Browse Source

添加周报数据

暖心小太阳 5 days ago
parent
commit
7fb4857f2a

+ 5 - 3
api/jms.js

@@ -1,7 +1,7 @@
 // 以下是业务服务器API地址
-var WxApiRoot = 'http://127.0.0.1:19220/jzfranchiseeapiservice/';
+// var WxApiRoot = 'http://127.0.0.1:19220/jzfranchiseeapiservice/';
 //  // uat环境使用
-//   var WxApiRoot = 'https://uat.jms.lifejingzhi.com/jzfranchiseeapiservice/';
+  var WxApiRoot = 'https://uat.jms.lifejingzhi.com/jzfranchiseeapiservice/';
 
  // 云平台上线时使用
 //  var WxApiRoot = 'https://jms.lifejingzhi.com/jzfranchiseeapiservice/';
@@ -59,6 +59,8 @@ var WxApiRoot = 'http://127.0.0.1:19220/jzfranchiseeapiservice/';
 	RefundisPass: WxApiRoot + 'jmsapp/mallAftersale/isPass',
 	PreRefundCheck: WxApiRoot + 'jmsapp/mallAftersale/preRefundCheck',
     FraWeekReport: WxApiRoot + 'jmsapp/fraWeekReport/getFraWeekReport',
-
+    GetReportList: WxApiRoot + 'admin/weekReport/queryReportList',
+    readWeekReport: WxApiRoot + 'admin/weekReport/read',
+    getReportDate: WxApiRoot + 'admin/weekReport/getReportDate',
  };
 

+ 133 - 43
pages/temp/fraWeekReport/fraWeekReport.js

@@ -2,49 +2,139 @@ const util = require("../../../utils/jmsUtil");
 const api = require("../../../api/jms");
 Page({
 
-    data: {},
-    onPageScroll(e) {
-
-    },
-
-
-    /**
-     * 生命周期函数--监听页面加载
-     */
-    onLoad: function (options) {
-
-    },
-
-    /**
-     * 生命周期函数--监听页面显示
-     */
-    onShow: function () {
-
-    }, onHide: function () {
-        console.log('onHide');
-    }, onUnload: function () {
-        console.log('onunload');
-    },
-
-    /**
-     * 生命周期函数--监听页面初次渲染完成
-     */
-    onReady: function () {
-
-    },
-    getFraWeekReport() {
-        util.request(api.GetFraWeekReport, {}, 'GET').then(res => {
-            if (res.errno === 0) {
-                this.setData({
-                    fraWeekReport: res.data.fraWeekReport,
-                    showFraWeekReportFlag: res.data.showFraWeekReportFlag
-                })
-            } else {
-                wx.showToast({
-                    title: res.errmsg, icon: 'none'
-                })
-            }
+  data: {
+    noData: false,
+    dataId: '',
+    reportList: {},
+    reportDateList: [],
+    showPopup: false,
+    beginDate: '',
+    endDate: '',
+    columns: [],
+    selectedWeek: '',
+    index: 0
+  },
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  onLoad(options) {
+    console.log("optons", options);
+    this.setData({
+      dataId: options.id
+    })
+  },
+
+  /**
+   * 生命周期函数--监听页面显示
+   */
+  onShow() {
+    this.getReportList()
+    this.getReportDate()
+  },
+  onHide: function () {
+    console.log('onHide');
+  },
+  onUnload: function () {
+    console.log('onunload');
+  },
+
+  /**
+   * 生命周期函数--监听页面初次渲染完成
+   */
+  onReady: function () {
+
+  },
+  getReportList() {
+    let params = {
+      isFra: 1,
+      pushFraFlag: 1,
+      beginDate: this.data.beginDate.replace(/\//g, '-'),
+      endDate: this.data.endDate.replace(/\//g, '-') ,
+      dataId: this.data.dataId
+    }
+    console.log("params",params);
+    util.request(api.GetReportList, params, 'post').then(res => {
+      if (res.errno === 0) {
+
+        if (res.data == null) {
+          this.setData({
+            noData: true
+          })
+        }else{
+           // console.log("我的打印", res.data.records[0]);
+        this.setData({
+          reportList: res.data.records[0]
+        })
+        }
+       
+      } else {
+        wx.showToast({
+          title: res.errmsg,
+          icon: 'none'
+        })
+      }
+    });
+  },
+  getReportDate() {
+    util.request(api.getReportDate, {}, 'get').then(res => {
+      if (res.errno === 0) {
+        console.log("我的打印", res.data);
+        this.setData({
+          reportDateList: res.data.reverse()
+        })
+        // 使用map方法转换每个日期对象
+        const formattedDates = res.data.map(date => {
+          // 格式化月份和日期,确保它们总是两位数
+          const beginDate = date.beginDate.split('-').map(part => part.padStart(2, '0')).join('-');
+          const endDate = date.endDate.split('-').map(part => part.padStart(2, '0')).join('-');
+          // 返回格式化后的日期字符串
+          return `${beginDate}-${endDate}`;
         });
-    },
+        this.setData({
+          columns: formattedDates
+        })
+      } else {
+        wx.showToast({
+          title: res.errmsg,
+          icon: 'none'
+        })
+      }
+    });
+  },
+
+  showWeekDate() {
+    this.setData({
+      showPopup: true
+    })
+  },
+  onClose() {
+    this.setData({
+      showPopup: false
+    });
+  },
+
+
+  onConfirm(event) {
+    const {
+      picker,
+      value,
+      index
+    } = event.detail;
+  
+    this.setData({
+      showPopup: false,
+      selectedWeek: value,
+      index: index,
+      beginDate: this.data.reportDateList[index].beginDate,
+      endDate: this.data.reportDateList[index].endDate
+    }); 
+     console.log("选中",value,index,this.data.reportDateList[index].beginDate);
+    this.getReportList()
+  },
 
+  onCancel() {
+    this.setData({
+      showPopup: false
+    });
+  },
 })

+ 140 - 3
pages/temp/fraWeekReport/fraWeekReport.wxml

@@ -1,7 +1,144 @@
 <view class="whole-page">
+  <view class="no-data" wx:if="{{noData}}">
+    <view class="no-data-img">
+    </view>
+    <view class="tip">
+      暂未推送数据
+    </view>
+  </view>
+
+
 
-    <view class="no-data">
-        <image src="/images/no-data.png" class="no-data-img"></image>
-        <text class="no-data-text">暂无数据</text>
+  <view class="data-container" wx:else>
+    <view class="week-report" bind:tap="showWeekDate">
+      <view class="l">周报数据</view>
+      <view class="r">
+        <text>{{reportList.bookStartAndEnd}}</text>
+        <view class="r-border"></view>
+      </view>
     </view>
+    <view class="report-data">
+      <view class="report-first">
+        <view class="top">
+          <view class="title">
+            <view class="t">
+              经营分
+            </view>
+            <view class="b">(指标:90分以上)</view>
+          </view>
+          <view class="title title1">经营分排名</view>
+          <view class="title">
+            <view class="t">
+              履约率
+            </view>
+            <view class="b">(指标:90分以上)</view>
+          </view>
+        </view>
+        <view class="top top1">
+          <view class="title">
+            {{reportList.douyinOperateScore}}
+          </view>
+          <view class="title title1"> {{reportList.operateScoreRank}}</view>
+          <view class="title">
+            {{reportList.complianceRate}}
+          </view>
+        </view>
+      </view>
+      <view class="report-first">
+        <view class="top">
+          <view class="title ">履约率排名</view>
+          <view class="title title1">
+            <view class="t">
+              保洁复购率
+            </view>
+            <view class="b">(指标:90分以上)</view>
+          </view>
+          <view class="title ">
+            保洁复购率排名
+          </view>
+        </view>
+        <view class="top top1">
+          <view class="title">
+            {{reportList.complianceRateRank}}
+          </view>
+          <view class="title title1"> {{reportList.bjRebuyRate}}</view>
+          <view class="title">
+            {{reportList.bjRebuyRateRank}}
+          </view>
+        </view>
+      </view>
+      <view class="report-first">
+        <view class="top">
+          <view class="title ">全职在线人数</view>
+          <view class="title title1">
+            <view class="t">
+              抖音差评率
+            </view>
+            <view class="b">(指标:小于1.5%)</view>
+          </view>
+          <view class="title">
+            抖音差评率排名
+          </view>
+        </view>
+        <view class="top top1">
+          <view class="title">
+            {{reportList.onlinePersonNumber}}
+          </view>
+          <view class="title title1"> {{reportList.douyinBadEvaRate}}</view>
+          <view class="title">
+            {{reportList.douyinBadEvaRank}}
+          </view>
+        </view>
+      </view>
+      <view class="report-first">
+        <view class="top">
+          <view class="title">
+            回访差评率
+          </view>
+          <view class="title title1">回访差评率排名</view>
+          <view class="title">
+            回访差评分
+          </view>
+        </view>
+        <view class="top top1">
+          <view class="title">
+            {{reportList.crmBadEvaRate}}
+          </view>
+          <view class="title title1"> {{reportList.crmBadEvaRateRank}}</view>
+          <view class="title">
+            {{reportList.crmBadEvaScore}}
+          </view>
+        </view>
+      </view>
+  
+      <view class="total">
+        <view>
+          合计权重分
+        </view>
+        <view>
+          {{reportList.totalWeightScore}}分
+        </view>
+      </view>
+
+    </view>
+
+
+    <van-overlay show="{{ showPopup }}" bind:click="onClose" />
+    <view class="time-select" wx:if="{{showPopup}}"> 
+           <van-picker
+           default-index="{{ reportDateList.length }}"
+  title="请选择时间"
+  show-toolbar
+  columns="{{ columns }}"
+  bind:cancel="onCancel"
+  bind:confirm="onConfirm"
+  
+/>
+    </view>
+ 
+
+
+
+
+  </view>
 </view>

+ 135 - 0
pages/temp/fraWeekReport/fraWeekReport.wxss

@@ -0,0 +1,135 @@
+.whole-page {
+  width: 100vw;
+  height: 100vh;
+  overflow: hidden;
+}
+
+.no-data {
+  width: 400rpx;
+  height: 500rpx;
+  margin: 300rpx auto;
+}
+
+.no-data-img {
+  width: 400rpx;
+  height: 400rpx;
+  margin: auto;
+  background-image: url('https://mall.zhaijieshi.cc/file/wx-jms/ss.png');
+  background-repeat: no-repeat;
+  background-size: contain;
+}
+
+.tip {
+  text-align: center;
+  color: #cecece;
+}
+
+.data-container {
+  height: 100vh;
+  background-color: #f5f5f5;
+  padding: 20rpx 30rpx;
+}
+
+.week-report {
+  display: flex;
+  justify-content: space-between;
+
+}
+
+.week-report .l {
+  color: #000;
+  font-weight: bold;
+}
+
+.week-report .r {
+  color: #000;
+  font-weight: bold;
+}
+
+.week-report .r .r-border {
+  display: inline-block;
+  width: 0;
+  height: 0;
+  border-left: 12rpx solid transparent;
+  border-right: 12rpx solid transparent;
+  border-top: 12rpx solid #C0EAFF;
+  position: relative;
+  top: -5rpx;
+  margin-left: 10rpx;
+}
+
+.report-data {
+  background-color: #fff;
+  border-radius: 20rpx;
+  height: 820rpx;
+  padding: 40rpx 30rpx;
+  margin-top: 30rpx;
+}
+
+.report-first {
+  margin-bottom: 30rpx;
+}
+
+.report-first .top {
+  display: flex;
+  border-top: 3rpx solid #cecece;
+  border-bottom: 3rpx solid #cecece;
+  height: 100rpx;
+}
+
+.report-first .top1 {
+  display: flex;
+  border-bottom: 3rpx solid #cecece;
+  border-top: 3rpx solid transparent;
+  height: 50rpx !important;
+}
+
+.top .title {
+  text-align: center;
+  font-size: 26rpx;
+  font-weight: bold;
+  width: 200rpx;
+  display: flex;
+  flex-direction: column;
+  justify-content: center;
+}
+
+.top .title1 {
+  flex: 1;
+  border-right: 3rpx solid #cecece;
+  border-left: 3rpx solid #cecece;
+}
+
+.top .title .t {
+  font-size: 26rpx;
+  font-weight: bold;
+}
+
+.top .title .b {
+  font-size: 22rpx;
+  font-weight: 400;
+}
+.total{
+  color: #1BB3FF;
+  font-size: 28rpx;
+  display: flex;
+  justify-content: space-between;
+
+}
+
+.total view{
+  font-weight: bold;
+}
+.time-select{
+  width: 600rpx;
+  height: 500rpx;
+  z-index: 999;
+  position: absolute;
+  top: 260rpx;
+  left: calc(50vw - 300rpx);
+  border-radius: 36rpx;
+ 
+}
+.van-picker {
+border-radius: 26rpx;
+}

+ 150 - 121
pages/temp/serviceOrder/serviceOrder.js

@@ -4,141 +4,170 @@ const api = require('../../../api/jms.js');
 
 
 Page({
-    noop() {
+  noop() {
 
+  },
+  data: {
+
+    userInfo: {
+      userName: '',
+      headImg: '',
+      fraName: '',
     },
-    data: {
+    serviceOrder: '',
+    ticket: '',
+    aftersale: '',
+    wmsOrderCount: '',
+    showFraWeekReportFlag: false,
+    fraWeekReportId: null
 
-        userInfo: {
-            userName: '', headImg: '', fraName: '',
-        },
-        serviceOrder: '',
-        ticket: '',
-        aftersale: '',
-        wmsOrderCount: '',
-        showFraWeekReportFlag: false,
-        fraWeekReportId: null
 
+  },
+  onPageScroll(e) {
 
-    }, onPageScroll(e) {
+  },
 
-    },
 
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  onLoad: function (options) {
 
-    /**
-     * 生命周期函数--监听页面加载
-     */
-    onLoad: function (options) {
 
+    let userInfo = wx.getStorageSync('userInfo');
+    console.log(userInfo);
+    app.globalData.userInfo = userInfo;
+    this.setData({
+      userInfo: userInfo
+    });
 
-        let userInfo = wx.getStorageSync('userInfo');
-        console.log(userInfo);
-        app.globalData.userInfo = userInfo;
-        this.setData({
-            userInfo: userInfo
-        });
 
-
-    },
-    getHomeInfo() {
-        util.request(api.GetHomeInfo, {}, 'GET').then(res => {
-            if (res.errno === 0) {
-                this.setData({
-                    serviceOrder: res.data.serviceOrder,
-                    ticket: res.data.ticket,
-                    aftersale: res.data.aftersale,
-                    wmsOrderCount: res.data.wmsOrderCount,
-                    showFraWeekReportFlag: res.data.showFraWeekReportFlag,
-                    fraWeekReportId: res.data.fraWeekReportId
-                })
-            } else {
-                wx.showToast({
-                    title: res.errmsg, icon: 'none'
-                })
-            }
-        });
-    },
-    closePopup() {
-        console.log('closePopup');
+  },
+  getHomeInfo() {
+    util.request(api.GetHomeInfo, {}, 'GET').then(res => {
+      if (res.errno === 0) {
         this.setData({
-            showFraWeekReportFlag: false
+          serviceOrder: res.data.serviceOrder,
+          ticket: res.data.ticket,
+          aftersale: res.data.aftersale,
+          wmsOrderCount: res.data.wmsOrderCount,
+          showFraWeekReportFlag: res.data.showFraWeekReportFlag,
+          fraWeekReportId: res.data.fraWeekReportId
         })
-    },
-
-
-    /**
-     * 生命周期函数--监听页面显示
-     */
-    onShow: function () {
-
-        this.getHomeInfo();
-    }, onHide: function () {
-        console.log('onHide');
-    }, onUnload: function () {
-        console.log('onunload');
-    }, /**
-     * 页面相关事件处理函数--监听用户下拉动作
-     */
-
-    exitLogin: function () {
-        wx.showModal({
-            title: '', confirmColor: '#b4282d', content: '退出登录?', success: function (res) {
-                if (!res.confirm) {
-                    return;
-                }
-
-                // util.request(api.AuthLogout, {}, 'POST');
-                app.globalData.hasLogin = false;
-                wx.removeStorageSync('token');
-                wx.removeStorageSync('userInfo');
-                // wx.redirectTo({
-                //   url: '/pages/temp/login/login'
-                // });
-                wx.redirectTo({
-                    url: '/pages/index/index'
-                });
-            }
+      } else {
+        wx.showToast({
+          title: res.errmsg,
+          icon: 'none'
         })
-
-    }, goService() {
-        wx.navigateTo({
-            url: '/pages/temp/orderBoard/orderBoard'
-        });
-    }, goTicket() {
-        wx.navigateTo({
-            url: '/pages/ticket/ticketList/ticketList'
+      }
+    });
+  },
+  closePopup() {
+    console.log('closePopup');
+    this.setData({
+      showFraWeekReportFlag: false
+    })
+  },
+
+
+  /**
+   * 生命周期函数--监听页面显示
+   */
+  onShow: function () {
+
+    this.getHomeInfo();
+  },
+  onHide: function () {
+    console.log('onHide');
+  },
+  onUnload: function () {
+    console.log('onunload');
+  },
+  /**
+   * 页面相关事件处理函数--监听用户下拉动作
+   */
+
+  exitLogin: function () {
+    wx.showModal({
+      title: '',
+      confirmColor: '#b4282d',
+      content: '退出登录?',
+      success: function (res) {
+        if (!res.confirm) {
+          return;
+        }
+
+        // util.request(api.AuthLogout, {}, 'POST');
+        app.globalData.hasLogin = false;
+        wx.removeStorageSync('token');
+        wx.removeStorageSync('userInfo');
+        // wx.redirectTo({
+        //   url: '/pages/temp/login/login'
+        // });
+        wx.redirectTo({
+          url: '/pages/index/index'
         });
-    }, goRefund() {
-        wx.navigateTo({
-            url: '/pages/refund/refundList/refundList'
-        });
-    }, goMall() {
-        wx.navigateTo({
-            url: '/pages/mall/catalog/catalog'
-        });
-    }, goOrder() {
-        wx.navigateTo({
-            url: '/pages/mall/order/order'
-        });
-    }, goWeekData() {
-        wx.navigateTo({
-            url: '/pages/temp/fraWeekReport/fraWeekReport?id=' + this.data.fraWeekReportId,
-        })
-    },
-
-    /**
-     * 生命周期函数--监听页面初次渲染完成
-     */
-    onReady: function () {
-
-    },
-
-
-    /**
-     * 用户点击右上角分享
-     */
-    onShareAppMessage: function () {
-
-    },
+      }
+    })
+
+  },
+  goService() {
+    wx.navigateTo({
+      url: '/pages/temp/orderBoard/orderBoard'
+    });
+  },
+  goTicket() {
+    wx.navigateTo({
+      url: '/pages/ticket/ticketList/ticketList'
+    });
+  },
+  goRefund() {
+    wx.navigateTo({
+      url: '/pages/refund/refundList/refundList'
+    });
+  },
+  goMall() {
+    wx.navigateTo({
+      url: '/pages/mall/catalog/catalog'
+    });
+  },
+  goOrder() {
+    wx.navigateTo({
+      url: '/pages/mall/order/order'
+    });
+  },
+  goWeekData(e) {
+ let type=e.target.dataset.type
+ if(type==2){
+    let params={dataId:this.data.fraWeekReportId}
+    util.request(api.readWeekReport, params, 'get').then(res => {
+      if (res.errno === 0) {
+      } else {
+          wx.showToast({
+              title: res.errmsg, icon: 'none'
+          })
+      }
+  });
+ }
+    wx.navigateTo({
+      url: '/pages/temp/fraWeekReport/fraWeekReport?id=' + this.data.fraWeekReportId,
+    })
+    
+  },
+
+  /**
+   * 生命周期函数--监听页面初次渲染完成
+   */
+  onReady: function () {
+
+  },
+
+
+  /**
+   * 用户点击右上角分享
+   */
+  onShareAppMessage: function () {
+
+  },
 
 })

+ 2 - 2
pages/temp/serviceOrder/serviceOrder.wxml

@@ -81,7 +81,7 @@
             <view class="title">
                 数据统计
             </view>
-            <image src="https://mall.zhaijieshi.cc/file/wx-jms/icon-order-jms.png" mode="aspectFill"></image>
+            <image src="https://mall.zhaijieshi.cc/file/wx-jms/blx.png" mode="aspectFill"></image>
             <view class="board-num"></view>
         </view>
 
@@ -93,7 +93,7 @@
         </view>
         <view class="popup-content"  >
             <view class="popup-text—left">您的周报数据已生成</view>
-            <view class="popup-text-right" bindtap="goWeekData" >去查看</view>
+            <view class="popup-text-right" bindtap="goWeekData" data-type="2">去查看</view>
         </view>