更新bug

This commit is contained in:
2024-11-18 10:44:51 +08:00
parent 8f1e5212e3
commit df530abb90
8 changed files with 145 additions and 134 deletions

View File

@@ -42,9 +42,7 @@
import AddOrUpdate from './add-or-updata';
import moment from 'moment';
import basicPageMixin from '@/mixins/lb/basicPageMixin';
import {
exportCheckOrderExcel,
} from '@/api/equipment/base/maintain/record';
import { exportCheckOrderExcel } from '@/api/equipment/base/maintain/record';
import WaitingListTable from './WaitingListTable.vue';
// const timeFilter = (val) => moment(val).format('yyyy-MM-DD HH:mm:ss');
@@ -76,16 +74,14 @@ export default {
name: 'Confirm',
components: {
WaitingListTable,
AddOrUpdate
AddOrUpdate,
},
mixins: [basicPageMixin],
data() {
return {
addOrUpdateVisible: false,
recordDetailVisible: false,
searchBarKeys: [
'name'
],
searchBarKeys: ['name'],
tobeConfirmedIdList: [],
searchBarFormConfig: [
{
@@ -100,46 +96,51 @@ export default {
name: 'search',
color: 'primary',
},
{
type: (this.$auth.hasPermiAnd([
'equipment:check-record:create',
'base:core-worker:query',
'base:core-production-line:query',
'base:core-department:query'
]) || this.$auth.hasPermi('equipment:check-record:update') || this.$auth.hasPermi('equipment:check-record:export')) ? 'separate' : '',
},
{
type: this.$auth.hasPermiAnd([
'equipment:check-record:create',
'base:core-worker:query',
'base:core-production-line:query',
'base:core-department:query'
])
? 'button'
: '',
btnName: '新增',
name: 'add',
plain: true,
color: 'success',
},
{
type: this.$auth.hasPermi('equipment:check-record:update')
type:
this.$auth.hasPermiAnd([
'equipment:check-record:create',
'base:core-worker:query',
'base:core-production-line:query',
'base:core-department:query',
]) ||
this.$auth.hasPermi('equipment:check-record:update') ||
this.$auth.hasPermi('equipment:check-record:export')
? 'separate'
: '',
},
{
type: this.$auth.hasPermiAnd([
'equipment:check-record:create',
'base:core-worker:query',
'base:core-production-line:query',
'base:core-department:query',
])
? 'button'
: '',
btnName: '新增',
name: 'add',
plain: true,
color: 'success',
},
{
type: this.$auth.hasPermi('equipment:check-record:update')
? 'button'
: '',
btnName: '巡检人批量确认',
name: 'batchConfirm',
color: 'primary',
plain: true,
},
{
type: this.$auth.hasPermi('equipment:check-record:update')
? 'button'
: '',
btnName: '确认人批量确认',
name: 'batchConfirm2',
color: 'primary',
plain: true,
},
},
{
type: this.$auth.hasPermi('equipment:check-record:update')
? 'button'
: '',
btnName: '确认人批量确认',
name: 'batchConfirm2',
color: 'primary',
plain: true,
},
// {
// type: this.$auth.hasPermi('equipment:check-record:export')
// ? 'button'
@@ -211,11 +212,14 @@ export default {
// }
return this.$axios({
// url: `/base/equipment-check-order/confirm?confirmPerson=${this.$store.getters.nickname}` + checkPersonParam,
url: `/base/equipment-check-order/confirm?confirmPerson=${this.$store.getters.nickname}`,
url: `/base/equipment-check-order/confirm`,
method: 'put',
data: this.$refs['waiting-list-table'].selectedPlan.map(
(item) => item.id
),
data: {
ids: this.$refs['waiting-list-table'].selectedPlan.map(
(item) => item.id
),
confirmBy: this.$store.getters.nickname,
},
});
})
.then((res) => {
@@ -223,35 +227,38 @@ export default {
res.code == 0 && this.$modal.msgSuccess('确认成功');
res.code != 0 && this.$modal.msgError('确认失败');
})
.catch(() => { });
case 'batchConfirm2':
if (this.$refs['waiting-list-table'].selectedPlan.length == 0) {
this.$message.warning('请选择待确认的设备巡检单');
return;
}
this.$modal
.confirm('是否确认所有选中巡检单"?')
.then(() => {
// let checkPersonParam = '';
// if (!row.checkPerson || row.checkPerson.trim() == '') {
// /** 如有必要,更新巡检人 */
// checkPersonParam = `&checkPerson=${this.$store.getters.nickname}`;
// }
return this.$axios({
// url: `/base/equipment-check-order/confirm?confirmPerson=${this.$store.getters.nickname}` + checkPersonParam,
url: `/base/equipment-check-order/confirm2?confirmPerson=${this.$store.getters.nickname}`,
method: 'put',
data: this.$refs['waiting-list-table'].selectedPlan.map(
(item) => item.id
),
});
})
.then((res) => {
this.getList();
res.code == 0 && this.$modal.msgSuccess('确认成功');
res.code != 0 && this.$modal.msgError('确认失败');
})
.catch(() => { });
.catch(() => {});
case 'batchConfirm2':
if (this.$refs['waiting-list-table'].selectedPlan.length == 0) {
this.$message.warning('请选择待确认的设备巡检单');
return;
}
this.$modal
.confirm('是否确认所有选中巡检单"?')
.then(() => {
// let checkPersonParam = '';
// if (!row.checkPerson || row.checkPerson.trim() == '') {
// /** 如有必要,更新巡检人 */
// checkPersonParam = `&checkPerson=${this.$store.getters.nickname}`;
// }
return this.$axios({
// url: `/base/equipment-check-order/confirm?confirmPerson=${this.$store.getters.nickname}` + checkPersonParam,
url: `/base/equipment-check-order/confirm2`,
method: 'put',
data: {
ids: this.$refs['waiting-list-table'].selectedPlan.map(
(item) => item.id
),
confirmBy: this.$store.getters.nickname,
},
});
})
.then((res) => {
this.getList();
res.code == 0 && this.$modal.msgSuccess('确认成功');
res.code != 0 && this.$modal.msgError('确认失败');
})
.catch(() => {});
break;
}
},
@@ -311,7 +318,7 @@ export default {
},
handleSearchBarChange({ param, value }) {
console.log('122', param)
console.log('122', param);
// if ('specialType' === param) {
// if (!value) {
// this.setSearchBarEquipmentList(this.allSpecialEquipments);
@@ -327,7 +334,7 @@ export default {
this.loading = true;
// 执行查询
this.recv({
...this.queryParams
...this.queryParams,
}).then((response) => {
this.list = response.data.list;
this.total = response.data.total;
@@ -376,18 +383,18 @@ export default {
// this.title = '添加待确认保养记录';
// this.addOrEditTitle = '新增';
this.addOrUpdateVisible = true;
this.$nextTick(() => {
this.$refs.addOrUpdate.init();
});
this.$nextTick(() => {
this.$refs.addOrUpdate.init();
});
},
// 新增 / 修改
// addOrUpdateHandle(id) {
// this.addOrUpdateVisible = true;
// this.$nextTick(() => {
// this.$refs.addOrUpdate.init(id);
// });
// },
// addOrUpdateHandle(id) {
// this.addOrUpdateVisible = true;
// this.$nextTick(() => {
// this.$refs.addOrUpdate.init(id);
// });
// },
getConfirmed() {
return this.$confirm('是否直接确认巡检记录', '提示', {
@@ -462,10 +469,12 @@ export default {
// checkPersonParam = `&checkPerson=${row.checkPerson}`
// }
return this.$axios({
url:
`/base/equipment-check-order/confirm?confirmPerson=${this.$store.getters.nickname}`,
url: `/base/equipment-check-order/confirm`,
method: 'put',
data: [row.id],
data: {
ids: [row.id],
confirmBy: this.$store.getters.nickname,
},
});
})
.then((res) => {
@@ -478,9 +487,9 @@ export default {
/** 编辑 */
async handleEdit(row) {
this.addOrUpdateVisible = true;
this.$nextTick(() => {
this.$refs.addOrUpdate.init(row.id);
});
this.$nextTick(() => {
this.$refs.addOrUpdate.init(row.id);
});
// this.reset();
// if (row.relatePlan == 1) {
// // 计划型
@@ -501,9 +510,7 @@ export default {
/** 删除按钮操作 */
handleDelete(row) {
this.$modal
.confirm(
'是否确认删除巡检单名称为"' + row.name + '"的数据项?'
)
.confirm('是否确认删除巡检单名称为"' + row.name + '"的数据项?')
.then(() => {
return this.$axios({
url: '/base/equipment-check-order/delete?id=' + row.id,
@@ -518,9 +525,9 @@ export default {
},
handleDetail(row) {
this.addOrUpdateVisible = true;
this.$nextTick(() => {
this.$refs.addOrUpdate.init(row.id, true);
});
this.$nextTick(() => {
this.$refs.addOrUpdate.init(row.id, true);
});
// this.recordDetailVisible = true;
// this.$nextTick(() => {
// this.$refs.recordDetailDrawer.show({