瀏覽代碼

销售预测

zhaoxiaohai 3 年之前
父節點
當前提交
77eee7379f

+ 28 - 10
packageA/salesForecasting/detail.js

@@ -34,13 +34,14 @@ Page({
         this.setData({
         this.setData({
             sa_salesforecastbillid: options.sa_salesforecastbillid
             sa_salesforecastbillid: options.sa_salesforecastbillid
         });
         });
-        this.getDetail();
+        this.getDetail(true);
     },
     },
-    getDetail() {
+    getDetail(init = false) {
         _Http.basic({
         _Http.basic({
             "id": 20220914104603,
             "id": 20220914104603,
             "version": 1,
             "version": 1,
             "content": {
             "content": {
+                nocache: true,
                 "sa_salesforecastbillid": this.data.sa_salesforecastbillid
                 "sa_salesforecastbillid": this.data.sa_salesforecastbillid
             },
             },
         }).then(res => {
         }).then(res => {
@@ -54,10 +55,10 @@ Page({
                 detail: res.data,
                 detail: res.data,
                 briefs: [{
                 briefs: [{
                     label: "提报开始时间",
                     label: "提报开始时间",
-                    value: '123'
+                    value: res.data.periodstart
                 }, {
                 }, {
                     label: "提报周期",
                     label: "提报周期",
-                    value: res.data.isrepeat == 0 ? res.data.begdate : `每月${res.data.periodpoint}号`
+                    value: res.data.reportingperiod
                 }, {
                 }, {
                     label: "提报要求",
                     label: "提报要求",
                     value: res.data.remarks
                     value: res.data.remarks
@@ -76,10 +77,10 @@ Page({
                     value: res.data.remarks
                     value: res.data.remarks
                 }, {
                 }, {
                     label: "提报开始时间",
                     label: "提报开始时间",
-                    value: res.data.begdate
+                    value: res.data.periodstart
                 }, {
                 }, {
                     label: "提报周期",
                     label: "提报周期",
-                    value: res.data.isrepeat == 0 ? res.data.begdate : `每月${res.data.periodpoint}号`
+                    value: res.data.reportingperiod
                 }, {
                 }, {
                     label: "预测金额(元)",
                     label: "预测金额(元)",
                     value: res.data.sumamount
                     value: res.data.sumamount
@@ -102,9 +103,25 @@ Page({
                 }],
                 }],
                 tabsList: this.data.tabsList
                 tabsList: this.data.tabsList
             });
             });
-            this.getTags();
-            this.getGroup();
-            this.partialRenewal();
+
+            /* 更新列表数据 */
+            let page = getCurrentPages().find(v => v.__route__ == 'packageA/salesForecasting/index');
+            if (page) {
+                let i = page.data.list.findIndex(v => v.sa_salesforecastbillid == this.data.sa_salesforecastbillid);
+                if (i != -1) {
+                    page.data.list[i].status = res.data.status;
+                    page.data.list[i].amount = res.data.sumamount;
+                    page.setData({
+                        [`list[${i}]`]: page.data.list[i]
+                    })
+                }
+            }
+
+            if (init) {
+                this.getTags();
+                this.getGroup();
+                this.partialRenewal();
+            }
         })
         })
     },
     },
     //tabs 切换
     //tabs 切换
@@ -192,7 +209,8 @@ Page({
                                 icon: "none"
                                 icon: "none"
                             })
                             })
                             let page = getCurrentPages().find(v => v.__route__ == 'packageA/select/project/select');
                             let page = getCurrentPages().find(v => v.__route__ == 'packageA/select/project/select');
-                            if (page) page.deteleItem(data.sa_projectid)
+                            if (page) page.deteleItem(data.sa_projectid);
+                            that.getDetail();
                         }, 500)
                         }, 500)
                     })
                     })
                 }
                 }

+ 3 - 3
packageA/salesForecasting/detail.wxml

@@ -1,5 +1,5 @@
 <view class="header">
 <view class="header">
-    <view class="title">单号:{{detail.billno}}</view>
+    <view class="title">单号:{{detail.billnum}}</view>
     <Yl-tags id="Tags" add ownertable='sa_salesforecastbill' ownerid='{{sa_salesforecastbillid}}' />
     <Yl-tags id="Tags" add ownertable='sa_salesforecastbill' ownerid='{{sa_salesforecastbillid}}' />
 </view>
 </view>
 <!-- 简介 -->
 <!-- 简介 -->
@@ -11,11 +11,11 @@
 <Yl_FunTabs list='{{tabsList}}' active='{{tabsActive}}' bind:onChenge="tabsChange">
 <Yl_FunTabs list='{{tabsList}}' active='{{tabsActive}}' bind:onChenge="tabsChange">
     <Preview slot='详细信息' list1='{{list1}}' list2='{{list2}}' />
     <Preview slot='详细信息' list1='{{list1}}' list2='{{list2}}' />
     <Trace slot='跟进动态' id='Trace' ownertable='sa_salesforecastbill' ownerid='{{sa_salesforecastbillid}}' />
     <Trace slot='跟进动态' id='Trace' ownertable='sa_salesforecastbill' ownerid='{{sa_salesforecastbillid}}' />
-    <Project slot='项目产品清单' id='Project' />
+    <Project slot='项目产品清单' id='Project' bindrefresh='getDetail' disabled="{{detail.status!='已提报'}}" />
     <Record slot='操作记录' id="Record" ownertable='sa_salesforecastbill' ownerid='{{sa_salesforecastbillid}}' />
     <Record slot='操作记录' id="Record" ownertable='sa_salesforecastbill' ownerid='{{sa_salesforecastbillid}}' />
     <Files slot='附件' id="Files" ownertable='sa_salesforecastbill' ownerid='{{sa_salesforecastbillid}}' />
     <Files slot='附件' id="Files" ownertable='sa_salesforecastbill' ownerid='{{sa_salesforecastbillid}}' />
     <view style="height: 140rpx;" />
     <view style="height: 140rpx;" />
 </Yl_FunTabs>
 </Yl_FunTabs>
 
 
 <!-- 底部 -->
 <!-- 底部 -->
-<Yl_Tabbar list='{{tabbarList}}' bind:callback="tabbarOnClick" />
+<Yl_Tabbar wx:if="{{detail.status!='已提报'}}" list='{{tabbarList}}' bind:callback="tabbarOnClick" />

+ 0 - 1
packageA/salesForecasting/index.js

@@ -1,7 +1,6 @@
 const _Http = getApp().globalData.http,
 const _Http = getApp().globalData.http,
     getHeight = require("../../utils/getRheRemainingHeight");
     getHeight = require("../../utils/getRheRemainingHeight");
 Page({
 Page({
-
     /* , {
     /* , {
             label: "筛选",
             label: "筛选",
             icon: "icon-shaixuan",
             icon: "icon-shaixuan",

+ 1 - 2
packageA/salesForecasting/index.wxml

@@ -1,6 +1,6 @@
 <Yl_nav search list='{{navList}}' sort='{{content.sort}}' bind:onClick='navClick' bindonSearch="onSearch" />
 <Yl_nav search list='{{navList}}' sort='{{content.sort}}' bind:onClick='navClick' bindonSearch="onSearch" />
 <!-- 显示类型 -->
 <!-- 显示类型 -->
-<van-action-sheet show="{{ classShow }}" actions="{{ classActions }}" cancel-text="取消" bind:cancel="classClose" bind:select="classSelect" />
+<van-action-sheet show="{{ classShow }}" actions="{{ classActions }}" cancel-text="取消" bind:cancel="classClose" bind:click-overlay='classClose' bind:select="classSelect" />
 <view class="total">共{{content.total}}个</view>
 <view class="total">共{{content.total}}个</view>
 <My_listBox id='ListBox' height="{{listHeight}}" bind:getlist='getList'>
 <My_listBox id='ListBox' height="{{listHeight}}" bind:getlist='getList'>
     <List list='{{list}}' />
     <List list='{{list}}' />
@@ -40,5 +40,4 @@
     </view>
     </view>
 </Yl_filtrate>
 </Yl_filtrate>
 
 
-<!-- 浮动按钮 -->
 <van-action-sheet show="{{ typeShow }}" actions="{{ typeList }}" cancel-text="取消" bind:cancel='typeCancel' bind:select='typeSelect' />
 <van-action-sheet show="{{ typeShow }}" actions="{{ typeList }}" cancel-text="取消" bind:cancel='typeCancel' bind:select='typeSelect' />

+ 3 - 3
packageA/salesForecasting/modules/list/index.wxml

@@ -9,10 +9,10 @@
         <van-tag custom-class='tag' wx:for="{{item.tags.datatag}}" wx:for-item='tag' color='#FAAB16' text-color='#fff' round>{{tag}}</van-tag>
         <van-tag custom-class='tag' wx:for="{{item.tags.datatag}}" wx:for-item='tag' color='#FAAB16' text-color='#fff' round>{{tag}}</van-tag>
     </view>
     </view>
     <view class="exp line-1">单号:{{item.billnum}}</view>
     <view class="exp line-1">单号:{{item.billnum}}</view>
-    <view class="exp line-1">提报开始时间:<text>{{item.periodend}}</text></view>
-    <view class="exp line-1">提报周期:<text>{{item.periodpoint}}</text></view>
+    <view class="exp line-1">提报开始时间:<text>{{item.periodstart}}</text></view>
+    <view class="exp line-1">提报周期:<text>{{item.reportingperiod}}</text></view>
     <view class="exp line-1">提报要求:<text>{{item.remarks}}</text></view>
     <view class="exp line-1">提报要求:<text>{{item.remarks}}</text></view>
-    <view class="exp line-1">预测金额:<text>{{item.billdate}}</text></view>
+    <view class="exp line-1">预测金额:<text>{{item.amount}}</text></view>
 </navigator>
 </navigator>
 
 
 <wxs module="backColor">
 <wxs module="backColor">

+ 8 - 2
packageA/salesForecasting/modules/project/index.js

@@ -1,6 +1,10 @@
 const _Http = getApp().globalData.http,
 const _Http = getApp().globalData.http,
     file = require("../../../../utils/matchingFeilType");
     file = require("../../../../utils/matchingFeilType");
 Component({
 Component({
+    properties: {
+        refresh: Function, //更新数据
+        disabled: Boolean, //禁用
+    },
     data: {
     data: {
         viewIndex: 0,
         viewIndex: 0,
         sa_salesforecastbillid: 0,
         sa_salesforecastbillid: 0,
@@ -118,7 +122,7 @@ Component({
                         pageTotal: 1
                         pageTotal: 1
                     }
                     }
                 })}`
                 })}`
-            })
+            });
         },
         },
         handleSelectProduct(itemclassinfos, oldList) {
         handleSelectProduct(itemclassinfos, oldList) {
             const that = this,
             const that = this,
@@ -148,6 +152,7 @@ Component({
                         setTimeout(() => {
                         setTimeout(() => {
                             that.getProduct(true);
                             that.getProduct(true);
                             wx.navigateBack();
                             wx.navigateBack();
+                            that.triggerEvent("refresh")
                         }, 300)
                         }, 300)
                     })
                     })
                 }
                 }
@@ -183,7 +188,7 @@ Component({
                     [`productList[${index}]`]: that.data.productList[index],
                     [`productList[${index}]`]: that.data.productList[index],
                     [`productList[0].sumamount`]: res.data[0].sumamount,
                     [`productList[0].sumamount`]: res.data[0].sumamount,
                 })
                 })
-                console.log(that.data.productList[index])
+                that.triggerEvent("refresh")
             })
             })
         },
         },
         /* 删除 */
         /* 删除 */
@@ -203,6 +208,7 @@ Component({
                 this.setData({
                 this.setData({
                     productList: this.data.productList.filter(v => v.sa_salesforecastid != detail.sa_salesforecastid)
                     productList: this.data.productList.filter(v => v.sa_salesforecastid != detail.sa_salesforecastid)
                 });
                 });
+                this.triggerEvent("refresh")
                 wx.showToast({
                 wx.showToast({
                     title: '删除成功',
                     title: '删除成功',
                     icon: "none"
                     icon: "none"

+ 2 - 1
packageA/salesForecasting/modules/project/index.wxml

@@ -4,9 +4,10 @@
 <view class="head">
 <view class="head">
     <view class="count"><text style="margin-right: 15rpx; font-size: 30rpx;font-weight: 600; color: #333;">{{list[viewIndex].projectname}}</text>预测金额:<text style="color: #FF3B30;">¥{{productList[0]?productList[0].sumamount:0}}</text></view>
     <view class="count"><text style="margin-right: 15rpx; font-size: 30rpx;font-weight: 600; color: #333;">{{list[viewIndex].projectname}}</text>预测金额:<text style="color: #FF3B30;">¥{{productList[0]?productList[0].sumamount:0}}</text></view>
     <view class="expand">
     <view class="expand">
-        <navigator url="#" class="but" bindtap="addProduct">
+        <navigator wx:if="{{disabled}}" url="#" class="but" bindtap="addProduct">
             <van-icon name="plus" />
             <van-icon name="plus" />
         </navigator>
         </navigator>
     </view>
     </view>
 </view>
 </view>
+
 <List list='{{productList}}' bindchangeQueue='changeQueue' binddeleteItem='deleteItem' />
 <List list='{{productList}}' bindchangeQueue='changeQueue' binddeleteItem='deleteItem' />

+ 7 - 0
project.private.config.json

@@ -63,6 +63,13 @@
                     "query": "id=170",
                     "query": "id=170",
                     "launchMode": "default",
                     "launchMode": "default",
                     "scene": null
                     "scene": null
+                },
+                {
+                    "name": "",
+                    "pathName": "packageA/publicCustomer/addAndEditor",
+                    "query": "",
+                    "launchMode": "default",
+                    "scene": null
                 }
                 }
             ]
             ]
         }
         }