1 |
- import{_ as $,d as H,w as C,aO as J,ab as L,U as K,r as p,aj as Q,H as W,l as n,o as g,c as X,j as o,C as i,a6 as Y,G as k,a as h,aC as Z,h as E,J as F,M as ee,aq as N}from"./index.js";import{o as oe,C as le}from"./ChildGoodEditModal.bd061d.js";import{u as te}from"./useDetail.68a84ae7.js";import{B as ae}from"./basic-descriptions.f8ae61bf.js";import ue from"./index.86eae1.js";import{h as T,b as se}from"./index.b1238b82.js";import{S as ne}from"./index.faf7951b.js";import"./status.d3ab78fb.js";import"./shared.2f92e8a7.js";import"./tootip.06479404.js";import"./use-page-search.d8b430d6.js";import"./index.85aafec4.js";const ie={class:"padding__container"},de={class:"w-full flex justify-between"},re={class:"flex w-full justify-end"},ce=H({__name:"detail",setup(me){const{title:w,collapses:_,id:v}=te({baseName:"\u51FA\u5165\u5E93",collapseLen:2}),b=C(!1),c=J(),f=L({editVisible:!1,index:-1,data:{}}),D=C(!1),y=C(null),A=K(()=>c.data?c.data.type=="2"?{basic_status:"1"}:{basic_status:"2"}:{}),a=C({goods:[],month:""}),S={goods:[{required:!0,message:"\u8BF7\u9009\u62E9\u64CD\u4F5C\u5546\u54C1"}],month:[{required:!0,message:"\u8BF7\u9009\u62E9\u5165\u8D26\u6708\u4EFD"}]};function V(t){const e=a.value.goods.map(({id:l})=>l),u=[];t.forEach(l=>{e.includes(l.id)||u.push(l)}),a.value.goods=[...u,...a.value.goods]}function x(t){f.index=t,f.editVisible=!0,f.data={...a.value.goods[t]}}function G(t,e){let u=Array.isArray(t)?t.length:0;if(u>0){let l=0,s=t[0][e],d=[1];for(let r=1;r<u;r++)t[r][e]==s?(d[l]+=1,d[r]=0):(l=r,d[r]=1,s=t[r][e]);return d}else return[0]}function I({row:t,column:e,rowIndex:u,columnIndex:l}){if([0,1,2,7].includes(Number(l)))return{rowspan:G(a.value.goods,"id")[u],colspan:1}}async function M(){try{await y.value.validate();const t=a.value.goods.map(({id:d,goodNum:r})=>({id:d,num:r})),e=[],u={};for(const d of t)u[d.id]||(e.push(d),u[d.id]=!0);D.value=!0;const{code:l,message:s}=await se({relaArr:e,manager_id:v.value});D.value=!1,l==0?(N.success("\u64CD\u4F5C\u5B8C\u6210"),c.run(T({id:v.value}))):N.warning(s)}catch{}}function P(t,e){const{id:u}=a.value.goods[t];a.value.goods.forEach((l,s)=>{l.id===u&&(a.value.goods[s].goodNum=e.goodNum,a.value.goods[s].childNum&&(a.value.goods[s].childActionNum=a.value.goods[s].childNum*e.goodNum))})}function j(t){const{id:e}=a.value.goods[t];a.value.goods=a.value.goods.filter(u=>u.id!==e)}return v.value&&c.run(T({id:v.value})),(t,e)=>{const u=p("ElCollapseItem"),l=p("ElTableColumn"),s=p("ElButton"),d=p("ElTooltip"),r=p("ElTable"),B=p("ElFormItem"),U=p("ElCollapse"),z=p("ElTabPane"),R=p("ElTabs"),q=Q("loading");return W((g(),X("div",ie,[o(R,null,{default:i(()=>[o(z,{label:n(w)},{default:i(()=>[o(U,{modelValue:n(_),"onUpdate:modelValue":e[1]||(e[1]=m=>Y(_)?_.value=m:null)},{default:i(()=>[o(u,{title:n(w),name:"1"},{default:i(()=>[n(c).data?(g(),k(n(ae),{key:0,columns:n(oe),data:n(c).data},null,8,["columns","data"])):h("v-if",!0)]),_:1},8,["title"]),h(" && detailTask.data.type == '1' "),n(c).data&&n(c).data.status=="1"?(g(),k(u,{key:0,title:"\u51FA\u5165\u5E93\u4FE1\u606F\u786E\u8BA4",name:"2"},{default:i(()=>[o(n(Z),{ref_key:"formRef",ref:y,rules:S,model:a.value},{default:i(()=>[o(B,{label:"\u64CD\u4F5C\u5546\u54C1",prop:"goods"},{default:i(()=>[o(r,{"span-method":I,border:"",size:"small",data:a.value.goods},{default:i(()=>[o(l,{label:"\u5546\u54C1\u7F16\u53F7",prop:"skuCode","show-overflow-tooltip":""}),o(l,{label:"\u5546\u54C1\u540D\u79F0",prop:"goodName","show-overflow-tooltip":""}),o(l,{label:"\u64CD\u4F5C\u6570\u91CF",prop:"goodNum","show-overflow-tooltip":""}),o(l,{label:"\u5B50\u5546\u54C1\u7F16\u53F7",prop:"childCode","show-overflow-tooltip":""}),o(l,{label:"\u9500\u552E\u65B9\u516C\u53F8\u7EB3\u7A0E\u8BC6\u522B\u53F7",width:"140px",prop:"seller_code","show-overflow-tooltip":""}),o(l,{label:"\u5B50\u5546\u54C1\u6BD4\u4F8B",prop:"childNum","show-overflow-tooltip":""}),o(l,{label:"\u5B50\u5546\u54C1\u64CD\u4F5C\u6570\u91CF",prop:"childActionNum","show-overflow-tooltip":""}),o(l,{width:"70px",label:"\u64CD\u4F5C"},{header:i(()=>[E("div",de,[e[4]||(e[4]=E("span",null,"\u64CD\u4F5C",-1)),o(d,{content:"\u6DFB\u52A0",placement:"top"},{default:i(()=>[o(s,{link:"",size:"small",type:"primary",icon:n(F)("add"),onClick:e[0]||(e[0]=m=>b.value=!0)},null,8,["icon"])]),_:1})])]),default:i(({$index:m})=>[o(d,{content:"\u7F16\u8F91",placement:"top"},{default:i(()=>[o(s,{icon:n(F)("edits"),type:"primary",size:"small",link:"",onClick:O=>x(m)},null,8,["icon","onClick"])]),_:2},1024),o(d,{content:"\u5220\u9664",placement:"top"},{default:i(()=>[o(s,{icon:n(F)("delete"),type:"danger",size:"small",link:"",onClick:O=>j(m)},null,8,["icon","onClick"])]),_:2},1024)]),_:1})]),_:1},8,["data"])]),_:1}),o(B,{label:"\u5165\u8D26\u6708\u4EFD",prop:"month"},{default:i(()=>[o(ne,{placeholder:"\u5165\u8D26\u6708\u4EFD",company_code:n(c).data.buyer_code},null,8,["company_code"])]),_:1})]),_:1},8,["model"]),E("div",re,[o(s,{type:"primary",onClick:M},{default:i(()=>e[5]||(e[5]=[ee("\u4FDD\u5B58")])),_:1})])]),_:1})):h("v-if",!0)]),_:1},8,["modelValue"])]),_:1},8,["label"])]),_:1}),o(ue,{visible:b.value,"onUpdate:visible":e[2]||(e[2]=m=>b.value=m),otherSearchParameter:A.value,onSubmit:V},null,8,["visible","otherSearchParameter"]),o(le,{data:f.data,index:f.index,visible:f.editVisible,"onUpdate:visible":e[3]||(e[3]=m=>f.editVisible=m),onSubmit:P},null,8,["data","index","visible"])])),[[q,n(c).loading]])}}});var ye=$(ce,[["__file","C:/Users/89793/Desktop/projects/ticket-system/src/views/invoiceInOut/inOutManager/detail.vue"]]);export{ye as default};
|