Commit 4e13bae0 by Lin

feat: 优化新建工单回填备注业务

1 parent 1d06801d
......@@ -739,4 +739,13 @@ module.exports = {
...data
})
},
updateGoodsOrderRemark(data = {}) {
return http.post({
method: 'dj.api.smartcarlife.goodsOrder.remark',
projectName: 'pad',
...data
})
},
}
......@@ -661,7 +661,10 @@ export default {
// 根据popupTypeEnum优化处理
const _typeValue = this.popupTypeEnum[popupTypeNum]
if (val.popupType == 19) return this.setCustomerInfo(chooseContent)
if (val.popupType == 19) {
console.log('客户档案选中数据:', chooseContent)
return this.setCustomerInfo(chooseContent)
}
// 安全检查:如果_typeValue不存在,直接返回并关闭弹窗
if (!_typeValue || !_typeValue.key) {
......@@ -1994,6 +1997,18 @@ export default {
}
return subOrderList
},
async fetchGoodsOrderRemark(customerId) {
console.log('获取订单备注***', customerId)
if (!customerId) return
try {
const res = await uni.$api.commonApi.updateGoodsOrderRemark({ id:customerId })
console.log('获取订单备注***', res)
const remark = res?.remark || ''
this.$set(this.orderObj, 'remark', remark)
} catch (e) {
console.error('获取订单备注失败', e)
}
},
async setCustomerInfo(customerInfo) {
const productFields = ['frontGear', 'frontWindow', 'rearGear', 'rearWindow', 'sunRoof', 'package', 'skuGoods']
productFields.forEach(field => {
......@@ -2004,6 +2019,11 @@ export default {
this.orderObj.customerId = customerInfo.id
this.subOrderList = this.prepareSubOrderListFromOrder(customerInfo)
const customerId = customerInfo.customer?.customerId
if (customerId) {
await this.fetchGoodsOrderRemark(customerId)
}
this.updateSceneGate()
const echoedSelectPayType = this.orderObj.selectPayType
const echoedPayeeType = this.orderObj.payeeType
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!