wanghairong 5 mēneši atpakaļ
vecāks
revīzija
c4582e8430

+ 43 - 0
src/views/lotCard/orderMange/config.js

@@ -0,0 +1,43 @@
+export const columns = [
+  { title: window.$t('lotCard.iccid'), dataIndex: 'ICCID', align: 'center', width:200   },
+  { title: window.$t('lotCard.currency'), dataIndex: 'currency', align: 'center', width:200   },
+  { title: window.$t('lotCard.dataBundleId'), dataIndex: 'dataBundleId', align: 'center', width:200 },
+  { title: window.$t('lotCard.created_at'), dataIndex: 'created_at', align: 'center', width:200 },
+  { title: window.$t('lotCard.deleted_at'), dataIndex: 'deleted_at', align: 'center', width:200 },
+  { title: window.$t('lotCard.updated_at'), dataIndex: 'updated_at', align: 'center', width:200 },
+  { title: window.$t('lotCard.is_Refuel'), dataIndex: 'is_Refuel', align: 'center', width:200 },
+  { title: window.$t('lotCard.price'), dataIndex: 'price', align: 'center', width:200 },
+  { title: window.$t('lotCard.quantity'), dataIndex: 'quantity', align: 'center', width:200 },
+  { title: window.$t('lotCard.UserId'), dataIndex: 'user_id', align: 'center', width:200 },
+  // {
+  //   title: window.$t('global.common.operations'),
+  //   dataIndex: 'id',
+  //   slotName: 'id',
+  //   align: 'center',
+  //   width: 180,
+  //   fixed: "right",
+  // }
+]
+
+
+export const dialogColumns = [
+  { title: window.$t('lotCard.cardHlrId'), dataIndex: 'cardHlrId', align: 'center', width:200   },
+  { title: window.$t('lotCard.cardHlrId'), dataIndex: 'cardHlrId', align: 'center', width:200   },
+  { title: window.$t('lotCard.CreateTime'), dataIndex: 'createTime', align: 'center', width:200 },
+  { title: window.$t('lotCard.lastModifyTime'), dataIndex: 'lastModifyTime', align: 'center', width:200 },
+  { title: window.$t('lotCard.ExpireTime'), dataIndex: 'expireTime', align: 'center', width:200 },
+  { title: window.$t('lotCard.himsi'), dataIndex: 'himsi', align: 'center', width:200 },
+  { title: window.$t('lotCard.iccid'), dataIndex: 'iccid', align: 'center', width:200 },
+  { title: window.$t('lotCard.msisdn'), dataIndex: 'msisdn', align: 'center', width:200 },
+  { title: window.$t('lotCard.realRuleListName'), dataIndex: 'realRuleListName', align: 'center', width:200 },
+  { title: window.$t('lotCard.serviceUsageMode'), dataIndex: 'serviceUsageMode', align: 'center', width:200 },
+  { title: window.$t('lotCard.statusSim'), dataIndex: 'status', align: 'center', width:200 },
+  {
+    title: window.$t('global.common.operations'),
+    dataIndex: 'id',
+    slotName: 'id',
+    align: 'center',
+    width: 180,
+    fixed: "right",
+  }
+]

+ 215 - 0
src/views/lotCard/orderMange/index.vue

@@ -0,0 +1,215 @@
+<template>
+    <!-- 订单管理 -->
+    <div class="container">
+        <div class="head-title">
+            <span>{{ route.meta.title }} </span>
+            <span class="head-title-right">
+                <a-button class="m-r-10" type="primary" @click="handleDialog({})"> {{ $t('lotCard.titleSim')
+                    }}</a-button>
+                <a-button type="primary" @click="handleIssuedDialog({})">{{ $t('lotCard.titleOrder') }}</a-button>
+            </span>
+        </div>
+        <!-- 搜索条件区 -->
+        <div class="search-section">
+            <a-form :model="searchForm" ref="formRef" layout="inline">
+                <a-form-item field="ICCID" :label="$t('lotCard.iccid')" :validate-trigger="['change', 'input', 'blur']"
+                    :rules="[{ required: true, message: $t('lotCard.please') + $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="dataBundleId" :label="$t('lotCard.dataBundleId')">
+                    <a-input v-model="searchForm.cardNumber"
+                        :placeholder="$t('lotCard.please') + $t('lotCard.dataBundleId')" allow-clear />
+                </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>
+
+        <a-table row-key="ICCID" :data="dataSource" :columns="columns" :pagination="pagination"
+            :row-selection="rowSelection" v-model:selectedKeys="selectedKeys" :scroll="{ x: 'auto' }">
+            <template #id="{ record }">
+                <!-- 结束套餐 -->
+                <a-popconfirm :content="$t('lotCard.confirmOrderEnd')" :ok-text="$t('form.Confirm')"
+                    :cancel-text="$t('form.Cancel')" @ok="handleUnsubscribeDialog(record)">
+                    <a class="a-link" href="javascript:;" style="margin-right: 1rem">{{ $t('lotCard.orderEnd') }}</a>
+                </a-popconfirm>
+            </template>
+
+        </a-table>
+    </div>
+</template>
+
+<script setup>
+import { onMounted, ref, reactive, getCurrentInstance } from "vue";
+import { useRoute } from "vue-router";
+import { columns } from "./config";
+import { Message, Notification } from '@arco-design/web-vue'
+import { orderList } from "@/api/path/lotCard.api"
+
+const { proxy } = getCurrentInstance()
+const formRef = ref()
+const searchForm = ref({
+    "orderId": "",
+    "is_Refuel": "",
+    "refuelingId": "",
+    "dataBundleId": "",
+    "quantity": 0,
+    "ICCID": "",
+    "sendLang": "",
+    "price": "",
+    "totalAmount": "",
+    "currency": "",
+    "userId": 0,
+    "current": 1,
+    "size": 10
+});
+
+const dataSource = ref([]);
+const route = useRoute();
+const pagination = ref({
+    total: 0,
+    pageSize: 10,
+    current: 1,
+})
+
+const rowSelection = reactive({
+    type: 'checkbox',
+    showCheckedAll: true,
+    onlyCurrent: false,
+});
+const selectedKeys = ref([])
+
+const dialogRef = ref()
+const issuedDialogRef = ref()
+const orderDialogRef = ref()
+
+
+const intData = async () => {
+    const param = {
+        current: pagination.value.current,
+        size: pagination.value.pageSize,
+        ...searchForm.value,
+    }
+    const { data } = await orderList(param)
+    dataSource.value = data.records || []
+    pagination.value.total = data.total
+}
+
+const handleDialog = (data) => {
+    if (selectedKeys.value.length > 0) {
+        dialogRef.value.open(selectedKeys.value)
+        return
+    }
+    dialogRef.value.open([data.ICCID])
+};
+
+const handleIssuedDialog = (data) => {
+    if (selectedKeys.value.length > 0) {
+        issuedDialogRef.value.open(selectedKeys.value)
+        return
+    }
+    issuedDialogRef.value.open([data.ICCID])
+}
+
+const handleOrderDialog = (data) => {
+    orderDialogRef.value.open(data)
+}
+
+
+const handleUnsubscribeDialog = async (data) => {
+    // 订阅关系状态
+    // 1:未激活
+    // 2: 已过期
+    // 3: 已激活99:已退款
+    let info = {}
+    let param = {}
+    // TODO 入参获取不到,结束套餐可能位置存在错误
+    if (data.status == 1) {
+        param = {
+            "orderId": "12410291340347056782",
+            "thirdOrderId": "1848992146566851025"
+        }
+        info = await unsubscribe(param)
+    }
+    if (data.status == 3) {
+        param = {
+            "iccidPackageList": [
+                {
+                    "iccid": "1845700383613420930",
+                    "imsi": "454120387374989",
+                    "packageid": "1851137028516811138"
+                }
+            ]
+        }
+        info = await release(param)
+
+    }
+    if (info.code == 200) {
+        Message.success({
+            content: data.msg,
+            duration: 2000,
+        });
+    }
+};
+
+
+const handleSearch = () => {
+    formRef.value.validate((errors) => {
+        if (!errors) {
+            intData()
+        }
+    });
+}
+const resetSearch = () => {
+    proxy.$refs.formRef.resetFields()
+    intData()
+}
+
+
+
+
+onMounted(() => {
+    intData()
+})
+</script>
+
+<style scoped lang="less">
+.head-title-right {
+    .m-r-10 {
+        margin-right: 10px;
+    }
+
+}
+
+.search-section {
+    margin-top: 20px;
+    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>

+ 8 - 8
src/views/lotCard/packageMange/config.js

@@ -18,12 +18,12 @@ export const columns = [
   { title: window.$t('lotCard.price'), dataIndex: 'prince', align: 'center', width:200 },
   { title: window.$t('lotCard.deductionModel'), dataIndex: 'deductionModel', align: 'center', width:200 },
   { title: window.$t('lotCard.packageStatus'), dataIndex: 'status', align: 'center',  width:200 },
-  {
-    title: window.$t('global.common.operations'),
-    dataIndex: 'id',
-    slotName: 'id',
-    align: 'center',
-    width: 180,
-    fixed: "right",
-  }
+  // {
+  //   title: window.$t('global.common.operations'),
+  //   dataIndex: 'id',
+  //   slotName: 'id',
+  //   align: 'center',
+  //   width: 180,
+  //   fixed: "right",
+  // }
 ]

+ 111 - 10
src/views/lotCard/packageMange/index.vue

@@ -4,13 +4,33 @@
       <span>{{ route.meta.title }} </span>
     </div>
 
+    <!-- 搜索条件区 -->
+    <div class="search-section">
+      <a-form :model="formData" ref="formRef" layout="inline">
+        <a-form-item field="iccid" :label="$t('lotCard.iccid')" :validate-trigger="['change', 'input', 'blur']"
+          :rules="[{ required: true, message: $t('lotCard.please') + $t('lotCard.iccid') }]">
+          <a-input v-model="formData.iccid" :placeholder="$t('lotCard.please') + $t('lotCard.iccid')" allow-clear />
+        </a-form-item>
+        <a-form-item field="orderChannel" :label="$t('lotCard.orderChannel')">
+          <a-input v-model="formData.orderChannel" :placeholder="$t('lotCard.please') + $t('lotCard.orderChannel')"
+            allow-clear />
+        </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>
     <a-table :data="dataSource" :columns="columns" :scroll="{ x: 'auto' }" @page-change="evChangePage"
       @page-size-change="evChangePageSize">
       <template #id="{ record }">
-        <!-- <a class="a-link" href="javascript:;" style="margin-right: 1rem" @click="evEdit(record)">编辑</a>
-          <a-popconfirm content="确认删除该信息?" ok-text="确定" cancel-text="取消" @ok="evDelete(record.id)">
-            <a href="javascript:;" class="a-link">删除</a>
-          </a-popconfirm> -->
+        <!-- 结束套餐 -->
+        <!-- <a-popconfirm :content="$t('lotCard.confirmOrderEnd')" :ok-text="$t('form.Confirm')"
+          :cancel-text="$t('form.Cancel')" @ok="handleUnsubscribeDialog(record)">
+          <a class="a-link" href="javascript:;" style="margin-right: 1rem">{{ $t('lotCard.orderEnd') }}</a>
+        </a-popconfirm> -->
       </template>
 
     </a-table>
@@ -18,16 +38,22 @@
 </template>
 
 <script setup>
-import { onMounted, ref, h } from "vue";
+import { onMounted, ref, getCurrentInstance } from "vue";
 import { useRoute } from "vue-router";
 import { columns } from "./config";
 import { Message, Notification } from '@arco-design/web-vue'
-import { packageTariffPlan } from "@/api/path/lotCard.api"
+import { packageTariffPlan, unsubscribe, release, orderList } from "@/api/path/lotCard.api"
+
+const { proxy } = getCurrentInstance()
+const formRef = ref()
 const formData = ref({
-  username: '',
-  "iccid": "89852342022040149139",
-  "hImsi": "454120387374989",
+  "iccid": "",
+  "orderChannel": "",
+  "hImsi": "",
+  "status": "",
   "language": "0",
+  // "beginIndex": 0,
+  // "count": 50
 });
 
 const dataSource = ref([]);
@@ -38,6 +64,11 @@ const pagination = ref({
   current: 1,
 })
 
+// 拿取从卡清单管理的订购套餐成功后的数据查询套餐管理
+const cardRouteData = ref({});
+
+
+
 const intData = async () => {
   const param = {
     current: pagination.value.current,
@@ -63,9 +94,79 @@ const evChangePageSize = (pageSize) => {
 }
 
 
+const handleSearch = () => {
+  formRef.value.validate((errors) => {
+    if (!errors) {
+      intData()
+    }
+  });
+
+}
+const resetSearch = () => {
+  proxy.$refs.formRef.resetFields()
+}
+
+
+const handleUnsubscribeDialog = async (data) => {
+  // 订阅关系状态
+  // 1:未激活
+  // 2: 已过期
+  // 3: 已激活99:已退款
+  let info = {}
+  let param = {}
+  let thirdOrderId = ""
+  // TODO 入参获取不到,结束套餐可能位置存在错误
+  if (data.status == 1) {
+    // 获取订单id
+    const { data } = await orderList({
+      "orderId": cardRouteData.value.orderID,
+      "dataBundleId": cardRouteData.value.dataBundleId,
+      "ICCID": cardRouteData.value.ICCID,
+      "current": 1,
+      "size": 10
+    })
+    if (data.records && Array.isArray(data.records) && data.records.length > 0) {
+      thirdOrderId = data.records[0].id
+    }
+    console.log(data,)
+    param = {
+      "orderId": cardRouteData.value.orderID,
+      thirdOrderId
+    }
+    info = await unsubscribe(param)
+  }
+  if (data.status == 3) {
+    param = {
+      "iccidPackageList": [
+        {
+          "iccid": cardRouteData.value.ICCID,
+          "imsi": "",
+          "packageid": cardRouteData.value.dataBundleId
+        }
+      ]
+    }
+    info = await release(param)
+
+  }
+  if (info.code == 200) {
+    Message.success({
+      content: info.data.msg,
+      duration: 2000,
+    });
+  }
+};
+
 onMounted(() => {
-  intData()
+  cardRouteData.value = route.query
+  if (Object.keys(cardRouteData.value).length > 0) {
+    console.log(cardRouteData.value.orderID, 'cardRouteData.value')
+
+    formData.value.iccid = cardRouteData.value.ICCID
+    intData()
+  }
+
 })
+
 </script>
 
 <style scoped lang="less">