import{_ as S,d as T,n as f,O as j,k as I,d3 as M,aa as V,ct as z,w as G,r as p,aw as H,B as q,i,o as L,A as U,y as s,e as v,h as e,dF as $,dH as J,H as _,G as y,cd as K,cm as P}from"./index.js";import{i as Q,r as W}from"./constants.42afb0d7.js";import{b as X}from"./index.f78c594b.js";import Y from"./modal.7255c2.js";import"./qr.79c2b7.js";import"./cg.735768.js";import"./single.af422d.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=T({__name:"form",setup(te){const r=f([]),{currentCompany:d}=j(),l=f({...Q()}),F=f(null),c=f(null),{push:b}=I(),{run:x,loading:h}=M({success:()=>b("/postSupplierOrder/postSupplierOrderCollection?tab=sendOrderRecord_collection")}),C=u=>{const{code:o,name:n,type:t}=u,m=t==="3"||t==="\u4E1A\u52A1\u516C\u53F8"?"(\u5DF2\u5347\u7EA7\u4E3A\u4E1A\u52A1\u516C\u53F8)":"";return o+" / "+n+m};function D(){var u;if(!l.value.companyNo||!l.value.supplierNo){P.warning("\u8BF7\u9009\u62E9\u4E70\u65B9\u516C\u53F8\u548C\u5356\u65B9\u516C\u53F8");return}(u=F.value)==null||u.open()}function A(u){var n;const{sids:o}=l.value;u.forEach(t=>{o.includes(t.id)||(l.value.sids.push(t.id),r.value.push(t))}),(n=c.value)==null||n.validateField("sids")}function B(u){var n;const o=r.value.findIndex(t=>t.id===u.id);l.value.sids.splice(o,1),r.value.splice(o,1),(n=c.value)==null||n.validateField("sids")}async function N(){try{await c.value.validate();const{sids:u}=l.value;x(X({cids:u}))}catch{}}const g=V(()=>r.value.reduce((u,o)=>Number(z(u,o.post_fee)).toFixed(2),0));return G(()=>d,()=>{l.value.companyNo=d.value.companyNo},{immediate:!0,deep:!0}),(u,o)=>{const n=p("el-input"),t=p("ElFormItem"),E=p("ElTag"),m=p("ElButton"),a=p("ElTableColumn"),k=p("el-button"),O=p("ElTable"),R=H("loading");return q((L(),U(i(K),{rules:i(W),model:l.value,ref_key:"formRef",ref:c},{default:s(()=>[v("div",Z,[e(t,{label:"\u4E1A\u52A1\u516C\u53F8",prop:"companyNo"},{default:s(()=>[e(n,{disabled:"",style:{width:"386px"},value:i(d).companyName,placeholder:"\u8BF7\u9009\u62E9\u4E70\u65B9\u516C\u53F8"},null,8,["value"])]),_:1}),e(t,{label:"\u7269\u6D41\u4F9B\u5E94\u5546",prop:"supplierNo"},{default:s(()=>[e(i($),{value:l.value.supplierNo,"onUpdate:value":o[0]||(o[0]=w=>l.value.supplierNo=w),api:i(J),style:{width:"386px"},placeholder:"\u8BF7\u9009\u62E9\u5356\u65B9\u516C\u53F8","request-prop":"name","response-label-prop":"name","response-val-prop":"code","disabled-value":i(d).companyNo,getLabel:C},null,8,["value","api","disabled-value"])]),_:1})]),e(t,{prop:"sids",label:"\u53D1\u8D27\u8FD0\u5355\u4FE1\u606F"},{default:s(()=>[v("div",ee,[v("div",oe,[e(E,{type:"warning"},{default:s(()=>[_("\u5171\u8BA1"+y(l.value.sids.length)+"\u4E2A\u8BA2\u5355, \u5171\u8BA1"+y(g.value)+"\u5143",1)]),_:1}),e(m,{type:"primary",onClick:D},{default:s(()=>o[1]||(o[1]=[_("\u6DFB\u52A0\u53D1\u8D27\u8FD0\u5355")])),_:1})]),e(O,{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:"\u5907\u6CE8",prop:"remark","min-width":"140px","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:w})=>[e(k,{type:"text",onClick:ae=>B(w),size:"small"},{default:s(()=>o[2]||(o[2]=[_("\u5220\u9664")])),_:2},1032,["onClick"])]),_:1})]),_:1},8,["data"])])]),_:1}),v("div",ue,[e(m,{type:"primary",onClick:N,loading:i(h)},{default:s(()=>o[3]||(o[3]=[_("\u4FDD\u5B58")])),_:1},8,["loading"])]),e(Y,{ref_key:"modalRef",ref:F,onAdd:A,companyNo:l.value.companyNo,supplierNo:l.value.supplierNo},null,8,["companyNo","supplierNo"])]),_:1},8,["rules","model"])),[[R,i(h)]])}}});var me=S(le,[["__file","D:/work/jiesuan/settle-vue3/src/views/postSupplierOrder/sendOrderRecord/components/form.vue"]]);export{me as default};
