From e932baad19331b34536dbc91bb5b0f18c8521c2a Mon Sep 17 00:00:00 2001
From: yz <yz_0812@outlook.com>
Date: 星期三, 10 三月 2021 02:56:10 +0800
Subject: [PATCH] 修改bug

---
 src/views/yunpan/fujian.vue         |  139 ++++++++++++++++++++++++---
 src/settings.js                     |    2 
 src/views/user/Informationinput.vue |    2 
 src/views/yunpan/zhishou.vue        |   74 ++++++++++++++
 src/views/yunpan/uploadfj.vue       |   77 ++++++++++++++
 5 files changed, 266 insertions(+), 28 deletions(-)

diff --git a/src/settings.js b/src/settings.js
index a040cc6..9792e10 100644
--- a/src/settings.js
+++ b/src/settings.js
@@ -29,6 +29,6 @@
     // 下载员工导入模版
     downloadEmpExcel: 'http://120.24.23.155:8000/员工信息.xls',
     // 导入员工
-    uploadEmpExcel: 'http://120.24.23.155:8301/hr/empBaseInfo/importEmp'
+    uploadEmpExcel: 'http://127.0.0.1:8301/hr/empBaseInfo/importEmp'
   }
 }
diff --git a/src/views/user/Informationinput.vue b/src/views/user/Informationinput.vue
index 599cd22..a6345c1 100644
--- a/src/views/user/Informationinput.vue
+++ b/src/views/user/Informationinput.vue
@@ -3128,7 +3128,7 @@
       })
     },
     importHandleAvatarSuccess(res, file) {
-      if (res.data === null) {
+      if (res.data === null || res.data.length === 0) {
         this.$notify({
           title: '成功',
           message: '导入成功!',
diff --git a/src/views/yunpan/fujian.vue b/src/views/yunpan/fujian.vue
index a019363..676da44 100644
--- a/src/views/yunpan/fujian.vue
+++ b/src/views/yunpan/fujian.vue
@@ -149,6 +149,62 @@
                     </el-checkbox-group>
                   </td>
                 </tr>
+                <tr>
+                  <td class="td">工作证:</td>
+                  <td class="td-group">
+                    <el-checkbox-group v-model="queryform.empCardStatus" class="fj-checkbox">
+                      <el-checkbox label="" @change="selectAllEmpCardStatus">全部</el-checkbox>
+                      <el-checkbox
+                        v-for="data in empCardStatusOptions"
+                        :key="data.dicItemName"
+                        :label="data.dicItemCode"
+                      >
+                        {{ data.dicItemName }}
+                      </el-checkbox>
+                    </el-checkbox-group>
+                  </td>
+                </tr>
+                <tr>
+                  <td class="td">员工手册:</td>
+                  <td class="td-group">
+                    <el-checkbox-group v-model="queryform.handbookStatus" class="fj-checkbox">
+                      <el-checkbox label="" @change="selectAllHandbookStatus">全部</el-checkbox>
+                      <el-checkbox
+                        v-for="data in handbookStatusOptions"
+                        :key="data.dicItemName"
+                        :label="data.dicItemCode"
+                      >
+                        {{ data.dicItemName }}
+                      </el-checkbox>
+                    </el-checkbox-group>
+                  </td>
+                </tr>
+                <tr>
+                  <td class="td">员工类型:</td>
+                  <td class="td-group">
+                    <el-checkbox-group v-model="queryform.empType" class="fj-checkbox">
+                      <el-checkbox label="" @change="selectAllEmpType">全部</el-checkbox>
+                      <el-checkbox
+                        v-for="data in empTypeOptions"
+                        :key="data.dicItemName"
+                        :label="data.dicItemCode"
+                      >
+                        {{ data.dicItemName }}
+                      </el-checkbox>
+                    </el-checkbox-group>
+                  </td>
+                </tr>
+                <tr>
+                  <td class="td">入职类型:</td>
+                  <td class="td-group">
+                    <el-checkbox-group v-model="queryform.entryType" class="fj-checkbox">
+                      <el-checkbox label="" @change="selectAllEntryType">全部</el-checkbox>
+                      <el-checkbox :label="4">新入职</el-checkbox>
+                      <el-checkbox :label="5">最新入职</el-checkbox>
+                      <el-checkbox :label="6">返聘入职</el-checkbox>
+                    </el-checkbox-group>
+                  </td>
+                </tr>
               </table>
             </el-col>
           </el-row>
@@ -159,7 +215,6 @@
           <el-col :span="24">
             <el-button class="hr-but-all" type="danger" @click="dialogFormVisible = true">新建标签</el-button>
             <el-button type="primary" @click="deldialogFormVisible = true">删除标签</el-button>
-            <el-button class="hr-but-all" type="danger" @click="downloaddialogFormVisible = true">下载附件</el-button>
             <el-dialog
               title="新建标签"
               :visible.sync="dialogFormVisible"
@@ -380,7 +435,11 @@
         age: [],
         archivesStatus: [],
         insuranceType: [],
-        empStatus: []
+        empStatus: [],
+        empCardStatus: [],
+        handbookStatus: [],
+        empType: [],
+        entryType: []
       },
       total: 0, // 总数量
       pagination: { // 分页参数
@@ -433,12 +492,24 @@
       educationOptions: [],
       statusOptions: [],
       ageStrOptions: [],
-      archivesStatusOptions: []
+      archivesStatusOptions: [],
+      empCardStatusOptions: [],
+      handbookStatusOptions: [],
+      empTypeOptions: []
     }
   },
   mounted() {
     this.initLabel()
     this.fetch()
+    this.getDicts('empType').then(response => {
+      this.empTypeOptions = response.data
+    })
+    this.getDicts('empCardStatus').then(response => {
+      this.empCardStatusOptions = response.data
+    })
+    this.getDicts('handbookStatus').then(response => {
+      this.handbookStatusOptions = response.data
+    })
     this.getDicts('sex').then(response => {
       this.sexOptions = response.data
     })
@@ -618,52 +689,82 @@
     },
     selectAllSex(val) {
       if (val) {
-        this.queryform.sex = ['1', '2']
+        this.queryParams.sex = this.dicListToArr(this.sexOptions)
       } else {
-        this.queryform.sex = []
+        this.queryParams.sex = []
       }
     },
     selectAllEducation(val) {
       if (val) {
-        this.queryform.education = ['91', '81', '71', '61', '42', '41', '31', '21', '11', '10']
+        this.queryParams.education = this.dicListToArr(this.educationOptions)
       } else {
-        this.queryform.education = []
+        this.queryParams.education = []
       }
     },
     selectAllPolitics(val) {
       if (val) {
-        this.queryform.politics = ['01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12', '13']
+        this.queryParams.politics = this.dicListToArr(this.statusOptions)
       } else {
-        this.queryform.politics = []
+        this.queryParams.politics = []
       }
     },
-    selectAllage(val) {
+    selectAllAgeStr(val) {
       if (val) {
-        this.queryform.age = ['18-29', '30-39', '40-49', '50-59', '60-69', '69-999']
+        this.queryParams.ageStr = this.dicListToArr(this.ageStrOptions)
       } else {
-        this.queryform.age = []
+        this.queryParams.ageStr = []
       }
     },
     selectAllArchivesStatus(val) {
       if (val) {
-        this.queryform.archivesStatus = ['0', '1']
+        this.queryParams.archivesStatus = this.dicListToArr(this.archivesStatusOptions)
       } else {
-        this.queryform.archivesStatus = []
+        this.queryParams.archivesStatus = []
       }
     },
     selectAllInsuranceType(val) {
       if (val) {
-        this.queryform.insuranceType = ['1', '2', '3', '4', '5']
+        this.queryParams.insuranceType = this.dicListToArr(this.insuranceTypeOptions)
       } else {
-        this.queryform.insuranceType = []
+        this.queryParams.insuranceType = []
       }
     },
-    selectAllEmpStatus(val) {
+    selectAllEmpCardStatus(val) {
       if (val) {
-        this.queryParams.empStatus = ['0', '1', '2', '3']
+        this.queryParams.empCardStatus = this.dicListToArr(this.empCardStatusOptions)
       } else {
-        this.queryParams.empStatus = []
+        this.queryParams.empCardStatus = []
       }
+    },
+    selectAllHandbookStatus(val) {
+      if (val) {
+        this.queryParams.handbookStatus = this.dicListToArr(this.handbookStatusOptions)
+      } else {
+        this.queryParams.handbookStatus = []
+      }
+    },
+    selectAllEmpType(val) {
+      if (val) {
+        this.queryParams.empType = this.dicListToArr(this.empTypeOptions)
+      } else {
+        this.queryParams.empType = []
+      }
+    },
+    selectAllEntryType(val) {
+      if (val) {
+        this.queryParams.entryType = [4, 5, 6]
+      } else {
+        this.queryParams.entryType = []
+      }
+    },
+    // dic列表转为数组
+    dicListToArr(dicList) {
+      var arr = []
+      for (var i = 0; i < dicList.length; i++) {
+        var dic = dicList[i]
+        arr.push(dic.dicItemCode)
+      }
+      return arr
     }
   }
 }
diff --git a/src/views/yunpan/uploadfj.vue b/src/views/yunpan/uploadfj.vue
index bfd57d3..d1fbe1b 100644
--- a/src/views/yunpan/uploadfj.vue
+++ b/src/views/yunpan/uploadfj.vue
@@ -47,14 +47,14 @@
             />提示:文件不要超过10个,单个文件大小不超过50M,单击或者拖动文件到下面区域,支持单个或批量文件的上传。</el-col>
           </el-row>
           <el-row style="background-color: rgba(0,0,0,0.2);">
-            <el-col :span="16">
+            <el-col :span="14">
               <el-checkbox
                 v-model="checkAll"
                 class="myRedCheckBox"
                 style="color: #000; margin-left: 20px;"
                 @change="checkAllMethods()"
               >全选</el-checkbox></el-col>
-            <el-col :span="8">
+            <el-col :span="10">
               <el-button
                 type="primary"
                 icon="el-icon-download"
@@ -70,9 +70,23 @@
               <el-popconfirm title="是否移动附件?" @onConfirm="mvdialogFormVisible = true">
                 <el-button slot="reference" class="hr-but" type="danger">转存</el-button>
               </el-popconfirm>
+              <el-button type="warning" @click="openUpdateFileName()">重命名</el-button>
+              <el-button type="primary" @click="downloaddialogFormVisible = true">查看</el-button>
             </el-col>
           </el-row>
         </el-header>
+        <el-dialog title="修改文件名" :visible.sync="updateFileNameFormVisible" append-to-body width="20%">
+          <el-form ref="updateFileName" :model="file" :rules="mvrules">
+            <el-form-item label="文件名" :label-width="formLabelWidth" prop="fileName">
+              <el-input v-model="file.fileName" autocomplete="off" />
+            </el-form-item>
+          </el-form>
+          <div slot="footer" class="dialog-footer">
+            <el-button @click="updateFileNameFormVisible = false">取 消</el-button>
+            <el-button type="primary" @click="updateFileName('updateFileName')">确 定</el-button>
+          </div>
+        </el-dialog>
+
         <el-dialog
           title="移动文件"
           :visible.sync="mvdialogFormVisible"
@@ -110,11 +124,11 @@
               <el-col v-if="node.isUpload === false" :key="node.filesid" :span="3">
                 <el-card
                   shadow="never"
-                  @click.native="clickCard(index * 8 + nodeIndex)"
                 >
                   <img
                     :src="showFileImg(node.filesformat)"
                     class="uploading-image"
+                    @click="clickCard(index * 8 + nodeIndex)"
                   >
                   <el-tooltip class="item" effect="dark" :content="node.filesname" placement="bottom">
                     <div style="padding-top: 14px;">
@@ -164,8 +178,16 @@
   },
   data() {
     return {
+      updateFileNameFormVisible: false,
+      file: {
+        fileName: ''
+      },
       mvrules: {
-        labelid: [{ required: true, message: '请选择标签', trigger: 'change' }]
+        labelid: [{ required: true, message: '请选择标签', trigger: 'change' }],
+        fileName: [
+          { required: true, message: '请输入文件名称', trigger: 'blur' },
+          { min: 3, max: 10, message: '长度在 3 到 20 个字符', trigger: 'blur' }
+        ]
       },
       mvdialogFormVisible: false,
       uploadSinglePath: pages.uploadSinglePath,
@@ -191,6 +213,53 @@
     this.initlabel()
   },
   methods: {
+    updateFileName(formName) {
+      this.$refs[formName].validate(valid => {
+        if (valid) {
+          var checke = ''
+          debugger
+          this.checkedArr.forEach((v, i) => {
+            if (v.isChecked) {
+              checke = v.accessoryid
+            }
+          })
+          // 生成查询文件的条件
+          var params = { accessoryid: checke, filesname: this.file.fileName }
+          this.$put('hr/empAccessory', { ...params }).then(() => {
+            this.$message({
+              message: '重命名成功!',
+              type: 'success'
+            })
+            this.file.fileName = ''
+            this.updateFileNameFormVisible = false
+            // 生成查询文件的条件
+            var initFileParams = {
+              labelid: this.activities[this.beforeIndex].id,
+              filesname: this.fileName,
+              empid: this.rowitem.empId
+            }
+            this.initFile(initFileParams)
+          })
+        }
+      })
+    },
+    openUpdateFileName() {
+      var checke = []
+      this.checkedArr.forEach((v, i) => {
+        if (v.isChecked) {
+          checke.push(v.filesid)
+        }
+      })
+
+      if (checke.length <= 0) {
+        this.$message({
+          message: '请选择一个需要重命名的文件!',
+          type: 'warning'
+        })
+      } else {
+        this.updateFileNameFormVisible = true
+      }
+    },
     async initlabel() {
       await this.$get('hr/label').then(r => {
         this.activities = []
diff --git a/src/views/yunpan/zhishou.vue b/src/views/yunpan/zhishou.vue
index d1950a4..a7f31ca 100644
--- a/src/views/yunpan/zhishou.vue
+++ b/src/views/yunpan/zhishou.vue
@@ -81,14 +81,14 @@
             />提示:文件不要超过10个,单个文件大小不超过200M,单击或者拖动文件到下面区域,支持单个或批量文件的上传。</el-col>
           </el-row>
           <el-row style="background-color: rgba(0,0,0,0.2);">
-            <el-col :span="17">
+            <el-col :span="14">
               <el-checkbox
                 v-model="checkAll"
                 class="myRedCheckBox"
                 style="color: #000; margin-left: 20px;"
                 @change="checkAllMethods()"
               >全选</el-checkbox></el-col>
-            <el-col :span="7">
+            <el-col :span="10">
               <el-button
                 type="primary"
                 icon="el-icon-download"
@@ -104,9 +104,24 @@
               <el-popconfirm title="是否移动文件?" @onConfirm="mvdialogFormVisible = true">
                 <el-button slot="reference" class="hr-but" type="danger">转存</el-button>
               </el-popconfirm>
+              <el-button type="warning" @click="openUpdateFileName()">重命名</el-button>
+              <el-button type="primary" @click="downloaddialogFormVisible = true">查看</el-button>
             </el-col>
           </el-row>
         </el-header>
+
+        <el-dialog title="修改文件名" :visible.sync="updateFileNameFormVisible" width="20%">
+          <el-form ref="updateFileName" :model="file" :rules="rules">
+            <el-form-item label="文件名" :label-width="formLabelWidth" prop="fileName">
+              <el-input v-model="file.fileName" autocomplete="off" />
+            </el-form-item>
+          </el-form>
+          <div slot="footer" class="dialog-footer">
+            <el-button @click="updateFileNameFormVisible = false">取 消</el-button>
+            <el-button type="primary" @click="updateFileName('updateFileName')">确 定</el-button>
+          </div>
+        </el-dialog>
+
         <el-dialog
           title="移动文件"
           :visible.sync="mvdialogFormVisible"
@@ -151,7 +166,7 @@
                   >
                   <el-tooltip class="item" effect="dark" :content="node.filesname" placement="bottom">
                     <div style="padding-top: 14px;">
-                      <el-checkbox v-model="checkedArr[index * rowCount + nodeIndex].isChecked" class="myRedCheckBox">{{ node.filesname }}</el-checkbox>
+                      <el-checkbox v-model="checkedArr[index * 8 + nodeIndex].isChecked" class="myRedCheckBox">{{ node.filesname }}</el-checkbox>
                     </div>
                   </el-tooltip>
                 </el-card>
@@ -191,6 +206,10 @@
 export default {
   data() {
     return {
+      updateFileNameFormVisible: false,
+      file: {
+        fileName: ''
+      },
       rowCount: 12,
       mvrules: {
         folderid: [{ required: true, message: '请选择目录', trigger: 'change' }]
@@ -212,6 +231,10 @@
           { required: true, message: '请输入文件夹名称', trigger: 'blur' },
           { min: 3, max: 10, message: '长度在 3 到 10 个字符', trigger: 'blur' }
         ],
+        fileName: [
+          { required: true, message: '请输入文件名称', trigger: 'blur' },
+          { min: 3, max: 10, message: '长度在 3 到 20 个字符', trigger: 'blur' }
+        ],
         sort: [{ required: true, message: '请输入排序', type: 'number', trigger: 'blur' }]
       },
       formLabelWidth: '100px',
@@ -229,6 +252,51 @@
     this.initFolder()
   },
   methods: {
+    updateFileName(formName) {
+      this.$refs[formName].validate(valid => {
+        if (valid) {
+          var checke = ''
+          this.checkedArr.forEach((v, i) => {
+            if (v.isChecked) {
+              checke = v.filesid
+            }
+          })
+          // 生成查询文件的条件
+          var params = { filesid: checke, filesname: this.file.fileName }
+          this.$put('hr/filesUpload', { ...params }).then(() => {
+            this.$message({
+              message: '重命名成功!',
+              type: 'success'
+            })
+            this.updateFileNameFormVisible = false
+            this.file.fileName = ''
+            // 生成查询文件的条件
+            var initFileParams = {
+              folderid: this.activities[this.beforeIndex].id,
+              filesname: this.fileName
+            }
+            this.initFile(initFileParams)
+          })
+        }
+      })
+    },
+    openUpdateFileName() {
+      var checke = []
+      this.checkedArr.forEach((v, i) => {
+        if (v.isChecked) {
+          checke.push(v.filesid)
+        }
+      })
+
+      if (checke.length <= 0) {
+        this.$message({
+          message: '请选择一个需要重命名的文件!',
+          type: 'warning'
+        })
+      } else {
+        this.updateFileNameFormVisible = true
+      }
+    },
     async initFolder() {
       await this.$get('hr/folder').then(r => {
         this.activities = []

--
Gitblit v1.8.0