ソースを参照

Merge branch 'master' of http://47.100.37.243:10080/wutt/manHourHousekeeper into master

seyason 3 年 前
コミット
8b0eef3ee3
1 ファイル変更41 行追加11 行削除
  1. 41 11
      fhKeeper/formulahousekeeper/timesheet/src/views/leave/list.vue

+ 41 - 11
fhKeeper/formulahousekeeper/timesheet/src/views/leave/list.vue

@@ -296,7 +296,7 @@
           </div>
           <!-- <div style="margin-top: 30px"> -->
           <div>
-            <el-table v-loading="loading" :data="statisticalList" height="780px" style="width: 100%">
+            <el-table v-loading="loading" :data="statisticalList" height="780px" style="width: 99%">
               <el-table-column prop="ownerName" label="姓名" width="300">
                 <template slot-scope="scope">
                     <div v-if="scope.row.ownerName">
@@ -390,7 +390,7 @@
       <div class="ctons">
         <div style="display: flex;align-items: center;padding-bottom: 20px;border-bottom: 1px solid #f2f2f2">
             <div style="display: inline-block;width: 350px">
-              <el-input style="float:left;" v-model="keywordAl" class="input-with-select" placeholder="请输入人员姓名搜索" clearable="true" size="small">
+              <el-input style="float:left;" v-model="keywordAl" class="input-with-select" placeholder="请输入人员姓名搜索" clearable="true" size="small" @clear="clearsearchAl()">
                   <el-button slot="append" @click="searchAl()" icon="el-icon-search"></el-button>
               </el-input>
             </div>
@@ -410,9 +410,13 @@
                 :show-all-levels="false">
               </el-cascader>
             </div>
+            <div style="display: inline-block;width: 224px;margin-left:100px">
+              <el-button size="small" @click="changeAltime(0)" type="primary">批量设置</el-button>
+            </div>
         </div>
         <div>
-          <el-table v-loading="loading" :data="iAlDataS" height="780px" style="width: 100%">
+          <el-table v-loading="loading" :data="iAlDataS" height="780px" style="width: 99%;" @selection-change="selPchg">
+            <el-table-column type="selection"></el-table-column>
               <el-table-column prop="userName" label="姓名" width="200">
                 <template slot-scope="scope">
                   <div v-if="scope.row.userName">
@@ -677,7 +681,8 @@ export default {
       soption : null,
 
       Alshow: false,
-      Alchange: null,
+      Alchange: {yearDays:null,userId:null},
+      AlchangeP: [],
       susers: [],
       keywordAl: '',
       NcurDeptId:[],
@@ -708,27 +713,53 @@ export default {
   filters: {},
   methods: {
     changeAltime(e){
+      if(e == 0 && this.AlchangeP.length == 0){
+          this.$message('请选择要批量设置的项')
+          return
+      }else if(e != 0){
+        this.Alchange = JSON.parse(JSON.stringify(e))
+      }
       this.Alshow = true
-      this.Alchange = JSON.parse(JSON.stringify(e))
-      console.log("设置",this.Alchange);
+    },
+    selPchg(e){
+      this.AlchangeP = e
     },
     searchAl(){
       this.iAlDataS = []
       for (let i = 0; i < this.iAlData.length; i++) {
-        if (this.iAlData[i].name.indexOf(this.keywordAl) != -1) {
+        if (this.iAlData[i].userName.indexOf(this.keywordAl) != -1) {
           this.iAlDataS.push(this.iAlData[i])
         }
       }
     },
+    clearsearchAl(){
+      this.iAlDataS = this.iAlData
+    },
     delAltime(){
       this.Alshow = false
-      this.Alchange = null
+      this.Alchange = {yearDays:null,userId:null}
     },
     chgAltime(){
-      this.http.post('/user-yearleave-setting/save',{userId: this.Alchange.userId, companyId: this.user.companyId, yearDays: this.Alchange.yearDays},
+      let chgPar = {}
+      let userids = ''
+      let Alpost = ''
+      if(this.Alchange.userId == null && this.AlchangeP != []){
+        Alpost = "/user-yearleave-setting/saveBatch"
+        for (let i = 0; i < this.AlchangeP.length; i++) {
+          userids = userids + "," + this.AlchangeP[i].userId
+        }
+        chgPar = {userIds: userids.slice(1), companyId: this.user.companyId, yearDays: this.Alchange.yearDays}
+      }else {
+        Alpost = "/user-yearleave-setting/save"
+        userids = this.Alchange.userId
+        chgPar = {userId: userids, companyId: this.user.companyId, yearDays: this.Alchange.yearDays}
+      }
+      this.http.post(Alpost,chgPar,
           res => {
             if(res.code == "ok"){
               this.Alshow = false,
+              this.Alchange = {yearDays:null,userId:null},
+              this.AlchangeP = []
               this.getAl()
             }else{
               this.$message({
@@ -755,7 +786,6 @@ export default {
               if(this.apk2 == 6){
                 this.selAl()
               }
-              console.log("getAl",res.data);
             } else {
               this.$message({
                 message: res.msg,
@@ -830,7 +860,6 @@ export default {
                           {value: 2 , label : "指定人员",children : this.susers}
                         ]
                         this.Nsdata = list1
-                        console.log("列表",this.Nsdata);
                     } else {
                         this.$message({
                             message: res.msg,
@@ -1645,6 +1674,7 @@ export default {
 .ctons {
     width: 86%;
     height: 92%;
+    overflow: hidden;
     background: #fff;
     padding: 30px 40px;
     box-sizing: border-box;