1 |
- import{_ as O,d as R,w as D,bs as P,bt as te,r as _,o as d,c as b,j as l,C as u,h as C,F as V,aN as j,aa as oe,c3 as se,c4 as ne,x as de,c5 as re,G as p,D as E,l as r,aq as pe,m as ie,n as me,aC as ve,H as fe,bW as ce,a as h,M as ye,b1 as _e}from"./index.js";import{h as L,c as ge,s as be,a as Ve,b as Ee,d as Fe,e as Be,f as De,p as Ce,r as Ue,g as ke,i as we}from"./index.13ae5653.js";import{A as xe}from"./account-query.b0b7548b.js";import{u as I,a as he}from"./useTask.8a645393.js";import"./validator.92b8f4b2.js";const Ae=C("div",{class:"add-icon"},"+",-1),Ie=["src"],qe=R({__name:"index",props:{multiple:{type:Boolean,required:!1},modelValue:{type:Array,required:!1}},emits:["change"],setup(U,{emit:g}){const A=U,k=["image/png","image/jpg","image/bmp","image/jpeg"],F=D([]),a=P(A,"modelValue"),w=te(),y=D(""),B=D(!1),x=({type:o,size:s})=>{if(!k.includes(o))return j.error("\u8BF7\u4E0A\u4F20jpg.png.bmp.jpeg\u7C7B\u578B\u56FE\u7247"),!1;if(s/1024/1024>1)return j.error("\u56FE\u7247\u5927\u5C0F\u8D85\u8FC71M"),!1},f=async({file:o})=>{const s=new FormData,i=oe();s.append("image",o),s.append("token",i);const{message:n,code:c,data:v}=await se(s);w({message:n,code:c,handler:()=>{a.value.push(ne+"/"+v[0].url),g("change",a.value.join(","))}})},q=()=>{j.error("\u56DE\u6267\u56FE\u7247\u4E0D\u80FD\u8D85\u8FC7\u5341\u5F20")},m=o=>{y.value=o.url,B.value=!0},t=o=>{const s=F.value.findIndex(({uid:i})=>i===o.uid);return a.value.splice(s,1),g("change",a.value.join(","),a),!0};return(o,s)=>{const i=_("el-upload"),n=_("el-dialog");return d(),b(V,null,[l(i,{"file-list":F.value,"onUpdate:fileList":s[0]||(s[0]=c=>F.value=c),"before-upload":x,"http-request":f,"before-remove":t,"on-preview":m,"on-exceed":q,limit:10,"list-type":"picture-card",multiple:U.multiple,accept:k.join(",")},{default:u(()=>[Ae]),_:1},8,["file-list","multiple","accept"]),l(n,{modelValue:B.value,"onUpdate:modelValue":s[1]||(s[1]=c=>B.value=c),"close-on-click-modal":!1},{default:u(()=>[C("img",{"w-full":"",src:y.value,alt:"Preview Image"},null,8,Ie)]),_:1},8,["modelValue"])],64)}}});var Se=O(qe,[["__file","C:/Users/Administrator/Desktop/projects/purchase-vue3/src/components/ImageUpload/src/index.vue"]]);const Te=R({__name:"business-type-query",props:{modelValue:{type:String,required:!1},disabled:{type:Boolean,required:!1}},emits:["change"],setup(U,{expose:g,emit:A}){const F=P(U,"modelValue");D([]);const a=I({initialData:[]});return de(async()=>a.run(re({size:1e4}))),g({initalData:w=>{}}),(w,y)=>{const B=_("ElOption"),x=_("ElSelect");return d(),p(x,{style:{width:"100%"},modelValue:r(F),"onUpdate:modelValue":y[0]||(y[0]=f=>pe(F)?F.value=f:null),disabled:U.disabled,loading:r(a).loading,onChange:y[1]||(y[1]=f=>A("change",f)),clearable:""},{default:u(()=>[(d(!0),b(V,null,E(r(a).data,f=>(d(),p(B,{key:f.id,value:f.id,label:f.company_type,disabled:String(f.status)==="0"},null,8,["value","label","disabled"]))),128))]),_:1},8,["modelValue","disabled","loading"])}}});var je=O(Te,[["__file","C:/Users/Administrator/Desktop/projects/purchase-vue3/src/components/BasicForm/src/fields/business-type-query.vue"]]);const Oe=C("h5",{class:"mb-[10px]",style:{"border-left":"5px solid #006eff","padding-left":"5px"}},"\u57FA\u7840\u4FE1\u606F",-1),Re={class:"w-full flex flex-wrap"},Ne=C("h5",{class:"mb-[10px]",style:{"border-left":"5px solid #006eff","padding-left":"5px"}},"\u8054\u7CFB\u4EBA\u4FE1\u606F",-1),Me=C("h5",{class:"mb-[10px]",style:{"border-left":"5px solid #006eff","padding-left":"5px"}},"\u8425\u4E1A\u6267\u7167\u4FE1\u606F",-1),Le={class:"flex w-full justify-end"},Pe=R({__name:"base-form",setup(U){const g=ie(),A=me(),k=D(null),a=D({...{id:"",code:"",coop_state:"",source:"",type:"",category:"",delivery_way:"",supplier_type:"",level:"",pay_type:"",personid:"",license_img:"",prove_img:[],contactor:"",mobile:"",email:"",position:"",telephone:"",name:"",registercode:"",nature:"",legaler:"",registertime:"",addr:"",scope:"",person:""}}),w=D(null),y=I({success(m){var M;const{id:t,code:o,coop_state:s,source:i,type:n,category:c,delivery_way:v,supplier_type:S,level:T,pay_type:e,license_img:Q,prove_img:$,contactor:H,mobile:J,position:W,registercode:z,name:G,nature:K,addr:X,legaler:Y,registertime:Z,scope:ee,personid:le,person:N,telephone:ue,email:ae}=m;a.value={id:t,code:o,coop_state:s,source:i,type:n,category:c,delivery_way:v,supplier_type:S,level:T,pay_type:e,license_img:Q,prove_img:$||[],contactor:H,mobile:J,position:W,registercode:z,name:G,nature:K,addr:X,legaler:Y,registertime:Z,scope:ee,personid:String(le),person:N,telephone:ue,email:ae},(M=k.value)==null||M.initialData({nickname:N})}}),B=I({success:()=>A.push("/supplierSettings/supplier")}),x=I({success:()=>y.run(L({code:g.query.id}))}),f=he(B,x);async function q(){try{await w.value.validate();const m=g.query.type==="create",t=m?B:x,o=m?ke:we,s=JSON.parse(JSON.stringify(a.value));s.prove_img=s.prove_img.join(","),m&&delete s.id,delete s.code,t.run(o(s))}catch{}}return g.query.id&&y.run(L({code:g.query.id})),(m,t)=>{const o=_("ElCol"),s=_("ElOption"),i=_("ElSelect"),n=_("ElFormItem"),c=_("ElRow"),v=_("ElInput"),S=_("ElButton"),T=ve("loading");return fe((d(),p(r(_e),{"label-width":"100px",model:a.value,rules:r(Ue),ref_key:"formRef",ref:w,disabled:r(g).query.type==="preview"},{default:u(()=>[l(c,{gutter:10},{default:u(()=>[l(o,{span:6},{default:u(()=>[Oe]),_:1}),l(o,{span:6},{default:u(()=>[l(n,{label:"\u5408\u7EA6\u72B6\u6001",prop:"coop_state"},{default:u(()=>[l(i,{modelValue:a.value.coop_state,"onUpdate:modelValue":t[0]||(t[0]=e=>a.value.coop_state=e),style:{width:"100%"}},{default:u(()=>[(d(!0),b(V,null,E(r(ge),e=>(d(),p(s,{key:e.value,label:e.label,value:e.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1})]),_:1}),l(o,{span:6},{default:u(()=>[l(n,{label:"\u4F9B\u5E94\u5546\u6765\u6E90",prop:"source"},{default:u(()=>[l(i,{modelValue:a.value.source,"onUpdate:modelValue":t[1]||(t[1]=e=>a.value.source=e),style:{width:"100%"}},{default:u(()=>[(d(!0),b(V,null,E(r(be),e=>(d(),p(s,{key:e.value,label:e.label,value:e.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1})]),_:1}),l(o,{span:6},{default:u(()=>[l(n,{label:"\u7533\u8BF7\u7C7B\u578B",prop:"type"},{default:u(()=>[l(i,{modelValue:a.value.type,"onUpdate:modelValue":t[2]||(t[2]=e=>a.value.type=e),style:{width:"100%"}},{default:u(()=>[(d(!0),b(V,null,E(r(Ve),e=>(d(),p(s,{key:e.value,label:e.label,value:e.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1})]),_:1}),l(o,{span:6},{default:u(()=>[l(n,{label:"\u6240\u5C5E\u7C7B\u522B",prop:"category"},{default:u(()=>[l(i,{modelValue:a.value.category,"onUpdate:modelValue":t[3]||(t[3]=e=>a.value.category=e),style:{width:"100%"}},{default:u(()=>[(d(!0),b(V,null,E(r(Ee),e=>(d(),p(s,{key:e.value,label:e.label,value:e.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1})]),_:1}),l(o,{span:6},{default:u(()=>[l(n,{label:"\u7269\u6D41\u65B9\u5F0F",prop:"delivery_way"},{default:u(()=>[l(i,{modelValue:a.value.delivery_way,"onUpdate:modelValue":t[4]||(t[4]=e=>a.value.delivery_way=e),style:{width:"100%"}},{default:u(()=>[(d(!0),b(V,null,E(r(Fe),e=>(d(),p(s,{key:e.value,label:e.label,value:e.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1})]),_:1}),l(o,{span:6},{default:u(()=>[l(n,{label:"\u4F9B\u5E94\u5546\u7C7B\u578B",prop:"supplier_type"},{default:u(()=>[l(i,{modelValue:a.value.supplier_type,"onUpdate:modelValue":t[5]||(t[5]=e=>a.value.supplier_type=e),style:{width:"100%"}},{default:u(()=>[(d(!0),b(V,null,E(r(Be),e=>(d(),p(s,{key:e.value,label:e.label,value:e.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1})]),_:1}),l(o,{span:6},{default:u(()=>[l(n,{label:"\u4F9B\u5E94\u5546\u7EA7\u522B",prop:"level"},{default:u(()=>[l(i,{modelValue:a.value.level,"onUpdate:modelValue":t[6]||(t[6]=e=>a.value.level=e),style:{width:"100%"}},{default:u(()=>[(d(!0),b(V,null,E(r(De),e=>(d(),p(s,{key:e.value,label:e.label,value:e.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1})]),_:1})]),_:1}),l(c,null,{default:u(()=>[l(o,{span:6},{default:u(()=>[l(n,{label:"\u652F\u4ED8\u65B9\u5F0F",prop:"pay_type"},{default:u(()=>[l(i,{modelValue:a.value.pay_type,"onUpdate:modelValue":t[7]||(t[7]=e=>a.value.pay_type=e),style:{width:"100%"}},{default:u(()=>[(d(!0),b(V,null,E(r(Ce),e=>(d(),p(s,{key:e.value,label:e.label,value:e.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),l(n,{label:"\u8D1F\u8D23\u4EBA",prop:"personid"},{default:u(()=>[l(r(xe),{modelValue:a.value.personid,"onUpdate:modelValue":t[8]||(t[8]=e=>a.value.personid=e),placeholder:"\u8D1F\u8D23\u4EBA",ref_key:"accountQueryRef",ref:k},null,8,["modelValue"])]),_:1})]),_:1}),l(o,{span:9},{default:u(()=>[l(n,{label:"\u8425\u4E1A\u6267\u7167",prop:"license_img"},{default:u(()=>[l(r(ce),{style:{width:"100%"},modelValue:a.value.license_img,"onUpdate:modelValue":t[9]||(t[9]=e=>a.value.license_img=e)},null,8,["modelValue"])]),_:1})]),_:1}),l(o,{span:9},{default:u(()=>[l(n,{label:"\u8D44\u8D28\u8BC1\u660E",prop:"prove_img"},{default:u(()=>[C("div",Re,[l(r(Se),{style:{width:"100%"},modelValue:a.value.prove_img,"onUpdate:modelValue":t[10]||(t[10]=e=>a.value.prove_img=e)},null,8,["modelValue"])])]),_:1})]),_:1})]),_:1}),l(c,null,{default:u(()=>[l(o,{span:24},{default:u(()=>[Ne]),_:1}),l(o,{span:8},{default:u(()=>[l(n,{label:"\u59D3\u540D",prop:"contactor"},{default:u(()=>[l(v,{modelValue:a.value.contactor,"onUpdate:modelValue":t[11]||(t[11]=e=>a.value.contactor=e),placeholder:"\u59D3\u540D"},null,8,["modelValue"])]),_:1})]),_:1}),l(o,{span:8},{default:u(()=>[l(n,{label:"\u624B\u673A\u53F7",prop:"mobile"},{default:u(()=>[l(v,{modelValue:a.value.mobile,"onUpdate:modelValue":t[12]||(t[12]=e=>a.value.mobile=e),maxlength:"20",placeholder:"\u624B\u673A\u53F7"},null,8,["modelValue"])]),_:1})]),_:1}),l(o,{span:8},{default:u(()=>[l(n,{label:"\u7535\u5B50\u90AE\u7BB1",prop:"email"},{default:u(()=>[l(v,{modelValue:a.value.email,"onUpdate:modelValue":t[13]||(t[13]=e=>a.value.email=e),maxlength:"50",placeholder:"\u7535\u5B50\u90AE\u7BB1"},null,8,["modelValue"])]),_:1})]),_:1}),l(o,{span:8},{default:u(()=>[l(n,{label:"\u804C\u4F4D",prop:"position"},{default:u(()=>[l(v,{modelValue:a.value.position,"onUpdate:modelValue":t[14]||(t[14]=e=>a.value.position=e),maxlength:"50",placeholder:"\u804C\u4F4D"},null,8,["modelValue"])]),_:1})]),_:1}),l(o,{span:8},{default:u(()=>[l(n,{label:"\u5EA7\u673A\u53F7",prop:"telephone"},{default:u(()=>[l(v,{modelValue:a.value.telephone,"onUpdate:modelValue":t[15]||(t[15]=e=>a.value.telephone=e),maxlength:"50",placeholder:"\u5EA7\u673A\u53F7"},null,8,["modelValue"])]),_:1})]),_:1})]),_:1}),l(c,null,{default:u(()=>[l(o,{span:24},{default:u(()=>[Me]),_:1}),l(o,{span:16},{default:u(()=>[l(n,{label:"\u4F9B\u5E94\u5546\u540D\u79F0",prop:"name"},{default:u(()=>[l(v,{modelValue:a.value.name,"onUpdate:modelValue":t[16]||(t[16]=e=>a.value.name=e),maxlength:"50",placeholder:"\u4F9B\u5E94\u5546\u540D\u79F0"},null,8,["modelValue"])]),_:1})]),_:1}),m.type!=="create"||!a.value.license_img?(d(),p(o,{key:0,span:8},{default:u(()=>[l(n,{label:"\u7EDF\u4E00\u793E\u4F1A\u4FE1\u7528\u4EE3\u7801",prop:"registercode","label-width":"140px"},{default:u(()=>[l(v,{modelValue:a.value.registercode,"onUpdate:modelValue":t[17]||(t[17]=e=>a.value.registercode=e),maxlength:"50",placeholder:"\u7EDF\u4E00\u793E\u4F1A\u4FE1\u7528\u4EE3\u7801"},null,8,["modelValue"])]),_:1})]),_:1})):h("v-if",!0),m.type!=="create"||!a.value.license_img?(d(),p(o,{key:1,span:8},{default:u(()=>[l(n,{label:"\u516C\u53F8\u7C7B\u578B",prop:"nature"},{default:u(()=>[l(r(je),{modelValue:a.value.nature,"onUpdate:modelValue":t[18]||(t[18]=e=>a.value.nature=e),maxlength:"50",placeholder:"\u516C\u53F8\u7C7B\u578B"},null,8,["modelValue"])]),_:1})]),_:1})):h("v-if",!0),m.type!=="create"||!a.value.license_img?(d(),p(o,{key:2,span:8},{default:u(()=>[l(n,{label:"\u6CD5\u4EBA\u4EE3\u8868",prop:"legaler"},{default:u(()=>[l(v,{modelValue:a.value.legaler,"onUpdate:modelValue":t[19]||(t[19]=e=>a.value.legaler=e),placeholder:"\u6CD5\u4EBA\u4EE3\u8868",maxlength:"20"},null,8,["modelValue"])]),_:1})]),_:1})):h("v-if",!0),m.type!=="create"||!a.value.license_img?(d(),p(o,{key:3,span:8},{default:u(()=>[l(n,{label:"\u6210\u7ACB\u65E5\u671F",prop:"registertime"},{default:u(()=>[l(v,{modelValue:a.value.registertime,"onUpdate:modelValue":t[20]||(t[20]=e=>a.value.registertime=e),maxlength:"50",placeholder:"\u6210\u7ACB\u65E5\u671F"},null,8,["modelValue"])]),_:1})]),_:1})):h("v-if",!0),m.type!=="create"||!a.value.license_img?(d(),p(o,{key:4,span:24},{default:u(()=>[l(n,{label:"\u8BE6\u7EC6\u5730\u5740",prop:"addr"},{default:u(()=>[l(v,{modelValue:a.value.addr,"onUpdate:modelValue":t[21]||(t[21]=e=>a.value.addr=e),maxlength:"200",placeholder:"\u8BE6\u7EC6\u5730\u5740"},null,8,["modelValue"])]),_:1})]),_:1})):h("v-if",!0),m.type!=="create"||!a.value.license_img?(d(),p(o,{key:5,span:24},{default:u(()=>[l(n,{label:"\u8FD0\u8425\u8303\u56F4",prop:"scope"},{default:u(()=>[l(v,{type:"textarea",modelValue:a.value.scope,"onUpdate:modelValue":t[22]||(t[22]=e=>a.value.scope=e),maxlength:"5000",placeholder:"\u8FD0\u8425\u8303\u56F4","show-word-limit":""},null,8,["modelValue"])]),_:1})]),_:1})):h("v-if",!0),l(o,{span:24},{default:u(()=>[C("div",Le,[l(S,{onClick:q,type:"primary",loading:r(f).loading},{default:u(()=>[ye("\u4FDD \u5B58")]),_:1},8,["loading"])])]),_:1})]),_:1})]),_:1},8,["model","rules","disabled"])),[[T,r(y).loading]])}}});var ze=O(Pe,[["__file","C:/Users/Administrator/Desktop/projects/purchase-vue3/src/views/serviceParam/supplier/base-form.vue"]]);export{ze as default};
|