浏览代码

业务员列表添加员工状态筛选

xiaohaizhao 1 年之前
父节点
当前提交
119a1f539d
共有 2 个文件被更改,包括 10 次插入6 次删除
  1. 9 5
      components/organization/index.js
  2. 1 1
      components/organization/index.wxml

+ 9 - 5
components/organization/index.js

@@ -57,16 +57,20 @@ Component({
                 isleave: e.currentTarget.dataset.value,
                 isleave: e.currentTarget.dataset.value,
                 'result.isleave': e.currentTarget.dataset.value
                 'result.isleave': e.currentTarget.dataset.value
             })
             })
+            this.initDepAndUser(false);
         },
         },
-        initDepAndUser() {
-            this.setData({
+        initDepAndUser(init = true) {
+            if (init) this.setData({
+                takeEffect: "", //生效筛选项
                 result: {},
                 result: {},
-                takeEffect: ""
             })
             })
+            let content = {
+                isleave: this.data.isleave
+            }
             return new Promise((resolve) => {
             return new Promise((resolve) => {
                 _Http.basic({
                 _Http.basic({
                     "id": 20230620102004,
                     "id": 20230620102004,
-                    "content": {}
+                    content
                 }).then(res => {
                 }).then(res => {
                     console.log("获取部门", res)
                     console.log("获取部门", res)
                     if (this.data.isdep) this.setData({
                     if (this.data.isdep) this.setData({
@@ -98,7 +102,7 @@ Component({
                             }
                             }
                         })
                         })
                     }
                     }
-                    this.setData({
+                    if (init) this.setData({
                         isleave: 0
                         isleave: 0
                     })
                     })
                     resolve({})
                     resolve({})

+ 1 - 1
components/organization/index.wxml

@@ -9,7 +9,7 @@
         </view>
         </view>
     </view>
     </view>
     <view class="content">
     <view class="content">
-        <van-button custom-class='but {{data.departmentid == item.active?" active":""}}' wx:for="{{item.list}}" wx:for-item="data" wx:for-index="i" wx:key="i" data-item="{{data}}" data-index="{{index}}" data-i="{{i}}" bindtap="selectDep">{{data.depname}}</van-button>
+        <van-button custom-class='but {{data.departmentid == item.active?" active":" "}}' wx:for="{{item.list}}" wx:for-item="data" wx:for-index="i" wx:key="i" data-item="{{data}}" data-index="{{index}}" data-i="{{i}}" bindtap="selectDep">{{data.depname}}</van-button>
     </view>
     </view>
 </view>
 </view>
 <!-- 人员筛选 -->
 <!-- 人员筛选 -->