moreShopAdmin/build/admin/assets/add.2d97ce00.js

2 lines
7.2 KiB
JavaScript

import{J as G,K as H,D as Q,w as X,M as Y,b as ee,N as oe,C as te,F as le,I as ue,L as ae}from"./element-plus.4a7d92a3.js";import{_ as se}from"./index.vue_vue_type_script_setup_true_name_systemStoreLists_lang.42c4cd5f.js";import{_ as ie}from"./index.vue_vue_type_script_setup_true_name_systemStoreLists_lang.1cb9b79f.js";import{k as re,h as ne}from"./index.0778bf8b.js";import{b as de}from"./store_order.80cc5e87.js";import{u as pe,a as me}from"./vue-router.101084e3.js";import{a as _e}from"./store_product_unit.5b0b1fc2.js";import{a as ce}from"./warehouse.bc3f2616.js";import{d as $,r as i,s as fe,Z as we,o as v,K as C,L as l,a as m,U as e,u as s,c as U,T as L,a9 as S,R as p,S as he,j as T}from"./@vue.18505fe0.js";import"./lodash-es.f52bd8b1.js";import"./async-validator.fb49d0f5.js";import"./@vueuse.fbc6a400.js";import"./@element-plus.edbd5a83.js";import"./dayjs.7347fedc.js";import"./axios.4607972f.js";import"./@ctrl.b082b0c1.js";import"./normalize-wheel-es.8aeb3683.js";import"./@popperjs.36402333.js";import"./index.vue_vue_type_script_setup_true_lang.5d4e738c.js";import"./usePaging.6a6670f9.js";import"./useDictOptions.6ebe388e.js";import"./store_product.02f5ffd5.js";import"./store_branch_product.b5e4744a.js";import"./warehouse_product_storege.1320d99d.js";import"./lodash.9dc701ad.js";import"./system_store.f60ed7da.js";import"./pinia.a969beab.js";import"./css-color-function.bb8c34b2.js";import"./color.fbd63fe8.js";import"./clone.31a3aa2c.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.0d2736b7.js";import"./vue-clipboard3.7d5a7a5d.js";import"./clipboard.860a1cea.js";import"./echarts.5016c48c.js";import"./zrender.58d022a1.js";import"./tslib.60310f1a.js";import"./highlight.js.31cd7941.js";import"./@highlightjs.b0c09b66.js";const ve=m("div",{class:"mb-4 text-lg font-bold"},"\u65B0\u589E\u8BA2\u5355",-1),be={class:"flex-1 w-full"},Ee={class:"mb-2"},Ce={class:"flex-1 w-full"},ge={class:"mb-2"},ke=$({name:"storeProductEdit"}),ho=$({...ke,props:{dictData:{type:Object,default:()=>({})}},emits:["success","close"],setup(Ve,{emit:De}){pe();const g=i([]),A=fe(),{removeTab:I}=re(),k=i(0),r=we({user_id:"",store_id:"",warehouse_id:""}),R=()=>{ce({}).then(u=>{g.value=u.lists})},_=i(!1),n=i([]),O=u=>{n.value=n.value.filter(t=>t.id!==u)},P=u=>{n.value=[],n.value.push(u),r.store_id=u.id,k.value=u.id,_.value=!1},c=i(!1),d=i([]),N=u=>{d.value=d.value.filter(t=>t.id!==u)},M=u=>{u.forEach(t=>{d.value.find(E=>E.id==t.id)||d.value.push(t)}),c.value=!1},j=i([]);(()=>{_e({}).then(u=>{j.value=u.lists})})();const b=i(!1),V=i([]),K=(u="")=>{b.value=!0,ne({nickname:u,page_size:10}).then(t=>{V.value=t.lists,setTimeout(()=>{b.value=!1},300)}).catch(t=>{setTimeout(()=>{b.value=!1},300)})};me();const z=async()=>{const u=d.value.map(t=>({id:t.id,product_id:t.product_id,stock:t.new_stock||0,price:t.price||0}));console.log(n.value),de({product_arr:u,...r}).then(t=>{setTimeout(()=>{I()},2e3)})};return R(),(u,t)=>{const E=G,D=H,f=Q,w=X,a=Y,y=ee,x=oe,B=te,J=le,W=ie,F=ue,Z=se,q=ae;return v(),C(q,null,{default:l(()=>[ve,m("div",null,[e(J,{ref_key:"formRef",ref:A,model:s(r),"label-width":"90px"},{default:l(()=>[e(f,{label:"\u4ED3\u5E93",prop:"uid"},{default:l(()=>[e(D,{modelValue:s(r).warehouse_id,"onUpdate:modelValue":t[0]||(t[0]=o=>s(r).warehouse_id=o),style:{width:"240px"}},{default:l(()=>[(v(!0),U(L,null,S(s(g),o=>(v(),C(E,{key:o.id,label:o.name,value:o.id},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),e(f,{label:"\u7528\u6237",prop:"uid"},{default:l(()=>[e(D,{modelValue:s(r).user_id,"onUpdate:modelValue":t[1]||(t[1]=o=>s(r).user_id=o),filterable:"",remote:"","reserve-keyword":"",placeholder:"\u8F93\u5165\u7528\u6237\u540D\u79F0\u641C\u7D22","remote-show-suffix":"","remote-method":K,loading:s(b),style:{width:"240px"}},{default:l(()=>[(v(!0),U(L,null,S(s(V),o=>(v(),C(E,{key:o.id,label:`${o.real_name}|${o.mobile} (ID:${o.id})`,value:o.id},null,8,["label","value"]))),128))]),_:1},8,["modelValue","loading"])]),_:1}),e(f,{label:"\u95E8\u5E97",prop:"store_id"},{default:l(()=>[m("div",be,[m("div",Ee,[e(w,{type:"primary",onClick:t[2]||(t[2]=o=>_.value=!0)},{default:l(()=>[p("\u9009\u62E9 \u95E8\u5E97")]),_:1})]),e(x,{data:s(n)},{default:l(()=>[e(a,{label:"ID",prop:"id","show-overflow-tooltip":""}),e(a,{label:"\u95E8\u5E97\u540D\u79F0",prop:"name","show-overflow-tooltip":""}),e(a,{label:"\u624B\u673A\u53F7\u7801",prop:"phone","show-overflow-tooltip":""}),e(a,{label:"\u8BE6\u7EC6\u5730\u5740",prop:"detailed_address","show-overflow-tooltip":""}),e(a,{label:"\u95E8\u5E97logo",prop:"image","show-overflow-tooltip":""},{default:l(({row:o})=>[e(y,{src:o.image,class:"w-[40px] h-[40px]","preview-teleported":!0},null,8,["src"])]),_:1}),e(a,{label:"\u8425\u4E1A\u72B6\u6001",prop:"is_show","show-overflow-tooltip":""},{default:l(({row:o})=>[p(he(o.is_show?"\u8425\u4E1A":"\u6253\u70CA"),1)]),_:1}),e(a,{label:"\u64CD\u4F5C",width:"120",fixed:"right"},{default:l(({row:o})=>[e(w,{type:"danger",link:"",onClick:h=>O(o.id)},{default:l(()=>[p(" \u5220\u9664 ")]),_:2},1032,["onClick"])]),_:1})]),_:1},8,["data"])])]),_:1}),e(f,{label:"\u5546\u54C1",prop:"store_id"},{default:l(()=>[m("div",Ce,[m("div",ge,[e(w,{type:"primary",onClick:t[3]||(t[3]=o=>c.value=!0)},{default:l(()=>[p("\u6DFB\u52A0\u5546\u54C1")]),_:1})]),e(x,{data:s(d)},{default:l(()=>[e(a,{label:"\u5546\u54C1ID",prop:"id","show-overflow-tooltip":""}),e(a,{label:"\u5546\u54C1\u56FE\u7247",prop:"image","min-width":"80"},{default:l(({row:o})=>[e(y,{style:{width:"50px",height:"50px"},src:o.image,"preview-teleported":!0},null,8,["src"])]),_:1}),e(a,{label:"\u5546\u54C1\u540D\u79F0",prop:"store_name","min-width":"200","show-overflow-tooltip":""}),e(a,{label:"\u5206\u7C7B",prop:"cate_name","min-width":"120","show-overflow-tooltip":""}),e(a,{label:"\u5355\u4F4D",prop:"unit_name","min-width":"80","show-overflow-tooltip":""}),e(a,{label:"\u5546\u54C1\u4EF7\u683C",prop:"price","min-width":"100","show-overflow-tooltip":""},{default:l(({row:o})=>[e(B,{modelValue:o.price,"onUpdate:modelValue":h=>o.price=h},null,8,["modelValue","onUpdate:modelValue"])]),_:1}),e(a,{label:"\u5E93\u5B58",prop:"stock","min-width":"100","show-overflow-tooltip":""}),e(a,{label:"\u9700\u6C42\u91CF","min-width":"150"},{default:l(({row:o})=>[e(B,{modelValue:o.new_stock,"onUpdate:modelValue":h=>o.new_stock=h},null,8,["modelValue","onUpdate:modelValue"])]),_:1}),e(a,{label:"\u64CD\u4F5C",width:"120",fixed:"right"},{default:l(({row:o})=>[e(w,{type:"danger",link:"",onClick:h=>N(o.id)},{default:l(()=>[p(" \u5220\u9664 ")]),_:2},1032,["onClick"])]),_:1})]),_:1},8,["data"])])]),_:1}),e(f,{label:""},{default:l(()=>[e(w,{onClick:z,type:"primary",class:"w-40"},{default:l(()=>[p("\u63D0\u4EA4")]),_:1})]),_:1})]),_:1},8,["model"])]),e(F,{modelValue:s(_),"onUpdate:modelValue":t[4]||(t[4]=o=>T(_)?_.value=o:null),title:"\u9009\u62E9\u95E8\u5E97",width:"70%"},{default:l(()=>[e(W,{onOnBindStore:P,is_selection:0})]),_:1},8,["modelValue"]),e(F,{modelValue:s(c),"onUpdate:modelValue":t[5]||(t[5]=o=>T(c)?c.value=o:null),title:"\u9009\u62E9\u5546\u54C1",width:"70%"},{default:l(()=>[e(Z,{onOnBindStore:M,store_id:s(k),is_branch:1},null,8,["store_id"])]),_:1},8,["modelValue"])]),_:1})}}});export{ho as default};