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