1 |
- var L=Object.defineProperty;var $=(n,t,e)=>t in n?L(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e;var h=(n,t,e)=>($(n,typeof t!="symbol"?t+"":t,e),e);import{_ as U,P as z}from"./page-content.e0c7af12.js";import{u as j}from"./use-page-search.0f272301.js";import{O as v,a as O}from"./status.2b37e8be.js";import{c as y,r as B,a as M}from"./column-helper.64ceba17.js";import{b as V}from"./exchangeOrder.1c840d9f.js";import{u as C,w as X,_ as Y}from"./index.vue_vue_type_script_setup_true_lang.a47d1543.js";import{bc as R,bd as b,aA as W,be as G,al as J,an as K,a as Q,r as _,b as E,c as g,j as x,h as f,f as m,u as i,x as A,l as D}from"./index.4d061c66.js";import{u as Z}from"./usePermission.8064505c.js";import{_ as H}from"./edit-dialog.vue_vue_type_script_setup_true_lang.676abad5.js";import"./remote-select.36ee67a3.js";import"./useAsync.df7387ce.js";import"./useNav.5e73c372.js";import"./image.e35d846c.js";import"./hooks.9f8f44e2.js";/* empty css */import"./image.4c97dbe3.js";/* empty css */import"./index.e63aea62.js";import"./responseHandle.fe68d5aa.js";import"./btnList.6c44b4ef.js";import"./goodDetail.config.df7d45a7.js";import"./good.75e37e88.js";import"./userDetail.config.0ab63777.js";import"./user.0ff210bc.js";const ee={formItems:[{field:"timer",type:"date_picker",otherOptions:{type:"daterange",startProp:"start_date",endProp:"end_date",startPlaceholder:"\u5F00\u59CB\u65F6\u95F4",endPlaceholder:"\u7ED3\u675F\u65F6\u95F4"}},{field:"status",type:"select",placeholder:"\u8BA2\u5355\u72B6\u6001",options:y(v)},{field:"type",type:"select",placeholder:"\u8BA2\u5355\u7C7B\u578B",options:y(O,"type")},{field:"name",type:"input",placeholder:"\u5BA2\u6237\u540D\u79F0"},{field:"username",type:"input",placeholder:"\u7528\u6237\u5361\u53F7"}]},P=ee,te=[{prop:"orderCode",label:"\u8BA2\u5355\u7F16\u53F7",width:"180px"},{prop:"status",label:"\u72B6\u6001",width:"90px",...B(v)},{prop:"type",label:"\u7C7B\u578B",width:"100px",...B(O,"type")},{prop:"company_title",label:"\u4F01\u4E1A\u540D\u79F0",width:"150px"},{prop:"card_title",label:"\u5361\u7C7B\u578B",width:"100px"},{prop:"username",label:"\u8D26\u53F7/\u5361\u53F7",width:"100px"},{prop:"good_code",label:"\u5546\u54C1\u7F16\u7801",width:"100px"},{prop:"good_cover_img",label:"\u56FE\u7247",width:"100px",...M("good_cover_img")},{prop:"good_name",label:"\u5546\u54C1\u540D\u79F0",width:"100px"},{prop:"num",label:"\u6570\u91CF",width:"110px"},{prop:"contactor",label:"\u6536\u8D27\u8054\u7CFB\u4EBA",width:"160px"},{prop:"mobile",label:"\u8054\u7CFB\u7535\u8BDD",width:"160px"},{prop:"addr_name",label:"\u6536\u8D27\u7701\u5E02\u533A",width:"160px"},{prop:"addr",label:"\u8BE6\u7EC6\u5730\u5740",width:"160px"},{prop:"post_name",label:"\u7269\u6D41\u516C\u53F8",width:"160px"},{prop:"post_code",label:"\u7269\u6D41\u5355\u53F7",width:"160px"},{prop:"addtime",label:"\u8D2D\u4E70\u65F6\u95F4",width:"140px"},{label:"\u64CD\u4F5C",fixed:"right",width:40,slot:"operation"}],oe={title:"\u8BA2\u5355\u7BA1\u7406",columns:te,showExpand:n=>n.child.length>0,apis:{httpList:V},notPreview:!1},ne=oe,re={baseURL:"",timeout:1e4,headers:{Accept:"aplication/zip"},responseType:"blob",paramsSerializer:n=>G.stringify(n,{indices:!1})},l=class{constructor(){this.httpInterceptorsRequest(),this.httpInterceptorsResponse()}httpInterceptorsRequest(){l.axiosInstance.interceptors.request.use(t=>{const e=t;if(b.start(),typeof t.beforeRequestCallback=="function")return t.beforeRequestCallback(e),e;if(l.initConfig.beforeRequestCallback)return l.initConfig.beforeRequestCallback(e),e;const o=W();return o&&(t.data.token=o),e},t=>Promise.reject(t))}httpInterceptorsResponse(){l.axiosInstance.interceptors.response.use(e=>{const o=e.config;return b.done(),typeof o.beforeResponseCallback=="function"?(o.beforeResponseCallback(e),e.data):(l.initConfig.beforeResponseCallback&&l.initConfig.beforeResponseCallback(e),e.data)},e=>{const o=e;return o.isCancelRequest=R.isCancel(o),b.done(),Promise.reject(o)})}request(t,e,o,a){const r={method:t,url:e,...o,...a};return new Promise((u,p)=>{l.axiosInstance.request(r).then(s=>{u(s)}).catch(s=>{p(s)})})}post(t,e,o){return this.request("post",t,e,o)}get(t,e,o){return this.request("get",t,e,o)}};let d=l;h(d,"initConfig",{}),h(d,"axiosInstance",R.create(re));const ae=new d,{VITE_PROXY_DOMAIN_REAL:ue}=J(),se=(n,t)=>ae.request("post",`${ue}admin/${n}`,{data:t,responseType:"blob"}),ie=[{key:"zip",value:"aplication/zip",fileName:"zip"},{key:"excel",value:"application/vnd.ms-excel",fileName:"xlsx"}],pe=["\u5E8F\u53F7","\u64CD\u4F5C"];function le(n){const{data:t,columns:e,name:o}=n;if(!t||!e)return;if(t.length===0)return K.warning("\u8BF7\u6253\u5F00\u52FE\u9009\u5217\u5E76\u52FE\u9009\u5BFC\u51FA\u6570\u636E");const a=de({data:t,columns:e}),r=e.map(({label:s})=>s).filter(s=>s&&!pe.includes(s));a.unshift(r);const u=C.book_new(),p=C.aoa_to_sheet(a);C.book_append_sheet(u,p,"sheet1"),X(u,o+".xlsx")}async function ce(n){if(!n.url)return;n.httpType||(n.httpType="zip");const{value:t,fileName:e}=ie.find(u=>u.key===n.httpType)||{},o=await se(n.url,{data:n.params}),a=window.URL.createObjectURL(new Blob([o],{type:t})),r=document.createElement("a");r.style.display="none",r.href=a,r.setAttribute("download",n.name+"."+e),document.body.appendChild(r),r.click(),r.remove(),window.URL.revokeObjectURL(a)}function de({data:n,columns:t}){return n.map(e=>{const o=[];for(let a=0;a<t.length;a++){const{prop:r,transform:u}=t[a];if(!r)continue;const p=u?u(e[r]):e[r];o.push(p)}return o})}function fe({type:n,url:t,columns:e,data:o,name:a,params:r,httpType:u}){const p=a||"\u5BFC\u51FA\u6570\u636E";switch(n){case"front":le({data:o,columns:e,name:p});break;case"http":ce({url:t,name:p,params:r,httpType:u});break}}const Ue=Q({__name:"index",setup(n){const t="exchangeOrder",{pageContentRef:e,handleResetClick:o,handleSearchClick:a,getMergeParams:r}=j(void 0,void 0,P),{hasPermissionWithCode:u,permissions:p}=Z(t),s=_(null),F=_(null);function q(){fe({type:"http",url:"orderExport",params:r(),name:"\u8BA2\u5355\u5BFC\u51FA"})}return(me,c)=>{const w=E("el-button"),I=E("PageAuth");return g(),x(I,{pageName:t},{default:f(()=>[m(i(U),{"form-config":i(P),onSearchBtnClick:i(a),onResetBtnClick:i(o)},{action:f(()=>[i(u)("019")?(g(),x(w,{key:0,onClick:q},{default:f(()=>[A("\u5BFC\u51FA\u8BA2\u5355")]),_:1})):D("",!0),i(u)("017")?(g(),x(w,{key:1,type:"primary",onClick:c[0]||(c[0]=()=>F.value.onDisplay())},{default:f(()=>[A("\u6279\u91CF\u53D1\u8D27 ")]),_:1})):D("",!0)]),_:1},8,["form-config","onSearchBtnClick","onResetBtnClick"]),m(i(z),{ref_key:"pageContentRef",ref:e,powers:i(p),"content-config":i(ne),onPreviewBtnClick:c[1]||(c[1]=({id:k,account_id:S,good_id:N,type:T})=>s.value.show({id:k,account_id:S,good_id:N,type:T}))},null,8,["powers","content-config"]),m(Y,{ref_key:"execlUploadRef",ref:F,onOnSuccess:i(o)},null,8,["onOnSuccess"]),m(H,{ref_key:"modelEditRef",ref:s,onReload:c[2]||(c[2]=k=>i(e).onSearch())},null,512)]),_:1})}}});export{Ue as default};
|