878 lines
47 KiB
Plaintext
878 lines
47 KiB
Plaintext
<%@ Page Title="後端管理" Language="C#" MasterPageFile="~/admin/Templates/TBS5ADM001/MasterPage.master" AutoEventWireup="true" CodeFile="item_reg.aspx.cs" Inherits="admin_activity_item_reg" ValidateRequest="false" %>
|
||
|
||
<%@ Register Src="~/admin/_uc/alert.ascx" TagPrefix="uc1" TagName="alert" %>
|
||
<asp:Content ID="Content1" ContentPlaceHolderID="page_header" runat="Server">
|
||
</asp:Content>
|
||
<asp:Content ID="Content4" ContentPlaceHolderID="footer_script" runat="Server">
|
||
<link href="../../App_Script/bootstrap_toggle/css/bootstrap-toggle.min.css" rel="stylesheet" />
|
||
<script src="../../App_Script/bootstrap_toggle/js/bootstrap-toggle.min.js"></script>
|
||
<!--編緝器-->
|
||
<script type="text/javascript" src="<%=ResolveUrl("~/admin/ckeditor/ckeditor.js") %>"></script>
|
||
<script type="text/javascript">
|
||
CKEDITOR.config.toolbar = 'Default';
|
||
</script>
|
||
<script>
|
||
var prod_bom_num = <%= prod_bom_num %>;
|
||
</script>
|
||
|
||
<!--編緝器-->
|
||
<script>
|
||
let VueApp = new Vue({
|
||
el: '#app',
|
||
vuetify: new Vuetify(vuetify_options),
|
||
data() {
|
||
return {
|
||
this_id: '<%= Request["num"] %>',
|
||
options: {},
|
||
optionsDetail: {
|
||
multiSort: false,
|
||
itemsPerPage: -1,
|
||
},
|
||
search_dialog: {
|
||
controls: {
|
||
search1: {
|
||
id: 'search1',
|
||
title: '項目分類',
|
||
text_prop: 'kind',
|
||
value_prop: 'num',
|
||
keys: [
|
||
{ id: 'kind', title: '分類名稱' },
|
||
],
|
||
api_url: HTTP_HOST + 'api/actItem_kind/GetList',
|
||
columns: [
|
||
{ id: 'kind', title: '分類名稱' },
|
||
],
|
||
selected: {},
|
||
select(item,t) {
|
||
console.log("select search1", t);
|
||
}
|
||
},
|
||
search2: {
|
||
id: 'search2',
|
||
title: '相關文件',
|
||
text_prop: 'subject',
|
||
value_prop: 'num',
|
||
keys: [
|
||
{ id: 'subject', title: '文件名稱', value: '' },
|
||
],
|
||
api_url: HTTP_HOST + 'api/FilesSet/GetList',
|
||
columns: [
|
||
{ id: 'subject', title: '文件名稱' },
|
||
],
|
||
selected: {},
|
||
select(item,t) {
|
||
console.log("select search2", t);
|
||
|
||
item.files_num_selected.text = t.subject //=====?
|
||
item.files_num_selected.val = t.num //=====?
|
||
}
|
||
},
|
||
search3: {
|
||
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
|
||
}
|
||
// item.bom_editedItem.actItem.subject = t.subject
|
||
// item.bom_editedItem.actItem.num = t.num
|
||
|
||
// item.bom_editedItem.item_num_selected={
|
||
// text : t.subject,
|
||
// val = t.num
|
||
// }
|
||
}
|
||
////新增/修改+關閉時, 會清空/還原
|
||
},
|
||
|
||
},
|
||
show: false,
|
||
current: {},
|
||
list: [],
|
||
count: 0,
|
||
page: 1,
|
||
loading: false,
|
||
footer: {
|
||
showFirstLastPage: true,
|
||
disableItemsPerPage: true,
|
||
itemsPerPageAllText: '',
|
||
itemsPerPageText: '',
|
||
},
|
||
},
|
||
snackbar: {
|
||
show: false,
|
||
text: "",
|
||
},
|
||
//相關文件
|
||
searchDetail: '',
|
||
headersDetail: [
|
||
{ text: '文件名稱', value: 'files_num_selected.text', sortable: false },
|
||
{ text: '', value: 'actions', sortable: false, width: "200px" },
|
||
],
|
||
footersDetail: {
|
||
showFirstLastPage: false,
|
||
disableItemsPerPage: false,
|
||
itemsPerPageAllText: '',
|
||
itemsPerPageText: '',
|
||
'prev-icon': null,
|
||
'next-icon': null,
|
||
'disable-pagination': true,
|
||
'items-per-page-options': []
|
||
},
|
||
desserts: [],
|
||
desserts_count: 0,
|
||
editedIndex: -1,
|
||
editedItem: {
|
||
id: 0,
|
||
num: 0,
|
||
actItem_num: 0,
|
||
files_num_selected: {
|
||
text: '',
|
||
val: 0
|
||
},
|
||
},
|
||
defaultItem: {
|
||
id: 0,
|
||
num: 0,
|
||
actItem_num: 0,
|
||
files_num_selected: {
|
||
text: '',
|
||
val: 0
|
||
},
|
||
},
|
||
//BOM
|
||
prod_bom_num: prod_bom_num,
|
||
bom_searchDetail: '',
|
||
bom_headersDetail: [
|
||
{ text: '品項', value: 'item_num_selected.text', sortable: false },
|
||
{ text: '', value: 'actions', sortable: false, width: "200px" },
|
||
],
|
||
bom_footersDetail: {
|
||
showFirstLastPage: false,
|
||
disableItemsPerPage: false,
|
||
itemsPerPageAllText: '',
|
||
itemsPerPageText: '',
|
||
'prev-icon': null,
|
||
'next-icon': null,
|
||
'disable-pagination': true,
|
||
'items-per-page-options': []
|
||
},
|
||
bom_list: [],
|
||
bom_count: 0,
|
||
bom_editedIndex: -1,
|
||
bom_editedItem: {
|
||
id: 0,
|
||
num: 0,
|
||
package_num: 0,
|
||
//item_num: 0,
|
||
item_num_selected: {
|
||
text: '',
|
||
val: 0
|
||
},
|
||
},
|
||
bom_defaultItem: {
|
||
id: 0,
|
||
num: 0,
|
||
package_num: 0,
|
||
//item_num: 0,
|
||
item_num_selected: {
|
||
text: '',
|
||
val: 0
|
||
},
|
||
},
|
||
}
|
||
},
|
||
mounted() {
|
||
this.search_dialog.current = this.search_dialog.controls.search1
|
||
//console.log("mounted");
|
||
},
|
||
watch: {
|
||
options: {
|
||
handler() {
|
||
//console.log("watch1", this.search_dialog, this.search_dialog.page);
|
||
this.search_get()
|
||
console.log("watch2", this.search_dialog, this.search_dialog.page);
|
||
},
|
||
deep: true,
|
||
},
|
||
optionsDetail: {
|
||
handler() {
|
||
this.initialize();
|
||
},
|
||
deep: true,
|
||
},
|
||
},
|
||
methods: {
|
||
search_show(curr) {
|
||
//console.log("btn_click:", curr, curr.api_url);
|
||
this.search_dialog.current = curr;
|
||
this.search_clear()
|
||
this.search_dialog.show = true;
|
||
},
|
||
search_clear() {
|
||
if (!this.search_dialog.current.keys) return;
|
||
this.search_dialog.current.keys.forEach((t, i) => { t.value = '' })
|
||
this.search_get()
|
||
},
|
||
search_get() {
|
||
if (!this.search_dialog.current.keys) return;
|
||
let api_url = this.search_dialog.current.api_url;
|
||
let keys = this.search_dialog.current.keys;
|
||
this.search_dialog.page = this.options.page ?? 1
|
||
let params = { page: this.search_dialog.page, pageSize: 10 };//url params
|
||
var search = {};//post body
|
||
keys.forEach((t, i) => {
|
||
search[t.id] = t.value;
|
||
});
|
||
//necessary parameter===
|
||
if (this.search_dialog.current.id == 'search1') {
|
||
if (this.this_id=="")
|
||
search['status'] = "Y";//啟用
|
||
}
|
||
console.log("search_get", api_url, search, params, this.options);
|
||
this.search_dialog.loading = true
|
||
axios.post(api_url, search, { params: params })
|
||
.then(response => {
|
||
this.search_dialog.list = response.data.list
|
||
this.search_dialog.count = response.data.count
|
||
this.search_dialog.loading = false
|
||
})
|
||
.catch(error => {
|
||
console.log(error)
|
||
this.search_dialog.list = []
|
||
this.search_dialog.count = 0
|
||
this.search_dialog.loading = false
|
||
this.snackbar.text = "錯誤:" + error
|
||
this.snackbar.show = true
|
||
})
|
||
},
|
||
search_headers() {
|
||
if (!this.search_dialog.current.columns) return;
|
||
r = [];
|
||
this.search_dialog.current.columns.forEach((t, i) => {
|
||
r.push({
|
||
text: t.title,
|
||
align: 'start',
|
||
sortable: false,
|
||
value: t.id,
|
||
})
|
||
})
|
||
return r
|
||
},
|
||
search_select(row) {
|
||
let curr = this.search_dialog.current;
|
||
let target = $(`[data-search-control=${curr.id}]`);
|
||
curr.selected = row;
|
||
var editem = this.editedItem;
|
||
if (curr.id == 'search3') {
|
||
editem = this.bom_editedItem;
|
||
}
|
||
else {
|
||
|
||
}
|
||
console.log("search_select", row, editem);
|
||
//debugger;
|
||
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);
|
||
}
|
||
this.search_dialog.show = false;
|
||
//console.log(row, row["u_name"], row["f_number"], curr.id, target);
|
||
},//文件
|
||
initialize() {
|
||
if (this.this_id != '') {
|
||
const { sortBy, sortDesc, page, itemsPerPage } = this.optionsDetail
|
||
const params = {
|
||
sortBy: sortBy[0], sortDesc: sortDesc[0],
|
||
page: page, pageSize: itemsPerPage,
|
||
};
|
||
//取得相關文件項目
|
||
var searchItemDetail = {
|
||
actItem_num: this.this_id,
|
||
}
|
||
axios
|
||
.post(HTTP_HOST + 'api/activity/GetItemFiles',
|
||
searchItemDetail, { params: params })
|
||
.then(response => {
|
||
this.desserts = response.data.list
|
||
this.desserts_count = response.data.count
|
||
})
|
||
.catch(
|
||
error => console.log(error)
|
||
)
|
||
//取得BOM子項目
|
||
var searchItemBom = {
|
||
item_num: this.this_id,
|
||
}
|
||
axios
|
||
.post(HTTP_HOST + 'api/activity/GetItemBomList',
|
||
searchItemBom, { params: params })
|
||
.then(response => {
|
||
this.bom_list = response.data.list
|
||
this.bom_count = response.data.count
|
||
})
|
||
.catch(
|
||
error => console.log(error)
|
||
)
|
||
}
|
||
|
||
},
|
||
editItem(item) {
|
||
this.editedIndex = this.desserts.indexOf(item);
|
||
this.editedItem = $.extend(true, {}, item);
|
||
},
|
||
deleteItem(item) {
|
||
//confirm('確定要刪除此筆資料嗎?') && this.desserts.splice(index, 1);
|
||
if (confirm('確定要刪除此筆資料嗎?')) {
|
||
const index = this.desserts.indexOf(item);
|
||
if (item.num > 0) {
|
||
if (index != -1) {
|
||
axios
|
||
.delete(HTTP_HOST + 'api/activity/DeleteFilesItem/' + item.num)
|
||
.then(response => {
|
||
console.log("del", item);
|
||
this.desserts.splice(index, 1)
|
||
this.desserts_count = this.desserts_count - 1;
|
||
})
|
||
.catch(error => console.log(error))
|
||
}
|
||
} else {
|
||
this.desserts.splice(index, 1)
|
||
}
|
||
}
|
||
},
|
||
cancel() {
|
||
|
||
this.spliceNullData();
|
||
this.close();
|
||
},
|
||
spliceNullData() {
|
||
|
||
//if new data ,then splice it
|
||
if (this.editedItem.num == 0) {
|
||
|
||
for (var i = 0; i < this.desserts.map(x => x.id).length; i++) {
|
||
if (this.desserts[i].id == this.editedItem.id) {
|
||
this.desserts.splice(i, 1); break;
|
||
}
|
||
}
|
||
}
|
||
},
|
||
close() {
|
||
setTimeout(() => {
|
||
this.editedItem = $.extend(true, {}, this.defaultItem);
|
||
this.editedIndex = -1;
|
||
}, 300)
|
||
},
|
||
addNew() {
|
||
|
||
this.spliceNullData();
|
||
|
||
//addObj.id = this.desserts.length + 1;
|
||
|
||
var keysArr = [];
|
||
for (var i = 0; i < this.desserts.map(x => x.id).length; i++) {
|
||
//console.log(this.desserts[i].id)
|
||
keysArr.push(parseInt(this.desserts[i].id));
|
||
}
|
||
var _c = Math.max.apply(null, keysArr);
|
||
|
||
const addObj = $.extend(true, {}, this.defaultItem);
|
||
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 ) {
|
||
//insert or update data
|
||
var pro_order_detail =
|
||
{
|
||
num: this.editedItem.num,
|
||
actItem_num: this.this_id,
|
||
files_num: this.editedItem.files_num_selected.val,
|
||
}
|
||
axios
|
||
.post(HTTP_HOST + 'api/activity/SaveDetailData', pro_order_detail)
|
||
.then(response => {
|
||
this.editedItem.num = response.data;
|
||
Object.assign(this.desserts[this.editedIndex], this.editedItem)
|
||
this.close()
|
||
})
|
||
.catch(
|
||
error => console.log(error)
|
||
)
|
||
|
||
|
||
} else {
|
||
this.snackbar.text = "必填項目未填寫完整";
|
||
this.snackbar.show = true
|
||
}
|
||
} else {
|
||
this.snackbar.text = "單號錯誤";
|
||
this.snackbar.show = true
|
||
}
|
||
|
||
}
|
||
},
|
||
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){
|
||
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){
|
||
confirm('確定要刪除此筆資料嗎?') && this.bom_list.splice(index, 1);
|
||
},
|
||
bom_cancel(){
|
||
this.bom_spliceNullData();
|
||
this.bom_close();
|
||
},
|
||
bom_spliceNullData() {
|
||
//if new data ,then splice it
|
||
if (this.bom_list.num == 0) {
|
||
for (var i = 0; i < this.bom_list.map(x => x.id).length; i++) {
|
||
if (this.bom_list[i].id == this.bom_list.id) {
|
||
this.bom_list.splice(i, 1); break;
|
||
}
|
||
}
|
||
}
|
||
},
|
||
bom_close() {
|
||
setTimeout(() => {
|
||
this.bom_editedItem = $.extend(true, {}, this.bom_defaultItem);
|
||
this.bom_editedItem = -1;
|
||
}, 300)
|
||
},
|
||
bom_addNew(){
|
||
this.spliceNullData();
|
||
|
||
//addObj.id = this.desserts.length + 1;
|
||
|
||
var keysArr = [];
|
||
for (var i = 0; i < this.desserts.map(x => x.id).length; i++) {
|
||
//console.log(this.desserts[i].id)
|
||
keysArr.push(parseInt(this.desserts[i].id));
|
||
}
|
||
var _c = Math.max.apply(null, keysArr);
|
||
|
||
const addObj = $.extend(true, {}, this.bom_defaultItem);
|
||
addObj.id = (isFinite(_c) ? _c : 0) + 1;
|
||
addObj.package_num = this.prod_bom_num; ////取得主項目的package_num
|
||
addObj.actItem = { subject: '', num: 0 };
|
||
if (!!this.bom_list) this.bom_list?.unshift(addObj);
|
||
this.bom_editItem(addObj);
|
||
},
|
||
bom_save(){
|
||
if (this.bom_editedIndex > -1) {
|
||
if (this.this_id != '') {
|
||
//chcck necessary params
|
||
if (this.bom_editedItem.item_num_selected.val != 0 ) {
|
||
//insert or update data
|
||
var package_num = $(".packageNum input[type=hidden]").val();
|
||
var bom_detail =
|
||
{
|
||
num: this.bom_editedItem.num,
|
||
package_num: package_num,
|
||
item_num: this.bom_editedItem.actItem.num,
|
||
|
||
};
|
||
axios
|
||
.post(HTTP_HOST + 'api/activity/SaveDetailBomList', bom_detail)
|
||
.then(response => {
|
||
this.bom_editedItem.num = response.data;
|
||
Object.assign(this.bom_list[this.bom_editedIndex], this.bom_editedItem)
|
||
this.bom_close();
|
||
})
|
||
.catch(
|
||
error => console.log(error)
|
||
)
|
||
} else {
|
||
this.snackbar.text = "必填項目未填寫完整";
|
||
this.snackbar.show = true
|
||
}
|
||
} else {
|
||
this.snackbar.text = "單號錯誤";
|
||
this.snackbar.show = true
|
||
}
|
||
}
|
||
},
|
||
},
|
||
computed: {
|
||
},
|
||
|
||
})
|
||
$(document).ready(function () {
|
||
setCss();
|
||
Sys.WebForms.PageRequestManager.getInstance().add_endRequest(EndRequestHandler);
|
||
});
|
||
|
||
function EndRequestHandler(sender, args) {
|
||
setCss();
|
||
}
|
||
function setCss() {
|
||
$(".cyclePanel input").addClass("form-check-input");
|
||
}
|
||
|
||
|
||
</script>
|
||
</asp:Content>
|
||
<asp:Content ID="Content3" ContentPlaceHolderID="page_nav" runat="Server">
|
||
<div class="scroll-nav nav nav-tabs mb-2 mb-sm-0 d-none d-sm-flex">
|
||
<template v-if="this_id !='' "> {{titleword()}} </template>
|
||
</div>
|
||
<div class="">
|
||
<asp:Button ID="add" runat="server" Text="送出" OnClick="add_Click" CssClass="btn btn-primary" />
|
||
<asp:Button ID="edit" runat="server" Text="修改" Visible="false" OnClick="edit_Click" CssClass="btn btn-primary" />
|
||
<asp:Button ID="goback" runat="server" Text="回列表" Visible="false" CausesValidation="false" OnClick="goback_Click" CssClass="btn btn-outline-secondary" />
|
||
</div>
|
||
</asp:Content>
|
||
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
|
||
<uc1:alert runat="server" ID="L_msg" Text="" />
|
||
<div id="content" class="container-fluid">
|
||
|
||
<div class="card shadow-sm my-2" id="sec2">
|
||
<div class="card-header py-0">
|
||
<nav class="navbar py-0">
|
||
<div class="nav nav-tabs">
|
||
<button class="nav-link active" id="sec2-tab1" data-bs-toggle="tab" data-bs-target="#sec2-page1"
|
||
type="button" role="tab" aria-controls="home" aria-selected="true">
|
||
基本資料</button>
|
||
<button class="nav-link" id="sec2-tab2" data-bs-toggle="tab" data-bs-target="#sec2-page2"
|
||
type="button" role="tab" aria-controls="profile" aria-selected="false">
|
||
相關文件</button>
|
||
<button class="nav-link" id="sec2-tab3" data-bs-toggle="tab" data-bs-target="#sec2-page3"
|
||
type="button" role="tab" aria-controls="bom" aria-selected="false">
|
||
功德項目</button>
|
||
</div>
|
||
</nav>
|
||
</div>
|
||
<div class="card-body">
|
||
<div class="tab-content" id="myTabContent">
|
||
<div class="tab-pane fade show active " id="sec2-page1" role="tabpanel" aria-labelledby="sec2-tab1">
|
||
<div>
|
||
<div class="form-text text-muted">以下 * 欄位為必填欄位</div>
|
||
</div>
|
||
<div class="row mb-1 label-sm-right">
|
||
<label class="col-sm-2 col-form-label">項目類別 *</label>
|
||
<div class="col-sm-4">
|
||
<asp:DropDownList ID="category" runat="server" CssClass="form-select">
|
||
<asp:ListItem Value="">請選擇</asp:ListItem>
|
||
</asp:DropDownList>
|
||
<asp:RequiredFieldValidator ID="RequiredFieldValidator3" ControlToValidate="category" runat="server" ErrorMessage="必填!" Display="Dynamic" SetFocusOnError="true"></asp:RequiredFieldValidator>
|
||
</div>
|
||
<label class="col-sm-2 col-form-label">項目分類 *</label>
|
||
<div class="col-sm-4">
|
||
<div class="input-group mb-3" data-search-control="search1" @click=" search_show(search_dialog.controls.search1)">
|
||
<input class="form-control search-text" type="text" readonly
|
||
id="kind_txt" runat="server" placeholder="請選擇" value="">
|
||
<asp:HiddenField ID="kind" runat="server" Value="" />
|
||
<button class="btn btn-outline-secondary" type="button">
|
||
<i class="mdi mdi-view-list-outline"></i>
|
||
</button>
|
||
</div>
|
||
<asp:RequiredFieldValidator ID="RequiredFieldValidator2" ControlToValidate="kind_txt" runat="server" ErrorMessage="必填!" Display="Dynamic" SetFocusOnError="true"></asp:RequiredFieldValidator>
|
||
|
||
</div>
|
||
</div>
|
||
<div class="row mb-1 label-sm-right">
|
||
<label class="col-sm-2 col-form-label">料號</label>
|
||
<div class="col-sm-4">
|
||
<asp:TextBox ID="PARTNO" MaxLength="100" runat="server" CssClass="form-control" placeholder="請輸入料號"></asp:TextBox>
|
||
</div>
|
||
<label class="col-sm-2 col-form-label">項目名稱 *</label>
|
||
<div class="col-sm-4">
|
||
<asp:TextBox ID="subject" MaxLength="100" runat="server" CssClass="form-control" placeholder="請輸入品項名稱"></asp:TextBox>
|
||
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" ControlToValidate="subject" runat="server" ErrorMessage="必填!" Display="Dynamic" SetFocusOnError="true"></asp:RequiredFieldValidator>
|
||
</div>
|
||
</div>
|
||
<div class="row mb-1 label-sm-right">
|
||
<label class="col-sm-2 col-form-label">牌位編號開頭</label>
|
||
<div class="col-sm-4">
|
||
<asp:TextBox ID="print_init" MaxLength="20" runat="server" CssClass="form-control" placeholder="請輸入牌位編號開頭"></asp:TextBox>
|
||
</div>
|
||
<label class="col-sm-2 col-form-label">預設金額</label>
|
||
<div class="col-sm-4">
|
||
<asp:TextBox ID="price" MaxLength="7" runat="server" CssClass="form-control" placeholder="請輸入預設金額"></asp:TextBox>
|
||
<asp:RegularExpressionValidator ControlToValidate="price" Display="Dynamic" SetFocusOnError="true" ErrorMessage="只能輸入數字" ID="RegularExpressionValidator3" runat="server" ValidationExpression="^(-?\d+)(\.\d+)?$" />
|
||
</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>
|
||
<div class="col-sm-4">
|
||
<asp:CheckBox ID="extend" runat="server" CssClass="cyclePanel" AutoPostBack="true" OnCheckedChanged="CheckBox1_CheckedChanged" />
|
||
<label class="form-check-label me-2" for='<%= extend.ClientID %>'>
|
||
應延續
|
||
</label>
|
||
<asp:CheckBox ID="is_reconcile_item" runat="server" CssClass="cyclePanel" />
|
||
<label class="form-check-label me-2" for='<%= is_reconcile_item.ClientID %>'>
|
||
核銷項目
|
||
</label>
|
||
</div>
|
||
<asp:PlaceHolder ID="cyclePlaceHolder" runat="server" Visible="false">
|
||
<label class="col-sm-2 col-form-label">收費週期 *</label>
|
||
<div class="col-sm-4">
|
||
<div class="input-group">
|
||
<asp:TextBox ID="cycle" MaxLength="3" runat="server" CssClass="form-control"></asp:TextBox>
|
||
<span class="input-group-text">月</span>
|
||
<asp:RegularExpressionValidator ControlToValidate="cycle" Display="Dynamic" SetFocusOnError="true" ErrorMessage="只能輸入數字" ID="RegularExpressionValidator1" runat="server" ValidationExpression="^(-?\d+)(\.\d+)?$" />
|
||
<asp:RequiredFieldValidator ID="RequiredFieldValidator4" ControlToValidate="cycle" runat="server" ErrorMessage="必填!" Display="Dynamic" SetFocusOnError="true"></asp:RequiredFieldValidator>
|
||
|
||
</div>
|
||
</div>
|
||
</asp:PlaceHolder>
|
||
</ContentTemplate>
|
||
</asp:UpdatePanel>
|
||
<div class="row mb-1 label-sm-right">
|
||
<label class="col-sm-2 col-form-label">備註</label>
|
||
<div class="col-sm-10">
|
||
<asp:TextBox ID="demo" runat="server" CssClass="ckeditor" TextMode="MultiLine"></asp:TextBox>
|
||
</div>
|
||
</div>
|
||
<div class="row mb-1 label-sm-right">
|
||
<label class="col-sm-2 col-form-label">自定義欄位預設值</label>
|
||
<div class="col-sm-10">
|
||
<asp:TextBox ID="customize_data" runat="server" Rows="3" TextMode="MultiLine" CssClass="form-control" placeholder="一行輸入一個定義欄位預設值,如: $品名:醬油 $金額:100" ToolTip="一行輸入一個定義欄位預設值,格式: $變數名稱:值"></asp:TextBox>
|
||
</div>
|
||
</div>
|
||
|
||
<div class="row mb-1 label-sm-right">
|
||
<label class="col-sm-2 col-form-label">狀態 *</label>
|
||
<div class="col-sm-2">
|
||
<label class="col-form-control">
|
||
<input type="checkbox" id="status" runat="server"
|
||
data-toggle="toggle" data-on="啟用" data-off="停用" data-onstyle="success" />
|
||
</label>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div class="tab-pane fade giftItems label-sm-right" id="sec2-page2" role="tabpanel" aria-labelledby="sec2-tab2">
|
||
<v-card class="mx-auto mt-10" outlined v-if="this_id!=''">
|
||
<v-data-table
|
||
:headers="headersDetail"
|
||
:items="desserts"
|
||
:footer-props="footersDetail"
|
||
:search="searchDetail"
|
||
:options.sync="optionsDetail" class="elevation-1" fixed-header height="350px"
|
||
<%-- :server-items-length="desserts_count"--%>
|
||
>
|
||
<v-divider inset></v-divider>
|
||
<template v-slot:top>
|
||
<v-toolbar flat color="white">
|
||
<div class="d-flex w-100">
|
||
<v-text-field v-model="searchDetail" append-icon="mdi-magnify" label="查詢" dense outlined single-line hide-details></v-text-field>
|
||
<v-btn
|
||
color="primary"
|
||
class="ml-2 white--text"
|
||
@click="addNew">
|
||
<v-icon dark>mdi-plus</v-icon>新增
|
||
</v-btn>
|
||
</div>
|
||
</v-toolbar>
|
||
</template>
|
||
<template v-slot:item.files_num_selected.text="{ item }">
|
||
<div class="input-group mb-3" data-search-control="search2"
|
||
@click="search_show(search_dialog.controls.search2)"
|
||
v-if="item.id === editedItem.id">
|
||
<input class="form-control search-text" type="text" readonly
|
||
placeholder="文件名稱" v-model="editedItem.files_num_selected.text" >
|
||
<input type="hidden" v-model="editedItem.files_num_selected.val">
|
||
<button class="btn btn-outline-secondary" type="button">
|
||
<i class="mdi mdi-view-list-outline"></i>
|
||
</button>
|
||
</div>
|
||
<span v-else>{{item.files_num_selected.text}}</span>
|
||
<span v-if="item.num==0" class="text-danger">(預設資料,未存檔)</span>
|
||
</template>
|
||
<template v-slot:item.actions="{ item }">
|
||
<div v-if="item.id === editedItem.id">
|
||
<v-icon color="red" class="mr-3" @click="cancel">
|
||
mdi-window-close
|
||
</v-icon>
|
||
<v-icon color="green" @click="save">
|
||
mdi-content-save
|
||
</v-icon>
|
||
</div>
|
||
<div v-else>
|
||
<v-icon color="green" class="mr-3" @click="editItem(item);">
|
||
mdi-pencil
|
||
</v-icon>
|
||
<v-icon color="red" @click="deleteItem(item)">
|
||
mdi-delete
|
||
</v-icon>
|
||
</div>
|
||
</template>
|
||
</v-data-table>
|
||
</v-card>
|
||
<div class="mx-auto" v-else >
|
||
<p class="lead">請先儲存基本資料後再新增相關文件</p>
|
||
</div>
|
||
</div>
|
||
<div class="tab-pane fade giftItems label-sm-right" id="sec2-page3" role="tabpanel" aria-labelledby="sec2-tab3">
|
||
<asp:Panel ID="bom_panel" runat="server">
|
||
<div class="row mb-1">
|
||
<label class="col-sm-2 col-form-label">牌位數量</label>
|
||
<div class="col-sm-6">
|
||
<asp:TextBox CssClass="form-control" ID="bom_qty" runat="server"></asp:TextBox>
|
||
</div>
|
||
<div class="col-md-4">
|
||
<asp:button class="btn btn-primary" id="setBom" runat="server"
|
||
Text="設定子項目" OnClick="setBom_Click" Visible="true"></asp:button>
|
||
<asp:button class="btn btn-primary" id="saveBom" runat="server"
|
||
Text="儲存子項目" OnClick="saveBom_Click" Visible="true"></asp:button>
|
||
</div>
|
||
<div class="packageNum">
|
||
<asp:HiddenField ID="packageNum" 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-10">
|
||
<asp:TextBox ID="bom_memo" runat="server" Rows="3" TextMode="MultiLine" CssClass="form-control" placeholder="輸入備註" ToolTip=""></asp:TextBox>
|
||
</div>
|
||
</div>
|
||
<v-card class="mx-auto mt-10" outlined v-if="this_id!=''">
|
||
<v-data-table class="elevation-1" fixed-header height="350px"
|
||
:headers="bom_headersDetail"
|
||
:items="bom_list"
|
||
:footer-props="bom_footersDetail"
|
||
:search="bom_searchDetail"
|
||
:options.sync="optionsDetail"
|
||
<%-- :server-items-length="desserts_count"--%>
|
||
>
|
||
<v-divider inset></v-divider>
|
||
<template v-slot:top>
|
||
<v-toolbar flat color="white">
|
||
<div class="d-flex w-100">
|
||
<v-text-field v-model="bom_searchDetail" append-icon="mdi-magnify" label="查詢" dense outlined single-line hide-details></v-text-field>
|
||
<v-btn
|
||
color="primary"
|
||
class="ml-2 white--text"
|
||
@click="bom_addNew">
|
||
<v-icon dark>mdi-plus</v-icon>新增
|
||
</v-btn>
|
||
</div>
|
||
</v-toolbar>
|
||
</template>
|
||
<template v-slot:item.item_num_selected.text="{ item }">
|
||
<div class="input-group my-3" data-search-control="search3"
|
||
@click="search_show(search_dialog.controls.search3)"
|
||
v-if="item.num === bom_editedItem.num">
|
||
<input class="form-control search-text" type="text" readonly
|
||
placeholder="名稱" v-model="bom_editedItem.actItem.subject" >
|
||
<input type="hidden" v-model="bom_editedItem.actItem.num">
|
||
<button class="btn btn-outline-secondary" type="button">
|
||
<i class="mdi mdi-view-list-outline"></i>
|
||
</button>
|
||
</div>
|
||
<span v-else>{{item.actItem.subject}}</span>
|
||
<span v-if="item.num==0" class="text-danger">(預設資料,未存檔)</span>
|
||
</template>
|
||
<template v-slot:item.actions="{ item }">
|
||
<div v-if="item.num === bom_editedItem.num">
|
||
<v-icon color="red" class="mr-3" @click="bom_cancel">
|
||
mdi-window-close
|
||
</v-icon>
|
||
<v-icon color="green" @click="bom_save">
|
||
mdi-content-save
|
||
</v-icon>
|
||
</div>
|
||
<div v-else>
|
||
<v-icon color="green" class="mr-3" @click="bom_editItem(item);">
|
||
mdi-pencil
|
||
</v-icon>
|
||
<v-icon color="red" @click="bom_deleteItem(item)">
|
||
mdi-delete
|
||
</v-icon>
|
||
</div>
|
||
</template>
|
||
</v-data-table>
|
||
</v-card>
|
||
<div class="mx-auto" v-else >
|
||
<p class="lead">請先儲存基本資料後再新增相關文件</p>
|
||
</div>
|
||
</asp:Panel>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<v-dialog v-model="search_dialog.show" max-width="500px">
|
||
<v-card>
|
||
<v-card-title class="justify-space-between grey lighten-2">
|
||
查詢:{{search_dialog.current.title}}
|
||
<v-btn icon @click="search_dialog.show=false"><v-icon>mdi-close</v-icon></v-btn>
|
||
</v-card-title>
|
||
<v-card-text >
|
||
<v-row>
|
||
<v-col v-for="item in search_dialog.current.keys"
|
||
:cols="search_dialog.current.keys.length>1?6:12" >
|
||
<v-text-field v-model="item.value" :label="item.title" v-if="item.visible===undefined || item.visible==true "></v-text-field>
|
||
</v-col>
|
||
<v-col cols="12" class="text-end">
|
||
<v-btn color="primary" elevation="0" @click="search_get()">查詢</v-btn>
|
||
<v-btn elevation="0" @click="search_clear()">清除條件</v-btn>
|
||
</v-col>
|
||
</v-row>
|
||
<v-data-table
|
||
:headers="search_headers()"
|
||
:items="search_dialog.list"
|
||
:footer-props="search_dialog.footer"
|
||
:items-per-page="10"
|
||
:server-items-length="search_dialog.count"
|
||
:page.sync="search_dialog.page"
|
||
:options.sync="options"
|
||
@click:row="search_select"
|
||
></v-data-table>
|
||
</v-card-text>
|
||
<v-card-actions>
|
||
</v-card-actions>
|
||
</v-card>
|
||
</v-dialog>
|
||
<v-snackbar
|
||
v-model="snackbar.show"
|
||
timeout="2000"
|
||
>
|
||
{{ snackbar.text }}
|
||
<template v-slot:action="{ attrs }">
|
||
<v-btn
|
||
text
|
||
v-bind="attrs"
|
||
@click="snackbar.show = false"
|
||
>
|
||
關閉
|
||
</v-btn>
|
||
</template>
|
||
</v-snackbar>
|
||
</div>
|
||
</asp:Content>
|
||
|