detail.385174.js 6.2 KB

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