瀏覽代碼

花名册调整

lizhenhao 2 年之前
父節點
當前提交
6dfbd43081

+ 16 - 0
src/components/treeSelect/treeSelect.vue

@@ -8,6 +8,8 @@
         :show-checkbox="showCheckbox"
         :props="props"
         highlight-current
+        :check-strictly="checkStrictly"
+        :check-on-click-node="checkOnClickNode"
         :node-key="props.value"
         :default-expanded-keys="defaultExpandedKey"
         @check-change="handleCheckChange"
@@ -88,6 +90,20 @@ export default {
       default: () => {
         return false
       }
+    },
+    // 在显示复选框的情况下,是否严格的遵循父子不互相关联的做法,默认为 false
+    checkStrictly: {
+      type: Boolean,
+      default: () => {
+        return false
+      }
+    },
+    // 是否在点击节点的时候选中节点,默认值为 false,即只有在点击复选框时才会选中节点。
+    checkOnClickNode: {
+      type: Boolean,
+      default: () => {
+        return false
+      }
     }
   },
   data () {

+ 17 - 11
src/views/modules/roster/RosterForm.vue

@@ -21,7 +21,7 @@
                label-width="125px" @submit.native.prevent>
 
         <el-divider content-position="left"><i class="el-icon-document"></i> 基础信息</el-divider>
-        <div v-if="activeName === '1'">
+        <div v-if="activeName === '1'" :key="keydiv1">
 <!--        <el-row  :gutter="15">-->
 <!--          <el-col :span="12">-->
 <!--            <el-form-item label="头像" prop="headshot"-->
@@ -99,7 +99,7 @@
           </el-col>
           <el-col :span="12">
             <el-form-item label="岗位" prop="postIdList">
-              <el-select v-model="inputForm.postIdList" style="width:100%" multiple placeholder="请选择">
+              <el-select v-model="inputForm.postIdList" @change="$forceUpdate()" style="width:100%" multiple placeholder="请选择">
                 <el-option
                   v-for="item in postList"
                   :key="item.id"
@@ -124,6 +124,8 @@
                 :clearable="false"
                 :accordion="true"
                 :showCheckbox="true"
+                :checkStrictly="true"
+                :checkOnClickNode="true"
                 @getValue="(value) => {inputForm.manageOfficeIds=value}"/>
             </el-form-item>
           </el-col>
@@ -199,11 +201,7 @@
               <el-input v-model="inputForm.idCard" placeholder="请填写证件号"  clearable></el-input>
             </el-form-item>
           </el-col>
-          <el-col :span="12">
-            <el-form-item label="手机号码" prop="mobile">
-              <el-input v-model="inputForm.mobile" placeholder="请填写手机号码"     clearable></el-input>
-            </el-form-item>
-          </el-col>
+
           <el-col :span="12">
             <el-form-item label="证件照正面" prop="certificatesFront"
                           :rules="[
@@ -257,7 +255,11 @@
               </el-popover>
             </el-form-item>
           </el-col>
-
+          <el-col :span="12">
+            <el-form-item label="手机号码" prop="mobile">
+              <el-input v-model="inputForm.mobile" placeholder="请填写手机号码"     clearable></el-input>
+            </el-form-item>
+          </el-col>
           <el-col :span="12" >
             <el-form-item label="合同类型" prop="contractType"
                           :rules="[
@@ -1284,7 +1286,7 @@
           </el-col>
         </el-row>
         </div>
-        <div v-if="activeName === '2'">
+        <div v-if="activeName === '2'" :key="keydiv2">
           <el-row  :gutter="15">
             <el-col :span="12">
               <el-form-item label="姓名" prop="name"
@@ -1583,7 +1585,9 @@
         activeName: '1',
         roleList: [],
         postList: [],
-        companyList: []
+        companyList: [],
+        keydiv1: '',
+        keydiv2: ''
       }
     },
     rankService: null,
@@ -2161,7 +2165,7 @@
             }
           }
         }
-        // 切换游客
+        // 切换游客
         if (event === '2') {
           this.inputForm = {
             id: this.inputForm.id,
@@ -2236,6 +2240,8 @@
             manageOfficeIds: ''
           }
         }
+        this.keydiv1 = Math.random()
+        this.keydiv2 = Math.random()
       },
       // 身份证号rule验证
       checkIdCardRule (rule, value, callback) {

+ 16 - 3
src/views/modules/roster/RosterList.vue

@@ -5,6 +5,9 @@
       <el-form-item prop="name">
         <el-input size="small" v-model="searchForm.name" placeholder="姓名" clearable></el-input>
       </el-form-item>
+      <el-form-item prop="mobile">
+        <el-input size="small" v-model="searchForm.mobile" placeholder="手机号码" clearable></el-input>
+      </el-form-item>
       <el-form-item prop="idCard">
         <el-input size="small" v-model="searchForm.idCard" placeholder="证件号" clearable></el-input>
       </el-form-item>
@@ -108,7 +111,9 @@
     data () {
       return {
         searchForm: {
-          name: ''
+          name: '',
+          idCard: '',
+          mobile: ''
         },
         dataList: [],
         tablePage: {
@@ -122,7 +127,8 @@
         workerTypeList: [],
         activeValue: '',
         showButton: false,
-        disableButton: true
+        disableButton: true,
+        personType: ''
       }
     },
     rosterService: null,
@@ -140,11 +146,13 @@
       // 获取数据列表
       refreshList () {
         this.loading = true
+        this.activeName = '全部'
         this.rosterService.list({
           'current': this.tablePage.currentPage,
           'size': this.tablePage.pageSize,
           'orders': this.tablePage.orders,
           'workerType': this.activeValue,
+          'personType': this.personType,
           ...this.searchForm
         }).then(({data}) => {
           this.dataList = data.records
@@ -207,14 +215,19 @@
         const val = tab.$attrs.value
         if (val === '0') {
           this.activeValue = ''
+          this.personType = ''
+        } else if (val === '7') {
+          this.activeValue = ''
+          this.personType = '2'
         } else {
           this.activeValue = val
+          this.personType = '1'
         }
         this.refreshList()
       },
       addTabs () {
         this.workerTypeList = []
-        this.workerTypeList.push({'label': '在职', 'value': '0'})
+        this.workerTypeList.push({'label': '全部', 'value': '0'})
         this.$dictUtils.getDictList('worker_type').forEach(item => {
           this.workerTypeList.push(item)
         })

+ 28 - 25
src/views/modules/sys/user/UserForm.vue

@@ -108,19 +108,22 @@
             <!-- 单选 -->
             <!--<el-select v-model="form.treeData" placeholder="请选择" style="width: 16rem">-->
             <!-- 多选 -->
-            <el-select v-model="form.treeData" multiple placeholder="请选择" style="width:100%">
-              <el-option :value="treeDataValue" style="height: auto">
-                <el-tree
-                  ref="selectTree"
-                  :data="data"
-                  :value="inputForm.manageOfficeIds"
-                  default-expand-all
-                  node-key="id"
-                  :props="defaultProps"
-                  @node-click="handleNodeClick"
-                />
-              </el-option>
-            </el-select>
+            <SelectTree
+              ref="officeTree"
+              :props="{
+                  value: 'id',             // ID字段名
+                  label: 'name',         // 显示名称
+                  children: 'children'    // 子级字段名
+                }"
+              size="middle"
+              :url="`/sys/office/treeData?type=2`"
+              :value="inputForm.manageOfficeIds"
+              :clearable="false"
+              :accordion="true"
+              :showCheckbox="true"
+              :checkStrictly="true"
+              :checkOnClickNode="true"
+              @getValue="(value) => {inputForm.manageOfficeIds=value}"/>
           </el-form-item>
         </el-col>
 
@@ -287,14 +290,14 @@ export default {
           this.userService.queryById(this.inputForm.id).then(({data}) => {
             this.inputForm = this.recover(this.inputForm, data)
             this.inputForm.oldLoginName = this.inputForm.loginName
-            if (!this.inputForm.manageOfficeNameList) {
-              this.treeDataValue = ''
-              this.form.treeData = []
-              this.form.treeDataId = []
-            } else {
-              this.form.treeData = this.inputForm.manageOfficeNameList
-              this.form.treeDataId = this.inputForm.manageOfficeIds.split(',')
-            }
+            // if (!this.inputForm.manageOfficeNameList) {
+            //   this.treeDataValue = ''
+            //   this.form.treeData = []
+            //   this.form.treeDataId = []
+            // } else {
+            //   this.form.treeData = this.inputForm.manageOfficeNameList
+            //   this.form.treeDataId = this.inputForm.manageOfficeIds.split(',')
+            // }
           })
 
           this.userService.getOffice().then(({data}) => {
@@ -326,10 +329,10 @@ export default {
     doSubmit () {
       this.$refs['inputForm'].validate((valid) => {
         if (valid) {
-          if (this.form.treeDataId) {
-            var manageOfficeIds = this.form.treeData.toString()
-            this.inputForm.manageOfficeIds = manageOfficeIds
-          }
+          // if (this.form.treeDataId) {
+          //   var manageOfficeIds = this.form.treeData.toString()
+          //   this.inputForm.manageOfficeIds = manageOfficeIds
+          // }
           this.loading = true
           this.userService.save(this.inputForm).then(({data}) => {
             this.loading = false