Prechádzať zdrojové kódy

休息时间段设置部门,企业微信账号继承

cs 2 rokov pred
rodič
commit
3838f1a04f

+ 24 - 6
fhKeeper/formulahousekeeper/timesheet/src/views/settings/timetype.vue

@@ -467,12 +467,12 @@
                 <el-form label-width="100px">
                     <el-form-item label="部门" v-if="setupItemId == null">
                         <!-- 部门筛选 -->
-                        <el-cascader v-if="user.userNameNeedTranslate != 1 && setupItemId == null" ref="deptList" :options="options" :placeholder="$t('qing-xuan-ze-bu-men')"
+                        <el-cascader style="width: 220px;" v-if="user.userNameNeedTranslate != 1 && setupItemId == null" ref="deptList" :options="options" :placeholder="$t('qing-xuan-ze-bu-men')"
                             :props="{value:'id',expandTrigger: 'hover',multiple: true }" collapse-tags :show-all-levels="false" clearable
                             @change="changeDept()"
                         >
                         </el-cascader>
-                        <vueCascader :widthStr="'125'" :clearable="true" :subject="options" :radios="true" :distinction="'1'" @vueCasader="vueCasader" v-if="user.userNameNeedTranslate == 1 && setupItemId == null" :selectNameChuan="$t('qing-xuan-ze-bu-men')"></vueCascader>
+                        <vueCascader :widthStr="'220'" size="small" :clearable="true" :subject="options" :distinction="'1'" @vueCasader="vueCasader" v-if="user.userNameNeedTranslate == 1 && setupItemId == null" :selectNameChuan="$t('qing-xuan-ze-bu-men')" @selectCal="selectCal"></vueCascader>
                     </el-form-item>
                     <el-form-item :label="$t('starttimes')">
                         <el-time-picker v-model="restTime.startTime" :placeholder="$t('message.Pleaseselectatime')" format="HH:mm" value-format="HH:mm" @change="timeRule(0)"></el-time-picker>
@@ -530,8 +530,13 @@
 </template>
 <script>
     import util from "../../common/js/util";
-
+    // 引入自定义级联组件
+    import vueCascader from "@/components/cascader.vue"
+    
     export default {
+        components: {
+            vueCascader
+        },
         data() {
             return {
                 settThree: false,
@@ -678,7 +683,10 @@
                 },res => {
                     if(res.code == 'ok'){
                         this.options = res.data;
-                        //this.options.unshift({ label: '全选', id: 0 })
+                        console.log(res.data)
+                        var all = { label: '全选',children:[]}
+                        all.children = JSON.parse(JSON.stringify(res.data))
+                        this.options.unshift(all)
                     }else {
                         this.$message({
                             message: res.msg,
@@ -1381,7 +1389,9 @@
                 var deptIdList = this.$refs["deptList"].getCheckedNodes();
                 var deptId = [];
                 for (var i=0; i<deptIdList.length; i++) {
-                    deptId.push(deptIdList[i].data.id);
+                    if (deptIdList[i].data.label != '全选'){
+                        deptId.push(deptIdList[i].data.id);
+                    }
                 }
                 this.restTime.departmentId = deptId;
             },
@@ -1396,7 +1406,15 @@
                 this.searchPersonnelFlgnum = +this.searchPersonnelFlgnum +1
                 this.searchPersonnelFlg = false
                 this.whiteListAll = this.whiteListAllTwo
-            }
+            },
+            // 自定义组件事件
+            vueCasader(obj) {
+                if(obj.distinction == '1') {
+                let arr = []
+                arr.push(obj.id)
+                this.handleSelectionZzjgwillchange = arr
+                }
+            },
 
         },
     };

+ 68 - 2
fhKeeper/formulahousekeeper/timesheet/src/views/team/index.vue

@@ -254,7 +254,8 @@
                         <!-- <el-button size="mini" type="danger"  v-if="scope.row.roleName != $t('role.superAdministrator')" @click="deleteUser(scope.row)">删除</el-button> -->
                         <el-button size="mini" type="default" v-if="scope.row.roleName != $t('role.superAdministrator') && scope.row.isActive==1" @click="showDeactiveDialog(scope.row)">{{ $t('ting-yong') }}</el-button>
                         <el-button size="mini" type="success" v-if="scope.row.roleName != $t('role.superAdministrator') && scope.row.isActive==0" @click="setActive(scope.row, 1)">{{ $t('enable') }}</el-button>
-                    </template>
+                        <el-button size="mini" type="success" v-if="scope.row.roleName != $t('role.superAdministrator') && scope.row.activeInfoByUser == 1" @click="transferActiveDialog(scope.row)">转让</el-button>
+                      </template>
                 </el-table-column>
             </el-table>
 
@@ -810,6 +811,18 @@
           <el-button type="primary" @click="newSyncWithCorpWx">开始同步</el-button>
         </span>
       </el-dialog>
+
+      <el-dialog
+        title="转移到"
+        :visible.sync="transferActiveDialogFlag"
+        width="20%">
+        <span style="margin-left:25px;margin-right:5px;color:#606266;">转移到</span>
+        <selectCat v-if="user.userNameNeedTranslate == 1" :subject="users" :subjectId="transferActive.takeoverId" :distinction="'23'" :clearable="true" @selectCal="selectCal"></selectCat>            
+        <span slot="footer" class="dialog-footer">
+          <el-button @click="transferActiveDialogFlag = false">取 消</el-button>
+          <el-button type="primary" @click="transferActiveMethod">确 定</el-button>
+        </span>
+      </el-dialog>
     </div>
   </div>
 </template>
@@ -877,6 +890,11 @@ export default {
   },
   data() {
     return {
+      transferActiveDialogFlag:false,
+      transferActive:{
+        handoverId:null,
+        takeoverId:null
+      },
       integer: '0',
       workingHoursDialog: false,
       workingHoursRadio: '1',
@@ -1054,7 +1072,7 @@ export default {
         {
           value: "0",
           label: this.$t('ting-yong'),
-        },
+        }
       ],
       status: "1",
       role: "",
@@ -1125,6 +1143,50 @@ export default {
     that = this;
   },
   methods: {
+    statesPush(){
+      if(this.user.corpwxUserid != null && this.user.userNameNeedTranslate == 1){
+        var state = {value: "2",label: "可转让"}
+        this.states.push(state);
+      } 
+    },
+    //继承账号弹窗
+    transferActiveDialog(row){
+      this.transferActiveDialogFlag = true;
+      this.transferActive.handoverId = row.id;
+    },
+    //继承账号
+    transferActiveMethod(){
+      if(this.transferActive.takeoverId == null){
+        this.$message({
+                  message: "请选择接收人",
+                  type: "error"
+              });
+        return;
+      }
+      this.transferActiveDialogFlag = false;
+      var handoverId = this.transferActive.handoverId
+      var takeoverId = this.transferActive.takeoverId
+      this.http.post('/wx-corp-info/batchTransferLicense', {handoverId,takeoverId},
+      res => {
+          if (res.code == "ok") {
+            this.$message({
+                  message: res.msg,
+                  type: "success"
+              });
+          } else {
+              this.$message({
+                  message: res.msg,
+                  type: "error"
+              });
+          }
+      },
+      error => {
+          this.$message({
+              message: error,
+              type: "error"
+          });
+      });
+    },
     // 调整
     adjustPositionClick() {
       this.adjustPosition = !this.adjustPosition
@@ -3541,6 +3603,9 @@ export default {
       } else if(obj.distinction == '22') {
         console.log(obj, '返回')
         this.moveReportUserId = obj.id
+      } else if(obj.distinction == '23') {
+        console.log(obj, '返回qwe')
+        this.transferActive.takeoverId = obj.id
       }
     },
     // 企业微信可见范围设置
@@ -3648,6 +3713,7 @@ export default {
     if(this.user.corpwxUserid != null && this.user.timeType.saasSyncContact == 1) {
       this.getWxManager()
     }
+    this.statesPush();
     // 获取企业微信的参数
     // if(this.user.companyId == '1081' || this.user.companyId == '7') {
     //   this.agentConfig()