2 lines
14 KiB
JavaScript
2 lines
14 KiB
JavaScript
import{Z as ie,_ as pe,$ as me,R as _e,S as fe,F as ce,D as ge,H as be,I as he,v as Fe,w as Ve,M as Ee,b as ye,N as ve,G as we,K as Ce,J as De}from"./element-plus.e43a9281.js";import{d as j,r as b,$ as K,o as C,c as M,W as u,Q as t,a as F,u as a,F as N,a9 as Be,P as O,U as h,aa as Y,V as I,j as H,n as D}from"./@vue.340249d8.js";import{a as ke}from"./vue-router.9ddb0e92.js";import{a as Ue,b as Ae,c as qe}from"./beforehand_order.8bedd6dc.js";import{k as Ke}from"./index.ca546884.js";import{_ as Ie}from"./productWarehousePop.vue_vue_type_script_setup_true_name_systemStoreLists_lang.7d3765e1.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.5d871bc3.js";import"./axios.7bd66c25.js";import"./async-validator.fb49d0f5.js";import"./memoize-one.4ee5c96d.js";import"./normalize-wheel-es.8aeb3683.js";import"./@floating-ui.0f9ce7c3.js";import"./lodash.e1b6d49d.js";import"./pinia.97fe9b12.js";import"./css-color-function.92cf4b29.js";import"./color.10cd7b9e.js";import"./clone.3a905afa.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.95290f48.js";import"./vue-clipboard3.d7f6d60e.js";import"./clipboard.07d173e7.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.4e4b54d4.js";import"./usePaging.fff444fa.js";const Pe=F("div",{class:"mb-4 text-lg font-bold"},"\u9884\u5B9A\u5355\u6DFB\u52A0",-1),Re={class:"flex-1 w-full"},xe={class:"mb-2"},Se=F("span",{class:"ml-4"},"\u8BE5\u91D1\u989D\u53EA\u505A\u524D\u53F0\u5C55\u793A,\u540E\u53F0\u4F1A\u4ECE\u65B0\u8BA1\u7B97",-1),$e=j({name:"storeProductEdit"}),wu=j({...$e,props:{dictData:{type:Object,default:()=>({})}},emits:["success","close"],setup(Te,{emit:Le}){const P=b(),s=K({warehouse_id:"",is_buyer:0,supplier_id:"",code:"",total_price:0,order_type:1,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:""}),G=async o=>{const e=await Ue({id:o.id,user_id:s.uid,is_show:1});B(o,e)},B=(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}]),z=o=>{g.value=g.value.filter(e=>e.id!==o)},J=o=>{o.forEach(e=>{g.value.find(r=>r.id==e.id)||g.value.push(e)}),E.value=!1};function Q(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 W(o){s.order_type==7||s.order_type==5?s.is_buyer=0:s.is_buyer=-1}const Z=ke(),X=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&&Ae({product_arr:e,...s}).then(d=>{setTimeout(()=>{Z.push({path:"/store_order/beforehand_order"})},2e3)})})},k=b([]),y=b(!1),U=b(),ee=o=>{qe({store_name:o.store_name,product_type:[0,6],is_warehouse:1,user_id:s.uid,is_show:1}).then(e=>{if(e.count==1){const r=e.lists[0];B(o,r)}e.count>1&&(k.value=e.lists,y.value=!0,U.value=o)})},ue=o=>{o!=null&&(B(U.value,o),y.value=!1,k.value=[],U.value=[])},f=K({}),v=(o,e,r)=>{const i=["id","store_name","nums","mark"];if(o.keyCode===38){if(e===0)return;f[e+r].blur(),D(()=>{f[e-1+r].focus()})}if(o.keyCode===40){if(e===g.value.length-1)return;f[e+r].blur(),D(()=>{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;D(()=>{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;D(()=>{f[e+i[d]].focus()})}}},le=K({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),R=b([]),te=(o="")=>{w.value=!0,Ke({nickname:o,page_size:10}).then(e=>{R.value=e.lists,setTimeout(()=>{w.value=!1},300)}).catch(e=>{setTimeout(()=>{w.value=!1},300)})},oe=()=>{E.value=!0},x=b(0),ae=o=>{x.value++};return(o,e)=>{const r=_e,i=fe,d=ce,p=ie,c=ge,V=pe,A=be,re=he,se=me,S=Fe,q=Ve,_=Ee,$=ye,T=ve,ne=we,L=Ce,de=De;return C(),M(N,null,[u(de,null,{default:t(()=>[Pe,F("div",null,[u(ne,{ref_key:"formRef",ref:P,model:a(s),"label-width":"90px",inline:!0,rules:a(le)},{default:t(()=>[u(V,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":te,loading:a(w),style:{width:"220px"},onChange:ae},{default:t(()=>[(C(!0),M(N,null,Be(a(R),l=>(C(),O(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(V,null,{default:t(()=>[u(p,{span:12},{default:t(()=>[u(d,{label:"\u8BA2\u5355\u7C7B\u578B",prop:"order_type"},{default:t(()=>[u(re,{modelValue:a(s).order_type,"onUpdate:modelValue":e[4]||(e[4]=l=>a(s).order_type=l),onChange:e[5]||(e[5]=l=>W())},{default:t(()=>[u(A,{label:1},{default:t(()=>[h("\u94FA\u8D27\u8BA2\u5355")]),_:1}),u(A,{label:2},{default:t(()=>[h("\u644A\u8D29\u8BA2\u5355")]),_:1}),u(A,{label:3},{default:t(()=>[h("\u4E00\u6761\u9F99\u8BA2\u5355")]),_:1})]),_:1},8,["modelValue"])]),_:1})]),_:1})]),_:1}),u(V,null,{default:t(()=>[u(p,{span:4},{default:t(()=>[u(d,{label:"\u5230\u8D27\u65F6\u95F4",prop:"arrival_time"},{default:t(()=>[u(se,{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(S,{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(S,{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(V,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(V,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(()=>[F("div",Re,[F("div",xe,[u(q,{type:"primary",onClick:e[13]||(e[13]=l=>oe())},{default:t(()=>[h("\u6DFB\u52A0\u5546\u54C1")]),_:1})]),u(T,{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:Y(n=>G(l),["enter"]),ref:n=>a(f)[m+"id"]=n,onKeyup:n=>v(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($,{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:Y(n=>ee(l),["enter"]),ref:n=>a(f)[m+"store_name"]=n,onKeyup:n=>v(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})=>[F("div",null,I(l.unit_name)+"-"+I(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=>Q(l),ref:n=>a(f)[m+"nums"]=n,onKeyup:n=>v(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=>v(n,m,"mark")},null,8,["modelValue","onUpdate:modelValue","onKeyup"])]),_:1}),u(_,{label:"\u64CD\u4F5C",width:"120",fixed:"right"},{default:t(({row:l})=>[u(q,{type:"danger",link:"",onClick:m=>z(l.id)},{default:t(()=>[h(" \u5220\u9664 ")]),_:2},1032,["onClick"])]),_:1})]),_:1},8,["data"])])]),_:1}),u(V,null,{default:t(()=>[u(q,{onClick:e[14]||(e[14]=l=>X(a(P))),type:"primary",class:"w-40 ml-20"},{default:t(()=>[h("\u63D0\u4EA4")]),_:1}),u(d,{label:"\u603B\u4EF7",prop:"total_price"},{default:t(()=>[F("div",null,[h(I(a(s).total_price)+" ",1),Se])]),_:1})]),_:1})]),_:1},8,["model","rules"])]),u(L,{modelValue:a(E),"onUpdate:modelValue":e[15]||(e[15]=l=>H(E)?E.value=l:null),title:"\u9009\u62E9\u5546\u54C1",width:"70%"},{default:t(()=>[(C(),O(Ie,{key:a(x),userId:a(s).uid,onOnBindStore:J},null,8,["userId"]))]),_:1},8,["modelValue"])]),_:1}),u(L,{modelValue:a(y),"onUpdate:modelValue":e[16]||(e[16]=l=>H(y)?y.value=l:null),title:"\u9009\u62E9\u5546\u54C1",width:"1200"},{default:t(()=>[u(T,{data:a(k),onCurrentChange:ue,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($,{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{wu as default};
|