1. 新增法會活動品項:牌位陽上與超度人數限制功能

2. 信眾資料新增全年性選項以及開始參加活動日期,自動報名並代入前一次的報名資料(品項)
This commit is contained in:
2026-05-04 11:43:57 +08:00
parent 7644df57d0
commit 11a8c3e932
13 changed files with 995 additions and 104 deletions
+227 -19
View File
@@ -116,6 +116,15 @@
vuetify: new Vuetify(vuetify_options),
data() {
return {
init_is_auto_enroll: false,
is_auto_enroll: false,
auto_enroll_date: '',
auto_enroll_config: {
is_receipt: true, // 是否寄送收據
receipt_title: '', // 收據抬頭
receipt_address: '', // 收據地址
},
last_confirmed_date: '',
tabArray: tabtmp,
tabArray2: "",
follower_id: '<%= Request["num"] %>',
@@ -124,6 +133,18 @@
multiSort: false,
//itemsPerPage: -1,
},
confirm_dialog: {
show: false,
headers: [
{ text: '活動日期', value: 'activitydate' },
{ text: '活動名稱', value: 'activityname'},
],
title: '',
desc: '',
orders: [],
btn_cancel_text: '', // 「取消報名」按鈕文字
btn_keep_text: '' // 「保留活動」按鈕文字
},
search_dialog: {
controls: {
search1: {
@@ -485,7 +506,16 @@
]
}
},
mounted() {//一開始就載入
mounted() {
//一開始就載入
this.$nextTick(() => {
this.auto_enroll_date = document.getElementById('<%= hid_auto_enroll_start_date.ClientID %>').value;
this.is_auto_enroll = (document.getElementById('<%= hid_is_auto_enroll.ClientID %>').value.toLowerCase() === "true");
this.init_is_auto_enroll = this.is_auto_enroll;
this.auto_enroll_config.is_receipt = (document.getElementById('<%= hid_auto_enroll_is_receipt.ClientID %>').value.toLowerCase() === "true");
this.auto_enroll_config.receipt_title = document.getElementById('<%= hid_auto_enroll_receipt_title.ClientID %>').value;
this.auto_enroll_config.receipt_address = document.getElementById('<%= hid_auto_enroll_receipt_address.ClientID %>').value;
})
this.search_dialog.current = this.search_dialog.controls.search1 ///default
//console.log("mounted");
//this.initialize();
@@ -496,6 +526,30 @@
this.onCityChange();
},
watch: {
auto_enroll_config: {
handler(newVal) {
document.getElementById('<%= hid_auto_enroll_is_receipt.ClientID %>').value = newVal.is_receipt;
document.getElementById('<%= hid_auto_enroll_receipt_title.ClientID %>').value = newVal.receipt_title;
document.getElementById('<%= hid_auto_enroll_receipt_address.ClientID %>').value = newVal.receipt_address;
},
deep: true,
},
is_auto_enroll(newVal, oldVal) {
if (newVal === true) {
if (!this.auto_enroll_date) {
this.auto_enroll_date = new Date().toISOString().substr(0, 10);
this.last_confirmed_date = this.auto_enroll_date;
}
} else {
if (this.init_is_auto_enroll === true) {
this.open_confirm_dialog('CANCEL_AUTO_ENROLL');
}
}
document.getElementById('<%=hid_is_auto_enroll.ClientID%>').value = newVal;
},
auto_enroll_date(newVal) {
document.getElementById('<%=hid_auto_enroll_start_date.ClientID%>').value = newVal;
},
options: {
handler() {
//console.log("watch1", this.search_dialog, this.search_dialog.page);
@@ -537,6 +591,58 @@
}
},
methods: {
syncAddress() {
const sourceAddr = document.getElementById('<%=address.ClientID%>').value;
this.auto_enroll_config.receipt_address = sourceAddr;
},
open_confirm_dialog(type) {
const targetDate = (type === 'CANCEL_AUTO_ENROLL') ? '2099-12-31' : this.auto_enroll_date;
api_url = 'api/follower/pending_orders?id=' + '<%= Request["num"] %>' + '&targetDate=' + targetDate;
if (type === "CANCEL_AUTO_ENROLL") {
axios
.post(HTTP_HOST + api_url)
.then(response => {
this.confirm_dialog.orders = response.data.list;
this.confirm_dialog.title = "取消自動報名";
this.confirm_dialog.desc = "以下活動已報名,是否一併取消?";
this.confirm_dialog.btn_cancel_text = "取消全部活動";
this.confirm_dialog.btn_keep_text = "保留現有活動";
const orderNos = this.confirm_dialog.orders.map(o => o.orderno).join(',');
document.getElementById('<%= hid_delete_order_list.ClientID %>').value = orderNos;
if (this.confirm_dialog.orders.length > 0) this.confirm_dialog.show = true;
})
}
else if (type === "UPDATE_START_DATE") {
axios
.post(HTTP_HOST + api_url)
.then(response => {
this.confirm_dialog.orders = response.data.list;
this.confirm_dialog.title = "生效日期延後確認";
this.confirm_dialog.desc = "以下活動已報名,是否一併取消?";
this.confirm_dialog.btn_cancel_text = "取消活動";
this.confirm_dialog.btn_keep_text = "保留現有活動";
const orderNos = this.confirm_dialog.orders.map(o => o.orderno).join(',');
document.getElementById('<%= hid_delete_order_list.ClientID %>').value = orderNos;
if (this.confirm_dialog.orders.length > 0) this.confirm_dialog.show = true;
})
}
},
close_confirm_dialog() {
this.auto_enroll_date = this.last_confirmed_date;
if (!this.is_auto_enroll)this.is_auto_enroll = true;
this.confirm_dialog.show = false;
},
keep_auto_enroll_order() {
document.getElementById('<%= hid_is_delete_all_order.ClientID %>').value = "false";
this.last_confirmed_date = this.auto_enroll_date;
this.confirm_dialog.show = false;
},
delete_auto_enroll_order() {
document.getElementById('<%= hid_is_delete_all_order.ClientID %>').value = "true";
console.log("TRUE");
this.last_confirmed_date = this.auto_enroll_date;
this.confirm_dialog.show = false;
},
search_show(curr) {
console.log("btn_click:", curr, curr.api_url);
this.search_dialog.current = curr;
@@ -1335,11 +1441,12 @@
}
});
}
</script>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="page_nav" runat="Server">
<asp:HiddenField ID="hid_delete_order_list" runat="server" />
<div class="scroll-nav nav nav-tabs mb-2 mb-sm-0 d-none d-sm-flex">
<template v-if="follower_id !='' "> {{titleword()}} </template>
</div>
@@ -1564,32 +1671,92 @@
<asp:RegularExpressionValidator ControlToValidate="contactor_phone" ErrorMessage="格式有誤" ID="RegularExpressionValidator3" runat="server" ValidationExpression="^[+-]?\d+([+-]?\d*)*$" Display="Dynamic" SetFocusOnError="true" />
</div>
</div>
<div class="row mb-1 label-sm-right">
<label class="col-sm-2 col-lg-1 col-form-label">自訂標籤</label>
<div class="col-sm-2 col-lg-1 d-flex align-center justify-content-end pr-2">
<input type="checkbox"
v-model="is_auto_enroll"
style="width: 18px; height: 18px; cursor: pointer;"
class="mr-2">
<label class="col-form-label">全年報名</label>
<asp:HiddenField ID="hid_is_auto_enroll" runat="server" Value="false" />
<asp:HiddenField ID="hid_is_delete_all_order" runat="server" Value="false" />
</div>
<div class="col-sm-10 col-lg-3">
<div class="input-group">
<input ID="auto_enroll_start_date" type="date"
class="form-control"
v-model="auto_enroll_date"
:disabled="!is_auto_enroll"
@change="open_confirm_dialog('UPDATE_START_DATE')">
<asp:HiddenField ID="hid_auto_enroll_start_date" runat="server" Value="" />
<small class="text-muted" v-if="is_auto_enroll">請設定生效日期</small>
</div>
<label class="col-sm-2 col-lg-1 col-form-label text-right">自訂標籤</label>
<div class="col-sm-4 col-lg-3">
<div class="input-group">
<input type="text" class="form-control" v-model="tabArray2" v-on:keyup.enter="addTab" title="可自由輸入標籤名稱,輸入完成請按「+」,或「Enter」" placeholder="自訂標籤名稱">
<asp:HiddenField ID="tab" runat="server" />
<a class="btn btn-default" @click="addTab" ><i class="mdi mdi-plus"></i></a>
</div>
</div>
<div class="col-sm-12 col-lg-7">
<template>
<div class="">
<asp:HiddenField ID="tab" runat="server" />
<div class="input-group-append">
<button type="button" class="btn btn-default" @click="addTab"><i class="mdi mdi-plus"></i></button>
</div>
</div>
</div>
<div class="col-sm-12 col-lg-4">
<template>
<div class="">
<v-chip v-for="item,index in tabArray"
v-if="item != ''"
class="ma-2"
close
@click:close="tabArray.splice(index, 1);remove(item)"
class="ma-2"
close
@click:close="tabArray.splice(index, 1);remove(item)"
>
{{item}}
{{item}}
</v-chip>
</div>
</template>
</div>
</template>
</div>
</div>
<v-expand-transition>
<div v-show="is_auto_enroll" class="row rounded grey lighten-4 border py-4">
<div class="row mb-1 label-sm-right">
<div class="col-sm-2 col-lg-1 d-flex align-center justify-content-end pr-2">
<input type="checkbox" v-model="auto_enroll_config.is_receipt" style="width:18px; height:18px; cursor: pointer;" class="mr-2">
<label class="col-form-label">寄送收據</label>
<asp:HiddenField ID="hid_auto_enroll_is_receipt" runat="server" />
</div>
<div class="col-sm-12 col-lg-3">
<input type="text" class="form-control"
placeholder="收據抬頭" v-model="auto_enroll_config.receipt_title" :disabled="!auto_enroll_config.is_receipt">
<asp:HiddenField ID="hid_auto_enroll_receipt_title" runat="server" />
</div>
<div class="col-sm-12 col-lg-6">
<div class="input-group mb-3">
<input type="text" class="form-control"
placeholder="收據地址" v-model="auto_enroll_config.receipt_address" :disabled="!auto_enroll_config.is_receipt">
<asp:HiddenField ID="hid_auto_enroll_receipt_address" runat="server" />
<button class="btn btn-outline-secondary" type="button" @click="syncAddress" :disabled="!auto_enroll_config.is_receipt">同收件地址</button>
</div>
</div>
</div>
<div class="py-1 px-8 mb-2 text-muted" style="font-size: 0.85rem; line-height: 1.5;">
<div class="font-weight-bold mb-1">
<v-icon small color="info" class="mr-1">mdi-information</v-icon> 自動報名須知:
</div>
<ul class="pl-4 mb-0">
<li><strong>生效範疇:</strong>此處修改僅影響<strong>往後</strong>產生的訂單;既有訂單請至「報名管理」手動調整。</li>
<li><strong>品項帶入:</strong>系統將自動沿用該信眾<strong>距今最近一次</strong>的報名品項(若無歷史紀錄則不自動帶入)。</li>
</ul>
</div>
</div>
</v-expand-transition>
<div class="row mb-1">
<label class="col-form-label">備註</label>
@@ -2123,7 +2290,7 @@
<v-card>
<v-card-title class="justify-space-between grey lighten-2">
查詢:{{search_dialog.current.title}}
<v-btn icon @click="search_dialog.show=false"><v-icon>mdi-close</v-icon></v-btn>
<v-btn icon @click="search_dialog.show=false;"><v-icon>mdi-close</v-icon></v-btn>
</v-card-title>
<v-card-text >
<v-row>
@@ -2173,6 +2340,47 @@
</v-btn>
</template>
</v-snackbar>
<v-dialog v-model="confirm_dialog.show" max-width="500px" persistent>
<v-card>
<v-card-title class="justify-space-between grey lighten-2">
<span>{{ confirm_dialog.title }}</span>
<v-btn icon @click="close_confirm_dialog"><v-icon>mdi-close</v-icon></v-btn>
</v-card-title>
<v-card-text class="pt-4">
<p class="body-1">{{ confirm_dialog.desc }}</p>
<v-data-table
:headers="confirm_dialog.headers"
:items="confirm_dialog.orders"
:items-per-page="5"
class="elevation-1 grey lighten-5"
:footer-props="{
'items-per-page-text': '每頁顯示',
'items-per-page-options': [5, 10]
}"
>
<template v-slot:item.activitydate="{ item }">
<span>{{ item.activitydate }}</span>
</template>
</v-data-table>
</v-card-text>
<v-divider class="pa-0 ma-0"></v-divider>
<v-card-actions class="pa-4 justify-end">
<v-btn color="primary" @click="keep_auto_enroll_order">
{{ confirm_dialog.btn_keep_text }}
</v-btn>
<v-btn color="red" dark @click="delete_auto_enroll_order">
{{ confirm_dialog.btn_cancel_text }}
</v-btn>
</v-card-actions>
</v-card>
</v-dialog>
</div>
</asp:Content>