|
@@ -104,6 +104,18 @@
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
</el-col>
|
|
</el-col>
|
|
|
</el-row>
|
|
</el-row>
|
|
|
|
|
+ <el-row style="margin-bottom: 10px">
|
|
|
|
|
+ <el-col :span="8">
|
|
|
|
|
+ <el-form-item label="模块分类" required prop="reportWorkType">
|
|
|
|
|
+ <dict-selection
|
|
|
|
|
+ v-model="formData.reportWorkType"
|
|
|
|
|
+ dictName="记录规则报工类型"
|
|
|
|
|
+ placeholder="请选择模块"
|
|
|
|
|
+ :clearable="false"
|
|
|
|
|
+ ></dict-selection>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ </el-col>
|
|
|
|
|
+ </el-row>
|
|
|
<el-row style="margin-bottom: 10px">
|
|
<el-row style="margin-bottom: 10px">
|
|
|
<el-col :span="24">
|
|
<el-col :span="24">
|
|
|
<el-form-item label="周期" prop="frequencyValue" required>
|
|
<el-form-item label="周期" prop="frequencyValue" required>
|
|
@@ -452,40 +464,45 @@
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
data() {
|
|
data() {
|
|
|
|
|
+ const formDateBase = {
|
|
|
|
|
+ id: null,
|
|
|
|
|
+ classify: null,
|
|
|
|
|
+ deviceId: null,
|
|
|
|
|
+ deviceName: '',
|
|
|
|
|
+ frequencyUnit: 2,
|
|
|
|
|
+ frequencyValue: null,
|
|
|
|
|
+ name: '',
|
|
|
|
|
+ recordRulesDetailList: [
|
|
|
|
|
+ {
|
|
|
|
|
+ id: 0,
|
|
|
|
|
+ defaultValue: '',
|
|
|
|
|
+ maxValue: null,
|
|
|
|
|
+ minValue: null,
|
|
|
|
|
+ paramType: null,
|
|
|
|
|
+ paramValue: null,
|
|
|
|
|
+ remark: '',
|
|
|
|
|
+ symbol: null,
|
|
|
|
|
+ tools: [],
|
|
|
|
|
+ unitName: null,
|
|
|
|
|
+ productName: '',
|
|
|
|
|
+ productCode: ''
|
|
|
|
|
+ }
|
|
|
|
|
+ ],
|
|
|
|
|
+ recordRulesCycleList: [],
|
|
|
|
|
+ startDate: null,
|
|
|
|
|
+ stopDate: null,
|
|
|
|
|
+ version: 1,
|
|
|
|
|
+ code: '',
|
|
|
|
|
+ fromId: null,
|
|
|
|
|
+ // 模块分类 参考字典项:record_rules_report_work_type
|
|
|
|
|
+ reportWorkType: '1'
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
return {
|
|
return {
|
|
|
dialogTitle: '',
|
|
dialogTitle: '',
|
|
|
visible: false,
|
|
visible: false,
|
|
|
- formData: {
|
|
|
|
|
- id: null,
|
|
|
|
|
- classify: null,
|
|
|
|
|
- deviceId: null,
|
|
|
|
|
- deviceName: '',
|
|
|
|
|
- frequencyUnit: 2,
|
|
|
|
|
- frequencyValue: null,
|
|
|
|
|
- name: '',
|
|
|
|
|
- recordRulesDetailList: [
|
|
|
|
|
- {
|
|
|
|
|
- id: 0,
|
|
|
|
|
- defaultValue: '',
|
|
|
|
|
- maxValue: null,
|
|
|
|
|
- minValue: null,
|
|
|
|
|
- paramType: null,
|
|
|
|
|
- paramValue: null,
|
|
|
|
|
- remark: '',
|
|
|
|
|
- symbol: null,
|
|
|
|
|
- tools: [],
|
|
|
|
|
- unitName: null,
|
|
|
|
|
- productName: '',
|
|
|
|
|
- productCode: ''
|
|
|
|
|
- }
|
|
|
|
|
- ],
|
|
|
|
|
- recordRulesCycleList: [],
|
|
|
|
|
- startDate: null,
|
|
|
|
|
- stopDate: null,
|
|
|
|
|
- version: 1,
|
|
|
|
|
- code: '',
|
|
|
|
|
- fromId: null
|
|
|
|
|
- },
|
|
|
|
|
|
|
+ formDateBase,
|
|
|
|
|
+ formData: JSON.parse(JSON.stringify(formDateBase)),
|
|
|
formRules: {
|
|
formRules: {
|
|
|
name: [
|
|
name: [
|
|
|
{ required: true, message: '请输入规则名称', trigger: 'blur' }
|
|
{ required: true, message: '请输入规则名称', trigger: 'blur' }
|
|
@@ -513,6 +530,10 @@
|
|
|
],
|
|
],
|
|
|
deviceName: [
|
|
deviceName: [
|
|
|
{ required: true, message: '请输入选择设备', trigger: 'blur' }
|
|
{ required: true, message: '请输入选择设备', trigger: 'blur' }
|
|
|
|
|
+ ],
|
|
|
|
|
+ reportWorkType: [
|
|
|
|
|
+ { required: true, message: '请选择模块分类', trigger: 'change' },
|
|
|
|
|
+ { required: true, message: '请选择模块分类', trigger: 'blur' }
|
|
|
]
|
|
]
|
|
|
},
|
|
},
|
|
|
recordSheet: [], // 记录表
|
|
recordSheet: [], // 记录表
|
|
@@ -520,7 +541,8 @@
|
|
|
dataIndex: null,
|
|
dataIndex: null,
|
|
|
showEdit: false,
|
|
showEdit: false,
|
|
|
btnLoading: false,
|
|
btnLoading: false,
|
|
|
- currentRow: null
|
|
|
|
|
|
|
+ currentRow: null,
|
|
|
|
|
+ type: ''
|
|
|
};
|
|
};
|
|
|
},
|
|
},
|
|
|
mounted() {
|
|
mounted() {
|
|
@@ -539,6 +561,7 @@
|
|
|
this.formData.startDate = new Date(row.startDate);
|
|
this.formData.startDate = new Date(row.startDate);
|
|
|
this.formData.stopDate = new Date(row.stopDate);
|
|
this.formData.stopDate = new Date(row.stopDate);
|
|
|
this.formData.classify = this.formData.classify + '';
|
|
this.formData.classify = this.formData.classify + '';
|
|
|
|
|
+ this.formData.reportWorkType = this.formData.reportWorkType + '';
|
|
|
|
|
|
|
|
this.recordrulesDetailPage(row);
|
|
this.recordrulesDetailPage(row);
|
|
|
this.recordrulesCyclePage(row);
|
|
this.recordrulesCyclePage(row);
|
|
@@ -591,38 +614,7 @@
|
|
|
this.visible = false;
|
|
this.visible = false;
|
|
|
this.$refs['formRef'].resetFields();
|
|
this.$refs['formRef'].resetFields();
|
|
|
// 清空表单数据
|
|
// 清空表单数据
|
|
|
- this.formData = {
|
|
|
|
|
- id: null,
|
|
|
|
|
- classify: null,
|
|
|
|
|
- deviceId: null,
|
|
|
|
|
- deviceName: '',
|
|
|
|
|
- frequencyUnit: null,
|
|
|
|
|
- frequencyValue: null,
|
|
|
|
|
- name: '',
|
|
|
|
|
- recordRulesDetailList: [
|
|
|
|
|
- {
|
|
|
|
|
- id: 0,
|
|
|
|
|
- defaultValue: '',
|
|
|
|
|
- maxValue: null,
|
|
|
|
|
- minValue: null,
|
|
|
|
|
- paramType: null,
|
|
|
|
|
- paramValue: null,
|
|
|
|
|
- remark: '',
|
|
|
|
|
- symbol: null,
|
|
|
|
|
- toolCodes: null,
|
|
|
|
|
- tools: [],
|
|
|
|
|
- unitName: null,
|
|
|
|
|
- productName: '',
|
|
|
|
|
- productCode: ''
|
|
|
|
|
- }
|
|
|
|
|
- ],
|
|
|
|
|
- recordRulesCycleList: [],
|
|
|
|
|
- startDate: null,
|
|
|
|
|
- stopDate: null,
|
|
|
|
|
- version: 1,
|
|
|
|
|
- code: '',
|
|
|
|
|
- fromId: null
|
|
|
|
|
- };
|
|
|
|
|
|
|
+ this.formData = JSON.parse(JSON.stringify(this.formDateBase));
|
|
|
},
|
|
},
|
|
|
// 保存
|
|
// 保存
|
|
|
confirm() {
|
|
confirm() {
|
|
@@ -641,11 +633,30 @@
|
|
|
this.btnLoading = true;
|
|
this.btnLoading = true;
|
|
|
|
|
|
|
|
this.formData.recordRulesCycleList =
|
|
this.formData.recordRulesCycleList =
|
|
|
- this.$refs.cycleMultipleRef.recordRulesCycleList.map(
|
|
|
|
|
- (i, index) => {
|
|
|
|
|
|
|
+ this.$refs.cycleMultipleRef.recordRulesCycleList
|
|
|
|
|
+ .map((i) => {
|
|
|
|
|
+ // 根据月日时分排序计算权重排序
|
|
|
|
|
+ let sortNum = 0;
|
|
|
|
|
+ if (i.month) {
|
|
|
|
|
+ sortNum += i.month * 60 * 24 * 30;
|
|
|
|
|
+ }
|
|
|
|
|
+ if (i.day) {
|
|
|
|
|
+ sortNum += i.day * 60 * 24;
|
|
|
|
|
+ }
|
|
|
|
|
+ if (i.hour) {
|
|
|
|
|
+ sortNum += i.hour * 60;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if (i.minute) {
|
|
|
|
|
+ sortNum += i.minute * 1;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ return { ...i, sortNum };
|
|
|
|
|
+ })
|
|
|
|
|
+ .sort((a, b) => a.sortNum - b.sortNum)
|
|
|
|
|
+ .map((i, index) => {
|
|
|
return { ...i, sortNum: index + 1 };
|
|
return { ...i, sortNum: index + 1 };
|
|
|
- }
|
|
|
|
|
- );
|
|
|
|
|
|
|
+ });
|
|
|
|
|
|
|
|
const body = { ...this.formData };
|
|
const body = { ...this.formData };
|
|
|
|
|
|
|
@@ -693,11 +704,30 @@
|
|
|
try {
|
|
try {
|
|
|
this.btnLoading = true;
|
|
this.btnLoading = true;
|
|
|
this.formData.recordRulesCycleList =
|
|
this.formData.recordRulesCycleList =
|
|
|
- this.$refs.cycleMultipleRef.recordRulesCycleList.map(
|
|
|
|
|
- (i, index) => {
|
|
|
|
|
|
|
+ this.$refs.cycleMultipleRef.recordRulesCycleList
|
|
|
|
|
+ .map((i) => {
|
|
|
|
|
+ // 根据月日时分排序计算权重排序
|
|
|
|
|
+ let sortNum = 0;
|
|
|
|
|
+ if (i.month) {
|
|
|
|
|
+ sortNum += i.month * 60 * 24 * 30;
|
|
|
|
|
+ }
|
|
|
|
|
+ if (i.day) {
|
|
|
|
|
+ sortNum += i.day * 60 * 24;
|
|
|
|
|
+ }
|
|
|
|
|
+ if (i.hour) {
|
|
|
|
|
+ sortNum += i.hour * 60;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if (i.minute) {
|
|
|
|
|
+ sortNum += i.minute * 1;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ return { ...i, sortNum };
|
|
|
|
|
+ })
|
|
|
|
|
+ .sort((a, b) => a.sortNum - b.sortNum)
|
|
|
|
|
+ .map((i, index) => {
|
|
|
return { ...i, sortNum: index + 1 };
|
|
return { ...i, sortNum: index + 1 };
|
|
|
- }
|
|
|
|
|
- );
|
|
|
|
|
|
|
+ });
|
|
|
|
|
|
|
|
const body = { ...this.formData };
|
|
const body = { ...this.formData };
|
|
|
|
|
|