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