2024-10-09 10:52:41 +08:00
|
|
|
import{U as Q,G as X,H as ee,k as L,J as oe,K as te,D as ue,C as le,w as ae,M as re,b as se,N as ie,F as ne,I as pe,L as de}from"./element-plus.4a7d92a3.js";import{_ as me}from"./index.vue_vue_type_script_setup_true_name_systemStoreLists_lang.b098b91e.js";import{_ as _e}from"./index.vue_vue_type_script_setup_true_name_systemStoreLists_lang.f9008957.js";import{k as ce}from"./index.9f02ca4f.js";import{b as fe}from"./warehouse_order.1c6bf98c.js";import{d as S,s as Ee,r as s,Z as we,ap as ve,o as b,K as B,L as t,a as c,U as e,u as r,j as k,c as he,T as be,a9 as ke,R as n,S as De,M as Ce}from"./@vue.18505fe0.js";import"./lodash.9dc701ad.js";import{u as Be,a as ye}from"./vue-router.101084e3.js";import{a as Ve}from"./store_product_unit.5dd8a7ec.js";import{a as ge}from"./warehouse.a69ae96d.js";import"./lodash-es.f52bd8b1.js";import"./async-validator.fb49d0f5.js";import"./@vueuse.fbc6a400.js";import"./@element-plus.edbd5a83.js";import"./dayjs.7347fedc.js";import"./axios.4607972f.js";import"./@ctrl.b082b0c1.js";import"./normalize-wheel-es.8aeb3683.js";import"./@popperjs.36402333.js";import"./index.vue_vue_type_script_setup_true_lang.5d4e738c.js";import"./usePaging.6a6670f9.js";import"./useDictOptions.49ccb93e.js";import"./store_product.1da3e690.js";import"./store_branch_product.f27de953.js";import"./warehouse_product_storege.cd9088e9.js";import"./system_store.272f6690.js";import"./pinia.a969beab.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.0d2736b7.js";import"./vue-clipboard3.7d5a7a5d.js";import"./clipboard.860a1cea.js";import"./echarts.5016c48c.js";import"./zrender.58d022a1.js";import"./tslib.60310f1a.js";import"./highlight.js.31cd7941.js";import"./@highlightjs.b0c09b66.js";const Fe=c("div",{class:"mb-4 text-lg font-bold"},"\u51FA\u5E93\u5546\u54C1\u5230\u95E8\u5E97",-1),xe={class:"flex-1 w-full"},Ue={class:"mb-2"},Ae={class:"flex-1 w-full"},Le={class:"mb-2"},Se=c("span",{class:"text-info text-xs ml-6"},"\u9ED8\u8BA4\u4E3A\u5206\u914D\u552E\u5356\u5E93\u5B58, \u5982\u9700\u5206\u914D\u5151\u6362\u5E93\u5B58\u8BF7\u9009\u62E9\u5206\u914D\u5151\u6362\u5E93\u5B58",-1),Re=S({name:"storeProductEdit"}),Fo=S({...Re,props:{dictData:{type:Object,default:()=>({})}},emits:["success","close"],setup(Ie,{emit:Me}){const y=Be(),R=Ee();ce(),s("add");const p=s(""),V=s([]);s(0);const d=we({store_id:"",manufacture:"",remark:""});y.query.warehouse_id&&(p.value=parseInt(y.query.warehouse_id));const I=()=>{ge({}).then(l=>{V.value=l.lists})},E=s(!1),f=s([]),M=l=>{f.value=f.value.filter(u=>u.id!==l)},O=l=>{f.value=[],f.value.push(l),D(),E.value=!1},w=s(!1),m=s([]),P=l=>{m.value=m.value.filter(u=>u.id!==l)},T=l=>{l.forEach(u=>{m.value.find(i=>i.id==u.id)||m.value.push(u)}),w.value=!1},$=s([]);(()=>{Ve({}).then(l=>{$.value=l.lists})})();const h=s(1),N=s(!0),D=()=>{m.value.map(l=>({id:l.product_id,stock:l.new_stock||0,stocks:l.stock||0}))},Y=ye(),j=async()=>{if(p.value==""){L.error("\u8BF7\u9009\u62E9\u4ED3\u5E93");return}if(D(),N.value==!1)return;const l=m.value.map(i=>({id:i.product_id,stock:i.new_stock||0,batch:i.batch||0})),u=f.value.map(i=>i.id);if(u.length>1){L.error("\u95E8\u5E97\u4E0D\u80FD\u8D85\u8FC7\u4E00\u4E2A");return}fe({product_arr:l,store_arr:u,stock_type:h.value,warehouse_id:p.value,delivery_time:d.manufacture,mark:d.remark}).then(i=>{setTimeout(()=>{Y.push({path:"/warehouse/outbound_order"})},2e3)})};return I(),(l,u)=>{const i=oe,q=te,_=ue,G=Q,g=le,v=ae,a=re,F=se,x=ie,U=X,K=ee,W=ne,H=_e,A=pe,J=me,Z=de,z=ve("perms");return b(),B(Z,null,{default:t(()=>[Fe,c("div",null,[e(W,{ref_key:"formRef",ref:R,model:r(d),"label-width":"90px"},{default:t(()=>[e(_,{label:"\u4ED3\u5E93",prop:"uid"},{default:t(()=>[e(q,{modelValue:r(p),"onUpdate:modelValue":u[0]||(u[0]=o=>k(p)?p.value=o:null),style:{width:"240px"}},{default:t(()=>[(b(!0),he(be,null,ke(r(V),o=>(b(),B(i,{key:o.id,label:o.name,value:o.id},null,8,["label","
|