detail.2f4bcc.js 5.5 KB

1
  1. import{_ as H,d as J,w as C,aX as K,W as L,a7 as O,r as p,at as W,H as X,l as d,o as g,c as Q,j as o,C as n,ah as Y,G as y,a as _,aK as Z,h as E,J as F,M as ee,az as N}from"./index.js";import{o as oe,C as le}from"./ChildGoodEditModal.15a4f7.js";import{u as te}from"./useDetail.859787a2.js";import{B as ae}from"./basic-descriptions.e05142a3.js";import ue from"./index.308ddd.js";import{h as T,b as se}from"./index.8858cda3.js";import{S as ne}from"./index.e7a5afd5.js";import"./status.d3ab78fb.js";import"./shared.6c13f2bb.js";import"./tootip.dc37052a.js";import"./use-page-search.d1285cf7.js";import"./index.a51214a2.js";const ie={class:"padding__container"},de={class:"w-full flex justify-between"},re={class:"flex w-full justify-end"},me=J({__name:"detail",setup(ce){const{title:w,collapses:b,id:v}=te({baseName:"\u5165\u5E93",collapseLen:2}),h=C(!1),c=K(),f=L({editVisible:!1,index:-1,data:{}}),D=C(!1),k=C(null),V=O(()=>c.data?c.data.type=="2"?{basic_status:"1"}:{basic_status:"2"}:{}),t=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 A(a){const e=t.value.goods.map(({id:l})=>l),u=[];a.forEach(l=>{e.includes(l.id)||u.push(l)}),t.value.goods=[...u,...t.value.goods]}function x(a){f.index=a,f.editVisible=!0,f.data={...t.value.goods[a]}}function G(a,e){let u=Array.isArray(a)?a.length:0;if(u>0){let l=0,s=a[0][e],i=[1];for(let r=1;r<u;r++)a[r][e]==s?(i[l]+=1,i[r]=0):(l=r,i[r]=1,s=a[r][e]);return i}else return[0]}function I({row:a,column:e,rowIndex:u,columnIndex:l}){if([0,1,2,7].includes(Number(l)))return{rowspan:G(t.value.goods,"id")[u],colspan:1}}async function M(){try{await k.value.validate();const a=t.value.goods.map(({id:i,goodNum:r})=>({id:i,num:r})),e=[],u={};for(const i of a)u[i.id]||(e.push(i),u[i.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(a,e){const{id:u}=t.value.goods[a];t.value.goods.forEach((l,s)=>{l.id===u&&(t.value.goods[s].goodNum=e.goodNum,t.value.goods[s].childNum&&(t.value.goods[s].childActionNum=t.value.goods[s].childNum*e.goodNum))})}function z(a){const{id:e}=t.value.goods[a];t.value.goods=t.value.goods.filter(u=>u.id!==e)}return v.value&&c.run(T({id:v.value})),(a,e)=>{const u=p("ElCollapseItem"),l=p("ElTableColumn"),s=p("ElButton"),i=p("ElTooltip"),r=p("ElTable"),B=p("ElFormItem"),U=p("ElCollapse"),j=p("ElTabPane"),R=p("ElTabs"),q=W("loading");return X((g(),Q("div",ie,[o(R,null,{default:n(()=>[o(j,{label:d(w)},{default:n(()=>[o(U,{modelValue:d(b),"onUpdate:modelValue":e[2]||(e[2]=m=>Y(b)?b.value=m:null)},{default:n(()=>[o(u,{title:d(w),name:"1"},{default:n(()=>[d(c).data?(g(),y(d(ae),{key:0,columns:d(oe),data:d(c).data},null,8,["columns","data"])):_("v-if",!0)]),_:1},8,["title"]),_(" && detailTask.data.type == '1' "),d(c).data&&d(c).data.status=="1"?(g(),y(u,{key:0,title:"\u51FA\u5165\u5E93\u4FE1\u606F\u786E\u8BA4",name:"2"},{default:n(()=>[o(d(Z),{ref_key:"formRef",ref:k,rules:S,model:t.value},{default:n(()=>[o(B,{label:"\u64CD\u4F5C\u5546\u54C1",prop:"goods"},{default:n(()=>[o(r,{"span-method":I,border:"",size:"small",data:t.value.goods},{default:n(()=>[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:n(()=>[E("div",de,[e[5]||(e[5]=E("span",null,"\u64CD\u4F5C",-1)),o(i,{content:"\u6DFB\u52A0",placement:"top"},{default:n(()=>[o(s,{link:"",size:"small",type:"primary",icon:d(F)("add"),onClick:e[0]||(e[0]=m=>h.value=!0)},null,8,["icon"])]),_:1})])]),default:n(({$index:m})=>[o(i,{content:"\u7F16\u8F91",placement:"top"},{default:n(()=>[o(s,{icon:d(F)("edits"),type:"primary",size:"small",link:"",onClick:$=>x(m)},null,8,["icon","onClick"])]),_:2},1024),o(i,{content:"\u5220\u9664",placement:"top"},{default:n(()=>[o(s,{icon:d(F)("delete"),type:"danger",size:"small",link:"",onClick:$=>z(m)},null,8,["icon","onClick"])]),_:2},1024)]),_:1})]),_:1},8,["data"])]),_:1}),o(B,{label:"\u5165\u8D26\u6708\u4EFD",prop:"month"},{default:n(()=>[_(' :company_code="detailTask.data.buyer_code" '),o(ne,{modelValue:t.value.month,"onUpdate:modelValue":e[1]||(e[1]=m=>t.value.month=m),placeholder:"\u5165\u8D26\u6708\u4EFD"},null,8,["modelValue"])]),_:1})]),_:1},8,["model"]),E("div",re,[o(s,{type:"primary",onClick:M},{default:n(()=>e[6]||(e[6]=[ee("\u4FDD\u5B58")])),_:1})])]),_:1})):_("v-if",!0)]),_:1},8,["modelValue"])]),_:1},8,["label"])]),_:1}),o(ue,{visible:h.value,"onUpdate:visible":e[3]||(e[3]=m=>h.value=m),otherSearchParameter:V.value,onSubmit:A},null,8,["visible","otherSearchParameter"]),o(le,{data:f.data,index:f.index,visible:f.editVisible,"onUpdate:visible":e[4]||(e[4]=m=>f.editVisible=m),onSubmit:P},null,8,["data","index","visible"])])),[[q,d(c).loading]])}}});var ke=H(me,[["__file","C:/Users/89793/Desktop/projects/ticket-system/src/views/invoiceInOut/inManager/detail.vue"]]);export{ke as default};