145 lines
6.1 KiB
Plaintext
145 lines
6.1 KiB
Plaintext
<%@ Page Title="" Language="C#" MasterPageFile="~/admin/Templates/TBS5ADM001/MasterPage.master" AutoEventWireup="true" CodeFile="index.aspx.cs" Inherits="admin_statistics_index" %>
|
|
|
|
<asp:Content ID="Content1" ContentPlaceHolderID="page_header" Runat="Server">
|
|
</asp:Content>
|
|
<asp:Content ID="Content2" ContentPlaceHolderID="page_nav" Runat="Server">
|
|
<div class="col-2">
|
|
<select class="form-select" v-model="selected_activity">
|
|
<option disabled value="">請選擇活動</option>
|
|
<option v-for="(item, index) in activity_list" :key="index" :value="item.num">
|
|
{{item.subject}}
|
|
</option>
|
|
</select>
|
|
</div>
|
|
</asp:Content>
|
|
<asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
|
|
<div class="container-fluid mt-1">
|
|
<div class="text-center text-h5 font-weight-bold my-4">
|
|
活動統計報表
|
|
</div>
|
|
<v-data-table
|
|
multi-sort
|
|
:headers="activity_statistics.headers"
|
|
item-key="id"
|
|
:loading="activity_statistics.loading"
|
|
:loading-text="activity_statistics.loadingtext"
|
|
:options.sync="activity_statistics.options"
|
|
:items-per-page="activity_statistics.options.itemsPerPage"
|
|
:server-items-length="activity_statistics.totalItems"
|
|
:items="activity_statistics.items">
|
|
<template #item.detail_btn="{item}">
|
|
<a :href="'activity.aspx?num='+item.id" class="btn btn-outline-secondary btn-sm" target="_blank">詳細統計</a>
|
|
</template>
|
|
<template #item.duetime="{item}">
|
|
{{item.startdate|timeString("YYYY/MM/DD")}}-{{item.enddate|timeString("YYYY/MM/DD")}}
|
|
</template>
|
|
</v-data-table>
|
|
</div>
|
|
<div class="container-fluid mt-1">
|
|
<div class="text-center text-h5 font-weight-bold my-4">信眾統計表</div>
|
|
<p>
|
|
{{activity_statistics.allGDZCount}}
|
|
</p>
|
|
</div>
|
|
</asp:Content>
|
|
<asp:Content ID="Content4" ContentPlaceHolderID="offCanvasRight" Runat="Server">
|
|
</asp:Content>
|
|
<asp:Content ID="Content5" ContentPlaceHolderID="footer_script" Runat="Server">
|
|
<script>
|
|
Vue.filter('timeString', function (value, myFormat) {
|
|
return value == null || value == "" ? "" : moment(value).format(myFormat || 'YYYY-MM-DD, HH:mm:ss');
|
|
});
|
|
let VueApp = new Vue({
|
|
el: '#app',
|
|
vuetify: new Vuetify(vuetify_options),
|
|
data() {
|
|
return {
|
|
activity_list: [],
|
|
selected_activity: '',
|
|
activity_statistics: {
|
|
loading: false,
|
|
loadingtext: "資料載入中...",
|
|
headers: [
|
|
{ text: '活動名稱', value: 'activity_name' },
|
|
{ text: '報名人數', value: 'order_count' },
|
|
{ text: '應收功德金', value: 'receivable' },
|
|
{ text: '實收功德金', value: 'received' },
|
|
{ text: '牌位總數', value: 'pw_count' },
|
|
{ text: '新增信眾人數', value: '' },//針對當前活動
|
|
{ text: '流失信眾人數', value: '' },//針對當前活動
|
|
{ text: '回歸信眾人數', value: '' },//針對當前活動
|
|
{ text: '連續多次參加信眾人數', value: '' },//針對當前活動
|
|
{ text: '功德主人數', value: 'gdz_peoples' },
|
|
{ text: '活動時間', value: 'duetime' },
|
|
{ text: '活動狀態', value: 'activity_status' },
|
|
{ text: '', value: 'detail_btn' }
|
|
],
|
|
items: [],
|
|
totalItems: 0,
|
|
options: {
|
|
page: 1,
|
|
itemsPerPage: 5,
|
|
sortBy: [],
|
|
sortDesc: [],
|
|
},
|
|
|
|
allGDZCount: 0,
|
|
}
|
|
}
|
|
},
|
|
mounted() {
|
|
this.getActivityList();
|
|
//this.getActivityStatistics();
|
|
},
|
|
methods: {
|
|
getActivityList() {
|
|
axios
|
|
.post(HTTP_HOST + 'api/statistics/activitylist')
|
|
.then(res => {
|
|
this.activity_list = res.data
|
|
})
|
|
.catch(error => {
|
|
|
|
})
|
|
},
|
|
getActivityStatistics() {
|
|
this.activity_statistics.loading = true;
|
|
const { page, itemsPerPage } = this.activity_statistics.options;
|
|
axios
|
|
.post(HTTP_HOST + 'api/statistics/activitycountlist', null, { params:{ page: page, pagesize: itemsPerPage }})
|
|
.then(res => {
|
|
this.activity_statistics.items = res.data.items;
|
|
this.activity_statistics.totalItems = res.data.count;
|
|
console.log(this.activity_statistics.options)
|
|
})
|
|
.catch(error => {
|
|
|
|
})
|
|
.finally(() => {
|
|
this.activity_statistics.loading = false;
|
|
})
|
|
},
|
|
},
|
|
watch: {
|
|
selected_activity: {
|
|
handler(newvalue, oldvalue) {
|
|
console.log('新值:', newvalue);
|
|
console.log('舊值:', oldvalue);
|
|
},
|
|
deep: true
|
|
},
|
|
'activity_statistics.options': {
|
|
handler() {
|
|
this.getActivityStatistics();
|
|
},
|
|
deep: true
|
|
}
|
|
},
|
|
computed: {
|
|
|
|
}
|
|
})
|
|
</script>
|
|
</asp:Content>
|
|
|