zxr 3 years ago
parent
commit
0165b83754
1 changed files with 46 additions and 9 deletions
  1. 46 9
      src/views/peopleManage/people/index.vue

+ 46 - 9
src/views/peopleManage/people/index.vue

@@ -570,8 +570,8 @@
             </template>
           </el-table-column>
           <el-table-column label="命令号" align="center" prop="command" />-->
-          <el-table-column label="部职别" align="center" prop="duty" />
-          <el-table-column label="职务" align="center" prop="postId">
+          <el-table-column label="部职别" align="center" width="300" prop="duty" />
+          <el-table-column label="职务" align="center" width="120" prop="postId">
             <template slot-scope="scope">
               <dict-tag
                 :options="dict.type.post_Level"
@@ -751,17 +751,24 @@
           <el-table-column
             label="操作"
             align="center"
-            width="160"
+            width="200"
             fixed="right"
           >
-            <template slot-scope="scope">
+            <template slot-scope="scope"> 
               <el-button
                 size="btu"
                 type="text"
                 @click="handleUpdate(scope.row)"
-                v-hasPermi="['peopleManage:people:edit']"
+                v-hasPermi="['peopleManage:people:edit']" 
                 >修改</el-button
               >
+              <el-button
+                size="btk"
+                type="text"
+                @click="handlesee(scope.row)"
+                v-hasPermi="['peopleManage:people:query']" 
+                >查看</el-button
+              >
               <el-button
                 size="btd"
                 type="text"
@@ -1214,9 +1221,9 @@
             label
             label-width="0px"
             class="laborcontractuploading"
-            prop="laborContractUploading"
+            prop="readmeFile"
           >
-            <fileUpload v-model="form.laborContractUploading" class="m-l-20" />
+            <fileUpload v-model="form.readmeFile" class="m-l-20" />
           </el-form-item>
           <!-- <el-form-item label prop="readmeFile">
           <el-input v-model="form.readmeFile" type="textarea" placeholder />
@@ -1224,7 +1231,7 @@
         </el-form>
       </div>
       <div slot="footer" class="dialog-footer">
-        <el-button type="primary" @click="submitForm">确 定</el-button>
+        <el-button type="primary" v-if="btnflg" @click="submitForm">确 定</el-button>
         <el-button @click="cancel">取 消</el-button>
       </div>
     </el-dialog>
@@ -1481,6 +1488,7 @@ export default {
       },
       deptOptions: [],
       value: null,
+      btnflg:false
     };
   },
   created() {
@@ -1668,6 +1676,20 @@ export default {
       this.reset();
       this.open = true;
       this.title = "添加人员管理";
+      this.btnflg=true;
+    },
+    /** 查看按钮操作 */
+    handlesee(row) {
+      this.reset();
+      const id = row.id || this.ids;
+      getPeople(id).then((response) => {
+        this.form = response.data;
+        this.jtlist = response.data.familyInformation;
+        this.bdglPeopleList = response.data.bdglPeopleList;
+        this.open = true;
+        this.title = "查看人员管理";
+        this.btnflg=false;
+      });
     },
     /** 修改按钮操作 */
     handleUpdate(row) {
@@ -1679,12 +1701,17 @@ export default {
         this.bdglPeopleList = response.data.bdglPeopleList;
         this.open = true;
         this.title = "修改人员管理";
+        this.btnflg=true;
       });
     },
     /** 提交按钮 */
     submitForm() {
+      // console.log(this.form.laborContractUploading)
       this.$refs["form"].validate((valid) => {
         if (valid) {
+           if (this.form.readmeFile) {
+            this.form.readmeFile = this.form.readmeFile[0].name;
+          }
           this.form.deptName = this.$refs["deptId"].selectedLabel;
           this.form.bdglPeopleList = this.bdglPeopleList;
           this.form.familyInformation = this.jtlist;
@@ -1843,9 +1870,19 @@ export default {
         "-" +
         this.form.idcard.substr(10, 2) +
         "-" +
-        this.form.idcard.substr(10, 2);
+        this.form.idcard.substr(12, 2);
       var myDate = new Date();
       this.form.age = myDate.getFullYear() - this.form.idcard.substr(6, 4);
+      listPeople({idcard:this.form.idcard}).then((response)=>{
+            console.log()
+            if(response.rows.length>0){
+                this.form.idcard=null;
+                this.form.age=null;
+                this.form.birthDate=null;
+                this.form.sex=null;
+                this.$modal.msgError("该人员已存在,无需重复添加");
+            }
+      })
     },
     // 筛选节点
     filterNode(value, data) {