(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-6b0cdb98"],{9093:function(t,o,e){"use strict";e.r(o);var a=function(){var t=this,o=t._self._c;return o("div",[o("el-row",[o("el-col",{attrs:{span:16}},[o("el-card",{staticClass:"box-card"},[o("div",{staticClass:"flex justify-between",attrs:{slot:"header"},slot:"header"},[o("span",[t._v("库存信息")]),o("div",[o("el-button",{attrs:{type:"primary",size:"small"},on:{click:t._goBack}},[t._v("返回")])],1)]),o("el-table",{staticStyle:{width:"100%"},attrs:{data:t.productStockManageInfo.productStocks,border:"",stripe:""}},[o("el-table-column",{attrs:{prop:"prodName",label:"商品名称",align:"center"}}),o("el-table-column",{attrs:{prop:"barCode",label:"条形码",align:"center"}}),o("el-table-column",{attrs:{prop:"createTime",label:"入库时间",align:"center"}}),o("el-table-column",{attrs:{prop:"state",label:"状态",align:"center"},scopedSlots:t._u([{key:"default",fn:function(o){return[t._v(" "+t._s("1001"==o.row.state?"正常":"占用")+" ")]}}])}),o("el-table-column",{attrs:{prop:"createUserName",label:"入库人",align:"center"}}),o("el-table-column",{attrs:{label:"操作",align:"right"},scopedSlots:t._u([{key:"default",fn:function(e){return[o("el-button",{attrs:{size:"mini",type:"danger"},on:{click:function(o){return t._openDeleteProductStockModel(e.row)}}},[t._v("删除")])]}}])})],1),o("el-pagination",{attrs:{"current-page":t.productStockManageInfo.conditions.page,"page-size":t.productStockManageInfo.conditions.row,layout:"total, prev, pager, next",total:t.productStockManageInfo.total},on:{"current-change":t.handleCurrentChange}})],1)],1),o("el-col",{attrs:{span:8}},[o("el-card",{staticClass:"box-card"},[o("div",{staticClass:"flex justify-between",attrs:{slot:"header"},slot:"header"},[o("span",[t._v("查询库存")])]),o("el-form",{staticClass:"demo-form-inline",attrs:{inline:!0}},[o("el-form-item",{attrs:{label:"条形码"}},[o("el-input",{attrs:{placeholder:"必填,请填写条形码"},nativeOn:{keyup:function(o){return!o.type.indexOf("key")&&t._k(o.keyCode,"enter",13,o.key,"Enter")?null:t._queryProductMethod.apply(null,arguments)}},model:{value:t.productStockManageInfo.conditions.barCode,callback:function(o){t.$set(t.productStockManageInfo.conditions,"barCode",o)},expression:"productStockManageInfo.conditions.barCode"}})],1),o("el-form-item",[o("el-button",{attrs:{type:"primary"},on:{click:t._queryProductMethod}},[t._v("查询")])],1)],1)],1),o("el-card",{staticClass:"box-card",staticStyle:{"margin-top":"20px"}},[o("div",{staticClass:"flex justify-between",attrs:{slot:"header"},slot:"header"},[o("span",[t._v("入库信息")])]),o("el-form",{attrs:{"label-width":"80px"}},[o("el-form-item",{attrs:{label:"条形码"}},[o("el-input",{attrs:{id:"enterBarCode",placeholder:"必填,请填写条形码"},nativeOn:{keyup:function(o){return!o.type.indexOf("key")&&t._k(o.keyCode,"enter",13,o.key,"Enter")?null:t._enterProductStock.apply(null,arguments)}},model:{value:t.productStockManageInfo.barCode,callback:function(o){t.$set(t.productStockManageInfo,"barCode",o)},expression:"productStockManageInfo.barCode"}})],1),o("el-form-item",{attrs:{label:"商品"}},[o("span",[t._v(t._s(t.productStockManageInfo.prodName))])]),o("el-form-item",[o("el-button",{staticStyle:{width:"100%"},attrs:{type:"warning",size:"large"},on:{click:t._enterProductStock}},[t._v("入库")])],1)],1)],1)],1)],1),o("delete-product-stock",{ref:"deleteProductStock"})],1)},r=[],n=e("7323"),c=e("9d2f"),s={name:"ProductStockManage",data(){return{productStockManageInfo:{productStocks:[],total:0,records:1,moreCondition:!1,barCode:"",prodName:"",conditions:{productId:"",valueId:"",keyword:"",barCode:"",shopId:"",page:1,row:10}}}},created(){this._initData(),this.productStockManageInfo.conditions.productId=this.$route.query.productId,this.productStockManageInfo.conditions.valueId=this.$route.query.valueId,this._listProducts(),this._listProductStocks(1,10)},methods:{_initData(){this.productStockManageInfo.conditions.shopId=Object(n["f"])(),document.getElementById("enterBarCode").focus()},handleCurrentChange(t){this._listProductStocks(t,this.productStockManageInfo.conditions.row)},async _listProductStocks(t,o){this.productStockManageInfo.conditions.page=t,this.productStockManageInfo.conditions.row=o;try{const t=await Object(c["c"])(this.productStockManageInfo.conditions);this.productStockManageInfo.total=t.total,this.productStockManageInfo.records=t.records,this.productStockManageInfo.productStocks=t.data}catch(e){console.error("请求失败处理",e)}},_openDeleteProductStockModel(t){this.$refs.deleteProductStock.open(t)},_queryProductMethod(){this._listProductStocks(1,this.productStockManageInfo.conditions.row)},async _listProducts(){try{const t=await Object(c["queryProduct"])({page:1,row:1,productId:this.productStockManageInfo.conditions.productId}),o=t.data[0];this.productStockManageInfo.prodName=o.prodName,this.productStockManageInfo.barCode=""}catch(t){console.error("请求失败处理",t)}},async _enterProductStock(){if(!this.productStockManageInfo.barCode)return void this.$message.error("条形码不能为空");const t={shopId:Object(n["f"])(),barCode:this.productStockManageInfo.barCode,productId:this.productStockManageInfo.conditions.productId,valueId:this.productStockManageInfo.conditions.valueId};try{const o=await Object(c["d"])(t);this.productStockManageInfo.barCode="",0===o.code?(this.$message.success("入库成功"),this._listProductStocks(1,this.productStockManageInfo.conditions.row)):this.$message.error(o.msg)}catch(o){console.error("请求失败处理",o),this.$message.error(o)}},_goBack(){this.$router.go(-1)}}},d=s,i=(e("a9b5"),e("2877")),l=Object(i["a"])(d,a,r,!1,null,"3002bf7f",null);o["default"]=l.exports},"9d2f":function(t,o,e){"use strict";e.d(o,"c",(function(){return r})),e.d(o,"d",(function(){return n})),e.d(o,"a",(function(){return c}));var a=e("b775");function r(t){return new Promise((o,e)=>{Object(a["a"])({url:"/productStock/queryProductStock",method:"get",params:t}).then(t=>{const e=t.data;o(e)}).catch(t=>{e(t)})})}function n(t){return new Promise((o,e)=>{Object(a["a"])({url:"/productStock/saveProductStock",method:"post",data:t}).then(t=>{const e=t.data;o(e)}).catch(t=>{e(t)})})}function c(t){return new Promise((o,e)=>{Object(a["a"])({url:"/productStock/deleteProductStock",method:"post",data:t}).then(t=>{const e=t.data;o(e)}).catch(t=>{e(t)})})}},a9b5:function(t,o,e){"use strict";e("ac92")},ac92:function(t,o,e){}}]); //# sourceMappingURL=chunk-6b0cdb98.2dbd4b7b.js.map