diff --git a/web/App_Code/Model/Model.cs b/web/App_Code/Model/Model.cs index 2e5c4ed..9fee5c5 100644 --- a/web/App_Code/Model/Model.cs +++ b/web/App_Code/Model/Model.cs @@ -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")] diff --git a/web/App_Code/Model/Model.edmx b/web/App_Code/Model/Model.edmx index d70820a..69cd63b 100644 --- a/web/App_Code/Model/Model.edmx +++ b/web/App_Code/Model/Model.edmx @@ -91,6 +91,9 @@ + + + @@ -480,7 +483,7 @@ - + @@ -724,7 +727,7 @@ - + @@ -981,7 +984,7 @@ - + @@ -1129,18 +1132,6 @@ - - - - - - - - - - - - @@ -2158,7 +2149,7 @@ - + @@ -2206,10 +2197,6 @@ - - - - @@ -2614,6 +2601,9 @@ + + + @@ -2973,7 +2963,7 @@ - + @@ -3189,7 +3179,7 @@ - + @@ -5336,6 +5326,9 @@ + + + diff --git a/web/App_Code/Model/Model.edmx.diagram b/web/App_Code/Model/Model.edmx.diagram index dbffeda..5493ff5 100644 --- a/web/App_Code/Model/Model.edmx.diagram +++ b/web/App_Code/Model/Model.edmx.diagram @@ -17,7 +17,7 @@ - + diff --git a/web/App_Code/api/designerController.cs b/web/App_Code/api/designerController.cs index 98fb8fd..3755b9f 100644 --- a/web/App_Code/api/designerController.cs +++ b/web/App_Code/api/designerController.cs @@ -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; /// 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) @@ -131,6 +146,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 +211,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 +267,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"}); + } } } \ No newline at end of file diff --git a/web/admin/activity/item_reg.aspx b/web/admin/activity/item_reg.aspx index 211231b..842494e 100644 --- a/web/admin/activity/item_reg.aspx +++ b/web/admin/activity/item_reg.aspx @@ -23,6 +23,8 @@ data() { return { this_id: '<%= Request["num"] %>', + paperlist: [], + stylelist:[], options: {}, optionsDetail: { multiSort: false, @@ -331,6 +333,45 @@ }) .catch( error => console.log(error) + ) + + 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 }) + $("#pageSize").append(``); + $("#printSize").append(``); + }); + } + } + }) + .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 }) + $("#defaultStyle").append(``); + } + }); + } + } + }) + .catch( + error => console.log(error) ) } @@ -525,6 +566,15 @@ } } }, + selectChange(what) { + if (what == "pageSize") { + document.getElementById('<%= pageSizeSel.ClientID %>').value = $("#pageSize").val(); + } else if (what == "printSize") { + document.getElementById('<%= printSizeSel.ClientID %>').value = $("#printSize").val(); + } else if (what=="defaultStyle") { + document.getElementById('<%= defaultStyleSel.ClientID %>').value = $("#defaultStyle").val(); + } + } }, computed: { }, @@ -625,6 +675,36 @@ +
+ +
+ + + <%-- --%> +
+ +
+ + + <%-- --%> +
+
+
+ +
+ + + <%-- --%> +
+ +
+ diff --git a/web/admin/activity/item_reg.aspx.cs b/web/admin/activity/item_reg.aspx.cs index 27efd4a..9f25b85 100644 --- a/web/admin/activity/item_reg.aspx.cs +++ b/web/admin/activity/item_reg.aspx.cs @@ -120,7 +120,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(pageSizeSel.Value)) + { + actItem.pageSize =(pageSizeSel.Value); + } + if (!isStrNull(printSizeSel.Value)) + { + actItem.printSize = (printSizeSel.Value); + } + if (!isStrNull(defaultStyleSel.Value)) + { + actItem.defaultStyle = (defaultStyleSel.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 +180,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(pageSizeSel.Value)) + { + actItem.pageSize = (pageSizeSel.Value); + } + if (!isStrNull(printSizeSel.Value)) + { + actItem.printSize = (printSizeSel.Value); + } + if (!isStrNull(defaultStyleSel.Value)) + { + actItem.defaultStyle = (defaultStyleSel.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; } diff --git a/web/admin/activity/reg.aspx b/web/admin/activity/reg.aspx index 44a569d..56ef3e1 100644 --- a/web/admin/activity/reg.aspx +++ b/web/admin/activity/reg.aspx @@ -640,12 +640,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)); /* diff --git a/web/admin/item/TabletDesigner.aspx b/web/admin/item/TabletDesigner.aspx index e054816..d319601 100644 --- a/web/admin/item/TabletDesigner.aspx +++ b/web/admin/item/TabletDesigner.aspx @@ -168,13 +168,13 @@
- +
- +
@@ -225,8 +225,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" } ], @@ -572,6 +572,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() @@ -599,6 +606,9 @@ .post(HTTP_HOST + 'api/tablet/SavePaperSize', ps) .then(response => { if (response.status == "200") { + if (response.data.result=="Y") { + alert("ok"); + } } }); @@ -926,7 +936,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 +947,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(); }, @@ -1015,7 +1025,11 @@ await axios .post(HTTP_HOST + `api/tablet/${path}`, master) .then(response => { - console.log(response); + if (response.status == "200") { + if (response.data.result == "Y") { + alert("ok"); + } + } }); } }; diff --git a/web/admin/order/reg.aspx b/web/admin/order/reg.aspx index fe2482e..fe1c0cd 100644 --- a/web/admin/order/reg.aspx +++ b/web/admin/order/reg.aspx @@ -2576,7 +2576,7 @@ mdi-close - + diff --git a/web/admin/print/print_multi_new.aspx b/web/admin/print/print_multi_new.aspx index cf9b22d..c5300ae 100644 --- a/web/admin/print/print_multi_new.aspx +++ b/web/admin/print/print_multi_new.aspx @@ -14,38 +14,16 @@ - - + <%----%> 列印 -
+
<%--
@@ -98,14 +76,20 @@