feat: 换货新旧资产展示与独立搜索
All checks were successful
构建并部署前端到测试环境 / build-and-deploy (push) Successful in 4m34s
All checks were successful
构建并部署前端到测试环境 / build-and-deploy (push) Successful in 4m34s
This commit is contained in:
@@ -423,7 +423,8 @@
|
||||
const searchForm = reactive({
|
||||
status: undefined,
|
||||
flow_type: undefined, // 流程类型筛选
|
||||
identifier: '',
|
||||
old_asset_keyword: '',
|
||||
new_asset_keyword: '',
|
||||
created_at_range: [],
|
||||
created_at_start: '',
|
||||
created_at_end: ''
|
||||
@@ -626,11 +627,20 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
label: '资产标识符',
|
||||
prop: 'identifier',
|
||||
label: '旧资产',
|
||||
prop: 'old_asset_keyword',
|
||||
type: 'input',
|
||||
config: {
|
||||
placeholder: '请输入资产标识符',
|
||||
placeholder: '请输入旧资产标识',
|
||||
clearable: true
|
||||
}
|
||||
},
|
||||
{
|
||||
label: '新资产',
|
||||
prop: 'new_asset_keyword',
|
||||
type: 'input',
|
||||
config: {
|
||||
placeholder: '请输入新资产标识',
|
||||
clearable: true
|
||||
}
|
||||
},
|
||||
@@ -682,18 +692,25 @@
|
||||
prop: 'old_asset_type',
|
||||
label: '旧资产类型',
|
||||
width: 120,
|
||||
formatter: (row: any) => (row.old_asset_type === 'iot_card' ? 'IoT卡' : '设备')
|
||||
formatter: (row: ExchangeResponse) => getAssetTypeName(row.old_asset_type)
|
||||
},
|
||||
{
|
||||
prop: 'old_asset_identifier',
|
||||
label: '旧资产标识符',
|
||||
width: 220
|
||||
width: 220,
|
||||
formatter: (row: ExchangeResponse) => row.old_asset_identifier || '--'
|
||||
},
|
||||
{
|
||||
prop: 'new_asset_type',
|
||||
label: '新资产类型',
|
||||
width: 120,
|
||||
formatter: (row: ExchangeResponse) => getAssetTypeName(row.new_asset_type)
|
||||
},
|
||||
{
|
||||
prop: 'new_asset_identifier',
|
||||
label: '新资产标识符',
|
||||
width: 220,
|
||||
formatter: (row: any) => row.new_asset_identifier || '--'
|
||||
formatter: (row: ExchangeResponse) => row.new_asset_identifier || '--'
|
||||
},
|
||||
{
|
||||
prop: 'recipient_name',
|
||||
@@ -734,7 +751,8 @@
|
||||
prop: 'status',
|
||||
label: '状态',
|
||||
width: 130,
|
||||
formatter: (row: any) => h(ElTag, { type: getStatusType(row.status) }, () => row.status_text)
|
||||
formatter: (row: ExchangeResponse) =>
|
||||
h(ElTag, { type: getStatusType(row.status) }, () => row.status_name || '--')
|
||||
},
|
||||
{
|
||||
prop: 'created_at',
|
||||
@@ -755,6 +773,12 @@
|
||||
return types[status] || 'info'
|
||||
}
|
||||
|
||||
const getAssetTypeName = (assetType?: string | null) => {
|
||||
if (assetType === 'iot_card') return '物联网卡'
|
||||
if (assetType === 'device') return '设备'
|
||||
return '--'
|
||||
}
|
||||
|
||||
// 加载换货单列表
|
||||
const loadExchangeList = async () => {
|
||||
loading.value = true
|
||||
@@ -771,8 +795,11 @@
|
||||
if (searchForm.flow_type) {
|
||||
params.flow_type = searchForm.flow_type
|
||||
}
|
||||
if (searchForm.identifier) {
|
||||
params.identifier = searchForm.identifier
|
||||
if (searchForm.old_asset_keyword) {
|
||||
params.old_asset_keyword = searchForm.old_asset_keyword
|
||||
}
|
||||
if (searchForm.new_asset_keyword) {
|
||||
params.new_asset_keyword = searchForm.new_asset_keyword
|
||||
}
|
||||
if (searchForm.created_at_start) {
|
||||
params.created_at_start = searchForm.created_at_start
|
||||
@@ -809,6 +836,8 @@
|
||||
|
||||
// 重置
|
||||
const handleReset = () => {
|
||||
searchForm.old_asset_keyword = ''
|
||||
searchForm.new_asset_keyword = ''
|
||||
searchForm.created_at_range = []
|
||||
searchForm.created_at_start = ''
|
||||
searchForm.created_at_end = ''
|
||||
|
||||
Reference in New Issue
Block a user