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 }}
-
-
+
+
+ 添加{{
+ 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"})
}
}
}