|
|
@ -1,19 +1,19 @@ |
|
|
|
<template> |
|
|
|
<view class="write-off-success"> |
|
|
|
<view class="wos-stadium"> |
|
|
|
<view class="ws-name">欧轩智能羽毛球馆(永泰店)</view> |
|
|
|
<view class="ws-name">{{ optionsQuery.stadium_name || '-' }}</view> |
|
|
|
</view> |
|
|
|
<view class="wos-main"> |
|
|
|
<image class="wm-icon" mode="aspectFit" src="/static/images/icon/success_tip.png"></image> |
|
|
|
<view class="wm-txt">核销成功</view> |
|
|
|
<view class="wm-btn" hover-class="hover-active">返回继续核销</view> |
|
|
|
<view class="wm-btn" hover-class="hover-active" @click="toBack">返回继续核销</view> |
|
|
|
</view> |
|
|
|
<view class="wos-gate-ls"> |
|
|
|
<view class="wos-gate-ls" v-if="gateLs&&gateLs.length"> |
|
|
|
<view class="wgl-tit">如需开门,请点击</view> |
|
|
|
<view class="wgl-ls"> |
|
|
|
<view class="wl-item" v-for="i in 3" :key="i"> |
|
|
|
<view class="wi-name">欧轩门禁</view> |
|
|
|
<view class="wi-btn" hover-class="hover-active">开门</view> |
|
|
|
<view class="wl-item" v-for="(e, i) in gateLs" :key="i"> |
|
|
|
<view class="wi-name">{{ e.hardware_name || '-' }}</view> |
|
|
|
<view class="wi-btn" hover-class="hover-active" @click="openGate(e)">开门</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
@ -21,8 +21,83 @@ |
|
|
|
</template> |
|
|
|
|
|
|
|
<script> |
|
|
|
|
|
|
|
import util from '../../../utils/util'; |
|
|
|
import { API } from '../../../js/api'; |
|
|
|
import { servers } from '../../../js/server'; |
|
|
|
|
|
|
|
export default { |
|
|
|
data(){ |
|
|
|
return { |
|
|
|
gateLs: [], |
|
|
|
optionsQuery: { |
|
|
|
stadium_name: '', |
|
|
|
brand_id: '', |
|
|
|
order_no: '' |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
onLoad(options){ |
|
|
|
let _query = {}; |
|
|
|
try{ |
|
|
|
_query = util.jsonPar(options.query); |
|
|
|
console.warn('_query======》', _query) |
|
|
|
this.optionsQuery = _query || {}; |
|
|
|
}catch(err){ |
|
|
|
console.error('json err--->', err) |
|
|
|
} |
|
|
|
|
|
|
|
this.getGateLs({ |
|
|
|
order_no: _query.order_no || '', |
|
|
|
brand_id: _query.brand_id || '', |
|
|
|
}); |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
openGate: util.debounce(function(e){ |
|
|
|
let { optionsQuery } = this; |
|
|
|
util.showLoad(); |
|
|
|
servers.post({ |
|
|
|
url: API.writeOff.matchOrderGateOpen, |
|
|
|
data: { |
|
|
|
brand_id: optionsQuery.brand_id, |
|
|
|
order_no: optionsQuery.order_no, |
|
|
|
gate_id: e.id, |
|
|
|
}, |
|
|
|
isDefaultGet: false, |
|
|
|
}) |
|
|
|
.then(res=>{ |
|
|
|
util.hideLoad(); |
|
|
|
if(res.data.code == 0){ |
|
|
|
util.showNone(res.data.message || '操作成功!') |
|
|
|
}else{ |
|
|
|
util.showNone(res.data.message || '操作失败!'); |
|
|
|
} |
|
|
|
}) |
|
|
|
}, 300, true), |
|
|
|
getGateLs({ |
|
|
|
order_no, |
|
|
|
brand_id, |
|
|
|
}){ |
|
|
|
util.showLoad(); |
|
|
|
servers.get({ |
|
|
|
url: API.writeOff.matchOrderGateLs, |
|
|
|
data: { |
|
|
|
order_no, |
|
|
|
brand_id |
|
|
|
}, |
|
|
|
failMsg: '加载门禁列表失败!' |
|
|
|
}) |
|
|
|
.then(res=>{ |
|
|
|
util.hideLoad(); |
|
|
|
let _ls = res.gates || []; |
|
|
|
this.gateLs = _ls; |
|
|
|
console.warn(res) |
|
|
|
}) |
|
|
|
}, |
|
|
|
toBack(){ |
|
|
|
util.routeTo(); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
</script> |
|
|
|
|
|
|
|