moreShopAdmin/build/admin/assets/import.da76f70f.js

2 lines
6.2 KiB
JavaScript

import{V as W,P as H,Q,k as v,N as Z,O as z,D as J,C as X,w as ee,G as oe,b as te,H as le,F as ue,L as ae,K as re}from"./element-plus.8e273e86.js";import{_ as se}from"./index.vue_vue_type_script_setup_true_name_systemStoreLists_lang.a9a99edd.js";import{k as ne}from"./index.2ebab4f0.js";import{b as ie}from"./warehouse_order.484c864d.js";import"./lodash.41b9567d.js";import{u as pe,a as de}from"./vue-router.10bd5b90.js";import{a as me}from"./store_product_unit.7a18daaf.js";import{a as _e}from"./warehouse.7c520bce.js";import{d as B,s as ce,r,Z as fe,o as b,K as g,L as l,a as w,U as o,u as s,j as k,c as we,T as Ee,a9 as ve,R as c}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.d6032bc4.js";import"./usePaging.f8c888e4.js";import"./useDictOptions.b9f2df24.js";import"./store_product.2da82c38.js";import"./store_branch_product.a2c0745c.js";import"./warehouse_product_storege.453bea94.js";import"./axios.b4cbdbc9.js";import"./jspdf.75308076.js";import"./fflate.0418c72f.js";import"./pinia.f3529286.js";import"./css-color-function.f23177ae.js";import"./color.a6ad6672.js";import"./clone.954ba32c.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 be={class:"flex-1 w-full"},ke={class:"mb-2"},he=B({name:"storeProductEdit"}),wo=B({...he,props:{dictData:{type:Object,default:()=>({})}},emits:["success","close"],setup(Ce,{emit:Ve}){const h=pe(),x=ce(),{removeTab:L}=ne();r("add");const i=r(""),C=r([]);r(0);const p=fe({store_id:"",manufacture:"",remark:""});h.query.warehouse_id&&(i.value=parseInt(h.query.warehouse_id));const U=()=>{_e({}).then(u=>{C.value=u.lists})};r(!1);const R=r([]),_=r(!1),d=r([]),A=u=>{d.value=d.value.filter(e=>e.id!==u)},P=u=>{u.forEach(e=>{d.value.find(a=>a.id==e.id)||d.value.push(e)}),_.value=!1},O=r([]);(()=>{me({}).then(u=>{O.value=u.lists})})();const f=r(1),S=r(!0),V=()=>{d.value.map(u=>({id:u.product_id,stock:u.new_stock||0,stocks:u.stock||0}))};de();const T=async()=>{if(i.value==""){v.error("\u8BF7\u9009\u62E9\u4ED3\u5E93");return}if(V(),S.value==!1)return;const u=d.value.map(a=>({id:a.product_id,stock:a.new_stock||0,batch:a.batch||0})),e=R.value.map(a=>a.id);if(e.length>1){v.error("\u95E8\u5E97\u4E0D\u80FD\u8D85\u8FC7\u4E00\u4E2A");return}ie({product_arr:u,store_arr:e,order_type:f.value,warehouse_id:i.value,delivery_time:p.manufacture,mark:p.remark}).then(a=>{L(),v.success(a.msg)})};return U(),(u,e)=>{const a=Z,I=z,m=J,M=W,F=X,E=ee,n=oe,N=te,Y=le,y=H,$=Q,j=ue,q=se,G=ae,K=re;return b(),g(K,null,{default:l(()=>[e[11]||(e[11]=w("div",{class:"mb-4 text-lg font-bold"},"\u51FA\u5E93\u5546\u54C1",-1)),w("div",null,[o(j,{ref_key:"formRef",ref:x,model:s(p),"label-width":"90px"},{default:l(()=>[o(m,{label:"\u4ED3\u5E93",prop:"uid"},{default:l(()=>[o(I,{modelValue:s(i),"onUpdate:modelValue":e[0]||(e[0]=t=>k(i)?i.value=t:null),style:{width:"240px"}},{default:l(()=>[(b(!0),we(Ee,null,ve(s(C),t=>(b(),g(a,{key:t.id,label:t.name,value:t.id},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),o(m,{label:"\u51FA\u5E93\u65F6\u95F4"},{default:l(()=>[o(M,{readonly:!1,class:"flex-1 !flex",modelValue:s(p).manufacture,"onUpdate:modelValue":e[1]||(e[1]=t=>s(p).manufacture=t),clearable:"",type:"date","value-format":"YYYY-MM-DD",placeholder:"\u9009\u62E9\u51FA\u5E93\u65E5\u671F"},null,8,["modelValue"])]),_:1}),o(m,{label:"\u5907\u6CE8"},{default:l(()=>[o(F,{modelValue:s(p).remark,"onUpdate:modelValue":e[2]||(e[2]=t=>s(p).remark=t),type:"input",rows:"4"},null,8,["modelValue"])]),_:1}),o(m,{label:"\u5546\u54C1",prop:"store_id"},{default:l(()=>[w("div",be,[w("div",ke,[o(E,{type:"primary",onClick:e[3]||(e[3]=t=>_.value=!0)},{default:l(()=>e[6]||(e[6]=[c("\u6DFB\u52A0\u5546\u54C1")])),_:1})]),o(Y,{data:s(d)},{default:l(()=>[o(n,{label:"\u5546\u54C1ID",prop:"product_id","show-overflow-tooltip":""}),o(n,{label:"\u5546\u54C1\u56FE\u7247",prop:"image","min-width":"80"},{default:l(({row:t})=>[o(N,{style:{width:"50px",height:"50px"},src:t.image,"preview-teleported":!0},null,8,["src"])]),_:1}),o(n,{label:"\u5546\u54C1\u540D\u79F0",prop:"store_name","min-width":"200","show-overflow-tooltip":""}),o(n,{label:"\u5206\u7C7B",prop:"cate_name","min-width":"120","show-overflow-tooltip":""}),o(n,{label:"\u5355\u4F4D",prop:"unit_name","min-width":"80","show-overflow-tooltip":""}),o(n,{label:"\u5546\u54C1\u4EF7\u683C",prop:"price","min-width":"100","show-overflow-tooltip":""}),o(n,{label:"\u5E93\u5B58",prop:"stock","min-width":"100","show-overflow-tooltip":""}),o(n,{label:"\u5206\u914D\u5E93\u5B58","min-width":"150"},{default:l(({row:t})=>[o(F,{modelValue:t.new_stock,"onUpdate:modelValue":D=>t.new_stock=D,onChange:V},null,8,["modelValue","onUpdate:modelValue"])]),_:1}),o(n,{label:"\u64CD\u4F5C",width:"120",fixed:"right"},{default:l(({row:t})=>[o(E,{type:"danger",link:"",onClick:D=>A(t.id)},{default:l(()=>e[7]||(e[7]=[c(" \u5220\u9664 ")])),_:2},1032,["onClick"])]),_:1})]),_:1},8,["data"])])]),_:1}),o(m,{label:"\u5E93\u5B58\u7C7B\u578B",prop:"order_type"},{default:l(()=>[o($,{modelValue:s(f),"onUpdate:modelValue":e[4]||(e[4]=t=>k(f)?f.value=t:null),class:"ml-6"},{default:l(()=>[o(y,{value:1,label:1},{default:l(()=>e[8]||(e[8]=[c("\u9000\u4F9B\u5E94\u5546")])),_:1}),o(y,{value:2,label:2},{default:l(()=>e[9]||(e[9]=[c("\u62A5\u635F")])),_:1})]),_:1},8,["modelValue"])]),_:1}),o(m,{label:""},{default:l(()=>[o(E,{onClick:T,type:"primary",class:"w-40"},{default:l(()=>e[10]||(e[10]=[c("\u63D0\u4EA4")])),_:1})]),_:1})]),_:1},8,["model"])]),o(G,{modelValue:s(_),"onUpdate:modelValue":e[5]||(e[5]=t=>k(_)?_.value=t:null),title:"\u9009\u62E9\u5546\u54C1",width:"70%"},{default:l(()=>[o(q,{onOnBindStore:P,is_warehouse:"1",warehouse_id:s(i)},null,8,["warehouse_id"])]),_:1},8,["modelValue"])]),_:1})}}});export{wo as default};