修改触发条件

This commit is contained in:
闫晓茹 2024-06-25 11:30:15 +08:00
parent 43b9124dc1
commit ba60f7537b
2 changed files with 72 additions and 54 deletions

View File

@ -22,9 +22,10 @@
>
</el-option>
</el-select>
<!-- 包含 -->
<el-select
disabled
v-model="updata.triggerConditionOperatorName"
v-model="updata.triggerConditionOperator"
style="width: 100px"
@change="changetriggerLogic($event, index)"
>
@ -38,8 +39,8 @@
</el-select>
<el-input
disabled
v-if="updata.dictDataType == 'STRING'"
disabled
v-model="updata.triggerConditionValue"
style="width: 300px"
placeholder="请输入触发条件"
@ -69,7 +70,7 @@
value-format="yyyy-MM-dd"
>
</el-date-picker>
<!-- {{ item }} -->
<el-input
disabled
v-if="updata.dictDataType == 'DECIMAL'"
@ -113,36 +114,35 @@
>
<el-option
v-for="item in optionsname"
:key="item.value"
:label="item.label"
:value="item.value"
:key="item.dictValue"
:label="item.dictLabel"
:value="item.dictValue"
>
</el-option>
</el-select>
<el-select
disabled
v-model="item.triggerConditionOperatorName"
v-model="item.triggerConditionOperator"
style="width: 100px"
@change="changetriggerLogic($event, index)"
>
<el-option
v-for="item in optionstriggerConditionOperator"
:key="item.value"
:label="item.label"
:value="item.value"
:key="item.dictValue"
:label="item.dictLabel"
:value="item.dictValue"
>
</el-option>
</el-select>
<el-input
disabled
v-if="item.dictDataType == 'STRING'"
disabled
v-model="item.triggerConditionValue"
style="width: 300px"
placeholder="请输入触发条件"
maxlength="100"
></el-input>
<el-select
disabled
v-if="item.dictDataType == 'SELECT'"
v-model="item.triggerConditionValue"
style="width: 300px"
@ -155,6 +155,7 @@
>
</el-option>
</el-select>
<el-date-picker
disabled
v-if="item.dictDataType == 'DATE'"
@ -165,7 +166,6 @@
value-format="yyyy-MM-dd"
>
</el-date-picker>
<!-- {{ item }} -->
<el-input
disabled
v-if="item.dictDataType == 'DECIMAL'"
@ -926,12 +926,9 @@ export default {
e.routeId = this.$route.query.id;
e.routeName = this.$route.query.routeName;
});
console.log(
this.openlist.triggerConditionList,
" this.openlist.triggerConditionList"
);
loading.close();
loading.close();
// return;
triggerCondition(this.openlist).then((res) => {
if (res.code == 200) {
this.$notify({
@ -939,10 +936,13 @@ export default {
title: "提示",
message: "修改触发条件成功",
});
this.routeName = res.data;
Cookies.remove("routeName");
Cookies.set("routeName", this.routeName);
// this.$router.go(0);
// window.location.reload();
}
this.infolist();
// this.handlelist();
@ -958,7 +958,7 @@ export default {
triggerConditionName: "",
triggerConditionOperator: "",
triggerConditionValue: "",
triggerConditionName: "",
triggerConditionOperatorName: "",
dictDataType: "STRING",
@ -978,7 +978,7 @@ export default {
triggerConditionName: "",
triggerConditionOperator: "",
triggerConditionValue: "",
triggerConditionName: "",
triggerConditionOperatorName: "",
dictDataType: "STRING",
triggerLogic: "AND",
@ -1203,13 +1203,15 @@ export default {
getList(dictType, this.dictDataType).then((res) => {
this.optionstriggerConditionOperator = res.data;
console.log(
this.optionstriggerConditionOperator,
" this.optionstriggerConditionOperator "
);
});
},
//
changetriggerLogic(e, index) {
console.log(e, index, "e包含,index");
this.openlist.triggerConditionList[index].triggerConditionOperatorName =
this.optionstriggerConditionOperator.find(
(el) => el.dictValue == e
@ -1254,17 +1256,29 @@ export default {
this.routeId = this.$route.query.id;
triggerConditionList(this.routeId).then((res) => {
this.openlist.triggerConditionList = res.data;
this.openlist.triggerConditionList.forEach((p) => {
res.data.forEach((p) => {
this.optiononditionOperators();
p.dictDataType = this.optionsname.find(
(el) => el.dictValue == p.triggerConditionCode
)?.dictDataType;
console.log(p, "0000000000000000");
var dictType = p.triggerConditionCode;
getAgencytype(dictType).then((res) => {
this.ConditionValue = res.data;
});
// console.log(this.ConditionValue,'ConditionValueConditionValueConditionValueConditionValue')
// this.handlelist();
// var dictType = "trigger_condition_operator";
// getList(dictType, this.dictDataType).then((res) => {
// this.optionstriggerConditionOperator = res.data;
// });
});
this.handlelist();
if (res.data.length == 1) {
//
this.updata = res.data[0];
console.log(this.updata, " this.updata");
this.updata.triggerConditionOperatorName =
this.optionstriggerConditionOperator.find(
(el) => el.dictValue == this.updata.triggerConditionOperator
@ -1277,8 +1291,11 @@ export default {
this.optionstriggerConditionOperator.find(
(el) => el.dictValue == this.updata.triggerConditionOperator
)?.dictLabel;
console.log(this.updata, " this.updata");
res.data.splice(0, 1);
this.updatalist = res.data;
console.log(this.updatalist, " this.updatalist");
this.updatalist.forEach((e) => {
e.triggerConditionOperatorName =
this.optionstriggerConditionOperator.find(
@ -1303,12 +1320,12 @@ export default {
o.dictDataType = this.optionsname.find(
(el) => el.dictValue == o.triggerConditionCode
)?.dictDataType;
if (o.triggerConditionCode.includes("SEX")) {
var dictType = "SEX";
getAgencytype(dictType).then((res) => {
this.ConditionValue = res.data;
});
}
// if (o.triggerConditionCode.includes("SEX")) {
// var dictType = "SEX";
// getAgencytype(dictType).then((res) => {
// this.ConditionValue = res.data;
// });
// }
});
this.$set(this.updata, "suitRange", this.openlist.suitRange);
});

View File

@ -93,6 +93,7 @@
v-for="(uitem, uindex) in list.childrenRouteList"
:key="uindex"
>
<!-- {{ uitem }} -->
<div class="title">
<el-tag type="success">触发条件</el-tag>
<span>
@ -473,10 +474,10 @@ export default {
).dictDataType;
this.updata.triggerConditionList[index].dictDataType =
this.optionsname.find((el) => el.dictValue == e).dictDataType;
console.log(
this.updata.triggerConditionList[index].dictDataType,
"this.dictDataType"
);
// console.log(
// this.updata.triggerConditionList[index].dictDataType,
// "this.dictDataType"
// );
this.handlelist();
},
//
@ -595,24 +596,24 @@ export default {
this.editopen = false;
this.resetForm("updataform");
},
editupload() {
// const loading = this.$loading({
// lock: true,
// text: "Loading",
// spinner: "el-icon-loading",
// background: "rgba(0, 0, 0, 0.7)",
// });
triggerConditionedit(this.updataform).then((res) => {
// loading.close();
this.$notify({
type: "success",
title: "提示",
message: "修改触发条件成功",
});
this.info();
this.editopenfalse();
});
},
// editupload() {
// // const loading = this.$loading({
// // lock: true,
// // text: "Loading",
// // spinner: "el-icon-loading",
// // background: "rgba(0, 0, 0, 0.7)",
// // });
// triggerConditionedit(this.updataform).then((res) => {
// // loading.close();
// this.$notify({
// type: "success",
// title: "",
// message: "",
// });
// this.info();
// this.editopenfalse();
// });
// },
openfalse() {
this.updata.triggerConditionList = [
{
@ -651,7 +652,7 @@ export default {
title: "提示",
message: "新增触发条件成功",
});
this.info();
// this.info();
this.openfalse();
}
});