Commit e488f0f3 by cen

Merge branch 'V4.56.0' of http://192.168.3.233:8090/glsx/gl_tape into V4.56.0

2 parents 50adf434 7d34c712
...@@ -497,14 +497,36 @@ export default { ...@@ -497,14 +497,36 @@ export default {
handleBlur (e, i) { handleBlur (e, i) {
let { value } = e.detail let { value } = e.detail
if (value) { if (value) {
let { orderObj, userInfo } = this
let key = i.value, let key = i.value,
numbers = value.match(/\d+/g) numbers = value.match(/\d+/g)
numbers = numbers ? numbers.join('') : '' numbers = numbers ? numbers.join('') : ''
if (numbers.length > 1) numbers = numbers.replace(/^0+/, '') if (numbers.length > 1) numbers = numbers.replace(/^0+/, '')
this.orderObj[key] = Math.min(Math.max(Number(numbers), 0), 100).toString() this.orderObj[key] = Math.min(Math.max(Number(numbers), 0), 100).toString()
this.dateKey = Date.now() this.dateKey = Date.now()
if (
this.isNotEmpty(orderObj.recordStaffCount) &&
this.isNotEmpty(value) &&
orderObj.recordStaffCount != value &&
orderObj.lastStaffUuid &&
userInfo.uuid != orderObj.lastStaffUuid
) uni.showModal({
title: '预警提示',
content: `今日驻店人数与 ${orderObj.lastStaffName} 提交不一致,再次确认!不一致提交日报时,今日驻店人数将被清空。`,
showCancel: false,
confirmText: '知道了',
confirmColor: '#347BFF'
})
} }
}, },
isNotEmpty (value) {
return (
value !== null &&
value !== undefined &&
value !== '' &&
!(Array.isArray(value) && value.length === 0)
)
},
handleCarInputBlur (e, i, item) { handleCarInputBlur (e, i, item) {
let { value } = e.detail let { value } = e.detail
if (value) { if (value) {
...@@ -522,29 +544,31 @@ export default { ...@@ -522,29 +544,31 @@ export default {
mask: true mask: true
}) })
try { try {
let { orderObj, carBandList } = this let { orderObj, carBandList, hwOhterObjArray } = this
orderObj.isAdmin = false orderObj.isAdmin = false
orderObj.oprBy = orderObj.staffUuid orderObj.oprBy = orderObj.staffUuid
orderObj.sceneType = 1 orderObj.sceneType = 1
orderObj.brandDataList = carBandList orderObj.brandDataList = carBandList
if (orderObj.onBreak == 'Y') {
orderObj.brandDataList.forEach(item => {
item.notDeliveryCount = item.notDeliveryCount || 0
item.equityToShopCount = item.equityToShopCount || 0
})
}
if (orderObj.pickerValue == 0) { if (orderObj.pickerValue == 0) {
if (orderObj.staffCount == null) throw { if (orderObj.staffCount == null) throw {
message: '今日驻店人数(按店)', message: '今日驻店人数(按店)',
refId: 'staffCount' refId: 'staffCount'
} }
orderObj.brandDataList.map((e, index) => { carBandList.map((item, index) => {
if (e.deliveryCount == null) throw { message: '店端实际交车数', refId: `deliveryCount_${index}` } hwOhterObjArray.map(el => {
if (!e.notDeliveryCount == null) throw { message: '店端总未触客数', refId: `notDeliveryCount_${index}` } if (el.required && ['', null].includes(item[el.key])) throw {
if (!e.equityToShopCount == null) throw { message: '实际售前触客数', refId: `equityToShopCount_${index}` } message: el.label,
refId: `${el.refId}_${index}`
}
})
})
}
if (orderObj.onBreak == 'Y') {
orderObj.brandDataList.forEach(item => {
item.notDeliveryCount = item.notDeliveryCount || 0
item.equityToShopCount = item.equityToShopCount || 0
}) })
} }
const data = await uni.$api.boutiqueApi.saveStaffDailyReport(orderObj) const data = await uni.$api.boutiqueApi.saveStaffDailyReport(orderObj)
uni.hideLoading() uni.hideLoading()
if (data) { if (data) {
...@@ -553,7 +577,6 @@ export default { ...@@ -553,7 +577,6 @@ export default {
} }
} catch (errorObj) { } catch (errorObj) {
uni.hideLoading() uni.hideLoading()
console.log(errorObj)
if (errorObj.message) { if (errorObj.message) {
uni.showToast({ uni.showToast({
title: `${errorObj.message}不能为空`, title: `${errorObj.message}不能为空`,
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!