diff --git a/src/components/period_select.vue b/src/components/period_select.vue
new file mode 100644
index 0000000..9220387
--- /dev/null
+++ b/src/components/period_select.vue
@@ -0,0 +1,138 @@
+
+
+
+ false">
+ 日期范围
+
+
+ 开始时间
+
+
+
+
+
+
+
+
+ 截止时间
+
+
+
+
+
+
+ 确定
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/pages.json b/src/pages.json
index fde19b2..5748c6f 100644
--- a/src/pages.json
+++ b/src/pages.json
@@ -895,6 +895,18 @@
"root": "subpackage/verification",
"pages": [
{
+ "path": "pages/null",
+ "style" : {
+ "navigationBarTitleText": "核销查询"
+ }
+ },
+ {
+ "path": "pages/record_search",
+ "style" : {
+ "navigationBarTitleText": "核销查询"
+ }
+ },
+ {
"path": "pages/index",
"style" : {
"navigationBarTitleText": "核销查询"
diff --git a/src/pages/index/index.vue b/src/pages/index/index.vue
index bca99c3..f2cdedc 100644
--- a/src/pages/index/index.vue
+++ b/src/pages/index/index.vue
@@ -116,7 +116,7 @@
{
id: 4,
name: '核销查询',
- path: '/pages/write_off/menu/menu',
+ path: '/subpackage/verification/pages/index',
serverKey: 1008 // 后端对应权限编号
},
{
diff --git a/src/pages/order_search/order_search.vue b/src/pages/order_search/order_search.vue
index 55704f9..db552fc 100644
--- a/src/pages/order_search/order_search.vue
+++ b/src/pages/order_search/order_search.vue
@@ -3,7 +3,7 @@
-
+
diff --git a/src/subpackage/verification/components/head_bar.vue b/src/subpackage/verification/components/head_bar.vue
index ec64299..b442c13 100644
--- a/src/subpackage/verification/components/head_bar.vue
+++ b/src/subpackage/verification/components/head_bar.vue
@@ -6,7 +6,7 @@
-
+
diff --git a/src/subpackage/verification/components/record/dy_item.vue b/src/subpackage/verification/components/record/dy_item.vue
index 9ef52f5..95af761 100644
--- a/src/subpackage/verification/components/record/dy_item.vue
+++ b/src/subpackage/verification/components/record/dy_item.vue
@@ -1,21 +1,21 @@
- 欧轩智能羽毛球馆(永泰店)
+
- 订单编号:20195175645666
+ 订单编号:{{ orderNum || '-' }}
- 用户信息:18316553852(yiming)
+ 用户信息:{{ userPhone || '-' }}
- 券码: 200801108978
+ 券码: {{ verifyCode || '-' }}
- 验证方式:扫码器验证(欧轩门闸)
+ 验证方式:{{ verifyMethod || '-' }}
- 核销时间:2021-05-17 11:12:58
+ 核销时间:{{ verifyTime || '-' }}
@@ -23,7 +23,14 @@
diff --git a/src/subpackage/verification/components/record/mall_item.vue b/src/subpackage/verification/components/record/mall_item.vue
new file mode 100644
index 0000000..a703a57
--- /dev/null
+++ b/src/subpackage/verification/components/record/mall_item.vue
@@ -0,0 +1,95 @@
+
+
+
+ 订单编号:{{ orderNum || '-' }}
+ 复制
+
+
+
+ 取货码:{{ orderCode || '-' }}
+
+
+ 取货人:{{ userName || '-' }} {{ userPhone || '-' }}
+
+
+ 商品:{{ goodsStr || '-' }}
+
+
+ 核验人:{{ optUser || '-' }}
+
+
+ 取货时间:{{ createdAt || '-' }}
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/subpackage/verification/components/record/site_item.vue b/src/subpackage/verification/components/record/site_item.vue
index 1d6ba60..11345ae 100644
--- a/src/subpackage/verification/components/record/site_item.vue
+++ b/src/subpackage/verification/components/record/site_item.vue
@@ -1,40 +1,45 @@
- 欧轩智能羽毛球馆(永泰店)
+ {{ stadiumName || '-' }}
- 订单编号:20195175645666
- (租场)
+ 订单编号:{{ orderNum || '-' }}
+ ({{ orderType || '-' }})
- 用户信息:18316553852(yiming)
+ 用户信息:{{ userPhone || '-' }}({{ userNickname || '-' }})
- 核销码: 200801108978
+ 核销码: {{ verifyCode || '-' }}
- 验证方式:扫码器验证(欧轩门闸)
+ 验证方式:{{ verifyMethod || '-' }}
- 核销时间:2021-05-17 11:12:58
+ 核销时间:{{ verifyTime || '-' }}
- 离场时间:2021-05-17 11:12:58
+ 离场时间:{{ verifyLeaveTime || '-' }}
- 手动离场
+ 手动离场
-
+
diff --git a/src/subpackage/verification/components/stadium_picker.vue b/src/subpackage/verification/components/stadium_picker.vue
index e69de29..95b9fa5 100644
--- a/src/subpackage/verification/components/stadium_picker.vue
+++ b/src/subpackage/verification/components/stadium_picker.vue
@@ -0,0 +1,15 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/subpackage/verification/js/api.js b/src/subpackage/verification/js/api.js
index c2e5897..e354cda 100644
--- a/src/subpackage/verification/js/api.js
+++ b/src/subpackage/verification/js/api.js
@@ -8,6 +8,11 @@ export const SUB_API = {
timingOpen: `${ORIGIN}/stadium/person/timing/open`, // 【20220208】凌晨自动清零【开/关】
// tid1803
enterVerifyOrder: `${ORIGIN}/admin/stadium/order/enterVerifyOrder`, // 商家助手-核销查询-输入验证码
+ listVerifyRecord: `${ORIGIN}/admin/stadium/order/listVerifyRecord`, // 商家助手-核销查询列表
+ leaveVerifyOrder:`${ORIGIN}/admin/stadium/order/leaveVerifyOrder`, // 【20220208】核销记录列表 - 手动离场
+ dyPoiOrderList: `${ORIGIN}/admin/douyinPlatformProductOrder/list`, // 商家助手-dypoi订单
+ shop2WriteoffList: `${ORIGIN}/admin/assistant/shop2/writeoffList`, // 商城订单核销 - 列表
+
}
diff --git a/src/subpackage/verification/pages/index.vue b/src/subpackage/verification/pages/index.vue
index 1a2c098..3a8f01e 100644
--- a/src/subpackage/verification/pages/index.vue
+++ b/src/subpackage/verification/pages/index.vue
@@ -10,7 +10,7 @@
可输入订场、次卡、年月卡、赛事、商城到店领取商品的验证码/券码进行核销,或点扫码图标进入扫描界面扫码核销。
- 确认
+ 确认
@@ -22,7 +22,7 @@
现场人数
-
+
核销记录
@@ -34,7 +34,7 @@
import API from "../js/api.js";
import server from "../js/server.js";
-import { showLoad, hideLoad, showModal, showNone, debounce, changeLowerCase, $_emit, routeTo } from "@/utils/util.js";
+import { showLoad, hideLoad, showModal, showNone, debounce, changeLowerCase, $_emit, routeTo, jsonStr } from "@/utils/util.js";
import { WRITE_OFF_ORDER_INFO } from '@/js/once_name';
import headBar from "../components/head_bar.vue";
export default {
@@ -64,6 +64,20 @@ export default {
let { brand_id } = this;
routeTo(`/subpackage/blacklist/pages/abnormal_list/abnormal_list?brand_id=${brand_id}`, 'nT');
},
+ toRecord(){
+ let { brand_id } = this;
+ routeTo(`/subpackage/verification/pages/record?brand_id=${brand_id}`, 'nT');
+ },
+ confirmBtn: debounce(function(){
+ let { iptCode } = this;
+ let { curStadium } = this;
+ if(!curStadium?.id)return showModal({ content: '请选择场馆!' });
+ this.verifyOrder({
+ brand_id: curStadium?.brand_id ?? '',
+ stadium_id: curStadium?.id ?? '',
+ verify_code: iptCode ?? '',
+ })
+ }, 300, true),
scanCode: debounce(function(){
let { curStadium } = this;
if(!curStadium?.id)return showModal({ content: '请选择场馆!' });
@@ -72,12 +86,11 @@ export default {
scanType: 'qrCode',
success: res=> {
if(changeLowerCase(res.scanType) !== 'qr_code')return showNone('不支持此类型!');
- console.log('扫码结果--->', res);
let { curStadium } = this;
this.verifyOrder({
- brand_id: curStadium?.brand_id || '',
- stadium_id: curStadium?.id || '',
- decrypt_text: res?.result || '',
+ brand_id: curStadium?.brand_id ?? '',
+ stadium_id: curStadium?.id ?? '',
+ decrypt_text: res?.result ?? '',
})
},
fail: function(err) {
@@ -158,13 +171,13 @@ export default {
routeTo(`/pages/write_off/events_order/events_order?type=${_vType}`, 'nT');
return
}
-
+ // 场次、次卡
$_emit(WRITE_OFF_ORDER_INFO, { ..._orderData });
routeTo(`/pages/write_off/confirm_order/confirm_order?type=${_vType}`, 'nT');
+ }else if(_data.code === 805){
+ routeTo(`/subpackage/verification/pages/null?tip=${jsonStr(_data?.message ?? '')}`, 'nT');
}else{
- if(!_vType)return Promise.reject(_data);
- routeTo(`/pages/write_off/null/null?type=${_vType}`, 'nT');
- // return Promise.reject(_data);
+ return Promise.reject(_data);
}
})
.catch(err => {
diff --git a/src/subpackage/verification/pages/null.vue b/src/subpackage/verification/pages/null.vue
new file mode 100644
index 0000000..1796319
--- /dev/null
+++ b/src/subpackage/verification/pages/null.vue
@@ -0,0 +1,62 @@
+
+
+
+
+
+ {{ tip || '很抱歉!获取找不到订单信息' }}
+ 返回
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/subpackage/verification/pages/record.vue b/src/subpackage/verification/pages/record.vue
index dcfab7b..a0ad1f7 100644
--- a/src/subpackage/verification/pages/record.vue
+++ b/src/subpackage/verification/pages/record.vue
@@ -1,26 +1,63 @@
-
- 2024.04.09 至 2024.05.09
+
+ {{ showPeriodStr }}
- 核销数量:30
+ 核销数量:{{ recordLs.length || 0 }}
-
-
-
+
+
+
+
+
+
+
+
+
@@ -28,22 +65,266 @@
import headBar from "../components/head_bar.vue";
import siteItem from "../components/record/site_item.vue";
import dyItem from "../components/record/dy_item.vue";
+import mallItem from "../components/record/mall_item.vue";
+import periodSelect from "@/components/period_select.vue";
+import { formatDate, showLoad, hideLoad, showModal, showNone, debounce, formatTime, routeTo } from "@/utils/util";
+import API from "../js/api.js";
+import server from "../js/server.js";
export default {
- components: { headBar, siteItem, dyItem },
+ components: { headBar, siteItem, dyItem, mallItem, periodSelect },
+ computed: {
+ // 展示时间段字符串
+ showPeriodStr(){
+ let { periodStr } = this;
+ return periodStr ? periodStr.replace(/\_/, ' 至 ').replace(/\-/g, '.') : ''
+ },
+ // 时间段对象
+ periodObj(){
+ let { periodStr } = this;
+ if(!periodStr)return {};
+ let [start, end] = periodStr.split('_');
+ return {
+ start: start ?? '',
+ end: end ?? '',
+ }
+ },
+ },
+ watch: {
+ periodStr(nVal, oVal){
+ if(oVal&&nVal&&nVal !== oVal)this.refreshRecordLs();
+ },
+ curTab(nVal, oVal){
+ if(nVal !== oVal)this.reloadRecordLs();
+ }
+ },
data(){
return {
+ brand_id: '',
+ tabs: [ '场地核销记录', '抖音核销记录', '商城核销记录' ],
curTab: 0,
+ periodStr: '',/** ex: 2025-01-01_2025-01-02 */
+ stadiumList: [],
+ curStadium: {},
+ recordLs: [],
+ page: 1,
}
},
+ async onLoad(options){
+ this.brand_id = options?.brand_id ?? '';
+ this.getStadiumLs({ brand_id: options?.brand_id ?? '' });
+ this.reloadRecordLs();
+ },
+ onReachBottom(){
+ let { curStadium, periodObj, page, brand_id } = this;
+ this.getRecordLs({
+ brand_id: brand_id ?? '',
+ stadium_id: curStadium?.id ?? '',
+ start_time: periodObj?.start ?? '',
+ end_time: periodObj?.end ?? '',
+ page: page + 1,
+ });
+ },
methods: {
-
+ // 搜索
+ toSearch(){
+ let { brand_id, curTab } = this;
+ routeTo(`/subpackage/verification/pages/record_search?brand_id=${brand_id}&type=${curTab}`, 'nT');
+ },
+ // 手动离场
+ siteLeaveBtn: debounce(function(e, idx){
+ console.log(e, idx);
+ showModal({
+ content: '是否确认手动离场?',
+ showCancel: true,
+ success: async mRes=>{
+ if(mRes.confirm){
+ let _status = await this.leaveVerifyOrder({ brand_id: e?.brand_id ?? '', id: e?.id ?? '' });
+ if(_status)this.recordLs[idx].verify_leave_time = formatTime(new Date());
+ this.$forceUpdate();
+ }
+ }
+ })
+ }, 300, true),
+ // 初始化时间段
+ initPeriodStr(){
+ let _today = new Date();
+ let _todayTimestamp = _today.getTime();
+ let _eStr = formatDate({ date: _today });
+ let _first30DaysTimestamp = _todayTimestamp - 30 * 24 * 60 * 60 * 1000;
+ let _sStr = formatDate({ date: new Date(_first30DaysTimestamp) });
+ return this.periodStr = `${_sStr}_${_eStr}`;
+ },
+ showPeriodModal(){
+ this.$refs?.periodSelect?.show?.();
+ },
+ // 门店切换
+ stadiumChange(e){
+ let { stadiumList } = this;
+ let _curStadium = stadiumList?.[e?.detail?.value ?? 0] ?? {};
+ this.curStadium = _curStadium;
+ this.refreshRecordLs();
+ },
+ // 加载/ 切换订单类型
+ reloadRecordLs(){
+ let { brand_id } = this;
+ this.page = 1;
+ this.recordLs = [];
+ this.initPeriodStr();
+ let { periodObj, curStadium } = this;
+ this.getRecordLs({
+ brand_id: brand_id ?? '' ,
+ stadium_id: curStadium.id ?? '',
+ start_time: periodObj.start,
+ end_time: periodObj.end,
+ });
+ },
+ // 切换门店/时间
+ refreshRecordLs(){
+ let { curStadium, periodObj, brand_id } = this;
+ this.page = 1;
+ this.recordLs = [];
+ this.getRecordLs({
+ brand_id: brand_id ?? '',
+ stadium_id: curStadium?.id ?? '',
+ start_time: periodObj?.start ?? '',
+ end_time: periodObj?.end ?? '',
+ });
+ },
+ // 获取门店列表
+ getStadiumLs({ brand_id }){
+ showLoad();
+ return server.post({
+ url: API.stadiumList,
+ data: { page_size: 9999, page: 1, brand_id },
+ isDefaultGet: false,
+ })
+ .then(res => {
+ hideLoad();
+ let _data = res?.data || {};
+ if(_data.code === 0){
+ let _ls = _data?.data?.list || [];
+ this.stadiumList = _ls;
+ return _ls;
+ }else{
+ return Promise.reject(_data);
+ }
+ })
+ .catch(err => {
+ hideLoad();
+ showModal({
+ title: '提示',
+ content: err.message || '加载门店失败!'
+ })
+ console.warn('verification record getStadiumLs err --->', err);
+ // return Promise.reject(err);
+ })
+ },
+ // 商家助手-核销查询列表
+ getRecordLs({ brand_id, stadium_id = '', start_time = '', end_time = '', page = 1, page_size = 20 }){
+ showLoad();
+ return server.post({
+ url: this.getRecordLsAPI(),
+ data: this.formatQuery({ brand_id, stadium_id, start_time, end_time, page, page_size }),
+ isDefaultGet: false,
+ })
+ .then(res => {
+ hideLoad();
+ let _data = res?.data || {};
+ if(_data.code === 0){
+ let _ls = this.formatRecordLs(_data?.data?.list || []);
+ if(page === 1)return this.recordLs = _ls;
+ if(!_ls.length)return showNone('没有更多!');
+ this.page = page;
+ this.recordLs = [ ...this.recordLs, ..._ls ];
+ return _ls;
+ }else{
+ return Promise.reject(_data);
+ }
+ })
+ .catch(err => {
+ hideLoad();
+ showModal({
+ title: '提示',
+ content: err.message || '加载数据失败!'
+ })
+ console.warn('verification record getRecordLs err --->', err);
+ // return Promise.reject(err);
+ })
+ },
+ // 获取记录列表API
+ getRecordLsAPI(){
+ let { curTab } = this;
+ if(curTab === 0)return API.listVerifyRecord
+ if(curTab === 1)return API.dyPoiOrderList
+ if(curTab === 2)return API.shop2WriteoffList
+ },
+ // 格式化查询参数
+ formatQuery(query){
+ let { curTab } = this;
+ if(curTab === 1)query['order_status'] = 'used';
+ if(curTab === 2){
+ query['stime'] = query?.start_time ?? '';
+ query['etime'] = query?.end_time ?? '';
+ delete query.start_time
+ delete query.end_time
+ }
+ return query;
+ },
+ // 格式化数据
+ formatRecordLs(ls){
+ let { curTab } = this;
+ // 抖音
+ if(curTab === 1){
+ return ls.map(item=>{
+ let _code = item?.order_codes?.find(e=>e?.code_status == 'used');
+ console.log('_code',item);
+ return {
+ order_no: item?.order_no ?? '',
+ user_phone: item?.mobile ?? '',
+ verify_code: _code?.code ?? '',
+ verify_method: _code?.verification_method ?? '',
+ verify_time: _code?.verification_time ?? '',
+ };
+ })
+ }
+ return ls;
+ },
+ // 核销记录列表 - 手动离场
+ leaveVerifyOrder({ brand_id, id }){
+ showLoad();
+ return server.post({
+ url: API.leaveVerifyOrder,
+ data: { brand_id, id },
+ isDefaultGet: false,
+ })
+ .then(res => {
+ hideLoad();
+ let _data = res?.data || {};
+ if(_data.code === 0){
+ showNone(_data?.message || '操作成功!')
+ return true;
+ }else{
+ return Promise.reject(_data);
+ }
+ })
+ .catch(err => {
+ hideLoad();
+ showModal({
+ title: '提示',
+ content: err.message || '操作失败!'
+ })
+ console.warn('verification record leaveVerifyOrder err --->', err);
+ // return Promise.reject(err);
+ return false;
+ })
+ },
}
}
\ No newline at end of file
diff --git a/src/subpackage/verification/static/images/order/null_code.png b/src/subpackage/verification/static/images/order/null_code.png
new file mode 100644
index 0000000..a1e5134
Binary files /dev/null and b/src/subpackage/verification/static/images/order/null_code.png differ
diff --git a/src/subpackage/verification/static/images/order/null_range.png b/src/subpackage/verification/static/images/order/null_range.png
new file mode 100644
index 0000000..9dcfdcb
Binary files /dev/null and b/src/subpackage/verification/static/images/order/null_range.png differ
diff --git a/src/subpackage/verification/static/images/order/null_search.png b/src/subpackage/verification/static/images/order/null_search.png
new file mode 100644
index 0000000..b8a2037
Binary files /dev/null and b/src/subpackage/verification/static/images/order/null_search.png differ
diff --git a/src/subpackage/verification/static/images/round_close.png b/src/subpackage/verification/static/images/round_close.png
new file mode 100644
index 0000000..c563ecb
Binary files /dev/null and b/src/subpackage/verification/static/images/round_close.png differ