|
|
|
|
@ -131,7 +131,8 @@
|
|
|
|
|
v-if="row.equipment_maintain_config && row.equipment_maintain_config.id === currentRule.id"
|
|
|
|
|
type="error"
|
|
|
|
|
size="small"
|
|
|
|
|
style="border-radius: 6px; background-color: #ed4014; color: #fff; border-color: #ed4014;"
|
|
|
|
|
ghost
|
|
|
|
|
style="border-radius: 6px;"
|
|
|
|
|
@click="toggleAssociation(row)"
|
|
|
|
|
:title="row.equipment_maintain_config ? `已关联规则: ${row.equipment_maintain_config.name}` : ''"
|
|
|
|
|
>
|
|
|
|
|
@ -141,7 +142,8 @@
|
|
|
|
|
v-else-if="row.equipment_maintain_config"
|
|
|
|
|
type="warning"
|
|
|
|
|
size="small"
|
|
|
|
|
style="border-radius: 6px; background-color: #ff9900; color: #fff; border-color: #ff9900;"
|
|
|
|
|
ghost
|
|
|
|
|
style="border-radius: 6px;"
|
|
|
|
|
@click="toggleAssociation(row)"
|
|
|
|
|
:title="row.equipment_maintain_config ? `已关联规则: ${row.equipment_maintain_config.name}` : ''"
|
|
|
|
|
>
|
|
|
|
|
@ -151,7 +153,8 @@
|
|
|
|
|
v-else
|
|
|
|
|
type="primary"
|
|
|
|
|
size="small"
|
|
|
|
|
style="border-radius: 6px; background-color: #2d8cf0; color: #fff; border-color: #2d8cf0;"
|
|
|
|
|
ghost
|
|
|
|
|
style="border-radius: 6px;"
|
|
|
|
|
@click="toggleAssociation(row)"
|
|
|
|
|
>
|
|
|
|
|
绑定
|
|
|
|
|
@ -402,12 +405,27 @@ export default {
|
|
|
|
|
this.showEditModal = true;
|
|
|
|
|
},
|
|
|
|
|
handleEditSubmit() {
|
|
|
|
|
this.$refs.editForm.validate((valid) => {
|
|
|
|
|
this.$refs.editForm.validate(async (valid) => {
|
|
|
|
|
if (valid) {
|
|
|
|
|
// TODO: 提交编辑表单数据
|
|
|
|
|
const data = {
|
|
|
|
|
id: this.currentRule.id,
|
|
|
|
|
name: this.editForm.name,
|
|
|
|
|
month_frequency: this.editForm.cycle,
|
|
|
|
|
start_standard: this.editForm.startSetting,
|
|
|
|
|
advance_days: this.editForm.timingValue,
|
|
|
|
|
next_plan_type: this.editForm.nextPlan,
|
|
|
|
|
remark: this.editForm.notes
|
|
|
|
|
};
|
|
|
|
|
try {
|
|
|
|
|
await saveMaintainConfig(data);
|
|
|
|
|
this.$message.success('编辑成功');
|
|
|
|
|
this.showEditModal = false;
|
|
|
|
|
this.getList();
|
|
|
|
|
} catch (e) {
|
|
|
|
|
this.$message.error('编辑失败');
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
this.$message.error('请填写所有必填项');
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
@ -780,4 +798,44 @@ export default {
|
|
|
|
|
.ivu-modal-wrap {
|
|
|
|
|
z-index: 1000 !important;
|
|
|
|
|
}
|
|
|
|
|
.ivu-btn {
|
|
|
|
|
margin: 0 4px;
|
|
|
|
|
border-radius: 4px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.ivu-btn-error {
|
|
|
|
|
background-color: #ed4014;
|
|
|
|
|
border-color: #ed4014;
|
|
|
|
|
color: #fff;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.ivu-btn-error:hover {
|
|
|
|
|
background-color: #f16643;
|
|
|
|
|
border-color: #f16643;
|
|
|
|
|
color: #fff;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.ivu-btn-warning {
|
|
|
|
|
background-color: #ff9900;
|
|
|
|
|
border-color: #ff9900;
|
|
|
|
|
color: #fff;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.ivu-btn-warning:hover {
|
|
|
|
|
background-color: #ffad33;
|
|
|
|
|
border-color: #ffad33;
|
|
|
|
|
color: #fff;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.ivu-btn-primary {
|
|
|
|
|
background-color: #2d8cf0;
|
|
|
|
|
border-color: #2d8cf0;
|
|
|
|
|
color: #fff;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.ivu-btn-primary:hover {
|
|
|
|
|
background-color: #5cadff;
|
|
|
|
|
border-color: #5cadff;
|
|
|
|
|
color: #fff;
|
|
|
|
|
}
|
|
|
|
|
</style>
|
|
|
|
|
|