2 lines
6.9 KiB
JavaScript
2 lines
6.9 KiB
JavaScript
import{m as T,_ as Y,r as i,s as H,aT as K,af as Q,p as b,y as V,v as t,x as _,t as l,u as s,q as U,V as L,W as A,a2 as f,G as Z,i as S,b3 as ee,b4 as le,aX as oe,aW as te,ae as ue,b6 as ae,J as se,b7 as re,aY as ie,b0 as de,b5 as ne}from"./.pnpm.1b0299fb.js";import{_ as pe}from"./index.vue_vue_type_script_setup_true_name_systemStoreLists_lang.cac2da5b.js";import{_ as me}from"./index.vue_vue_type_script_setup_true_name_systemStoreLists_lang.7ac2f365.js";import{k as _e,h as fe}from"./index.689cfa31.js";import{b as ce}from"./store_order.645a0384.js";import{a as we}from"./store_product_unit.a4bcfa14.js";import{a as ve}from"./warehouse.c65c5953.js";import"./index.vue_vue_type_script_setup_true_lang.b077f234.js";import"./usePaging.00aa976d.js";import"./useDictOptions.e9843f63.js";import"./store_product.90b19113.js";import"./store_branch_product.063beab6.js";import"./warehouse_product_storege.b9f73c92.js";import"./lodash.c3b66c05.js";import"./system_store.e6c50bcf.js";import"./@vueuse.72d44d91.js";import"./@vue.9d708d7c.js";const be={class:"flex-1 w-full"},he={class:"mb-2"},Ee={class:"flex-1 w-full"},Ce={class:"mb-2"},Ve=T({name:"storeProductEdit"}),je=T({...Ve,props:{dictData:{type:Object,default:()=>({})}},emits:["success","close"],setup(ke,{emit:ge}){Y();const k=i([]),$=H(),{removeTab:I}=_e(),g=i(0),r=K({user_id:"",store_id:"",warehouse_id:"",mark:""}),R=()=>{ve({}).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),r.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)},W=u=>{u.forEach(e=>{p.value.find(E=>E.id==e.id)||p.value.push(e)}),w.value=!1},M=i([]);(()=>{we({}).then(u=>{M.value=u.lists})})();const h=i(!1),y=i([]),j=(u="")=>{h.value=!0,fe({nickname:u,page_size:10}).then(e=>{y.value=e.lists,setTimeout(()=>{h.value=!1},300)}).catch(e=>{setTimeout(()=>{h.value=!1},300)})};Q();const q=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),ce({product_arr:u,...r}).then(e=>{setTimeout(()=>{I()},2e3)})};return R(),(u,e)=>{const E=ee,B=le,m=oe,C=te,v=ue,a=ae,D=se,F=re,z=ie,G=me,x=de,J=pe,X=ne;return b(),V(X,null,{default:t(()=>[e[12]||(e[12]=_("div",{class:"mb-4 text-lg font-bold"},"\u65B0\u589E\u8BA2\u5355",-1)),_("div",null,[l(z,{ref_key:"formRef",ref:$,model:s(r),"label-width":"90px"},{default:t(()=>[l(m,{label:"\u4ED3\u5E93",prop:"uid"},{default:t(()=>[l(B,{modelValue:s(r).warehouse_id,"onUpdate:modelValue":e[0]||(e[0]=o=>s(r).warehouse_id=o),style:{width:"240px"}},{default:t(()=>[(b(!0),U(L,null,A(s(k),o=>(b(),V(E,{key:o.id,label:o.name,value:o.id},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),l(m,{label:"\u7528\u6237",prop:"uid"},{default:t(()=>[l(B,{modelValue:s(r).user_id,"onUpdate:modelValue":e[1]||(e[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":j,loading:s(h),style:{width:"240px"}},{default:t(()=>[(b(!0),U(L,null,A(s(y),o=>(b(),V(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}),l(m,{label:"\u5907\u6CE8",prop:"mark"},{default:t(()=>[l(C,{modelValue:s(r).mark,"onUpdate:modelValue":e[2]||(e[2]=o=>s(r).mark=o),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u8BA2\u5355\u5907\u6CE8",readonly:!1},null,8,["modelValue"])]),_:1}),l(m,{label:"\u95E8\u5E97",prop:"store_id"},{default:t(()=>[_("div",be,[_("div",he,[l(v,{type:"primary",onClick:e[3]||(e[3]=o=>c.value=!0)},{default:t(()=>e[7]||(e[7]=[f("\u9009\u62E9 \u95E8\u5E97")])),_:1})]),l(F,{data:s(n)},{default:t(()=>[l(a,{label:"ID",prop:"id","show-overflow-tooltip":""}),l(a,{label:"\u95E8\u5E97\u540D\u79F0",prop:"name","show-overflow-tooltip":""}),l(a,{label:"\u624B\u673A\u53F7\u7801",prop:"phone","show-overflow-tooltip":""}),l(a,{label:"\u8BE6\u7EC6\u5730\u5740",prop:"detailed_address","show-overflow-tooltip":""}),l(a,{label:"\u95E8\u5E97logo",prop:"image","show-overflow-tooltip":""},{default:t(({row:o})=>[l(D,{src:o.image,class:"w-[40px] h-[40px]","preview-teleported":!0},null,8,["src"])]),_:1}),l(a,{label:"\u8425\u4E1A\u72B6\u6001",prop:"is_show","show-overflow-tooltip":""},{default:t(({row:o})=>[f(Z(o.is_show?"\u8425\u4E1A":"\u6253\u70CA"),1)]),_:1}),l(a,{label:"\u64CD\u4F5C",width:"120",fixed:"right"},{default:t(({row:o})=>[l(v,{type:"danger",link:"",onClick:d=>O(o.id)},{default:t(()=>e[8]||(e[8]=[f(" \u5220\u9664 ")])),_:2},1032,["onClick"])]),_:1})]),_:1},8,["data"])])]),_:1}),l(m,{label:"\u5546\u54C1",prop:"store_id"},{default:t(()=>[_("div",Ee,[_("div",Ce,[l(v,{type:"primary",onClick:e[4]||(e[4]=o=>w.value=!0)},{default:t(()=>e[9]||(e[9]=[f("\u6DFB\u52A0\u5546\u54C1")])),_:1})]),l(F,{data:s(p)},{default:t(()=>[l(a,{label:"\u5546\u54C1ID",prop:"id","show-overflow-tooltip":""}),l(a,{label:"\u5546\u54C1\u56FE\u7247",prop:"image","min-width":"80"},{default:t(({row:o})=>[l(D,{style:{width:"50px",height:"50px"},src:o.image,"preview-teleported":!0},null,8,["src"])]),_:1}),l(a,{label:"\u5546\u54C1\u540D\u79F0",prop:"store_name","min-width":"200","show-overflow-tooltip":""}),l(a,{label:"\u5206\u7C7B",prop:"cate_name","min-width":"120","show-overflow-tooltip":""}),l(a,{label:"\u5355\u4F4D",prop:"unit_name","min-width":"80","show-overflow-tooltip":""}),l(a,{label:"\u4F9B\u8D27\u4EF7\u683C",prop:"purchase","min-width":"100","show-overflow-tooltip":""},{default:t(({row:o})=>[l(C,{modelValue:o.purchase,"onUpdate:modelValue":d=>o.purchase=d},null,8,["modelValue","onUpdate:modelValue"])]),_:1}),l(a,{label:"\u5546\u54C1\u4EF7\u683C",prop:"price","min-width":"100","show-overflow-tooltip":""},{default:t(({row:o})=>[l(C,{modelValue:o.price,"onUpdate:modelValue":d=>o.price=d},null,8,["modelValue","onUpdate:modelValue"])]),_:1}),l(a,{label:"\u5E93\u5B58",prop:"stock","min-width":"100","show-overflow-tooltip":""}),l(a,{label:"\u9700\u6C42\u91CF","min-width":"150"},{default:t(({row:o})=>[l(C,{modelValue:o.new_stock,"onUpdate:modelValue":d=>o.new_stock=d},null,8,["modelValue","onUpdate:modelValue"])]),_:1}),l(a,{label:"\u64CD\u4F5C",width:"120",fixed:"right"},{default:t(({row:o})=>[l(v,{type:"danger",link:"",onClick:d=>N(o.id)},{default:t(()=>e[10]||(e[10]=[f(" \u5220\u9664 ")])),_:2},1032,["onClick"])]),_:1})]),_:1},8,["data"])])]),_:1}),l(m,{label:""},{default:t(()=>[l(v,{onClick:q,type:"primary",class:"w-40"},{default:t(()=>e[11]||(e[11]=[f("\u63D0\u4EA4")])),_:1})]),_:1})]),_:1},8,["model"])]),l(x,{modelValue:s(c),"onUpdate:modelValue":e[5]||(e[5]=o=>S(c)?c.value=o:null),title:"\u9009\u62E9\u95E8\u5E97",width:"70%"},{default:t(()=>[l(G,{onOnBindStore:P,is_selection:0})]),_:1},8,["modelValue"]),l(x,{modelValue:s(w),"onUpdate:modelValue":e[6]||(e[6]=o=>S(w)?w.value=o:null),title:"\u9009\u62E9\u5546\u54C1",width:"70%"},{default:t(()=>[l(J,{onOnBindStore:W,store_id:s(g),is_branch:1},null,8,["store_id"])]),_:1},8,["modelValue"])]),_:1})}}});export{je as default};
|