fix: bug
All checks were successful
构建并部署前端到测试环境 / build-and-deploy (push) Successful in 7m11s

This commit is contained in:
sexygoat
2026-04-24 18:39:39 +08:00
parent 2d6b5d7903
commit 17c299e4ce
27 changed files with 500 additions and 481 deletions

View File

@@ -140,13 +140,20 @@
>
<ElSelect
v-model="allocateForm.carrier_id"
placeholder="请选择运营商"
placeholder="请选择或搜索运营商"
clearable
filterable
remote
:remote-method="handleSearchAllocateCarrier"
:loading="allocateCarrierLoading"
style="width: 100%"
>
<ElOption label="中国移动" :value="1" />
<ElOption label="中国联通" :value="2" />
<ElOption label="中国电信" :value="3" />
<ElOption
v-for="item in allocateCarrierOptions"
:key="item.id"
:label="item.carrier_name"
:value="item.id"
/>
</ElSelect>
</ElFormItem>
<ElFormItem
@@ -166,10 +173,25 @@
</ElSelect>
</ElFormItem>
<ElFormItem
v-if="allocateForm.selection_type === CardSelectionType.FILTER"
v-if="allocateForm.selection_type === CardSelectionType.FILTER && userInfo.user_type !== 3"
label="批次号"
>
<ElInput v-model="allocateForm.batch_no" placeholder="请输入批次号" />
<ElSelect
v-model="allocateForm.batch_no"
placeholder="请选择或搜索批次号"
clearable
filterable
remote
:remote-method="handleSearchAllocateBatchNo"
style="width: 100%"
>
<ElOption
v-for="item in allocateBatchNoOptions"
:key="item.id"
:label="item.batch_no"
:value="item.batch_no"
/>
</ElSelect>
</ElFormItem>
<ElFormItem label="备注">
@@ -235,20 +257,42 @@
>
<ElSelect
v-model="recallForm.carrier_id"
placeholder="请选择运营商"
placeholder="请选择或搜索运营商"
clearable
filterable
remote
:remote-method="handleSearchAllocateCarrier"
:loading="allocateCarrierLoading"
style="width: 100%"
>
<ElOption label="中国移动" :value="1" />
<ElOption label="中国联通" :value="2" />
<ElOption label="中国电信" :value="3" />
<ElOption
v-for="item in allocateCarrierOptions"
:key="item.id"
:label="item.carrier_name"
:value="item.id"
/>
</ElSelect>
</ElFormItem>
<ElFormItem
v-if="recallForm.selection_type === CardSelectionType.FILTER"
v-if="recallForm.selection_type === CardSelectionType.FILTER && userInfo.user_type !== 3"
label="批次号"
>
<ElInput v-model="recallForm.batch_no" placeholder="请输入批次号" />
<ElSelect
v-model="recallForm.batch_no"
placeholder="请选择或搜索批次号"
clearable
filterable
remote
:remote-method="handleSearchAllocateBatchNo"
style="width: 100%"
>
<ElOption
v-for="item in allocateBatchNoOptions"
:key="item.id"
:label="item.batch_no"
:value="item.batch_no"
/>
</ElSelect>
</ElFormItem>
<ElFormItem label="备注">
@@ -585,6 +629,8 @@
import type { SearchFormItem } from '@/types'
import { useCheckedColumns } from '@/composables/useCheckedColumns'
import { useAuth } from '@/composables/useAuth'
import { useUserStore } from '@/store/modules/user'
import { storeToRefs } from 'pinia'
import { formatDateTime } from '@/utils/business/format'
import ArtMenuRight from '@/components/core/others/ArtMenuRight.vue'
import type { MenuItemType } from '@/components/core/others/ArtMenuRight.vue'
@@ -602,6 +648,8 @@
defineOptions({ name: 'StandaloneCardList' })
const { hasAuth } = useAuth()
const userStore = useUserStore()
const { info: userInfo } = storeToRefs(userStore)
const router = useRouter()
const loading = ref(false)
@@ -646,6 +694,10 @@
const carrierLoading = ref(false)
const searchCarrierOptions = ref<any[]>([])
// 批量分配对话框运营商选项
const allocateCarrierOptions = ref<any[]>([])
const allocateCarrierLoading = ref(false)
// 加载搜索栏运营商选项默认加载10条
const loadSearchCarrierOptions = async (carrierName?: string) => {
try {
@@ -665,6 +717,37 @@
}
}
// 加载批量分配对话框运营商选项
const loadAllocateCarrierOptions = async (carrierName?: string) => {
try {
allocateCarrierLoading.value = true
const params: any = {
page: 1,
page_size: 20
}
if (carrierName) {
params.carrier_name = carrierName
}
const res = await CarrierService.getCarriers(params)
if (res.code === 0) {
allocateCarrierOptions.value = res.data.items || []
}
} catch (error) {
console.error('加载运营商选项失败:', error)
} finally {
allocateCarrierLoading.value = false
}
}
// 搜索批量分配对话框运营商
const handleSearchAllocateCarrier = (query: string) => {
if (query) {
loadAllocateCarrierOptions(query)
} else {
loadAllocateCarrierOptions()
}
}
// 搜索运营商(用于搜索栏)
const handleSearchCarrier = (query: string) => {
if (query) {
@@ -674,6 +757,37 @@
}
}
// 批量分配对话框批次号选项
const allocateBatchNoOptions = ref<any[]>([])
// 加载批量分配对话框批次号选项
const loadAllocateBatchNoOptions = async (batchNo?: string) => {
try {
const params: any = {
page: 1,
page_size: 20
}
if (batchNo) {
params.batch_no = batchNo
}
const res = await CardService.getIotCardImportTasks(params)
if (res.code === 0) {
allocateBatchNoOptions.value = res.data.items || []
}
} catch (error) {
console.error('加载批次号选项失败:', error)
}
}
// 搜索批量分配对话框批次号
const handleSearchAllocateBatchNo = (query: string) => {
if (query) {
loadAllocateBatchNoOptions(query)
} else {
loadAllocateBatchNoOptions()
}
}
// 套餐系列搜索相关
const searchSeriesOptions = ref<any[]>([])
@@ -939,22 +1053,7 @@
})
// 搜索表单配置
const formItems: SearchFormItem[] = [
{
label: '状态',
prop: 'status',
type: 'select',
config: {
clearable: true,
placeholder: '全部'
},
options: () => [
{ label: '在库', value: 1 },
{ label: '已分销', value: 2 },
{ label: '已激活', value: 3 },
{ label: '已停用', value: 4 }
]
},
const baseFormItems: SearchFormItem[] = [
{
label: 'ICCID',
prop: 'iccid',
@@ -983,13 +1082,19 @@
}))
},
{
label: 'MSISDN',
prop: 'msisdn',
type: 'input',
label: '状态',
prop: 'status',
type: 'select',
config: {
clearable: true,
placeholder: '请输入MSISDN'
}
placeholder: '全部'
},
options: () => [
{ label: '在库', value: 1 },
{ label: '已分销', value: 2 },
{ label: '已激活', value: 3 },
{ label: '已停用', value: 4 }
]
},
{
label: '卡虚拟号',
@@ -1000,6 +1105,15 @@
placeholder: '请输入卡虚拟号'
}
},
{
label: 'MSISDN',
prop: 'msisdn',
type: 'input',
config: {
clearable: true,
placeholder: '请输入MSISDN'
}
},
{
label: '绑定设备虚拟号',
prop: 'device_virtual_no',
@@ -1085,6 +1199,9 @@
}
]
// 搜索表单配置
const formItems: SearchFormItem[] = baseFormItems
// 列配置
const columnOptions = [
{ label: 'ICCID', prop: 'iccid' },
@@ -1521,6 +1638,8 @@
batch_no: '',
remark: ''
})
loadAllocateCarrierOptions()
loadAllocateBatchNoOptions()
if (allocateFormRef.value) {
allocateFormRef.value.resetFields()
}
@@ -1545,6 +1664,8 @@
if (recallFormRef.value) {
recallFormRef.value.resetFields()
}
loadAllocateCarrierOptions()
loadAllocateBatchNoOptions()
}
// 关闭批量分配对话框