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
+63 -2
View File
@@ -165,6 +165,8 @@
{ text: '* 品項名稱', value: 'act_item_selected.text', sortable: false },
{ text: '預設金額', value: 'price', sortable: false },
{ text: '數量', value: 'qty', sortable: false },
{ text: '陽上/祈福人數限制', value: 'limit_yang', sortable: false },
{ text: '超渡人數限制', value: 'limit_chao', sortable: false },
{ text: '', value: 'actions', sortable: false, width: "200px" },
],
footersDetail: {
@@ -191,6 +193,10 @@
price: 0,
qty: 0,
files: [],
has_yang_limit: false,
has_chao_limit: false,
yang_limit_count: 0,
chao_limit_count: 0,
},
defaultItem: {
id: 0,
@@ -203,6 +209,10 @@
price: 0,
qty: 0,
files: [],
has_yang_limit: false,
has_chao_limit: false,
yang_limit_count: 0,
chao_limit_count: 0,
},
//列印
data_table: {
@@ -434,9 +444,8 @@
this.close();
},
spliceNullData() {
//if new data ,then splice it
if (this.editedItem.num == 0) {
if (this.editedItem.num == 0) {
for (var i = 0; i < this.desserts.map(x => x.id).length; i++) {
if (this.desserts[i].id == this.editedItem.id) {
this.desserts.splice(i, 1); break;
@@ -482,6 +491,10 @@
actItem_num: this.editedItem.act_item_selected.val,
price: this.editedItem.price,
qty: this.editedItem.qty,
has_yang_limit: this.editedItem.has_yang_limit,
has_chao_limit: this.editedItem.has_chao_limit,
yang_limit_count: this.editedItem.yang_limit_count,
chao_limit_count: this.editedItem.chao_limit_count,
}
axios
.post(HTTP_HOST + 'api/activity/SaveRelatingData', pro_order_detail)
@@ -1019,6 +1032,54 @@
<v-text-field v-model="editedItem.qty" :hide-details="true" dense single-line v-if="item.id === editedItem.id" ></v-text-field>
<span v-else>{{item.qty}}</span>
</template>
<template v-slot:item.limit_yang="{ item }">
<div class="d-flex align-center">
<v-text-field v-model="editedItem.yang_limit_count" v-if="item.id === editedItem.id"
type="number"
dense
:hide-details="true"
single-line
:disabled="!editedItem.has_yang_limit"
suffix="人" >
</v-text-field>
<v-checkbox v-if="item.id === editedItem.id"
v-model="editedItem.has_yang_limit"
label="不限"
hide-details
class="ml-2 mt-0"
:true-value="false"
:false-value="true"
:disabled="item.id !== editedItem.id">
</v-checkbox>
<span v-if="item.id !== editedItem.id && !item.has_yang_limit">不限</span>
<span v-if="item.id !== editedItem.id && item.has_yang_limit">{{item.yang_limit_count}} 人</span>
</div>
</template>
<template v-slot:item.limit_chao="{ item }">
<div class="d-flex align-center">
<v-text-field v-model="editedItem.chao_limit_count" v-if="item.id === editedItem.id"
type="number"
dense
:hide-details="true"
single-line
:disabled="!editedItem.has_chao_limit"
suffix="人" >
</v-text-field>
<v-checkbox v-if="item.id === editedItem.id"
v-model="editedItem.has_chao_limit"
label="不限"
hide-details
class="ml-2 mt-0"
:true-value="false"
:false-value="true"
:disabled="item.id !== editedItem.id">
</v-checkbox>
<span v-if="item.id !== editedItem.id && !item.has_chao_limit">不限</span>
<span v-if="item.id !== editedItem.id && item.has_chao_limit">{{item.chao_limit_count}} 人</span>
</div>
</template>
<template v-slot:item.actions="{ item }">
<template v-if="item.id === editedItem.id">
<v-icon color="red" class="mr-2" @click="cancel">
+84
View File
@@ -235,6 +235,36 @@ public partial class admin_activity_reg : MyWeb.config
#endregion
#region
protected string createOrderNumber()
{
Application.Lock();
string order_no = "AA" + DateTime.Now.ToString("yyMMdd");
var qry = _db.companies.AsQueryable();
//var prod = qry.Where(q => q.last_order_no.Contains(order_no)).FirstOrDefault();
var prod = qry.Where(q => q.num == 1).FirstOrDefault();
if (prod != null)
{
if (!isStrNull(prod.last_order_no) && prod.last_order_no.Contains(order_no))
{
int tmp = Convert.ToInt32(prod.last_order_no.Replace(order_no, "")) + 1;
order_no = order_no + tmp.ToString("0000");
}
else
{
order_no = order_no + "0001";
}
prod.last_order_no = order_no;
_db.SaveChanges();
}
else
order_no = "";
Application.UnLock();
return order_no;
}
protected void add_Click(object sender, EventArgs e)
{
@@ -293,6 +323,60 @@ public partial class admin_activity_reg : MyWeb.config
Model.admin_log admin_log = new Model.admin_log();
admin_log.writeLog(admin.info.u_id, (int)Model.admin_log.Systems.Activity, (int)Model.admin_log.Status.Insert, subject.Text);
// 自動報名的信眾報名
var qry = _db.followers.Where(f => f.is_auto_enroll == true).AsQueryable();
var followers = qry.ToList();
if (followers != null)
{
try
{
foreach (var follower in followers)
{
Model.pro_order pro_order = new Model.pro_order(); //新增
pro_order.order_no = createOrderNumber();
pro_order.up_time = DateTime.Now;
pro_order.reg_time = DateTime.Now;
pro_order.keyin1 = "A01";
pro_order.f_num = follower.num;
if (!isStrNull(follower.phone)) { pro_order.phone = follower.phone; }
if (!isStrNull(follower.cellphone)) { pro_order.phone = follower.cellphone; }
if (IsNumeric(activity.num)) { pro_order.activity_num = activity.num; }
pro_order.address = isStrNull(follower.auto_enroll_receipt_address) ? "" : follower.auto_enroll_receipt_address;
pro_order.receipt_title = isStrNull(follower.auto_enroll_receipt_title) ? "" : follower.auto_enroll_receipt_title;
pro_order.send_receipt = isStrNull(follower.auto_enroll_is_receipt) ? false : follower.auto_enroll_is_receipt;
pro_order.demo = "";
pro_order.customize_data = "";
try
{
if (!isStrNull(pro_order.order_no))
{
bool isRegistered = _db.pro_order.Any(x => x.f_num == pro_order.f_num && x.activity_num == pro_order.activity_num);
if (isRegistered) // 重複報名
{
continue;
}
else
{
_db.pro_order.Add(pro_order);
_db.SaveChanges();
admin_log.writeLog(admin.info.u_id, (int)Model.admin_log.Systems.Order, (int)Model.admin_log.Status.Insert, pro_order.order_no);
}
}
}
catch (Exception ex)
{
}
}
}
catch (Exception ex)
{
}
}
Response.Redirect("index.aspx");
}
else