17 Commits

Author SHA1 Message Date
minom 7db39117b4 批次報名移除排序功能·移除一些console.log 2026-06-23 07:56:12 +08:00
minom 5fa147f960 功能修正調整 2026-06-22 17:58:04 +08:00
minom 5f3ac3ec7f 牌位版型設計,增加刪除版型跟紙張尺寸 2026-06-16 09:44:16 +08:00
minom c249e84240 modify 2026-06-08 17:02:17 +08:00
minom 23da5f0dc0 modify 2026-06-08 13:41:33 +08:00
minom dce5d52a70 merge to main 2026-06-08 13:32:21 +08:00
minom 824077858d Merge pull request 'merge to main' (#7) from 0.2 into main
Reviewed-on: #7
2026-06-08 01:42:06 +00:00
minom 121c5e1637 merge N++ 0.1 2026-06-08 09:39:58 +08:00
EnChia b866a3c454 1. 隱藏信眾資料牌位標題
2. 刪除品項的料號欄位
3. 更新資料庫修改紀錄
2026-05-12 17:52:43 +08:00
EnChia ca9548494c 更新 資料庫修改紀錄.txt 2026-05-11 09:38:14 +08:00
EnChia e201426e5f 更新 資料庫修改紀錄.md 2026-05-11 01:34:50 +00:00
EnChia 46494547db 將全年報名移至獨立頁籤,並新增未報名品項名單列印功能 2026-05-11 09:11:22 +08:00
EnChia 9a7c30bd21 1. 更新法會活動品項中的牌位陽上與超度人數限制功能 2026-05-04 13:48:51 +08:00
EnChia 29f2902119 1. 更新法會活動品項中的牌位陽上與超度人數限制功能 2026-05-04 13:44:16 +08:00
EnChia 11a8c3e932 1. 新增法會活動品項:牌位陽上與超度人數限制功能
2. 信眾資料新增全年性選項以及開始參加活動日期,自動報名並代入前一次的報名資料(品項)
2026-05-04 11:43:57 +08:00
EnChia 98af98da74 上傳檔案到「data」 2026-04-13 09:41:47 +00:00
EnChia e69fce0d02 上傳檔案到「data」 2026-04-09 09:52:34 +00:00
36 changed files with 1954 additions and 351 deletions
+6
View File
@@ -0,0 +1,6 @@
FK_act_bom_actItem1 刪除規則設為 cascade
FK_pro_order_followers 刪除規則設為 cascade
FK_pro_order_activity 刪除規則設為 cascade
FK_pro_order_detail_pro_order 刪除規則設為 cascade
FK_pro_order_detail_followers 刪除規則設為 沒有動作
FK_activity_relating_activity 刪除規則設為 cascade
+80 -2
View File
@@ -1,4 +1,5 @@
using DocumentFormat.OpenXml.Office2010.Excel;
using AjaxControlToolkit.HTMLEditor.Popups;
using DocumentFormat.OpenXml.Office2010.Excel;
using DocumentFormat.OpenXml.Wordprocessing;
using MINOM.COM.Utility;
using Model;
@@ -293,7 +294,7 @@ public class StyleDataAccess
new SqlParameter("@UTime",""),
};
sb.Append("update TabletStyle set Descr=@Descr,PaperSize=@PaperSize,BackendImg=@BackendImg,PrintSize=@PrintSize,");
sb.Append("update TabletStyle set Name=@Name,Descr=@Descr,PaperSize=@PaperSize,BackendImg=@BackendImg,PrintSize=@PrintSize,");
sb.Append("PrintMode=@PrintMode,Orientation=@Orientation,PrintPageCount=@PrintPageCount,RosterLimit=@RosterLimit,");
sb.Append("CUser=@CUser,CDate=@CDate,CTime=@CTime,UUser=@UUSer,UDate=@UDate,UTime=@UTime ");
sb.Append("where StyleID=@StyleID ");
@@ -348,4 +349,81 @@ public class StyleDataAccess
}
return obj;
}
public object[] DelTabletPaper(string paperID)
{
try
{
using (var context = new ezEntities())
{
StringBuilder sb = new StringBuilder();
SqlParameter[] sp = new SqlParameter[] {
new SqlParameter("@PaperID",paperID),
};
sb.Clear();
sb.Append("if not exists (select StyleID from TabletStyle where PaperSize=@paperID or PrintSize=@paperID)");
sb.Append("begin ");
sb.Append("delete TabletPaperSize where paperID=@paperID ");
sb.Append("end;");
sb.Append("select @@ROWCOUNT ;");
int i = context.Database.ExecuteSqlCommand(sb.ToString(), sp.ToArray());
if (i > 0)
{
obj[0] = "Y";
obj[1] = "刪除成功";
}
else
{
obj[0] = "N";
obj[1] = "刪除失敗,已有活動使用";
}
}
}
catch (Exception ex)
{
obj[0] = "N";
obj[1] = "刪除失敗:" + ex.Message;
}
return obj;
}
public object[] DelTabletStyle(string styleID)
{
try
{
using (var context = new ezEntities())
{
StringBuilder sb = new StringBuilder();
SqlParameter[] sp = new SqlParameter[] {
new SqlParameter("@StyleID",styleID),
};
sb.Clear();
sb.Append("if not exists (select defaultStyle from actItem where defaultStyle=@styleID)");
sb.Append("begin ");
sb.Append("delete TabletStyle where styleID=@styleID ");
sb.Append("delete TabletStyleDetail where StyleID=@StyleID ");
sb.Append("end;");
sb.Append("select @@ROWCOUNT ;");
int i = context.Database.ExecuteSqlCommand(sb.ToString(), sp.ToArray());
if (i > 0)
{
obj[0] = "Y";
obj[1] = "刪除成功";
}
else
{
obj[0] = "N";
obj[1] = "刪除失敗,已有活動使用";
}
}
}
catch (Exception ex)
{
obj[0] = "N";
obj[1] = "刪除失敗:"+ex.Message;
}
return obj;
}
}
+1
View File
@@ -94,6 +94,7 @@ namespace Model
public virtual DbSet<AncestralTabletRegistrant> AncestralTabletRegistrant { get; set; }
public virtual DbSet<AncestralTabletStatus> AncestralTabletStatus { get; set; }
public virtual DbSet<GuaDanOrderGuest> GuaDanOrderGuest { get; set; }
public virtual DbSet<auto_enroll> auto_enroll { get; set; }
public virtual int pager_eztrust(Nullable<int> startRowIndex, Nullable<int> pageSize, string tableName, string columnName, string sqlWhere, string orderBy, ObjectParameter rowCount)
{
+35
View File
@@ -409,6 +409,10 @@ namespace Model
public Nullable<float> price { get; set; }
public Nullable<int> qty { get; set; }
public Nullable<System.DateTime> reg_time { get; set; }
public Nullable<bool> has_yang_limit { get; set; }
public Nullable<bool> has_chao_limit { get; set; }
public Nullable<int> yang_limit_count { get; set; }
public Nullable<int> chao_limit_count { get; set; }
public virtual actItem actItem { get; set; }
public virtual activity activity { get; set; }
@@ -680,6 +684,31 @@ namespace Model
using System;
using System.Collections.Generic;
public partial class auto_enroll
{
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")]
public auto_enroll()
{
this.pro_order = new HashSet<pro_order>();
}
public int num { get; set; }
public int f_num { get; set; }
public System.DateTime start_date { get; set; }
public System.DateTime end_date { get; set; }
public string receipt_title { get; set; }
public string receipt_address { get; set; }
public virtual follower followers { get; set; }
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")]
public virtual ICollection<pro_order> pro_order { get; set; }
}
}
namespace Model
{
using System;
using System.Collections.Generic;
public partial class bed_kind
{
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")]
@@ -806,6 +835,7 @@ namespace Model
public string smtp_def { get; set; }
public string use_sender { get; set; }
public string bed_order_no { get; set; }
public string last_auto_order_no { get; set; }
}
}
namespace Model
@@ -907,6 +937,7 @@ namespace Model
this.transfer_register1 = new HashSet<transfer_register>();
this.GuaDanOrder = new HashSet<GuaDanOrder>();
this.GuaDanOrderGuest = new HashSet<GuaDanOrderGuest>();
this.auto_enroll = new HashSet<auto_enroll>();
}
public int num { get; set; }
@@ -971,6 +1002,8 @@ namespace Model
public virtual ICollection<GuaDanOrder> GuaDanOrder { get; set; }
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")]
public virtual ICollection<GuaDanOrderGuest> GuaDanOrderGuest { get; set; }
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")]
public virtual ICollection<auto_enroll> auto_enroll { get; set; }
}
}
namespace Model
@@ -1344,6 +1377,7 @@ namespace Model
public Nullable<int> introducer { get; set; }
public Nullable<bool> send_receipt { get; set; }
public string receipt_title { get; set; }
public Nullable<int> au_num { get; set; }
public virtual activity activity { get; set; }
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")]
@@ -1352,6 +1386,7 @@ namespace Model
public virtual follower follower1 { get; set; }
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")]
public virtual ICollection<pro_order_detail> pro_order_detail { get; set; }
public virtual auto_enroll auto_enroll { get; set; }
}
}
namespace Model
+124
View File
@@ -193,6 +193,10 @@
<Property Name="price" Type="real" />
<Property Name="qty" Type="int" />
<Property Name="reg_time" Type="datetime" />
<Property Name="has_yang_limit" Type="bit" />
<Property Name="has_chao_limit" Type="bit" />
<Property Name="yang_limit_count" Type="int" />
<Property Name="chao_limit_count" Type="int" />
</EntityType>
<EntityType Name="activity_spares">
<Key>
@@ -333,6 +337,17 @@
<Property Name="num" Type="int" StoreGeneratedPattern="Identity" Nullable="false" />
<Property Name="title" Type="nvarchar" MaxLength="10" />
</EntityType>
<EntityType Name="auto_enroll">
<Key>
<PropertyRef Name="num" />
</Key>
<Property Name="num" Type="int" StoreGeneratedPattern="Identity" Nullable="false" />
<Property Name="f_num" Type="int" Nullable="false" />
<Property Name="start_date" Type="date" Nullable="false" />
<Property Name="end_date" Type="date" Nullable="false" />
<Property Name="receipt_title" Type="nvarchar(max)" />
<Property Name="receipt_address" Type="nchar" MaxLength="200" />
</EntityType>
<EntityType Name="bed_kind">
<Key>
<PropertyRef Name="num" />
@@ -404,6 +419,7 @@
<Property Name="smtp_def" Type="nvarchar" MaxLength="1" />
<Property Name="use_sender" Type="nvarchar" MaxLength="1" />
<Property Name="bed_order_no" Type="nvarchar" MaxLength="20" />
<Property Name="last_auto_order_no" Type="nvarchar" MaxLength="20" />
</EntityType>
<EntityType Name="country">
<Key>
@@ -700,6 +716,7 @@
<Property Name="introducer" Type="int" />
<Property Name="send_receipt" Type="bit" />
<Property Name="receipt_title" Type="nvarchar(max)" />
<Property Name="au_num" Type="int" />
</EntityType>
<EntityType Name="pro_order_detail">
<Key>
@@ -1269,6 +1286,18 @@
</Dependent>
</ReferentialConstraint>
</Association>
<Association Name="FK_auto_enroll_followers">
<End Role="followers" Type="Self.followers" Multiplicity="1" />
<End Role="auto_enroll" Type="Self.auto_enroll" Multiplicity="*" />
<ReferentialConstraint>
<Principal Role="followers">
<PropertyRef Name="num" />
</Principal>
<Dependent Role="auto_enroll">
<PropertyRef Name="f_num" />
</Dependent>
</ReferentialConstraint>
</Association>
<Association Name="FK_bed_kind_detail_bed_kind">
<End Role="bed_kind" Type="Self.bed_kind" Multiplicity="0..1" />
<End Role="bed_kind_detail" Type="Self.bed_kind_detail" Multiplicity="*" />
@@ -1647,6 +1676,18 @@
</Dependent>
</ReferentialConstraint>
</Association>
<Association Name="FK_pro_order_auto_enroll">
<End Role="auto_enroll" Type="Self.auto_enroll" Multiplicity="0..1" />
<End Role="pro_order" Type="Self.pro_order" Multiplicity="*" />
<ReferentialConstraint>
<Principal Role="auto_enroll">
<PropertyRef Name="num" />
</Principal>
<Dependent Role="pro_order">
<PropertyRef Name="au_num" />
</Dependent>
</ReferentialConstraint>
</Association>
<Association Name="FK_pro_order_detail_actItem">
<End Role="actItem" Type="Self.actItem" Multiplicity="0..1">
<OnDelete Action="Cascade" />
@@ -2117,6 +2158,7 @@
<EntitySet Name="AncestralTabletRegistrant" EntityType="Self.AncestralTabletRegistrant" Schema="dbo" store:Type="Tables" />
<EntitySet Name="AncestralTabletStatus" EntityType="Self.AncestralTabletStatus" Schema="dbo" store:Type="Tables" />
<EntitySet Name="appellation" EntityType="Self.appellation" Schema="dbo" store:Type="Tables" />
<EntitySet Name="auto_enroll" EntityType="Self.auto_enroll" Schema="dbo" store:Type="Tables" />
<EntitySet Name="bed_kind" EntityType="Self.bed_kind" Schema="dbo" store:Type="Tables" />
<EntitySet Name="bed_kind_detail" EntityType="Self.bed_kind_detail" Schema="dbo" store:Type="Tables" />
<EntitySet Name="bed_order" EntityType="Self.bed_order" Schema="dbo" store:Type="Tables" />
@@ -2248,6 +2290,10 @@
<End Role="AncestralTabletArea" EntitySet="AncestralTabletArea" />
<End Role="AncestralTabletArea1" EntitySet="AncestralTabletArea" />
</AssociationSet>
<AssociationSet Name="FK_auto_enroll_followers" Association="Self.FK_auto_enroll_followers">
<End Role="followers" EntitySet="followers" />
<End Role="auto_enroll" EntitySet="auto_enroll" />
</AssociationSet>
<AssociationSet Name="FK_bed_kind_detail_bed_kind" Association="Self.FK_bed_kind_detail_bed_kind">
<End Role="bed_kind" EntitySet="bed_kind" />
<End Role="bed_kind_detail" EntitySet="bed_kind_detail" />
@@ -2372,6 +2418,10 @@
<End Role="activity" EntitySet="activity" />
<End Role="pro_order" EntitySet="pro_order" />
</AssociationSet>
<AssociationSet Name="FK_pro_order_auto_enroll" Association="Self.FK_pro_order_auto_enroll">
<End Role="auto_enroll" EntitySet="auto_enroll" />
<End Role="pro_order" EntitySet="pro_order" />
</AssociationSet>
<AssociationSet Name="FK_pro_order_detail_actItem" Association="Self.FK_pro_order_detail_actItem">
<End Role="actItem" EntitySet="actItem" />
<End Role="pro_order_detail" EntitySet="pro_order_detail" />
@@ -2736,6 +2786,10 @@
<Property Name="reg_time" Type="DateTime" Precision="3" />
<NavigationProperty Name="actItem" Relationship="Self.FK_activity_relating_actItem" FromRole="activity_relating" ToRole="actItem" />
<NavigationProperty Name="activity" Relationship="Self.FK_activity_relating_activity" FromRole="activity_relating" ToRole="activity" />
<Property Name="has_yang_limit" Type="Boolean" />
<Property Name="has_chao_limit" Type="Boolean" />
<Property Name="yang_limit_count" Type="Int32" />
<Property Name="chao_limit_count" Type="Int32" />
</EntityType>
<EntityType Name="activity_spares">
<Key>
@@ -2899,6 +2953,7 @@
<Property Name="smtp_def" Type="String" MaxLength="1" FixedLength="false" Unicode="true" />
<Property Name="use_sender" Type="String" MaxLength="1" FixedLength="false" Unicode="true" />
<Property Name="bed_order_no" Type="String" MaxLength="20" FixedLength="false" Unicode="true" />
<Property Name="last_auto_order_no" Type="String" MaxLength="20" FixedLength="false" Unicode="true" />
</EntityType>
<EntityType Name="country">
<Key>
@@ -2977,6 +3032,7 @@
<NavigationProperty Name="GuaDanOrder" Relationship="Model.FK_GuaDanOrder_Followers" FromRole="follower" ToRole="GuaDanOrder" />
<Property Name="search_keywords" Type="String" MaxLength="Max" FixedLength="false" Unicode="false" />
<NavigationProperty Name="GuaDanOrderGuest" Relationship="Model.FK_GuaDanOrderGuest_FOLLOWERS" FromRole="follower" ToRole="GuaDanOrderGuest" />
<NavigationProperty Name="auto_enroll" Relationship="Model.FK_auto_enroll_followers" FromRole="follower" ToRole="auto_enroll" />
</EntityType>
<EntityType Name="followers_tablet">
<Key>
@@ -3155,6 +3211,8 @@
<NavigationProperty Name="pro_order_detail" Relationship="Self.FK_pro_order_detail_pro_order" FromRole="pro_order" ToRole="pro_order_detail" />
<Property Name="send_receipt" Type="Boolean" />
<Property Name="receipt_title" Type="String" MaxLength="Max" FixedLength="false" Unicode="true" />
<Property Name="au_num" Type="Int32" />
<NavigationProperty Name="auto_enroll" Relationship="Model.FK_pro_order_auto_enroll" FromRole="pro_order" ToRole="auto_enroll" />
</EntityType>
<EntityType Name="pro_order_detail">
<Key>
@@ -4553,6 +4611,15 @@
<End Role="GuaDanOrderGuest" EntitySet="GuaDanOrderGuest" />
<End Role="RegionAndRoomAndBedSchedule" EntitySet="RegionAndRoomAndBedSchedule" />
</AssociationSet>
<EntitySet Name="auto_enroll" EntityType="Model.auto_enroll" />
<AssociationSet Name="FK_auto_enroll_followers" Association="Model.FK_auto_enroll_followers">
<End Role="follower" EntitySet="followers" />
<End Role="auto_enroll" EntitySet="auto_enroll" />
</AssociationSet>
<AssociationSet Name="FK_pro_order_auto_enroll" Association="Model.FK_pro_order_auto_enroll">
<End Role="auto_enroll" EntitySet="auto_enroll" />
<End Role="pro_order" EntitySet="pro_order" />
</AssociationSet>
</EntityContainer>
<ComplexType Name="sp_helpdiagramdefinition_Result">
<Property Type="Int32" Name="version" Nullable="true" />
@@ -5270,6 +5337,45 @@
</Dependent>
</ReferentialConstraint>
</Association>
<EntityType Name="auto_enroll">
<Key>
<PropertyRef Name="num" />
</Key>
<Property Name="num" Type="Int32" Nullable="false" annotation:StoreGeneratedPattern="Identity" />
<Property Name="f_num" Type="Int32" Nullable="false" />
<Property Name="start_date" Type="DateTime" Precision="0" Nullable="false" />
<Property Name="end_date" Type="DateTime" Precision="0" Nullable="false" />
<Property Name="receipt_title" Type="String" MaxLength="Max" FixedLength="false" Unicode="true" />
<Property Name="receipt_address" Type="String" MaxLength="200" FixedLength="true" Unicode="true" />
<NavigationProperty Name="followers" Relationship="Model.FK_auto_enroll_followers" FromRole="auto_enroll" ToRole="follower" />
<NavigationProperty Name="pro_order" Relationship="Model.FK_pro_order_auto_enroll" FromRole="auto_enroll" ToRole="pro_order" />
</EntityType>
<Association Name="FK_auto_enroll_followers">
<End Type="Model.follower" Role="follower" Multiplicity="1">
<OnDelete Action="Cascade" />
</End>
<End Type="Model.auto_enroll" Role="auto_enroll" Multiplicity="*" />
<ReferentialConstraint>
<Principal Role="follower">
<PropertyRef Name="num" />
</Principal>
<Dependent Role="auto_enroll">
<PropertyRef Name="f_num" />
</Dependent>
</ReferentialConstraint>
</Association>
<Association Name="FK_pro_order_auto_enroll">
<End Type="Model.auto_enroll" Role="auto_enroll" Multiplicity="0..1" />
<End Type="Model.pro_order" Role="pro_order" Multiplicity="*" />
<ReferentialConstraint>
<Principal Role="auto_enroll">
<PropertyRef Name="num" />
</Principal>
<Dependent Role="pro_order">
<PropertyRef Name="au_num" />
</Dependent>
</ReferentialConstraint>
</Association>
</Schema>
</edmx:ConceptualModels>
<!-- C-S mapping content -->
@@ -5456,6 +5562,10 @@
<EntitySetMapping Name="activity_relating">
<EntityTypeMapping TypeName="Model.activity_relating">
<MappingFragment StoreEntitySet="activity_relating">
<ScalarProperty Name="chao_limit_count" ColumnName="chao_limit_count" />
<ScalarProperty Name="yang_limit_count" ColumnName="yang_limit_count" />
<ScalarProperty Name="has_chao_limit" ColumnName="has_chao_limit" />
<ScalarProperty Name="has_yang_limit" ColumnName="has_yang_limit" />
<ScalarProperty Name="num" ColumnName="num" />
<ScalarProperty Name="activity_num" ColumnName="activity_num" />
<ScalarProperty Name="actItem_num" ColumnName="actItem_num" />
@@ -5595,6 +5705,7 @@
<EntitySetMapping Name="companies">
<EntityTypeMapping TypeName="Model.company">
<MappingFragment StoreEntitySet="company">
<ScalarProperty Name="last_auto_order_no" ColumnName="last_auto_order_no" />
<ScalarProperty Name="num" ColumnName="num" />
<ScalarProperty Name="com_name" ColumnName="com_name" />
<ScalarProperty Name="com_mail" ColumnName="com_mail" />
@@ -5829,6 +5940,7 @@
<EntitySetMapping Name="pro_order">
<EntityTypeMapping TypeName="Model.pro_order">
<MappingFragment StoreEntitySet="pro_order">
<ScalarProperty Name="au_num" ColumnName="au_num" />
<ScalarProperty Name="receipt_title" ColumnName="receipt_title" />
<ScalarProperty Name="send_receipt" ColumnName="send_receipt" />
<ScalarProperty Name="order_no" ColumnName="order_no" />
@@ -6323,6 +6435,18 @@
</MappingFragment>
</EntityTypeMapping>
</EntitySetMapping>
<EntitySetMapping Name="auto_enroll">
<EntityTypeMapping TypeName="Model.auto_enroll">
<MappingFragment StoreEntitySet="auto_enroll">
<ScalarProperty Name="receipt_address" ColumnName="receipt_address" />
<ScalarProperty Name="receipt_title" ColumnName="receipt_title" />
<ScalarProperty Name="end_date" ColumnName="end_date" />
<ScalarProperty Name="start_date" ColumnName="start_date" />
<ScalarProperty Name="f_num" ColumnName="f_num" />
<ScalarProperty Name="num" ColumnName="num" />
</MappingFragment>
</EntityTypeMapping>
</EntitySetMapping>
</EntityContainerMapping>
</Mapping>
</edmx:Mappings>
+3
View File
@@ -162,6 +162,9 @@
<AssociationConnector Association="Model.FK_GuaDanOrderGuest_RoomUuid" />
<AssociationConnector Association="Model.FK_GuaDanOrderGuest_StatusCode" />
<AssociationConnector Association="Model.FK_Schedule_GuaDanOrderGuest" />
<EntityTypeShape EntityType="Model.auto_enroll" Width="1.5" PointX="5.25" PointY="37.875" />
<AssociationConnector Association="Model.FK_auto_enroll_followers" />
<AssociationConnector Association="Model.FK_pro_order_auto_enroll" />
</Diagram>
</edmx:Diagrams>
</edmx:Designer>
+362 -7
View File
@@ -1,15 +1,20 @@
using System;
using DocumentFormat.OpenXml.Drawing.Charts;
using DocumentFormat.OpenXml.Office2010.Excel;
using Model;
using MyWeb;
using Newtonsoft.Json;
using OfficeOpenXml.FormulaParsing.Excel.Functions.DateTime;
using PagedList;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Data.Entity;
using System.Diagnostics;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Web.Http;
using PagedList;
using Newtonsoft.Json;
using System.Collections;
using DocumentFormat.OpenXml.Office2010.Excel;
using MyWeb;
using System.Data.Entity;
using System.Web.Razor.Tokenizer;
// api/Follower
//[ezAuthorize(Roles = "admin")]//群組:*
@@ -723,6 +728,204 @@ public class FollowerController : ApiController
}
[HttpGet]
[Route("api/follower/GetAutoEnrollList/{id}")]
public IHttpActionResult GetAutoEnrollList(int id)
{
var prod = _db.auto_enroll.Where(q => q.f_num == id).ToList();
var ret = new
{
list = prod.Select(x => new
{
num = x.num,
auto_enroll_start_date = x.start_date.ToString("yyyy-MM-dd"),
auto_enroll_end_date = x.end_date.ToString("yyyy-MM-dd"),
auto_enroll_receipt_title = x.receipt_title?? "",
auto_enroll_receipt_address = x.receipt_address?? "",
}),
};
return Ok(ret);
}
[HttpPost]
[Route("api/follower/SaveAutoEnrollList")]
public IHttpActionResult SaveAutoEnrollList([FromBody] Model.auto_enroll item)
{
Model.auto_enroll autoEnroll;
if (item.num == 0)
{
// ===== 新增 =====
autoEnroll = new Model.auto_enroll()
{
num=0,
f_num = item.f_num,
start_date = item.start_date,
end_date = item.end_date,
receipt_title = string.IsNullOrEmpty(item.receipt_title) ? null : item.receipt_title.Trim(),
receipt_address = string.IsNullOrEmpty(item.receipt_address) ? null : item.receipt_address.Trim(),
}
;
_db.auto_enroll.Add(autoEnroll);
_db.SaveChanges();
CreateOrdersForActivities(item.f_num, autoEnroll.num, item.start_date, item.end_date, item.receipt_title, item.receipt_address);
}
else
{
// ===== 更新 =====
autoEnroll = _db.auto_enroll.Where(q => q.num == item.num).FirstOrDefault();
if (autoEnroll == null) return NotFound();
autoEnroll.start_date = item.start_date;
autoEnroll.end_date = item.end_date;
autoEnroll.receipt_title = item.receipt_title?.Trim() ?? null;
autoEnroll.receipt_address = item.receipt_address?.Trim() ?? null;
_db.SaveChanges();
CreateOrdersForActivities(item.f_num, autoEnroll.num, item.start_date, item.end_date, item.receipt_title, item.receipt_address);
}
try
{
var ret = new
{
num = autoEnroll.num,
start_date = autoEnroll.start_date.ToString("yyyy-MM-dd"),
end_date = autoEnroll.end_date.ToString("yyyy-MM-dd"),
receipt_title = autoEnroll.receipt_title,
receipt_address = autoEnroll.receipt_address,
};
return Ok(ret);
}
catch(Exception ex)
{
return InternalServerError(ex);
}
}
[HttpPost]
[Route("api/follower/GetAffectedOrders")]
public IHttpActionResult GetAffectedOrders([FromBody] Model.auto_enroll item, bool is_delete = false)
{
if (item == null) return BadRequest();
try
{
IQueryable<pro_order> query = _db.pro_order
.Where(o => o.f_num == item.f_num
&& o.order_no.StartsWith("AU")
&& o.au_num == item.num);
if (is_delete)
{
// 刪除:查期間內所有自動報名訂單
query = query.Where(o =>
o.activity.startDate_solar >= item.start_date &&
o.activity.startDate_solar <= item.end_date
);
}
else
{
// 修改:查不在新範圍內的訂單
query = query.Where(o =>
o.activity.startDate_solar < item.start_date ||
o.activity.startDate_solar > item.end_date
);
}
var rawOrders = query.Select(o => new
{
o.order_no,
o.activity.subject,
o.activity.startDate_solar
}).ToList();
var affectedOrders = rawOrders.Select(o => new
{
order_no = o.order_no,
activityname = o.subject,
activitydate = o.startDate_solar?.ToString("yyyy/MM/dd") ?? ""
}).ToList();
return Ok(new
{
count = affectedOrders.Count,
list = affectedOrders
});
}
catch (Exception ex)
{
return InternalServerError(ex.GetBaseException());
}
}
[HttpDelete]
[Route("api/follower/DeleteAutoEnroll/{id}")]
public IHttpActionResult DeleteAutoEnroll(int id)
{
try
{
var prod = _db.auto_enroll.Where(q => q.num == id).FirstOrDefault();
if (prod != null)
{
_db.auto_enroll.Remove(prod);
_db.SaveChanges();
return Ok();
}
else return NotFound();
}
catch (Exception ex)
{
return BadRequest(ex.Message);
}
}
[HttpGet]
[Route("api/follower/GetUnfilledActivityOrders/{id}")]
public IHttpActionResult GetUnfilledActivityOrders(int id, int page, int pageSize = 10, string sortBy = "", bool sortDesc = false)
{
try
{
var config = _db.auto_enroll.FirstOrDefault(x => x.num == id);
if (config == null) return NotFound();
var query = from o in _db.pro_order
join a in _db.activities on o.activity_num equals a.num
where o.f_num == config.f_num
&& a.startDate_solar >= config.start_date
&& a.startDate_solar <= config.end_date
&& !_db.pro_order_detail.Any(d => d.order_no == o.order_no)
select new { o, a };
int totalCount = query.Count();
var pagedData = query
.OrderByDescending(x => x.o.order_no)
.Skip((page - 1) * pageSize)
.Take(pageSize)
.ToList()
.Select(x => new {
order_no = x.o.order_no,
startdate = x.a.startDate_solar?.ToString("yyyy/MM/dd") ?? "",
enddate = x.a.endDate_solar?.ToString("yyyy/MM/dd") ?? "",
activityname = x.a.subject,
category = x.a.activity_category_kind?.kind ?? ""
});
return Ok(new
{
list = pagedData,
count = totalCount,
page = page,
pageSize = pageSize
});
}
catch (Exception ex)
{
return BadRequest(ex.Message);
}
}
[HttpPost]
[Route("api/follower/GetTabletList")]
@@ -864,6 +1067,31 @@ public class FollowerController : ApiController
return Ok(data);
}
[HttpPost]
[Route("api/follower/pending_orders")]
public IHttpActionResult GetPendingOrders(int id, string targetDate)
{
DateTime today = DateTime.Today;
if (!DateTime.TryParse(targetDate, out DateTime limitDate))
{
limitDate = new DateTime(2099, 12, 31);
}
var orderrecord = _db.pro_order
.Where(x => x.f_num == id && x.activity.startDate_solar >= today && x.activity.startDate_solar < limitDate)
.Include(x => x.activity)
.ToList();
var data = new
{
list = orderrecord.Select(x => new
{
orderno = x.order_no,
activitydate = x.activity.startDate_solar.Value.ToString("yyyy/MM/dd"),
activityname = x.activity.subject,
})
};
return Ok(data);
}
[HttpPost]
[Route("api/follower/totalorderamount")]
public IHttpActionResult GetTotalOrderCount(int id)
{
@@ -899,5 +1127,132 @@ public class FollowerController : ApiController
};
return Ok(data);
}
private void CreateOrdersForActivities(int f_num, int au_num, DateTime start_date, DateTime end_date, string receipt_title, string receipt_address)
{
var follower = _db.followers.Where(x => x.num == f_num).FirstOrDefault();
var activities = _db.activities
.Where(x =>
x.startDate_solar >= start_date &&
x.startDate_solar <= end_date
)
.ToList();
foreach (var activity in activities)
{
var existOrder = _db.pro_order
.Where(o => o.activity_num == activity.num && o.f_num == f_num)
.FirstOrDefault();
if (existOrder != null) {
existOrder.au_num = au_num;
_db.SaveChanges();
continue;
}
string newOrderNo = AutoOrderService.CreateAutoOrderNumber(_db);
string finalPhone = follower?.cellphone ?? follower?.phone ?? "";
var newOrder = new pro_order
{
order_no = newOrderNo,
up_time = DateTime.Now,
reg_time = DateTime.Now,
keyin1 = "A01",
f_num = f_num,
au_num = au_num,
phone = finalPhone,
address = string.IsNullOrEmpty(receipt_address) ? "" : receipt_address,
activity_num = activity.num,
receipt_title = receipt_title ?? "",
demo = "",
customize_data = "",
};
_db.pro_order.Add(newOrder);
// 抓取同活動分類的上一筆訂單,複製品項
var latestOrder = _db.pro_order
.Where(o =>
o.f_num == f_num &&
o.activity.kind == activity.kind &&
o.order_no != newOrderNo &&
_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)
{
var newDetail = new 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,
bed_type = detail.bed_type,
qty = detail.qty,
price = detail.price,
start_date = DateTime.Today,
pay = detail.pay,
keyin1 = detail.keyin1,
demo = detail.demo,
customize_data = detail.customize_data,
printed_files = detail.printed_files,
UpdateTime = DateTime.Now,
};
_db.pro_order_detail.Add(newDetail);
}
}
}
_db.SaveChanges();
}
}
public static class AutoOrderService
{
private static readonly object _lock = new object();
public static string CreateAutoOrderNumber(Model.ezEntities _db)
{
lock (_lock)
{
string prefix = "AU" + DateTime.Now.ToString("yyMMdd");
var company = _db.companies.FirstOrDefault(q => q.num == 1);
if (company == null) return "";
string order_no;
if (!string.IsNullOrEmpty(company.last_auto_order_no) && company.last_auto_order_no.StartsWith(prefix))
{
string serialStr = company.last_auto_order_no.Replace(prefix, "");
int nextSerial = int.Parse(serialStr) + 1;
order_no = prefix + nextSerial.ToString("0000");
}
else
{
order_no = prefix + "0001";
}
company.last_auto_order_no = order_no;
_db.SaveChanges();
return order_no;
}
}
}
+148 -1
View File
@@ -7,6 +7,7 @@ using System;
using System.Collections;
using System.Collections.Generic;
using System.Data.Entity;
using System.Diagnostics;
using System.Linq;
using System.Net;
using System.Net.Http;
@@ -362,6 +363,8 @@ public class activityController : ApiController
}).ToList(), x.kind) : "",
startDate_solar = x.startDate_solar,
endDate_solar = x.endDate_solar,
startDate = x.startDate_solar?.ToString("yyyy-MM-dd"),
endDate = x.endDate_solar?.ToString("yyyy-MM-dd"),
startDate_lunar = x.startDate_lunar,
endDate_lunar = x.endDate_lunar,
dueDate = x.dueDate,
@@ -947,7 +950,7 @@ public class activityController : ApiController
//已有值
var count = qry.Count(); //pageSize = count;//一次取回??
var qryList = (pageSize > 0) ? qry.OrderBy(a=>a.num).ToPagedList(page, pageSize).ToList() : qry.ToList();
var qryList = (pageSize > 0) ? qry.OrderBy(a => a.num).ToPagedList(page, pageSize).ToList() : qry.ToList();
var ret = new
{
list = qryList.Select(x => new
@@ -1104,6 +1107,10 @@ public class activityController : ApiController
},
price = x.price ?? 0,
qty = x.qty ?? 0,
has_yang_limit = x.has_yang_limit ?? false,
has_chao_limit = x.has_yang_limit ?? false,
yang_limit_count = x.yang_limit_count ?? 0,
chao_limit_count = x.chao_limit_count ?? 0,
files = x.actItem?.actItem_files.Select(f => new
{
num = f.file.num,
@@ -1322,6 +1329,10 @@ public class activityController : ApiController
if (item.qty.HasValue) { _data.qty = item.qty.Value; }
else { _data.qty = null; }
_data.reg_time = DateTime.Now;
if (item.has_yang_limit.HasValue) { _data.has_yang_limit = item.has_yang_limit; }
if (item.yang_limit_count >= 0) { _data.yang_limit_count = item.yang_limit_count.Value; }
if (item.has_chao_limit.HasValue) { _data.has_chao_limit = item.has_chao_limit; }
if (item.chao_limit_count >= 0) { _data.chao_limit_count = item.chao_limit_count.Value; }
_db.SaveChanges();
var ret = _data.num;
@@ -1342,6 +1353,10 @@ public class activityController : ApiController
if (item.qty.HasValue) { _data.qty = item.qty.Value; }
else { _data.qty = null; }
_data.reg_time = DateTime.Now;
if (item.has_yang_limit.HasValue) { _data.has_yang_limit = item.has_yang_limit; }
if (item.yang_limit_count >= 0) { _data.yang_limit_count = item.yang_limit_count.Value; }
if (item.has_chao_limit.HasValue) { _data.has_chao_limit = item.has_chao_limit; }
if (item.chao_limit_count >= 0) { _data.chao_limit_count = item.chao_limit_count.Value; }
_db.activity_relating.Add(_data);
_db.SaveChanges();
@@ -1754,4 +1769,136 @@ public class activityController : ApiController
return Ok(ret);
}
[HttpGet]
[Route("api/activity/GetUnfilledOrdersByActivity/{num}")]
public IHttpActionResult GetUnfilledOrdersByActivity(int num)
{
try
{
var activityExists = _db.activities.Any(a => a.num == num);
if (!activityExists) return NotFound();
var query = from o in _db.pro_order
join f in _db.followers on o.f_num equals f.num into fg
from f in fg.DefaultIfEmpty()
where o.activity_num == num
&& !_db.pro_order_detail.Any(d => d.order_no == o.order_no)
select new { o, f };
MyWeb.encrypt encrypt = new MyWeb.encrypt();
var unfilledOrders = query.ToList().Select(x => new
{
order_no = x.o.order_no,
f_number = x.f.f_number,
u_name = x.f != null ? x.f.u_name : "未知",
phone = !string.IsNullOrEmpty(x.f.cellphone) ? encrypt.DecryptAutoKey(x.f.cellphone) : (encrypt.DecryptAutoKey(x.f.phone) ?? ""),
order_date = x.o.reg_time.HasValue ? x.o.reg_time.Value.ToString("yyyy/MM/dd") : "",
}).ToList();
return Ok(new
{
list = unfilledOrders,
count = unfilledOrders.Count
});
}
catch (Exception ex)
{
return InternalServerError(ex.GetBaseException());
}
}
[HttpPost]
[Route("api/activity/TriggerAutoEnroll/{activity_num}")]
public IHttpActionResult TriggerAutoEnroll(int activity_num)
{
try
{
var activity = _db.activities.FirstOrDefault(a => a.num == activity_num);
if (activity == null) return NotFound();
if (!activity.startDate_solar.HasValue) return BadRequest("該活動沒有設定開始日期,無法執行自動報名。");
DateTime actDate = activity.startDate_solar.Value;
var validConfigs = _db.auto_enroll
.Where(ae => actDate >= ae.start_date && actDate <= ae.end_date)
.ToList();
int successCount = 0;
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);
string newOrderNo = AutoOrderService.CreateAutoOrderNumber(_db);
var newOrder = new pro_order
{
order_no = newOrderNo,
up_time = DateTime.Now,
reg_time = DateTime.Now,
keyin1 = "A01",
f_num = config.f_num,
au_num = config.num,
phone = follower?.cellphone ?? follower?.phone ?? "",
address = config.receipt_address ?? "",
activity_num = activity_num,
receipt_title = config.receipt_title ?? "",
demo = "系統於新增活動時自動報名",
};
_db.pro_order.Add(newOrder);
CopyLatestOrderDetails(newOrderNo, config.f_num, (int)activity.kind);
successCount++;
}
_db.SaveChanges();
return Ok(new
{
message = $"自動報名執行完畢,共為 {successCount} 位信眾完成報名。",
count = successCount
});
}
catch (Exception ex)
{
return InternalServerError(ex.GetBaseException());
}
}
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)
{
_db.pro_order_detail.Add(new 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
});
}
}
}
}
+28
View File
@@ -299,4 +299,32 @@ public class designerController : ApiController
}
}
[HttpPost]
[Route("api/tablet/DelPaperSize")]
public IHttpActionResult DelPaperSize([FromBody] dynamic data)
{
LogUtility log = new LogUtility();
var json = data;
log.writeLogPath((string)json.paperSize);
string paperSize = (json == null || json.paperSize == null) ? "" : (string)json.paperSize;
//先檢查有沒有用過
object[] obj = new StyleDataAccess().DelTabletPaper(paperSize);
return Ok(new { result = obj[0].ToString(), message = obj[1].ToString() });
}
[HttpPost]
[Route("api/tablet/DelTabletStyle")]
public IHttpActionResult DelTabletStyle([FromBody] dynamic data)
{
LogUtility log = new LogUtility();
var json = data;
log.writeLogPath((string)json.styleID);
string StyleID = (json == null || json.styleID == null) ? "" : (string)json.styleID;
//先檢查有沒有用過
object[] obj = new StyleDataAccess().DelTabletStyle(StyleID);
return Ok(new { result = obj[0].ToString(), message = obj[1].ToString() });
}
}
+11 -2
View File
@@ -10,6 +10,7 @@ using System.Activities.Expressions;
using System.Collections;
using System.Collections.Generic;
using System.Data.Entity;
using System.Data.Entity.Core.Objects;
using System.Diagnostics;
using System.IdentityModel.Metadata;
using System.Linq;
@@ -564,6 +565,7 @@ public class orderController : ApiController
subject = x.activity_num.HasValue ? x.activity.subject : "",
keyin1 = x.keyin1,
up_time = x.up_time,
uptime=x.up_time?.ToString("yyyy-MM-dd"),
keyin1_txt = Model.pro_order.keyin1_value_to_text(x.keyin1),
status = x.activity.activity_check.FirstOrDefault(a => x.activity_num == a.activity_num && x.f_num == a.f_num)?.status ?? 0,
}),
@@ -597,7 +599,9 @@ public class orderController : ApiController
//var qry1 = _db.pro_order_detail.AsEnumerable();
//qry1 = qry1.Where(o => o.order_no == order_no);
//var qry1 = prod.pro_order_detail.AsEnumerable();
var qry1 = prod.pro_order_detail.AsQueryable().include(o=>o.pro_order.activity.activity_relating);
var qry1 = prod.pro_order_detail.AsQueryable().Include(o=>o.pro_order.activity.activity_relating);
//if (!string.IsNullOrEmpty(q.subject))
// qry = qry.Where(o => o.subject.Contains(q.subject));
@@ -636,9 +640,12 @@ public class orderController : ApiController
(List<pro_order_detail>)qry1_list.ToPagedList(page, pageSize);
var count = qry1_list.Count();
var ret = new
{
list = qry1_list.Select(x => {
var tmpActivityRelating = x.pro_order?.activity?.activity_relating?.Where(a => a.actItem_num == x.actItem_num).FirstOrDefault();
return new
{
@@ -718,7 +725,9 @@ public class orderController : ApiController
// //pay_kind = tdesc2[c.payment.HasValue && x.keyin1.Value > 0 ? x.keyin1.Value : 1],
//}),
})
};
})
.ToList()
.OrderByDescending(x => (x.isPackage + (x.parent_num == null ? 0 : 1)))
//.ThenBy(x => (x.parent_num == null ? 1 : 2)) // Top-level items first
+2 -2
View File
@@ -114,7 +114,7 @@
.catch(error => console.log(error))
},
editItem(item) {
console.log("edit", item);
},
deleteItem(item) {
if (confirm('是否確定刪除此筆資料?')) {
@@ -123,7 +123,7 @@
axios
.delete(HTTP_HOST + 'api/accounting/' + item.num)
.then(response => {
console.log("del", item);
this.data_table.list.splice(index, 1);
this.data_table.count = this.data_table.list.length
})
+6 -7
View File
@@ -29,7 +29,7 @@
],
selected: {},
select(t) {
console.log("select search1", t);
}
}, search2: {
id: 'search2',
@@ -45,7 +45,7 @@
],
selected: {},
select(t) {
console.log("select search2", t);
}
},
search3: {
@@ -64,7 +64,7 @@
],
selected: {},
select(t) {
console.log("select search3", t);
}
},
@@ -86,7 +86,6 @@
],
selected: {},
select(t) {
console.log("select search4", t);
}
},
@@ -151,7 +150,7 @@
options: {
handler() {
this.search_get()
console.log("watch2", this.search_dialog, this.search_dialog.page);
},
deep: true,
},
@@ -188,7 +187,7 @@
search[t.id] = t.value;
});
console.log("search_get", api_url, search, params, this.options);
this.search_dialog.loading = true
axios.post(api_url, search, { params: params })
.then(response => {
@@ -375,7 +374,7 @@
axios
.delete(HTTP_HOST + 'api/accounting/DeleteFilesItem/' + item.num)
.then(response => {
console.log("del", item);
this.desserts.splice(index, 1)
this.desserts_count = this.desserts_count - 1;
})
+2 -2
View File
@@ -99,7 +99,7 @@
.catch(error => console.log(error))
},
editItem(item) {
console.log("edit", item);
},
copyItem(item) {
@@ -132,7 +132,7 @@
axios
.delete(HTTP_HOST + 'api/activity/' + item.num)
.then(response => {
console.log("del", item);
this.data_table.list.splice(index, 1);
this.data_table.count = this.data_table.list.length
})
+3 -3
View File
@@ -107,7 +107,7 @@
select(t, data) {
data.search.kind = t.num;
data.btn_search()
console.log("select search1", t);
}
}
},
@@ -215,7 +215,7 @@
},
editItem(item) {
console.log("edit", item);
},
deleteItem(item) {
@@ -306,7 +306,7 @@
search[t.id] = t.value;
});
console.log("search_get", api_url, search, params, this.options);
this.search_dialog.loading = true
axios.post(api_url, search, { params: params })
.then(response => {
+4 -4
View File
@@ -46,7 +46,7 @@
],
selected: {},
select(item, t) {
console.log("select search1", t);
}
},
search2: {
@@ -63,7 +63,7 @@
],
selected: {},
select(item, t) {
console.log("select search2", t);
item.files_num_selected.text = t.subject //=====?
item.files_num_selected.val = t.num //=====?
@@ -85,7 +85,7 @@
],
selected: {},
select(item, t) {
console.log("select search3", item, t);
//debugger;
item.actItem.subject = t.subject
item.actItem.num = t.num
@@ -371,7 +371,7 @@
axios
.delete(HTTP_HOST + 'api/activity/DeleteFilesItem/' + item.num)
.then(response => {
console.log("del", item);
this.desserts.splice(index, 1)
this.desserts_count = this.desserts_count - 1;
})
+1 -1
View File
@@ -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))
{
+5 -7
View File
@@ -10,7 +10,7 @@
el: '#app',
vuetify: new Vuetify(vuetify_options),
data() {
console.log("yes",<%= _this_id %>);
return {
this_id: '<%= _this_id %>',
options: {},
@@ -33,8 +33,6 @@
],
selected: {},
select(item,t) {
console.log("select search1", t);
item.actItem_num.text = t.subject
item.actItem_num.val = t.num
@@ -114,7 +112,7 @@
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,
},
@@ -154,7 +152,7 @@
if (this.search_dialog.current.id == 'search1') {
search['categorys'] = "1,2,4";//報名,掛單,贊助
}
console.log("search_get", api_url, search, params, this.options);
this.search_dialog.loading = true
axios.post(api_url, search, { params: params })
.then(response => {
@@ -233,7 +231,7 @@
axios
.delete(HTTP_HOST + 'api/activity/DeleteActKindDetail/' + item.num)
.then(response => {
console.log("del", item);
this.desserts.splice(index, 1)
this.desserts_count = this.desserts_count - 1;
})
@@ -321,7 +319,7 @@
}
}, customSearch(value, item) {
console.log(value, item)
},
searchData(event) {
this.desserts = this.desserts.filter(item => item.actItem_num.text.toLowerCase().includes(event));
+106 -183
View File
@@ -24,11 +24,11 @@
if (data.isOk) {
$(btn).parents('.row.label-sm-right').find('.lunar').text(data.cDate);
} else {
console.log(data.msg);
}
});
}
console.log(_date);
}
let VueApp = new Vue({
@@ -57,13 +57,13 @@
{ id: 'kind', title: '分類名稱' },
],
selected: {},
select(item,t) {
console.log("select search1", t);
select(item, t) {
//帶入預設日期
axios
.get(HTTP_HOST + 'api/activity/GetKindDate/' + t.num )
.get(HTTP_HOST + 'api/activity/GetKindDate/' + t.num)
.then(response => {
console.log(response.data.startDate_solar);
$('#<%= startDate_solar.ClientID%>').val(response.data.startDate_solar);
$('#<%= endDate_solar.ClientID%>').val(response.data.endDate_solar);
$('#<%= startDate_lunar.ClientID%>').val(response.data.startDate_lunar);
@@ -90,9 +90,7 @@
{ id: 'kindTxt', title: '項目分類' },
],
selected: {},
select(item,t) {
console.log("select search2", t);
select(item, t) {
item.act_item_selected.text = t.subject
item.act_item_selected.val = t.num
item.price = t.price
@@ -114,8 +112,7 @@
{ id: 'kindTxt', title: '項目分類' },
],
selected: {},
select(item,t) {
console.log("select search3", t);
select(item, t) {
item.act_item_selected.text = t.subject
item.act_item_selected.val = t.num
@@ -136,7 +133,6 @@
],
selected: {},
select(item, t) {
console.log("select search4", t);
}
},
@@ -165,7 +161,7 @@
{ 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_yang', sortable: false },
{ text: '超渡人數限制', value: 'limit_chao', sortable: false },
{ text: '', value: 'actions', sortable: false, width: "200px" },
],
@@ -180,7 +176,7 @@
'items-per-page-options': []
},
desserts: [],
desserts_count :0,
desserts_count: 0,
editedIndex: -1,
editedItem: {
id: 0,
@@ -198,97 +194,100 @@
yang_limit_count: 0,
chao_limit_count: 0,
},
defaultItem: {
id: 0,
num: 0,
activity_num: 0,
act_item_selected: {
text: '',
val: 0
defaultItem: {
id: 0,
num: 0,
activity_num: 0,
act_item_selected: {
text: '',
val: 0
},
price: 0,
qty: 0,
files: [],
has_yang_limit: false,
has_chao_limit: false,
yang_limit_count: 0,
chao_limit_count: 0,
},
price: 0,
qty: 0,
files: [],
has_yang_limit: false,
has_chao_limit: false,
yang_limit_count: 0,
chao_limit_count: 0,
},
//列印
data_table: {
selected: [],
editFilesItem: [],
headersFilesList: [
{ text: '訂單編號', value: 'order_no', sortable: false },
{ text: '牌位編號', value: 'print_id', sortable: false },
//{ text: '信眾姓名', value: 'from_id', sortable: false },
{ text: '已列印', value: 'isprinted', sortable: false },
//列印
data_table: {
selected: [],
editFilesItem: [],
headersFilesList: [
{ text: '訂單編號', value: 'order_no', sortable: false },
{ text: '牌位編號', value: 'print_id', sortable: false },
//{ text: '信眾姓名', value: 'from_id', sortable: false },
{ text: '已列印', value: 'isprinted', sortable: false },
],
singleSelect: false,
searchList: '',
},
thisFilesSelected: {
text: '',
val: 0,
},
thisItemSelected: {
text: '',
val: 0,
},
printfiles: [],
//備品項目
searchSpares: '',
headersSpares: [//項目名稱
{ text: '* 品項名稱', value: 'act', sortable: false },
{ text: '總數量', value: 'totalqty', sortable: false },
{ text: '備註', value: 'demo', sortable: false },
{ text: '', value: 'actions', sortable: false, width: "200px" },
],
singleSelect: false,
searchList: '',
},
thisFilesSelected: {
text: '',
val: 0,
},
thisItemSelected: {
text: '',
val: 0,
},
printfiles:[],
//備品項目
searchSpares: '',
headersSpares: [//項目名稱
{ text: '* 品項名稱', value: 'act', sortable: false },
{ text: '總數量', value: 'totalqty', sortable: false },
{ text: '備註', value: 'demo', sortable: false },
{ text: '', value: 'actions', sortable: false, width: "200px" },
],
sparesItems: [],
sparesItems_count:0,
modifyIndex: -1,
modifyItem: {
id: 0,
num: 0,
activity_num: 0,
act_item_selected: {
text: '',
val: 0
sparesItems: [],
sparesItems_count: 0,
modifyIndex: -1,
modifyItem: {
id: 0,
num: 0,
activity_num: 0,
act_item_selected: {
text: '',
val: 0
},
totalqty: 0,
demo: '',
},
totalqty: 0,
demo: '',
},
simpleItem: {
id: 0,
num: 0,
activity_num: 0,
act_item_selected: {
text: '',
val: 0
simpleItem: {
id: 0,
num: 0,
activity_num: 0,
act_item_selected: {
text: '',
val: 0
},
totalqty: 0,
demo: '',
},
totalqty: 0,
demo: '',
},
//列印文件
file_dialog: {
show: false,
},
//報名名單
order_dialog: {
show: false,
},
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"}
],
//列印文件
file_dialog: {
show: false,
},
//報名名單
order_dialog: {
show: false,
},
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() {
@@ -301,7 +300,7 @@
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,
},
@@ -347,7 +346,7 @@
if (this.search_dialog.current.id == 'search3') {
search['category'] = "3";//備品
}
console.log("search_get", api_url, search, params, this.options);
this.search_dialog.loading = true
axios.post(api_url, search, { params: params })
.then(response => {
@@ -439,7 +438,7 @@
axios
.delete(HTTP_HOST + 'api/activity/DeleteRelatingData/' + item.num)
.then(response => {
console.log("del", item);
this.desserts.splice(index, 1)
this.desserts_count = this.desserts_count - 1;
})
@@ -457,7 +456,6 @@
this.close();
},
spliceNullData() {
//if new data ,then splice it
if (this.editedItem.num == 0) {
for (var i = 0; i < this.desserts.map(x => x.id).length; i++) {
@@ -740,7 +738,7 @@
};
// Add form fields
console.log(this.thisItemSelected.val, this.thisFilesSelected.val,JSON.stringify(list));
addHiddenField("item", this.thisItemSelected.val);
addHiddenField("file", this.thisFilesSelected.val);
addHiddenField("list", JSON.stringify(list));
@@ -913,7 +911,7 @@
const _date = $('#<%= startDate_solar.ClientID%>').val();
return _subject + " " + _date;
},
loadUnfilledList() {
loadUnfilledList() {
if (!this.this_id) return;
this.unfilled_list.loading = true;
@@ -1283,6 +1281,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">
@@ -1315,83 +1314,7 @@ loadUnfilledList() {
</div>
<div class="tab-pane fade giftItems" id="sec2-page3" role="tabpanel" aria-labelledby="sec2-tab3" v-if="this_id!=''">
<v-card class="mx-auto" outlined v-if="this_id!=''">
<v-data-table
:headers="headersSpares"
:items="sparesItems"
:footer-props="footersDetail"
:search="searchSpares"
:options.sync="optionsSpares" class="elevation-1" fixed-header height="350px"
>
<v-divider inset></v-divider>
<template v-slot:top>
<v-toolbar flat color="white">
<div class="d-flex w-100">
<v-text-field v-model="searchSpares" append-icon="mdi-magnify" label="查詢" dense outlined single-line hide-details></v-text-field>
<v-btn
color="primary"
class="ml-2 white--text"
@click="addNewSp">
<v-icon dark>mdi-plus</v-icon>新增
</v-btn>
</div>
</v-toolbar>
</template>
<template v-slot:item.act="{ item }">
<div class="input-group mb-3" data-search-control="search3" @click="search_show(search_dialog.controls.search3)" v-if="item.id === modifyItem.id">
<input class="form-control search-text" type="text" readonly
placeholder="品項名稱" v-model="modifyItem.act_item_selected.text" >
<input type="hidden" v-model="modifyItem.act_item_selected.val">
<button class="btn btn-outline-secondary" type="button">
<i class="mdi mdi-view-list-outline"></i>
</button>
</div>
<span v-else>{{item.act_item_selected.text}}
<span v-if="item.num==0" class="text-danger">(預設資料,未存檔)</span>
</span>
</template>
<%-- <template v-slot:item.qty1="{ item }">
<v-text-field v-model="modifyItem.qty1" :hide-details="true" dense single-line v-if="item.id === modifyItem.id" ></v-text-field>
<span v-else>{{item.qty1}}</span>
</template>
<template v-slot:item.qty2="{ item }">
<v-text-field v-model="modifyItem.qty2" :hide-details="true" dense single-line v-if="item.id === modifyItem.id" ></v-text-field>
<span v-else>{{item.qty2}}</span>
</template>--%>
<template v-slot:item.demo="{ item }">
<v-text-field v-model="modifyItem.demo" :hide-details="true" dense single-line v-if="item.id === modifyItem.id" ></v-text-field>
<span v-else>{{item.demo}}</span>
</template>
<template v-slot:item.actions="{ item }">
<div v-if="item.id === modifyItem.id">
<v-icon color="red" class="mr-3" @click="cancelSp">
mdi-window-close
</v-icon>
<v-icon color="green" @click="saveSp">
mdi-content-save
</v-icon>
</div>
<div v-else>
<v-icon color="green" class="mr-3" @click="editItem(item,true);">
mdi-pencil
</v-icon>
<v-icon color="red" @click="deleteItemSp(item)">
mdi-delete
</v-icon>
</div>
</template>
</v-data-table>
</v-card>
</div>
<div class="tab-pane fade" id="sec2-page4" role="tabpanel" aria-labelledby="sec2-tab4" v-if="this_id!=''">
<v-card class="mx-auto" outlined id="print-unfilled-area">
+9 -9
View File
@@ -311,14 +311,14 @@ public partial class admin_activity_reg : MyWeb.config
//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.category_kind = Val(category_kind.Value);
activity.reg_time = DateTime.Now;
_db.activities.Add(activity);
_db.SaveChanges();
int _id = activity.num;
if (_id > 0)
int t_id = activity.num;
if (t_id > 0)
{
RunAutoEnroll(_id);
RunAutoEnroll(t_id);
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);
@@ -336,8 +336,8 @@ public partial class admin_activity_reg : MyWeb.config
activity.reg_time = DateTime.Now;
_db.activities.Add(activity);
_db.SaveChanges();
int _id = activity.num;
if (_id > 0)
t_id = activity.num;
if (t_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);
@@ -421,7 +421,7 @@ public partial class admin_activity_reg : MyWeb.config
else
{
//activity.category_kind = Val(category_kind.Value);
activity.category_kind = Val(category_kind.Value);
//activity.category_kind = Val(category_kind.Value);
_db.SaveChanges();
RunAutoEnroll(activity.num);
@@ -524,8 +524,8 @@ private void RunAutoEnroll(int activityNum)
}
}
#endregion
}
+2 -3
View File
@@ -110,7 +110,7 @@
.then(res => {
this.activity_statistics.items = res.data.items;
this.activity_statistics.totalItems = res.data.count;
console.log(this.activity_statistics.options)
})
.catch(error => {
@@ -123,8 +123,7 @@
watch: {
selected_activity: {
handler(newvalue, oldvalue) {
console.log('新值:', newvalue);
console.log('舊值:', oldvalue);
},
deep: true
},
@@ -400,7 +400,7 @@
async saveRegistrantMethod() {
try {
const response = await axios.post(HTTP_HOST + 'api/ancestraltablet/registrant/create', this.form.createRegister);
console.log('保存成功', response.data);
// 可選:提示用戶、關閉對話框、刷新數據等
this.$toast?.success('登記人保存成功'); // 取決於你是否使用 toast 插件
@@ -416,7 +416,7 @@
updateRegistrantMethod() {
axios.post(HTTP_HOST + 'api/ancestraltablet/registrant/update', this.form.createRegister)
.then(response => {
console.log('登記人更新成功:', response.data);
this.$toast?.success?.('登記人更新成功'); // 可選:使用 toast 彈出提示
//this.showCreatePWFlag = false; // 關閉彈出視窗
// 可選:刷新列表等
+2 -2
View File
@@ -76,7 +76,7 @@
if (getArray != undefined && getArray != null ) {
var keys = Object.keys(getArray);
for (let i = 0; i < keys.length; i++) {
console.log(`${keys[i]}:${getArray[keys[i]]}`); //value : text
var _tmp = {
text: getArray[keys[i]],
val: parseInt(keys[i]),
@@ -125,7 +125,7 @@
axios
.delete(HTTP_HOST + 'api/bed_kind/DeleteBedKindDetail/' + item.num)
.then(response => {
console.log("del", item);
this.desserts.splice(index, 1)
this.desserts_count = this.desserts_count - 1;
})
+3 -3
View File
@@ -528,7 +528,7 @@
if (selectedItem.price) {
this.currentRow.selected_items_text += ` (NT$${Number(selectedItem.price).toLocaleString()})`;
}
console.log('已選擇項目:', selectedItem.subject, '項目編號:', selectedItem.num);
}
}
}
@@ -731,7 +731,7 @@
search.is_reconcile = 'Y';
}
console.log("search_get", api_url, search, params, this.options);
this.search_dialog.loading = true;
axios.post(api_url, search, { params: params })
@@ -770,7 +770,7 @@
curr.select(this, row);
}
this.search_dialog.show = false;
console.log('Selected row:', row);
},
showItemSelectDialog(item) {
//
+3 -3
View File
@@ -81,7 +81,7 @@
.catch(error => console.log(error))
},
editItem(item) {
console.log("edit", item);
},
deleteItem(item) {
@@ -91,7 +91,7 @@
axios
.delete(HTTP_HOST + 'api/FilesSet/' + item.num)
.then(response => {
console.log("del", item);
this.data_table.list.splice(index, 1);
this.data_table.count = this.data_table.list.length
})
@@ -104,7 +104,7 @@
axios
.delete(HTTP_HOST + 'api/FilesSet/Delete/' + this.data_table.selected.map(x => x.num))
.then(response => {
console.log("delAll");
for (var i = 0; i < this.data_table.selected.length; i++) {
const index = this.data_table.list.indexOf(this.data_table.selected[i]);
+597 -4
View File
@@ -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> &nbsp;&nbsp;
信眾姓名:<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;
@@ -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>
@@ -1590,7 +1976,6 @@
</div>
</div>
<div class="row mb-1">
<label class="col-form-label">備註</label>
<div class="">
@@ -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>
+41 -14
View File
@@ -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
{
@@ -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;
@@ -181,7 +182,36 @@ public partial class admin_follower_reg : MyWeb.config
#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) {
@@ -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 = "信眾編號重複";
}
*/
}
}
+110 -13
View File
@@ -22,15 +22,43 @@
<ul class="dropdown-menu style-menu">
<%--<li><span class="dropdown-item" data-value="">選擇版型</span></li>--%>
</ul>
<input type="text" id="styleName" class="form-control" aria-label="版型名稱">
</div>
<div class="form-floating mb-3">
<select class="form-select form-select-sm mb-2 " onchange="Designer.changePaper()" id="paperSize">
<option value="">請選擇</option>
</select>
<label for="paperSize" style="color: black">尺寸</label>
</div>
<div class="input-group mb-3">
<div class="row">
<div class="col-2">
<a class="" style="cursor:pointer;text-decoration: none;color:white;width:30px;height:30px;font-size:30px;"
title="增加版型" onclick="Designer.changeStyle('000001')">+</a></div>
<div class="col-8"> <input type="text" id="styleName" class="form-control" aria-label="版型名稱"></div>
<div class="col-2">
<a class="" style="cursor:pointer;text-decoration: none;color:white;width:30px;height:30px;font-size:30px;"
title="刪除版型" onclick="Designer.removeStyle()">-</a></div>
</div>
</div>
<div class="row">
<div class="col-2">
<a class="" style="cursor:pointer;text-decoration: none;color:white;width:30px;height:30px;font-size:30px;"
title="增加尺寸" onclick="Designer.changePaper1('newsize')">+</a>
</div>
<div class="col-8">
<div class="form-floating mb-3">
<select class="form-select form-select-sm mb-2 " onchange="Designer.changePaper()" id="paperSize">
<option value="">請選擇</option>
</select>
<label for="paperSize" style="color: black">內容尺寸</label>
</div>
</div>
<div class="col-2">
<a class="" style="cursor:pointer;text-decoration: none;color:white;width:30px;height:30px;font-size:30px;"
title="刪除尺寸" onclick="Designer.removePaper()">-</a>
</div>
</div>
<div id="sizeDiv" style="display: none;">
<div class="form-floating mb-3">
<input type="text" class="form-control form-select-sm mb-2 " id="paperName" />
@@ -52,9 +80,9 @@
<span class="btn btn-info" onclick="Designer.savePaperSize()">儲存</span>
</div>
</div>
<div id="paperOrientation" onclick="Designer.changeOrientation()" class="mb-2">
<%-- <div id="paperOrientation" onclick="Designer.changeOrientation()" class="mb-2">
<span></span>
</div>
</div>--%>
<div>
<ul class="navbar-nav">
<li class="nav-item dropdown">
@@ -259,7 +287,7 @@
this.bg.forEach(x => {
$("#backendInp").append("<option value='" + x.name + "'>" + x.name + "</option>")
});
$("#paperOrientation").html("<span>直向</span>")
//$("#paperOrientation").html("<span>直向</span>")
this.toast = new bootstrap.Toast($('#liveToast'));
},
print() {
@@ -440,6 +468,9 @@
},
async getPaperSize() {
let self = this
self.allSize.length = 0;
$("#paperSize").html("")
$("#printSize").html("")
await axios
.post(HTTP_HOST + 'api/tablet/GetPaperSize', {})
.then(response => {
@@ -476,6 +507,9 @@
});
},
async getStyles() {
let self = this
self.allSize.length = 0
$(".style-menu").html("")
await axios
.post(HTTP_HOST + 'api/tablet/GetStyleData', {})
.then(response => {
@@ -484,7 +518,7 @@
let data = response.data;
if (data.result == "Y") {
data.data.forEach(x => {
this.allStyle.push(x);
self.allStyle.push(x);
$(".style-menu").append("<li><span class='dropdown-item style-item' data-value='" + x.styleID + "'>" + x.name + "</span></li>");
});
@@ -597,6 +631,10 @@
el.y = $("#yPosition").val();
$(`.tablet-element[id="${this.activeId}"]`).css({ left: el.x + "mm", top: el.y + "mm" });
},
changePaper1(val) {
$("#paperSize").val(val)
this.changePaper()
},
changePaper() {
let paperSize = $("#paperSize").val()
let self = this;
@@ -613,13 +651,69 @@
});
}
},
async removePaper() {
let self = this;
let paperSize = $("#paperSize").val()
//console.log("paperSize:",paperSize);
if (paperSize == "newsize" || paperSize == "" || paperSize == null || paperSize==undefined) {
$("#toast_body").html("請選擇要刪除的尺寸")
self.toast.show();
return false
}
let ps = { paperSize: paperSize }
await axios
.post(HTTP_HOST + 'api/tablet/DelPaperSize', ps)
.then(response => {
if (response.status == "200") {
//if (response.data.result == "Y") {
$("#toast_body").html(`${response.data.message}`)
self.toast.show();
//}
if (response.data.result == "Y") {
self.getPaperSize()
$("#paperSize").val("")
this.changePaper()
}
}
});
},
async removeStyle() {
let self = this;
let sID = this.styleID
//console.log("styleID:", sID);
if (sID == "000001" || sID == null || sID == undefined) {
$("#toast_body").html("請選擇要刪除的版型")
self.toast.show();
return false
}
let ps = { styleID: sID }
await axios
.post(HTTP_HOST + 'api/tablet/DelTabletStyle', ps)
.then(response => {
if (response.status == "200") {
//if (response.data.result == "Y") {
$("#toast_body").html(`${response.data.message}`)
self.toast.show();
//}
if (response.data.result == "Y") {
self.getStyles()
}
}
});
},
async savePaperSize() {
let ps = {
paperName: $("#paperName").val(),
width: $("#paperWidth").val(),
height: $("#paperHeight").val()
}
console.log(ps);
let self = this;
//console.log(ps);
await axios
.post(HTTP_HOST + 'api/tablet/SavePaperSize', ps)
.then(response => {
@@ -628,6 +722,9 @@
$("#toast_body").html(`${"ok"}`)
self.toast.show();
self.getPaperSize()
$("#paperSize").val("")
self.changePaper()
}
}
});
@@ -642,7 +739,7 @@
bindEvents() {
// 文字變更連動渲染
//$('#rosterLimit').on('input', (e) =>this.)
console.log("OOQ");
//console.log("OOQ");
$('#inp-text').on('input', (e) => this.updateActive('text', $(e.target).val()));
$('#inp-size').on('input', (e) => this.updateActive('fontSize', $(e.target).val()));
$('#width').on('input', (e) => this.updateActive('width', $(e.target).val()))
+38 -32
View File
@@ -12,12 +12,12 @@
</v-text-field>-->
<!--</v-col>-->
<v-col cols="2" md="2">
<v-col cols="12" md="2">
<v-text-field label="法會名稱" v-model="search.subject">
</v-text-field>
</v-col>
<v-col cols="2" md="2">
<v-col cols="12" md="2">
<!--<v-text-field label="開始日期" v-model="search.uptime1">
</v-text-field>-->
@@ -39,7 +39,7 @@
@input="startmenu = false"></v-date-picker>
</v-menu>
</v-col>
<v-col cols="2" md="2">
<v-col cols="12" md="2">
<v-btn @click.prevent="getDefault()">查詢</v-btn>
<v-btn @click.prevent="clearSearch()">清空條件</v-btn>
</v-col>
@@ -47,33 +47,31 @@
</v-expansion-panel-content>
</v-expansion-panel>
</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"
:footer-props="data_table.footer"
:server-items-length="data_table.count"
:loading="data_table.loading"
:single-select="data_table.singleSelect"
hide-default-footer
:page.sync="data_table.page"
:items-per-page.sync="data_table.pageSize"
class="elevation-1">
<template #item.up_time="{ item }">
{{ item.up_time|timeString('YYYY/MM/DD') }}
</template>
<template #item.u_name="{ item }">
<a v-if="item.f_num != null && item.activity_num != null" @click="checkInMsg(item)" class="btn btn-outline-secondary btn-sm"><i class="mdi mdi-account-check"></i>報到</a>
{{ item.u_name }}
</template>
<template #item.slot_btn="{ item }">
<a @click="gotoSignup(item)" class="btn btn-outline-secondary btn-sm">報名</a>
<a @click="gotoBatchSignup(item)" class="btn btn-outline-secondary btn-sm">批次報名</a>
<a @click="gotoSignupList(item)" class="btn btn-outline-secondary btn-sm">明細</a>
<v-data-table v-model="data_table.selected"
:items="data_table.list"
item-key="order_no"
:options.sync="options"
:headers="data_table.header"
:footer-props="data_table.footer"
:server-items-length="data_table.count"
:loading="data_table.loading"
:single-select="data_table.singleSelect"
hide-default-footer
:page.sync="data_table.page"
:items-per-page.sync="data_table.pageSize"
disable-sort
class="elevation-1">
<template #item.u_name="{ item }">
<a v-if="item.f_num != null && item.activity_num != null" @click="checkInMsg(item)" class="btn btn-outline-secondary btn-sm"><i class="mdi mdi-account-check"></i>報到</a>
{{ item.u_name }}
</template>
<template #item.slot_btn="{ item }">
<a @click="gotoSignup(item)" class="btn btn-outline-secondary btn-sm">報名</a>
<a @click="gotoBatchSignup(item)" class="btn btn-outline-secondary btn-sm">批次報名</a>
<a @click="gotoSignupList(item)" class="btn btn-outline-secondary btn-sm">明細</a>
</template>
</v-data-table>
</template>
</v-data-table>
<v-container class="container-fluid">
<v-row class="align-baseline" wrap>
<v-col cols="12" md="9">
@@ -99,7 +97,6 @@
</template>
<script>
module.exports = {
props: ['formData'],
data() {
@@ -121,8 +118,8 @@
header: [
{ text: '活動分類', value: 'kindsTxt' },
{ text: '活動名稱', value: 'subject' },
{ text: '開始日期', value: 'startDate_solar' },
{ text: '結束日期', value: 'endDate_solar', align: 'start' },
{ text: '開始日期', value: 'startDate' },
{ text: '結束日期', value: 'endDate' },
{ text: '報名人數', value: 'orderCounts' },
{ text: '', value: 'slot_btn', sortable: false, align: 'end' }
],
@@ -192,7 +189,16 @@
deep: true,
},
},
filters: {
timestring(value) {
console.log("timeString:", value)
return "20260102";
//return (value == null || value == "") ? "" : moment(value).format('YYYY-MM-DD');
},
},
methods: {
initKindList() {
axios
//.get(HTTP_HOST + 'api/activity_kind')
+19 -10
View File
@@ -8,10 +8,10 @@
<v-expansion-panel-header color="#006fc9"
class="white--text">
<v-row>
<v-col cols="10" md="10">
<v-col cols="4" sm="4" md="10">
<label>查詢條件</label>
</v-col>
<v-col cols="2" md="2">
<v-col cols="8" sm="8" 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>
@@ -19,27 +19,27 @@
</v-expansion-panel-header>
<v-expansion-panel-content>
<v-row>
<v-col cols="2" md="2">
<v-col cols="12" sm="12" md="2">
<v-text-field label="姓名" v-model="search.u_name">
</v-text-field>
</v-col>
<v-col cols="2" md="2">
<v-col cols="12" sm="12" md="2">
<v-text-field label="電話" v-model="search.phone">
</v-text-field>
</v-col>
<v-col cols="2" md="2">
<v-col cols="12" sm="12" md="2">
<v-text-field label="行動電話" v-model="search.cellphone">
</v-text-field>
</v-col>
<v-col cols="2" md="2">
<v-col cols="12" sm="12" md="2">
<v-text-field label="身分證號" v-model="search.id_code">
</v-text-field>
</v-col>
<v-col cols="2" md="2">
<v-col cols="12" sm="12" md="4">
<v-btn @click.prevent="getDetail()">查詢</v-btn>
<v-btn @click.prevent="clearSearch()">清空條件</v-btn>
</v-col>
@@ -62,11 +62,13 @@
hide-default-footer
:page.sync="detail_table.page"
:items-per-page.sync="detail_table.pageSize"
disable-sort
class="elevation-1">
<template #item.slot_btn="{ item }">
<!--<a :href="'reg.aspx?order_no='+item.order_no" class="btn btn-outline-secondary btn-sm"><i class="mdi mdi-pencil-box-outline"></i>修改</a>
<a @click="$root.currentView='step-three';$root.selected_order=item.order_no" class="btn btn-outline-secondary btn-sm">明細</a>
<a @click="deleteItem(item)" class="btn btn-outline-secondary btn-sm"><i class="mdi mdi-trash-can"></i>刪除</a>-->
<a @click="$root.currentView='step-three';$root.selected_order=item.order_no" class="btn btn-outline-secondary btn-sm">明細</a>
<a @click="deleteItem(item)" class="btn btn-outline-secondary btn-sm"><i class="mdi mdi-trash-can"></i>刪除</a>-->
</template>
</v-data-table>
<v-container>
@@ -95,6 +97,7 @@
</template>
<script>
module.exports = {
props: {
num: {
@@ -122,7 +125,7 @@
header: [
{ text: '單號', value: 'order_no' },
{ text: '姓名', value: 'u_name' },
{ text: '報名日期', value: 'up_time' },
{ text: '報名日期', value: 'uptime' },
{ text: '單據狀態', value: 'keyin1_txt', align: 'start' },
{ text: '', value: 'slot_btn', sortable: false, align: 'end' }
],
@@ -148,6 +151,12 @@
},
},
filters: {
timeString(value, myFormat) {
console.log("timeString:", value, myFormat)
return value == null || value == "" ? "" : moment(value).format(myFormat || 'YYYY-MM-DD, HH:mm:ss');
},
},
methods: {
back01() {
this.$emit('custom-event', { action: 'signup1', item: this.num });
+6 -1
View File
@@ -423,7 +423,12 @@
// console.log("saveOrder:", x, x.num, x.order_no)
}
})
if (detail.length === 0) {
this.message_dialog.show_confirm = false
this.message_dialog.show = true
this.message_dialog.message = "沒有選擇功德項目,如果無法選擇,請使用一般報名程序"
return false
}
//
let main = {
activity_num: this.num, f_num: this.follower.num,
+1
View File
@@ -25,6 +25,7 @@
hide-default-footer
:page.sync="detail_table.page"
:items-per-page.sync="detail_table.pageSize"
disable-sort
class="elevation-1">
<template #item.slot_btn="{ item }">
</template>
+2 -1
View File
@@ -62,7 +62,7 @@
header: [
{ text: '單號', value: 'order_no' },
{ text: '姓名', value: 'u_name' },
{ text: '報名日期', value: 'up_time' },
{ text: '報名日期', value: 'uptime' },
{ text: '單據狀態', value: 'keyin1_txt', align: 'start' },
{ text: '', value: 'slot_btn', sortable: false, align: 'end' }
],
@@ -109,6 +109,7 @@
methods: {
changeView(item) {
if (item.action === "detail") {
console.log("change to fastSignup2")
this.twoData = item.item.num
this.currentView = "fastSignUp2-component"
} else if (item.action === "add") {
-1
View File
@@ -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)
+25
View File
@@ -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 = {
+102
View File
@@ -0,0 +1,102 @@
## FK 規則更新
| FK 名稱 | 更新內容 |
| - | - |
| FK_act_bom_actItem1| 刪除規則設為 cascade |
| FK_pro_order_followers | 刪除規則設為 cascade |
| FK_pro_order_activity | 刪除規則設為 cascade |
| FK_pro_order_detail_pro_order | 刪除規則設為 cascade |
| FK_pro_order_detail_followers | 刪除規則設為 沒有動作 |
| FK_activity_relating_activity | 刪除規則設為 cascade |
| FK_pro_order_auto_enroll | 刪除規則設為 NULL |
## 資料表欄位更新
| 資料表 | 新增欄位 | 備註 |
| - | - | - |
| actitem | 加上 sort_order (int) 欄位位 | |
| activity_relating | 加上 has_yang_limit(bit) 欄位 | |
| activity_relating | 加上 has_chao_limit(bit) 欄位 | |
| activity_relating | 加上 yang_limit_count (int) 欄位 | |
| activity_relating | 加上 chao_limit_count (int) 欄位 | |
| company | 加上 last_auto_order_no (nvarchar(20)) 欄位 | |
| pro_order | 加上 au_num (int) 欄位 | 需建立 FK 限制 (見下方 SQL) |
- 更新 actitem 資料表
```language
ALTER TABLE actitem
ADD sort_order int NULL;
```
- 更新 activity_relating 資料表
```language
ALTER TABLE activity_relating
ADD has_yang_limit bit NULL,
has_chao_limit bit NULL,
yang_limit_count int NULL,
chao_limit_count int NULL;
```
- 更新 company 資料表
```language
ALTER TABLE company
ADD last_auto_order_no nvarchar(20) NULL;
```
- 更新 pro_order 資料表及外鍵限制
```language
-- 新增欄位
ALTER TABLE pro_order
ADD au_num int NULL;
-- 建立外鍵限制 (FK_pro_order_auto_enroll)
ALTER TABLE pro_order
ADD CONSTRAINT FK_pro_order_auto_enroll
FOREIGN KEY (au_num) REFERENCES auto_enroll(num);
```
## 新增資料表 auto_enroll
| 欄位名稱 | 資料類型 | 允許 Null | 備註 |
| - | - | - | - |
| num | int | 否 | PK, 識別規格 (Identity) |
| f_num | int | 否 | FK (連至 followers.num) |
| start_date | date | 是 | |
| end_date | date | 是 | |
| receipt_title | nvarchar(MAX) | 是 | |
| receipt_address | nchar(200) | 否 | |
- 建立資料表 auto_enroll
```language
CREATE TABLE [dbo].[auto_enroll] (
[num] int IDENTITY(1,1) NOT NULL,
[f_num] int NOT NULL,
[start_date] date NULL,
[end_date] date NULL,
[receipt_title] nvarchar(MAX) NULL,
[receipt_address] nchar(200) NOT NULL,
CONSTRAINT [PK_auto_enroll] PRIMARY KEY CLUSTERED ([num] ASC)
);
```
- 設定外鍵限制
```language
ALTER TABLE [dbo].[auto_enroll]
ADD CONSTRAINT FK_auto_enroll_followers
FOREIGN KEY (f_num) REFERENCES followers(num);
```
### 資料表相關設定 (SQL)
- 設定主鍵
```language
ALTER TABLE [dbo].[auto_enroll]
ADD CONSTRAINT PK_auto_enroll PRIMARY KEY (num);
```
- 設定外鍵
```language
ALTER TABLE auto_enroll
ADD CONSTRAINT FK_auto_enroll_followers
FOREIGN KEY (f_num) REFERENCES followers(num);
```
- Model.edmx 設定
- num 識別規格設為 是
- Model.edmx auto_enroll.num 屬性 StoreGeneratedPattern 設為 Identity
+40 -7
View File
@@ -1,8 +1,41 @@
FK_act_bom_actItem1 刪除規則設為 cascade
FK_pro_order_followers 刪除規則設為 cascade
FK_pro_order_activity 刪除規則設為 cascade
FK_pro_order_detail_pro_order 刪除規則設為 cascade
FK_pro_order_detail_followers 刪除規則設為 沒有動作
FK_activity_relating_activity 刪除規則設為 cascade
FK 規則更新
FK_act_bom_actItem1 刪除規則設為 cascade
FK_pro_order_followers 刪除規則設為 cascade
FK_pro_order_activity 刪除規則設為 cascade
FK_pro_order_detail_pro_order 刪除規則設為 cascade
FK_pro_order_detail_followers 刪除規則設為 沒有動作
FK_activity_relating_activity 刪除規則設為 cascade
FK_pro_order_auto_enroll 刪除規則設為 NULL
------------------------------------------------------------
資料表欄位更新
actitem 加上 sort_order(int) 欄位
activity_relating 加上 has_yang_limit(bit) 欄位
activity_relating 加上 has_chao_limit(bit) 欄位
activity_relating 加上 yang_limit_count(int) 欄位
activity_relating 加上 chao_limit_count(int) 欄位
company 加上 last_auto_order_no(nvarchar(20)) 欄位
pro_order 加上 au_num(int) 欄位 並加上 constraint
ALTER TABLE pro_order
ADD CONSTRAINT FK_pro_order_auto_enroll
FOREIGN KEY (au_num) REFERENCES auto_enroll(num);
------------------------------------------------------------
新增資料表 auto_enroll
num int 不允許 Null
f_num int 不允許 Null
start_date date 允許 Null
end_date date 允許 Null
receipt_title nvarchar(MAX) 允許 Null
receipt_address nchar(200) 不允許 Null
actitem 加上 sort_order(int) 欄位
設定主鍵
ALTER TABLE [dbo].[auto_enroll]
ADD CONSTRAINT PK_auto_enroll PRIMARY KEY (num);
設定外鍵
ALTER TABLE auto_enroll
ADD CONSTRAINT FK_auto_enroll_followers
FOREIGN KEY (f_num) REFERENCES followers(num);
Model.edmx 設定
1. num 識別規格設為 是
2. Model.edmx auto_enroll.num 屬性 StoreGeneratedPattern 設為 Identity