1262 lines
68 KiB
Plaintext
1262 lines
68 KiB
Plaintext
<%@ Page Title="後端管理" Language="C#" MasterPageFile="~/admin/Templates/TBS5ADM001/MasterPage.master" AutoEventWireup="true" CodeFile="reg.aspx.cs" Inherits="admin_activity_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">
|
||
<script>
|
||
function chagenDate(btn) {
|
||
var _date = $(btn).val();
|
||
if (_date != "") {
|
||
$.ajax({
|
||
method: "POST",
|
||
url: "../follower/reg.aspx",
|
||
data: {
|
||
type: 'getTxt',
|
||
date: _date
|
||
},
|
||
error: function (xhr, status, error) {
|
||
var errorMessage = xhr.status + ': ' + xhr.statusText
|
||
//alert('Error - ' + errorMessage);
|
||
console.log('Error - ' + errorMessage);
|
||
}
|
||
}).done(function (data) {
|
||
if (data.isOk) {
|
||
$(btn).parents('.row.label-sm-right').find('.lunar').text(data.cDate);
|
||
} else {
|
||
console.log(data.msg);
|
||
}
|
||
});
|
||
}
|
||
console.log(_date);
|
||
}
|
||
|
||
let VueApp = new Vue({
|
||
el: '#app',
|
||
vuetify: new Vuetify(vuetify_options),
|
||
data() {
|
||
return {
|
||
this_id: '<%= Request["num"] %>',
|
||
this_category_kindTxt: '<%= _category_kindTxt %>',
|
||
options: {},
|
||
optionsList: { multiSort: false, itemsPerPage: -1 },
|
||
optionsDetail: { multiSort: false, itemsPerPage: -1 },
|
||
optionsSpares: { multiSort: false },
|
||
search_dialog: {
|
||
controls: {
|
||
search1: {
|
||
id: 'search1',
|
||
title: '活動分類',
|
||
text_prop: 'kind',
|
||
value_prop: 'num',
|
||
keys: [
|
||
{ id: 'kind', title: '分類名稱' },
|
||
],
|
||
api_url: HTTP_HOST + 'api/activity/GetKindList',
|
||
columns: [
|
||
{ id: 'kind', title: '分類名稱' },
|
||
],
|
||
selected: {},
|
||
select(item,t) {
|
||
console.log("select search1", t);
|
||
//帶入預設日期
|
||
axios
|
||
.get(HTTP_HOST + 'api/activity/GetKindDate/' + t.num )
|
||
.then(response => {
|
||
console.log(response.data.startDate_solar);
|
||
$('#<%= startDate_solar.ClientID%>').val(response.data.startDate_solar);
|
||
$('#<%= endDate_solar.ClientID%>').val(response.data.endDate_solar);
|
||
$('#<%= startDate_lunar.ClientID%>').val(response.data.startDate_lunar);
|
||
$('#<%= endDate_lunar.ClientID%>').val(response.data.endDate_lunar);
|
||
|
||
})
|
||
.catch(
|
||
error => console.log(error)
|
||
)
|
||
}
|
||
},
|
||
search2: {
|
||
id: 'search2',
|
||
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 search2", t);
|
||
|
||
item.act_item_selected.text = t.subject
|
||
item.act_item_selected.val = t.num
|
||
item.price = t.price
|
||
item.qty = t.qty
|
||
}
|
||
},
|
||
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", t);
|
||
|
||
item.act_item_selected.text = t.subject
|
||
item.act_item_selected.val = t.num
|
||
|
||
}
|
||
},
|
||
search4: {
|
||
id: 'search4',
|
||
title: '活動類型',
|
||
text_prop: 'kind',
|
||
value_prop: 'num',
|
||
keys: [
|
||
{ id: 'kind', title: '類型名稱', value: '' },
|
||
],
|
||
api_url: HTTP_HOST + 'api/activity/GetCategoryKindList',
|
||
columns: [
|
||
{ id: 'kind', title: '類型名稱', value: '' },
|
||
],
|
||
selected: {},
|
||
select(item, t) {
|
||
console.log("select search4", t);
|
||
|
||
}
|
||
},
|
||
},
|
||
|
||
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: 'act_item_selected.text', sortable: false },
|
||
{ text: '預設金額', value: 'price', sortable: false },
|
||
{ text: '數量', value: 'qty', 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,
|
||
activity_num: 0,
|
||
act_item_selected: {
|
||
text: '',
|
||
val: 0
|
||
},
|
||
price: 0,
|
||
qty: 0,
|
||
files: [],
|
||
},
|
||
defaultItem: {
|
||
id: 0,
|
||
num: 0,
|
||
activity_num: 0,
|
||
act_item_selected: {
|
||
text: '',
|
||
val: 0
|
||
},
|
||
price: 0,
|
||
qty: 0,
|
||
files: [],
|
||
},
|
||
//列印
|
||
data_table: {
|
||
selected: [],
|
||
editFilesItem: [],
|
||
headersFilesList: [
|
||
{ text: '訂單編號', value: 'order_no', sortable: false },
|
||
{ text: '牌位編號', value: 'print_id', sortable: false },
|
||
//{ text: '信眾姓名', value: 'from_id', sortable: false },
|
||
{ text: '已列印', value: 'isprinted', sortable: false },
|
||
],
|
||
singleSelect: false,
|
||
searchList: '',
|
||
},
|
||
thisFilesSelected: {
|
||
text: '',
|
||
val: 0,
|
||
},
|
||
thisItemSelected: {
|
||
text: '',
|
||
val: 0,
|
||
},
|
||
printfiles:[],
|
||
//備品項目
|
||
searchSpares: '',
|
||
headersSpares: [//項目名稱
|
||
{ text: '* 品項名稱', value: 'act', sortable: false },
|
||
{ text: '總數量', value: 'totalqty', sortable: false },
|
||
{ text: '備註', value: 'demo', sortable: false },
|
||
{ text: '', value: 'actions', sortable: false, width: "200px" },
|
||
],
|
||
sparesItems: [],
|
||
sparesItems_count:0,
|
||
modifyIndex: -1,
|
||
modifyItem: {
|
||
id: 0,
|
||
num: 0,
|
||
activity_num: 0,
|
||
act_item_selected: {
|
||
text: '',
|
||
val: 0
|
||
},
|
||
totalqty: 0,
|
||
demo: '',
|
||
},
|
||
simpleItem: {
|
||
id: 0,
|
||
num: 0,
|
||
activity_num: 0,
|
||
act_item_selected: {
|
||
text: '',
|
||
val: 0
|
||
},
|
||
totalqty: 0,
|
||
demo: '',
|
||
},
|
||
//列印文件
|
||
file_dialog: {
|
||
show: false,
|
||
},
|
||
//報名名單
|
||
order_dialog: {
|
||
show: false,
|
||
},
|
||
}
|
||
},
|
||
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,
|
||
},
|
||
optionsSpares: {
|
||
handler() {
|
||
this.initspares();
|
||
},
|
||
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 == 'search2') {
|
||
search['categorys'] = "1,2,4";//報名,掛單,贊助
|
||
}
|
||
if (this.search_dialog.current.id == 'search3') {
|
||
search['category'] = "3";//備品
|
||
}
|
||
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;
|
||
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) {
|
||
if (this.modifyIndex >-1)
|
||
curr.select(this.modifyItem, row);
|
||
else
|
||
curr.select(this.editedItem, row);
|
||
}
|
||
this.search_dialog.show = false;
|
||
//console.log(row, row["u_name"], row["f_number"], curr.id, target);
|
||
},//相關項目
|
||
initialize() {
|
||
if (this.this_id != '') {
|
||
/*if (this.optionsDetail.itemsPerPage == -1) { this.optionsDetail.itemsPerPage = this.desserts.length; }*/
|
||
const { sortBy, sortDesc, page, itemsPerPage } = this.optionsDetail
|
||
const params = {
|
||
sortBy: sortBy[0], sortDesc: sortDesc[0],
|
||
page: page,
|
||
//pageSize: itemsPerPage == -1 ? this.desserts.length : itemsPerPage,
|
||
//pageSize: itemsPerPage
|
||
pageSize: -1
|
||
};
|
||
var searchItemDetail = {
|
||
num: this.this_id,
|
||
}
|
||
axios
|
||
.post(HTTP_HOST + 'api/activity/GetActRelaList', searchItemDetail, { params: params })
|
||
.then(response => {
|
||
this.desserts = response.data.list
|
||
this.desserts_count = response.data.count
|
||
})
|
||
.catch(
|
||
error => console.log(error)
|
||
)
|
||
}
|
||
|
||
},
|
||
editItem(item, isSpares=false) {
|
||
if (isSpares) {
|
||
this.modifyIndex = this.sparesItems.indexOf(item);
|
||
//this.modifyItem = Object.assign({}, item);
|
||
this.modifyItem = $.extend(true, {}, item);
|
||
} else {
|
||
this.editedIndex = this.desserts.indexOf(item);
|
||
//this.editedItem = Object.assign({}, 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/DeleteRelatingData/' + 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 = Object.assign({}, this.defaultItem);
|
||
this.editedItem = $.extend(true, {}, this.defaultItem);
|
||
|
||
this.editedIndex = -1;
|
||
}, 300)
|
||
},
|
||
addNew() {
|
||
this.spliceNullData();
|
||
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 = Object.assign({}, this.defaultItem);
|
||
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.act_item_selected.val != 0 ) {
|
||
//insert or update data
|
||
var pro_order_detail =
|
||
{
|
||
num: this.editedItem.num,
|
||
activity_num: this.this_id,
|
||
actItem_num: this.editedItem.act_item_selected.val,
|
||
price: this.editedItem.price,
|
||
qty: this.editedItem.qty,
|
||
}
|
||
axios
|
||
.post(HTTP_HOST + 'api/activity/SaveRelatingData', 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
|
||
}
|
||
|
||
}
|
||
},
|
||
//列印
|
||
printItem(item) {
|
||
//this.editedIndex = this.desserts.indexOf(item);
|
||
//this.editedItem = $.extend(true, {}, item);
|
||
this.thisItemSelected.text = item.act_item_selected.text;
|
||
this.thisItemSelected.val = item.act_item_selected.val;
|
||
this.printfiles = item.files;
|
||
this.file_dialog.show = true;
|
||
},
|
||
//匯出EXCEL
|
||
exportExcel(item) {
|
||
//this.editedIndex = this.desserts.indexOf(item);
|
||
//this.editedItem = $.extend(true, {}, item);
|
||
this.thisItemSelected.text = item.act_item_selected.text;
|
||
this.thisItemSelected.val = item.act_item_selected.val;
|
||
this.printfiles = item.files;
|
||
if (this.printfiles.length>0) {
|
||
//console.log([this.printfiles[0].subject, this.printfiles[0].list]);
|
||
var subject = this.printfiles[0].subject;
|
||
var list = [];
|
||
list = this.printfiles[0].list.map(x => x.num);
|
||
if (list.length>0) {
|
||
_url = HTTP_HOST + 'admin/print/exportExcel.aspx';
|
||
//axios.post(_url, params)
|
||
// .then(response => {
|
||
// console.log('success');
|
||
// })
|
||
// .catch(error => {
|
||
// console.log(error)
|
||
|
||
// })
|
||
|
||
var form = document.createElement("form");
|
||
form.setAttribute("method", "POST");
|
||
form.setAttribute("target", "_blank");
|
||
form.setAttribute("action", _url);
|
||
|
||
var hiddenField = document.createElement("input");
|
||
hiddenField.setAttribute("type", "hidden");
|
||
hiddenField.setAttribute("name", "item");
|
||
hiddenField.setAttribute("value", this.thisItemSelected.val);
|
||
form.appendChild(hiddenField);
|
||
|
||
var hiddenField2 = document.createElement("input");
|
||
hiddenField2.setAttribute("type", "hidden");
|
||
hiddenField2.setAttribute("name", "file");
|
||
hiddenField2.setAttribute("value", this.thisFilesSelected.val);
|
||
form.appendChild(hiddenField2);
|
||
|
||
var hiddenField3 = document.createElement("input");
|
||
hiddenField3.setAttribute("type", "hidden");
|
||
hiddenField3.setAttribute("name", "list");
|
||
//hiddenField3.setAttribute("value", "[" + list + "]");
|
||
hiddenField3.setAttribute("value", JSON.stringify(list));
|
||
form.appendChild(hiddenField3);
|
||
|
||
var hiddenField4 = document.createElement("input");
|
||
hiddenField4.setAttribute("type", "hidden");
|
||
hiddenField4.setAttribute("name", "subject");
|
||
hiddenField4.setAttribute("value", subject);
|
||
form.appendChild(hiddenField4);
|
||
|
||
document.body.appendChild(form); // Not entirely sure if this is necessary
|
||
form.submit();
|
||
}
|
||
}
|
||
else {
|
||
alert("沒有資料");
|
||
}
|
||
},
|
||
//報名名單
|
||
orderList(item) {
|
||
this.data_table.editFilesItem = item.list;
|
||
this.thisFilesSelected.text = item.subject;
|
||
this.thisFilesSelected.val = item.num;
|
||
this.order_dialog.show = true;
|
||
},
|
||
checkUnPrint() {
|
||
if (this.data_table.editFilesItem.length > 0) {
|
||
for (let i = 0; i < this.data_table.editFilesItem.length; i++) {
|
||
if (!this.data_table.editFilesItem[i].isPrinted)
|
||
this.data_table.selected.push(this.data_table.editFilesItem[i])
|
||
}
|
||
}
|
||
}, multiPrint() {
|
||
var params = {
|
||
item: this.thisItemSelected.val,
|
||
file: this.thisFilesSelected.val,
|
||
//list: this.data_table.selected.map(x => x.num)
|
||
};
|
||
|
||
var list = [];
|
||
//list = this.data_table.selected.map(x => x.num);
|
||
|
||
list = this.data_table.selected
|
||
.sort((a, b) => a.print_id.localeCompare(b.print_id))
|
||
.map(x => x.num);
|
||
|
||
if (list.length > 0) {
|
||
// 記錄已列印
|
||
let _url = HTTP_HOST + 'api/order/printMultiFileLog';
|
||
axios.post(_url, list, { params: params })
|
||
.then(response => {
|
||
for (let i = 0; i < this.data_table.selected.length; i++) {
|
||
for (let j = 0; i < this.data_table.editFilesItem.length; j++) {
|
||
if (this.data_table.selected[i].num == this.data_table.editFilesItem[j].num) {
|
||
this.data_table.editFilesItem[j].isPrinted = true;
|
||
break;
|
||
}
|
||
}
|
||
}
|
||
})
|
||
.catch(error => {
|
||
console.log(error)
|
||
|
||
})
|
||
// 送出列印
|
||
_url = HTTP_HOST + 'admin/print/print_multi.aspx';
|
||
var form = document.createElement("form");
|
||
form.method = "POST";
|
||
form.action = _url;
|
||
form.target = "_blank"; // Open the result in a new tab
|
||
|
||
// Helper function to add hidden fields
|
||
const addHiddenField = (name, value) => {
|
||
const hiddenField = document.createElement("input");
|
||
hiddenField.type = "hidden";
|
||
hiddenField.name = name;
|
||
hiddenField.value = value;
|
||
form.appendChild(hiddenField);
|
||
};
|
||
|
||
// Add form fields
|
||
addHiddenField("item", this.thisItemSelected.val);
|
||
addHiddenField("file", this.thisFilesSelected.val);
|
||
addHiddenField("list", JSON.stringify(list));
|
||
addHiddenField("title", `${this.thisItemSelected.text} / ${this.thisFilesSelected.text}`);
|
||
|
||
/*
|
||
var hiddenField = document.createElement("input");
|
||
hiddenField.setAttribute("type", "hidden");
|
||
hiddenField.setAttribute("name", "item");
|
||
hiddenField.setAttribute("value", this.thisItemSelected.val);
|
||
form.appendChild(hiddenField);
|
||
|
||
var hiddenField2 = document.createElement("input");
|
||
hiddenField2.setAttribute("type", "hidden");
|
||
hiddenField2.setAttribute("name", "file");
|
||
hiddenField2.setAttribute("value", this.thisFilesSelected.val);
|
||
form.appendChild(hiddenField2);
|
||
|
||
|
||
var hiddenField3 = document.createElement("input");
|
||
hiddenField3.setAttribute("type", "hidden");
|
||
hiddenField3.setAttribute("name", "list");
|
||
//hiddenField3.setAttribute("value", "[" + list + "]");
|
||
hiddenField3.setAttribute("value", JSON.stringify(list));
|
||
form.appendChild(hiddenField3);
|
||
|
||
var selectedText = this.thisItemSelected.text + " / " + this.thisFilesSelected.text;
|
||
console.log("selectedText", selectedText);
|
||
var hiddenField4 = document.createElement("input");
|
||
hiddenField4.setAttribute("type", "hidden");
|
||
hiddenField4.setAttribute("name", "title");
|
||
hiddenField4.setAttribute("value", selectedText);
|
||
form.appendChild(hiddenField4);
|
||
*/
|
||
|
||
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
|
||
}
|
||
},
|
||
//備品項目
|
||
initspares() {
|
||
if (this.this_id != '') {
|
||
const { sortBy, sortDesc, page, itemsPerPage } = this.optionsDetail
|
||
const params = {
|
||
sortBy: sortBy[0], sortDesc: sortDesc[0],
|
||
page: page,
|
||
//pageSize: itemsPerPage == -1 ? this.sparesItems.length : itemsPerPage,
|
||
pageSize: itemsPerPage
|
||
};
|
||
var searchItemDetail = {
|
||
num: this.this_id,
|
||
}
|
||
axios
|
||
.post(HTTP_HOST + 'api/activity/GetActSparesList', searchItemDetail, { params: params })
|
||
.then(response => {
|
||
this.sparesItems = response.data.list
|
||
this.sparesItems_count = response.data.count
|
||
|
||
})
|
||
.catch(
|
||
error => console.log(error)
|
||
)
|
||
}
|
||
|
||
},
|
||
deleteItemSp(item) {
|
||
if (confirm('確定要刪除此筆資料嗎?')) {
|
||
const index = this.sparesItems.indexOf(item);
|
||
if (item.num > 0) {
|
||
if (index != -1) {
|
||
axios
|
||
.delete(HTTP_HOST + 'api/activity/DeleteSparesData/' + item.num)
|
||
.then(response => {
|
||
console.log("del", item);
|
||
this.sparesItems.splice(index, 1)
|
||
this.sparesItems_count = this.sparesItems_count - 1;
|
||
})
|
||
.catch(error => console.log(error))
|
||
}
|
||
} else {
|
||
this.sparesItems.splice(index, 1)
|
||
}
|
||
}
|
||
},
|
||
cancelSp() {
|
||
|
||
this.spliceNullDataSp();
|
||
this.closeSp();
|
||
},
|
||
spliceNullDataSp() {
|
||
|
||
//if new data ,then splice it
|
||
if (this.modifyItem.num == 0) {
|
||
for (var i = 0; i < this.sparesItems.map(x => x.id).length; i++) {
|
||
if (this.sparesItems[i].id == this.modifyItem.id) {
|
||
this.sparesItems.splice(i, 1); break;
|
||
}
|
||
}
|
||
}
|
||
},
|
||
closeSp() {
|
||
setTimeout(() => {
|
||
//this.modifyItem = Object.assign({}, this.simpleItem);
|
||
this.modifyItem = $.extend(true, {}, this.simpleItem);
|
||
this.modifyIndex = -1;
|
||
}, 300)
|
||
},
|
||
addNewSp() {
|
||
|
||
this.spliceNullDataSp();
|
||
|
||
var keysArr = [];
|
||
|
||
for (var i = 0; i < this.sparesItems.map(x => x.id).length; i++) {
|
||
keysArr.push(parseInt(this.sparesItems[i].id));
|
||
}
|
||
|
||
var _c = Math.max.apply(null, keysArr);
|
||
//const addObj = Object.assign({}, this.simpleItem);
|
||
const addObj = $.extend(true, {}, this.simpleItem);
|
||
addObj.id = (isFinite(_c) ? _c : 0) + 1;
|
||
this.sparesItems.unshift(addObj);
|
||
this.editItem(addObj,true);
|
||
},
|
||
saveSp() {
|
||
if (this.modifyIndex > -1) {
|
||
if (this.this_id != '') {
|
||
//chcck necessary params
|
||
if (this.modifyItem.act_item_selected.val != 0) {
|
||
//insert or update data
|
||
var pro_order_detail =
|
||
{
|
||
num: this.modifyItem.num,
|
||
activity_num: this.this_id,
|
||
actItem_num: this.modifyItem.act_item_selected.val,
|
||
demo: this.modifyItem.demo,
|
||
}
|
||
axios
|
||
.post(HTTP_HOST + 'api/activity/SaveSparesData', pro_order_detail)
|
||
.then(response => {
|
||
this.modifyItem.num = response.data;
|
||
Object.assign(this.sparesItems[this.modifyIndex], this.modifyItem)
|
||
this.closeSp()
|
||
})
|
||
.catch(
|
||
error => console.log(error)
|
||
)
|
||
|
||
|
||
} else {
|
||
this.snackbar.text = "必填項目未填寫完整";
|
||
this.snackbar.show = true
|
||
}
|
||
} else {
|
||
this.snackbar.text = "單號錯誤";
|
||
this.snackbar.show = true
|
||
}
|
||
|
||
}
|
||
}, titleword() {
|
||
const _subject = $('#<%= subject.ClientID%>').val();
|
||
const _date = $('#<%= startDate_solar.ClientID%>').val();
|
||
return _subject + " " + _date;
|
||
},
|
||
},
|
||
computed: {
|
||
},
|
||
filters: {
|
||
currency: function (value) {
|
||
return value == null || value == "" ? "" :
|
||
('$' + parseFloat(value).toFixed(2).replace(/(\d)(?=(\d{3})+\.)/g, "$1,").replace(".00", ""));
|
||
},
|
||
}
|
||
})
|
||
</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 !='' "> {{this_category_kindTxt !="相關"? "("+this_category_kindTxt+")":"" }}{{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-md">
|
||
|
||
<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 v-if="this_id!=''" 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">
|
||
{{this_category_kindTxt}}項目</button>
|
||
<button v-if="this_id!=''" class="nav-link" id="sec2-tab3" data-bs-toggle="tab" data-bs-target="#sec2-page3"
|
||
type="button" role="tab" aria-controls="profile" aria-selected="false">
|
||
備品項目</button>
|
||
</div>
|
||
</nav>
|
||
</div>
|
||
<asp:Panel ID="cardBodyPanel" runat="server" CssClass="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-lg-1 col-form-label">活動名稱 *</label>
|
||
<div class="col-sm-10 col-lg-3">
|
||
<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>
|
||
|
||
<label class="col-sm-2 col-lg-1 col-form-label">活動主類型 *</label>
|
||
<div class="col-sm-10 col-lg-3" >
|
||
<div class="input-group mb-3" data-search-control="search4" @click="search_show(search_dialog.controls.search4)" >
|
||
<input class="form-control search-text" type="text" readonly
|
||
id="category_kind_txt" runat="server" placeholder="活動主類型" value="">
|
||
<asp:HiddenField ID="category_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="RequiredFieldValidator3" ControlToValidate="category_kind_txt" runat="server" ErrorMessage="必填!" Display="Dynamic" SetFocusOnError="true"></asp:RequiredFieldValidator>
|
||
</div>
|
||
|
||
<label class="col-sm-2 col-lg-1 col-form-label">活動詳細分類 *</label>
|
||
<div class="col-sm-10 col-lg-3">
|
||
<asp:PlaceHolder ID="kindPH" runat="server">
|
||
<div class="input-group mb-3" data-search-control="search1" @click="this_id=='' && 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>
|
||
</asp:PlaceHolder>
|
||
<asp:Literal ID="kind_txt2" runat="server"></asp:Literal>
|
||
</div>
|
||
</div>
|
||
<div class="row mb-1 label-sm-right">
|
||
<label class="col-sm-2 col-lg-1 col-form-label">牌位編號開頭</label>
|
||
<div class="col-sm-10 col-lg-3">
|
||
<asp:TextBox ID="print_init" MaxLength="50" runat="server" CssClass="form-control" placeholder="請輸入牌位編號開頭"></asp:TextBox>
|
||
</div>
|
||
<label class="col-sm-2 col-lg-1 col-form-label">活動地點</label>
|
||
<div class="col-sm-10 col-lg-3">
|
||
<asp:TextBox ID="address" MaxLength="200" runat="server" CssClass="form-control" placeholder="請輸入活動地址"></asp:TextBox>
|
||
</div>
|
||
<label class="col-sm-2 col-lg-1 col-form-label">大殿</label>
|
||
<div class="col-sm-10 col-lg-3">
|
||
<asp:TextBox ID="hall" MaxLength="50" runat="server" CssClass="form-control" placeholder="請輸入大殿名稱"></asp:TextBox>
|
||
</div>
|
||
</div>
|
||
<div class="row mb-1 label-sm-right">
|
||
<label class="col-sm-2 col-lg-1 col-form-label">開始日期(西元)</label>
|
||
<div class="col-sm-4 col-lg-3">
|
||
<asp:TextBox ID="startDate_solar" TextMode="Date" runat="server" CssClass="form-control" onchange="chagenDate(this)"></asp:TextBox>
|
||
</div>
|
||
<label class="col-sm-2 col-lg-1 col-form-label">(農曆)</label>
|
||
<div class="col-sm-4 col-lg-3 lunar pt-2">
|
||
<asp:Literal ID="startDate_lunar" runat="server"></asp:Literal>
|
||
</div>
|
||
<label class="col-sm-2 col-lg-1 col-form-label">主修沙門 </label>
|
||
<div class="col-sm-4 col-lg-3">
|
||
<asp:TextBox ID="monk" MaxLength="50" runat="server" CssClass="form-control" placeholder="請輸入主修沙門"></asp:TextBox>
|
||
</div>
|
||
</div>
|
||
|
||
|
||
<div class="row mb-1 label-sm-right">
|
||
|
||
<label class="col-sm-2 col-lg-1 col-form-label">結束日期(西元)</label>
|
||
<div class="col-sm-4 col-lg-3">
|
||
<asp:TextBox ID="endDate_solar" TextMode="Date" runat="server" CssClass="form-control" onchange="chagenDate(this)"></asp:TextBox>
|
||
</div>
|
||
<label class="col-sm-2 col-lg-1 col-form-label">(農曆)</label>
|
||
<div class="col-sm-4 col-lg-3 lunar pt-2">
|
||
<asp:Literal ID="endDate_lunar" runat="server"></asp:Literal>
|
||
</div>
|
||
<label class="col-sm-2 col-lg-1 col-form-label">報名截止日 *</label>
|
||
<div class="col-sm-4 col-lg-3">
|
||
<asp:TextBox ID="dueDate" TextMode="Date" runat="server" CssClass="form-control"></asp:TextBox>
|
||
<asp:RequiredFieldValidator ID="RequiredFieldValidator5" ControlToValidate="dueDate" 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-lg-1 col-form-label">開始歲次 </label>
|
||
<div class="col-sm-4 col-lg-3">
|
||
<asp:TextBox ID="start_sexagenary" MaxLength="2" runat="server" CssClass="form-control" placeholder="請輸入開始歲次"></asp:TextBox>
|
||
|
||
</div>
|
||
|
||
<label class="col-sm-2 col-lg-1 col-form-label">結束歲次 </label>
|
||
<div class="col-sm-4 col-lg-3">
|
||
<asp:TextBox ID="end_sexagenary" MaxLength="2" runat="server" CssClass="form-control" placeholder="請輸入結束歲次"></asp:TextBox>
|
||
|
||
</div>
|
||
|
||
</div>
|
||
<hr />
|
||
|
||
<div class="row mb-1">
|
||
<label class="col-form-label">備註</label>
|
||
<div class="">
|
||
<asp:TextBox ID="demo" runat="server" Rows="5" TextMode="MultiLine" CssClass="form-control" placeholder="請輸入備註"></asp:TextBox>
|
||
</div>
|
||
</div>
|
||
<div class="row mb-1">
|
||
<label class="col-form-label">自定義欄位預設值</label>
|
||
<div class="">
|
||
<asp:TextBox ID="customize_data" runat="server" Rows="3" TextMode="MultiLine" CssClass="form-control" placeholder="一行輸入一個定義欄位預設值,如: $活動:OO年法會 $地點:台中市OO區OO路" ToolTip="一行輸入一個定義欄位預設值,格式: $變數名稱:值"></asp:TextBox>
|
||
</div>
|
||
</div>
|
||
<div class="row mb-1">
|
||
<asp:Panel ID="timePanel1" runat="server" CssClass="col-12 text-right text-primary" Visible="false">建檔時間:<asp:Literal ID="reg_time" runat="server"></asp:Literal></asp:Panel>
|
||
</div>
|
||
</div>
|
||
<div class="tab-pane fade giftItems" id="sec2-page2" role="tabpanel" aria-labelledby="sec2-tab2" v-if="this_id!=''">
|
||
<v-card class="mx-auto" 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"
|
||
>
|
||
<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.act_item_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.act_item_selected.text" >
|
||
<input type="hidden" v-model="editedItem.act_item_selected.val">
|
||
<button class="btn btn-outline-secondary" type="button">
|
||
<i class="mdi mdi-view-list-outline"></i>
|
||
</button>
|
||
</div>
|
||
<span v-else>{{item.act_item_selected.text}}
|
||
<span v-if="item.num==0" class="text-danger">(預設資料,未存檔)</span>
|
||
</span>
|
||
</template>
|
||
<template v-slot:item.price="{ item }">
|
||
<v-text-field v-model="editedItem.price" :hide-details="true" dense single-line v-if="item.id === editedItem.id" ></v-text-field>
|
||
<span v-else>{{item.price | currency }}</span>
|
||
</template>
|
||
<template v-slot:item.qty="{ item }">
|
||
<v-text-field v-model="editedItem.qty" :hide-details="true" dense single-line v-if="item.id === editedItem.id" ></v-text-field>
|
||
<span v-else>{{item.qty}}</span>
|
||
</template>
|
||
<template v-slot:item.actions="{ item }">
|
||
<template v-if="item.id === editedItem.id">
|
||
<v-icon color="red" class="mr-2" @click="cancel">
|
||
mdi-window-close
|
||
</v-icon>
|
||
<v-icon color="green" class="mr-2" @click="save">
|
||
mdi-content-save
|
||
</v-icon>
|
||
</template>
|
||
<template v-else>
|
||
<v-icon color="green" class="mr-2" @click="editItem(item);">
|
||
mdi-pencil
|
||
</v-icon>
|
||
<v-icon color="red" class="mr-2" @click="deleteItem(item)">
|
||
mdi-delete
|
||
</v-icon>
|
||
</template>
|
||
<v-icon color="blue" class="mr-2" @click="printItem(item);" >
|
||
mdi-printer
|
||
</v-icon>
|
||
<v-icon color="green" @click="exportExcel(item);" >
|
||
mdi-file-excel
|
||
</v-icon>
|
||
|
||
|
||
</template>
|
||
|
||
</v-data-table>
|
||
</v-card>
|
||
|
||
|
||
</div>
|
||
<div class="tab-pane fade giftItems" id="sec2-page3" role="tabpanel" aria-labelledby="sec2-tab3" v-if="this_id!=''">
|
||
|
||
<v-card class="mx-auto" outlined v-if="this_id!=''">
|
||
|
||
<v-data-table
|
||
:headers="headersSpares"
|
||
:items="sparesItems"
|
||
:footer-props="footersDetail"
|
||
:search="searchSpares"
|
||
:options.sync="optionsSpares" class="elevation-1" fixed-header height="350px"
|
||
|
||
>
|
||
<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="searchSpares" append-icon="mdi-magnify" label="查詢" dense outlined single-line hide-details></v-text-field>
|
||
<v-btn
|
||
color="primary"
|
||
class="ml-2 white--text"
|
||
@click="addNewSp">
|
||
<v-icon dark>mdi-plus</v-icon>新增
|
||
</v-btn>
|
||
</div>
|
||
</v-toolbar>
|
||
</template>
|
||
<template v-slot:item.act="{ item }">
|
||
<div class="input-group mb-3" data-search-control="search3" @click="search_show(search_dialog.controls.search3)" v-if="item.id === modifyItem.id">
|
||
<input class="form-control search-text" type="text" readonly
|
||
placeholder="品項名稱" v-model="modifyItem.act_item_selected.text" >
|
||
<input type="hidden" v-model="modifyItem.act_item_selected.val">
|
||
<button class="btn btn-outline-secondary" type="button">
|
||
<i class="mdi mdi-view-list-outline"></i>
|
||
</button>
|
||
|
||
</div>
|
||
<span v-else>{{item.act_item_selected.text}}
|
||
<span v-if="item.num==0" class="text-danger">(預設資料,未存檔)</span>
|
||
</span>
|
||
</template>
|
||
<%-- <template v-slot:item.qty1="{ item }">
|
||
<v-text-field v-model="modifyItem.qty1" :hide-details="true" dense single-line v-if="item.id === modifyItem.id" ></v-text-field>
|
||
<span v-else>{{item.qty1}}</span>
|
||
</template>
|
||
<template v-slot:item.qty2="{ item }">
|
||
<v-text-field v-model="modifyItem.qty2" :hide-details="true" dense single-line v-if="item.id === modifyItem.id" ></v-text-field>
|
||
<span v-else>{{item.qty2}}</span>
|
||
</template>--%>
|
||
<template v-slot:item.demo="{ item }">
|
||
<v-text-field v-model="modifyItem.demo" :hide-details="true" dense single-line v-if="item.id === modifyItem.id" ></v-text-field>
|
||
<span v-else>{{item.demo}}</span>
|
||
</template>
|
||
<template v-slot:item.actions="{ item }">
|
||
<div v-if="item.id === modifyItem.id">
|
||
<v-icon color="red" class="mr-3" @click="cancelSp">
|
||
mdi-window-close
|
||
</v-icon>
|
||
<v-icon color="green" @click="saveSp">
|
||
mdi-content-save
|
||
</v-icon>
|
||
</div>
|
||
<div v-else>
|
||
<v-icon color="green" class="mr-3" @click="editItem(item,true);">
|
||
mdi-pencil
|
||
</v-icon>
|
||
<v-icon color="red" @click="deleteItemSp(item)">
|
||
mdi-delete
|
||
</v-icon>
|
||
</div>
|
||
|
||
</template>
|
||
|
||
</v-data-table>
|
||
</v-card>
|
||
|
||
|
||
</div>
|
||
</div>
|
||
</asp:Panel>
|
||
</div>
|
||
<v-dialog v-model="file_dialog.show" max-width="400px">
|
||
<v-card>
|
||
<v-card-title class="justify-space-between grey lighten-2">
|
||
相關文件
|
||
<v-btn icon @click="file_dialog.show=false;"><v-icon>mdi-close</v-icon></v-btn>
|
||
</v-card-title>
|
||
<v-card-text >
|
||
<v-row v-for="item in printfiles" densee class="pt-3" >
|
||
<v-col :cols="1" >
|
||
<v-icon dense >mdi-rhombus-medium</v-icon>
|
||
</v-col>
|
||
<v-col :cols="7" >
|
||
<a @click="orderList(item)" class="text-decoration-none">
|
||
<span class="fs-6 text text-dark">{{item.subject}}</span>
|
||
</a>
|
||
</v-col>
|
||
<v-col :cols="4" class="text-right">
|
||
<a @click="orderList(item)" class="text-decoration-none">
|
||
<v-icon color="blue" >
|
||
mdi-printer
|
||
</v-icon>
|
||
</a>
|
||
</v-col>
|
||
</v-row>
|
||
</v-card-text>
|
||
<v-card-actions>
|
||
</v-card-actions>
|
||
</v-card>
|
||
</v-dialog>
|
||
<v-dialog v-model="order_dialog.show" max-width="500px">
|
||
<v-card>
|
||
<v-card-title class="justify-space-between grey lighten-2">
|
||
報名名單
|
||
<v-btn icon @click="order_dialog.show=false;data_table.selected=[]"><v-icon>mdi-close</v-icon></v-btn>
|
||
</v-card-title>
|
||
<v-card-text>
|
||
<v-row dense class="pt-2">
|
||
<v-col :cols="12" class="pt-3" >
|
||
<span class="fs-6 ">{{thisItemSelected.text}} / {{thisFilesSelected.text}}</span>
|
||
</v-col>
|
||
</v-row>
|
||
</v-card-text>
|
||
<v-data-table
|
||
v-model="data_table.selected"
|
||
item-key="num"
|
||
:headers="data_table.headersFilesList"
|
||
:items="data_table.editFilesItem"
|
||
:search="data_table.searchList"
|
||
:single-select="data_table.singleSelect"
|
||
show-select
|
||
:options.sync="optionsList" class="elevation-1" fixed-header height="350px">
|
||
<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="data_table.searchList" append-icon="mdi-magnify" label="查詢" dense outlined single-line hide-details></v-text-field>--%>
|
||
<v-btn
|
||
color="primary"
|
||
class="ml-2 white--text"
|
||
@click="checkUnPrint">
|
||
勾選未列印
|
||
</v-btn>
|
||
<v-btn
|
||
color="primary"
|
||
class="ml-2 white--text"
|
||
@click="multiPrint">
|
||
列印<v-icon dark>mdi-turn-right</v-icon>
|
||
</v-btn>
|
||
</div>
|
||
</v-toolbar>
|
||
</template>
|
||
<template v-slot:item.isprinted="{ item }">
|
||
<v-icon color="blue" class="mr-2" v-if="item.isPrinted" >
|
||
mdi-check-circle
|
||
</v-icon>
|
||
</template>
|
||
</v-data-table>
|
||
</v-card>
|
||
</v-dialog>
|
||
|
||
<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> |