Explorar o código

人员档案添加页面功能完成

guoqing hai 1 ano
pai
achega
d698df021b

+ 7 - 0
src/api/placePerson/placePerson.js

@@ -19,5 +19,12 @@ export default class placePerson {
             `/zjzz/religion/list`,
             params
         )
+    };
+    //人员新增
+    save(inputForm) {
+        return request.post(
+            `/user/usermanagement/userManagement/save`,
+            inputForm
+        )
     }
 }

+ 214 - 44
src/views/placeManage/placePerson/placePersonAdd.vue

@@ -11,7 +11,7 @@
       <p class="miniTitle">场所信息</p>
       <van-cell-group>
         <van-field
-          v-model="idType"
+          v-model="idTypeName"
           readonly
           required
           label="证件类型:"
@@ -417,7 +417,7 @@
         "
       >
         <van-field
-          v-model="inputForm.idcard"
+          v-model="job"
           center
           label="职务:"
           placeholder="请填写职务"
@@ -467,7 +467,7 @@
       </van-cell-group>
       <van-cell-group v-if="showZW.includes('3')">
         <van-field
-          v-model="inputForm.idcard"
+          v-model="finishschoolName"
           center
           label-width="6.5em"
           label="宗教毕业院校:"
@@ -477,7 +477,7 @@
       </van-cell-group>
       <van-cell-group v-if="showZW.includes('3')">
         <van-field
-          v-model="inputForm.idcard"
+          v-model="certificateNumber"
           center
           label-width="6.5em"
           label="教职证书号:"
@@ -508,7 +508,7 @@
       </van-cell-group>
       <van-cell-group v-if="showZW.includes('3')">
         <van-field
-          v-model="inputForm.idcard"
+          v-model="certificateUnit"
           center
           label-width="6.5em"
           label="证书颁发单位:"
@@ -538,7 +538,7 @@
       </van-cell-group>
       <van-cell-group v-if="showZW.includes('3')">
         <van-field
-          v-model="inputForm.idcard"
+          v-model="authorityName"
           center
           label-width="6.5em"
           label="备案机关名称:"
@@ -548,7 +548,7 @@
       </van-cell-group>
       <van-cell-group v-if="showZW.includes('3')">
         <van-field
-          v-model="inputForm.idcard"
+          v-model="schoolName"
           center
           label-width="6.5em"
           label="宗教院校名称:"
@@ -558,7 +558,7 @@
       </van-cell-group>
       <van-cell-group v-if="showZW.includes('3')">
         <van-field
-          v-model="inputForm.idcard"
+          v-model="takeoffice"
           center
           label-width="6.5em"
           label="院校任职情况:"
@@ -568,27 +568,45 @@
       </van-cell-group>
       <van-cell-group v-if="showZW.includes('16')">
         <van-field
-          v-model="inputForm.idcard"
+          v-model="operateName"
           center
           label-width="6.5em"
           label="网络运营类型:"
           placeholder="请填写网络运营类型"
           input-align="right"
+          @click="hs_operate = true"
         />
+        <van-popup v-model:show="hs_operate" round position="bottom">
+          <van-picker
+            title="网络运营类型"
+            :columns="operate"
+            @cancel="hs_operate = false"
+            @confirm="getoperate"
+          />
+        </van-popup>
       </van-cell-group>
       <van-cell-group v-if="showZW.includes('18')">
         <van-field
-          v-model="inputForm.idcard"
+          v-model="journalistName"
           center
           label-width="6.5em"
           label="记者类型:"
           placeholder="请填写记者类型"
           input-align="right"
+          @click="hs_journalist = true"
         />
+        <van-popup v-model:show="hs_journalist" round position="bottom">
+          <van-picker
+            title="记者类型"
+            :columns="journalistn"
+            @cancel="hs_journalist = false"
+            @confirm="getjournalist"
+          />
+        </van-popup>
       </van-cell-group>
       <van-cell-group v-if="showZW.includes('6') && showZW.includes('19')">
         <van-field
-          v-model="inputForm.idcard"
+          v-model="overseas"
           center
           label-width="6.5em"
           label="境外来源地:"
@@ -604,7 +622,7 @@
         "
       >
         <van-field
-          v-model="inputForm.idcard"
+          v-model="faction"
           center
           label-width="6.5em"
           label="派别:"
@@ -614,7 +632,7 @@
       </van-cell-group>
       <van-cell-group v-if="showZW.includes('7')">
         <van-field
-          v-model="inputForm.idcard"
+          v-model="cityOutaddress"
           center
           label-width="6.5em"
           label="市外来源地:"
@@ -655,6 +673,7 @@
 import { onBeforeUpdate, onMounted, ref } from "vue";
 import placePerson from "@/api/placePerson/placePerson";
 import PlaceRegister from "@/api/placeRegister/placeRegister";
+import { useRouter } from "vue-router";
 import tools from "@/api/sys/tools";
 export default {
   setup() {
@@ -700,7 +719,32 @@ export default {
       },
       bkcheck: "",
     });
-
+    // 职务
+    const job = ref("");
+    //教职身份
+    const teachType = ref("");
+    //宗教教育程度
+    const religiousType = ref("");
+    // 宗教毕业院校
+    const religiousScool = ref("");
+    //教职证书号
+    const certificateNumber = ref("");
+    //证书颁发单位
+    const certificateUnit = ref("");
+    //备案机关名称
+    const authorityName = ref("");
+    // 宗教毕业院校
+    const finishschoolName = ref("");
+    //宗教院校名称
+    const schoolName = ref("");
+    //院校任职情况
+    const takeoffice = ref("");
+    //境外来源地
+    const overseas = ref("");
+    //派别
+    const faction = ref("");
+    //市外来源地
+    const cityOutaddress = ref("");
     const locationName = ref("");
     onMounted(() => {
       //民族字段接口
@@ -725,12 +769,15 @@ export default {
       { text: "港澳通行证", value: "3" },
       { text: "其他", value: "4" },
     ];
-    const idType = ref("");
+    const idTypeName = ref("");
     let showPicker = ref(false);
     const getPlace = ({ selectedOptions }) => {
       showPicker.value = false;
-      inputForm.idType = selectedOptions[0].value;
-      idType.value = selectedOptions[0].text;
+      const json = Object.assign(inputForm.value, {
+        idType: selectedOptions[0].value,
+      });
+      inputForm.value = json;
+      idTypeName.value = selectedOptions[0].text;
     };
     // 民族
     const nationName = ref("");
@@ -738,19 +785,25 @@ export default {
     let hs_nation = ref(false);
     const getnation = ({ selectedOptions }) => {
       hs_nation.value = false;
-      inputForm.nation = selectedOptions[0].value;
+      const json = Object.assign(inputForm.value, {
+        nation: selectedOptions[0].value,
+      });
+      inputForm.value = json;
       nationName.value = selectedOptions[0].text;
     };
     // 性别
     const sexName = ref("");
     const sex = [
-      { text: "男", value: "0" },
-      { text: "女", value: "1" },
+      { text: "男", value: "1" },
+      { text: "女", value: "2" },
     ];
     let hs_sex = ref(false);
     const getsex = ({ selectedOptions }) => {
       hs_sex.value = false;
-      inputForm.sex = selectedOptions[0].value;
+      const json = Object.assign(inputForm.value, {
+        sex: selectedOptions[0].value,
+      });
+      inputForm.value = json;
       sexName.value = selectedOptions[0].text;
     };
     // 教育程度
@@ -769,7 +822,10 @@ export default {
     let hs_education = ref(false);
     const geteducation = ({ selectedOptions }) => {
       hs_education.value = false;
-      inputForm.nationalEducationLevel = selectedOptions[0].value;
+      const json = Object.assign(inputForm.value, {
+        nationalEducationLevel: selectedOptions[0].value,
+      });
+      inputForm.value = json;
       educationName.value = selectedOptions[0].text;
     };
     // 宗教类别
@@ -784,11 +840,15 @@ export default {
     let hs_religious = ref(false);
     const getreligious = ({ selectedOptions }) => {
       hs_religious.value = false;
-      inputForm.religion = selectedOptions[0].value;
+      const json = Object.assign(inputForm.value, {
+        religion: selectedOptions[0].value,
+      });
+      inputForm.value = json;
       religiousName.value = selectedOptions[0].text;
     };
     // 宗教类别2
     const religiousName2 = ref("");
+    const religioustype2 = ref("");
     const religious2 = [
       { text: "伊斯兰教", value: "1" },
       { text: "基督教", value: "2" },
@@ -799,7 +859,7 @@ export default {
     let hs_religious2 = ref(false);
     const getreligious2 = ({ selectedOptions }) => {
       hs_religious2.value = false;
-      // inputForm.religion = selectedOptions[0].value;
+      religioustype2.value = selectedOptions[0].value;
       religiousName2.value = selectedOptions[0].text;
     };
     // 所属场所
@@ -808,7 +868,9 @@ export default {
     let hs_site = ref(false);
     const getsite = (val) => {
       locationName.value = val.name;
-      inputForm.location.id = val.id;
+      console.log(val.id, "==========================>val.id");
+      const json = Object.assign(inputForm.value, { location: { id: val.id } });
+      inputForm.value = json;
       checked.value = val.id;
     };
     const loading = ref(false);
@@ -866,7 +928,11 @@ export default {
     let hs_typeOfEmployees = ref(false);
     const gettypeOfEmployees = ({ selectedOptions }) => {
       hs_typeOfEmployees.value = false;
-      inputForm.typeOfEmployees = selectedOptions[0].value;
+      // inputForm.typeOfEmployees = selectedOptions[0].value;
+      const json = Object.assign(inputForm.value, {
+        typeOfEmployees: selectedOptions[0].value,
+      });
+      inputForm.value = json;
       typeOfEmployeesName.value = selectedOptions[0].text;
     };
 
@@ -883,20 +949,25 @@ export default {
         str += item.name + "/";
       });
       inputForm.nativePlace = str;
-      const json = Object.assign(inputForm, { nativePlace: str });
+      const json = Object.assign(inputForm.value, { nativePlace: str });
       inputForm.value = json;
     };
     //图片上传
     let fileList = ref([]);
     let fileImg = ref([]);
+    let workpic = ref("");
     const afterRead1 = (file) => {
       new tools()
-        .uploadFile(file, `religioussites/siteinfo/religiousSitesInfo`)
+        .uploadFile(file, `sys/file/webupload/upload`)
         .then(({ data }) => {
           data.name = decodeURIComponent(
             data.url.substring(data.url.lastIndexOf("/") + 1)
           );
-          placeActivity.placeData.scenesImage += "" + data.url;
+          workpic.value += "" + data.url;
+          const json = Object.assign(inputForm.value, {
+            workPicture: workpic.value,
+          });
+          inputForm.value = json;
           fileImg.value.push(data);
         });
     };
@@ -940,7 +1011,7 @@ export default {
       });
       inputForm.currentResidence = str1;
       inputForm.currentResidenceId = str2;
-      const json = Object.assign(inputForm, {
+      const json = Object.assign(inputForm.value, {
         currentResidence: str1,
         currentResidenceId: str2,
       });
@@ -954,7 +1025,8 @@ export default {
     let hs_tissue = ref(false);
     const gettissue = (val) => {
       tissueName.value = val.organizationName;
-      inputForm.zjzz.id = val.id;
+      const json = Object.assign(inputForm.value, { zjzz: { id: val.id } });
+      inputForm.value = json;
       checked1.value = val.id;
     };
     const loading1 = ref(false);
@@ -1014,7 +1086,10 @@ export default {
       checkboxRefs.value[index].toggle();
       let str = "";
       str = checked2.value.join();
-      const json = Object.assign(inputForm, { personnelType: str });
+      const json = Object.assign(
+        { ...inputForm.value },
+        { personnelType: str }
+      );
       inputForm.value = json;
       personnalType.value = getValue(checked2.value).join();
       showZW.value = str;
@@ -1062,7 +1137,10 @@ export default {
     let hs_activity = ref(false);
     const getactivity = ({ selectedOptions }) => {
       hs_activity.value = false;
-      inputForm.bkcheck = selectedOptions[0].value;
+      const json = Object.assign(inputForm.value, {
+        bkcheck: selectedOptions[0].value,
+      });
+      inputForm.value = json;
       activitytext.value = selectedOptions[0].text;
     };
     // 教职身份
@@ -1081,7 +1159,7 @@ export default {
     let hs_teach = ref(false);
     const getteach = ({ selectedOptions }) => {
       hs_teach.value = false;
-      // inputForm.bkcheck = selectedOptions[0].value;
+      teachType.value = selectedOptions[0].value;
       teachPosition.value = selectedOptions[0].text;
     };
     // 宗教教育程度
@@ -1100,7 +1178,7 @@ export default {
     let hs_Reducation = ref(false);
     const getReducation = ({ selectedOptions }) => {
       hs_Reducation.value = false;
-      // inputForm.bkcheck = selectedOptions[0].value;
+      religiousType.value = selectedOptions[0].value;
       Religiouseducation.value = selectedOptions[0].text;
     };
     // 证书颁发时间
@@ -1108,8 +1186,6 @@ export default {
     let hs_issueDate = ref(false);
     const getissueDate = ({ selectedOptions }) => {
       hs_issueDate.value = false;
-
-      // inputForm.bkcheck = selectedOptions[0].value;
       issueDate.value =
         selectedOptions[0].text +
         "-" +
@@ -1117,12 +1193,11 @@ export default {
         "-" +
         selectedOptions[2].text;
     };
-    // 证书颁发时间
+    // 备案时间
     const recordDate = ref("");
     let hs_recordDate = ref(false);
     const getrecordDate = ({ selectedOptions }) => {
       hs_recordDate.value = false;
-      // inputForm.bkcheck = selectedOptions[0].value;
       recordDate.value =
         selectedOptions[0].text +
         "-" +
@@ -1130,12 +1205,83 @@ export default {
         "-" +
         selectedOptions[2].text;
     };
+    //记者类型
+    const journalistName = ref("");
+    const journalistName2 = ref("");
+    const journalistn = [
+      { text: "境内", value: "1" },
+      { text: "境外", value: "2" },
+    ];
+    let hs_journalistn = ref(false);
+    const getjournalistn = ({ selectedOptions }) => {
+      hs_journalistn.value = false;
+      journalistName2.value = selectedOptions[0].value;
+      journalistName.value = selectedOptions[0].text;
+    };
+    //网络运营类型
+    const operateName = ref("");
+    const operateName2 = ref("");
+    const operate = [
+      { text: "网络主播", value: "1" },
+      { text: "微博", value: "2" },
+      { text: "微信", value: "3" },
+      { text: "抖音", value: "4" },
+      { text: "快手", value: "5" },
+      { text: "淘宝", value: "6" },
+      { text: "QQ", value: "7" },
+    ];
+    let hs_operate = ref(false);
+    const getoperate = ({ selectedOptions }) => {
+      hs_operate.value = false;
+      operateName2.value = selectedOptions[0].value;
+      operateName.value = selectedOptions[0].text;
+    };
+    //跳转
+    let router = useRouter();
     //数据提交
     const submit = () => {
-      new PlaceRegister().sava(placeActivity.placeData).then((res) => {
-        router.push({
-          path: "/tabAll",
-        });
+      const list = [
+        { chineseName: "职务", value: job.value },
+        { chineseName: "教职身份", value: teachType.value },
+        { chineseName: "宗教教育程度", value: religiousType.value },
+        { chineseName: "宗教毕业院校", value: finishschoolName.value },
+        { chineseName: "教职证书号", value: certificateNumber.value },
+        { chineseName: "证书颁发时间", value: issueDate.value },
+        { chineseName: "证书颁发单位", value: certificateUnit.value },
+        { chineseName: "备案时间", value: recordDate.value },
+        { chineseName: "备案机关名称", value: authorityName.value },
+        { chineseName: "宗教院校名称", value: schoolName.value },
+        { chineseName: "院校任职情况", value: takeoffice.value },
+        { chineseName: "网络运营类型", value: operateName2.value },
+        { chineseName: "记者类型", value: journalistName2.value },
+        { chineseName: "境外来源地", value: overseas.value },
+        { chineseName: "派别", value: faction.value },
+        { chineseName: "市外来源地", value: cityOutaddress.value },
+        { chineseName: "教别", value: religioustype2.value },
+      ];
+      let newList = [];
+      newList = list.filter((item) => {
+        return item.value != "";
+      });
+      const json = Object.assign(inputForm.value, {
+        userManagenmetDetailsDTOList: newList,
+      });
+      inputForm.value = json;
+      new placePerson().save(inputForm.value).then((res) => {
+        console.log(res);
+        if (res.status == 200) {
+          xm.showToast({
+            message: "人员添加成功",
+          });
+          router.push({
+            path: "/placePerson",
+          });
+        }else{
+          xm.showToast({
+            message: "人员添加失败",
+          });
+          console.log(res);
+        }
       });
     };
 
@@ -1143,7 +1289,7 @@ export default {
       //人员添加
       inputForm,
       // 证件类型
-      idType,
+      idTypeName,
       showPicker,
       places,
       getPlace,
@@ -1169,6 +1315,7 @@ export default {
       getreligious,
       // 宗教类别2
       religiousName2,
+      religioustype2,
       hs_religious2,
       religious2,
       getreligious2,
@@ -1232,6 +1379,17 @@ export default {
       hs_recordDate,
       recordDate,
       getrecordDate,
+      //记者类型
+      journalistName,
+      journalistn,
+      hs_journalistn,
+      getjournalistn,
+      //网络运营类型
+      operate,
+      operateName,
+      operateName2,
+      hs_operate,
+      getoperate,
       //图片上传
       fileList,
       afterRead1,
@@ -1247,6 +1405,18 @@ export default {
       showPlace1,
       getPlace1,
       options,
+      //userList数组
+      job,
+      religiousScool,
+      certificateNumber,
+      certificateUnit,
+      authorityName,
+      schoolName,
+      takeoffice,
+      overseas,
+      faction,
+      cityOutaddress,
+      finishschoolName,
       //数据提交
       submit,
       selectColor,