1 |
- import{_ as Y,d as Z,w as _,aX as P,W as ee,a7 as oe,r as E,at as le,H as M,l as e,o as f,c as R,j as o,C as a,aI as ae,ah as te,aJ as h,G as b,a as v,aM as z,aN as r,a$ as D,aR as g,J as y,aK as ue,h as V,M as ie,az as U}from"./index.js";import{o as se,i as ne,a as de,C as re}from"./ChildGoodEditModal.4f2a2c.js";import{u as me}from"./useDetail.f22a90d7.js";import{B as x}from"./basic-descriptions.092e0951.js";import pe from"./index.aeacb5.js";import{h as $,b as ce}from"./index.21141f80.js";import{a as fe}from"./index.699735f5.js";import{P as ve}from"./index.691ae80b.js";import{S as Ce}from"./index.dfa30c8a.js";import"./status.4e0ebdbc.js";import"./shared.3ff0a9a1.js";import"./tootip.07ef3ad4.js";import"./shared.9d577e31.js";import"./use-page-search.f8704e82.js";import"./columns.1630c13c.js";const _e={class:"padding__container"},be={class:"w-full flex justify-between"},he={class:"flex w-full justify-end"},ge=Z({__name:"detail",setup(we){const{title:A,collapses:k,id:w}=me({baseName:"\u51FA\u5E93",collapseLen:5}),B=_(!1),N=_(!1),S=_(0),F=P(),i=P(),C=ee({editVisible:!1,index:-1,data:{}}),T=_(!1),I=_(null),j=oe(()=>i.data?i.data.type=="2"?{basic_status:"1"}:{basic_status:"2"}:{}),u=_({goods:[],month:""}),q={goods:[{required:!0,message:"\u8BF7\u9009\u62E9\u64CD\u4F5C\u5546\u54C1"}],month:[{required:!0,message:"\u8BF7\u9009\u62E9\u5165\u8D26\u6708\u4EFD"}]};function J(t){const l=u.value.goods.map(({id:d})=>d),s=[];t.forEach(d=>{l.includes(d.id)||s.push(d)}),u.value.goods=[...s,...u.value.goods]}function O(t){C.index=t,C.editVisible=!0,C.data={...u.value.goods[t]}}function H(t,l){let s=Array.isArray(t)?t.length:0;if(s>0){let d=0,m=t[0][l],p=[1];for(let c=1;c<s;c++)t[c][l]==m?(p[d]+=1,p[c]=0):(d=c,p[c]=1,m=t[c][l]);return p}else return[0]}function K({row:t,column:l,rowIndex:s,columnIndex:d}){if([0,1,2,7].includes(Number(d)))return{rowspan:H(u.value.goods,"id")[s],colspan:1}}async function L(){try{await I.value.validate();const t=u.value.goods.map(({id:p,goodNum:c})=>({id:p,num:c})),l=[],s={};for(const p of t)s[p.id]||(l.push(p),s[p.id]=!0);T.value=!0;const{code:d,message:m}=await ce({relaArr:l,manager_id:w.value});T.value=!1,d==0?(U.success("\u64CD\u4F5C\u5B8C\u6210"),i.run($({id:w.value}))):U.warning(m)}catch{}}function W(t,l){const{id:s}=u.value.goods[t];u.value.goods.forEach((d,m)=>{d.id===s&&(u.value.goods[m].goodNum=l.goodNum,u.value.goods[m].childNum&&(u.value.goods[m].childActionNum=u.value.goods[m].childNum*l.goodNum))})}function X(t,l){N.value=!0,S.value=l,F.run(fe({id:t}))}function Q(t){const{id:l}=u.value.goods[t];u.value.goods=u.value.goods.filter(s=>s.id!==l)}return w.value&&i.run($({id:w.value})),(t,l)=>{const s=E("ElFormItem"),d=E("ElTabPane"),m=E("ElTabs"),p=E("ElDialog"),c=le("loading");return M((f(),R("div",_e,[o(m,null,{default:a(()=>[o(d,{label:e(A)},{default:a(()=>[o(e(ae),{modelValue:e(k),"onUpdate:modelValue":l[2]||(l[2]=n=>te(k)?k.value=n:null)},{default:a(()=>[o(e(h),{title:e(A),name:"1"},{default:a(()=>[e(i).data?(f(),b(e(x),{key:0,columns:e(se),data:e(i).data},null,8,["columns","data"])):v("v-if",!0)]),_:1},8,["title"]),v(" importInvoiceGoodColumns "),o(e(h),{title:"\u8BA2\u5355\u8BE6\u60C5",name:"2"},{default:a(()=>[e(i).data?(f(),b(e(x),{key:0,columns:e(ne),data:e(i).data},null,8,["columns","data"])):v("v-if",!0)]),_:1}),o(e(h),{title:"\u53D1\u7968\u8BE6\u60C5",name:"3"},{default:a(()=>[e(i).data?(f(),b(e(x),{key:0,columns:e(de),data:e(i).data},null,8,["columns","data"])):v("v-if",!0)]),_:1}),e(i).data?(f(),b(e(h),{key:0,title:"\u5546\u54C1\u4FE1\u606F",name:"4"},{default:a(()=>[o(e(z),{size:"small",border:"",data:e(i).data.ProductRela},{default:a(()=>[o(e(r),{label:"\u5546\u54C1ID",prop:"product_id","show-overflow-tooltip":""}),o(e(r),{label:"\u5546\u54C1\u7F16\u53F7",prop:"skuCode","show-overflow-tooltip":""}),o(e(r),{label:"\u5546\u54C1\u540D\u79F0",prop:"goodName","show-overflow-tooltip":""}),o(e(r),{label:"\u64CD\u4F5C\u6570\u91CF",prop:"num","show-overflow-tooltip":""}),o(e(r),{label:"\u64CD\u4F5C",width:"100px"},{default:a(n=>[o(e(D),{content:"\u67E5\u770B\u8BE6\u60C5"},{default:a(()=>[o(e(g),{type:"primary",link:"",icon:e(y)("eye-view"),onClick:G=>X(n.row.product_id,n.$index)},null,8,["icon","onClick"])]),_:2},1024)]),_:1})]),_:1},8,["data"])]),_:1})):v("v-if",!0),e(i).data&&e(i).data.status=="1"?(f(),b(e(h),{key:1,title:"\u51FA\u5165\u5E93\u4FE1\u606F\u786E\u8BA4",name:"5"},{default:a(()=>[o(e(ue),{ref_key:"formRef",ref:I,rules:q,model:u.value},{default:a(()=>[o(s,{label:"\u64CD\u4F5C\u5546\u54C1",prop:"goods"},{default:a(()=>[o(e(z),{"span-method":K,border:"",size:"small",data:u.value.goods},{default:a(()=>[o(e(r),{label:"\u5546\u54C1\u7F16\u53F7",prop:"skuCode","show-overflow-tooltip":""}),o(e(r),{label:"\u5546\u54C1\u540D\u79F0",prop:"goodName","show-overflow-tooltip":""}),o(e(r),{label:"\u64CD\u4F5C\u6570\u91CF",prop:"goodNum","show-overflow-tooltip":""}),o(e(r),{label:"\u5B50\u5546\u54C1\u7F16\u53F7",prop:"childCode","show-overflow-tooltip":""}),o(e(r),{label:"\u9500\u552E\u65B9\u516C\u53F8\u7EB3\u7A0E\u8BC6\u522B\u53F7",width:"140px",prop:"seller_code","show-overflow-tooltip":""}),o(e(r),{label:"\u5B50\u5546\u54C1\u6BD4\u4F8B",prop:"childNum","show-overflow-tooltip":""}),o(e(r),{label:"\u5B50\u5546\u54C1\u64CD\u4F5C\u6570\u91CF",prop:"childActionNum","show-overflow-tooltip":""}),o(e(r),{width:"70px",label:"\u64CD\u4F5C"},{header:a(()=>[V("div",be,[l[6]||(l[6]=V("span",null,"\u64CD\u4F5C",-1)),o(e(D),{content:"\u6DFB\u52A0",placement:"top"},{default:a(()=>[o(e(g),{link:"",size:"small",type:"primary",icon:e(y)("add"),onClick:l[0]||(l[0]=n=>B.value=!0)},null,8,["icon"])]),_:1})])]),default:a(({$index:n})=>[o(e(D),{content:"\u7F16\u8F91",placement:"top"},{default:a(()=>[o(e(g),{icon:e(y)("edits"),type:"primary",size:"small",link:"",onClick:G=>O(n)},null,8,["icon","onClick"])]),_:2},1024),o(e(D),{content:"\u5220\u9664",placement:"top"},{default:a(()=>[o(e(g),{icon:e(y)("delete"),type:"danger",size:"small",link:"",onClick:G=>Q(n)},null,8,["icon","onClick"])]),_:2},1024)]),_:1})]),_:1},8,["data"])]),_:1}),o(s,{label:"\u5165\u8D26\u6708\u4EFD",prop:"month"},{default:a(()=>[v(' :company_code="detailTask.data.buyer_code" '),o(Ce,{modelValue:u.value.month,"onUpdate:modelValue":l[1]||(l[1]=n=>u.value.month=n),placeholder:"\u5165\u8D26\u6708\u4EFD",company_code:e(i).data.buyer_code},null,8,["modelValue","company_code"])]),_:1})]),_:1},8,["model"]),V("div",he,[o(e(g),{type:"primary",onClick:L},{default:a(()=>l[7]||(l[7]=[ie("\u4FDD\u5B58")])),_:1})])]),_:1})):v("v-if",!0)]),_:1},8,["modelValue"])]),_:1},8,["label"])]),_:1}),o(pe,{visible:B.value,"onUpdate:visible":l[3]||(l[3]=n=>B.value=n),otherSearchParameter:j.value,onSubmit:J},null,8,["visible","otherSearchParameter"]),o(re,{data:C.data,index:C.index,visible:C.editVisible,"onUpdate:visible":l[4]||(l[4]=n=>C.editVisible=n),onSubmit:W},null,8,["data","index","visible"]),o(p,{center:"",title:"\u5546\u54C1\u8BE6\u60C5",modelValue:N.value,"onUpdate:modelValue":l[5]||(l[5]=n=>N.value=n),style:{overflow:"hidden"}},{default:a(()=>[M((f(),R("div",null,[e(F).data?(f(),b(ve,{key:0,data:e(F).data,num:e(i).data.ProductRela[S.value].num},null,8,["data","num"])):v("v-if",!0)])),[[c,e(F).loading]])]),_:1},8,["modelValue"])])),[[c,e(i).loading]])}}});var Me=Y(ge,[["__file","C:/Users/89793/Desktop/projects/ticket-system/src/views/invoiceInOut/outManager/detail.vue"]]);export{Me as default};
|