|
|
@@ -21,15 +21,18 @@ Page({
|
|
|
* 页面的初始数据
|
|
|
*/
|
|
|
data: {
|
|
|
+ dateType: 'week',// week本周, month本月
|
|
|
swiperIndex: 0,
|
|
|
- imageUrl:config.image_url + '/static/img/',
|
|
|
+ imageUrl: config.image_url + '/static/img/',
|
|
|
advertisementList: [], // 广告数据
|
|
|
// 分页flg
|
|
|
pageFlag: false,
|
|
|
comMenuList: [],// 常用功能
|
|
|
companyName: null,
|
|
|
- transactionAmount: '¥11,850.00',
|
|
|
- collectionAmount: '¥10,850.00',
|
|
|
+ // 成交额
|
|
|
+ transactionAmount: 0,
|
|
|
+ // 收款额
|
|
|
+ collectionAmount: 0,
|
|
|
//功能分类-大功能模块-页面
|
|
|
functionItems: [
|
|
|
{
|
|
|
@@ -132,12 +135,68 @@ Page({
|
|
|
* @author : 周兴
|
|
|
* @date : 2024/4/1
|
|
|
*/
|
|
|
- changeCp(){
|
|
|
+ changeCp() {
|
|
|
wx.navigateTo({
|
|
|
url: '/pages/company/company',
|
|
|
})
|
|
|
},
|
|
|
/**
|
|
|
+ * @desc : 切换日期查询成交额和收款额
|
|
|
+ * @author : 周兴
|
|
|
+ * @date : 2024/4/1
|
|
|
+ */
|
|
|
+ changeDate() {
|
|
|
+ let dateType = this.data.dateType;
|
|
|
+ dateType = dateType == 'month' ? 'week' : 'month';
|
|
|
+ console.log('dateType',dateType);
|
|
|
+ // 查询应收和收款
|
|
|
+ this.getReceivableAccountSum(dateType);
|
|
|
+ this.setData({
|
|
|
+ dateType: dateType
|
|
|
+ })
|
|
|
+ },
|
|
|
+ /**
|
|
|
+ * @desc : 查询应收和收款
|
|
|
+ * @author : 周兴
|
|
|
+ * @date : 2024/4/3
|
|
|
+ */
|
|
|
+ getReceivableAccountSum(dateType) {
|
|
|
+
|
|
|
+ let now = new Date();
|
|
|
+ let params = {
|
|
|
+ staffId: app.globalData.user.staffId,
|
|
|
+ }
|
|
|
+ // 本周
|
|
|
+ if (dateType == 'week') {
|
|
|
+ params['accDateStart'] = now.getWeekFirstDay()
|
|
|
+ params['accDateEnd'] = now.getWeekLastDay()
|
|
|
+ } else if (dateType == 'month') {
|
|
|
+ params['accDateStart'] = now.getFirstDateStr()
|
|
|
+ params['accDateEnd'] = now.getLastDateStr()
|
|
|
+ }
|
|
|
+ let service = app.globalData['accountService']
|
|
|
+ api.request(service.prefix + service.getReceivableAccountSum, 'POST', params).then(res => {
|
|
|
+ if (res.data.code == Constants.SUCESS_CODE) {
|
|
|
+ console.log('eee', res.data);
|
|
|
+ if (res.data && res.data.data) {
|
|
|
+ this.setData({
|
|
|
+ transactionAmount: res.data.data.receivable,
|
|
|
+ collectionAmount: res.data.data.receipt,
|
|
|
+ })
|
|
|
+ }
|
|
|
+ // if (res.data && res.data.data) {
|
|
|
+ // let advertisementList = res.data.data
|
|
|
+ // advertisementList.forEach(it => {
|
|
|
+ // it.adPath = config.image_url + it.adPath
|
|
|
+ // })
|
|
|
+ // this.setData({
|
|
|
+ // advertisementList: advertisementList
|
|
|
+ // })
|
|
|
+ // }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ /**
|
|
|
* @desc : 查询广告
|
|
|
* @author : 周兴
|
|
|
* @date : 2024/4/1
|
|
|
@@ -145,18 +204,18 @@ Page({
|
|
|
getAdvertisement() {
|
|
|
let params = {
|
|
|
appCode: Constants.APP_CODE,
|
|
|
- gradeCode:app.globalData.company.gradeCode
|
|
|
+ gradeCode: app.globalData.company.gradeCode
|
|
|
}
|
|
|
let service = app.globalData['advertisementService']
|
|
|
api.request(service.prefix + service.selectByCond, 'POST', params).then(res => {
|
|
|
if (res.data.code == Constants.SUCESS_CODE) {
|
|
|
- if(res.data && res.data.data){
|
|
|
+ if (res.data && res.data.data) {
|
|
|
let advertisementList = res.data.data
|
|
|
- advertisementList.forEach(it=>{
|
|
|
+ advertisementList.forEach(it => {
|
|
|
it.adPath = config.image_url + it.adPath
|
|
|
})
|
|
|
this.setData({
|
|
|
- advertisementList:advertisementList
|
|
|
+ advertisementList: advertisementList
|
|
|
})
|
|
|
}
|
|
|
}
|
|
|
@@ -254,15 +313,17 @@ Page({
|
|
|
}
|
|
|
})
|
|
|
this.setData({
|
|
|
- companyName:app.globalData.company.cpName
|
|
|
+ companyName: app.globalData.company.cpName
|
|
|
})
|
|
|
// 查询广告数据
|
|
|
this.getAdvertisement();
|
|
|
+ // 查询应收和收款额
|
|
|
+ this.getReceivableAccountSum(this.data.dateType);
|
|
|
// options 中的 scene
|
|
|
if (options.scene) {
|
|
|
// var scene = options.scene
|
|
|
var scene = decodeURLComponent(options.scene)
|
|
|
- let openid = scene.s
|
|
|
+ let openid = scene.s
|
|
|
|
|
|
// 邀请员工的确认
|
|
|
wx.navigateTo({
|