2024-11-15 16:58:18 +08:00
|
|
|
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.922c0e0d.js";import{_ as se}from"./index.vue_vue_type_script_setup_true_name_systemStoreLists_lang.377dcf90.js";import{k as ie,h as de}from"./index.45e3c1f0.js";import{b as ne}from"./store_order.6bfce358.js";import{u as pe,a as me}from"./vue-router.10bd5b90.js";import{a as _e}from"./store_product_unit.c9cbc701.js";import{a as fe}from"./warehouse.16c7cc4d.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.55a5f7ca.js";import"./store_product.4b77192d.js";import"./store_branch_product.fd82e9de.js";import"./warehouse_product_storege.c5e43166.js";import"./lodash.4e6d2a38.js";import"./system_store.7a4ecbcf.js";import"./axios.cffda5ac.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
|