diff --git a/src/views/mes/wm/barcode/index.vue b/src/views/mes/wm/barcode/index.vue index 5786a9b..d4a2ad8 100644 --- a/src/views/mes/wm/barcode/index.vue +++ b/src/views/mes/wm/barcode/index.vue @@ -201,6 +201,27 @@ + + + + + + + + + + + @@ -234,6 +255,7 @@ + @@ -250,6 +272,8 @@ + + @@ -294,6 +318,7 @@ import PackageSelectSingle from "@/components/package/single.vue"; import WorkstationSelect from "@/components/workstationSelect/simpletableSingle.vue" import Barcodeconfig from "./config.vue" import BarcodeBatchPrint from "./batchprint.vue" +import {getTreeList} from "@/api/mes/wm/warehouse" export default { name: "Barcode", dicts: ['mes_barcode_type','mes_barcode_formart','sys_yes_no'], @@ -302,6 +327,13 @@ export default { }, data() { return { + warehouseInfo:[], + warehouseOptions:[], + warehouseProps:{ + multiple: false, + value: 'pId', + label: 'pName', + }, optType: null, // 遮罩层 loading: true, @@ -352,6 +384,7 @@ export default { }, created() { this.getList(); + this.getWarehouseList(); }, methods: { /** 查询条码清单列表 */ @@ -485,6 +518,40 @@ export default { this.form.barcodeContent= "".concat(this.form.barcodeType,'-',this.form.bussinessCode); } }, + //选择仓库、库区、库位 + getWarehouseList(){ + getTreeList().then( response =>{ + if(response.data){ + this.warehouseOptions = response.data.filter((el) =>{ + return el.warehouseCode.indexOf('VIR') == -1; + });; + } + this.warehouseOptions.map(w =>{ + debugger; + w.children.map(l =>{ + let lstr =JSON.stringify(l.children).replace(/locationId/g,'lId').replace(/areaId/g, 'pId').replace(/areaName/g,'pName'); + l.children = JSON.parse(lstr); + }); + + let wstr = JSON.stringify(w.children).replace(/warehouseId/g,'wId').replace(/locationId/g, 'pId').replace(/locationName/g,'pName'); + w.children = JSON.parse(wstr); + + }); + let ostr=JSON.stringify(this.warehouseOptions).replace(/warehouseId/g,'pId').replace(/warehouseName/g, 'pName'); + this.warehouseOptions = JSON.parse(ostr); + debugger; + }); + }, + handleWarehouseChanged(obj){ + debugger; + const checkedNode = this.$refs['warehouseRef'].getCheckedNodes(); + if(obj !=null){ + this.form.bussinessId = checkedNode[0].data.pId; + this.form.bussinessCode = checkedNode[0].data.areaCode; + this.form.bussinessName = checkedNode[0].data.pName; + this.form.barcodeContent = "".concat(this.form.barcodeType,'-',this.form.bussinessCode); + } + }, //装箱单选择 handleSelectPackage(){ this.$refs.packageSelect.showFlag=true;