From b148035c4012c97a920783cc0596fa413b160a96 Mon Sep 17 00:00:00 2001 From: aixianling Date: Wed, 26 Jan 2022 15:11:56 +0800 Subject: [PATCH 1/2] BUG 26970 --- packages/party/partyMember/components/Add.vue | 254 ++++++------------ .../party/partyMember/components/List.vue | 3 +- 2 files changed, 78 insertions(+), 179 deletions(-) diff --git a/packages/party/partyMember/components/Add.vue b/packages/party/partyMember/components/Add.vue index 3193f5b3..2a07748a 100644 --- a/packages/party/partyMember/components/Add.vue +++ b/packages/party/partyMember/components/Add.vue @@ -211,12 +211,7 @@ v-model="form.partyOrgName" > @@ -309,13 +304,13 @@ @@ -348,7 +343,7 @@ placeholder="请选择流动情况" :selectList="dict.getDict('flowStatus')" @change="flowStatusChange" - > + /> - - - - + + + + -
- -
- - 添加{{ activeName }} -
-
+ + + { + }).then((res) => { if (res?.data) { - this.form = { - ...res.data, - }; + this.form = res.data } }); }, - editJob(query, index) { - this.jobForm = { - ...query, - date: [query.starTime, query.endTime], - }; - this.jobId = index; - - this.isShowJobForm = true; - }, editStar(query, index) { - this.starForm = { - ...query, - }; + this.starForm = JSON.parse(JSON.stringify(query)); this.starId = index; - this.isShowStarForm = true; }, + editJob(query, index) { + this.jobForm = JSON.parse(JSON.stringify(query)); + this.jobId = index; + this.isShowJobForm = true; + }, editDisciplinary(query, index) { - this.disciplinaryForm = { - ...query, - }; + this.disciplinaryForm = JSON.parse(JSON.stringify(query)); this.disciplinaryId = index; this.isShowDisciplinaryForm = true; }, idChange(val) { - if (val.length == 18) { - this.IdCard(val); - } else { - this.form.sex = ""; - this.form.age = ""; - this.form.birthday = ""; - } - }, - IdCard(UUserCard) { - if (UUserCard) { - let arr = []; - let birth = - UUserCard.substring(6, 10) + - "-" + - UUserCard.substring(10, 12) + - "-" + - UUserCard.substring(12, 14) + - " 00:00:00"; - arr.push(birth); - if (parseInt(UUserCard.substr(16, 1)) % 2 == 1) { - arr.push("1"); - } else { - arr.push("0"); - } - - const myDate = new Date(); - const month = myDate.getMonth() + 1; - const day = myDate.getDate(); - let age = myDate.getFullYear() - UUserCard.substring(6, 10) - 1; - if ( - UUserCard.substring(10, 12) < month || - (UUserCard.substring(10, 12) == month && - UUserCard.substring(12, 14) <= day) - ) { - age++; - } - arr.push(age); - this.form.sex = arr[1]; - this.form.age = arr[2]; - this.form.birthday = arr[0]; - } + let info = this.$idCardNoUtil.getIdCardInfo(val) + this.form.sex = info.sex || ""; + this.form.birthday = info.birthday || ""; + this.form.age = this.$calcAge(val) || ""; }, checkName(val) { for (let i in this.form) { @@ -1009,74 +959,46 @@ export default { } this.form.avatarUrl = val.photo; }, - onDisciplinarForm() { - this.$refs.disciplinaryForm.validate((valid) => { - if (valid) { - if (this.disciplinaryId !== "") { - this.$set( - this.form.disciplinaryInfoList, - this.disciplinaryId, - JSON.parse(JSON.stringify(this.disciplinaryForm)) - ); - } else { - this.form.disciplinaryInfoList.push( - JSON.parse(JSON.stringify(this.disciplinaryForm)) - ); - } - this.isShowDisciplinaryForm = false; - this.$message.success( - this.disciplinaryId !== "" ? "编辑成功" : "新增成功" - ); - } - }); - }, onJobForm() { this.$refs.jobForm.validate((valid) => { if (valid) { - if (this.jobId !== "") { - this.$set( - this.form.workInfoList, - this.jobId, - JSON.parse( - JSON.stringify({ - ...this.jobForm, - starTime: this.jobForm.date[0], - endTime: this.jobForm.date[1], - }) - ) - ); + let info = JSON.parse(JSON.stringify({ + ...this.jobForm, + starTime: this.jobForm.date[0], + endTime: this.jobForm.date[1], + })) + if (!!this.jobId) { + this.form.workInfoList.splice(this.jobId, 1, info) } else { - this.form.workInfoList.push( - JSON.parse( - JSON.stringify({ - ...this.jobForm, - starTime: this.jobForm.date[0], - endTime: this.jobForm.date[1], - }) - ) - ); + this.form.workInfoList.push(info) } - this.isShowJobForm = false; - this.$message.success(this.jobId !== "" ? "编辑成功" : "新增成功"); } }); }, onStarForm() { this.$refs.starForm.validate((valid) => { if (valid) { - if (this.starId !== "") { - this.$set( - this.form.starList, - this.starId, - JSON.parse(JSON.stringify(this.starForm)) - ); + let info = JSON.parse(JSON.stringify(this.starForm)) + if (!!this.starId) { + this.form.starList.splice(this.starId, 1, info) } else { - this.form.starList.push(JSON.parse(JSON.stringify(this.starForm))); + this.form.starList.push(info) } - this.isShowStarForm = false; - this.$message.success(this.starId !== "" ? "编辑成功" : "新增成功"); + } + }); + }, + onDisciplinarForm() { + this.$refs.disciplinaryForm.validate((valid) => { + if (valid) { + let info = JSON.parse(JSON.stringify(this.disciplinaryForm)) + if (!!this.disciplinaryId) { + this.form.disciplinaryInfoList.splice(this.disciplinaryId, 1, info) + } else { + this.form.disciplinaryInfoList.push(info) + } + this.isShowDisciplinaryForm = false; } }); }, @@ -1108,9 +1030,8 @@ export default { confirm() { this.$refs.form.validate((valid) => { if (valid) { - this.instance - .post(`/app/appparty/addOrUpdate`, { - ...this.form, + this.instance.post(`/app/appparty/addOrUpdate`, { + ...this.form }) .then((res) => { if (res.code == 0) { @@ -1127,12 +1048,10 @@ export default { this.$router.push({}); }, handlePartyOrgSelect(e) { - let {isLeaf, name, id} = e?.[0]; + let {isLeaf, name, id} = e?.[0] || {}; if (isLeaf == 1) { this.form.partyOrgName = name; this.form.partyOrgId = id; - } else { - this.$message.error("请选择党支部"); } }, }, @@ -1160,6 +1079,12 @@ export default { } } + ::v-deep.cardTabs { + .el-tabs__header { + padding: 0; + } + } + .audit-0 { color: #ff8822 !important; } @@ -1167,30 +1092,5 @@ export default { .audit-1 { color: #2ea222 !important; } - - .add-btn { - display: flex; - align-items: center; - justify-content: space-between; - margin: 10px 0 20px; - - div { - display: flex; - align-items: center; - color: #2266ff; - font-size: 14px; - - &:hover { - opacity: 0.6; - cursor: pointer; - user-select: none; - } - - i { - line-height: 1; - margin-right: 4px; - } - } - } } diff --git a/packages/party/partyMember/components/List.vue b/packages/party/partyMember/components/List.vue index 7c300128..6f828ed1 100644 --- a/packages/party/partyMember/components/List.vue +++ b/packages/party/partyMember/components/List.vue @@ -254,8 +254,7 @@ export default { this.$router.push({query: {id}}) }, toAdd(id) { - let {id: oid, name: oname} = this.selected - this.$router.push({query: {id, oid, oname}, hash: "#add"}) + this.$router.push({query: {id}, hash: "#add"}) } } } From bce382fcc18489dcdb8c5ebd337a46227736ef10 Mon Sep 17 00:00:00 2001 From: aixianling Date: Wed, 26 Jan 2022 15:34:01 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E4=B8=8A=E6=9E=B6=E7=89=88=E6=8E=A5?= =?UTF-8?q?=E5=85=A5=E8=8F=9C=E5=8D=95=E7=AE=A1=E7=90=86,=E8=B4=A6?= =?UTF-8?q?=E5=8F=B7=E8=A7=92=E8=89=B2=E7=AE=A1=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- project/sass/core.import.json | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/project/sass/core.import.json b/project/sass/core.import.json index 2a861905..ef8fa998 100644 --- a/project/sass/core.import.json +++ b/project/sass/core.import.json @@ -3,5 +3,7 @@ "AppDictionary": "数据字典", "AppQyWxConfig": "企业微信配置", "AppUserInfo": "个人中心", - "AppRightsManager": "权限管理" + "AppRightsManager": "权限管理", + "AppAccountRole": "账号角色", + "AppMenuManager": "菜单管理" }