Parcourir la source

客户管理搜索

zhaoxiaohai il y a 2 ans
Parent
commit
fc99dd41b7

+ 62 - 0
packageA/setclient/search.js

@@ -0,0 +1,62 @@
+const _Http = getApp().globalData.http;
+Page({
+    data: {
+        content: {
+            "type": 0,
+            "pageNumber": 1,
+            "pageSize": 20,
+            "isExport": 0,
+            "where": {
+                "condition": "",
+                "status": "", //状态
+                "startdate": "",
+                "enddate": ""
+            },
+        },
+        list: []
+    },
+    onLoad(options) {
+        this.getList();
+    },
+    /* 开始搜索 */
+    startSearch({
+        detail
+    }) {
+        this.setData({
+            "content.where.condition": detail
+        });
+        this.getList(true);
+    },
+    onClear() {
+        this.setData({
+            "content.where.condition": ""
+        });
+        this.getList(true);
+    },
+    getList(init = false) {
+        //init 用于初始化分页
+        let content = this.data.content;
+        if (init) content.pageNumber = 1;
+        if (content.pageNumber > content.pageTotal) return;
+        _Http.basic({
+            "id": 20221012164402,
+            content
+        }).then(res => {
+            console.log("搜索客户列表", res)
+            if (res.msg != '成功') return wx.showToast({
+                title: res.data,
+                icon: "none"
+            })
+            // this.getTags(res.data.map(v => v.sys_enterpriseid));
+            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)
+            })
+        })
+    },
+    onReachBottom() {
+        this.getList();
+    },
+})

+ 10 - 0
packageA/setclient/search.json

@@ -0,0 +1,10 @@
+{
+    "usingComponents": {
+        "TraceList": "./modules/trace/list/index",
+        "AddressList": "./modules/address/list/index",
+        "ContactsList": "./modules/contacts/list/index",
+        "FinancingList": "./modules/financing/list/index",
+        "list": "./modules/list/index"
+    },
+    "navigationBarTitleText": "客户管理搜索"
+}

+ 0 - 0
packageA/setclient/search.scss


+ 3 - 0
packageA/setclient/search.wxml

@@ -0,0 +1,3 @@
+<van-search value="{{ content.where.condition }}" shape="round" placeholder="请输入搜索关键词" bind:search='startSearch' bind:clear='onClear' />
+<view style="height: 20rpx;" />
+<list list='{{list}}' />