4.4c38889e493a484de1e6.js 15 KB

1
  1. webpackJsonp([4],{"/Tmc":function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=o("Xxa5"),r=o.n(n),a=o("exGp"),s=o.n(a),i=o("Dd8w"),d=o.n(i),l=o("NYxO"),c=o("jQQ7"),u=o("Oa05"),p=o("hky6"),m=o("dClm"),f=(o("CIZm"),o("Pfph")),v={name:"goodsInventoryAdd",data:function(){return{adminList:[],dialogVisible:!1,warehouseList:[],deptList:[],deptListAll:[],roleSplit:[],id:"",type:"",goodsInventoryAddForm:{product_list:[]},goodsInventoryAddFormRule:{warehouse_id:{required:!0,message:"请选择报仓库",trigger:"change"},damage_type_value:{required:!0,message:"请选择报损类型",trigger:"change"},dept_id:{required:!0,message:"请选择所属部门",trigger:"change"},creator_id:{required:!0,message:"请选择制单人",trigger:"change"}},warehouseProduct:null}},computed:d()({},Object(l.b)(["user"])),mounted:function(){"goodsInventoryLossEdit"===this.$route.name?this.type="edit":"goodsInventoryLossAudit"===this.$route.name?this.type="audit":"goodsInventoryLossReturn"===this.$route.name?this.type="return":"goodsInventoryLossAdd"===this.$route.name?(this.goodsInventoryAddForm.creator_id=this.user.uid,this.goodsInventoryAddForm.dept_id=this.user.dept_id,this.GET_WarehouseList({dept_id:this.user.dept_id})):"goodsInventoryLossDetail"===this.$route.name&&(this.type="detail"),this.$route.params.id&&(this.id=this.$route.params.id,this.GET_goodsInventoryAddDetail()),this.GET_AdministratorList(),this.GET_DeptList(),this.GET_DictDataInfo()},methods:{printIng:function(){},changeCreator:function(e){this.$forceUpdate()},cleanGoodsList:function(){this.goodsInventoryAddForm.product_list=[]},GET_AdministratorList:function(){var e=this;f.h({page_no:1,page_size:9999,user_state:0}).then(function(t){e.adminList=t.data})},GET_DictDataInfo:function(){var e=this;p.p("es_stock_damage_report").then(function(t){e.roleSplit=t})},handlePassGoodsInventoryLoss:function(){var e=this;this.$confirm("确定通过吗?","提示",{type:"warning"}).then(function(){u.c(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:"goodsInventoryLoss"})})}).catch(function(){})},handleRejectGoodsInventoryLoss:function(){var e=this;this.$confirm("确定拒绝吗?","提示",{type:"warning"}).then(function(){u.c(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:"goodsInventoryLoss"})})}).catch(function(){})},changewarehouseList:function(e){this.$set(this.goodsInventoryAddForm,"warehouse_id",""),this.GET_WarehouseList({dept_id:e}),this.cleanGoodsList()},GET_WarehouseList:function(e){var t=this;m.D(e).then(function(e){t.warehouseList=e})},submitGoodsInventoryAddForm:function(){var e=this;this.$refs.goodsInventoryAddForm.validate(function(t){if(t){var o=e.goodsInventoryAddForm.id,n=e.MixinClone(e.goodsInventoryAddForm);n.dept_id&&(n.dept_name=e.deptListAll.find(function(e){return e.id===n.dept_id}).name),n.warehouse_id&&(n.warehouse_name=e.warehouseList.find(function(e){return e.id===n.warehouse_id}).name),n.damage_type_value&&(n.damage_type_key=e.roleSplit.find(function(e){return e.value===n.damage_type_value}).label),n.creator_id&&(n.creator=e.adminList.find(function(e){return e.id===n.creator_id}).real_name),n.product_list=n.product_list.map(function(e){return{report_num:e.report_num,product_id:e.product_id}}),o?u.f(o,n).then(function(t){e.$message.success("修改成功!");var o=e.$route.params.callback;"function"==typeof o&&o(),e.$store.dispatch("delCurrentViews",{view:e.$route,$router:e.$router}),e.$router.push({name:"goodsInventoryLoss"})}):u.b(n).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:"goodsInventoryLoss"})})}})},handleSelectWarehouseEntryBatch:function(){var e=this;return s()(r.a.mark(function t(){var 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/warehouseOut/getGoodByWarehouse/"+e.goodsInventoryAddForm.warehouse_id,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:o=t.sent,e.goodsInventoryAddForm.warehouse_id=o.warehouse_id,e.goodsInventoryAddForm.product_list=o.purchasePlans;case 8:case"end":return t.stop()}},t,e)}))()},GET_DeptList:function(){var e=this;p.o().then(function(t){e.deptList=c.Foundation.buildTree(t,"0"),e.deptListAll=t})},GET_goodsInventoryAddDetail:function(){var e=this;u.g(this.id).then(function(t){e.goodsInventoryAddForm=t,e.GET_WarehouseList({dept_id:t.dept_id}),e.goodsInventoryAddForm.distribution_name=t.staff_name})}}},_=o("XyMi");var h=function(e){o("hQwY")},g=Object(_.a)(v,function(){var e=this,t=e.$createElement,o=e._self._c||t;return o("div",{staticClass:"bg-in-stock"},[o("el-form",{ref:"goodsInventoryAddForm",staticClass:"change-form",attrs:{model:e.goodsInventoryAddForm,rules:e.goodsInventoryAddFormRule,"label-width":"120px",inline:""}},[o("h3",{staticStyle:{width:"100%"}},[e._v("库存报损")]),e._v(" "),o("el-form-item",{staticClass:"change-form-item",attrs:{label:"报损时间",prop:"report_time"}},[o("el-date-picker",{attrs:{"value-format":"yyyy-MM-dd HH:mm:ss",type:"datetime",disabled:"detail"===e.type||"audit"===e.type,placeholder:"选择日期时间"},model:{value:e.goodsInventoryAddForm.report_time,callback:function(t){e.$set(e.goodsInventoryAddForm,"report_time",t)},expression:"goodsInventoryAddForm.report_time"}})],1),e._v(" "),o("el-form-item",{staticClass:"change-form-item",attrs:{label:"仓库",prop:"warehouse_id"}},[o("el-select",{attrs:{disabled:"detail"===e.type||"audit"===e.type},on:{change:e.cleanGoodsList},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 o("el-option",{key:e.id,attrs:{label:e.name,value:e.id}})}),1)],1),e._v(" "),o("el-form-item",{staticClass:"change-form-item",attrs:{label:"报损类型",prop:"damage_type_value"}},[o("el-select",{attrs:{disabled:"detail"===e.type||"audit"===e.type},model:{value:e.goodsInventoryAddForm.damage_type_value,callback:function(t){e.$set(e.goodsInventoryAddForm,"damage_type_value",t)},expression:"goodsInventoryAddForm.damage_type_value"}},e._l(e.roleSplit,function(e){return o("el-option",{key:e.label,attrs:{label:e.label,value:e.value}})}),1)],1),e._v(" "),o("el-form-item",{staticClass:"change-form-item",attrs:{label:"制单人",prop:"creator_id"}},[o("el-select",{attrs:{disabled:"detail"===e.type||"audit"===e.type},on:{change:e.changeCreator},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 o("el-option",{key:e.id,attrs:{label:e.real_name,value:e.id}})}),1)],1),e._v(" "),o("el-form-item",{staticClass:"change-form-item",staticStyle:{width:"61%"},attrs:{label:"报损说明",prop:"report_desc"}},[o("el-input",{staticStyle:{flex:"1"},attrs:{type:"textarea",disabled:"detail"===e.type||"audit"===e.type,autosize:{minRows:3,maxRows:4},placeholder:"请输入报损说明"},model:{value:e.goodsInventoryAddForm.report_desc,callback:function(t){e.$set(e.goodsInventoryAddForm,"report_desc",t)},expression:"goodsInventoryAddForm.report_desc"}})],1),e._v(" "),o("div",{staticClass:"mx"},[o("h3",[e._v("报损商品明细")]),e._v(" "),"detail"!==e.type?o("el-button",{staticClass:"button",attrs:{size:"mini",type:"primary"},on:{click:e.handleSelectWarehouseEntryBatch}},[e._v("选择")]):e._e()],1),e._v(" "),o("div",{staticStyle:{width:"100%",display:"block"}},[o("el-form-item",{staticStyle:{width:"100%"}},[o("el-table",{staticStyle:{width:"100%","margin-top":"20px"},attrs:{data:e.goodsInventoryAddForm.product_list,border:"","cell-style":{textAlign:"center"},"header-cell-style":{textAlign:"center"}}},[o("el-table-column",{attrs:{label:"商品编号"},scopedSlots:e._u([{key:"default",fn:function(t){return[e.id?o("span",[e._v(" "+e._s(t.row.goods_vo.sn))]):o("span",[e._v(e._s(t.row.good_vo.sn))])]}}])}),e._v(" "),o("el-table-column",{attrs:{label:"商品名称"},scopedSlots:e._u([{key:"default",fn:function(t){return[e.id?o("span",[e._v(e._s(t.row.goods_vo.name))]):o("span",[e._v(e._s(t.row.good_vo.name))])]}}])}),e._v(" "),o("el-table-column",{attrs:{label:"规格型号"},scopedSlots:e._u([{key:"default",fn:function(t){return[(e.id,o("span",[e._v(e._s(t.row.product_vo.spec_name.join("/")))]))]}}])}),e._v(" "),o("el-table-column",{attrs:{label:"单位"},scopedSlots:e._u([{key:"default",fn:function(t){return[(e.id,o("span",[e._v(" "+e._s(t.row.product_vo.unit))]))]}}])}),e._v(" "),o("el-table-column",{attrs:{label:"库存数量"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v("\n "+e._s(t.row.usable_stock)+"\n ")]}}])}),e._v(" "),o("el-table-column",{attrs:{label:"报损数量"},scopedSlots:e._u([{key:"default",fn:function(t){return[o("el-input",{attrs:{type:"number",min:0,maxlength:20,disabled:"detail"===e.type||"audit"===e.type},model:{value:t.row.report_num,callback:function(o){e.$set(t.row,"report_num",o)},expression:"scope.row.report_num"}})]}}])}),e._v(" "),"detail"!==e.type&&"audit"!==e.type?o("el-table-column",{attrs:{label:"操作"},scopedSlots:e._u([{key:"default",fn:function(t){return[o("el-button",{attrs:{size:"mini",type:"danger"},on:{click:function(o){return e.goodsInventoryAddForm.product_list.splice(t.$index,1)}}},[e._v("删除")])]}}],null,!1,2952986069)}):e._e()],1)],1)],1)],1),e._v(" "),o("div",{staticClass:"footer"},["audit"!==e.type&&"detail"!==e.type?o("el-button",{attrs:{type:"primary"},on:{click:e.submitGoodsInventoryAddForm}},[e._v("保存\n ")]):e._e(),e._v(" "),"detail"==e.type?o("el-button",{on:{click:e.printIng}},[e._v("打印")]):e._e(),e._v(" "),o("el-button",{on:{click:function(t){return e.$router.back()}}},[e._v("返回\n ")])],1),e._v(" "),o("el-dialog",{attrs:{title:"提示",visible:e.dialogVisible,width:"30%"},on:{"update:visible":function(t){e.dialogVisible=t}}},[o("el-form",{ref:"goodsInventoryAddForm",staticStyle:{width:"900px"},attrs:{model:e.goodsInventoryAddForm,"label-width":"120px",inline:""}},[o("el-form-item",{attrs:{label:"驳回原因",prop:"reject_reason"}},[o("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(" "),o("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[o("el-button",{on:{click:function(t){e.dialogVisible=!1}}},[e._v("取 消")]),e._v(" "),o("el-button",{attrs:{type:"primary"},on:{click:function(t){return e.handleRejectGoodsInventoryLoss()}}},[e._v("确 定")])],1)],1)],1)},[],!1,h,"data-v-7e27d60c",null);t.default=g.exports},"4vu5":function(e,t,o){(e.exports=o("FZ+f")(!1)).push([e.i,'\n@charset "UTF-8";\n/** 底部步骤 */\n.footer[data-v-7e27d60c] {\n width: 100%;\n padding: 10px;\n bottom: 0px;\n text-align: center;\n z-index: 999;\n}\n.mx[data-v-7e27d60c] {\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-7e27d60c] {\n margin-left: 10px;\n}\n.change-form[data-v-7e27d60c] {\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-7e27d60c] {\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-7e27d60c] .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-7e27d60c] .el-date-editor,\n .change-form[data-v-7e27d60c] .el-cascader,\n .change-form[data-v-7e27d60c] .el-select {\n width: 100%;\n}\n.bg-in-stock[data-v-7e27d60c] {\n background-color: #fff;\n margin: 10px;\n padding: 25px;\n}\n.goods-info[data-v-7e27d60c] {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n}\n.goods-info .goods-name-box[data-v-7e27d60c] {\n text-align: left;\n}\n.goods-info .goods-name-box .goods-name[data-v-7e27d60c] {\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-7e27d60c] {\n color: #999999;\n}\n[data-v-7e27d60c] .el-input--suffix .el-input__inner {\n padding-right: 10px;\n}\n[data-v-7e27d60c] .error-input .el-input__inner {\n border: 1px solid red;\n}\n',""])},Oa05:function(e,t,o){"use strict";t.a=function(e){return Object(n.a)({url:"admin/stock/damage/report/confirm/"+e,method:"post"})},t.f=function(e,t){return Object(n.a)({url:"admin/stock/damage/report/"+e,method:"post",headers:{"Content-Type":"application/json"},data:t})},t.b=function(e){return Object(n.a)({url:"admin/stock/damage/report",method:"post",headers:{"Content-Type":"application/json"},data:e})},t.d=function(e){return Object(n.a)({url:"admin/stock/damage/report/cancel/"+e,method:"post"})},t.c=function(e,t){return Object(n.a)({url:"admin/stock/damage/report/audit/"+e,method:"post",data:t})},t.g=function(e){return Object(n.a)({url:"admin/stock/damage/report/"+e,method:"get",loaidng:!1})},t.h=function(e){return Object(n.a)({url:"admin/stock/damage/report",method:"get",loaidng:!1,params:e})},t.e=function(e){return Object(n.a)({url:"admin/stock/damage/report/"+e,method:"delete"})},t.i=function(e){return Object(n.a)({url:"/admin/stock/damage/report/syncStock/"+e,method:"post"})};var n=o("vLgD")},hQwY:function(e,t,o){var n=o("4vu5");"string"==typeof n&&(n=[[e.i,n,""]]),n.locals&&(e.exports=n.locals);o("rjj0")("7e0225c4",n,!0)}});