1 |
- webpackJsonp([46],{CShc:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n("Xxa5"),a=n.n(o),s=n("exGp"),i=n.n(s),r=n("Dd8w"),c=n.n(r),d=n("NYxO"),l=(n("jQQ7"),n("dO7o")),u=n("G+dR"),p=n("hky6"),h=n("dClm"),_=n("CIZm"),f=n("Pfph"),m={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:c()({},Object(d.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.v({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;f.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 n=t.MixinClone(t.goodsExchangeAddForm),o=[];if(!t.goodsExchangeAddForm.product_list.length)return void t.$message.error("请选择商品!");t.goodsExchangeAddForm.product_list.map(function(t){return o.push(t.id)}),n.stock_id_list=o,u.c(t.warehouse_id,t.id,n).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(n){t.activeList=n.area_stock_vo,e.records.map(function(e){n.area_stock_vo.map(function(n){e.id===n.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 n,o;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:n=e.sent,t.$set(t.goodsExchangeAddForm,"distribution_name",n[0].distribution_name),o=n.map(function(t){return t.sn}),t.$set(t.goodsExchangeAddForm,"order_sn",o.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 n;return a.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,_.a({order_sn:t.goodsExchangeAddForm.order_sn});case 2:n=e.sent,t.goodsExchangeAddForm.return_list=n.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})})}}},g=n("XyMi");var b=function(t){n("aiT9")},v=Object(g.a)(m,function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"bg-in-stock"},[n("el-form",{ref:"goodsExchangeAddForm",staticClass:"change-form",attrs:{model:t.goodsExchangeAddForm,rules:t.goodsExchangeAddFormRule,"label-width":"160px",inline:""}},[n("div",{staticClass:"mx"},[n("h3",[t._v("当前库位: "+t._s(t.code))])]),t._v(" "),n("div",{staticClass:"mx"},[n("h3",[t._v("商品明细")]),t._v(" "),"detail"!==t.type&&"audit"!==t.type?n("el-button",{staticClass:"button",attrs:{size:"mini",type:"primary",disabled:"check"===t.type},on:{click:t.handleSelectWarehouseEntryBatch}},[t._v("选择")]):t._e()],1),t._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:t.goodsExchangeAddForm.product_list,border:"","cell-style":{textAlign:"center"},"header-cell-style":{textAlign:"center"}}},[n("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(" "),n("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(" "),n("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(" "),n("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?n("el-table-column",{attrs:{label:"规格型号"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n "+t._s(e.row.product_vo.spec_name.join("/"))+"\n ")]}}],null,!1,3386992641)}):n("el-table-column",{attrs:{label:"规格型号"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n "+t._s(e.row.product_vo.spec_name.join("/"))+"\n ")]}}])}),t._v(" "),n("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(" "),n("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?n("el-table-column",{attrs:{label:"操作"},scopedSlots:t._u([{key:"default",fn:function(e){return[n("el-button",{attrs:{size:"mini",type:"danger"},on:{click:function(n){return t.goodsExchangeAddForm.product_list.splice(e.$index,1)}}},[t._v("删除")])]}}],null,!1,1006518692)}):t._e()],1)],1)],1)]),t._v(" "),n("div",{staticClass:"footer"},["audit"!==t.type&&"detail"!==t.type?n("el-button",{attrs:{type:"primary",disabled:"check"===t.type},on:{click:t.saveGoodsExchangeAddForm}},[t._v("添加\n ")]):t._e(),t._v(" "),n("el-button",{on:{click:function(e){return t.$router.back()}}},[t._v("返回")])],1),t._v(" "),n("el-dialog",{attrs:{title:"商品列表",visible:t.goodsVisible,width:"1000px"},on:{"update:visible":function(e){t.goodsVisible=e},close:t.closeGoosData}},[n("el-table",{ref:"table",staticStyle:{width:"100%"},attrs:{data:t.goodsData,border:""},on:{"selection-change":t.handleSelectionChange}},[n("el-table-column",{attrs:{type:"selection",width:"55"}}),t._v(" "),n("el-table-column",{attrs:{prop:"goods_vo.sn",label:"商品编号"}}),t._v(" "),n("el-table-column",{attrs:{prop:"product_vo.bar_code",label:"商品条码"}}),t._v(" "),n("el-table-column",{attrs:{prop:"product_vo.sn_code",label:"序列号"}}),t._v(" "),n("el-table-column",{attrs:{prop:"goods_vo.name",label:"商品名称"}}),t._v(" "),n("el-table-column",{attrs:{prop:"",label:"规格型号"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n "+t._s(e.row.product_vo.spec_name.join("/"))+"\n ")]}}])}),t._v(" "),n("el-table-column",{attrs:{prop:"product_vo.unit",label:"单位"}}),t._v(" "),n("el-table-column",{attrs:{prop:"usable_stock",label:"库存数量"}})],1),t._v(" "),n("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[n("el-button",{on:{click:t.closeGoosData}},[t._v("取 消")]),t._v(" "),n("el-button",{attrs:{type:"primary"},on:{click:function(e){return t.submitGoosData()}}},[t._v("确 定")])],1)],1)],1)},[],!1,b,"data-v-1cc97281",null);e.default=v.exports},FP3E:function(t,e,n){(t.exports=n("FZ+f")(!1)).push([t.i,'\n@charset "UTF-8";\n/** 底部步骤 */\n.footer[data-v-1cc97281] {\n width: 100%;\n padding: 10px;\n bottom: 0px;\n text-align: center;\n z-index: 999;\n}\n.mx[data-v-1cc97281] {\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-1cc97281] {\n margin-left: 10px;\n}\n.change-form[data-v-1cc97281] {\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-1cc97281] {\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-1cc97281] .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-1cc97281] .el-date-editor,\n .change-form[data-v-1cc97281] .el-cascader,\n .change-form[data-v-1cc97281] .el-select {\n width: 100%;\n}\n.bg-in-stock[data-v-1cc97281] {\n background-color: #fff;\n margin: 10px;\n padding: 25px;\n}\n.goods-info[data-v-1cc97281] {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n}\n.goods-info .goods-name-box[data-v-1cc97281] {\n text-align: left;\n}\n.goods-info .goods-name-box .goods-name[data-v-1cc97281] {\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-1cc97281] {\n color: #999999;\n}\n[data-v-1cc97281] .el-input--suffix .el-input__inner {\n padding-right: 10px;\n}\n[data-v-1cc97281] .error-input .el-input__inner {\n border: 1px solid red;\n}\n',""])},aiT9:function(t,e,n){var o=n("FP3E");"string"==typeof o&&(o=[[t.i,o,""]]),o.locals&&(t.exports=o.locals);n("rjj0")("468eb915",o,!0)}});
|