Commit f220eb46 by 李伟康

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

1.  修正代码缩进不一致的问题
2.  调整配送日期和客户标签的取值逻辑,支持从customer对象获取默认值
3.  修复字段判断时的空格格式问题
1 parent 477b86f4
......@@ -174,7 +174,7 @@ export default {
},
'orderObj.salesType': {
handler(newVal) {
const selected = Boolean(this.orderObj && (this.orderObj.baseSceneCodeValue || this.orderObj.baseSceneCode))
const selected = Boolean(this.orderObj && (this.orderObj.baseSceneCodeValue || this.orderObj.baseSceneCode))
let formList = this.formList
let { isHarmony } = this
formList.map(item => {
......@@ -1105,15 +1105,15 @@ export default {
// 场景名称:界面展示用 name;提交入参需要 code
if (obj.baseSceneCodeValue) obj.baseSceneCode = 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,
...otherCustomer.reduce((acc, key) => {
if (obj[key] !== undefined) {
if(key == 'customerTags'){
if (key == 'customerTags') {
obj[key] = obj[key].join(',')
}
if(key == 'actualDeliveryDate'){
if (key == 'actualDeliveryDate') {
obj[key] += ' 00:00:00'
}
acc[key] = obj[key]
......@@ -1981,11 +1981,12 @@ export default {
this.orderObj.orderTypeCode = '1'
this.orderObj.djOrderType = orderTypeMap['1'] || '正常订单'
}
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(',')
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(',')
this.orderObj.payeeType = rest.selectPayType == '2' ? '1' : '0'
const customerFields = ['customerName', 'customerSex', 'customerPhone', 'salesType', 'standNo', 'plateNumber', 'experienceFlag']
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!