12345678910111213141516171819202122232425 |
- import{bN as ve,aZ as Ee,_ as be,d as De,w as m,W as Fe,b3 as V,ag as B,r as s,aC as _e,o as x,G as q,C as l,H as Ce,u as f,aR as ye,l as e,M as F,a as j,c as Ve,F as Be,D as xe,y as H,bO as Ne,aY as k,bP as we,bQ as Ue,bR as qe}from"./index.42bf163d.js";import ke from"./platform.dcb06767.js";import he from"./company.8cec4443.js";import Re from"./customer.784cdc6e.js";import Ae from"./supplier.eefb968c.js";import Pe from"./category.2dfc2fbf.js";import Oe from"./sale-user.a81b155a.js";import Se from"./user.2ead3b1c.js";var g=(i=>(i[i.create=0]="create",i[i.update=1]="update",i[i.preview=2]="preview",i[i.proUpdate=3]="proUpdate",i))(g||{});const Ie=(i,_,C)=>{_!==""?ve(_)||Ee(_)?C():C(new Error("\u8054\u7CFB\u7535\u8BDD\u683C\u5F0F\u4E0D\u6B63\u786E\uFF01")):C(new Error("\u8054\u7CFB\u7535\u8BDD\uFF01"))},Le={platform_id:[{required:!0,message:"\u8BF7\u9009\u62E9\u6240\u5C5E\u5E73\u53F0",trigger:"change"}],sale_id:[{required:!0,message:"\u9500\u552E\u5458\u4E0D\u80FD\u4E3A\u7A7A\uFF01",trigger:"blur"}],buyerid:[{required:!0,message:"\u91C7\u8D2D\u5458\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\u7F16\u7801",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:Ie}],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"}]},$={sale_id:"",sale_name:"",companyNo:"",poCode:"",workCode:"",qrdType:"2",goodName:"",tax:"",goodNum:"",goodPrice:"",addr:"",mobile:"",contactor:"",buyerid:"",sendtime:"",cat:"",supplierNo:"",cgd_tax:"",khNo:"",platform_id:""},Qe=De({__name:"qrd-modal",emits:["reload"],setup(i,{expose:_,emit:C}){const b=m(!1),M=m(!1),E=m(g.create),h=m(null),R=m(null),N=m(null),A=m(null),P=m(null),O=m(null),z=o=>o.getTime()>new Date().valueOf(),S=m(null),a=m({...$}),{currentCompany:w}=Fe();function I(){b.value=!1,C("reload")}async function G(o){const u=Object.keys(o),d=["goodNum","goodPrice","cgd_tax"];u.forEach(D=>{a.value[D]=d.includes(D)?Number(o[D]):o[D]});const{companyNo:p,supplierNo:r,khNo:n,cat:v,sale_name:c,buyer:U}=a.value;a.value.platform_id=Number(a.value.platform_id);const y=v?v[v.length-1].id:"";a.value.cat=y,await Q(),N.value.initalData({companyNo:p}),R.value.initalData({companyNo:r}),h.value.initalData({companyNo:n}),O.value.initalData({cat:y}),await H(()=>{P.value.initalData({nickname:U,companyNo:p}),A.value.initalData({nickname:c,companyNo:p})})}function W(o){var d;const{tax:u}=a.value;if(!o||!u)return null;a.value.tax=(d=o.find(({rate:p})=>p===u))==null?void 0:d.id}const{data:Z,run:J,loading:K}=V({isList:!1,initalData:[],success:o=>W(o)}),{run:T,loading:X}=V({success:()=>I()}),{run:ee,loading:ue}=V({success:()=>I()}),{run:le,loading:ae}=V({initalData:{},success:o=>G(o)}),te=B(()=>{const o="\u9500\u552E\u8BA2\u5355",u=E.value===g.preview,d=E.value===g.create;return u?`${o}\u8BE6\u60C5`:`${d?"\u521B\u5EFA":"\u4FEE\u6539"}${o}`});function L(o,u){if(!o)return null;const{nickname:d}=o;a.value[u]=d}const oe=B(()=>K.value||ae.value),re=B(()=>X.value||ue.value),ne=B(()=>{const{goodNum:o,goodPrice:u}=a.value;return(Number(o)*Number(u)).toFixed(2)}),Q=()=>J(Ne()),de=o=>T(Ue(o)),se=o=>ee(qe(o)),ie=o=>le(we(o));function pe(){const{sale_id:o,buyerid:u,companyNo:d,supplierNo:p}=a.value;if(o===u&&o&&u){k.warning("\u91C7\u8D2D\u5458\u548C\u9500\u552E\u5458\u4E0D\u80FD\u76F8\u540C");return}if(d===p){k.warning("\u9500\u552E\u65B9\u516C\u53F8\u548C\u4F9B\u5E94\u5546\u516C\u53F8\u4E0D\u80FD\u76F8\u540C");return}S.value.validate(r=>{if(!r)return null;(E.value===g.update||E.value===g.proUpdate?se:de)(a.value)})}function me(o,u){const d=o===g.update||o===g.proUpdate||o===g.preview;if(E.value=o,b.value=!0,!d&&!w.value.companyNo){k.warning("\u8BF7\u5728\u53F3\u4E0A\u89D2\u9009\u62E9\u4E00\u5BB6\u516C\u53F8");return}if(d){ie({id:u});return}Q(),a.value.companyNo=w.value.companyNo,H(()=>N.value.initalData({companyNo:w.value.companyNo}))}return _({onDisplay:me}),(o,u)=>{const d=s("ElTag"),p=s("ElDivider"),r=s("ElCol"),n=s("ElFormItem"),v=s("ElInputNumber"),c=s("ElInput"),U=s("ElDatePicker"),y=s("ElOption"),D=s("ElSelect"),Y=s("ElButton"),ge=s("ElRow"),fe=s("ElDialog"),ce=_e("loading");return x(),q(fe,{modelValue:b.value,"onUpdate:modelValue":u[21]||(u[21]=t=>b.value=t),title:f(te),"destroy-on-close":"",width:"1040px",top:"10vh",center:"",onClose:u[22]||(u[22]=()=>a.value={...f($)}),"close-on-click-modal":!1},{default:l(()=>[Ce((x(),q(f(ye),{ref_key:"formRef",ref:S,model:a.value,rules:f(Le),"label-width":"70px",disabled:E.value===f(g).preview},{default:l(()=>[e(ge,{gutter:10},{default:l(()=>[e(r,{span:24,style:{padding:"0 0 10px 0","margin-top":"-5px"}},{default:l(()=>[e(p,null,{default:l(()=>[e(d,null,{default:l(()=>[F("\u9500\u552E\u8BA2\u5355\u4FE1\u606F")]),_:1})]),_:1})]),_:1}),e(r,{span:8},{default:l(()=>[e(n,{label:"\u6240\u5C5E\u5E73\u53F0","label-width":"85px",prop:"platform_id"},{default:l(()=>[e(ke,{visible:b.value,modelValue:a.value.platform_id,"onUpdate:modelValue":u[0]||(u[0]=t=>a.value.platform_id=t),placeholder:"\u6240\u5C5E\u5E73\u53F0",maxlength:"200"},null,8,["visible","modelValue"])]),_:1})]),_:1}),j(` <ElCol :span="8">\r
- <ElFormItem label="\u9500\u552E\u5458\u90E8\u95E8" prop="sale_depart">\r
- <ElSelect style="width: 100%" v-model="formData.sale_depart">\r
- <ElOption\r
- v-for="(deparment, index) in saleDepartOptions"\r
- :label="deparment.value"\r
- :value="deparment.value"\r
- :disabled="deparment.status !== '1'"\r
- :key="index"\r
- />\r
- </ElSelect>\r
- </ElFormItem>\r
- </ElCol> `),e(r,{span:6},{default:l(()=>[e(n,{label:"\u91C7\u8D2D\u6BDB\u5229\u7387","label-width":"95px",prop:"cgd_tax"},{default:l(()=>[e(v,{modelValue:a.value.cgd_tax,"onUpdate:modelValue":u[1]||(u[1]=t=>a.value.cgd_tax=t),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:5},{default:l(()=>[e(n,{label:"\u9500\u552E\u5458",prop:"sale_id"},{default:l(()=>[e(Oe,{ref_key:"saleUserRef",ref:A,companyNo:a.value.companyNo,modelValue:a.value.sale_id,"onUpdate:modelValue":u[2]||(u[2]=t=>a.value.sale_id=t),onItemChange:u[3]||(u[3]=t=>L(t,"sale_name"))},null,8,["companyNo","modelValue"])]),_:1})]),_:1}),e(r,{span:5},{default:l(()=>[e(n,{label:"\u91C7\u8D2D\u5458",prop:"buyerid"},{default:l(()=>[e(Se,{ref_key:"buyerUserRef",ref:P,modelValue:a.value.buyerid,"onUpdate:modelValue":u[4]||(u[4]=t=>a.value.buyerid=t),companyNo:a.value.companyNo,onItemChange:u[5]||(u[5]=t=>L(t,"buyer"))},null,8,["modelValue","companyNo"])]),_:1})]),_:1}),j(` <ElCol :span="8">\r
- <ElFormItem label="\u91C7\u8D2D\u5458\u90E8\u95E8" prop="cgd_depart">\r
- <ElSelect style="width: 100%" v-model="formData.cgd_depart">\r
- <ElOption\r
- v-for="(deparment, index) in purchaseDepartOptions"\r
- :label="deparment.value"\r
- :value="deparment.value"\r
- :disabled="deparment.status !== '1'"\r
- :key="index"\r
- />\r
- </ElSelect>\r
- </ElFormItem>\r
- </ElCol> `),e(r,{span:12},{default:l(()=>[e(n,{label:"\u5355\u636E\u53F7",prop:"workCode"},{default:l(()=>[e(c,{modelValue:a.value.workCode,"onUpdate:modelValue":u[6]||(u[6]=t=>a.value.workCode=t),placeholder:"\u5355\u636E\u53F7",maxlength:"200"},null,8,["modelValue"])]),_:1})]),_:1}),e(r,{span:12},{default:l(()=>[e(n,{label:"\u5E73\u53F0\u8BA2\u5355\u7F16\u7801",prop:"poCode","label-width":"110px"},{default:l(()=>[e(c,{modelValue:a.value.poCode,"onUpdate:modelValue":u[7]||(u[7]=t=>a.value.poCode=t),placeholder:"\u5E73\u53F0\u8BA2\u5355\u7F16\u7801",maxlength:"200"},null,8,["modelValue"])]),_:1})]),_:1}),e(r,{span:12},{default:l(()=>[e(n,{label:"\u8D2D\u4E70\u65B9\u516C\u53F8",prop:"khNo","label-width":"95px"},{default:l(()=>[e(Re,{ref_key:"customerRef",ref:h,modelValue:a.value.khNo,"onUpdate:modelValue":u[8]||(u[8]=t=>a.value.khNo=t)},null,8,["modelValue"])]),_:1})]),_:1}),e(r,{span:12},{default:l(()=>[e(n,{label:"\u9500\u552E\u65B9\u516C\u53F8",prop:"companyNo","label-width":"95px"},{default:l(()=>[e(he,{ref_key:"companyRef",ref:N,modelValue:a.value.companyNo,"onUpdate:modelValue":u[9]||(u[9]=t=>a.value.companyNo=t),disabled:E.value!==f(g).proUpdate},null,8,["modelValue","disabled"])]),_:1})]),_:1}),e(r,{span:24,style:{padding:"0 0 10px 0","margin-top":"-5px"}},{default:l(()=>[e(p,null,{default:l(()=>[e(d,null,{default:l(()=>[F("\u6536\u8D27\u4FE1\u606F")]),_:1})]),_:1})]),_:1}),e(r,{span:8},{default:l(()=>[e(n,{label:"\u6536\u8D27\u4EBA",prop:"contactor"},{default:l(()=>[e(c,{modelValue:a.value.contactor,"onUpdate:modelValue":u[10]||(u[10]=t=>a.value.contactor=t),placeholder:"\u6536\u8D27\u4EBA",maxlength:"200"},null,8,["modelValue"])]),_:1})]),_:1}),e(r,{span:8},{default:l(()=>[e(n,{label:"\u8054\u7CFB\u7535\u8BDD",prop:"mobile","label-width":"80px"},{default:l(()=>[e(c,{modelValue:a.value.mobile,"onUpdate:modelValue":u[11]||(u[11]=t=>a.value.mobile=t),placeholder:"\u8054\u7CFB\u7535\u8BDD",maxlength:"11"},null,8,["modelValue"])]),_:1})]),_:1}),e(r,{span:8},{default:l(()=>[e(n,{label:"\u53D1\u8D27\u65F6\u95F4",prop:"sendtime","label-width":"80px"},{default:l(()=>[e(U,{modelValue:a.value.sendtime,"onUpdate:modelValue":u[12]||(u[12]=t=>a.value.sendtime=t),"disabled-date":z,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},{default:l(()=>[e(n,{label:"\u8054\u7CFB\u5730\u5740",prop:"addr","label-width":"80px"},{default:l(()=>[e(c,{modelValue:a.value.addr,"onUpdate:modelValue":u[13]||(u[13]=t=>a.value.addr=t),placeholder:"\u8054\u7CFB\u5730\u5740",maxlength:"200"},null,8,["modelValue"])]),_:1})]),_:1}),e(r,{span:24,style:{padding:"0 0 10px 0","margin-top":"-5px"}},{default:l(()=>[e(p,null,{default:l(()=>[e(d,null,{default:l(()=>[F("\u5546\u54C1\u4FE1\u606F")]),_:1})]),_:1})]),_:1}),e(r,{span:12},{default:l(()=>[e(n,{label:"\u4F9B\u5E94\u5546\u516C\u53F8",prop:"supplierNo","label-width":"95px"},{default:l(()=>[e(Ae,{ref_key:"supplierRef",ref:R,modelValue:a.value.supplierNo,"onUpdate:modelValue":u[14]||(u[14]=t=>a.value.supplierNo=t)},null,8,["modelValue"])]),_:1})]),_:1}),e(r,{span:12},{default:l(()=>[e(n,{label:"\u5546\u54C1\u5206\u7C7B",prop:"cat","label-width":"80px"},{default:l(()=>[e(Pe,{modelValue:a.value.cat,"onUpdate:modelValue":u[15]||(u[15]=t=>a.value.cat=t),style:{width:"100%"},ref_key:"categoryRef",ref:O},null,8,["modelValue"])]),_:1})]),_:1}),e(r,{span:12},{default:l(()=>[e(n,{label:"\u5546\u54C1\u540D\u79F0",prop:"goodName","label-width":"80px"},{default:l(()=>[e(c,{modelValue:a.value.goodName,"onUpdate:modelValue":u[16]||(u[16]=t=>a.value.goodName=t),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:a.value.goodNum,"onUpdate:modelValue":u[17]||(u[17]=t=>a.value.goodNum=t),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:a.value.goodPrice,"onUpdate:modelValue":u[18]||(u[18]=t=>a.value.goodPrice=t),"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:f(ne),placeholder:"\u8D27\u6B3E\u603B\u989D",disabled:""},{append:l(()=>[F("\u5143")]),_:1},8,["value"])]),_:1})]),_:1}),e(r,{span:6},{default:l(()=>[e(n,{label:"\u7A0E\u7387",prop:"tax"},{default:l(()=>[e(D,{style:{width:"100%"},modelValue:a.value.tax,"onUpdate:modelValue":u[19]||(u[19]=t=>a.value.tax=t)},{default:l(()=>[(x(!0),Ve(Be,null,xe(f(Z),t=>(x(),q(y,{key:t.id,label:t.rate+"%",value:t.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(Y,{type:"primary",onClick:pe,loading:f(re)||M.value},{default:l(()=>[F("\u4FDD\u5B58")]),_:1},8,["loading"]),e(Y,{onClick:u[20]||(u[20]=()=>b.value=!1)},{default:l(()=>[F("\u5173\u95ED")]),_:1})]),_:1})]),_:1})]),_:1},8,["model","rules","disabled"])),[[ce,f(oe)]])]),_:1},8,["modelValue","title"])}}});var Ye=be(Qe,[["__file","C:/Users/63107/Desktop/projects/accout-vue3-ui/src/views/netOrderEnter/netOrderEntry/qrd-modal.vue"]]),Je=Object.freeze(Object.defineProperty({__proto__:null,default:Ye},Symbol.toStringTag,{value:"Module"}));export{g as M,Ye as Q,Je as q};
|