import{_ as S,d as O,w as f,W as M,n as j,bv as z,ag as I,z as V,r as i,aC as G,H as L,u as p,o as U,G as q,C as s,b as v,l as e,aQ as H,bM as Q,M as _,L as E,aR as W,aY as Y}from"./index.56c69f5a.js";import{i as $,r as J}from"./constants.42afb0d7.js";import{b as K}from"./index.5ce46a74.js";import P from"./modal.603605a0.js";import{a as X}from"./calc.850c7422.js";import"./qr.50a65734.js";import"./cg.11583519.js";import"./single.9f2f383c.js";const Z={flex:"","gap-10":""},ee={class:"w-full"},oe={class:"flex justify-between w-full mb-[10px]"},ue={class:"flex justify-end"},le=O({__name:"form",setup(te){const r=f([]),{currentCompany:d}=M(),u=f({...$()}),w=f(null),c=f(null),{push:y}=j(),{run:b,loading:C}=z({success:()=>y("/postSupplierOrder/sendOrderRecord")}),x=o=>{const{code:t,name:n,type:l}=o,m=l==="3"||l==="\u4E1A\u52A1\u516C\u53F8"?"(\u5DF2\u5347\u7EA7\u4E3A\u4E1A\u52A1\u516C\u53F8)":"";return t+" / "+n+m};function D(){var o;if(!u.value.companyNo||!u.value.supplierNo){Y.warning("\u8BF7\u9009\u62E9\u4E70\u65B9\u516C\u53F8\u548C\u5356\u65B9\u516C\u53F8");return}(o=w.value)==null||o.open()}function A(o){var n;const{sids:t}=u.value;o.forEach(l=>{t.includes(l.id)||(u.value.sids.push(l.id),r.value.push(l))}),(n=c.value)==null||n.validateField("sids")}function B(o){var n;const t=r.value.findIndex(l=>l.id===o.id);u.value.sids.splice(t,1),r.value.splice(t,1),(n=c.value)==null||n.validateField("sids")}async function N(){try{await c.value.validate();const{sids:o}=u.value;b(K({cids:o}))}catch{}}const g=I(()=>r.value.reduce((o,t)=>Number(X(o,t.post_fee)).toFixed(2),0));return V(()=>d,()=>{u.value.companyNo=d.value.companyNo},{immediate:!0,deep:!0}),(o,t)=>{const n=i("el-input"),l=i("ElFormItem"),F=i("ElTag"),m=i("ElButton"),a=i("ElTableColumn"),k=i("el-button"),R=i("ElTable"),T=G("loading");return L((U(),q(p(W),{rules:p(J),model:u.value,ref_key:"formRef",ref:c},{default:s(()=>[v("div",Z,[e(l,{label:"\u4E1A\u52A1\u516C\u53F8",prop:"companyNo"},{default:s(()=>[e(n,{disabled:"",style:{width:"386px"},value:p(d).companyName,placeholder:"\u8BF7\u9009\u62E9\u4E70\u65B9\u516C\u53F8"},null,8,["value"])]),_:1}),e(l,{label:"\u7269\u6D41\u4F9B\u5E94\u5546",prop:"supplierNo"},{default:s(()=>[e(p(H),{value:u.value.supplierNo,"onUpdate:value":t[0]||(t[0]=h=>u.value.supplierNo=h),api:p(Q),style:{width:"386px"},placeholder:"\u8BF7\u9009\u62E9\u5356\u65B9\u516C\u53F8","request-prop":"name","response-label-prop":"name","response-val-prop":"code","disabled-value":p(d).companyNo,getLabel:x},null,8,["value","api","disabled-value"])]),_:1})]),e(l,{prop:"sids",label:"\u53D1\u8D27\u8FD0\u5355\u4FE1\u606F"},{default:s(()=>[v("div",ee,[v("div",oe,[e(F,{type:"warning"},{default:s(()=>[_("\u5171\u8BA1"+E(u.value.sids.length)+"\u4E2A\u8BA2\u5355, \u5171\u8BA1"+E(p(g))+"\u5143",1)]),_:1}),e(m,{type:"primary",onClick:D},{default:s(()=>[_("\u6DFB\u52A0\u53D1\u8D27\u8FD0\u5355")]),_:1})]),e(R,{size:"small",border:"",data:r.value,"max-height":"450px"},{default:s(()=>[e(a,{type:"index",label:"\u5E8F\u53F7","min-width":"55","show-overflow-tooltip":""}),e(a,{prop:"TrackCode",label:"\u53D1\u8D27\u8FD0\u5355\u7F16\u53F7","min-width":"150px","show-overflow-tooltip":""}),e(a,{prop:"outChildCode",label:"\u53D1\u8D27\u5DE5\u5355\u7F16\u53F7","min-width":"160px","show-overflow-tooltip":""}),e(a,{prop:"orderCode",label:"\u9500\u552E\u8BA2\u5355\u7F16\u53F7","min-width":"150px","show-overflow-tooltip":""}),e(a,{prop:"companyName",label:"\u4E1A\u52A1\u516C\u53F8","min-width":"180px","show-overflow-tooltip":""}),e(a,{prop:"supplierName",label:"\u7269\u6D41\u4F9B\u5E94\u5546","min-width":"180px","show-overflow-tooltip":""}),e(a,{label:"\u7269\u6D41\u8D39\u7528","min-width":"100px",prop:"post_fee","show-overflow-tooltip":""}),e(a,{label:"\u521B\u5EFA\u4EBA",prop:"apply_name","min-width":"120px","show-overflow-tooltip":""}),e(a,{label:"\u521B\u5EFA\u65F6\u95F4",prop:"create_time","min-width":"140px","show-overflow-tooltip":""}),e(a,{label:"\u64CD\u4F5C",width:"65px",align:"center",fixed:"right"},{default:s(({row:h})=>[e(k,{type:"text",onClick:ae=>B(h),size:"small"},{default:s(()=>[_("\u5220\u9664")]),_:2},1032,["onClick"])]),_:1})]),_:1},8,["data"])])]),_:1}),v("div",ue,[e(m,{type:"primary",onClick:N},{default:s(()=>[_("\u4FDD\u5B58")]),_:1})]),e(P,{ref_key:"modalRef",ref:w,onAdd:A,companyNo:u.value.companyNo,supplierNo:u.value.supplierNo},null,8,["companyNo","supplierNo"])]),_:1},8,["rules","model"])),[[T,p(C)]])}}});var fe=S(le,[["__file","C:/Users/63107/Desktop/projects/accout-vue3-ui/src/views/postSupplierOrder/sendOrderRecord/components/form.vue"]]);export{fe as default};
