qrd-modal.f155269c.js 14 KB

1
  1. import{bK as Fe,aT as _e,_ as be,d as Ce,E as g,a5 as Be,aZ as A,af as U,x as s,aA as ye,o as v,N,K as l,O as Ve,u as i,aK as Ne,y as e,c as R,M as h,L as O,W as _,G as H,bL as xe,aS as P,bM as Ae,bN as Ue,bO as qe}from"./index.743f0c80.js";import we from"./company.ca18062a.js";import ke from"./customer.41a365fb.js";import Re from"./supplier.dbf3e947.js";import he from"./category.c3e1442c.js";import Oe from"./sale-user.7746b259.js";import Pe from"./user.03362d92.js";var E=(p=>(p[p.create=0]="create",p[p.update=1]="update",p[p.preview=2]="preview",p[p.proUpdate=3]="proUpdate",p))(E||{});const Se=(p,b,C)=>{b!==""?Fe(b)||_e(b)?C():C(new Error("\u8054\u7CFB\u7535\u8BDD\u683C\u5F0F\u4E0D\u6B63\u786E\uFF01")):C(new Error("\u8054\u7CFB\u7535\u8BDD\uFF01"))},Le={sale_id:[{required:!0,message:"\u9500\u552E\u5458\u4E0D\u80FD\u4E3A\u7A7A\uFF01",trigger:"blur"}],sale_depart:[{required:!0,message:"\u9500\u552E\u5458\u90E8\u95E8\u4E0D\u80FD\u4E3A\u7A7A\uFF01",trigger:"change"}],buyerid:[{required:!0,message:"\u91C7\u8D2D\u5458\u4E0D\u80FD\u4E3A\u7A7A\uFF01",trigger:"change"}],cgd_depart:[{required:!0,message:"\u91C7\u8D2D\u5458\u90E8\u95E8\u4E0D\u80FD\u4E3A\u7A7A\uFF01",trigger:"change"}],cgd_tax:[{required:!0,message:"\u91C7\u8D2D\u6BDB\u5229\u7387",trigger:"blur"}],cat:[{required:!0,message:"\u5546\u54C1\u5206\u7C7B",trigger:"change"}],supplierNo:[{required:!0,message:"\u4F9B\u5E94\u5546\u516C\u53F8",trigger:"change"}],qrdType:[{required:!0,message:"\u8BA2\u5355\u7C7B\u578B",trigger:"blur"}],good_total:[{required:!0,message:"\u8D27\u6B3E\u603B\u91D1\u989D",trigger:"blur"}],workCode:[{required:!0,message:"\u5355\u636E\u53F7",trigger:"blur"}],poCode:[{required:!0,message:"\u5E73\u53F0\u8BA2\u5355\u53F7",trigger:"blur"}],khNo:[{required:!0,message:"\u8D2D\u4E70\u65B9\u516C\u53F8",trigger:"change"}],tax:[{required:!0,message:"\u7A0E\u7387",trigger:"change"}],companyNo:[{required:!0,message:"\u9500\u552E\u65B9\u516C\u53F8",trigger:"change"}],contactor:[{required:!0,message:"\u6536\u8D27\u4EBA",trigger:"blur"}],mobile:[{required:!0,trigger:"blur",validator:Se}],addr:[{required:!0,message:"\u8054\u7CFB\u5730\u5740",trigger:"blur"}],sendtime:[{required:!0,message:"\u53D1\u8D27\u65F6\u95F4",trigger:"change"}],goodName:[{required:!0,message:"\u5546\u54C1\u540D\u79F0",trigger:"blur"}],goodPrice:[{required:!0,message:"\u5355\u4EF7",trigger:"blur"}],goodNum:[{required:!0,message:"\u6570\u91CF",trigger:"blur"}]},Ie=[{status:"1",value:"\u7F51\u7EDC\u90E8@\u6CD3\u6E90\u5E7F\u8BDA"},{status:"1",value:"\u5BA2\u670D\u90E8@\u767E\u8FB0\u8363\u8FBE"},{status:"0",value:"\u9879\u76EE\u90E8@\u666E\u6DA6\u5FC3\u5802"},{status:"0",value:"\u5E73\u53F0\u90E8@\u4E07\u5B87\u6052\u901A"},{status:"0",value:"\u8D22\u52A1\u90E8@\u4E07\u5B87\u6052\u901A"},{status:"0",value:"\u4E07\u5B87\u4F9B\u5E94\u94FE\u8D44\u6E90\u90E8"},{status:"0",value:"\u4E07\u5B87\u4EA7\u54C1\u90E8"}],Qe=[{status:"1",value:"\u7F51\u7EDC\u90E8@\u6CD3\u6E90\u5E7F\u8BDA"},{status:"1",value:"\u4E07\u5B87\u4F9B\u5E94\u94FE\u8D44\u6E90\u90E8"},{status:"0",value:"\u5BA2\u670D\u90E8@\u767E\u8FB0\u8363\u8FBE"},{status:"0",value:"\u9879\u76EE\u90E8@\u666E\u6DA6\u5FC3\u5802"},{status:"0",value:"\u5E73\u53F0\u90E8@\u4E07\u5B87\u6052\u901A"},{status:"0",value:"\u8D22\u52A1\u90E8@\u4E07\u5B87\u6052\u901A"},{status:"0",value:"\u4E07\u5B87\u4EA7\u54C1\u90E8"}],z={sale_id:"",sale_name:"",companyNo:"",poCode:"",workCode:"",qrdType:"2",goodName:"",tax:"",goodNum:"",goodPrice:"",addr:"",mobile:"",contactor:"",buyerid:"",sendtime:"",cat:"",supplierNo:"",cgd_tax:"",sale_depart:"",cgd_depart:"",khNo:""},Ye=_("\u786E\u8BA4\u5355\u4FE1\u606F"),je=_("\u6536\u8D27\u4FE1\u606F"),Ke=_("\u5546\u54C1\u4FE1\u606F"),Me=_("\u5143"),$e=_("\u4FDD\u5B58"),He=_("\u5173\u95ED"),ze=Ce({__name:"qrd-modal",emits:["reload"],setup(p,{expose:b,emit:C}){const B=g(!1),G=g(!1),D=g(E.create),S=g(null),L=g(null),q=g(null),I=g(null),Q=g(null),Y=g(null),T=o=>o.getTime()>new Date().valueOf(),j=g(null),t=g({...z}),{currentCompany:w}=Be();function K(){B.value=!1,C("reload")}async function W(o){const u=Object.keys(o),d=["goodNum","goodPrice","cgd_tax"];u.forEach(F=>{let x=d.includes(F)?Number(o[F]):o[F];t.value[F]=x});const{companyNo:m,supplierNo:r,khNo:n,cat:f,sale_name:y,buyer:V}=t.value,c=f?f[f.length-1].id:"";t.value.cat=c,$(),q.value.initalData({companyNo:m}),L.value.initalData({companyNo:r}),S.value.initalData({companyNo:n}),Y.value.initalData({cat:c}),await H(()=>{Q.value.initalData({nickname:V,companyNo:m}),I.value.initalData({nickname:y,companyNo:m})})}function Z(o){var d;const{tax:u}=t.value;if(!o||!u)return null;t.value.tax=(d=o.find(({rate:m})=>m===u))==null?void 0:d.id}const{data:J,run:X,loading:ee}=A({isList:!1,initalData:[],success:o=>Z(o)}),{run:ue,loading:le}=A({success:()=>K()}),{run:ae,loading:te}=A({success:()=>K()}),{run:oe,loading:re}=A({initalData:{},success:o=>W(o)}),ne=U(()=>{const o="\u786E\u8BA4\u5355",u=D.value===E.preview,d=D.value===E.create;return u?`${o}\u8BE6\u60C5`:`${d?"\u521B\u5EFA":"\u4FEE\u6539"}${o}`});function M(o,u){if(!o)return null;const{nickname:d}=o;t.value[u]=d}const de=U(()=>ee.value||re.value),se=U(()=>le.value||te.value),ie=U(()=>{const{goodNum:o,goodPrice:u}=t.value;return(Number(o)*Number(u)).toFixed(2)}),$=()=>X(xe()),pe=o=>ue(Ue(o)),me=o=>ae(qe(o)),ge=o=>oe(Ae(o));function Ee(){const{sale_id:o,buyerid:u,companyNo:d,supplierNo:m}=t.value;if(o===u&&o&&u){P.warning("\u91C7\u8D2D\u5458\u548C\u9500\u552E\u5458\u4E0D\u80FD\u76F8\u540C");return}if(d===m){P.warning("\u9500\u552E\u65B9\u516C\u53F8\u548C\u4F9B\u5E94\u5546\u516C\u53F8\u4E0D\u80FD\u76F8\u540C");return}j.value.validate(r=>{if(!r)return null;(D.value===E.update||D.value===E.proUpdate?me:pe)(t.value)})}function ce(o,u){const d=o===E.update||o===E.proUpdate||o===E.preview;if(D.value=o,B.value=!0,!d&&!w.value.companyNo){P.warning("\u8BF7\u5728\u53F3\u4E0A\u89D2\u9009\u62E9\u4E00\u5BB6\u516C\u53F8");return}if(d){ge({id:u});return}$(),t.value.companyNo=w.value.companyNo,H(()=>q.value.initalData({companyNo:w.value.companyNo}))}return b({onDisplay:ce}),(o,u)=>{const d=s("ElTag"),m=s("ElDivider"),r=s("ElCol"),n=s("ElFormItem"),f=s("ElOption"),y=s("ElSelect"),V=s("ElInputNumber"),c=s("ElInput"),F=s("ElDatePicker"),x=s("ElButton"),fe=s("ElRow"),ve=s("ElDialog"),De=ye("loading");return v(),N(ve,{modelValue:B.value,"onUpdate:modelValue":u[22]||(u[22]=a=>B.value=a),title:i(ne),"destroy-on-close":"",width:"1040px",top:"10vh",center:"",onClose:u[23]||(u[23]=()=>t.value={...i(z)}),"close-on-click-modal":!1},{default:l(()=>[Ve((v(),N(i(Ne),{ref_key:"formRef",ref:j,model:t.value,rules:i(Le),"label-width":"93px",disabled:D.value===i(E).preview},{default:l(()=>[e(fe,{gutter:10},{default:l(()=>[e(r,{span:24,style:{padding:"0 0 10px 0","margin-top":"-5px"}},{default:l(()=>[e(m,null,{default:l(()=>[e(d,null,{default:l(()=>[Ye]),_:1})]),_:1})]),_:1}),e(r,{span:8},{default:l(()=>[e(n,{label:"\u9500\u552E\u5458",prop:"sale_id"},{default:l(()=>[e(Oe,{ref_key:"saleUserRef",ref:I,companyNo:t.value.companyNo,modelValue:t.value.sale_id,"onUpdate:modelValue":u[0]||(u[0]=a=>t.value.sale_id=a),onItemChange:u[1]||(u[1]=a=>M(a,"sale_name"))},null,8,["companyNo","modelValue"])]),_:1})]),_:1}),e(r,{span:8},{default:l(()=>[e(n,{label:"\u9500\u552E\u5458\u90E8\u95E8",prop:"sale_depart"},{default:l(()=>[e(y,{style:{width:"100%"},modelValue:t.value.sale_depart,"onUpdate:modelValue":u[2]||(u[2]=a=>t.value.sale_depart=a)},{default:l(()=>[(v(!0),R(O,null,h(i(Ie),(a,k)=>(v(),N(f,{label:a.value,value:a.value,disabled:a.status!=="1",key:k},null,8,["label","value","disabled"]))),128))]),_:1},8,["modelValue"])]),_:1})]),_:1}),e(r,{span:8},{default:l(()=>[e(n,{label:"\u91C7\u8D2D\u6BDB\u5229\u7387",prop:"cgd_tax"},{default:l(()=>[e(V,{modelValue:t.value.cgd_tax,"onUpdate:modelValue":u[3]||(u[3]=a=>t.value.cgd_tax=a),style:{width:"100%"},"controls-position":"right",placeholder:"\u91C7\u8D2D\u6BDB\u5229\u7387","step-strictly":"",min:0,precision:2,step:.01,max:100},null,8,["modelValue","step"])]),_:1})]),_:1}),e(r,{span:8},{default:l(()=>[e(n,{label:"\u91C7\u8D2D\u5458",prop:"buyerid"},{default:l(()=>[e(Pe,{ref_key:"buyerUserRef",ref:Q,modelValue:t.value.buyerid,"onUpdate:modelValue":u[4]||(u[4]=a=>t.value.buyerid=a),companyNo:t.value.companyNo,onItemChange:u[5]||(u[5]=a=>M(a,"buyer"))},null,8,["modelValue","companyNo"])]),_:1})]),_:1}),e(r,{span:8},{default:l(()=>[e(n,{label:"\u91C7\u8D2D\u5458\u90E8\u95E8",prop:"cgd_depart"},{default:l(()=>[e(y,{style:{width:"100%"},modelValue:t.value.cgd_depart,"onUpdate:modelValue":u[6]||(u[6]=a=>t.value.cgd_depart=a)},{default:l(()=>[(v(!0),R(O,null,h(i(Qe),(a,k)=>(v(),N(f,{label:a.value,value:a.value,disabled:a.status!=="1",key:k},null,8,["label","value","disabled"]))),128))]),_:1},8,["modelValue"])]),_:1})]),_:1}),e(r,{span:12},{default:l(()=>[e(n,{label:"\u5355\u636E\u53F7",prop:"workCode"},{default:l(()=>[e(c,{modelValue:t.value.workCode,"onUpdate:modelValue":u[7]||(u[7]=a=>t.value.workCode=a),placeholder:"\u5355\u636E\u53F7",maxlength:"200"},null,8,["modelValue"])]),_:1})]),_:1}),e(r,{span:12},{default:l(()=>[e(n,{label:"\u5E73\u53F0\u8BA2\u5355\u53F7",prop:"poCode"},{default:l(()=>[e(c,{modelValue:t.value.poCode,"onUpdate:modelValue":u[8]||(u[8]=a=>t.value.poCode=a),placeholder:"\u5E73\u53F0\u8BA2\u5355\u53F7",maxlength:"200"},null,8,["modelValue"])]),_:1})]),_:1}),e(r,{span:12},{default:l(()=>[e(n,{label:"\u8D2D\u4E70\u65B9\u516C\u53F8",prop:"khNo"},{default:l(()=>[e(ke,{ref_key:"customerRef",ref:S,modelValue:t.value.khNo,"onUpdate:modelValue":u[9]||(u[9]=a=>t.value.khNo=a)},null,8,["modelValue"])]),_:1})]),_:1}),e(r,{span:12},{default:l(()=>[e(n,{label:"\u9500\u552E\u65B9\u516C\u53F8",prop:"companyNo"},{default:l(()=>[e(we,{ref_key:"companyRef",ref:q,modelValue:t.value.companyNo,"onUpdate:modelValue":u[10]||(u[10]=a=>t.value.companyNo=a),disabled:D.value!==i(E).proUpdate},null,8,["modelValue","disabled"])]),_:1})]),_:1}),e(r,{span:24,style:{padding:"0 0 10px 0","margin-top":"-5px"}},{default:l(()=>[e(m,null,{default:l(()=>[e(d,null,{default:l(()=>[je]),_:1})]),_:1})]),_:1}),e(r,{span:12},{default:l(()=>[e(n,{label:"\u6536\u8D27\u4EBA",prop:"contactor"},{default:l(()=>[e(c,{modelValue:t.value.contactor,"onUpdate:modelValue":u[11]||(u[11]=a=>t.value.contactor=a),placeholder:"\u6536\u8D27\u4EBA",maxlength:"200"},null,8,["modelValue"])]),_:1})]),_:1}),e(r,{span:12},{default:l(()=>[e(n,{label:"\u8054\u7CFB\u7535\u8BDD",prop:"mobile"},{default:l(()=>[e(c,{modelValue:t.value.mobile,"onUpdate:modelValue":u[12]||(u[12]=a=>t.value.mobile=a),placeholder:"\u8054\u7CFB\u7535\u8BDD",maxlength:"11"},null,8,["modelValue"])]),_:1})]),_:1}),e(r,{span:12},{default:l(()=>[e(n,{label:"\u8054\u7CFB\u5730\u5740",prop:"addr"},{default:l(()=>[e(c,{modelValue:t.value.addr,"onUpdate:modelValue":u[13]||(u[13]=a=>t.value.addr=a),placeholder:"\u8054\u7CFB\u5730\u5740",maxlength:"200"},null,8,["modelValue"])]),_:1})]),_:1}),e(r,{span:12},{default:l(()=>[e(n,{label:"\u53D1\u8D27\u65F6\u95F4",prop:"sendtime"},{default:l(()=>[e(F,{modelValue:t.value.sendtime,"onUpdate:modelValue":u[14]||(u[14]=a=>t.value.sendtime=a),"disabled-date":T,editable:!1,clearable:!0,placeholder:"\u53D1\u8D27\u65F6\u95F4",style:{width:"100%",margin:"0"},type:"datetime","value-format":"YYYY-MM-DD HH:mm:ss"},null,8,["modelValue"])]),_:1})]),_:1}),e(r,{span:24,style:{padding:"0 0 10px 0","margin-top":"-5px"}},{default:l(()=>[e(m,null,{default:l(()=>[e(d,null,{default:l(()=>[Ke]),_:1})]),_:1})]),_:1}),e(r,{span:12},{default:l(()=>[e(n,{label:"\u4F9B\u5E94\u5546\u516C\u53F8",prop:"supplierNo"},{default:l(()=>[e(Re,{ref_key:"supplierRef",ref:L,modelValue:t.value.supplierNo,"onUpdate:modelValue":u[15]||(u[15]=a=>t.value.supplierNo=a)},null,8,["modelValue"])]),_:1})]),_:1}),e(r,{span:12},{default:l(()=>[e(n,{label:"\u5546\u54C1\u5206\u7C7B",prop:"cat"},{default:l(()=>[e(he,{modelValue:t.value.cat,"onUpdate:modelValue":u[16]||(u[16]=a=>t.value.cat=a),ref_key:"categoryRef",ref:Y},null,8,["modelValue"])]),_:1})]),_:1}),e(r,{span:12},{default:l(()=>[e(n,{label:"\u5546\u54C1\u540D\u79F0",prop:"goodName"},{default:l(()=>[e(c,{modelValue:t.value.goodName,"onUpdate:modelValue":u[17]||(u[17]=a=>t.value.goodName=a),placeholder:"\u5546\u54C1\u540D\u79F0",maxlength:"200"},null,8,["modelValue"])]),_:1})]),_:1}),e(r,{span:6},{default:l(()=>[e(n,{label:"\u6570\u91CF",prop:"goodNum"},{default:l(()=>[e(V,{modelValue:t.value.goodNum,"onUpdate:modelValue":u[18]||(u[18]=a=>t.value.goodNum=a),style:{width:"100%"},"controls-position":"right",placeholder:"\u6570\u91CF",min:0,precision:0,"step-strictly":"",step:1,max:9999999},null,8,["modelValue"])]),_:1})]),_:1}),e(r,{span:6},{default:l(()=>[e(n,{label:"\u5355\u4EF7","label-width":"55px",prop:"goodPrice"},{default:l(()=>[e(V,{modelValue:t.value.goodPrice,"onUpdate:modelValue":u[19]||(u[19]=a=>t.value.goodPrice=a),"controls-position":"right",placeholder:"\u5355\u4EF7",style:{width:"100%"},min:0,precision:2,"step-strictly":"",step:.01,max:9999999},null,8,["modelValue","step"])]),_:1})]),_:1}),e(r,{span:6},{default:l(()=>[e(n,{label:"\u8D27\u6B3E\u603B\u989D"},{default:l(()=>[e(c,{value:i(ie),placeholder:"\u8D27\u6B3E\u603B\u989D",disabled:""},{append:l(()=>[Me]),_:1},8,["value"])]),_:1})]),_:1}),e(r,{span:6},{default:l(()=>[e(n,{label:"\u7A0E\u7387",prop:"tax"},{default:l(()=>[e(y,{style:{width:"100%"},modelValue:t.value.tax,"onUpdate:modelValue":u[20]||(u[20]=a=>t.value.tax=a)},{default:l(()=>[(v(!0),R(O,null,h(i(J),a=>(v(),N(f,{key:a.id,label:a.rate+"%",value:a.id},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1})]),_:1}),e(r,{span:12,style:{"text-align":"right",padding:"5px 0 0 0"}},{default:l(()=>[e(x,{type:"primary",onClick:Ee,loading:i(se)||G.value},{default:l(()=>[$e]),_:1},8,["loading"]),e(x,{onClick:u[21]||(u[21]=()=>B.value=!1)},{default:l(()=>[He]),_:1})]),_:1})]),_:1})]),_:1},8,["model","rules","disabled"])),[[De,i(de)]])]),_:1},8,["modelValue","title"])}}});var Ge=be(ze,[["__file","D:/work/accout-vue3-ui/src/views/netOrderEnter/netOrderEntry/qrd-modal.vue"]]),lu=Object.freeze(Object.defineProperty({__proto__:null,default:Ge},Symbol.toStringTag,{value:"Module"}));export{E as M,Ge as Q,lu as q};