瀏覽代碼

项目商机

zhaoxiaohai 2 年之前
父節點
當前提交
344daaec39
共有 3 個文件被更改,包括 24 次插入18 次删除
  1. 20 13
      packageA/project/index.js
  2. 3 1
      packageA/project/index.json
  3. 1 4
      packageA/project/index.wxml

+ 20 - 13
packageA/project/index.js

@@ -74,15 +74,21 @@ Page({
     onLoad(options) {
         this.getList();
     },
-    getList(init = false) {
+    getList(init = false, data) {
         if (init.detail != undefined) init = init.detail;
-        if (init) this.setData({
-            ['content.pageNumber']: 1
-        })
-        if (this.data.content.pageNumber > this.data.content.pageTotal) return;
+        let content = this.data.content;
+        if (init) content.pageNumber = 1;
+        if (content.pageNumber > content.pageTotal) return;
+        if (data) {
+            content.where.status = data.statusActive;
+            content.where.projecttype = data.typeActive;
+            content.where.stagename = data.stageActive;
+            content.where.startdate = data.startdate;
+            content.where.enddate = data.enddate;
+        }
         _Http.basic({
             "id": 20221020143502,
-            content: this.data.content
+            content
         }).then(res => {
             console.log("客户商机列表", res)
             this.selectComponent('#ListBox').RefreshToComplete();
@@ -107,14 +113,9 @@ Page({
         switch (detail) {
             case 'confirm':
                 this.setData({
-                    'content.where.status': data.statusActive,
-                    "content.where.projecttype": data.typeActive,
-                    "content.where.stagename": data.stageActive,
-                    'content.where.startdate': data.startdate,
-                    'content.where.enddate': data.enddate,
                     'filter.show': false
                 });
-                this.getList(true);
+                this.getList(true, data);
                 break;
             case 'reset':
                 this.setData({
@@ -124,7 +125,7 @@ Page({
                     'filter.startdate': "",
                     'filter.enddate': "",
                 });
-                this.getList(true)
+                this.getList(true, this.data.filter)
                 break;
             case 'close':
                 this.setData({
@@ -250,5 +251,11 @@ Page({
             listHeight: res
         }));
     },
+    /* 搜索 */
+    navSearch() {
+        wx.navigateTo({
+            url: '/packageA/project/search'
+        })
+    },
     onShareAppMessage() {}
 })

+ 3 - 1
packageA/project/index.json

@@ -1,4 +1,6 @@
 {
-    "usingComponents": {},
+    "usingComponents": {
+        "List":"./modules/list/index"
+    },
     "navigationBarTitleText": "项目商机"
 }

+ 1 - 4
packageA/project/index.wxml

@@ -2,12 +2,9 @@
 <!-- 显示类型 -->
 <van-action-sheet show="{{ classShow }}" actions="{{ classActions }}" cancel-text="取消" bind:cancel="classClose" bind:select="classSelect" />
 <view class="total">共{{content.total}}个</view>
-
 <My_listBox id='ListBox' height="{{listHeight}}" bind:getlist='getList'>
-    <!-- <list list='{{list}}' /> -->
+    <List list='{{list}}' />
 </My_listBox>
-
-
 <!-- 筛选条件 -->
 <Yl_filtrate show="{{filter.show}}" bind:handle="handleFilter">
     <view class="groud" wx:if="{{filter.projectTypeList.length!=0}}">