index.58cc7a.js 6.5 KB

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