123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205 |
- <template>
- <!-- 卡清单管理 -->
- <div class="container">
- <!-- 搜索条件区 -->
- <div class="search-section">
- <a-form :model="searchForm" ref="formRef" layout="inline">
- <a-form-item field="iccid" :label="$t('lotCard.iccid')">
- <a-input v-model="searchForm.iccid" :placeholder="$t('lotCard.please') + $t('lotCard.iccid')" allow-clear />
- </a-form-item>
- <!-- 主卡状态-->
- <a-form-item field="iccid" :label="$t('lotCard.iccidType')">
- <a-select v-model="value" :style="{ width: '240px' }" :placeholder="$t('lotCard.iccidTypeName')">
- <a-option v-for="item of statusList" :value="item.id" :label="item.label" />
- </a-select>
- </a-form-item>
- <!-- 来源-->
- <a-form-item field="iccid" :label="$t('lotCard.sourceCard')">
- <a-select v-model="value" :style="{ width: '240px' }" :placeholder="$t('lotCard.sourceCardType')">
- <a-option v-for="item of sourceList" :value="item.id" :label="item.label" />
- </a-select>
- </a-form-item>
- <!-- 创建时间-->
- <a-form-item field="iccid" :label="$t('lotCard.statrt_time')">
- <a-date-picker style="width: 200px;" ::placeholder="$t('lotCard.statrt_timeType')" />
- </a-form-item>
- <!-- 更新时间-->
- <a-form-item field="iccid" :label="$t('lotCard.Renewal_time')">
- <a-date-picker style="width: 200px;" ::placeholder="$t('lotCard.Renewal_timeType')" />
- </a-form-item>
- <a-form-item>
- <a-space>
- <a-button type="primary" @click="handleSearch">{{ $t('form.Search') }}</a-button>
- <a-button @click="resetSearch">{{ $t('form.Reset') }}</a-button>
- </a-space>
- </a-form-item>
- </a-form>
- </div>
-
- <!-- <div class="top-actions">
- <a-space>
- <a-button type="primary" @click="showAdd=true">{{ $t('form.Add') }}</a-button>
- </a-space>
- </div> -->
- <a-table row-key="iccid" :data="dataSource" :columns="columns" :pagination="pagination" :scroll="{ x: 'auto' }"
- @page-change="evChangePage">
- <template #poolNum="{ record }">
- <span>{{ record.poolName }}</span>
- <br />
- <span>{{ record.poolId }}</span>
- </template>
- <template #dataUsageTotal="{ record }">
- <span>{{ record.dataUsageTotal }}MB</span>
- </template>
- <template #id="{ record }">
- <!-- 查看流量消耗 -->
- <a class="a-link" href="javascript:;" style="margin-right: 1rem" @click="handletrafficUseDialog(record)">详情</a>
- </template>
- </a-table>
- <!-- 查看流量消耗 -->
- <trafficUseDialog ref="trafficUseDialogRef" @submit="intData()" />
- <Add v-model="showAdd"></Add>
- </div>
- </template>
- <script setup>
- import { onMounted, ref, getCurrentInstance, h } from "vue";
- import { columns } from "./config";
- import { cardInfoList } from "@/api/path/lotCard.api"
- import trafficUseDialog from "./trafficUseDialog.vue";
- import { Getdictionary } from '@/mixins/index.js'
- import Add from './add.vue'
- const { proxy } = getCurrentInstance()
- import {useI18n} from 'vue-i18n'
- const {t} = useI18n();
- const formRef = ref()
- const searchForm = ref({
- "iccid": "",
- });
- const statusList = ref([]);
- const sourceList = ref([]);
- const serviceList = ref([]);
- const dataSource = ref([]);
- const pagination = ref({
- total: 0,
- pageSize: 10,
- current: 1,
- })
- const showAdd = ref(false)
- const trafficUseDialogRef = ref()
- const intData = async () => {
- const param = {
- current: pagination.value.current,
- size: pagination.value.pageSize,
- ...searchForm.value,
- }
- const soureName = await Getdictionary('source')
- const accountStatusName = await Getdictionary('account')
- const { data } = await cardInfoList(param)
- dataSource.value = (data.records || []).map((item, index) => {
- const payType = item.payType == 0 ? 'Prepay' : 'Postpay';
- const soure = soureName.find(val => val.value == item.source)?.label
- const iccidStatus = accountStatusName.find(val => val.value == item.iccidStatus)?.label
- return {
- ...item,
- ...item.Info,
- payType: payType,
- sourceName: soure,
- iccidStatus,
- forewarningStatus: '正常',
- SilenceEndtime: '一个月',
- usedBg: '0',
- usableBg: '0',
- dataUsage: item.dataPackage[0]?.dataUsage + '/MB',
- dataTotal: item.dataPackage[0]?.dataTotal + '/MB',
- }
- })
- pagination.value.total = data.total
- }
- // 详情
- const handletrafficUseDialog = (data) => {
- trafficUseDialogRef.value.open(data)
- }
- const evChangePage = (page) => {
- pagination.value.current = page
- intData()
- }
- const handleSearch = () => {
- formRef.value.validate((errors) => {
- if (!errors) {
- intData()
- }
- });
- }
- // 获取字典
- const handleDictValue = async () => {
- sourceList.value = await Getdictionary('source')
- statusList.value = await Getdictionary('mainCardStatus')
- serviceList.value = await Getdictionary('activationPackageMethod')
- }
- const resetSearch = () => {
- proxy.$refs.formRef.resetFields()
- intData()
- }
- onMounted(() => {
- handleDictValue()
- intData()
- })
- </script>
- <style scoped lang="less">
- .head-title-right {
- .m-r-10 {
- margin-right: 10px;
- }
- }
- .search-section {
- margin-top: 20px;
- margin-bottom: 20px;
- }
- .top-actions {
- margin-bottom: 20px;
- }
- .container {
- .head-title {
- display: flex;
- justify-content: space-between;
- }
- .form-row {
- display: flex;
- .form-row-col {
- width: 25%;
- display: flex;
- align-items: center;
- .form-row-label {
- width: 120px;
- text-align: right;
- }
- }
- }
- }
- </style>
|