Compare commits
5 Commits
37b64e5654
...
weeklyCard
Author | SHA1 | Date | |
---|---|---|---|
![]() |
d31726d6e7 | ||
![]() |
7bdbb9f071 | ||
![]() |
cb54148f6e | ||
![]() |
fcefd9e09d | ||
![]() |
210a6a8f71 |
135
src/api/weeklyCard/weeklyCard.js
Normal file
135
src/api/weeklyCard/weeklyCard.js
Normal file
@@ -0,0 +1,135 @@
|
||||
import request from '@/utils/request';
|
||||
import { genQueryParam } from '@/utils/maintainer';
|
||||
// 地区接口
|
||||
export const listPartitionInfo = query => {
|
||||
return request({
|
||||
url: '/partition/listPartitionInfo',
|
||||
method: 'get',
|
||||
params: query
|
||||
});
|
||||
};
|
||||
// 福袋列表请求
|
||||
export const listLuckyBagLinearGift = query => {
|
||||
return request({
|
||||
url: '/admin/gift/getGiftByTypes',
|
||||
method: 'get',
|
||||
params: query
|
||||
});
|
||||
};
|
||||
// 福袋礼物列表请求
|
||||
export const getPrizeGroupsInfo = query => {
|
||||
return request({
|
||||
url: '/admin/luckyBag/getGroupInfo',
|
||||
method: 'get',
|
||||
params: query
|
||||
});
|
||||
};
|
||||
// 所有礼物列表请求
|
||||
export const getAll = query => {
|
||||
return request({
|
||||
url: '/admin/gift/getAll',
|
||||
method: 'get',
|
||||
params: query
|
||||
});
|
||||
};
|
||||
// 所有座驾列表请求
|
||||
export const carAll = query => {
|
||||
return request({
|
||||
url: '/admin/car/goods/total/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
});
|
||||
};
|
||||
// 所有头饰列表请求
|
||||
export const headwearAll = query => {
|
||||
return request({
|
||||
url: '/admin/headwear/total/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
});
|
||||
};
|
||||
// 所有铭牌列表请求
|
||||
export const nameplateAll = query => {
|
||||
return request({
|
||||
url: '/admin/nameplate/total/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
});
|
||||
};
|
||||
// 所有气泡列表请求
|
||||
export const chatbubbleAll = query => {
|
||||
return request({
|
||||
url: '/admin/chatbubble/total/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
});
|
||||
};
|
||||
// 所有资料卡列表请求
|
||||
export const infocard = query => {
|
||||
return request({
|
||||
url: '/admin/infocard/total/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
});
|
||||
};
|
||||
// 周卡TAB-列表
|
||||
export const weekCardTabList = query => {
|
||||
return request({
|
||||
url: '/admin/weekCardTab/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
});
|
||||
};
|
||||
// 周卡TAB-保存
|
||||
export const weekCardTabSave = query => {
|
||||
return request({
|
||||
url: '/admin/weekCardTab/save',
|
||||
method: 'post',
|
||||
params: query
|
||||
});
|
||||
};
|
||||
// 周卡激励统计-列表
|
||||
export const weekCardRecordPage = query => {
|
||||
return request({
|
||||
url: '/admin/weekCardRecord/page',
|
||||
method: 'get',
|
||||
params: query
|
||||
});
|
||||
};
|
||||
// 周卡激励统计-详情
|
||||
export const weekCardRecordGetDetailPage = query => {
|
||||
return request({
|
||||
url: '/admin/weekCardRecord/getDetailPage',
|
||||
method: 'get',
|
||||
params: query
|
||||
});
|
||||
};
|
||||
// 周卡激励统计-导出
|
||||
export const weekCardRecordExport = query => {
|
||||
window.location.href = `/admin/weekCardRecord/export?${genQueryParam(query)}`;
|
||||
return;
|
||||
};
|
||||
// 周卡激励配置-列表
|
||||
export const weekCardPage = query => {
|
||||
return request({
|
||||
url: '/admin/weekCard/page',
|
||||
method: 'get',
|
||||
params: query
|
||||
});
|
||||
};
|
||||
// 周卡激励配置-上下线
|
||||
export const updateEnabled = query => {
|
||||
return request({
|
||||
url: '/admin/weekCard/updateEnabled',
|
||||
method: 'get',
|
||||
params: query
|
||||
});
|
||||
};
|
||||
// 周卡激励配置-保存
|
||||
export const weekCardSave = query => {
|
||||
return request({
|
||||
url: '/admin/weekCard/save',
|
||||
method: 'post',
|
||||
params: query
|
||||
});
|
||||
};
|
@@ -51,6 +51,7 @@ export default {
|
||||
},
|
||||
getViewComponent(context, path) {
|
||||
let component = path;
|
||||
console.log(component)
|
||||
if (path && path.endsWith('.html')) {
|
||||
const pathArray = path.split('/');
|
||||
const routeName = toCamelCase(pathArray[pathArray.length - 1].replace('.html', ''));
|
||||
|
@@ -129,7 +129,7 @@
|
||||
filterable
|
||||
v-model="controlsObj.value"
|
||||
placeholder="请选择"
|
||||
style="width:100%"
|
||||
style="width: 100%"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in controlsObj.options"
|
||||
@@ -383,11 +383,11 @@ export default {
|
||||
desc: "全部",
|
||||
id: "",
|
||||
});
|
||||
listPartitionInfo().then((res) => {
|
||||
this.controlsObj.options = res.data;
|
||||
this.getData();
|
||||
});
|
||||
});
|
||||
listPartitionInfo().then((res) => {
|
||||
this.controlsObj.options = res.data;
|
||||
});
|
||||
this.getData();
|
||||
},
|
||||
methods: {
|
||||
// 查询接口
|
||||
|
@@ -243,6 +243,7 @@ export default {
|
||||
listAll().then((res) => {
|
||||
if (res.code == 200) {
|
||||
this.grantObj.options = res.data;
|
||||
this.getData();
|
||||
} else {
|
||||
ElMessage({
|
||||
showClose: true,
|
||||
@@ -251,7 +252,6 @@ export default {
|
||||
});
|
||||
}
|
||||
});
|
||||
this.getData();
|
||||
},
|
||||
methods: {
|
||||
// 查询接口
|
||||
|
234
src/views/weeklyCard/weekCardGear.vue
Normal file
234
src/views/weeklyCard/weekCardGear.vue
Normal file
@@ -0,0 +1,234 @@
|
||||
<template>
|
||||
<!-- 表格 -->
|
||||
<el-table
|
||||
v-loading="loading"
|
||||
:data="tableData"
|
||||
border
|
||||
style="width: 100%; margin-top: 25px"
|
||||
>
|
||||
<el-table-column
|
||||
prop="appleChargeProdId"
|
||||
align="center"
|
||||
label="apple充值档位"
|
||||
/>
|
||||
<el-table-column prop="createTime" align="center" label="创建时间" />
|
||||
<el-table-column
|
||||
prop="googleChargeProdId"
|
||||
align="center"
|
||||
label="google充值档位"
|
||||
/>
|
||||
<el-table-column prop="id" align="center" label="主键" />
|
||||
<el-table-column prop="seqNo" align="center" label="排序" />
|
||||
<el-table-column prop="showAmount" align="center" label="展示金额" />
|
||||
<el-table-column prop="tabName" align="center" label="TAB名称">
|
||||
<template v-slot="scope">
|
||||
{{ JsonFunc(scope.row.tabName).zh }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="updateTime" align="center" label="更新时间" />
|
||||
<el-table-column align="center" label="操作">
|
||||
<template v-slot="scope">
|
||||
<el-button
|
||||
@click="
|
||||
controlsDialog = true;
|
||||
controlsObjNew = scope.row;
|
||||
controlsObj.value = controlsObjNew.partitionId;
|
||||
controlsObj.num = controlsObjNew.showAmount;
|
||||
"
|
||||
class="primary"
|
||||
type="primary"
|
||||
size="default"
|
||||
>编辑</el-button
|
||||
>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<!-- 分页 -->
|
||||
<el-pagination
|
||||
style="margin-top: 10px"
|
||||
class="paginationClass"
|
||||
v-model:current-page="currentPage"
|
||||
v-model:page-size="pageSize"
|
||||
:page-sizes="[10, 20, 30, 40, 50, 100, 200, 300, 400, 500, 999999999]"
|
||||
layout="sizes, prev, pager, next"
|
||||
:total="total"
|
||||
@size-change="handleSizeChange"
|
||||
@current-change="handleCurrentChange"
|
||||
/>
|
||||
|
||||
<!-- 新增&编辑弹窗 -->
|
||||
<el-dialog
|
||||
destroy-on-close
|
||||
class="pub"
|
||||
v-model="controlsDialog"
|
||||
:title="controlsTitle"
|
||||
width="32%"
|
||||
center
|
||||
>
|
||||
<!-- 地区选择 -->
|
||||
<div style="margin-bottom: 25px; margin-top: 10px; width: 134%">
|
||||
<span
|
||||
style="display: inline-block; margin-right: 20px"
|
||||
class="col-sm-2 control-label"
|
||||
>地区选择</span
|
||||
>
|
||||
<el-select filterable v-model="controlsObj.value" placeholder="请选择">
|
||||
<el-option
|
||||
v-for="item in controlsObj.options"
|
||||
:key="item.id"
|
||||
:label="item.desc"
|
||||
:value="item.id"
|
||||
>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
<!-- 展示折扣金额 -->
|
||||
<div style="margin-bottom: 25px; margin-top: 10px; width: 134%">
|
||||
<span
|
||||
style="display: inline-block; margin-right: 20px"
|
||||
class="col-sm-2 control-label"
|
||||
>展示折扣金额</span
|
||||
>
|
||||
<el-input
|
||||
v-model="controlsObj.num"
|
||||
placeholder=""
|
||||
class="input"
|
||||
style="display: inline-block; width: 36%"
|
||||
></el-input>
|
||||
</div>
|
||||
<!-- 弹窗按钮 -->
|
||||
<template #footer>
|
||||
<span class="dialog-footer">
|
||||
<el-button @click="controlsDialog = false">取消</el-button>
|
||||
<el-button type="primary" @click="controlsDialogOut()">
|
||||
确认
|
||||
</el-button>
|
||||
</span>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
weekCardTabList,
|
||||
listPartitionInfo,
|
||||
weekCardTabSave,
|
||||
} from "@/api/weeklyCard/weeklyCard";
|
||||
import { dateFormat } from "@/utils/system-helper";
|
||||
import { ElMessage } from "element-plus";
|
||||
|
||||
export default {
|
||||
name: "weekCardGear",
|
||||
data() {
|
||||
return {
|
||||
inquire: {
|
||||
giftId: "",
|
||||
userId: "",
|
||||
time: "",
|
||||
},
|
||||
loading: false,
|
||||
// 表格数据
|
||||
tableData: [],
|
||||
// 分页
|
||||
total: 10, //总页数
|
||||
currentPage: 1, //页码
|
||||
pageSize: 10, //条数
|
||||
// 编辑
|
||||
controlsDialog: false,
|
||||
controlsObjNew: false,
|
||||
controlsObj: {
|
||||
value: "",
|
||||
options: [],
|
||||
num: "",
|
||||
},
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getData();
|
||||
listPartitionInfo().then((res) => {
|
||||
this.controlsObj.options = res.data;
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
getData() {
|
||||
this.loading = true;
|
||||
weekCardTabList({})
|
||||
.then((res) => {
|
||||
if (res.code === 200) {
|
||||
this.tableData = res.data;
|
||||
} else {
|
||||
ElMessage({
|
||||
showClose: true,
|
||||
message: res.message || "获取数据失败",
|
||||
type: "error",
|
||||
});
|
||||
}
|
||||
this.loading = false;
|
||||
})
|
||||
.catch((error) => {
|
||||
console.error("请求出错:", error);
|
||||
ElMessage({
|
||||
showClose: true,
|
||||
message: "请求出错,请稍后重试",
|
||||
type: "error",
|
||||
});
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
// 确认编辑按钮
|
||||
controlsDialogOut() {
|
||||
weekCardTabSave({
|
||||
showAmount: this.controlsObj.num,
|
||||
partitionId: this.controlsObj.value,
|
||||
id: this.controlsObjNew.id,
|
||||
}).then((res) => {
|
||||
if (res.code === 200) {
|
||||
this.getData();
|
||||
this.controlsDialog = false;
|
||||
} else {
|
||||
ElMessage({
|
||||
showClose: true,
|
||||
message: res.message,
|
||||
type: "error",
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
JsonFunc(val) {
|
||||
var res = JSON.parse(val);
|
||||
return res;
|
||||
},
|
||||
// 分页导航
|
||||
handleSizeChange(size) {
|
||||
this.pageSize = size;
|
||||
this.getData();
|
||||
},
|
||||
handleCurrentChange(page) {
|
||||
this.currentPage = page;
|
||||
this.getData();
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.box {
|
||||
padding-top: 20px;
|
||||
background: #ecf0f5;
|
||||
.inquire {
|
||||
display: inline-block;
|
||||
margin-right: 20px;
|
||||
span {
|
||||
margin-right: 10px;
|
||||
}
|
||||
.input {
|
||||
width: 180px;
|
||||
margin-right: 10px;
|
||||
}
|
||||
}
|
||||
.paginationClass {
|
||||
margin: 15px 0 5px 0px;
|
||||
}
|
||||
}
|
||||
</style>
|
841
src/views/weeklyCard/weekCardSet.vue
Normal file
841
src/views/weeklyCard/weekCardSet.vue
Normal file
@@ -0,0 +1,841 @@
|
||||
<template>
|
||||
<div class="box">
|
||||
<!-- 查询 -->
|
||||
<div class="inquire">
|
||||
<div class="block">
|
||||
<!-- 地区 -->
|
||||
<span class="demonstration">地区</span>
|
||||
<el-select filterable v-model="inquire.value" placeholder="请选择">
|
||||
<el-option
|
||||
v-for="item in inquire.options"
|
||||
:key="item.id"
|
||||
:label="item.desc"
|
||||
:value="item.id"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="inquire">
|
||||
<div class="block">
|
||||
<!-- 地区 -->
|
||||
<span class="demonstration">周卡栏</span>
|
||||
<el-select filterable v-model="inquire.value2" placeholder="请选择">
|
||||
<el-option
|
||||
v-for="item in inquire.options2"
|
||||
:key="item.id"
|
||||
:label="item.desc"
|
||||
:value="item.id"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 查询按钮 -->
|
||||
<el-button class="primary" type="primary" @click="getData()"
|
||||
>查询</el-button
|
||||
>
|
||||
<!-- 新增按钮 -->
|
||||
<el-button class="primary" type="primary" @click="add()">新增</el-button>
|
||||
</div>
|
||||
<!-- 表格 -->
|
||||
<el-table
|
||||
v-loading="loading"
|
||||
:data="tableData"
|
||||
border
|
||||
style="width: 100%; margin-top: 25px"
|
||||
>
|
||||
<el-table-column prop="id" align="center" label="ID" />
|
||||
<el-table-column prop="groupName" align="center" label="日期" />
|
||||
<el-table-column prop="rewardType" align="center" label="金币">
|
||||
<template v-slot="scope">
|
||||
{{ scope.row.rewardType == 1 ? scope.row.rewardNum : "/" }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="rewardType" align="center" label="礼物类型">
|
||||
<template v-slot="scope">
|
||||
{{ rewardTypeNumFun(scope.row.rewardType).name }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="rewardName" align="center" label="礼物名称" />
|
||||
<el-table-column prop="rewardPrice" align="center" label="礼物价值" />
|
||||
<el-table-column prop="rewardNum" align="center" label="数量" />
|
||||
<el-table-column prop="rewardValue" align="center" label="可用天数" />
|
||||
<el-table-column prop="seqNo" align="center" label="排序" />
|
||||
<el-table-column
|
||||
align="center"
|
||||
prop="cardIcon"
|
||||
label="卡片ICON"
|
||||
width="120"
|
||||
>
|
||||
<template v-slot="scope">
|
||||
<el-image
|
||||
style="width: 100px; height: 100px"
|
||||
:src="scope.row.cardIcon"
|
||||
:zoom-rate="1.1"
|
||||
:preview-src-list="scope.row.cardIcon"
|
||||
fit="cover"
|
||||
preview-teleported="true"
|
||||
hide-on-click-modal="true"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
align="center"
|
||||
prop="rewardIcon"
|
||||
label="奖励ICON"
|
||||
width="120"
|
||||
>
|
||||
<template v-slot="scope">
|
||||
<el-image
|
||||
style="width: 100px; height: 100px"
|
||||
:src="scope.row.rewardIcon"
|
||||
:zoom-rate="1.1"
|
||||
:preview-src-list="scope.row.rewardIcon"
|
||||
fit="cover"
|
||||
preview-teleported="true"
|
||||
hide-on-click-modal="true"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="操作">
|
||||
<template v-slot="scope">
|
||||
<el-button
|
||||
@click="eid(scope)"
|
||||
class="primary"
|
||||
type="primary"
|
||||
size="default"
|
||||
>编辑</el-button
|
||||
>
|
||||
<el-button
|
||||
@click="
|
||||
delDialog = true;
|
||||
delObj = scope.row;
|
||||
"
|
||||
:class="scope.row.isEnabled == 1 ? 'danger' : 'primary'"
|
||||
:type="scope.row.isEnabled == 1 ? 'danger' : 'primary'"
|
||||
size="default"
|
||||
>{{ scope.row.isEnabled == 1 ? "下线" : "上线" }}</el-button
|
||||
>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<!-- 分页 -->
|
||||
<el-pagination
|
||||
style="margin-top: 10px"
|
||||
class="paginationClass"
|
||||
v-model:current-page="currentPage"
|
||||
v-model:page-size="pageSize"
|
||||
:page-sizes="[10, 20, 30, 40, 50, 100, 200, 300, 400, 500, 999999999]"
|
||||
layout="sizes, prev, pager, next"
|
||||
:total="total"
|
||||
@size-change="handleSizeChange"
|
||||
@current-change="handleCurrentChange"
|
||||
/>
|
||||
|
||||
<!-- 添加和编辑弹窗 -->
|
||||
<el-dialog
|
||||
v-model="operationDialog"
|
||||
:title="operationTitle"
|
||||
width="30%"
|
||||
center
|
||||
>
|
||||
<!-- 输入日期 -->
|
||||
<div class="selectBox">
|
||||
<span class="left" style="margin-right: 20px">输入日期</span>
|
||||
<el-select filterable v-model="operation.days" placeholder="请选择">
|
||||
<el-option
|
||||
v-for="item in operation.optionsDays"
|
||||
:key="item.id"
|
||||
:label="item.desc"
|
||||
:value="item.id"
|
||||
>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
<!-- 金币数量 -->
|
||||
<div class="selectBox">
|
||||
<span class="left" style="margin-right: 20px">金币数量</span>
|
||||
<el-input
|
||||
v-model="operation.gameName"
|
||||
size="default"
|
||||
placeholder=""
|
||||
class="right"
|
||||
style="width: 70%"
|
||||
></el-input>
|
||||
</div>
|
||||
<!-- 游戏icon -->
|
||||
<div class="selectBox selectBoxImg">
|
||||
<span class="left" style="margin-right: 20px">金币icon</span>
|
||||
<el-upload
|
||||
class="avatar-uploader"
|
||||
action="/admin/tencent/cos/upload/file"
|
||||
:show-file-list="false"
|
||||
:on-success="handleAvatarSuccess"
|
||||
:before-upload="beforeAvatarUpload"
|
||||
:on-error="handleAvatarError"
|
||||
>
|
||||
<img
|
||||
v-if="operation.imageUrl1"
|
||||
:src="operation.imageUrl1"
|
||||
class="avatar"
|
||||
/>
|
||||
<el-icon v-else class="avatar-uploader-icon"><Plus /></el-icon>
|
||||
</el-upload>
|
||||
</div>
|
||||
<!-- 选择礼物类型 -->
|
||||
<div style="margin-bottom: 25px; margin-top: 10px; width: 134%">
|
||||
<span
|
||||
style="display: inline-block; margin-right: 20px"
|
||||
class="col-sm-2 control-label"
|
||||
>选择礼物类型</span
|
||||
>
|
||||
<el-select
|
||||
filterable
|
||||
v-model="operation.value"
|
||||
@change="optionsChange()"
|
||||
placeholder="请选择"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in operation.options"
|
||||
:key="item.id"
|
||||
:label="item.desc"
|
||||
:value="item.id"
|
||||
>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
<!-- 奖励 -->
|
||||
<div
|
||||
v-show="operationIsShow"
|
||||
style="margin-bottom: 25px; margin-top: 10px; width: 134%"
|
||||
>
|
||||
<span
|
||||
style="display: inline-block; margin-right: 20px"
|
||||
class="col-sm-2 control-label"
|
||||
>奖励</span
|
||||
>
|
||||
<el-select
|
||||
filterable
|
||||
v-model="operation.value2"
|
||||
@change="operationChange(e)"
|
||||
placeholder="请选择"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in operation.options2"
|
||||
:key="item.id"
|
||||
:label="
|
||||
operation.value == 2
|
||||
? JsonFunc(item.giftName).zh
|
||||
: operation.value == 16 || operation.value == 17
|
||||
? JsonFunc(item.name).zh
|
||||
: item.name
|
||||
"
|
||||
:value="operation.value == 2 ? item.giftId : item.id"
|
||||
>
|
||||
<!-- item.name -->
|
||||
</el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
<!-- 奖励天数 -->
|
||||
<div v-show="operationIsShow" class="selectBox">
|
||||
<span class="left" style="margin-right: 20px">奖励天数</span>
|
||||
<el-input
|
||||
v-model="operation.rewardDays"
|
||||
size="default"
|
||||
placeholder="特权类奖励请输入天数,其他不需要填写"
|
||||
class="right"
|
||||
style="width: 70%"
|
||||
></el-input>
|
||||
</div>
|
||||
<!-- 奖励个数v-show="!operationIsShow" -->
|
||||
<div class="selectBox">
|
||||
<span class="left" style="margin-right: 20px">奖励个数</span>
|
||||
<el-input
|
||||
v-model="operation.rewardGoldNum"
|
||||
size="default"
|
||||
placeholder="金币/金币礼物请输入数量"
|
||||
class="right"
|
||||
style="width: 70%"
|
||||
></el-input>
|
||||
</div>
|
||||
<!-- 排序 -->
|
||||
<div class="selectBox">
|
||||
<span class="left" style="margin-right: 20px">排序</span>
|
||||
<el-input
|
||||
v-model="operation.seqNo"
|
||||
size="default"
|
||||
placeholder="请输入排序,越小排序越前 "
|
||||
class="right"
|
||||
style="width: 70%"
|
||||
></el-input>
|
||||
</div>
|
||||
<!-- 操作 -->
|
||||
<template #footer>
|
||||
<span class="dialog-footer">
|
||||
<el-button @click="operationDialog = false">取消</el-button>
|
||||
<el-button type="primary" @click="operationClick()"> 确认 </el-button>
|
||||
</span>
|
||||
</template>
|
||||
</el-dialog>
|
||||
|
||||
<!-- 二次确认弹窗 -->
|
||||
<el-dialog
|
||||
destroy-on-close
|
||||
v-model="delDialog"
|
||||
title="提示"
|
||||
width="30%"
|
||||
center
|
||||
>
|
||||
<span> 确定要进行该操作吗?</span>
|
||||
<template #footer>
|
||||
<span class="dialog-footer">
|
||||
<el-button @click="delDialog = false">取消</el-button>
|
||||
<el-button type="primary" @click="delClick()"> 确认 </el-button>
|
||||
</span>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
listPartitionInfo,
|
||||
weekCardPage,
|
||||
getAll,
|
||||
carAll,
|
||||
headwearAll,
|
||||
nameplateAll,
|
||||
chatbubbleAll,
|
||||
infocard,
|
||||
weekCardSave,
|
||||
updateEnabled,
|
||||
} from "@/api/weeklyCard/weeklyCard";
|
||||
import { dateFormat } from "@/utils/system-helper";
|
||||
import { ElMessage } from "element-plus";
|
||||
|
||||
export default {
|
||||
name: "weekCardSet",
|
||||
data() {
|
||||
return {
|
||||
inquire: {
|
||||
value: "",
|
||||
options: [],
|
||||
value2: "",
|
||||
value22: "",
|
||||
options2: [
|
||||
{ desc: "初级周卡", id: 1 },
|
||||
{ desc: "中级周卡", id: 2 },
|
||||
{ desc: "高级周卡", id: 3 },
|
||||
],
|
||||
},
|
||||
giftArr: [],
|
||||
carArr: [],
|
||||
headArr: [],
|
||||
nameplateArr: [],
|
||||
bubbleArr: [],
|
||||
cardArr: [],
|
||||
loading: false,
|
||||
// 表格数据
|
||||
tableData: [],
|
||||
// 分页
|
||||
total: 10, //总页数
|
||||
currentPage: 1, //页码
|
||||
pageSize: 10, //条数
|
||||
// 编辑
|
||||
operationDialog: false,
|
||||
operationType: 1, //1添加2编辑
|
||||
operationTitle: "编辑&添加",
|
||||
operatioObj: {},
|
||||
operation: {
|
||||
days: "",
|
||||
optionsDays: [
|
||||
{ desc: "第一天", id: 1 },
|
||||
{ desc: "第二天", id: 2 },
|
||||
{ desc: "第三天", id: 3 },
|
||||
{ desc: "第四天", id: 4 },
|
||||
{ desc: "第五天", id: 5 },
|
||||
{ desc: "第六天", id: 6 },
|
||||
{ desc: "第七天", id: 7 },
|
||||
],
|
||||
gameName: "",
|
||||
imageUrl1: "",
|
||||
value: "",
|
||||
options: [
|
||||
{ desc: "金币", id: 1 },
|
||||
{ desc: "礼物", id: 2 },
|
||||
{ desc: "铭牌", id: 14 },
|
||||
{ desc: "头饰", id: 4 },
|
||||
{ desc: "气泡", id: 16 },
|
||||
{ desc: "资料卡", id: 17 },
|
||||
{ desc: "座驾", id: 3 },
|
||||
],
|
||||
value2: "",
|
||||
value22: "",
|
||||
options2: [],
|
||||
rewardDays: "",
|
||||
rewardGoldNum: "",
|
||||
seqNo: "",
|
||||
},
|
||||
operationIsShow: true,
|
||||
// 上下线
|
||||
delDialog: false,
|
||||
delObj: {},
|
||||
};
|
||||
},
|
||||
created() {
|
||||
// this.getData();
|
||||
listPartitionInfo().then((res) => {
|
||||
this.inquire.options = res.data;
|
||||
});
|
||||
this.loading = true;
|
||||
getAll().then((res) => {
|
||||
this.giftArr = res.data;
|
||||
carAll().then((res) => {
|
||||
this.carArr = res.data;
|
||||
headwearAll().then((res) => {
|
||||
this.headArr = res.data;
|
||||
nameplateAll().then((res) => {
|
||||
this.nameplateArr = res.data;
|
||||
chatbubbleAll().then((res) => {
|
||||
this.bubbleArr = res.data;
|
||||
infocard().then((res) => {
|
||||
this.cardArr = res.data;
|
||||
this.loading = false;
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
// 上线下线
|
||||
delClick() {
|
||||
updateEnabled({
|
||||
weekCardId: this.delObj.id,
|
||||
isEnabled: !this.delObj.isEnabled == true ? 1 : 2,
|
||||
}).then((res) => {
|
||||
if (res.code === 200) {
|
||||
this.getData();
|
||||
this.loading = false;
|
||||
this.delDialog = false;
|
||||
} else {
|
||||
ElMessage({
|
||||
showClose: true,
|
||||
message: res.message,
|
||||
type: "error",
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
// 查询
|
||||
getData() {
|
||||
this.loading = true;
|
||||
weekCardPage({
|
||||
page: this.currentPage,
|
||||
pageSize: this.pageSize,
|
||||
partitionId: this.inquire.value,
|
||||
tabId: this.inquire.value2,
|
||||
})
|
||||
.then((res) => {
|
||||
if (res.code === 200) {
|
||||
this.tableData = res.data.records;
|
||||
this.total = res.data.total;
|
||||
} else {
|
||||
ElMessage({
|
||||
showClose: true,
|
||||
message: res.message || "获取数据失败",
|
||||
type: "error",
|
||||
});
|
||||
}
|
||||
this.loading = false;
|
||||
})
|
||||
.catch((error) => {
|
||||
console.error("请求出错:", error);
|
||||
ElMessage({
|
||||
showClose: true,
|
||||
message: "请求出错,请稍后重试",
|
||||
type: "error",
|
||||
});
|
||||
});
|
||||
},
|
||||
// 监听礼物类型
|
||||
optionsChange() {
|
||||
let than = this;
|
||||
var type = than.operation.value;
|
||||
than.operation.value2 = "";
|
||||
if (type) {
|
||||
than.operationIsShow = true;
|
||||
if (type == 2) {
|
||||
//礼物
|
||||
than.operation.options2 = than.giftArr;
|
||||
} else if (type == 3) {
|
||||
//座驾
|
||||
than.operation.options2 = than.carArr;
|
||||
} else if (type == 4) {
|
||||
//头饰
|
||||
than.operation.options2 = than.headArr;
|
||||
} else if (type == 14) {
|
||||
//铭牌
|
||||
than.operation.options2 = than.nameplateArr;
|
||||
} else if (type == 16) {
|
||||
//气泡
|
||||
than.operation.options2 = than.bubbleArr;
|
||||
} else if (type == 17) {
|
||||
//资料卡
|
||||
than.operation.options2 = than.cardArr;
|
||||
} else if (type == 1) {
|
||||
//金币
|
||||
than.operationIsShow = false;
|
||||
}
|
||||
}
|
||||
},
|
||||
operationChange() {
|
||||
this.operation.options2.forEach((res, i) => {
|
||||
if (this.operation.value == 2) {
|
||||
if (res.giftId == this.operation.value2) {
|
||||
this.operation.value22 =
|
||||
this.operation.value == 2
|
||||
? this.JsonFunc(res.giftName).zh
|
||||
: this.operation.value == 16 || this.operation.value == 17
|
||||
? this.JsonFunc(res.name).zh
|
||||
: res.name;
|
||||
}
|
||||
} else {
|
||||
if (res.id == this.operation.value2) {
|
||||
this.operation.value22 =
|
||||
this.operation.value == 2
|
||||
? this.JsonFunc(res.giftName).zh
|
||||
: this.operation.value == 16 || this.operation.value == 17
|
||||
? this.JsonFunc(res.name).zh
|
||||
: res.name;
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
// 新增
|
||||
add() {
|
||||
this.operation = {
|
||||
days: "",
|
||||
optionsDays: [
|
||||
{ desc: "第一天", id: 1 },
|
||||
{ desc: "第二天", id: 2 },
|
||||
{ desc: "第三天", id: 3 },
|
||||
{ desc: "第四天", id: 4 },
|
||||
{ desc: "第五天", id: 5 },
|
||||
{ desc: "第六天", id: 6 },
|
||||
{ desc: "第七天", id: 7 },
|
||||
],
|
||||
gameName: "",
|
||||
imageUrl1: "",
|
||||
value: "",
|
||||
options: [
|
||||
{ desc: "金币", id: 1 },
|
||||
{ desc: "礼物", id: 2 },
|
||||
{ desc: "铭牌", id: 14 },
|
||||
{ desc: "头饰", id: 4 },
|
||||
{ desc: "气泡", id: 16 },
|
||||
{ desc: "资料卡", id: 17 },
|
||||
{ desc: "座驾", id: 3 },
|
||||
],
|
||||
value2: "",
|
||||
options2: [],
|
||||
rewardDays: "",
|
||||
rewardGoldNum: "",
|
||||
seqNo: "",
|
||||
};
|
||||
this.operationType = 1;
|
||||
this.operationTitle = "添加";
|
||||
this.operationDialog = true;
|
||||
},
|
||||
// 编辑
|
||||
eid(scope) {
|
||||
this.operationDialog = true;
|
||||
this.operatioObj = scope.row;
|
||||
this.operation = {
|
||||
days: this.operatioObj.groupId,
|
||||
optionsDays: [
|
||||
{ desc: "第一天", id: 1 },
|
||||
{ desc: "第二天", id: 2 },
|
||||
{ desc: "第三天", id: 3 },
|
||||
{ desc: "第四天", id: 4 },
|
||||
{ desc: "第五天", id: 5 },
|
||||
{ desc: "第六天", id: 6 },
|
||||
{ desc: "第七天", id: 7 },
|
||||
],
|
||||
gameName: this.operatioObj.rewardValue,
|
||||
imageUrl1: this.operatioObj.cardIcon,
|
||||
value: this.operatioObj.rewardType,
|
||||
options: [
|
||||
{ desc: "金币", id: 1 },
|
||||
{ desc: "礼物", id: 2 },
|
||||
{ desc: "铭牌", id: 14 },
|
||||
{ desc: "头饰", id: 4 },
|
||||
{ desc: "气泡", id: 16 },
|
||||
{ desc: "资料卡", id: 17 },
|
||||
{ desc: "座驾", id: 3 },
|
||||
],
|
||||
value2: this.operatioObj.rewardId,
|
||||
options2:
|
||||
this.operatioObj.rewardType == 2
|
||||
? this.giftArr
|
||||
: this.operatioObj.rewardType == 3
|
||||
? this.carArr
|
||||
: this.operatioObj.rewardType == 4
|
||||
? this.headArr
|
||||
: this.operatioObj.rewardType == 14
|
||||
? this.nameplateArr
|
||||
: this.operatioObj.rewardType == 16
|
||||
? this.bubbleArr
|
||||
: this.operatioObj.rewardType == 17
|
||||
? this.cardArr
|
||||
: "",
|
||||
|
||||
rewardDays: this.operatioObj.rewardValue,
|
||||
rewardGoldNum: this.operatioObj.rewardNum,
|
||||
seqNo: this.operatioObj.seqNo,
|
||||
};
|
||||
this.operationType = 2;
|
||||
this.operationTitle = "编辑";
|
||||
this.operationDialog = true;
|
||||
},
|
||||
// 确认按钮
|
||||
operationClick() {
|
||||
if (this.operationType == 1) {
|
||||
// 新增
|
||||
weekCardSave({
|
||||
groupId: this.operation.days,
|
||||
groupName:
|
||||
this.operation.days == 1
|
||||
? "第一天"
|
||||
: this.operation.days == 2
|
||||
? "第二天"
|
||||
: this.operation.days == 3
|
||||
? "第三天"
|
||||
: this.operation.days == 4
|
||||
? "第四天"
|
||||
: this.operation.days == 5
|
||||
? "第五天"
|
||||
: this.operation.days == 6
|
||||
? "第六天"
|
||||
: "第七天",
|
||||
rewardPrice: this.operation.gameName,
|
||||
cardIcon: this.operation.imageUrl1,
|
||||
rewardType: this.operation.value,
|
||||
rewardId: this.operation.value2,
|
||||
rewardName: this.operation.value22,
|
||||
rewardNum: this.operation.rewardGoldNum,
|
||||
seqNo: this.operation.seqNo,
|
||||
partitionId: this.inquire.value1,
|
||||
tabId: this.inquire.value2,
|
||||
})
|
||||
.then((res) => {
|
||||
if (res.code === 200) {
|
||||
this.operationDialog = false;
|
||||
this.getData();
|
||||
this.loading = false;
|
||||
} else {
|
||||
ElMessage({
|
||||
showClose: true,
|
||||
message: res.message || "获取数据失败",
|
||||
type: "error",
|
||||
});
|
||||
}
|
||||
})
|
||||
.catch((error) => {
|
||||
console.error("请求出错:", error);
|
||||
ElMessage({
|
||||
showClose: true,
|
||||
message: "请求出错,请稍后重试",
|
||||
type: "error",
|
||||
});
|
||||
});
|
||||
} else {
|
||||
// 编辑
|
||||
weekCardSave({
|
||||
groupId: this.operation.days,
|
||||
groupName:
|
||||
this.operation.days == 1
|
||||
? "第一天"
|
||||
: this.operation.days == 2
|
||||
? "第二天"
|
||||
: this.operation.days == 3
|
||||
? "第三天"
|
||||
: this.operation.days == 4
|
||||
? "第四天"
|
||||
: this.operation.days == 5
|
||||
? "第五天"
|
||||
: this.operation.days == 6
|
||||
? "第六天"
|
||||
: "第七天",
|
||||
rewardPrice: this.operation.gameName,
|
||||
cardIcon: this.operation.imageUrl1,
|
||||
rewardType: this.operation.value,
|
||||
rewardId: this.operation.value2,
|
||||
rewardName: this.operation.value22,
|
||||
rewardNum: this.operation.rewardGoldNum,
|
||||
seqNo: this.operation.seqNo,
|
||||
id: this.operatioObj.id,
|
||||
partitionId: this.inquire.value1,
|
||||
tabId: this.inquire.value2,
|
||||
})
|
||||
.then((res) => {
|
||||
if (res.code === 200) {
|
||||
this.getData();
|
||||
this.operationDialog = false;
|
||||
this.loading = false;
|
||||
} else {
|
||||
ElMessage({
|
||||
showClose: true,
|
||||
message: res.message || "获取数据失败",
|
||||
type: "error",
|
||||
});
|
||||
}
|
||||
})
|
||||
.catch((error) => {
|
||||
console.error("请求出错:", error);
|
||||
ElMessage({
|
||||
showClose: true,
|
||||
message: "请求出错,请稍后重试",
|
||||
type: "error",
|
||||
});
|
||||
});
|
||||
}
|
||||
},
|
||||
// 单位判断
|
||||
rewardTypeNumFun(num) {
|
||||
if (num == 1) {
|
||||
return { name: "金币", unit: "个" };
|
||||
} else if (num == 2) {
|
||||
return { name: "礼物", unit: "个" };
|
||||
} else if (num == 3) {
|
||||
return { name: "座驾", unit: "天" };
|
||||
} else if (num == 4) {
|
||||
return { name: "头饰", unit: "天" };
|
||||
} else if (num == 5) {
|
||||
return { name: "背景", unit: "天" };
|
||||
} else if (num == 6) {
|
||||
return { name: "实物", unit: "个" };
|
||||
} else if (num == 7) {
|
||||
return { name: "靓号", unit: "天" };
|
||||
} else if (num == 8) {
|
||||
return { name: "全麦礼物", unit: "个" };
|
||||
} else if (num == 9) {
|
||||
return { name: "随机靓号", unit: "天" };
|
||||
} else if (num == 10) {
|
||||
return { name: "锤子", unit: "个" };
|
||||
} else if (num == 13) {
|
||||
return { name: "祝福语", unit: "天" };
|
||||
} else if (num == 14) {
|
||||
return { name: "铭牌", unit: "天" };
|
||||
} else if (num == 15) {
|
||||
return { name: "虚拟货币", unit: "个" };
|
||||
} else if (num == 16) {
|
||||
return { name: "聊天气泡", unit: "天" };
|
||||
} else if (num == 17) {
|
||||
return { name: "资料卡", unit: "天" };
|
||||
} else {
|
||||
return { name: "null", unit: "null" };
|
||||
}
|
||||
},
|
||||
beforeAvatarUpload() {
|
||||
ElMessage({
|
||||
showClose: true,
|
||||
message: "上传中~",
|
||||
type: "warning",
|
||||
});
|
||||
},
|
||||
handleAvatarError() {
|
||||
ElMessage({
|
||||
showClose: true,
|
||||
message: "上传失败!",
|
||||
type: "error",
|
||||
});
|
||||
},
|
||||
handleAvatarSuccess(res, file) {
|
||||
console.log(file);
|
||||
// this.operation.imageUrl1 = URL.createObjectURL();
|
||||
this.operation.imageUrl1 = file.response.data;
|
||||
ElMessage({
|
||||
showClose: true,
|
||||
message: "上传成功!",
|
||||
type: "success",
|
||||
});
|
||||
},
|
||||
// 分页导航
|
||||
handleSizeChange(size) {
|
||||
this.pageSize = size;
|
||||
this.getData();
|
||||
this.loading = false;
|
||||
},
|
||||
handleCurrentChange(page) {
|
||||
this.currentPage = page;
|
||||
this.getData();
|
||||
this.loading = false;
|
||||
},
|
||||
JsonFunc(val) {
|
||||
var res = JSON.parse(val);
|
||||
return res;
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.box {
|
||||
padding-top: 20px;
|
||||
background: #ecf0f5;
|
||||
.inquire {
|
||||
display: inline-block;
|
||||
margin-right: 20px;
|
||||
span {
|
||||
margin-right: 10px;
|
||||
}
|
||||
.input {
|
||||
width: 180px;
|
||||
margin-right: 10px;
|
||||
}
|
||||
}
|
||||
.paginationClass {
|
||||
margin: 15px 0 5px 0px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
<style scoped>
|
||||
.avatar-uploader .avatar {
|
||||
width: 178px;
|
||||
height: 178px;
|
||||
display: block;
|
||||
}
|
||||
.selectBox {
|
||||
display: flex;
|
||||
height: 35px;
|
||||
line-height: 35px;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
.selectBox span {
|
||||
min-width: 80px;
|
||||
}
|
||||
.selectBoxImg {
|
||||
height: 150px;
|
||||
}
|
||||
</style>
|
||||
|
||||
<style>
|
||||
.avatar-uploader .el-upload {
|
||||
border: 1px dashed var(--el-border-color);
|
||||
border-radius: 6px;
|
||||
cursor: pointer;
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
transition: var(--el-transition-duration-fast);
|
||||
width: 150px;
|
||||
height: 150px;
|
||||
}
|
||||
|
||||
.avatar-uploader .el-upload .el-upload__input {
|
||||
display: none;
|
||||
}
|
||||
.avatar-uploader .el-upload:hover {
|
||||
border-color: var(--el-color-primary);
|
||||
}
|
||||
</style>
|
293
src/views/weeklyCard/weekCardStatistics.vue
Normal file
293
src/views/weeklyCard/weekCardStatistics.vue
Normal file
@@ -0,0 +1,293 @@
|
||||
<template>
|
||||
<div class="box">
|
||||
<!-- 查询 -->
|
||||
<div class="inquire">
|
||||
<div class="block">
|
||||
<!-- 地区 -->
|
||||
<span class="demonstration">地区</span>
|
||||
<el-select filterable v-model="inquire.value" placeholder="请选择">
|
||||
<el-option
|
||||
v-for="item in inquire.options"
|
||||
:key="item.id"
|
||||
:label="item.desc"
|
||||
:value="item.id"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 时间选择器 -->
|
||||
<div class="inquire">
|
||||
<div class="block">
|
||||
<span class="demonstration">日期</span>
|
||||
<el-date-picker
|
||||
v-model="inquire.time"
|
||||
type="datetimerange"
|
||||
range-separator="至"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
></el-date-picker>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 查询按钮 -->
|
||||
<el-button class="primary" type="primary" @click="getData()"
|
||||
>查询</el-button
|
||||
>
|
||||
<!-- 导出按钮 -->
|
||||
<el-button class="primary" type="primary" @click="derive()">导出</el-button>
|
||||
</div>
|
||||
<!-- 表格 -->
|
||||
<el-table
|
||||
v-loading="loading"
|
||||
:data="tableData"
|
||||
border
|
||||
style="width: 100%; margin-top: 25px"
|
||||
>
|
||||
<el-table-column prop="dateTime" align="center" label="日期" />
|
||||
<el-table-column prop="userNum1" align="center" label="初级周卡获得人数" />
|
||||
<el-table-column prop="userNum2" align="center" label="中级周卡获得人数" />
|
||||
<el-table-column prop="userNum3" align="center" label="高级周卡获得人数" />
|
||||
<el-table-column prop="chargeAmount" align="center" label="充值金额" />
|
||||
<el-table-column align="center" label="操作">
|
||||
<template v-slot="scope">
|
||||
<el-button
|
||||
@click="detial(scope.row)"
|
||||
class="primary"
|
||||
type="primary"
|
||||
size="default"
|
||||
>详情</el-button
|
||||
>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<!-- 分页 -->
|
||||
<el-pagination
|
||||
style="margin-top: 10px"
|
||||
class="paginationClass"
|
||||
v-model:current-page="currentPage"
|
||||
v-model:page-size="pageSize"
|
||||
:page-sizes="[10, 20, 30, 40, 50, 100, 200, 300, 400, 500, 999999999]"
|
||||
layout="sizes, prev, pager, next"
|
||||
:total="total"
|
||||
@size-change="handleSizeChange"
|
||||
@current-change="handleCurrentChange"
|
||||
/>
|
||||
|
||||
<!-- 详情弹窗 -->
|
||||
<el-dialog
|
||||
destroy-on-close
|
||||
class="pub"
|
||||
v-model="controlsDialog"
|
||||
title="详情"
|
||||
width="32%"
|
||||
center
|
||||
>
|
||||
<!-- 内表格 -->
|
||||
<el-table
|
||||
v-loading="loading2"
|
||||
:data="tableData2"
|
||||
border
|
||||
style="width: 100%; margin-top: 25px"
|
||||
>
|
||||
<el-table-column prop="erBanNo" align="center" label="用户ID" />
|
||||
<el-table-column prop="nick" align="center" label="用户昵称" />
|
||||
<el-table-column prop="tabName" align="center" label="购买档位" />
|
||||
<el-table-column prop="chargeAmount" align="center" label="购买金额" />
|
||||
<el-table-column prop="createTimeStr" align="center" label="购买时间" />
|
||||
</el-table>
|
||||
<!-- 分页 -->
|
||||
<el-pagination
|
||||
style="margin-top: 10px"
|
||||
class="paginationClass"
|
||||
v-model:current-page="currentPage2"
|
||||
v-model:page-size="pageSize2"
|
||||
:page-sizes="[10, 20, 30, 40, 50, 100, 200, 300, 400, 500, 999999999]"
|
||||
layout="sizes, prev, pager, next"
|
||||
:total="total"
|
||||
@size-change="handleSizeChange2"
|
||||
@current-change="handleCurrentChange2"
|
||||
/>
|
||||
<!-- 弹窗按钮 -->
|
||||
<template #footer>
|
||||
<span class="dialog-footer">
|
||||
<el-button @click="controlsDialog = false">关闭</el-button>
|
||||
</span>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
weekCardRecordPage,
|
||||
listPartitionInfo,
|
||||
weekCardRecordExport,
|
||||
weekCardRecordGetDetailPage,
|
||||
} from "@/api/weeklyCard/weeklyCard";
|
||||
import { dateFormat } from "@/utils/system-helper";
|
||||
import { ElMessage } from "element-plus";
|
||||
|
||||
export default {
|
||||
name: "weekCardStatistics",
|
||||
data() {
|
||||
return {
|
||||
inquire: {
|
||||
time: "",
|
||||
value: "",
|
||||
options: [],
|
||||
},
|
||||
loading: false,
|
||||
loading2: false,
|
||||
// 表格数据
|
||||
tableData: [],
|
||||
tableData2: [],
|
||||
// 分页
|
||||
total: 10, //总页数
|
||||
currentPage: 1, //页码
|
||||
pageSize: 10, //条数
|
||||
// 分页2
|
||||
total2: 10, //总页数
|
||||
currentPage2: 1, //页码
|
||||
pageSize2: 10, //条数
|
||||
// 编辑
|
||||
controlsDialog: false,
|
||||
controlsObjNew: false,
|
||||
controlsObj: {
|
||||
value: "",
|
||||
options: [],
|
||||
num: "",
|
||||
},
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getData();
|
||||
listPartitionInfo().then((res) => {
|
||||
this.inquire.options = res.data;
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
getData() {
|
||||
this.loading = true;
|
||||
let startTime = "";
|
||||
let endTime = "";
|
||||
if (this.inquire.time && this.inquire.time.length > 0) {
|
||||
startTime = dateFormat(this.inquire.time[0], "yyyy-MM-dd hh:mm:ss");
|
||||
endTime = dateFormat(this.inquire.time[1], "yyyy-MM-dd hh:mm:ss");
|
||||
}
|
||||
this.loading = true;
|
||||
weekCardRecordPage({
|
||||
startTime,
|
||||
endTime,
|
||||
partitionId: this.inquire.value,
|
||||
pageSize: this.pageSize,
|
||||
page: this.currentPage,
|
||||
})
|
||||
.then((res) => {
|
||||
if (res.code === 200) {
|
||||
this.tableData = res.data.records;
|
||||
this.total = res.data.total;
|
||||
} else {
|
||||
ElMessage({
|
||||
showClose: true,
|
||||
message: res.message || "获取数据失败",
|
||||
type: "error",
|
||||
});
|
||||
}
|
||||
this.loading = false;
|
||||
})
|
||||
.catch((error) => {
|
||||
console.error("请求出错:", error);
|
||||
ElMessage({
|
||||
showClose: true,
|
||||
message: "请求出错,请稍后重试",
|
||||
type: "error",
|
||||
});
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
derive() {
|
||||
let startTime = "";
|
||||
let endTime = "";
|
||||
if (this.inquire.time && this.inquire.time.length > 0) {
|
||||
startTime = dateFormat(this.inquire.time[0], "yyyy-MM-dd hh:mm:ss");
|
||||
endTime = dateFormat(this.inquire.time[1], "yyyy-MM-dd hh:mm:ss");
|
||||
}
|
||||
weekCardRecordExport({
|
||||
startTime,
|
||||
endTime,
|
||||
partitionId: this.inquire.value,
|
||||
}).then((res) => {});
|
||||
},
|
||||
detial(val) {
|
||||
weekCardRecordGetDetailPage({
|
||||
page: this.currentPage2,
|
||||
pageSize: this.pageSize2,
|
||||
dateTime: val.createTimeStr,
|
||||
partitionId: this.inquire.value,
|
||||
})
|
||||
.then((res) => {
|
||||
if (res.code === 200) {
|
||||
this.tableData2 = res.data.records;
|
||||
this.total2 = res.data.total;
|
||||
} else {
|
||||
ElMessage({
|
||||
showClose: true,
|
||||
message: res.message || "获取数据失败",
|
||||
type: "error",
|
||||
});
|
||||
}
|
||||
this.controlsDialog = true;
|
||||
this.loading2 = false;
|
||||
})
|
||||
.catch((error) => {
|
||||
console.error("请求出错:", error);
|
||||
ElMessage({
|
||||
showClose: true,
|
||||
message: "请求出错,请稍后重试",
|
||||
type: "error",
|
||||
});
|
||||
this.loading2 = false;
|
||||
});
|
||||
},
|
||||
// 分页导航
|
||||
handleSizeChange2(size) {
|
||||
this.pageSize2 = size;
|
||||
this.getData();
|
||||
},
|
||||
handleCurrentChange2(page) {
|
||||
this.currentPage2 = page;
|
||||
this.getData();
|
||||
},
|
||||
// 分页导航
|
||||
handleSizeChange(size) {
|
||||
this.pageSize = size;
|
||||
this.getData();
|
||||
},
|
||||
handleCurrentChange(page) {
|
||||
this.currentPage = page;
|
||||
this.getData();
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.box {
|
||||
padding-top: 20px;
|
||||
background: #ecf0f5;
|
||||
.inquire {
|
||||
display: inline-block;
|
||||
margin-right: 20px;
|
||||
span {
|
||||
margin-right: 10px;
|
||||
}
|
||||
.input {
|
||||
width: 180px;
|
||||
margin-right: 10px;
|
||||
}
|
||||
}
|
||||
.paginationClass {
|
||||
margin: 15px 0 5px 0px;
|
||||
}
|
||||
}
|
||||
</style>
|
Reference in New Issue
Block a user