index.97429c.js 6.3 KB

1
  1. import{_ as G,d as J,W as P,x as S,aO as Q,r as B,o as p,G as N,D as v,m as _,a as U,l as h,c as g,F as K,E as X,M as y,L as j,J as Y,aZ as i,Q as $,R as uu,h as eu}from"./index.js";import{e as au}from"./execl-upload.7c83427b.js";import{b as tu}from"./index.24943c38.js";import"./xlsx.ed122d16.js";const T=["\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"],D={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"},ou=["spuCode","tax","cat_code","inv_good_name","is_discount"],su=()=>{const r=[{type:"index",width:"50",fixed:"left",label:"\u5E8F\u53F7"}];return T.forEach((b,E)=>{r.push({prop:"value"+E,label:b,minWidth:E===0||E===1?"120px":"135px"})}),r};const lu=r=>($("data-v-06c9e7e8"),r=r(),uu(),r),nu={key:0,class:"flex"},cu={key:1},ru={key:2},pu=lu(()=>eu("span",{style:{color:"#f56c6c","font-size":"14px"}},"* ",-1)),iu={key:1,flex:"","justify-end":"","gap-2":"",style:{padding:"10px 0 0 0"}},du=J({__name:"index",props:{isZx:{type:String,required:!0,default:"1"}},emits:["onSuccess"],setup(r,{expose:b,emit:E}){const W=r,H=P(),x=S(!1),a=S(!1),t=S([]),O=su(),k={\u514D\u7A0E:"1",\u4E0D\u5F81\u7A0E:"2",\u96F6\u7A0E\u7387:"3"},V={\u662F:"1",\u5426:"0"},q=Q();let A=!1;const M=({results:F,header:n})=>{if(a.value=!0,A=!1,F.length===0){i.error("\u8868\u683C\u65E0\u6709\u6548\u6570\u636E\uFF01"),a.value=!1;return}let o=!0;if(n.length!==T.length?o=!1:T.forEach((s,c)=>{s!==n[c]&&(o=!1)}),!o){i.error("\u8868\u5934\u4E0E\u5BFC\u5165\u6A21\u677F\u4E0D\u5339\u914D\uFF01"),a.value=!1;return}t.value=[];try{for(const c of F){const f=Object.values(c);let e={};f.forEach((u,l)=>{const d="value"+l;switch(e[d]=u+"",D[d]){case"inv_tag":u+""&&!k[u+""]&&(A=!0,e[d]="");break;case"is_discount":u+""&&!V[u+""]&&(A=!0,e[d]="");break}}),t.value.push(e)}const s=[...new Set(t.value.map(({value5:c})=>c))];if(s.length!==1){i.error("\u4E0A\u4F20\u7684\u5356\u51FA\u65B9\u516C\u53F8\u5FC5\u987B\u4E00\u81F4"),t.value=[];return}else if(s[0]!==H.currentCompany.value.companyName){i.error("\u4E0A\u4F20\u7684\u5356\u51FA\u65B9\u516C\u53F8\u4E0E\u5F53\u524D\u9009\u62E9\u516C\u53F8\u5FC5\u987B\u4E00\u81F4"),t.value=[],a.value=!1;return}a.value=!1}catch(s){return s}},R=async()=>{if(a.value)return;a.value=!0;const F=[],n=[],o=[];if(t.value.forEach((e,u)=>{const l={};Object.keys(e).forEach(z=>{const C=D[z],m=e[z];switch(C){case"tax":l[C]=m*100+"%";break;case"is_discount":l[C]=V[m];break;case"inv_tag":l[C]=m?k[m]:"0";break;default:l[C]=m;break}});const{tax:d,is_discount:w,addTax:I,inv_tag:Z}=l;d==="0%"&&w==="1"&&(!I||k[I]!==Z)&&n.push(u+1),d==="0%"&&w==="0"&&Z!=="3"&&o.push(u+1),F.push(l)}),A){i.warning("\u4E0A\u4F20\u90E8\u5206\u5B57\u6BB5\u89E3\u6790\u4E0D\u6210\u529F,\u8BF7\u6838\u5BF9\u540E\u91CD\u8BD5."),a.value=!1;return}if(n.length>0){i.warning("\u7B2C"+n.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"),a.value=!1;return}if(o.length>0){i.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'"),a.value=!1;return}const s=F.map(e=>({addTax:e.addTax,inv_good_name:e.inv_good_name,inv_tag:e.inv_tag,is_discount:e.is_discount,spuCode:e.spuCode,tax:e.tax,cat_code:e.cat_code})),{code:c,message:f}=await tu({list:s,status:"2",isZx:W.isZx});a.value=!1,q({code:c,message:f,handler:()=>{i.success("\u6570\u636E\u5BFC\u5165\u6210\u529F\uFF01"),E("onSuccess"),x.value=!1}})},L=()=>{t.value=[]};return b({onDisplay:()=>(x.value=!0,t.value=[])}),(F,n)=>{const o=B("el-button"),s=B("el-popover"),c=B("el-table-column"),f=B("el-table"),e=B("el-dialog");return p(),N(e,{modelValue:x.value,"onUpdate:modelValue":n[0]||(n[0]=u=>x.value=u),title:"\u6279\u91CF\u5BFC\u5165\u8D22\u52A1\u8BBE\u7F6E\u6A21\u677F\u7ED3\u679C",width:"1040px",top:"8vh",center:"","close-on-click-modal":!1,"close-on-press-escape":!1},{default:v(()=>[t.value.length===0?(p(),N(_(au),{key:0,onOnSuccess:M})):U("v-if",!0),h(f,{data:t.value,stripe:"",border:"","max-height":"500px",size:"small",style:{width:"100%"}},{default:v(()=>[(p(!0),g(K,null,X(_(O),(u,l)=>(p(),N(c,{type:u.type,minWidth:u.minWidth,fixed:u.fixed,key:l,prop:u.prop,"show-overflow-tooltip":""},{header:v(()=>[_(D)[u.prop]==="inv_tag"||_(D)[u.prop]==="addTax"?(p(),g("p",nu,[y(j(u.label)+" ",1),h(s,{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:_(Y)("question-filled")},null,8,["icon"])]),_:1})])):!_(ou).includes(_(D)[u.prop])||u.label==="\u5E8F\u53F7"?(p(),g("span",cu,j(u.label),1)):(p(),g("p",ru,[pu,y(" "+j(u.label),1)]))]),_:2},1032,["type","minWidth","fixed","prop"]))),128))]),_:1},8,["data"]),t.value.length!==0?(p(),g("div",iu,[h(o,{size:"small",onClick:L},{default:v(()=>[y("\u53D6\u6D88")]),_:1}),h(o,{size:"small",type:"primary",loading:a.value,onClick:R},{default:v(()=>[y("\u4FDD\u5B58")]),_:1},8,["loading"])])):U("v-if",!0)]),_:1},8,["modelValue"])}}});var fu=G(du,[["__scopeId","data-v-06c9e7e8"],["__file","C:/Users/89793/Desktop/projects/settle-vue3/src/views/supplyInvoiceSaleSettings/_component/execl-files-upload/index.vue"]]);export{fu as default};