Ver código fonte

创建联系人选择单位范围修改

xiaohaizhao 2 anos atrás
pai
commit
4ca2c8eda6

+ 24 - 34
packageA/project/modules/contacts/select/index.js

@@ -1,56 +1,47 @@
 const _Http = getApp().globalData.http;
 Page({
     data: {
-        active: 0,
         item: null,
         radio: true,
         content: {
-            pageNumber: 1,
-            pageTotal: 1,
-            total: null,
-            where: {
-                condition: "",
-                type: 5,
-                sa_projectid: 1
+            "nocache": true,
+            "pageNumber": 1,
+            "pageTotal": 1,
+            "pageSize": 20,
+            "where": {
+                "condition": ""
             }
         }
     },
     onLoad(options) {
+        this.data.content.sa_projectid = getCurrentPages().find(v => v.__route__ == 'packageA/project/detail').data.sa_projectid
         /* 从表单组件进入进入 */
         this.getList()
     },
-    onChange(e) {
-        this.setData({
-            active: e.detail.index
-        });
-        this.getList(true);
-    },
     getList(init = false) {
         //init 用于初始化分页
         if (init.detail != undefined) init = init.detail;
         let content = this.data.content;
         if (init) content.pageNumber = 1;
         if (content.pageNumber > content.pageTotal) return;
-        content.where.type = this.data.active == 0 ? 6 : 5
-        if (this.data)
-            _Http.basic({
-                id: 20220920083901,
-                content
-            }).then(res => {
-                console.log("选择客户列表", res)
-                this.selectComponent('#ListBox').RefreshToComplete();
-                if (res.msg != '成功') return wx.showToast({
-                    title: res.data,
-                    icon: "none"
-                })
-                this.setData({
-                    'content.pageNumber': res.pageNumber + 1,
-                    'content.pageTotal': res.pageTotal,
-                    'content.total': res.total,
-                    list: res.pageNumber == 1 ? res.data : this.data.list.concat(res.data)
-                })
-                this.getTags();
+        _Http.basic({
+            "id": "20221027143702",
+            content
+        }).then(res => {
+            console.log("选择客户列表", res)
+            this.selectComponent('#ListBox').RefreshToComplete();
+            if (res.msg != '成功') return wx.showToast({
+                title: res.data,
+                icon: "none"
+            })
+            this.setData({
+                'content.pageNumber': res.pageNumber + 1,
+                'content.pageTotal': res.pageTotal,
+                'content.total': res.total,
+                list: res.pageNumber == 1 ? res.data : this.data.list.concat(res.data)
             })
+            this.getTags();
+        })
     },
     /* 获取列表标签 */
     getTags() {
@@ -72,7 +63,6 @@ Page({
             })
         })
     },
-
     /* 选中 */
     changeResult(e) {
         let {

+ 0 - 4
packageA/project/modules/contacts/select/index.wxml

@@ -1,7 +1,3 @@
-<van-tabs active="{{ active }}" bind:change="onChange" title-active-color='var(--assist)' color='var(--assist)'>
-    <van-tab title="关联客户" />
-    <van-tab title="我的客户" />
-</van-tabs>
 <van-search class="search" value="{{ content.where.condition }}" shape="round" placeholder="请输入搜索关键词" bind:search='startSearch' bind:clear='onClear' />
 <Yl_ListBox id='ListBox' bind:getlist='getList'>
     <view class="total">共{{content.total}}个</view>

+ 1 - 1
packageA/project/modules/contract/index.js

@@ -76,7 +76,7 @@ Component({
             let page = getCurrentPages()[getCurrentPages().length - 1];
             if (detail.name != '居间协议') type = page.selectComponent("#Tags").data.systemtag.some(v => v == '直销') ? 'type3' : 'type2';
             wx.navigateTo({
-                url: `/packageA/contract/add/${type}/index?project=${JSON.stringify([page.data.detail.projectname,[page.data.detail.sa_projectid]])}&sa_projectid=${this.data.sa_projectid}`,
+                url: `/packageA/contract/add/${type}/index?project=${JSON.stringify(page.data.detail)}`,
             })
             this.typeCancel();
         },