1 |
- webpackJsonp([5],{RfAR:function(e,t,n){(e.exports=n("FZ+f")(!1)).push([e.i,'\n@charset "UTF-8";\n/** 底部步骤 */\n.footer[data-v-6c866926] {\n width: 100%;\n padding: 10px;\n bottom: 0px;\n text-align: center;\n z-index: 999;\n}\n.mx[data-v-6c866926] {\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}\n.mx .button[data-v-6c866926] {\n margin-left: 10px;\n}\n.bg-in-stock[data-v-6c866926] {\n background-color: #fff;\n margin: 10px;\n padding: 25px;\n}\n.goods-info[data-v-6c866926] {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n}\n.goods-info .goods-name-box[data-v-6c866926] {\n text-align: left;\n}\n.goods-info .goods-name-box .goods-name[data-v-6c866926] {\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-6c866926] {\n color: #999999;\n}\n[data-v-6c866926] .el-input--suffix .el-input__inner {\n padding-right: 10px;\n}\n[data-v-6c866926] .error-input .el-input__inner {\n border: 1px solid red;\n}\n',""])},fxt2:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=n("Xxa5"),d=n.n(o),r=n("exGp"),s=n.n(r),i=n("Dd8w"),a=n.n(i),u=n("NYxO"),l=n("G+dR"),c=n("jQQ7"),p=n("hky6"),_=n("dClm"),m=n("Pfph"),f={name:"goodsLendAdd",data:function(){return{adminList:[],warehouseList:[],deptList:[],deptListAll:[],id:"",type:"",goodsLendAddForm:{},goodsLendAddFormRule:{lend_person_id:{required:!0,message:"请选择出借人",trigger:"change"},dept_id:{required:!0,message:"请选择所属部门",trigger:"change"},lend_register_id:{required:!0,message:"请选择经手人",trigger:"change"},lend_desc:this.MixinRequired("请填写借出说明")}}},computed:a()({},Object(u.b)(["user"])),watch:{$route:{immediate:!0,handler:function(e){this.GET_AdministratorList(),"goodsLendEdit"===this.$route.name?this.type="edit":"goodsLendReturn"===this.$route.name?this.type="return":"goodsLendAdd"===this.$route.name?(this.goodsLendAddForm={},this.GET_WarehouseList({dept_id:this.user.dept_id})):"goodsLendDetail"===this.$route.name&&(this.type="detail"),this.$route.params.id&&(this.id=this.$route.params.id,this.GET_info(this.id))}}},mounted:function(){this.GET_DeptList()},methods:{forceUpdate:function(e){this.$forceUpdate()},GET_AdministratorList:function(){var e=this;m.h({page_no:1,page_size:9999,user_state:0}).then(function(t){e.adminList=t.data})},cleanGoodsList:function(){this.$set(this.goodsLendAddForm,"product_list",[])},changewarehouseList:function(e){this.$set(this.goodsLendAddForm,"warehouse_id",""),this.GET_WarehouseList({dept_id:e}),this.cleanGoodsList()},GET_WarehouseList:function(e){var t=this;_.D(e).then(function(e){t.warehouseList=e})},submitGoodsLendAddForm:function(){var e=this;this.$refs.goodsLendAddForm.validate(function(t){if(t){var n=e.goodsLendAddForm.id,o=e.MixinClone(e.goodsLendAddForm);n?l.s(n,o).then(function(t){e.$message.update("修改成功!");var n=e.$route.params.callback;"function"==typeof n&&n(),e.$store.dispatch("delCurrentViews",{view:e.$route,$router:e.$router}),e.$router.push({name:"goodsLend"})}):l.e(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:"goodsLend"})})}})},returngoodsLendAddForm:function(){var e=this,t=this.goodsLendAddForm.id,n=this.MixinClone(this.goodsLendAddForm);n.return_person_id&&(n.return_person=this.adminList.find(function(e){return e.id===n.return_person_id}).real_name),n.return_register_id&&(n.return_register=this.adminList.find(function(e){return e.id===n.return_register_id}).real_name),n.dept_name=this.deptListAll.find(function(e){return e.id===n.dept_id}).name,n.warehouse_name=this.warehouseList.find(function(e){return e.id===n.warehouse_id}).name,n.lend_time=Math.floor(n.lend_time/1e3),n.product_list=n.product_list.map(function(e){return e.product_sn=e.product_sn,e.product_name=e.product_name,e.specification=e.product_specification,e.product_id=e.product_id,e.unit=e.product_unit,e.stock_sn=e.warehouse_entry_sn,e.stock_num=e.remain_num,e.stock_batch_sn=e.sn,e}),l.r(t,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:"goodsLend"})})},handleSelectWarehouseEntryBatch:function(){var e=this;return s()(d.a.mark(function t(){var n;return d.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(e.goodsLendAddForm.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",selectedIds:e.id?e.goodsLendAddForm.product_list&&e.goodsLendAddForm.product_list.map(function(e){return e.id}):e.goodsLendAddForm.product_list.map(function(e){return e.id}),warehouseList:e.warehouseList,purchasePlanApiParams:{warehouse_id:e.goodsLendAddForm.warehouse_id}});case 5:n=t.sent,e.$set(e.goodsLendAddForm,"product_list",n.purchasePlans),e.$set(e.goodsLendAddForm,"warehouse_id",n.warehouse_id);case 8:case"end":return t.stop()}},t,e)}))()},GET_DeptList:function(){var e=this;p.p().then(function(t){e.deptList=c.Foundation.buildTree(t,"0"),e.deptListAll=t})},GET_goodsLendAddDetail:function(){var e=this;l.n(this.id).then(function(t){e.goodsLendAddForm=t,e.GET_WarehouseList({dept_id:t.dept_id}),e.goodsLendAddForm.return_person_id=t.return_person_id||t.lend_person_id,e.goodsLendAddForm.return_person=t.return_person||t.lend_person,e.goodsLendAddForm.return_register_id=t.return_register_id||e.user.uid,e.goodsLendAddForm.lend_time=Math.floor(1e3*e.goodsLendAddForm.lend_time),e.goodsLendAddForm.product_list=e.goodsLendAddForm.product_list.map(function(e){return e.product_sn=e.product_sn,e.product_name=e.product_name,e.product_specification=e.specification,e.product_id=e.product_id,e.product_unit=e.unit,e.lend_num=e.lend_num,e.sn=e.stock_batch_sn,e.remain_num=e.stock_num,e.warehouse_entry_sn=e.stock_sn,e})})},GET_info:function(e){var t=this;l.l({id:e}).then(function(e){t.goodsLendAddForm=e})}}},h=n("XyMi");var g=function(e){n("iAPd")},L=Object(h.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:"goodsLendAddForm",staticClass:"change-form",attrs:{model:e.goodsLendAddForm,rules:e.goodsLendAddFormRule,"label-width":"120px",inline:""}},[n("h3",[e._v("库位管理")]),e._v(" "),n("el-form-item",{staticStyle:{width:"340px"},attrs:{label:"仓库名称",prop:"name"}},[n("el-input",{attrs:{placeholder:"请输入仓库名称"},model:{value:e.goodsLendAddForm.name,callback:function(t){e.$set(e.goodsLendAddForm,"name",t)},expression:"goodsLendAddForm.name"}})],1),e._v(" "),n("el-form-item",{staticStyle:{width:"340px"},attrs:{label:"库位号",prop:"code"}},[n("el-input",{attrs:{placeholder:"请输入库位号"},model:{value:e.goodsLendAddForm.code,callback:function(t){e.$set(e.goodsLendAddForm,"code",t)},expression:"goodsLendAddForm.code"}})],1),e._v(" "),n("el-form-item",{attrs:{label:"仓库类型",prop:"type"}},[n("el-select",{attrs:{clearable:""},model:{value:e.goodsLendAddForm.type,callback:function(t){e.$set(e.goodsLendAddForm,"type",t)},expression:"goodsLendAddForm.type"}},[n("el-option",{key:"d",attrs:{label:"大型",value:"大型"}}),e._v(" "),n("el-option",{key:"z",attrs:{label:"中型",value:"中型"}}),e._v(" "),n("el-option",{key:"s",attrs:{label:"小型",value:"小型"}})],1)],1),e._v(" "),n("el-form-item",{attrs:{label:"库位说明",prop:"intro"}},[n("el-input",{attrs:{type:"textarea",autosize:{minRows:2,maxRows:4},placeholder:"请输入内容"},model:{value:e.goodsLendAddForm.intro,callback:function(t){e.$set(e.goodsLendAddForm,"intro",t)},expression:"goodsLendAddForm.intro"}})],1),e._v(" "),n("div",{staticClass:"mx"},[n("h3",[e._v("商品明细")]),e._v(" "),"return"!==e.type&&"detail"!==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:{display:"block"}},[n("el-form-item",[n("el-table",{staticStyle:{width:"100%","margin-top":"20px"},attrs:{data:e.goodsLendAddForm.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 ")]}}])})],1)],1)],1)],1),e._v(" "),n("div",{staticClass:"footer"},["return"!==e.type&&"detail"!==e.type?n("el-button",{attrs:{type:"primary"},on:{click:e.submitGoodsLendAddForm}},[e._v("保存\n ")]):e._e(),e._v(" "),n("el-button",{on:{click:function(t){return e.$router.back()}}},[e._v("返回\n ")])],1)],1)},[],!1,g,"data-v-6c866926",null);t.default=L.exports},iAPd:function(e,t,n){var o=n("RfAR");"string"==typeof o&&(o=[[e.i,o,""]]),o.locals&&(e.exports=o.locals);n("rjj0")("2cdf302c",o,!0)}});
|