import{_ as I,d as k,x as v,W as L,aP as M,cl as z,bc as P,y as O,A as E,r as T,o as U,c as j,l as o,D as l,m as e,cm as G,bZ as B,cn as h,a as x,co as Q,cg as Z,cp as $,h as p,aR as N,M as r,L as n,ar as W,bY as F,bz as Y,cq as t,c1 as H,aQ as J,F as K,aZ as w,Q as X,R as ee}from"./index.js";import{h as oe}from"./index.f522024d.js";import{o as ue}from"./_options.04c95e2d.js";import le from"./order-modal.168fb9.js";import"./single.e44042.js";import"./index.31497729.js";import"./batch.ea7b57.js";const g=f=>(X("data-v-8e9a5fba"),f=f(),ee(),f),te={class:"w-full flex justify-between"},ae=g(()=>p("span",{style:{color:"red","margin-right":"5px"}},"*",-1)),re=g(()=>p("span",null,"\u901A\u7528\u8BA2\u5355",-1)),se={class:"flex items-center"},ne=g(()=>p("p",{class:"mr-[10px]"},"\u5E73\u53F0\u7C7B\u578B:",-1)),de={class:"w-full flex justify-end"},ie=k({__name:"order-form",emits:["create"],setup(f,{emit:A}){const y=v(null),C=v(null),s=v([]),{currentCompany:_}=L(),c=M(""),i=z({customerNo:"",companyNo:""}),{run:D}=P({success:()=>A("create")});function R(d){const a=s.value.map(u=>String(u.id)),m=d.filter(({id:u})=>!a.includes(String(u)));s.value=[...s.value,...m]}async function V(){var d;if(s.value.length>150){w.warning("\u901A\u7528\u8BA2\u5355\u6570\u91CF\u4E0D\u80FD\u8D85\u8FC7150\u6761");return}try{if(await((d=C.value)==null?void 0:d.validate()),s.value.length===0)return w.warning("\u8BF7\u9009\u62E9\u901A\u7528\u8BA2\u5355");D(oe({common_ids:s.value.map(a=>a.id)}))}catch{}}function S(){var m;const{companyNo:d,customerNo:a}=i;if(!a){w.warning("\u8BF7\u9009\u62E9\u4E70\u5165\u65B9\u516C\u53F8");return}if(a===d){w.warning("\u5356\u51FA\u65B9\u516C\u53F8\u4E0E\u4E70\u5165\u65B9\u516C\u53F8\u4E0D\u80FD\u662F\u540C\u4E00\u5BB6\u516C\u53F8");return}(m=y.value)==null||m.onDisplay(a,d)}return O(()=>{i.companyNo=_.value.companyNo}),E(()=>[i.customerNo,i.customerNo],()=>s.value=[]),E(()=>c.value,()=>s.value=[]),(d,a)=>{const m=T("el-switch");return U(),j(K,null,[o(e(J),{rules:e(ue),ref_key:"formRef",ref:C,model:e(i)},{default:l(()=>[o(e(G),{gutter:10},{default:l(()=>[o(e(B),{span:12},{default:l(()=>[o(e(h),{label:"\u5356\u51FA\u65B9\u516C\u53F8",prop:"companyNo"},{default:l(()=>[x(` \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(Q),{modelValue:e(_).companyName,"onUpdate:modelValue":a[0]||(a[0]=u=>e(_).companyName=u),disabled:""},null,8,["modelValue"])]),_:1})]),_:1}),o(e(B),{span:12},{default:l(()=>[o(e(h),{label:"\u4E70\u5165\u65B9\u516C\u53F8",prop:"customerNo"},{default:l(()=>[x(' <ElInput modelValue="\u5317\u4EAC\u4E07\u5B87\u6052\u901A\u56FD\u9645\u79D1\u8D38\u6709\u9650\u516C\u53F8" disabled></ElInput> '),o(e(Z),{ref:"RemoteSelectRef",modelValue:e(i).customerNo,"onUpdate:modelValue":a[1]||(a[1]=u=>e(i).customerNo=u),style:{width:"100%"},api:e($),"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(()=>[p("div",te,[p("div",null,[ae,re,o(e(N),{style:{"margin-left":"10px"},size:"small"},{default:l(()=>[r(n(s.value.length)+"/150",1)]),_:1})]),p("div",se,[ne,o(m,{class:"mr-[10px]",modelValue:e(c),"onUpdate:modelValue":a[2]||(a[2]=u=>W(c)?c.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(()=>[r("\u6DFB\u52A0\u901A\u7528\u8BA2\u5355")]),_:1})])])]),default:l(()=>[o(e(Y),{border:"",size:"small",data:s.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:"\u7C7B\u76EE\u7F16\u7801","min-width":"130","show-overflow-tooltip":""},{default:l(u=>[r(n(u.row.good?u.row.good.cgd_inv_cat_code:""),1)]),_:1}),o(e(t),{label:"\u8D27\u7269\u548C\u52B3\u52A1\u540D\u79F0","min-width":"130","show-overflow-tooltip":""},{default:l(u=>[r(n(u.row.good?u.row.good.cgd_inv_cat_name:""),1)]),_:1}),o(e(t),{label:"\u5F00\u7968\u5546\u54C1\u540D\u79F0","min-width":"160","show-overflow-tooltip":""},{default:l(u=>[r(n(u.row.good?u.row.good.cgd_inv_good_name:""),1)]),_:1}),o(e(t),{label:"\u5F00\u7968\u7A0E\u7387","min-width":"80","show-overflow-tooltip":""},{default:l(u=>[r(n(u.row.good?u.row.good.cgd_inv_tax:""),1)]),_:1}),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=>[r(n(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=>[r(n(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 b;return[r(n(((b=e(H).find(q=>q.value==u.row.status))==null?void 0:b.label)||"--"),1)]}),_:2},1024)]),_:1}),o(e(t),{label:"\u7A0E\u7387",width:"80",prop:"goodPrice","show-overflow-tooltip":""},{default:l(u=>[r(n(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:()=>s.value.splice(u.$index)},{default:l(()=>[r("\u5220\u9664")]),_:2},1032,["onClick"])]),_:1})]),_:1},8,["data"])]),_:1}),p("div",de,[o(e(F),{type:"primary",onClick:V},{default:l(()=>[r("\u4FDD\u5B58")]),_:1})])]),_:1},8,["rules","model"]),o(le,{platform_type:e(c),ref_key:"orderModalRef",ref:y,onList:R},null,8,["platform_type"])],64)}}});var he=I(ie,[["__scopeId","data-v-8e9a5fba"],["__file","C:/Users/89793/Desktop/projects/settle-vue3/src/views/InvoiceSales/currentcyOrderRecord/components/order-form.vue"]]);export{he as default};
