|
|
@@ -224,6 +224,7 @@
|
|
|
>
|
|
|
<template v-slot:action="{ row }">
|
|
|
<el-link
|
|
|
+ v-if="type != 'detail'"
|
|
|
type="danger"
|
|
|
:underline="false"
|
|
|
icon="el-icon-delete"
|
|
|
@@ -272,14 +273,29 @@
|
|
|
:cache-key="cacheKeyUrl"
|
|
|
>
|
|
|
<template v-slot:toolbar>
|
|
|
- <el-button
|
|
|
- type="primary"
|
|
|
- icon="el-icon-plus"
|
|
|
- class="ele-btn-icon"
|
|
|
- @click="addRow"
|
|
|
- >
|
|
|
- 新建
|
|
|
- </el-button>
|
|
|
+ <div style="display: flex; align-items: center; gap: 10px">
|
|
|
+ <el-button
|
|
|
+ type="primary"
|
|
|
+ icon="el-icon-plus"
|
|
|
+ class="ele-btn-icon"
|
|
|
+ @click="addRow"
|
|
|
+ >
|
|
|
+ 新建
|
|
|
+ </el-button>
|
|
|
+
|
|
|
+ <el-form-item
|
|
|
+ v-if="formData.executeMethodTitle"
|
|
|
+ label="编辑执行方式:"
|
|
|
+ label-width="110px"
|
|
|
+ style="margin-bottom: 0"
|
|
|
+ >
|
|
|
+ <el-input
|
|
|
+ type="text"
|
|
|
+ :disabled="formData.executeMethodTitle == '无执行方式'"
|
|
|
+ v-model="executeMethodTitleComputed"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ </div>
|
|
|
</template>
|
|
|
|
|
|
<template v-slot:paramType="{ row }">
|
|
|
@@ -437,18 +453,20 @@
|
|
|
</template>
|
|
|
|
|
|
<template v-slot:executeMethodTitle="{ row }">
|
|
|
- <el-select v-model="row.executeMethodTitle" clearable size="mini">
|
|
|
+ <!-- <el-select v-model="row.executeMethodTitle" clearable size="mini">
|
|
|
<el-option
|
|
|
v-for="item in formData.executeMethodList"
|
|
|
:key="item"
|
|
|
:label="item"
|
|
|
:value="item"
|
|
|
></el-option>
|
|
|
- </el-select>
|
|
|
+ </el-select> -->
|
|
|
+ {{ row.executeMethodTitle }}
|
|
|
</template>
|
|
|
|
|
|
<template v-slot:action="{ row }">
|
|
|
<el-link
|
|
|
+ v-if="type != 'detail'"
|
|
|
type="danger"
|
|
|
:underline="false"
|
|
|
icon="el-icon-delete"
|
|
|
@@ -622,7 +640,7 @@
|
|
|
label: '执行方式',
|
|
|
align: 'center',
|
|
|
slot: 'executeMethodTitle',
|
|
|
- minWidth: 180
|
|
|
+ minWidth: 110
|
|
|
},
|
|
|
{
|
|
|
columnKey: 'action',
|
|
|
@@ -636,7 +654,7 @@
|
|
|
];
|
|
|
},
|
|
|
versionText() {
|
|
|
- if (this.type == 'clone') {
|
|
|
+ if (this.type == 'change') {
|
|
|
return '系统自动生成';
|
|
|
}
|
|
|
return (
|
|
|
@@ -701,6 +719,34 @@
|
|
|
} else {
|
|
|
return this.formData.details;
|
|
|
}
|
|
|
+ },
|
|
|
+ executeMethodTitleComputed: {
|
|
|
+ get() {
|
|
|
+ return this.formData.executeMethodTitle;
|
|
|
+ },
|
|
|
+ set(value) {
|
|
|
+ // 更改 明细表的 executeMethodTitle
|
|
|
+ this.formData.details = this.formData.details.map((i) => {
|
|
|
+ if (i.executeMethodTitle == this.formData.executeMethodTitle) {
|
|
|
+ return {
|
|
|
+ ...i,
|
|
|
+ executeMethodTitle: value
|
|
|
+ };
|
|
|
+ }
|
|
|
+ return i;
|
|
|
+ });
|
|
|
+
|
|
|
+ this.formData.executeMethodList = this.formData.executeMethodList.map(
|
|
|
+ (i) => {
|
|
|
+ if (i == this.formData.executeMethodTitle) {
|
|
|
+ return value;
|
|
|
+ }
|
|
|
+ return i;
|
|
|
+ }
|
|
|
+ );
|
|
|
+
|
|
|
+ this.formData.executeMethodTitle = value;
|
|
|
+ }
|
|
|
}
|
|
|
},
|
|
|
data() {
|
|
|
@@ -822,11 +868,12 @@
|
|
|
this.type = type;
|
|
|
console.log('type', type, row);
|
|
|
|
|
|
- if (type == 'edit' || type == 'detail') {
|
|
|
- this.getDetils(row.id);
|
|
|
- }
|
|
|
-
|
|
|
- if (type == 'clone') {
|
|
|
+ if (
|
|
|
+ type == 'edit' ||
|
|
|
+ type == 'detail' ||
|
|
|
+ type == 'change' ||
|
|
|
+ type == 'clone'
|
|
|
+ ) {
|
|
|
this.getDetils(row.id);
|
|
|
}
|
|
|
|
|
|
@@ -925,12 +972,18 @@
|
|
|
this.formData.classify = this.formData.classify + '';
|
|
|
this.formData.reportWorkType = this.formData.reportWorkType + '';
|
|
|
|
|
|
- if (this.type == 'clone') {
|
|
|
+ if (this.type == 'change') {
|
|
|
this.formData.name = this.formData.name + '-副本';
|
|
|
|
|
|
this.formData.fromId = id;
|
|
|
this.formData.id = null;
|
|
|
}
|
|
|
+
|
|
|
+ if (this.type == 'clone') {
|
|
|
+ this.formData.fromId = null;
|
|
|
+ this.formData.id = null;
|
|
|
+ }
|
|
|
+
|
|
|
this.loading = false;
|
|
|
} catch (error) {
|
|
|
this.loading = false;
|
|
|
@@ -984,7 +1037,7 @@
|
|
|
const exists = this.formData.details.some(
|
|
|
(detail) => detail.executeMethodTitle === item
|
|
|
);
|
|
|
- if (!exists) {
|
|
|
+ if (!exists && item != '无执行方式') {
|
|
|
this.$message.warning(
|
|
|
`请为执行方式 "${item}" 添加至少一条规则项`
|
|
|
);
|
|
|
@@ -1005,9 +1058,9 @@
|
|
|
|
|
|
const body = this.formatBody();
|
|
|
|
|
|
- if (this.type == 'add') {
|
|
|
+ if (this.type == 'add' || this.type == 'clone') {
|
|
|
await recordrulesSave(body);
|
|
|
- } else if (this.type == 'clone') {
|
|
|
+ } else if (this.type == 'change') {
|
|
|
await recordrulesUpdateVersion(body);
|
|
|
} else {
|
|
|
// 编辑
|