12 Commits

Author SHA1 Message Date
minom 3273072fb3 排版設定 2026-04-16 17:51:02 +08:00
minom d9e651fe72 左右正名可選可輸入 2026-04-15 17:46:35 +08:00
minom 08b339e0cd 牌位報名與列印 2026-04-14 15:45:42 +08:00
minom a81967ddbd 新增親友功能 2026-04-13 17:44:13 +08:00
minom 1afb90f3ba 新增親友 2026-04-12 20:55:09 +08:00
minom 21a3ec6198 still 牌位版面調整 2026-04-10 17:24:46 +08:00
minom c5fc2469d7 1.報名牌位 2.牌位列印 2026-04-09 17:42:29 +08:00
minom 8fe243356e 牌位設定 2026-04-08 17:54:28 +08:00
minom 83a7c67439 增加一個新的報名牌位編輯功能 2026-04-07 18:04:08 +08:00
minom 36174834a8 牌位排版 2026-04-06 19:06:22 +08:00
minom f087e4aa61 底圖 2026-04-02 18:22:46 +08:00
minom 7998312785 排版 2026-04-02 18:22:18 +08:00
17 changed files with 3372 additions and 532 deletions
+3
View File
@@ -184,6 +184,9 @@ namespace Model
public string partno { get; set; } public string partno { get; set; }
public string print_init { get; set; } public string print_init { get; set; }
public string is_reconcile { get; set; } public string is_reconcile { get; set; }
public string pageSize { get; set; }
public string printSize { get; set; }
public string defaultStyle { get; set; }
public virtual actItem_kind actItem_kind { get; set; } public virtual actItem_kind actItem_kind { get; set; }
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")]
+14 -21
View File
@@ -91,6 +91,9 @@
<Property Name="customize_data" Type="nvarchar(max)" /> <Property Name="customize_data" Type="nvarchar(max)" />
<Property Name="reg_time" Type="datetime" /> <Property Name="reg_time" Type="datetime" />
<Property Name="is_reconcile" Type="nvarchar" MaxLength="1" /> <Property Name="is_reconcile" Type="nvarchar" MaxLength="1" />
<Property Name="pageSize" Type="varchar" MaxLength="50" />
<Property Name="printSize" Type="varchar" MaxLength="50" />
<Property Name="defaultStyle" Type="varchar" MaxLength="50" />
</EntityType> </EntityType>
<EntityType Name="actItem_files"> <EntityType Name="actItem_files">
<Key> <Key>
@@ -480,7 +483,7 @@
<Property Name="country" Type="nvarchar" MaxLength="5" /> <Property Name="country" Type="nvarchar" MaxLength="5" />
<Property Name="appellation_id" Type="int" /> <Property Name="appellation_id" Type="int" />
<Property Name="follower_hash" Type="nvarchar" MaxLength="100" /> <Property Name="follower_hash" Type="nvarchar" MaxLength="100" />
<Property Name="search_keywords" Type="nvarchar(max)" /> <Property Name="search_keywords" Type="varchar(max)" />
</EntityType> </EntityType>
<EntityType Name="followers_tablet"> <EntityType Name="followers_tablet">
<Key> <Key>
@@ -981,7 +984,7 @@
<Property Name="balance_act_item" Type="int" /> <Property Name="balance_act_item" Type="int" />
<Property Name="balance_pro_order_detail" Type="int" /> <Property Name="balance_pro_order_detail" Type="int" />
</EntityType> </EntityType>
<Association Name="FK__Ancestral__Regis__4DF47A4E"> <Association Name="FK__Ancestral__Regis__1A9EF37A">
<End Role="AncestralTabletRegistrant" Type="Self.AncestralTabletRegistrant" Multiplicity="1" /> <End Role="AncestralTabletRegistrant" Type="Self.AncestralTabletRegistrant" Multiplicity="1" />
<End Role="AncestralTabletPositionRecord" Type="Self.AncestralTabletPositionRecord" Multiplicity="*" /> <End Role="AncestralTabletPositionRecord" Type="Self.AncestralTabletPositionRecord" Multiplicity="*" />
<ReferentialConstraint> <ReferentialConstraint>
@@ -1129,18 +1132,6 @@
</Dependent> </Dependent>
</ReferentialConstraint> </ReferentialConstraint>
</Association> </Association>
<Association Name="FK_activity_activity_kind">
<End Role="activity_kind" Type="Self.activity_kind" Multiplicity="0..1" />
<End Role="activity" Type="Self.activity" Multiplicity="*" />
<ReferentialConstraint>
<Principal Role="activity_kind">
<PropertyRef Name="num" />
</Principal>
<Dependent Role="activity">
<PropertyRef Name="kind" />
</Dependent>
</ReferentialConstraint>
</Association>
<Association Name="FK_activity_check_activity"> <Association Name="FK_activity_check_activity">
<End Role="activity" Type="Self.activity" Multiplicity="0..1"> <End Role="activity" Type="Self.activity" Multiplicity="0..1">
<OnDelete Action="Cascade" /> <OnDelete Action="Cascade" />
@@ -2158,7 +2149,7 @@
<EntitySet Name="supplier" EntityType="Self.supplier" Schema="dbo" store:Type="Tables" /> <EntitySet Name="supplier" EntityType="Self.supplier" Schema="dbo" store:Type="Tables" />
<EntitySet Name="supplier_kind" EntityType="Self.supplier_kind" Schema="dbo" store:Type="Tables" /> <EntitySet Name="supplier_kind" EntityType="Self.supplier_kind" Schema="dbo" store:Type="Tables" />
<EntitySet Name="transfer_register" EntityType="Self.transfer_register" Schema="dbo" store:Type="Tables" /> <EntitySet Name="transfer_register" EntityType="Self.transfer_register" Schema="dbo" store:Type="Tables" />
<AssociationSet Name="FK__Ancestral__Regis__4DF47A4E" Association="Self.FK__Ancestral__Regis__4DF47A4E"> <AssociationSet Name="FK__Ancestral__Regis__1A9EF37A" Association="Self.FK__Ancestral__Regis__1A9EF37A">
<End Role="AncestralTabletRegistrant" EntitySet="AncestralTabletRegistrant" /> <End Role="AncestralTabletRegistrant" EntitySet="AncestralTabletRegistrant" />
<End Role="AncestralTabletPositionRecord" EntitySet="AncestralTabletPositionRecord" /> <End Role="AncestralTabletPositionRecord" EntitySet="AncestralTabletPositionRecord" />
</AssociationSet> </AssociationSet>
@@ -2206,10 +2197,6 @@
<End Role="activity_category_kind" EntitySet="activity_category_kind" /> <End Role="activity_category_kind" EntitySet="activity_category_kind" />
<End Role="activity" EntitySet="activity" /> <End Role="activity" EntitySet="activity" />
</AssociationSet> </AssociationSet>
<AssociationSet Name="FK_activity_activity_kind" Association="Self.FK_activity_activity_kind">
<End Role="activity_kind" EntitySet="activity_kind" />
<End Role="activity" EntitySet="activity" />
</AssociationSet>
<AssociationSet Name="FK_activity_check_activity" Association="Self.FK_activity_check_activity"> <AssociationSet Name="FK_activity_check_activity" Association="Self.FK_activity_check_activity">
<End Role="activity" EntitySet="activity" /> <End Role="activity" EntitySet="activity" />
<End Role="activity_check" EntitySet="activity_check" /> <End Role="activity_check" EntitySet="activity_check" />
@@ -2614,6 +2601,9 @@
<Property Name="print_init" Type="String" MaxLength="100" FixedLength="false" Unicode="true" /> <Property Name="print_init" Type="String" MaxLength="100" FixedLength="false" Unicode="true" />
<NavigationProperty Name="transfer_register" Relationship="Model.FK_transfer_register_actItem" FromRole="actItem" ToRole="transfer_register" /> <NavigationProperty Name="transfer_register" Relationship="Model.FK_transfer_register_actItem" FromRole="actItem" ToRole="transfer_register" />
<Property Name="is_reconcile" Type="String" MaxLength="1" FixedLength="false" Unicode="true" /> <Property Name="is_reconcile" Type="String" MaxLength="1" FixedLength="false" Unicode="true" />
<Property Name="pageSize" Type="String" MaxLength="50" FixedLength="false" Unicode="false" />
<Property Name="printSize" Type="String" MaxLength="50" FixedLength="false" Unicode="false" />
<Property Name="defaultStyle" Type="String" MaxLength="50" FixedLength="false" Unicode="false" />
</EntityType> </EntityType>
<EntityType Name="actItem_files"> <EntityType Name="actItem_files">
<Key> <Key>
@@ -2973,7 +2963,7 @@
<NavigationProperty Name="transfer_register" Relationship="Model.FK_transfer_register_followers" FromRole="follower" ToRole="transfer_register" /> <NavigationProperty Name="transfer_register" Relationship="Model.FK_transfer_register_followers" FromRole="follower" ToRole="transfer_register" />
<NavigationProperty Name="transfer_register1" Relationship="Model.FK_transfer_register_followers_match" FromRole="follower" ToRole="transfer_register" /> <NavigationProperty Name="transfer_register1" Relationship="Model.FK_transfer_register_followers_match" FromRole="follower" ToRole="transfer_register" />
<NavigationProperty Name="GuaDanOrder" Relationship="Model.FK_GuaDanOrder_Followers" FromRole="follower" ToRole="GuaDanOrder" /> <NavigationProperty Name="GuaDanOrder" Relationship="Model.FK_GuaDanOrder_Followers" FromRole="follower" ToRole="GuaDanOrder" />
<Property Name="search_keywords" Type="String" MaxLength="Max" FixedLength="false" Unicode="true" /> <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="GuaDanOrderGuest" Relationship="Model.FK_GuaDanOrderGuest_FOLLOWERS" FromRole="follower" ToRole="GuaDanOrderGuest" />
</EntityType> </EntityType>
<EntityType Name="followers_tablet"> <EntityType Name="followers_tablet">
@@ -3189,7 +3179,7 @@
<Property Name="UpdateTime" Type="DateTime" Precision="7" /> <Property Name="UpdateTime" Type="DateTime" Precision="7" />
<NavigationProperty Name="accountings" Relationship="Model.FK_accounting_pro_order_detail" FromRole="pro_order_detail" ToRole="accounting" /> <NavigationProperty Name="accountings" Relationship="Model.FK_accounting_pro_order_detail" FromRole="pro_order_detail" ToRole="accounting" />
<NavigationProperty Name="transfer_register" Relationship="Model.FK_transfer_register_pro_order_detail" FromRole="pro_order_detail" ToRole="transfer_register" /> <NavigationProperty Name="transfer_register" Relationship="Model.FK_transfer_register_pro_order_detail" FromRole="pro_order_detail" ToRole="transfer_register" />
<Property Name="style" Type="String" Unicode="true" FixedLength="false" MaxLength="50" Nullable="true" /> <Property Name="style" Type="String" Unicode="false" FixedLength="false" MaxLength="50" Nullable="true" />
</EntityType> </EntityType>
<EntityType Name="pro_order_record"> <EntityType Name="pro_order_record">
<Key> <Key>
@@ -5336,6 +5326,9 @@
<EntitySetMapping Name="actItems"> <EntitySetMapping Name="actItems">
<EntityTypeMapping TypeName="Model.actItem"> <EntityTypeMapping TypeName="Model.actItem">
<MappingFragment StoreEntitySet="actItem"> <MappingFragment StoreEntitySet="actItem">
<ScalarProperty Name="defaultStyle" ColumnName="defaultStyle" />
<ScalarProperty Name="printSize" ColumnName="printSize" />
<ScalarProperty Name="pageSize" ColumnName="pageSize" />
<ScalarProperty Name="is_reconcile" ColumnName="is_reconcile" /> <ScalarProperty Name="is_reconcile" ColumnName="is_reconcile" />
<ScalarProperty Name="print_init" ColumnName="print_init" /> <ScalarProperty Name="print_init" ColumnName="print_init" />
<ScalarProperty Name="partno" ColumnName="partno" /> <ScalarProperty Name="partno" ColumnName="partno" />
+1 -1
View File
@@ -17,7 +17,7 @@
<EntityTypeShape EntityType="Model.activity_check" Width="1.5" PointX="5.25" PointY="18.5" IsExpanded="true" /> <EntityTypeShape EntityType="Model.activity_check" Width="1.5" PointX="5.25" PointY="18.5" IsExpanded="true" />
<EntityTypeShape EntityType="Model.activity_kind" Width="1.5" PointX="0.75" PointY="11.625" IsExpanded="true" /> <EntityTypeShape EntityType="Model.activity_kind" Width="1.5" PointX="0.75" PointY="11.625" IsExpanded="true" />
<EntityTypeShape EntityType="Model.activity_kind_detail" Width="1.5" PointX="13.5" PointY="3.875" IsExpanded="true" /> <EntityTypeShape EntityType="Model.activity_kind_detail" Width="1.5" PointX="13.5" PointY="3.875" IsExpanded="true" />
<EntityTypeShape EntityType="Model.activity_relating" Width="1.5" PointX="10.5" PointY="9.875" IsExpanded="true" /> <EntityTypeShape EntityType="Model.activity_relating" Width="1.5" PointX="11.25" PointY="9.875" IsExpanded="true" />
<EntityTypeShape EntityType="Model.activity_spares" Width="1.5" PointX="13.5" PointY="7.75" IsExpanded="true" /> <EntityTypeShape EntityType="Model.activity_spares" Width="1.5" PointX="13.5" PointY="7.75" IsExpanded="true" />
<EntityTypeShape EntityType="Model.admin" Width="1.5" PointX="6" PointY="1.375" IsExpanded="true" /> <EntityTypeShape EntityType="Model.admin" Width="1.5" PointX="6" PointY="1.375" IsExpanded="true" />
<EntityTypeShape EntityType="Model.admin_group" Width="1.5" PointX="3.75" PointY="3.625" IsExpanded="true" /> <EntityTypeShape EntityType="Model.admin_group" Width="1.5" PointX="3.75" PointY="3.625" IsExpanded="true" />
+61 -4
View File
@@ -1,5 +1,6 @@
using Microsoft.Ajax.Utilities; using Microsoft.Ajax.Utilities;
using MINOM.COM.Utility; using MINOM.COM.Utility;
using Model;
using Newtonsoft.Json; using Newtonsoft.Json;
using Newtonsoft.Json.Linq; using Newtonsoft.Json.Linq;
using System; using System;
@@ -14,6 +15,7 @@ using System.Web.Http;
/// </summary> /// </summary>
public class designerController : ApiController public class designerController : ApiController
{ {
private Model.ezEntities _db = new Model.ezEntities();
public designerController() public designerController()
{ {
// //
@@ -21,6 +23,19 @@ public class designerController : ApiController
// //
} }
[HttpPost]
[Route("api/tablet/GetActItem")]
public IHttpActionResult GetActItem([FromBody] dynamic data)
{
LogUtility log = new LogUtility();
var json = data;
string itemNum = (json == null || json.itemNum == null) ? "" : (string)json.itemNum;
int num = int.Parse(itemNum);
var item=_db.actItems.AsQueryable().Where(x => x.num == num).FirstOrDefault();
return Ok(new { result = "Y", data =item});
}
[HttpPost] [HttpPost]
[Route("api/tablet/GetTabletElement")] [Route("api/tablet/GetTabletElement")]
public IHttpActionResult GetTabletElement([FromBody] dynamic data) public IHttpActionResult GetTabletElement([FromBody] dynamic data)
@@ -61,6 +76,28 @@ public class designerController : ApiController
//return Ok(data); //return Ok(data);
} }
[HttpPost]
[Route("api/tablet/saveFamily")]
public IHttpActionResult saveFamily([FromBody] family_members familyMember)
{
LogUtility log = new LogUtility();
_db.family_members.Add(familyMember);
_db.SaveChanges();
return Ok(new { result = "Y", data= familyMember });
//object[] obj = new StyleDataAccess().GetStyle("", "");
//if (obj[0].ToString() == "Y")
//{
// return Ok(new { result = "Y", data = obj[2] });
//}
//else
//{
// return Ok(new { result = "N", message = obj[1] });
// //throw new HttpResponseException(HttpStatusCode.NotFound);
//}
//return Ok(data);
}
[HttpPost] [HttpPost]
[Route("api/tablet/GetStyleData")] [Route("api/tablet/GetStyleData")]
public IHttpActionResult GetStyleData([FromBody] dynamic data) public IHttpActionResult GetStyleData([FromBody] dynamic data)
@@ -131,6 +168,14 @@ public class designerController : ApiController
if (mode == "add") if (mode == "add")
{ {
object[] obj = new StyleDataAccess().AddStyle(ts, list); object[] obj = new StyleDataAccess().AddStyle(ts, list);
if (obj[0].ToString() == "Y")
{
return Ok(new { result = "Y" });
}
else
{
return Ok(new { result = "N" });
}
} }
return Ok(); return Ok();
} }
@@ -188,8 +233,14 @@ public class designerController : ApiController
} }
object[] obj = new StyleDataAccess().UpdateStyle(ts, list); object[] obj = new StyleDataAccess().UpdateStyle(ts, list);
if (obj[0].ToString() == "Y")
return Ok(); {
return Ok(new { result = "Y" });
}
else
{
return Ok(new { result = "N" });
}
} }
@@ -238,8 +289,14 @@ public class designerController : ApiController
tps.UTime = DateTime.Now.ToString("HHmmss"); tps.UTime = DateTime.Now.ToString("HHmmss");
object[] obj = new StyleDataAccess().AddTabletPaper(tps); object[] obj = new StyleDataAccess().AddTabletPaper(tps);
if (obj[0].ToString()=="Y")
return Ok(); {
return Ok(new { result = "Y" });
}
else
{
return Ok(new { result = "N"});
}
} }
} }
@@ -8,7 +8,7 @@
<LastUsedPlatform>Any CPU</LastUsedPlatform> <LastUsedPlatform>Any CPU</LastUsedPlatform>
<LaunchSiteAfterPublish>true</LaunchSiteAfterPublish> <LaunchSiteAfterPublish>true</LaunchSiteAfterPublish>
<PublishProvider>FileSystem</PublishProvider> <PublishProvider>FileSystem</PublishProvider>
<PublishUrl>D:\17168web</PublishUrl> <PublishUrl>C:\17168web</PublishUrl>
<WebPublishMethod>FileSystem</WebPublishMethod> <WebPublishMethod>FileSystem</WebPublishMethod>
<_TargetId>Folder</_TargetId> <_TargetId>Folder</_TargetId>
<SiteUrlToLaunchAfterPublish /> <SiteUrlToLaunchAfterPublish />
+90 -14
View File
@@ -23,6 +23,8 @@
data() { data() {
return { return {
this_id: '<%= Request["num"] %>', this_id: '<%= Request["num"] %>',
paperlist: [],
stylelist: [],
options: {}, options: {},
optionsDetail: { optionsDetail: {
multiSort: false, multiSort: false,
@@ -43,7 +45,7 @@
{ id: 'kind', title: '分類名稱' }, { id: 'kind', title: '分類名稱' },
], ],
selected: {}, selected: {},
select(item,t) { select(item, t) {
console.log("select search1", t); console.log("select search1", t);
} }
}, },
@@ -60,7 +62,7 @@
{ id: 'subject', title: '文件名稱' }, { id: 'subject', title: '文件名稱' },
], ],
selected: {}, selected: {},
select(item,t) { select(item, t) {
console.log("select search2", t); console.log("select search2", t);
item.files_num_selected.text = t.subject //=====? item.files_num_selected.text = t.subject //=====?
@@ -82,14 +84,14 @@
{ id: 'kindTxt', title: '項目分類' }, { id: 'kindTxt', title: '項目分類' },
], ],
selected: {}, selected: {},
select(item,t) { select(item, t) {
console.log("select search3", item, t); console.log("select search3", item, t);
//debugger; //debugger;
item.actItem.subject = t.subject item.actItem.subject = t.subject
item.actItem.num = t.num item.actItem.num = t.num
item.item_num_selected={ item.item_num_selected = {
text: t.subject, text: t.subject,
val : t.num val: t.num
} }
// item.bom_editedItem.actItem.subject = t.subject // item.bom_editedItem.actItem.subject = t.subject
// item.bom_editedItem.actItem.num = t.num // item.bom_editedItem.actItem.num = t.num
@@ -243,7 +245,7 @@
}); });
//necessary parameter=== //necessary parameter===
if (this.search_dialog.current.id == 'search1') { if (this.search_dialog.current.id == 'search1') {
if (this.this_id=="") if (this.this_id == "")
search['status'] = "Y";//啟用 search['status'] = "Y";//啟用
} }
console.log("search_get", api_url, search, params, this.options); console.log("search_get", api_url, search, params, this.options);
@@ -292,7 +294,7 @@
target.children("input.search-text").val(curr.selected[curr.text_prop])//text target.children("input.search-text").val(curr.selected[curr.text_prop])//text
target.children("input:hidden").val(curr.selected[curr.value_prop])//value target.children("input:hidden").val(curr.selected[curr.value_prop])//value
if (curr.select instanceof Function) { if (curr.select instanceof Function) {
curr.select(editem,row); curr.select(editem, row);
} }
this.search_dialog.show = false; this.search_dialog.show = false;
//console.log(row, row["u_name"], row["f_number"], curr.id, target); //console.log(row, row["u_name"], row["f_number"], curr.id, target);
@@ -334,6 +336,50 @@
) )
} }
axios
.post(HTTP_HOST + 'api/tablet/GetPaperSize', {})
.then(response => {
console.log(response);
if (response.status == "200") {
let data = response.data;
if (data.result == "Y") {
data.data.forEach(x => {
this.paperlist.push({ name: x.paperName, id: x.paperID, width: x.width, height: x.height })
$('#<%= ddlPageSize.ClientID %>').append(`<option value="${x.paperID}">${x.paperName}</option>`);
$('#<%= ddlPrintSize.ClientID %>').append(`<option value="${x.paperID}">${x.paperName}</option>`);
});
$('#<%= ddlPageSize.ClientID %>').val($("#<%= hidPageSize.ClientID %>").val())
$('#<%= ddlPrintSize.ClientID %>').val($("#<%= hidPrintSize.ClientID %>").val())
}
}
})
.catch(
error => console.log(error)
)
axios
.post(HTTP_HOST + 'api/tablet/GetStyleData', {})
.then(response => {
console.log(response);
if (response.status == "200") {
let data = response.data;
if (data.result == "Y") {
data.data.forEach(x => {
if (x.styleID != "000001") {
this.stylelist.push({ styleID: x.styleID, name: x.name })
$('#<%= ddlDefaultStyle.ClientID %>').append(`<option value="${x.styleID}">${x.name}</option>`);
//$("#defaultStyle").append(`<option value="${x.styleID}">${x.name}</option>`);
}
});
$('#<%= ddlDefaultStyle.ClientID %>').val($("#<%= hidDefaultStyle.ClientID %>").val())
}
}
})
.catch(
error => console.log(error)
)
}, },
editItem(item) { editItem(item) {
this.editedIndex = this.desserts.indexOf(item); this.editedIndex = this.desserts.indexOf(item);
@@ -404,7 +450,7 @@
if (this.editedIndex > -1) { if (this.editedIndex > -1) {
if (this.this_id != '') { if (this.this_id != '') {
//chcck necessary params //chcck necessary params
if (this.editedItem.files_num_selected.val != 0 ) { if (this.editedItem.files_num_selected.val != 0) {
//insert or update data //insert or update data
var pro_order_detail = var pro_order_detail =
{ {
@@ -443,16 +489,16 @@
const _subject = $('#<%= subject.ClientID%>').val(); const _subject = $('#<%= subject.ClientID%>').val();
return "" + strUser + "" + " " + _kind_txt + " " + _subject; return "" + strUser + "" + " " + _kind_txt + " " + _subject;
}, },
bom_editItem(item){ bom_editItem(item) {
this.bom_editedIndex = this.bom_list.indexOf(item); this.bom_editedIndex = this.bom_list.indexOf(item);
this.bom_editedItem = $.extend(true, {}, item); this.bom_editedItem = $.extend(true, {}, item);
console.log("bom_editItem:", this.bom_editedIndex, this.bom_editedItem); console.log("bom_editItem:", this.bom_editedIndex, this.bom_editedItem);
//debugger; //debugger;
}, },
bom_deleteItem(item){ bom_deleteItem(item) {
confirm('確定要刪除此筆資料嗎?') && this.bom_list.splice(index, 1); confirm('確定要刪除此筆資料嗎?') && this.bom_list.splice(index, 1);
}, },
bom_cancel(){ bom_cancel() {
this.bom_spliceNullData(); this.bom_spliceNullData();
this.bom_close(); this.bom_close();
}, },
@@ -472,7 +518,7 @@
this.bom_editedItem = -1; this.bom_editedItem = -1;
}, 300) }, 300)
}, },
bom_addNew(){ bom_addNew() {
this.spliceNullData(); this.spliceNullData();
//addObj.id = this.desserts.length + 1; //addObj.id = this.desserts.length + 1;
@@ -491,11 +537,11 @@
if (!!this.bom_list) this.bom_list?.unshift(addObj); if (!!this.bom_list) this.bom_list?.unshift(addObj);
this.bom_editItem(addObj); this.bom_editItem(addObj);
}, },
bom_save(){ bom_save() {
if (this.bom_editedIndex > -1) { if (this.bom_editedIndex > -1) {
if (this.this_id != '') { if (this.this_id != '') {
//chcck necessary params //chcck necessary params
if (this.bom_editedItem.item_num_selected.val != 0 ) { if (this.bom_editedItem.item_num_selected.val != 0) {
//insert or update data //insert or update data
var package_num = $(".packageNum input[type=hidden]").val(); var package_num = $(".packageNum input[type=hidden]").val();
var bom_detail = var bom_detail =
@@ -525,6 +571,15 @@
} }
} }
}, },
changeSel(selType) {
if (selType=="ddlPageSize") {
$("#<%= hidPageSize.ClientID %>").val($("#<%= ddlPageSize.ClientID %>").val())
} else if (selType == "ddlPrintSize") {
$("#<%= hidPrintSize.ClientID %>").val($("#<%=ddlPrintSize.ClientID %>").val())
} else if (selType == "ddlDefaultStyle") {
$("#<%= hidDefaultStyle.ClientID %>").val($("#<%= ddlDefaultStyle.ClientID %>").val())
}
}
}, },
computed: { computed: {
}, },
@@ -625,6 +680,27 @@
<asp:RegularExpressionValidator ControlToValidate="price" Display="Dynamic" SetFocusOnError="true" ErrorMessage="只能輸入數字" ID="RegularExpressionValidator3" runat="server" ValidationExpression="^(-?\d+)(\.\d+)?$" /> <asp:RegularExpressionValidator ControlToValidate="price" Display="Dynamic" SetFocusOnError="true" ErrorMessage="只能輸入數字" ID="RegularExpressionValidator3" runat="server" ValidationExpression="^(-?\d+)(\.\d+)?$" />
</div> </div>
</div> </div>
<div class="row mb-1 label-sm-right">
<label class="col-sm-2 col-form-label">預設頁面尺寸</label>
<div class="col-sm-4">
<select ID="ddlPageSize" runat="server" onchange="VueApp.changeSel('ddlPageSize')"></select>
<asp:HiddenField ID="hidPageSize" runat="server" />
</div>
<label class="col-sm-2 col-form-label">預設列印尺寸</label>
<div class="col-sm-4">
<select ID="ddlPrintSize" runat="server" onchange="VueApp.changeSel('ddlPrintSize')"></select>
<asp:HiddenField ID="hidPrintSize" runat="server" />
</div>
</div>
<div class="row mb-1 label-sm-right">
<label class="col-sm-2 col-form-label">預設版型</label>
<div class="col-sm-4">
<select ID="ddlDefaultStyle" runat="server" onchange="VueApp.changeSel('ddlDefaultStyle')"></select>
<asp:HiddenField ID="hidDefaultStyle" runat="server" />
</div>
</div>
<asp:UpdatePanel ID="UpdatePanel1" runat="server" class="row mb-1 label-sm-right"> <asp:UpdatePanel ID="UpdatePanel1" runat="server" class="row mb-1 label-sm-right">
<ContentTemplate> <ContentTemplate>
<label class="col-sm-2 col-form-label"></label> <label class="col-sm-2 col-form-label"></label>
+51
View File
@@ -44,6 +44,21 @@ public partial class admin_activity_item_reg : MyWeb.config
print_init.Text = prod.print_init; print_init.Text = prod.print_init;
PARTNO.Text = prod.partno; PARTNO.Text = prod.partno;
//kind.SelectedValue = prod.kind.ToString(); //kind.SelectedValue = prod.kind.ToString();
if (!isStrNull(prod.pageSize))
{
ddlPageSize.Value = prod.pageSize.ToString();
hidPageSize.Value = prod.pageSize.ToString();
}
if (!isStrNull(prod.printSize))
{
ddlPrintSize.Value = prod.printSize.ToString();
hidPrintSize.Value = prod.printSize.ToString();
}
if (!isStrNull(prod.defaultStyle))
{
ddlDefaultStyle.Value = prod.defaultStyle.ToString();
hidDefaultStyle.Value = prod.defaultStyle.ToString();
}
if (prod.kind.HasValue) if (prod.kind.HasValue)
{ {
kind_txt.Value = prod.actItem_kind.kind; kind_txt.Value = prod.actItem_kind.kind;
@@ -121,6 +136,18 @@ public partial class admin_activity_item_reg : MyWeb.config
actItem.subject = subject.Text; actItem.subject = subject.Text;
actItem.print_init = print_init.Text; actItem.print_init = print_init.Text;
actItem.partno = PARTNO.Text; actItem.partno = PARTNO.Text;
if (!isStrNull(ddlPageSize.Value))
{
actItem.pageSize = ddlPageSize.Value;
}
if (!isStrNull(ddlPrintSize.Value))
{
actItem.printSize = ddlPrintSize.Value;
}
if (!isStrNull(ddlDefaultStyle.Value))
{
actItem.defaultStyle = (ddlDefaultStyle.Value);
}
//if (!isStrNull(kind.SelectedValue)) { actItem.kind = Val(kind.SelectedValue); } else { actItem.kind = null; } //if (!isStrNull(kind.SelectedValue)) { actItem.kind = Val(kind.SelectedValue); } else { actItem.kind = null; }
if (!isStrNull(category.SelectedValue)) { actItem.category = Val(category.SelectedValue); } else { actItem.category = null; } if (!isStrNull(category.SelectedValue)) { actItem.category = Val(category.SelectedValue); } else { actItem.category = null; }
if (!isStrNull(kind.Value)) { actItem.kind = Val(kind.Value); } else { actItem.kind = null; } if (!isStrNull(kind.Value)) { actItem.kind = Val(kind.Value); } else { actItem.kind = null; }
@@ -168,6 +195,18 @@ public partial class admin_activity_item_reg : MyWeb.config
actItem.subject = subject.Text; actItem.subject = subject.Text;
actItem.print_init = print_init.Text; actItem.print_init = print_init.Text;
actItem.partno = PARTNO.Text; actItem.partno = PARTNO.Text;
if (!isStrNull(hidPageSize.Value))
{
actItem.pageSize = hidPageSize.Value;
}
if (!isStrNull(hidPrintSize.Value))
{
actItem.printSize = hidPrintSize.Value;
}
if (!isStrNull(hidDefaultStyle.Value))
{
actItem.defaultStyle = (hidDefaultStyle.Value);
}
//if (!isStrNull(kind.SelectedValue)) { actItem.kind = Val(kind.SelectedValue); } else { actItem.kind = null; } //if (!isStrNull(kind.SelectedValue)) { actItem.kind = Val(kind.SelectedValue); } else { actItem.kind = null; }
if (!isStrNull(category.SelectedValue)) { actItem.category = Val(category.SelectedValue); } else { actItem.category = null; } if (!isStrNull(category.SelectedValue)) { actItem.category = Val(category.SelectedValue); } else { actItem.category = null; }
if (!isStrNull(kind.Value)) { actItem.kind = Val(kind.Value); } else { actItem.kind = null; } if (!isStrNull(kind.Value)) { actItem.kind = Val(kind.Value); } else { actItem.kind = null; }
@@ -246,4 +285,16 @@ public partial class admin_activity_item_reg : MyWeb.config
} }
} }
} }
//protected override void Render(HtmlTextWriter writer)
//{
// ClientScript.RegisterForEventValidation(
// ddlDefaultStyle.UniqueID, "ddlDefaultStyle");
// ClientScript.RegisterForEventValidation(
// ddlPageSize.UniqueID, "ddlPageSize");
// ClientScript.RegisterForEventValidation(
// ddlPrintSize.UniqueID, "ddlPrintSize");
// base.Render(writer);
//}
} }
+82 -2
View File
@@ -590,7 +590,8 @@
this.data_table.selected.push(this.data_table.editFilesItem[i]) this.data_table.selected.push(this.data_table.editFilesItem[i])
} }
} }
}, multiPrint() { },
multiPrintNew() {
var params = { var params = {
item: this.thisItemSelected.val, item: this.thisItemSelected.val,
file: this.thisFilesSelected.val, file: this.thisFilesSelected.val,
@@ -601,7 +602,7 @@
//list = this.data_table.selected.map(x => x.num); //list = this.data_table.selected.map(x => x.num);
list = this.data_table.selected list = this.data_table.selected
.sort((a, b) => (a.print_id==null?"":a.print_id).localeCompare(b.print_id==null?"":b.print_id)) .sort((a, b) => (a.print_id == null ? "" : a.print_id).localeCompare(b.print_id == null ? "" : b.print_id))
.map(x => x.num); .map(x => x.num);
//console.log("what:",list); //console.log("what:",list);
@@ -641,11 +642,84 @@
}; };
// Add form fields // Add form fields
console.log(this.thisItemSelected.val, this.thisFilesSelected.val, JSON.stringify(list));
addHiddenField("item", this.thisItemSelected.val); addHiddenField("item", this.thisItemSelected.val);
addHiddenField("file", this.thisFilesSelected.val); addHiddenField("file", this.thisFilesSelected.val);
addHiddenField("list", JSON.stringify(list)); addHiddenField("list", JSON.stringify(list));
addHiddenField("title", `${this.thisItemSelected.text} / ${this.thisFilesSelected.text}`); addHiddenField("title", `${this.thisItemSelected.text} / ${this.thisFilesSelected.text}`);
//console.log("底家:",this.data_table.selected); //console.log("底家:",this.data_table.selected);
localStorage.setItem("item", this.thisItemSelected.val);
localStorage.setItem("list", JSON.stringify(this.data_table.selected));
document.body.appendChild(form); // Not entirely sure if this is necessary
form.submit();
document.body.removeChild(form);
}
else {
this.snackbar.text = "未選擇列印項目";
this.snackbar.show = true
}
},
multiPrint() {
var params = {
item: this.thisItemSelected.val,
file: this.thisFilesSelected.val,
//list: this.data_table.selected.map(x => x.num)
};
var list = [];
//list = this.data_table.selected.map(x => x.num);
list = this.data_table.selected
.sort((a, b) => (a.print_id==null?"":a.print_id).localeCompare(b.print_id==null?"":b.print_id))
.map(x => x.num);
//console.log("what:",list);
if (list.length > 0) {
// 記錄已列印
let _url = HTTP_HOST + 'api/order/printMultiFileLog';
axios.post(_url, list, { params: params })
.then(response => {
for (let i = 0; i < this.data_table.selected.length; i++) {
for (let j = 0; i < this.data_table.editFilesItem.length; j++) {
if (this.data_table.selected[i].num == this.data_table.editFilesItem[j].num) {
this.data_table.editFilesItem[j].isPrinted = true;
break;
}
}
}
})
.catch(error => {
console.log(error)
})
// 送出列印
_url = HTTP_HOST + 'admin/print/print_multi.aspx';
var form = document.createElement("form");
form.method = "POST";
form.action = _url;
form.target = "_blank"; // Open the result in a new tab
// Helper function to add hidden fields
const addHiddenField = (name, value) => {
const hiddenField = document.createElement("input");
hiddenField.type = "hidden";
hiddenField.name = name;
hiddenField.value = value;
form.appendChild(hiddenField);
};
// 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));
addHiddenField("title", `${this.thisItemSelected.text} / ${this.thisFilesSelected.text}`);
//console.log("底家:",this.data_table.selected);
localStorage.setItem("item", this.thisItemSelected.val);
localStorage.setItem("list", JSON.stringify(this.data_table.selected)); localStorage.setItem("list", JSON.stringify(this.data_table.selected));
/* /*
@@ -1203,6 +1277,12 @@
@click="multiPrint"> @click="multiPrint">
列印<v-icon dark>mdi-turn-right</v-icon> 列印<v-icon dark>mdi-turn-right</v-icon>
</v-btn> </v-btn>
<v-btn
color="primary"
class="ml-2 white--text"
@click="multiPrintNew">
列印(New)<v-icon dark>mdi-turn-right</v-icon>
</v-btn>
</div> </div>
</v-toolbar> </v-toolbar>
</template> </template>
+85 -34
View File
@@ -101,14 +101,14 @@
</select> </select>
<label for="printMode" style="color: black">列印模式</label> <label for="printMode" style="color: black">列印模式</label>
</div> </div>
<div class="form-floating mb-3"> <%-- <div class="form-floating mb-3">
<input type="number" id="rosterLimit" onchange="Designer.changeRosterLimit()" class="form-control form-control-sm mb-2"> <input type="number" id="rosterLimit" onchange="Designer.changeRosterLimit()" class="form-control form-control-sm mb-2">
<label class="small" for="rosterLimit" style="color: black;">正名上限</label> <label class="small" for="rosterLimit" style="color: black;">正名上限</label>
</div> </div>
<div class="form-floating mb-3"> <div class="form-floating mb-3">
<input type="number" id="perpage" class="form-control form-control-sm mb-2"> <input type="number" id="perpage" class="form-control form-control-sm mb-2">
<label class="small" for="perpage" style="color: black;">每頁列印筆數</label> <label class="small" for="perpage" style="color: black;">每頁列印筆數</label>
</div> </div>--%>
<div class="row"> <div class="row">
<div class="col-6"> <div class="col-6">
<span class="btn btn-sm btn-outline-info w-100 mb-2" onclick="Designer.saveStyle()">存檔</span> <span class="btn btn-sm btn-outline-info w-100 mb-2" onclick="Designer.saveStyle()">存檔</span>
@@ -135,7 +135,7 @@
<label class="small" for="inp-size">字體大小 (pt)</label> <label class="small" for="inp-size">字體大小 (pt)</label>
</div> </div>
<div class="row "> <%-- <div class="row ">
<div class="col-6"> <div class="col-6">
<div class="form-floating mb-3"> <div class="form-floating mb-3">
<input type="number" id="2offset" class="form-control form-control-sm mb-2"> <input type="number" id="2offset" class="form-control form-control-sm mb-2">
@@ -163,18 +163,18 @@
<label class="small" for="breakLen">斷行字數</label> <label class="small" for="breakLen">斷行字數</label>
</div> </div>
</div> </div>
</div> </div>--%>
<div class="row"> <div class="row">
<div class="col-6"> <div class="col-6">
<div class="form-floating mb-3"> <div class="form-floating mb-3">
<input type="number" id="xPosition" class="form-control form-control-sm mb-2"> <input type="number" id="xPosition" class="form-control form-control-sm mb-2" onchange="Designer.changePosition()">
<label class="small" for="xPosition">X</label> <label class="small" for="xPosition">X</label>
</div> </div>
</div> </div>
<div class="col-6"> <div class="col-6">
<div class="form-floating mb-3"> <div class="form-floating mb-3">
<input type="number" id="yPosition" class="form-control form-control-sm mb-2"> <input type="number" id="yPosition" class="form-control form-control-sm mb-2" onchange="Designer.changePosition()">
<label class="small" for="yPosition">Y</label> <label class="small" for="yPosition">Y</label>
</div> </div>
</div> </div>
@@ -210,7 +210,19 @@
</div> </div>
</div> </div>
<div class="position-fixed top-50 start-50 p-3" style="z-index: 10001" >
<div id="liveToast" class="toast hide " role="alert" aria-live="assertive"
data-bs-delay="3000" aria-atomic="true"
style="color:white;background-color:dimgray;opacity:1;font-size:24px;">
<div class="toast-header">
<strong class="me-auto">提示訊息</strong>
<button type="button" class="btn-close" data-bs-dismiss="toast" aria-label="Close"></button>
</div>
<div class="toast-body" id="toast_body">
</div>
</div>
</div>
</asp:Content> </asp:Content>
@@ -225,8 +237,8 @@
allSize: [ allSize: [
], ],
bg: [ bg: [
{ name: "黃1", path: "../../admin/print/html/tablet-1.svg" }, { name: "黃1", path: "../../admin/print/html/tablet-1_new.svg" },
{ name: "黃2", path: "../../admin/print/html/tablet-1B.svg" }, { name: "黃2", path: "../../admin/print/html/tablet-1B_new.svg" },
{ name: "紅1", path: "../../admin/print/html/tablet-2.svg" }, { name: "紅1", path: "../../admin/print/html/tablet-2.svg" },
{ name: "紅2", path: "../../admin/print/html/tablet-2B.svg" } { name: "紅2", path: "../../admin/print/html/tablet-2B.svg" }
], ],
@@ -235,6 +247,7 @@
tabletElements: [ tabletElements: [
], ],
orientation: "portrait", orientation: "portrait",
toast:null,
init() { init() {
//$(".tablet-element").draggable({}); //$(".tablet-element").draggable({});
this.getPaperSize(); this.getPaperSize();
@@ -247,13 +260,17 @@
$("#backendInp").append("<option value='" + x.name + "'>" + x.name + "</option>") $("#backendInp").append("<option value='" + x.name + "'>" + x.name + "</option>")
}); });
$("#paperOrientation").html("<span>直向</span>") $("#paperOrientation").html("<span>直向</span>")
this.toast = new bootstrap.Toast($('#liveToast'));
}, },
print() { print() {
let self = this;
let s = this.allStyle.find(x => x.styleID == this.styleID) let s = this.allStyle.find(x => x.styleID == this.styleID)
let size = this.allSize.find(x => x.id = s.paperSize) let size = this.allSize.find(x => x.id = s.paperSize)
let w = window.open('', '_blank'); let w = window.open('', '_blank');
if (!w) { if (!w) {
alert("請允許瀏覽器開啟彈出式視窗!");
$("#toast_body").html(`${"請允許瀏覽器開啟彈出式視窗!"}`)
self.toast.show();
return; return;
} }
@@ -345,15 +362,15 @@
} }
.ancestor-wrapper { // .ancestor-wrapper {
/* 重置為橫向流,這樣 column 才會是真正的上下堆疊 */ // /* 重置為橫向流,這樣 column 才會是真正的上下堆疊 */
writing-mode: horizontal-tb; // writing-mode: horizontal-tb;
display: flex; // display: flex;
flex-direction: column; // flex-direction: column;
align-items: center; /* 水平置中 */ // align-items: center; /* 水平置中 */
justify-content: center; // justify-content: flex-start;
width: fit-content; // width: fit-content;
} //}
.main-name { .main-name {
line-height: 1.2; line-height: 1.2;
@@ -572,6 +589,13 @@
}, },
changePrintSize() { changePrintSize() {
},
changePosition() {
//this.activeId = id;
const el = this.elements.find(x => x.id === this.activeId);
el.x=$('#xPosition').val();
el.y = $("#yPosition").val();
$(`.tablet-element[id="${this.activeId}"]`).css({ left: el.x + "mm", top: el.y + "mm" });
}, },
changePaper() { changePaper() {
let paperSize = $("#paperSize").val() let paperSize = $("#paperSize").val()
@@ -579,7 +603,7 @@
if (paperSize == "newsize") { if (paperSize == "newsize") {
$("#sizeDiv").attr("style", "display:"); $("#sizeDiv").attr("style", "display:");
} else { } else {
console.log("paperSize:", paperSize); // console.log("paperSize:", paperSize);
let size = this.allSize.find(x => x.id == paperSize) let size = this.allSize.find(x => x.id == paperSize)
$(".tablet-paper").css({ $(".tablet-paper").css({
"background-color": "white", "background-color": "white",
@@ -599,6 +623,11 @@
.post(HTTP_HOST + 'api/tablet/SavePaperSize', ps) .post(HTTP_HOST + 'api/tablet/SavePaperSize', ps)
.then(response => { .then(response => {
if (response.status == "200") { if (response.status == "200") {
if (response.data.result=="Y") {
$("#toast_body").html(`${"ok"}`)
self.toast.show();
}
} }
}); });
@@ -680,7 +709,7 @@
// 2. 正名合併置中 // 2. 正名合併置中
else if (el.type === 'combined-center') { else if (el.type === 'combined-center') {
const parts = el.text.split('\n'); const parts = el.text.split('\n');
html = `<div class="ancestor-wrapper" > html = `<div class="ancestor-wrapper" style="width:${el.width}px !important;height:${el.height}px !important;" >
<span class="main-name" >${parts[0] || ''}</span> <span class="main-name" >${parts[0] || ''}</span>
<span class="sub-text">${parts[1] || ''}</span> <span class="sub-text">${parts[1] || ''}</span>
</div>`; </div>`;
@@ -797,13 +826,6 @@
"justify-content": "start", "justify-content": "start",
gap: "20px", gap: "20px",
}); });
//h.append(
// $(`<div class="name-group">${top.map(n => `<div class="roster-name" style="font-size:${size}pt">${n}</div>`).join('')}</div>`)
//)
//if (bot.length) h.append(`<div class="name-group">${bot.map(n => `<div class="roster-name" style="font-size:${size}pt">${n}</div>`).join('')}</div>`)
//h += `<div class="name-group">${top.map(n => `<div class="roster-name" style="font-size:${size}pt">${n}</div>`).join('')}</div>`;
///if (bot.length) h += `<div class="name-group">${bot.map(n => `<div class="roster-name" style="font-size:${size}pt">${n}</div>`).join('')}</div>`;
//return h + `</div>`;
h.append(this.renderNameGroups(top,el)); h.append(this.renderNameGroups(top,el));
if (bot.length) h.append(this.renderNameGroups(bot,el)); if (bot.length) h.append(this.renderNameGroups(bot,el));
return h return h
@@ -875,8 +897,8 @@
else if (key === '2offset') el.twoOffset = parseFloat(val); else if (key === '2offset') el.twoOffset = parseFloat(val);
else if (key === '3offset') el.threeOffset = parseFloat(val); else if (key === '3offset') el.threeOffset = parseFloat(val);
else if (key === '4offset') el.fourOffset = parseFloat(val); else if (key === '4offset') el.fourOffset = parseFloat(val);
else if (key === 'height') el.height = parseFloat(val);
else el[key] = val; else el[key] = val;
console.log("activeId:",this.activeId)
if (el.type == "roster") { if (el.type == "roster") {
const names = el.text.split('\n').filter(s => s.trim()); const names = el.text.split('\n').filter(s => s.trim());
@@ -884,13 +906,18 @@
position: "absolute", left: el.startX + "mm", top: el.startY + "mm", fontSize: el.style.fontSize + 'pt', fontFamily: el.fontFamily, "z-index": 9999, visibility: el.style.isActive position: "absolute", left: el.startX + "mm", top: el.startY + "mm", fontSize: el.style.fontSize + 'pt', fontFamily: el.fontFamily, "z-index": 9999, visibility: el.style.isActive
}).html(this.renderRoster(names.slice(0 * this.rosterLimit, (0 + 1) * this.rosterLimit), el)); }).html(this.renderRoster(names.slice(0 * this.rosterLimit, (0 + 1) * this.rosterLimit), el));
} else if (el.type == "combined-center") { } else if (el.type == "combined-center") {
console.log("combined-center");
const parts = el.text.split('\n'); const parts = el.text.split('\n');
html = `<div class="ancestor-wrapper" > html = `<div class="ancestor-wrapper" style='width:${el.width}px !important;height:${el.height}px !important' >
<span class="main-name" >${parts[0] || ''}</span> <span class="main-name" >${parts[0] || ''}</span>
<span class="sub-text">${parts[1] || ''}</span> <span class="sub-text">${parts[1] || ''}</span>
</div>`; </div>`;
$(`.tablet-element[id="${this.activeId}"]`).css({ $(`.tablet-element[id="${this.activeId}"]`).css({
position: "absolute", left: el.startX + "mm", top: el.startY + "mm", fontSize: el.style.fontSize + 'pt', fontFamily: el.fontFamily, "z-index": 9999, visibility: el.style.isActive position: "absolute", left: el.startX + "mm", top: el.startY + "mm",
fontSize: el.style.fontSize + 'pt', fontFamily: el.fontFamily,
"z-index": 9999, visibility: el.style.isActive,
}).html(html); }).html(html);
} else if (this.activeId === "title1") { } else if (this.activeId === "title1") {
let names = el.text.split('\n').filter(s => s.trim()); let names = el.text.split('\n').filter(s => s.trim());
@@ -906,6 +933,24 @@
$(`.tablet-element[id="${this.activeId}"]`).css({ $(`.tablet-element[id="${this.activeId}"]`).css({
position: "absolute", left: el.x + "mm", top: el.y + "mm", fontSize: el.style.fontSize + 'pt', fontFamily: el.style.fontFamily, "z-index": 9999, visibility: el.style.visibility position: "absolute", left: el.x + "mm", top: el.y + "mm", fontSize: el.style.fontSize + 'pt', fontFamily: el.style.fontFamily, "z-index": 9999, visibility: el.style.visibility
}).html(html); }).html(html);
} else if (this.activeId==="righttitle") {
$(`.tablet-element[id="${this.activeId}"]`).css({
position: "absolute", left: el.x + "mm", top: el.y + "mm", fontSize: el.style.fontSize + 'pt',
fontFamily: el.style.fontFamily, "z-index": 9999, visibility: el.style.visibility,
width:el.width,height:el.height
}).text(el.text);
} else if (this.activeId === "lefttitle") {
$(`.tablet-element[id="${this.activeId}"]`).css({
position: "absolute", left: el.x + "mm", top: el.y + "mm", fontSize: el.style.fontSize + 'pt',
fontFamily: el.style.fontFamily, "z-index": 9999, visibility: el.style.visibility,
width: el.width, height: el.height
}).text(el.text);
} else if (this.activeId === "address") {
$(`.tablet-element[id="${this.activeId}"]`).css({
position: "absolute", left: el.x + "mm", top: el.y + "mm", fontSize: el.style.fontSize + 'pt',
fontFamily: el.style.fontFamily, "z-index": 9999, visibility: el.style.visibility,
width: el.width, height: el.height
}).text(el.text);
} else { } else {
$(`.tablet-element[id="${this.activeId}"]`).css({ $(`.tablet-element[id="${this.activeId}"]`).css({
position: "absolute", left: el.x + "mm", top: el.y + "mm", fontSize: el.style.fontSize + 'pt', fontFamily: el.style.fontFamily, "z-index": 9999, visibility: el.style.visibility position: "absolute", left: el.x + "mm", top: el.y + "mm", fontSize: el.style.fontSize + 'pt', fontFamily: el.style.fontFamily, "z-index": 9999, visibility: el.style.visibility
@@ -926,7 +971,7 @@
const id = `${prefix}-${Date.now()}-${i}`; const id = `${prefix}-${Date.now()}-${i}`;
this.elements.push({ this.elements.push({
id, type: 'title', text: `正名${i}`, x: 100 - (i * 30), y: 80, id, type: 'title', text: `正名${i}`, x: 100 - (i * 30), y: 80,
style: { fontSize: 24, fontFamily: 'Kaiti', isVertical: true } style: { fontSize: 24, fontFamily: 'DFKai-sb', isVertical: true }
}); });
} }
//this.render(); //this.render();
@@ -937,7 +982,7 @@
this.elements.push({ this.elements.push({
id: 'combined-' + Date.now(), type: 'combined-center', text: '林張\n氏歷代祖先', x: 130, y: 80, id: 'combined-' + Date.now(), type: 'combined-center', text: '林張\n氏歷代祖先', x: 130, y: 80,
style: { fontSize: 24, fontFamily: 'Kaiti', isVertical: true } style: { fontSize: 24, fontFamily: 'DFKai-sb', isVertical: true }
}); });
//this.render(); //this.render();
}, },
@@ -985,7 +1030,7 @@
}) })
}, },
async saveStyle() { async saveStyle() {
let self = this;
let detail = [ let detail = [
]; ];
@@ -1015,7 +1060,13 @@
await axios await axios
.post(HTTP_HOST + `api/tablet/${path}`, master) .post(HTTP_HOST + `api/tablet/${path}`, master)
.then(response => { .then(response => {
console.log(response); if (response.status == "200") {
if (response.data.result == "Y") {
$("#toast_body").html(`${"ok"}`)
self.toast.show();
}
}
}); });
} }
}; };
+1 -1
View File
@@ -232,7 +232,7 @@
display: flex; display: flex;
flex-direction: column; flex-direction: column;
align-items: center; /* 水平置中 */ align-items: center; /* 水平置中 */
justify-content: center; justify-content: flex-start;
width: fit-content; width: fit-content;
} }
+143 -2
View File
@@ -11,9 +11,9 @@
border-bottom: 1px solid #eee; border-bottom: 1px solid #eee;
} }
</style> </style>
</asp:Content> </asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="footer_script" runat="Server"> <asp:Content ID="Content4" ContentPlaceHolderID="footer_script" runat="Server">
<script> <script>
Vue.filter('timeString', function (value, myFormat) { Vue.filter('timeString', function (value, myFormat) {
return value == null || value == "" ? "" : moment(value).format(myFormat || 'YYYY-MM-DD, HH:mm:ss'); return value == null || value == "" ? "" : moment(value).format(myFormat || 'YYYY-MM-DD, HH:mm:ss');
@@ -464,6 +464,11 @@
initialized: false, initialized: false,
currentItem: {} currentItem: {}
}, },
tablet_edit_new: {
show: false,
initialized: false,
currentItem: {}
},
//收款註記 //收款註記
cash_dialog: { cash_dialog: {
show: false, show: false,
@@ -547,10 +552,38 @@
// 關閉編輯對話框 // 關閉編輯對話框
this.tablet_edit.show = false; this.tablet_edit.show = false;
this.tablet_edit_new.show = false;
// 顯示成功訊息 // 顯示成功訊息
this.snackbar.text = '牌位資料已更新'; this.snackbar.text = '牌位資料已更新';
this.snackbar.show = true; this.snackbar.show = true;
} else if (event.data.source === 'editorNew.btn.click') {
const receivedData = event.data.data;
// 更新編輯中的項目
//if (receivedData.tabletItem && this.editedIndex > -1) {
if (receivedData.tabletItem) {
// 將 tablet_data 轉換為 JSON 字串
//this.editedItem.f_num_tablet = JSON.stringify(receivedData.tablet_data);
// 確保其他必要欄位保持不變
const currentItem = this.desserts[this.editedIndex];
//currentItem.f_num_tablet = JSON.stringify(receivedData.tablet_data);
this.editedItem = {
...currentItem,
f_num_tablet: JSON.stringify(receivedData.tablet_data),
style: receivedData.style
};
// 呼叫 save 方法
await this.save();
}
this.tablet_edit_new.show = false;
// 顯示成功訊息
this.snackbar.text = '牌位資料已更新';
this.snackbar.show = true;
} }
}); });
@@ -561,6 +594,13 @@
this.tablet_edit.initialized = true; this.tablet_edit.initialized = true;
}; };
} }
const iframe1 = document.querySelector('iframe#tablet_edit_new_iframe');
if (iframe1) {
iframe1.onload = () => {
this.tablet_edit_new.initialized = true;
};
}
}, },
watch: { watch: {
options: { options: {
@@ -572,6 +612,17 @@
'tablet_edit.show': { 'tablet_edit.show': {
handler(newVal) { handler(newVal) {
if (!newVal && this._savedEditedItem) { if (!newVal && this._savedEditedItem) {
// console.log("三小");
this.editedItem = $.extend(true, {}, this._savedEditedItem);
this._savedEditedItem = null;
}
}
},
'tablet_edit_new.show': {
handler(newVal) {
if (!newVal && this._savedEditedItem) {
//console.log("不合理");
//$("#tablet_edit_new_iframe").src = $("#tablet_edit_new_iframe").src;
this.editedItem = $.extend(true, {}, this._savedEditedItem); this.editedItem = $.extend(true, {}, this._savedEditedItem);
this._savedEditedItem = null; this._savedEditedItem = null;
} }
@@ -819,6 +870,34 @@
this.editedItem = $.extend(true, {}, item); this.editedItem = $.extend(true, {}, item);
this.file_dialog.show = true; this.file_dialog.show = true;
}, },
async editTabletNew(item) {
this.editedIndex = this.desserts.indexOf(item);
this.editedItem = $.extend(true, {}, item);
try {
//document.getElementById("tablet_edit_new_iframe").contentWindow.location.reload();
// 如果是新項目,先保存
if (this.editedItem.num <= 0 || this.editedItem.num === null || this.editedItem.num === undefined) {
this.editedItem.qty = 1;
const savedItem = await this.save(false);
if (savedItem) {
this.$set(this.desserts, this.editedIndex, savedItem);
this.editedItem = $.extend(true, {}, savedItem);
}
}
// 先發送消息
await this.sendMessageToIframeNew();
// 保存當前的 editedItem 數據
const currentData = $.extend(true, {}, this.editedItem);
// 顯示對話框
this.tablet_edit_new.show = true;
// 立即恢復數據
this.editedItem = $.extend(true, {}, currentData);
} catch (error) {
console.error('Error in editTablet:', error);
}
},
async editTablet(item) { async editTablet(item) {
this.editedIndex = this.desserts.indexOf(item); this.editedIndex = this.desserts.indexOf(item);
this.editedItem = $.extend(true, {}, item); this.editedItem = $.extend(true, {}, item);
@@ -845,6 +924,54 @@
console.error('Error in editTablet:', error); console.error('Error in editTablet:', error);
} }
}, },
async sendMessageToIframeNew() {
const iframe = document.querySelector('iframe#tablet_edit_new_iframe');
// 在這裡深度複製 editedItem,確保數據不會被修改
const itemToSend = $.extend(true, {}, this.editedItem);
if (iframe) {
try {
// 準備要發送的數據
let familyMembers = [];
try {
// 嘗試獲取家族成員數據
const response = await axios.get(HTTP_HOST + 'api/familymembers/follower/' + this.follower_id);
familyMembers = response.data;
} catch (error) {
console.warn('error:', error);
}
// 準備發送的數據
const itemInfo = {
source: 'order.btn.click',
tabletItem: {
...itemToSend,
title: this.titleword() // 確保標題被包含
},
familyMembers: familyMembers,
host: HTTP_HOST,
follower_id:this.follower_id
};
iframe.contentWindow.postMessage(itemInfo, '*');
// 發送後確認數據完整性
// 如果數據被清除,立即恢復
if (!this.editedItem.num && itemToSend.num) {
this.$nextTick(() => {
this.editedItem = $.extend(true, {}, itemToSend);
});
}
} catch (error) {
console.error('Error in sendMessageToIframe:', error);
}
} else {
console.error('iframe not found');
}
},
async sendMessageToIframe() { async sendMessageToIframe() {
const iframe = document.querySelector('iframe#tablet_edit_iframe'); const iframe = document.querySelector('iframe#tablet_edit_iframe');
@@ -2002,6 +2129,9 @@
<v-icon title="編輯牌位" color="blue" class="mr-2" @click="editTablet(item);"> <v-icon title="編輯牌位" color="blue" class="mr-2" @click="editTablet(item);">
mdi-file-document-edit-outline mdi-file-document-edit-outline
</v-icon> </v-icon>
<v-icon title="編輯牌位New" color="blue" class="mr-2" @click="editTabletNew(item);">
mdi-file-document-edit-outline
</v-icon>
<v-icon title="列印" color="blue" class="mr-2" @click="printItem(item);" v-if="canPrint || lists.length==0" > <v-icon title="列印" color="blue" class="mr-2" @click="printItem(item);" v-if="canPrint || lists.length==0" >
mdi-printer mdi-printer
</v-icon> </v-icon>
@@ -2569,6 +2699,17 @@
</v-card> </v-card>
</v-dialog> </v-dialog>
<v-dialog v-model="tablet_edit_new.show" min-width="100vw" min-height="100vh" persistent eager :class="{'d-none': !tablet_edit_new.initialized}">
<v-card>
<v-card-title class="justify-space-between grey lighten-2">
<span class="fs-6 text text-dark">編輯牌位 : {{editedItem.actitem_num_selected.text}} - {{editedItem.print_id}}</span>
<v-btn icon @click="tablet_edit_new.show=false"><v-icon>mdi-close</v-icon></v-btn>
</v-card-title>
<v-card-text>
<iframe id="tablet_edit_new_iframe" src="../print/tablet_edit/editorNewOne.html" style="width: 100%; height: 100%;min-height:100vh;min-width:100vw" frameborder="0"></iframe>
</v-card-text>
</v-card>
</v-dialog>
<v-dialog v-model="tablet_edit.show" max-width="1000px" persistent eager :class="{'d-none': !tablet_edit.initialized}"> <v-dialog v-model="tablet_edit.show" max-width="1000px" persistent eager :class="{'d-none': !tablet_edit.initialized}">
<v-card> <v-card>
<v-card-title class="justify-space-between grey lighten-2"> <v-card-title class="justify-space-between grey lighten-2">
@@ -2576,7 +2717,7 @@
<v-btn icon @click="tablet_edit.show=false"><v-icon>mdi-close</v-icon></v-btn> <v-btn icon @click="tablet_edit.show=false"><v-icon>mdi-close</v-icon></v-btn>
</v-card-title> </v-card-title>
<v-card-text> <v-card-text>
<iframe id="tablet_edit_iframe" src="../print/tablet_edit/editornew.html" style="width: 100%; height: 550px;" frameborder="0"></iframe> <iframe id="tablet_edit_iframe" src="../print/tablet_edit/editornew.html" style="width: 100%; height: 580px;" frameborder="0"></iframe>
</v-card-text> </v-card-text>
</v-card> </v-card>
</v-dialog> </v-dialog>
File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 81 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 99 KiB

File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+42 -11
View File
@@ -80,7 +80,7 @@
top: -2px; top: -2px;
} }
.equal-card { .equal-card {
min-height: 260px; min-height: 280px;
} }
.checkbox-narrow { .checkbox-narrow {
min-width: 32px; min-width: 32px;
@@ -402,6 +402,9 @@
selected: { selected: {
style:"" style:""
}, },
actitem: "",
pageSize: "",
defaultStyle:"",
isAllSelected: false, isAllSelected: false,
dialog: false, dialog: false,
addDialog: false, // 新增項目對話框 addDialog: false, // 新增項目對話框
@@ -440,6 +443,12 @@
} }
}, },
deep: true deep: true
},
actitem: {
handler() {
this.getActItem();
},
deep: true
} }
}, },
computed: { computed: {
@@ -498,12 +507,12 @@
window.addEventListener('message', (event) => { window.addEventListener('message', (event) => {
this.isAllSelected = false; this.isAllSelected = false;
console.log('editor.html - received message event'); console.log('editor.html - received message event');
console.log('editor.html - event origin:', event.origin); //console.log('editor.html - event origin:', event.origin);
console.log('editor.html - parent origin:', window.parent.location.origin); //console.log('editor.html - parent origin:', window.parent.location.origin);
if (event.origin === window.parent.location.origin) { if (event.origin === window.parent.location.origin) {
console.log('editor.html - origin check passed'); //console.log('editor.html - origin check passed');
console.log('editor.html - received data:', event.data); //console.log('editor.html - received data:', event.data);
const receivedData = event.data; const receivedData = event.data;
this.family_deceased_Y_selected = []; this.family_deceased_Y_selected = [];
this.family_deceased_N_selected = []; this.family_deceased_N_selected = [];
@@ -518,12 +527,16 @@
if (receivedData.tabletItem) { if (receivedData.tabletItem) {
this.tabletItem = receivedData.tabletItem; this.tabletItem = receivedData.tabletItem;
} }
//console.log("actitem:", receivedData.tabletItem.actitem_num_selected.val);
console.log("receivedData::",receivedData); console.log("receivedData::",receivedData);
if (receivedData.tabletItem.style) { if (receivedData.tabletItem.style) {
this.selected.style = receivedData.tabletItem.style; this.selected.style = receivedData.tabletItem.style;
} else { } else {
this.selected.style = ""; this.selected.style = "";
} }
//console.log("actitem:", receivedData.tabletItem.actitem_num_selected.val);
this.actitem = receivedData.tabletItem.actitem_num_selected.val;
//console.log("actitem:",receivedData.tabletItem.actitem_num_selected.val);
// 處理 f_num_tablet 資料 // 處理 f_num_tablet 資料
if (this.tabletItem.f_num_tablet) { if (this.tabletItem.f_num_tablet) {
try { try {
@@ -570,11 +583,29 @@
} }
} }
//this.getActItem();
}); });
this.getStyle();
}, },
methods: { methods: {
getActItem() {
axios
.post('/api/tablet/GetActItem', { itemNum: this.actitem })
.then(response => {
console.log(response);
if (response.data.result == "Y" && response.data.data) {
this.pageSize = response.data.data.pageSize;
this.defaultStyle = response.data.data.defaultStyle;
this.selected.style = response.data.data.defaultStyle;
console.log("shit:",this.selected.style);
this.getStyle();
}
}
);
},
getStyle() { getStyle() {
axios axios
.post('/api/tablet/GetStyleData', {}, {}) .post('/api/tablet/GetStyleData', {}, {})
@@ -583,14 +614,14 @@
if (response.data.data) { if (response.data.data) {
response.data.data.forEach(x => { response.data.data.forEach(x => {
if (x.styleID != "000001") { if (x.styleID != "000001") {
console.log(this.pageSize, x.paperSize);
if (this.pageSize&&this.pageSize==x.paperSize) {
this.code.style.push(x) this.code.style.push(x)
} }
})
} }
//this.code.style = response.data.data; })
//this.detail_table.list = response.data.list
//this.detail_table.count = response.data.count; }
//this.detail_table.loading = false
}) })
.catch(error => console.log(error)) .catch(error => console.log(error))
}, },
+3 -3
View File
@@ -42,12 +42,12 @@
<add key="UseSearchKeywords" value="true" /> <add key="UseSearchKeywords" value="true" />
<!--網站的簡稱,用來區別session和cookie--> <!--網站的簡稱,用來區別session和cookie-->
<add key="SC" value="erp17168" /> <add key="SC" value="erp17168" />
<add key="LogPath" value="D:\\log\\" /> <add key="LogPath" value="C:\\log\\" />
</appSettings> </appSettings>
<connectionStrings> <connectionStrings>
<!--SQL用--> <!--SQL用-->
<add name="shopConn" providerName="System.Data.SqlClient" connectionString="Data Source=192.168.5.16;Initial Catalog=17168erp_t;User ID=sa;Password=linux@mssql1234;Encrypt=False;TrustServerCertificate=True;Provider=SQLOLEDB;Connection Timeout=10;" /> <add name="shopConn" providerName="System.Data.SqlClient" connectionString="Data Source=192.168.5.20;Initial Catalog=17168erp_c;User ID=sa;Password=linux@mssql1234;Encrypt=False;TrustServerCertificate=True;Provider=SQLOLEDB;Connection Timeout=10;" />
<add name="ezEntities" providerName="System.Data.EntityClient" connectionString="metadata=res://*/App_Code.Model.Model.csdl|res://*/App_Code.Model.Model.ssdl|res://*/App_Code.Model.Model.msl;provider=System.Data.SqlClient;provider connection string=&quot;Data Source=192.168.5.16;Initial Catalog=17168erp_t;User ID=sa;Password=linux@mssql1234;Encrypt=False;TrustServerCertificate=True;Connection Timeout=10;&quot;" /> <add name="ezEntities" providerName="System.Data.EntityClient" connectionString="metadata=res://*/App_Code.Model.Model.csdl|res://*/App_Code.Model.Model.ssdl|res://*/App_Code.Model.Model.msl;provider=System.Data.SqlClient;provider connection string=&quot;Data Source=192.168.5.20;Initial Catalog=17168erp_c;User ID=sa;Password=linux@mssql1234;Encrypt=False;TrustServerCertificate=True;Connection Timeout=10;&quot;" />
<!-- <!--
--> -->
<!--SQL用--> <!--SQL用-->