|
|
@@ -70,7 +70,7 @@
|
|
|
></el-input>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
- <!-- <el-col :span="12">
|
|
|
+ <el-col :span="12">
|
|
|
<el-form-item label="选择生成单据:">
|
|
|
<el-radio-group
|
|
|
v-model="baseInfoForm.generateDocumentType"
|
|
|
@@ -82,7 +82,7 @@
|
|
|
<el-radio :label="5">量具送检</el-radio>
|
|
|
</el-radio-group>
|
|
|
</el-form-item>
|
|
|
- </el-col> -->
|
|
|
+ </el-col>
|
|
|
</el-row>
|
|
|
<el-row>
|
|
|
<el-col :span="24">
|
|
|
@@ -396,7 +396,11 @@
|
|
|
</el-tabs>
|
|
|
<span slot="footer" class="dialog-footer">
|
|
|
<el-button size="small" @click="handleClose">取 消</el-button>
|
|
|
- <el-button size="small" type="primary" @click="saveWarningSetting" v-if="dialogType!='view'"
|
|
|
+ <el-button
|
|
|
+ size="small"
|
|
|
+ type="primary"
|
|
|
+ @click="saveWarningSetting"
|
|
|
+ v-if="dialogType != 'view'"
|
|
|
>确 定</el-button
|
|
|
>
|
|
|
</span>
|
|
|
@@ -465,9 +469,7 @@
|
|
|
// attributeCode: 'identifier',
|
|
|
// attributeName: '温度'
|
|
|
// }
|
|
|
- {
|
|
|
-
|
|
|
- }
|
|
|
+ {}
|
|
|
], // 基本信息触发条件表格
|
|
|
notices: [
|
|
|
{
|
|
|
@@ -501,7 +503,7 @@
|
|
|
this.baseInfoForm.deviceId = data.id;
|
|
|
this.baseInfoForm.deviceName = data.name;
|
|
|
this.baseInfoForm.deviceCode = data.code;
|
|
|
- this.baseInfoForm.conditions=[]
|
|
|
+ this.baseInfoForm.conditions = [];
|
|
|
getPhysicalModel(data.id).then((res) => {
|
|
|
this.temperatureList = res.properties;
|
|
|
});
|
|
|
@@ -555,7 +557,7 @@
|
|
|
);
|
|
|
},
|
|
|
receiver(item, index) {
|
|
|
- console.log(index,'index')
|
|
|
+ console.log(index, 'index');
|
|
|
this.$set(this.baseInfoForm.notices[index], 'receiverName', item.name);
|
|
|
},
|
|
|
|
|
|
@@ -567,6 +569,10 @@
|
|
|
}
|
|
|
},
|
|
|
addPostscript() {
|
|
|
+ if (!this.baseInfoForm?.workItems?.length) {
|
|
|
+ this.$message.error('请先添加规则!');
|
|
|
+ return;
|
|
|
+ }
|
|
|
this.baseInfoForm.workItems.push({
|
|
|
sort: null,
|
|
|
name: '',
|
|
|
@@ -631,17 +637,29 @@
|
|
|
|
|
|
// 保存
|
|
|
async saveWarningSetting() {
|
|
|
+ if (
|
|
|
+ [1, 2, 5].includes(this.baseInfoForm.generateDocumentType) &&
|
|
|
+ !this.baseInfoForm?.workItems?.length
|
|
|
+ ) {
|
|
|
+ this.$message.error('规则不能为空!');
|
|
|
+ return;
|
|
|
+ }
|
|
|
this.$refs.baseInfoFormRef.validate(async (valid) => {
|
|
|
- this.saveLoading = true;
|
|
|
- let api=this.baseInfoForm.id?update:save
|
|
|
- api(this.baseInfoForm).then((res) => {
|
|
|
- this._resetDialogInfo();
|
|
|
- this.saveLoading = false;
|
|
|
- this.addWarningDialog = false;
|
|
|
- this.$emit('refreshList');
|
|
|
- this.$message.success('操作成功!');
|
|
|
- this.saveLoading = false;
|
|
|
- });
|
|
|
+ if (valid) {
|
|
|
+ this.saveLoading = true;
|
|
|
+ let api = this.baseInfoForm.id ? update : save;
|
|
|
+ api(this.baseInfoForm)
|
|
|
+ .then((res) => {
|
|
|
+ this._resetDialogInfo();
|
|
|
+ this.saveLoading = false;
|
|
|
+ this.addWarningDialog = false;
|
|
|
+ this.$emit('refreshList');
|
|
|
+ this.$message.success('操作成功!');
|
|
|
+ })
|
|
|
+ .finally(() => {
|
|
|
+ this.saveLoading = false;
|
|
|
+ });
|
|
|
+ }
|
|
|
});
|
|
|
},
|
|
|
// 重置弹窗信息
|
|
|
@@ -651,8 +669,8 @@
|
|
|
alarmEquipmentId: '', // 告警设备类型id
|
|
|
alarmEquipmentName: '', // 告警设备类型name
|
|
|
name: '', // 告警名称
|
|
|
- status: false, // 状态
|
|
|
- generateDocumentType: false, // 是否生成保修工单
|
|
|
+ // status: false, // 状态
|
|
|
+ // generateDocumentType: false, // 是否生成保修工单
|
|
|
description: '', // 告警描述
|
|
|
alarmTrigger: 0, // 告警触发条件类型选择
|
|
|
alarmMode: '', // 告警方式
|