From 026fd37a22cd78a964136d149909e5c675a2bea1 Mon Sep 17 00:00:00 2001
From: shijingjing <1789544664@qq.com>
Date: Mon, 17 Oct 2022 15:59:19 +0800
Subject: [PATCH] =?UTF-8?q?=20=20=E8=AF=A6=E6=83=85?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../components/electionAdd.vue | 100 +++++++++++++-----
.../components/electionList.vue | 20 ++--
2 files changed, 81 insertions(+), 39 deletions(-)
diff --git a/project/pingchang/apps/AppGeneralElection/components/electionAdd.vue b/project/pingchang/apps/AppGeneralElection/components/electionAdd.vue
index 70b0be68..b9503ecb 100644
--- a/project/pingchang/apps/AppGeneralElection/components/electionAdd.vue
+++ b/project/pingchang/apps/AppGeneralElection/components/electionAdd.vue
@@ -1,7 +1,41 @@
-
-
+
+
+
+
+
+
+
+ 修改
+
+
+
+
+
+
+
+
+
+
+
+ {{ item }}
+ ,
+
+
+
+
+ {{ item }}
+ ,
+
+
+
+
+
+
+
+
+
@@ -80,31 +114,7 @@
-
+
@@ -114,7 +124,9 @@ export default {
props: {
instance: Function,
dict: Object,
+ params: Object,
},
+
data() {
let validCandidate = (rule, value, callback) => {
if (!value.length) {
@@ -154,10 +166,20 @@ export default {
},
id: '',
isEdit: false,
+ info: {},
+ candidateUsersList: '',
+ voteUsersList: '',
}
},
computed: {
},
+ created() {
+ if(this.params && this.params.id) {
+ this.id = this.params.id
+ this.isEdit = this.params.isEdit
+ this.getDetail()
+ }
+ },
methods: {
cancel (isRefresh) {
this.$emit('change', {
@@ -165,6 +187,20 @@ export default {
isRefresh: !!isRefresh
})
},
+ getDetail() {
+ this.instance.post(`/app/appgeneralelectioninfo/queryDetailById`,null, {
+ params: {id:this.id}
+ }).then((res) => {
+ if(res?.data) {
+ // console.log(res.data);
+ this.form = res.data,
+ this.info = res.data
+ this.candidateUsersList = res.data.candidateUsers.map(v=> v.name)
+ this.voteUsersList = res.data.voteUsers.map(v=> v.name)
+ }
+ })
+ },
+ edit() {},
selectCandidate(v) {
this.form.candidateUsers = v
},
@@ -173,9 +209,11 @@ export default {
},
handlePartyOrgSelect(v) {
if(v) {
- // console.log(v);
this.form.organizationName = v[0].name
this.form.partyOrganizations = [v[0]]
+ } else {
+ this.form.organizationName = this.chooseUserList[0].name
+ this.form.partyOrganizations = this.chooseUserList
}
},
confirm() {
@@ -185,7 +223,11 @@ export default {
...this.form
}).then(res => {
if(res.code == 0) {
- this.$message.success('新增成功')
+ if(this.id) {
+ this.$message.success('编辑成功')
+ } else {
+ this.$message.success('新增成功')
+ }
this.cancel(false)
}
}).catch((err) => {
diff --git a/project/pingchang/apps/AppGeneralElection/components/electionList.vue b/project/pingchang/apps/AppGeneralElection/components/electionList.vue
index 35e80a2a..42441eeb 100644
--- a/project/pingchang/apps/AppGeneralElection/components/electionList.vue
+++ b/project/pingchang/apps/AppGeneralElection/components/electionList.vue
@@ -5,7 +5,7 @@
- 添加
+ 添加
@@ -18,8 +18,8 @@
- 编辑
- 详情
+ 编辑
+ 详情
删除
@@ -57,11 +57,11 @@ export default {
computed: {
colConfigs() {
return [
- {prop: "", label: "标题", align: "left", showOverflowTooltip: true},
- {prop: "", label: "所属支部", align: "center"},
- {prop: "", label: "选举方式", align: "center"},
- {prop: "", label: "应选人数", align: "center"},
- {prop: "", label: "状态", align: "center",width: "180px"},
+ {prop: "title", label: "标题", align: "left", showOverflowTooltip: true},
+ {prop: "organizationName", label: "所属支部", align: "center"},
+ {prop: "electionMethod", label: "选举方式", align: "center"},
+ {prop: "chooseNumber", label: "应选人数", align: "center"},
+ {prop: "status", label: "状态", align: "center",width: "180px"},
{ slot: "options", },
]
}
@@ -75,17 +75,17 @@ export default {
}
}).then(res=> {
if(res?.data) {
- // console.log(res);
this.tableData = res.data.records
this.total.total = res.data.total
}
})
},
- toAdd(id) {
+ toAdd(id,flag) {
this.$emit('change', {
type: 'electionAdd',
params: {
id: id || '',
+ isEdit: flag
}
})
},