Explorar o código

获取人员信息

LuChongMei hai 1 ano
pai
achega
deebc636eb
Modificáronse 1 ficheiros con 32 adicións e 44 borrados
  1. 32 44
      src/views/activityMan/personList.vue

+ 32 - 44
src/views/activityMan/personList.vue

@@ -1,56 +1,21 @@
 <template>
   <div class="personList">
-    <van-search
-      v-model="searchVal"
-      clearable
-      show-action
-      shape="round"
-      placeholder="请输入搜索关键词"
-      input-align="center"
-      @search="onSearch"
-      @cancel="onCancel"
-    />
-    <van-list
-      v-model:loading="loading"
-      :finished="finished"
-      finished-text="没有更多了"
-      @load="onLoad"
-    >
-      <van-checkbox-group
-        v-if="type == 1"
-        v-model="checked"
-        ref="checkboxGroup"
-      >
-        <van-button type="primary" size="mini" @click="checkAll"
-          >全选</van-button
-        >
+    <van-search v-model="searchVal" clearable show-action shape="round" placeholder="请输入搜索关键词" input-align="center"
+      @search="onSearch" @cancel="onCancel" />
+    <van-list v-model:loading="loading" :finished="finished" finished-text="没有更多了" @load="onLoad">
+      <van-checkbox-group v-if="type == 1" v-model="checked" ref="checkboxGroup">
+        <van-button type="primary" size="mini" @click="checkAll">全选</van-button>
         <van-cell-group inset>
-          <van-cell
-            v-for="(item, index) in list"
-            clickable
-            :key="item"
-            :title="item.name"
-            @click="toggle(index)"
-          >
+          <van-cell v-for="(item, index) in list" clickable :key="item" :title="item.name" @click="toggle(index)">
             <template #right-icon>
-              <van-checkbox
-                shape="square"
-                :name="item"
-                :ref="(el) => (checkboxRefs[index] = el)"
-              />
+              <van-checkbox shape="square" :name="item" :ref="(el) => (checkboxRefs[index] = el)" />
             </template>
           </van-cell>
         </van-cell-group>
       </van-checkbox-group>
       <van-radio-group v-if="type == 0" v-model="checked">
         <van-cell-group inset>
-          <van-cell
-            v-for="item in list"
-            clickable
-            :key="item"
-            :title="item.name"
-            @click="selectes(item)"
-          >
+          <van-cell v-for="item in list" clickable :key="item" :title="item.name" @click="selectes(item)">
             <template #right-icon>
               <van-radio :name="item" />
             </template>
@@ -79,6 +44,7 @@ export default {
         .list({
           current: index + 1,
           size: 10,
+          ...searchForm.value
         })
         .then(({ records }) => {
           list.value.push(...records);
@@ -94,12 +60,29 @@ export default {
     };
     // 搜索
     const searchVal = ref("");
+    let searchForm = ref({
+      name: "",
+      sex: "",
+      idType: "",
+      idcard: "",
+      phone: "",
+      location: {
+        id: ""
+      },
+      typeOfEmployees: "",
+      personnelType: "",
+      religion: "",
+      sjfw: [],
+      nativePlace: '',
+      currentResidence: ''
+    })
     const onSearch = () => {
+      searchForm.value.name = searchVal.value;
       new UserManage()
         .list({
           current: 1,
           size: 10000,
-          name: searchVal.value,
+          ...searchForm.value
         })
         .then(({ records }) => {
           list.value = [];
@@ -115,6 +98,7 @@ export default {
       list.value = [];
       index = 0;
       finished.value = false;
+      searchForm.value.name = ""
       onLoad();
     };
     // 选择人员
@@ -164,17 +148,21 @@ export default {
   overflow: auto;
   margin: 10px;
 }
+
 .van-button {
   top: -5px;
 }
+
 .search {
   height: 40px;
   line-height: 40px;
 }
+
 .van-list {
   height: 80%;
   margin-top: 5px;
 }
+
 .keyword {
   width: 70%;
   height: 25px;