2 lines
14 KiB
JavaScript
2 lines
14 KiB
JavaScript
import{Z as me,_ as _e,$ as fe,R as ce,S as ge,F as be,D as he,H as Fe,I as Ve,v as ve,w as Ee,M as ye,b as Ce,N as we,G as De,K as Be,J as ke}from"./element-plus.74f0cd57.js";import{d as j,r as b,$ as P,o as v,c as D,W as u,Q as t,a as h,u as a,F as x,a9 as O,P as Y,U as V,aa as H,V as B,j as G,n as k}from"./@vue.340249d8.js";import{a as Ue}from"./vue-router.9ddb0e92.js";import{a as Ae,b as qe,c as Ke}from"./beforehand_order.a2fb2ac1.js";import{l as Ie}from"./index.d291c744.js";import{_ as Pe}from"./productWarehousePop.vue_vue_type_script_setup_true_name_systemStoreLists_lang.620ee198.js";import{a as xe}from"./useDictOptions.0b410355.js";import"./lodash-es.edba6135.js";import"./@vueuse.e3650918.js";import"./@element-plus.558a564d.js";import"./@popperjs.36402333.js";import"./@ctrl.b082b0c1.js";import"./dayjs.9886411c.js";import"./axios.45058a27.js";import"./async-validator.fb49d0f5.js";import"./memoize-one.4ee5c96d.js";import"./normalize-wheel-es.8aeb3683.js";import"./@floating-ui.0f9ce7c3.js";import"./lodash.3d784a58.js";import"./pinia.97fe9b12.js";import"./css-color-function.5c1c877d.js";import"./color.97e03886.js";import"./clone.cfa55f7b.js";import"./color-convert.755d189f.js";import"./color-name.e7a4e1d3.js";import"./color-string.e356f5de.js";import"./balanced-match.d2a36341.js";import"./ms.564e106c.js";import"./nprogress.8c276ac9.js";import"./vue-clipboard3.44194d32.js";import"./clipboard.47836ecb.js";import"./echarts.8535e5a6.js";import"./zrender.3eba8991.js";import"./tslib.60310f1a.js";import"./highlight.js.31cd7941.js";import"./@highlightjs.309a94da.js";import"./index.vue_vue_type_script_setup_true_lang.21d9ea5c.js";import"./usePaging.fff444fa.js";const Re=h("div",{class:"mb-4 text-lg font-bold"},"\u9884\u5B9A\u5355\u6DFB\u52A0",-1),Se={class:"flex-1 w-full"},$e={class:"mb-2"},Te=h("span",{class:"ml-4"},"\u8BE5\u91D1\u989D\u53EA\u505A\u524D\u53F0\u5C55\u793A,\u540E\u53F0\u4F1A\u4ECE\u65B0\u8BA1\u7B97",-1),Le={class:"ml-20"},Me={class:"flex flex-wrap"},Ne=j({name:"storeProductEdit"}),Uu=j({...Ne,emits:["success","close"],setup(Oe,{emit:Ye}){const{dictData:z}=xe("store_refund_description"),R=b(),s=P({warehouse_id:"",is_buyer:0,supplier_id:"",code:"",total_price:0,order_type:3,store_id:"",arrival_time:"",purpose:"",tables:0,days:0,chef:"",chef_phone:"",splitting_officer:"",merchandiser:"\u4F55\u6708\u82F1",distribution_personnel:"\u4F59\u53CB",transporter:"",system_store_name:"",regional_manager:"\u5F20\u6CE2",mark:"",uid:"",nickname:"",phone:"",store_mark:"",address:""}),J=async o=>{const e=await Ae({id:o.id,user_id:s.uid});U(o,e)},U=(o,e)=>{o.id=e.id,o.image=e.image,o.marques=e.marques,o.store_info=e.store_info,o.price=e.price,o.purchase=e.purchase,o.after_sales=e.after_sales,o.loss=e.loss,o.unit=e.unit,o.store_name=e.store_name,o.unit_name=e.unit_name,o.status_msg=e.status_msg,o.stock=e.stock,o.gross_weight=e.gross_weight,o.net_weight=e.net_weight,o.package=e.package;const r=[];g.value.forEach(i=>{r.push(i.id)}),r.includes(0)==!1&&g.value.push({id:0})},E=b(!1),g=b([{id:0}]),Q=o=>{g.value=g.value.filter(e=>e.id!==o)},W=o=>{o.forEach(e=>{g.value.find(r=>r.id==e.id)||g.value.push(e)}),E.value=!1};function Z(o){o.total_price=(o.nums*o.price).toFixed(2),o.total_price>0&&(s.total_price=(parseFloat(s.total_price)+parseFloat(o.total_price)).toFixed(2))}function X(){s.order_type==7||s.order_type==5?s.is_buyer=0:s.is_buyer=-1}const ee=Ue(),ue=async o=>{const e=g.value.map(r=>({product_id:r.id,nums:r.nums,price:r.price||0,purchase:r.purchase||0,total_price:r.total_price||0,marques:r.marques,store_info:r.store_info,after_sales:r.after_sales,loss:r.loss,unit:r.unit,gross_weight:r.gross_weight,net_weight:r.net_weight,package:r.package,mark:r.mark}));await o.validate((r,i)=>{r&&qe({product_arr:e,...s}).then(d=>{setTimeout(()=>{ee.push({path:"/store_order/beforehand_order"})},2e3)})})},A=b([]),y=b(!1),q=b(),le=o=>{Ke({store_name:o.store_name,product_type:[0,6],is_warehouse:1,user_id:s.uid}).then(e=>{if(e.count==1){const r=e.lists[0];U(o,r)}e.count>1&&(A.value=e.lists,y.value=!0,q.value=o)})},te=o=>{o!=null&&(U(q.value,o),y.value=!1,A.value=[],q.value=[])},f=P({}),C=(o,e,r)=>{const i=["id","store_name","nums","mark"];if(o.keyCode===38){if(e===0)return;f[e+r].blur(),k(()=>{f[e-1+r].focus()})}if(o.keyCode===40){if(e===g.value.length-1)return;f[e+r].blur(),k(()=>{f[e+1+r].focus()})}if(o.keyCode===37){if(e===0&&r===i[0])return;if(f[e+r].blur(),r===i[0])f[e-1+i[i.length-1]].focus();else{const d=i.findIndex(p=>p===r)-1;k(()=>{f[e+i[d]].focus()})}}if(o.keyCode===39){if(e===g.value.length-1&&r===i[i.length-1])return;if(f[e+r].blur(),r===i[i.length-1])f[e+1+i[0]].focus();else{const d=i.findIndex(p=>p===r)+1;k(()=>{f[e+i[d]].focus()})}}},oe=P({uid:[{required:!0,message:"\u8BF7\u8F93\u5165\u91C7\u8D2D\u7528\u6237",trigger:["blur"]}],store_id:[{required:!0,message:"\u8BF7\u9009\u62E9\u95E8\u5E97",trigger:["blur"]}],arrival_time:[{required:!0,message:"\u8BF7\u9009\u62E9\u5230\u8D27\u65F6\u95F4",trigger:["blur"]}],tables:[{required:!0,message:"\u8BF7\u8F93\u5165\u684C\u6570",trigger:["blur"]}],days:[{required:!0,message:"\u8BF7\u8F93\u5165\u5929\u6570",trigger:["blur"]}],chef:[{required:!0,message:"\u8BF7\u8F93\u5165\u53A8\u5E08",trigger:["blur"]}],chef_phone:[{required:!0,message:"\u8BF7\u8F93\u5165\u53A8\u5E08\u7535\u8BDD",trigger:["blur"]}],purpose:[{required:!0,message:"\u8BF7\u8F93\u5165\u91C7\u8D2D\u76EE\u7684",trigger:["blur"]}],system_store_name:[{required:!0,message:"\u8BF7\u8F93\u5165\u95E8\u5E97\u8054\u7CFB\u4EBA",trigger:["blur"]}],splitting_officer:[{required:!0,message:"\u8BF7\u8F93\u5165\u5206\u5355\u5458",trigger:["blur"]}],merchandiser:[{required:!0,message:"\u8BF7\u8F93\u5165\u8DDF\u5355\u5458",trigger:["blur"]}],distribution_personnel:[{required:!0,message:"\u8BF7\u8F93\u5165\u4ED3\u7BA1\u5458",trigger:["blur"]}],transporter:[{required:!0,message:"\u8BF7\u8F93\u5165\u8FD0\u8F93\u5458",trigger:["blur"]}],regional_manager:[{required:!0,message:"\u8BF7\u8F93\u5165\u533A\u57DF\u7ECF\u7406",trigger:["blur"]}]}),w=b(!1),S=b([]),ae=(o="")=>{w.value=!0,Ie({nickname:o,page_size:10}).then(e=>{S.value=e.lists,setTimeout(()=>{w.value=!1},300)}).catch(e=>{setTimeout(()=>{w.value=!1},300)})},re=()=>{E.value=!0},$=b(0),se=o=>{$.value++};return(o,e)=>{const r=ce,i=ge,d=be,p=me,c=he,F=_e,K=Fe,ne=Ve,de=fe,T=ve,I=Ee,_=ye,L=Ce,M=we,ie=De,N=Be,pe=ke;return v(),D(x,null,[u(pe,null,{default:t(()=>[Re,h("div",null,[u(ie,{ref_key:"formRef",ref:R,model:a(s),"label-width":"90px",inline:!0,rules:a(oe)},{default:t(()=>[u(F,null,{default:t(()=>[u(p,{span:5},{default:t(()=>[u(d,{label:"\u7528\u6237",prop:"nickname"},{default:t(()=>[u(i,{modelValue:a(s).uid,"onUpdate:modelValue":e[0]||(e[0]=l=>a(s).uid=l),filterable:"",remote:"","reserve-keyword":"",placeholder:"\u8F93\u5165\u7528\u6237\u540D\u79F0\u641C\u7D22","remote-show-suffix":"","remote-method":ae,loading:a(w),style:{width:"220px"},onChange:se},{default:t(()=>[(v(!0),D(x,null,O(a(S),l=>(v(),Y(r,{key:l.id,label:`${l.real_name}|${l.mobile} (ID:${l.id})`,value:l.id},null,8,["label","value"]))),128))]),_:1},8,["modelValue","loading"])]),_:1})]),_:1}),u(p,{span:4},{default:t(()=>[u(d,{label:"\u59D3\u540D",prop:"nickname"},{default:t(()=>[u(c,{modelValue:a(s).nickname,"onUpdate:modelValue":e[1]||(e[1]=l=>a(s).nickname=l),type:"input"},null,8,["modelValue"])]),_:1})]),_:1}),u(p,{span:4},{default:t(()=>[u(d,{label:"\u624B\u673A\u53F7",prop:"phone"},{default:t(()=>[u(c,{modelValue:a(s).phone,"onUpdate:modelValue":e[2]||(e[2]=l=>a(s).phone=l),type:"input"},null,8,["modelValue"])]),_:1})]),_:1}),u(p,{span:6},{default:t(()=>[u(d,{label:"\u5730\u5740",prop:"address"},{default:t(()=>[u(c,{modelValue:a(s).address,"onUpdate:modelValue":e[3]||(e[3]=l=>a(s).address=l),type:"input"},null,8,["modelValue"])]),_:1})]),_:1})]),_:1}),u(F,null,{default:t(()=>[u(p,{span:12},{default:t(()=>[u(d,{label:"\u8BA2\u5355\u7C7B\u578B",prop:"order_type"},{default:t(()=>[u(ne,{modelValue:a(s).order_type,"onUpdate:modelValue":e[4]||(e[4]=l=>a(s).order_type=l),onChange:e[5]||(e[5]=l=>X())},{default:t(()=>[u(K,{label:3},{default:t(()=>[V("\u4E00\u6761\u9F99\u8BA2\u5355")]),_:1}),u(K,{label:1},{default:t(()=>[V("\u94FA\u8D27\u8BA2\u5355")]),_:1}),u(K,{label:2},{default:t(()=>[V("\u644A\u8D29\u8BA2\u5355")]),_:1})]),_:1},8,["modelValue"])]),_:1})]),_:1})]),_:1}),u(F,null,{default:t(()=>[u(p,{span:4},{default:t(()=>[u(d,{label:"\u5230\u8D27\u65F6\u95F4",prop:"arrival_time"},{default:t(()=>[u(de,{modelValue:a(s).arrival_time,"onUpdate:modelValue":e[6]||(e[6]=l=>a(s).arrival_time=l),type:"datetime",readonly:!1,clearable:"","value-format":"YYYY-MM-DD HH:mm:ss",placeholder:"\u8BF7\u9009\u62E9\u5230\u8D27\u65F6\u95F4",style:{width:"180px"}},null,8,["modelValue"])]),_:1})]),_:1}),u(p,{span:4},{default:t(()=>[u(d,{label:"\u684C\u6570",prop:"tables"},{default:t(()=>[u(T,{modelValue:a(s).tables,"onUpdate:modelValue":e[7]||(e[7]=l=>a(s).tables=l),type:"input"},null,8,["modelValue"])]),_:1})]),_:1}),u(p,{span:4},{default:t(()=>[u(d,{label:"\u529E\u4E8B\u5929\u6570",prop:"days"},{default:t(()=>[u(T,{modelValue:a(s).days,"onUpdate:modelValue":e[8]||(e[8]=l=>a(s).days=l),type:"input"},null,8,["modelValue"])]),_:1})]),_:1}),u(p,{span:4},{default:t(()=>[u(d,{label:"\u53A8\u5E08",prop:"chef"},{default:t(()=>[u(c,{modelValue:a(s).chef,"onUpdate:modelValue":e[9]||(e[9]=l=>a(s).chef=l),type:"input"},null,8,["modelValue"])]),_:1})]),_:1}),u(p,{span:4},{default:t(()=>[u(d,{label:"\u7535\u8BDD",prop:"chef_phone"},{default:t(()=>[u(c,{modelValue:a(s).chef_phone,"onUpdate:modelValue":e[10]||(e[10]=l=>a(s).chef_phone=l),type:"input"},null,8,["modelValue"])]),_:1})]),_:1})]),_:1}),u(F,null,{default:t(()=>[u(p,{span:12},{default:t(()=>[u(d,{label:"\u5907\u6CE8",prop:"purpose"},{default:t(()=>[u(c,{modelValue:a(s).purpose,"onUpdate:modelValue":e[11]||(e[11]=l=>a(s).purpose=l),type:"input",style:{width:"480px"}},null,8,["modelValue"])]),_:1})]),_:1})]),_:1}),u(F,null,{default:t(()=>[u(p,{span:12},{default:t(()=>[u(d,{label:"\u4EE3\u8D2D\u5907\u6CE8",prop:"store_mark"},{default:t(()=>[u(c,{modelValue:a(s).store_mark,"onUpdate:modelValue":e[12]||(e[12]=l=>a(s).store_mark=l),type:"textarea",rows:3,style:{width:"480px"}},null,8,["modelValue"])]),_:1})]),_:1})]),_:1}),u(d,{label:"\u5546\u54C1",prop:"product_id",class:"w-full"},{default:t(()=>[h("div",Se,[h("div",$e,[u(I,{type:"primary",onClick:e[13]||(e[13]=l=>re())},{default:t(()=>[V("\u6DFB\u52A0\u5546\u54C1")]),_:1})]),u(M,{data:a(g)},{default:t(()=>[u(_,{label:"\u5546\u54C1ID",prop:"id","show-overflow-tooltip":""},{default:t(({row:l,$index:m})=>[u(c,{modelValue:l.id,"onUpdate:modelValue":n=>l.id=n,onKeydown:H(n=>J(l),["enter"]),ref:n=>a(f)[m+"id"]=n,onKeyup:n=>C(n,m,"id")},null,8,["modelValue","onUpdate:modelValue","onKeydown","onKeyup"])]),_:1}),u(_,{label:"\u5546\u54C1\u56FE\u7247",prop:"image","min-width":"80"},{default:t(({row:l})=>[u(L,{style:{width:"50px",height:"50px"},src:l.image,"preview-teleported":!0},null,8,["src"])]),_:1}),u(_,{label:"\u5546\u54C1\u540D\u79F0",prop:"store_name","show-overflow-tooltip":""},{default:t(({row:l,$index:m})=>[u(c,{modelValue:l.store_name,"onUpdate:modelValue":n=>l.store_name=n,onKeydown:H(n=>le(l),["enter"]),ref:n=>a(f)[m+"store_name"]=n,onKeyup:n=>C(n,m,"store_name")},null,8,["modelValue","onUpdate:modelValue","onKeydown","onKeyup"])]),_:1}),u(_,{label:"\u5355\u4F4D","min-width":"80","show-overflow-tooltip":""},{default:t(({row:l})=>[h("div",null,B(l.unit_name)+"-"+B(l.status_msg),1)]),_:1}),u(_,{label:"\u6570\u91CF"},{default:t(({row:l,$index:m})=>[u(c,{modelValue:l.nums,"onUpdate:modelValue":n=>l.nums=n,onChange:n=>Z(l),ref:n=>a(f)[m+"nums"]=n,onKeyup:n=>C(n,m,"nums")},null,8,["modelValue","onUpdate:modelValue","onChange","onKeyup"])]),_:1}),u(_,{label:"\u4EF7\u683C"},{default:t(({row:l})=>[u(c,{modelValue:l.price,"onUpdate:modelValue":m=>l.price=m,disabled:""},null,8,["modelValue","onUpdate:modelValue"])]),_:1}),u(_,{label:"\u603B\u4EF7"},{default:t(({row:l})=>[u(c,{modelValue:l.total_price,"onUpdate:modelValue":m=>l.total_price=m,disabled:""},null,8,["modelValue","onUpdate:modelValue"])]),_:1}),u(_,{label:"\u5907\u6CE8"},{default:t(({row:l,$index:m})=>[u(c,{modelValue:l.mark,"onUpdate:modelValue":n=>l.mark=n,ref:n=>a(f)[m+"mark"]=n,onKeyup:n=>C(n,m,"mark")},null,8,["modelValue","onUpdate:modelValue","onKeyup"])]),_:1}),u(_,{label:"\u64CD\u4F5C",width:"120",fixed:"right"},{default:t(({row:l})=>[u(I,{type:"danger",link:"",onClick:m=>Q(l.id)},{default:t(()=>[V(" \u5220\u9664 ")]),_:2},1032,["onClick"])]),_:1})]),_:1},8,["data"])])]),_:1}),u(F,null,{default:t(()=>[u(I,{onClick:e[14]||(e[14]=l=>ue(a(R))),type:"primary",class:"w-40 ml-20"},{default:t(()=>[V("\u63D0\u4EA4")]),_:1}),u(d,{label:"\u603B\u4EF7",prop:"total_price"},{default:t(()=>[h("div",null,[V(B(a(s).total_price)+" ",1),Te])]),_:1})]),_:1}),u(F,null,{default:t(()=>[h("div",Le,[(v(!0),D(x,null,O(a(z).store_refund_description,l=>(v(),D("span",Me,B(l.value),1))),256))])]),_:1})]),_:1},8,["model","rules"])]),u(N,{modelValue:a(E),"onUpdate:modelValue":e[15]||(e[15]=l=>G(E)?E.value=l:null),title:"\u9009\u62E9\u5546\u54C1",width:"70%"},{default:t(()=>[(v(),Y(Pe,{key:a($),userId:a(s).uid,onOnBindStore:W},null,8,["userId"]))]),_:1},8,["modelValue"])]),_:1}),u(N,{modelValue:a(y),"onUpdate:modelValue":e[16]||(e[16]=l=>G(y)?y.value=l:null),title:"\u9009\u62E9\u5546\u54C1",width:"1200"},{default:t(()=>[u(M,{data:a(A),onCurrentChange:te,height:300},{default:t(()=>[u(_,{label:"\u5546\u54C1ID",prop:"id","show-overflow-tooltip":""}),u(_,{label:"\u5546\u54C1\u56FE\u7247",prop:"image","min-width":"80"},{default:t(({row:l})=>[u(L,{style:{width:"50px",height:"50px"},src:l.image,"preview-teleported":!0},null,8,["src"])]),_:1}),u(_,{label:"\u5546\u54C1\u540D\u79F0",prop:"store_name","min-width":"200","show-overflow-tooltip":""}),u(_,{label:"\u5206\u7C7B",prop:"cate_name","min-width":"120","show-overflow-tooltip":""}),u(_,{label:"\u5355\u4F4D",prop:"unit_name","min-width":"80","show-overflow-tooltip":""}),u(_,{label:"\u5546\u54C1\u4EF7\u683C",prop:"price","min-width":"100","show-overflow-tooltip":""})]),_:1},8,["data"])]),_:1},8,["modelValue"])],64)}}});export{Uu as default};
|