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