Compare commits
4 Commits
564a4a42d2
...
eb0445f479
Author | SHA1 | Date | |
---|---|---|---|
eb0445f479 | |||
9f8d604456 | |||
d5551eabb8 | |||
8ca1ef5624 |
@ -360,8 +360,9 @@ export default {
|
|||||||
promiseList.push(async () => {
|
promiseList.push(async () => {
|
||||||
const response = await this.$axios(opt.url, {
|
const response = await this.$axios(opt.url, {
|
||||||
method: opt.method ?? 'get',
|
method: opt.method ?? 'get',
|
||||||
|
// data: opt.method == 'post' ? opt.queryParams : null
|
||||||
});
|
});
|
||||||
console.log('[dialogForm:handleOptions:response]', response);
|
// console.log('[dialogForm:handleOptions:response]', response);
|
||||||
if (opt.select) {
|
if (opt.select) {
|
||||||
// 处理下拉框选项
|
// 处理下拉框选项
|
||||||
const list =
|
const list =
|
||||||
|
@ -27,7 +27,7 @@
|
|||||||
<div class="drawer-body flex">
|
<div class="drawer-body flex">
|
||||||
<div class="drawer-body__content">
|
<div class="drawer-body__content">
|
||||||
<section>
|
<section>
|
||||||
<SmallTitle>保养信息</SmallTitle>
|
<!-- <SmallTitle>保养信息</SmallTitle> -->
|
||||||
<div class="form-part" style="margin-bottom: 32px">
|
<div class="form-part" style="margin-bottom: 32px">
|
||||||
<el-skeleton v-if="!showForm" animated />
|
<el-skeleton v-if="!showForm" animated />
|
||||||
<el-form
|
<el-form
|
||||||
@ -56,14 +56,6 @@
|
|||||||
<section>
|
<section>
|
||||||
<SmallTitle>保养详情</SmallTitle>
|
<SmallTitle>保养详情</SmallTitle>
|
||||||
<div style="margin-top: 12px; position: relative">
|
<div style="margin-top: 12px; position: relative">
|
||||||
<!-- <div
|
|
||||||
v-if="!mode.includes('detail')"
|
|
||||||
style="position: absolute; top: -40px; right: 0">
|
|
||||||
<el-button @click="handleAddDetail" type="text">
|
|
||||||
<i class="el-icon-plus"></i>
|
|
||||||
添加详情
|
|
||||||
</el-button>
|
|
||||||
</div> -->
|
|
||||||
<base-table
|
<base-table
|
||||||
v-loading="detailLoading"
|
v-loading="detailLoading"
|
||||||
:table-props="detailTableProps"
|
:table-props="detailTableProps"
|
||||||
@ -210,7 +202,8 @@ export default {
|
|||||||
detailTableProps: [
|
detailTableProps: [
|
||||||
{ prop: 'equipmentName', label: '设备名称' },
|
{ prop: 'equipmentName', label: '设备名称' },
|
||||||
{ prop: 'program', label: '保养项目' },
|
{ prop: 'program', label: '保养项目' },
|
||||||
{ prop: 'remark', label: '备注' },
|
{ prop: 'maintenanceDes', label: '保养描述' },
|
||||||
|
// { prop: 'remark', label: '备注' },
|
||||||
],
|
],
|
||||||
detailTableQuery: {
|
detailTableQuery: {
|
||||||
pageNo: 1,
|
pageNo: 1,
|
||||||
@ -306,18 +299,29 @@ export default {
|
|||||||
},
|
},
|
||||||
async refreshDetailList() {
|
async refreshDetailList() {
|
||||||
this.detailLoading = true;
|
this.detailLoading = true;
|
||||||
if (!this.form.id)
|
if (!this.form.id) {
|
||||||
return this.$message.info('没有找到保养计划相关信息...');
|
this.$message.info('没有找到保养计划相关信息...');
|
||||||
const res = await this.$axios('/base/equipment-maintain-plan-det/page', {
|
this.detailLoading = false;
|
||||||
params: {
|
}
|
||||||
pageNo: this.detailTableQuery.pageNo,
|
|
||||||
pageSize: this.detailTableQuery.pageSize,
|
try {
|
||||||
planId: this.form.id,
|
const res = await this.$axios(
|
||||||
},
|
'/base/equipment-maintain-log-det/page',
|
||||||
});
|
{
|
||||||
this.detailList = res.data?.list || [];
|
params: {
|
||||||
this.detailTotal = res.data?.total || 0;
|
pageNo: this.detailTableQuery.pageNo,
|
||||||
this.detailLoading = false;
|
pageSize: this.detailTableQuery.pageSize,
|
||||||
|
// planId: this.form.id,
|
||||||
|
logId: this.form.id,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
);
|
||||||
|
this.detailList = res.data?.list || [];
|
||||||
|
this.detailTotal = res.data?.total || 0;
|
||||||
|
this.detailLoading = false;
|
||||||
|
} catch (err) {
|
||||||
|
this.detailLoading = false;
|
||||||
|
}
|
||||||
},
|
},
|
||||||
//
|
//
|
||||||
handleDetailTableAction() {},
|
handleDetailTableAction() {},
|
||||||
|
@ -157,6 +157,7 @@ export default {
|
|||||||
label: '保养计划名称',
|
label: '保养计划名称',
|
||||||
width: 110,
|
width: 110,
|
||||||
showOverflowtooltip: true,
|
showOverflowtooltip: true,
|
||||||
|
filter: (val) => (val != null ? val : '---'),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'departmentName',
|
prop: 'departmentName',
|
||||||
@ -514,30 +515,7 @@ export default {
|
|||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.initSearchBar();
|
this.initSearchBar();
|
||||||
// if (this.$route.query) {
|
|
||||||
// this.queryParams.specialType =
|
|
||||||
// this.$route.query?.specialType ?? undefined;
|
|
||||||
// this.queryParams.equipmentId =
|
|
||||||
// this.$route.query?.equipmentId ?? undefined;
|
|
||||||
// this.queryParams.maintainPlanId =
|
|
||||||
// this.$route.query?.maintainPlanId ?? undefined;
|
|
||||||
// this.queryParams.relatePlan = this.$route.query?.relatePlan ?? undefined;
|
|
||||||
// this.queryParams.startTime = this.$route.query?.createTime ?? undefined;
|
|
||||||
// this.searchBarFormConfig[0].defaultSelect =
|
|
||||||
// this.$route.query.specialType ?? undefined;
|
|
||||||
// this.searchBarFormConfig[1].defaultSelect =
|
|
||||||
// this.$route.query.equipmentId ?? undefined;
|
|
||||||
// this.searchBarFormConfig[2].defaultSelect =
|
|
||||||
// this.$route.query.maintainPlanId ?? undefined;
|
|
||||||
// this.searchBarFormConfig[3].defaultSelect =
|
|
||||||
// this.$route.query?.createTime ?? undefined;
|
|
||||||
// this.searchBarFormConfig[4].defaultSelect =
|
|
||||||
// Number(this.$route.query.relatePlan) ?? undefined;
|
|
||||||
// }
|
|
||||||
this.getList();
|
this.getList();
|
||||||
// if (this.$route.query.addRecord) {
|
|
||||||
// this.handleAdd();
|
|
||||||
// }
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
handleEmitFun({ action, value }) {
|
handleEmitFun({ action, value }) {
|
||||||
@ -566,21 +544,7 @@ 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.allSpecialEquipments = data.filter((item) => item.special);
|
|
||||||
// this.setSearchBarEquipmentList(data.filter((item) => item.special));
|
|
||||||
// });
|
|
||||||
this.http('/base/equipment-maintain-plan/page', 'get', {
|
this.http('/base/equipment-maintain-plan/page', 'get', {
|
||||||
pageNo: 1,
|
pageNo: 1,
|
||||||
pageSize: 100,
|
pageSize: 100,
|
||||||
@ -588,7 +552,6 @@ export default {
|
|||||||
}).then(({ data }) => {
|
}).then(({ data }) => {
|
||||||
this.$set(
|
this.$set(
|
||||||
this.searchBarFormConfig[0],
|
this.searchBarFormConfig[0],
|
||||||
// this.searchBarFormConfig[2],
|
|
||||||
'selectOptions',
|
'selectOptions',
|
||||||
(data?.list || []).map((item) => ({
|
(data?.list || []).map((item) => ({
|
||||||
name: item.name,
|
name: item.name,
|
||||||
@ -602,20 +565,7 @@ export default {
|
|||||||
this.loading = true;
|
this.loading = true;
|
||||||
// 执行查询
|
// 执行查询
|
||||||
this.recv({ ...this.queryParams, special: true }).then((response) => {
|
this.recv({ ...this.queryParams, special: true }).then((response) => {
|
||||||
this.list = [
|
this.list = response.data.list;
|
||||||
{
|
|
||||||
id: 213,
|
|
||||||
maintainOrderNumber: 123,
|
|
||||||
planName: 'hhh',
|
|
||||||
departmentName: 'asdf',
|
|
||||||
lineName: 456,
|
|
||||||
planStartTime: '2024-01-01',
|
|
||||||
planEndTime: '2024-01-01',
|
|
||||||
startTime: '2024-01-01',
|
|
||||||
endTime: '2024-01-01',
|
|
||||||
relatePlan: 1,
|
|
||||||
},
|
|
||||||
]; // response.data.list;
|
|
||||||
this.total = response.data.total;
|
this.total = response.data.total;
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
});
|
});
|
||||||
@ -670,19 +620,6 @@ export default {
|
|||||||
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 (() => {
|
|
||||||
// return new Promise((acpt, rejt) => {
|
|
||||||
// this.form.relatePlan =
|
|
||||||
// this.$route.query.relatePlan ||
|
|
||||||
// (tempRow.nextMaintainTime ? 1 : 2);
|
|
||||||
// this.form.startTime = tempRow.nextMaintainTime;
|
|
||||||
// acpt();
|
|
||||||
// });
|
|
||||||
// })();
|
|
||||||
// this.$nextTick(() => {
|
|
||||||
// this.form.maintainPlanId = tempRow.id;
|
|
||||||
// this.form.equipmentId = tempRow.equipmentId;
|
|
||||||
// });
|
|
||||||
}
|
}
|
||||||
if (this.$route.query.isAdd) {
|
if (this.$route.query.isAdd) {
|
||||||
// 赋值
|
// 赋值
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
v-loading="formLoading">
|
v-loading="formLoading">
|
||||||
<el-row :gutter="20">
|
<el-row :gutter="20">
|
||||||
<!-- 维修单号 -->
|
<!-- 维修单号 -->
|
||||||
<el-col :span="12">
|
<el-col :span="8">
|
||||||
<el-form-item
|
<el-form-item
|
||||||
label="维修单号"
|
label="维修单号"
|
||||||
prop="repairOrderNumber"
|
prop="repairOrderNumber"
|
||||||
@ -28,39 +28,37 @@
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
|
||||||
<!-- 维修工 -->
|
<!-- 产线名 -->
|
||||||
<el-col :span="12">
|
<el-col :span="8">
|
||||||
<el-form-item
|
<el-form-item label="产线名" prop="lineId">
|
||||||
label="维修工"
|
|
||||||
prop="repairman"
|
|
||||||
:rules="[
|
|
||||||
{ required: true, message: '维修工不能为空', trigger: 'blur' },
|
|
||||||
]">
|
|
||||||
<el-input
|
|
||||||
v-model="form.repairman"
|
|
||||||
@change="$emit('update', form)"
|
|
||||||
placeholder="请输入维修工"
|
|
||||||
:disabled="disabled" />
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
|
|
||||||
<!-- 设备大类 -->
|
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item
|
|
||||||
label="设备大类"
|
|
||||||
prop="equipmentCategory"
|
|
||||||
:rules="[
|
|
||||||
{ required: true, message: '设备大类不能为空', trigger: 'blur' },
|
|
||||||
]">
|
|
||||||
<el-select
|
<el-select
|
||||||
v-model="form.equipmentCategory"
|
v-model="formFilters.lineId"
|
||||||
:placeholder="`请选择设备大类`"
|
:placeholder="`请选择产线`"
|
||||||
:disabled="disabled"
|
:disabled="disabled"
|
||||||
clearable
|
clearable
|
||||||
filterable
|
filterable
|
||||||
@change="handleEqTypeChange">
|
@change="handleEqTypeChange">
|
||||||
<el-option
|
<el-option
|
||||||
v-for="opt in equipmentTypeOptions"
|
v-for="opt in lineOptions"
|
||||||
|
:key="opt.value"
|
||||||
|
:label="opt.label"
|
||||||
|
:value="opt.value" />
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
<!-- 工段名 -->
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="工段名" prop="sectionId">
|
||||||
|
<el-select
|
||||||
|
v-model="formFilters.sectionId"
|
||||||
|
:placeholder="`请选择工段`"
|
||||||
|
:disabled="disabled"
|
||||||
|
clearable
|
||||||
|
filterable
|
||||||
|
@change="handleEqTypeChange">
|
||||||
|
<el-option
|
||||||
|
v-for="opt in sectionOptions"
|
||||||
:key="opt.value"
|
:key="opt.value"
|
||||||
:label="opt.label"
|
:label="opt.label"
|
||||||
:value="opt.value" />
|
:value="opt.value" />
|
||||||
@ -69,7 +67,7 @@
|
|||||||
</el-col>
|
</el-col>
|
||||||
|
|
||||||
<!-- 设备名称 -->
|
<!-- 设备名称 -->
|
||||||
<el-col :span="12">
|
<el-col :span="8">
|
||||||
<el-form-item
|
<el-form-item
|
||||||
label="设备名称"
|
label="设备名称"
|
||||||
prop="equipmentId"
|
prop="equipmentId"
|
||||||
@ -93,7 +91,7 @@
|
|||||||
</el-col>
|
</el-col>
|
||||||
|
|
||||||
<!-- 故障发生时间 -->
|
<!-- 故障发生时间 -->
|
||||||
<el-col :span="12">
|
<el-col :span="8">
|
||||||
<el-form-item
|
<el-form-item
|
||||||
label="故障发生时间"
|
label="故障发生时间"
|
||||||
prop="faultTime"
|
prop="faultTime"
|
||||||
@ -117,7 +115,7 @@
|
|||||||
</el-col>
|
</el-col>
|
||||||
|
|
||||||
<!-- 故障级别 -->
|
<!-- 故障级别 -->
|
||||||
<el-col :span="12">
|
<el-col :span="8">
|
||||||
<el-form-item
|
<el-form-item
|
||||||
label="故障级别"
|
label="故障级别"
|
||||||
prop="faultLevel"
|
prop="faultLevel"
|
||||||
@ -142,8 +140,98 @@
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
|
||||||
|
<!-- 故障类型 - 数据字典 -->
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item
|
||||||
|
label="故障类型"
|
||||||
|
prop="faultType"
|
||||||
|
:rules="[
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
message: '故障类型不能为空',
|
||||||
|
trigger: 'blur',
|
||||||
|
},
|
||||||
|
]">
|
||||||
|
<el-select
|
||||||
|
v-model="form.faultType"
|
||||||
|
placeholder="故障类型"
|
||||||
|
:disabled="disabled"
|
||||||
|
@change="$emit('update', form)">
|
||||||
|
<el-option
|
||||||
|
v-for="opt in getDictDatas(DICT_TYPE.FAULT_LEVEL)"
|
||||||
|
:key="opt.value"
|
||||||
|
:label="opt.label"
|
||||||
|
:value="opt.value" />
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
<!-- 维修开始时间 -->
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item
|
||||||
|
label="维修开始时间"
|
||||||
|
prop="maintenanceStartTime"
|
||||||
|
:rules="[
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
message: '维修开始时间不能为空',
|
||||||
|
trigger: 'blur',
|
||||||
|
},
|
||||||
|
]">
|
||||||
|
<el-date-picker
|
||||||
|
v-model="form.maintenanceStartTime"
|
||||||
|
type="datetime"
|
||||||
|
:disabled="disabled"
|
||||||
|
:placeholder="`请选择维修开始时间`"
|
||||||
|
value-format="timestamp"
|
||||||
|
format="yyyy-MM-dd HH:mm:ss"
|
||||||
|
clearable
|
||||||
|
@change="$emit('update', form)" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
<!-- 维修结束时间 -->
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item
|
||||||
|
label="维修结束时间"
|
||||||
|
prop="maintenanceFinishTime"
|
||||||
|
:rules="[
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
message: '维修结束时间不能为空',
|
||||||
|
trigger: 'blur',
|
||||||
|
},
|
||||||
|
]">
|
||||||
|
<el-date-picker
|
||||||
|
v-model="form.maintenanceFinishTime"
|
||||||
|
type="datetime"
|
||||||
|
:disabled="disabled"
|
||||||
|
:placeholder="`请选择维修结束时间`"
|
||||||
|
value-format="timestamp"
|
||||||
|
format="yyyy-MM-dd HH:mm:ss"
|
||||||
|
clearable
|
||||||
|
@change="$emit('update', form)" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
<!-- 维修工 -->
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item
|
||||||
|
label="维修工"
|
||||||
|
prop="repairman"
|
||||||
|
:rules="[
|
||||||
|
{ required: true, message: '维修工不能为空', trigger: 'blur' },
|
||||||
|
]">
|
||||||
|
<el-input
|
||||||
|
v-model="form.repairman"
|
||||||
|
@change="$emit('update', form)"
|
||||||
|
placeholder="请输入维修工"
|
||||||
|
:disabled="disabled" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
<!-- 联系方式 -->
|
<!-- 联系方式 -->
|
||||||
<el-col :span="24">
|
<el-col :span="8">
|
||||||
<el-form-item
|
<el-form-item
|
||||||
label="联系方式"
|
label="联系方式"
|
||||||
prop="repairmanPhone"
|
prop="repairmanPhone"
|
||||||
@ -157,6 +245,117 @@
|
|||||||
:disabled="disabled" />
|
:disabled="disabled" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
|
||||||
|
<!-- 维修方式 - 数据字典 -->
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item
|
||||||
|
label="维修方式"
|
||||||
|
prop="repairMode"
|
||||||
|
:rules="[
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
message: '维修方式不能为空',
|
||||||
|
trigger: 'blur',
|
||||||
|
},
|
||||||
|
]">
|
||||||
|
<el-select
|
||||||
|
v-model="form.repairMode"
|
||||||
|
placeholder="维修方式"
|
||||||
|
:disabled="disabled"
|
||||||
|
@change="$emit('update', form)">
|
||||||
|
<el-option
|
||||||
|
v-for="opt in getDictDatas(DICT_TYPE.FAULT_LEVEL)"
|
||||||
|
:key="opt.value"
|
||||||
|
:label="opt.label"
|
||||||
|
:value="opt.value" />
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
<!-- 维修结果 - 数据字典 -->
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item
|
||||||
|
label="维修结果"
|
||||||
|
prop="maintenanceResult"
|
||||||
|
:rules="[
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
message: '维修结果不能为空',
|
||||||
|
trigger: 'blur',
|
||||||
|
},
|
||||||
|
]">
|
||||||
|
<el-select
|
||||||
|
v-model="form.maintenanceResult"
|
||||||
|
placeholder="维修结果"
|
||||||
|
:disabled="disabled"
|
||||||
|
@change="$emit('update', form)">
|
||||||
|
<el-option
|
||||||
|
v-for="opt in getDictDatas(DICT_TYPE.FAULT_LEVEL)"
|
||||||
|
:key="opt.value"
|
||||||
|
:label="opt.label"
|
||||||
|
:value="opt.value" />
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
<!-- 备注 -->
|
||||||
|
<el-col :span="24">
|
||||||
|
<el-form-item label="备注" prop="remark">
|
||||||
|
<el-input
|
||||||
|
v-model="form.remark"
|
||||||
|
@change="$emit('update', form)"
|
||||||
|
placeholder="请输入备注"
|
||||||
|
:disabled="disabled" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
<!-- 故障明细 -->
|
||||||
|
<el-col :span="24">
|
||||||
|
<el-form-item
|
||||||
|
label="故障明细"
|
||||||
|
prop="faultDetail"
|
||||||
|
:rules="[
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
message: '故障明细不能为空',
|
||||||
|
trigger: 'blur',
|
||||||
|
},
|
||||||
|
]"></el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
<!-- 维修描述 -->
|
||||||
|
<el-col :span="24">
|
||||||
|
<el-form-item label="维修描述" prop="maintenanceDetail"></el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
<!-- 维修附件 -->
|
||||||
|
<el-col :span="24">
|
||||||
|
<el-form-item label="维修附件" prop="files"></el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
<!-- 设备大类 -->
|
||||||
|
<!-- <el-col :span="8">
|
||||||
|
<el-form-item
|
||||||
|
label="设备大类"
|
||||||
|
prop="equipmentCategory"
|
||||||
|
:rules="[
|
||||||
|
{ required: true, message: '设备大类不能为空', trigger: 'blur' },
|
||||||
|
]">
|
||||||
|
<el-select
|
||||||
|
v-model="form.equipmentCategory"
|
||||||
|
:placeholder="`请选择设备大类`"
|
||||||
|
:disabled="disabled"
|
||||||
|
clearable
|
||||||
|
filterable
|
||||||
|
@change="handleEqTypeChange">
|
||||||
|
<el-option
|
||||||
|
v-for="opt in equipmentTypeOptions"
|
||||||
|
:key="opt.value"
|
||||||
|
:label="opt.label"
|
||||||
|
:value="opt.value" />
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col> -->
|
||||||
</el-row>
|
</el-row>
|
||||||
</el-form>
|
</el-form>
|
||||||
</template>
|
</template>
|
||||||
@ -189,6 +388,10 @@ export default {
|
|||||||
allSpeicalEquipments: [],
|
allSpeicalEquipments: [],
|
||||||
uploadOpen: false,
|
uploadOpen: false,
|
||||||
form: {},
|
form: {},
|
||||||
|
formFilters: {
|
||||||
|
lineId: null,
|
||||||
|
sectionId: null,
|
||||||
|
},
|
||||||
formLoading: true,
|
formLoading: true,
|
||||||
dataLoaded: false,
|
dataLoaded: false,
|
||||||
equipmentList: [],
|
equipmentList: [],
|
||||||
@ -200,6 +403,8 @@ export default {
|
|||||||
],
|
],
|
||||||
workerOptions: [],
|
workerOptions: [],
|
||||||
planOptions: [],
|
planOptions: [],
|
||||||
|
sectionOptions: [],
|
||||||
|
lineOptions: [],
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
|
@ -51,7 +51,7 @@
|
|||||||
v-model="form"
|
v-model="form"
|
||||||
:disabled="mode == 'detail'" />
|
:disabled="mode == 'detail'" />
|
||||||
</base-dialog>
|
</base-dialog>
|
||||||
<CustomDialogForm
|
<DetailDrawer
|
||||||
v-if="addOrUpdateVisible"
|
v-if="addOrUpdateVisible"
|
||||||
ref="addOrUpdate"
|
ref="addOrUpdate"
|
||||||
@refreshDataList="getList"
|
@refreshDataList="getList"
|
||||||
@ -61,7 +61,7 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
import basicPageMixin from '@/mixins/lb/basicPageMixin';
|
import basicPageMixin from '@/mixins/lb/basicPageMixin';
|
||||||
import CustomDialogForm from './CustomDialogForm.vue';
|
import DetailDrawer from './CustomDialogForm.vue';
|
||||||
import {
|
import {
|
||||||
deleteRepair,
|
deleteRepair,
|
||||||
exportRepairLogExcel,
|
exportRepairLogExcel,
|
||||||
@ -72,13 +72,13 @@ import DialogForm from './Repair--add.vue';
|
|||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'SpecialEquipmentRepair',
|
name: 'SpecialEquipmentRepair',
|
||||||
components: { CustomDialogForm, DialogForm },
|
components: { DetailDrawer, DialogForm },
|
||||||
mixins: [basicPageMixin],
|
mixins: [basicPageMixin],
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
addOrUpdateVisible: false,
|
addOrUpdateVisible: false,
|
||||||
searchBarKeys: [
|
searchBarKeys: [
|
||||||
'maintenanceStatus',
|
'maintenanceResult',
|
||||||
'createTime',
|
'createTime',
|
||||||
'equipmentId',
|
'equipmentId',
|
||||||
'specialType',
|
'specialType',
|
||||||
@ -167,7 +167,6 @@ export default {
|
|||||||
filter: (v) => (v != null ? ['成功', '失败'][v] : ''),
|
filter: (v) => (v != null ? ['成功', '失败'][v] : ''),
|
||||||
},
|
},
|
||||||
{ prop: 'maintenanceDetail', label: '维修描述', width: 110 },
|
{ prop: 'maintenanceDetail', label: '维修描述', width: 110 },
|
||||||
{ prop: '_detail', label: '查看详情', width: 110 },
|
|
||||||
{
|
{
|
||||||
prop: 'remark',
|
prop: 'remark',
|
||||||
label: '备注',
|
label: '备注',
|
||||||
@ -207,19 +206,19 @@ export default {
|
|||||||
// },
|
// },
|
||||||
],
|
],
|
||||||
searchBarFormConfig: [
|
searchBarFormConfig: [
|
||||||
{
|
// {
|
||||||
type: 'select',
|
// type: 'select',
|
||||||
label: '设备大类',
|
// label: '设备大类',
|
||||||
placeholder: '请选择设备大类',
|
// placeholder: '请选择设备大类',
|
||||||
param: 'specialType',
|
// param: 'specialType',
|
||||||
onchange: true,
|
// onchange: true,
|
||||||
selectOptions: [
|
// selectOptions: [
|
||||||
{ id: 1, name: '安全设备' },
|
// { id: 1, name: '安全设备' },
|
||||||
{ id: 2, name: '消防设备' },
|
// { id: 2, name: '消防设备' },
|
||||||
{ id: 3, name: '特种设备' },
|
// { id: 3, name: '特种设备' },
|
||||||
],
|
// ],
|
||||||
filterable: true,
|
// filterable: true,
|
||||||
},
|
// },
|
||||||
{
|
{
|
||||||
type: 'select',
|
type: 'select',
|
||||||
label: '设备',
|
label: '设备',
|
||||||
@ -229,13 +228,12 @@ export default {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
type: 'select',
|
type: 'select',
|
||||||
label: '状态',
|
label: '维修结果',
|
||||||
placeholder: '请选择状态',
|
placeholder: '请选择维修结果',
|
||||||
param: 'maintenanceStatus',
|
param: 'maintenanceResult',
|
||||||
selectOptions: [
|
selectOptions: [
|
||||||
{ name: '未完成', id: '0' },
|
{ name: '成功', id: '0' },
|
||||||
{ name: '完成', id: '1' },
|
{ name: '失败', id: '1' },
|
||||||
{ name: '进行中', id: '2' },
|
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
// 时间段
|
// 时间段
|
||||||
@ -282,7 +280,8 @@ export default {
|
|||||||
queryParams: {
|
queryParams: {
|
||||||
pageNo: 1,
|
pageNo: 1,
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
maintenanceStatus: null,
|
// maintenanceStatus: null,
|
||||||
|
maintenanceResult: null,
|
||||||
createTime: null,
|
createTime: null,
|
||||||
equipmentId: null,
|
equipmentId: null,
|
||||||
special: true,
|
special: true,
|
||||||
@ -488,7 +487,7 @@ export default {
|
|||||||
},
|
},
|
||||||
setSearchBarEquipmentList(eqList) {
|
setSearchBarEquipmentList(eqList) {
|
||||||
this.$set(
|
this.$set(
|
||||||
this.searchBarFormConfig[1],
|
this.searchBarFormConfig[0],
|
||||||
'selectOptions',
|
'selectOptions',
|
||||||
eqList.map((item) => ({
|
eqList.map((item) => ({
|
||||||
name: item.name,
|
name: item.name,
|
||||||
|
@ -74,12 +74,18 @@
|
|||||||
<UnplannedEditDrawer
|
<UnplannedEditDrawer
|
||||||
ref="unplanned"
|
ref="unplanned"
|
||||||
v-if="openUnplannedDrawer"
|
v-if="openUnplannedDrawer"
|
||||||
|
@refreshDataList="getList"
|
||||||
@destroy="openUnplannedDrawer = false" />
|
@destroy="openUnplannedDrawer = false" />
|
||||||
|
<PlannedEditDrawer
|
||||||
|
ref="planned"
|
||||||
|
v-if="openPlannedDrawer"
|
||||||
|
@refreshDataList="getList"
|
||||||
|
@destroy="openPlannedDrawer = false" />
|
||||||
|
|
||||||
<!-- <RecordDetail
|
<RecordDetail
|
||||||
v-if="recordDetailVisible"
|
v-if="recordDetailVisible"
|
||||||
ref="recordDetailDrawer"
|
ref="recordDetailDrawer"
|
||||||
@closed="recordDetailVisible = false" /> -->
|
@closed="recordDetailVisible = false" />
|
||||||
|
|
||||||
<!-- 详情 -->
|
<!-- 详情 -->
|
||||||
</div>
|
</div>
|
||||||
@ -90,11 +96,13 @@ import moment from 'moment';
|
|||||||
import basicPageMixin from '@/mixins/lb/basicPageMixin';
|
import basicPageMixin from '@/mixins/lb/basicPageMixin';
|
||||||
import DialogFormUnplanned from './WaitingList--add--unplanned.vue';
|
import DialogFormUnplanned from './WaitingList--add--unplanned.vue';
|
||||||
import UnplannedEditDrawer from './WaitingListUnplanned--edit.vue';
|
import UnplannedEditDrawer from './WaitingListUnplanned--edit.vue';
|
||||||
|
import PlannedEditDrawer from './WaitingListPlanned--edit.vue';
|
||||||
import {
|
import {
|
||||||
deleteEqMaintainLog,
|
deleteEqMaintainLog,
|
||||||
exportMaintainLogExcel,
|
exportMaintainLogExcel,
|
||||||
} from '@/api/equipment/base/maintain/record';
|
} from '@/api/equipment/base/maintain/record';
|
||||||
import WaitingListTable from './WaitingListTable.vue';
|
import WaitingListTable from './WaitingListTable.vue';
|
||||||
|
import RecordDetail from './Record--detail.vue';
|
||||||
|
|
||||||
const timeFilter = (val) => moment(val).format('yyyy-MM-DD HH:mm:ss');
|
const timeFilter = (val) => moment(val).format('yyyy-MM-DD HH:mm:ss');
|
||||||
|
|
||||||
@ -123,7 +131,13 @@ const btn = {
|
|||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'SpecialEquipmentMaintainRecord',
|
name: 'SpecialEquipmentMaintainRecord',
|
||||||
components: { DialogFormUnplanned, WaitingListTable, UnplannedEditDrawer },
|
components: {
|
||||||
|
DialogFormUnplanned,
|
||||||
|
WaitingListTable,
|
||||||
|
RecordDetail,
|
||||||
|
UnplannedEditDrawer,
|
||||||
|
PlannedEditDrawer
|
||||||
|
},
|
||||||
mixins: [basicPageMixin],
|
mixins: [basicPageMixin],
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
@ -449,6 +463,7 @@ export default {
|
|||||||
allSpecialEquipments: [],
|
allSpecialEquipments: [],
|
||||||
openPlannedDrawer: false,
|
openPlannedDrawer: false,
|
||||||
openUnplannedDrawer: false,
|
openUnplannedDrawer: false,
|
||||||
|
openPlannedDrawer: false,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
@ -488,17 +503,25 @@ export default {
|
|||||||
// }
|
// }
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
searchBarClicked(btn) {
|
/** 批量确认 */
|
||||||
console.log('searchBarClicked', btn);
|
async searchBarClicked(btn) {
|
||||||
switch (btn.btnName) {
|
switch (btn.btnName) {
|
||||||
case 'batchConfirm':
|
case 'batchConfirm':
|
||||||
if (this.$refs['waiting-list-table'].selectedPlan.length == 0) {
|
if (this.$refs['waiting-list-table'].selectedPlan.length == 0) {
|
||||||
this.$message.warning('请选择待确认的设备保养记录');
|
this.$message.warning('请选择待确认的设备保养记录');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const res = await this.$axios({
|
||||||
|
url: '/base/equipment-maintain-log/confirm',
|
||||||
|
method: 'put',
|
||||||
|
data: this.$refs['waiting-list-table'].selectedPlan.map(
|
||||||
|
(item) => item.id
|
||||||
|
),
|
||||||
|
});
|
||||||
|
if (res.code == 0) {
|
||||||
|
this.$message.success('确认成功');
|
||||||
|
this.getList();
|
||||||
}
|
}
|
||||||
console.log(
|
|
||||||
'selectedPlan',
|
|
||||||
this.$refs['waiting-list-table'].selectedPlan
|
|
||||||
);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -596,14 +619,10 @@ export default {
|
|||||||
this.recv({
|
this.recv({
|
||||||
...this.queryParams,
|
...this.queryParams,
|
||||||
special: true,
|
special: true,
|
||||||
relatePlan: 2,
|
// relatePlan: 2,
|
||||||
confirmed: false,
|
confirmed: false,
|
||||||
}).then((response) => {
|
}).then((response) => {
|
||||||
this.list = response.data.list.map((item) => ({
|
this.list = response.data.list;
|
||||||
...item,
|
|
||||||
planName: '---',
|
|
||||||
_selection: 0b10,
|
|
||||||
}));
|
|
||||||
this.total = response.data.total;
|
this.total = response.data.total;
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
});
|
});
|
||||||
@ -627,7 +646,7 @@ export default {
|
|||||||
endTime: null,
|
endTime: null,
|
||||||
planStartTime: null,
|
planStartTime: null,
|
||||||
planEndTime: null,
|
planEndTime: null,
|
||||||
confirmed: null,
|
confirmed: false,
|
||||||
remark: null,
|
remark: null,
|
||||||
special: false,
|
special: false,
|
||||||
};
|
};
|
||||||
@ -646,36 +665,18 @@ export default {
|
|||||||
/** 新增按钮操作 */
|
/** 新增按钮操作 */
|
||||||
handleAdd() {
|
handleAdd() {
|
||||||
this.reset();
|
this.reset();
|
||||||
// if (this.$route.query.addRecord) {
|
|
||||||
// // 赋值
|
|
||||||
// const tempRow = this.$route.query.row;
|
|
||||||
// this.form.equipmentId = tempRow.equipmentId;
|
|
||||||
// this.form.relatePlan = tempRow.nextMaintainTime ? 1 : 2;
|
|
||||||
// this.form.startTime = tempRow.nextMaintainTime;
|
|
||||||
// this.form.maintainPlanId = tempRow.id;
|
|
||||||
// // await (() => {
|
|
||||||
// // return new Promise((acpt, rejt) => {
|
|
||||||
// // this.form.relatePlan =
|
|
||||||
// // this.$route.query.relatePlan ||
|
|
||||||
// // (tempRow.nextMaintainTime ? 1 : 2);
|
|
||||||
// // this.form.startTime = tempRow.nextMaintainTime;
|
|
||||||
// // acpt();
|
|
||||||
// // });
|
|
||||||
// // })();
|
|
||||||
// // this.$nextTick(() => {
|
|
||||||
// // this.form.maintainPlanId = tempRow.id;
|
|
||||||
// // this.form.equipmentId = tempRow.equipmentId;
|
|
||||||
// // });
|
|
||||||
// }
|
|
||||||
// if (this.$route.query.isAdd) {
|
|
||||||
// // 赋值
|
|
||||||
// this.form.equipmentId = this.$route.query.equipmentId;
|
|
||||||
// this.form.maintainPlanId = this.$route.query.maintainPlanId;
|
|
||||||
// }
|
|
||||||
this.open = true;
|
this.open = true;
|
||||||
this.title = '添加待确认保养记录';
|
this.title = '添加待确认保养记录';
|
||||||
},
|
},
|
||||||
|
|
||||||
|
getConfirmed() {
|
||||||
|
return this.$confirm('是否直接确认保养记录', '提示', {
|
||||||
|
confirmButtonText: '确定',
|
||||||
|
cancelButtonText: '取消',
|
||||||
|
type: 'warning',
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
/** 提交按钮 */
|
/** 提交按钮 */
|
||||||
submitForm() {
|
submitForm() {
|
||||||
this.$refs['form'].validate((valid) => {
|
this.$refs['form'].validate((valid) => {
|
||||||
@ -696,52 +697,62 @@ export default {
|
|||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 添加的提交
|
// 添加的提交
|
||||||
this.post({
|
this.getConfirmed()
|
||||||
...this.form,
|
.then((confirmed) => {
|
||||||
maintainWorker: this.form.maintainWorker.join(','),
|
this.post({
|
||||||
special: true,
|
...this.form,
|
||||||
relatePlan: 2,
|
maintainWorker: this.form.maintainWorker.join(','),
|
||||||
}).then((response) => {
|
special: true,
|
||||||
this.$modal.msgSuccess('新增成功');
|
relatePlan: 2,
|
||||||
|
confirmed: true,
|
||||||
// 跳转至 备品备件 保养
|
}).then((response) => {
|
||||||
// const toSparePartsMaintain = () => {
|
this.$modal.msgSuccess('新增成功');
|
||||||
// this.open = false;
|
this.open = false;
|
||||||
// };
|
this.getList();
|
||||||
|
});
|
||||||
// this.$confirm('是否有备品备件更换?', '提示', {
|
})
|
||||||
// confirmButtonText: '有',
|
.catch((err) => {
|
||||||
// cancelButtonText: '没有',
|
this.post({
|
||||||
// })
|
...this.form,
|
||||||
// .then(toSparePartsMaintain)
|
maintainWorker: this.form.maintainWorker.join(','),
|
||||||
// .catch(() => {
|
special: true,
|
||||||
// this.open = false;
|
relatePlan: 2,
|
||||||
// this.getList();
|
confirmed: false,
|
||||||
// });
|
}).then((response) => {
|
||||||
this.open = false;
|
this.$modal.msgSuccess('新增成功');
|
||||||
this.getList();
|
this.open = false;
|
||||||
});
|
this.getList();
|
||||||
|
});
|
||||||
|
});
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
/** 确认 */
|
/** 确认 */
|
||||||
handleConfirm(row) {
|
async handleConfirm(row) {
|
||||||
console.log('confirm', row);
|
const res = await this.$axios({
|
||||||
|
url: '/base/equipment-maintain-log/confirm',
|
||||||
|
method: 'put',
|
||||||
|
data: [row.id],
|
||||||
|
});
|
||||||
|
if (res.code == 0) {
|
||||||
|
this.$message.success('确认成功');
|
||||||
|
this.getList();
|
||||||
|
}
|
||||||
},
|
},
|
||||||
/** 编辑 */
|
/** 编辑 */
|
||||||
async handleEdit(row) {
|
async handleEdit(row) {
|
||||||
this.reset();
|
this.reset();
|
||||||
if (row.relatePlan == 1) {
|
if (row.relatePlan == 1) {
|
||||||
// 计划型
|
// 计划型
|
||||||
const res = await this.info({ id: row.id });
|
|
||||||
this.form = res.data;
|
|
||||||
this.form.maintainWorker = res.data.maintainWorker.split(',');
|
|
||||||
this.openPlannedDrawer = true;
|
|
||||||
} else {
|
|
||||||
// 非计划型 2
|
|
||||||
// const res = await this.info({ id: row.id });
|
// const res = await this.info({ id: row.id });
|
||||||
// this.form = res.data;
|
// this.form = res.data;
|
||||||
// this.form.maintainWorker = res.data.maintainWorker.split(',');
|
// this.form.maintainWorker = res.data.maintainWorker.split(',');
|
||||||
|
this.openPlannedDrawer = true;
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.$refs.planned.init(row);
|
||||||
|
});
|
||||||
|
} else {
|
||||||
this.openUnplannedDrawer = true;
|
this.openUnplannedDrawer = true;
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
this.$refs.unplanned.init(row);
|
this.$refs.unplanned.init(row);
|
||||||
@ -750,31 +761,30 @@ export default {
|
|||||||
},
|
},
|
||||||
/** 删除按钮操作 */
|
/** 删除按钮操作 */
|
||||||
handleDelete(row) {
|
handleDelete(row) {
|
||||||
console.log('delete', row);
|
|
||||||
return;
|
|
||||||
const id = row.id;
|
|
||||||
this.$modal
|
this.$modal
|
||||||
.confirm(
|
.confirm(
|
||||||
'是否确认删除设备保养单号为"' + row.maintainOrderNumber + '"的数据项?'
|
'是否确认删除设备保养单号为"' + row.maintainOrderNumber + '"的数据项?'
|
||||||
)
|
)
|
||||||
.then(function () {
|
.then(() => {
|
||||||
// return deleteEqMaintainLog(id);
|
return this.$axios({
|
||||||
|
url: '/base/equipment-maintain-log/delete?id=' + row.id,
|
||||||
|
method: 'delete',
|
||||||
|
});
|
||||||
})
|
})
|
||||||
.then(() => {
|
.then(() => {
|
||||||
this.getList();
|
this.getList();
|
||||||
this.$modal.msgSuccess('删除成功');
|
this.$modal.msgSuccess('删除成功');
|
||||||
})
|
})
|
||||||
.catch(() => {});
|
.catch(console.error);
|
||||||
},
|
},
|
||||||
handleDetail(row) {
|
handleDetail(row) {
|
||||||
console.log('detail', row);
|
this.recordDetailVisible = true;
|
||||||
return;
|
this.$nextTick(() => {
|
||||||
this.reset();
|
this.$refs.recordDetailDrawer.show({
|
||||||
this.mode = 'detail';
|
id: row.id,
|
||||||
this.info({ id }).then((response) => {
|
planMaintainWorker: row.planMaintainWorker,
|
||||||
this.form = response.data;
|
maintainWorker: row.maintainWorker,
|
||||||
// this.open = true;
|
});
|
||||||
// this.title = '查看保养记录详情';
|
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
/** 导出按钮操作 */
|
/** 导出按钮操作 */
|
||||||
|
758
src/views/specialEquipment/maintain/WaitingListPlanned--edit.vue
Normal file
758
src/views/specialEquipment/maintain/WaitingListPlanned--edit.vue
Normal file
@ -0,0 +1,758 @@
|
|||||||
|
<!--
|
||||||
|
filename: WaitingListUnplanned--edit.vue
|
||||||
|
author: liubin
|
||||||
|
date: 2023-08-22 14:38:56
|
||||||
|
description:
|
||||||
|
-->
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<el-drawer
|
||||||
|
:visible="visible"
|
||||||
|
:show-close="false"
|
||||||
|
:wrapper-closable="false"
|
||||||
|
class="drawer"
|
||||||
|
custom-class="mes-drawer"
|
||||||
|
size="60%"
|
||||||
|
@closed="$emit('destroy')">
|
||||||
|
<SmallTitle slot="title">编辑</SmallTitle>
|
||||||
|
|
||||||
|
<div class="drawer-body flex">
|
||||||
|
<div class="drawer-body__content">
|
||||||
|
<div class="form-part" style="margin-bottom: 32px">
|
||||||
|
<!-- <el-skeleton v-if="!showForm" animated /> -->
|
||||||
|
<el-form
|
||||||
|
class="equipment-info-form"
|
||||||
|
ref="form"
|
||||||
|
:model="form"
|
||||||
|
label-width="200px"
|
||||||
|
label-position="top"
|
||||||
|
v-loading="formLoading">
|
||||||
|
<el-row :gutter="20">
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="保养计划单号" prop="maintainOrderNumber">
|
||||||
|
<!-- :rules="[
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
message: '请输入保养计划单号',
|
||||||
|
trigger: 'blur',
|
||||||
|
},
|
||||||
|
]" -->
|
||||||
|
<el-input
|
||||||
|
v-model="form.maintainOrderNumber"
|
||||||
|
disabled
|
||||||
|
:placeholder="`请输入保养计划单号`" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="保养计划名称" prop="planName">
|
||||||
|
<el-input
|
||||||
|
v-model="form.planName"
|
||||||
|
placeholder="请输入保养计划名称"
|
||||||
|
disabled />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="部门" prop="departmentId">
|
||||||
|
<!-- :rules="[
|
||||||
|
{ required: true, message: '请选择部门', trigger: 'blur' },
|
||||||
|
]" -->
|
||||||
|
<el-select
|
||||||
|
v-model="form.departmentId"
|
||||||
|
:placeholder="`请选择部门`"
|
||||||
|
clearable
|
||||||
|
disabled
|
||||||
|
filterable>
|
||||||
|
<el-option
|
||||||
|
v-for="opt in departmentOptions"
|
||||||
|
:key="opt.value"
|
||||||
|
:label="opt.label"
|
||||||
|
:value="opt.value" />
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="产线" prop="lineId">
|
||||||
|
<!-- :rules="[
|
||||||
|
{ required: true, message: '请选择产线', trigger: 'blur' },
|
||||||
|
]" -->
|
||||||
|
<el-select
|
||||||
|
v-model="form.lineId"
|
||||||
|
:placeholder="`请选择产线`"
|
||||||
|
disabled
|
||||||
|
clearable
|
||||||
|
filterable>
|
||||||
|
<el-option
|
||||||
|
v-for="opt in lineOptions"
|
||||||
|
:key="opt.value"
|
||||||
|
:label="opt.label"
|
||||||
|
:value="opt.value" />
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="计划保养人员" prop="maintainer">
|
||||||
|
<el-select
|
||||||
|
v-model="form.planMaintainWorker"
|
||||||
|
placeholder="请选择计划保养人员"
|
||||||
|
disabled
|
||||||
|
clearable
|
||||||
|
filterable />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="计划开始时间" prop="planStartTime">
|
||||||
|
<el-date-picker
|
||||||
|
v-model="form.planStartTime"
|
||||||
|
type="datetime"
|
||||||
|
disabled
|
||||||
|
placeholder="请选择计划开始时间"
|
||||||
|
value-format="timestamp"></el-date-picker>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="计划结束时间" prop="planEndTime">
|
||||||
|
<el-date-picker
|
||||||
|
v-model="form.planEndTime"
|
||||||
|
type="datetime"
|
||||||
|
disabled
|
||||||
|
placeholder="请选择计划结束时间"
|
||||||
|
value-format="timestamp"></el-date-picker>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item
|
||||||
|
label="实际开始时间"
|
||||||
|
prop="startTime"
|
||||||
|
:rules="[
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
message: '请选择实际开始时间',
|
||||||
|
trigger: 'blur',
|
||||||
|
},
|
||||||
|
]">
|
||||||
|
<el-date-picker
|
||||||
|
v-model="form.startTime"
|
||||||
|
type="datetime"
|
||||||
|
placeholder="请选择实际开始时间"
|
||||||
|
value-format="timestamp"></el-date-picker>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item
|
||||||
|
label="实际结束时间"
|
||||||
|
prop="endTime"
|
||||||
|
:rules="[
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
message: '请选择实际结束时间',
|
||||||
|
trigger: 'blur',
|
||||||
|
},
|
||||||
|
]">
|
||||||
|
<el-date-picker
|
||||||
|
v-model="form.endTime"
|
||||||
|
type="datetime"
|
||||||
|
placeholder="请选择实际结束时间"
|
||||||
|
value-format="timestamp"></el-date-picker>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item
|
||||||
|
label="实际保养人员"
|
||||||
|
prop="maintainWorker"
|
||||||
|
:rules="[
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
message: '请选择实际保养人员',
|
||||||
|
trigger: 'blur',
|
||||||
|
},
|
||||||
|
]">
|
||||||
|
<el-select
|
||||||
|
v-model="form.maintainWorker"
|
||||||
|
:placeholder="`请选择实际保养人员`"
|
||||||
|
multiple
|
||||||
|
clearable
|
||||||
|
filterable>
|
||||||
|
<el-option
|
||||||
|
v-for="opt in maintainerOptions"
|
||||||
|
:key="opt.value"
|
||||||
|
:label="opt.label"
|
||||||
|
:value="opt.value" />
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
<el-col :span="24">
|
||||||
|
<el-form-item label="备注" prop="remark">
|
||||||
|
<el-input v-model="form.remark" :placeholder="`请输入备注`" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</el-form>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<SmallTitle>保养内容</SmallTitle>
|
||||||
|
|
||||||
|
<div style="margin-top: 12px; position: relative">
|
||||||
|
<SearchBar
|
||||||
|
:formConfigs="searchBarFormConfig"
|
||||||
|
ref="attr-search-bar"
|
||||||
|
@headBtnClick="handleSearchBarBtnClick" />
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div style="margin-top: 12px; position: relative">
|
||||||
|
<div style="position: absolute; top: -40px; right: 0">
|
||||||
|
<el-button @click="handleAddAttr" type="text">
|
||||||
|
<i class="el-icon-plus"></i>
|
||||||
|
添加属性
|
||||||
|
</el-button>
|
||||||
|
</div>
|
||||||
|
<base-table
|
||||||
|
v-loading="attrListLoading"
|
||||||
|
:table-props="attrTableProps"
|
||||||
|
:page="attrQuery?.params.pageNo || 1"
|
||||||
|
:limit="attrQuery?.params.pageSize || 10"
|
||||||
|
:table-data="attrList"
|
||||||
|
@emitFun="handleEmitFun">
|
||||||
|
<method-btn
|
||||||
|
slot="handleBtn"
|
||||||
|
label="操作"
|
||||||
|
:method-list="tableBtn"
|
||||||
|
@clickBtn="handleTableBtnClick" />
|
||||||
|
</base-table>
|
||||||
|
|
||||||
|
<!-- 分页组件 -->
|
||||||
|
<pagination
|
||||||
|
v-show="attrTotal > 0"
|
||||||
|
:total="attrTotal"
|
||||||
|
:page.sync="attrQuery.params.pageNo"
|
||||||
|
:limit.sync="attrQuery.params.pageSize"
|
||||||
|
@pagination="getAttrList" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="drawer-body__footer">
|
||||||
|
<el-button style="" @click="handleCancel">取消</el-button>
|
||||||
|
<el-button type="primary" @click="handleConfirm">保存</el-button>
|
||||||
|
<!-- sections的第二项必须是 属性列表 -->
|
||||||
|
<!-- <el-button
|
||||||
|
v-if="sections[1].allowAdd"
|
||||||
|
type="primary"
|
||||||
|
@click="handleAddAttr">
|
||||||
|
添加属性
|
||||||
|
</el-button> -->
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- 属性对话框 -->
|
||||||
|
<base-dialog
|
||||||
|
:dialogTitle="attrTitle"
|
||||||
|
:dialogVisible="attrFormVisible"
|
||||||
|
width="35%"
|
||||||
|
:append-to-body="true"
|
||||||
|
custom-class="baseDialog"
|
||||||
|
@close="closeAttrForm"
|
||||||
|
@cancel="closeAttrForm"
|
||||||
|
@confirm="submitAttrForm">
|
||||||
|
<DialogForm
|
||||||
|
v-if="attrFormVisible"
|
||||||
|
ref="attrForm"
|
||||||
|
v-model="attrForm"
|
||||||
|
:rows="attrRows" />
|
||||||
|
</base-dialog>
|
||||||
|
</el-drawer>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import DialogForm from '../../../components/DialogForm/index.vue';
|
||||||
|
|
||||||
|
const SmallTitle = {
|
||||||
|
name: 'SmallTitle',
|
||||||
|
props: ['size'],
|
||||||
|
components: {},
|
||||||
|
data() {
|
||||||
|
return {};
|
||||||
|
},
|
||||||
|
methods: {},
|
||||||
|
render: function (h) {
|
||||||
|
return h(
|
||||||
|
'span',
|
||||||
|
{
|
||||||
|
class: 'small-title',
|
||||||
|
style: {
|
||||||
|
fontSize: '18px',
|
||||||
|
lineHeight:
|
||||||
|
this.size == 'lg' ? '24px' : this.size == 'sm' ? '18px' : '20px',
|
||||||
|
fontWeight: 500,
|
||||||
|
fontFamily: '微软雅黑, Microsoft YaHei, Arial, Helvetica, sans-serif',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
this.$slots.default
|
||||||
|
);
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
export default {
|
||||||
|
components: { SmallTitle, DialogForm },
|
||||||
|
props: ['dataId'], // dataId 作为一个通用的存放id的字段
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
visible: false,
|
||||||
|
btnLoading: false,
|
||||||
|
form: {},
|
||||||
|
formLoading: false,
|
||||||
|
lineList: [],
|
||||||
|
maintainerList: [],
|
||||||
|
departmentList: [],
|
||||||
|
attrTableProps: [
|
||||||
|
{
|
||||||
|
prop: 'equipmentName',
|
||||||
|
label: '设备名称',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: 'program',
|
||||||
|
label: '保养项目',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: 'maintenanceDes',
|
||||||
|
label: '保养描述',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
attrList: [],
|
||||||
|
attrTotal: 0,
|
||||||
|
attrTitle: '',
|
||||||
|
attrForm: {
|
||||||
|
id: null,
|
||||||
|
logId: null,
|
||||||
|
program: null,
|
||||||
|
maintenanceDes: null,
|
||||||
|
remark: null,
|
||||||
|
},
|
||||||
|
attrFormVisible: false,
|
||||||
|
attrRows: [
|
||||||
|
[
|
||||||
|
{
|
||||||
|
select: true,
|
||||||
|
label: '设备名称',
|
||||||
|
prop: 'equipmentId',
|
||||||
|
url: '/base/core-equipment/page?pageNo=1&pageSize=100&special=true',
|
||||||
|
// method: 'post',
|
||||||
|
// queryParams: {
|
||||||
|
// pageNo: 1,
|
||||||
|
// pageSize: 100,
|
||||||
|
// special: true,
|
||||||
|
// },
|
||||||
|
rules: [
|
||||||
|
{ required: true, message: '设备不能为空', trigger: 'blur' },
|
||||||
|
],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
[
|
||||||
|
{
|
||||||
|
input: true,
|
||||||
|
label: '保养项目',
|
||||||
|
prop: 'program',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
[
|
||||||
|
{
|
||||||
|
input: true,
|
||||||
|
label: '保养描述',
|
||||||
|
prop: 'maintenanceDes',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
[
|
||||||
|
{
|
||||||
|
input: true,
|
||||||
|
label: '备注',
|
||||||
|
prop: 'remark',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
],
|
||||||
|
attrQuery: {
|
||||||
|
params: {
|
||||||
|
pageNo: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
equipmentName: null,
|
||||||
|
},
|
||||||
|
}, // 属性列表的请求
|
||||||
|
searchBarFormConfig: [
|
||||||
|
{
|
||||||
|
type: 'input',
|
||||||
|
label: '设备',
|
||||||
|
placeholder: '请输入设备名称',
|
||||||
|
param: 'equipmentName',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: 'button',
|
||||||
|
btnName: '查询',
|
||||||
|
name: 'search',
|
||||||
|
color: 'primary',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
attrFormSubmitting: false,
|
||||||
|
attrListLoading: false,
|
||||||
|
// syncFileListFlag: null,
|
||||||
|
tableBtn: [
|
||||||
|
{
|
||||||
|
type: 'edit',
|
||||||
|
btnName: '编辑',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: 'delete',
|
||||||
|
btnName: '删除',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
row: null,
|
||||||
|
};
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
departmentOptions() {
|
||||||
|
return (this.departmentList || []).map((item) => ({
|
||||||
|
id: item.id,
|
||||||
|
label: item.name,
|
||||||
|
value: item.id,
|
||||||
|
}));
|
||||||
|
},
|
||||||
|
lineOptions() {
|
||||||
|
return (this.lineList || []).map((item) => ({
|
||||||
|
id: item.id,
|
||||||
|
label: item.name,
|
||||||
|
value: item.id,
|
||||||
|
}));
|
||||||
|
},
|
||||||
|
maintainerOptions() {
|
||||||
|
return (this.maintainerList || []).map((item) => ({
|
||||||
|
id: item.id,
|
||||||
|
label: item.name,
|
||||||
|
value: item.name,
|
||||||
|
}));
|
||||||
|
},
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
this.getList('maintainer');
|
||||||
|
this.getList('department');
|
||||||
|
this.getList('line');
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
handleSearchBarBtnClick(btn) {
|
||||||
|
switch (btn.btnName) {
|
||||||
|
case 'search':
|
||||||
|
this.attrQuery.params.equipmentName = btn.equipmentName;
|
||||||
|
this.getAttrList();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
handleTableBtnClick({ type, data }) {
|
||||||
|
switch (type) {
|
||||||
|
case 'edit':
|
||||||
|
this.handleEditAttr(data.id);
|
||||||
|
break;
|
||||||
|
case 'delete':
|
||||||
|
this.handleDeleteAttr(data.id);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
async handleConfirm() {
|
||||||
|
this.btnLoading = true;
|
||||||
|
this.$nextTick(async () => {
|
||||||
|
const { code, data } = await this.$axios({
|
||||||
|
url: '/base/equipment-maintain-log/update',
|
||||||
|
method: 'put',
|
||||||
|
data: {
|
||||||
|
...this.form,
|
||||||
|
maintainWorker: this.form.maintainWorker.join(','),
|
||||||
|
planMaintainWorker: this.form.planMaintainWorker?.join(','),
|
||||||
|
},
|
||||||
|
});
|
||||||
|
if (code == 0) {
|
||||||
|
this.$modal.msgSuccess('更新成功');
|
||||||
|
}
|
||||||
|
this.btnLoading = false;
|
||||||
|
this.$emit('refreshDataList');
|
||||||
|
this.handleCancel();
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
handleEmitFun(val) {
|
||||||
|
console.log('handleEmitFun', val);
|
||||||
|
},
|
||||||
|
|
||||||
|
init(row) {
|
||||||
|
this.visible = true;
|
||||||
|
this.row = row;
|
||||||
|
this.getInfo(row);
|
||||||
|
this.getAttrList(row);
|
||||||
|
},
|
||||||
|
|
||||||
|
async getInfo(row) {
|
||||||
|
this.formLoading = true;
|
||||||
|
const res = await this.$axios(
|
||||||
|
'/base/equipment-maintain-log/get?id=' + row.id
|
||||||
|
);
|
||||||
|
if (res.code == 0) {
|
||||||
|
this.form = res.data;
|
||||||
|
this.form.maintainWorker = res.data.maintainWorker.split(',');
|
||||||
|
this.form.planMaintainWorker = res.data.planMaintainWorker?.split(',');
|
||||||
|
this.formLoading = false;
|
||||||
|
}
|
||||||
|
this.formLoading = false;
|
||||||
|
},
|
||||||
|
|
||||||
|
async getAttrList(row, condition = {}) {
|
||||||
|
if (!row) row = this.row;
|
||||||
|
this.attrListLoading = true;
|
||||||
|
const res = await this.$axios({
|
||||||
|
url: '/base/equipment-maintain-log-det/page',
|
||||||
|
method: 'get',
|
||||||
|
params: {
|
||||||
|
...this.attrQuery.params,
|
||||||
|
logId: row.id,
|
||||||
|
...condition,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
if (res.code == 0) {
|
||||||
|
this.attrList = res.data.list;
|
||||||
|
this.attrTotal = res.data.total;
|
||||||
|
}
|
||||||
|
this.attrListLoading = false;
|
||||||
|
},
|
||||||
|
|
||||||
|
async getList(source = 'department') {
|
||||||
|
const urls = [
|
||||||
|
'/base/core-production-line/listAll',
|
||||||
|
'/base/core-department/listAll',
|
||||||
|
'/base/core-worker/listAll',
|
||||||
|
];
|
||||||
|
let res;
|
||||||
|
switch (source) {
|
||||||
|
case 'department':
|
||||||
|
res = await this.$axios(urls[1]);
|
||||||
|
this.departmentList = res.data || [];
|
||||||
|
break;
|
||||||
|
case 'maintainer':
|
||||||
|
res = await this.$axios(urls[2]);
|
||||||
|
this.maintainerList = res.data || [];
|
||||||
|
break;
|
||||||
|
case 'line':
|
||||||
|
res = await this.$axios(urls[0]);
|
||||||
|
this.lineList = res.data || [];
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
this.formLoading = false;
|
||||||
|
},
|
||||||
|
|
||||||
|
// 保存表单
|
||||||
|
handleSave() {
|
||||||
|
this.$refs.form.validate(async (valid) => {
|
||||||
|
if (valid) {
|
||||||
|
await this.$axios({
|
||||||
|
url: '/urlupdate', // this.sections[0][isEdit ? 'urlUpdate' : 'urlCreate'],
|
||||||
|
method: 'post', // isEdit ? 'put' : 'post',
|
||||||
|
data: this.form,
|
||||||
|
});
|
||||||
|
this.$modal.msgSuccess(`${isEdit ? '更新' : '创建'}成功`);
|
||||||
|
this.visible = false;
|
||||||
|
this.$emit('refreshDataList');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
handleCancel() {
|
||||||
|
this.visible = false;
|
||||||
|
},
|
||||||
|
|
||||||
|
resetAttrform() {
|
||||||
|
this.attrForm = {
|
||||||
|
id: null,
|
||||||
|
logId: this.row.id,
|
||||||
|
maintenanceDes: '',
|
||||||
|
program: null,
|
||||||
|
remark: null,
|
||||||
|
};
|
||||||
|
},
|
||||||
|
|
||||||
|
// 新增属性
|
||||||
|
handleAddAttr() {
|
||||||
|
if (!this.row.id) return this.$message.error('请先选中保养记录');
|
||||||
|
this.resetAttrform();
|
||||||
|
this.attrTitle = '添加设备属性';
|
||||||
|
this.attrFormVisible = true;
|
||||||
|
},
|
||||||
|
|
||||||
|
// 编辑属性
|
||||||
|
async handleEditAttr(attrId) {
|
||||||
|
const res = await this.$axios({
|
||||||
|
url: '/base/equipment-maintain-log-det/get',
|
||||||
|
method: 'get',
|
||||||
|
params: { id: attrId },
|
||||||
|
});
|
||||||
|
if (res.code == 0) {
|
||||||
|
this.attrForm = res.data;
|
||||||
|
this.attrTitle = '编辑设备属性';
|
||||||
|
this.attrFormVisible = true;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
// 删除属性
|
||||||
|
handleDeleteAttr(attrId) {
|
||||||
|
this.$confirm('确定删除该保养内容?', '提示', {
|
||||||
|
confirmButtonText: '确定',
|
||||||
|
cancelButtonText: '取消',
|
||||||
|
type: 'warning',
|
||||||
|
})
|
||||||
|
.then(async () => {
|
||||||
|
const res = await this.$axios({
|
||||||
|
url: '/base/equipment-maintain-log-det/delete?id=' + attrId,
|
||||||
|
method: 'delete',
|
||||||
|
});
|
||||||
|
if (res.code == 0) {
|
||||||
|
this.$message({
|
||||||
|
message: '删除成功',
|
||||||
|
type: 'success',
|
||||||
|
duration: 1500,
|
||||||
|
onClose: () => {
|
||||||
|
this.getAttrList();
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch(() => {});
|
||||||
|
},
|
||||||
|
|
||||||
|
// 提交属性表
|
||||||
|
submitAttrForm() {
|
||||||
|
this.$refs['attrForm'].validate(async (valid) => {
|
||||||
|
if (!valid) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
const isEdit = this.attrForm.id != null;
|
||||||
|
this.attrFormSubmitting = true;
|
||||||
|
const res = await this.$axios({
|
||||||
|
url: isEdit
|
||||||
|
? '/base/equipment-maintain-log-det/update'
|
||||||
|
: '/base/equipment-maintain-log-det/create',
|
||||||
|
method: isEdit ? 'put' : 'post',
|
||||||
|
data: this.attrForm,
|
||||||
|
});
|
||||||
|
|
||||||
|
if (res.code == 0) {
|
||||||
|
this.closeAttrForm();
|
||||||
|
this.$message({
|
||||||
|
message: `${isEdit ? '更新' : '创建'}成功`,
|
||||||
|
type: 'success',
|
||||||
|
duration: 1500,
|
||||||
|
onClose: () => {
|
||||||
|
this.getAttrList();
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
this.attrFormSubmitting = false;
|
||||||
|
} catch (err) {
|
||||||
|
this.$message({
|
||||||
|
message: err,
|
||||||
|
type: 'error',
|
||||||
|
duration: 1500,
|
||||||
|
});
|
||||||
|
this.attrFormSubmitting = false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
closeAttrForm() {
|
||||||
|
this.attrFormVisible = false;
|
||||||
|
},
|
||||||
|
|
||||||
|
handleClick(raw) {
|
||||||
|
if (raw.type === 'delete') {
|
||||||
|
this.$confirm(
|
||||||
|
`确定对${
|
||||||
|
raw.data.name
|
||||||
|
? '[名称=' + raw.data.name + ']'
|
||||||
|
: '[序号=' + raw.data._pageIndex + ']'
|
||||||
|
}进行删除操作?`,
|
||||||
|
'提示',
|
||||||
|
{
|
||||||
|
confirmButtonText: '确定',
|
||||||
|
cancelButtonText: '取消',
|
||||||
|
type: 'warning',
|
||||||
|
}
|
||||||
|
)
|
||||||
|
.then(() => {
|
||||||
|
deleteProductAttr(raw.data.id).then(({ data }) => {
|
||||||
|
this.$message({
|
||||||
|
message: '操作成功',
|
||||||
|
type: 'success',
|
||||||
|
duration: 1500,
|
||||||
|
onClose: () => {
|
||||||
|
this.getList();
|
||||||
|
},
|
||||||
|
});
|
||||||
|
});
|
||||||
|
})
|
||||||
|
.catch(() => {});
|
||||||
|
} else {
|
||||||
|
this.addNew(raw.data.id);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.drawer >>> .el-drawer {
|
||||||
|
border-radius: 8px 0 0 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.drawer >>> .el-date-editor,
|
||||||
|
.drawer >>> .el-select {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.drawer >>> .el-drawer__header {
|
||||||
|
margin: 0;
|
||||||
|
padding: 32px 32px 24px;
|
||||||
|
border-bottom: 1px solid #dcdfe6;
|
||||||
|
margin-bottom: 0px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.small-title::before {
|
||||||
|
content: '';
|
||||||
|
display: inline-block;
|
||||||
|
vertical-align: top;
|
||||||
|
width: 4px;
|
||||||
|
height: 22px;
|
||||||
|
border-radius: 1px;
|
||||||
|
margin-right: 8px;
|
||||||
|
background-color: #0b58ff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.drawer-body {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.drawer-body__content {
|
||||||
|
flex: 1;
|
||||||
|
/* background: #eee; */
|
||||||
|
padding: 20px 30px;
|
||||||
|
overflow-y: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.drawer-body__footer {
|
||||||
|
display: flex;
|
||||||
|
justify-content: flex-end;
|
||||||
|
padding: 18px;
|
||||||
|
}
|
||||||
|
</style>
|
@ -39,18 +39,21 @@
|
|||||||
width="128"
|
width="128"
|
||||||
label="设备保养单号"
|
label="设备保养单号"
|
||||||
prop="maintainOrderNumber"></el-table-column>
|
prop="maintainOrderNumber"></el-table-column>
|
||||||
<el-table-column
|
<el-table-column v-if="selectedBox[1]" width="128" label="保养计划名称" prop="planName">
|
||||||
v-if="selectedBox[1]"
|
<template slot-scope="scope">
|
||||||
label="保养计划名称"
|
{{ scope.row.planName || '---' }}
|
||||||
prop="planName"></el-table-column>
|
</template>
|
||||||
<el-table-column
|
</el-table-column>
|
||||||
v-if="selectedBox[2]"
|
<el-table-column v-if="selectedBox[2]" label="部门" prop="departmentName">
|
||||||
label="部门"
|
<template slot-scope="scope">
|
||||||
prop="departmentName"></el-table-column>
|
{{ scope.row.departmentName || '---' }}
|
||||||
<el-table-column
|
</template>
|
||||||
v-if="selectedBox[3]"
|
</el-table-column>
|
||||||
label="产线名"
|
<el-table-column v-if="selectedBox[3]" label="产线名" prop="lineName">
|
||||||
prop="lineName"></el-table-column>
|
<template slot-scope="scope">
|
||||||
|
{{ scope.row.lineName || '---' }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
<el-table-column
|
<el-table-column
|
||||||
v-if="selectedBox[4]"
|
v-if="selectedBox[4]"
|
||||||
width="150"
|
width="150"
|
||||||
|
@ -191,7 +191,9 @@
|
|||||||
:formConfigs="searchBarFormConfig"
|
:formConfigs="searchBarFormConfig"
|
||||||
ref="attr-search-bar"
|
ref="attr-search-bar"
|
||||||
@headBtnClick="handleSearchBarBtnClick" />
|
@headBtnClick="handleSearchBarBtnClick" />
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div style="margin-top: 12px; position: relative">
|
||||||
<div style="position: absolute; top: -40px; right: 0">
|
<div style="position: absolute; top: -40px; right: 0">
|
||||||
<el-button @click="handleAddAttr" type="text">
|
<el-button @click="handleAddAttr" type="text">
|
||||||
<i class="el-icon-plus"></i>
|
<i class="el-icon-plus"></i>
|
||||||
@ -245,16 +247,18 @@
|
|||||||
@close="closeAttrForm"
|
@close="closeAttrForm"
|
||||||
@cancel="closeAttrForm"
|
@cancel="closeAttrForm"
|
||||||
@confirm="submitAttrForm">
|
@confirm="submitAttrForm">
|
||||||
<!-- <DialogForm
|
<DialogForm
|
||||||
v-if="attrFormVisible"
|
v-if="attrFormVisible"
|
||||||
ref="attrForm"
|
ref="attrForm"
|
||||||
:dataForm="attrForm"
|
v-model="attrForm"
|
||||||
:rows="attrRows" /> -->
|
:rows="attrRows" />
|
||||||
</base-dialog>
|
</base-dialog>
|
||||||
</el-drawer>
|
</el-drawer>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import DialogForm from '../../../components/DialogForm/index.vue';
|
||||||
|
|
||||||
const SmallTitle = {
|
const SmallTitle = {
|
||||||
name: 'SmallTitle',
|
name: 'SmallTitle',
|
||||||
props: ['size'],
|
props: ['size'],
|
||||||
@ -282,13 +286,14 @@ const SmallTitle = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: { SmallTitle },
|
components: { SmallTitle, DialogForm },
|
||||||
props: ['dataId'], // dataId 作为一个通用的存放id的字段
|
props: ['dataId'], // dataId 作为一个通用的存放id的字段
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
visible: false,
|
visible: false,
|
||||||
btnLoading: false,
|
btnLoading: false,
|
||||||
form: {},
|
form: {},
|
||||||
|
formLoading: false,
|
||||||
lineList: [],
|
lineList: [],
|
||||||
maintainerList: [],
|
maintainerList: [],
|
||||||
departmentList: [],
|
departmentList: [],
|
||||||
@ -311,27 +316,49 @@ export default {
|
|||||||
attrTitle: '',
|
attrTitle: '',
|
||||||
attrForm: {
|
attrForm: {
|
||||||
id: null,
|
id: null,
|
||||||
equipmentId: null,
|
logId: null,
|
||||||
name: '',
|
program: null,
|
||||||
value: '',
|
maintenanceDes: null,
|
||||||
|
remark: null,
|
||||||
},
|
},
|
||||||
attrFormVisible: false,
|
attrFormVisible: false,
|
||||||
attrRows: [
|
attrRows: [
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
input: true,
|
select: true,
|
||||||
label: '属性名称',
|
label: '设备名称',
|
||||||
prop: 'name',
|
prop: 'equipmentId',
|
||||||
|
url: '/base/core-equipment/page?pageNo=1&pageSize=100&special=true',
|
||||||
|
// method: 'post',
|
||||||
|
// queryParams: {
|
||||||
|
// pageNo: 1,
|
||||||
|
// pageSize: 100,
|
||||||
|
// special: true,
|
||||||
|
// },
|
||||||
rules: [
|
rules: [
|
||||||
{ required: true, message: '属性名称不能为空', trigger: 'blur' },
|
{ required: true, message: '设备不能为空', trigger: 'blur' },
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
input: true,
|
input: true,
|
||||||
label: '属性值',
|
label: '保养项目',
|
||||||
prop: 'value',
|
prop: 'program',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
[
|
||||||
|
{
|
||||||
|
input: true,
|
||||||
|
label: '保养描述',
|
||||||
|
prop: 'maintenanceDes',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
[
|
||||||
|
{
|
||||||
|
input: true,
|
||||||
|
label: '备注',
|
||||||
|
prop: 'remark',
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
@ -396,8 +423,8 @@ export default {
|
|||||||
console.log('btn', btn);
|
console.log('btn', btn);
|
||||||
switch (btn.btnName) {
|
switch (btn.btnName) {
|
||||||
case 'search':
|
case 'search':
|
||||||
this.attrQuery.params.equipmentName = btn['key'];
|
this.attrQuery.params.equipmentName = btn.equipmentName;
|
||||||
this.handleQuery();
|
this.getAttrList();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -413,18 +440,18 @@ export default {
|
|||||||
},
|
},
|
||||||
async handleConfirm() {
|
async handleConfirm() {
|
||||||
this.btnLoading = true;
|
this.btnLoading = true;
|
||||||
// this.syncFileListFlag = Math.random();
|
|
||||||
|
|
||||||
this.$nextTick(async () => {
|
this.$nextTick(async () => {
|
||||||
const { code, data } = await this.$axios({
|
const { code, data } = await this.$axios({
|
||||||
url: '/update', // this.sections[0].urlUpdate,
|
url: '/base/equipment-maintain-log/update',
|
||||||
method: 'put',
|
method: 'put',
|
||||||
data: this.form,
|
data: {
|
||||||
|
...this.form,
|
||||||
|
maintainWorker: this.form.maintainWorker.join(',')
|
||||||
|
},
|
||||||
});
|
});
|
||||||
if (code == 0) {
|
if (code == 0) {
|
||||||
this.$modal.msgSuccess('更新成功');
|
this.$modal.msgSuccess('更新成功');
|
||||||
}
|
}
|
||||||
|
|
||||||
this.btnLoading = false;
|
this.btnLoading = false;
|
||||||
this.$emit('refreshDataList');
|
this.$emit('refreshDataList');
|
||||||
this.handleCancel();
|
this.handleCancel();
|
||||||
@ -518,15 +545,20 @@ export default {
|
|||||||
this.visible = false;
|
this.visible = false;
|
||||||
},
|
},
|
||||||
|
|
||||||
// 新增属性
|
resetAttrform() {
|
||||||
handleAddAttr() {
|
|
||||||
if (!this.dataId) return this.$message.error('请先创建设备信息');
|
|
||||||
this.attrForm = {
|
this.attrForm = {
|
||||||
id: null,
|
id: null,
|
||||||
equipmentId: this.dataId,
|
logId: this.row.id,
|
||||||
name: '',
|
maintenanceDes: '',
|
||||||
value: '',
|
program: null,
|
||||||
|
remark: null,
|
||||||
};
|
};
|
||||||
|
},
|
||||||
|
|
||||||
|
// 新增属性
|
||||||
|
handleAddAttr() {
|
||||||
|
if (!this.row.id) return this.$message.error('请先选中保养记录');
|
||||||
|
this.resetAttrform();
|
||||||
this.attrTitle = '添加设备属性';
|
this.attrTitle = '添加设备属性';
|
||||||
this.attrFormVisible = true;
|
this.attrFormVisible = true;
|
||||||
},
|
},
|
||||||
@ -534,7 +566,7 @@ export default {
|
|||||||
// 编辑属性
|
// 编辑属性
|
||||||
async handleEditAttr(attrId) {
|
async handleEditAttr(attrId) {
|
||||||
const res = await this.$axios({
|
const res = await this.$axios({
|
||||||
url: 'urlpudate', // this.sections[1].urlDetail,
|
url: '/base/equipment-maintain-log-det/get',
|
||||||
method: 'get',
|
method: 'get',
|
||||||
params: { id: attrId },
|
params: { id: attrId },
|
||||||
});
|
});
|
||||||
@ -583,10 +615,9 @@ export default {
|
|||||||
const isEdit = this.attrForm.id != null;
|
const isEdit = this.attrForm.id != null;
|
||||||
this.attrFormSubmitting = true;
|
this.attrFormSubmitting = true;
|
||||||
const res = await this.$axios({
|
const res = await this.$axios({
|
||||||
url: 'url edit',
|
url: isEdit
|
||||||
// isEdit
|
? '/base/equipment-maintain-log-det/update'
|
||||||
// ? this.sections[1].urlUpdate
|
: '/base/equipment-maintain-log-det/create',
|
||||||
// : this.sections[1].urlCreate,
|
|
||||||
method: isEdit ? 'put' : 'post',
|
method: isEdit ? 'put' : 'post',
|
||||||
data: this.attrForm,
|
data: this.attrForm,
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user