Commit 2b53f22a by 张立顺

feat 功能开发

1 parent 69dab665
......@@ -327,5 +327,9 @@ module.exports = {
// 退款审批列表查询
getRefundReviewListAPI(data) {
return api.post('dj.api.smartcarlife.refundApplyRecord.waitForAudit.list', data)
},
// 日报填报前参数校验
dailyReportCheck(data) {
return api.post('dj.api.smartcarlife.staff.daily.report.data.check', data)
}
}
......@@ -298,9 +298,18 @@ Page({
max: 100,
inputPlaceholder: ''
},
// {
// label: '店端总未触客数',
// key: 'notDeliveryCount',
// type: 'number',
// required: true,
// min: 0,
// max: 100,
// inputPlaceholder: ''
// },
{
label: '店端总未触客数',
key: 'notDeliveryCount',
label: '实际售前触客数',
key: 'equityToShopCount',
type: 'number',
required: true,
min: 0,
......@@ -308,24 +317,42 @@ Page({
inputPlaceholder: ''
},
{
label: '实际售前触客数',
key: 'equityToShopCount',
label: '实际售后触客数',
key: 'afterSaleEquityToShopCount',
type: 'number',
required: true,
required: false,
min: 0,
max: 100,
inputPlaceholder: ''
},
{
label: '实际售后触客数',
key: 'afterSaleEquityToShopCount',
label: '今日店端实际发券数',
key: 'issueCouponCount',
type: 'number',
required: false,
required: true,
min: 0,
max: 100,
inputPlaceholder: ''
},
{
label: '本月待邀约',
key: 'waitInviteCount',
type: 'number',
required: true,
min: 0,
max: 1000,
inputPlaceholder: ''
},
{
label: '本月流失',
key: 'customerLossCount',
type: 'number',
required: true,
min: 0,
max: 1000,
inputPlaceholder: ''
},
{
name: 'person'
},
{
......@@ -339,40 +366,6 @@ Page({
disabled: true,
inputPlaceholder: '自动填入系统数据'
},
// {
// name: 'person'
// },
// {
// label: '北汽无忧成交数',
// key: 'bqWorryFreeCount',
// type: 'number',
// required: false,
// min: 0,
// max: 100,
// templateValue: 3,
// disabled: true,
// inputPlaceholder: '自动填入系统数据'
// },
// {
// label: '广爱无忧成交数',
// key: 'gaWorryFreeCount',
// type: 'number',
// required: false,
// min: 0,
// max: 100,
// disabled: true,
// templateValue: 3,
// inputPlaceholder: '自动填入系统数据'
// },
// {
// label: '未触客返店人数',
// key: 'notDeliveryReturnCount',
// type: 'number',
// required: false,
// min: 0,
// max: 100,
// inputPlaceholder: ''
// }
]
},
handleTemplagePickerChange(e) {
......@@ -520,7 +513,6 @@ Page({
],
sceneType: 1
}
// console.log(params, 'submitApproval');
wx.$util.showLoading()
api
.staffDailyReportApprove(params)
......@@ -574,25 +566,6 @@ Page({
(role != 'super' || !orderObj.isDateWithin60Days)
)
return wx.$util.showToast('已超过提交时效')
// for (let index = 0; index < carBandList.length; index++) {
// if (true) {
// }
// if (['', null].includes(carBandList[index].deliveryCount)) {
// return this.showToast(`请输入${carBandList[index].brandName}新车交付数`)
// }
// if (['', null].includes(carBandList[index].equityToShopCount)) {
// return this.showToast(
// `请输入${carBandList[index].brandName}新车到店流量`
// )
// }
// if (['', null].includes(carBandList[index].afterSaleEquityToShopCount)) {
// return this.showToast(
// `请输入${carBandList[index].brandName}售后到店流量`
// )
// }
// }
let checkFlag = false
carBandList.forEach(item => {
if (orderObj.onBreak == 'N') {
......@@ -611,8 +584,12 @@ Page({
}
return el
})
// debugger
otherObjArray = otherObjArray.map(el => {
console.log(el.required, ['', null].includes(item[el.key]));
console.log(el.key, item[el.key]);
if (el.required && ['', null].includes(item[el.key])) {
console.log(el, 'otherObjArray');
el.error = true
checkFlag = true
}
......@@ -649,6 +626,10 @@ Page({
}
// orderObj.reportType = reportType
// console.log(orderObj, 'orderObj')
// 非调休 日报填报前参数校验
let check = this.dailyReportCheck(orderObj)
if (check) return false;
wx.$util.showLoading()
api
.staffDailyReportSave(orderObj)
......@@ -751,6 +732,57 @@ Page({
})
}
},
async dailyReportCheck(params) {
console.log(params, 'params');
let { carBandList } = this.data
// let result = await api.dailyReportCheck({ brandDataList: params.brandDataList })
let result = {
code: 0,
data: {
list: [
{
brandType: 0,
isCheckPass: true
},
{
brandType: 1,
isCheckPass: true
},
]
}
}
let { code, data } = result
if (code == 0) {
let showModal = false
data.list.forEach(item => {
if (item.isCheckPass) {
showModal = true
carBandList.forEach(el => {
if (el.brandType == item.brandType) {
el.equityToShopCountinputError = true
el.notDeliveryCountinputError = true
}
})
}
})
this.setData({
carBandList
})
if (showModal) {
wx.showModal({
title: '预警提示',
content: `店端总未触客数+门店售前触客数 与 当月实际交车数不符,请相关驻店销售对齐核销再次提交`,
showCancel: false,
confirmText: '知道了',
confirmColor: '#347BFF',
success(res) {
}
})
return true;
}
}
},
checkValue(e) {
let that = this
let { value } = e.detail
......@@ -766,7 +798,7 @@ Page({
} = this.data
//
if (
['staffCount', 'deliveryCount', 'notDeliveryCount'].includes(name) &&
['staffCount', 'deliveryCount', 'notDeliveryCount', 'equityToShopCount'].includes(name) &&
orderObj.onBreak == 'N'
) {
let checkName = `record${name}`
......
......@@ -82,7 +82,7 @@
</view>
</view>
</view>
<view class="box">
<view class="box" wx:if="{{item.firstBrandId != -1}}">
<block wx:for="{{ filter.filterTemplateList(hwOhterObjArray,orderObj.templateType) }}" wx:key="hw_index" wx:for-index="hw_index" wx:for-item="hw_item">
<view wx:if="{{ hw_item.name }}" class="presonBox">个人相关</view>
<view wx:else class="input-item">
......@@ -93,6 +93,21 @@
</view>
<view class="tips" wx:if="{{ hw_item.placeholder }}">{{hw_item.placeholder}}</view>
</view>
<input type="{{ hw_item.type||'number' }}" value="{{ item[hw_item.key] }}" data-index="{{ arr_index }}" data-hwohter-index="{{ hw_index }}" placeholder-style="{{ hw_item.error && orderObj.onBreak == 'N'? 'color: #F24724 ': 'color: #D0D2D6' }};" class="content-input {{ item[hw_item.key + 'inputError'] ?'inputerror':''}} {{ filter.filterDisabled(role, weeklyList, orderObj.reportDate, isEditReport) ? 'disabled' : '' }}" placeholder="{{ hw_item.error && orderObj.onBreak == 'N'? '必填不能为空': filter.filterDisabled(role, weeklyList, orderObj.reportDate, isEditReport) ? '': (hw_item.inputPlaceholder || '请输入') }}" bindinput="input" bindblur="checkValue" data-name="{{ hw_item.key }}" disabled="{{ filter.filterDisabled(role, weeklyList, orderObj.reportDate, isEditReport) ||hw_item.disabled }}" />
</view>
</block>
</view>
<view class="box" wx:if="{{item.firstBrandId == -1}}">
<block wx:for="{{ filter.filterTemplateList(otherObjArray,orderObj.templateType) }}" wx:key="hw_index" wx:for-index="hw_index" wx:for-item="hw_item">
<view wx:if="{{ hw_item.name }}" class="presonBox">个人相关</view>
<view wx:else class="input-item">
<view class="left">
<view class="label {{ filter.filterDisabled(role, weeklyList, orderObj.reportDate, isEditReport) ? 'disabled' : '' }}">
{{hw_item.label}}
<text class="required_text"> {{hw_item.required && orderObj.onBreak == 'N' ? '*' :''}}</text>
</view>
<view class="tips" wx:if="{{ hw_item.placeholder }}">{{hw_item.placeholder}}</view>
</view>
<input type="{{ hw_item.type||'number' }}" value="{{ item[hw_item.key] }}" data-index="{{ arr_index }}" data-hwohter-index="{{ hw_index }}" placeholder-style="{{ hw_item.error && orderObj.onBreak == 'N'? 'color: #F24724 ': 'color: #D0D2D6' }};" class="content-input {{ item[hw_item.key + 'inputError'] ?'inputerror':''}} {{ filter.filterDisabled(role, weeklyList, orderObj.reportDate, isEditReport) ? 'disabled' : '' }}" placeholder="{{ hw_item.error && orderObj.onBreak == 'N'? '必填不能为空': filter.filterDisabled(role, weeklyList, orderObj.reportDate, isEditReport) ? '': (hw_item.inputPlaceholder || '请输入') }}" bindinput="input" bindblur="checkValue" data-name="{{ hw_item.key }}" disabled="{{ filter.filterDisabled(role, weeklyList, orderObj.reportDate, isEditReport) ||hw_item.disabled }}" />
</view>
</block>
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!