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