import{_ as k,d as q,w,W as M,aP as L,bN as z,b3 as P,x as O,z as E,r as T,o as U,c as j,l as o,C as l,u as e,aN as Q,aM as g,bO as v,a as N,bP as W,aQ as G,bQ as Y,b as i,aS as x,M as p,L as f,aq as $,aW as h,bo as H,bR as u,aR as J,F as K,aY as y,Q as X,R as Z}from"./index.56c69f5a.js";import{h as ee}from"./index.dd812b2f.js";import{o as oe}from"./_options.04c95e2d.js";import{t as ae}from"./status.2df4810d.js";import le from"./order-modal.78efb32e.js";import"./single.efbadb4f.js";import"./index.d07aea6b.js";import"./batch.edfa6665.js";const F=c=>(X("data-v-8e9a5fba"),c=c(),Z(),c),te={class:"w-full flex justify-between"},ue=F(()=>i("span",{style:{color:"red","margin-right":"5px"}},"*",-1)),re=F(()=>i("span",null,"\u901A\u7528\u8BA2\u5355",-1)),se={class:"flex items-center"},ne=F(()=>i("p",{class:"mr-[10px]"},"\u5E73\u53F0\u7C7B\u578B:",-1)),pe={class:"w-full flex justify-end"},ie=q({__name:"order-form",emits:["create"],setup(c,{emit:A}){const b=w(null),C=w(null),r=w([]),{currentCompany:_}=M(),m=L(""),s=z({customerNo:"",companyNo:""}),{run:R}=P({success:()=>A("create")});function D(n){const t=r.value.map(a=>String(a.id)),d=n.filter(({id:a})=>!t.includes(String(a)));r.value=[...r.value,...d]}async function S(){var n;if(r.value.length>150){y.warning("\u901A\u7528\u8BA2\u5355\u6570\u91CF\u4E0D\u80FD\u8D85\u8FC7150\u6761");return}try{if(await((n=C.value)==null?void 0:n.validate()),r.value.length===0)return y.warning("\u8BF7\u9009\u62E9\u901A\u7528\u8BA2\u5355");R(ee({common_ids:r.value.map(t=>t.id)}))}catch{}}function V(){var d;const{companyNo:n,customerNo:t}=s;if(!t){y.warning("\u8BF7\u9009\u62E9\u4E70\u5165\u65B9\u516C\u53F8");return}(d=b.value)==null||d.onDisplay(t,n)}return O(()=>s.companyNo=_.value.companyNo),E(()=>[s.customerNo,s.customerNo],()=>r.value=[]),E(()=>m.value,()=>r.value=[]),(n,t)=>{const d=T("el-switch");return U(),j(K,null,[o(e(J),{rules:e(oe),ref_key:"formRef",ref:C,model:e(s)},{default:l(()=>[o(e(Q),{gutter:10},{default:l(()=>[o(e(g),{span:12},{default:l(()=>[o(e(v),{label:"\u5356\u51FA\u65B9\u516C\u53F8",prop:"companyNo"},{default:l(()=>[N(` \r
              <RemoteSelect \r
                  style="width: 100%" \r
                  :api="httpGetSupplier" \r
                  requestProp="name" \r
                  responseLabel-prop="name"\r
                  responseValProp="code" \r
                  placeholder="\u8BF7\u9009\u62E9\u5356\u65B9\u516C\u53F8" \r
                  v-model:value="formData.companyNo" \r
                  :getLabel="getLabel"\r
                /> \r
              `),o(e(W),{modelValue:e(_).companyName,"onUpdate:modelValue":t[0]||(t[0]=a=>e(_).companyName=a),disabled:""},null,8,["modelValue"])]),_:1})]),_:1}),o(e(g),{span:12},{default:l(()=>[o(e(v),{label:"\u4E70\u5165\u65B9\u516C\u53F8",prop:"customerNo"},{default:l(()=>[N(' <ElInput v-model="currentCompany.companyName" disabled></ElInput> '),o(e(G),{ref:"RemoteSelectRef",modelValue:e(s).customerNo,"onUpdate:modelValue":t[1]||(t[1]=a=>e(s).customerNo=a),style:{width:"100%"},api:e(Y),"requset-prop":"name","response-label-prop":"company_name","response-val-prop":"companyNo"},null,8,["modelValue","api"])]),_:1})]),_:1})]),_:1}),o(e(v),{class:"be-current__item"},{label:l(()=>[i("div",te,[i("div",null,[ue,re,o(e(x),{style:{"margin-left":"10px"},size:"small"},{default:l(()=>[p(f(r.value.length)+"/150",1)]),_:1})]),i("div",se,[ne,o(d,{class:"mr-[10px]",modelValue:e(m),"onUpdate:modelValue":t[2]||(t[2]=a=>$(m)?m.value=a:null),size:"small","active-text":"toC","inactive-text":"toB","active-value":"2","inactive-value":"1"},null,8,["modelValue"]),o(e(h),{type:"primary",size:"small",onClick:V},{default:l(()=>[p("\u6DFB\u52A0\u901A\u7528\u8BA2\u5355")]),_:1})])])]),default:l(()=>[o(e(H),{border:"",size:"small",data:r.value,class:"mt-[10px]","max-height":500},{default:l(()=>[o(e(u),{label:"\u5E8F\u53F7",type:"index",fixed:"left",align:"center"}),o(e(u),{label:"\u901A\u7528\u8BA2\u5355\u7F16\u53F7","min-width":"160",prop:"tyCode","show-overflow-tooltip":""}),o(e(u),{label:"\u786E\u8BA4\u5355\u7F16\u53F7","min-width":"160",prop:"orderCode","show-overflow-tooltip":""}),o(e(u),{label:"\u9500\u552E\u8BA2\u5355\u4E3B\u7F16\u53F7","min-width":"160",prop:"cxCode","show-overflow-tooltip":""}),o(e(u),{label:"\u7533\u8BF7\u4EBA",prop:"apply_name",width:"100px","show-overflow-tooltip":""}),o(e(u),{label:"\u5546\u54C1\u7F16\u53F7","min-width":"160",prop:"goodNo","show-overflow-tooltip":""}),o(e(u),{label:"\u5546\u54C1\u540D\u79F0","min-width":"160",prop:"goodName","show-overflow-tooltip":""}),o(e(u),{label:"\u5356\u51FA\u65B9\u516C\u53F8","min-width":"160",prop:"companyName","show-overflow-tooltip":""}),o(e(u),{label:"\u4E0B\u5355\u6570\u91CF",width:"80",prop:"goodNum","show-overflow-tooltip":""},{default:l(a=>[p(f(a.row.qrd?a.row.qrd.goodNum:""),1)]),_:1}),o(e(u),{label:"\u9500\u552E\u5355\u4EF7",width:"80",prop:"goodPrice","show-overflow-tooltip":""},{default:l(a=>[p(f(a.row.qrd?a.row.qrd.goodPrice:""),1)]),_:1}),o(e(u),{label:"\u5BF9\u8D26\u72B6\u6001",width:"80",prop:"status","show-overflow-tooltip":""},{default:l(a=>[o(e(x),null,{default:l(()=>{var B;return[p(f(((B=e(ae).find(I=>I.value==a.row.status))==null?void 0:B.label)||"--"),1)]}),_:2},1024)]),_:1}),o(e(u),{label:"\u4E0B\u5355\u65F6\u95F4",width:"100",prop:"addtime","show-overflow-tooltip":""}),o(e(u),{label:"\u64CD\u4F5C",fixed:"right",width:"60px"},{default:l(a=>[o(e(h),{size:"small",type:"primary",text:"",onClick:()=>r.value.splice(a.$index)},{default:l(()=>[p("\u5220\u9664")]),_:2},1032,["onClick"])]),_:1})]),_:1},8,["data"])]),_:1}),i("div",pe,[o(e(h),{type:"primary",onClick:S},{default:l(()=>[p("\u4FDD\u5B58")]),_:1})])]),_:1},8,["rules","model"]),o(le,{platform_type:e(m),ref_key:"orderModalRef",ref:b,onList:D},null,8,["platform_type"])],64)}}});var ye=k(ie,[["__scopeId","data-v-8e9a5fba"],["__file","C:/Users/63107/Desktop/projects/accout-vue3-ui/src/views/InvoiceSales/currentcyOrderRecord/components/order-form.vue"]]);export{ye as default};
