| | |
| | | } |
| | | } |
| | | }, |
| | | created() { |
| | | // this.queryParam['maintenanceOrderId'] = this.dailyMaintenanceOrderId; |
| | | // this.queryParam['equipmentId'] = this.equipmentId |
| | | // this.loadData(1); |
| | | console.log("77777777", this.mainId) |
| | | }, |
| | | // created() { |
| | | // this.queryParam['maintenanceOrderId'] = this.dailyMaintenanceOrderId; |
| | | // this.queryParam['equipmentId'] = this.equipmentId |
| | | // this.loadData(1); |
| | | // console.log("77777777", this.mainId) |
| | | // }, |
| | | methods: { |
| | | addMaterial() { |
| | | let ids = []; |
| | |
| | | this.dataSource = []; |
| | | this.ipagination.current = 1 |
| | | }, |
| | | getUuiD(randomLength) { |
| | | return Number( |
| | | Math.random() |
| | | .toString() |
| | | .substr(2, randomLength) + Date.now() |
| | | ).toString(36) |
| | | }, |
| | | // getUuiD(randomLength) { |
| | | // return Number( |
| | | // Math.random() |
| | | // .toString() |
| | | // .substr(2, randomLength) + Date.now() |
| | | // ).toString(36) |
| | | // }, |
| | | handleLock(record) { |
| | | let that = this; |
| | | if (record.actualQuantity == null || record.actualQuantity == undefined || record.actualQuantity == '') { |
| | |
| | | }, |
| | | mounted() { |
| | | let newActualMaterials = []; |
| | | this.$bus.$on('selectionRows', (data) => { |
| | | this.$bus.$on('selection3Rows', (data) => { |
| | | for (let i = 0; i < data.length; i++) { |
| | | var actualMaterial |
| | | = |
| | | { |
| | | id: this.getUuiD(16), |
| | | newActualMaterials.push({ |
| | | // id: this.getUuiD(16), |
| | | num: data[i].num, |
| | | outboundOrderDetailId: data[i].id, |
| | | sparePartId: data[i].sparePartId, |
| | | sparePartNum: data[i].spareNum, |
| | | sparePartName: data[i].spareName, |
| | | sparePartSpecification: data[i].specification, |
| | | sparePartModel: data[i].model, |
| | | constructorName: data[i].constructorName, |
| | | constructorId: data[i].constructorId, |
| | | mainUnitName: data[i].mainUnitName, |
| | | mainUnitId: data[i].mainUnitId, |
| | | // sparePartNum: data[i].spareNum, |
| | | // sparePartName: data[i].spareName, |
| | | // sparePartSpecification: data[i].specification, |
| | | // sparePartModel: data[i].model, |
| | | // constructorName: data[i].constructorName, |
| | | // constructorId: data[i].constructorId, |
| | | // mainUnitName: data[i].mainUnitName, |
| | | // mainUnitId: data[i].mainUnitId, |
| | | mainQuantity: data[i].mainQuantity, |
| | | useQuantity: data[i].useQuantity, |
| | | availableQuantity: data[i].availableQuantity, |
| | | repairOrderId: this.mainId.id, |
| | | equipmentId: this.equipmentId, |
| | | isLock: 'no' |
| | | } |
| | | newActualMaterials.push(actualMaterial); |
| | | }) |
| | | } |
| | | let that = this |
| | | let obj = obj = postAction(this.url.addInit, newActualMaterials) |
| | | obj.then((res) => { |
| | | postAction(this.url.addInit, newActualMaterials).then((res) => { |
| | | if (res.success) { |
| | | that.$message.success(res.message) |
| | | |
| | | newActualMaterials = [] |
| | | that.$emit('ok') |
| | | } else { |
| | | that.$message.warning(res.message) |
| | | } |
| | | }).finally(res => { |
| | | that.loadData(); |
| | | newActualMaterials = [] |
| | | |
| | | }) |
| | | }) |
| | | }, |