功能條整
This commit is contained in:
@@ -42,7 +42,7 @@ namespace MyWeb
|
||||
}
|
||||
//定義欄位cookie==================end
|
||||
|
||||
private AdmItem JDecode(string json)
|
||||
public AdmItem JDecode(string json)
|
||||
{
|
||||
json = encrypt.DecryptAutoKey(json); //解密
|
||||
AdmItem mItem = JsonConvert.DeserializeObject<AdmItem>(json);
|
||||
|
||||
@@ -1,13 +1,16 @@
|
||||
using PagedList;
|
||||
using DocumentFormat.OpenXml.EMMA;
|
||||
using MINOM.COM.Utility;
|
||||
using MyWeb;
|
||||
using PagedList;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Configuration;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Text;
|
||||
using System.Web;
|
||||
using System.Web.Http;
|
||||
using MyWeb;
|
||||
using MINOM.COM.Utility;
|
||||
using System.Text;
|
||||
using static MyWeb.admin;
|
||||
// api/pre_order
|
||||
//[ezAuthorize(Roles = "admin")]//群組:*
|
||||
//[ezAuthorize]
|
||||
@@ -76,7 +79,8 @@ public class preOrderController: ApiController
|
||||
});
|
||||
}
|
||||
}
|
||||
catch (Exception ex) {
|
||||
catch (Exception ex)
|
||||
{
|
||||
return Ok(new
|
||||
{
|
||||
result = "N",
|
||||
@@ -97,7 +101,8 @@ public class preOrderController: ApiController
|
||||
{
|
||||
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)) {
|
||||
if (!string.IsNullOrEmpty(pre.order_no))
|
||||
{
|
||||
qry = qry.Where(x => x.order_no.Contains(pre.order_no));
|
||||
}
|
||||
if (!string.IsNullOrEmpty(pre.act_name))
|
||||
@@ -117,7 +122,16 @@ public class preOrderController: ApiController
|
||||
{
|
||||
list = qry.ToPagedList(page, pageSize).Select(x => new
|
||||
{
|
||||
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,
|
||||
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,
|
||||
admin_name=_db.admins.Where(q=>q.num==x.admin_num).Select(q=>q.u_name).FirstOrDefault(),
|
||||
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()
|
||||
@@ -142,6 +156,19 @@ public class preOrderController: ApiController
|
||||
{
|
||||
throw new Exception("已經報過名,請勿重複報名");
|
||||
}
|
||||
string scc = ConfigurationManager.AppSettings["shopCarCode"].ToString();
|
||||
int admin_num =0;
|
||||
|
||||
if (HttpContext.Current.Session[scc + "admin"] != null)
|
||||
{
|
||||
MyWeb.admin admin = new MyWeb.admin();
|
||||
AdmItem item = admin.JDecode(HttpContext.Current.Session[scc + "admin"].ToString());
|
||||
string info = item.u_id;
|
||||
if (!string.IsNullOrEmpty(info))
|
||||
{
|
||||
admin_num=_db.admins.Where(x => x.u_id == info).Select(x=>x.num).FirstOrDefault();
|
||||
}
|
||||
}
|
||||
|
||||
var qry = _db.followers.AsQueryable();
|
||||
qry = qry.Where(x => x.num == pre.f_num);
|
||||
@@ -154,7 +181,9 @@ public class preOrderController: ApiController
|
||||
preO.act_num = pre.act_num;
|
||||
preO.f_num = pre.f_num;
|
||||
preO.item_count = pre.item_count;
|
||||
|
||||
if (admin_num!=0) {
|
||||
preO.admin_num = admin_num;
|
||||
}
|
||||
preO.total_amt = pre.total_amt;
|
||||
preO.reg_time = DateTime.Now;
|
||||
|
||||
@@ -212,7 +241,8 @@ public class preOrderController: ApiController
|
||||
act_name = _db.activities.Where(w => w.num == x.act_num).Select(w => w.subject).FirstOrDefault(),
|
||||
}).FirstOrDefault()
|
||||
};
|
||||
if (ret.data == null) {
|
||||
if (ret.data == null)
|
||||
{
|
||||
return Ok(new { result = "N", message = "" });
|
||||
}
|
||||
;
|
||||
|
||||
@@ -8,8 +8,8 @@
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
|
||||
<div id="content" class="container-fluid py-4">
|
||||
<keep-alive>
|
||||
<component :is="currentView" ref="myChild"
|
||||
<keep-alive :exclude="['pre_order-component']">
|
||||
<component :is="currentView" ref="myChild" :reload="reload"
|
||||
@custom-event="changeView" :search="search">
|
||||
</component>
|
||||
</keep-alive>
|
||||
@@ -50,6 +50,7 @@
|
||||
order_no: '',
|
||||
f_name:'',
|
||||
},
|
||||
reload:0,
|
||||
}
|
||||
},
|
||||
components: {
|
||||
@@ -84,6 +85,7 @@
|
||||
if (item.action === "add") {
|
||||
this.currentView = "pre_order_reg-component";
|
||||
} else if (item.action === "list") {
|
||||
this.reload++;
|
||||
this.currentView = "pre_order-component";
|
||||
}
|
||||
},
|
||||
|
||||
@@ -14,7 +14,9 @@
|
||||
:page.sync="data_table.page"
|
||||
:items-per-page.sync="data_table.pageSize"
|
||||
class="elevation-1">
|
||||
|
||||
<template #item.reg_time="{ item }">
|
||||
{{ item.reg_time|timeString('YYYY/MM/DD') }}
|
||||
</template>
|
||||
<template #item.slot_btn="{ item }">
|
||||
<a @click.prevent="openReceipt(item)" class="btn btn-outline-secondary btn-sm"><i class="mdi mdi-receipt-text"></i>開立收據</a>
|
||||
<!--<a :href="'reg.aspx?order_no='+item.order_no" class="btn btn-outline-secondary btn-sm"><i class="mdi mdi-pencil-box-outline"></i>編輯</a>
|
||||
@@ -67,13 +69,18 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
Vue.filter('timeString', function (value, myFormat) {
|
||||
return value == null || value == "" ? "" : moment(value).format(myFormat || 'YYYY-MM-DD, HH:mm:ss');
|
||||
});
|
||||
module.exports = {
|
||||
props: {
|
||||
formData: {},
|
||||
search: {
|
||||
|
||||
},
|
||||
|
||||
reload: {
|
||||
type: Number
|
||||
}
|
||||
},
|
||||
name:"ParentComponent",
|
||||
components: {
|
||||
@@ -105,7 +112,7 @@
|
||||
{ text: '功德項目數量', value: 'item_count' },
|
||||
{ text: '總金額', value: 'total_amt' },
|
||||
{ text: '收據金額', value: 'receipt_amt' },
|
||||
{ text: '登錄人員', value: 'admin_num' },
|
||||
{ text: '登錄人員', value: 'admin_name' },
|
||||
{ text: '登錄時間', value: 'reg_time' },
|
||||
{ text: '', value: 'slot_btn', sortable: false, align: 'end' }
|
||||
],
|
||||
@@ -168,7 +175,18 @@
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
|
||||
options: {
|
||||
handler() {
|
||||
this.loadData()
|
||||
},
|
||||
deep: true,
|
||||
},
|
||||
reload: {
|
||||
handler() {
|
||||
this.loadData()
|
||||
},
|
||||
deep: true,
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
pageCount() {
|
||||
|
||||
@@ -55,7 +55,7 @@
|
||||
<v-card>
|
||||
<v-card-title>
|
||||
|
||||
<v-text-field v-model="picker.search.name" :label="picker.search.text" @keyup.enter.prevent=""></v-text-field>
|
||||
<v-text-field v-model="picker.search.name" :label="picker.search.text" @keyup.enter.prevent="getFollowers"></v-text-field>
|
||||
</v-card-title>
|
||||
<v-card-text>
|
||||
<div class="row">
|
||||
@@ -182,6 +182,11 @@
|
||||
watch: {
|
||||
"picker.target": {
|
||||
handler(newVal) {
|
||||
//this.options.page = 1;
|
||||
//this.options.pageSize = 10;
|
||||
this.options = { multiSort: false }
|
||||
this.picker.data_table.page = 1;
|
||||
this.picker.data_table.pageSize=10;
|
||||
if (this.picker.target === "follower") {
|
||||
this.picker.search.name = ""
|
||||
this.picker.search.text = "信眾姓名"
|
||||
@@ -196,7 +201,12 @@
|
||||
},
|
||||
deep: true,
|
||||
},
|
||||
|
||||
options: {
|
||||
handler() {
|
||||
this.getFollowers()
|
||||
},
|
||||
deep: true,
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
handleRowClick(item, row) {
|
||||
@@ -230,7 +240,7 @@
|
||||
page: page??1, pageSize: itemsPerPage??10
|
||||
};
|
||||
this.picker.data_table.loading = true;
|
||||
let search = {}
|
||||
let search = {u_name:this.picker.search.name}
|
||||
axios
|
||||
.post(HTTP_HOST + 'api/follower/GetList', search, { params: params })
|
||||
.then(response => {
|
||||
|
||||
@@ -973,7 +973,7 @@
|
||||
})
|
||||
return g;
|
||||
},
|
||||
renderNormal(mid, d)
|
||||
renderNormal(mid, d) {
|
||||
let self = this;
|
||||
let txt = $(`<div class='${d.elementID}'>${mid==undefined?"":mid}</div>`).css({
|
||||
"z-index": 9999, visibility: d.visibility,
|
||||
|
||||
Reference in New Issue
Block a user