|
|
@@ -1,6 +1,59 @@
|
|
|
<template>
|
|
|
<div class="main-container">
|
|
|
<TableBody>
|
|
|
+ <template #header>
|
|
|
+ <el-input
|
|
|
+ v-model="activeCode.activationCode"
|
|
|
+ style="width: 200px; margin: 10px 0 10px 20px"
|
|
|
+ placeholder="请输入激活码"
|
|
|
+ clearable
|
|
|
+ />
|
|
|
+ <el-select
|
|
|
+ v-model="activeCode.proxyId"
|
|
|
+ placeholder="请选择代理"
|
|
|
+ style="width: 200px; margin: 10px 0 10px 10px"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="item in proxyList"
|
|
|
+ :key="item.id"
|
|
|
+ :label="item.proxyName"
|
|
|
+ :value="item.id"
|
|
|
+ />
|
|
|
+ </el-select>
|
|
|
+ <el-select
|
|
|
+ v-model="activeCode.packageType"
|
|
|
+ placeholder="请选择套餐类型"
|
|
|
+ style="width: 200px; margin: 10px 0 10px 10px"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="item in packageTypeEnum"
|
|
|
+ :key="item.value"
|
|
|
+ :label="item.label"
|
|
|
+ :value="item.value"
|
|
|
+ />
|
|
|
+ </el-select>
|
|
|
+ <el-button
|
|
|
+ type="success"
|
|
|
+ icon="Refresh"
|
|
|
+ style="margin-left: 10px"
|
|
|
+ @click="resetSearch"
|
|
|
+ size="small">
|
|
|
+ 重置
|
|
|
+ </el-button>
|
|
|
+ <el-button
|
|
|
+ type="primary"
|
|
|
+ icon="Search"
|
|
|
+ @click="doRefresh"
|
|
|
+ size="small">
|
|
|
+ 搜索
|
|
|
+ </el-button>
|
|
|
+ <el-button
|
|
|
+ type="primary"
|
|
|
+ size="small"
|
|
|
+ icon="Download"
|
|
|
+ @click="exportCsv"
|
|
|
+ >导出</el-button>
|
|
|
+ </template>
|
|
|
<template #tableConfig>
|
|
|
<TableConfig
|
|
|
v-model:border="tableConfig.border"
|
|
|
@@ -148,11 +201,14 @@ import { onBeforeMount, onMounted, reactive, ref } from "vue";
|
|
|
import {
|
|
|
actionCarTypeEnum,
|
|
|
activationCode,
|
|
|
- activationCodeAdd, packageListLink, proxyListLink
|
|
|
+ activationCodeAdd, packageListLink, packageTypeEnumLink, proxyListLink
|
|
|
} from "@/api/url";
|
|
|
import { ElMessage } from "element-plus";
|
|
|
import type { DialogType, TableFooter } from "@/components/types";
|
|
|
import { useRouter } from "vue-router";
|
|
|
+import { get } from "@/api/http";
|
|
|
+import useUserStore from "@/store/modules/user";
|
|
|
+import { baseIp } from "@/api/axios.config";
|
|
|
const router = useRouter();
|
|
|
const post = usePost();
|
|
|
const dialogRef = ref<DialogType>();
|
|
|
@@ -160,6 +216,9 @@ const tableFooter = ref<TableFooter>();
|
|
|
const proxyList = ref<Array<any>>([]);
|
|
|
const salesPackageList = ref<Array<any>>([]);
|
|
|
const tableRef = ref();
|
|
|
+const packageTypeEnum = ref([
|
|
|
+ {label:"",value:""}
|
|
|
+]);
|
|
|
const {
|
|
|
dataList,
|
|
|
tableLoading,
|
|
|
@@ -173,6 +232,8 @@ const activeCode = reactive<ActiveCodeModel>({
|
|
|
addNum: "",
|
|
|
salesPackageId: "",
|
|
|
proxyId: "",
|
|
|
+ activationCode: "",
|
|
|
+ packageType: "",
|
|
|
});
|
|
|
|
|
|
function add() {
|
|
|
@@ -199,9 +260,7 @@ function doRefresh() {
|
|
|
url: activationCode,
|
|
|
data: {
|
|
|
...tableFooter.value?.withPageInfoData(),
|
|
|
- data: {
|
|
|
-
|
|
|
- }
|
|
|
+ data: activeCode
|
|
|
}
|
|
|
})
|
|
|
.then((res) => {
|
|
|
@@ -226,6 +285,19 @@ function getPackageList(){
|
|
|
}).catch(console.log);
|
|
|
}
|
|
|
|
|
|
+function getPackageTypeEnum(){
|
|
|
+ get({
|
|
|
+ url: packageTypeEnumLink,
|
|
|
+ data: {},
|
|
|
+ }).then((res:any) => {
|
|
|
+ packageTypeEnum.value = res.data || [];
|
|
|
+ }).catch(console.log);
|
|
|
+}
|
|
|
+function exportCsv() {
|
|
|
+ const useStore = useUserStore();
|
|
|
+ window.open(baseIp+"cms_api/activation_code/export_csv?adminToken="+useStore.token+"&activationCode="+activeCode.activationCode+"&proxyId="+activeCode.proxyId+"&packageType="+activeCode.packageType)
|
|
|
+}
|
|
|
+
|
|
|
function getProxyList(){
|
|
|
post({
|
|
|
url:proxyListLink,
|
|
|
@@ -240,11 +312,19 @@ function getProxyList(){
|
|
|
}).catch(console.log);
|
|
|
}
|
|
|
|
|
|
+const resetSearch = () => {
|
|
|
+ activeCode.activationCode = "";
|
|
|
+ activeCode.proxyId = "";
|
|
|
+ activeCode.packageType="";
|
|
|
+ doRefresh();
|
|
|
+}
|
|
|
+
|
|
|
onMounted(() => {
|
|
|
doRefresh();
|
|
|
useHeight();
|
|
|
getProxyList();
|
|
|
getPackageList();
|
|
|
+ getPackageTypeEnum();
|
|
|
});
|
|
|
onBeforeMount(offTableCollapseTransition);
|
|
|
</script>
|