1 |
- import{_ as K,d as Q,m as _,V as J,aH as E,a2 as P,Q as W,r as X,ao as Y,B as Z,h as e,o as v,c as ee,f as t,x as d,aL as g,A as h,a as f,bv as oe,a0 as te,a1 as c,e as w,br as B,bm as b,D as k,H as ae,ac as le,aK as ue,az as A}from"./index.js";import{o as se,i as ie,a as de,C as re}from"./ChildGoodEditModal.396f34.js";import{u as ne}from"./useDetail.33ec7a53.js";import{B as y}from"./basic-descriptions.e6b0a528.js";import me from"./index.77e8d1.js";import{h as R,d as ce}from"./index.004a0bb2.js";import{a as pe}from"./index.0d3e4f3d.js";import{B as fe}from"./index.ea39302f.js";import{S as ve}from"./index.5f93fc4f.js";import{M as Ce,F as ge}from"./index.cc66ea4e.js";import"./status.b7512d56.js";import"./shared.110b48c6.js";import"./tootip.c6ca5db9.js";import"./use-page-search.dfa27a70.js";import"./columns.74c15f1e.js";import"./columnRenderHelper.8411add2.js";import"./index.4109350c.js";import"./index.1ed73e65.js";import"./find.5020d717.js";const he={class:"padding__container"},_e={class:"w-full flex justify-between"},be={class:"flex w-full justify-end"},De=Q({__name:"detail",setup(Fe){const{title:x,collapses:D,id:C}=ne({baseName:"\u5165\u5E93",collapseLen:5}),F=_(!1),{isSuperUser:T}=J(),N=E();E();const u=E({success(a){const{ProductRela:o}=a,{product_id:i}=o[0];N.run(pe({id:i}))}});P(()=>u.data&&u.data.ProductRela?u.data.ProductRela[0]:{});const I=P(()=>{var a,o;return u.data?{good_type:String((a=u.data)==null?void 0:a.goodType),status:"1",basic_status:"1",good_source:String((o=u.data)==null?void 0:o.source)}:{}}),p=W({editVisible:!1,index:-1,data:{}}),V=_(!1),S=_(null),s=_({goods:[],month:""}),G={goods:[{required:!0,message:"\u8BF7\u9009\u62E9\u64CD\u4F5C\u5546\u54C1"}],month:[{required:!0,message:"\u8BF7\u9009\u62E9\u5165\u8D26\u6708\u4EFD"}]};function M(a){const o=s.value.goods.map(({id:r})=>r),i=[];a.forEach(r=>{o.includes(r.id)||i.push(r)}),s.value.goods=[...i,...s.value.goods]}function U(a){p.index=a,p.editVisible=!0,p.data={...s.value.goods[a]}}function z(a,o){let i=Array.isArray(a)?a.length:0;if(i>0){let r=0,l=a[0][o],n=[1];for(let m=1;m<i;m++)a[m][o]==l?(n[r]+=1,n[m]=0):(r=m,n[m]=1,l=a[m][o]);return n}else return[0]}function j({row:a,column:o,rowIndex:i,columnIndex:r}){if([0,1,2,7].includes(Number(r)))return{rowspan:z(s.value.goods,"id")[i],colspan:1}}async function O(){try{await S.value.validate();const a=s.value.goods.map(({id:n,goodNum:m,unit_price:H,subunit_price:L})=>({id:n,num:m,unit_price:H,subunit_price:L})),o=[],i={};for(const n of a)i[n.id]||(o.push(n),i[n.id]=!0);V.value=!0;const{code:r,message:l}=await ce({relaArr:o,manager_id:C.value});V.value=!1,r==0?(A.success("\u64CD\u4F5C\u5B8C\u6210"),u.run(R({id:C.value}))):A.warning(l)}catch{}}function $(a,o){const{id:i}=s.value.goods[a];s.value.goods.forEach((r,l)=>{r.id===i&&(s.value.goods[l].goodNum=o.goodNum,s.value.goods[l].childNum&&(s.value.goods[l].childActionNum=s.value.goods[l].childNum*o.goodNum))})}function q(a){const{id:o}=s.value.goods[a];s.value.goods=s.value.goods.filter(i=>i.id!==o)}return C.value&&u.run(R({id:C.value})),(a,o)=>{const i=X("ElFormItem"),r=Y("loading");return Z((v(),ee("div",he,[t(ge,{id:e(C),mode:e(Ce).IN},null,8,["id","mode"]),t(e(ue),{modelValue:e(D),"onUpdate:modelValue":o[2]||(o[2]=l=>le(D)?D.value=l:null)},{default:d(()=>[t(e(g),{title:e(x),name:"1"},{default:d(()=>[e(u).data?(v(),h(e(y),{key:0,columns:e(se),data:e(u).data},null,8,["columns","data"])):f("v-if",!0)]),_:1},8,["title"]),t(e(g),{title:"\u8BA2\u5355\u8BE6\u60C5",name:"2"},{default:d(()=>[e(u).data?(v(),h(e(y),{key:0,columns:e(ie),data:e(u).data},null,8,["columns","data"])):f("v-if",!0)]),_:1}),t(e(g),{title:"\u53D1\u7968\u8BE6\u60C5",name:"3"},{default:d(()=>[e(u).data?(v(),h(e(y),{key:0,columns:e(de),data:e(u).data},null,8,["columns","data"])):f("v-if",!0)]),_:1}),e(N).data&&e(u).data.ProductRela.length!==0?(v(),h(e(g),{key:0,title:"\u5546\u54C1\u4FE1\u606F",name:"4"},{default:d(()=>[f(' <ProductDetail :data="productDetailTask.data" :num="productDetail?.num" :time="productDetail?.create_time" :name="productDetail?.apply_name" /> '),t(fe,{ProductRela:e(u).data.ProductRela},null,8,["ProductRela"])]),_:1})):f("v-if",!0),!e(T)&&e(u).data&&e(u).data.status=="1"||e(u).data.status=="4"?(v(),h(e(g),{key:1,title:"\u51FA\u5165\u5E93\u4FE1\u606F\u786E\u8BA4",name:"5"},{default:d(()=>[t(e(oe),{ref_key:"formRef",ref:S,rules:G,model:s.value},{default:d(()=>[t(i,{label:"\u64CD\u4F5C\u5546\u54C1",prop:"goods"},{default:d(()=>[t(e(te),{"span-method":j,border:"",size:"small",data:s.value.goods},{default:d(()=>[t(e(c),{label:"\u5546\u54C1\u7F16\u53F7",prop:"skuCode","show-overflow-tooltip":""}),t(e(c),{label:"\u5546\u54C1\u540D\u79F0",prop:"goodName","show-overflow-tooltip":""}),t(e(c),{label:"\u64CD\u4F5C\u6570\u91CF",prop:"goodNum","show-overflow-tooltip":""}),t(e(c),{label:"\u5B50\u5546\u54C1\u7F16\u53F7",prop:"childCode","show-overflow-tooltip":""}),t(e(c),{label:"\u9500\u552E\u65B9\u516C\u53F8\u7EB3\u7A0E\u8BC6\u522B\u53F7",width:"140px",prop:"seller_code","show-overflow-tooltip":""}),t(e(c),{label:"\u5B50\u5546\u54C1\u6BD4\u4F8B",prop:"childNum","show-overflow-tooltip":""}),t(e(c),{label:"\u5B50\u5546\u54C1\u64CD\u4F5C\u6570\u91CF",prop:"childActionNum","show-overflow-tooltip":""}),t(e(c),{width:"70px",label:"\u64CD\u4F5C"},{header:d(()=>[w("div",_e,[o[5]||(o[5]=w("span",null,"\u64CD\u4F5C",-1)),t(e(B),{content:"\u6DFB\u52A0",placement:"top"},{default:d(()=>[t(e(b),{link:"",size:"small",type:"primary",icon:e(k)("add"),onClick:o[0]||(o[0]=l=>F.value=!0)},null,8,["icon"])]),_:1})])]),default:d(({$index:l})=>[t(e(B),{content:"\u7F16\u8F91",placement:"top"},{default:d(()=>[t(e(b),{icon:e(k)("edits"),type:"primary",size:"small",link:"",onClick:n=>U(l)},null,8,["icon","onClick"])]),_:2},1024),t(e(B),{content:"\u5220\u9664",placement:"top"},{default:d(()=>[t(e(b),{icon:e(k)("delete"),onClick:n=>q(l),type:"danger",size:"small",link:""},null,8,["icon","onClick"])]),_:2},1024)]),_:1})]),_:1},8,["data"])]),_:1}),f(" {{ detailTask.data.seller_code }} "),t(i,{label:"\u5165\u8D26\u6708\u4EFD",prop:"month"},{default:d(()=>[t(ve,{placeholder:"\u5165\u8D26\u6708\u4EFD",modelValue:s.value.month,"onUpdate:modelValue":o[1]||(o[1]=l=>s.value.month=l),company_code:e(u).data.inv_buyer_code},null,8,["modelValue","company_code"])]),_:1})]),_:1},8,["model"]),w("div",be,[t(e(b),{type:"primary",onClick:O},{default:d(()=>o[6]||(o[6]=[ae("\u4FDD\u5B58")])),_:1})])]),_:1})):f("v-if",!0)]),_:1},8,["modelValue"]),t(me,{visible:F.value,"onUpdate:visible":o[3]||(o[3]=l=>F.value=l),otherSearchParameter:I.value,onSubmit:M},null,8,["visible","otherSearchParameter"]),t(re,{data:p.data,index:p.index,visible:p.editVisible,"onUpdate:visible":o[4]||(o[4]=l=>p.editVisible=l),onSubmit:$},null,8,["data","index","visible"])])),[[r,e(u).loading]])}}});var Oe=K(De,[["__file","C:/Users/89793/Desktop/projects/ticket-system/src/views/invoiceInOut/inManager/detail.vue"]]);export{Oe as default};
|