|
@@ -27,11 +27,12 @@
|
|
|
</div>
|
|
|
|
|
|
<a-table row-key="iccid" :data="dataSource" :columns="columns" :pagination="pagination"
|
|
|
- :row-selection="rowSelection" v-model:selectedKeys="selectedKeys" :scroll="{ x: 'auto' }">
|
|
|
+ :row-selection="rowSelection" v-model:selectedKeys="selectedKeys" :scroll="{ x: 'auto' }"
|
|
|
+ :expandable="expandable">
|
|
|
<template #id="{ record }">
|
|
|
<!-- 查看流量消耗 -->
|
|
|
- <!-- <a class="a-link" href="javascript:;" style="margin-right: 1rem" @click="handletrafficUseDialog(record)">{{
|
|
|
- $t('lotCard.trafficUse') }}</a> -->
|
|
|
+ <a class="a-link" href="javascript:;" style="margin-right: 1rem" @click="handletrafficUseDialog(record)">{{
|
|
|
+ $t('lotCard.trafficUse') }}</a>
|
|
|
</template>
|
|
|
|
|
|
</a-table>
|
|
@@ -41,13 +42,14 @@
|
|
|
</template>
|
|
|
|
|
|
<script setup>
|
|
|
-import { onMounted, ref, reactive, getCurrentInstance } from "vue";
|
|
|
+import { onMounted, ref, reactive, getCurrentInstance, h } from "vue";
|
|
|
import { useRoute } from "vue-router";
|
|
|
import { columns } from "./config";
|
|
|
import { Message, Notification } from '@arco-design/web-vue'
|
|
|
-import { cardInfoList, cardInfoImport } from "@/api/path/lotCard.api"
|
|
|
+import { cardInfoList, cardInfoImport, orderList, orderFlowData } from "@/api/path/lotCard.api"
|
|
|
import trafficUseDialog from "./trafficUseDialog.vue";
|
|
|
import { enum_dict } from "@/hooks/enum";
|
|
|
+import list from "./list.vue";
|
|
|
|
|
|
const { proxy } = getCurrentInstance()
|
|
|
const formRef = ref()
|
|
@@ -83,7 +85,34 @@ const intData = async () => {
|
|
|
...searchForm.value,
|
|
|
}
|
|
|
const { data } = await cardInfoList(param)
|
|
|
- dataSource.value = (data.records || []).map(item => {
|
|
|
+
|
|
|
+ dataSource.value = (data.records || []).map((item, index) => {
|
|
|
+ // 卡下级信息
|
|
|
+ let orderArr = []
|
|
|
+ orderList({ current: 1, size: 999, ICCID: item.iccid }).then(res => {
|
|
|
+
|
|
|
+ res.data.records?.forEach(async (orderItem) => {
|
|
|
+
|
|
|
+ const params = {
|
|
|
+ // iccid: orderItem.ICCID,
|
|
|
+ iccid: '89852342022040149139',
|
|
|
+ childOrderId: orderItem.id,
|
|
|
+ subscriptionKey: "1824754463183432097",
|
|
|
+ }
|
|
|
+
|
|
|
+ let trafficList = []
|
|
|
+ if ((item.iccid == '89852342022040149139' && index < 5) || item.iccid !== '89852342022040149139') {
|
|
|
+ const { data } = await orderFlowData(params)
|
|
|
+ trafficList = data.historyData || []
|
|
|
+ orderArr.push({
|
|
|
+ ...orderItem,
|
|
|
+ trafficList
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ })
|
|
|
+
|
|
|
+ // 处理卡列表信息
|
|
|
const sourceName = sourceList.value.find(sourceItem => sourceItem.value == item.source)?.label || ''
|
|
|
const serviceName = serviceList.value.find(serviceItem => serviceItem.value == item.service_usage_mode)?.label || ''
|
|
|
const statusName = statusList.value.find(statusItem => statusItem.value == item.status)?.label || ''
|
|
@@ -92,12 +121,49 @@ const intData = async () => {
|
|
|
...item,
|
|
|
sourceName,
|
|
|
serviceName,
|
|
|
- statusName
|
|
|
+ statusName,
|
|
|
+ orderArr
|
|
|
}
|
|
|
+
|
|
|
})
|
|
|
pagination.value.total = data.total
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+// const { data: orderData } = await orderList({ current: 1, size: 999, ICCID: ICCID.value })
|
|
|
+// orderData.records?.forEach(async (orderItem) => {
|
|
|
+
|
|
|
+// const params = {
|
|
|
+// // iccid: orderItem.ICCID,
|
|
|
+// iccid: '89852342022040149139',
|
|
|
+// childOrderId: orderItem.id,
|
|
|
+// subscriptionKey: "1824754463183432097",
|
|
|
+// }
|
|
|
+
|
|
|
+// let trafficList = []
|
|
|
+// const { data } = await orderFlowData(params)
|
|
|
+// trafficList = data.historyData || []
|
|
|
+
|
|
|
+// dataSource.value.push({
|
|
|
+// ...orderItem,
|
|
|
+// trafficList
|
|
|
+// })
|
|
|
+// })
|
|
|
+
|
|
|
+
|
|
|
+const expandable = {
|
|
|
+ expandedRowRender: (record) => {
|
|
|
+ if (record.orderArr && Array.isArray(record.orderArr) && record.orderArr.length > 0) {
|
|
|
+ return h('div', {}, [
|
|
|
+ h(list, { 'data': record.orderArr })
|
|
|
+ ]);
|
|
|
+ }
|
|
|
+ return h('div', {}, '暂无数据')
|
|
|
+
|
|
|
+
|
|
|
+ },
|
|
|
+};
|
|
|
+
|
|
|
const handleImport = async () => {
|
|
|
if (!searchForm.value.iccid) {
|
|
|
Message.warning({
|