Commit f220eb46 by 李伟康

fix(CreateOrder): 修复订单相关字段处理的格式与逻辑问题

1.  修正代码缩进不一致的问题
2.  调整配送日期和客户标签的取值逻辑,支持从customer对象获取默认值
3.  修复字段判断时的空格格式问题
1 parent 477b86f4
...@@ -1105,15 +1105,15 @@ export default { ...@@ -1105,15 +1105,15 @@ export default {
// 场景名称:界面展示用 name;提交入参需要 code // 场景名称:界面展示用 name;提交入参需要 code
if (obj.baseSceneCodeValue) obj.baseSceneCode = obj.baseSceneCodeValue if (obj.baseSceneCodeValue) obj.baseSceneCode = obj.baseSceneCodeValue
delete obj.baseSceneCodeValue delete obj.baseSceneCodeValue
const otherCustomer = ['standNo', 'plateNumber', 'customerSex', 'experienceFlag', 'salesType','actualDeliveryDate','customerTags'] const otherCustomer = ['standNo', 'plateNumber', 'customerSex', 'experienceFlag', 'salesType', 'actualDeliveryDate', 'customerTags']
obj.customer = { obj.customer = {
...obj.customer, ...obj.customer,
...otherCustomer.reduce((acc, key) => { ...otherCustomer.reduce((acc, key) => {
if (obj[key] !== undefined) { if (obj[key] !== undefined) {
if(key == 'customerTags'){ if (key == 'customerTags') {
obj[key] = obj[key].join(',') obj[key] = obj[key].join(',')
} }
if(key == 'actualDeliveryDate'){ if (key == 'actualDeliveryDate') {
obj[key] += ' 00:00:00' obj[key] += ' 00:00:00'
} }
acc[key] = obj[key] acc[key] = obj[key]
...@@ -1981,11 +1981,12 @@ export default { ...@@ -1981,11 +1981,12 @@ export default {
this.orderObj.orderTypeCode = '1' this.orderObj.orderTypeCode = '1'
this.orderObj.djOrderType = orderTypeMap['1'] || '正常订单' this.orderObj.djOrderType = orderTypeMap['1'] || '正常订单'
} }
let actualDeliveryDate = rest.actualDeliveryDate || customer.actualDeliveryDate,
customerTags = rest.customerTags || customer.customerTags
if (actualDeliveryDate) this.orderObj.actualDeliveryDate = dayjs(actualDeliveryDate).format('YYYY-MM-DD')
if (customerTags && typeof customerTags === 'string') this.orderObj.customerTags = customerTags.split(',')
if(rest.actualDeliveryDate) this.orderObj.actualDeliveryDate = dayjs(rest.actualDeliveryDate).format('YYYY-MM-DD')
if(rest.customerTags && typeof rest.customerTags === 'string') this.orderObj.customerTags = rest.customerTags.split(',')
this.orderObj.payeeType = rest.selectPayType == '2' ? '1' : '0' this.orderObj.payeeType = rest.selectPayType == '2' ? '1' : '0'
const customerFields = ['customerName', 'customerSex', 'customerPhone', 'salesType', 'standNo', 'plateNumber', 'experienceFlag'] const customerFields = ['customerName', 'customerSex', 'customerPhone', 'salesType', 'standNo', 'plateNumber', 'experienceFlag']
Object.assign(this.orderObj, Object.fromEntries(customerFields.map(field => [field, customer[field]]))) Object.assign(this.orderObj, Object.fromEntries(customerFields.map(field => [field, customer[field]])))
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!