|
@@ -589,9 +589,6 @@ export default {
|
|
|
}
|
|
|
|
|
|
try {
|
|
|
- /**
|
|
|
- * @type {import('axios').AxiosResponse<ApiResponse<PageResult<OrderItemRecord>>>}
|
|
|
- */
|
|
|
const response = await getOrderItemList(1, 1000, { orderId })
|
|
|
|
|
|
// 验证响应数据结构
|
|
@@ -623,7 +620,8 @@ export default {
|
|
|
const taxAmountValidation = validateNumber(material.taxAmount)
|
|
|
const totalAmountValidation = validateNumber(material.totalAmount)
|
|
|
|
|
|
- return {
|
|
|
+ /** @type MaterialDetailRecord */
|
|
|
+ const detailData = {
|
|
|
...material,
|
|
|
dataSource: MaterialDetailDataSource.REMOTE,
|
|
|
isDeletable: false, // 远程加载的数据不可删除
|
|
@@ -636,9 +634,9 @@ export default {
|
|
|
// 确保必要的字段存在
|
|
|
itemCode: material.itemCode || '',
|
|
|
itemName: material.itemName || '',
|
|
|
- specs: material.specs || material.specification || '',
|
|
|
- unit: material.unit || ''
|
|
|
+ specs: material.specs || '',
|
|
|
}
|
|
|
+ return detailData;
|
|
|
} catch (itemError) {
|
|
|
console.error(`格式化物料明细第${index + 1}项失败:`, itemError)
|
|
|
// 返回默认的物料明细项,确保数据完整性
|
|
@@ -759,7 +757,7 @@ export default {
|
|
|
|
|
|
/**
|
|
|
* 保存成功事件
|
|
|
- * @event save-success
|
|
|
+ * @event typeof ORDER_FORM_EVENTS.SAVE_SUCCESS
|
|
|
* @param {Object} data - 保存后的订单数据
|
|
|
* @description 订单保存成功后触发,携带最新的订单数据
|
|
|
*/
|
|
@@ -781,7 +779,7 @@ export default {
|
|
|
* 提交订单数据到服务器
|
|
|
* @description 根据编辑模式调用相应的API接口,新建状态下使用createSalesOrder包含物料明细
|
|
|
* @param {OrderFormModel} submitData - 要提交的订单数据
|
|
|
- * @returns {Promise<import('axios').AxiosResponse<ApiResponse<import('@/api/types/order').OrderRecord>>>} API响应结果
|
|
|
+ * @returns {Promise<import("@/api/types/order").SalesOrderCreateResponse>} API响应结果
|
|
|
* @private
|
|
|
* @this {import('./types').OrderFormMixin}
|
|
|
*/
|