| | |
| | | </a-row> |
| | | <!-- :disabled="false" --> |
| | | </div> |
| | | <actual-material-select |
| | | ref="actualMaterialSelect" |
| | | @sendMaterialRecord="sendMaterialRecord" |
| | | > |
| | | <actual-material-select ref="actualMaterialSelect"> |
| | | <!-- @sendMaterialRecord="sendMaterialRecord" --> |
| | | </actual-material-select> |
| | | <j-select-spare-part-modal ref='JSelectSparePartModal'></j-select-spare-part-modal> |
| | | </a-card> |
| | |
| | | equipmentId: { |
| | | type: String, |
| | | required: false, |
| | | default: '' |
| | | default: '-1' |
| | | }, |
| | | }, |
| | | data() { |
| | |
| | | immediate: true, |
| | | handler(val) { |
| | | this.clearList(); |
| | | this.queryParam['maintenanceOrderId'] = val |
| | | this.queryParam['equipmentId'] = this.equipmentId |
| | | // this.queryParam['maintenanceOrderId'] = val |
| | | // this.queryParam['equipmentId'] = this.equipmentId |
| | | this.loadData(1); |
| | | } |
| | | }, |
| | | equipmentId: { |
| | | immediate: true, |
| | | handler(val) { |
| | | this.clearList(); |
| | | this.queryParam['maintenanceOrderId'] = this.dailyMaintenanceOrderId |
| | | this.queryParam['equipmentId'] = val |
| | | this.loadData(1); |
| | | } |
| | | } |
| | | // equipmentId: { |
| | | // immediate: true, |
| | | // handler(val) { |
| | | // this.clearList(); |
| | | // this.queryParam['maintenanceOrderId'] = this.dailyMaintenanceOrderId |
| | | // this.queryParam['equipmentId'] = val |
| | | // this.loadData(1); |
| | | // } |
| | | // } |
| | | }, |
| | | created() { |
| | | this.queryParam['maintenanceOrderId'] = this.dailyMaintenanceOrderId; |
| | | this.queryParam['equipmentId'] = this.equipmentId |
| | | this.loadData(1); |
| | | }, |
| | | // created() { |
| | | // this.queryParam['maintenanceOrderId'] = this.dailyMaintenanceOrderId; |
| | | // this.queryParam['equipmentId'] = this.equipmentId |
| | | // this.loadData(1); |
| | | // }, |
| | | methods: { |
| | | addMaterial() { |
| | | let ids = []; |
| | |
| | | this.$refs.actualMaterialSelect.list() |
| | | this.$refs.actualMaterialSelect.title = '物料选择' |
| | | }, |
| | | sendMaterialRecord(data, val) { |
| | | let record = data.record |
| | | const temp = [...this.dataSource] |
| | | const target = temp[this.recordIndex] |
| | | if (target) { |
| | | target.materialId = record.id; |
| | | target.materialName = record.name; |
| | | target.materialNum = record.num; |
| | | target.materialModel = record.model; |
| | | target.materialSpecification = record.specification; |
| | | target.unitId_dictText = record.unitId_dictText; |
| | | this.dataSource = temp |
| | | } |
| | | }, |
| | | |
| | | // sendMaterialRecord(data, val) { |
| | | // let record = data.record |
| | | // const temp = [...this.dataSource] |
| | | // const target = temp[this.recordIndex] |
| | | // if (target) { |
| | | // target.materialId = record.id; |
| | | // target.materialName = record.name; |
| | | // target.materialNum = record.num; |
| | | // target.materialModel = record.model; |
| | | // target.materialSpecification = record.specification; |
| | | // target.unitId_dictText = record.unitId_dictText; |
| | | // this.dataSource = temp |
| | | // } |
| | | // }, |
| | | clearList() { |
| | | 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.quantity == null || record.quantity == undefined || record.quantity == '') { |
| | |
| | | }) |
| | | }, |
| | | }, |
| | | |
| | | mounted() { |
| | | let newActualMaterials = []; |
| | | this.$bus.$on('selectionRows', (data) => { |
| | | this.$bus.$on('selection2Rows', (data) => { |
| | | for (let i = 0; i < data.length; i++) { |
| | | var actualMaterial |
| | | = |
| | | { |
| | | id: this.getUuiD(16), |
| | | num: data[i].num, |
| | | 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, |
| | | specification: data[i].specification, |
| | | model: 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, |
| | | // specification: data[i].specification, |
| | | // model: 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, |
| | | maintenanceOrderId: this.dailyMaintenanceOrderId, |
| | | equipmentId: this.equipmentId, |
| | | isLock: 'no' |
| | | } |
| | | newActualMaterials.push(actualMaterial); |
| | | }) |
| | | } |
| | | debugger |
| | | let that = this |
| | | let obj = obj = postAction(this.url.addInit, newActualMaterials) |
| | | obj.then((res) => { |
| | | // newActualMaterials = this.dataSource |
| | | postAction(this.url.addInit, newActualMaterials).then((res) => { |
| | | if (res.success) { |
| | | that.$message.success(res.message) |
| | | |
| | | that.$emit('ok') |
| | | } else { |
| | | that.$message.warning(res.message) |
| | | } |
| | | }).finally(res => { |
| | | that.loadData(); |
| | | newActualMaterials = [] |
| | | that.loadData(1); |
| | | |
| | | }) |
| | | }) |
| | | }, |
| | |
| | | this.$message.warn("请选择备件"); |
| | | return false; |
| | | } |
| | | this.$bus.$emit('selectionRows', this.selectionRows) |
| | | this.$bus.$emit('selection2Rows', this.selectionRows) |
| | | this.close() |
| | | }, |
| | | onSelectChange(selectionRows) { |
| | |
| | | align: "center", |
| | | dataIndex: 'maintenanceSpecialtyName', |
| | | }, |
| | | { |
| | | title: '维修保养角色', |
| | | align: "center", |
| | | dataIndex: 'maintenanceRoleName', |
| | | }, |
| | | |
| | | ], |
| | | url: { |
| | |
| | | @change="(e)=>handleChange(e, record.key, col, index)" |
| | | > |
| | | </j-image-upload> |
| | | <j-dict-select-tag |
| | | v-if="col.dataIndex == 'maintenanceRole'" |
| | | :value="text" |
| | | allow-clear |
| | | :triggerChange="true" |
| | | dictCode="maintenance_role" |
| | | placeholder="请选择保养角色" |
| | | style="width: 100%" |
| | | @change="(e)=>handleChange(e, record.key, col, index)" |
| | | /> |
| | | </div> |
| | | </template> |
| | | |
| | |
| | | align: 'center', |
| | | dataIndex: 'maintenanceCycleId', |
| | | scopedSlots: { customRender: 'maintenanceCycleId' }, |
| | | width: 150, |
| | | }, |
| | | { |
| | | title: '保养角色', |
| | | align: 'center', |
| | | dataIndex: 'maintenanceRole', |
| | | scopedSlots: { customRender: 'maintenanceRole' }, |
| | | width: 150, |
| | | }, |
| | | { |
| | |
| | | if (column.dataIndex == 'location') { |
| | | target[column.dataIndex] = value.target.value; |
| | | } |
| | | if (column.dataIndex == 'maintenanceRole') { |
| | | target[column.dataIndex] = value; |
| | | } |
| | | //显示带过来的数据 |
| | | that.dataSource = temp; |
| | | } |
| | |
| | | } |
| | | } |
| | | }, |
| | | 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 = [] |
| | | |
| | | }) |
| | | }) |
| | | }, |
| | |
| | | this.$message.warn("请选择备件"); |
| | | return false; |
| | | } |
| | | this.$bus.$emit('selectionRows', this.selectionRows) |
| | | this.$bus.$emit('selection3Rows', this.selectionRows) |
| | | this.close() |
| | | }, |
| | | onSelectChange(selectionRows) { |
| | |
| | | </a-row> |
| | | <!-- :disabled="false" --> |
| | | </div> |
| | | <actual-material-select |
| | | ref="actualMaterialSelect" |
| | | @sendMaterialRecord="sendMaterialRecord" |
| | | > |
| | | <actual-material-select ref="actualMaterialSelect"> |
| | | <!-- @sendMaterialRecord="sendMaterialRecord" --> |
| | | </actual-material-select> |
| | | <j-select-spare-part-modal ref='JSelectSparePartModal'></j-select-spare-part-modal> |
| | | </a-card> |
| | |
| | | immediate: true, |
| | | handler(val) { |
| | | this.clearList(); |
| | | this.queryParam['maintenanceOrderId'] = val |
| | | this.queryParam['equipmentId'] = this.equipmentId |
| | | // this.queryParam['maintenanceOrderId'] = val |
| | | // this.queryParam['equipmentId'] = this.equipmentId |
| | | this.loadData(1); |
| | | } |
| | | }, |
| | | equipmentId: { |
| | | immediate: true, |
| | | handler(val) { |
| | | this.clearList(); |
| | | this.queryParam['maintenanceOrderId'] = this.specialyMaintenanceOrderIdmaintenanceOrderId |
| | | this.queryParam['equipmentId'] = val |
| | | this.loadData(1); |
| | | } |
| | | } |
| | | // equipmentId: { |
| | | // immediate: true, |
| | | // handler(val) { |
| | | // this.clearList(); |
| | | // this.queryParam['maintenanceOrderId'] = this.specialyMaintenanceOrderIdmaintenanceOrderId |
| | | // this.queryParam['equipmentId'] = val |
| | | // this.loadData(1); |
| | | // } |
| | | // } |
| | | }, |
| | | created() { |
| | | this.queryParam['maintenanceOrderId'] = this.specialyMaintenanceOrderId; |
| | | this.queryParam['equipmentId'] = this.equipmentId |
| | | this.loadData(1); |
| | | }, |
| | | // created() { |
| | | // this.queryParam['maintenanceOrderId'] = this.specialyMaintenanceOrderId; |
| | | // this.queryParam['equipmentId'] = this.equipmentId |
| | | // this.loadData(1); |
| | | // }, |
| | | methods: { |
| | | addMaterial() { |
| | | let ids = []; |
| | |
| | | this.$refs.actualMaterialSelect.list() |
| | | this.$refs.actualMaterialSelect.title = '物料选择' |
| | | }, |
| | | sendMaterialRecord(data, val) { |
| | | let record = data.record |
| | | const temp = [...this.dataSource] |
| | | const target = temp[this.recordIndex] |
| | | if (target) { |
| | | target.materialId = record.id; |
| | | target.materialName = record.name; |
| | | target.materialNum = record.num; |
| | | target.materialModel = record.model; |
| | | target.materialSpecification = record.specification; |
| | | target.unitId_dictText = record.unitId_dictText; |
| | | this.dataSource = temp |
| | | } |
| | | }, |
| | | // sendMaterialRecord(data, val) { |
| | | // let record = data.record |
| | | // const temp = [...this.dataSource] |
| | | // const target = temp[this.recordIndex] |
| | | // if (target) { |
| | | // target.materialId = record.id; |
| | | // target.materialName = record.name; |
| | | // target.materialNum = record.num; |
| | | // target.materialModel = record.model; |
| | | // target.materialSpecification = record.specification; |
| | | // target.unitId_dictText = record.unitId_dictText; |
| | | // this.dataSource = temp |
| | | // } |
| | | // }, |
| | | clearList() { |
| | | 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.quantity == null || record.quantity == undefined || record.quantity == '') { |
| | |
| | | let newActualMaterials = []; |
| | | this.$bus.$on('selectionRows', (data) => { |
| | | for (let i = 0; i < data.length; i++) { |
| | | var actualMaterial |
| | | = |
| | | { |
| | | id: this.getUuiD(16), |
| | | num: data[i].num, |
| | | 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, |
| | | specification: data[i].specification, |
| | | model: 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, |
| | | // specification: data[i].specification, |
| | | // model: 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, |
| | | maintenanceOrderId: this.specialyMaintenanceOrderId, |
| | | 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) |
| | | |
| | | that.$emit('ok') |
| | | } else { |
| | | that.$message.warning(res.message) |
| | | } |
| | | }).finally(res => { |
| | | that.loadData(); |
| | | newActualMaterials = [] |
| | | that.loadData(); |
| | | |
| | | }) |
| | | }) |
| | | }, |