batchAddition.2479bc91.js 4.5 KB

1
  1. import{b as A}from"./stock.14dda429.js";import{d as x,r as m,b7 as b,c as F,e as V,f as L,g as n,H as D,h as t,i as o,t as N,F as k,m as C,l as P,E as p,_ as U}from"./index.76214426.js";const w={class:"header"},I={class:"center"},S=C("\u65B0\u5EFA\u4E00\u884C"),$=["onClick"],R=P('<div class="annotate" data-v-1fd265c3><div style="margin-top:10px;" data-v-1fd265c3>\u6CE8\u91CA\uFF1A</div><div style="margin-top:10px;" data-v-1fd265c3>1.\u6BCF\u4E2A\u8D27\u4F4D\u4E0D\u8D85\u8FC74\u6BB5\uFF0C\u9664\u533A\u53F7\u5916\uFF0C\u6BCF\u6BB5\u6700\u591A\u586B\u51993\u4F4D\u6570\uFF1B</div><div style="margin-top:10px;" data-v-1fd265c3>2.\u533A\u53F7\u53EF\u4EE5\u4E3A\u6570\u5B57\u3001\u5B57\u6BCD\u6216\u6C49\u5B57\uFF0C\u5176\u4ED6\u53EA\u80FD\u662F\u6570\u5B57\uFF1B</div><div style="margin-top:10px;" data-v-1fd265c3>3.\u82E5\u662F\u5DF2\u5B58\u5728\u7684\u8D27\u4F4D\uFF0C\u4E0D\u4F1A\u8FDB\u884C\u5904\u7406\uFF1B</div><div style="margin-top:10px;" data-v-1fd265c3>4.\u8D37\u4F4D\u6570\u91CF=\u8D27\u67B6\u540D\u79F0*\u8D37\u67B6\u5C42\u6570*\u6BCF\u5C42\u8D27\u4F4D\u6570\u91CF\uFF1B</div></div>',1),z={class:"footer"},H=C("\u786E\u8BA4\u63D0\u4EA4"),M=x({setup(T){const i=m(1),s=m([{areaCode:"",shelfName:"",shelfLayers:"",positionsPerLayer:""}]),_=()=>{s.value.push({areaCode:"",shelfName:"",shelfLayers:"",positionsPerLayer:""})},f=u=>{s.value.splice(u,1)},B=u=>{const a=parseInt(u.shelfName)||0,c=parseInt(u.shelfLayers)||0,r=parseInt(u.positionsPerLayer)||0;return a*c*r},v=b(),y=()=>{v.push({path:"/store/goods/stock/stockList"})},h=u=>{const a=/^[1-9][0-9]{0,2}$/;return!u.areaCode||!u.shelfName||!u.shelfLayers||!u.positionsPerLayer?(p.error("\u6240\u6709\u5B57\u6BB5\u90FD\u4E0D\u80FD\u4E3A\u7A7A"),!1):!a.test(u.shelfName.toString())||!a.test(u.shelfLayers.toString())||!a.test(u.positionsPerLayer.toString())?(p.error("\u8D27\u67B6\u540D\u79F0\u3001\u8D27\u67B6\u5C42\u6570\u548C\u6BCF\u5C42\u8D27\u4F4D\u5FC5\u987B\u4E3A\u6B63\u6574\u6570\u4E14\u4E0D\u8D85\u8FC7\u4E09\u4F4D\u6570"),!1):!0},E=async()=>{for(let u=0;u<s.value.length;u++)if(!h(s.value[u]))return;try{const u=await A(s.value);p({message:"\u6570\u636E\u63D0\u4EA4\u6210\u529F",type:"success"}),s.value=[],y()}catch(u){console.error("\u63D0\u4EA4\u8FC7\u7A0B\u4E2D\u53D1\u751F\u9519\u8BEF:",u),p.error("\u63D0\u4EA4\u8FC7\u7A0B\u4E2D\u53D1\u751F\u9519\u8BEF\uFF0C\u8BF7\u91CD\u8BD5")}};return(u,a)=>{const c=F("el-button"),r=F("el-input"),d=F("el-table-column"),g=F("el-table");return V(),L(k,null,[n("div",w,[n("div",{onClick:a[0]||(a[0]=e=>i.value=1),class:D({active:i.value==1}),style:{cursor:"pointer","margin-right":"20px","padding-bottom":"5px"}},"\u6309\u8D27\u4F4D\u751F\u6210",2),n("div",{onClick:a[1]||(a[1]=e=>i.value=2),class:D({active:i.value==2}),style:{cursor:"pointer","padding-bottom":"5px"}},"\u6309\u6587\u4EF6\u5BFC\u5165 ",2)]),n("div",I,[t(c,{type:"primary",round:"",onClick:_},{default:o(()=>[S]),_:1}),t(g,{data:s.value,style:{width:"100%","border-radius":"8px","margin-top":"20px"}},{default:o(()=>[t(d,{align:"center",label:"\u533A\u53F7"},{default:o(e=>[t(r,{type:"text",modelValue:e.row.areaCode,"onUpdate:modelValue":l=>e.row.areaCode=l,placeholder:"\u8BF7\u8F93\u5165\u533A\u53F7",style:{margin:"0 10px"}},null,8,["modelValue","onUpdate:modelValue"])]),_:1}),t(d,{align:"center",label:"\u8D27\u67B6\u540D\u79F0"},{default:o(e=>[t(r,{type:"text",modelValue:e.row.shelfName,"onUpdate:modelValue":l=>e.row.shelfName=l,placeholder:"\u8BF7\u8F93\u5165\u8D27\u67B6\u540D\u79F0",style:{margin:"0 10px"}},null,8,["modelValue","onUpdate:modelValue"])]),_:1}),t(d,{align:"center",label:"\u8D27\u67B6\u5C42\u6570"},{default:o(e=>[t(r,{type:"text",modelValue:e.row.shelfLayers,"onUpdate:modelValue":l=>e.row.shelfLayers=l,placeholder:"\u8BF7\u8F93\u5165\u8D27\u67B6\u5C42\u6570",style:{margin:"0 10px"}},null,8,["modelValue","onUpdate:modelValue"])]),_:1}),t(d,{align:"center",label:"\u6BCF\u5C42\u8D27\u4F4D"},{default:o(e=>[t(r,{type:"text",modelValue:e.row.positionsPerLayer,"onUpdate:modelValue":l=>e.row.positionsPerLayer=l,placeholder:"\u8BF7\u8F93\u5165\u6BCF\u5C42\u8D27\u4F4D\u6570",style:{margin:"0 10px"}},null,8,["modelValue","onUpdate:modelValue"])]),_:1}),t(d,{align:"center",label:"\u8D27\u4F4D\u6570\u91CF"},{default:o(e=>[n("span",null,N(B(e.row)),1)]),_:1}),t(d,{align:"center",label:"\u64CD\u4F5C"},{default:o(e=>[n("div",{style:{color:"#ffc143",cursor:"pointer"},onClick:l=>f(e.$index)},"\u5220\u9664 ",8,$)]),_:1})]),_:1},8,["data"]),R,n("div",z,[t(c,{onClick:E,type:"primary",round:""},{default:o(()=>[H]),_:1})])])],64)}}});const G=U(M,[["__scopeId","data-v-1fd265c3"]]);export{G as default};