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