index.d4f6ca.js 5.4 KB

1
  1. import{_ as M,d as G,x as _,w as K,W as P,r as h,o as n,G as x,D as i,m as N,a as V,l as E,c as B,F as S,E as I,L as U,M as k,aZ as f,bW as Q,bx as R,Q as Z,R as J,h as X}from"./index.js";import{e as Y}from"./index.4e61d38f.js";import{e as $}from"./execl-upload.7c83427b.js";import"./xlsx.ed122d16.js";const b=["\u6536\u6B3E\u65B9\u516C\u53F8\u7F16\u7801","\u6536\u6B3E\u65B9\u516C\u53F8\u540D\u79F0","\u6536\u6B3E\u65B9\u8D26\u6237","ND\u7F16\u53F7","\u5E73\u53F0\u8BA2\u5355\u7F16\u53F7","\u8BA2\u5355\u5BA2\u6237\u540D\u79F0","\u4EA4\u6613\u65F6\u95F4","\u6536\u5165\u91D1\u989D","\u8D26\u53F7\u4F59\u989D","\u4EA4\u6613\u884C\u540D","\u5BF9\u65B9\u8D26\u53F7","\u5BF9\u65B9\u6237\u540D","\u4EA4\u6613\u7528\u9014"],uu=["\u6536\u6B3E\u65B9\u516C\u53F8\u7F16\u7801","\u6536\u6B3E\u65B9\u8D26\u6237","\u4EA4\u6613\u65F6\u95F4","\u6536\u5165\u91D1\u989D","\u4EA4\u6613\u884C\u540D","\u5BF9\u65B9\u8D26\u53F7","\u5BF9\u65B9\u6237\u540D"],p=s=>"value"+b.findIndex(v=>v===s),eu=[p("\u6536\u6B3E\u65B9\u516C\u53F8\u7F16\u7801"),p("\u6536\u6B3E\u65B9\u8D26\u6237"),p("\u4EA4\u6613\u65F6\u95F4"),p("\u6536\u5165\u91D1\u989D"),p("\u4EA4\u6613\u884C\u540D"),p("\u5BF9\u65B9\u8D26\u53F7"),p("\u5BF9\u65B9\u6237\u540D")],au=()=>{const s=[{type:"index",width:"50",fixed:"left",label:"\u5E8F\u53F7"}];return b.forEach((v,m)=>{s.push({prop:"value"+m,label:v,minWidth:m===0||m===1?"120px":"90px"})}),s};const lu=s=>(Z("data-v-36931696"),s=s(),J(),s),tu={key:0},ou={key:1},su=lu(()=>X("span",{style:{color:"#f56c6c","font-size":"14px"}},"* ",-1)),nu={key:1,flex:"","justify-end":"","gap-2":"",style:{padding:"10px 0 0 0"}},ru=G({__name:"index",emits:["onSuccess"],setup(s,{expose:v,emit:m}){const D=_(!1),o=_(!1),e=_([]),W=au(),{logout:z}=K(),{currentCompany:H}=P(),y=_(!1),w=_([]),O=()=>{},j=({results:F,header:l})=>{if(o.value=!0,F.length===0){f.error("\u8868\u683C\u65E0\u6709\u6548\u6570\u636E\uFF01"),o.value=!1;return}let r=!0;if(l.length!==b.length?r=!1:b.forEach((a,t)=>{a!==l[t]&&(r=!1)}),!r){y.value=!0,w.value=[...l],o.value=!1;return}e.value=[];let c=!1;try{F.forEach(t=>{const u=Object.values(t);let d={};u.forEach((g,A)=>{d["value"+A]=g+""}),d.value6.indexOf("-")===-1&&(c=!0),e.value.push(d)}),o.value=!1;const a=[...new Set(e.value.map(({value0:t})=>t))];if(a.length!==1){f.warning("\u4E0A\u4F20\u6570\u636E\u7684\u6536\u6B3E\u65B9\u516C\u53F8\u5FC5\u987B\u4E3A\u540C\u4E00\u5BB6\u516C\u53F8"),e.value=[];return}if(a[0]!==H.value.companyNo){f.warning("\u4E0A\u4F20\u6570\u636E\u7684\u6536\u6B3E\u65B9\u516C\u53F8\u4E0E\u5F53\u524D\u9009\u4E2D\u7684\u4E1A\u52A1\u516C\u53F8\u4E0D\u4E00\u81F4"),e.value=[];return}if(c){e.value=[],f.error("\u4EA4\u6613\u65F6\u95F4\u683C\u5F0F\u9519\u8BEF,\u5E94\u4E3A:2020-01-01");return}}catch{f.error("\u5BFC\u5165\u6570\u636E\u62FC\u63A5\u6709\u8BEF\uFF01"),o.value=!1}},T={value0:"companyNo",value1:"trade_in",value2:"trade_in_account",value3:"NdCode",value4:"poCode",value5:"customerName",value6:"tradeTime",value7:"trade_fee",value8:"balance",value9:"trade_bank",value10:"trade_account",value11:"trade_out",value12:"trade_used"},q=async()=>{if(o.value)return;o.value=!0;let F=!0,l=[];if(e.value.forEach(a=>{let t={};for(let C in a)eu.includes(C)&&!a[C]&&(F=!1),t[T[C]]=a[C];const u={...t,trade_type:"0",trade_remark:""},{companyNo:d,trade_in:g,trade_fee:A}=u;u.trade_in_code=d,u.companyName=g,u.com_total=A,l.push(u)}),!F){Q({title:"\u5FC5\u586B\u5B57\u6BB5\u7F3A\u5931\uFF01",type:"error"}),o.value=!1;return}const{code:r,message:c}=await Y({data:l});R({code:r,message:c,logout:z,handler:()=>{o.value=!1,f.success("\u6570\u636E\u5BFC\u5165\u6210\u529F\uFF01"),m("onSuccess"),D.value=!1}})},L=()=>{e.value=[]};return v({onDisplay:()=>(D.value=!0,e.value=[])}),(F,l)=>{const r=h("el-table-column"),c=h("el-table"),a=h("el-button"),t=h("el-dialog");return n(),x(t,{"close-on-click-modal":!1,"close-on-press-escape":!1,modelValue:D.value,"onUpdate:modelValue":l[1]||(l[1]=u=>D.value=u),title:"\u5BFC\u5165\u5BA2\u6237\u4ED8\u6B3E\u8D44\u91D1\u6570\u636E",width:"1040px",top:"8vh",center:"",onClose:O},{default:i(()=>[e.value.length===0?(n(),x(N($),{key:0,onOnSuccess:j})):V("v-if",!0),E(c,{stripe:"",border:"",size:"small",data:e.value,"max-height":"500px",style:{width:"100%"}},{default:i(()=>[(n(!0),B(S,null,I(N(W),(u,d)=>(n(),x(r,{type:u.type,minWidth:u.minWidth,fixed:u.fixed,key:d,prop:u.prop,"show-overflow-tooltip":""},{header:i(()=>[!N(uu).includes(u.label)||u.label==="\u5E8F\u53F7"?(n(),B("span",tu,U(u.label),1)):(n(),B("p",ou,[su,k(" "+U(u.label),1)]))]),_:2},1032,["type","minWidth","fixed","prop"]))),128))]),_:1},8,["data"]),e.value.length!==0?(n(),B("div",nu,[E(a,{size:"small",onClick:L},{default:i(()=>[k("\u53D6\u6D88")]),_:1}),E(a,{size:"small",type:"primary",loading:o.value,onClick:q},{default:i(()=>[k("\u4FDD\u5B58")]),_:1},8,["loading"])])):V("v-if",!0),E(t,{modelValue:y.value,"onUpdate:modelValue":l[0]||(l[0]=u=>y.value=u),title:"\u5BFC\u5165\u6587\u4EF6\u8868\u5934\u4E0E\u6A21\u677F\u8868\u5934\u4E0D\u4E00\u81F4,\u5F53\u524D\u5BFC\u5165\u6587\u4EF6\u8868\u5934\u4E3A:","close-on-click-modal":!1,"close-on-press-escape":!1},{default:i(()=>[E(c,{border:"",size:"small"},{default:i(()=>[(n(!0),B(S,null,I(w.value,u=>(n(),x(r,{fit:"",label:u.indexOf("UNKNOWN")!==-1?"":u},null,8,["label"]))),256))]),_:1})]),_:1},8,["modelValue"])]),_:1},8,["modelValue"])}}});var Fu=M(ru,[["__scopeId","data-v-36931696"],["__file","C:/Users/89793/Desktop/projects/settle-vue3/src/views/InvoiceSales/capitalClaim/components/execl-files-upload-backup/index.vue"]]);export{Fu as default};