BUG 26970
This commit is contained in:
@@ -211,12 +211,7 @@
|
||||
v-model="form.partyOrgName"
|
||||
>
|
||||
<template slot="append">
|
||||
<ai-party
|
||||
:instance="instance"
|
||||
size="small"
|
||||
:value="form.partyOrgId"
|
||||
@origin="handlePartyOrgSelect"
|
||||
/>
|
||||
<ai-party :instance="instance" size="small" :value="form.partyOrgId" @origin="handlePartyOrgSelect"/>
|
||||
</template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
@@ -309,13 +304,13 @@
|
||||
</el-form-item>
|
||||
<el-form-item label="任职日期" prop="partyStartDate">
|
||||
<el-date-picker
|
||||
size="small"
|
||||
v-model="form.partyStartDate"
|
||||
type="date"
|
||||
placeholder="选择日期"
|
||||
style="width: 100%"
|
||||
format="yyyy-MM-dd"
|
||||
:value-format="'yyyy-MM-dd'"
|
||||
size="small"
|
||||
v-model="form.partyStartDate"
|
||||
type="date"
|
||||
placeholder="选择日期"
|
||||
style="width: 100%"
|
||||
format="yyyy-MM-dd"
|
||||
:value-format="'yyyy-MM-dd'"
|
||||
>
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
@@ -348,7 +343,7 @@
|
||||
placeholder="请选择流动情况"
|
||||
:selectList="dict.getDict('flowStatus')"
|
||||
@change="flowStatusChange"
|
||||
></ai-select>
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
label="流入组织"
|
||||
@@ -467,18 +462,19 @@
|
||||
></ai-select>
|
||||
</el-form-item>
|
||||
</div>
|
||||
<el-tabs v-model="activeName">
|
||||
<el-tab-pane label="五星党员" name="五星党员" lazy></el-tab-pane>
|
||||
<el-tab-pane label="工作信息" name="工作信息" lazy></el-tab-pane>
|
||||
<el-tab-pane label="违纪信息" name="违纪信息" lazy></el-tab-pane>
|
||||
<el-tabs v-model="activeName" class="cardTabs">
|
||||
<el-tab-pane label="五星党员" name="五星党员" lazy/>
|
||||
<el-tab-pane label="工作信息" name="工作信息" lazy/>
|
||||
<el-tab-pane label="违纪信息" name="违纪信息" lazy/>
|
||||
</el-tabs>
|
||||
<div class="add-btn">
|
||||
<span></span>
|
||||
<div @click="addForm(activeName)">
|
||||
<i class="iconfont iconAdd"></i>
|
||||
<span>添加{{ activeName }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<ai-search-bar>
|
||||
<template #right>
|
||||
<el-button type="text" icon="iconfont iconAdd" @click="addForm(activeName)">添加{{
|
||||
activeName
|
||||
}}
|
||||
</el-button>
|
||||
</template>
|
||||
</ai-search-bar>
|
||||
<ai-table
|
||||
v-if="activeName === '五星党员'"
|
||||
:border="true"
|
||||
@@ -779,6 +775,7 @@ export default {
|
||||
props: {
|
||||
instance: Function,
|
||||
dict: Object,
|
||||
selected: Object
|
||||
},
|
||||
computed: {
|
||||
isEdit() {
|
||||
@@ -882,7 +879,6 @@ export default {
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.initOrg();
|
||||
this.dict.load(
|
||||
"partyStatus",
|
||||
"education",
|
||||
@@ -893,7 +889,12 @@ export default {
|
||||
"sex",
|
||||
"nation"
|
||||
);
|
||||
this.getInfo();
|
||||
if (this.isEdit) {
|
||||
this.getInfo()
|
||||
} else {
|
||||
this.initOrg();
|
||||
}
|
||||
|
||||
},
|
||||
methods: {
|
||||
flowStatusChange() {
|
||||
@@ -904,7 +905,7 @@ export default {
|
||||
this.form.lossTime = ''
|
||||
},
|
||||
initOrg() {
|
||||
let {oid: partyOrgId, oname: partyOrgName} = this.$route.query;
|
||||
let {id: partyOrgId, name: partyOrgName} = this.selected
|
||||
this.form.partyOrgId = partyOrgId;
|
||||
this.form.partyOrgName = partyOrgName;
|
||||
},
|
||||
@@ -915,85 +916,34 @@ export default {
|
||||
},
|
||||
getInfo() {
|
||||
let {id} = this.$route.query;
|
||||
id &&
|
||||
this.instance
|
||||
.post(`/app/appparty/detail`, null, {
|
||||
id && this.instance.post(`/app/appparty/detail`, null, {
|
||||
params: {id},
|
||||
})
|
||||
.then((res) => {
|
||||
}).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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -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"})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user