牌位排版

This commit is contained in:
2026-04-06 19:06:22 +08:00
parent f087e4aa61
commit 36174834a8
5 changed files with 533 additions and 245 deletions
+116 -105
View File
@@ -24,7 +24,7 @@
return {
this_id: '<%= Request["num"] %>',
paperlist: [],
stylelist:[],
stylelist: [],
options: {},
optionsDetail: {
multiSort: false,
@@ -45,7 +45,7 @@
{ id: 'kind', title: '分類名稱' },
],
selected: {},
select(item,t) {
select(item, t) {
console.log("select search1", t);
}
},
@@ -62,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 //=====?
@@ -73,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
@@ -100,11 +100,11 @@
// text : t.subject,
// val = t.num
// }
}
////新增/修改+關閉時, 會清空/還原
}
////新增/修改+關閉時, 會清空/還原
},
},
},
show: false,
current: {},
list: [],
@@ -144,7 +144,7 @@
editedItem: {
id: 0,
num: 0,
actItem_num: 0,
actItem_num: 0,
files_num_selected: {
text: '',
val: 0
@@ -177,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: '',
@@ -192,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() {
@@ -245,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
@@ -294,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);
@@ -311,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
@@ -325,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
@@ -333,48 +333,53 @@
})
.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(`<option value="${x.paperID}">${x.paperName}</option>`);
$("#printSize").append(`<option value="${x.paperID}">${x.paperName}</option>`);
});
}
}
})
.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(`<option value="${x.styleID}">${x.name}</option>`);
}
});
}
}
})
.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 })
$('#<%= 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);
@@ -401,7 +406,7 @@
}
},
cancel() {
this.spliceNullData();
this.close();
},
@@ -424,7 +429,7 @@
}, 300)
},
addNew() {
this.spliceNullData();
//addObj.id = this.desserts.length + 1;
@@ -440,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 =
{
@@ -475,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
@@ -513,7 +518,7 @@
this.bom_editedItem = -1;
}, 300)
},
bom_addNew(){
bom_addNew() {
this.spliceNullData();
//addObj.id = this.desserts.length + 1;
@@ -532,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,
@@ -566,13 +571,13 @@
}
}
},
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();
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())
}
}
},
@@ -591,8 +596,8 @@
function setCss() {
$(".cyclePanel input").addClass("form-check-input");
}
</script>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="page_nav" runat="Server">
@@ -678,28 +683,34 @@
<div class="row mb-1 label-sm-right">
<label class="col-sm-2 col-form-label">預設頁面尺寸</label>
<div class="col-sm-4">
<select id="pageSize" onchange="VueApp.selectChange('pageSize')">
<select ID="ddlPageSize" runat="server" onchange="VueApp.changeSel('ddlPageSize')"></select>
<asp:HiddenField ID="hidPageSize" runat="server" />
<%-- <select id="pageSize" onchange="VueApp.selectChange('pageSize')">
<option value="">請選擇</option>
</select>
<asp:HiddenField ID="pageSizeSel" runat="server" Value="" />
<asp:HiddenField ID="pageSizeSel" runat="server" Value="" />--%>
<%--<asp:DropDownList ID="pageSize" runat="server"></asp:DropDownList> --%>
</div>
<label class="col-sm-2 col-form-label">預設列印尺寸</label>
<div class="col-sm-4">
<select id="printSize" onchange="VueApp.selectChange('printSize')">
<select ID="ddlPrintSize" runat="server" onchange="VueApp.changeSel('ddlPrintSize')"></select>
<asp:HiddenField ID="hidPrintSize" runat="server" />
<%-- <select id="printSize" onchange="VueApp.selectChange('printSize')">
<option value="">請選擇</option>
</select>
<asp:HiddenField ID="printSizeSel" runat="server" Value="" />
<asp:HiddenField ID="printSizeSel" runat="server" Value="" />--%>
<%-- <asp:DropDownList ID="printSize" runat="server"></asp:DropDownList> --%>
</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="defaultStyle" onchange="VueApp.selectChange('defaultStyle')">
<select ID="ddlDefaultStyle" runat="server" onchange="VueApp.changeSel('ddlDefaultStyle')"></select>
<asp:HiddenField ID="hidDefaultStyle" runat="server" />
<%-- <select id="defaultStyle" onchange="VueApp.selectChange('defaultStyle')">
<option value="">請選擇</option>
</select>
<asp:HiddenField ID="defaultStyleSel" runat="server" Value="" />
<asp:HiddenField ID="defaultStyleSel" runat="server" Value="" />--%>
<%--<asp:DropDownList ID="pageSize" runat="server"></asp:DropDownList> --%>
</div>