Compare commits
12 Commits
37d0b928ec
...
dapper
| Author | SHA1 | Date | |
|---|---|---|---|
| 3273072fb3 | |||
| d9e651fe72 | |||
| 08b339e0cd | |||
| a81967ddbd | |||
| 1afb90f3ba | |||
| 21a3ec6198 | |||
| c5fc2469d7 | |||
| 8fe243356e | |||
| 83a7c67439 | |||
| 36174834a8 | |||
| f087e4aa61 | |||
| 7998312785 |
@@ -184,6 +184,9 @@ namespace Model
|
||||
public string partno { get; set; }
|
||||
public string print_init { 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; }
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")]
|
||||
|
||||
@@ -91,6 +91,9 @@
|
||||
<Property Name="customize_data" Type="nvarchar(max)" />
|
||||
<Property Name="reg_time" Type="datetime" />
|
||||
<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 Name="actItem_files">
|
||||
<Key>
|
||||
@@ -480,7 +483,7 @@
|
||||
<Property Name="country" Type="nvarchar" MaxLength="5" />
|
||||
<Property Name="appellation_id" Type="int" />
|
||||
<Property Name="follower_hash" Type="nvarchar" MaxLength="100" />
|
||||
<Property Name="search_keywords" Type="nvarchar(max)" />
|
||||
<Property Name="search_keywords" Type="varchar(max)" />
|
||||
</EntityType>
|
||||
<EntityType Name="followers_tablet">
|
||||
<Key>
|
||||
@@ -724,7 +727,7 @@
|
||||
<Property Name="customize_data" Type="nvarchar(max)" />
|
||||
<Property Name="printed_files" Type="nvarchar(max)" />
|
||||
<Property Name="UpdateTime" Type="datetime2" Precision="7" />
|
||||
<Property Name="style" Type="varchar" MaxLength="50" />
|
||||
<Property Name="style" Type="varchar" MaxLength="50" />
|
||||
</EntityType>
|
||||
<EntityType Name="pro_order_record">
|
||||
<Key>
|
||||
@@ -981,7 +984,7 @@
|
||||
<Property Name="balance_act_item" Type="int" />
|
||||
<Property Name="balance_pro_order_detail" Type="int" />
|
||||
</EntityType>
|
||||
<Association Name="FK__Ancestral__Regis__4DF47A4E">
|
||||
<Association Name="FK__Ancestral__Regis__1A9EF37A">
|
||||
<End Role="AncestralTabletRegistrant" Type="Self.AncestralTabletRegistrant" Multiplicity="1" />
|
||||
<End Role="AncestralTabletPositionRecord" Type="Self.AncestralTabletPositionRecord" Multiplicity="*" />
|
||||
<ReferentialConstraint>
|
||||
@@ -1129,18 +1132,6 @@
|
||||
</Dependent>
|
||||
</ReferentialConstraint>
|
||||
</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">
|
||||
<End Role="activity" Type="Self.activity" Multiplicity="0..1">
|
||||
<OnDelete Action="Cascade" />
|
||||
@@ -2158,7 +2149,7 @@
|
||||
<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="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="AncestralTabletPositionRecord" EntitySet="AncestralTabletPositionRecord" />
|
||||
</AssociationSet>
|
||||
@@ -2206,10 +2197,6 @@
|
||||
<End Role="activity_category_kind" EntitySet="activity_category_kind" />
|
||||
<End Role="activity" EntitySet="activity" />
|
||||
</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">
|
||||
<End Role="activity" EntitySet="activity" />
|
||||
<End Role="activity_check" EntitySet="activity_check" />
|
||||
@@ -2614,6 +2601,9 @@
|
||||
<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" />
|
||||
<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 Name="actItem_files">
|
||||
<Key>
|
||||
@@ -2973,7 +2963,7 @@
|
||||
<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="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" />
|
||||
</EntityType>
|
||||
<EntityType Name="followers_tablet">
|
||||
@@ -3189,7 +3179,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="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 Name="pro_order_record">
|
||||
<Key>
|
||||
@@ -5336,6 +5326,9 @@
|
||||
<EntitySetMapping Name="actItems">
|
||||
<EntityTypeMapping TypeName="Model.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="print_init" ColumnName="print_init" />
|
||||
<ScalarProperty Name="partno" ColumnName="partno" />
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
<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_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.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" />
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using Microsoft.Ajax.Utilities;
|
||||
using MINOM.COM.Utility;
|
||||
using Model;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using System;
|
||||
@@ -14,6 +15,7 @@ using System.Web.Http;
|
||||
/// </summary>
|
||||
public class designerController : ApiController
|
||||
{
|
||||
private Model.ezEntities _db = new Model.ezEntities();
|
||||
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]
|
||||
[Route("api/tablet/GetTabletElement")]
|
||||
public IHttpActionResult GetTabletElement([FromBody] dynamic data)
|
||||
@@ -61,6 +76,28 @@ public class designerController : ApiController
|
||||
//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]
|
||||
[Route("api/tablet/GetStyleData")]
|
||||
public IHttpActionResult GetStyleData([FromBody] dynamic data)
|
||||
@@ -131,6 +168,14 @@ public class designerController : ApiController
|
||||
if (mode == "add")
|
||||
{
|
||||
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();
|
||||
}
|
||||
@@ -188,8 +233,14 @@ public class designerController : ApiController
|
||||
}
|
||||
|
||||
object[] obj = new StyleDataAccess().UpdateStyle(ts, list);
|
||||
|
||||
return Ok();
|
||||
if (obj[0].ToString() == "Y")
|
||||
{
|
||||
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");
|
||||
|
||||
object[] obj = new StyleDataAccess().AddTabletPaper(tps);
|
||||
|
||||
return Ok();
|
||||
if (obj[0].ToString()=="Y")
|
||||
{
|
||||
return Ok(new { result = "Y" });
|
||||
}
|
||||
else
|
||||
{
|
||||
return Ok(new { result = "N"});
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -8,7 +8,7 @@
|
||||
<LastUsedPlatform>Any CPU</LastUsedPlatform>
|
||||
<LaunchSiteAfterPublish>true</LaunchSiteAfterPublish>
|
||||
<PublishProvider>FileSystem</PublishProvider>
|
||||
<PublishUrl>D:\17168web</PublishUrl>
|
||||
<PublishUrl>C:\17168web</PublishUrl>
|
||||
<WebPublishMethod>FileSystem</WebPublishMethod>
|
||||
<_TargetId>Folder</_TargetId>
|
||||
<SiteUrlToLaunchAfterPublish />
|
||||
|
||||
@@ -23,6 +23,8 @@
|
||||
data() {
|
||||
return {
|
||||
this_id: '<%= Request["num"] %>',
|
||||
paperlist: [],
|
||||
stylelist: [],
|
||||
options: {},
|
||||
optionsDetail: {
|
||||
multiSort: false,
|
||||
@@ -43,7 +45,7 @@
|
||||
{ id: 'kind', title: '分類名稱' },
|
||||
],
|
||||
selected: {},
|
||||
select(item,t) {
|
||||
select(item, t) {
|
||||
console.log("select search1", t);
|
||||
}
|
||||
},
|
||||
@@ -60,7 +62,7 @@
|
||||
{ id: 'subject', title: '文件名稱' },
|
||||
],
|
||||
selected: {},
|
||||
select(item,t) {
|
||||
select(item, t) {
|
||||
console.log("select search2", t);
|
||||
|
||||
item.files_num_selected.text = t.subject //=====?
|
||||
@@ -71,26 +73,26 @@
|
||||
id: 'search3',
|
||||
title: '子項目',
|
||||
text_prop: 'subject',
|
||||
value_prop: 'num',
|
||||
keys: [
|
||||
{ id: 'subject', title: '項目名稱', value: '' },
|
||||
{ id: 'kindTxt', title: '項目分類' },
|
||||
],
|
||||
api_url: HTTP_HOST + 'api/activity/GetItemList',
|
||||
columns: [
|
||||
{ id: 'subject', title: '項目名稱', value: '' },
|
||||
{ id: 'kindTxt', title: '項目分類' },
|
||||
],
|
||||
selected: {},
|
||||
select(item,t) {
|
||||
console.log("select search3", item, t);
|
||||
//debugger;
|
||||
item.actItem.subject = t.subject
|
||||
item.actItem.num = t.num
|
||||
item.item_num_selected={
|
||||
text: t.subject,
|
||||
val : t.num
|
||||
}
|
||||
value_prop: 'num',
|
||||
keys: [
|
||||
{ id: 'subject', title: '項目名稱', value: '' },
|
||||
{ id: 'kindTxt', title: '項目分類' },
|
||||
],
|
||||
api_url: HTTP_HOST + 'api/activity/GetItemList',
|
||||
columns: [
|
||||
{ id: 'subject', title: '項目名稱', value: '' },
|
||||
{ id: 'kindTxt', title: '項目分類' },
|
||||
],
|
||||
selected: {},
|
||||
select(item, t) {
|
||||
console.log("select search3", item, t);
|
||||
//debugger;
|
||||
item.actItem.subject = t.subject
|
||||
item.actItem.num = t.num
|
||||
item.item_num_selected = {
|
||||
text: t.subject,
|
||||
val: t.num
|
||||
}
|
||||
// item.bom_editedItem.actItem.subject = t.subject
|
||||
// item.bom_editedItem.actItem.num = t.num
|
||||
|
||||
@@ -98,11 +100,11 @@
|
||||
// text : t.subject,
|
||||
// val = t.num
|
||||
// }
|
||||
}
|
||||
////新增/修改+關閉時, 會清空/還原
|
||||
}
|
||||
////新增/修改+關閉時, 會清空/還原
|
||||
},
|
||||
|
||||
},
|
||||
},
|
||||
show: false,
|
||||
current: {},
|
||||
list: [],
|
||||
@@ -142,7 +144,7 @@
|
||||
editedItem: {
|
||||
id: 0,
|
||||
num: 0,
|
||||
actItem_num: 0,
|
||||
actItem_num: 0,
|
||||
files_num_selected: {
|
||||
text: '',
|
||||
val: 0
|
||||
@@ -175,12 +177,12 @@
|
||||
'items-per-page-options': []
|
||||
},
|
||||
bom_list: [],
|
||||
bom_count: 0,
|
||||
bom_count: 0,
|
||||
bom_editedIndex: -1,
|
||||
bom_editedItem: {
|
||||
id: 0,
|
||||
num: 0,
|
||||
package_num: 0,
|
||||
package_num: 0,
|
||||
//item_num: 0,
|
||||
item_num_selected: {
|
||||
text: '',
|
||||
@@ -190,13 +192,13 @@
|
||||
bom_defaultItem: {
|
||||
id: 0,
|
||||
num: 0,
|
||||
package_num: 0,
|
||||
package_num: 0,
|
||||
//item_num: 0,
|
||||
item_num_selected: {
|
||||
text: '',
|
||||
val: 0
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
@@ -243,8 +245,8 @@
|
||||
});
|
||||
//necessary parameter===
|
||||
if (this.search_dialog.current.id == 'search1') {
|
||||
if (this.this_id=="")
|
||||
search['status'] = "Y";//啟用
|
||||
if (this.this_id == "")
|
||||
search['status'] = "Y";//啟用
|
||||
}
|
||||
console.log("search_get", api_url, search, params, this.options);
|
||||
this.search_dialog.loading = true
|
||||
@@ -292,7 +294,7 @@
|
||||
target.children("input.search-text").val(curr.selected[curr.text_prop])//text
|
||||
target.children("input:hidden").val(curr.selected[curr.value_prop])//value
|
||||
if (curr.select instanceof Function) {
|
||||
curr.select(editem,row);
|
||||
curr.select(editem, row);
|
||||
}
|
||||
this.search_dialog.show = false;
|
||||
//console.log(row, row["u_name"], row["f_number"], curr.id, target);
|
||||
@@ -309,7 +311,7 @@
|
||||
actItem_num: this.this_id,
|
||||
}
|
||||
axios
|
||||
.post(HTTP_HOST + 'api/activity/GetItemFiles',
|
||||
.post(HTTP_HOST + 'api/activity/GetItemFiles',
|
||||
searchItemDetail, { params: params })
|
||||
.then(response => {
|
||||
this.desserts = response.data.list
|
||||
@@ -323,7 +325,7 @@
|
||||
item_num: this.this_id,
|
||||
}
|
||||
axios
|
||||
.post(HTTP_HOST + 'api/activity/GetItemBomList',
|
||||
.post(HTTP_HOST + 'api/activity/GetItemBomList',
|
||||
searchItemBom, { params: params })
|
||||
.then(response => {
|
||||
this.bom_list = response.data.list
|
||||
@@ -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) {
|
||||
this.editedIndex = this.desserts.indexOf(item);
|
||||
@@ -360,7 +406,7 @@
|
||||
}
|
||||
},
|
||||
cancel() {
|
||||
|
||||
|
||||
this.spliceNullData();
|
||||
this.close();
|
||||
},
|
||||
@@ -383,7 +429,7 @@
|
||||
}, 300)
|
||||
},
|
||||
addNew() {
|
||||
|
||||
|
||||
this.spliceNullData();
|
||||
|
||||
//addObj.id = this.desserts.length + 1;
|
||||
@@ -399,12 +445,12 @@
|
||||
addObj.id = (isFinite(_c) ? _c : 0) + 1;
|
||||
this.desserts.unshift(addObj);
|
||||
this.editItem(addObj);
|
||||
},
|
||||
},
|
||||
save() {
|
||||
if (this.editedIndex > -1) {
|
||||
if (this.this_id != '') {
|
||||
//chcck necessary params
|
||||
if (this.editedItem.files_num_selected.val != 0 ) {
|
||||
if (this.editedItem.files_num_selected.val != 0) {
|
||||
//insert or update data
|
||||
var pro_order_detail =
|
||||
{
|
||||
@@ -434,27 +480,27 @@
|
||||
}
|
||||
|
||||
}
|
||||
},
|
||||
titleword() {
|
||||
var e = document.getElementById("<%= category.ClientID%>");
|
||||
},
|
||||
titleword() {
|
||||
var e = document.getElementById("<%= category.ClientID%>");
|
||||
const strUser = e.options[e.selectedIndex].text;
|
||||
|
||||
const _kind_txt = $('#<%= kind_txt.ClientID%>').val();
|
||||
const _subject = $('#<%= subject.ClientID%>').val();
|
||||
return "(" + strUser + ")" + " " + _kind_txt + " " + _subject;
|
||||
},
|
||||
bom_editItem(item){
|
||||
bom_editItem(item) {
|
||||
this.bom_editedIndex = this.bom_list.indexOf(item);
|
||||
this.bom_editedItem = $.extend(true, {}, item);
|
||||
console.log("bom_editItem:", this.bom_editedIndex, this.bom_editedItem);
|
||||
//debugger;
|
||||
},
|
||||
bom_deleteItem(item){
|
||||
bom_deleteItem(item) {
|
||||
confirm('確定要刪除此筆資料嗎?') && this.bom_list.splice(index, 1);
|
||||
},
|
||||
bom_cancel(){
|
||||
bom_cancel() {
|
||||
this.bom_spliceNullData();
|
||||
this.bom_close();
|
||||
this.bom_close();
|
||||
},
|
||||
bom_spliceNullData() {
|
||||
//if new data ,then splice it
|
||||
@@ -472,7 +518,7 @@
|
||||
this.bom_editedItem = -1;
|
||||
}, 300)
|
||||
},
|
||||
bom_addNew(){
|
||||
bom_addNew() {
|
||||
this.spliceNullData();
|
||||
|
||||
//addObj.id = this.desserts.length + 1;
|
||||
@@ -491,13 +537,13 @@
|
||||
if (!!this.bom_list) this.bom_list?.unshift(addObj);
|
||||
this.bom_editItem(addObj);
|
||||
},
|
||||
bom_save(){
|
||||
bom_save() {
|
||||
if (this.bom_editedIndex > -1) {
|
||||
if (this.this_id != '') {
|
||||
//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
|
||||
var package_num = $(".packageNum input[type=hidden]").val();
|
||||
var package_num = $(".packageNum input[type=hidden]").val();
|
||||
var bom_detail =
|
||||
{
|
||||
num: this.bom_editedItem.num,
|
||||
@@ -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: {
|
||||
},
|
||||
@@ -541,8 +596,8 @@
|
||||
function setCss() {
|
||||
$(".cyclePanel input").addClass("form-check-input");
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content3" ContentPlaceHolderID="page_nav" runat="Server">
|
||||
@@ -625,6 +680,27 @@
|
||||
<asp:RegularExpressionValidator ControlToValidate="price" Display="Dynamic" SetFocusOnError="true" ErrorMessage="只能輸入數字" ID="RegularExpressionValidator3" runat="server" ValidationExpression="^(-?\d+)(\.\d+)?$" />
|
||||
</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">
|
||||
<ContentTemplate>
|
||||
<label class="col-sm-2 col-form-label"></label>
|
||||
|
||||
@@ -44,6 +44,21 @@ public partial class admin_activity_item_reg : MyWeb.config
|
||||
print_init.Text = prod.print_init;
|
||||
PARTNO.Text = prod.partno;
|
||||
//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)
|
||||
{
|
||||
kind_txt.Value = prod.actItem_kind.kind;
|
||||
@@ -120,7 +135,19 @@ public partial class admin_activity_item_reg : MyWeb.config
|
||||
Model.actItem actItem = new Model.actItem();//新增
|
||||
actItem.subject = subject.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(category.SelectedValue)) { actItem.category = Val(category.SelectedValue); } else { actItem.category = 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.print_init = print_init.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(category.SelectedValue)) { actItem.category = Val(category.SelectedValue); } else { actItem.category = 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);
|
||||
//}
|
||||
}
|
||||
@@ -590,7 +590,79 @@
|
||||
this.data_table.selected.push(this.data_table.editFilesItem[i])
|
||||
}
|
||||
}
|
||||
}, multiPrint() {
|
||||
},
|
||||
multiPrintNew() {
|
||||
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_new.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));
|
||||
|
||||
|
||||
|
||||
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,
|
||||
@@ -625,7 +697,7 @@
|
||||
|
||||
})
|
||||
// 送出列印
|
||||
_url = HTTP_HOST + 'admin/print/print_multi_new.aspx';
|
||||
_url = HTTP_HOST + 'admin/print/print_multi.aspx';
|
||||
var form = document.createElement("form");
|
||||
form.method = "POST";
|
||||
form.action = _url;
|
||||
@@ -640,12 +712,14 @@
|
||||
form.appendChild(hiddenField);
|
||||
};
|
||||
|
||||
// Add form fields
|
||||
// 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));
|
||||
|
||||
/*
|
||||
@@ -1203,6 +1277,12 @@
|
||||
@click="multiPrint">
|
||||
列印<v-icon dark>mdi-turn-right</v-icon>
|
||||
</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>
|
||||
</v-toolbar>
|
||||
</template>
|
||||
|
||||
@@ -101,14 +101,14 @@
|
||||
</select>
|
||||
<label for="printMode" style="color: black">列印模式</label>
|
||||
</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">
|
||||
<label class="small" for="rosterLimit" style="color: black;">正名上限</label>
|
||||
</div>
|
||||
<div class="form-floating mb-3">
|
||||
<input type="number" id="perpage" class="form-control form-control-sm mb-2">
|
||||
<label class="small" for="perpage" style="color: black;">每頁列印筆數</label>
|
||||
</div>
|
||||
</div>--%>
|
||||
<div class="row">
|
||||
<div class="col-6">
|
||||
<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>
|
||||
</div>
|
||||
|
||||
<div class="row ">
|
||||
<%-- <div class="row ">
|
||||
<div class="col-6">
|
||||
<div class="form-floating mb-3">
|
||||
<input type="number" id="2offset" class="form-control form-control-sm mb-2">
|
||||
@@ -163,18 +163,18 @@
|
||||
<label class="small" for="breakLen">斷行字數</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>--%>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-6">
|
||||
<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>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-6">
|
||||
<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>
|
||||
</div>
|
||||
</div>
|
||||
@@ -210,7 +210,19 @@
|
||||
</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>
|
||||
|
||||
@@ -225,8 +237,8 @@
|
||||
allSize: [
|
||||
],
|
||||
bg: [
|
||||
{ name: "黃1", path: "../../admin/print/html/tablet-1.svg" },
|
||||
{ name: "黃2", path: "../../admin/print/html/tablet-1B.svg" },
|
||||
{ name: "黃1", path: "../../admin/print/html/tablet-1_new.svg" },
|
||||
{ name: "黃2", path: "../../admin/print/html/tablet-1B_new.svg" },
|
||||
{ name: "紅1", path: "../../admin/print/html/tablet-2.svg" },
|
||||
{ name: "紅2", path: "../../admin/print/html/tablet-2B.svg" }
|
||||
],
|
||||
@@ -235,6 +247,7 @@
|
||||
tabletElements: [
|
||||
],
|
||||
orientation: "portrait",
|
||||
toast:null,
|
||||
init() {
|
||||
//$(".tablet-element").draggable({});
|
||||
this.getPaperSize();
|
||||
@@ -247,13 +260,17 @@
|
||||
$("#backendInp").append("<option value='" + x.name + "'>" + x.name + "</option>")
|
||||
});
|
||||
$("#paperOrientation").html("<span>直向</span>")
|
||||
this.toast = new bootstrap.Toast($('#liveToast'));
|
||||
},
|
||||
print() {
|
||||
let self = this;
|
||||
let s = this.allStyle.find(x => x.styleID == this.styleID)
|
||||
let size = this.allSize.find(x => x.id = s.paperSize)
|
||||
let w = window.open('', '_blank');
|
||||
if (!w) {
|
||||
alert("請允許瀏覽器開啟彈出式視窗!");
|
||||
|
||||
$("#toast_body").html(`${"請允許瀏覽器開啟彈出式視窗!"}`)
|
||||
self.toast.show();
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -345,15 +362,15 @@
|
||||
}
|
||||
|
||||
|
||||
.ancestor-wrapper {
|
||||
/* 重置為橫向流,這樣 column 才會是真正的上下堆疊 */
|
||||
writing-mode: horizontal-tb;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center; /* 水平置中 */
|
||||
justify-content: center;
|
||||
width: fit-content;
|
||||
}
|
||||
// .ancestor-wrapper {
|
||||
// /* 重置為橫向流,這樣 column 才會是真正的上下堆疊 */
|
||||
// writing-mode: horizontal-tb;
|
||||
// display: flex;
|
||||
// flex-direction: column;
|
||||
// align-items: center; /* 水平置中 */
|
||||
// justify-content: flex-start;
|
||||
// width: fit-content;
|
||||
//}
|
||||
|
||||
.main-name {
|
||||
line-height: 1.2;
|
||||
@@ -572,6 +589,13 @@
|
||||
},
|
||||
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() {
|
||||
let paperSize = $("#paperSize").val()
|
||||
@@ -579,7 +603,7 @@
|
||||
if (paperSize == "newsize") {
|
||||
$("#sizeDiv").attr("style", "display:");
|
||||
} else {
|
||||
console.log("paperSize:", paperSize);
|
||||
// console.log("paperSize:", paperSize);
|
||||
let size = this.allSize.find(x => x.id == paperSize)
|
||||
$(".tablet-paper").css({
|
||||
"background-color": "white",
|
||||
@@ -599,6 +623,11 @@
|
||||
.post(HTTP_HOST + 'api/tablet/SavePaperSize', ps)
|
||||
.then(response => {
|
||||
if (response.status == "200") {
|
||||
if (response.data.result=="Y") {
|
||||
|
||||
$("#toast_body").html(`${"ok"}`)
|
||||
self.toast.show();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@@ -680,7 +709,7 @@
|
||||
// 2. 正名合併置中
|
||||
else if (el.type === 'combined-center') {
|
||||
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="sub-text">${parts[1] || ''}</span>
|
||||
</div>`;
|
||||
@@ -797,13 +826,6 @@
|
||||
"justify-content": "start",
|
||||
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));
|
||||
if (bot.length) h.append(this.renderNameGroups(bot,el));
|
||||
return h
|
||||
@@ -875,8 +897,8 @@
|
||||
else if (key === '2offset') el.twoOffset = parseFloat(val);
|
||||
else if (key === '3offset') el.threeOffset = parseFloat(val);
|
||||
else if (key === '4offset') el.fourOffset = parseFloat(val);
|
||||
else if (key === 'height') el.height = parseFloat(val);
|
||||
else el[key] = val;
|
||||
console.log("activeId:",this.activeId)
|
||||
if (el.type == "roster") {
|
||||
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
|
||||
}).html(this.renderRoster(names.slice(0 * this.rosterLimit, (0 + 1) * this.rosterLimit), el));
|
||||
} else if (el.type == "combined-center") {
|
||||
console.log("combined-center");
|
||||
|
||||
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="sub-text">${parts[1] || ''}</span>
|
||||
</div>`;
|
||||
$(`.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);
|
||||
} else if (this.activeId === "title1") {
|
||||
let names = el.text.split('\n').filter(s => s.trim());
|
||||
@@ -906,6 +933,24 @@
|
||||
$(`.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
|
||||
}).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 {
|
||||
$(`.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
|
||||
@@ -926,7 +971,7 @@
|
||||
const id = `${prefix}-${Date.now()}-${i}`;
|
||||
this.elements.push({
|
||||
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();
|
||||
@@ -937,7 +982,7 @@
|
||||
|
||||
this.elements.push({
|
||||
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();
|
||||
},
|
||||
@@ -985,7 +1030,7 @@
|
||||
})
|
||||
},
|
||||
async saveStyle() {
|
||||
|
||||
let self = this;
|
||||
let detail = [
|
||||
|
||||
];
|
||||
@@ -1015,7 +1060,13 @@
|
||||
await axios
|
||||
.post(HTTP_HOST + `api/tablet/${path}`, master)
|
||||
.then(response => {
|
||||
console.log(response);
|
||||
if (response.status == "200") {
|
||||
if (response.data.result == "Y") {
|
||||
|
||||
$("#toast_body").html(`${"ok!"}`)
|
||||
self.toast.show();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
@@ -232,7 +232,7 @@
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center; /* 水平置中 */
|
||||
justify-content: center;
|
||||
justify-content: flex-start;
|
||||
width: fit-content;
|
||||
}
|
||||
|
||||
|
||||
+148
-7
@@ -11,9 +11,9 @@
|
||||
border-bottom: 1px solid #eee;
|
||||
}
|
||||
</style>
|
||||
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content4" ContentPlaceHolderID="footer_script" runat="Server">
|
||||
|
||||
<script>
|
||||
Vue.filter('timeString', function (value, myFormat) {
|
||||
return value == null || value == "" ? "" : moment(value).format(myFormat || 'YYYY-MM-DD, HH:mm:ss');
|
||||
@@ -464,6 +464,11 @@
|
||||
initialized: false,
|
||||
currentItem: {}
|
||||
},
|
||||
tablet_edit_new: {
|
||||
show: false,
|
||||
initialized: false,
|
||||
currentItem: {}
|
||||
},
|
||||
//收款註記
|
||||
cash_dialog: {
|
||||
show: false,
|
||||
@@ -526,13 +531,13 @@
|
||||
window.addEventListener('message', async (event) => {
|
||||
if (event.data.source === 'editor.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);
|
||||
@@ -544,13 +549,41 @@
|
||||
// 呼叫 save 方法
|
||||
await this.save();
|
||||
}
|
||||
|
||||
|
||||
// 關閉編輯對話框
|
||||
this.tablet_edit.show = false;
|
||||
|
||||
this.tablet_edit_new.show = false;
|
||||
|
||||
// 顯示成功訊息
|
||||
this.snackbar.text = '牌位資料已更新';
|
||||
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;
|
||||
};
|
||||
}
|
||||
|
||||
const iframe1 = document.querySelector('iframe#tablet_edit_new_iframe');
|
||||
if (iframe1) {
|
||||
iframe1.onload = () => {
|
||||
this.tablet_edit_new.initialized = true;
|
||||
};
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
options: {
|
||||
@@ -572,6 +612,17 @@
|
||||
'tablet_edit.show': {
|
||||
handler(newVal) {
|
||||
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._savedEditedItem = null;
|
||||
}
|
||||
@@ -819,6 +870,34 @@
|
||||
this.editedItem = $.extend(true, {}, item);
|
||||
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) {
|
||||
this.editedIndex = this.desserts.indexOf(item);
|
||||
this.editedItem = $.extend(true, {}, item);
|
||||
@@ -845,6 +924,54 @@
|
||||
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() {
|
||||
const iframe = document.querySelector('iframe#tablet_edit_iframe');
|
||||
|
||||
@@ -2001,7 +2128,10 @@
|
||||
</v-icon>
|
||||
<v-icon title="編輯牌位" color="blue" class="mr-2" @click="editTablet(item);">
|
||||
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" >
|
||||
mdi-printer
|
||||
</v-icon>
|
||||
@@ -2569,6 +2699,17 @@
|
||||
|
||||
</v-card>
|
||||
</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-card>
|
||||
<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-card-title>
|
||||
<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>
|
||||
</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
@@ -80,7 +80,7 @@
|
||||
top: -2px;
|
||||
}
|
||||
.equal-card {
|
||||
min-height: 260px;
|
||||
min-height: 280px;
|
||||
}
|
||||
.checkbox-narrow {
|
||||
min-width: 32px;
|
||||
@@ -402,6 +402,9 @@
|
||||
selected: {
|
||||
style:""
|
||||
},
|
||||
actitem: "",
|
||||
pageSize: "",
|
||||
defaultStyle:"",
|
||||
isAllSelected: false,
|
||||
dialog: false,
|
||||
addDialog: false, // 新增項目對話框
|
||||
@@ -440,6 +443,12 @@
|
||||
}
|
||||
},
|
||||
deep: true
|
||||
},
|
||||
actitem: {
|
||||
handler() {
|
||||
this.getActItem();
|
||||
},
|
||||
deep: true
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
@@ -498,12 +507,12 @@
|
||||
window.addEventListener('message', (event) => {
|
||||
this.isAllSelected = false;
|
||||
console.log('editor.html - received message event');
|
||||
console.log('editor.html - event origin:', event.origin);
|
||||
console.log('editor.html - parent origin:', window.parent.location.origin);
|
||||
//console.log('editor.html - event origin:', event.origin);
|
||||
//console.log('editor.html - parent origin:', window.parent.location.origin);
|
||||
|
||||
if (event.origin === window.parent.location.origin) {
|
||||
console.log('editor.html - origin check passed');
|
||||
console.log('editor.html - received data:', event.data);
|
||||
//console.log('editor.html - origin check passed');
|
||||
//console.log('editor.html - received data:', event.data);
|
||||
const receivedData = event.data;
|
||||
this.family_deceased_Y_selected = [];
|
||||
this.family_deceased_N_selected = [];
|
||||
@@ -518,12 +527,16 @@
|
||||
if (receivedData.tabletItem) {
|
||||
this.tabletItem = receivedData.tabletItem;
|
||||
}
|
||||
//console.log("actitem:", receivedData.tabletItem.actitem_num_selected.val);
|
||||
console.log("receivedData::",receivedData);
|
||||
if (receivedData.tabletItem.style) {
|
||||
this.selected.style = receivedData.tabletItem.style;
|
||||
} else {
|
||||
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 資料
|
||||
if (this.tabletItem.f_num_tablet) {
|
||||
try {
|
||||
@@ -570,11 +583,29 @@
|
||||
|
||||
}
|
||||
}
|
||||
//this.getActItem();
|
||||
|
||||
});
|
||||
|
||||
this.getStyle();
|
||||
|
||||
},
|
||||
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() {
|
||||
axios
|
||||
.post('/api/tablet/GetStyleData', {}, {})
|
||||
@@ -583,14 +614,14 @@
|
||||
if (response.data.data) {
|
||||
response.data.data.forEach(x => {
|
||||
if (x.styleID != "000001") {
|
||||
this.code.style.push(x)
|
||||
console.log(this.pageSize, x.paperSize);
|
||||
if (this.pageSize&&this.pageSize==x.paperSize) {
|
||||
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))
|
||||
},
|
||||
|
||||
+3
-3
@@ -42,12 +42,12 @@
|
||||
<add key="UseSearchKeywords" value="true" />
|
||||
<!--網站的簡稱,用來區別session和cookie-->
|
||||
<add key="SC" value="erp17168" />
|
||||
<add key="LogPath" value="D:\\log\\" />
|
||||
<add key="LogPath" value="C:\\log\\" />
|
||||
</appSettings>
|
||||
<connectionStrings>
|
||||
<!--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="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="Data Source=192.168.5.16;Initial Catalog=17168erp_t;User ID=sa;Password=linux@mssql1234;Encrypt=False;TrustServerCertificate=True;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="Data Source=192.168.5.20;Initial Catalog=17168erp_c;User ID=sa;Password=linux@mssql1234;Encrypt=False;TrustServerCertificate=True;Connection Timeout=10;"" />
|
||||
<!--
|
||||
-->
|
||||
<!--SQL用-->
|
||||
|
||||
Reference in New Issue
Block a user