before change table
This commit is contained in:
parent
86996f8dd2
commit
f67930941f
@ -16,12 +16,12 @@
|
|||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item
|
<el-form-item
|
||||||
label="保养计划单号"
|
label="保养计划单号"
|
||||||
prop="code"
|
prop="maintainOrderNumber"
|
||||||
:rules="[
|
:rules="[
|
||||||
{ required: true, message: '请输入保养计划单号', trigger: 'blur' },
|
{ required: true, message: '请输入保养计划单号', trigger: 'blur' },
|
||||||
]">
|
]">
|
||||||
<el-input
|
<el-input
|
||||||
v-model="form.code"
|
v-model="form.maintainOrderNumber"
|
||||||
@change="$emit('update', form)"
|
@change="$emit('update', form)"
|
||||||
:placeholder="`请输入保养计划单号`"
|
:placeholder="`请输入保养计划单号`"
|
||||||
:disabled="disabled" />
|
:disabled="disabled" />
|
||||||
@ -102,13 +102,13 @@
|
|||||||
</el-col>
|
</el-col>
|
||||||
|
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="计划开始时间" prop="firstMaintenanceTime">
|
<el-form-item label="计划开始时间" prop="planStartTime">
|
||||||
<el-input value="---" disabled />
|
<el-input value="---" disabled />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="计划结束时间" prop="firstMaintenanceTime">
|
<el-form-item label="计划结束时间" prop="planEndTime">
|
||||||
<el-input value="---" disabled />
|
<el-input value="---" disabled />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
@ -116,12 +116,12 @@
|
|||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item
|
<el-form-item
|
||||||
label="实际开始时间"
|
label="实际开始时间"
|
||||||
prop="firstMaintenanceTime"
|
prop="startTime"
|
||||||
:rules="[
|
:rules="[
|
||||||
{ required: true, message: '请选择实际开始时间', trigger: 'blur' },
|
{ required: true, message: '请选择实际开始时间', trigger: 'blur' },
|
||||||
]">
|
]">
|
||||||
<el-date-picker
|
<el-date-picker
|
||||||
v-model="form.firstMaintenanceTime"
|
v-model="form.startTime"
|
||||||
type="datetime"
|
type="datetime"
|
||||||
:disabled="edit"
|
:disabled="edit"
|
||||||
placeholder="请选择实际开始时间"
|
placeholder="请选择实际开始时间"
|
||||||
@ -133,12 +133,12 @@
|
|||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item
|
<el-form-item
|
||||||
label="实际结束时间"
|
label="实际结束时间"
|
||||||
prop="firstMaintenanceTime"
|
prop="endTime"
|
||||||
:rules="[
|
:rules="[
|
||||||
{ required: true, message: '请选择实际结束时间', trigger: 'blur' },
|
{ required: true, message: '请选择实际结束时间', trigger: 'blur' },
|
||||||
]">
|
]">
|
||||||
<el-date-picker
|
<el-date-picker
|
||||||
v-model="form.firstMaintenanceTime"
|
v-model="form.endTime"
|
||||||
type="datetime"
|
type="datetime"
|
||||||
:disabled="edit"
|
:disabled="edit"
|
||||||
placeholder="请选择实际结束时间"
|
placeholder="请选择实际结束时间"
|
||||||
@ -150,13 +150,13 @@
|
|||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item
|
<el-form-item
|
||||||
label="实际保养人员"
|
label="实际保养人员"
|
||||||
prop="maintainer"
|
prop="maintainWorker"
|
||||||
:rules="[
|
:rules="[
|
||||||
{ required: true, message: '请选择实际保养人员', trigger: 'blur' },
|
{ required: true, message: '请选择实际保养人员', trigger: 'blur' },
|
||||||
]">
|
]">
|
||||||
<el-select
|
<el-select
|
||||||
v-model="form.maintainer"
|
v-model="form.maintainWorker"
|
||||||
:placeholder="`请选择计划保养人员`"
|
:placeholder="`请选择实际保养人员`"
|
||||||
:disabled="disabled"
|
:disabled="disabled"
|
||||||
multiple
|
multiple
|
||||||
clearable
|
clearable
|
||||||
@ -268,7 +268,7 @@ export default {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
!this.edit && this.getCode('/base/equipment-maintain-plan/getCode');
|
// !this.edit && this.getCode('/base/equipment-maintain-plan/getCode');
|
||||||
this.getList('maintainer');
|
this.getList('maintainer');
|
||||||
this.getList('department');
|
this.getList('department');
|
||||||
this.getList('line');
|
this.getList('line');
|
||||||
|
@ -120,6 +120,7 @@ export default {
|
|||||||
// 'equipmentId',
|
// 'equipmentId',
|
||||||
// 'specialType',
|
// 'specialType',
|
||||||
],
|
],
|
||||||
|
tobeConfirmedIdList: [],
|
||||||
tableBtn: [
|
tableBtn: [
|
||||||
// this.$auth.hasPermi('equipment:maintain-record:update')
|
// this.$auth.hasPermi('equipment:maintain-record:update')
|
||||||
// ? {
|
// ? {
|
||||||
@ -150,16 +151,51 @@ export default {
|
|||||||
// },
|
// },
|
||||||
{
|
{
|
||||||
type: 'selection',
|
type: 'selection',
|
||||||
prop: '_selection',
|
// prop: '_selection',
|
||||||
label: '批量选择',
|
// label: '批量选择',
|
||||||
width: 128,
|
width: 48,
|
||||||
selectable: (row, index) => {
|
|
||||||
return index % 2 == 0;
|
|
||||||
},
|
|
||||||
subcomponent: {
|
subcomponent: {
|
||||||
render: (h, { row, index }) => {
|
props: ['injectData'],
|
||||||
return <h1>hello</h1>;
|
data() {
|
||||||
// return <el-checkbox v-model={this.$refs.table.selection} />
|
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 (
|
||||||
|
<div>
|
||||||
|
<span>{this.selected}</span>
|
||||||
|
<el-checkbox disabled={!enabled} v-model={this.selected} />
|
||||||
|
</div>
|
||||||
|
);
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -397,6 +433,15 @@ export default {
|
|||||||
allSpecialEquipments: [],
|
allSpecialEquipments: [],
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
watch: {
|
||||||
|
tobeConfirmedIdList: {
|
||||||
|
handler(val) {
|
||||||
|
if (val.length == this.list.length) {
|
||||||
|
this.$refs['table'].toggleAllSelection();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
created() {
|
created() {
|
||||||
this.initSearchBar();
|
this.initSearchBar();
|
||||||
// if (this.$route.query) {
|
// if (this.$route.query) {
|
||||||
@ -426,7 +471,31 @@ export default {
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
handleSelectionChange(list) {
|
handleSelectionChange(list) {
|
||||||
console.log('handleSelectionChange', list);
|
if (this.tobeConfirmedIdList.length) {
|
||||||
|
this.tobeConfirmedIdList = [];
|
||||||
|
this.list.forEach((item) => {
|
||||||
|
this.handleEmitFun({
|
||||||
|
action: 'row-selected',
|
||||||
|
value: { row: item, selected: false },
|
||||||
|
});
|
||||||
|
});
|
||||||
|
console.log(
|
||||||
|
'清空选择列表',
|
||||||
|
this.list.map((item) => item._selection)
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
this.tobeConfirmedIdList = list.map((item) => item.id);
|
||||||
|
this.list.forEach((item) => {
|
||||||
|
this.handleEmitFun({
|
||||||
|
action: 'row-selected',
|
||||||
|
value: { row: item, selected: true },
|
||||||
|
});
|
||||||
|
});
|
||||||
|
console.log(
|
||||||
|
'全选',
|
||||||
|
this.list.map((item) => item._selection)
|
||||||
|
);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
handleEmitFun({ action, value }) {
|
handleEmitFun({ action, value }) {
|
||||||
@ -441,6 +510,18 @@ export default {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
|
case 'row-selected':
|
||||||
|
if (value.selected) {
|
||||||
|
this.tobeConfirmedIdList.push(value.row.id);
|
||||||
|
value.row._selection = 0b11;
|
||||||
|
} else {
|
||||||
|
const index = this.tobeConfirmedIdList.indexOf(value.row.id);
|
||||||
|
if (index != -1) {
|
||||||
|
this.tobeConfirmedIdList.splice(index, 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
console.log('tobeConfirmedIdList', this.tobeConfirmedIdList);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -455,16 +536,6 @@ export default {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// setSearchBarEquipmentList(eqList) {
|
|
||||||
// this.$set(
|
|
||||||
// this.searchBarFormConfig[1],
|
|
||||||
// 'selectOptions',
|
|
||||||
// eqList.map((item) => ({
|
|
||||||
// name: item.name,
|
|
||||||
// id: item.id,
|
|
||||||
// }))
|
|
||||||
// );
|
|
||||||
// },
|
|
||||||
initSearchBar() {
|
initSearchBar() {
|
||||||
// this.http('/base/core-equipment/listAll', 'get').then(({ data }) => {
|
// this.http('/base/core-equipment/listAll', 'get').then(({ data }) => {
|
||||||
// this.allSpecialEquipments = data.filter((item) => item.special);
|
// this.allSpecialEquipments = data.filter((item) => item.special);
|
||||||
@ -490,28 +561,20 @@ export default {
|
|||||||
getList() {
|
getList() {
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
// 执行查询
|
// 执行查询
|
||||||
this.recv({ ...this.queryParams, special: true, confirmed: false }).then(
|
this.recv({
|
||||||
(response) => {
|
...this.queryParams,
|
||||||
this.list =
|
special: true,
|
||||||
// [
|
relatePlan: 2,
|
||||||
// {
|
confirmed: false,
|
||||||
// id: 213,
|
}).then((response) => {
|
||||||
// maintainOrderNumber: 123,
|
this.list = response.data.list.map((item) => ({
|
||||||
// planName: 'hhh',
|
...item,
|
||||||
// departmentName: 'asdf',
|
planName: '---',
|
||||||
// lineName: 456,
|
_selection: 0b10,
|
||||||
// planStartTime: '2024-01-01',
|
}));
|
||||||
// planEndTime: '2024-01-01',
|
this.total = response.data.total;
|
||||||
// startTime: '2024-01-01',
|
this.loading = false;
|
||||||
// endTime: '2024-01-01',
|
});
|
||||||
// relatePlan: 1,
|
|
||||||
// },
|
|
||||||
// ];
|
|
||||||
response.data.list;
|
|
||||||
this.total = response.data.total;
|
|
||||||
this.loading = false;
|
|
||||||
}
|
|
||||||
);
|
|
||||||
},
|
},
|
||||||
/** 取消按钮 */
|
/** 取消按钮 */
|
||||||
cancel() {
|
cancel() {
|
||||||
@ -524,22 +587,13 @@ export default {
|
|||||||
this.form = {
|
this.form = {
|
||||||
id: null,
|
id: null,
|
||||||
relatePlan: null,
|
relatePlan: null,
|
||||||
maintainPlanId: null,
|
|
||||||
equipmentId: null,
|
|
||||||
maintainWorker: [],
|
maintainWorker: [],
|
||||||
maintainOrderNumber: null,
|
maintainOrderNumber: null,
|
||||||
|
departmentId: null,
|
||||||
|
lineId: null,
|
||||||
startTime: null,
|
startTime: null,
|
||||||
endTime: null,
|
endTime: null,
|
||||||
timeUsed: null,
|
|
||||||
remark: null,
|
remark: null,
|
||||||
maintenanceDes: null,
|
|
||||||
files: [
|
|
||||||
// {
|
|
||||||
// fileName: '',
|
|
||||||
// fileType: '',
|
|
||||||
// fileUrl: '',
|
|
||||||
// },
|
|
||||||
],
|
|
||||||
};
|
};
|
||||||
this.resetForm('form');
|
this.resetForm('form');
|
||||||
},
|
},
|
||||||
@ -556,32 +610,32 @@ export default {
|
|||||||
/** 新增按钮操作 */
|
/** 新增按钮操作 */
|
||||||
handleAdd() {
|
handleAdd() {
|
||||||
this.reset();
|
this.reset();
|
||||||
if (this.$route.query.addRecord) {
|
// if (this.$route.query.addRecord) {
|
||||||
// 赋值
|
// // 赋值
|
||||||
const tempRow = this.$route.query.row;
|
// const tempRow = this.$route.query.row;
|
||||||
this.form.equipmentId = tempRow.equipmentId;
|
// this.form.equipmentId = tempRow.equipmentId;
|
||||||
this.form.relatePlan = tempRow.nextMaintainTime ? 1 : 2;
|
// this.form.relatePlan = tempRow.nextMaintainTime ? 1 : 2;
|
||||||
this.form.startTime = tempRow.nextMaintainTime;
|
// this.form.startTime = tempRow.nextMaintainTime;
|
||||||
this.form.maintainPlanId = tempRow.id;
|
// this.form.maintainPlanId = tempRow.id;
|
||||||
// await (() => {
|
// // await (() => {
|
||||||
// return new Promise((acpt, rejt) => {
|
// // return new Promise((acpt, rejt) => {
|
||||||
// this.form.relatePlan =
|
// // this.form.relatePlan =
|
||||||
// this.$route.query.relatePlan ||
|
// // this.$route.query.relatePlan ||
|
||||||
// (tempRow.nextMaintainTime ? 1 : 2);
|
// // (tempRow.nextMaintainTime ? 1 : 2);
|
||||||
// this.form.startTime = tempRow.nextMaintainTime;
|
// // this.form.startTime = tempRow.nextMaintainTime;
|
||||||
// acpt();
|
// // acpt();
|
||||||
// });
|
// // });
|
||||||
// })();
|
// // })();
|
||||||
// this.$nextTick(() => {
|
// // this.$nextTick(() => {
|
||||||
// this.form.maintainPlanId = tempRow.id;
|
// // this.form.maintainPlanId = tempRow.id;
|
||||||
// this.form.equipmentId = tempRow.equipmentId;
|
// // this.form.equipmentId = tempRow.equipmentId;
|
||||||
// });
|
// // });
|
||||||
}
|
// }
|
||||||
if (this.$route.query.isAdd) {
|
// if (this.$route.query.isAdd) {
|
||||||
// 赋值
|
// // 赋值
|
||||||
this.form.equipmentId = this.$route.query.equipmentId;
|
// this.form.equipmentId = this.$route.query.equipmentId;
|
||||||
this.form.maintainPlanId = this.$route.query.maintainPlanId;
|
// this.form.maintainPlanId = this.$route.query.maintainPlanId;
|
||||||
}
|
// }
|
||||||
this.open = true;
|
this.open = true;
|
||||||
this.title = '添加待确认保养记录';
|
this.title = '添加待确认保养记录';
|
||||||
},
|
},
|
||||||
@ -607,6 +661,8 @@ export default {
|
|||||||
this.put({
|
this.put({
|
||||||
...this.form,
|
...this.form,
|
||||||
maintainWorker: this.form.maintainWorker.join(','),
|
maintainWorker: this.form.maintainWorker.join(','),
|
||||||
|
special: true,
|
||||||
|
relatePlan: 2,
|
||||||
}).then((response) => {
|
}).then((response) => {
|
||||||
this.$modal.msgSuccess('修改成功');
|
this.$modal.msgSuccess('修改成功');
|
||||||
this.open = false;
|
this.open = false;
|
||||||
@ -618,24 +674,27 @@ export default {
|
|||||||
this.post({
|
this.post({
|
||||||
...this.form,
|
...this.form,
|
||||||
maintainWorker: this.form.maintainWorker.join(','),
|
maintainWorker: this.form.maintainWorker.join(','),
|
||||||
|
special: true,
|
||||||
|
relatePlan: 2,
|
||||||
}).then((response) => {
|
}).then((response) => {
|
||||||
this.$modal.msgSuccess('新增成功');
|
this.$modal.msgSuccess('新增成功');
|
||||||
|
|
||||||
// 跳转至 备品备件 保养
|
// 跳转至 备品备件 保养
|
||||||
const toSparePartsMaintain = () => {
|
// const toSparePartsMaintain = () => {
|
||||||
this.open = false;
|
// this.open = false;
|
||||||
// 没有备品备件保养模块。。。
|
// };
|
||||||
};
|
|
||||||
|
|
||||||
this.$confirm('是否有备品备件更换?', '提示', {
|
// this.$confirm('是否有备品备件更换?', '提示', {
|
||||||
confirmButtonText: '有',
|
// confirmButtonText: '有',
|
||||||
cancelButtonText: '没有',
|
// cancelButtonText: '没有',
|
||||||
})
|
// })
|
||||||
.then(toSparePartsMaintain)
|
// .then(toSparePartsMaintain)
|
||||||
.catch(() => {
|
// .catch(() => {
|
||||||
this.open = false;
|
// this.open = false;
|
||||||
this.getList();
|
// this.getList();
|
||||||
});
|
// });
|
||||||
|
this.open = false;
|
||||||
|
this.getList();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user