1 |
- webpackJsonp([11],{RRIQ:function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=o("Xxa5"),i=o.n(n),a=o("exGp"),s=o.n(a),r=o("Dd8w"),d=o.n(r),l=o("NYxO"),c=(o("jQQ7"),o("dO7o")),u=(o("G+dR"),o("hky6")),p=o("dClm"),m=o("CIZm"),f=o("Pfph"),_=o("UVPs"),h={name:"goodsExchangeAdd",data:function(){return{typeList:[],adminList:[],dialogVisible:!1,warehouseList:[],deptList:[],deptListAll:[],orderList:[],params:{pages:1,size:10},id:"",type:"",productListAddForm:{item_do_list:[],type:"",hire_or_sail:""},productListAddFormRule:{name:[this.MixinRequired("请填写组合名称","blur")],hire_or_sail:[this.MixinRequired("请选择商品类型","change")]},warehouseProduct:null,scanDialogVisible:!1,scanGoodsForm:{},sttorageType:"",goodsVisible:!1,goodsData:[],goodsList:[],item_do_list:[],code:"",warehouse_id:"",activeList:[],isDetail:void 0}},mounted:function(){this.id=this.$route.params.id,this.type=this.$route.params.type,"check"===this.type&&(this.isDetail=!0,this.GET_goodsExchangeAddDetail()),this.GET_WarehouseList(),this.GET_DeptList(),this.outType()},watch:{$route:{immediate:!0,handler:function(t){"productClassEdit"===t.name&&this.GET_goodsExchangeAddDetail()}}},computed:d()({},Object(l.b)(["user"])),methods:{selhire_or_sail:function(){this.productListAddForm.item_do_list=[]},submitGoosData:function(){this.goodsList.length>=1?(this.productListAddForm.item_do_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;u.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(){c.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;p.G().then(function(t){e.warehouseList=t})},saveproductListAddForm:function(){var t=this;this.$refs.productListAddForm.validate(function(e){if(e){var o=t.productListAddForm.id,n=t.MixinClone(t.productListAddForm);if(!t.productListAddForm.item_do_list.length)return void t.$message.error("请选择商品!");n.item_do_list.map(function(t){t.product_id=t.id,t.id=""}),o?_.a(o,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:"productClass"})}):_.f(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:"productClass"})})}})},reverseSelect:function(t){this.$refs.table.toggleRowSelection(t)},handleSelectWarehouseEntryBatch:function(){var t=this;return s()(i.a.mark(function e(){return i.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:""!==t.productListAddForm.hire_or_sail?(t.params.hire_or_sail=t.productListAddForm.hire_or_sail,_.c(t.params).then(function(e){t.goodsData=e.data,t.goodsVisible=!0,console.log(e)})):t.$message.error("请先选择商品组合类型");case 1:case"end":return e.stop()}},e,t)}))()},handleSelectOrderSn:function(){var t=this;return s()(i.a.mark(function e(){var o,n;return i.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.$EnPickerOrder({orderApi:"admin/erp/order",selectedIds:[t.productListAddForm.order_sn],limit:1});case 2:o=e.sent,t.$set(t.productListAddForm,"distribution_name",o[0].distribution_name),n=o.map(function(t){return t.sn}),t.$set(t.productListAddForm,"order_sn",n.join(",")),t.GET_WarehouseOutProduct();case 7:case"end":return e.stop()}},e,t)}))()},GET_WarehouseOutProduct:function(){var t=this;return s()(i.a.mark(function e(){var o;return i.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,m.a({order_sn:t.productListAddForm.order_sn});case 2:o=e.sent,t.productListAddForm.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;c.i().then(function(e){t.deptListAll=e,t.deptListAll.password=""})},handleChangeWareHouse:function(t){},GET_goodsExchangeAddDetail:function(){var t=this;this.$nextTick(function(){_.b(t.id).then(function(e){e.item_do_list.map(function(t){t.bar_code=t.product_vo.bar_code,t.spec_name=t.product_vo.spec_name,t.unit=t.product_vo.unit}),t.productListAddForm=e})})}}},b=o("XyMi");var v=function(t){o("pg3U")},g=Object(b.a)(h,function(){var t=this,e=t.$createElement,o=t._self._c||e;return o("div",{staticClass:"bg-in-stock"},[o("el-form",{ref:"productListAddForm",staticClass:"change-form",attrs:{model:t.productListAddForm,rules:t.productListAddFormRule,disabled:t.isDetail,"label-width":"160px",inline:""}},[o("div",{staticClass:"mx"},[o("el-form-item",{staticClass:"change-form-item",attrs:{label:"组合类型",prop:"hire_or_sail"}},[o("el-select",{attrs:{clearable:""},on:{change:t.selhire_or_sail},model:{value:t.productListAddForm.hire_or_sail,callback:function(e){t.$set(t.productListAddForm,"hire_or_sail",e)},expression:"productListAddForm.hire_or_sail"}},[o("el-option",{attrs:{label:"售卖商品",value:"sail"}}),t._v(" "),o("el-option",{attrs:{label:"出租商品",value:"hire"}})],1)],1),t._v(" "),o("el-form-item",{staticClass:"change-form-item",attrs:{label:"组合名称",prop:"name"}},[o("el-input",{attrs:{placeholder:"请输入"},model:{value:t.productListAddForm.name,callback:function(e){t.$set(t.productListAddForm,"name",e)},expression:"productListAddForm.name"}})],1),t._v(" "),o("el-form-item",{staticClass:"change-form-item",staticStyle:{width:"61%"},attrs:{label:"备注",prop:"remark"}},[o("el-input",{staticStyle:{flex:"1"},attrs:{type:"textarea",disabled:"detail"===t.type||"audit"===t.type,autosize:{minRows:3,maxRows:4},placeholder:"请输入"},model:{value:t.productListAddForm.remark,callback:function(e){t.$set(t.productListAddForm,"remark",e)},expression:"productListAddForm.remark"}})],1)],1),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.productListAddForm.item_do_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:"SKU"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n "+t._s(e.row.sku)+"\n ")]}}])}),t._v(" "),o("el-table-column",{attrs:{prop:"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.unit)+"\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.productListAddForm.item_do_list.splice(e.$index,1)}}},[t._v("删除")])]}}],null,!1,729741996)}):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.saveproductListAddForm}},[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:"sku",label:"sku"}}),t._v(" "),o("el-table-column",{attrs:{prop:"goods_vo.name",label:"商品名称"}}),t._v(" "),o("el-table-column",{attrs:{prop:"spec_name",label:"规格型号"}}),t._v(" "),o("el-table-column",{attrs:{prop:"unit",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,v,"data-v-9f43c9e8",null);e.default=g.exports},hk57:function(t,e,o){(t.exports=o("FZ+f")(!1)).push([t.i,'\n@charset "UTF-8";\n/** 底部步骤 */\n.footer[data-v-9f43c9e8] {\n width: 100%;\n padding: 10px;\n bottom: 0px;\n text-align: center;\n z-index: 999;\n}\n.mx[data-v-9f43c9e8] {\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-9f43c9e8] {\n margin-left: 10px;\n}\n.change-form[data-v-9f43c9e8] {\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-9f43c9e8] {\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-9f43c9e8] .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-9f43c9e8] .el-date-editor,\n .change-form[data-v-9f43c9e8] .el-cascader,\n .change-form[data-v-9f43c9e8] .el-select {\n width: 100%;\n}\n.bg-in-stock[data-v-9f43c9e8] {\n background-color: #fff;\n margin: 10px;\n padding: 25px;\n}\n.goods-info[data-v-9f43c9e8] {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n}\n.goods-info .goods-name-box[data-v-9f43c9e8] {\n text-align: left;\n}\n.goods-info .goods-name-box .goods-name[data-v-9f43c9e8] {\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-9f43c9e8] {\n color: #999999;\n}\n[data-v-9f43c9e8] .el-input--suffix .el-input__inner {\n padding-right: 10px;\n}\n[data-v-9f43c9e8] .error-input .el-input__inner {\n border: 1px solid red;\n}\n',""])},pg3U:function(t,e,o){var n=o("hk57");"string"==typeof n&&(n=[[t.i,n,""]]),n.locals&&(t.exports=n.locals);o("rjj0")("08dc3233",n,!0)}});
|