import{_ as q,d as L,x as v,W as M,aP as z,cl as P,bc as O,y as T,A as g,r as j,o as U,c as G,l as o,D as u,m as e,cm as Q,bZ as x,cn as h,a as F,co as N,h as p,aR as A,M as n,L as f,ar as Z,bY as y,bz as W,cq as a,c1 as Y,aQ as $,F as H,aZ as _,Q as J,R as K}from"./index.js";import{h as X}from"./index.f522024d.js";import{o as ee}from"./_options.61c25632.js";import oe from"./order-modal.d33e6e.js";import"./index.31497729.js";const C=c=>(J("data-v-b5f03d08"),c=c(),K(),c),ue={class:"w-full flex justify-between"},le=C(()=>p("span",{style:{color:"red","margin-right":"5px"}},"*",-1)),te=C(()=>p("span",null,"\u901A\u7528\u8BA2\u5355",-1)),ae={class:"flex items-center"},re=C(()=>p("p",{class:"mr-[10px]"},"\u5E73\u53F0\u7C7B\u578B:",-1)),se={class:"w-full flex justify-end"},ne=L({__name:"order-form",emits:["create"],setup(c,{emit:D}){const b=v(null),B=v(null),r=v([]),{currentCompany:w}=M(),m=z(""),i=P({customerNo:"",companyNo:""}),{run:R}=O({success:()=>D("create")});function S(s){const t=r.value.map(l=>String(l.id)),d=s.filter(({id:l})=>!t.includes(String(l)));r.value=[...r.value,...d]}async function V(){var s;if(r.value.length>150){_.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 _.warning("\u8BF7\u9009\u62E9\u901A\u7528\u8BA2\u5355");R(X({common_ids:r.value.map(t=>t.id)}))}catch{}}function I(){var d;const{companyNo:s,customerNo:t}=i;if(!t){_.warning("\u8BF7\u9009\u62E9\u4E70\u5165\u65B9\u516C\u53F8");return}if(t!==s){_.warning("\u5356\u51FA\u65B9\u516C\u53F8\u4E0E\u4E70\u5165\u65B9\u516C\u53F8\u4E0D\u80FD\u662F\u4E00\u5BB6\u516C\u53F8");return}(d=b.value)==null||d.onDisplay(t,s)}return T(()=>{i.companyNo=w.value.companyNo,i.customerNo="GS2203161855277894"}),g(()=>[i.customerNo,i.customerNo],()=>r.value=[]),g(()=>m.value,()=>r.value=[]),(s,t)=>{const d=j("el-switch");return U(),G(H,null,[o(e($),{rules:e(ee),ref_key:"formRef",ref:B,model:e(i)},{default:u(()=>[o(e(Q),{gutter:10},{default:u(()=>[o(e(x),{span:12},{default:u(()=>[o(e(h),{label:"\u5356\u51FA\u65B9\u516C\u53F8",prop:"companyNo"},{default:u(()=>[F(` \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(N),{modelValue:e(w).companyName,"onUpdate:modelValue":t[0]||(t[0]=l=>e(w).companyName=l),disabled:""},null,8,["modelValue"])]),_:1})]),_:1}),o(e(x),{span:12},{default:u(()=>[o(e(h),{label:"\u4E70\u5165\u65B9\u516C\u53F8",prop:"customerNo"},{default:u(()=>[F(' <ElInput v-model="currentCompany.companyName" disabled></ElInput> '),F(` <RemoteSelect\r
            disabled\r
            ref="RemoteSelectRef"\r
            v-model="formData.customerNo"\r
            style="width: 100%"\r
            :api="httpCompanylist"\r
            requset-prop="name"\r
            response-label-prop="company_name"\r
            response-val-prop="companyNo"\r
           /> `),o(e(N),{modelValue:"\u5317\u4EAC\u4E07\u5B87\u6052\u901A\u56FD\u9645\u79D1\u8D38\u6709\u9650\u516C\u53F8",disabled:""})]),_:1})]),_:1})]),_:1}),o(e(h),{class:"be-current__item"},{label:u(()=>[p("div",ue,[p("div",null,[le,te,o(e(A),{style:{"margin-left":"10px"},size:"small"},{default:u(()=>[n(f(r.value.length)+"/150",1)]),_:1})]),p("div",ae,[re,o(d,{class:"mr-[10px]",modelValue:e(m),"onUpdate:modelValue":t[1]||(t[1]=l=>Z(m)?m.value=l:null),size:"small","active-text":"toC","inactive-text":"toB","active-value":"2","inactive-value":"1"},null,8,["modelValue"]),o(e(y),{type:"primary",size:"small",onClick:I},{default:u(()=>[n("\u6DFB\u52A0\u901A\u7528\u8BA2\u5355")]),_:1})])])]),default:u(()=>[o(e(W),{border:"",size:"small",data:r.value,class:"mt-[10px]","max-height":500},{default:u(()=>[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:"\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:u(l=>[n(f(l.row.qrd?l.row.qrd.goodNum:""),1)]),_:1}),o(e(a),{label:"\u9500\u552E\u5355\u4EF7",width:"80",prop:"goodPrice","show-overflow-tooltip":""},{default:u(l=>[n(f(l.row.qrd?l.row.qrd.goodPrice:""),1)]),_:1}),o(e(a),{label:"\u5BF9\u8D26\u72B6\u6001",width:"80",prop:"status","show-overflow-tooltip":""},{default:u(l=>[o(e(A),null,{default:u(()=>{var E;return[n(f(((E=e(Y).find(k=>k.value==l.row.status))==null?void 0:E.label)||"--"),1)]}),_:2},1024)]),_: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:u(l=>[o(e(y),{size:"small",type:"primary",text:"",onClick:()=>r.value.splice(l.$index)},{default:u(()=>[n("\u5220\u9664")]),_:2},1032,["onClick"])]),_:1})]),_:1},8,["data"])]),_:1}),p("div",se,[o(e(y),{type:"primary",onClick:V},{default:u(()=>[n("\u4FDD\u5B58")]),_:1})])]),_:1},8,["rules","model"]),o(oe,{platform_type:e(m),ref_key:"orderModalRef",ref:b,onList:S},null,8,["platform_type"])],64)}}});var fe=q(ne,[["__scopeId","data-v-b5f03d08"],["__file","C:/Users/89793/Desktop/projects/settle-vue3/src/views/InvoiceSales/currentcyOrderRecord copy/components/order-form.vue"]]);export{fe as default};
