diff --git a/src/views/specialEquipment/maintain/WaitingList.vue b/src/views/specialEquipment/maintain/WaitingList.vue index 817e2cc4..0ddc57c8 100644 --- a/src/views/specialEquipment/maintain/WaitingList.vue +++ b/src/views/specialEquipment/maintain/WaitingList.vue @@ -34,7 +34,11 @@ ref="waiting-list-table" :table-data="list" :page="queryParams.pageNo" - :limit="queryParams.pageSize" /> + :limit="queryParams.pageSize" + @edit="handleEdit" + @detail="handleDetail" + @delete="handleDelete" + @confirm="handleConfirm" /> { - this.outside = false; - }); - }, - }, - }, - render(h) { - const enabled = 0b10 & this.injectData._selection; - // return this.injectData?._selection ? h('h1', null, 'hello') : h('h1', null, '1'); - return ( -
- {this.selected} - -
- ); - }, - }, - }, - { - prop: 'maintainOrderNumber', - label: '设备保养单号', - width: 110, - showOverflowtooltip: true, - }, - { - prop: 'planName', - label: '保养计划名称', - width: 110, - showOverflowtooltip: true, - }, - { - prop: 'departmentName', - label: '部门', - width: 110, - showOverflowtooltip: true, - }, - { - prop: 'lineName', - label: '产线名', - width: 110, - showOverflowtooltip: true, - }, - { - prop: 'planStartTime', - label: '计划开始时间', - filter: timeFilter, - minWidth: 150, - showOverflowtooltip: true, - }, - { - prop: 'planEndTime', - label: '计划结束时间', - filter: timeFilter, - minWidth: 150, - showOverflowtooltip: true, - }, - { - prop: 'startTime', - label: '实际开始时间', - filter: timeFilter, - minWidth: 150, - showOverflowtooltip: true, - }, - { - prop: 'endTime', - label: '实际结束时间', - filter: timeFilter, - minWidth: 150, - showOverflowtooltip: true, - }, - { - prop: 'confirmDueTime', - label: '确认截止时间', - filter: timeFilter, - minWidth: 150, - showOverflowtooltip: true, - }, - { - prop: 'relatePlan', - label: '保养计划类型', - minWidth: 150, - showOverflowtooltip: true, - filter: (val) => - val != null ? ['-', '计划型', '非计划型'][val] : '-', - }, - { - prop: '_detail', - label: '详情', - name: '详情', - minWidth: 60, - subcomponent: btn, - }, - // { - // prop: 'equipmentCategory', - // label: '设备大类', - // minWidth: 100, - // showOverflowtooltip: true, - // filter: (val) => - // val != null ? ['-', '安全设备', '消防设备', '特种设备'][val] : '-', - // }, - // { - // prop: 'equipmentName', - // label: '设备名称', - // minWidth: 100, - // showOverflowtooltip: true, - // }, - // { - // prop: 'maintainWorker', - // label: '保养人员', - // minWidth: 100, - // showOverflowtooltip: true, - // }, - // { - // prop: 'relatePlan', - // label: '是否计划保养', - // width: 120, - // filter: (v) => (v != null ? ['', '是', '否'][v] : ''), - // }, - // { - // prop: 'planName', - // label: '保养计划名称', - // minWidth: 120, - // showOverflowtooltip: true, - // }, - // { - // prop: 'maintainDuration', - // label: '计划保养用时(h)', - // minWidth: 130, - // showOverflowtooltip: true, - // }, - // { prop: 'timeUsed', label: '实际保养用时(h)', minWidth: 130 }, - // { - // prop: 'remark', - // label: '备注', - // minWidth: 100, - // showOverflowtooltip: true, - // }, - ], + // tableBtn: [ + // // this.$auth.hasPermi('equipment:maintain-record:update') + // // ? { + // // type: 'detail', + // // btnName: '详情', + // // } + // // : undefined, + // { + // type: 'confirm', + // btnName: '确认', + // }, + // { + // type: 'edit', + // btnName: '编辑', + // }, + // { + // type: 'delete', + // btnName: '删除', + // }, + // ], + // tableProps: [ + // // { + // // prop: 'createTime', + // // label: '添加时间', + // // fixed: true, + // // width: 150, + // // filter: timeFilter, + // // }, + // { + // type: 'selection', + // // prop: '_selection', + // // label: '批量选择', + // width: 48, + // subcomponent: { + // props: ['injectData'], + // data() { + // return { + // outside: false, + // selected: false, + // }; + // }, + // watch: { + // selected(val) { + // if (!this.outside) { + // console.log('emit row-selected...'); + // this.$emit('emitData', { + // action: 'row-selected', + // value: { + // row: this.injectData, + // selected: val, + // }, + // }); + // } + // }, + // injectData: { + // deep: true, + // immediate: true, + // handler: function (val) { + // this.outside = true; + // this.selected = !!((val._selection & 0b01) != 0); + // this.$nextTick(() => { + // this.outside = false; + // }); + // }, + // }, + // }, + // render(h) { + // const enabled = 0b10 & this.injectData._selection; + // // return this.injectData?._selection ? h('h1', null, 'hello') : h('h1', null, '1'); + // return ( + //
+ // {this.selected} + // + //
+ // ); + // }, + // }, + // }, + // { + // prop: 'maintainOrderNumber', + // label: '设备保养单号', + // width: 110, + // showOverflowtooltip: true, + // }, + // { + // prop: 'planName', + // label: '保养计划名称', + // width: 110, + // showOverflowtooltip: true, + // }, + // { + // prop: 'departmentName', + // label: '部门', + // width: 110, + // showOverflowtooltip: true, + // }, + // { + // prop: 'lineName', + // label: '产线名', + // width: 110, + // showOverflowtooltip: true, + // }, + // { + // prop: 'planStartTime', + // label: '计划开始时间', + // filter: timeFilter, + // minWidth: 150, + // showOverflowtooltip: true, + // }, + // { + // prop: 'planEndTime', + // label: '计划结束时间', + // filter: timeFilter, + // minWidth: 150, + // showOverflowtooltip: true, + // }, + // { + // prop: 'startTime', + // label: '实际开始时间', + // filter: timeFilter, + // minWidth: 150, + // showOverflowtooltip: true, + // }, + // { + // prop: 'endTime', + // label: '实际结束时间', + // filter: timeFilter, + // minWidth: 150, + // showOverflowtooltip: true, + // }, + // { + // prop: 'confirmDueTime', + // label: '确认截止时间', + // filter: timeFilter, + // minWidth: 150, + // showOverflowtooltip: true, + // }, + // { + // prop: 'relatePlan', + // label: '保养计划类型', + // minWidth: 150, + // showOverflowtooltip: true, + // filter: (val) => + // val != null ? ['-', '计划型', '非计划型'][val] : '-', + // }, + // { + // prop: '_detail', + // label: '详情', + // name: '详情', + // minWidth: 60, + // subcomponent: btn, + // }, + // // { + // // prop: 'equipmentCategory', + // // label: '设备大类', + // // minWidth: 100, + // // showOverflowtooltip: true, + // // filter: (val) => + // // val != null ? ['-', '安全设备', '消防设备', '特种设备'][val] : '-', + // // }, + // // { + // // prop: 'equipmentName', + // // label: '设备名称', + // // minWidth: 100, + // // showOverflowtooltip: true, + // // }, + // // { + // // prop: 'maintainWorker', + // // label: '保养人员', + // // minWidth: 100, + // // showOverflowtooltip: true, + // // }, + // // { + // // prop: 'relatePlan', + // // label: '是否计划保养', + // // width: 120, + // // filter: (v) => (v != null ? ['', '是', '否'][v] : ''), + // // }, + // // { + // // prop: 'planName', + // // label: '保养计划名称', + // // minWidth: 120, + // // showOverflowtooltip: true, + // // }, + // // { + // // prop: 'maintainDuration', + // // label: '计划保养用时(h)', + // // minWidth: 130, + // // showOverflowtooltip: true, + // // }, + // // { prop: 'timeUsed', label: '实际保养用时(h)', minWidth: 130 }, + // // { + // // prop: 'remark', + // // label: '备注', + // // minWidth: 100, + // // showOverflowtooltip: true, + // // }, + // ], searchBarFormConfig: [ // { // type: 'select', @@ -437,6 +441,8 @@ export default { basePath: '/base/equipment-maintain-log', mode: null, allSpecialEquipments: [], + openPlannedDialog: false, + openUnplannedDialog: false, }; }, watch: { @@ -481,12 +487,8 @@ export default { switch (btn.btnName) { case 'batchConfirm': if (this.$refs['waiting-list-table'].selectedPlan.length == 0) { - console.log( - 'selectedPlan', - this.$refs['waiting-list-table'].selectedPlan - ); - alert('no data...'); - }; + this.$message.warning('请选择待确认的设备保养记录'); + } console.log( 'selectedPlan', this.$refs['waiting-list-table'].selectedPlan @@ -617,7 +619,11 @@ export default { lineId: null, startTime: null, endTime: null, + planStartTime: null, + planEndTime: null, + confirmed: null, remark: null, + special: false, }; this.resetForm('form'); }, @@ -664,15 +670,21 @@ export default { this.title = '添加待确认保养记录'; }, /** 修改按钮操作 */ - handleUpdate(row) { + async handleUpdate(row) { this.reset(); - const id = row.id; - this.info({ id }).then((response) => { - this.form = response.data; - this.open = true; - this.form.maintainWorker = this.form.maintainWorker.split(','); - this.title = '修改保养记录'; - }); + if (row.relatePlan == 1) { + // 计划型 + const res = await this.info(); + this.form = res.data; + this.form.maintainWorker = res.data.maintainWorker.split(','); + this.openPlannedDialog = true; + } else { + // 非计划型 2 + const res = await this.info(); + this.form = res.data; + this.form.maintainWorker = res.data.maintainWorker.split(','); + this.openUnplannedDialog = true; + } }, /** 提交按钮 */ submitForm() { @@ -722,13 +734,25 @@ export default { }); }); }, + /** 确认 */ + handleConfirm(row) { + console.log('confirm', row); + }, + /** 编辑 */ + handleEdit(row) { + console.log('edit', row); + }, /** 删除按钮操作 */ handleDelete(row) { + console.log('delete', row); + return; const id = row.id; this.$modal - .confirm('是否确认删除设备名称为"' + row.equipmentName + '"的数据项?') + .confirm( + '是否确认删除设备保养单号为"' + row.maintainOrderNumber + '"的数据项?' + ) .then(function () { - return deleteEqMaintainLog(id); + // return deleteEqMaintainLog(id); }) .then(() => { this.getList(); @@ -736,13 +760,15 @@ export default { }) .catch(() => {}); }, - handleDetail({ id }) { + handleDetail(row) { + console.log('detail', row); + return; this.reset(); this.mode = 'detail'; this.info({ id }).then((response) => { this.form = response.data; - this.open = true; - this.title = '查看保养记录详情'; + // this.open = true; + // this.title = '查看保养记录详情'; }); }, /** 导出按钮操作 */ diff --git a/src/views/specialEquipment/maintain/WaitingListTable.vue b/src/views/specialEquipment/maintain/WaitingListTable.vue index 97c3b065..52262a61 100644 --- a/src/views/specialEquipment/maintain/WaitingListTable.vue +++ b/src/views/specialEquipment/maintain/WaitingListTable.vue @@ -16,13 +16,16 @@ color: '#606266', }" class="waiting-list-table"> - +