modify
This commit is contained in:
@@ -26,6 +26,7 @@ namespace Model.ViewModel
|
||||
public Nullable<System.DateTime> reg_time { get; set; }
|
||||
public Nullable<int> receipt_num { get; set; }
|
||||
public string f_name { get; set; }
|
||||
public string act_name { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
@@ -2,16 +2,20 @@
|
||||
using MINOM.COM.Utility;
|
||||
using Model;
|
||||
using Newtonsoft.Json;
|
||||
using OfficeOpenXml;
|
||||
using Org.BouncyCastle.Crypto;
|
||||
using Org.BouncyCastle.Crypto.Tls;
|
||||
using PagedList;
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Data.Entity;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Net.Http;
|
||||
using System.Web;
|
||||
using System.Web.Http;
|
||||
using System.Web.Services;
|
||||
using static TreeView;
|
||||
@@ -2165,4 +2169,78 @@ string sortBy = "", bool sortDesc = false)
|
||||
}
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
[Route("api/activity/ComparePreAndOrder")]
|
||||
public IHttpActionResult ComparePreAndOrder([FromBody] Model.ViewModel.activity act)
|
||||
{
|
||||
//用活動撈pre_order
|
||||
//檢查pro_order_detail 的數量跟金額與pre_order登記是否相符
|
||||
var qry = _db.pre_order.AsQueryable();
|
||||
qry = qry.Where(x => x.act_num == act.num);
|
||||
var dqry = _db.pro_order_detail.AsQueryable();
|
||||
dqry = dqry.Where(y => _db.pro_order.Where(z => z.activity_num == act.num).Select(z => z.order_no).ToList().Contains(y.order_no));
|
||||
|
||||
var list = qry.Select(x => new
|
||||
{
|
||||
x.num,
|
||||
x.order_no,
|
||||
x.reg_time,
|
||||
x.receipt_num,
|
||||
x.item_count,
|
||||
x.f_num,
|
||||
x.total_amt,
|
||||
x.admin_num,
|
||||
act_name=_db.activities.Where(w=>w.num==act.num).Select(w=>w.subject).FirstOrDefault(),
|
||||
f_name=_db.followers.Where(z=>z.num==x.f_num).Select(z=>z.u_name).FirstOrDefault(),
|
||||
order_amt=dqry.Where(y=>y.order_no==x.order_no).Sum(y=>y.qty*y.price),
|
||||
order_count=dqry.Where(y=> y.order_no == x.order_no&&!y.parent_num.HasValue).ToList().Count(),
|
||||
}).ToList();
|
||||
string rootPath = HttpRuntime.AppDomainAppPath;
|
||||
string name = $"output{DateTime.Now.ToString("yyyyMMddHHmmss")}.xlsx";
|
||||
string fileName = Path.Combine(new string[] { rootPath, "rpt", name });
|
||||
|
||||
var file = new FileInfo($"{fileName}"); // 檔案路徑
|
||||
using (var excel = new ExcelPackage())
|
||||
{
|
||||
LogUtility log = new LogUtility();
|
||||
// 建立分頁
|
||||
var ws = excel.Workbook.Worksheets.Add("MySheet");
|
||||
int i = 0;
|
||||
i++;
|
||||
ws.Cells[i, 1].Value = "序號";
|
||||
ws.Cells[i, 2].Value = "法會名稱";
|
||||
ws.Cells[i, 3].Value = "信眾";
|
||||
ws.Cells[i, 4].Value = "登記數量";
|
||||
ws.Cells[i, 5].Value = "登記金額";
|
||||
ws.Cells[i, 6].Value = "報名數量";
|
||||
ws.Cells[i, 7].Value = "報名金額";
|
||||
ws.Cells[i, 8].Value = "是否相符";
|
||||
i++;
|
||||
foreach (var data in list)
|
||||
{
|
||||
ws.Cells[i, 1].Value = i-1;
|
||||
ws.Cells[i, 2].Value =data.act_name;
|
||||
ws.Cells[i, 3].Value = data.f_name;
|
||||
ws.Cells[i, 4].Value = data.item_count;
|
||||
ws.Cells[i, 5].Value = data.total_amt;
|
||||
ws.Cells[i, 6].Value = data.order_count;
|
||||
ws.Cells[i, 7].Value = data.order_amt;
|
||||
|
||||
if (data.total_amt != data.order_amt || data.item_count != data.order_count)
|
||||
{
|
||||
ws.Cells[i, 8].Value = "否";
|
||||
}
|
||||
else
|
||||
{
|
||||
ws.Cells[i, 8].Value = "是";
|
||||
}
|
||||
}
|
||||
excel.SaveAs(file);
|
||||
}
|
||||
|
||||
return Ok(new { result = "Y", filename = $"rpt/{name}" });
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@ using System.Web;
|
||||
using System.Web.Http;
|
||||
using MyWeb;
|
||||
using MINOM.COM.Utility;
|
||||
using System.Text;
|
||||
// api/pre_order
|
||||
//[ezAuthorize(Roles = "admin")]//群組:*
|
||||
//[ezAuthorize]
|
||||
@@ -20,6 +21,71 @@ public class preOrderController: ApiController
|
||||
// TODO: 在這裡新增建構函式邏輯
|
||||
//
|
||||
}
|
||||
|
||||
|
||||
[HttpPost]
|
||||
[Route("api/preOrder/CheckPreVsOrder")]
|
||||
public IHttpActionResult CheckPreVsOrder([FromBody] Model.ViewModel.preOrder pre)
|
||||
{
|
||||
try
|
||||
{
|
||||
//用order_no去檢查pre_order登記的總數量跟pro_order_detail數量比較
|
||||
var order_qry = _db.pro_order_detail.AsQueryable();
|
||||
order_qry = order_qry.Where(x => x.order_no == pre.order_no);
|
||||
var order = order_qry.ToList();
|
||||
|
||||
var pre_qry = _db.pre_order.AsQueryable();
|
||||
pre_qry = pre_qry.Where(y => y.order_no == pre.order_no);
|
||||
var pre_order = pre_qry.FirstOrDefault();
|
||||
if (order != null && pre_order != null)
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
if (pre_order.total_amt != order.Sum(x => x.price * x.qty))
|
||||
{
|
||||
sb.Append("金額與客堂登記不符\n");
|
||||
}
|
||||
int order_count = order.Where(x => !x.parent_num.HasValue).ToList().Count;
|
||||
if (pre_order.item_count != order_count)
|
||||
{
|
||||
sb.Append("功德項目數與客堂登記不符\n");
|
||||
}
|
||||
if (sb.Length > 0)
|
||||
{
|
||||
return Ok(new
|
||||
{
|
||||
result = "Y",
|
||||
|
||||
message = sb.ToString(),
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
return Ok(new
|
||||
{
|
||||
result = "Y",
|
||||
message = "與客堂登記相符",
|
||||
});
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return Ok(new
|
||||
{
|
||||
result = "Y",
|
||||
message = "無客堂登記資料",
|
||||
});
|
||||
}
|
||||
}
|
||||
catch (Exception ex) {
|
||||
return Ok(new
|
||||
{
|
||||
result="N",
|
||||
message=ex.Message,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
[HttpPost]
|
||||
[Route("api/preOrder/GetPreOrder")]
|
||||
|
||||
@@ -29,10 +95,17 @@ public class preOrderController: ApiController
|
||||
var qry=_db.pre_order.AsQueryable();
|
||||
if (!string.IsNullOrEmpty(pre.f_name))
|
||||
{
|
||||
qry = qry.Where(x => _db.followers.Where(y => y.u_name == pre.f_name).Select(y => y.num).ToList().Contains((int)x.f_num));
|
||||
qry = qry.Where(x => _db.followers.Where(y => y.u_name.Contains( pre.f_name)).Select(y => y.num).ToList().Contains((int)x.f_num));
|
||||
}
|
||||
if (!string.IsNullOrEmpty(pre.order_no)) {
|
||||
qry = qry.Where(x => x.order_no.Contains(pre.order_no));
|
||||
}
|
||||
if (!string.IsNullOrEmpty(pre.act_name))
|
||||
{
|
||||
qry = qry.Where(x => _db.activities.Where(z=>z.subject.Contains(pre.act_name)).Select(z=>z.num).ToList().Contains((int)x.act_num));
|
||||
}
|
||||
//sortBy = sortBy ?? string.Empty;
|
||||
qry=qry.OrderByDescending(x => x.num);
|
||||
qry =qry.OrderByDescending(x => x.num);
|
||||
var count = qry.Count(); //pageSize = count;//一次取回??
|
||||
if (pageSize == -1)
|
||||
{
|
||||
@@ -47,6 +120,7 @@ public class preOrderController: ApiController
|
||||
x.num,x.f_num,x.admin_num,x.order_no,x.item_count,x.total_amt,x.reg_time,x.receipt_num,x.act_num,
|
||||
f_name=_db.followers.Where(z=>z.num==x.f_num).Select(z=>z.u_name).FirstOrDefault(),
|
||||
act_name=_db.activities.Where(w=>w.num==x.act_num).Select(w=>w.subject).FirstOrDefault(),
|
||||
receipt_amt=(_db.receipt_detail.Where(rd=>_db.receipt_master.Where(rm=>rm.order_no==x.order_no).Select(rm=>rm.num).ToList().Contains((int)rd.receipt_num))).Select(rd=>rd.amt).Sum()
|
||||
}).ToList(),
|
||||
count = count
|
||||
};
|
||||
|
||||
@@ -82,6 +82,37 @@
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
compare(item) {
|
||||
// console.log("compare:", item);
|
||||
axios
|
||||
.post(HTTP_HOST + 'api/activity/ComparePreAndOrder', {num:item.num})
|
||||
.then(response => {
|
||||
if (response.data.result == "N") {
|
||||
this.message_dialog.message = response.data.message;
|
||||
this.message_dialog.show = true;
|
||||
} else if (response.data.result == "Y") {
|
||||
const link = document.createElement('a');
|
||||
link.href = HTTP_HOST + "/" + response.data.filename;
|
||||
link.target = "_blank";
|
||||
|
||||
// 5. Specify the filename for the download
|
||||
//link.setAttribute('download', 'my-downloaded-file.pdf');
|
||||
|
||||
// 6. Append link to the body, click it, and remove it immediately
|
||||
document.body.appendChild(link);
|
||||
link.click();
|
||||
document.body.removeChild(link);
|
||||
|
||||
// 7. Free up memory by revoking the object URL
|
||||
//window.URL.revokeObjectURL(blobUrl);
|
||||
//window.open(HTTP_HOST +"/" +response.data.filename, "_blank");
|
||||
}
|
||||
this.isdisabled = false;
|
||||
this.isloading = false;
|
||||
|
||||
})
|
||||
.catch(error => console.log(error))
|
||||
},
|
||||
getDefault(clearpage = false) {
|
||||
const { sortBy, sortDesc, page, itemsPerPage } = this.options
|
||||
const params = {
|
||||
@@ -209,6 +240,10 @@
|
||||
<a :href="'reg.aspx?num='+item.num" class="btn btn-outline-secondary btn-sm"><i class="mdi mdi-pencil-box-outline"></i>編輯</a>
|
||||
<a @click="copyItem(item)" class="btn btn-outline-secondary btn-sm"><i class="mdi mdi-pencil-box-outline"></i>複製</a>
|
||||
<a @click="deleteItem(item)" class="btn btn-outline-secondary btn-sm"><i class="mdi mdi-trash-can"></i>刪除</a>
|
||||
<% if (IsPreOrder == "true")
|
||||
{ %>
|
||||
<a @click="compare(item)" class="btn btn-outline-secondary btn-sm"><i class="mdi mdi-trash-can"></i>比對</a>
|
||||
<% } %>
|
||||
</template>
|
||||
</v-data-table>
|
||||
<v-container>
|
||||
|
||||
@@ -14,12 +14,13 @@ using static TreeView;
|
||||
public partial class admin_activity_index : MyWeb.config
|
||||
{
|
||||
private Model.ezEntities _db = new Model.ezEntities();
|
||||
public string IsPreOrder = "false";
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
if (!IsPostBack)
|
||||
{
|
||||
|
||||
IsPreOrder = ConfigurationManager.AppSettings["IsPreOrder"];
|
||||
BuildKind();
|
||||
|
||||
}
|
||||
|
||||
+50
-250
@@ -4,87 +4,82 @@
|
||||
<script src="/js/httpVueLoader.js"></script>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content2" ContentPlaceHolderID="page_nav" Runat="Server">
|
||||
<div class="mb-2 mb-sm-0">
|
||||
<%-- <a @click.prevent="changeView({action:'add'})" class="btn btn-primary">
|
||||
<i class="mdi mdi-plus"></i>新增
|
||||
</a>--%>
|
||||
<%--<a @click="deleteAll" class="btn btn-outline-danger" title="刪除勾選的資料" ><i class="mdi mdi-trash-can"></i> 刪除勾選</a>--%>
|
||||
</div>
|
||||
<div class="">
|
||||
<%--<a @click="print_dialog.show=true" class="btn btn-outline-primary btn-print" target="_blank">
|
||||
<i class="mdi mdi-printer"></i>列印管理報表
|
||||
</a>
|
||||
<div :style="data_table.list.length === 0 ? 'pointer-events: none; opacity: 0.5;' : ''" style="display:inline-block;">
|
||||
<div class="dropdown d-inline-block">
|
||||
<a class="btn btn-outline-primary btn-print dropdown-toggle" data-bs-toggle="dropdown" href="#" role="button" aria-expanded="false"><i class="mdi mdi-printer"></i>列印查詢資料</a>
|
||||
<ul class="dropdown-menu ps-0 w-100" aria-labelledby="dropdownPrintLink">
|
||||
<li><a @click="search.hasPrice='Y';goPrint()" class="dropdown-item"><i class="mdi mdi-printer me-1"></i>有金額</a></li>
|
||||
<li><a @click="search.hasPrice='N';goPrint()" class="dropdown-item"><i class="mdi mdi-printer me-1"></i>無金額</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div :style="data_table.list.length === 0 ? 'pointer-events: none; opacity: 0.5;' : ''" style="display:inline-block;">
|
||||
<asp:LinkButton ID="excel" runat="server" CssClass="btn btn-outline-success" OnClick="excel_Click"><span class="fa-solid fa-file-excel"></span> 匯出查詢資料(Excel)</asp:LinkButton>
|
||||
</div>--%>
|
||||
</div>
|
||||
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
|
||||
<div id="content" class="container-fluid py-4">
|
||||
<keep-alive>
|
||||
<component :is="currentView"
|
||||
@custom-event="changeView">
|
||||
<component :is="currentView" ref="myChild"
|
||||
@custom-event="changeView" :search="search">
|
||||
</component>
|
||||
</keep-alive>
|
||||
</div>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content4" ContentPlaceHolderID="offCanvasRight" Runat="Server">
|
||||
<div id="search_panel" alt="查詢">
|
||||
<div class="mb-3">
|
||||
<label class="form-label">信眾</label>
|
||||
<input type="text" v-model="search.f_name" class="form-control" placeholder="可輸入關鍵字查詢">
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label class="form-label">活動</label>
|
||||
<input type="text" v-model="search.act_name" class="form-control" placeholder="可輸入關鍵字查詢">
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label class="form-label">報名單號</label>
|
||||
<input type="text" v-model="search.order_no" class="form-control" placeholder="可輸入關鍵字查詢">
|
||||
</div>
|
||||
<div class="mb-3 p-2 border-top">
|
||||
<a @click.prevent="btn_search" class="btn btn-outline-primary"><i class="mdi mdi-filter"></i> 搜尋</a>
|
||||
<a class="btn btn-outline-secondary" @click.prevent="btn_all"><i class="mdi mdi-filter-remove"></i> 所有資料</a>
|
||||
</div>
|
||||
</div>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content5" ContentPlaceHolderID="footer_script" Runat="Server">
|
||||
<script>
|
||||
let VueApp = new Vue({
|
||||
el: '#app',
|
||||
vuetify: new Vuetify(),
|
||||
vuetify: new Vuetify(vuetify_options),
|
||||
data() {
|
||||
return {
|
||||
currentView: 'pre_order-component',
|
||||
options: { multiSort: false },
|
||||
search_options: { multiSort: false },
|
||||
//data_table: {
|
||||
// loading: true,
|
||||
// list: [],
|
||||
// selected: [],
|
||||
// singleSelect: false,
|
||||
// count: 0,
|
||||
// page: 1,
|
||||
// pageSize: 10,
|
||||
// header: [
|
||||
// { text: '信眾', value: 'f_num' },
|
||||
// { text: '報名單號', value: 'order_no' },
|
||||
// { text: '收據號碼', value: 'receipt_num' },
|
||||
// { text: '活動', value: 'act_num', align: 'start' },
|
||||
// { text: '功德項目數量', value: 'item_count' },
|
||||
// { text: '總金額', value: 'total_amt' },
|
||||
// { text: '登錄人員', value: 'admin_num' },
|
||||
// { text: '登錄時間', value: 'reg_time' },
|
||||
// { text: '', value: 'slot_btn', sortable: false, align: 'end' }
|
||||
// ],
|
||||
// footer: {
|
||||
// showFirstLastPage: true,
|
||||
// itemsPerPageOptions: [5, 10, 20, 30],
|
||||
// },
|
||||
//},
|
||||
search: {
|
||||
act_name: '',
|
||||
order_no: '',
|
||||
f_name:'',
|
||||
},
|
||||
}
|
||||
},
|
||||
components: {
|
||||
'pre_order-component': httpVueLoader('./pre_order.vue'),
|
||||
'pre_order_reg-component': httpVueLoader('./pre_order_reg.vue'),
|
||||
},
|
||||
//watch: {
|
||||
//},
|
||||
//mounted() {
|
||||
// // this.loadData();
|
||||
//},
|
||||
watch: {
|
||||
search_options: {
|
||||
handler() {
|
||||
|
||||
},
|
||||
deep: true,
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
search_show(curr) {
|
||||
this.search_dialog.current = curr;
|
||||
this.search_clear()
|
||||
this.search_dialog.show = true;
|
||||
},
|
||||
btn_search() {
|
||||
this.$refs.myChild.loadData();
|
||||
},
|
||||
btn_all() {
|
||||
this.search.act_name= ''
|
||||
this.search.order_no= ''
|
||||
this.search.f_name= ''
|
||||
|
||||
this.btn_search();
|
||||
},
|
||||
changeView(item) {
|
||||
if (item.action === "add") {
|
||||
this.currentView = "pre_order_reg-component";
|
||||
@@ -92,204 +87,9 @@
|
||||
this.currentView = "pre_order-component";
|
||||
}
|
||||
},
|
||||
//loadData(clearpage = false) {
|
||||
// const { sortBy, sortDesc, page, itemsPerPage } = this.options
|
||||
// //page = this.data_table.page;
|
||||
// let search = {}
|
||||
// const params = {
|
||||
// sortBy: sortBy[0], sortDesc: sortDesc[0],
|
||||
// page: clearpage ? '1' : page, pageSize: itemsPerPage
|
||||
// };
|
||||
// this.data_table.loading = true
|
||||
// axios
|
||||
// .post(HTTP_HOST + 'api/preOrder/GetPreOrder', search, { params: params })
|
||||
// .then(response => {
|
||||
// console.log(response)
|
||||
// this.data_table.list = response.data.list
|
||||
// this.data_table.count = response.data.count;
|
||||
// this.data_table.loading = false
|
||||
|
||||
// const dataToStore = JSON.stringify(this.data_table);
|
||||
// //sessionStorage.setItem("order_list_cache", dataToStore);
|
||||
// })
|
||||
// .catch(error => console.log(error))
|
||||
// },
|
||||
},
|
||||
|
||||
//computed: {
|
||||
// pageCount() {
|
||||
// return Math.ceil(this.detail_table.count / this.detail_table.pageSize)
|
||||
// },
|
||||
//}
|
||||
})
|
||||
//Vue.filter('timeString', function (value, myFormat) {
|
||||
// return value == null || value == "" ? "" : moment(value).format(myFormat || 'YYYY-MM-DD, HH:mm:ss');
|
||||
//});
|
||||
|
||||
//let VueApp = new Vue({
|
||||
// el: '#app',
|
||||
// vuetify: new Vuetify(vuetify_options),
|
||||
// data() {
|
||||
// return {
|
||||
// options: { multiSort: false },
|
||||
// search_options: { multiSort: false },
|
||||
// data_table: {
|
||||
// loading: true,
|
||||
// list: [],
|
||||
// selected: [],
|
||||
// singleSelect: false,
|
||||
// count: 0,
|
||||
// page: 1,
|
||||
// pageSize: 10,
|
||||
// header: [
|
||||
// { text: '信眾', value: 'f_num' },
|
||||
// { text: '報名單號', value: 'order_no' },
|
||||
// { text: '收據號碼', value: 'receipt_num' },
|
||||
// { text: '活動', value: 'act_num', align: 'start' },
|
||||
// { text: '功德項目數量', value: 'item_count' },
|
||||
// { text: '總金額', value: 'total_amt' },
|
||||
// { text: '登錄人員', value: 'admin_num' },
|
||||
// { text: '登錄時間', value: 'reg_time' },
|
||||
// { text: '', value: 'slot_btn', sortable: false, align: 'end' }
|
||||
// ],
|
||||
// footer: {
|
||||
// showFirstLastPage: true,
|
||||
// itemsPerPageOptions: [5, 10, 20, 30],
|
||||
// },
|
||||
// },
|
||||
// search_dialog: {
|
||||
// controls: {
|
||||
// search1: {
|
||||
// id: 'search1',
|
||||
// title: '國籍',
|
||||
// text_prop: 'name_zh',
|
||||
// value_prop: 'id',
|
||||
// keys: [
|
||||
// { id: 'keyword', title: '關鍵字' },
|
||||
// ],
|
||||
// api_url: HTTP_HOST + 'api/country/GetList',
|
||||
// columns: [
|
||||
// { id: 'id', title: '代碼' },
|
||||
// { id: 'name_en', title: '英文短名稱' },
|
||||
// { id: 'name_zh', title: '中文名稱' },
|
||||
// ],
|
||||
// selected: {},
|
||||
// select(item, t) {
|
||||
// t.search.country = item.id;
|
||||
// t.search.country2 = '';
|
||||
// }
|
||||
// },
|
||||
// search2: {
|
||||
// id: 'search2',
|
||||
// title: '報名活動',
|
||||
// text_prop: 'subject',
|
||||
// value_prop: 'num',
|
||||
// keys: [
|
||||
// { id: 'subject', title: '活動名稱', value: '' },
|
||||
// { id: 'kindTxt', title: '活動分類' },
|
||||
// ],
|
||||
// api_url: HTTP_HOST + 'api/activity/GetList',
|
||||
// columns: [
|
||||
// { id: 'subject', title: '活動名稱' },
|
||||
// { id: 'kindTxt', title: '活動分類' },
|
||||
// ],
|
||||
// selected: {},
|
||||
// select(item, t) {
|
||||
// t.print_search.select_act = item.num;
|
||||
// }
|
||||
// },
|
||||
// search3: {
|
||||
// id: 'search3',
|
||||
// title: '活動品項',
|
||||
// text_prop: 'subject',
|
||||
// value_prop: 'num',
|
||||
// keys: [
|
||||
// { id: 'subject', title: '項目名稱', value: '' },
|
||||
// { id: 'kindTxt', title: '項目分類' },
|
||||
// { id: 'num', visible: false },
|
||||
// ],
|
||||
// api_url: HTTP_HOST + 'api/activity/GetOrderList',
|
||||
// columns: [
|
||||
// { id: 'subject', title: '項目名稱' },
|
||||
// { id: 'kindTxt', title: '項目分類' },
|
||||
// ],
|
||||
// selected: {},
|
||||
// select(item, t) {
|
||||
// t.print_search.select_actitem = item.num;
|
||||
// }
|
||||
// }
|
||||
|
||||
// }, show: false,
|
||||
// current: {},
|
||||
// list: [],
|
||||
// count: 0,
|
||||
// page: 1,
|
||||
// loading: false,
|
||||
// footer: {
|
||||
// showFirstLastPage: true,
|
||||
// disableItemsPerPage: true,
|
||||
// itemsPerPageAllText: '',
|
||||
// itemsPerPageText: '',
|
||||
// },
|
||||
// },
|
||||
// search: {
|
||||
// keyin1: '',
|
||||
// order_no: '',
|
||||
// subject: '',
|
||||
// u_name: '',
|
||||
// up_time1: '',
|
||||
// up_time2: '',
|
||||
// actItemTxt: '',
|
||||
// introducerTxt: '',
|
||||
// activity_num: '',
|
||||
// country: '',
|
||||
// country2: '',
|
||||
// hasPrice: '',
|
||||
// }
|
||||
// }
|
||||
// },
|
||||
// mounted() {
|
||||
// this.loadData()
|
||||
// },
|
||||
// methods: {
|
||||
// loadData(clearpage = false) {
|
||||
// const { sortBy, sortDesc, page, itemsPerPage } = this.options
|
||||
// //page = this.data_table.page;
|
||||
// let search = {}
|
||||
// const params = {
|
||||
// sortBy: sortBy[0], sortDesc: sortDesc[0],
|
||||
// page: clearpage ? '1' : page, pageSize: itemsPerPage
|
||||
// };
|
||||
// this.data_table.loading = true
|
||||
// axios
|
||||
// .post(HTTP_HOST + 'api/preOrder/GetPreOrder', search, { params: params })
|
||||
// .then(response => {
|
||||
// console.log(response)
|
||||
// this.data_table.list = response.data.list
|
||||
// this.data_table.count = response.data.count;
|
||||
// this.data_table.loading = false
|
||||
|
||||
// const dataToStore = JSON.stringify(this.data_table);
|
||||
// //sessionStorage.setItem("order_list_cache", dataToStore);
|
||||
// })
|
||||
// .catch(error => console.log(error))
|
||||
// },
|
||||
// search_headers() {
|
||||
|
||||
// },
|
||||
// search_select() {
|
||||
|
||||
// }
|
||||
// },
|
||||
// watch: {
|
||||
|
||||
// },
|
||||
// computed: {
|
||||
// pageCount() {
|
||||
// return Math.ceil(this.data_table.count / this.data_table.pageSize)
|
||||
// },
|
||||
// }
|
||||
//});
|
||||
</script>
|
||||
</asp:Content>
|
||||
|
||||
|
||||
@@ -50,13 +50,13 @@
|
||||
style="top: 5vh !important; left: 5vw !important; display: flex; margin: auto !important; width: 100% !important; height: 100% !important; ">
|
||||
|
||||
<!-- Modal Window Box -->
|
||||
<div class="modal-window" style="height: 100% !important; width: 100% !important; overflow: auto !important; width: 80vw !important; height: 80vh !important; ">
|
||||
<div class="modal-window" style="height: 100% !important; width: 100% !important; ">
|
||||
<header class="modal-header">
|
||||
<!--<h2>Modal Title</h2>-->
|
||||
<button @click="closeModal" class="close-btn">×</button>
|
||||
</header>
|
||||
|
||||
<main class="modal-body" style="overflow-y:auto;">
|
||||
<main class="modal-body" style="overflow: auto !important; height: 100% !important; width: 100% !important; width: 80vw !important; height: 80vh !important; ">
|
||||
<!-- Async component loaded dynamically via v-if -->
|
||||
<receipt-component :form-data="formData" @close-dialog="closeModal" mode="preOrder" :order_no="receiptComponent.order_no" :total_amt="receiptComponent.total_amt" />
|
||||
</main>
|
||||
@@ -68,7 +68,13 @@
|
||||
|
||||
<script>
|
||||
module.exports = {
|
||||
props: ['formData'],
|
||||
props: {
|
||||
formData: {},
|
||||
search: {
|
||||
|
||||
},
|
||||
|
||||
},
|
||||
name:"ParentComponent",
|
||||
components: {
|
||||
// Add .then(m => m.default || m) to safely handle module.exports
|
||||
@@ -83,7 +89,7 @@
|
||||
order_no: "",
|
||||
total_amt:0
|
||||
},
|
||||
search: {},
|
||||
|
||||
data_table: {
|
||||
loading: true,
|
||||
list: [],
|
||||
@@ -95,10 +101,10 @@
|
||||
header: [
|
||||
{ text: '信眾', value: 'f_name' },
|
||||
{ text: '報名單號', value: 'order_no' },
|
||||
{ text: '收據號碼', value: 'receipt_num' },
|
||||
{ text: '活動', value: 'act_name'},
|
||||
{ text: '功德項目數量', value: 'item_count' },
|
||||
{ text: '總金額', value: 'total_amt' },
|
||||
{ text: '收據金額', value: 'receipt_amt' },
|
||||
{ text: '登錄人員', value: 'admin_num' },
|
||||
{ text: '登錄時間', value: 'reg_time' },
|
||||
{ text: '', value: 'slot_btn', sortable: false, align: 'end' }
|
||||
@@ -132,16 +138,17 @@
|
||||
this.$emit('custom-event', { action: 'add' });
|
||||
},
|
||||
loadData(clearpage = false) {
|
||||
|
||||
const { sortBy, sortDesc, page, itemsPerPage } = this.options
|
||||
//page = this.data_table.page;
|
||||
let search = {}
|
||||
//let search = {}
|
||||
const params = {
|
||||
sortBy: "", sortDesc: false,
|
||||
page: clearpage ? '1' : page, pageSize: itemsPerPage
|
||||
};
|
||||
this.data_table.loading = true
|
||||
axios
|
||||
.post(HTTP_HOST + 'api/preOrder/GetPreOrder', search, { params: params })
|
||||
.post(HTTP_HOST + 'api/preOrder/GetPreOrder', this.search, { params: params })
|
||||
.then(response => {
|
||||
console.log(response)
|
||||
this.data_table.list = response.data.list
|
||||
|
||||
@@ -54,6 +54,10 @@
|
||||
<template>
|
||||
<v-card>
|
||||
<v-card-title>
|
||||
|
||||
<v-text-field v-model="picker.search.name" :label="picker.search.text" @keyup.enter.prevent=""></v-text-field>
|
||||
</v-card-title>
|
||||
<v-card-text>
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<v-data-table v-model="picker.data_table.selected"
|
||||
@@ -96,11 +100,11 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</v-card-title>
|
||||
<v-card-text>
|
||||
</v-card-text>
|
||||
<v-card-actions>
|
||||
<v-btn @click.prevent="picker.show=false">關閉</v-btn>
|
||||
<v-btn @click.prevent="picker_confirm()">確認</v-btn>
|
||||
</v-card-text>
|
||||
</v-card-actions>
|
||||
</v-card>
|
||||
</template>
|
||||
</v-dialog>
|
||||
@@ -162,7 +166,12 @@
|
||||
showFirstLastPage: true,
|
||||
itemsPerPageOptions: [5, 10, 20, 30],
|
||||
},
|
||||
}
|
||||
},
|
||||
search: {
|
||||
name: "",
|
||||
text: "法會名稱"
|
||||
},
|
||||
change: 0
|
||||
},
|
||||
snackbar: {
|
||||
show: false,
|
||||
@@ -171,11 +180,17 @@
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
options: {
|
||||
handler() {
|
||||
"picker.target": {
|
||||
handler(newVal) {
|
||||
if (this.picker.target === "follower") {
|
||||
this.picker.search.name = ""
|
||||
this.picker.search.text = "信眾姓名"
|
||||
this.picker.change++
|
||||
this.getFollowers()
|
||||
} else if (this.picker.target === "act") {
|
||||
this.picker.search.name = ""
|
||||
this.picker.search.text = "法會名稱"
|
||||
this.picker.change++
|
||||
this.getActivity()
|
||||
}
|
||||
},
|
||||
@@ -212,7 +227,7 @@
|
||||
const { sortBy, sortDesc, page, itemsPerPage } = this.options
|
||||
const params = {
|
||||
sortBy: "num", sortDesc: false,
|
||||
page: page, pageSize: itemsPerPage
|
||||
page: page??1, pageSize: itemsPerPage??10
|
||||
};
|
||||
this.picker.data_table.loading = true;
|
||||
let search = {}
|
||||
@@ -233,7 +248,7 @@
|
||||
const { sortBy, sortDesc, page, itemsPerPage } = this.options
|
||||
const params = {
|
||||
sortBy: "num", sortDesc: false,
|
||||
page: page, pageSize: itemsPerPage
|
||||
page: page??1, pageSize: itemsPerPage??10
|
||||
};
|
||||
this.picker.data_table.loading = true;
|
||||
let search = {}
|
||||
|
||||
@@ -676,7 +676,16 @@
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
||||
checkPreOrder() {
|
||||
axios
|
||||
.post(HTTP_HOST + 'api/preOrder/CheckPreVsOrder', {order_no:this.order_no})
|
||||
.then(response => {
|
||||
console.log(response)
|
||||
let resp = response.data;
|
||||
this.snackbar.text = resp.message;
|
||||
this.snackbar.show = true;
|
||||
})
|
||||
},
|
||||
getPreOrder() {
|
||||
let search = { order_no: this.order_no }
|
||||
axios
|
||||
@@ -2076,19 +2085,29 @@
|
||||
</div>
|
||||
<div class="tab-pane fade label-sm-right" id="sec2-page2" role="tabpanel" aria-labelledby="sec2-tab2">
|
||||
|
||||
<div class="d-flex w-100">
|
||||
|
||||
<v-card class="mx-auto" outlined v-if="order_no!=''">
|
||||
<v-card-title>
|
||||
|
||||
<%if (IsPreOrder == "true")
|
||||
{ %>
|
||||
<div class="container-lg" >
|
||||
<div class="row">
|
||||
<div class="col-12 col-md-6 ">
|
||||
<div class="col-12 col-md-4 ">
|
||||
客堂登記功德項目數:{{ preOrder.item_count }}
|
||||
</div>
|
||||
<div class="col-12 col-md-6 ">
|
||||
<div class="col-12 col-md-4 ">
|
||||
客堂登記總金額:{{ preOrder.total_amt }}
|
||||
</div>
|
||||
<div class="col-12 col-md-6 "></div>
|
||||
<div class="col-12 col-md-6 "></div>
|
||||
<div class="col-12 col-md-4 ">
|
||||
<button class="btn btn-primary" title="檢查客堂登記與文書組登打差異" @click.prevent="checkPreOrder">檢查</button>
|
||||
</div>
|
||||
<%--<div class="col-12 col-md-6 "></div>--%>
|
||||
</div>
|
||||
</div>
|
||||
<v-card class="mx-auto" outlined v-if="order_no!=''">
|
||||
<% } %>
|
||||
|
||||
</v-card-title>
|
||||
<v-data-table
|
||||
:headers="headersDetail"
|
||||
:items="desserts"
|
||||
|
||||
@@ -20,11 +20,13 @@ public partial class admin_order_reg : MyWeb.config
|
||||
public string _org_from_id_cuz_data = "";
|
||||
public string _org_activity_cuz_data = "";
|
||||
public Dictionary<int, string> _keyin1Item = null;
|
||||
public string IsPreOrder="false";
|
||||
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
if (!IsPostBack)
|
||||
{
|
||||
IsPreOrder = ConfigurationManager.AppSettings["IsPreOrder"];
|
||||
Model.pro_order order = new Model.pro_order();
|
||||
ArrayList options = order.keyin1_list();
|
||||
foreach (Model.pro_order.keyin optionKey in options)
|
||||
|
||||
Reference in New Issue
Block a user