功能調整

This commit is contained in:
2026-05-27 17:52:36 +08:00
parent 669b29d183
commit 2b9e266eb0
7 changed files with 193 additions and 179 deletions
+17 -1
View File
@@ -14,6 +14,7 @@ using System.IdentityModel.Metadata;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Web.Helpers;
using System.Web.Http;
using static TreeView;
@@ -345,7 +346,7 @@ public class orderController : ApiController
public IHttpActionResult GetList([FromBody] Model.ViewModel.pro_order q, int page, int pageSize = 10,
string sortBy = "", bool sortDesc = false)
{
MyWeb.encrypt encrypt = new MyWeb.encrypt();
var qry = _db.pro_order.Include("activity").Include("activity.activity_check").AsQueryable();
//var aIDt = _db.actItems.AsEnumerable().Where(f => f.subject.Contains(q.actItemTxt.Trim())).Select(f => f.num);//品項
@@ -398,6 +399,21 @@ public class orderController : ApiController
}
}
if (q.f_user!=null&&!string.IsNullOrEmpty(q.f_user.u_name)) {
qry = qry.Where(o => o.f_num != null && o.follower != null && o.follower.u_name ==q.f_user.u_name);
}
if (q.f_user != null && !string.IsNullOrEmpty(q.f_user.phone))
{
qry = qry.Where(o => o.f_num != null && o.follower != null && encrypt.DecryptAutoKey(o.follower.phone) == q.f_user.phone);
}
if (q.f_user != null && !string.IsNullOrEmpty(q.f_user.cellphone))
{
qry = qry.Where(o => o.f_num != null && o.follower != null && encrypt.DecryptAutoKey(o.follower.cellphone) == q.f_user.cellphone);
}
if (q.f_user != null && !string.IsNullOrEmpty(q.f_user.id_code))
{
qry = qry.Where(o => o.f_num != null && o.follower != null && encrypt.DecryptAutoKey(o.follower.id_code) == q.f_user.id_code);
}
if (sortBy.Equals("order_no"))
{
+2 -2
View File
@@ -986,7 +986,7 @@
</div>
</div>
<div class="row mb-1 label-sm-right">
<label class="col-sm-2 col-lg-1 col-form-label">開始日期(西元)</label>
<label class="col-sm-2 col-lg-1 col-form-label">開始日期(西元)*</label>
<div class="col-sm-4 col-lg-3">
<asp:TextBox ID="startDate_solar" TextMode="Date" runat="server" CssClass="form-control" onchange="chagenDate(this)"></asp:TextBox>
</div>
@@ -1003,7 +1003,7 @@
<div class="row mb-1 label-sm-right">
<label class="col-sm-2 col-lg-1 col-form-label">結束日期(西元)</label>
<label class="col-sm-2 col-lg-1 col-form-label">結束日期(西元)*</label>
<div class="col-sm-4 col-lg-3">
<asp:TextBox ID="endDate_solar" TextMode="Date" runat="server" CssClass="form-control" onchange="chagenDate(this)"></asp:TextBox>
</div>
+34 -20
View File
@@ -254,7 +254,7 @@ public partial class admin_activity_reg : MyWeb.config
{
if (textBox.TextMode == TextBoxMode.Date)
ObjValue.SetValue(activity, selectDate(textBox));
else
ObjValue.SetValue(activity, ((TextBox)obj).Text.Trim());
}
@@ -281,24 +281,31 @@ public partial class admin_activity_reg : MyWeb.config
// printInit 欄位
//var printInitValue = printInit.Text.Trim();
//activity.print_init = !string.IsNullOrEmpty(printInitValue) ? printInitValue : null;
activity.kind = Val(kind.Value);
activity.category_kind = Val(category_kind.Value);
activity.reg_time = DateTime.Now;
_db.activities.Add(activity);
_db.SaveChanges();
int _id = activity.num;
if (_id > 0)
if (activity.startDate_solar == null || activity.endDate_solar == null)
{
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);
Response.Redirect("index.aspx");
L_msg.Type = alert_type.danger;
L_msg.Text = "開始、結束日期必須填寫";
}
else
{
L_msg.Type = alert_type.danger;
L_msg.Text = "Error";
activity.kind = Val(kind.Value);
activity.category_kind = Val(category_kind.Value);
activity.reg_time = DateTime.Now;
_db.activities.Add(activity);
_db.SaveChanges();
int _id = activity.num;
if (_id > 0)
{
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);
Response.Redirect("index.aspx");
}
else
{
L_msg.Type = alert_type.danger;
L_msg.Text = "Error";
}
}
}
catch (Exception ex)
@@ -363,12 +370,19 @@ public partial class admin_activity_reg : MyWeb.config
// printInit 欄位
//var printInitValue = printInit.Text.Trim();
//activity.print_init = !string.IsNullOrEmpty(printInitValue) ? printInitValue : null;
if (activity.startDate_solar == null || activity.endDate_solar == null)
{
L_msg.Type = alert_type.danger;
L_msg.Text = "開始、結束日期必須填寫";
}
else
{
activity.category_kind = Val(category_kind.Value);
_db.SaveChanges();
activity.category_kind = Val(category_kind.Value);
_db.SaveChanges();
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.Update, subject.Text);
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.Update, subject.Text);
}
}
catch (Exception ex)
{
+17 -122
View File
@@ -6,11 +6,12 @@
<v-expansion-panel-header>查詢條件</v-expansion-panel-header>
<v-expansion-panel-content>
<v-row>
<v-col cols="2" md="2">
<v-text-field label="法會分類">
<!-- <v-col cols="2" md="2">-->
<!--<v-text-field label="法會分類">
</v-text-field>
</v-col>
</v-text-field>-->
<!--</v-col>-->
<v-col cols="2" md="2">
<v-text-field label="法會名稱" v-model="search.subject">
@@ -38,25 +39,6 @@
@input="startmenu = false"></v-date-picker>
</v-menu>
</v-col>
<!--<v-col cols="2" md="2">
<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="search.up_time2"
label="結束日期"
prepend-icon="mdi-calendar"
readonly
v-bind="attrs"
v-on="on"></v-text-field>
</template>
<v-date-picker v-model="search.up_time2"
@input="endmenu = false"></v-date-picker>
</v-menu>
</v-col>-->
<v-col cols="2" md="2">
<v-btn @click.prevent="getDefault()">查詢</v-btn>
<v-btn @click.prevent="clearSearch()">清空條件</v-btn>
@@ -67,7 +49,6 @@
</v-expansion-panels>
<v-data-table v-model="data_table.selected"
:items="data_table.list"
item-key="order_no"
:options.sync="options"
:headers="data_table.header"
@@ -75,7 +56,6 @@
:server-items-length="data_table.count"
:loading="data_table.loading"
:single-select="data_table.singleSelect"
show-select
hide-default-footer
:page.sync="data_table.page"
:items-per-page.sync="data_table.pageSize"
@@ -128,6 +108,7 @@
search_options: { multiSort: false },
startmenu: false,
endmenu: false,
itemKindList:[],
data_table: {
loading: true,
list: [],
@@ -149,18 +130,6 @@
itemsPerPageOptions: [5, 10, 20, 30],
},
},
//列印管理報表
//print_conditions: 'yy',
//print_search: {
// year: '',
// month: '',
// season: '',
// chk_hasact: false,
// chk_noact: false,
// select_act: '',
// select_actitem: '',
//},
select_act_list: [],
select_items: {
month: [{
@@ -172,85 +141,6 @@
val: 0
},],
},
//print_dialog: {
// show: false,
//},
//search_dialog: {
// controls: {
// search1: {
// id: 'search1',
// title: '國籍',
// text_prop: 'name_zh',
// value_prop: 'id',
// keys: [
// { id: 'keyword', title: '關鍵字' },
// ],
// api_url: HTTP_HOST + 'api/country/GetList',
// columns: [
// { id: 'id', title: '代碼' },
// { id: 'name_en', title: '英文短名稱' },
// { id: 'name_zh', title: '中文名稱' },
// ],
// selected: {},
// select(item, t) {
// //console.log("select search1", t);
// t.search.country = item.id;
// t.search.country2 = '';
// }
// },
// search2: {
// id: 'search2',
// title: '報名活動',
// text_prop: 'subject',
// value_prop: 'num',
// keys: [
// { id: 'subject', title: '活動名稱', value: '' },
// { id: 'kindTxt', title: '活動分類' },
// ],
// api_url: HTTP_HOST + 'api/activity/GetList',
// columns: [
// { id: 'subject', title: '活動名稱' },
// { id: 'kindTxt', title: '活動分類' },
// ],
// selected: {},
// select(item, t) {
// t.print_search.select_act = item.num;
// }
// },
// search3: {
// id: 'search3',
// title: '活動品項',
// text_prop: 'subject',
// value_prop: 'num',
// keys: [
// { id: 'subject', title: '項目名稱', value: '' },
// { id: 'kindTxt', title: '項目分類' },
// { id: 'num', visible: false },
// ],
// api_url: HTTP_HOST + 'api/activity/GetOrderList',
// columns: [
// { id: 'subject', title: '項目名稱' },
// { id: 'kindTxt', title: '項目分類' },
// ],
// selected: {},
// select(item, t) {
// t.print_search.select_actitem = item.num;
// }
// }
// }, show: false,
// current: {},
// list: [],
// count: 0,
// page: 1,
// loading: false,
// footer: {
// showFirstLastPage: true,
// disableItemsPerPage: true,
// itemsPerPageAllText: '',
// itemsPerPageText: '',
// },
//},
search: {
keyin1: '',
order_no: '',
@@ -274,12 +164,6 @@
};
},
mounted() {
//this.detalKeyinArray();
//this.search_dialog.current = this.search_dialog.controls.search1 ///default
//if (this.this_act != '')
// this.search.activity_num = this.this_act;
//this.initPrintSearch();
//this.initActivity();
const navEntries = performance.getEntriesByType("navigation");
const isReload = navEntries.length > 0 && navEntries[0].type === "reload";
if (isReload) {
@@ -291,6 +175,7 @@
this.options.page = savedPage;
}
}
this.initKindList()
},
watch: {
options: {
@@ -307,6 +192,16 @@
},
},
methods: {
initKindList() {
axios
//.get(HTTP_HOST + 'api/activity_kind')
.get(HTTP_HOST + 'api/actItem_kind/GetAll')
.then(response => {
this.itemKindList = response.data
})
.catch(error => console.log(error))
},
clearSearch() {
this.search.subject = ""
this.search.up_time1=""
+61 -24
View File
@@ -2,8 +2,51 @@
<div class="container-fluid">
<v-card>
<v-card-title class="bg-primary white--text text-center">
<v-btn @click.prevent='fast_signup'>快速報名</v-btn>
<v-btn @click.prevent="back01()" class="ms-auto">返回</v-btn>
<v-expansion-panels accordion>
<v-expansion-panel v-for="(item,i) in 1"
:key="i">
<v-expansion-panel-header color="#006fc9"
class="white--text">
<v-row>
<v-col cols="10" md="10">
<label>查詢條件</label>
</v-col>
<v-col cols="2" md="2">
<v-btn @click.prevent='fast_signup' class="ms-auto">快速報名</v-btn>
<v-btn @click.prevent="back01()" class="ms-auto">返回</v-btn>
</v-col>
</v-row>
</v-expansion-panel-header>
<v-expansion-panel-content>
<v-row>
<v-col cols="2" md="2">
<v-text-field label="姓名" v-model="search.u_name">
</v-text-field>
</v-col>
<v-col cols="2" md="2">
<v-text-field label="電話" v-model="search.phone">
</v-text-field>
</v-col>
<v-col cols="2" md="2">
<v-text-field label="行動電話" v-model="search.cellphone">
</v-text-field>
</v-col>
<v-col cols="2" md="2">
<v-text-field label="身分證號" v-model="search.id_code">
</v-text-field>
</v-col>
<v-col cols="2" md="2">
<v-btn @click.prevent="getDetail()">查詢</v-btn>
<v-btn @click.prevent="clearSearch()">清空條件</v-btn>
</v-col>
</v-row>
</v-expansion-panel-content>
</v-expansion-panel>
</v-expansion-panels>
</v-card-title>
<v-card-text>
<v-data-table v-model="detail_table.selected"
@@ -16,7 +59,6 @@
:server-items-length="detail_table.count"
:loading="detail_table.loading"
:single-select="detail_table.singleSelect"
show-select
hide-default-footer
:page.sync="detail_table.page"
:items-per-page.sync="detail_table.pageSize"
@@ -59,12 +101,10 @@
type: Number }
},
activated() {
console.log("yes ,go go", this.num);
this.getDetail();
},
mounted() {
console.log("yes ,go go", this.num);
this.getDetail();
},
data() {
@@ -92,18 +132,10 @@
},
},
search: {
keyin1: '',
order_no: '',
subject: '',
u_name: '',
up_time1: '',
up_time2: '',
actItemTxt: '',
introducerTxt: '',
activity_num: '',
country: '',
country2: '',
hasPrice: '',
phone: '',
cellphone: '',
id_code:''
}
};
},
@@ -123,20 +155,25 @@
fast_signup() {
this.$emit('custom-event', { action: 'add', item: this.num });
},
getDetail() {
clearSearch() {
},
getDetail(clearpage=false) {
const { sortBy, sortDesc, page, itemsPerPage } = this.options
const params = {
//sortBy: sortBy == undefined ? "order_no" : sortBy[0],
//sortDesc: sortDesc == undefined ? "" : sortDesc[0],
//page: clearpage ? '1' : page, pageSize: itemsPerPage,
page: '1', pageSize: 10,
sortBy: sortBy[0], sortDesc: sortDesc[0],
page: clearpage ? '1' : page, pageSize: itemsPerPage
};
this.search = { activity_num: this.num }
let newsearch = {
activity_num: this.num, f_user: {
u_name: this.search.u_name, phone: this.search.phone,
cellphone: this.search.cellphone, id_code: this.search.id_code
}
}
this.detail_table.loading = true
sessionStorage.setItem('orderpage', '1');// clearpage ? '1' : page
axios
.post(HTTP_HOST + 'api/order/GetList', this.search, { params: params })
.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;
+7 -3
View File
@@ -112,7 +112,7 @@
</template>
<template v-slot:no-data>
<v-alert :value="true" color="error" icon="warning">
無資料可顯示可能此信眾未曾參加過
無資料可顯示可能此信眾未曾參加過任何法會
</v-alert>
</template>
</v-data-iterator>
@@ -121,7 +121,7 @@
</v-card-text>
</v-card>
<v-dialog v-model="message_dialog.show" style="width: 300px !important; height: 300px !important;">
<v-dialog v-model="message_dialog.show" class="dialog_width">
<template>
<v-card>
<v-card-title>
@@ -136,7 +136,7 @@
</v-dialog>
<v-dialog v-model="transfer_dialog.show" width="300px" style="width: 300px !important; height: 300px !important;">
<v-dialog v-model="transfer_dialog.show" class="dialog_width">
<template>
<v-card>
<v-card-title>
@@ -454,4 +454,8 @@
.enabled-checkbox {
}
.v-dialog{
width:500px !important;
}
</style>
+55 -7
View File
@@ -854,11 +854,28 @@
self.bindEvent();
},
async addNewItem() {
console.log("addNewItem:",$("#custom_txt").val())
if ($("#custom_txt").val()=="") {
alert("名稱不可空白")
return false
}
let self = this;
let target = $(self.selectedElement).children().first();
let error=""
//let fam = self.familyMembers.find(x => x.fam_name == target.text());
if (target.hasClass("liveList")) {
self.alive.forEach(x => {
if (x == $("#custom_txt").val()) {
error = "名稱已存在"
}
})
if (error != "") {
alert(error)
return false
}
self.alive.push($("#custom_txt").val());
let obj = {
IsShuWen: false,
@@ -872,6 +889,15 @@
}
self.family_deceased_Y_selected.push(obj);
} else if (target.hasClass("nameList") || target.hasClass("rosterList")) {
self.properTitle.forEach(x => {
if (x == $("#custom_txt").val()) {
error = "名稱已存在"
}
})
if (error != "") {
alert(error)
return false
}
self.properTitle.push($("#custom_txt").val());
let obj = {
IsShuWen: false,
@@ -885,6 +911,16 @@
}
self.family_deceased_N_selected.push(obj);
} else if (target.hasClass("ancestor-wrapper")) {
//再來判斷是否已有這個名稱
self.properTitle.forEach(x => {
if (x == $("#custom_txt").val()) {
error = "名稱已存在"
}
})
if (error != "") {
alert(error)
return false
}
if (self.properTitle.length >= 2) {
alert("多姓氏合併必須第一個名稱為姓,第二個名稱為氏歷代祖先之類,且最多兩個名稱");
} else {
@@ -902,9 +938,15 @@
self.family_deceased_N_selected.push(obj);
}
} else if (target.hasClass("lefttitle")) {
//if (self.leftProperTitle.length >= 1) {
// alert("左正名");
//} else {
self.leftProperTitle.forEach(x => {
if (x == $("#custom_txt").val()) {
error = "名稱已存在"
}
})
if (error != "") {
alert(error)
return false
}
self.leftProperTitle.length = 0;
self.family_left_title.length = 0;
self.leftProperTitle.push($("#custom_txt").val());
@@ -922,9 +964,15 @@
//self.family_deceased_N_selected.push(obj);
//}
} else if (target.hasClass("righttitle")) {
//if (self.rightProperTitle.length >= 1) {
// alert("右正名");
//} else {
self.rightProperTitle.forEach(x => {
if (x == $("#custom_txt").val()) {
error = "名稱已存在"
}
})
if (error != "") {
alert(error)
return false
}
self.rightProperTitle.length = 0;
self.family_right_title.length = 0;
self.rightProperTitle.push($("#custom_txt").val());