2024-08-21 22:51:57 +08:00
|
|
|
import{U as X,G as ee,H as te,k as F,J as oe,K as ue,D as le,C as ae,w as re,M as se,b as ie,N as ne,F as pe,I as de,L as me}from"./element-plus.a63a26dd.js";import{_ as _e}from"./index.vue_vue_type_script_setup_true_name_systemStoreLists_lang.5807d4f1.js";import{_ as ce}from"./index.vue_vue_type_script_setup_true_name_systemStoreLists_lang.58af5558.js";import{k as fe}from"./index.4eacc1fd.js";import{a as Ee}from"./warehouse_order.8aced0ab.js";import{d as O,s as we,r as i,Z as he,ap as ve,o as E,K as b,L as u,a as f,U as e,u as s,j as D,c as be,T as ke,a9 as De,R as n,S as Be,M,Q as Ce}from"./@vue.18505fe0.js";import"./lodash.2473fc51.js";import{u as ye,a as Fe}from"./vue-router.101084e3.js";import{a as Ve}from"./store_product_unit.2eb5c6cb.js";import{a as ge}from"./warehouse.b7c921d8.js";import"./lodash-es.f52bd8b1.js";import"./async-validator.fb49d0f5.js";import"./@vueuse.fbc6a400.js";import"./@element-plus.edbd5a83.js";import"./dayjs.4884cfc2.js";import"./axios.932d3f8a.js";import"./@ctrl.b082b0c1.js";import"./normalize-wheel-es.8aeb3683.js";import"./@popperjs.36402333.js";import"./index.vue_vue_type_script_setup_true_lang.ecb80feb.js";import"./usePaging.6a6670f9.js";import"./useDictOptions.798027a7.js";import"./store_product.ad22c96e.js";import"./store_branch_product.67b6c969.js";import"./warehouse_product_storege.74c2a590.js";import"./system_store.4ee984bb.js";import"./pinia.a969beab.js";import"./css-color-function.9f6a56f3.js";import"./color.d1bc3784.js";import"./clone.83700f2e.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.fcc9be76.js";import"./vue-clipboard3.9e751565.js";import"./clipboard.dda64e67.js";import"./echarts.5016c48c.js";import"./zrender.58d022a1.js";import"./tslib.60310f1a.js";import"./highlight.js.31cd7941.js";import"./@highlightjs.b0c09b66.js";const xe=f("div",{class:"mb-4 text-lg font-bold"},"\u51FA\u5E93\u5546\u54C1\u5230\u95E8\u5E97",-1),Ae={class:"flex-1 w-full"},Ue={class:"mb-2"},Le={class:"flex-1 w-full"},Se={class:"mb-2"},Re=f("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),Ie=O({name:"storeProductEdit"}),gt=O({...Ie,props:{dictData:{type:Object,default:()=>({})}},emits:["success","close"],setup(Me,{emit:Oe}){const V=ye(),P=we();fe(),i("add");const p=i(""),g=i([]);i(0);const d=he({store_id:"",manufacture:"",remark:""});V.query.warehouse_id&&(p.value=parseInt(V.query.warehouse_id));const T=()=>{ge({}).then(a=>{g.value=a.lists})},w=i(!1),m=i([]),$=a=>{m.value=m.value.filter(o=>o.id!==a)},N=a=>{m.value=[],m.value.push(a),C(),w.value=!1},h=i(!1),_=i([]),Y=a=>{_.value=_.value.filter(o=>o.id!==a)},j=a=>{a.forEach(o=>{_.value.find(l=>l.id==o.id)||_.value.push(o)}),h.value=!1},q=i([]);(()=>{Ve({}).then(a=>{q.value=a.lists})})();const k=i(1),B=i(!0),C=()=>{const a=_.value.map(l=>({id:l.product_id,stock:l.new_stock||0,stocks:l.stock||0})),o=m.value.length;if(o>0&&a.length>0)try{a.forEach(l=>{if(l.stock*o>l.stocks)throw B.value=!1,new Error("\u8D85\u51FA\u4ED3\u5E93\u5E93\u5B58,\u8BF7\u91CD\u65B0\u8BBE\u7F6E")})}catch{F.error("\u8D85\u51FA\u4ED3\u5E93\u5E93\u5B58,\u8BF7\u91CD\u65B0\u8BBE\u7F6E");return}B.value=!0},G=Fe(),K=async()=>{if(p.value==""){F.error("\u8BF7\u9009\u62E9\u4ED3\u5E93");return}if(C(),B.value==!1)return;const a=_.value.map(l=>({id:l.product_id,stock:l.new_stock||0,batch:l.batch||0})),o=m.value.map(l=>l.id);if(o.length>1){F.error("\u95E8\u5E97\u4E0D\u80FD\u8D85\u8FC7\u4E00\u4E2A");return}Ee({product_arr:a,store_arr:o,stock_type:k.value,warehouse_id:p.value,delivery_time:d.manufacture,mark:d.remark}).then(l=>{setTimeout(()=>{G.push({path:"/warehouse/outbound_order"})},2e3)})};return T(),(a,o)=>{const l=oe,x=ue,c=le,W=X,A=ae,v=re,r=se,U=ie,L=ne,S=ee,H=te,J=pe,Q=ce,R=de,Z=_e,z=me,I=ve("perms");return E(),b(z,null,{default:u(()=>[xe,f("div",null,[e(J,{ref_key:"formRef",ref:P,model:s(d),"label-wi
|