1 |
- import{_ as L,d as Z,w,aO as G,r as m,o as r,G as S,C as v,u as p,a as H,l as h,c as B,F as J,D as P,M as A,L as N,J as Q,aY as E,Q as Y,R as K,b as X}from"./index.fd765376.js";import{e as $}from"./execl-upload.491b2dd2.js";import{c as uu}from"./index.a71cd8eb.js";import"./xlsx.ed122d16.js";const j=["\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","\u91C7\u8D2D\u7A0E\u7387","\u91C7\u8D2D\u7C7B\u76EE\u7F16\u7801","\u91C7\u8D2D\u7C7B\u76EE\u540D\u79F0","\u91C7\u8D2D\u5F00\u7968\u5546\u54C1\u540D\u79F0","\u8D22\u52A1\u7A0E\u7387","\u8D22\u52A1\u7C7B\u76EE\u7F16\u7801","\u8D22\u52A1\u7C7B\u76EE\u540D\u79F0","\u8D22\u52A1\u5F00\u7968\u5546\u54C1\u540D\u79F0","\u7A0E\u7387\u6807\u8BC6","\u662F\u5426\u6709\u4F18\u60E0\u653F\u7B56","\u589E\u503C\u7A0E\u7BA1\u7406\u5185\u5BB9"],g={value0:"spuCode",value1:"spuName",value2:"buyerCompanyCode",value3:"buyerCompanyName",value4:"sellerCompanyCode",value5:"sellerCompanyName",value6:"cg_tax",value7:"cg_cat_code",value8:"cg_cat_name",value9:"cg_inv_good_name",value10:"tax",value11:"cat_code",value12:"cat_name",value13:"inv_good_name",value14:"inv_tag",value15:"is_discount",value16:"addTax"},eu=["spuCode","tax","cat_code","inv_good_name","is_discount"],au=()=>{const i=[{type:"index",width:"50",fixed:"left",label:"\u5E8F\u53F7"}];return j.forEach((b,F)=>{i.push({prop:"value"+F,label:b,minWidth:F===0||F===1?"120px":"135px"})}),i};const tu=i=>(Y("data-v-7261064a"),i=i(),K(),i),ou={key:0,class:"flex"},su={key:1},lu={key:2},nu=tu(()=>X("span",{style:{color:"#f56c6c","font-size":"14px"}},"* ",-1)),cu={key:1,flex:"","justify-end":"","gap-2":"",style:{padding:"10px 0 0 0"}},ru=Z({__name:"index",emits:["onSuccess"],setup(i,{expose:b,emit:F}){const D=w(!1),t=w(!1),n=w([]),O=au(),y={\u514D\u7A0E:"1",\u4E0D\u5F81\u7A0E:"2",\u96F6\u7A0E\u7387:"3"},T={\u662F:"1",\u5426:"0"},W=G();let x=!1;const M=({results:_,header:s})=>{if(t.value=!0,x=!1,_.length===0){E.error("\u8868\u683C\u65E0\u6709\u6548\u6570\u636E\uFF01"),t.value=!1;return}let o=!0;if(s.length!==j.length?o=!1:j.forEach((l,d)=>{l!==s[d]&&(o=!1)}),!o){E.error("\u8868\u5934\u4E0E\u5BFC\u5165\u6A21\u677F\u4E0D\u5339\u914D\uFF01"),t.value=!1;return}n.value=[];try{for(const l of _){const d=Object.values(l);let c={};d.forEach((u,e)=>{const a="value"+e;switch(c[a]=u+"",g[a]){case"inv_tag":u+""&&!y[u+""]&&(x=!0,c[a]="");break;case"is_discount":u+""&&!T[u+""]&&(x=!0,c[a]="");break}}),n.value.push(c)}t.value=!1}catch(l){return l}},R=async()=>{if(t.value)return;t.value=!0;const _=[],s=[],o=[];if(n.value.forEach((u,e)=>{const a={};Object.keys(u).forEach(U=>{const f=g[U],C=u[U];switch(f){case"tax":a[f]=C*100+"%";break;case"is_discount":a[f]=T[C];break;case"inv_tag":a[f]=C?y[C]:"0";break;default:a[f]=C;break}});const{tax:k,is_discount:V,addTax:I,inv_tag:z}=a;k==="0%"&&V==="1"&&(!I||y[I]!==z)&&s.push(e+1),k==="0%"&&V==="0"&&z!=="3"&&o.push(e+1),_.push(a)}),x){E.warning("\u4E0A\u4F20\u90E8\u5206\u5B57\u6BB5\u89E3\u6790\u4E0D\u6210\u529F,\u8BF7\u6838\u5BF9\u540E\u91CD\u8BD5."),t.value=!1;return}if(s.length>0){E.warning("\u7B2C"+s.join(",")+"\u884C\u6570\u636E\u586B\u5199\u9519\u8BEF,\u7A0E\u7387\u4E3A0\u4E14\u662F\u5426\u6709\u4F18\u60E0\u653F\u7B56\u4E3A\u662F\u65F6,\u589E\u503C\u7A0E\u548C\u6C47\u7387\u6807\u8BC6\u662F\u5FC5\u586B\u9879\uFF0C\u4E14\u589E\u503C\u7A0E\u7BA1\u7406\u5185\u5BB9\u8981\u548C\u6C47\u7387\u6807\u8BC6\u4E00\u81F4"),t.value=!1;return}if(o.length>0){E.warning("\u7B2C"+o.join(",")+"\u884C\u6570\u636E\u586B\u5199\u9519\u8BEF,\u7A0E\u7387\u4E3A0\u4E14\u662F\u5426\u6709\u4F18\u60E0\u653F\u7B56\u4E3A\u5426\u65F6,\u7A0E\u7387\u6807\u8BC6\u503C\u5FC5\u987B\u4E3A:'\u96F6\u7A0E\u7387'"),t.value=!1;return}const l=_.map(u=>({addTax:u.addTax,inv_good_name:u.inv_good_name,inv_tag:u.inv_tag,is_discount:u.is_discount,spuCode:u.spuCode,tax:u.tax,cat_code:u.cat_code})),{code:d,message:c}=await uu({list:l,status:"2"});t.value=!1,W({code:d,message:c,handler:()=>{E.success("\u6570\u636E\u5BFC\u5165\u6210\u529F\uFF01"),F("onSuccess"),D.value=!1}})},q=()=>{n.value=[]};return b({onDisplay:()=>(D.value=!0,n.value=[])}),(_,s)=>{const o=m("el-button"),l=m("el-popover"),d=m("el-table-column"),c=m("el-table"),u=m("el-dialog");return r(),S(u,{modelValue:D.value,"onUpdate:modelValue":s[0]||(s[0]=e=>D.value=e),title:"\u6279\u91CF\u5BFC\u5165\u8D22\u52A1\u8BBE\u7F6E\u7C7B\u76EE\u7ED3\u679C",width:"1040px",top:"8vh",center:""},{default:v(()=>[n.value.length===0?(r(),S(p($),{key:0,onOnSuccess:M})):H("v-if",!0),h(c,{data:n.value,stripe:"",border:"","max-height":"500px",size:"small",style:{width:"100%"}},{default:v(()=>[(r(!0),B(J,null,P(p(O),(e,a)=>(r(),S(d,{type:e.type,minWidth:e.minWidth,fixed:e.fixed,key:a,prop:e.prop,"show-overflow-tooltip":""},{header:v(()=>[p(g)[e.prop]==="inv_tag"||p(g)[e.prop]==="addTax"?(r(),B("p",ou,[A(N(e.label)+" ",1),h(l,{placement:"top-start",title:"\u9009\u9879",width:200,trigger:"hover",content:"\u514D\u7A0E\u3001\u4E0D\u5F81\u7A0E\u3001\u96F6\u7A0E\u7387"},{reference:v(()=>[h(o,{link:"",size:"small",icon:p(Q)("question-filled")},null,8,["icon"])]),_:1})])):!p(eu).includes(p(g)[e.prop])||e.label==="\u5E8F\u53F7"?(r(),B("span",su,N(e.label),1)):(r(),B("p",lu,[nu,A(" "+N(e.label),1)]))]),_:2},1032,["type","minWidth","fixed","prop"]))),128))]),_:1},8,["data"]),n.value.length!==0?(r(),B("div",cu,[h(o,{size:"small",onClick:q},{default:v(()=>[A("\u53D6\u6D88")]),_:1}),h(o,{size:"small",type:"primary",loading:t.value,onClick:R},{default:v(()=>[A("\u4FDD\u5B58")]),_:1},8,["loading"])])):H("v-if",!0)]),_:1},8,["modelValue"])}}});var vu=L(ru,[["__scopeId","data-v-7261064a"],["__file","C:/Users/63107/Desktop/projects/accout-vue3-ui/src/views/InvoiceSaleSettings/_component/execl-files-upload/index.vue"]]);export{vu as default};
|