import{_ as q,d as k,n as v,O as I,cc as L,dL as M,cB as O,p as P,w as C,r as z,o as T,c as j,h as o,y as t,i as e,dM as G,dn as E,dN as _,a as B,dO as U,dF as $,dP as H,e as p,ce as b,H as r,G as s,dm as F,cY as Q,dQ as a,dq as Y,cd as J,F as K,cm as w}from"./index.js";import{h as W}from"./index.d650a936.js";import{o as X}from"./_options.04c95e2d.js";import Z from"./order-modal.8abc75.js";import"./single.265cc1.js";import"./index.43fba9db.js";import"./batch.961d4c.js";const ee={class:"w-full flex justify-between"},oe={class:"flex items-center"},ue={class:"w-full flex justify-end"},le=k({__name:"order-form",emits:["create"],setup(te,{emit:x}){const N=x,h=v(null),y=v(null),n=v([]),{currentCompany:c}=I(),f=L(""),i=M({customerNo:"",companyNo:""}),{run:A}=O({success:()=>N("create")});function D(d){const l=n.value.map(u=>String(u.id)),m=d.filter(({id:u})=>!l.includes(String(u)));n.value=[...n.value,...m]}async function V(){var d;if(n.value.length>150){w.warning("\u901A\u7528\u8BA2\u5355\u6570\u91CF\u4E0D\u80FD\u8D85\u8FC7150\u6761");return}try{if(await((d=y.value)==null?void 0:d.validate()),n.value.length===0)return w.warning("\u8BF7\u9009\u62E9\u901A\u7528\u8BA2\u5355");A(W({common_ids:n.value.map(l=>l.id)}))}catch{}}function R(){var m;const{companyNo:d,customerNo:l}=i;if(!l){w.warning("\u8BF7\u9009\u62E9\u4E70\u5165\u65B9\u516C\u53F8");return}if(l===d){w.warning("\u5356\u51FA\u65B9\u516C\u53F8\u4E0E\u4E70\u5165\u65B9\u516C\u53F8\u4E0D\u80FD\u662F\u540C\u4E00\u5BB6\u516C\u53F8");return}(m=h.value)==null||m.onDisplay(l,d)}return P(()=>{i.companyNo=c.value.companyNo}),C(()=>[i.customerNo,i.customerNo],()=>n.value=[]),C(()=>f.value,()=>n.value=[]),(d,l)=>{const m=z("el-switch");return T(),j(K,null,[o(e(J),{rules:e(X),ref_key:"formRef",ref:y,model:e(i)},{default:t(()=>[o(e(G),{gutter:10},{default:t(()=>[o(e(E),{span:12},{default:t(()=>[o(e(_),{label:"\u5356\u51FA\u65B9\u516C\u53F8",prop:"companyNo"},{default:t(()=>[B(` \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(U),{modelValue:e(c).companyName,"onUpdate:modelValue":l[0]||(l[0]=u=>e(c).companyName=u),disabled:""},null,8,["modelValue"])]),_:1})]),_:1}),o(e(E),{span:12},{default:t(()=>[o(e(_),{label:"\u4E70\u5165\u65B9\u516C\u53F8",prop:"customerNo"},{default:t(()=>[B(' <ElInput modelValue="\u5317\u4EAC\u4E07\u5B87\u6052\u901A\u56FD\u9645\u79D1\u8D38\u6709\u9650\u516C\u53F8" disabled></ElInput> '),o(e($),{ref:"RemoteSelectRef",modelValue:e(i).customerNo,"onUpdate:modelValue":l[1]||(l[1]=u=>e(i).customerNo=u),style:{width:"100%"},api:e(H),"requset-prop":"name","response-label-prop":"company_name","response-val-prop":"companyNo",disabledValue:"GS2404151642335170"},null,8,["modelValue","api"])]),_:1})]),_:1})]),_:1}),o(e(_),{class:"be-current__item"},{label:t(()=>[p("div",ee,[p("div",null,[l[3]||(l[3]=p("span",{style:{color:"red","margin-right":"5px"}},"*",-1)),l[4]||(l[4]=p("span",null,"\u901A\u7528\u8BA2\u5355",-1)),o(e(b),{style:{"margin-left":"10px"},size:"small"},{default:t(()=>[r(s(n.value.length)+"/150",1)]),_:1})]),p("div",oe,[l[6]||(l[6]=p("p",{class:"mr-[10px]"},"\u5E73\u53F0\u7C7B\u578B:",-1)),o(m,{class:"mr-[10px]",modelValue:f.value,"onUpdate:modelValue":l[2]||(l[2]=u=>f.value=u),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:R},{default:t(()=>l[5]||(l[5]=[r("\u6DFB\u52A0\u901A\u7528\u8BA2\u5355")])),_:1})])])]),default:t(()=>[o(e(Q),{border:"",size:"small",data:n.value,class:"mt-[10px]","max-height":500},{default:t(()=>[o(e(a),{label:"\u5E8F\u53F7",type:"index",fixed:"left",align:"center"}),o(e(a),{label:"\u901A\u7528\u8BA2\u5355\u7F16\u53F7","min-width":"160",prop:"tyCode","show-overflow-tooltip":""}),o(e(a),{label:"\u786E\u8BA4\u5355\u7F16\u53F7","min-width":"160",prop:"orderCode","show-overflow-tooltip":""}),o(e(a),{label:"\u9500\u552E\u8BA2\u5355\u4E3B\u7F16\u53F7","min-width":"160",prop:"cxCode","show-overflow-tooltip":""}),o(e(a),{label:"\u7533\u8BF7\u4EBA",prop:"apply_name",width:"100px","show-overflow-tooltip":""}),o(e(a),{label:"\u5546\u54C1\u7F16\u53F7","min-width":"160",prop:"goodNo","show-overflow-tooltip":""}),o(e(a),{label:"\u5546\u54C1\u540D\u79F0","min-width":"160",prop:"goodName","show-overflow-tooltip":""}),o(e(a),{label:"\u7C7B\u76EE\u7F16\u7801","min-width":"130","show-overflow-tooltip":""},{default:t(u=>[r(s(u.row.good?u.row.good.cgd_inv_cat_code:""),1)]),_:1}),o(e(a),{label:"\u8D27\u7269\u548C\u52B3\u52A1\u540D\u79F0","min-width":"130","show-overflow-tooltip":""},{default:t(u=>[r(s(u.row.good?u.row.good.cgd_inv_cat_name:""),1)]),_:1}),o(e(a),{label:"\u5F00\u7968\u5546\u54C1\u540D\u79F0","min-width":"160","show-overflow-tooltip":""},{default:t(u=>[r(s(u.row.good?u.row.good.cgd_inv_good_name:""),1)]),_:1}),o(e(a),{label:"\u5F00\u7968\u7A0E\u7387","min-width":"80","show-overflow-tooltip":""},{default:t(u=>[r(s(u.row.good?u.row.good.cgd_inv_tax:""),1)]),_:1}),o(e(a),{label:"\u5356\u51FA\u65B9\u516C\u53F8","min-width":"160",prop:"companyName","show-overflow-tooltip":""}),o(e(a),{label:"\u4E0B\u5355\u6570\u91CF",width:"80",prop:"goodNum","show-overflow-tooltip":""},{default:t(u=>[r(s(u.row.qrd?u.row.qrd.goodNum:""),1)]),_:1}),o(e(a),{label:"\u9500\u552E\u5355\u4EF7",width:"80",prop:"goodPrice","show-overflow-tooltip":""},{default:t(u=>[r(s(u.row.qrd?u.row.qrd.goodPrice:""),1)]),_:1}),o(e(a),{label:"\u5BF9\u8D26\u72B6\u6001",width:"80",prop:"status","show-overflow-tooltip":""},{default:t(u=>[o(e(b),null,{default:t(()=>{var g;return[r(s(((g=e(Y).find(S=>S.value==u.row.status))==null?void 0:g.label)||"--"),1)]}),_:2},1024)]),_:1}),o(e(a),{label:"\u7A0E\u7387",width:"80",prop:"goodPrice","show-overflow-tooltip":""},{default:t(u=>[r(s(u.row.qrd?`${u.row.qrd.tax}%`:""),1)]),_:1}),o(e(a),{label:"\u4E0B\u5355\u65F6\u95F4",width:"100",prop:"addtime","show-overflow-tooltip":""}),o(e(a),{label:"\u64CD\u4F5C",fixed:"right",width:"60px"},{default:t(u=>[o(e(F),{size:"small",type:"primary",text:"",onClick:()=>n.value.splice(u.$index)},{default:t(()=>l[7]||(l[7]=[r("\u5220\u9664")])),_:2},1032,["onClick"])]),_:1})]),_:1},8,["data"])]),_:1}),p("div",ue,[o(e(F),{type:"primary",onClick:V},{default:t(()=>l[8]||(l[8]=[r("\u4FDD\u5B58")])),_:1})])]),_:1},8,["rules","model"]),o(Z,{platform_type:f.value,ref_key:"orderModalRef",ref:h,onList:D},null,8,["platform_type"])],64)}}});var me=q(le,[["__scopeId","data-v-8e9a5fba"],["__file","D:/work/jiesuan/settle-vue3/src/views/InvoiceSales/currentcyOrderRecord/components/order-form.vue"]]);export{me as default};
