1 |
- import{_ as M,d as G,W as I,n as j,w as _,aY as R,az as g,a7 as U,r as h,o as $,G as q,C as s,j as o,M as v,L as w,l as r,h as C,b0 as b,aR as c,J as F,aK as J}from"./index.js";import P from"./index.539c9b.js";import{t as K,a as L}from"./shared.98a4b50b.js";import{u as W}from"./status.b7512d56.js";import Y from"./index.acf3b9.js";import{C as H}from"./ChildGoodEditModal.8fb53d.js";import{S as Q}from"./index.e11d8035.js";import{h as X}from"./index.a90a6537.js";import"./use-page-search.25684bb5.js";import"./columnRenderHelper.eaa2d7d7.js";import"./index.3ff9d0ea.js";import"./tootip.19541d1c.js";import"./basic-descriptions.d80c710b.js";const Z={class:"flex justify-between"},oo={class:"w-full flex justify-between"},eo={class:"w-full flex justify-end"},uo=G({__name:"index",setup(lo){const d=I({orderVisible:!1,goodvisible:!1,editVisible:!1,data:{},index:-1}),B=j(),i=_({orders:[],goods:[],month:""}),D=R({success(){g.success("\u521B\u5EFA\u6210\u529F"),B.push("/invoiceInOut/clinetC")}}),E=_(null);function k(a,u){let e=Array.isArray(a)?a.length:0;if(e>0){let t=0,f=a[0][u],m=[1];for(let l=1;l<e;l++)a[l][u]==f?(m[t]+=1,m[l]=0):(t=l,m[l]=1,f=a[l][u]);return m}else return[0]}function A({row:a,column:u,rowIndex:e,columnIndex:t}){if([0,1,2,3,4,5,9].includes(Number(t)))return{rowspan:k(i.value.goods,"id")[e],colspan:1}}function y(a){const u=i.value.orders.map(({id:e})=>e);a.forEach(e=>{u.includes(e.id)||i.value.orders.push(e)})}function x(a){d.index=a,d.editVisible=!0,d.data={...i.value.goods[a]}}function N(a){const{id:u}=i.value.goods[a];i.value.goods=i.value.goods.filter(e=>e.id!==u)}function V(a){const u=i.value.goods.map(({id:t})=>t),e=[];a.forEach(t=>{u.includes(t.id)||e.push(t)}),i.value.goods=[...e,...i.value.goods]}function z(a,u){const{id:e}=i.value.goods[a];i.value.goods=i.value.goods.map(t=>{if(t.id===e){const f=u.goodNum,m=t.childNum?Number(t.childNum)*Number(f):void 0;return{...t,goodNum:f,childActionNum:m}}return t})}async function T(){var a;try{await((a=E.value)==null?void 0:a.validate());const{orders:u,goods:e,month:t}=i.value;if([...new Set(u.map(({goodNo:n})=>n))].length!==1){g.warning("\u9009\u62E9\u8BA2\u5355\u7684\u5546\u54C1\u7F16\u53F7\u5FC5\u987B\u4E00\u81F4");return}if([...new Set(e.map(({skuCode:n})=>n))].length!==1){g.warning("\u9009\u62E9\u5546\u54C1\u7684\u5546\u54C1\u7F16\u53F7\u5FC5\u987B\u4E00\u81F4");return}if(i.value.goods.filter(n=>!!n.goodNum).length===0){g.warning("\u5546\u54C1\u64CD\u4F5C\u6570\u91CF\u4E0D\u80FD\u4E3A\u7A7A");return}const p={manager_id:u.map(n=>n.id),is_checkOrder:S.value?"1":"0",relaArr:e.map(n=>({id:n.id,num:n.goodNum,unit_price:n.unit_price,subunit_price:n.subunit_price})),fz_date:t};D.run(X(p))}catch{}}const S=U(()=>i.value.goods.map(({id:u,goodNum:e,isJT:t})=>({id:u,num:e,isJT:t})).some(({isJT:u})=>u)),O={orders:[{required:!0,message:"\u8BF7\u9009\u62E9toC\u8BA2\u5355\u4FE1\u606F",trigger:"change"}],goods:[{required:!0,message:"\u8BF7\u9009\u62E9\u64CD\u4F5C\u5546\u54C1",trigger:"change"}],month:[{required:!0,message:"\u8BF7\u9009\u62E9\u5165\u8D26\u6708\u4EFD",trigger:"change"}]};return(a,u)=>{const e=h("ElTableColumn"),t=h("ElTag"),f=h("ElTable"),m=h("ElFormItem");return $(),q(r(J),{ref_key:"formRef",ref:E,"label-width":"100px",model:i.value,rules:O},{default:s(()=>[o(m,{label:"toC\u8BA2\u5355\u4FE1\u606F",prop:"orders"},{default:s(()=>[o(f,{border:"",size:"small",data:i.value.orders},{default:s(()=>[o(e,{label:"\u786E\u8BA4\u5355\u7F16\u53F7",prop:"orderCode","show-overflow-tooltip":""}),o(e,{label:"\u9500\u552E\u4E3B\u5355\u53F7",prop:"cxCode","show-overflow-tooltip":""}),o(e,{label:"\u4E1A\u52A1\u7C7B\u578B"},{default:s(({row:l})=>[o(t,{size:"small"},{default:s(()=>{var p;return[v(w(((p=r(K).find(n=>n.value==l.type))==null?void 0:p.label)||"--"),1)]}),_:2},1024)]),_:1}),o(e,{label:"\u72B6\u6001"},{default:s(({row:l})=>[o(t,{size:"small"},{default:s(()=>{var p;return[v(w(((p=r(L).find(n=>n.value==l.status))==null?void 0:p.label)||"--"),1)]}),_:2},1024)]),_:1}),o(e,{label:"\u5E73\u53F0\u8BA2\u5355\u53F7",prop:"poCode","show-overflow-tooltip":""}),o(e,{label:"\u5E73\u53F0\u7C7B\u578B"},{default:s(({row:l})=>[o(t,{size:"small"},{default:s(()=>{var p;return[v(w(((p=r(W).find(n=>n.value==l.status))==null?void 0:p.label)||"--"),1)]}),_:2},1024)]),_:1}),o(e,{label:"\u5356\u51FA\u65B9\u516C\u53F8",prop:"seller_name","show-overflow-tooltip":""}),o(e,{label:"\u5BA2\u6237\u516C\u53F8",prop:"buyer_name","show-overflow-tooltip":""}),o(e,{label:"\u5546\u54C1\u540D\u79F0",prop:"goodName","show-overflow-tooltip":""}),o(e,{label:"\u4E0B\u5355\u6570\u91CF",prop:"num","show-overflow-tooltip":""}),o(e,{label:"\u9500\u552E\u5355\u4EF7",prop:"goodPrice","show-overflow-tooltip":""}),o(e,{label:"\u9500\u552E\u5408\u8BA1",prop:"totalPrice","show-overflow-tooltip":""}),o(e,{label:"\u51FA\u5E93\u65F6\u95F4",porp:"fz_date","show-overflow-tooltip":""}),o(e,{label:"\u64CD\u4F5C",fixed:"right",width:"60px"},{header:s(()=>[C("div",Z,[u[6]||(u[6]=C("span",null,"\u64CD\u4F5C",-1)),o(r(b),{content:"\u6DFB\u52A0",placement:"top"},{default:s(()=>[o(r(c),{icon:r(F)("add"),link:"",size:"small",type:"primary",onClick:u[0]||(u[0]=l=>d.orderVisible=!0)},null,8,["icon"])]),_:1})])]),default:s(({$index:l})=>[o(r(b),{content:"\u5220\u9664",placement:"top"},{default:s(()=>[o(r(c),{onClick:p=>i.value.orders.splice(l,1),icon:r(F)("delete"),size:"small",type:"danger",link:""},null,8,["onClick","icon"])]),_:2},1024)]),_:1})]),_:1},8,["data"])]),_:1}),o(m,{label:"\u64CD\u4F5C\u5546\u54C1",prop:"goods"},{default:s(()=>[o(f,{"span-method":A,border:"",size:"small",data:i.value.goods},{default:s(()=>[o(e,{label:"\u5546\u54C1ID",prop:"id",width:"60px","show-overflow-tooltip":""}),o(e,{label:"\u5546\u54C1\u7F16\u53F7",prop:"skuCode","show-overflow-tooltip":""}),o(e,{label:"\u5546\u54C1\u540D\u79F0",prop:"goodName","show-overflow-tooltip":""}),o(e,{label:"\u662F\u5426\u4E3A\u8BA1\u63D0",prop:"residue_stock",width:"80px","show-overflow-tooltip":""},{default:s(({row:l})=>[v(w(l.isJT?"\u662F":"\u5426"),1)]),_:1}),o(e,{label:"\u7ED3\u5B58\u6570",prop:"residue_stock",width:"80px","show-overflow-tooltip":""}),o(e,{label:"\u64CD\u4F5C\u6570\u91CF",prop:"goodNum",width:"80px","show-overflow-tooltip":""}),o(e,{label:"\u5B50\u5546\u54C1\u7F16\u53F7",prop:"childCode","show-overflow-tooltip":""}),o(e,{label:"\u5B50\u5546\u54C1\u6BD4\u4F8B",prop:"childNum","show-overflow-tooltip":""}),o(e,{label:"\u5B50\u5546\u54C1\u64CD\u4F5C\u6570\u91CF",prop:"childActionNum",width:"110px","show-overflow-tooltip":""}),o(e,{width:"70px",label:"\u64CD\u4F5C"},{header:s(()=>[C("div",oo,[u[7]||(u[7]=C("span",null,"\u64CD\u4F5C",-1)),o(r(b),{content:"\u6DFB\u52A0",placement:"top"},{default:s(()=>[o(r(c),{link:"",size:"small",type:"primary",icon:r(F)("add"),onClick:u[1]||(u[1]=l=>d.goodvisible=!0)},null,8,["icon"])]),_:1})])]),default:s(({$index:l})=>[o(r(b),{content:"\u7F16\u8F91",placement:"top"},{default:s(()=>[o(r(c),{icon:r(F)("edits"),type:"primary",size:"small",link:"",onClick:p=>x(l)},null,8,["icon","onClick"])]),_:2},1024),o(r(b),{content:"\u5220\u9664",placement:"top"},{default:s(()=>[o(r(c),{icon:r(F)("delete"),type:"danger",size:"small",link:"",onClick:p=>N(l)},null,8,["icon","onClick"])]),_:2},1024)]),_:1})]),_:1},8,["data"])]),_:1}),o(m,{label:"\u5165\u8D26\u6708\u4EFD",prop:"month"},{default:s(()=>[o(Q,{modelValue:i.value.month,"onUpdate:modelValue":u[2]||(u[2]=l=>i.value.month=l),placeholder:"\u5165\u8D26\u6708\u4EFD"},null,8,["modelValue"])]),_:1}),C("div",eo,[o(r(c),{type:"primary",onClick:T},{default:s(()=>u[8]||(u[8]=[v("\u4FDD\u5B58")])),_:1})]),o(P,{visible:d.orderVisible,"onUpdate:visible":u[3]||(u[3]=l=>d.orderVisible=l),onSubmit:y},null,8,["visible"]),o(Y,{visible:d.goodvisible,"onUpdate:visible":u[4]||(u[4]=l=>d.goodvisible=l),onSubmit:V},null,8,["visible"]),o(H,{data:d.data,index:d.index,visible:d.editVisible,"onUpdate:visible":u[5]||(u[5]=l=>d.editVisible=l),onSubmit:z},null,8,["data","index","visible"])]),_:1},8,["model"])}}});var Fo=M(uo,[["__file","C:/Users/89793/Desktop/projects/ticket-system/src/views/invoiceInOut/clientC/components/BaseForm/index.vue"]]);export{Fo as default};
|