27.0f297d3fe496bf07d409.js 11 KB

1
  1. webpackJsonp([27],{CShc:function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=o("Xxa5"),a=o.n(n),s=o("exGp"),i=o.n(s),r=o("Dd8w"),d=o.n(r),c=o("NYxO"),l=(o("jQQ7"),o("dO7o")),u=o("G+dR"),p=o("hky6"),h=o("dClm"),f=o("CIZm"),b=o("Pfph"),_={name:"goodsExchangeAdd",data:function(){return{typeList:[],adminList:[],dialogVisible:!1,warehouseList:[],deptList:[],deptListAll:[],orderList:[],id:"",type:"",goodsExchangeAddForm:{product_list:[],type:""},goodsExchangeAddFormRule:{},warehouseProduct:null,scanDialogVisible:!1,scanGoodsForm:{},sttorageType:"",goodsVisible:!1,goodsData:[],goodsList:[],product_list:[],code:"",warehouse_id:"",activeList:[]}},mounted:function(){this.id=this.$route.params.id,this.warehouse_id=this.$route.params.warehouse_id,this.code=this.$route.params.code,this.type=this.$route.params.type,"check"===this.type&&this.GET_goodsExchangeAddDetail(),this.GET_WarehouseList(),this.GET_DeptList(),this.outType()},watch:{$route:{immediate:!0,handler:function(t){"goodsExchangeEdit"===this.$route.name?this.type="edit":"goodsExchangeAudit"===this.$route.name?this.type="audit":"goodsExchangeReturn"===this.$route.name?this.type="return":"inventoryItem"===this.$route.name?(this.type="add",this.$set(this.goodsExchangeAddForm,"change_time",(new Date).getTime())):"goodsExchangeDetail"===this.$route.name&&(this.type="detail"),this.$route.params.id&&(this.id=this.$route.params.id),this.GET_AdministratorList()}}},computed:d()({},Object(c.b)(["user"])),methods:{submitGoosData:function(){this.goodsList.length>=1?(this.goodsExchangeAddForm.product_list=this.goodsList,this.goodsVisible=!1):this.$message.error("请选择商品信息")},handleSelectionChange:function(t){this.goodsList=t},closeGoosData:function(){this.goodsVisible=!1},outType:function(){var t=this;p.u({dictType:"out_warehouse_type"}).then(function(e){t.typeList=e.data.filter(function(t){if("SALE_OUT"!==t.value&&"HAIL_OUT"!==t.value)return t})})},printIng:function(){},toSearch:function(){l.g({barcode:this.scanGoodsForm.bar_code}).then(function(t){})},scanCode:function(){var t=this;this.scanDialogVisible=!0,this.$nextTick(function(){t.$refs.input.focus()})},GET_AdministratorList:function(){var t=this;b.h({page_no:1,page_size:9999,user_state:0}).then(function(e){t.adminList=e.data})},GET_WarehouseList:function(t){var e=this;h.D().then(function(t){e.warehouseList=t})},saveGoodsExchangeAddForm:function(){var t=this;this.$refs.goodsExchangeAddForm.validate(function(e){if(e){t.goodsExchangeAddForm.id;var o=t.MixinClone(t.goodsExchangeAddForm),n=[];if(!t.goodsExchangeAddForm.product_list.length)return void t.$message.error("请选择商品!");t.goodsExchangeAddForm.product_list.map(function(t){return n.push(t.id)}),o.stock_id_list=n,u.c(t.warehouse_id,t.id,o).then(function(){t.$message.success("添加成功!");var e=t.$route.params.callback;"function"==typeof e&&e(),t.$store.dispatch("delCurrentViews",{view:t.$route,$router:t.$router}),t.$router.push({name:"goodsLend"})})}})},reverseSelect:function(t){this.$refs.table.toggleRowSelection(t)},handleSelectWarehouseEntryBatch:function(){var t=this;return i()(a.a.mark(function e(){return a.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:u.o(t.warehouse_id,t.params).then(function(e){t.goodsData=e.records,t.goodsVisible=!0,u.l({id:t.id}).then(function(o){t.activeList=o.area_stock_vo,e.records.map(function(e){o.area_stock_vo.map(function(o){e.id===o.product_stock_id&&t.reverseSelect(e)})})})});case 1:case"end":return e.stop()}},e,t)}))()},handleSelectOrderSn:function(){var t=this;return i()(a.a.mark(function e(){var o,n;return a.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.$EnPickerOrder({orderApi:"admin/erp/order",selectedIds:[t.goodsExchangeAddForm.order_sn],limit:1});case 2:o=e.sent,t.$set(t.goodsExchangeAddForm,"distribution_name",o[0].distribution_name),n=o.map(function(t){return t.sn}),t.$set(t.goodsExchangeAddForm,"order_sn",n.join(",")),t.GET_WarehouseOutProduct();case 7:case"end":return e.stop()}},e,t)}))()},GET_WarehouseOutProduct:function(){var t=this;return i()(a.a.mark(function e(){var o;return a.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,f.a({order_sn:t.goodsExchangeAddForm.order_sn});case 2:o=e.sent,t.goodsExchangeAddForm.return_list=o.data.map(function(t){return t.amount=t.product_price,t.product_sn=t.product_sn,t.product_name=t.product_name,t.specification=t.product_specification,t.product_id=t.product_id,t.unit=t.product_unit,t.out_num=t.return_num,t.stock_sn=t.warehouse_entry_sn,t.cost_price=t.product_cost_price,t});case 4:case"end":return e.stop()}},e,t)}))()},GET_DeptList:function(){var t=this;l.i().then(function(e){t.deptListAll=e,t.deptListAll.password=""})},handleChangeWareHouse:function(t){},GET_goodsExchangeAddDetail:function(){var t=this;this.$nextTick(function(){u.l({id:t.id}).then(function(e){t.goodsExchangeAddForm.product_list=e.area_stock_vo})})}}},m=o("XyMi");var g=function(t){o("yoK3")},v=Object(m.a)(_,function(){var t=this,e=t.$createElement,o=t._self._c||e;return o("div",{staticClass:"bg-in-stock"},[o("el-form",{ref:"goodsExchangeAddForm",staticClass:"change-form",attrs:{model:t.goodsExchangeAddForm,rules:t.goodsExchangeAddFormRule,"label-width":"160px",inline:""}},[o("div",{staticClass:"mx"},[o("h3",[t._v("当前库位: "+t._s(t.code))])]),t._v(" "),o("div",{staticClass:"mx"},[o("h3",[t._v("商品明细")]),t._v(" "),"detail"!==t.type&&"audit"!==t.type?o("el-button",{staticClass:"button",attrs:{size:"mini",type:"primary",disabled:"check"===t.type},on:{click:t.handleSelectWarehouseEntryBatch}},[t._v("选择")]):t._e()],1),t._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:t.goodsExchangeAddForm.product_list,border:"","cell-style":{textAlign:"center"},"header-cell-style":{textAlign:"center"}}},[o("el-table-column",{attrs:{label:"商品编号"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n "+t._s(e.row.goods_vo.sn)+"\n ")]}}])}),t._v(" "),o("el-table-column",{attrs:{label:"商品名称"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n "+t._s(e.row.goods_vo.name)+"\n ")]}}])}),t._v(" "),o("el-table-column",{attrs:{label:"条码"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n\n "+t._s(e.row.product_vo.bar_code)+"\n ")]}}])}),t._v(" "),o("el-table-column",{attrs:{label:"序列号"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n\n "+t._s(e.row.product_vo.sn_code)+"\n ")]}}])}),t._v(" "),(t.id,o("el-table-column",{attrs:{prop:"product_vo.spec_name",label:"规格型号"}})),t._v(" "),o("el-table-column",{attrs:{label:"单位"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n "+t._s(e.row.product_vo.unit)+"\n ")]}}])}),t._v(" "),o("el-table-column",{attrs:{label:"库存数量"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n "+t._s(e.row.usable_stock)+"\n ")]}}])}),t._v(" "),"detail"!==t.type&&"audit"!==t.type?o("el-table-column",{attrs:{label:"操作"},scopedSlots:t._u([{key:"default",fn:function(e){return[o("el-button",{attrs:{size:"mini",type:"danger"},on:{click:function(o){return t.goodsExchangeAddForm.product_list.splice(e.$index,1)}}},[t._v("删除")])]}}],null,!1,1006518692)}):t._e()],1)],1)],1)]),t._v(" "),o("div",{staticClass:"footer"},["audit"!==t.type&&"detail"!==t.type?o("el-button",{attrs:{type:"primary",disabled:"check"===t.type},on:{click:t.saveGoodsExchangeAddForm}},[t._v("添加\n ")]):t._e(),t._v(" "),o("el-button",{on:{click:function(e){return t.$router.back()}}},[t._v("返回")])],1),t._v(" "),o("el-dialog",{attrs:{title:"商品列表",visible:t.goodsVisible,width:"1000px"},on:{"update:visible":function(e){t.goodsVisible=e},close:t.closeGoosData}},[o("el-table",{ref:"table",staticStyle:{width:"100%"},attrs:{data:t.goodsData,border:""},on:{"selection-change":t.handleSelectionChange}},[o("el-table-column",{attrs:{type:"selection",width:"55"}}),t._v(" "),o("el-table-column",{attrs:{prop:"goods_vo.sn",label:"商品编号"}}),t._v(" "),o("el-table-column",{attrs:{prop:"product_vo.bar_code",label:"商品条码"}}),t._v(" "),o("el-table-column",{attrs:{prop:"product_vo.sn_code",label:"序列号"}}),t._v(" "),o("el-table-column",{attrs:{prop:"goods_vo.name",label:"商品名称"}}),t._v(" "),o("el-table-column",{attrs:{prop:"product_vo.spec_name",label:"规格型号"}}),t._v(" "),o("el-table-column",{attrs:{prop:"product_vo.unit",label:"单位"}}),t._v(" "),o("el-table-column",{attrs:{prop:"usable_stock",label:"库存数量"}})],1),t._v(" "),o("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[o("el-button",{on:{click:t.closeGoosData}},[t._v("取 消")]),t._v(" "),o("el-button",{attrs:{type:"primary"},on:{click:function(e){return t.submitGoosData()}}},[t._v("确 定")])],1)],1)],1)},[],!1,g,"data-v-ebc8b600",null);e.default=v.exports},FmhP:function(t,e,o){(t.exports=o("FZ+f")(!1)).push([t.i,'\n@charset "UTF-8";\n/** 底部步骤 */\n.footer[data-v-ebc8b600] {\n width: 100%;\n padding: 10px;\n bottom: 0px;\n text-align: center;\n z-index: 999;\n}\n.mx[data-v-ebc8b600] {\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-ebc8b600] {\n margin-left: 10px;\n}\n.change-form[data-v-ebc8b600] {\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-ebc8b600] {\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-ebc8b600] .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-ebc8b600] .el-date-editor,\n .change-form[data-v-ebc8b600] .el-cascader,\n .change-form[data-v-ebc8b600] .el-select {\n width: 100%;\n}\n.bg-in-stock[data-v-ebc8b600] {\n background-color: #fff;\n margin: 10px;\n padding: 25px;\n}\n.goods-info[data-v-ebc8b600] {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n}\n.goods-info .goods-name-box[data-v-ebc8b600] {\n text-align: left;\n}\n.goods-info .goods-name-box .goods-name[data-v-ebc8b600] {\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-ebc8b600] {\n color: #999999;\n}\n[data-v-ebc8b600] .el-input--suffix .el-input__inner {\n padding-right: 10px;\n}\n[data-v-ebc8b600] .error-input .el-input__inner {\n border: 1px solid red;\n}\n',""])},yoK3:function(t,e,o){var n=o("FmhP");"string"==typeof n&&(n=[[t.i,n,""]]),n.locals&&(t.exports=n.locals);o("rjj0")("21a5f54b",n,!0)}});