1 |
- webpackJsonp([1],{MGZr:function(e,t,n){var o=n("YmXY");"string"==typeof o&&(o=[[e.i,o,""]]),o.locals&&(e.exports=o.locals);n("rjj0")("659ed0a4",o,!0)},PSeb:function(e,t,n){"use strict";t.h=function(e){return Object(o.a)({url:"admin/lend/form/list-product-lend-num",method:"post",loaidng:!1,headers:{"Content-Type":"application/json"},data:e})},t.i=function(e){return Object(o.a)({url:"admin/stock/inventory/confirm/"+e,method:"post"})},t.e=function(e,t){return Object(o.a)({url:"admin/stock/inventory/"+e,method:"post",headers:{"Content-Type":"application/json"},data:t})},t.a=function(e){return Object(o.a)({url:"admin/stock/inventory",method:"post",headers:{"Content-Type":"application/json"},data:e})},t.j=function(e){return Object(o.a)({url:"admin/stock/inventory/submit/"+e,method:"post"})},t.c=function(e){return Object(o.a)({url:"admin/stock/inventory/cancel/"+e,method:"post"})},t.b=function(e,t){return Object(o.a)({url:"admin/stock/inventory/audit/"+e,method:"post",data:t})},t.f=function(e){return Object(o.a)({url:"admin/stock/inventory/"+e,method:"get",loaidng:!1})},t.g=function(e){return Object(o.a)({url:"admin/stock/inventory",method:"get",loaidng:!1,params:e})},t.d=function(e){return Object(o.a)({url:"admin/stock/inventory/"+e,method:"delete"})};var o=n("vLgD")},Y38y:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=n("Xxa5"),r=n.n(o),i=n("exGp"),a=n.n(i),d=n("Dd8w"),s=n.n(d),l=n("NYxO"),c=n("jQQ7"),u=n("PSeb"),m=n("hky6"),p=n("dClm"),_=(n("CIZm"),n("Pfph")),f={name:"goodsInventoryAdd",data:function(){return{adminList:[],dialogVisible:!1,warehouseList:[],deptList:[],deptListAll:[],id:"",type:"",goodsInventoryAddForm:{product_list:[]},goodsInventoryAddFormRule:{inventory_person_id:{required:!0,message:"请选择盘点人",trigger:"change"},warehouse_id:{required:!0,message:"请选择报仓库",trigger:"change"},dept_id:{required:!0,message:"请选择所属部门",trigger:"change"},creator_id:{required:!0,message:"请选择制单人",trigger:"change"}},warehouseProduct:null}},computed:s()({},Object(l.b)(["user"])),mounted:function(){"goodsInventoryEdit"===this.$route.name?this.type="edit":"goodsInventoryAudit"===this.$route.name?this.type="audit":"goodsInventoryReturn"===this.$route.name?this.type="return":"goodsInventoryAdd"===this.$route.name?(this.goodsInventoryAddForm.creator_id=this.user.uid,this.goodsInventoryAddForm.inventory_person_id=this.user.uid,this.goodsInventoryAddForm.dept_id=this.user.dept_id,this.GET_WarehouseList({dept_id:this.user.dept_id}),this.$set(this.goodsInventoryAddForm,"inventory_time",(new Date).getTime())):"goodsInventoryDetail"===this.$route.name?this.type="detail":"goodsInventoryCheck"===this.$route.name&&(this.type="check"),this.$route.params.id&&(this.id=this.$route.params.id,this.GET_goodsInventoryAddDetail()),this.GET_AdministratorList(),this.GET_DeptList()},methods:{printIng:function(){},forceUpdate:function(){this.$forceUpdate()},cleanGoodsList:function(){this.goodsInventoryAddForm.product_list=[]},GET_AdministratorList:function(){var e=this;_.h({page_no:1,page_size:9999,user_state:0}).then(function(t){e.adminList=t.data})},handlePassGoodsInventory:function(){var e=this;this.$confirm("确定通过吗?","提示",{type:"warning"}).then(function(){u.b(e.id,{status:"PASS"}).then(function(){e.$message.success("已通过!");var t=e.$route.params.callback;"function"==typeof t&&t(),e.$store.dispatch("delCurrentViews",{view:e.$route,$router:e.$router}),e.$router.push({name:"goodsInventory"})})}).catch(function(){})},handleRejectGoodsInventory:function(){var e=this;this.goodsInventoryAddForm.reject_reason?this.$confirm("确定拒绝吗?","提示",{type:"warning"}).then(function(){u.b(e.id,{status:"REJECT",reject_reason:e.goodsInventoryAddForm.reject_reason}).then(function(){e.$message.success("已拒绝!");var t=e.$route.params.callback;"function"==typeof t&&t(),e.$store.dispatch("delCurrentViews",{view:e.$route,$router:e.$router}),e.$router.push({name:"goodsInventory"})})}).catch(function(){}):this.$message.error("请填写驳回原因!")},changewarehouseList:function(e){this.$set(this.goodsInventoryAddForm,"warehouse_id",""),this.GET_WarehouseList({dept_id:e}),this.cleanGoodsList()},GET_WarehouseList:function(e){var t=this;p.C(e).then(function(e){t.warehouseList=e})},submitGoodsInventoryAddForm:function(){var e=this;this.$refs.goodsInventoryAddForm.validate(function(t){if(t){var n=e.goodsInventoryAddForm.id,o=e.MixinClone(e.goodsInventoryAddForm);o.dept_id&&(o.dept_name=e.deptListAll.find(function(e){return e.id===o.dept_id}).name),o.warehouse_id&&(o.warehouse_name=e.warehouseList.find(function(e){return e.id===o.warehouse_id}).name),o.creator_id&&(o.creator=e.adminList.find(function(e){return e.id===o.creator_id}).real_name),o.inventory_person_id&&(o.inventory_person=e.adminList.find(function(e){return e.id===o.inventory_person_id}).real_name),o.inventory_time=Math.floor(o.inventory_time/1e3),o.product_list=o.product_list.map(function(e){return{diff_num:e.inventory_num-e.remain_num,inventory_num:1*e.inventory_num,product_id:e.product_id,product_name:e.product_name,product_sn:e.product_sn,specification:e.product_specification,stock_num:1*e.remain_num,unit:e.product_unit,goods_id:e.goods_id,remark:e.remark}}),n?u.e(n,o).then(function(t){e.$message.success("修改成功!");var n=e.$route.params.callback;"function"==typeof n&&n(),e.$store.dispatch("delCurrentViews",{view:e.$route,$router:e.$router}),e.$router.push({name:"goodsInventory"})}):u.a(o).then(function(){e.$message.success("添加成功!");var t=e.$route.params.callback;"function"==typeof t&&t(),e.$store.dispatch("delCurrentViews",{view:e.$route,$router:e.$router}),e.$router.push({name:"goodsInventory"})})}})},handleSelectWarehouseEntryBatch:function(){var e=this;return a()(r.a.mark(function t(){var n,o;return r.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(e.goodsInventoryAddForm.warehouse_id){t.next=3;break}return e.$message.error("请先选择仓库!"),t.abrupt("return");case 3:return t.next=5,e.$EnwarehouseEntryBatch({goodsApi:"admin/erp/warehouseEntryBatch",warehouseList:e.warehouseList,selectedIds:e.id?e.goodsInventoryAddForm.product_list&&e.goodsInventoryAddForm.product_list.map(function(e){return e.id}):e.goodsInventoryAddForm.product_list.map(function(e){return e.id}),purchasePlanApiParams:{warehouse_id:e.goodsInventoryAddForm.warehouse_id}});case 5:n=t.sent,e.goodsInventoryAddForm.warehouse_id=n.warehouse_id,o=n.purchasePlans.map(function(e){return{product_id:e.product_id,stock_sn:e.warehouse_entry_sn}}),e.getlistProductLendNum(o,n.purchasePlans);case 9:case"end":return t.stop()}},t,e)}))()},getlistProductLendNum:function(e,t){var n=this;u.h(e).then(function(e){t.map(function(t){e.forEach(function(e){t.product_id===e.product_id&&t.warehouse_entry_sn===e.stock_sn&&(t.remark=e.lend_num?"借出"+e.lend_num+(t.product_unit?t.product_unit:""):"")})}),n.goodsInventoryAddForm.product_list=t})},GET_DeptList:function(){var e=this;m.p().then(function(t){e.deptList=c.Foundation.buildTree(t,"0"),e.deptListAll=t})},handleChangeWareHouse:function(e){this.goodsInventoryAddForm.product_list=[]},GET_goodsInventoryAddDetail:function(){var e=this;u.f(this.id).then(function(t){e.goodsInventoryAddForm=t,e.GET_WarehouseList({dept_id:t.dept_id}),e.goodsInventoryAddForm.inventory_time=Math.floor(1e3*e.goodsInventoryAddForm.inventory_time),e.goodsInventoryAddForm.distribution_name=t.staff_name,e.goodsInventoryAddForm.product_list=e.goodsInventoryAddForm.product_list.map(function(e){return e.product_specification=e.specification,e.product_unit=e.unit,e.remain_num=e.stock_num,e})})}}},v=n("XyMi");var y=function(e){n("MGZr")},h=Object(v.a)(f,function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"bg-in-stock"},[n("el-form",{ref:"goodsInventoryAddForm",staticClass:"change-form",attrs:{model:e.goodsInventoryAddForm,rules:e.goodsInventoryAddFormRule,"label-width":"120px",inline:""}},[n("h3",{staticStyle:{width:"100%"}},[e._v("盘点单")]),e._v(" "),"edit"===e.type||"detail"===e.type?n("el-form-item",{staticClass:"change-form-item",attrs:{label:"盘点编号",prop:"sn"}},[n("el-input",{attrs:{disabled:!0},model:{value:e.goodsInventoryAddForm.sn,callback:function(t){e.$set(e.goodsInventoryAddForm,"sn",t)},expression:"goodsInventoryAddForm.sn"}})],1):e._e(),e._v(" "),n("el-form-item",{staticClass:"change-form-item",attrs:{label:"盘点时间",prop:"inventory_time"}},[n("el-date-picker",{attrs:{"value-format":"timestamp",type:"datetime",disabled:"detail"===e.type||"audit"===e.type||"check"===e.type,placeholder:"选择日期时间"},model:{value:e.goodsInventoryAddForm.inventory_time,callback:function(t){e.$set(e.goodsInventoryAddForm,"inventory_time",t)},expression:"goodsInventoryAddForm.inventory_time"}})],1),e._v(" "),n("el-form-item",{staticClass:"change-form-item",attrs:{label:"仓库",prop:"warehouse_id"}},[n("el-select",{attrs:{disabled:"detail"===e.type||"audit"===e.type||"check"===e.type},on:{change:e.handleChangeWareHouse},model:{value:e.goodsInventoryAddForm.warehouse_id,callback:function(t){e.$set(e.goodsInventoryAddForm,"warehouse_id",t)},expression:"goodsInventoryAddForm.warehouse_id"}},e._l(e.warehouseList,function(e){return n("el-option",{key:e.id,attrs:{label:e.name,value:e.id}})}),1)],1),e._v(" "),n("el-form-item",{staticClass:"change-form-item",attrs:{label:"盘点人",prop:"inventory_person_id"}},[n("el-select",{attrs:{disabled:"detail"===e.type||"audit"===e.type||"check"===e.type},on:{change:e.forceUpdate},model:{value:e.goodsInventoryAddForm.inventory_person_id,callback:function(t){e.$set(e.goodsInventoryAddForm,"inventory_person_id",t)},expression:"goodsInventoryAddForm.inventory_person_id"}},e._l(e.adminList,function(e){return n("el-option",{key:e.id,attrs:{label:e.real_name,value:e.id}})}),1)],1),e._v(" "),n("el-form-item",{staticClass:"change-form-item",attrs:{label:"制单人",prop:"creator_id"}},[n("el-select",{attrs:{disabled:"detail"===e.type||"audit"===e.type||"check"===e.type},on:{change:e.forceUpdate},model:{value:e.goodsInventoryAddForm.creator_id,callback:function(t){e.$set(e.goodsInventoryAddForm,"creator_id",t)},expression:"goodsInventoryAddForm.creator_id"}},e._l(e.adminList,function(e){return n("el-option",{key:e.id,attrs:{label:e.real_name,value:e.id}})}),1)],1),e._v(" "),n("el-form-item",{staticClass:"change-form-item",attrs:{label:"盘点类型",prop:"type"}},[n("el-select",{attrs:{disabled:"detail"===e.type||"audit"===e.type||"check"===e.type},on:{change:e.handleChangeWareHouse},model:{value:e.goodsInventoryAddForm.type,callback:function(t){e.$set(e.goodsInventoryAddForm,"type",t)},expression:"goodsInventoryAddForm.type"}})],1),e._v(" "),n("div",{staticClass:"mx"},[n("h3",[e._v("商品明细")]),e._v(" "),"detail"!==e.type&&"check"!==e.type?n("el-button",{staticClass:"button",attrs:{size:"mini",type:"primary"},on:{click:e.handleSelectWarehouseEntryBatch}},[e._v("选择")]):e._e()],1),e._v(" "),n("div",{staticStyle:{width:"100%",display:"block"}},[n("el-form-item",{staticStyle:{width:"100%"}},[n("el-table",{staticStyle:{width:"100%","margin-top":"20px"},attrs:{data:e.goodsInventoryAddForm.product_list,border:"","cell-style":{textAlign:"center"},"header-cell-style":{textAlign:"center"}}},[n("el-table-column",{attrs:{label:"商品编号"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v("\n "+e._s(t.row.product_sn)+"\n ")]}}])}),e._v(" "),n("el-table-column",{attrs:{label:"商品名称"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v("\n "+e._s(t.row.product_name)+"\n ")]}}])}),e._v(" "),n("el-table-column",{attrs:{label:"条码"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v("\n "+e._s(t.row.bar_code)+"\n ")]}}])}),e._v(" "),n("el-table-column",{attrs:{label:"序列号"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v("\n "+e._s(t.row.sn_code)+"\n ")]}}])}),e._v(" "),n("el-table-column",{attrs:{label:"规格型号"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v("\n "+e._s(t.row.product_specification)+"\n ")]}}])}),e._v(" "),n("el-table-column",{attrs:{label:"单位"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v("\n "+e._s(t.row.product_unit)+"\n ")]}}])}),e._v(" "),n("el-table-column",{attrs:{label:"库存数量"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v("\n "+e._s(t.row.remain_num)+"\n ")]}}])}),e._v(" "),n("el-table-column",{attrs:{label:"盘点数量"},scopedSlots:e._u([{key:"default",fn:function(t){return[n("el-input",{attrs:{type:"number",min:0,maxlength:20,disabled:"detail"===e.type||"audit"===e.type||"check"===e.type},model:{value:t.row.inventory_num,callback:function(n){e.$set(t.row,"inventory_num",n)},expression:"scope.row.inventory_num"}})]}}])}),e._v(" "),n("el-table-column",{attrs:{label:"差异"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v("\n "+e._s(t.row.inventory_num-t.row.remain_num||0)+"\n ")]}}])}),e._v(" "),n("el-table-column",{attrs:{label:"备注"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v("\n "+e._s(t.row.remark)+"\n "),n("el-input",{directives:[{name:"show",rawName:"v-show",value:!1,expression:"false"}],attrs:{min:0,maxlength:20,disabled:!0},model:{value:t.row.remark,callback:function(n){e.$set(t.row,"remark",n)},expression:"scope.row.remark"}})]}}])}),e._v(" "),"detail"!==e.type&&"audit"!==e.type&&"check"!==e.type?n("el-table-column",{attrs:{label:"操作"},scopedSlots:e._u([{key:"default",fn:function(t){return[n("el-button",{attrs:{size:"mini",type:"danger"},on:{click:function(n){return e.goodsInventoryAddForm.product_list.splice(t.$index,1)}}},[e._v("删除")])]}}],null,!1,2952986069)}):e._e()],1)],1)],1)],1),e._v(" "),n("div",{staticClass:"footer"},["audit"===e.type&&"detail"!==e.type&&"check"!==e.type?n("el-button",{attrs:{type:"primary"},on:{click:function(t){return e.handlePassGoodsInventory()}}},[e._v("通过\n ")]):e._e(),e._v(" "),"audit"===e.type&&"detail"!==e.type&&"check"!==e.type?n("el-button",{attrs:{type:"danger"},on:{click:function(t){e.dialogVisible=!0}}},[e._v("驳回\n ")]):e._e(),e._v(" "),"audit"!==e.type&&"detail"!==e.type&&"check"!==e.type?n("el-button",{attrs:{type:"primary"},on:{click:e.submitGoodsInventoryAddForm}},[e._v("保存\n ")]):e._e(),e._v(" "),"check"==e.type?n("el-button",{on:{click:e.printIng}},[e._v("打印")]):e._e(),e._v(" "),n("el-button",{on:{click:function(t){return e.$router.back()}}},[e._v("返回\n ")])],1),e._v(" "),n("el-dialog",{attrs:{title:"提示",visible:e.dialogVisible,width:"30%"},on:{"update:visible":function(t){e.dialogVisible=t}}},[n("el-form",{ref:"goodsInventoryAddForm",staticStyle:{width:"900px"},attrs:{model:e.goodsInventoryAddForm,"label-width":"120px",inline:""}},[n("el-form-item",{attrs:{label:"驳回原因",prop:"reject_reason",required:"true"}},[n("el-input",{attrs:{type:"textarea",minlength:0,maxlength:100},model:{value:e.goodsInventoryAddForm.reject_reason,callback:function(t){e.$set(e.goodsInventoryAddForm,"reject_reason",t)},expression:"goodsInventoryAddForm.reject_reason"}})],1)],1),e._v(" "),n("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[n("el-button",{on:{click:function(t){e.dialogVisible=!1}}},[e._v("取 消")]),e._v(" "),n("el-button",{attrs:{type:"primary"},on:{click:function(t){return e.handleRejectGoodsInventory()}}},[e._v("确 定")])],1)],1)],1)},[],!1,y,"data-v-a9b3dd5a",null);t.default=h.exports},YmXY:function(e,t,n){(e.exports=n("FZ+f")(!1)).push([e.i,'\n@charset "UTF-8";\n/** 底部步骤 */\n.footer[data-v-a9b3dd5a] {\n width: 100%;\n padding: 10px;\n bottom: 0px;\n text-align: center;\n z-index: 999;\n}\n.mx[data-v-a9b3dd5a] {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n width: 100%;\n}\n.mx .button[data-v-a9b3dd5a] {\n margin-left: 10px;\n}\n.change-form[data-v-a9b3dd5a] {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-pack: start;\n -ms-flex-pack: start;\n justify-content: flex-start;\n -webkit-box-align: start;\n -ms-flex-align: start;\n align-items: flex-start;\n -ms-flex-wrap: wrap;\n flex-wrap: wrap;\n min-width: 900px;\n}\n.change-form .change-form-item[data-v-a9b3dd5a] {\n width: 30%;\n margin: 0 10px 20px 0;\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-orient: horizontal;\n -webkit-box-direction: normal;\n -ms-flex-direction: row;\n flex-direction: row;\n -ms-flex-wrap: nowrap;\n flex-wrap: nowrap;\n}\n.change-form[data-v-a9b3dd5a] .el-form-item__content {\n -webkit-box-flex: 1;\n -ms-flex: 1;\n flex: 1;\n width: 100%;\n}\n.change-form[data-v-a9b3dd5a] .el-date-editor,\n .change-form[data-v-a9b3dd5a] .el-cascader,\n .change-form[data-v-a9b3dd5a] .el-select {\n width: 100%;\n}\n.bg-in-stock[data-v-a9b3dd5a] {\n background-color: #fff;\n margin: 10px;\n padding: 25px;\n}\n.goods-info[data-v-a9b3dd5a] {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n}\n.goods-info .goods-name-box[data-v-a9b3dd5a] {\n text-align: left;\n}\n.goods-info .goods-name-box .goods-name[data-v-a9b3dd5a] {\n text-overflow: ellipsis;\n display: -webkit-box;\n -webkit-line-clamp: 2;\n -webkit-box-orient: vertical;\n overflow: hidden;\n line-height: 16px;\n}\n.goods-info .goods-name-box .specs[data-v-a9b3dd5a] {\n color: #999999;\n}\n[data-v-a9b3dd5a] .el-input--suffix .el-input__inner {\n padding-right: 10px;\n}\n[data-v-a9b3dd5a] .error-input .el-input__inner {\n border: 1px solid red;\n}\n',""])}});
|