moreShopAdmin/build/admin/assets/add.7e4d53e7.js

2 lines
6.9 KiB
JavaScript
Raw Normal View History

2024-11-15 19:58:31 +08:00
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:"