import{d as V,p as c,r as v,c as B,e as b,k as N,i as y,g as e,w as _,aY as m,h,q as k,m as g,E as f,R as q,S as L,_ as U}from"./index.0308b213.js";import{s as I}from"./stock.c0e2e5a0.js";const l=o=>(q("data-v-535947d4"),o=o(),L(),o),z={class:"san"},j=l(()=>e("div",{style:{flex:"1","text-align":"end","padding-right":"20px"}},"\u8D27\u4F4D\uFF1A",-1)),M={style:{flex:"7",display:"flex","align-items":"center"}},R={class:"input"},T=l(()=>e("text",{style:{margin:"0 4px"}},"-",-1)),Y={class:"input"},$=l(()=>e("text",{style:{margin:"0 4px"}},"-",-1)),G={class:"input"},H=l(()=>e("text",{style:{margin:"0 4px"}},"-",-1)),J={class:"input"},K={class:"san",style:{"margin-top":"20px"}},O=l(()=>e("div",{style:{flex:"1","text-align":"end","padding-right":"20px"}},"\u5907\u6CE8\uFF1A",-1)),P={style:{flex:"7",display:"flex","align-items":"center"}},Q=l(()=>e("div",{style:{"margin-top":"20px",display:"flex","justify-content":"space-between"}},[e("div",{style:{flex:"1","text-align":"end","padding-right":"20px"}},"\u6CE8\u610F\uFF1A"),e("div",{style:{flex:"7"}},[e("div",null,"\u2460\u533A\u53F7\u53EF\u4EE5\u4E3A\u6570\u5B57\u3001\u5B57\u6BCD\u6216\u6C49\u5B57\uFF0C\u5176\u4ED6\u53EA\u80FD\u662F\u6570\u5B57\uFF1B"),e("div",{style:{"margin-top":"8px"}},"\u2461\u7B2C\u4E00\u4E2A\u5B57\u6BB5\u901A\u5E38\u4E3A\u533A\u53F7\uFF1B\u7B2C\u4E8C\u4E2A\u5B57\u6BB5\u901A\u5E38\u4E3A\u8D27\u67B6\u540D\u79F0\uFF1B\u7B2C\u4E09\u4E2A\u5B57\u6BB5\u901A\u5E38\u4E3A\u8D27\u67B6\u5C42\u6570\uFF1B\u7B2C\u56DB\u4E2A\u5B57\u6BB5\u901A\u5E38\u4E3A\u8D27\u67B6\u6BCF\u5C42\u7684\u7B2C\u51E0\u4E2A\u8D27\u4F4D\uFF1B"),e("div",{style:{"margin-top":"8px"}},"\u4F8B\u5982:A-1-01-01\u6216\u8005B-1-01-01\u6216\u8005\u4E09\u533A-1-1-1")])],-1)),W={style:{width:"100%",display:"flex","justify-content":"space-between","margin-top":"20px"}},X=l(()=>e("div",null,null,-1)),Z=g("\u53D6\u6D88"),ee=g("\u786E\u8BA4"),ue=V({props:{areaCode:String,shelfName:Number,shelfLayerCount:Number,positionSequence:Number,textarea:String,openAdd:Boolean},emits:["customEvent","fetchStockList"],setup(o,{emit:x}){const a=o;c(()=>a.areaCode,u=>{p.value=u}),c(()=>a.shelfName,u=>{n.value=u}),c(()=>a.shelfLayerCount,u=>{i.value=u}),c(()=>a.positionSequence,u=>{d.value=u}),c(()=>a.textarea,u=>{r.value=u});const p=v(a.areaCode),n=v(a.shelfName),i=v(a.shelfLayerCount),d=v(a.positionSequence),r=v(a.textarea),C=()=>{const u=/^[1-9][0-9]{0,2}$/;return!u.test(n.value.toString())||!u.test(i.value.toString())||!u.test(d.value.toString())?(f.error("\u8BF7\u8F93\u5165\u6B63\u6574\u6570\u4E14\u4E0D\u8D85\u8FC7\u4E09\u4F4D\u6570"),!1):!0},A=()=>{x("customEvent"),E()},E=()=>{p.value="",n.value=0,i.value=0,d.value=0,r.value=""},D=async()=>{if(!!C())try{const u={area_code:p.value,shelf_name:n.value,shelf_layer_count:i.value,position_sequence:d.value,notes:r.value},t=await I(u);x("customEvent"),x("fetchStockList"),f({message:"\u6DFB\u52A0\u6210\u529F",type:"success"}),E()}catch(u){f.error(u.message)}};return(u,t)=>{const S=B("el-input"),F=B("el-button"),w=B("el-dialog");return b(),N(w,{title:"\u65B0\u589E\u8D27\u4F4D",modelValue:o.openAdd,"onUpdate:modelValue":t[5]||(t[5]=s=>k(openAdd)?openAdd.value=s:null)},{default:y(()=>[e("div",z,[j,e("div",M,[e("div",R,[_(e("input",{type:"text","onUpdate:modelValue":t[0]||(t[0]=s=>p.value=s),placeholder:"\u533A\u53F7",style:{margin:"0 10px",width:"100px"}},null,512),[[m,p.value]])]),T,e("div",Y,[_(e("input",{type:"number","onUpdate:modelValue":t[1]||(t[1]=s=>n.value=s),placeholder:"\u8D27\u67B6\u540D\u79F0",style:{margin:"0 10px",width:"100px"}},null,512),[[m,n.value]])]),$,e("div",G,[_(e("input",{type:"number","onUpdate:modelValue":t[2]||(t[2]=s=>i.value=s),placeholder:"\u8D27\u67B6\u5C42\u6570",style:{margin:"0 10px",width:"100px"}},null,512),[[m,i.value]])]),H,e("div",J,[_(e("input",{type:"number","onUpdate:modelValue":t[3]||(t[3]=s=>d.value=s),placeholder:"\u7B2C\u51E0\u4E2A\u8D27\u4F4D",style:{margin:"0 10px",width:"100px"}},null,512),[[m,d.value]])])])]),e("div",K,[O,e("div",P,[h(S,{modelValue:r.value,"onUpdate:modelValue":t[4]||(t[4]=s=>r.value=s),style:{width:"100%"},autosize:"",type:"textarea",placeholder:"\u5907\u6CE8"},null,8,["modelValue"])])]),Q,e("div",W,[X,e("div",null,[h(F,{type:"primary",size:"large",plain:"",onClick:A},{default:y(()=>[Z]),_:1}),h(F,{type:"primary",size:"large",onClick:D},{default:y(()=>[ee]),_:1})])])]),_:1},8,["modelValue"])}}});const ae=U(ue,[["__scopeId","data-v-535947d4"]]);export{ae as default};
