批次報名 統計報表修正

This commit is contained in:
2026-06-03 16:36:52 +08:00
parent 8affaaf344
commit 08d8e27bc9
10 changed files with 449 additions and 56 deletions
+122 -1
View File
@@ -2,6 +2,11 @@
<%@ Register Src="~/admin/_uc/alert.ascx" TagPrefix="uc1" TagName="alert" %>
<asp:Content ID="Content1" ContentPlaceHolderID="page_header" runat="Server">
<style>
.v-dialog{
width:80% !important;
}
</style>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="page_nav" runat="Server">
<div class="mb-2 mb-sm-0">
@@ -53,7 +58,19 @@
search: {
kind: 0,
subject: '',
}
},
signData: {
subject: "",
up_time1: "",
up_time2: "",
deadline: "",
num:null
},
startmenu: false,
endmenu: false,
deadmenu: false,
copy_dialog: { show: false, show_confirm: false, message: "" },
message_dialog: { show: false, show_confirm: false, message: "" },
}
},
watch: {
@@ -84,6 +101,30 @@
editItem(item) {
console.log("edit", item);
},
copyItem(item) {
this.signData.num=item.num
this.copy_dialog.show = true
},
gotoCopy() {
if (this.signData.subject == "" || this.signData.up_time1 == "" || this.signData.up_time2 == "" || this.signData.deadline == "") {
this.message_dialog.show = true
this.message_dialog.message = "所有欄位都必須填寫"
return false;
}
axios
.post(HTTP_HOST + "api/activity/CopyActivity", this.signData)
.then(response => {
this.message_dialog.show = true
this.message_dialog.message = response.data.message
if (response.data.result === "Y") {
this.copy_dialog.show = false;
}
})
.catch(error => console.log(error))
},
deleteItem(item) {
if (confirm('是否確定刪除此筆資料?')) {
const index = this.data_table.list.indexOf(item)
@@ -166,6 +207,7 @@
</template>
<template #item.slot_btn="{ item }">
<a :href="'reg.aspx?num='+item.num" class="btn btn-outline-secondary btn-sm"><i class="mdi mdi-pencil-box-outline"></i>修改</a>
<a @click="copyItem(item)" class="btn btn-outline-secondary btn-sm"><i class="mdi mdi-pencil-box-outline"></i>複製</a>
<a @click="deleteItem(item)" class="btn btn-outline-secondary btn-sm"><i class="mdi mdi-trash-can"></i>刪除</a>
</template>
</v-data-table>
@@ -194,6 +236,85 @@
</v-row>
</v-container>
</div>
<v-dialog v-model="message_dialog.show" class="dialog_width">
<template>
<v-card>
<v-card-title>
{{ message_dialog.message }}
</v-card-title>
<v-card-text>
<v-btn @click.prevent="message_dialog.show=false" v-if="!message_dialog.show_confirm">關閉</v-btn>
</v-card-text>
</v-card>
</template>
</v-dialog>
<v-dialog v-model="copy_dialog.show" class="dialog_width">
<template>
<v-card>
<v-card-title>
<v-text-field v-model="signData.subject"
label="請輸入法會名稱"></v-text-field>
<v-menu v-model="startmenu"
:close-on-content-click="false"
:nudge-right="40"
transition="scale-transition"
offset-y
min-width="auto">
<template v-slot:activator="{ on, attrs }">
<v-text-field v-model="signData.up_time1"
label="開始日期"
prepend-icon="mdi-calendar"
readonly
v-bind="attrs"
v-on="on"></v-text-field>
</template>
<v-date-picker v-model="signData.up_time1"
@input="startmenu = false"></v-date-picker>
</v-menu>
<v-menu v-model="endmenu"
:close-on-content-click="false"
:nudge-right="40"
transition="scale-transition"
offset-y
min-width="auto">
<template v-slot:activator="{ on, attrs }">
<v-text-field v-model="signData.up_time2"
label="結束日期"
prepend-icon="mdi-calendar"
readonly
v-bind="attrs"
v-on="on"></v-text-field>
</template>
<v-date-picker v-model="signData.up_time2"
@input="endmenu = false"></v-date-picker>
</v-menu>
<v-menu v-model="deadmenu"
:close-on-content-click="false"
:nudge-right="40"
transition="scale-transition"
offset-y
min-width="auto">
<template v-slot:activator="{ on, attrs }">
<v-text-field v-model="signData.deadline"
label="報名截止日"
prepend-icon="mdi-calendar"
readonly
v-bind="attrs"
v-on="on"></v-text-field>
</template>
<v-date-picker v-model="signData.deadline"
@input="deadmenu = false"></v-date-picker>
</v-menu>
</v-card-title>
<v-card-text>
<v-btn @click.prevent="copy_dialog.show=false">關閉</v-btn>
<v-btn @click.prevent="gotoCopy()">確認</v-btn>
</v-card-text>
</v-card>
</template>
</v-dialog>
<div id="print_data">
</div>
</asp:Content>
+5 -1
View File
@@ -69,8 +69,9 @@
</template>
<template #item.slot_btn="{ item }">
<a @click="gotoSignup(item)" class="btn btn-outline-secondary btn-sm">報名</a>
<a @click="gotoBatchSignup(item)" class="btn btn-outline-secondary btn-sm">批次報名</a>
<a @click="gotoSignupList(item)" class="btn btn-outline-secondary btn-sm">明細</a>
</template>
</v-data-table>
<v-container class="container-fluid">
@@ -206,6 +207,9 @@
this.search.subject = ""
this.search.up_time1=""
},
gotoBatchSignup(item) {
this.$emit('custom-event', { action: 'batchSign', item: item });
},
gotoSignup(item) {
this.$emit('custom-event', { action: 'add', item: item });
},
+166 -14
View File
@@ -1,13 +1,49 @@
<template>
<v-card>
<v-card-title class="bg-primary white--text text-center">
<h4>批次報名</h4>
<div class="ms-auto">
<v-btn @click.prevent="batchSave()">儲存</v-btn>
<v-btn @click.prevent="back01()">返回</v-btn>
</div>
</v-card-title>
</v-card>
<div class="container-fluid">
<v-card>
<v-card-title class="bg-primary white--text text-center">
<h4>批次報名</h4>
<div class="ms-auto">
<v-btn @click.prevent="batchSave()">儲存</v-btn>
<v-btn @click.prevent="back01()">返回</v-btn>
</div>
</v-card-title>
<v-card-text>
<v-select :items="data_table.list"
label="選擇法會"
item-text="subject"
item-value="num" v-model="selected">
</v-select>
<v-data-table v-model="detail_table.selected"
:items="detail_table.list"
:headers="detail_table.header"
:footer-props="detail_table.footer"
:server-items-length="detail_table.count"
:loading="detail_table.loading"
show-select
item-key="order_no"
hide-default-footer
:page.sync="detail_table.page"
:items-per-page.sync="detail_table.pageSize"
class="elevation-1">
<template #item.slot_btn="{ item }">
</template>
</v-data-table>
</v-card-text>
</v-card>
<v-dialog v-model="message_dialog.show" class="dialog_width">
<template>
<v-card>
<v-card-title>
{{ message_dialog.message }}
</v-card-title>
<v-card-text>
<v-btn @click.prevent="message_dialog.show=false" v-if="!message_dialog.show_confirm">關閉</v-btn>
</v-card-text>
</v-card>
</template>
</v-dialog>
</div>
</template>
<script>
module.exports = {
@@ -18,18 +54,134 @@
},
data() {
return {
options: { multiSort: false },
search_options: { multiSort: false },
message_dialog: { show: false, show_confirm: false, message: "" },
data_table: {
loading: true,
list: [],
selected: [],
singleSelect: false,
count: 0,
page: 1,
pageSize: -1,
},
selected: null,
detail_table: {
loading: false,
list: [],
selected: [],
singleSelect: false,
count: 0,
page: 1,
pageSize: -1,
header: [
{ text: '單號', value: 'order_no' },
{ text: '信眾號碼', value: 'f_num' },
{ text: '姓名', value: 'u_name' },
{ text: '報名日期', value: 'up_time' },
{ text: '單據狀態', value: 'keyin1_txt', align: 'start' },
{ text: '', value: 'slot_btn', sortable: false, align: 'end' }
],
footer: {
showFirstLastPage: true,
itemsPerPageOptions: [5, 10, 20, 30],
},
},
search: {subject:""}
}
},
methods: {
batchSave() {
activated() {
this.getActivity()
},
watch: {
selected: {
handler() {
this.getProOrder()
},
deep: true,
},
back01() {
},
methods: {
batchSave() {//批次存檔
const orders = []
this.detail_table.selected.forEach(x => {
orders.push(x.order_no)
})
const po = {
old_activity_num: this.selected,
activity_num: this.num,
orders: orders
}
axios
.post(HTTP_HOST + 'api/order/BatchSave', po)
.then(response => {
this.message_dialog.show = true;
if (response.data.result == "Y") {
let rp = response.data.data;
let other = ""
if (rp && rp.length>0) {
other = rp.join(",")
other = ",以下信眾號碼已經報過名:" + other;
}
this.message_dialog.message = response.data.message + other;
if (rp.length > 0) {
} else {
this.$emit('custom-event', { action: 'signup1', item: this.num });
}
} else {
this.message_dialog.message = response.data.message
}
}).catch(error => console.log(error))
},
back01() {//返回
this.$emit('custom-event', { action: 'signup1', item: this.num });
},
getActivity() {//撈法會資料
//const { sortBy, sortDesc, page, itemsPerPage } = this.options
const params = {
sortBy: "startDate_solar", sortDesc: true,
page: 1, pageSize: -1
};
this.data_table.loading = true
const self = this
axios
.post(HTTP_HOST + 'api/activity/GetListNew', this.search, { params: params })
.then(response => {
this.data_table.list = response.data.list
this.data_table.list=this.data_table.list.filter(x=>x.num!=self.num)
this.data_table.count = response.data.count;
this.data_table.loading = false
})
.catch(error => console.log(error))
},
getProOrder() {//撈報名資料,勾選要報名的人
const { sortBy, sortDesc, page, itemsPerPage } = this.options
const params = {
sortBy: "order_no", sortDesc: true,
page: 1, pageSize: -1
};
let newsearch = {
activity_num: this.selected
}
this.detail_table.loading = true
// sessionStorage.setItem('orderpage', '1');// clearpage ? '1' : page
axios
.post(HTTP_HOST + 'api/order/GetList', newsearch, { params: params })
.then(response => {
this.detail_table.list = response.data.list
this.detail_table.count = response.data.count;
this.detail_table.loading = false
})
.catch(error => console.log(error))
}
}
}
</script>
<style>
.v-dialog{
width:80% !important;
}
</style>
+4
View File
@@ -95,6 +95,7 @@
'fastSignUp2-component': httpVueLoader('./fastSignUp2.vue'),
'fastSignUp3-component': httpVueLoader('./fastSignUp3.vue'),
'fastSignUp4-component': httpVueLoader('./fastSignUp4.vue'),
'fastSignUp5-component': httpVueLoader('./fastSignUp5.vue'),
},
watch: {
options: {
@@ -121,6 +122,9 @@
this.currentView = "fastSignUp-component"
} else if (item.action === "oldSign") {
location.href="/admin/order/index.aspx"
} else if (item.action === "batchSign") {
this.twoData = item.item.num
this.currentView = "fastSignUp5-component"
}
//console.log("item.action:",this.twoData)
},