Browse Source

add write_off all

voice
刘嘉炜 4 years ago
parent
commit
7286eaeeb3
  1. 4
      src/pages/write_off/confirm_order/confirm_order.vue
  2. 31
      src/pages/write_off/operate/operate.vue
  3. 60
      src/pages/write_off/search_result/search_result.vue

4
src/pages/write_off/confirm_order/confirm_order.vue

@ -65,7 +65,9 @@
<view>
<text>预定场次</text>
<view>
<view v-for="(e, i) in orderInfo.sessions" :key="i">{{e.date || ''}} {{e.duration || ''}}</view>
<view>
<block v-for="(e, i) in orderInfo.extension.spec_names" :key="i"> {{ i!=0?'+':'' }}{{ e || '-' }} </block>
</view>
</view>
</view>
</view>

31
src/pages/write_off/operate/operate.vue

@ -46,20 +46,20 @@ export default {
},
methods: {
scanCodeBtn: util.debounce(function(){
uni.scanCode({
onlyFromCamera: true,
scanType: 'qrCode',
success: res=> {
console.warn('success--->', res);
if(util.changeLowerCase(res.scanType) !== 'qr_code')return util.showNone('不支持此类型!');
console.warn(res.result)
this.analysisOrder({ decrypt_text: res.result });
},
fail: function(err) {
util.showNone('扫码失败!');
console.warn('扫码失败--->', err);
}
})
uni.scanCode({
onlyFromCamera: true,
scanType: 'qrCode',
success: res=> {
console.warn('success--->', res);
if(util.changeLowerCase(res.scanType) !== 'qr_code')return util.showNone('不支持此类型!');
console.warn(res.result)
this.analysisOrder({ decrypt_text: res.result });
},
fail: function(err) {
util.showNone('扫码失败!');
console.warn('扫码失败--->', err);
}
})
}, 300, true),
stadiumChange(e){
let { stadiumList } = this;
@ -83,12 +83,14 @@ export default {
}
if(!!verify_code)_query['verify_code'] = verify_code;
if(!!decrypt_text)_query['decrypt_text'] = decrypt_text;
util.showLoad();
servers.get({
url: API.writeOff.enterVerifyOrder,
data: _query,
isDefaultGet: false
})
.then(res=>{
util.hideLoad();
if(res.data.code == 0){
let _data = res.data.data || {}
util.$_emit(WRITE_OFF_ORDER_INFO, {..._data})
@ -99,6 +101,7 @@ export default {
}
console.log('订单查询---->', res);
})
.catch(util.hideLoad)
}
}

60
src/pages/write_off/search_result/search_result.vue

@ -10,33 +10,33 @@
</picker>
</view>
<view class="r-timer-select">
<picker mode="date">
<picker mode="date" @change="dateChange">
<view>
<text>核销日期2020-08-27</text>
<text>核销日期{{curDate || '-'}}</text>
<image mode="aspectFit" src="/static/images/icon/arrow_c33.png"></image>
</view>
</picker>
<view>核销数量{{writeOffList.length || 0}}</view>
</view>
<view class="r-order-list">
<view class="l-item" v-for="i in 10" :key="i">
<view class="i-name">欧轩智能羽毛球馆(永泰店)</view>
<view class="l-item" v-for="(e, i) in writeOffList" :key="i">
<view class="i-name">{{ e.extension.stadium_name || '-' }}</view>
<view class="i-lines">
<view>
<view>订单编号20195175645666</view>
<view>租场</view>
<view>订单编号{{ e.order_no || '-' }}</view>
<view>{{ e.type || '-' }}</view>
</view>
<view>
<view>用户昵称周大强</view>
<view>用户昵称{{ e.extension.nickname || '-' }}</view>
</view>
<view>
<view>核销码 200801108978</view>
<view>核销码 {{ e.verify_code || '-' }}</view>
</view>
<view>
<view>验证方式扫码器验证(pad)</view>
<view>验证方式{{ e.desc || '-' }}</view>
</view>
<view>
<view>核销时间2021-05-17 11:12:58</view>
<view>核销时间{{ e.verify_time || '-'}}</view>
</view>
</view>
</view>
@ -59,17 +59,40 @@ export default {
return {
stadiumList: [], //
curStadium: {}, //
writeOffList: [] //
writeOffList: [], // ,
curDate: util.formatDate({}),
}
},
onLoad(){
this.initPage();
},
onShow(){
let { curStadium, curDate } = this;
if(curStadium&&curStadium.id)this.getList({
brand_id: curStadium.brand_id || '',
stadium_id: curStadium.id,
date: curDate,
});
},
methods: {
dateChange(e){
let { curStadium } = this;
this.curDate = e.detail.value;
this.getList({
brand_id: curStadium.brand_id || '',
stadium_id: curStadium.id,
date: e.detail.value,
});
},
stadiumChange(e){
let { stadiumList } = this;
let { stadiumList, curDate } = this;
this.curStadium = stadiumList[e.detail.value];
this.getList({
brand_id: stadiumList[e.detail.value].brand_id || '',
stadium_id: stadiumList[e.detail.value].id,
date: curDate,
});
},
async initPage(){
let { brandInfo } = this;
@ -77,8 +100,11 @@ export default {
let _storeList = await this.getStoreList({ brand_id: brandInfo.brand.id || '' });
this.stadiumList = _storeList || [];
if(_storeList.length) this.curStadium = _storeList[0];
console.warn(util.formatDate({}))
this.getList({
brand_id: brandInfo.brand.id || ''
brand_id: brandInfo.brand.id || '',
stadium_id: _storeList[0].id,
date: util.formatDate({}),
});
}catch(err){
console.warn('加载数据失败!', err);
@ -92,13 +118,15 @@ export default {
})
util.routeTo(`/pages/write_off/operate/operate`, 'nT');
},
getList({ brand_id }){
getList({ brand_id, stadium_id = '', date = '' }){
util.showLoad();
servers.get({
url: API.writeOff.listVerifyRecord,
data: { brand_id },
data: { brand_id, stadium_id, date },
failMsg: '加载失败!',
})
.then(res=>{
util.hideLoad();
let _list = res.list || [];
this.writeOffList = _list;
console.warn(res, 'jijjjjjjjjj')

Loading…
Cancel
Save