|
@@ -16,6 +16,7 @@
|
|
|
ref="formRef"
|
|
ref="formRef"
|
|
|
label-width="120px"
|
|
label-width="120px"
|
|
|
:rules="rules"
|
|
:rules="rules"
|
|
|
|
|
+ :disabled="type == 'details'"
|
|
|
>
|
|
>
|
|
|
<el-form-item label="类型" required prop="itemType">
|
|
<el-form-item label="类型" required prop="itemType">
|
|
|
<DictSelection
|
|
<DictSelection
|
|
@@ -136,6 +137,7 @@
|
|
|
ref="deviceSelectDialog"
|
|
ref="deviceSelectDialog"
|
|
|
selectType="single"
|
|
selectType="single"
|
|
|
@chooseEquipment="chooseEquipment"
|
|
@chooseEquipment="chooseEquipment"
|
|
|
|
|
+ :multiple="false"
|
|
|
></material-add>
|
|
></material-add>
|
|
|
|
|
|
|
|
<selectMatterRules
|
|
<selectMatterRules
|
|
@@ -205,7 +207,7 @@
|
|
|
|
|
|
|
|
return {
|
|
return {
|
|
|
visible: false,
|
|
visible: false,
|
|
|
- type: 'add', // add新增 edit编辑
|
|
|
|
|
|
|
+ type: 'add', // add新增 edit编辑 details 详情
|
|
|
formBaseData,
|
|
formBaseData,
|
|
|
formData: JSON.parse(JSON.stringify(formBaseData)),
|
|
formData: JSON.parse(JSON.stringify(formBaseData)),
|
|
|
// 表单验证规则
|
|
// 表单验证规则
|
|
@@ -283,10 +285,11 @@
|
|
|
this.formData.executeMethod = '2';
|
|
this.formData.executeMethod = '2';
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
- openEdit(row) {
|
|
|
|
|
- this.title = '编辑事项';
|
|
|
|
|
|
|
+ openEdit(row, type = 'edit') {
|
|
|
|
|
+ console.log('type', type);
|
|
|
|
|
+ this.title = type == 'edit' ? '编辑事项' : '事项详情';
|
|
|
console.log('row', row);
|
|
console.log('row', row);
|
|
|
- this.type = 'edit';
|
|
|
|
|
|
|
+ this.type = type;
|
|
|
this.visible = true;
|
|
this.visible = true;
|
|
|
this.$util.assignObject(this.formData, row);
|
|
this.$util.assignObject(this.formData, row);
|
|
|
this.formData.executeMethod = row.executeMethod + '';
|
|
this.formData.executeMethod = row.executeMethod + '';
|
|
@@ -300,15 +303,14 @@
|
|
|
},
|
|
},
|
|
|
chooseEquipment(data, index, categoryId) {
|
|
chooseEquipment(data, index, categoryId) {
|
|
|
console.log('data', data, index, categoryId);
|
|
console.log('data', data, index, categoryId);
|
|
|
- this.formData.deviceId = data[0]?.id || null;
|
|
|
|
|
- this.formData.deviceName = data[0]?.name || '';
|
|
|
|
|
- if (this.rules && this.rules.length > 1) {
|
|
|
|
|
- // 提示用户选择的规则有多个事项规则
|
|
|
|
|
- this.$message.warning('所选设备包含多个设备,请注意选择');
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ this.formData.deviceId = data?.id || null;
|
|
|
|
|
+ this.formData.deviceName = data?.name || '';
|
|
|
},
|
|
},
|
|
|
// 去选择事项规则
|
|
// 去选择事项规则
|
|
|
selectRulesId() {
|
|
selectRulesId() {
|
|
|
|
|
+ if (this.type == 'details') {
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
this.$refs.selectMatterRulesRef.open();
|
|
this.$refs.selectMatterRulesRef.open();
|
|
|
},
|
|
},
|
|
|
confirm() {
|
|
confirm() {
|
|
@@ -347,6 +349,9 @@
|
|
|
},
|
|
},
|
|
|
// 去选择记录规则
|
|
// 去选择记录规则
|
|
|
selectReleaseId() {
|
|
selectReleaseId() {
|
|
|
|
|
+ if (this.type == 'details') {
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
this.$refs.selectReleaseRulesRef.open(
|
|
this.$refs.selectReleaseRulesRef.open(
|
|
|
this.formData.reportWorkType,
|
|
this.formData.reportWorkType,
|
|
|
this.formData.produceTaskId
|
|
this.formData.produceTaskId
|