1 |
- import{_ as U,d as W,W as H,w as b,aU as O,r as f,o as s,G as D,C as _,l as d,a as A,j as F,c as h,F as R,D as q,M as x,L as B,J as L,aS as E,Q as M,R as P,h as T}from"./index.js";import{e as G}from"./execl-upload.282bc1ba.js";import{c as J}from"./index.fe638b6e.js";import"./xlsx.ed122d16.js";const k=["\u5546\u54C1\u7F16\u7801","\u5546\u54C1\u540D\u79F0","\u4E70\u5165\u65B9\u516C\u53F8\u7F16\u7801","\u4E70\u5165\u65B9\u516C\u53F8\u540D\u79F0","\u5356\u51FA\u65B9\u516C\u53F8\u7F16\u7801","\u5356\u51FA\u65B9\u516C\u53F8\u540D\u79F0","\u7A0E\u7387","\u7C7B\u76EE\u7F16\u7801","\u5F00\u7968\u5546\u54C1\u540D\u79F0"],C={value0:"spuCode",value1:"spuName",value2:"companyNo",value3:"companyName",value4:"suppplierNo",value5:"supplierName",value6:"tax",value7:"cat_code",value8:"inv_good_name"},Q=["spuCode","tax","cat_code"],K=()=>{const n=[{type:"index",width:"50",fixed:"left",label:"\u5E8F\u53F7"}];return k.forEach((g,m)=>{n.push({prop:"value"+m,label:g,minWidth:"120px"})}),n};const X=n=>(M("data-v-4b51de23"),n=n(),P(),n),Y={key:0,class:"flex"},Z={key:1},$={key:2},ee=X(()=>T("span",{style:{color:"#f56c6c","font-size":"14px"}},"* ",-1)),ue={key:1,flex:"","justify-end":"","gap-2":"",style:{padding:"10px 0 0 0"}},ae=W({__name:"index",emits:["onSuccess"],setup(n,{expose:g,emit:m}){const S=H(),y=b(!1),t=b(!1),u=b([]),N=K(),I=O(),V=({results:i,header:r})=>{if(t.value=!0,i.length===0){E.error("\u8868\u683C\u65E0\u6709\u6548\u6570\u636E\uFF01"),t.value=!1;return}let o=!0;if(r.length!==k.length?o=!1:k.forEach((a,l)=>{a!==r[l]&&(o=!1)}),!o){E.error("\u8868\u5934\u4E0E\u5BFC\u5165\u6A21\u677F\u4E0D\u5339\u914D\uFF01"),t.value=!1;return}u.value=[];try{for(const l of i){const c=Object.values(l);let p={};c.forEach((e,v)=>{const w="value"+v;p[w]=e+"";const te=C[w]}),u.value.push(p)}const a=[...new Set(u.value.map(({value5:l})=>l))];if(a.length!==1){E.error("\u4E0A\u4F20\u7684\u5356\u51FA\u65B9\u516C\u53F8\u5FC5\u987B\u4E00\u81F4"),u.value=[];return}else if(a[0]!==S.currentCompany.value.companyName){E.error("\u4E0A\u4F20\u7684\u5356\u51FA\u65B9\u516C\u53F8\u4E0E\u5F53\u524D\u9009\u62E9\u516C\u53F8\u5FC5\u987B\u4E00\u81F4"),u.value=[],t.value=!1;return}t.value=!1}catch(a){return a}},j=async()=>{if(t.value)return;t.value=!0;const i=[];u.value.forEach((a,l)=>{const c={};Object.keys(a).forEach(p=>{const e=C[p],v=a[p];switch(e){case"tax":c[e]=v*100+"%";break;default:c[e]=v;break}}),i.push(c)});const{code:r,message:o}=await J({list:i,status:"1"});t.value=!1,I({code:r,message:o,handler:()=>{E.success("\u6570\u636E\u5BFC\u5165\u6210\u529F\uFF01"),m("onSuccess"),y.value=!1}})},z=()=>{u.value=[]};return g({onDisplay:()=>(y.value=!0,u.value=[])}),(i,r)=>{const o=f("el-button"),a=f("el-popover"),l=f("el-table-column"),c=f("el-table"),p=f("el-dialog");return s(),D(p,{modelValue:y.value,"onUpdate:modelValue":r[0]||(r[0]=e=>y.value=e),title:"\u6279\u91CF\u5BFC\u5165\u91C7\u8D2D\u8BBE\u7F6E\u6A21\u677F\u7ED3\u679C",width:"1040px",top:"8vh",center:""},{default:_(()=>[u.value.length===0?(s(),D(d(G),{key:0,onOnSuccess:V})):A("v-if",!0),F(c,{data:u.value,stripe:"",border:"","max-height":"500px",size:"small",style:{width:"100%"}},{default:_(()=>[(s(!0),h(R,null,q(d(N),(e,v)=>(s(),D(l,{type:e.type,minWidth:e.minWidth,fixed:e.fixed,key:v,prop:e.prop,"show-overflow-tooltip":""},{header:_(()=>[d(C)[e.prop]==="inv_tag"||d(C)[e.prop]==="addTax"?(s(),h("p",Y,[x(B(e.label)+" ",1),F(a,{placement:"top-start",title:"\u9009\u9879",width:200,trigger:"hover",content:"\u514D\u7A0E\u3001\u4E0D\u5F81\u7A0E\u3001\u96F6\u7A0E\u7387"},{reference:_(()=>[F(o,{link:"",size:"small",icon:d(L)("question-filled")},null,8,["icon"])]),_:1})])):!d(Q).includes(d(C)[e.prop])||e.label==="\u5E8F\u53F7"?(s(),h("span",Z,B(e.label),1)):(s(),h("p",$,[ee,x(" "+B(e.label),1)]))]),_:2},1032,["type","minWidth","fixed","prop"]))),128))]),_:1},8,["data"]),u.value.length!==0?(s(),h("div",ue,[F(o,{size:"small",onClick:z},{default:_(()=>[x("\u53D6\u6D88")]),_:1}),F(o,{size:"small",type:"primary",loading:t.value,onClick:j},{default:_(()=>[x("\u4FDD\u5B58")]),_:1},8,["loading"])])):A("v-if",!0)]),_:1},8,["modelValue"])}}});var re=U(ae,[["__scopeId","data-v-4b51de23"],["__file","C:/Users/63107/Desktop/projects/settle-vue3/src/views/supplyInvoiceSaleSettings/_component/procure-import/index.vue"]]);export{re as default};
|