| | |
| | | type="dashed" |
| | | icon="plus" |
| | | @click="addMaterial" |
| | | :disabled="mainId.status=='4'" |
| | | :disabled="mainId.status=='4' || mainId.status=='2'" |
| | | >添加实际用料</a-button> |
| | | <div :style="{width: '100%',border: '1px solid #e9e9e9',padding: '10px 16px',background: '#fff',}"> |
| | | <a-row :style="{textAlign:'right'}"> |
| | |
| | | import pick from 'lodash.pick' |
| | | import JEllipsis from '@/components/jeecg/JEllipsis' |
| | | import JSelectSparePartModal from './select/JSelectSparePartModal' |
| | | import RepairOrderActualMaterialReportModel from './RepairOrderActualMaterialReportModel.vue' |
| | | import RepairOrderActualMaterialReportModel from './RepairOrderActualMaterialReportModel.vue' |
| | | export default { |
| | | name: 'RepairOrderActualMaterialReport', |
| | | mixins: [JeecgListMixin], |
| | |
| | | loading: false, |
| | | dataSource: [], |
| | | columns: [ |
| | | { |
| | | title: '#', |
| | | dataIndex: '', |
| | | key: 'rowIndex', |
| | | width: 60, |
| | | align: "center", |
| | | customRender: function (t, r, index) { |
| | | return parseInt(index) + 1; |
| | | } |
| | | }, |
| | | { |
| | | title: '领料出库单', |
| | | dataIndex: 'num', |
| | |
| | | } |
| | | } |
| | | }, |
| | | 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 = [] |
| | | |
| | | }) |
| | | }) |
| | | }, |