2 lines
7.8 KiB
JavaScript
2 lines
7.8 KiB
JavaScript
import{J as G,K as H,D as Q,C as X,w as Y,M as ee,b as oe,N as te,F as le,I as ue,L as ae}from"./element-plus.91c68cc0.js";import{_ as re}from"./index.vue_vue_type_script_setup_true_name_systemStoreLists_lang.52d1f352.js";import{_ as se}from"./index.vue_vue_type_script_setup_true_name_systemStoreLists_lang.eb5e0636.js";import{k as ie,h as de}from"./index.892cd835.js";import{b as ne}from"./store_order.b3bb689d.js";import{u as pe,a as me}from"./vue-router.10bd5b90.js";import{a as _e}from"./store_product_unit.4033c4f1.js";import{a as fe}from"./warehouse.5516f674.js";import{d as T,r as i,s as ce,Z as we,o as h,K as V,L as l,a as _,U as o,u as r,c as U,T as L,a9 as S,R as f,S as ve,j as A}from"./@vue.76ce7aa3.js";import"./lodash-es.f52bd8b1.js";import"./async-validator.fb49d0f5.js";import"./@vueuse.9ffef7f8.js";import"./@element-plus.73235148.js";import"./dayjs.0112e2c7.js";import"./@babel.80d29b7b.js";import"./@ctrl.b082b0c1.js";import"./normalize-wheel-es.8aeb3683.js";import"./@popperjs.36402333.js";import"./index.vue_vue_type_script_setup_true_lang.863ae816.js";import"./usePaging.f8c888e4.js";import"./useDictOptions.bbcac283.js";import"./store_product.77fb3e55.js";import"./store_branch_product.2061e0ca.js";import"./warehouse_product_storege.2c62fabd.js";import"./lodash.4e6d2a38.js";import"./system_store.7c50d15d.js";import"./axios.659d5af3.js";import"./jspdf.6c61b9d3.js";import"./fflate.0418c72f.js";import"./pinia.f3529286.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.b502f541.js";import"./vue-clipboard3.e775fc74.js";import"./clipboard.6417898a.js";import"./echarts.5016c48c.js";import"./zrender.58d022a1.js";import"./tslib.60310f1a.js";import"./highlight.js.31cd7941.js";import"./@highlightjs.8d65305c.js";const he={class:"flex-1 w-full"},be={class:"mb-2"},Ee={class:"flex-1 w-full"},Ce={class:"mb-2"},Ve=T({name:"storeProductEdit"}),bo=T({...Ve,props:{dictData:{type:Object,default:()=>({})}},emits:["success","close"],setup(ke,{emit:ge}){pe();const k=i([]),$=ce(),{removeTab:I}=ie(),g=i(0),s=we({user_id:"",store_id:"",warehouse_id:"",mark:""}),R=()=>{fe({}).then(u=>{k.value=u.lists})},c=i(!1),n=i([]),O=u=>{n.value=n.value.filter(e=>e.id!==u)},P=u=>{n.value=[],n.value.push(u),s.store_id=u.id,g.value=u.id,c.value=!1},w=i(!1),p=i([]),N=u=>{p.value=p.value.filter(e=>e.id!==u)},M=u=>{u.forEach(e=>{p.value.find(E=>E.id==e.id)||p.value.push(e)}),w.value=!1},j=i([]);(()=>{_e({}).then(u=>{j.value=u.lists})})();const b=i(!1),D=i([]),K=(u="")=>{b.value=!0,de({nickname:u,page_size:10}).then(e=>{D.value=e.lists,setTimeout(()=>{b.value=!1},300)}).catch(e=>{setTimeout(()=>{b.value=!1},300)})};me();const z=async()=>{const u=p.value.map(e=>({id:e.id,product_id:e.product_id,stock:e.new_stock||0,price:e.price||0,purchase:e.purchase||0}));console.log(n.value),ne({product_arr:u,...s}).then(e=>{setTimeout(()=>{I()},2e3)})};return R(),(u,e)=>{const E=G,B=H,m=Q,C=X,v=Y,a=ee,F=oe,y=te,J=le,W=se,x=ue,Z=re,q=ae;return h(),V(q,null,{default:l(()=>[e[12]||(e[12]=_("div",{class:"mb-4 text-lg font-bold"},"\u65B0\u589E\u8BA2\u5355",-1)),_("div",null,[o(J,{ref_key:"formRef",ref:$,model:r(s),"label-width":"90px"},{default:l(()=>[o(m,{label:"\u4ED3\u5E93",prop:"uid"},{default:l(()=>[o(B,{modelValue:r(s).warehouse_id,"onUpdate:modelValue":e[0]||(e[0]=t=>r(s).warehouse_id=t),style:{width:"240px"}},{default:l(()=>[(h(!0),U(L,null,S(r(k),t=>(h(),V(E,{key:t.id,label:t.name,value:t.id},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),o(m,{label:"\u7528\u6237",prop:"uid"},{default:l(()=>[o(B,{modelValue:r(s).user_id,"onUpdate:modelValue":e[1]||(e[1]=t=>r(s).user_id=t),filterable:"",remote:"","reserve-keyword":"",placeholder:"\u8F93\u5165\u7528\u6237\u540D\u79F0\u641C\u7D22","remote-show-suffix":"","remote-method":K,loading:r(b),style:{width:"240px"}},{default:l(()=>[(h(!0),U(L,null,S(r(D),t=>(h(),V(E,{key:t.id,label:`${t.real_name}|${t.mobile} (ID:${t.id})`,value:t.id},null,8,["label","value"]))),128))]),_:1},8,["modelValue","loading"])]),_:1}),o(m,{label:"\u5907\u6CE8",prop:"mark"},{default:l(()=>[o(C,{modelValue:r(s).mark,"onUpdate:modelValue":e[2]||(e[2]=t=>r(s).mark=t),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u8BA2\u5355\u5907\u6CE8",readonly:!1},null,8,["modelValue"])]),_:1}),o(m,{label:"\u95E8\u5E97",prop:"store_id"},{default:l(()=>[_("div",he,[_("div",be,[o(v,{type:"primary",onClick:e[3]||(e[3]=t=>c.value=!0)},{default:l(()=>e[7]||(e[7]=[f("\u9009\u62E9 \u95E8\u5E97")])),_:1})]),o(y,{data:r(n)},{default:l(()=>[o(a,{label:"ID",prop:"id","show-overflow-tooltip":""}),o(a,{label:"\u95E8\u5E97\u540D\u79F0",prop:"name","show-overflow-tooltip":""}),o(a,{label:"\u624B\u673A\u53F7\u7801",prop:"phone","show-overflow-tooltip":""}),o(a,{label:"\u8BE6\u7EC6\u5730\u5740",prop:"detailed_address","show-overflow-tooltip":""}),o(a,{label:"\u95E8\u5E97logo",prop:"image","show-overflow-tooltip":""},{default:l(({row:t})=>[o(F,{src:t.image,class:"w-[40px] h-[40px]","preview-teleported":!0},null,8,["src"])]),_:1}),o(a,{label:"\u8425\u4E1A\u72B6\u6001",prop:"is_show","show-overflow-tooltip":""},{default:l(({row:t})=>[f(ve(t.is_show?"\u8425\u4E1A":"\u6253\u70CA"),1)]),_:1}),o(a,{label:"\u64CD\u4F5C",width:"120",fixed:"right"},{default:l(({row:t})=>[o(v,{type:"danger",link:"",onClick:d=>O(t.id)},{default:l(()=>e[8]||(e[8]=[f(" \u5220\u9664 ")])),_:2},1032,["onClick"])]),_:1})]),_:1},8,["data"])])]),_:1}),o(m,{label:"\u5546\u54C1",prop:"store_id"},{default:l(()=>[_("div",Ee,[_("div",Ce,[o(v,{type:"primary",onClick:e[4]||(e[4]=t=>w.value=!0)},{default:l(()=>e[9]||(e[9]=[f("\u6DFB\u52A0\u5546\u54C1")])),_:1})]),o(y,{data:r(p)},{default:l(()=>[o(a,{label:"\u5546\u54C1ID",prop:"id","show-overflow-tooltip":""}),o(a,{label:"\u5546\u54C1\u56FE\u7247",prop:"image","min-width":"80"},{default:l(({row:t})=>[o(F,{style:{width:"50px",height:"50px"},src:t.image,"preview-teleported":!0},null,8,["src"])]),_:1}),o(a,{label:"\u5546\u54C1\u540D\u79F0",prop:"store_name","min-width":"200","show-overflow-tooltip":""}),o(a,{label:"\u5206\u7C7B",prop:"cate_name","min-width":"120","show-overflow-tooltip":""}),o(a,{label:"\u5355\u4F4D",prop:"unit_name","min-width":"80","show-overflow-tooltip":""}),o(a,{label:"\u4F9B\u8D27\u4EF7\u683C",prop:"purchase","min-width":"100","show-overflow-tooltip":""},{default:l(({row:t})=>[o(C,{modelValue:t.purchase,"onUpdate:modelValue":d=>t.purchase=d},null,8,["modelValue","onUpdate:modelValue"])]),_:1}),o(a,{label:"\u5546\u54C1\u4EF7\u683C",prop:"price","min-width":"100","show-overflow-tooltip":""},{default:l(({row:t})=>[o(C,{modelValue:t.price,"onUpdate:modelValue":d=>t.price=d},null,8,["modelValue","onUpdate:modelValue"])]),_:1}),o(a,{label:"\u5E93\u5B58",prop:"stock","min-width":"100","show-overflow-tooltip":""}),o(a,{label:"\u9700\u6C42\u91CF","min-width":"150"},{default:l(({row:t})=>[o(C,{modelValue:t.new_stock,"onUpdate:modelValue":d=>t.new_stock=d},null,8,["modelValue","onUpdate:modelValue"])]),_:1}),o(a,{label:"\u64CD\u4F5C",width:"120",fixed:"right"},{default:l(({row:t})=>[o(v,{type:"danger",link:"",onClick:d=>N(t.id)},{default:l(()=>e[10]||(e[10]=[f(" \u5220\u9664 ")])),_:2},1032,["onClick"])]),_:1})]),_:1},8,["data"])])]),_:1}),o(m,{label:""},{default:l(()=>[o(v,{onClick:z,type:"primary",class:"w-40"},{default:l(()=>e[11]||(e[11]=[f("\u63D0\u4EA4")])),_:1})]),_:1})]),_:1},8,["model"])]),o(x,{modelValue:r(c),"onUpdate:modelValue":e[5]||(e[5]=t=>A(c)?c.value=t:null),title:"\u9009\u62E9\u95E8\u5E97",width:"70%"},{default:l(()=>[o(W,{onOnBindStore:P,is_selection:0})]),_:1},8,["modelValue"]),o(x,{modelValue:r(w),"onUpdate:modelValue":e[6]||(e[6]=t=>A(w)?w.value=t:null),title:"\u9009\u62E9\u5546\u54C1",width:"70%"},{default:l(()=>[o(Z,{onOnBindStore:M,store_id:r(g),is_branch:1},null,8,["store_id"])]),_:1},8,["modelValue"])]),_:1})}}});export{bo as default};
|