Commit 0b7377bf by 李伟康

```

fix(OrderPopup): 更新客户选择逻辑以使用id字段替代customerPhone

- 将Customer.vue组件中使用的customerPhone字段替换为id字段,
  包括选中判断、数据初始化及事件触发部分
- 同步更新config.js中的idKey配置由'phone'改为'customerId'
- 调整CreateOrder.vue中customerId赋值逻辑,确保owner.id正确映射到orderObj.ownerId
- DailyReport.vue中增加deliveryCountRecord与notDeliveryCountRecord字段用于记录原始值
- 增加输入校验提示功能,当交付数量与记录不一致时弹出警告
```
1 parent b68ecd63
......@@ -54,10 +54,10 @@ export default {
this.updateParams(params, list || [])
},
initData (list) {
const { params: { idKey }, data } = this
const { params: { idKey }, data } = this
if (data[idKey]) {
this.currentId = data[idKey]
let item = list.find(i => i.customerPhone == this.currentId)
let item = list.find(i => i.id == this.currentId)
this.$emit('choose', item)
}
this.list = list
......@@ -68,12 +68,12 @@ export default {
this.getList(searchValue, true)
},
choose (i) {
this.currentId = i.customerPhone
this.currentId = i.id
this.$emit('choose', i)
},
checkActive (i) {
let { currentId, data, params } = this
return currentId ? i.customerPhone == currentId : i.customerPhone == data[params.idKey]
return currentId ? i.id == currentId : i.id == data[params.idKey]
}
}
}
......
......@@ -220,7 +220,7 @@ const componentConfig = {
loadComplete: false,
placeholder: '查找',
nullTips: '请选择客户',
idKey: 'phone',
idKey: 'customerId',
cacheData: [],
loadComplete: false,
searchValue: '',
......
......@@ -354,7 +354,7 @@ export default {
customerKeyList.map(key => {
if (owner[key] != null) orderObj[key] = owner[key]
})
if (owner.id) orderObj.customerId = owner.id
if (owner.id) orderObj.ownerId = owner.id
this.orderObj = orderObj
this.getConfig()
setTimeout(() => {
......@@ -712,7 +712,7 @@ export default {
customerKeyList.map(key => {
if (orderInfo[key] != null) params.owner[key] = orderInfo[key]
})
if (orderInfo.customerId) params.owner.id = orderInfo.customerId
if (orderInfo.ownerId) params.owner.id = orderInfo.ownerId
return params
},
// 乘以100保留两位小数点
......@@ -874,6 +874,7 @@ export default {
salesType = customerInfo.salesType || '0',
city = customerInfo.customerCity
Object.assign(orderObj, {
customerId: customerInfo.id,
owner: customerInfo.customerName,
phone: customerInfo.customerPhone,
ownerGender,
......
......@@ -388,7 +388,7 @@ export default {
},
infoObject () {
let { tabIndex, carBandList, orderObj: { templateType, totalOrderMoney } } = this,
{ brandType, firstBrandId } = carBandList[tabIndex],
{ brandType, firstBrandId } = carBandList[tabIndex],
/**模版为广联权益 */
TemplateType3 = templateType == 3,//
NotAitoAndTemplateType3 = brandType != 0 || TemplateType3, //非问界 或者 广联权益 时隐藏
......@@ -637,6 +637,8 @@ export default {
...carBand,
firstBrandId,
firstBrandName,
deliveryCountRecord: carBand.deliveryCount,
notDeliveryCountRecord: carBand.notDeliveryCount,
brandId,
brandName,
brandType,
......@@ -687,9 +689,9 @@ export default {
if (numbers.length > 1) numbers = numbers.replace(/^0+/, '')
this.orderObj[key] = Math.min(Math.max(Number(numbers), 0), 100).toString()
this.dateKey[key] = Date.now()
console.log(key)
if (
this.isNotEmpty(orderObj.recordStaffCount) &&
this.isNotEmpty(value) &&
orderObj.recordStaffCount != value &&
orderObj.lastStaffUuid &&
userInfo.uuid != orderObj.lastStaffUuid
......@@ -718,6 +720,11 @@ export default {
)
},
handleCarInputBlur (e, i, item, index) {
const { orderObj,
userInfo,
carBandList
} = this
console.log(carBandList,'===')
let { value } = e.detail
if (value) {
let { key, max } = i,
......@@ -726,6 +733,31 @@ export default {
if (numbers.length > 1) numbers = numbers.replace(/^0+/, '')
item[key] = Math.min(Math.max(Number(numbers), 0), max).toString()
this.dateKey[`${key}_${index}`] = Date.now()
if (['deliveryCount', 'notDeliveryCount'].includes(key) && orderObj.onBreak == 'N') {
let checkName = `${key}Record`,
checkValue = carBandList[index][checkName]
if (
this.isNotEmpty(item[key]) &&
this.isNotEmpty(carBandList[index][checkName]) &&
checkValue != value &&
orderObj.lastStaffUuid &&
userInfo.uuid != orderObj.lastStaffUuid) {
let context = i.label
this.noticeObj = {
title: '重要提示',
text: `${context}与 ${orderObj.lastStaffName} 提交不一致,再次确认!不一致提交日报时,${context}将被清空。`,
type: 'warning',
buttons: [
{
text: '确定',
type: 'primary',
}
]
}
this.$nextTick(() => this.$refs.reportNotice.open())
}
}
console.log(key)
}
},
async submit () {
......@@ -842,7 +874,7 @@ export default {
showModal = true
carBandList.forEach(el => {
if (el.brandType == item.brandType) {
context += `【${item.brandName}】 店端总未触客数+门店售前触客数与当月实际交车数不符,差异值${item.differenceValue
context += `【${item.tabName}】 店端总未触客数+门店售前触客数与当月实际交车数不符,差异值${item.differenceValue
},请相关驻店销售对齐核销再次提交\t\n`
}
})
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!