1 |
- import{ac as I,aZ as R,d as ee,a$ as he,n as Fe,w as E,r as G,o as F,G as D,C as r,l as e,a as y,j as t,M as $,ah as ue,b0 as ge,_ as te,az as B,aY as q,a4 as be,W as we,a7 as M,at as _e,H,c as K,aJ as P,aM as W,aN as f,a_ as z,aR as x,J as O,h as V,L as U,aK as Ee,aI as De}from"./index.js";import{o as Be,i as ye,a as ke,C as Ae}from"./ChildGoodEditModal.b0de1a.js";import{u as Te}from"./useDetail.32a642c5.js";import{B as L}from"./basic-descriptions.2d799182.js";import{u as Ne}from"./use-page-search.d7df394f.js";import{h as Se,a as Pe}from"./index.201d3c34.js";import{c as xe,a as Y,g as Ve}from"./status.b7512d56.js";import{r as Z}from"./columnRenderHelper.e1123c92.js";import{g as Je,b as oe}from"./columns.cfbb53f4.js";import{h as Q,c as Ie}from"./index.7a9097e5.js";import{P as Re}from"./index.5f41e9b6.js";import{S as Me}from"./index.da24816f.js";import{a as ze}from"./calc.850c7422.js";import"./shared.cf063854.js";import"./tootip.ff1af1fd.js";import"./shared.4cd09a2f.js";const Oe=[{width:30,type:"selection",fixed:"left"},{label:"ID",prop:"id",width:80},{label:"\u5546\u54C1\u7F16\u7801",prop:"skuCode",width:150},{label:"\u5546\u54C1\u540D\u79F0",prop:"goodName",width:150},{label:"\u5546\u54C1\u7C7B\u578B",width:100,cellRenderer({row:v}){return I(R,{size:"small"},{default:()=>{var C;return((C=xe.find(p=>p.value==v.good_type))==null?void 0:C.label)||"--"}})}},{label:"\u7ED3\u5B58\u6570",prop:"residue_stock",width:80},{label:"\u72B6\u6001",prop:"status",width:60,cellRenderer({row:v}){var C;return I(R,{size:"small",type:((C=Y.find(p=>p.value==v.status))==null?void 0:C.type)||"warning"},{default:()=>{var p;return((p=Y.find(_=>_.value==v.status))==null?void 0:p.label)||"--"}})}},{label:"\u5546\u54C1\u6765\u6E90",width:95,cellRenderer({row:v}){return I(R,{size:"small"},{default:()=>{var C;return((C=Je.find(p=>p.value==v.good_source))==null?void 0:C.label)||"--"}})}},{label:"\u6210\u672C\u72B6\u6001",width:75,cellRenderer({row:v}){return I(R,{size:"small"},{default:()=>{var C;return((C=oe.find(p=>p.value==v.basic_status))==null?void 0:C.label)||"--"}})}},{label:"\u7A0E\u524D\u5355\u4EF7",prop:"subunit_price",width:100},{label:"\u7A0E\u540E\u5355\u4EF7",prop:"unit_price",width:100},{label:"\u5355\u4F4D",prop:"unit",width:42},{label:"\u89C4\u683C",prop:"spec",width:80},{label:"\u91CD\u91CF",prop:"unit_weight",width:80},{label:"\u9500\u552E\u65B9\u516C\u53F8",width:160,...Z("seller_code","seller_name","\u9500\u552E\u65B9\u516C\u53F8\u7EB3\u7A0E\u53F7:")},{label:"\u8D2D\u4E70\u65B9\u516C\u53F8",width:160,...Z("buyer_code","buyer_name","\u8D2D\u4E70\u65B9\u516C\u53F8\u7EB3\u7A0E\u53F7:")},{label:"\u521B\u5EFA\u4EBA",prop:"apply_name",width:80},{label:"\u521B\u5EFA\u65F6\u95F4",prop:"create_time",width:140}],Ge={columns:Oe,companyProp:"buyer_code",apis:{httpList:(v={})=>Se({...v,status:"1"})}},X={formItems:[{field:"timer",type:"date_picker",span:7,label:"\u521B\u5EFA\u65F6\u95F4",otherOptions:{type:"daterange",startProp:"start",endProp:"end",startPlaceholder:"\u5F00\u59CB\u65F6\u95F4",endPlaceholder:"\u7ED3\u675F\u65F6\u95F4"}},{field:"good_type",type:"select",options:Ve,placeholder:"\u5546\u54C1\u7C7B\u578B",otherOptions:{disabled:!0}},{type:"select",placeholder:"\u6210\u672C\u7C7B\u578B",field:"basic_status",options:oe,otherOptions:{disabled:!0}}]},Ue=ee({__name:"index",props:{visible:{type:Boolean,required:!0},otherSearchParameter:{type:null,required:!0},skuCode:{type:String,required:!1},isJT:{type:Boolean,required:!0}},emits:["submit"],setup(v,{emit:C}){const p=v,_=C,g=he(p,"visible"),A=Fe(),T={pageSearchHook:()=>Ne(void 0,void 0,X)},b=E([]),k={content:{preview:({id:h})=>A.push("/invoiceInOut/productManagerDetail?id="+h),create:()=>A.push("/invoiceInOut/productManagerDetail")}};function s(){if(b.value.length===0){B.warning("\u8BF7\u9009\u62E9\u81F3\u5C11\u4E00\u4E2A\u5546\u54C1");return}if(p.isJT){if(b.value.length>1){B.warning("\u53EA\u80FD\u9009\u62E9\u4E00\u6761\u8BA1\u63D0\u5546\u54C1");return}}else{const n=[...new Set(b.value.map(({skuCode:w})=>w))];if(n.length!==1){B.warning("\u9009\u62E9\u7684\u5546\u54C1\u7684\u5546\u54C1\u7F16\u53F7\u5FC5\u987B\u4E00\u81F4");return}if(p.skuCode&&n[0]!==p.skuCode){B.warning("\u9009\u62E9\u7684\u5546\u54C1\u7684\u5546\u54C1\u7F16\u53F7\u5FC5\u987B\u548C\u5F53\u524D\u9009\u62E9\u5546\u54C1\u7684\u5546\u54C1\u7F16\u53F7\u5FC5\u987B\u4E00\u81F4");return}}const h=[];b.value.forEach(n=>{n.ProductsCombind.length===0?h.push({...n,goodNum:"",isJT:p.isJT}):n.ProductsCombind.forEach(w=>{h.push({...n,isJT:p.isJT,goodNum:"",childCode:w.products.skuCode,childNum:w.child_num,childActionNum:""})})}),g.value=!1,_("submit",h)}return(h,n)=>{const w=G("PageContainer"),J=G("ElButton");return F(),D(e(ge),{class:"relative",modelValue:e(g),"onUpdate:modelValue":n[1]||(n[1]=N=>ue(g)?g.value=N:null),title:h.isJT?"\u6DFB\u52A0\u8BA1\u63D0\u5546\u54C1":"\u9009\u62E9\u5546\u54C1",center:"",top:"10px"},{default:r(()=>[e(g)?(F(),D(w,{key:0,"only-self":!0,hooks:T,events:k,searchConfig:e(X),contentConfig:e(Ge),isPageStart:!0,"other-search-parameter":h.otherSearchParameter,onContentSelectChange:n[0]||(n[0]=N=>b.value=N.map(S=>({...S,child_num:"1",child_id:S.id})))},null,8,["searchConfig","contentConfig","other-search-parameter"])):y("v-if",!0),t(J,{class:"absolute bottom-[30px] right-[20px]",type:"primary",onClick:s},{default:r(()=>n[2]||(n[2]=[$("\u4FDD\u5B58 ")])),_:1})]),_:1},8,["modelValue","title"])}}});var Le=te(Ue,[["__file","C:/Users/89793/Desktop/projects/ticket-system/src/components/ChooseGoodModal/index.vue"]]);const $e={class:"padding__container"},je={class:"w-full flex justify-between mb-[10px]"},qe={class:"w-full flex justify-between"},He={class:"flex w-full justify-end"},Ke=ee({__name:"detail",setup(v){const{title:C,collapses:p,id:_}=Te({baseName:"\u51FA\u5E93",collapseLen:5}),g=E(!1),A=E(!1),T=E(!1),b=E(0),k=q(),s=q(),{isSuperUser:h}=be(),n=we({editVisible:!1,index:-1,data:{}}),w=E(!1),J=E(null),N=M(()=>{var u;return s.data?{...{},good_type:(u=s.data)==null?void 0:u.goodType}:{}}),S=M(()=>{const a=l.value.goods.map(({id:d,goodNum:m})=>({id:d,num:m})),u={};let i=0;for(const d of a)if(!u[d.id]){u[d.id]=!0;const{num:m="0"}=d;i=ze(m,i)}return i}),ae=M(()=>l.value.goods.map(({id:u,goodNum:i,isJT:d})=>({id:u,num:i,isJT:d})).some(({isJT:u})=>u)),j=M(()=>l.value.goods.filter(a=>!a.isJT)),l=E({goods:[],month:""}),le={goods:[{required:!0,message:"\u8BF7\u9009\u62E9\u64CD\u4F5C\u5546\u54C1"}],month:[{required:!0,message:"\u8BF7\u9009\u62E9\u5165\u8D26\u6708\u4EFD"}]};function se(a){const u=l.value.goods.map(({id:d})=>d),i=[];a.forEach(d=>{u.includes(d.id)||i.push(d)}),l.value.goods=[...l.value.goods,...i]}function ie(a){n.index=a,n.editVisible=!0,n.data={...l.value.goods[a]}}function re(a,u){let i=Array.isArray(a)?a.length:0;if(i>0){let d=0,m=a[0][u],o=[1];for(let c=1;c<i;c++)a[c][u]==m?(o[d]+=1,o[c]=0):(d=c,o[c]=1,m=a[c][u]);return o}else return[0]}function ne({row:a,column:u,rowIndex:i,columnIndex:d}){if([0,1,2,3,4,5,9].includes(Number(d)))return{rowspan:re(l.value.goods,"id")[i],colspan:1}}async function de(){try{await J.value.validate();const a=l.value.goods.map(({id:c,goodNum:fe,unit_price:Ce,subunit_price:ve})=>({id:c,unit_price:Ce,num:fe,subunit_price:ve})),u=[],i={};for(const c of a)i[c.id]||(u.push(c),i[c.id]=!0);if(Number(s.data.balance_num)!==Number(S.value)){B.warning("\u64CD\u4F5C\u6570\u91CF\u5FC5\u987B\u7B49\u4E8E\u5F85\u5904\u7406\u6570\u91CF");return}if(l.value.goods.filter(c=>!!c.num).length!==0){B.warning("\u5546\u54C1\u64CD\u4F5C\u6570\u91CF\u4E0D\u80FD\u4E3A\u7A7A");return}w.value=!0;const{code:m,message:o}=await Ie({relaArr:u,manager_id:_.value,is_checkOrder:ae.value?"1":"0",fz_date:l.value.month});w.value=!1,m==0?(B.success("\u64CD\u4F5C\u5B8C\u6210"),s.run(Q({id:_.value}))):B.warning(o)}catch{}}function pe(a,u){const{id:i}=l.value.goods[a];l.value.goods.forEach((d,m)=>{if(d.id===i){l.value.goods[m].goodNum=u.goodNum;const{goodNum:o,residue_stock:c}=u;l.value.goods[m].isJT=o>c,l.value.goods[m].childNum&&(l.value.goods[m].isJT=o>c,l.value.goods[m].childActionNum=l.value.goods[m].childNum*u.goodNum)}})}function ce(a,u){T.value=!0,b.value=u,k.run(Pe({id:a}))}function me(a){const{id:u}=l.value.goods[a];l.value.goods=l.value.goods.filter(i=>i.id!==u)}return _.value&&s.run(Q({id:_.value})),(a,u)=>{const i=G("ElFormItem"),d=G("ElDialog"),m=_e("loading");return H((F(),K("div",$e,[t(e(De),{modelValue:e(p),"onUpdate:modelValue":u[2]||(u[2]=o=>ue(p)?p.value=o:null)},{default:r(()=>[t(e(P),{title:e(C),name:"1"},{default:r(()=>[e(s).data?(F(),D(e(L),{key:0,columns:e(Be),data:e(s).data},null,8,["columns","data"])):y("v-if",!0)]),_:1},8,["title"]),t(e(P),{title:"\u8BA2\u5355\u8BE6\u60C5",name:"2"},{default:r(()=>[e(s).data?(F(),D(e(L),{key:0,columns:e(ye),data:e(s).data},null,8,["columns","data"])):y("v-if",!0)]),_:1}),t(e(P),{title:"\u53D1\u7968\u8BE6\u60C5",name:"3"},{default:r(()=>[e(s).data?(F(),D(e(L),{key:0,columns:e(ke),data:e(s).data},null,8,["columns","data"])):y("v-if",!0)]),_:1}),e(s).data&&e(s).data.status=="2"?(F(),D(e(P),{key:0,title:"\u5546\u54C1\u4FE1\u606F",name:"4"},{default:r(()=>[t(e(W),{size:"small",border:"",data:e(s).data.ProductRela},{default:r(()=>[t(e(f),{label:"\u5546\u54C1ID",prop:"product_id",width:"60px","show-overflow-tooltip":""}),t(e(f),{label:"\u5546\u54C1\u7F16\u53F7",prop:"skuCode","show-overflow-tooltip":""}),t(e(f),{label:"\u5546\u54C1\u540D\u79F0",prop:"goodName","show-overflow-tooltip":""}),t(e(f),{label:"\u64CD\u4F5C\u6570\u91CF",prop:"num",width:"80px","show-overflow-tooltip":""}),t(e(f),{label:"\u521B\u5EFA\u65F6\u95F4",prop:"create_time","show-overflow-tooltip":""}),t(e(f),{label:"\u64CD\u4F5C",width:"100px"},{default:r(o=>[t(e(z),{content:"\u67E5\u770B\u8BE6\u60C5"},{default:r(()=>[t(e(x),{type:"primary",link:"",icon:e(O)("eye-view"),onClick:c=>ce(o.row.product_id,o.$index)},null,8,["icon","onClick"])]),_:2},1024)]),_:1})]),_:1},8,["data"])]),_:1})):y("v-if",!0),!e(h)&&e(s).data&&(e(s).data.status=="1"||e(s).data.status=="4")?(F(),D(e(P),{key:1,name:"5",title:"\u5F85\u5904\u7406\u4FE1\u606F"},{default:r(()=>[V("div",je,[V("p",null,"\u5F85\u5904\u7406 "+U(Number(e(s).data.balance_num))+" / "+U(S.value),1)]),t(e(Ee),{ref_key:"formRef",ref:J,rules:le,model:l.value},{default:r(()=>[t(i,{label:"\u64CD\u4F5C\u5546\u54C1",prop:"goods"},{default:r(()=>[t(e(W),{"span-method":ne,border:"",size:"small",data:l.value.goods},{default:r(()=>[t(e(f),{label:"\u5546\u54C1ID",prop:"id",width:"60px","show-overflow-tooltip":""}),t(e(f),{label:"\u5546\u54C1\u7F16\u53F7",prop:"skuCode","show-overflow-tooltip":""}),t(e(f),{label:"\u5546\u54C1\u540D\u79F0",prop:"goodName","show-overflow-tooltip":""}),t(e(f),{label:"\u662F\u5426\u4E3A\u8BA1\u63D0",prop:"residue_stock",width:"80px","show-overflow-tooltip":""},{default:r(({row:o})=>[$(U(o.isJT?"\u662F":"\u5426"),1)]),_:1}),t(e(f),{label:"\u7ED3\u5B58\u6570",prop:"residue_stock",width:"80px","show-overflow-tooltip":""}),t(e(f),{label:"\u64CD\u4F5C\u6570\u91CF",prop:"goodNum",width:"80px","show-overflow-tooltip":""}),t(e(f),{label:"\u5B50\u5546\u54C1\u7F16\u53F7",prop:"childCode","show-overflow-tooltip":""}),t(e(f),{label:"\u5B50\u5546\u54C1\u6BD4\u4F8B",prop:"childNum","show-overflow-tooltip":""}),t(e(f),{label:"\u5B50\u5546\u54C1\u64CD\u4F5C\u6570\u91CF",prop:"childActionNum",width:"110px","show-overflow-tooltip":""}),t(e(f),{width:"70px",label:"\u64CD\u4F5C"},{header:r(()=>[V("div",qe,[u[6]||(u[6]=V("span",null,"\u64CD\u4F5C",-1)),t(e(z),{content:"\u6DFB\u52A0",placement:"top"},{default:r(()=>[t(e(x),{link:"",size:"small",type:"primary",icon:e(O)("add"),onClick:u[0]||(u[0]=o=>{A.value=!1,g.value=!0})},null,8,["icon"])]),_:1})])]),default:r(({$index:o})=>[t(e(z),{content:"\u7F16\u8F91",placement:"top"},{default:r(()=>[t(e(x),{icon:e(O)("edits"),type:"primary",size:"small",link:"",onClick:c=>ie(o)},null,8,["icon","onClick"])]),_:2},1024),t(e(z),{content:"\u5220\u9664",placement:"top"},{default:r(()=>[t(e(x),{icon:e(O)("delete"),type:"danger",size:"small",link:"",onClick:c=>me(o)},null,8,["icon","onClick"])]),_:2},1024)]),_:1})]),_:1},8,["data"])]),_:1}),t(i,{label:"\u5165\u8D26\u6708\u4EFD",prop:"month"},{default:r(()=>[t(Me,{placeholder:"\u5165\u8D26\u6708\u4EFD",modelValue:l.value.month,"onUpdate:modelValue":u[1]||(u[1]=o=>l.value.month=o)},null,8,["modelValue"])]),_:1})]),_:1},8,["model"]),V("div",He,[t(e(x),{type:"primary",onClick:de},{default:r(()=>u[7]||(u[7]=[$("\u4FDD\u5B58")])),_:1})])]),_:1})):y("v-if",!0)]),_:1},8,["modelValue"]),t(Le,{visible:g.value,"onUpdate:visible":u[3]||(u[3]=o=>g.value=o),isJT:A.value,otherSearchParameter:N.value,onSubmit:se,skuCode:j.value.length===0?"":j.value[0].skuCode},null,8,["visible","isJT","otherSearchParameter","skuCode"]),t(Ae,{data:n.data,index:n.index,visible:n.editVisible,"onUpdate:visible":u[4]||(u[4]=o=>n.editVisible=o),onSubmit:pe},null,8,["data","index","visible"]),t(d,{center:"",title:"\u5546\u54C1\u8BE6\u60C5",modelValue:T.value,"onUpdate:modelValue":u[5]||(u[5]=o=>T.value=o),style:{overflow:"hidden"}},{default:r(()=>[H((F(),K("div",null,[e(k).data?(F(),D(Re,{key:0,data:e(k).data,num:e(s).data.ProductRela[b.value].num,time:e(s).data.ProductRela[b.value].create_time},null,8,["data","num","time"])):y("v-if",!0)])),[[m,e(k).loading]])]),_:1},8,["modelValue"])])),[[m,e(s).loading]])}}});var pu=te(Ke,[["__file","C:/Users/89793/Desktop/projects/ticket-system/src/views/invoiceInOut/outManager/detail.vue"]]);export{pu as default};
|