2024-11-15 16:58:18 +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.91c68cc0.js";import{_ as me}from"./index.vue_vue_type_script_setup_true_name_systemStoreLists_lang.922c0e0d.js";import{_ as _e}from"./index.vue_vue_type_script_setup_true_name_systemStoreLists_lang.377dcf90.js";import{k as fe}from"./index.45e3c1f0.js";import{b as ce}from"./warehouse_order.397a4451.js";import{d as S,s as Ee,r as s,Z as we,ap as ve,o as h,K as B,L as u,a as f,U as o,u as r,j as k,c as be,T as he,a9 as ke,R as n,S as De,M as Ce}from"./@vue.76ce7aa3.js";import"./lodash.4e6d2a38.js";import{u as Be,a as ye}from"./vue-router.10bd5b90.js";import{a as Ve}from"./store_product_unit.c9cbc701.js";import{a as ge}from"./warehouse.16c7cc4d.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"./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 Fe={class:"flex-1 w-full"},xe={class:"mb-2"},Ue={class:"flex-1 w-full"},Ae={class:"mb-2"},Le=S({name:"storeProductEdit"}),xo=S({...Le,props:{dictData:{type:Object,default:()=>({})}},emits:["success","close"],setup(Se,{emit:Re}){const y=Be(),R=Ee();fe(),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),c=s([]),M=l=>{c.value=c.value.filter(e=>e.id!==l)},O=l=>{c.value=[],c.value.push(l),D(),E.value=!1},w=s(!1),m=s([]),P=l=>{m.value=m.value.filter(e=>e.id!==l)},T=l=>{l.forEach(e=>{m.value.find(i=>i.id==e.id)||m.value.push(e)}),w.value=!1},$=s([]);(()=>{Ve({}).then(l=>{$.value=l.lists})})();const b=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})),e=c.value.map(i=>i.id);if(e.length>1){L.error("\u95E8\u5E97\u4E0D\u80FD\u8D85\u8FC7\u4E00\u4E2A");return}ce({product_arr:l,store_arr:e,stock_type:b.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,e)=>{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 h(),B(Z,null,{default:u(()=>[e[16]||(e[16]=f("div",{class:"mb-4 text-lg font-bold"},"\u51FA\u5E93\u5546\u54C1\u5230\u95E8\u5E97",-1)),f("div",null,[o(W,{ref_key:"formRef",ref:R,model:r(d),"label-width":"90px"},{default:u(()=>[o(_,{label:"\u4ED3\u5E93",prop:"uid"},{default:u(()=>[o(q,{modelValue:r(p),"onUpdate:modelValue":e[0]||(e[0]=t=>k(p)?p.value=t:null),style:{width:"240px"}},{default:u(()=>[(h(!0),be(he,null,ke(r(V),t=>(h(),B(i,{key:t.id,label:t.name,value:t.id},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),o(_,{label:"\u9001\u8D27\u65F6\u95F4"},{default:u(()=>[o(G,{reado
|