1 |
- import{_ as Z,d as ee,w as b,aY as P,a4 as oe,W as le,a7 as ae,r as E,at as te,H as M,l as e,o as f,c as U,j as o,C as a,aI as ue,ah as se,aJ as h,G as _,a as v,aM as R,aN as r,b0 as D,aR as g,J as y,aK as ie,h as V,M as ne,az as z}from"./index.js";import{o as de,i as re,a as me,C as pe}from"./ChildGoodEditModal.4f2a2c.js";import{u as ce}from"./useDetail.de731874.js";import{B as S}from"./basic-descriptions.898fa2c0.js";import fe from"./index.aeacb5.js";import{h as $,b as ve}from"./index.81d51bb0.js";import{a as Ce}from"./index.0e8d4646.js";import{P as be}from"./index.21e677c9.js";import{S as _e}from"./index.0270321a.js";import"./status.0f771e9a.js";import"./shared.3ff0a9a1.js";import"./tootip.f8ec1491.js";import"./shared.9d577e31.js";import"./use-page-search.c6a73876.js";import"./columns.57fd1333.js";const he={class:"padding__container"},ge={class:"w-full flex justify-between"},we={class:"flex w-full justify-end"},Fe=ee({__name:"detail",setup(Ee){const{title:x,collapses:k,id:w}=ce({baseName:"\u51FA\u5E93",collapseLen:5}),B=b(!1),N=b(!1),A=b(0),F=P(),s=P(),{isSuperUser:j}=oe(),C=le({editVisible:!1,index:-1,data:{}}),I=b(!1),T=b(null),q=ae(()=>s.data?s.data.type=="2"?{basic_status:"1"}:{basic_status:"2"}:{}),u=b({goods:[],month:""}),J={goods:[{required:!0,message:"\u8BF7\u9009\u62E9\u64CD\u4F5C\u5546\u54C1"}],month:[{required:!0,message:"\u8BF7\u9009\u62E9\u5165\u8D26\u6708\u4EFD"}]};function O(t){const l=u.value.goods.map(({id:d})=>d),i=[];t.forEach(d=>{l.includes(d.id)||i.push(d)}),u.value.goods=[...i,...u.value.goods]}function H(t){C.index=t,C.editVisible=!0,C.data={...u.value.goods[t]}}function K(t,l){let i=Array.isArray(t)?t.length:0;if(i>0){let d=0,m=t[0][l],p=[1];for(let c=1;c<i;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 L({row:t,column:l,rowIndex:i,columnIndex:d}){if([0,1,2,7].includes(Number(d)))return{rowspan:K(u.value.goods,"id")[i],colspan:1}}async function W(){try{await T.value.validate();const t=u.value.goods.map(({id:p,goodNum:c})=>({id:p,num:c})),l=[],i={};for(const p of t)i[p.id]||(l.push(p),i[p.id]=!0);I.value=!0;const{code:d,message:m}=await ve({relaArr:l,manager_id:w.value});I.value=!1,d==0?(z.success("\u64CD\u4F5C\u5B8C\u6210"),s.run($({id:w.value}))):z.warning(m)}catch{}}function Y(t,l){const{id:i}=u.value.goods[t];u.value.goods.forEach((d,m)=>{d.id===i&&(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 Q(t,l){N.value=!0,A.value=l,F.run(Ce({id:t}))}function X(t){const{id:l}=u.value.goods[t];u.value.goods=u.value.goods.filter(i=>i.id!==l)}return w.value&&s.run($({id:w.value})),(t,l)=>{const i=E("ElFormItem"),d=E("ElTabPane"),m=E("ElTabs"),p=E("ElDialog"),c=te("loading");return M((f(),U("div",he,[o(m,null,{default:a(()=>[o(d,{label:e(x)},{default:a(()=>[o(e(ue),{modelValue:e(k),"onUpdate:modelValue":l[2]||(l[2]=n=>se(k)?k.value=n:null)},{default:a(()=>[o(e(h),{title:e(x),name:"1"},{default:a(()=>[e(s).data?(f(),_(e(S),{key:0,columns:e(de),data:e(s).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(s).data?(f(),_(e(S),{key:0,columns:e(re),data:e(s).data},null,8,["columns","data"])):v("v-if",!0)]),_:1}),o(e(h),{title:"\u53D1\u7968\u8BE6\u60C5",name:"3"},{default:a(()=>[e(s).data?(f(),_(e(S),{key:0,columns:e(me),data:e(s).data},null,8,["columns","data"])):v("v-if",!0)]),_:1}),e(s).data?(f(),_(e(h),{key:0,title:"\u5546\u54C1\u4FE1\u606F",name:"4"},{default:a(()=>[o(e(R),{size:"small",border:"",data:e(s).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=>Q(n.row.product_id,n.$index)},null,8,["icon","onClick"])]),_:2},1024)]),_:1})]),_:1},8,["data"])]),_:1})):v("v-if",!0),!e(j)&&e(s).data&&e(s).data.status=="1"?(f(),_(e(h),{key:1,title:"\u51FA\u5165\u5E93\u4FE1\u606F\u786E\u8BA4",name:"5"},{default:a(()=>[o(e(ie),{ref_key:"formRef",ref:T,rules:J,model:u.value},{default:a(()=>[o(i,{label:"\u64CD\u4F5C\u5546\u54C1",prop:"goods"},{default:a(()=>[o(e(R),{"span-method":L,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",ge,[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=>H(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=>X(n)},null,8,["icon","onClick"])]),_:2},1024)]),_:1})]),_:1},8,["data"])]),_:1}),o(i,{label:"\u5165\u8D26\u6708\u4EFD",prop:"month"},{default:a(()=>[v(' :company_code="detailTask.data.buyer_code" '),o(_e,{modelValue:u.value.month,"onUpdate:modelValue":l[1]||(l[1]=n=>u.value.month=n),placeholder:"\u5165\u8D26\u6708\u4EFD",company_code:e(s).data.buyer_code},null,8,["modelValue","company_code"])]),_:1})]),_:1},8,["model"]),V("div",we,[o(e(g),{type:"primary",onClick:W},{default:a(()=>l[7]||(l[7]=[ne("\u4FDD\u5B58")])),_:1})])]),_:1})):v("v-if",!0)]),_:1},8,["modelValue"])]),_:1},8,["label"])]),_:1}),o(fe,{visible:B.value,"onUpdate:visible":l[3]||(l[3]=n=>B.value=n),otherSearchParameter:q.value,onSubmit:O},null,8,["visible","otherSearchParameter"]),o(pe,{data:C.data,index:C.index,visible:C.editVisible,"onUpdate:visible":l[4]||(l[4]=n=>C.editVisible=n),onSubmit:Y},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(),U("div",null,[e(F).data?(f(),_(be,{key:0,data:e(F).data,num:e(s).data.ProductRela[A.value].num},null,8,["data","num"])):v("v-if",!0)])),[[c,e(F).loading]])]),_:1},8,["modelValue"])])),[[c,e(s).loading]])}}});var Re=Z(Fe,[["__file","C:/Users/89793/Desktop/projects/ticket-system/src/views/invoiceInOut/outManager/detail.vue"]]);export{Re as default};
|