Browse Source

解决组织架构中编辑人员后会跳到第一页的问题

seyason 1 year ago
parent
commit
183406bb20
1 changed files with 6 additions and 196 deletions
  1. 6 196
      fhKeeper/formulahousekeeper/timesheet/src/views/team/index.vue

+ 6 - 196
fhKeeper/formulahousekeeper/timesheet/src/views/team/index.vue

@@ -518,59 +518,6 @@
           <el-button type="primary" @click="deleteUser(deleteUserFlgData)" :loading="deleteUserFlgloading">确 定</el-button>
         </span>
       </el-dialog>
-
-        <!-- 编辑超级管理员的Dialog -->
-        <el-dialog :title="$t('editorialstaff')" :visible.sync="dialogVisible1" width="550px" >
-            <el-form ref="form1" :model="insertForm" :rules="rules" label-width="80px">
-                <el-form-item :label="$t('lable.name')" prop="name">
-                    <el-input v-model="insertForm.name" :placeholder="$t('peaseenterthe')" clearable :disabled="user.userNameNeedTranslate == '1'"></el-input>
-                </el-form-item>
-                <el-form-item :label="$t('phone')" prop="phone">
-                    <el-input v-model="insertForm.phone" :placeholder="$t('peaseenterthe')" clearable></el-input>
-                </el-form-item>
-                <el-form-item :label="$t('Worknumber')" prop="jobNumber">
-                    <el-input v-model="insertForm.jobNumber" :placeholder="$t('peaseenterthe')" clearable></el-input>
-                </el-form-item>
-                <el-form-item :label="$t('payway')" prop="salaryType" v-if="permissions.structurePersonnel">
-                    <el-radio-group v-model="insertForm.salaryType" @change="onSalaryTypeChange">
-                    <el-radio  :label="0" >{{ $t('fixedmonthlycost') }}</el-radio>
-                    <el-radio  :label="1">{{ $t('hourlywages') }}</el-radio>
-                    </el-radio-group>
-                </el-form-item>
-                <el-form-item :label="$t('monthcost')" prop="monthCost" v-if="insertForm.salaryType == 0 && permissions.structurePersonnel" >
-                    <el-input v-model="insertForm.monthCost" id="monthCost" @input="oninput" @keyup.native="restrictNumber('monthCost')" :placeholder="$t('yuechengben')" clearable></el-input>
-                    <span style="color:orange;font-size:12px;">{{ $t('yuegongzuoo') }}{{timeType.monthDays}}{{ $t('time.day') }},{{$t('meitian')}}{{timeType.allday}}{{ $t('xiaoshi') }}</span>
-                    <el-link :underline="false" style="color:blue;font-size:12px;margin-left:7px;" href="#/timetype">{{ $t('modifyworkinghours') }}</el-link>
-                </el-form-item>
-                <el-form-item :label="$t('hourlywage')" prop="cost" v-if="permissions.structurePersonnel">
-                    <el-input v-model="insertForm.cost" id="cost" :disabled="insertForm.salaryType == 0" @keyup.native="restrictNumber4('cost')" style="width:120px;"
-                     :placeholder="$t('yuechengbenxiaoshi')" clearable></el-input>
-                    <span style="margin-left:25px;">{{ $t('effectivedate') }}</span>
-                    <el-date-picker v-model="insertForm.costApplyDate"  value-format="yyyy-MM-dd"></el-date-picker>
-                </el-form-item>
-                <el-form-item :label="$t('lable.department')" prop="departmentId">
-                    <el-cascader v-model="insertForm.departmentId" 
-                    :placeholder="$t('qing-xuan-ze-bu-men')" 
-                    style="width: 100%"
-                    :options="option" 
-                    :props="{ checkStrictly: true,expandTrigger: 'hover' }" :show-all-levels="false" 
-                    clearable></el-cascader>
-                </el-form-item>
-                <!-- <el-form-item :label="$t('immediatesuperior')">
-                    <el-select v-model="insertForm.superiorId" :placeholder="$t('defaultText.pleaseChoose')" style="width: 100%" filterable clearable>
-                        <el-option v-for="item in users" :label="item.name" :value="item.id" :key="item.id" :disabled="item.id == insertForm.id">
-                            <span style="float: left">{{item.name}}</span>
-                            <span style="float: right; color: #8492a6; font-size: 13px">{{item.departmentName}}</span>
-                        </el-option>
-                    </el-select>
-                </el-form-item> -->
-            </el-form>
-            <span slot="footer" class="dialog-footer">
-                <el-button @click="dialogVisible1=false">{{ $t('btn.cancel') }}</el-button>
-                <el-button type="primary" @click="submitInsert1" :loading="submitLoading">{{ $t('btn.submit') }}</el-button>
-            </span>
-        </el-dialog>
-
         <el-dialog :title="$t('historicalpersonnelcost')" :visible.sync="userSalaryListDialog" width="550px" >
             <el-table :data="userSalaryList" highlight-current-row v-loading="listLoading" height="300px" style="width: 100%;">
                 <el-table-column prop="userName" :label="$t('lable.name')" >
@@ -1041,8 +988,6 @@ export default {
       managementFormRou: {
         name: [{ required: true, message: this.$t('pleaseenterprofessionalcertificate'), trigger: "blur" }],
       },
-      dialogVisible1: false,
-
       departmentVisible: false,
       depTitle: "",
       depForm: {
@@ -2491,19 +2436,17 @@ export default {
     //分页
     handleCurrentChange(val) {
       this.page = val;
-      this.getUser(1);
+      this.getUser();
     },
 
     handleSizeChange(val) {
       this.size = val;
-      this.getUser(1);
+      this.page=1;
+      this.getUser();
     },
 
     //获取所有员工的列表
-    getUser(e) {
-      if (e != 1) {
-        this.page = 1;
-      }
+    getUser() {
       // console.log(12345)
       this.listLoading = true;
       this.http.post(
@@ -2854,6 +2797,7 @@ export default {
               type: "success",
             });
             //重新读取列表
+            this.page=1;
             this.getUser();
           } else {
             this.$message({
@@ -2914,141 +2858,6 @@ export default {
         .catch(() => {});
     },
 
-    // 修改老板的成本
-    openInsertDialog1(row) {
-      var list1 = JSON.parse(JSON.stringify(row)),
-        arr1 = [],
-        array1 = [];
-      if (list1.departmentCascade != "0" && list1.departmentCascade != null) {
-        if (list1.departmentCascade.indexOf(",") > -1) {
-          arr1 = list1.departmentCascade.split(",");
-        } else {
-          arr1 = [].concat(list1.departmentCascade);
-        }
-      }
-
-      for (var i in arr1) {
-        array1.push(parseInt(arr1[i]));
-      }
-      this.http.post(
-        "/user/getUserInfo",
-        {
-          userId: list1.id,
-        },
-        (res) => {
-          if (res.code == "ok") {
-            this.insertForm = {
-              id: res.data.id,
-              name: res.data.name,
-              phone: res.data.phone,
-              roleId: res.data.roleId,
-              monthCost: res.data.monthCost,
-              cost: res.data.cost,
-              departmentId: array1.reverse(),
-              salaryType: res.data.salaryType,
-              costApplyDate: res.data.costApplyDate,
-              inductionDate: res.data.inductionDate,
-              position: res.data.position,
-              certJson: res.data.certList,
-              plateMap: {},
-              superiorId: res.data.superiorId,
-              jobNumber: res.data.jobNumber,
-            };
-          } else {
-            this.$message({
-              message: res.msg,
-              type: "error",
-            });
-          }
-        },
-        (error) => {
-          this.listLoading = false;
-          this.$message({
-            message: error,
-            type: "error",
-          });
-        }
-      );
-      // console.log(list1)
-      // this.insertForm = {
-      //     id: list1.id,
-      //     name: list1.name,
-      //     phone: list1.phone,
-      //     roleId: list1.roleId,
-      //     monthCost:list1.monthCost,
-      //     cost: list1.cost,
-      //     departmentId: array1.reverse(),
-      //     salaryType: list1.salaryType,
-      //     name: list1.name,
-      //     position: list1.position,
-      //     certJson: list1.certJson
-      // };
-      this.dialogVisible1 = true;
-    },
-
-    submitInsert1() {
-      var form = {};
-      this.$refs.form1.validate((valid) => {
-        if (valid) {
-          this.submitLoading = true;
-          form = {
-            id: this.insertForm.id,
-            name: this.insertForm.name,
-            phone: this.insertForm.phone,
-            roleId: this.insertForm.roleId,
-            monthCost: this.insertForm.monthCost,
-            cost: this.insertForm.cost,
-            position: this.insertForm.position,
-            certJson: this.insertForm.certJson,
-            inductionDate: this.insertForm.inductionDate,
-            jobNumber: this.insertForm.jobNumber,
-          };
-          if (this.insertForm.departmentId != null) {
-            form.departmentId =
-              this.insertForm.departmentId[
-                this.insertForm.departmentId.length - 1
-              ];
-          }
-          if (this.insertForm.costApplyDate != null) {
-            form.costApplyDate = this.insertForm.costApplyDate;
-          }
-          if (this.insertForm.superiorId) {
-            form.superiorId = this.insertForm.superiorId;
-          }
-
-          this.http.post(
-            this.port.manage.insert,
-            form,
-            (res) => {
-              this.submitLoading = false;
-              if (res.code == "ok") {
-                this.$message({
-                  message: this.$t('message.modifyTheSuccess'),
-                  type: "success",
-                });
-                this.dialogVisible1 = false;
-                //重新读取列表
-                this.getUser();
-                this.getUsers();
-              } else {
-                this.$message({
-                  message: res.msg,
-                  type: "error",
-                });
-              }
-            },
-            (error) => {
-              this.listLoading = false;
-              this.$message({
-                message: error,
-                type: "error",
-              });
-            }
-          );
-        }
-      });
-    },
-
     // 获取部门列表
     getDepartment() {
       this.http.post(
@@ -3312,6 +3121,7 @@ export default {
                     label: this.$t('lable.allStaff'),
                   };
                   that.getDepartment();
+                  this.page=1;
                   that.getUser();
                 } else {
                   that.$message({