2024-08-28 20:36:40 +08:00
|
|
|
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.a63a26dd.js";import{_ as se}from"./index.vue_vue_type_script_setup_true_name_systemStoreLists_lang.a48e8593.js";import{_ as ie}from"./index.vue_vue_type_script_setup_true_name_systemStoreLists_lang.e46088fa.js";import{k as re,h as ne}from"./index.709cbd5a.js";import{b as de}from"./store_order.44b253e2.js";import{u as pe,a as me}from"./vue-router.101084e3.js";import{a as _e}from"./store_product_unit.9e8ab348.js";import{a as ce}from"./warehouse.60f73ad8.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.4884cfc2.js";import"./axios.932d3f8a.js";import"./@ctrl.b082b0c1.js";import"./normalize-wheel-es.8aeb3683.js";import"./@popperjs.36402333.js";import"./index.vue_vue_type_script_setup_true_lang.ecb80feb.js";import"./usePaging.6a6670f9.js";import"./useDictOptions.9b4eaa00.js";import"./store_product.464ce49f.js";import"./store_branch_product.2a94e432.js";import"./warehouse_product_storege.69ba322c.js";import"./lodash.2473fc51.js";import"./system_store.a4aef92a.js";import"./pinia.a969beab.js";import"./css-color-function.9f6a56f3.js";import"./color.d1bc3784.js";import"./clone.83700f2e.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.fcc9be76.js";import"./vue-clipboard3.9e751565.js";import"./clipboard.dda64e67.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"])])
|