detail.344814.js 6.1 KB

1
  1. import{_ as H,d as J,w as C,aX as K,W as Q,a7 as W,r as m,at as X,H as Y,l as a,o as h,c as Z,j as o,C as i,ah as ee,G as y,a as E,aK as oe,aL as F,h as g,J as k,b9 as le,aP as te,aQ as N,M as ue,az as V}from"./index.js";import{o as ae,C as se}from"./ChildGoodEditModal.682aea.js";import{u as ie}from"./useDetail.b6f9d593.js";import{B as ne}from"./basic-descriptions.4fe7a992.js";import de from"./index.5a0076.js";import{h as A,e as re}from"./index.e9006de7.js";import"./status.4e0ebdbc.js";import"./shared.b2aeacac.js";import"./tootip.df6555b6.js";import"./use-page-search.64c4cb3a.js";import"./index.09815a1f.js";const ce={class:"padding__container"},pe={class:"w-full flex justify-between"},me={class:"flex w-full justify-end"},fe=J({__name:"detail",setup(ve){const{title:w,collapses:_,id:v}=ie({baseName:"\u8BA1\u63D0\u51FA\u5E93\u660E\u7EC6\u5904\u7406",collapseLen:2}),b=C(!1),p=K(),f=Q({editVisible:!1,index:-1,data:{}}),D=C(!1),B=C(null),T=W(()=>p.data?p.data.type=="2"?{basic_status:"1"}:{basic_status:"2"}:{}),l=C({goods:[],checkFee:"",is_CheckOrder:""}),x={goods:[{required:!0,message:"\u8BF7\u9009\u62E9\u64CD\u4F5C\u5546\u54C1"}],checkFee:[{required:!0,message:"\u8BF7\u8F93\u5165\u8C03\u6574\u91D1\u989D"}],is_CheckOrder:[{required:!0,message:"\u8BF7\u9009\u62E9\u662F\u5426\u52A0\u5165\u8C03\u6574\u5355"}]};function O(t){const e=l.value.goods.map(({id:u})=>u),s=[];t.forEach(u=>{e.includes(u.id)||s.push(u)}),l.value.goods=[...s,...l.value.goods],M()}function S(t){f.index=t,f.editVisible=!0,f.data={...l.value.goods[t]}}function G(t,e){let s=Array.isArray(t)?t.length:0;if(s>0){let u=0,n=t[0][e],d=[1];for(let c=1;c<s;c++)t[c][e]==n?(d[u]+=1,d[c]=0):(u=c,d[c]=1,n=t[c][e]);return d}else return[0]}function I({row:t,column:e,rowIndex:s,columnIndex:u}){if([0,1,2,7].includes(Number(u)))return{rowspan:G(l.value.goods,"id")[s],colspan:1}}async function U(){try{await B.value.validate();const t=l.value.goods.map(({id:d,goodNum:c})=>({id:d,num:c})),e=[],s={};for(const d of t)s[d.id]||(e.push(d),s[d.id]=!0);D.value=!0;const{code:u,message:n}=await re({relaArr:e,manager_id:v.value,checkFee:l.value.checkFee,is_CheckOrder:l.value.is_CheckOrder});D.value=!1,u==0?(V.success("\u64CD\u4F5C\u5B8C\u6210"),p.run(A({id:v.value}))):V.warning(n)}catch{}}function P(t,e){const{id:s}=l.value.goods[t];l.value.goods.forEach((u,n)=>{u.id===s&&(l.value.goods[n].goodNum=e.goodNum,l.value.goods[n].childNum&&(l.value.goods[n].childActionNum=l.value.goods[n].childNum*e.goodNum))})}function z(t){const{id:e}=l.value.goods[t];l.value.goods=l.value.goods.filter(s=>s.id!==e)}function M(){let t="0";l.value.goods.forEach(e=>{t+=Number(Number(e.goodNum*e.subunit_price).toFixed(2)).toFixed(2)}),l.value.checkFee=t}return v.value&&p.run(A({id:v.value})),(t,e)=>{const s=m("ElCollapseItem"),u=m("ElTableColumn"),n=m("ElButton"),d=m("ElTooltip"),c=m("ElTable"),j=m("ElCollapse"),R=m("ElTabPane"),q=m("ElTabs"),L=X("loading");return Y((h(),Z("div",ce,[o(q,null,{default:i(()=>[o(R,{label:a(w)},{default:i(()=>[o(j,{modelValue:a(_),"onUpdate:modelValue":e[3]||(e[3]=r=>ee(_)?_.value=r:null)},{default:i(()=>[o(s,{title:a(w),name:"1"},{default:i(()=>[a(p).data?(h(),y(a(ne),{key:0,columns:a(ae),data:a(p).data},null,8,["columns","data"])):E("v-if",!0)]),_:1},8,["title"]),E(" && detailTask.data.type == '1' "),a(p).data&&a(p).data.status=="1"?(h(),y(s,{key:0,title:"\u51FA\u5165\u5E93\u4FE1\u606F\u786E\u8BA4",name:"2"},{default:i(()=>[o(a(oe),{ref_key:"formRef",ref:B,rules:x,model:l.value,"label-width":"140px"},{default:i(()=>[o(a(F),{label:"\u5173\u8054\u51ED\u8BC1",prop:"goods"},{default:i(()=>[o(c,{"span-method":I,border:"",size:"small",data:l.value.goods},{default:i(()=>[o(u,{label:"\u5546\u54C1\u7F16\u53F7",prop:"skuCode","show-overflow-tooltip":""}),o(u,{label:"\u5546\u54C1\u540D\u79F0",prop:"goodName","show-overflow-tooltip":""}),o(u,{label:"\u8D26\u9762\u6570\u91CF",prop:"total_stock","show-overflow-tooltip":""}),o(u,{label:"\u76EE\u6807\u5546\u54C1\u6BD4\u4F8B",prop:"spbl","show-overflow-tooltip":""}),o(u,{label:"\u5173\u8054\u6570\u91CF",prop:"goodNum","show-overflow-tooltip":""}),o(u,{label:"\u7A0E\u524D\u5355\u4EF7",prop:"subunit_price","show-overflow-tooltip":""}),o(u,{label:"\u7A0E\u540E\u603B\u4EF7",prop:"unit_price",width:"140px","show-overflow-tooltip":""}),o(u,{width:"70px",label:"\u64CD\u4F5C"},{header:i(()=>[g("div",pe,[e[6]||(e[6]=g("span",null,"\u64CD\u4F5C",-1)),o(d,{content:"\u6DFB\u52A0",placement:"top"},{default:i(()=>[o(n,{link:"",size:"small",type:"primary",icon:a(k)("add"),onClick:e[0]||(e[0]=r=>b.value=!0)},null,8,["icon"])]),_:1})])]),default:i(({$index:r})=>[o(d,{content:"\u7F16\u8F91",placement:"top"},{default:i(()=>[o(n,{icon:a(k)("edits"),type:"primary",size:"small",link:"",onClick:$=>S(r)},null,8,["icon","onClick"])]),_:2},1024),o(d,{content:"\u5220\u9664",placement:"top"},{default:i(()=>[o(n,{icon:a(k)("delete"),type:"danger",size:"small",link:"",onClick:$=>z(r)},null,8,["icon","onClick"])]),_:2},1024)]),_:1})]),_:1},8,["data"])]),_:1}),o(a(F),{label:"\u8C03\u6574\u8D39\u7528",prop:"checkFee"},{default:i(()=>[o(a(le),{modelValue:l.value.checkFee,"onUpdate:modelValue":e[1]||(e[1]=r=>l.value.checkFee=r),unit:"\u5143",placeholder:"\u8C03\u6574\u8D39\u7528"},null,8,["modelValue"])]),_:1}),o(a(F),{label:"\u662F\u5426\u6DFB\u52A0\u81F3\u8C03\u6574\u5355",prop:"is_CheckOrder"},{default:i(()=>[o(a(te),{modelValue:l.value.is_CheckOrder,"onUpdate:modelValue":e[2]||(e[2]=r=>l.value.is_CheckOrder=r)},{default:i(()=>[o(a(N),{label:"\u662F",value:"1"}),o(a(N),{label:"\u5426",value:"2"})]),_:1},8,["modelValue"])]),_:1})]),_:1},8,["model"]),g("div",me,[o(n,{type:"primary",onClick:U},{default:i(()=>e[7]||(e[7]=[ue("\u4FDD\u5B58")])),_:1})])]),_:1})):E("v-if",!0)]),_:1},8,["modelValue"])]),_:1},8,["label"])]),_:1}),o(de,{visible:b.value,"onUpdate:visible":e[4]||(e[4]=r=>b.value=r),otherSearchParameter:T.value,onSubmit:O},null,8,["visible","otherSearchParameter"]),o(se,{data:f.data,index:f.index,visible:f.editVisible,"onUpdate:visible":e[5]||(e[5]=r=>f.editVisible=r),onSubmit:P},null,8,["data","index","visible"])])),[[L,a(p).loading]])}}});var ye=H(fe,[["__file","C:/Users/89793/Desktop/projects/ticket-system/src/views/invoiceInOut/provisionOut/detail.vue"]]);export{ye as default};