You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

1 lines
6.1 KiB

import{d as ve,e as l,o as g,p as E,f as i,g as e,b as o,n,a,w as me,i as x,c as fe,X as xe,a9 as _e,aa as ye,_ as be,V as he,U as Ie,a6 as we,ab as ge,x as Ve,B as Se,Q as qe,R as De,__tla as Be}from"./index-69b9c98d.js";import{_ as Fe,__tla as ze}from"./Dialog.vue_vue_type_style_index_0_lang-f2babf52.js";import{d as Ue}from"./download-20922b56.js";import{u as ke,__tla as Ce}from"./useMessage-0b4356a5.js";import{_ as Pe}from"./_plugin-vue_export-helper-1b428a4d.js";let G,Oe=Promise.all([(()=>{try{return Be}catch{}})(),(()=>{try{return ze}catch{}})(),(()=>{try{return Ce}catch{}})()]).then(async()=>{let p,V,S,q,D,B,F,z,U,k,C,P,O,T,R,j,A,H,L;p=c=>(qe("data-v-24974a05"),c=c(),De(),c),V=p(()=>e("div",{class:"el-upload__text"},[n("\u5C06\u6587\u4EF6\u62D6\u5230\u6B64\u5904\uFF0C\u6216"),e("em",null,"\u70B9\u51FB\u4E0A\u4F20")],-1)),S={class:"el-upload__tip ml--126px mr--80px"},q={class:"flex"},D=p(()=>e("div",{class:"label h-32px mr-26px color-#acaeb3 font-size-14px w-100px text-right",style:{"line-height":"32px"}},"\u5BFC\u5165\u6A21\u5F0F",-1)),B={class:""},F={class:"radio"},z=p(()=>e("div",{class:"tips color-#acaeb3 font-size-14px"},[e("div",{class:"mt-2"},"\u66F4\u65B0\uFF1A\u65B0\u589E\u5E76\u4FEE\u6539"),e("div",{class:"mt-2"},"\u8FFD\u52A0\uFF1A\u53EA\u65B0\u589E\uFF0C\u4E0D\u4FEE\u6539"),e("div",{class:"mt-2"},"\u8986\u76D6\uFF1A\u53EA\u4FEE\u6539\u4E0D\u65B0\u589E")],-1)),U={class:"flex mt-16px"},k=p(()=>e("div",{class:"label h-32px mr-26px color-#acaeb3 font-size-14px w-100px text-right",style:{"line-height":"32px"}},"\u90E8\u5206\u4FDD\u5B58",-1)),C={class:""},P={class:"switch"},O=p(()=>e("div",{class:"tips color-#acaeb3 font-size-14px"},[e("div",{class:"mt-2"},"\u90E8\u5206\u4FDD\u5B58\uFF1A\u5982\u5B58\u5728\u9519\u8BEF\u6570\u636E\uFF0C\u6B63\u786E\u6570\u636E\u6B63\u5E38\u5BFC\u5165"),e("div",{class:"mt-2"},"\u5168\u90E8\u4FDD\u5B58\uFF1A\u5168\u90E8\u6570\u636E\u6B63\u786E\uFF0C\u624D\u80FD\u5BFC\u5165")],-1)),T={key:0,class:"flex mt-16px"},R=p(()=>e("div",{class:"label h-32px mr-26px color-#acaeb3 font-size-14px w-100px text-right",style:{"line-height":"32px"}},"\u662F\u5426\u5916\u90E8\u8D44\u6E90",-1)),j={class:""},A={class:"switch"},H={class:"flex items-center"},L={class:"flex-1 text-left"},G=Pe(ve({name:"ImportForm",__name:"ImportForm",props:{importTemplateData:{type:Object,required:!0},accept:{type:String,required:!1,default:".xlsx,.xls"},mode:{type:Number,required:!1,default:1},updateIsDisable:{type:Boolean,required:!1,default:!1},appendIsDisable:{type:Boolean,required:!1,default:!1},coverIsDisable:{type:Boolean,required:!1,default:!1},updatePart:{type:Boolean,required:!1,default:!1},url:{type:String,required:!1},isShowOut:{type:Boolean,required:!1,default:!1},outFile:{type:Boolean,required:!1,default:!1},fromInventoryStatus:{type:String,required:!1,default:""},toInventoryStatus:{type:String,required:!1,default:""}},emits:["success"],setup(c,{expose:J,emit:K}){const v=ke(),m=l(!1),r=l(!1),_=l(),N=l(),f=l([]),Q=l(""),u=c,X=l(u.importTemplateData),M=l(u.accept),y=l(u.mode),W=l(u.updateIsDisable),Y=l(u.appendIsDisable),ee=l(u.coverIsDisable),b=l(u.updatePart),h=l(u.outFile),ae="http://dev.ccwin-in.com:25200/api/admin-api"+u.url;J({open:()=>{m.value=!0,oe()}});const le=async()=>{f.value.length!=0?(Q.value=f.value[0].name,N.value={Authorization:"Bearer "+_e(),"tenant-id":ye()},r.value=!0,_.value.submit()):v.error("\u8BF7\u4E0A\u4F20\u6587\u4EF6")},te=K,se=s=>{if(r.value=!0,s){if(s.code==500)return _.value.clearFiles(),v.error("\u5BFC\u5165\u5931\u8D25"),void(r.value=!1);s.code==0&&(s.data.errorCount>0?v.confirm("\u6587\u4EF6\u4E2D\u6709\u90E8\u5206\u6570\u636E\u5BFC\u5165\u5931\u8D25\uFF0C\u662F\u5426\u4E0B\u8F7D\u5931\u8D25\u6570\u636E\uFF1F").then(()=>{window.open("http://dev.ccwin-in.com:25200/api/admin-api"+s.data.errorFile,"222")}):v.success("\u5BFC\u5165\u6210\u529F"))}r.value=!1,te("success"),m.value=!1},ie=()=>{v.error("\u4E0A\u4F20\u5931\u8D25\uFF0C\u8BF7\u60A8\u91CD\u65B0\u4E0A\u4F20\uFF01"),r.value=!1},oe=()=>{var s;r.value=!1,(s=_.value)==null||s.clearFiles(),f.value=[]},de=()=>{v.error("\u6700\u591A\u53EA\u80FD\u4E0A\u4F20\u4E00\u4E2A\u6587\u4EF6\uFF01")},re=()=>{const s=X.value.templateUrl;Ue.excel(s,X.value.templateTitle)};return(s,t)=>{const Z=be,I=he,ue=Ie,$=we,ce=ge,w=Ve,pe=Fe,ne=Se;return g(),E(pe,{modelValue:a(m),"onUpdate:modelValue":t[5]||(t[5]=d=>x(m)?m.value=d:null),title:"\u5BFC\u5165",width:"600","close-on-click-modal":!1},{footer:i(()=>[e("div",H,[e("div",L,[o(w,{type:"primary",plain:"",onClick:re},{default:i(()=>[o(Z,{icon:"ep:download"}),n(" \u4E0B\u8F7D\u6A21\u677F ")]),_:1})]),o(w,{disabled:a(r),type:"primary",onClick:le},{default:i(()=>[n("\u786E \u5B9A")]),_:1},8,["disabled"]),o(w,{onClick:t[4]||(t[4]=d=>m.value=!1)},{default:i(()=>[n("\u53D6 \u6D88")]),_:1})])]),default:i(()=>[me((g(),E(ce,{ref_key:"uploadRef",ref:_,"file-list":a(f),"onUpdate:fileList":t[3]||(t[3]=d=>x(f)?f.value=d:null),action:ae+"?mode="+a(y)+"&file="+a(Q)+"&updatePart="+a(b)+"&outFile="+a(h)+"&fromInventoryStatus="+c.fromInventoryStatus+"&toInventoryStatus="+c.toInventoryStatus,"auto-upload":!1,disabled:a(r),headers:a(N),limit:1,"on-error":ie,"on-exceed":de,"on-success":se,accept:a(M),drag:"",style:{width:"300px",margin:"0 auto"}},{tip:i(()=>[e("div",S,[e("div",q,[D,e("div",B,[e("div",F,[o(ue,{modelValue:a(y),"onUpdate:modelValue":t[0]||(t[0]=d=>x(y)?y.value=d:null)},{default:i(()=>[o(I,{label:1,disabled:a(W)},{default:i(()=>[n("\u66F4\u65B0")]),_:1},8,["disabled"]),o(I,{label:2,disabled:a(Y)},{default:i(()=>[n("\u8FFD\u52A0")]),_:1},8,["disabled"]),o(I,{label:3,disabled:a(ee)},{default:i(()=>[n("\u8986\u76D6")]),_:1},8,["disabled"])]),_:1},8,["modelValue"])]),z])]),e("div",U,[k,e("div",C,[e("div",P,[o($,{modelValue:a(b),"onUpdate:modelValue":t[1]||(t[1]=d=>x(b)?b.value=d:null)},null,8,["modelValue"])]),O])]),c.isShowOut?(g(),fe("div",T,[R,e("div",j,[e("div",A,[o($,{modelValue:a(h),"onUpdate:modelValue":t[2]||(t[2]=d=>x(h)?h.value=d:null)},null,8,["modelValue"])])])])):xe("",!0)])]),default:i(()=>[o(Z,{icon:"ep:upload-filled",color:"#c0c4cc",size:"60"}),V]),_:1},8,["file-list","action","disabled","headers","accept"])),[[ne,a(r)]])]),_:1},8,["modelValue"])}}}),[["__scopeId","data-v-24974a05"]])});export{G as I,Oe as __tla};