Browse Source

Merge branch 'Nov16thResetMusic' of http://git.dayaedu.com/molingzhide/dy-admin-manager into Nov16thResetMusic

mo 4 years ago
parent
commit
32368da920

+ 15 - 4
src/components/remote-search/index.vue

@@ -28,7 +28,7 @@ const placeholder = {
   setTeachers: "请选择老师",
   setTeachers: "请选择老师",
   setEducations: "请选乐团主管",
   setEducations: "请选乐团主管",
 };
 };
-import { throttle, slice } from "lodash";
+import { throttle, slice, uniqBy } from "lodash";
 import selects from "@/store/modules/selects";
 import selects from "@/store/modules/selects";
 export default {
 export default {
   name: "remote-search",
   name: "remote-search",
@@ -37,6 +37,7 @@ export default {
     return {
     return {
       options: [],
       options: [],
       list: [],
       list: [],
+      listById: {},
       loading: false,
       loading: false,
       constant: this.number || 50,
       constant: this.number || 50,
       placeholder: placeholder[this.commit],
       placeholder: placeholder[this.commit],
@@ -52,7 +53,11 @@ export default {
     async getList() {
     async getList() {
       await this.$store.dispatch(this.commit);
       await this.$store.dispatch(this.commit);
       this.list = this.selects[this.enumer[this.commit]];
       this.list = this.selects[this.enumer[this.commit]];
-
+      const data = {}
+      for (const item of this.list) {
+        data[item.userId] = item
+      }
+      this.listById = data
       this.options =
       this.options =
         this.list.length <= this.constant
         this.list.length <= this.constant
           ? this.list
           ? this.list
@@ -63,7 +68,7 @@ export default {
       // throttle
       // throttle
       throttle(this.getOptions, 800)(query);
       throttle(this.getOptions, 800)(query);
     },
     },
-    getOptions(query) {
+    async getOptions(query) {
       if (query) {
       if (query) {
         let flag;
         let flag;
         this.options = this.list.filter((item) => {
         this.options = this.list.filter((item) => {
@@ -77,7 +82,13 @@ export default {
           }
           }
         });
         });
       } else {
       } else {
-          this.getList();
+          await this.getList()
+          const optionids = this.options.map(item => item.userId)
+          const valueItem = this.listById[this.value]
+          if (!optionids.includes(this.value) && valueItem) {
+            this.options.push(valueItem)
+            this.options = uniqBy(this.options, 'userId')
+          }
       }
       }
     },
     },
     changeValue(val) {
     changeValue(val) {

+ 1 - 1
src/views/teacherManager/teacherDetail/components/teacherInfo.vue

@@ -170,7 +170,7 @@
           </el-row>
           </el-row>
              <el-row>
              <el-row>
             <el-col :span="12">
             <el-col :span="12">
-              <el-form-item label="转日期"
+              <el-form-item label="转日期"
                             :label-width="formLabelWidth">
                             :label-width="formLabelWidth">
                 <el-input disabled
                 <el-input disabled
                           v-model.trim="topForm.formalStaffDate"></el-input>
                           v-model.trim="topForm.formalStaffDate"></el-input>

+ 3 - 3
src/views/teacherManager/teacherList.vue

@@ -107,7 +107,7 @@
             v-model.trim="searchForm.isProbationPeriod"
             v-model.trim="searchForm.isProbationPeriod"
             clearable
             clearable
             filterable
             filterable
-            placeholder="人事状态"
+            placeholder="员工状态"
           >
           >
             <el-option label="正式" value="0"></el-option>
             <el-option label="正式" value="0"></el-option>
             <el-option label="试用" value="1"></el-option>
             <el-option label="试用" value="1"></el-option>
@@ -184,7 +184,7 @@
               scope.row.jobNature | jobNature
               scope.row.jobNature | jobNature
             }}</template>
             }}</template>
           </el-table-column>
           </el-table-column>
-          <el-table-column align="center" label="人事状态">
+          <el-table-column align="center" label="员工状态">
             <template slot-scope="scope">
             <template slot-scope="scope">
               {{ scope.row.isProbationPeriod == 0 ? "正式" : "试用" }}
               {{ scope.row.isProbationPeriod == 0 ? "正式" : "试用" }}
             </template>
             </template>
@@ -219,7 +219,7 @@
               }}</el-button>
               }}</el-button>
             </template>
             </template>
           </el-table-column>
           </el-table-column>
-             <el-table-column align="center" label="转日期">
+             <el-table-column align="center" label="转日期">
             <template slot-scope="scope">
             <template slot-scope="scope">
               <div>
               <div>
                 {{scope.row.formalStaffDate | dayjsFormat}}
                 {{scope.row.formalStaffDate | dayjsFormat}}

+ 5 - 5
src/views/teacherManager/teacherOperation/components/teacherOperation.vue

@@ -135,7 +135,7 @@
           <el-row>
           <el-row>
             <el-col :span="12">
             <el-col :span="12">
               <el-form-item
               <el-form-item
-                label="人事状态"
+                label="员工状态"
                 prop="isProbationPeriod"
                 prop="isProbationPeriod"
                 :label-width="formLabelWidth"
                 :label-width="formLabelWidth"
               >
               >
@@ -143,7 +143,7 @@
                   v-model.trim="topForm.isProbationPeriod"
                   v-model.trim="topForm.isProbationPeriod"
                   clearable
                   clearable
                   filterable
                   filterable
-                  placeholder="人事状态"
+                  placeholder="员工状态"
                 >
                 >
                   <el-option label="正式" :value="0"></el-option>
                   <el-option label="正式" :value="0"></el-option>
                   <el-option label="试用" :value="1"></el-option>
                   <el-option label="试用" :value="1"></el-option>
@@ -282,12 +282,12 @@
           </el-row>
           </el-row>
           <el-row>
           <el-row>
             <el-col :span="12">
             <el-col :span="12">
-              <el-form-item label="转日期" :label-width="formLabelWidth">
+              <el-form-item label="转日期" :label-width="formLabelWidth">
                 <el-date-picker
                 <el-date-picker
                    v-model="topForm.formalStaffDate"
                    v-model="topForm.formalStaffDate"
                     value-format="yyyy-MM-dd"
                     value-format="yyyy-MM-dd"
                   type="date"
                   type="date"
-                  placeholder="选择转日期"
+                  placeholder="选择转日期"
                 >
                 >
                 </el-date-picker>
                 </el-date-picker>
               </el-form-item>
               </el-form-item>
@@ -439,7 +439,7 @@ export default {
           { required: true, message: "请选择工作类型", trigger: "change" },
           { required: true, message: "请选择工作类型", trigger: "change" },
         ],
         ],
         isProbationPeriod: [
         isProbationPeriod: [
-          { required: true, message: "请选择人事状态", trigger: "change" },
+          { required: true, message: "请选择员工状态", trigger: "change" },
         ],
         ],
         organId: [
         organId: [
           { required: true, message: "请选择所属分部", trigger: "change" },
           { required: true, message: "请选择所属分部", trigger: "change" },