瀏覽代碼

只看部门

xiaohaizhao 2 年之前
父節點
當前提交
53edbeeb15

+ 23 - 4
packageA/finishforecast/detail.js

@@ -24,7 +24,8 @@ Page({
             "dataid": 0,
             "dataid": 0,
             "baseonproject": 1,
             "baseonproject": 1,
             "title": ""
             "title": ""
-        }
+        },
+        isonlydep: false
     },
     },
     onLoad(options) {
     onLoad(options) {
         this.setData({
         this.setData({
@@ -100,6 +101,21 @@ Page({
         this.getTags();
         this.getTags();
         this.partialRenewal();
         this.partialRenewal();
     },
     },
+    switchOnChange({
+        detail
+    }) {
+        this.setData({
+            isonlydep: detail
+        });
+        if (detail) {
+            this.setData({
+                active: null,
+                "content.type": 1,
+                "content.dataid": 0,
+            });
+        };
+        this.getRests();
+    },
     /* 切换 */
     /* 切换 */
     onChange(e) {
     onChange(e) {
         this.setData({
         this.setData({
@@ -120,21 +136,24 @@ Page({
                 active,
                 active,
                 'content.type': active.type == '人员' ? 0 : 1,
                 'content.type': active.type == '人员' ? 0 : 1,
                 'content.dataid': active.id || 0,
                 'content.dataid': active.id || 0,
+                isonlydep: false
             });
             });
         } catch (error) {
         } catch (error) {
             this.setData({
             this.setData({
                 active: null,
                 active: null,
                 'content.type': 1,
                 'content.type': 1,
                 'content.dataid': 0,
                 'content.dataid': 0,
+                isonlydep: false
             })
             })
         }
         }
         this.getRests();
         this.getRests();
     },
     },
     getRests() {
     getRests() {
-        console.log(this.data.content)
+        let content = this.data.content;
+        content.isonlydep = this.data.isonlydep ? 1 : 0
         _Http.basic({
         _Http.basic({
             "id": 20230705144804,
             "id": 20230705144804,
-            content: this.data.content
+            content
         }).then(res => {
         }).then(res => {
             console.log("其他预测单", res)
             console.log("其他预测单", res)
             if (res.msg != '成功') wx.showToast({
             if (res.msg != '成功') wx.showToast({
@@ -336,7 +355,7 @@ Page({
         content.pageSize = (content.pageNumber - 1) * content.pageSize;
         content.pageSize = (content.pageNumber - 1) * content.pageSize;
         content.pageNumber = 1;
         content.pageNumber = 1;
         _Http.basic({
         _Http.basic({
-            id: page.data.admim ? 20230705144604 : 20230706092304,
+            id: page.data.admin ? 20230705144604 : 20230706092304,
             content
             content
         }).then(res => {
         }).then(res => {
             console.log("更新预测", res);
             console.log("更新预测", res);

+ 1 - 0
packageA/finishforecast/detail.wxml

@@ -28,6 +28,7 @@
 </view>
 </view>
 
 
 <view hidden="{{pageIndex!=1}}">
 <view hidden="{{pageIndex!=1}}">
+    <Yl_Headline title='预测单列表' type='switch' switchLabel='只看部门' switch='{{isonlydep}}' bind:callBack='switchOnChange' />
     <view class="head1">
     <view class="head1">
         <view class="price">
         <view class="price">
             预测人数/金额:<text style="color: #FF3B30;">{{rests.allhr}}/{{rests.allprojectamount}}</text>
             预测人数/金额:<text style="color: #FF3B30;">{{rests.allhr}}/{{rests.allprojectamount}}</text>

+ 9 - 8
packageA/finishforecast/index.js

@@ -61,15 +61,16 @@ Page({
         }]
         }]
     },
     },
     onLoad(options) {
     onLoad(options) {
+        let classActions = wx.getStorageSync('templetList').map(v => {
+            return {
+                name: v.templetname,
+                index: v.templetid
+            }
+        }).filter(v => v.name != '站点全部' && v.name != '我创建的');
         this.setData({
         this.setData({
-            classActions: wx.getStorageSync('templetList').map(v => {
-                return {
-                    name: v.templetname,
-                    index: v.templetid
-                }
-            }).filter(v => v.name != '站点全部' && v.name != '我创建的'),
-            'navList[0].label': wx.getStorageSync('templetList')[0].templetname,
-            "content.type": wx.getStorageSync('templetList')[0].templetid,
+            classActions,
+            'navList[0].label': classActions[0].name,
+            "content.type": classActions[0].index,
         })
         })
         this.getList();
         this.getList();
     },
     },

+ 24 - 4
packageA/invoiceforecast/detail.js

@@ -17,7 +17,8 @@ Page({
             "dataid": 0,
             "dataid": 0,
             "baseonproject": 0,
             "baseonproject": 0,
             "title": ""
             "title": ""
-        }
+        },
+        isonlydep: false
     },
     },
     onLoad(options) {
     onLoad(options) {
         this.setData({
         this.setData({
@@ -108,6 +109,21 @@ Page({
         this.getGroup()
         this.getGroup()
         this.partialRenewal();
         this.partialRenewal();
     },
     },
+    switchOnChange({
+        detail
+    }) {
+        this.setData({
+            isonlydep: detail
+        });
+        if (detail) {
+            this.setData({
+                active: null,
+                "content.type": 1,
+                "content.dataid": 0,
+            });
+        };
+        this.getRests();
+    },
     /* 切换 */
     /* 切换 */
     onChange(e) {
     onChange(e) {
         this.setData({
         this.setData({
@@ -128,20 +144,24 @@ Page({
                 active,
                 active,
                 'content.type': active.type == '人员' ? 0 : 1,
                 'content.type': active.type == '人员' ? 0 : 1,
                 'content.dataid': active.id || 0,
                 'content.dataid': active.id || 0,
+                isonlydep: false
             });
             });
         } catch (error) {
         } catch (error) {
             this.setData({
             this.setData({
                 active: null,
                 active: null,
                 'content.type': 1,
                 'content.type': 1,
                 'content.dataid': 0,
                 'content.dataid': 0,
+                isonlydep: false
             })
             })
         }
         }
         this.getRests();
         this.getRests();
     },
     },
     getRests() {
     getRests() {
+        let content = this.data.content;
+        content.isonlydep = this.data.isonlydep ? 1 : 0
         _Http.basic({
         _Http.basic({
             "id": 20230705144804,
             "id": 20230705144804,
-            content: this.data.content
+            content
         }).then(res => {
         }).then(res => {
             console.log("其他预测单", res)
             console.log("其他预测单", res)
             if (res.msg != '成功') wx.showToast({
             if (res.msg != '成功') wx.showToast({
@@ -224,10 +244,10 @@ Page({
         let page = getCurrentPages()[getCurrentPages().length - 2];
         let page = getCurrentPages()[getCurrentPages().length - 2];
         if (page.getRests) return page.getRests();
         if (page.getRests) return page.getRests();
         let content = JSON.parse(JSON.stringify(page.data.content));
         let content = JSON.parse(JSON.stringify(page.data.content));
-        content.pageSize = (content.pageNumber - 1) * content.pageSize;
+        content.pageSize = ((content.pageNumber - 1) * content.pageSize) || 20;
         content.pageNumber = 1;
         content.pageNumber = 1;
         _Http.basic({
         _Http.basic({
-            id: page.data.admim ? 20230705144604 : 20230706092304,
+            id: page.data.admin ? 20230705144604 : 20230706092304,
             content
             content
         }).then(res => {
         }).then(res => {
             console.log("更新预测", res);
             console.log("更新预测", res);

+ 15 - 12
packageA/invoiceforecast/detail.wxml

@@ -17,21 +17,22 @@
         <view class="row" style="margin-bottom: 10rpx;">状态:<text style="color:{{backColor.getColor(detail.status)}};">{{detail.status}}</text></view>
         <view class="row" style="margin-bottom: 10rpx;">状态:<text style="color:{{backColor.getColor(detail.status)}};">{{detail.status}}</text></view>
         <Yl-group id='Group' ownertable='sa_salesforecastbill' ownerid='{{sa_salesforecastbillid}}' />
         <Yl-group id='Group' ownertable='sa_salesforecastbill' ownerid='{{sa_salesforecastbillid}}' />
     </view>
     </view>
+    <view style="height: 20rpx;" />
+    <Yl_FunTabs list='{{tabsList}}' active='{{tabsActive}}' bind:onChenge="tabsChange">
+        <Trace slot='跟进动态' id='Trace' ownertable='sa_salesforecastbill' ownerid='{{sa_salesforecastbillid}}' />
+        <OrderForm slot='订单' id='OrderForm' disabled="{{(detail.status=='进行中' || detail.status=='未开始')&&isLeader}}" />
+        <Project slot='项目' id='Project' disabled="{{(detail.status=='进行中' || detail.status=='未开始')&&isLeader}}" />
+        <Client slot='客户' id='Client' disabled="{{(detail.status=='进行中' || detail.status=='未开始')&&isLeader}}" />
+        <Record slot='操作记录' id="Record" ownertable='sa_salesforecastbill' disabled="{{(detail.status=='进行中'|| detail.status=='未开始') && isLeader}}" ownerid='{{sa_salesforecastbillid}}' />
+        <Files slot='附件' id="Files" ownertable='sa_salesforecastbill' disabled="{{(detail.status=='进行中'|| detail.status=='未开始') && isLeader}}" ownerid='{{sa_salesforecastbillid}}' />
+        <Work slot='任务' id='Work' ownertable='sa_salesforecastbill' ownerid='{{sa_salesforecastbillid}}' disabled="{{(detail.status=='进行中'|| detail.status=='未开始') && isLeader}}" />
+        <view style="height: 140rpx;" />
+    </Yl_FunTabs>
+    <wxs src="../finishforecast/modules/getColor.wxs" module="backColor" />
 </view>
 </view>
-<view style="height: 20rpx;" />
-<Yl_FunTabs list='{{tabsList}}' active='{{tabsActive}}' bind:onChenge="tabsChange">
-    <Trace slot='跟进动态' id='Trace' ownertable='sa_salesforecastbill' ownerid='{{sa_salesforecastbillid}}' />
-    <OrderForm slot='订单' id='OrderForm' disabled="{{(detail.status=='进行中' || detail.status=='未开始')&&isLeader}}" />
-    <Project slot='项目' id='Project' disabled="{{(detail.status=='进行中' || detail.status=='未开始')&&isLeader}}" />
-    <Client slot='客户' id='Client' disabled="{{(detail.status=='进行中' || detail.status=='未开始')&&isLeader}}" />
-    <Record slot='操作记录' id="Record" ownertable='sa_salesforecastbill' disabled="{{(detail.status=='进行中'|| detail.status=='未开始') && isLeader}}" ownerid='{{sa_salesforecastbillid}}' />
-    <Files slot='附件' id="Files" ownertable='sa_salesforecastbill' disabled="{{(detail.status=='进行中'|| detail.status=='未开始') && isLeader}}" ownerid='{{sa_salesforecastbillid}}' />
-    <Work slot='任务' id='Work' ownertable='sa_salesforecastbill' ownerid='{{sa_salesforecastbillid}}' disabled="{{(detail.status=='进行中'|| detail.status=='未开始') && isLeader}}" />
-    <view style="height: 140rpx;" />
-</Yl_FunTabs>
-<wxs src="../finishforecast/modules/getColor.wxs" module="backColor" />
 
 
 <view hidden="{{pageIndex!=1}}">
 <view hidden="{{pageIndex!=1}}">
+    <Yl_Headline title='预测单列表' type='switch' switchLabel='只看部门' switch='{{isonlydep}}' bind:callBack='switchOnChange' />
     <view class="head1">
     <view class="head1">
         <view class="price">
         <view class="price">
             预测人数:<text style="color: #FF3B30;">{{rests.allhr}}</text>
             预测人数:<text style="color: #FF3B30;">{{rests.allhr}}</text>
@@ -42,6 +43,8 @@
             <van-icon style="margin-left: 6rpx;" name="arrow-down" />
             <van-icon style="margin-left: 6rpx;" name="arrow-down" />
         </navigator>
         </navigator>
     </view>
     </view>
+
+    <!-- isonlydep -->
     <view class="rep">
     <view class="rep">
         <view>
         <view>
             出货预测金额:<text>{{rests.allorderoutamount}}</text>
             出货预测金额:<text>{{rests.allorderoutamount}}</text>

+ 2 - 58
project.private.config.json

@@ -5,74 +5,18 @@
         "urlCheck": false
         "urlCheck": false
     },
     },
     "description": "项目私有配置文件。此文件中的内容将覆盖 project.config.json 中的相同字段。项目的改动优先同步到此文件中。详见文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html",
     "description": "项目私有配置文件。此文件中的内容将覆盖 project.config.json 中的相同字段。项目的改动优先同步到此文件中。详见文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html",
+    "libVersion": "3.0.1",
     "condition": {
     "condition": {
         "miniprogram": {
         "miniprogram": {
             "list": [
             "list": [
-                {
-                    "name": "lxr",
-                    "pathName": "packageA/contacts/index",
-                    "query": "",
-                    "launchMode": "default",
-                    "scene": null
-                },
-                {
-                    "name": "xmsq",
-                    "pathName": "packageA/project/detail",
-                    "query": "id=5214",
-                    "launchMode": "default",
-                    "scene": null
-                },
                 {
                 {
                     "name": "首页",
                     "name": "首页",
                     "pathName": "pages/tabbar/home/index",
                     "pathName": "pages/tabbar/home/index",
                     "query": "",
                     "query": "",
                     "launchMode": "default",
                     "launchMode": "default",
                     "scene": null
                     "scene": null
-                },
-                {
-                    "name": "线索管理",
-                    "pathName": "packageA/saleAdmin/index",
-                    "query": "",
-                    "launchMode": "default",
-                    "scene": null
-                },
-                {
-                    "name": "新建线索",
-                    "pathName": "packageA/saleAdmin/insert",
-                    "query": "",
-                    "launchMode": "default",
-                    "scene": null
-                },
-                {
-                    "name": "小程序上图元",
-                    "pathName": "packageA/saleAdmin/detail",
-                    "query": "id=690",
-                    "launchMode": "default",
-                    "scene": null
-                },
-                {
-                    "name": "合同",
-                    "pathName": "packageA/contract/index",
-                    "query": "",
-                    "launchMode": "default",
-                    "scene": null
-                },
-                {
-                    "name": "直销客户",
-                    "pathName": "packageA/contract/add/type6/index",
-                    "query": "",
-                    "launchMode": "default",
-                    "scene": null
-                },
-                {
-                    "name": "直销客户详情",
-                    "pathName": "packageA/contract/detail",
-                    "query": "id=3823",
-                    "launchMode": "default",
-                    "scene": null
                 }
                 }
             ]
             ]
         }
         }
-    },
-    "libVersion": "3.0.1"
+    }
 }
 }