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