From a58e6ac7ac643259d22c9c72d2ff9b1955c2a4f0 Mon Sep 17 00:00:00 2001 From: minom Date: Mon, 25 May 2026 17:41:32 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BF=AB=E9=80=9F=E5=A0=B1=E5=90=8D=EF=BC=8C?= =?UTF-8?q?=E5=8A=9F=E5=BE=B7=E5=85=A7=E5=AE=B9=E8=A8=AD=E5=AE=9A=E8=AA=BF?= =?UTF-8?q?=E6=95=B4:=E5=8F=AA=E8=A6=81=E9=81=B8=E6=93=87=E9=A0=90?= =?UTF-8?q?=E8=A8=AD=E7=89=88=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/App_Code/Model/ViewModel/activity.cs | 2 + web/App_Code/api/activityController.cs | 108 ++++++++++++++++++++++ web/admin/activity/item_reg.aspx | 113 +++++++++-------------- web/admin/activity/item_reg.aspx.cs | 24 ++--- web/admin/order/fastSignUp.vue | 55 +++++++++-- web/admin/order/fastSignUp2.vue | 101 ++++++++++---------- web/admin/order/fastSignUp3.vue | 37 +++++--- 7 files changed, 291 insertions(+), 149 deletions(-) diff --git a/web/App_Code/Model/ViewModel/activity.cs b/web/App_Code/Model/ViewModel/activity.cs index 48a7561..8fe28a1 100644 --- a/web/App_Code/Model/ViewModel/activity.cs +++ b/web/App_Code/Model/ViewModel/activity.cs @@ -32,6 +32,8 @@ namespace Model.ViewModel public string subject { get; set; } public int? num { get; set; } public string is_reconcile { get; set; } + public string up_time1 { get; set; } + public string up_time2 { get; set; } } diff --git a/web/App_Code/api/activityController.cs b/web/App_Code/api/activityController.cs index bfbafd7..4d31baa 100644 --- a/web/App_Code/api/activityController.cs +++ b/web/App_Code/api/activityController.cs @@ -235,6 +235,114 @@ public class activityController : ApiController var count = _db.activities.Count(); return count; } + + [HttpPost] + [Route("api/activity/GetListNew")] + public IHttpActionResult GetListNew([FromBody] Model.ViewModel.activity q, int page, int pageSize = 10, + string sortBy = "", bool sortDesc = false) + { + var qry = _db.activities.AsQueryable(); + if (!string.IsNullOrEmpty(q.subject)) + qry = qry.Where(o => o.subject.Contains(q.subject)); + if (q.kind.HasValue && q.kind > 0) + { + var _subKinds = new TreeView().subKinds(_db.activity_kind.Select(o => new TreeItem() + { + num = o.num, + root = o.root, + }).ToList(), q.kind.Value); + + //qry = qry.Where(o => o.kind == q.kind); + qry = qry.Where(o => o.kind == q.kind.Value || _subKinds.Any(s => s == o.kind)); + } + if (!string.IsNullOrEmpty(q.up_time1)) + { + var s = DateTime.Parse(q.up_time1); + qry = qry.Where(o => o.startDate_solar <=s&&o.endDate_solar>=s); + } + + //if (!string.IsNullOrEmpty(q.up_time2)) + //{ + // var end = DateTime.Parse(q.up_time2); + // qry = qry.Where(o => o.endDate_solar<=end); + //} + + if (!string.IsNullOrEmpty(q.kindTxt)) + qry = qry.Where(o => o.activity_kind.kind.Contains(q.kindTxt)); + + if (sortBy.Equals("subject")) + { + if (sortDesc) + qry = qry.OrderByDescending(o => o.subject); + else + qry = qry.OrderBy(o => o.subject); + } + else if (sortBy.Equals("kind")) + { + if (sortDesc) + qry = qry.OrderByDescending(o => o.kind); + else + qry = qry.OrderBy(o => o.kind); + } + else if (sortBy.Equals("startDate_solar")) + { + if (sortDesc) + qry = qry.OrderByDescending(o => o.startDate_solar); + else + qry = qry.OrderBy(o => o.startDate_solar); + } + else if (sortBy.Equals("endDate_solar")) + { + if (sortDesc) + qry = qry.OrderByDescending(o => o.endDate_solar); + else + qry = qry.OrderBy(o => o.endDate_solar); + } + else if (sortBy.Equals("dueDate")) + { + if (sortDesc) + qry = qry.OrderByDescending(o => o.dueDate); + else + qry = qry.OrderBy(o => o.dueDate); + } + else + qry = qry.OrderByDescending(o => o.num); + + var count = qry.Count(); //pageSize = count;//一次取回?? + var qryList = (pageSize > 0) ? qry.ToPagedList(page, pageSize).ToList() : qry.ToList(); + + var ret = new + { + list = qryList.Select(x => new + { + num = x.num, + subject = x.subject, + kind = x.kind, + kindTxt = x.kind.HasValue ? x.activity_kind.kind : "", + kindsTxt = x.kind.HasValue ? new TreeView().kindText(_db.activity_kind.Select(o => new TreeItem() + { + kind = o.kind, + num = o.num, + root = o.root, + }).ToList(), x.kind) : "", + startDate_solar = x.startDate_solar, + endDate_solar = x.endDate_solar, + startDate_lunar = x.startDate_lunar, + endDate_lunar = x.endDate_lunar, + dueDate = x.dueDate, + orderCounts = _db.pro_order.Where(y => y.activity_num == x.num).Count(), + }), + count = count, + + + }; + + + if (ret.list == null) throw new HttpResponseException(HttpStatusCode.NotFound); + return Ok(ret); + } + + [HttpPost] [Route("api/activity/GetList")] public IHttpActionResult GetList([FromBody] Model.ViewModel.activity q, int page, int pageSize = 10, diff --git a/web/admin/activity/item_reg.aspx b/web/admin/activity/item_reg.aspx index 6fd70b9..7e8d4f9 100644 --- a/web/admin/activity/item_reg.aspx +++ b/web/admin/activity/item_reg.aspx @@ -199,19 +199,24 @@ val: 0 }, }, + style_datas: [], + paper_datas: [], + defaultStyle: "", + paperID: "", + printID:"" } }, mounted() { this.search_dialog.current = this.search_dialog.controls.search1 //console.log("mounted"); + this.initialize() }, watch: { options: { handler() { //console.log("watch1", this.search_dialog, this.search_dialog.page); this.search_get() - console.log("watch2", this.search_dialog, this.search_dialog.page); - }, + }, deep: true, }, optionsDetail: { @@ -248,7 +253,6 @@ if (this.this_id == "") search['status'] = "Y";//啟用 } - console.log("search_get", api_url, search, params, this.options); this.search_dialog.loading = true axios.post(api_url, search, { params: params }) .then(response => { @@ -289,7 +293,7 @@ else { } - console.log("search_select", row, editem); + //debugger; target.children("input.search-text").val(curr.selected[curr.text_prop])//text target.children("input:hidden").val(curr.selected[curr.value_prop])//value @@ -336,46 +340,19 @@ ) } - axios - .post(HTTP_HOST + 'api/tablet/GetPaperSize', {}) - .then(response => { - console.log(response); - if (response.status == "200") { - let data = response.data; - if (data.result == "Y") { - data.data.forEach(x => { - this.paperlist.push({ name: x.paperName, id: x.paperID, width: x.width, height: x.height }) - $('#<%= ddlPageSize.ClientID %>').append(``); - $('#<%= ddlPrintSize.ClientID %>').append(``); - }); - - $('#<%= ddlPageSize.ClientID %>').val($("#<%= hidPageSize.ClientID %>").val()) - $('#<%= ddlPrintSize.ClientID %>').val($("#<%= hidPrintSize.ClientID %>").val()) - } - } - }) - .catch( - error => console.log(error) - ) + this.paper_datas.length = 0 + this.style_datas.length = 0 axios .post(HTTP_HOST + 'api/tablet/GetStyleData', {}) .then(response => { - console.log(response); if (response.status == "200") { let data = response.data; if (data.result == "Y") { - data.data.forEach(x => { - if (x.styleID != "000001") { - this.stylelist.push({ styleID: x.styleID, name: x.name }) - $('#<%= ddlDefaultStyle.ClientID %>').append(``); - //$("#defaultStyle").append(``); - } - }); - $('#<%= ddlDefaultStyle.ClientID %>').val($("#<%= hidDefaultStyle.ClientID %>").val()) - } - } - }) + this.style_datas = data.data + this.defaultStyle=$("#<%=hidDefaultStyle.ClientID %>").val() + } + }}) .catch( error => console.log(error) ) @@ -492,7 +469,7 @@ bom_editItem(item) { this.bom_editedIndex = this.bom_list.indexOf(item); this.bom_editedItem = $.extend(true, {}, item); - console.log("bom_editItem:", this.bom_editedIndex, this.bom_editedItem); + //debugger; }, bom_deleteItem(item) { @@ -572,13 +549,13 @@ } }, changeSel(selType) { - if (selType=="ddlPageSize") { - $("#<%= hidPageSize.ClientID %>").val($("#<%= ddlPageSize.ClientID %>").val()) - } else if (selType == "ddlPrintSize") { - $("#<%= hidPrintSize.ClientID %>").val($("#<%=ddlPrintSize.ClientID %>").val()) - } else if (selType == "ddlDefaultStyle") { - $("#<%= hidDefaultStyle.ClientID %>").val($("#<%= ddlDefaultStyle.ClientID %>").val()) - } + let style = this.style_datas.find(x => x.styleID == this.defaultStyle) + this.paperID = style.paperSize + this.printID = style.printSize + $("#<%= hidPageSize.ClientID %>").val(this.paperID) + $("#<%=hidPrintSize.ClientID %>").val(this.printID) + $("#<%=hidDefaultStyle.ClientID %>").val(this.defaultStyle) + } }, computed: { @@ -659,47 +636,43 @@
- + <%--
-
+
--%>
- -
- -
+ +
+ +
+
-
-
- -
- - -
- + +
- - + + + <%-- --%> + + +
-
- -
- - -
- -
@@ -909,7 +882,7 @@ - diff --git a/web/admin/activity/item_reg.aspx.cs b/web/admin/activity/item_reg.aspx.cs index 74a81f8..c9a7891 100644 --- a/web/admin/activity/item_reg.aspx.cs +++ b/web/admin/activity/item_reg.aspx.cs @@ -42,21 +42,21 @@ public partial class admin_activity_item_reg : MyWeb.config BuildKind(); subject.Text = prod.subject; print_init.Text = prod.print_init; - PARTNO.Text = prod.partno; + //PARTNO.Text = prod.partno; //kind.SelectedValue = prod.kind.ToString(); if (!isStrNull(prod.pageSize)) { - ddlPageSize.Value = prod.pageSize.ToString(); + //ddlPageSize.Value = prod.pageSize.ToString(); hidPageSize.Value = prod.pageSize.ToString(); } if (!isStrNull(prod.printSize)) { - ddlPrintSize.Value = prod.printSize.ToString(); + //ddlPrintSize.Value = prod.printSize.ToString(); hidPrintSize.Value = prod.printSize.ToString(); } if (!isStrNull(prod.defaultStyle)) { - ddlDefaultStyle.Value = prod.defaultStyle.ToString(); + //ddlDefaultStyle.Value = prod.defaultStyle.ToString(); hidDefaultStyle.Value = prod.defaultStyle.ToString(); } if (prod.kind.HasValue) @@ -136,18 +136,18 @@ public partial class admin_activity_item_reg : MyWeb.config int maxSort = _db.actItems.Max(x => (int?)x.sort_order) ?? 0; actItem.subject = subject.Text; actItem.print_init = print_init.Text; - actItem.partno = PARTNO.Text; - if (!isStrNull(ddlPageSize.Value)) + //actItem.partno = PARTNO.Text; + if (!isStrNull(hidPageSize.Value)) { - actItem.pageSize = ddlPageSize.Value; + actItem.pageSize = hidPageSize.Value; } - if (!isStrNull(ddlPrintSize.Value)) + if (!isStrNull(hidPrintSize.Value)) { - actItem.printSize = ddlPrintSize.Value; + actItem.printSize = hidPrintSize.Value; } - if (!isStrNull(ddlDefaultStyle.Value)) + if (!isStrNull(hidDefaultStyle.Value)) { - actItem.defaultStyle = (ddlDefaultStyle.Value); + actItem.defaultStyle = (hidDefaultStyle.Value); } //if (!isStrNull(kind.SelectedValue)) { actItem.kind = Val(kind.SelectedValue); } else { actItem.kind = null; } if (!isStrNull(category.SelectedValue)) { actItem.category = Val(category.SelectedValue); } else { actItem.category = null; } @@ -196,7 +196,7 @@ public partial class admin_activity_item_reg : MyWeb.config { actItem.subject = subject.Text; actItem.print_init = print_init.Text; - actItem.partno = PARTNO.Text; + //actItem.partno = PARTNO.Text; if (!isStrNull(hidPageSize.Value)) { actItem.pageSize = hidPageSize.Value; diff --git a/web/admin/order/fastSignUp.vue b/web/admin/order/fastSignUp.vue index 4419680..f0d5fc8 100644 --- a/web/admin/order/fastSignUp.vue +++ b/web/admin/order/fastSignUp.vue @@ -12,19 +12,54 @@ - + - + + + + + + - - - + 查詢 + 清空條件 @@ -91,6 +126,8 @@ this_act:'', options: { multiSort: false }, search_options: { multiSort: false }, + startmenu: false, + endmenu: false, data_table: { loading: true, list: [], @@ -270,6 +307,10 @@ }, }, methods: { + clearSearch() { + this.search.subject = "" + this.search.up_time1="" + }, gotoSignup(item) { this.$emit('custom-event', { action: 'add', item: item }); }, @@ -305,7 +346,7 @@ sessionStorage.setItem('orderpage', clearpage ? '1' : page); axios //.post(HTTP_HOST + 'api/order/GetList', this.search, { params: params }) - .post(HTTP_HOST + 'api/activity/GetList', this.search, { params: params }) + .post(HTTP_HOST + 'api/activity/GetListNew', this.search, { params: params }) .then(response => { this.data_table.list = response.data.list this.data_table.count = response.data.count; diff --git a/web/admin/order/fastSignUp2.vue b/web/admin/order/fastSignUp2.vue index d17d7a1..104da26 100644 --- a/web/admin/order/fastSignUp2.vue +++ b/web/admin/order/fastSignUp2.vue @@ -1,51 +1,55 @@