|
@@ -71,12 +71,13 @@
|
|
|
<van-field name="uploader" label-align="top" label="工作照片:">
|
|
|
<template #input>
|
|
|
<van-uploader
|
|
|
+ readonly
|
|
|
v-model="fileList"
|
|
|
- :after-read="afterRead1"
|
|
|
:max-count="1"
|
|
|
- capture="camera"
|
|
|
accept=""
|
|
|
- :before-delete="fjdelete"
|
|
|
+ :preview-full-image="false"
|
|
|
+ :before-delete="deleteRead"
|
|
|
+ @click-upload="chooseImg"
|
|
|
>
|
|
|
</van-uploader>
|
|
|
</template>
|
|
@@ -327,6 +328,7 @@
|
|
|
v-model:show="hs_persontype"
|
|
|
title="人员类型"
|
|
|
show-cancel-button
|
|
|
+ @confirm="changperson"
|
|
|
>
|
|
|
<div class="dialog">
|
|
|
<van-list>
|
|
@@ -451,21 +453,26 @@
|
|
|
placeholder="请选择"
|
|
|
input-align="right"
|
|
|
right-icon="arrow-down"
|
|
|
- @click="hs_select = true"
|
|
|
+ @click="hs_select[index + '_select'] = true"
|
|
|
/>
|
|
|
- <van-popup v-model:show="hs_select" round position="bottom" >
|
|
|
+ <van-popup
|
|
|
+ v-model:show="hs_select[index + '_select']"
|
|
|
+ round
|
|
|
+ position="bottom"
|
|
|
+ >
|
|
|
<van-picker
|
|
|
+ :title="item.chineseName"
|
|
|
:columns="$dictUtils.getDictList(item.dataDictionary)"
|
|
|
:columns-field-names="{
|
|
|
text: 'label',
|
|
|
value: 'value',
|
|
|
}"
|
|
|
- @cancel="hs_select = false"
|
|
|
- @confirm="getselect"
|
|
|
+ @cancel="hs_select[index + '_select'] = false"
|
|
|
+ @confirm="getselect(index + '_select', $event)"
|
|
|
/>
|
|
|
</van-popup>
|
|
|
</van-cell-group>
|
|
|
- <van-cell-group v-if="item.dataType === '2'">
|
|
|
+ <van-cell-group v-else-if="item.dataType === '2'">
|
|
|
<van-field
|
|
|
v-model="item.value"
|
|
|
center
|
|
@@ -473,7 +480,7 @@
|
|
|
input-align="right"
|
|
|
/>
|
|
|
</van-cell-group>
|
|
|
- <van-cell-group v-if="item.dataType === '3'">
|
|
|
+ <van-cell-group v-else-if="item.dataType === '3'">
|
|
|
<van-field
|
|
|
:v-model="item.value"
|
|
|
center
|
|
@@ -481,7 +488,7 @@
|
|
|
input-align="right"
|
|
|
/>
|
|
|
</van-cell-group>
|
|
|
- <van-cell-group v-if="item.dataType === '4'">
|
|
|
+ <van-cell-group v-else-if="item.dataType === '4'">
|
|
|
<van-field
|
|
|
name="uploader"
|
|
|
label-align="top"
|
|
@@ -500,7 +507,7 @@
|
|
|
</template>
|
|
|
</van-field>
|
|
|
</van-cell-group>
|
|
|
- <van-cell-group v-if="item.dataType === '5'">
|
|
|
+ <van-cell-group v-else-if="item.dataType === '5'">
|
|
|
<van-field
|
|
|
v-model="item.value"
|
|
|
center
|
|
@@ -531,19 +538,26 @@
|
|
|
placeholder="请选择日期时间"
|
|
|
input-align="right"
|
|
|
right-icon="arrow-down"
|
|
|
- @click="hs_Date = true"
|
|
|
+ @click="hs_Date[index + '_Date'] = true"
|
|
|
/>
|
|
|
- <van-popup v-model:show="hs_Date" round position="bottom">
|
|
|
+ <van-popup
|
|
|
+ v-model:show="hs_Date[index + '_Date']"
|
|
|
+ round
|
|
|
+ position="bottom"
|
|
|
+ >
|
|
|
<van-date-picker
|
|
|
title="选择日期"
|
|
|
:min-date="minDate"
|
|
|
:max-date="maxDate"
|
|
|
- @cancel="hs_Date = false"
|
|
|
- @confirm="getDate"
|
|
|
+ @cancel="hs_Date[index + '_Date'] = false"
|
|
|
+ @confirm="getDate(index + '_Date', $event)"
|
|
|
/>
|
|
|
</van-popup>
|
|
|
</van-cell-group>
|
|
|
</van-col>
|
|
|
+ <div class="subbtn">
|
|
|
+ <van-button type="primary" @click="submit">确认修改</van-button>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</template>
|
|
@@ -556,7 +570,6 @@ import placePerson from "@/api/placePerson/placePerson";
|
|
|
import PlaceRegister from "@/api/placeRegister/placeRegister";
|
|
|
import UserManage from "@/api/user/UserManage";
|
|
|
import tools from "@/api/sys/tools";
|
|
|
-import placeRegister from '@/api/placeRegister/placeRegister';
|
|
|
export default {
|
|
|
setup() {
|
|
|
const data = ref({});
|
|
@@ -583,25 +596,76 @@ export default {
|
|
|
"hs_personnel_education",
|
|
|
data.value.nationalEducationLevel
|
|
|
);
|
|
|
- religiousName.value = current.appContext.config.globalProperties.$dictUtils.getDictLabel(
|
|
|
+ religiousName.value =
|
|
|
+ current.appContext.config.globalProperties.$dictUtils.getDictLabel(
|
|
|
"hs_religion_type",
|
|
|
data.value.religion
|
|
|
);
|
|
|
- let location = data.value.location
|
|
|
+ let location = data.value.location;
|
|
|
locationName.value = location.name;
|
|
|
- typeOfEmployeesName.value = current.appContext.config.globalProperties.$dictUtils.getDictLabel(
|
|
|
+ typeOfEmployeesName.value =
|
|
|
+ current.appContext.config.globalProperties.$dictUtils.getDictLabel(
|
|
|
"hs_type_of_employees",
|
|
|
data.value.typeOfEmployees
|
|
|
);
|
|
|
- let arr = data.value.personnelType.split(',')
|
|
|
- personnalType.value = getValue1(arr).join(',')
|
|
|
- let tissid = data.value.zjzz.id
|
|
|
- if(tissid!=''){
|
|
|
- new placePerson().queryId({id:tissid}).then((res)=>{
|
|
|
- tissueName.value = res.organizationName
|
|
|
- })
|
|
|
+ let arr = data.value.personnelType.split(",");
|
|
|
+ personnalType.value = getValue1(arr).join(",");
|
|
|
+ let tissid = data.value.zjzz.id;
|
|
|
+ if (tissid != "") {
|
|
|
+ new placePerson().queryId({ id: tissid }).then((res) => {
|
|
|
+ tissueName.value = res.organizationName;
|
|
|
+ });
|
|
|
}
|
|
|
activitytext.value = getActivity(data.value.bkcheck);
|
|
|
+ data.value.workPicture.split("|").forEach((item) => {
|
|
|
+ if (item.trim().length > 0) {
|
|
|
+ fileImg.value.push({
|
|
|
+ name: decodeURIComponent(
|
|
|
+ item.substring(item.lastIndexOf("/") + 1)
|
|
|
+ ),
|
|
|
+ url: $base + item.replace("程序附件//", "程序附件/"),
|
|
|
+ id: item.replace("程序附件//", "程序附件/"),
|
|
|
+ });
|
|
|
+ fileList.value.push({
|
|
|
+ name: decodeURIComponent(
|
|
|
+ item.substring(item.lastIndexOf("/") + 1)
|
|
|
+ ),
|
|
|
+
|
|
|
+ url: $base + item.replace("程序附件//", "程序附件/"),
|
|
|
+ id: item.replace("程序附件//", "程序附件/"),
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+ data.value.userManagenmetDetailsDTOList.forEach((item) => {
|
|
|
+ if (item.chineseName === "教职身份") {
|
|
|
+ const teachType = {
|
|
|
+ 1: "阿訇",
|
|
|
+ 2: "牧师",
|
|
|
+ 3: "长老",
|
|
|
+ 4: "传道员",
|
|
|
+ 5: "神学生",
|
|
|
+ 6: "道士(正一)",
|
|
|
+ 7: "比丘",
|
|
|
+ 8: "教师(副牧师)",
|
|
|
+ 9: "比丘尼",
|
|
|
+ };
|
|
|
+ item.value = teachType[item.value];
|
|
|
+ }
|
|
|
+ if (item.chineseName === "宗教教育程度") {
|
|
|
+ const Type = {
|
|
|
+ 1: "小学",
|
|
|
+ 2: "初中",
|
|
|
+ 3: "中专",
|
|
|
+ 4: "高中",
|
|
|
+ 5: "大专",
|
|
|
+ 6: "本科",
|
|
|
+ 7: "硕士研究生",
|
|
|
+ 8: "博士研究生",
|
|
|
+ 9: "其他",
|
|
|
+ };
|
|
|
+ item.value = Type[item.value];
|
|
|
+ }
|
|
|
+ });
|
|
|
});
|
|
|
//籍贯接口
|
|
|
new placePerson().nativePlace().then((res) => {
|
|
@@ -665,7 +729,7 @@ export default {
|
|
|
4: "其他",
|
|
|
};
|
|
|
return type[item];
|
|
|
- }
|
|
|
+ };
|
|
|
// 性别
|
|
|
const sexName = ref("");
|
|
|
const sex = [
|
|
@@ -747,7 +811,9 @@ export default {
|
|
|
let id = "";
|
|
|
id = val.id;
|
|
|
locationName.value = val.name;
|
|
|
- const json = Object.assign(data.value, { location: { id: id,name:val.name} });
|
|
|
+ const json = Object.assign(data.value, {
|
|
|
+ location: { id: id, name: val.name },
|
|
|
+ });
|
|
|
data.value = json;
|
|
|
checked.value = val.id;
|
|
|
};
|
|
@@ -804,30 +870,36 @@ export default {
|
|
|
//图片上传
|
|
|
let fileList = ref([]);
|
|
|
let fileImg = ref([]);
|
|
|
- let workpic = ref("");
|
|
|
- const afterRead1 = (file) => {
|
|
|
- new tools()
|
|
|
- .uploadFile(file, `sys/file/webupload/upload`)
|
|
|
- .then(({ data }) => {
|
|
|
- data.name = decodeURIComponent(
|
|
|
- data.url.substring(data.url.lastIndexOf("/") + 1)
|
|
|
- );
|
|
|
- workpic.value += "" + data.url;
|
|
|
- const json = Object.assign(data.value, {
|
|
|
- workPicture: workpic.value,
|
|
|
- });
|
|
|
- data.value = json;
|
|
|
- fileImg.value.push(data);
|
|
|
- });
|
|
|
+ const chooseImg = () => {
|
|
|
+ xm.chooseFile({
|
|
|
+ count: 1,
|
|
|
+ name: "file",
|
|
|
+ url: $base + `/sys/file/webupload/upload?uploadPath=logo`,
|
|
|
+ headers: {
|
|
|
+ "Content-Type": "multipart/form-data",
|
|
|
+ token: window.localStorage.getItem("MZ_TOKEN"),
|
|
|
+ },
|
|
|
+ }).then((res) => {
|
|
|
+ let data = res[0].data;
|
|
|
+ data.name = decodeURIComponent(
|
|
|
+ data.id.substring(data.url.lastIndexOf("/") + 1)
|
|
|
+ );
|
|
|
+ data.url = $base + data.url;
|
|
|
+ fileImg.value.push(data);
|
|
|
+ fileList.value.push(data);
|
|
|
+ });
|
|
|
};
|
|
|
- const fjdelete = (file) => {
|
|
|
+ // 删除文件
|
|
|
+ const deleteRead = (file) => {
|
|
|
//删除文件操作
|
|
|
for (let index = 0; index < fileList.value.length; index++) {
|
|
|
- if (file.file == fileList.value[index].file) {
|
|
|
- let delurl = fileImg.value[index].url;
|
|
|
- new tools().uploadFiledelete("", delurl).then(({ data }) => {});
|
|
|
- fileImg.value.splice(index, 1);
|
|
|
+ if (file.id == fileList.value[index].id) {
|
|
|
fileList.value.splice(index, 1);
|
|
|
+ if (fileImg.value[index]) {
|
|
|
+ let delurl = fileImg.value[index].url;
|
|
|
+ new tools().uploadFiledelete("", delurl).then(({ data }) => {});
|
|
|
+ fileImg.value.splice(index, 1);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
};
|
|
@@ -930,12 +1002,39 @@ export default {
|
|
|
let hs_persontype = ref(false);
|
|
|
const toggle = (index) => {
|
|
|
checkboxRefs.value[index].toggle();
|
|
|
- let str = "";
|
|
|
- str = checked2.value.join();
|
|
|
- const json = Object.assign({ ...data.value }, { personnelType: str });
|
|
|
+ personnalType.value = getValue(checked2.value).join();
|
|
|
+ showZW.value = checked2.value.join();
|
|
|
+ };
|
|
|
+ const changperson = () => {
|
|
|
+ const json = Object.assign(
|
|
|
+ { ...data.value },
|
|
|
+ { personnelType: showZW.value }
|
|
|
+ );
|
|
|
data.value = json;
|
|
|
- personnalType.value = getValue1(checked2.value).join(',');
|
|
|
- showZW.value = str;
|
|
|
+ changePersonnelType();
|
|
|
+ };
|
|
|
+ const changePersonnelType = () => {
|
|
|
+ let userManagenmetDetailsDTOList = [];
|
|
|
+ new placePerson()
|
|
|
+ .userDTOqueryId(data.value.personnelType.toString())
|
|
|
+ .then((data) => {
|
|
|
+ data.forEach((item) => {
|
|
|
+ let userManagenmetDetail = {};
|
|
|
+ userManagenmetDetail = Object.assign(userManagenmetDetail, {
|
|
|
+ id: "",
|
|
|
+ chineseName: item.chineseName,
|
|
|
+ englishName: item.englishName,
|
|
|
+ dataType: item.dataType,
|
|
|
+ value: "",
|
|
|
+ orderNum: item.orderNum,
|
|
|
+ dataDictionary: item.dataDictionary,
|
|
|
+ dataDictionaryId: item.dataDictionaryId,
|
|
|
+ });
|
|
|
+ userManagenmetDetailsDTOList.push(userManagenmetDetail);
|
|
|
+ });
|
|
|
+ data.value.userManagenmetDetailsDTOList =
|
|
|
+ userManagenmetDetailsDTOList;
|
|
|
+ });
|
|
|
};
|
|
|
onBeforeUpdate(() => {
|
|
|
checkboxRefs.value = [];
|
|
@@ -972,18 +1071,19 @@ export default {
|
|
|
return Array;
|
|
|
};
|
|
|
// 扩展信息选择
|
|
|
- const teachPosition = ref("");
|
|
|
- let hs_select = ref(false);
|
|
|
- const getselect = ({selectedOptions,selectedIndexes}) => {
|
|
|
- hs_select.value = false;
|
|
|
- teachPosition.value = selectedOptions[0].value;
|
|
|
+ let hs_select = ref({});
|
|
|
+ const getselect = (index, { selectedOptions }) => {
|
|
|
+ hs_select.value[index] = false;
|
|
|
+ let inputIndex = index.split("_")[0];
|
|
|
+ data.value.userManagenmetDetailsDTOList[inputIndex].value =
|
|
|
+ selectedOptions[0].label;
|
|
|
};
|
|
|
// 扩展信息的时间
|
|
|
- const issueDate = ref("");
|
|
|
- let hs_Date = ref(false);
|
|
|
- const getDate = ({ selectedOptions }) => {
|
|
|
- hs_Date.value = false;
|
|
|
- issueDate.value =
|
|
|
+ let hs_Date = ref({});
|
|
|
+ const getDate = (index, { selectedOptions }) => {
|
|
|
+ hs_Date.value[index] = false;
|
|
|
+ let inputIndex = index.split("_")[0];
|
|
|
+ data.value.userManagenmetDetailsDTOList[inputIndex].value =
|
|
|
selectedOptions[0].text +
|
|
|
"-" +
|
|
|
selectedOptions[1].text +
|
|
@@ -1016,6 +1116,58 @@ export default {
|
|
|
const onClickLeft = () => {
|
|
|
history.back();
|
|
|
};
|
|
|
+ //数据提交
|
|
|
+ const submit = () => {
|
|
|
+ //保存前附件处理
|
|
|
+ data.value.workPicture = fileImg.value
|
|
|
+ .map((option) => option.id)
|
|
|
+ .join("|");
|
|
|
+ data.value.userManagenmetDetailsDTOList.forEach((item) => {
|
|
|
+ if (item.chineseName === "教职身份") {
|
|
|
+ const teachType = {
|
|
|
+ 阿訇: 1,
|
|
|
+ 牧师: 2,
|
|
|
+ 长老: 3,
|
|
|
+ 传道员: 4,
|
|
|
+ 神学生: 5,
|
|
|
+ "道士(正一)": 6,
|
|
|
+ 比丘: 7,
|
|
|
+ "教师(副牧师)": 8,
|
|
|
+ 比丘尼: 9,
|
|
|
+ };
|
|
|
+ item.value = teachType[item.value];
|
|
|
+ }
|
|
|
+ if (item.chineseName === "宗教教育程度") {
|
|
|
+ const Type = {
|
|
|
+ 小学: 1,
|
|
|
+ 初中: 2,
|
|
|
+ 中专: 3,
|
|
|
+ 高中: 4,
|
|
|
+ 大专: 5,
|
|
|
+ 本科: 6,
|
|
|
+ 硕士研究生: 7,
|
|
|
+ 博士研究生: 8,
|
|
|
+ 其他: 9,
|
|
|
+ };
|
|
|
+ item.value = Type[item.value];
|
|
|
+ }
|
|
|
+ });
|
|
|
+ new placePerson().save(data.value).then((res) => {
|
|
|
+ if (res.status == 200) {
|
|
|
+ xm.showToast({
|
|
|
+ message: "人员添加成功",
|
|
|
+ });
|
|
|
+ router.push({
|
|
|
+ path: "/placePerson",
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ xm.showToast({
|
|
|
+ message: "人员添加失败",
|
|
|
+ });
|
|
|
+ console.log(res);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ };
|
|
|
return {
|
|
|
onClickLeft,
|
|
|
data,
|
|
@@ -1086,6 +1238,7 @@ export default {
|
|
|
toggle,
|
|
|
checkboxRefs,
|
|
|
showZW,
|
|
|
+ changperson,
|
|
|
// 是否参加非法活动
|
|
|
activity,
|
|
|
hs_activity,
|
|
@@ -1098,14 +1251,17 @@ export default {
|
|
|
getPlace1,
|
|
|
options,
|
|
|
getLocation,
|
|
|
- //扩展信息选择器
|
|
|
- teachPosition,
|
|
|
+ //扩展信息选择
|
|
|
hs_select,
|
|
|
getselect,
|
|
|
//扩展信息时间
|
|
|
hs_Date,
|
|
|
- issueDate,
|
|
|
getDate,
|
|
|
+ //图片上传
|
|
|
+ fileList,
|
|
|
+ chooseImg,
|
|
|
+ deleteRead,
|
|
|
+ submit,
|
|
|
};
|
|
|
},
|
|
|
};
|
|
@@ -1117,4 +1273,17 @@ export default {
|
|
|
height: 400px;
|
|
|
overflow: auto;
|
|
|
}
|
|
|
+.subbtn {
|
|
|
+ margin: 20px;
|
|
|
+ text-align: center;
|
|
|
+}
|
|
|
+.subbtn .van-button {
|
|
|
+ width: 100%;
|
|
|
+ margin: 5px;
|
|
|
+}
|
|
|
+.van-uploader .van-button {
|
|
|
+ border: none;
|
|
|
+ color: #36a7f3;
|
|
|
+ top: -4px;
|
|
|
+}
|
|
|
</style>
|