Explorar o código

经营概况体验

changhaoning hai 1 ano
pai
achega
4ee2d57459

+ 2 - 1
app.json

@@ -209,7 +209,8 @@
                 "pages/profit-report/org-rank/org-rank",
                 "pages/profit-report/staff-rank/staff-rank",
                 "pages/profit-report/sku-rank/sku-rank",
-                "pages/business-overview/business-overview"
+                "pages/business-overview/business-overview",
+                "pages/business-overview-experience/business-overview-experience"
             ]
         },
         {

+ 222 - 0
package-business-analysis/pages/business-overview-experience/business-overview-experience.js

@@ -0,0 +1,222 @@
+const Constants = require('@/utils/Constants.js');
+const mixins = require('@/mixins/index.js');
+const config = require('@/config/config.js');
+const app = getApp()
+
+Page({
+    mixins: [mixins],
+    /**
+     * 页面的初始数据
+     */
+    data: {
+        userEndDateString: '',
+        funData: [],
+        userEndDate: null,
+        userEndDateFlg: false,
+        userEndDateString: '',
+    },
+
+    /**
+     * 生命周期函数--监听页面加载
+     */
+    onLoad(options) {
+        // 查询活动
+        this.getActivity()
+        setTimeout(() => {
+            // 用户到期日期
+            if (app.globalData.company.userEndDate) {
+                this.setData({
+                    userEndDate: app.globalData.company.userEndDate
+                })
+            } else {
+                //获取服务器的最新时间
+                this.getCurrentDate()
+            }
+        }, 200)
+    },
+
+    /**
+     * @desc : 服务器的日期
+     * @author : 姜永辉
+     * @date : 2024/4/1
+     */
+    getCurrentDate() {
+        let _this = this
+        let service = app.globalData['commonService']
+        _this.excute(service, service.getCurrentDate, {}).then(res => {
+            if (res.data.code == Constants.SUCESS_CODE) {
+                //服务器的时间  
+                let nowDate = res.data.data.currentDate
+                let endDate = new Date(nowDate).addMonths(12).addDays(-1).toDateStr()
+                // 用户到期日期
+                if (_this.data.userEndDate == null || !_this.data.userEndDate) {
+                    this.setData({
+                        userEndDate: endDate,
+                        userEndDateFlg: true,
+                        userEndDateString: _this.data.funData.wxPrice + '元/年(' + _this.data.funData.activityItemDescribe + ')',
+                        factAmt: _this.data.funData.wxPrice,
+                        extendDays: 365,
+                        nowDate,
+                    })
+                } else {
+                    // 和 服务器的时间一致
+                    if (_this.data.userEndDate == endDate) {
+                        this.setData({
+                            userEndDateFlg: true,
+                            userEndDateString: _this.data.funData.wxPrice + '元/年(' + _this.data.funData.activityItemDescribe + ')',
+                            factAmt: _this.data.funData.wxPrice,
+                            extendDays: 365,
+                            nowDate,
+                        })
+                    } else {
+                        let extendDays = Math.ceil(new Date(_this.data.userEndDate).dayDiff(new Date(nowDate)) + 1);
+
+                        let price = (Math.round((_this.data.funData.wxPrice / 365 + Number.EPSILON) * 100) / 100).toFixed(2)
+                        console.log(price);
+                        let factAmt = (Number(price) * extendDays).toFixed(2)
+                        this.setData({
+                            userEndDateFlg: false,
+                            userEndDateString: price + '元/天(' + _this.data.funData.activityItemDescribe + ')* ' + extendDays + '天=' + factAmt + '元',
+                            factAmt: factAmt,
+                            extendDays,
+                            nowDate,
+                        })
+                    }
+
+                }
+            }
+        });
+    },
+
+    /**
+     * @desc : 查询活动
+     * @author : 周兴
+     * @date : 2024/4/1
+     */
+    getActivity() {
+        let params = {
+            appCode: Constants.APP_CODE,
+            activityStatus: Constants.kindCode.activityStatus,
+            cpId: app.globalData.company.cpId,
+            gradeCode: this.data.gradeCode,
+            activityTypeList: [Constants.kindCode.activityFunc],
+        }
+
+        let service = app.globalData['activityService']
+        this.excute(service, service.selectActivityItems, params).then(res => {
+            if (res.data.code == Constants.SUCESS_CODE) {
+                if (res.data && res.data.data) {
+                    let funData = []
+                    let data = res.data.data
+                    data.forEach(it => {
+                        if (it.activityItemDescribe == '报表功能包') {
+                            funData = it
+                        }
+                    })
+                    this.setData({
+                        funData: funData
+                    })
+                }
+            }
+        });
+    },
+
+        /**
+    * @desc : 设置保存参数
+    * @author : 周兴
+    * @date : 2024/4/1
+    */
+    setParams(params) { 
+        let funPackage = app.globalData.company.funPackage || []
+        params.endDate = app.globalData.company.endDate
+        params.userEndDate = this.data.userEndDate
+        params.gradeCode = app.globalData.company.gradeCode
+        params.cpId = app.globalData.company.cpId
+        params.tradeNo = this.generateRandomNo();
+        params.wxUserId = app.globalData.user.userId
+        params.tradeAmount = Number(this.data.factAmt)
+        params.buyBeginDate = this.data.nowDate;
+        params.buyEndDate = this.data.userEndDate
+        params.extendDays = 0;
+        params.wxMaxNum = app.globalData.company.wxMaxNum
+        params.webMaxNum = app.globalData.company.webMaxNum
+        funPackage.push({
+            funUuids: this.data.funData.funUuids,
+            activityId: this.data.funData.activityId,
+        })
+        params.funPackage = funPackage
+        if (app.globalData.company.vip) {
+            params.vip = true;
+        }
+        params.buyLong = this.data.extendDays + '天'
+        console.log(params);
+        return params;
+    },
+
+    /**
+     * @desc : 保存数据
+     * @author : 周兴
+     * @date : 2024/5/17
+     */
+    saveData(params) {
+        let service = app.globalData['companyService']
+        return this.excute(service, service.saveFunc, this.data.params).then(res => {
+            if (res.data.code == Constants.SUCESS_CODE) {
+                // 成功后跳转支付
+                this.toPay(res.data.data);
+            }
+        })
+    },
+
+    /**
+     * @desc : 体验跳转
+     * @author : 常皓宁
+     * @date : 2024/7/4 13:16
+     */
+    handleTitleBtn(e) {
+        let type = e.currentTarget.dataset.item
+        //收发存汇总表
+        if (type == 'INT') {
+            wx.navigateTo({
+                url: '/package-inventory/pages/ivt-sum-report/ivt-sum-report',
+                success: function (res) {
+                    let params = {
+                        testFlag: true
+                    }
+                    res.eventChannel.emit('params', {
+                        params: params
+                    });
+                }
+            })
+        }
+        //客户收支表
+        else if (type == 'CUS') {
+            wx.navigateTo({
+                url: '/package-business-analysis/pages/cus-rec-pay-report/cus-rec-pay-report',
+                success: function (res) {
+                    let params = {
+                        testFlag: true
+                    }
+                    res.eventChannel.emit('params', {
+                        params: params
+                    });
+                }
+            })
+        }
+        //利润表
+        else {
+            let this_ = this
+            wx.navigateTo({
+                url: '/package-business-analysis/pages/profit-report/profit-report',
+                success: function (res) {
+                    let params = {
+                        testFlag: true
+                    }
+                    res.eventChannel.emit('params', {
+                        params: params
+                    });
+                }
+            })
+        }
+    },
+})

+ 3 - 0
package-business-analysis/pages/business-overview-experience/business-overview-experience.json

@@ -0,0 +1,3 @@
+{
+    "usingComponents": {}
+}

+ 90 - 0
package-business-analysis/pages/business-overview-experience/business-overview-experience.wxml

@@ -0,0 +1,90 @@
+<view>
+	<view class="content">
+		<view class="item-card">
+			<view class="card-title">
+				<view class="name-title">
+					<view class="name"> 库存资产明细</view>
+				</view>
+			</view>
+			<view class="card-content">
+				<view class="list-item">
+					<view class="title">从入库到出库,全程透明</view>
+					<view class="title">收发存汇总,助力企业精准运营每一步。</view>
+					<view class="video-title">
+						<view style="font-size: 20px;text-align: center;width: 100%;">视频介绍</view>
+						<view style="width: 20%;color: blue;font-size: 14px;" data-item="INT" catchtap="handleTitleBtn">体验一下</view>
+					</view>
+					<view style="font-size: 100px;">视频</view>
+				</view>
+			</view>
+		</view>
+
+		<view class="item-card">
+			<view class="card-title">
+				<view class="name-title">
+					<view class="name"> 客户欠款明细</view>
+				</view>
+			</view>
+			<view class="card-content">
+				<view class="list-item">
+					<view class="title">洞悉欠款,控财财务未来</view>
+					<view class="title">精准数据,智慧决策,共创辉煌!</view>
+					<view class="video-title">
+						<view style="font-size: 20px;text-align: center;width: 100%;">视频介绍</view>
+						<view style="width: 20%;color: blue;font-size: 14px;" data-item="CUS" catchtap="handleTitleBtn">体验一下</view>
+					</view>
+					<view style="font-size: 100px;">视频</view>
+				</view>
+			</view>
+		</view>
+
+		<view class="item-card">
+			<view class="card-title">
+				<view class="name-title">
+					<view class="name">销售利润明细</view>
+				</view>
+			</view>
+			<view class="card-content">
+				<view class="list-item">
+					<view class="title">用数据赋能,以利润证明</view>
+					<view class="title">专业报表,见证每一次成功背后的智慧决策!</view>
+					<view class="video-title">
+						<view style="font-size: 20px;text-align: center;width: 100%;">视频介绍</view>
+						<view style="width: 20%;color: blue;font-size: 14px;" data-item="SAL" catchtap="handleTitleBtn">体验一下</view>
+					</view>
+					<view style="font-size: 100px;">视频</view>
+				</view>
+			</view>
+		</view>
+	</view>
+
+</view>
+<view style="height: 300rpx;"></view>
+
+<view class="bottom-class">
+	<view class="view-margin">
+		<view style="display: flex;justify-content: space-between;align-items: center;">
+			<view>订单详情 <van-icon slot="label-icon" name="question-o" data-item="{{item}}" catchtap="showTip" /></view>
+			<view>{{userEndDateString}}</view>
+		</view>
+	</view>
+	<view wx:if="{{false}}" class="view-margin" style="text-align: right;margin-top: 35rpx;">
+		减少100积分<van-icon slot="label-icon" name="question-o" data-item="{{item}}" catchtap="showTip" />
+	</view>
+	<view class="view-margin" style="display: flex;justify-content:space-between; align-items:center;   ">
+		<view style="display: flex;justify-content: center;align-items: center;">
+			<view>截止日期:</view>
+			<dk-cell fontSize="16" amount="{{false}}" contentColor="#FF1810" content="{{userEndDate}}"></dk-cell>
+		</view>
+
+		<view style="display: flex;justify-content: center;align-items: center;">
+			<view>实付款:</view>
+			<dk-cell fontSize="16" contentColor="#FF7B1A" content="{{factAmt}}"></dk-cell>
+		</view>
+	</view>
+
+	<view class="bottom-class-button">
+		<van-button color="#FF7B1A" custom-style="width:95%;border-radius: 15rpx;" loading="{{loading}}" bind:click="save" type="info">购买
+		</van-button>
+	</view>
+</view>

+ 118 - 0
package-business-analysis/pages/business-overview-experience/business-overview-experience.wxss

@@ -0,0 +1,118 @@
+.content {
+	padding: 0 16rpx;
+}
+
+.card-title {
+	background: linear-gradient(95.33deg, #ADC6FF -2.27%, #F0F5FF 60.66%),
+		linear-gradient(0deg, #F4F8FF, #F4F8FF),
+		radial-gradient(58.28% 235.72% at 10.78% 50%, rgba(191, 213, 255, 0.6) 0%, rgba(216, 229, 255, 0) 56.69%);
+	padding: 30rpx 20rpx;
+	border-radius: 15rpx 15rpx 0 0;
+	display: flex;
+	justify-content: space-between;
+}
+
+.item-card {
+	border-radius: 16rpx;
+	margin-top: 32rpx;
+	background: white;
+	box-shadow: 0px 10px 20px 0px #0000000D;
+	box-shadow: 0px -6px 20px 0px #0000000D;
+	padding: 32rpx 32rpx 40rpx 32rpx;
+	position: relative;
+}
+
+.name-title {
+	width: 100%;
+	display: flex;
+	color: #1B365D;
+	font-weight: 600;
+	flex-direction: row;
+	font-size: 28rpx;
+	text-align: center;
+	justify-content: start;
+	align-content: center;
+}
+
+.name-title .name {
+	width: 100%;
+	font-size: 34rpx;
+	text-align: center;
+}
+
+.littleName {
+	font-size: 20rpx;
+	padding-top: 14rpx;
+}
+
+.card-content {
+	width: 100%;
+	display: flex;
+	flex-direction: column;
+	justify-content: center;
+	align-content: center;
+	padding-top: 20rpx;
+}
+
+.card-content .list-item {
+	padding: 15rpx 20rpx;
+	text-align: center;
+	height: 200px;
+}
+
+.title {
+	width: 100%;
+	font-size: 14px;
+	color: #95A8CB;
+	padding-right: 32rpx;
+	text-align: center;
+}
+
+.video-title {
+	width: 100%;
+	padding-top: 10px;
+	font-size: 20px;
+	color: #95A8CB;
+	text-align: center;
+	display: flex;
+}
+
+.scan-class {
+	width: auto;
+	display: flex;
+	align-items: center;
+	/* margin-right: 12rpx; */
+	color: #1B365D;
+}
+
+.date-class {
+	width: 200rpx;
+	position: absolute;
+	right: -10px;
+	top: 130rpx;
+}
+
+.bottom-class {
+	background: #fff;
+	position: fixed;
+	bottom: 0;
+	width: 100%;
+	height: 302rpx;
+	border-top: 1px solid #efefef;
+	padding: 20rpx;
+	z-index: 7;
+}
+
+.bottom-class-button {
+	background: #fff;
+	position: fixed;
+	bottom: 0;
+	width: 100%;
+	z-index: 2;
+	margin-bottom: 45rpx;
+}
+.view-margin{
+	margin: 15rpx 0;
+	margin-right: 35rpx;
+	font-size: 13px;
+}

+ 5 - 1
package-business-analysis/pages/business-overview/business-overview.js

@@ -133,7 +133,11 @@ Page({
       let menuList = app.globalData.menus
       let filters = menuList.filter(it => it.objectCode == 'ivt-sum-report');
       //只要一个没有就都没有 需要购买 跳转购买页面
-      if (!filters || filters.length == 0) {
+      // if (!filters || filters.length == 0) {
+        if (true) {
+          wx.navigateTo({
+            url: '/package-business-analysis/pages/business-overview-experience/business-overview-experience',
+          })
         //跳转购买
         return
       }

+ 28 - 2
package-business-analysis/pages/cus-rec-pay-report/cus-rec-pay-report.js

@@ -11,6 +11,7 @@ const Constants = require('@/utils/Constants.js');
 const util = require('@/utils/util.js')
 const app = getApp()
 const mixins = require('@/mixins/index.js')
+const Data = require('@/utils/data.js');
 
 Page({
   mixins: [mixins],
@@ -18,6 +19,7 @@ Page({
    * 页面的初始数据
    */
   data: {
+    initSearchFlag:false,
     placeholder: "请输入客户名称/电话/地址",
     searchContent: [],
     sortMenuObject: {
@@ -63,7 +65,11 @@ Page({
    * @author : 刘尧
    */
   getData(params) {
-    return this.excute(this.data.service, this.data.service.getCusRecPayReportItem, params);
+    if(this.data.params && this.data.params.testFlag){
+      return
+    }else{
+      return this.excute(this.data.service, this.data.service.getCusRecPayReportItem, params);
+    }
   },
     /**
    * @desc : 处理接口返回数据
@@ -130,5 +136,25 @@ Page({
         res.eventChannel.emit('params', { id: cusId, formMode: Constants.formMode.edit })
       }
     })
-  }
+  },
+
+  /**
+   * @desc : 初始加载
+   * @date : 2024/7/5 15:49
+   * @author : 常皓宁
+   */
+  loadInit(){
+    console.log('ttt',this.data.params);
+    if(this.data.params && this.data.params.testFlag){
+      console.log('sasss',Data.falseCusRecPayReportData)
+      this.setData({
+        tableData:Data.falseCusRecPayReportData
+      })
+      this.handleSearchData(this.data.tableData)
+      console.log('tableData',this.data.tableData)
+    }else{
+      this.searchData();
+    }
+  },
+  
 })

+ 36 - 4
package-business-analysis/pages/profit-report/profit-report.js

@@ -4,6 +4,7 @@ const app = getApp()
 const Constants = require('../../../utils/Constants.js');
 const util = require('../../../utils/util.js')
 const mixins = require('@/mixins/index.js')
+const Data = require('@/utils/data.js');
 
 Page({
   mixins: [mixins],
@@ -11,6 +12,7 @@ Page({
    * 页面的初始数据
    */
   data: {
+    initSearchFlag:false,
     service: app.globalData['reportService'],
     // 查询条件
     searchContent: [{
@@ -28,10 +30,10 @@ Page({
   /**
    * 生命周期函数--监听页面加载
    */
-  onLoad: function (options) {
-    // 报表查询数据
-    this.getSaleProfit()
-  },
+  // onLoad: function (options) {
+  //   // 报表查询数据
+  //   this.getSaleProfit()
+  // },
 
 
   /**
@@ -97,6 +99,10 @@ Page({
   /** 查询所有报表信息 */
   /** 查询页面展示的所有 */
   getSaleProfit() {
+    //体验不走查询
+    if(this.data.params && this.data.params.testFlag){
+      return
+    }else{
     //如果是跳转过来的star
     if(this.data.item){
       this.setData({
@@ -138,6 +144,7 @@ Page({
         loading: false
       })
     })
+    }
   },
 
    /**
@@ -149,5 +156,30 @@ Page({
         util.showToast(item);
       }
     },
+
+  /**
+   * @desc : 初始加载
+   * @date : 2024/7/5 15:49
+   * @author : 常皓宁
+   */
+  loadInit(){
+    console.log('ttt',this.data.params);
+    if(this.data.params && this.data.params.testFlag){
+      let data = Data.falseProfitReportData
+      this.setData({
+        profit:data.profit,
+      })
+      console.log('sasss',data)
+      /** 图形重新渲染 */
+      setTimeout(() => {
+        this.setEcharts('echartsProfitDate', { data: data.dateProfit, labelKey: 'accDate', valueKey: 'profit', type: 1 })
+        this.setEcharts('echartsProfitOrg', { data: data.orgProfit, labelKey: 'orgName', valueKey: 'profit', type: 3 })
+        this.setEcharts('echartsProfitStaff', { data: data.staffProfit, labelKey: 'staffName', valueKey: 'profit', type: 3 })
+        this.setEcharts('echartsProfitSku', { data: data.skuProfit, labelKey: 'skuName', valueKey: 'profit', type: 3 })
+      }, 1000)
+    }else{
+      this.getSaleProfit()
+    }
+  },
 })
 

+ 23 - 1
package-inventory/pages/ivt-sum-report/ivt-sum-report.js

@@ -9,6 +9,7 @@
  *******************************************************************************/
 const mixins = require('@/mixins/index.js')
 const Constants = require('@/utils/Constants.js');
+const Data = require('@/utils/data.js');
 const config = require('@/config/config.js')
 const app = getApp()
 Page({
@@ -17,6 +18,7 @@ Page({
    * 页面的初始数据
    */
   data: {
+    initSearchFlag:false,
     // 路由
     routeObjName: 'report',
     // 查询条件
@@ -138,7 +140,27 @@ Page({
    * @author : 姜永辉
    */
   getData(params) {
-    return this.excute(this.data.service, this.data.service.getIvtSumReport, params);
+    if(this.data.params && this.data.params.testFlag){
+      return
+    }else{
+      return this.excute(this.data.service, this.data.service.getIvtSumReport, params);
+    }
+  },
+
+  /**
+   * @desc : 初始加载
+   * @date : 2024/7/5 15:49
+   * @author : 常皓宁
+   */
+  loadInit(){
+    console.log('ttt',this.data.params);
+    if(this.data.params && this.data.params.testFlag){
+      this.setData({
+        tableData:Data.falseIvtSumReportData
+      })
+    }else{
+      this.searchData();
+    }
   },
 
   /**

+ 95 - 0
utils/data.js

@@ -0,0 +1,95 @@
+module.exports = {
+  falseIvtSumReportData: [{
+    brandName: "测试",
+    currentIntoAmt: 100,
+    currentIntoQty: 100,
+    currentOutAmt: 100,
+    currentOutQty: 100,
+    decimalPlaces: 0,
+    endingIvtAmt: 104501,
+    endingIvtQty: 100,
+    imagesUrl: "https://s.dev01.dkiboss.com:7000/file/dc91014c58d4d/t_mst_goods_sku/2024-06/27/aa556141-2f8a-49fe-b7a7-b45b44760b32.png",
+    invId: "10112024-0625-0000-0000-000460f23129",
+    nonStdCode: "-",
+    openingIvtAmt: 104501,
+    openingIvtQty: 88,
+    packBox: 8,
+    seriesName: "测试数据",
+    shortName: "测试",
+    skuImages: [{
+      createTime: "2024-06-27T14:54:13.398",
+      name: "2N8O15Jzd35910ab61066bb6311ee8e5baa140bc0a9f.png",
+      path: "/dc91014c58d4d/t_mst_goods_sku/2024-06/27/aa556141-2f8a-49fe-b7a7-b45b44760b32.png",
+      type: "image",
+      url: "https://s.dev01.dkiboss.com:7000/file/dc91014c58d4d/t_mst_goods_sku/2024-06/27/aa556141-2f8a-49fe-b7a7-b45b44760b32.png",
+    }],
+    skuModel: "测试数据",
+    skuName: "测试数据",
+    skuSpec: "测试数据",
+    subUnitName: "箱",
+    unitName: "个",
+    whName: "主仓",
+  }],
+  falseCusRecPayReportData: [{
+    facAmt: 99999
+  }, {
+    arrears: 99999
+  }, {
+    outAmt: 99999
+  }, {
+    arrears: 99,
+    cusName: "张萌萌",
+    cusPhone: "1388888888",
+    objectId: "10112024-0622-0000-0000-0004529ba002",
+  }, {
+    arrears: 99,
+    cusName: "王萌萌",
+    cusPhone: "1399999999",
+    objectId: "10112024-0622-0000-0000-00045369aaff"
+  }],
+  falseProfitReportData: {
+    profit: {
+      inbound: -45321,
+      outbound: 765432,
+      profit: 77884,
+      profitRate: 106.17,
+    },
+    dateProfit: [{
+        accDate: "2024-06",
+        profit: 123123,
+        profitRate: 177.33,
+      },
+      {
+        accDate: "2024-07",
+        profit: 44232,
+        profitRate: 106.17,
+      }
+    ],
+    orgProfit: [{
+      orgName: "测试中心",
+      profitRate: 106.17,
+      profit: 77804
+    }],
+    staffProfit: [{
+        staffName: "145555555",
+        profitRate: 107.06,
+        profit: 32322
+      },
+      {
+        staffName: "4223333",
+        profitRate: 100.2,
+        profit: 9519
+      }
+    ],
+    skuProfit: [{
+      skuName: "P001",
+      profitRate: 111.01,
+      profit: 12345
+    }, {
+      skuName: "U001(U001)",
+      profitRate: 23,
+      profit: 23233
+    }]
+  },
+
+}