Commit 56bf398a by zhangxw

Merge branch 'SAAS+V5.3.0-1117' of http://192.168.3.233:8090/saas_plus/sales-ass…

…istant into SAAS+V5.3.0-1117
2 parents 4b25003b c36a2e01
import api from '~/utils/request/request'
const { appId } = wx.getAccountInfoSync().miniProgram
const CODE = {
platformEntrance: 'SALES_ASSISTANT',
productCode: 'PC00c3'
}
class dailyReportApi {
// 销售员工日报详情查询
staffDailyReportDetail(data) {
return api.post({
method: 'dj.api.sale.staff.dailyReport.detail',
...data
})
}
// 查询当周员工日报是否填写列表
staffDailyReportWeeklyList(data) {
return api.post({
method: 'dj.api.sale.staff.dailyReport.weekly.list',
...data
})
}
// 销售员工日报填报
staffDailyReportSave(data) {
return api.post({
method: 'dj.api.sale.staff.dailyReport.save',
...data
})
}
// 大区经理、总监视角销售人员日报概览查询
staffDailyReportManagerViewSelect(data) {
return api.post({
method: 'dj.api.sale.staff.dailyReport.manager.view.select',
...data
})
}
}
export default dailyReportApi
import dailyReportApi from './dailyReportApi.js'
export default new dailyReportApi()
......@@ -195,10 +195,11 @@ class UsersApi {
...data
})
}
// 能否打开智能名片
// 根据手机号查询智能名片
canOpenBusinessCard(data) {
return api.post({
method: 'dj.api.sale.login.openBusinessCard',
method: 'dj.api.sale.login.findBusinessCard',
...data
})
}
......
......@@ -42,26 +42,19 @@ Component({
* 获取自定义导航栏信息
*/
wx.getSystemInfo().then(res => {
let {
fontSizeSetting,
statusBarHeight,
screenWidth
} = res
const {
height,
right,
width,
top
} = wx.getMenuButtonBoundingClientRect(),
currentPages = getCurrentPages(), {
showBack
} = this.data
if (showBack && currentPages.length > 1) this.setData({
SHOWBACK: true
})
let navigationBarHeight = height + ((top - statusBarHeight) * 2) + 4 // 4
let { fontSizeSetting, statusBarHeight, screenWidth } = res
const { height, right, width, top } =
wx.getMenuButtonBoundingClientRect(),
currentPages = getCurrentPages(),
{ showBack } = this.data
if (showBack && currentPages.length > 1)
this.setData({
SHOWBACK: true
})
let navigationBarHeight = height + (top - statusBarHeight) * 2 + 4 // 4
let navigationBarPadding = screenWidth - right
let navigationBarWidth = screenWidth - (navigationBarPadding * 2 + width) - width
let navigationBarWidth =
screenWidth - (navigationBarPadding * 2 + width) - width
this.setData({
statusBarHeight,
navigationBarHeight,
......@@ -74,12 +67,9 @@ Component({
})
})
},
emit({
navigationBarHeight,
statusBarHeight
}) {
emit({ navigationBarHeight, statusBarHeight }) {
let navHeight = navigationBarHeight + statusBarHeight
const thisPage = wx.$router.getPageInstance()
let thisPage = wx.$router.getPageInstance()
this.triggerEvent('navbarReady', {
height: navHeight,
statusBarHeight,
......@@ -105,4 +95,4 @@ Component({
this.setPageTitle()
}
}
})
\ No newline at end of file
})
......@@ -52,7 +52,7 @@ Component({
},
/**输入回调 */
input(e) {
const thisPage = wx.$router.getPageInstance()
let thisPage = wx.$router.getPageInstance()
const { value } = e.detail,
{ name } = e.currentTarget.dataset
this.setData({
......@@ -117,13 +117,14 @@ Component({
},
/**检查输入框内容 */
checkFormData() {
const thisPage = wx.$router.getPageInstance()
let thisPage = wx.$router.getPageInstance()
const { loginType, formData } = this.data
if (loginType != 0) {
if (loginType == 1) {
this.setData(
{
phoneReady: formData.phone && thisPage.validate.methods.tel(formData.phone)
phoneReady:
formData.phone && thisPage.validate.methods.tel(formData.phone)
},
() => {
thisPage.checkLoginBtn()
......@@ -159,13 +160,13 @@ Component({
obj =
loginType == 1
? {
mobile: formData.phone,
code: formData.code
}
mobile: formData.phone,
code: formData.code
}
: {
userName: formData.account,
password: md5(formData.password)
}
userName: formData.account,
password: md5(formData.password)
}
this.setBtnLoading()
USERAPI[target](obj)
.then(({ code, data, message }) => {
......@@ -173,7 +174,7 @@ Component({
// console.log(code, 'code');
// debugger
if (code == '0') {
const thisPage = wx.$router.getPageInstance()
let thisPage = wx.$router.getPageInstance()
if (loginType == 1) setLoginInfo(data, data.sessionId)
wx.$storage.set('auto_login_object', {
noSignInUuid: data.noSignInUuid
......@@ -207,7 +208,7 @@ Component({
},
/**微信登录 */
wxLogin({ detail }) {
console.log(detail, 'detail');
console.log(detail, 'detail')
if (detail.errno == 104 || !detail.code) return //用户手动拒绝
// if (!detail.code) {
// // wx.$api.showToast('当前微信版本过低,无法使用该功能,请升级到最新微信版本后重试。')
......@@ -235,7 +236,7 @@ Component({
},
/**设置登录按钮loading状态 */
setBtnLoading(loading = true) {
const thisPage = wx.$router.getPageInstance()
let thisPage = wx.$router.getPageInstance()
thisPage.setData({
loading
})
......@@ -250,8 +251,8 @@ Component({
})
network.getNetworkType()
try {
const { data, code, message } = await USERAPI.wxCodeLogin()
const thisPage = wx.$router.getPageInstance()
let { data, code, message } = await USERAPI.wxCodeLogin()
let thisPage = wx.$router.getPageInstance()
if (code == '0') {
thisPage.setData({
disabled: false,
......
......@@ -2,19 +2,19 @@ import { setSessionId, setUserInfo } from '~/utils/cache/storageApi'
import USERAPI from '~/api/usersApi/index'
const setRouteData = targetPath => {
targetPath = decodeURIComponent(targetPath)
console.log(targetPath, 'targetPath');
console.log(targetPath, 'targetPath')
let [url, query] = targetPath.split('?'),
obj = {}
console.log(query, 'query');
console.log(query, 'query')
if (query) {
var list = query.split('&') || []
console.log(list, list);
console.log(list, list)
list.forEach(item => {
const [key, val] = item.split('=')
obj[key] = val
})
}
console.log(obj, url);
console.log(obj, url)
return {
url,
obj
......@@ -39,7 +39,7 @@ const setLoginInfo = (userInfo, sessionId) => {
// wx.$api.showToast('仅支持服务商类型账户登录')
// return
// }
console.log('wx.$router.getPageInstance()', wx.$router.getPageInstance());
console.log('wx.$router.getPageInstance()', wx.$router.getPageInstance())
// const {
// options: { reportDate },
// options
......@@ -77,9 +77,9 @@ const setLoginInfo = (userInfo, sessionId) => {
const loginSuccess = () => {
const {
options: { targetPath },
options,
options
} = wx.$router.getPageInstance()
console.log(options, 'loginSuccess');
console.log(options, 'loginSuccess')
if (targetPath) {
const { url, obj } = setRouteData(targetPath)
wx.$router.reLaunch(url, obj)
......@@ -101,7 +101,7 @@ const loginModal = async ({ message, confirmText, cancelText }) => {
}
/**手机号&微信登录:是否跳转登录列表页 */
const checkLoginUserInfo = ({ loginUserInfoList, sessionId }) => {
const thisPage = wx.$router.getPageInstance()
let thisPage = wx.$router.getPageInstance()
/**多个账号 */
// if (loginUserInfoList.length > 1)
// wx.$router.go('login.accountItems', {
......@@ -120,6 +120,6 @@ module.exports = {
loginSuccess,
setRouteData,
setLoginInfo,
loginModal,
loginModal
// initServiceCenter
}
......@@ -38,11 +38,13 @@ Page({
tabList[0].count = backstopWarningList.length
tabList[1].count = lostShopWarningList.length
tabList[2].count = lossWarningList.length
// list 根据
this.setData({
tabList,
backstopWarningList,
lostShopWarningList,
lossWarningList
lossWarningList,
list: backstopWarningList
})
})
},
......@@ -81,10 +83,19 @@ Page({
})
},
tabClick(e) {
// 根据索引获取数据
let { backstopWarningList, lostShopWarningList, lossWarningList } =
this.data
let list =
e.detail == 0
? backstopWarningList
: e.detail == 1
? lostShopWarningList
: lossWarningList
this.setData({
activeIndex: e.detail
activeIndex: e.detail,
list
})
this.getWarningStores()
},
onRoute(options) {
console.log(options, 'options')
......
{
"title": "指标预警门店",
"navigationBarTitleText": "指标预警门店",
"usingComponents": {}
}
......@@ -6,7 +6,7 @@
.box {
box-sizing: border-box;
width: 710rpx;
height: 220rpx;
// height: 220rpx;
border-radius: 16rpx;
// opacity: 1;
margin: 24rpx auto;
......@@ -31,30 +31,44 @@
}
.introduction {
display: flex;
flex-wrap: wrap;
// display: flex;
// flex-wrap: wrap;
.headerItem {
display: flex;
.children {
display: flex;
width: 50%;
}
// .right {
// width: 50%;
// }
}
.item {
width: 50%;
// width: 50%;
display: flex;
align-items: center;
// align-items: center;
margin-top: 16rpx;
align-items: center;
// align-items: center;
.label {
color: #999ea8;
font-size: 28rpx;
width: 168rpx;
width: 200rpx;
}
.content {
flex: 1;
color: #292d33;
font-size: 28rpx;
margin-left: 21rpx;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
margin-left: 24rpx;
// margin-left: 21rpx;
// white-space: nowrap;
// overflow: hidden;
// text-overflow: ellipsis;
}
.short {
......@@ -70,9 +84,9 @@
width: 120rpx;
}
.person {
width: 90rpx;
}
// .person {
// width: 90rpx;
// }
}
.last {
......@@ -84,23 +98,26 @@
}
.merchant {
display: flex;
align-items: center;
// display: flex;
// align-items: center;
.merchantName {
flex: 1;
// flex: 1;
color: #292d33;
font-size: 32rpx;
font-weight: 500;
// width: 100%;
// width: 120rpx;
// height: 50rpx;
}
.status {
margin-left: auto;
width: 80rpx;
color: #ff9d0a;
font-size: 26rpx;
margin-left: 28rpx;
}
// .status {
// margin-left: auto;
// width: 80rpx;
// color: #ff9d0a;
// font-size: 26rpx;
// margin-left: 28rpx;
// }
}
......@@ -109,4 +126,29 @@
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.newStore {
box-sizing: border-box;
display: inline-block;
background: #347bff14;
border-radius: 4rpx;
color: #347bff;
font-size: 22rpx;
margin-right: 10rpx;
line-height: 40rpx;
padding: 0rpx 8rpx;
}
.oldStore {
box-sizing: border-box;
display: inline-block;
background: #35c37614;
border-radius: 4rpx;
line-height: 40rpx;
color: #35C376;
font-size: 22rpx;
margin-right: 10rpx;
line-height: 40rpx;
padding: 0rpx 8rpx;
}
\ No newline at end of file
<!--packageIndex/pages/salesSummary/salesSummary.wxml-->
<!-- <text>packageIndex/pages/salesSummary/salesSummary.wxml</text> -->
<!-- <view class="tab">
<view class="tabItem">当月未拓店人员(8)</view>
<view class="tabItem">长期未签约客户(8)</view>
</view> -->
<tab-bar tabList="{{ tabList }}" bindclick="tabClick" activeIndex="{{ activeIndex }}" />
<scroll-view class="scrollView" scroll-y style="height: calc(100vh - 80px);">
<block wx:if="{{ activeIndex==0 }}">
<view class="list">
<view class="box" wx:for="{{ list }}" wx:key="index">
<view class="header">
<view class="name">{{item.personName}}</view>
<view class="phone">{{item.personPhone}}</view>
</view>
<view class="introduction">
<view class="item">
<view class="label short">区域</view>
<view class="content">{{item.regionName}}</view>
</view>
<view class="item">
<view class="label">直属上级</view>
<view class="content">{{item.directSuperior}}</view>
</view>
<view class="item">
<view class="label short">跟进中</view>
<view class="content">{{item.followUpCount||0}}家</view>
<view class="list">
<!-- wx:for="{{ list }}" wx:key="index" -->
<view class="box" wx:for="{{ list }}" wx:key="index">
<text class="merchant"><text class="status {{ item.storeType == 1?'newStore':'oldStore' }}">{{item.storeType == 1?'新店':'老店'}}</text><text class="merchantName">跟进中跟跟进中跟进中跟进中跟进中跟进中跟进中跟进中进中跟进中跟进中跟进中跟进中跟进中{{item.potentialCustomerName}}</text></text>
<view class="introduction merchantInfo">
<view class="item headerItem">
<view class="left children">
<view class="label">拜访次数</view>
<view class="content">{{item.visitTimes?item.visitTimes+'次':'-'}}</view>
</view>
<view class="item">
<view class="label">已签约未出单</view>
<view class="content">{{item.signedNotIssuedCount||0}}家</view>
<view class="right children">
<view class="label">销售人员</view>
<view class="content text-hide">销售人员销售人员销售人员销售人员{{item.visitCount?item.visitCount+'次':'-'}}</view>
</view>
</view>
</view>
</view>
</block>
<block wx:if="{{ activeIndex ==1 }}">
<view class="list">
<view class="box" wx:for="{{ list }}" wx:key="index">
<view class="merchant">
<view class="merchantName text-hide">{{item.potentialCustomerName}}</view>
<view class="status">跟进中</view>
<view class="item">
<view class="label person">签约时间</view>
<view class="content">{{item.signedTime||'-'}}</view>
</view>
<view class="introduction merchantInfo">
<view class="item">
<view class="label">拜访次数</view>
<view class="content">{{item.visitCount?item.visitCount+'次':'-'}}</view>
</view>
<view class="item">
<view class="label person">跟进人</view>
<view class="content">{{item.followPersonName||'-'}}</view>
</view>
<view class="item last">
<view class="label">最后跟进</view>
<view class="content">{{item.lastFollowUpTime||'-'}}</view>
</view>
<view class="item">
<view class="label person">展业时间</view>
<view class="content">{{item.expectedOperationDate||'-'}}</view>
</view>
<view class="item">
<view class="label person">门店地址</view>
<view class="content">{{item.address||'-'}}</view>
</view>
</view>
</view>
</block>
</view>
</scroll-view>
\ No newline at end of file
// packageTool/pages/salesDailyReport/salesDailyReport.js
var util = require('~/utils/timeFormat/time-utils.js')
import { getUserInfo } from '~/utils/cache/userInfo'
import dailyReportApi from '~/api/dailyReportApi/index'
import api from '../../api.js'
Page({
/**
......@@ -10,63 +11,76 @@ Page({
// isFullSucreen: wx.$util.isFullSucreen(),
timeBean: {}, //timeBean 传递给组件的数据,数据的格式在一开始的工具类中明确
selectWeek: 0, //0代表的本周 1代表下一周 -1代表上一周
role: 'staff'
role: 'staff',
hasDailyValue: false
},
handleConfirm() {
let { orderObj } = this.data
let params = {
staffUuid: orderObj.staffUuid,
reportDate: orderObj.reportDate,
todayWorkContent: orderObj.todayWorkContent,
tomorrowPlanContent: orderObj.tomorrowPlanContent
}
api.dailyReportSave(params).then((result) => {
wx.showModal({
title: '提示',
content: '您的日报填写完成!',
showCancel: false,
confirmText: '我知道了',
confirmColor: '#292D33',
success(res) {
}
dailyReportApi
.staffDailyReportSave(params)
.then(result => {
wx.showModal({
title: '提示',
content: '您的日报填写完成!',
showCancel: false,
confirmText: '我知道了',
confirmColor: '#292D33',
success(res) {}
})
})
}).catch((err) => {
});
.catch(err => {})
},
formatDateTime(date) {
const year = date.getFullYear()
const month = String(date.getMonth() + 1).padStart(2, '0')
const day = String(date.getDate()).padStart(2, '0')
return `${year}-${month}-${day}`
},
getStaffDailyReportDetailWeeklyList() {
let { orderObj, timeBean } = this.data
// console.log({ ...orderObj, ...timeBean }, 'getStaffDailyReportDetailWeeklyList');
// if (this.data.noStaffData) return wx.$util.showToast('该门店没有员工')
// if (this.data.noStoreData) return wx.$util.showToast('该4s店查无数据')
let { merchantId, yqMerchantId, staffUuid } = orderObj
// orderObj?.merchantId &&
console.log('getStaffDailyReportDetailWeeklyList');
console.log('getStaffDailyReportDetailWeeklyList')
api
.dailyReportWeekly({
dailyReportApi
.staffDailyReportWeeklyList({
// merchantId,
// yqMerchantId,
staffUuid,
...timeBean,
...timeBean
// sceneType: 1,
// reportTypeList: [-1]
})
.then(res => {
let { code, data, message } = res
if (code == 0) {
// console.log(data, 'data')
timeBean.weekDayList = timeBean.weekDayList.map((item, index) => {
// item.weeklyList = data[index]
item.hasDailyValue = data.includes(item.date)
return item
})
this.setData({
weeklyList: data,
timeBean
})
} else {
wx.$util.showToast(message)
}
.then(data => {
console.log(data, 'getStaffDailyReportDetailWeeklyList')
// let { code, data, message } = res
// if (code == 0) {
// console.log(data, 'data')
timeBean.weekDayList = timeBean.weekDayList.map((item, index) => {
// item.weeklyList = data[index]
item.hasDailyValue = data.includes(item.date)
return item
})
// 判断当前日期是否已填写日报
let currentDate = this.formatDateTime(new Date())
let hasDailyValue = timeBean.weekDayList.some(
item => item.date == currentDate
)
console.log(currentDate, hasDailyValue, 'hasDailyValue')
this.setData({
weeklyList: data,
timeBean,
hasDailyValue
})
// } else {
// wx.$api.showToast(message)
// }
})
},
remarkInput(e) {
......@@ -98,7 +112,6 @@ Page({
['timeBean.selectDay']: e.detail
})
this.setReportDate()
// this.getStaffReport()
},
toDetail(e) {
let { item } = e.currentTarget.dataset
......@@ -172,6 +185,27 @@ Page({
// this.getStaffReport()
this.getStaffDailyReportDetailWeeklyList()
},
getStaffReport() {
let { orderObj } = this.data
let { reportDate, staffUuid } = orderObj
console.log(orderObj, 'getStaffReport')
dailyReportApi
.staffDailyReportDetail({
reportDate,
staffUuid
})
.then(data => {
console.log(data)
this.setData({
detailObj: data,
['orderObj.todayWorkContent']: data?.todayWorkContent || '',
todayWorkContent: data?.todayWorkContent.length || 0,
['orderObj.tomorrowPlanContent']: data?.tomorrowPlanContent || '',
tomorrowPlanContent: data?.tomorrowPlanContent.length || 0
})
})
},
initData() {
let { orderObj, reportDate, role, approvedSource, userInfo } = this.data
if (reportDate) {
......@@ -203,7 +237,6 @@ Page({
timeBean: util.getWeekDayList(this.data.selectWeek)
})
}
this.setReportDate()
let isStaff = true // 是否是员工
// if (isStaff && approvedSource != '3') {
......@@ -224,18 +257,17 @@ Page({
// yqMerchantId: merchantId,
// yqMerchantName: merchantName,
// staffName: name,
staffUuid: uuid,
staffUuid: uuid
// shopMerchantId: shopMerchantId,
// shopMerchantName: shopMerchantName
// merchantId: shopMerchantId,
// merchantName: shopMerchantName
},
}
// merchantRange: [{ merchantName: shopMerchantName }]
})
this.getStaffDailyReportDetailWeeklyList()
// this.getMerchantCarBandList()
// }
this.setReportDate()
},
// 设置报告日期
setReportDate() {
......@@ -244,13 +276,14 @@ Page({
var time = new Date(date)
var y = time.getFullYear()
var m = time.getMonth() + 1
console.log(date, 'date');
console.log(date, 'date')
this.setData({
['timeBean.yearMonth']: y + '-' + m,
['orderObj.reportDate']: date,
isEditReport: false
})
console.log(this.data.orderObj);
console.log(this.data.orderObj)
this.getStaffReport()
},
onRoute(options) {
console.log(options, 'staffoptions')
......@@ -270,8 +303,6 @@ Page({
})
// wx.$util.getUserInfo()
this.initData()
},
/**
* 生命周期函数--监听页面加载
......@@ -286,35 +317,35 @@ Page({
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() { },
onReady() {},
/**
* 生命周期函数--监听页面显示
*/
onShow() { },
onShow() {},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() { },
onHide() {},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() { },
onUnload() {},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() { },
onPullDownRefresh() {},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() { },
onReachBottom() {},
/**
* 用户点击右上角分享
*/
onShareAppMessage() { }
onShareAppMessage() {}
})
......@@ -2,25 +2,44 @@
<wxs src="../../index.wxs" module="filter" />
<weekCalendar timeBean="{{ timeBean }}" bind:lastWeek="lastWeek" bind:nextWeek="nextWeek" bind:dayClick="dayClick"></weekCalendar>
<view class="textbox">
<view class="remark_box">
<view class="label">今日工作</view>
<!-- {{ filter.filterDisabled(role, orderObj.reportDate) ?'disabled':'' }} -->
<view class="textArea_box ">
<textarea disabled="{{ filter.filterDisabled(role, orderObj.reportDate)}}" value="{{ orderObj.todayWorkContent }}" maxlength="200" placeholder="请输入" class="textarea" data-name="todayWorkContent" bindinput="remarkInput" />
<!-- -->
<view class="currentWordNumber">{{todayWorkContent || 0}} / 200</view>
</view>
</view>
<view class="remark_box">
<view class="label">明日计划</view>
<!-- {{ filter.filterDisabled(role, weeklyList, orderObj.reportDate, isEditReport) || role != 'staff' ?'disabled':'' }} -->
<!-- {{ filter.filterDisabled(role, orderObj.reportDate) ?'disabled':'' }} -->
<view class="textArea_box ">
<textarea disabled="{{ filter.filterDisabled(role, orderObj.reportDate)}}" value="{{ orderObj.tomorrowPlanContent }}" maxlength="200" placeholder="请输入" class="textarea" data-name="tomorrowPlanContent" bindinput="remarkInput" />
<!-- disabled="{{ filter.filterDisabled(role, weeklyList, orderObj.reportDate, isEditReport) || role != 'staff' }}" -->
<view class="currentWordNumber">{{tomorrowPlanContent || 0}} / 200</view>
</view>
</view>
<view class="remark_box">
<view class="label">今日工作</view>
<!-- {{ filter.filterDisabled(role, orderObj.reportDate) ?'disabled':'' }} -->
<view class="textArea_box">
<textarea
disabled="{{ filter.filterDisabled(role, orderObj.reportDate) }}"
value="{{ orderObj.todayWorkContent }}"
maxlength="200"
placeholder="请输入"
class="textarea"
data-name="todayWorkContent"
bindinput="remarkInput"
/>
<!-- -->
<view class="currentWordNumber">{{todayWorkContent || 0}} / 200</view>
</view>
</view>
<view class="remark_box">
<view class="label">明日计划</view>
<!-- {{ filter.filterDisabled(role, weeklyList, orderObj.reportDate, isEditReport) || role != 'staff' ?'disabled':'' }} -->
<!-- {{ filter.filterDisabled(role, orderObj.reportDate) ?'disabled':'' }} -->
<view class="textArea_box">
<textarea
disabled="{{ filter.filterDisabled(role, orderObj.reportDate) }}"
value="{{ orderObj.tomorrowPlanContent }}"
maxlength="200"
placeholder="请输入"
class="textarea"
data-name="tomorrowPlanContent"
bindinput="remarkInput"
/>
<!-- disabled="{{ filter.filterDisabled(role, weeklyList, orderObj.reportDate, isEditReport) || role != 'staff' }}" -->
<view class="currentWordNumber">{{tomorrowPlanContent || 0}} / 200</view>
</view>
</view>
</view>
<!-- wx:if="{{ !filter.filterDisabled(role, orderObj.reportDate)}}" -->
<view class="confirm text-center {{ filter.filterDisabled(role, orderObj.reportDate)?'disabled':''}}" bindtap="handleConfirm">提交</view>
\ No newline at end of file
<view
class="confirm text-center {{ filter.filterDisabled(role, orderObj.reportDate)||hasDailyValue?'disabled':'' }}"
bindtap="handleConfirm"
>提交</view>
\ No newline at end of file
// packageTool/pages/salesReport/salesReport.js
var util = require('~/utils/timeFormat/time-utils.js')
import { getUserInfo } from '~/utils/cache/userInfo'
import api from '../../api.js'
// import api from '../../api.js'
import dailyReportApi from '~/api/dailyReportApi/index'
Page({
/**
* 页面的初始数据
*/
data: {
table: [],
currentMonth: '',
timeBean: {}, //timeBean 传递给组件的数据,数据的格式在一开始的工具类中明确
selectWeek: 0 //0代表的本周 1代表下一周 -1代表上一周
},
getList() {
let { currentMonth } = this.data
api.dailyReportSelect({ reportMonth: currentMonth }).then((result) => {
console.log(result)
}).catch((err) => {
});
dailyReportApi
.staffDailyReportManagerViewSelect({ reportMonth: currentMonth })
.then(result => {
console.log(result)
this.setData({
table: result
})
})
.catch(err => {})
},
handleMonthChange: function (e) {
this.setData({
currentMonth: e.detail.month
});
})
},
toDetail(e) {
let { item } = e.currentTarget.dataset
......@@ -121,48 +126,48 @@ Page({
* 生命周期函数--监听页面加载
*/
onLoad(options) {
const now = new Date();
const year = now.getFullYear();
const month = now.getMonth() + 1; // 月份从0开始
const now = new Date()
const year = now.getFullYear()
const month = now.getMonth() + 1 // 月份从0开始
this.setData({
currentMonth: `${year}-${month < 10 ? '0' + month : month}`,
userInfo: getUserInfo()
});
})
this.initData()
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() { },
onReady() {},
/**
* 生命周期函数--监听页面显示
*/
onShow() { },
onShow() {},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() { },
onHide() {},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() { },
onUnload() {},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() { },
onPullDownRefresh() {},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() { },
onReachBottom() {},
/**
* 用户点击右上角分享
*/
onShareAppMessage() { }
onShareAppMessage() {}
})
......@@ -89,6 +89,10 @@ Page {
font-size: 32rpx;
font-family: numberNor;
}
.danger {
color: #F24724;
}
}
margin-bottom: 100rpx;
......
......@@ -2,7 +2,7 @@
<!-- <view style="margin-top:{{ navBarHeight }}px"> -->
<view class="main">
<!-- <weekCalendar timeBean="{{ timeBean }}" bind:lastWeek="lastWeek" bind:nextWeek="nextWeek" bind:dayClick="dayClick"></weekCalendar> -->
<month-switcher bind:monthChange="handleMonthChange" currentMonth="{{currentMonth}}"></month-switcher>
<month-switcher bind:monthChange="handleMonthChange" currentMonth="{{ currentMonth }}"></month-switcher>
<view class="staffBox">
<view class="title">
<view class="name">销售名称</view>
......@@ -10,14 +10,14 @@
<view class="num">未填日报</view>
<view class="num">应填日报</view>
</view>
<view class="listItem" wx:for="{{ 30 }}" bind:tap="toDetail" data-item="{{ item }}" wx:key="index">
<view class="listItem" wx:for="{{ table }}" bind:tap="toDetail" data-item="{{ item }}" wx:key="index">
<view class="name">
<view class="text-hide">迪丽热巴·迪力木拉提</view>
<view class="area">东北大区-经理</view>
<view class="text-hide">{{item.staffName}}</view>
<view class="area" wx:if="{{ userInfo.loginRole == 1 }}">{{item.regionName}}</view>
</view>
<view class="num">{{index}}</view>
<view class="num">0</view>
<view class="num">0</view>
<view class="num">{{item.filledReportNum}}</view>
<view class="num {{ item.notFilledReportNum > 0?'danger':'' }}">{{item.notFilledReportNum}}</view>
<view class="num">{{ item.shouldFilledReportNum }}</view>
</view>
</view>
</view>
......
......@@ -33,16 +33,21 @@ Component({
tableObj: [
{
name: '拓店数',
name: '已完成',
key: 'completed',
width: 'var(--fontSize134)'
},
{
name: '已签约数量',
name: '当月目标',
key: 'target',
width: 'var(--fontSize134)'
},
{ name: '跟进中', key: 'completionRate', width: 'var(--fontSize84)' }
{
name: '完成率',
key: 'completionRate',
width: 'var(--fontSize84)',
unit: '%'
}
],
headerConfig: {
name: '门店名称',
......
const ISCOMMECTED = Symbol('ISCOMMECTED')
class NetWork {
[ISCOMMECTED] = false;
[ISCOMMECTED] = false
constructor() {
this.onNetworkStatusChange()
}
/**监听网络变化 */
onNetworkStatusChange() {
wx.onNetworkStatusChange(({
isConnected,
networkType
}) => {
wx.onNetworkStatusChange(({ isConnected, networkType }) => {
if (!isConnected && !this[ISCOMMECTED]) {
this[ISCOMMECTED] = true
wx.showToast({
......@@ -21,7 +18,7 @@ class NetWork {
})
} else {
if (this[ISCOMMECTED]) {
const thisPage = wx.$router.getPageInstance(),
let thisPage = wx.$router.getPageInstance(),
options = Object.keys(thisPage.options)
this[ISCOMMECTED] = false
wx.showLoading()
......@@ -50,9 +47,7 @@ class NetWork {
const that = this
return new Promise((resolve, reject) => {
wx.getNetworkType({
success({
networkType
}) {
success({ networkType }) {
that[ISCOMMECTED] = networkType == 'none'
resolve(networkType)
},
......@@ -78,16 +73,11 @@ class NetWork {
refreshPage() {
wx.hideLoading()
wx.showNavigationBarLoading()
const thisPage = wx.$router.getPageInstance(),
{
onLoad,
onShow,
onRoute,
options
} = thisPage
let thisPage = wx.$router.getPageInstance(),
{ onLoad, onShow, onRoute, options } = thisPage
if (onLoad) thisPage.onLoad(options, true)
if (onShow) thisPage.onShow(options, true)
if (onRoute) thisPage.onRoute(options, true)
}
}
export default new NetWork()
\ No newline at end of file
export default new NetWork()
......@@ -21,7 +21,7 @@ const h5Obj = {
2测试
3生产
*/
const index = 1
const index = 0
const accountInfo = wx.getAccountInfoSync()
const systemInfo = wx.getSystemInfoSync()
// console.log(systemInfo);
......@@ -116,7 +116,8 @@ const djSecretKey = {
const domain = {
ip: {
// dj: 'http://192.168.1.165:8292',
dj: 'http://192.168.1.150:8293',
// dj: 'http://192.168.1.150:8293',
dj: 'http://192.168.1.76:8293', //璐琦
scrm: 'https://scrm.dev.glsx.com.cn',
merchant: 'http://192.168.1.144:8091'
// dj: 'http://192.168.3.189:8385',
......
......@@ -58,7 +58,7 @@ class Request {
if (code == 20 || code == 21) {
wx.$storage.rm('sessionId')
wx.$storage.rm('userInfo')
const thisPage = wx.$router.getPageInstance(),
let thisPage = wx.$router.getPageInstance(),
autoLoginObject = wx.$storage.get('auto_login_object')
if (thisPage.route == 'login/loading/loading') {
resolve(data)
......
......@@ -23,7 +23,9 @@ class Share {
let _this = this
Page = function (el) {
try {
el || (el = {}), _this.pageLeaveProxy(el), thisPage.apply(this, arguments)
el || (el = {}),
_this.pageLeaveProxy(el),
thisPage.apply(this, arguments)
} catch (el) {
thisPage.apply(this, arguments)
}
......@@ -37,13 +39,22 @@ class Share {
if (page.onShareAppMessage) {
const that = this
page.onShareAppMessage = function () {
let { shareTitle, sharePath, shareImage, shareQuery, noPageAuth, shareFun, shareTrackData } = this,
let {
shareTitle,
sharePath,
shareImage,
shareQuery,
noPageAuth,
shareFun,
shareTrackData
} = this,
path = `/${this.route}`
if (sharePath) path = `/${sharePath}`
path += that.setCommonShareQuery()
if (shareQuery) path += `&${shareQuery}`
console.log('===============', path)
if (!noPageAuth) path = `/login/loading/loading?url=${encodeURIComponent(path)}`
if (!noPageAuth)
path = `/login/loading/loading?url=${encodeURIComponent(path)}`
if (shareFun) shareFun()
if (shareTrackData) that.reportShareData(shareTrackData)
return {
......@@ -55,7 +66,8 @@ class Share {
}
if (page.onShareTimeline) {
page.onShareTimeline = function () {
let { shareTitle, shareImage, shareQuery, shareFun, shareTrackData } = this
let { shareTitle, shareImage, shareQuery, shareFun, shareTrackData } =
this
if (shareFun) shareFun()
if (shareTrackData) that.reportShareData(shareTrackData)
shareQuery = that.setCommonShareQuery(shareQuery)
......@@ -88,7 +100,7 @@ class Share {
}
}
}
getCommonData() {
getCommonData() {
const WXUSERINFO = wx.$storage.get('wx_user_info'), //针对没登录用户,有openid
USERINFO = wx.$storage.get('userInfo') //这个是针对登录的
return {
......@@ -97,23 +109,27 @@ class Share {
}
}
setCommonShareQuery(query) {
const { WXUSERINFO, USERINFO } = this.getCommonData(),
let { WXUSERINFO, USERINFO } = this.getCommonData(),
thisPage = wx.$router.getPageInstance().options
query = `${query ? `?${query}&` : '?'}merchantId=${thisPage.merchantId || USERINFO.merchantId || ''}&shareOpenId=${thisPage.shareOpenId || WXUSERINFO.openId || ''}&sharePhone=${thisPage.sharePhone || USERINFO.phone || ''}`
query = `${query ? `?${query}&` : '?'}merchantId=${
thisPage.merchantId || USERINFO.merchantId || ''
}&shareOpenId=${
thisPage.shareOpenId || WXUSERINFO.openId || ''
}&sharePhone=${thisPage.sharePhone || USERINFO.phone || ''}`
return query
}
reportShareData(shareTrackData) {
const { WXUSERINFO, USERINFO } = this.getCommonData(),
let { WXUSERINFO, USERINFO } = this.getCommonData(),
thisPage = wx.$router.getPageInstance().options
reportData({
openId: WXUSERINFO.openId || '',
unionId: WXUSERINFO.unionId || '',
nickName: WXUSERINFO.nickName || '',
avatar: WXUSERINFO.avatarUrl || '',
phone: WXUSERINFO.phone || '', //浏览用户授权的手机号
phone: WXUSERINFO.phone || '', //浏览用户授权的手机号
merchantId: thisPage.merchantId || USERINFO.merchantId || '',
shareOpenId: thisPage.shareOpenId || WXUSERINFO.openId || '',
sharePhone: thisPage.sharePhone || USERINFO.phone || '', //登陆人,服务商的手机号
sharePhone: thisPage.sharePhone || USERINFO.phone || '', //登陆人,服务商的手机号
...shareTrackData
})
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!