1 |
- import{_ as j,d as z,w as b,aO as O,r as m,o as s,G as g,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.fd765376.js";import{e as M}from"./execl-upload.491b2dd2.js";import{c as P}from"./index.a71cd8eb.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((C,f)=>{n.push({prop:"value"+f,label:C,minWidth:"120px"})}),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"}},$=z({__name:"index",emits:["onSuccess"],setup(n,{expose:C,emit:f}){const E=b(!1),a=b(!1),o=b([]),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"),E.value=!1}})},V=()=>{o.value=[]};return C({onDisplay:()=>(E.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(),g(_,{modelValue:E.value,"onUpdate:modelValue":c[0]||(c[0]=e=>E.value=e),title:"\u6279\u91CF\u5BFC\u5165\u91C7\u8D2D\u8BBE\u7F6E\u6A21\u677F\u7ED3\u679C",width:"1040px",top:"8vh",center:""},{default:v(()=>[o.value.length===0?(s(),g(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(),g(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-4b51de23"],["__file","C:/Users/63107/Desktop/projects/accout-vue3-ui/src/views/supplyInvoiceSaleSettings/_component/procure-import/index.vue"]]);export{le as default};
|