merge N++ 0.1
This commit is contained in:
@@ -42,7 +42,7 @@ public partial class admin_activity_item_reg : MyWeb.config
|
||||
BuildKind();
|
||||
subject.Text = prod.subject;
|
||||
print_init.Text = prod.print_init;
|
||||
//PARTNO.Text = prod.partno;
|
||||
|
||||
//kind.SelectedValue = prod.kind.ToString();
|
||||
if (!isStrNull(prod.pageSize))
|
||||
{
|
||||
|
||||
@@ -197,7 +197,6 @@
|
||||
has_chao_limit: false,
|
||||
yang_limit_count: 0,
|
||||
chao_limit_count: 0,
|
||||
},
|
||||
defaultItem: {
|
||||
id: 0,
|
||||
num: 0,
|
||||
@@ -289,6 +288,20 @@
|
||||
items: [
|
||||
{ order_no: "D", member_name: "S", order_date:"2025-12-07"}
|
||||
],
|
||||
unfilled_list: {
|
||||
loading: false,
|
||||
search: '',
|
||||
headers: [
|
||||
{ text: '訂單編號', value: 'order_no' },
|
||||
{ text: '信眾編號', value: 'f_number' },
|
||||
{ text: '信眾姓名', value: 'u_name' },
|
||||
{ text: '聯絡電話', value: 'phone' },
|
||||
{ text: '建立日期', value: 'order_date' },
|
||||
],
|
||||
items: [
|
||||
{ order_no: "D", member_name: "S", order_date:"2025-12-07"}
|
||||
],
|
||||
},
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
@@ -457,9 +470,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;
|
||||
@@ -913,7 +925,7 @@
|
||||
const _date = $('#<%= startDate_solar.ClientID%>').val();
|
||||
return _subject + " " + _date;
|
||||
},
|
||||
loadUnfilledList() {
|
||||
loadUnfilledList() {
|
||||
if (!this.this_id) return;
|
||||
|
||||
this.unfilled_list.loading = true;
|
||||
@@ -1283,6 +1295,7 @@ loadUnfilledList() {
|
||||
<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">
|
||||
|
||||
@@ -524,8 +524,85 @@ private void RunAutoEnroll(int activityNum)
|
||||
}
|
||||
}
|
||||
|
||||
private void RunAutoEnroll(int activityNum)
|
||||
{
|
||||
var activity = _db.activities.FirstOrDefault(a => a.num == activityNum);
|
||||
if (activity == null || !activity.startDate_solar.HasValue) return;
|
||||
|
||||
DateTime actDate = activity.startDate_solar.Value;
|
||||
|
||||
var validConfigs = _db.auto_enroll
|
||||
.Where(ae => actDate >= ae.start_date && actDate <= ae.end_date)
|
||||
.ToList();
|
||||
|
||||
foreach (var config in validConfigs)
|
||||
{
|
||||
if (_db.pro_order.Any(o => o.activity_num == activity.num && o.f_num == config.f_num))
|
||||
continue;
|
||||
|
||||
var follower = _db.followers.FirstOrDefault(f => f.num == config.f_num);
|
||||
if (follower == null) continue;
|
||||
|
||||
string newOrderNo = AutoOrderService.CreateAutoOrderNumber(_db);
|
||||
|
||||
Model.pro_order proOrder = new Model.pro_order
|
||||
{
|
||||
order_no = newOrderNo,
|
||||
up_time = DateTime.Now,
|
||||
reg_time = DateTime.Now,
|
||||
keyin1 = "A01",
|
||||
f_num = follower.num,
|
||||
au_num = config.num,
|
||||
phone = !string.IsNullOrEmpty(follower.cellphone) ? follower.cellphone : (follower.phone ?? ""),
|
||||
activity_num = activity.num,
|
||||
address = config.receipt_address ?? "",
|
||||
receipt_title = config.receipt_title ?? "",
|
||||
demo = "",
|
||||
customize_data = ""
|
||||
};
|
||||
|
||||
_db.pro_order.Add(proOrder);
|
||||
|
||||
CopyLatestOrderDetails(newOrderNo, config.f_num, (int)activity.kind);
|
||||
}
|
||||
|
||||
_db.SaveChanges();
|
||||
}
|
||||
|
||||
private void CopyLatestOrderDetails(string newOrderNo, int f_num, int activityKind)
|
||||
{
|
||||
var latestOrder = _db.pro_order
|
||||
.Where(o => o.f_num == f_num && o.activity.kind == activityKind && _db.pro_order_detail.Any(d => d.order_no == o.order_no))
|
||||
.OrderByDescending(o => o.order_no)
|
||||
.FirstOrDefault();
|
||||
|
||||
if (latestOrder != null)
|
||||
{
|
||||
var prevDetails = _db.pro_order_detail.Where(d => d.order_no == latestOrder.order_no).ToList();
|
||||
foreach (var detail in prevDetails)
|
||||
{
|
||||
Model.pro_order_detail newDetail = new Model.pro_order_detail
|
||||
{
|
||||
order_no = newOrderNo,
|
||||
actItem_num = detail.actItem_num,
|
||||
parent_num = detail.parent_num,
|
||||
print_id = detail.print_id,
|
||||
f_num = detail.f_num,
|
||||
f_num_tablet = detail.f_num_tablet,
|
||||
address = detail.address,
|
||||
from_id = detail.from_id,
|
||||
from_id_tablet = detail.from_id_tablet,
|
||||
qty = detail.qty,
|
||||
price = detail.price,
|
||||
start_date = DateTime.Today,
|
||||
pay = 0,
|
||||
UpdateTime = DateTime.Now
|
||||
};
|
||||
_db.pro_order_detail.Add(newDetail);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
}
|
||||
+598
-5
@@ -116,6 +116,7 @@
|
||||
vuetify: new Vuetify(vuetify_options),
|
||||
data() {
|
||||
return {
|
||||
last_confirmed_date: '',
|
||||
tabArray: tabtmp,
|
||||
tabArray2: "",
|
||||
follower_id: '<%= Request["num"] %>',
|
||||
@@ -124,6 +125,20 @@
|
||||
multiSort: false,
|
||||
//itemsPerPage: -1,
|
||||
},
|
||||
confirm_dialog: {
|
||||
show: false,
|
||||
headers: [
|
||||
{ text: '活動日期', value: 'activitydate' },
|
||||
{ text: '活動名稱', value: 'activityname'},
|
||||
],
|
||||
title: '',
|
||||
desc: '',
|
||||
orders: [],
|
||||
pendingData: null,
|
||||
pendingDeleteItem: null,
|
||||
btn_cancel_text: '', // 「取消報名」按鈕文字
|
||||
btn_keep_text: '' // 「保留活動」按鈕文字
|
||||
},
|
||||
search_dialog: {
|
||||
controls: {
|
||||
search1: {
|
||||
@@ -454,6 +469,56 @@
|
||||
{ text: '', value: 'actions', sortable: false, width: "100px" },
|
||||
],
|
||||
},
|
||||
// 全年報名表格
|
||||
auto_enroll: {
|
||||
headers: [
|
||||
{ text: '開始日期(西元)', value: 'auto_enroll_start_date', sortable: false },
|
||||
{ text: '結束日期(西元)', value: 'auto_enroll_end_date', sortable: false },
|
||||
{ text: '收據抬頭', value: 'auto_enroll_receipt_title', sortable: false },
|
||||
{ text: '收據地址', value: 'auto_enroll_receipt_address', sortable: false },
|
||||
{ text: '狀態', value: 'auto_enroll_status', sortable: false },
|
||||
{ text: '', value: 'actions', sortable: false, width: "150px" },
|
||||
],
|
||||
items: [],
|
||||
editedIndex: -1,
|
||||
editedItem: {
|
||||
num: 0,
|
||||
auto_enroll_start_date: '',
|
||||
auto_enroll_end_date: '',
|
||||
auto_enroll_receipt_title: '',
|
||||
auto_enroll_receipt_address: '',
|
||||
},
|
||||
defaultItem: {
|
||||
num: 0,
|
||||
auto_enroll_start_date: '',
|
||||
auto_enroll_end_date: '',
|
||||
auto_enroll_receipt_title: '',
|
||||
auto_enroll_receipt_address: '',
|
||||
},
|
||||
search:""
|
||||
},
|
||||
unfilled_dialog: {
|
||||
show: false,
|
||||
headers: [
|
||||
{ text: '報名單號', value: 'order_no', sortable: false },
|
||||
{ text: '活動分類', value: 'category', sortable: false },
|
||||
{ text: '活動名稱', value: 'activityname', sortable: false },
|
||||
{ text: '開始日期', value: 'startdate', sortable: false },
|
||||
{ text: '結束日期', value: 'enddate', sortable: false },
|
||||
],
|
||||
items: [],
|
||||
footer: {
|
||||
showFirstLastPage: true,
|
||||
disableItemsPerPage: true,
|
||||
itemsPerPageAllText: '',
|
||||
itemsPerPageText: '',
|
||||
current_item: null,
|
||||
},
|
||||
count: 0,
|
||||
page: 1,
|
||||
pageSize: 10,
|
||||
loading: false,
|
||||
},
|
||||
cityOptions: [], // 城市選項
|
||||
areaOptions: {}, // 區域選項
|
||||
//天干地支:甲子, 乙丑...
|
||||
@@ -485,7 +550,7 @@
|
||||
]
|
||||
}
|
||||
},
|
||||
mounted() {//一開始就載入
|
||||
mounted() {
|
||||
this.search_dialog.current = this.search_dialog.controls.search1 ///default
|
||||
//console.log("mounted");
|
||||
//this.initialize();
|
||||
@@ -494,6 +559,7 @@
|
||||
this.getFamilyMembers();
|
||||
this.getCityOptions();
|
||||
this.onCityChange();
|
||||
this.initAutoEnroll();
|
||||
},
|
||||
watch: {
|
||||
options: {
|
||||
@@ -537,6 +603,323 @@
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
initAutoEnroll() {
|
||||
if (this.follower_id != '') {
|
||||
axios.get(HTTP_HOST + `api/follower/GetAutoEnrollList/${this.follower_id}`)
|
||||
.then(response => {
|
||||
this.auto_enroll.items = response.data.list.map(item => ({
|
||||
...item,
|
||||
id: item.num
|
||||
}));
|
||||
})
|
||||
}
|
||||
},
|
||||
// 取得報名狀態
|
||||
getEnrollStatus(item) {
|
||||
const today = new Date();
|
||||
today.setHours(0, 0, 0, 0);
|
||||
const start = new Date(item.auto_enroll_start_date);
|
||||
const end = new Date(item.auto_enroll_end_date);
|
||||
if (today < start) return { label: '未開始', color: 'blue lighten-4', textColor: 'blue darken-3' };
|
||||
if (today > end) return { label: '已結束', color: 'grey lighten-2', textColor: 'grey darken-2' };
|
||||
return { label: '報名中', color: 'green lighten-4', textColor: 'green darken-3' };
|
||||
},
|
||||
// 新增
|
||||
auto_enroll_add() {
|
||||
if (this.auto_enroll.editedIndex !== -1) return;
|
||||
|
||||
const newItem = {
|
||||
...this.auto_enroll.defaultItem,
|
||||
id: -Date.now()
|
||||
};
|
||||
this.auto_enroll.items.unshift(newItem);
|
||||
this.auto_enroll.editedItem = { ...newItem };
|
||||
this.auto_enroll.editedIndex = 0;
|
||||
},
|
||||
// 編輯
|
||||
auto_enroll_edit(item) {
|
||||
this.auto_enroll.editedIndex = this.auto_enroll.items.indexOf(item);
|
||||
this.auto_enroll.editedItem = { ...item };
|
||||
},
|
||||
// 取消
|
||||
auto_enroll_cancel() {
|
||||
// 若是新增的空白列,取消時移除
|
||||
const item = this.auto_enroll.items[this.auto_enroll.editedIndex];
|
||||
if (item && !item.auto_enroll_start_date && !item.auto_enroll_end_date) {
|
||||
this.auto_enroll.items.splice(this.auto_enroll.editedIndex, 1);
|
||||
}
|
||||
this.auto_enroll.editedItem = { ...this.auto_enroll.defaultItem };
|
||||
this.auto_enroll.editedIndex = -1;
|
||||
},
|
||||
// 儲存
|
||||
auto_enroll_save() {
|
||||
const { id, num, auto_enroll_start_date, auto_enroll_end_date, auto_enroll_receipt_title, auto_enroll_receipt_address } = this.auto_enroll.editedItem;
|
||||
|
||||
if (!auto_enroll_start_date || !auto_enroll_end_date) {
|
||||
alert('請填寫開始與結束日期');
|
||||
return;
|
||||
}
|
||||
if (auto_enroll_start_date > auto_enroll_end_date) {
|
||||
alert('開始日期不可晚於結束日期');
|
||||
return;
|
||||
}
|
||||
|
||||
// 檢查是否與其他列日期重疊
|
||||
const isOverlap = this.auto_enroll.items.some(item => {
|
||||
if (item.id === id) return false; // 跳過自己
|
||||
|
||||
const existStart = item.auto_enroll_start_date;
|
||||
const existEnd = item.auto_enroll_end_date;
|
||||
|
||||
return auto_enroll_start_date <= existEnd && auto_enroll_end_date >= existStart;
|
||||
});
|
||||
|
||||
if (isOverlap) {
|
||||
alert('此報名期間與現有資料重疊,請重新確認日期');
|
||||
return;
|
||||
}
|
||||
|
||||
var auto_enroll =
|
||||
{
|
||||
num: num,
|
||||
f_num: Number('<%= Request["num"] %>'),
|
||||
start_date: auto_enroll_start_date,
|
||||
end_date: auto_enroll_end_date,
|
||||
receipt_title: auto_enroll_receipt_title,
|
||||
receipt_address: auto_enroll_receipt_address,
|
||||
}
|
||||
|
||||
this.open_confirm_dialog(auto_enroll);
|
||||
|
||||
//axios.post(HTTP_HOST + 'api/follower/SaveAutoEnrollList', auto_enroll)
|
||||
// .then(response => {
|
||||
// const savedData = response.data;
|
||||
// const updatedItem = {
|
||||
// ...this.auto_enroll.editedItem,
|
||||
// num: Number(savedData.num),
|
||||
// id: Number(savedData.num),
|
||||
// auto_enroll_start_date: savedData.start_date,
|
||||
// auto_enroll_end_date: savedData.end_date,
|
||||
// auto_enroll_receipt_title: savedData.receipt_title,
|
||||
// auto_enroll_receipt_address: savedData.receipt_address,
|
||||
// };
|
||||
// this.$set(this.auto_enroll.items, this.auto_enroll.editedIndex, updatedItem);
|
||||
// this.auto_enroll.editedItem = { ...this.auto_enroll.defaultItem };
|
||||
// this.auto_enroll.editedIndex = -1;
|
||||
// })
|
||||
},
|
||||
// 刪除
|
||||
auto_enroll_delete(item) {
|
||||
// 先查受影響訂單
|
||||
axios.post(HTTP_HOST + 'api/follower/GetAffectedOrders', {
|
||||
num: item.num,
|
||||
f_num: Number('<%= Request["num"] %>'),
|
||||
start_date: item.auto_enroll_start_date,
|
||||
end_date: item.auto_enroll_end_date,
|
||||
}, {
|
||||
params: { is_delete: true }
|
||||
})
|
||||
.then(response => {
|
||||
this.confirm_dialog.pendingData = null;
|
||||
this.confirm_dialog.pendingDeleteItem = item;
|
||||
|
||||
if (response.data.list.length > 0) {
|
||||
this.confirm_dialog.orders = response.data.list;
|
||||
this.confirm_dialog.title = "刪除全年報名";
|
||||
this.confirm_dialog.desc = "刪除後,以下已報名的活動是否一併取消?";
|
||||
this.confirm_dialog.btn_keep_text = "保留現有活動";
|
||||
this.confirm_dialog.btn_cancel_text = "取消全部活動";
|
||||
this.confirm_dialog.show = true;
|
||||
} else {
|
||||
this.doDelete(item);
|
||||
}
|
||||
})
|
||||
},
|
||||
doDelete(item) {
|
||||
axios.delete(HTTP_HOST + `api/follower/DeleteAutoEnroll/${item.num}`)
|
||||
.then(() => {
|
||||
const index = this.auto_enroll.items.indexOf(item);
|
||||
this.auto_enroll.items.splice(index, 1);
|
||||
this.confirm_dialog.pendingDeleteItem = null; // 清空暫存
|
||||
})
|
||||
.catch(error => {
|
||||
console.log("刪除失敗", error);
|
||||
this.snackbar.text = "刪除失敗:" + error;
|
||||
this.snackbar.show = true;
|
||||
})
|
||||
},
|
||||
// 顯示尚未填寫項目的活動
|
||||
unfilled_dialog_show(item) {
|
||||
this.unfilled_dialog.current_item = item;
|
||||
this.unfilled_dialog.page = 1;
|
||||
this.unfilled_dialog.show = true;
|
||||
this.unfilled_dialog_load();
|
||||
},
|
||||
unfilled_dialog_load() {
|
||||
const item = this.unfilled_dialog.current_item;
|
||||
const { page, pageSize, sortBy, sortDesc } = this.unfilled_dialog;
|
||||
this.unfilled_dialog.loading = true;
|
||||
axios
|
||||
.get(HTTP_HOST + `api/follower/GetUnfilledActivityOrders/${item.num}`, {
|
||||
params: {
|
||||
page,
|
||||
pageSize,
|
||||
sortBy: Array.isArray(sortBy) ? sortBy[0] : sortBy,
|
||||
sortDesc: Array.isArray(sortDesc) ? sortDesc[0] : sortDesc
|
||||
}
|
||||
})
|
||||
.then(response => {
|
||||
this.unfilled_dialog.items = response.data.list;
|
||||
this.unfilled_dialog.count = response.data.count;
|
||||
})
|
||||
.finally(() => {
|
||||
this.unfilled_dialog.loading = false;
|
||||
});
|
||||
},
|
||||
// 列印
|
||||
async exportUnfilledOrders() {
|
||||
const item = this.unfilled_dialog.current_item;
|
||||
|
||||
// 取得全部資料
|
||||
const response = await axios.get(
|
||||
HTTP_HOST + `api/follower/GetUnfilledActivityOrders/${item.num}`,
|
||||
{ params: { page: 1, pageSize: 99999 } }
|
||||
);
|
||||
const allItems = response.data.list;
|
||||
|
||||
const fullTitle = this.titleword();
|
||||
const infoParts = fullTitle.split(' ');
|
||||
const followerNum = infoParts[0] || "未知編號";
|
||||
const followerName = infoParts[1] ? infoParts[1].split('(')[0] : "未知姓名";
|
||||
|
||||
const rows = allItems.map(item => `
|
||||
<tr>
|
||||
<td>${item.order_no}</td>
|
||||
<td>${item.category}</td>
|
||||
<td>${item.activityname}</td>
|
||||
<td>${item.startdate?.substring(0, 10)}</td>
|
||||
<td>${item.enddate?.substring(0, 10)}</td>
|
||||
</tr>
|
||||
`).join('');
|
||||
|
||||
const win = window.open('', '_blank');
|
||||
win.document.write(`
|
||||
<html>
|
||||
<head>
|
||||
<title>未填寫品項活動 - ${followerName}</title>
|
||||
<style>
|
||||
body { font-family: "Microsoft JhengHei", Arial, sans-serif; padding: 20px; }
|
||||
h2 { text-align: center; margin-bottom: 10px; }
|
||||
.info-header { text-align: center; margin-bottom: 20px; font-size: 16px; border-bottom: 1px solid #eee; padding-bottom: 10px; }
|
||||
table { width: 100%; border-collapse: collapse; }
|
||||
th, td { border: 1px solid #666; padding: 8px; text-align: left; }
|
||||
th { background-color: #f2f2f2; }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<h2>未填寫品項之活動清單</h2>
|
||||
<div class="info-header">
|
||||
信眾編號:<strong>${followerNum}</strong>
|
||||
信眾姓名:<strong>${followerName}</strong>
|
||||
</div>
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>報名單號</th>
|
||||
<th>活動分類</th>
|
||||
<th>活動名稱</th>
|
||||
<th>開始日期</th>
|
||||
<th>結束日期</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>${rows}</tbody>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
`);
|
||||
win.document.close();
|
||||
win.print();
|
||||
win.close();
|
||||
},
|
||||
syncAddress() {
|
||||
const sourceAddr = document.getElementById('<%=address.ClientID%>').value;
|
||||
this.auto_enroll_config.receipt_address = sourceAddr;
|
||||
},
|
||||
open_confirm_dialog(auto_enroll) {
|
||||
if (auto_enroll.num == 0) {
|
||||
this.doSave(auto_enroll);
|
||||
return;
|
||||
}
|
||||
|
||||
// 受影響訂單
|
||||
axios.post(HTTP_HOST + 'api/follower/GetAffectedOrders', auto_enroll)
|
||||
.then(response => {
|
||||
this.confirm_dialog.pendingData = auto_enroll;
|
||||
|
||||
if (response.data.list.length > 0) {
|
||||
this.confirm_dialog.orders = response.data.list;
|
||||
this.confirm_dialog.title = "受影響的已報名活動";
|
||||
this.confirm_dialog.desc = "修改報名期間後,以下活動將不在新範圍內,是否一併取消?";
|
||||
this.confirm_dialog.btn_keep_text = "保留現有活動";
|
||||
this.confirm_dialog.btn_cancel_text = "取消全部活動";
|
||||
this.confirm_dialog.show = true;
|
||||
} else {
|
||||
this.doSave(auto_enroll);
|
||||
}
|
||||
})
|
||||
},
|
||||
doSave(auto_enroll) {
|
||||
axios.post(HTTP_HOST + 'api/follower/SaveAutoEnrollList', auto_enroll)
|
||||
.then(response => {
|
||||
const savedData = response.data;
|
||||
const updatedItem = {
|
||||
...this.auto_enroll.editedItem,
|
||||
num: Number(savedData.num),
|
||||
id: Number(savedData.num),
|
||||
auto_enroll_start_date: savedData.start_date,
|
||||
auto_enroll_end_date: savedData.end_date,
|
||||
auto_enroll_receipt_title: savedData.receipt_title,
|
||||
auto_enroll_receipt_address: savedData.receipt_address,
|
||||
};
|
||||
this.$set(this.auto_enroll.items, this.auto_enroll.editedIndex, updatedItem);
|
||||
this.auto_enroll.editedItem = { ...this.auto_enroll.defaultItem };
|
||||
this.auto_enroll.editedIndex = -1;
|
||||
this.confirm_dialog.pendingData = null;
|
||||
})
|
||||
},
|
||||
close_confirm_dialog() {
|
||||
this.confirm_dialog.show = false;
|
||||
},
|
||||
keep_auto_enroll_order() {
|
||||
this.confirm_dialog.show = false;
|
||||
|
||||
if (this.confirm_dialog.pendingData) {
|
||||
this.doSave(this.confirm_dialog.pendingData);
|
||||
} else if (this.confirm_dialog.pendingDeleteItem) {
|
||||
this.doDelete(this.confirm_dialog.pendingDeleteItem);
|
||||
}
|
||||
},
|
||||
delete_auto_enroll_order() {
|
||||
this.confirm_dialog.show = false;
|
||||
|
||||
const orderNos = this.confirm_dialog.orders.map(o => o.order_no);
|
||||
if (orderNos.length === 0) return;
|
||||
const numsString = orderNos.join(',')
|
||||
|
||||
axios.delete(HTTP_HOST + `api/order/DeleteAll/${numsString}`)
|
||||
.then(() => {
|
||||
if (this.confirm_dialog.pendingData) {
|
||||
this.doSave(this.confirm_dialog.pendingData);
|
||||
} else if (this.confirm_dialog.pendingDeleteItem) {
|
||||
this.doDelete(this.confirm_dialog.pendingDeleteItem);
|
||||
}
|
||||
})
|
||||
.catch(error => {
|
||||
console.log("刪除訂單失敗", error);
|
||||
this.snackbar.text = "刪除訂單失敗:" + error;
|
||||
this.snackbar.show = true;
|
||||
})
|
||||
},
|
||||
search_show(curr) {
|
||||
console.log("btn_click:", curr, curr.api_url);
|
||||
this.search_dialog.current = curr;
|
||||
@@ -1335,7 +1718,7 @@
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
</asp:Content>
|
||||
@@ -1378,8 +1761,11 @@
|
||||
type="button" role="tab" aria-controls="profile" aria-selected="false" v-if="lists.length > 0">
|
||||
未付款紀錄 </button>
|
||||
<button class="nav-link" id="sec2-tab4" data-bs-toggle="tab" data-bs-target="#sec2-page4"
|
||||
type="button" role="tab" aria-controls="profile" aria-selected="false">
|
||||
type="button" role="tab" aria-controls="profile" aria-selected="false" display="none">
|
||||
牌位標題 </button>
|
||||
<button class="nav-link" id="sec2-tab5" data-bs-toggle="tab" data-bs-target="#sec2-page5"
|
||||
type="button" role="tab" aria-controls="profile" aria-selected="false">
|
||||
全年報名 </button>
|
||||
</div>
|
||||
</nav>
|
||||
</div>
|
||||
@@ -1589,7 +1975,6 @@
|
||||
</template>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="row mb-1">
|
||||
<label class="col-form-label">備註</label>
|
||||
@@ -1978,9 +2363,176 @@
|
||||
</v-data-table>
|
||||
</v-card>
|
||||
</div>
|
||||
<div class="tab-pane fade" id="sec2-page5" role="tabpanel" aria-labelledby="sec2-tab5" >
|
||||
<v-card class="mx-auto" outlined v-if="follower_id!=''">
|
||||
<v-data-table class="elevation-1" fixed-header
|
||||
:headers="auto_enroll.headers"
|
||||
:items="auto_enroll.items"
|
||||
:search="auto_enroll.search">
|
||||
<v-divider inset></v-divider>
|
||||
<template v-slot:top>
|
||||
<v-toolbar flat color="transparent" class="row ms-0">
|
||||
<div class="col-12 col-md-10 d-flex">
|
||||
<v-text-field
|
||||
v-model="auto_enroll.search"
|
||||
append-icon="mdi-magnify"
|
||||
label="查詢"
|
||||
dense
|
||||
outlined
|
||||
single-line
|
||||
hide-details>
|
||||
</v-text-field>
|
||||
<v-btn
|
||||
color="primary"
|
||||
class="ml-2 white--text "
|
||||
title="新增全年報名"
|
||||
@click="auto_enroll_add">
|
||||
<v-icon dark>mdi-plus</v-icon>新增
|
||||
</v-btn>
|
||||
</div>
|
||||
</v-toolbar>
|
||||
</template>
|
||||
|
||||
<!-- 編輯中 -->
|
||||
<template v-slot:item.auto_enroll_start_date="{ item }">
|
||||
<template v-if="item.id === auto_enroll.editedItem.id">
|
||||
<v-text-field
|
||||
v-model="auto_enroll.editedItem.auto_enroll_start_date"
|
||||
type="date"
|
||||
dense
|
||||
hide-details
|
||||
outlined>
|
||||
</v-text-field>
|
||||
</template>
|
||||
<template v-else>
|
||||
{{ item.auto_enroll_start_date }}
|
||||
</template>
|
||||
</template>
|
||||
|
||||
<template v-slot:item.auto_enroll_end_date="{ item }">
|
||||
<template v-if="item.id === auto_enroll.editedItem.id">
|
||||
<v-text-field
|
||||
v-model="auto_enroll.editedItem.auto_enroll_end_date"
|
||||
type="date"
|
||||
dense
|
||||
hide-details
|
||||
outlined>
|
||||
</v-text-field>
|
||||
</template>
|
||||
<template v-else>
|
||||
{{ item.auto_enroll_end_date }}
|
||||
</template>
|
||||
</template>
|
||||
|
||||
<template v-slot:item.auto_enroll_receipt_title="{ item }">
|
||||
<template v-if="item.id === auto_enroll.editedItem.id">
|
||||
<v-text-field
|
||||
v-model="auto_enroll.editedItem.auto_enroll_receipt_title"
|
||||
dense
|
||||
hide-details
|
||||
outlined
|
||||
placeholder="請輸入收據抬頭">
|
||||
</v-text-field>
|
||||
</template>
|
||||
<template v-else>
|
||||
{{ item.auto_enroll_receipt_title }}
|
||||
</template>
|
||||
</template>
|
||||
|
||||
<template v-slot:item.auto_enroll_receipt_address="{ item }">
|
||||
<template v-if="item.id === auto_enroll.editedItem.id">
|
||||
<v-text-field
|
||||
v-model="auto_enroll.editedItem.auto_enroll_receipt_address"
|
||||
dense
|
||||
hide-details
|
||||
outlined
|
||||
placeholder="請輸入收據地址">
|
||||
</v-text-field>
|
||||
</template>
|
||||
<template v-else>
|
||||
{{ item.auto_enroll_receipt_address }}
|
||||
</template>
|
||||
</template>
|
||||
|
||||
<!-- 狀態欄位 -->
|
||||
<template v-slot:item.auto_enroll_status="{ item }">
|
||||
<v-chip
|
||||
small
|
||||
:color="getEnrollStatus(item).color"
|
||||
:text-color="getEnrollStatus(item).textColor"
|
||||
class="font-weight-medium">
|
||||
{{ getEnrollStatus(item).label }}
|
||||
</v-chip>
|
||||
</template>
|
||||
|
||||
<!-- 操作欄位 -->
|
||||
<template v-slot:item.actions="{ item }">
|
||||
<template v-if="item.id === auto_enroll.editedItem.id">
|
||||
<v-icon color="red" class="mr-2" @click="auto_enroll_cancel">
|
||||
mdi-window-close
|
||||
</v-icon>
|
||||
<v-icon color="green" class="mr-2" @click="auto_enroll_save">
|
||||
mdi-content-save
|
||||
</v-icon>
|
||||
</template>
|
||||
<template v-else>
|
||||
<v-icon color="green" class="mr-2" @click="auto_enroll_edit(item)">
|
||||
mdi-pencil
|
||||
</v-icon>
|
||||
<v-icon color="red" class="mr-2" @click="auto_enroll_delete(item)">
|
||||
mdi-delete
|
||||
</v-icon>
|
||||
<v-icon color="blue" class="mr-2" @click="unfilled_dialog_show(item)" title="查看未填寫品項活動">
|
||||
mdi-file-find
|
||||
</v-icon>
|
||||
</template>
|
||||
</template>
|
||||
|
||||
</v-data-table>
|
||||
</v-card>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</asp:Panel>
|
||||
</div>
|
||||
|
||||
<!-- 顯示沒有品項的活動 -->
|
||||
<v-dialog v-model="unfilled_dialog.show" max-width="900px">
|
||||
<v-card>
|
||||
<v-card-title class="headline grey lighten-2">
|
||||
未填寫品項的活動
|
||||
<v-spacer></v-spacer>
|
||||
<v-btn icon @click="unfilled_dialog.show = false"><v-icon>mdi-close</v-icon></v-btn>
|
||||
</v-card-title>
|
||||
|
||||
<v-card-text>
|
||||
<v-data-table
|
||||
:headers="unfilled_dialog.headers"
|
||||
:items="unfilled_dialog.items"
|
||||
:footer-props="unfilled_dialog.footer"
|
||||
:items-per-page="unfilled_dialog.pageSize"
|
||||
:server-items-length="unfilled_dialog.count"
|
||||
:page.sync="unfilled_dialog.page"
|
||||
:loading="unfilled_dialog.loading"
|
||||
@update:page="unfilled_dialog_load"
|
||||
>
|
||||
</v-data-table>
|
||||
</v-card-text>
|
||||
|
||||
<v-card-actions class="justify-center pb-6">
|
||||
<v-btn
|
||||
color="primary"
|
||||
:disabled="unfilled_dialog.items.length == 0"
|
||||
class="px-4"
|
||||
@click="exportUnfilledOrders">
|
||||
<v-icon left>mdi-printer</v-icon>
|
||||
列印
|
||||
</v-btn>
|
||||
</v-card-actions>
|
||||
</v-card>
|
||||
</v-dialog>
|
||||
|
||||
<!-- Family Member Dialog -->
|
||||
<v-dialog v-model="family.dialog" max-width="600px">
|
||||
<v-card>
|
||||
@@ -2123,7 +2675,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 +2725,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="10"
|
||||
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>
|
||||
@@ -11,9 +11,11 @@ using System.Diagnostics;
|
||||
using System.Globalization;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Security.Cryptography;
|
||||
using System.Web;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
using static Model.activity_check;
|
||||
|
||||
public partial class admin_follower_reg : MyWeb.config
|
||||
{
|
||||
@@ -142,7 +144,7 @@ public partial class admin_follower_reg : MyWeb.config
|
||||
country.Value = prod.country.ToString();
|
||||
}
|
||||
if (prod.reg_time.HasValue)
|
||||
{
|
||||
{
|
||||
timePanel1.Visible = true;
|
||||
reg_time.Text= prod.reg_time.Value.ToString("yyyy/MM/dd HH:mm:ss");
|
||||
}
|
||||
@@ -153,7 +155,6 @@ public partial class admin_follower_reg : MyWeb.config
|
||||
modify_time.Text = prod.admin_log;
|
||||
}
|
||||
|
||||
|
||||
edit.Visible = true;
|
||||
goback.Visible = true;
|
||||
add.Visible = false;
|
||||
@@ -178,10 +179,39 @@ public partial class admin_follower_reg : MyWeb.config
|
||||
Response.Redirect("index.aspx?page=" + Convert.ToString(Request["page"]));
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
#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)
|
||||
{
|
||||
if (Page.IsValid) {
|
||||
@@ -205,7 +235,7 @@ public partial class admin_follower_reg : MyWeb.config
|
||||
{
|
||||
ObjValue.SetValue(followers, selectDate(textBox));
|
||||
}
|
||||
else if (!isStrNull(((TextBox)obj).Attributes["data-encrypt"])
|
||||
else if (!isStrNull(((TextBox)obj).Attributes["data-encrypt"])
|
||||
&& ValString(textBox.Attributes["data-encrypt"]).Equals("Y"))
|
||||
{
|
||||
ObjValue.SetValue(followers, encrypt.EncryptAutoKey(textBox.Text.Trim()));
|
||||
@@ -270,9 +300,9 @@ public partial class admin_follower_reg : MyWeb.config
|
||||
|
||||
Model.admin_log admin_log = new Model.admin_log();
|
||||
admin_log.writeLog(admin.info.u_id, (int)Model.admin_log.Systems.Follower, (int)Model.admin_log.Status.Insert, f_number.Text + u_name.Text);
|
||||
|
||||
|
||||
Session["LastAddedID"] = followers.f_number;
|
||||
|
||||
|
||||
Response.Redirect("index.aspx");
|
||||
}
|
||||
else
|
||||
@@ -292,8 +322,8 @@ public partial class admin_follower_reg : MyWeb.config
|
||||
L_msg.Type = alert_type.danger;
|
||||
L_msg.Text = "信眾編號重複";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
@@ -331,10 +361,7 @@ public partial class admin_follower_reg : MyWeb.config
|
||||
}
|
||||
else
|
||||
ObjValue.SetValue(followers, null);
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
followers.identity_type = Val(identity_type.SelectedValue);
|
||||
@@ -410,16 +437,16 @@ public partial class admin_follower_reg : MyWeb.config
|
||||
L_msg.Type = alert_type.danger;
|
||||
L_msg.Text = "查無資料";
|
||||
}
|
||||
/*
|
||||
if (chk_pro_num(f_number.Text, Val(Request["num"])))
|
||||
{
|
||||
}
|
||||
else
|
||||
{
|
||||
L_msg.Type = alert_type.danger;
|
||||
L_msg.Text = "信眾編號重複";
|
||||
}
|
||||
*/
|
||||
/*
|
||||
if (chk_pro_num(f_number.Text, Val(Request["num"])))
|
||||
{
|
||||
}
|
||||
else
|
||||
{
|
||||
L_msg.Type = alert_type.danger;
|
||||
L_msg.Text = "信眾編號重複";
|
||||
}
|
||||
*/
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -835,7 +835,6 @@
|
||||
this.desserts_count = response.data.list !== undefined ? response.data.count : 0
|
||||
this.calutotalPrice();
|
||||
this.disableButton = false;
|
||||
|
||||
})
|
||||
.catch(
|
||||
error => console.log(error)
|
||||
@@ -920,7 +919,7 @@
|
||||
// 顯示對話框
|
||||
this.tablet_edit.show = true;
|
||||
// 立即恢復數據
|
||||
this.editedItem = $.extend(true, {}, currentData);
|
||||
this.editedItem = $.extend(true, {}, currentData);
|
||||
} catch (error) {
|
||||
console.error('Error in editTablet:', error);
|
||||
}
|
||||
|
||||
@@ -147,6 +147,14 @@
|
||||
</v-col>
|
||||
<v-col cols="auto" class="ml-4">
|
||||
<span class="subtitle-2 grey--text text--darken-1">超渡-已選</span>
|
||||
<v-chip v-if="tabletItem.has_chao_limit"
|
||||
x-small
|
||||
class="ml-2 px-2"
|
||||
:color="family_deceased_Y_selected.length > tabletItem.chao_limit_count ? 'error' : 'grey lighten-1'"
|
||||
:dark="family_deceased_Y_selected.length > tabletItem.chao_limit_count"
|
||||
label>
|
||||
{{ family_deceased_Y_selected.length }} / {{ tabletItem.chao_limit_count }}
|
||||
</v-chip>
|
||||
</v-col>
|
||||
<v-spacer></v-spacer>
|
||||
<v-col cols="auto">
|
||||
@@ -237,6 +245,14 @@
|
||||
</v-col>
|
||||
<v-col cols="auto" :class="{'ml-4': item_type==='A'}">
|
||||
<span class="subtitle-2 grey--text text--darken-1">陽上/祈福-已選</span>
|
||||
<v-chip v-if="tabletItem.has_yang_limit"
|
||||
x-small
|
||||
class="ml-2 px-2"
|
||||
:color="family_deceased_N_selected.length > tabletItem.yang_limit_count ? 'error' : 'grey lighten-1'"
|
||||
:dark="family_deceased_N_selected.length > tabletItem.yang_limit_count"
|
||||
label>
|
||||
{{ family_deceased_N_selected.length }} / {{ tabletItem.yang_limit_count }}
|
||||
</v-chip>
|
||||
</v-col>
|
||||
<v-spacer></v-spacer>
|
||||
<v-col cols="auto">
|
||||
@@ -700,6 +716,15 @@
|
||||
saveData() {
|
||||
// 其它資料欄位, 不應在這裡修改
|
||||
// 應該在進來的時候, 就已經修改(insert)好了
|
||||
if (this.tabletItem.has_chao_limit && this.family_deceased_Y_selected.length > this.tabletItem.chao_limit_count) {
|
||||
alert(`超渡人數超過限制!(上限 ${this.tabletItem.chao_limit_count} 人)`);
|
||||
return; // 阻斷存檔
|
||||
}
|
||||
if (this.tabletItem.has_yang_limit && this.family_deceased_N_selected.length > this.tabletItem.yang_limit_count) {
|
||||
alert(`陽上人數超過限制!(上限 ${this.tabletItem.yang_limit_count} 人)`);
|
||||
return; // 阻斷存檔
|
||||
}
|
||||
|
||||
let tablet_data = {};
|
||||
if (this.item_type === 'B') {// B:超渡, 超薦.....
|
||||
tablet_data = {
|
||||
|
||||
Reference in New Issue
Block a user