This commit is contained in:
@@ -83,6 +83,11 @@
|
||||
formatter: (_, data) =>
|
||||
data.flow_type_name || (flowType === 'direct' ? '直接换货' : '物流换货')
|
||||
},
|
||||
{
|
||||
label: '提交人',
|
||||
formatter: (value) => value || '--',
|
||||
prop: 'submitter_name'
|
||||
},
|
||||
{
|
||||
label: '换货原因',
|
||||
prop: 'exchange_reason',
|
||||
|
||||
@@ -380,7 +380,13 @@
|
||||
import { h } from 'vue'
|
||||
import { useRouter } from 'vue-router'
|
||||
import { ExchangeService, CardService, DeviceService } from '@/api/modules'
|
||||
import type { ExchangeResponse } from '@/api/modules/exchange'
|
||||
import type {
|
||||
CreateExchangeRequest,
|
||||
ExchangeAssetType,
|
||||
ExchangeFlowType,
|
||||
ExchangeQueryParams,
|
||||
ExchangeResponse
|
||||
} from '@/api/modules/exchange'
|
||||
import type { StandaloneIotCard, Device } from '@/types/api'
|
||||
import { ElMessage, ElTag, ElButton, ElMessageBox, ElSwitch } from 'element-plus'
|
||||
import type { FormInstance, FormRules } from 'element-plus'
|
||||
@@ -422,7 +428,7 @@
|
||||
]
|
||||
|
||||
// 搜索表单
|
||||
const searchForm = reactive({
|
||||
const searchForm = reactive<ExchangeQueryParams & { created_at_range: string[] }>({
|
||||
status: undefined,
|
||||
flow_type: undefined, // 流程类型筛选
|
||||
old_asset_keyword: '',
|
||||
@@ -433,7 +439,16 @@
|
||||
})
|
||||
|
||||
// 创建换货单表单
|
||||
const createForm = reactive({
|
||||
const createForm = reactive<{
|
||||
exchange_reason: string
|
||||
exchange_reason_other: string
|
||||
old_asset_type: ExchangeAssetType | ''
|
||||
old_identifier: string
|
||||
flow_type: ExchangeFlowType
|
||||
new_identifier: string
|
||||
migrate_data: boolean
|
||||
remark: string
|
||||
}>({
|
||||
exchange_reason: '',
|
||||
exchange_reason_other: '',
|
||||
old_asset_type: '',
|
||||
@@ -819,7 +834,7 @@
|
||||
loading.value = true
|
||||
try {
|
||||
// 过滤掉空值参数
|
||||
const params: any = {
|
||||
const params: ExchangeQueryParams = {
|
||||
page: pagination.page,
|
||||
page_size: pagination.page_size
|
||||
}
|
||||
@@ -1328,9 +1343,9 @@
|
||||
? createForm.exchange_reason_other.trim()
|
||||
: createForm.exchange_reason
|
||||
|
||||
const requestData: any = {
|
||||
const requestData: CreateExchangeRequest = {
|
||||
exchange_reason: exchangeReason,
|
||||
old_asset_type: createForm.old_asset_type,
|
||||
old_asset_type: createForm.old_asset_type as ExchangeAssetType,
|
||||
old_identifier: createForm.old_identifier,
|
||||
flow_type: createForm.flow_type,
|
||||
remark: createForm.remark || undefined
|
||||
@@ -1351,7 +1366,7 @@
|
||||
}
|
||||
|
||||
ElMessage.error(res.msg || '换货单创建失败')
|
||||
} catch (error: any) {
|
||||
} catch (error) {
|
||||
console.error('创建换货单失败:', error)
|
||||
} finally {
|
||||
createLoading.value = false
|
||||
|
||||
Reference in New Issue
Block a user