multiStoreAdmin/build/store/assets/add.5ab04dfd.js
2025-02-11 17:55:57 +08:00

2 lines
13 KiB
JavaScript

import{Z as oe,_ as ae,$ as re,D as se,F as ne,H as de,I as ie,v as pe,w as me,M as _e,b as fe,N as ce,G as ge,K as be,J as he}from"./element-plus.791fe907.js";import{d as $,r as g,$ as A,o as y,c as q,W as u,Q as t,a as b,u as r,U as h,aa as S,V as C,F as N,a9 as Fe,j as T,P as Ve,n as v}from"./@vue.340249d8.js";import{a as Ee}from"./vue-router.9ddb0e92.js";import{a as ye,b as Ce,c as ve}from"./beforehand_order.407443aa.js";import"./index.275545e3.js";import{_ as we}from"./productWarehousePop.vue_vue_type_script_setup_true_name_systemStoreLists_lang.84875eee.js";import{a as De}from"./useDictOptions.da91a424.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.6b964ca4.js";import"./axios.ebd1d4d0.js";import"./async-validator.fb49d0f5.js";import"./memoize-one.4ee5c96d.js";import"./normalize-wheel-es.8aeb3683.js";import"./@floating-ui.0f9ce7c3.js";import"./lodash.ab1d8f92.js";import"./pinia.97fe9b12.js";import"./css-color-function.7a4c1284.js";import"./color.10b8b3bd.js";import"./clone.623e4e2d.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.518a19eb.js";import"./vue-clipboard3.c098b37d.js";import"./clipboard.a67a48a7.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.656911a4.js";import"./usePaging.fff444fa.js";const Be=b("div",{class:"mb-4 text-lg font-bold"},"\u9884\u5B9A\u5355\u6DFB\u52A0",-1),ke={class:"flex-1 w-full"},Ue={class:"mb-2"},Ae=b("span",{class:"ml-4"},"\u8BE5\u91D1\u989D\u53EA\u505A\u524D\u53F0\u5C55\u793A,\u540E\u53F0\u4F1A\u4ECE\u65B0\u8BA1\u7B97",-1),qe={class:"ml-20"},Ke={class:"flex flex-wrap"},Ie=$({name:"storeProductEdit"}),Vu=$({...Ie,emits:["success","close"],setup(Pe,{emit:xe}){const{dictData:M}=De("store_refund_description"),K=g(),s=A({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:""}),L=async a=>{const e=await ye({id:a.id,user_id:s.uid});w(a,e)},w=(a,e)=>{a.id=e.id,a.image=e.image,a.marques=e.marques,a.store_info=e.store_info,a.price=e.price,a.purchase=e.purchase,a.after_sales=e.after_sales,a.loss=e.loss,a.unit=e.unit,a.store_name=e.store_name,a.unit_name=e.unit_name,a.status_msg=e.status_msg,a.stock=e.stock,a.gross_weight=e.gross_weight,a.net_weight=e.net_weight,a.package=e.package;const o=[];c.value.forEach(n=>{o.push(n.id)}),o.includes(0)==!1&&c.value.push({id:0})},F=g(!1),c=g([{id:0}]),Y=a=>{c.value=c.value.filter(e=>e.id!==a)},H=a=>{a.forEach(e=>{c.value.find(o=>o.id==e.id)||c.value.push(e)}),F.value=!1};function O(a){a.total_price=(a.nums*a.price).toFixed(2),a.total_price>0&&(s.total_price=(parseFloat(s.total_price)+parseFloat(a.total_price)).toFixed(2))}function G(){s.order_type==7||s.order_type==5?s.is_buyer=0:s.is_buyer=-1}const j=Ee(),J=async a=>{const e=c.value.map(o=>({product_id:o.id,nums:o.nums,price:o.price||0,purchase:o.purchase||0,total_price:o.total_price||0,marques:o.marques,store_info:o.store_info,after_sales:o.after_sales,loss:o.loss,unit:o.unit,gross_weight:o.gross_weight,net_weight:o.net_weight,package:o.package,mark:o.mark}));await a.validate((o,n)=>{o&&Ce({product_arr:e,...s}).then(i=>{setTimeout(()=>{j.push({path:"/store_order/beforehand_order"})},2e3)})})},D=g([]),V=g(!1),B=g(),Q=a=>{ve({store_name:a.store_name,product_type:[0,6],is_warehouse:1,user_id:s.uid}).then(e=>{if(e.count==1){const o=e.lists[0];w(a,o)}e.count>1&&(D.value=e.lists,V.value=!0,B.value=a)})},W=a=>{a!=null&&(w(B.value,a),V.value=!1,D.value=[],B.value=[])},_=A({}),E=(a,e,o)=>{const n=["id","store_name","nums","mark"];if(a.keyCode===38){if(e===0)return;_[e+o].blur(),v(()=>{_[e-1+o].focus()})}if(a.keyCode===40){if(e===c.value.length-1)return;_[e+o].blur(),v(()=>{_[e+1+o].focus()})}if(a.keyCode===37){if(e===0&&o===n[0])return;if(_[e+o].blur(),o===n[0])_[e-1+n[n.length-1]].focus();else{const i=n.findIndex(f=>f===o)-1;v(()=>{_[e+n[i]].focus()})}}if(a.keyCode===39){if(e===c.value.length-1&&o===n[n.length-1])return;if(_[e+o].blur(),o===n[n.length-1])_[e+1+n[0]].focus();else{const i=n.findIndex(f=>f===o)+1;v(()=>{_[e+n[i]].focus()})}}},Z=A({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"]}]});g(!1),g([]);const z=()=>{F.value=!0},X=g(0);return(a,e)=>{const o=se,n=ne,i=oe,f=ae,k=de,ee=ie,ue=re,I=pe,U=me,m=_e,P=fe,x=ce,le=ge,R=be,te=he;return y(),q(N,null,[u(te,null,{default:t(()=>[Be,b("div",null,[u(le,{ref_key:"formRef",ref:K,model:r(s),"label-width":"90px",inline:!0,rules:r(Z)},{default:t(()=>[u(f,null,{default:t(()=>[u(i,{span:4},{default:t(()=>[u(n,{label:"\u59D3\u540D",prop:"nickname"},{default:t(()=>[u(o,{modelValue:r(s).nickname,"onUpdate:modelValue":e[0]||(e[0]=l=>r(s).nickname=l),type:"input"},null,8,["modelValue"])]),_:1})]),_:1}),u(i,{span:4},{default:t(()=>[u(n,{label:"\u624B\u673A\u53F7",prop:"phone"},{default:t(()=>[u(o,{modelValue:r(s).phone,"onUpdate:modelValue":e[1]||(e[1]=l=>r(s).phone=l),type:"input"},null,8,["modelValue"])]),_:1})]),_:1}),u(i,{span:6},{default:t(()=>[u(n,{label:"\u5730\u5740",prop:"address"},{default:t(()=>[u(o,{modelValue:r(s).address,"onUpdate:modelValue":e[2]||(e[2]=l=>r(s).address=l),type:"input"},null,8,["modelValue"])]),_:1})]),_:1})]),_:1}),u(f,null,{default:t(()=>[u(i,{span:12},{default:t(()=>[u(n,{label:"\u8BA2\u5355\u7C7B\u578B",prop:"order_type"},{default:t(()=>[u(ee,{modelValue:r(s).order_type,"onUpdate:modelValue":e[3]||(e[3]=l=>r(s).order_type=l),onChange:e[4]||(e[4]=l=>G())},{default:t(()=>[u(k,{label:3},{default:t(()=>[h("\u4E00\u6761\u9F99\u8BA2\u5355")]),_:1}),u(k,{label:1},{default:t(()=>[h("\u94FA\u8D27\u8BA2\u5355")]),_:1}),u(k,{label:2},{default:t(()=>[h("\u644A\u8D29\u8BA2\u5355")]),_:1})]),_:1},8,["modelValue"])]),_:1})]),_:1})]),_:1}),u(f,null,{default:t(()=>[u(i,{span:4},{default:t(()=>[u(n,{label:"\u5230\u8D27\u65F6\u95F4",prop:"arrival_time"},{default:t(()=>[u(ue,{modelValue:r(s).arrival_time,"onUpdate:modelValue":e[5]||(e[5]=l=>r(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(i,{span:4},{default:t(()=>[u(n,{label:"\u684C\u6570",prop:"tables"},{default:t(()=>[u(I,{modelValue:r(s).tables,"onUpdate:modelValue":e[6]||(e[6]=l=>r(s).tables=l),type:"input"},null,8,["modelValue"])]),_:1})]),_:1}),u(i,{span:4},{default:t(()=>[u(n,{label:"\u529E\u4E8B\u5929\u6570",prop:"days"},{default:t(()=>[u(I,{modelValue:r(s).days,"onUpdate:modelValue":e[7]||(e[7]=l=>r(s).days=l),type:"input"},null,8,["modelValue"])]),_:1})]),_:1}),u(i,{span:4},{default:t(()=>[u(n,{label:"\u53A8\u5E08",prop:"chef"},{default:t(()=>[u(o,{modelValue:r(s).chef,"onUpdate:modelValue":e[8]||(e[8]=l=>r(s).chef=l),type:"input"},null,8,["modelValue"])]),_:1})]),_:1}),u(i,{span:4},{default:t(()=>[u(n,{label:"\u7535\u8BDD",prop:"chef_phone"},{default:t(()=>[u(o,{modelValue:r(s).chef_phone,"onUpdate:modelValue":e[9]||(e[9]=l=>r(s).chef_phone=l),type:"input"},null,8,["modelValue"])]),_:1})]),_:1})]),_:1}),u(f,null,{default:t(()=>[u(i,{span:12},{default:t(()=>[u(n,{label:"\u5907\u6CE8",prop:"purpose"},{default:t(()=>[u(o,{modelValue:r(s).purpose,"onUpdate:modelValue":e[10]||(e[10]=l=>r(s).purpose=l),type:"input",style:{width:"480px"}},null,8,["modelValue"])]),_:1})]),_:1})]),_:1}),u(f,null,{default:t(()=>[u(i,{span:12},{default:t(()=>[u(n,{label:"\u4EE3\u8D2D\u5907\u6CE8",prop:"store_mark"},{default:t(()=>[u(o,{modelValue:r(s).store_mark,"onUpdate:modelValue":e[11]||(e[11]=l=>r(s).store_mark=l),type:"textarea",rows:3,style:{width:"480px"}},null,8,["modelValue"])]),_:1})]),_:1})]),_:1}),u(n,{label:"\u5546\u54C1",prop:"product_id",class:"w-full"},{default:t(()=>[b("div",ke,[b("div",Ue,[u(U,{type:"primary",onClick:e[12]||(e[12]=l=>z())},{default:t(()=>[h("\u6DFB\u52A0\u5546\u54C1")]),_:1})]),u(x,{data:r(c)},{default:t(()=>[u(m,{label:"\u5546\u54C1ID",prop:"id","show-overflow-tooltip":""},{default:t(({row:l,$index:p})=>[u(o,{modelValue:l.id,"onUpdate:modelValue":d=>l.id=d,onKeydown:S(d=>L(l),["enter"]),ref:d=>r(_)[p+"id"]=d,onKeyup:d=>E(d,p,"id")},null,8,["modelValue","onUpdate:modelValue","onKeydown","onKeyup"])]),_:1}),u(m,{label:"\u5546\u54C1\u56FE\u7247",prop:"image","min-width":"80"},{default:t(({row:l})=>[u(P,{style:{width:"50px",height:"50px"},src:l.image,"preview-teleported":!0},null,8,["src"])]),_:1}),u(m,{label:"\u5546\u54C1\u540D\u79F0",prop:"store_name","show-overflow-tooltip":""},{default:t(({row:l,$index:p})=>[u(o,{modelValue:l.store_name,"onUpdate:modelValue":d=>l.store_name=d,onKeydown:S(d=>Q(l),["enter"]),ref:d=>r(_)[p+"store_name"]=d,onKeyup:d=>E(d,p,"store_name")},null,8,["modelValue","onUpdate:modelValue","onKeydown","onKeyup"])]),_:1}),u(m,{label:"\u5355\u4F4D","min-width":"80","show-overflow-tooltip":""},{default:t(({row:l})=>[b("div",null,C(l.unit_name)+"-"+C(l.status_msg),1)]),_:1}),u(m,{label:"\u6570\u91CF"},{default:t(({row:l,$index:p})=>[u(o,{modelValue:l.nums,"onUpdate:modelValue":d=>l.nums=d,onChange:d=>O(l),ref:d=>r(_)[p+"nums"]=d,onKeyup:d=>E(d,p,"nums")},null,8,["modelValue","onUpdate:modelValue","onChange","onKeyup"])]),_:1}),u(m,{label:"\u4EF7\u683C"},{default:t(({row:l})=>[u(o,{modelValue:l.price,"onUpdate:modelValue":p=>l.price=p,disabled:""},null,8,["modelValue","onUpdate:modelValue"])]),_:1}),u(m,{label:"\u603B\u4EF7"},{default:t(({row:l})=>[u(o,{modelValue:l.total_price,"onUpdate:modelValue":p=>l.total_price=p,disabled:""},null,8,["modelValue","onUpdate:modelValue"])]),_:1}),u(m,{label:"\u5907\u6CE8"},{default:t(({row:l,$index:p})=>[u(o,{modelValue:l.mark,"onUpdate:modelValue":d=>l.mark=d,ref:d=>r(_)[p+"mark"]=d,onKeyup:d=>E(d,p,"mark")},null,8,["modelValue","onUpdate:modelValue","onKeyup"])]),_:1}),u(m,{label:"\u64CD\u4F5C",width:"120",fixed:"right"},{default:t(({row:l})=>[u(U,{type:"danger",link:"",onClick:p=>Y(l.id)},{default:t(()=>[h(" \u5220\u9664 ")]),_:2},1032,["onClick"])]),_:1})]),_:1},8,["data"])])]),_:1}),u(f,null,{default:t(()=>[u(U,{onClick:e[13]||(e[13]=l=>J(r(K))),type:"primary",class:"w-40 ml-20"},{default:t(()=>[h("\u63D0\u4EA4")]),_:1}),u(n,{label:"\u603B\u4EF7",prop:"total_price"},{default:t(()=>[b("div",null,[h(C(r(s).total_price)+" ",1),Ae])]),_:1})]),_:1}),u(f,null,{default:t(()=>[b("div",qe,[(y(!0),q(N,null,Fe(r(M).store_refund_description,l=>(y(),q("span",Ke,C(l.value),1))),256))])]),_:1})]),_:1},8,["model","rules"])]),u(R,{modelValue:r(F),"onUpdate:modelValue":e[14]||(e[14]=l=>T(F)?F.value=l:null),title:"\u9009\u62E9\u5546\u54C1",width:"70%"},{default:t(()=>[(y(),Ve(we,{key:r(X),userId:r(s).uid,onOnBindStore:H},null,8,["userId"]))]),_:1},8,["modelValue"])]),_:1}),u(R,{modelValue:r(V),"onUpdate:modelValue":e[15]||(e[15]=l=>T(V)?V.value=l:null),title:"\u9009\u62E9\u5546\u54C1",width:"1200"},{default:t(()=>[u(x,{data:r(D),onCurrentChange:W,height:300},{default:t(()=>[u(m,{label:"\u5546\u54C1ID",prop:"id","show-overflow-tooltip":""}),u(m,{label:"\u5546\u54C1\u56FE\u7247",prop:"image","min-width":"80"},{default:t(({row:l})=>[u(P,{style:{width:"50px",height:"50px"},src:l.image,"preview-teleported":!0},null,8,["src"])]),_:1}),u(m,{label:"\u5546\u54C1\u540D\u79F0",prop:"store_name","min-width":"200","show-overflow-tooltip":""}),u(m,{label:"\u5206\u7C7B",prop:"cate_name","min-width":"120","show-overflow-tooltip":""}),u(m,{label:"\u5355\u4F4D",prop:"unit_name","min-width":"80","show-overflow-tooltip":""}),u(m,{label:"\u5546\u54C1\u4EF7\u683C",prop:"price","min-width":"100","show-overflow-tooltip":""})]),_:1},8,["data"])]),_:1},8,["modelValue"])],64)}}});export{Vu as default};