|
|
@ -134,6 +134,15 @@ |
|
|
|
</view> |
|
|
|
<view class="cr-btn" @click="depositRefundBtn" v-if="orderInfo.order_type == 'deposit'&&orderInfo.pay_status == 2">退押金</view> |
|
|
|
<view class="cr-btn" @click="overBillingBtn" v-if="orderInfo.order_type != 'deposit'&&orderInfo.pay_status == 1">结束计费</view> |
|
|
|
<!-- <view class="cr-btn" @click="overBillingBtn">结束计费</view> --> |
|
|
|
|
|
|
|
<end-billing |
|
|
|
v-if = 'isShowEndBilling' |
|
|
|
@close = 'isShowEndBilling = false' |
|
|
|
@confirm = 'endBillingBtn' |
|
|
|
:orderInfo = 'orderInfo' |
|
|
|
></end-billing> |
|
|
|
|
|
|
|
</view> |
|
|
|
</template> |
|
|
|
|
|
|
@ -141,48 +150,87 @@ |
|
|
|
import { ORDER_API } from '../../../js/api'; |
|
|
|
import server from '../../../js/server'; |
|
|
|
import a_line from '../../../../../components/order_list/a_line/a_line.vue'; |
|
|
|
import end_billing from '../../../components/club_rental/end_billing/end_billing.vue'; |
|
|
|
import util from '../../../../../utils/util'; |
|
|
|
|
|
|
|
// 租用中 1 已完成2 已退款4 |
|
|
|
// 押金类型只有2,4 |
|
|
|
export default { |
|
|
|
components: { |
|
|
|
'a-line': a_line, |
|
|
|
'end-billing': end_billing |
|
|
|
}, |
|
|
|
data(){ |
|
|
|
return { |
|
|
|
orderInfo: { |
|
|
|
extension: {}, |
|
|
|
cabinet: {}, |
|
|
|
} |
|
|
|
}, |
|
|
|
isShowEndBilling: false, |
|
|
|
} |
|
|
|
}, |
|
|
|
onLoad(options){ |
|
|
|
this.getOrderInfo(options.order_no); |
|
|
|
this.getOrderInfo({ |
|
|
|
order_no: options.order_no, |
|
|
|
isEndBilling: !!+options.is_end || false |
|
|
|
}); |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
endBillingBtn: util.debounce(function(e){ |
|
|
|
this.isShowEndBilling = false; |
|
|
|
util.showModal({ |
|
|
|
title: '提示', |
|
|
|
content: `结算金额为${ e.amount || 0 }元`, |
|
|
|
showCancel: true, |
|
|
|
success: mRes => { |
|
|
|
if(mRes.confirm == true)this.endBillingReq(e.amount); |
|
|
|
} |
|
|
|
}) |
|
|
|
|
|
|
|
}, 300, true), |
|
|
|
overBillingBtn: util.debounce(function(){ |
|
|
|
let { orderInfo } = this; |
|
|
|
this.getOrderInfo({ |
|
|
|
order_no: orderInfo.order_no || '', |
|
|
|
isEndBilling: true |
|
|
|
}); |
|
|
|
|
|
|
|
}, 300, true), |
|
|
|
endBillingReq(amount = 0){ |
|
|
|
util.showLoad(); |
|
|
|
let { orderInfo } = this; |
|
|
|
server.post({ |
|
|
|
url: ORDER_API.rentballOrderEnd, |
|
|
|
url: ORDER_API.rentballEndBilling, |
|
|
|
data: { |
|
|
|
order_no: orderInfo.order_no |
|
|
|
order_no: orderInfo.order_no, |
|
|
|
pay_amount: amount, |
|
|
|
amount |
|
|
|
}, |
|
|
|
isDefaultGet: false, |
|
|
|
}) |
|
|
|
.then(res => { |
|
|
|
util.hideLoad(); |
|
|
|
|
|
|
|
if(res.data.code == 0){ |
|
|
|
util.showNone(res.data.message || '操作成功!'); |
|
|
|
setTimeout(_=>this.getOrderInfo(orderInfo.order_no), 1200); |
|
|
|
setTimeout(_=>{ |
|
|
|
this.getOrderInfo({ order_no: orderInfo.order_no }); |
|
|
|
util.previousPageFunction({ // 刷新上一页 |
|
|
|
fnName: 'refreshList', |
|
|
|
query: null |
|
|
|
}) |
|
|
|
}, 1200); |
|
|
|
}else{ |
|
|
|
util.showNone(res.data.message || '操作失败!'); |
|
|
|
} |
|
|
|
}) |
|
|
|
.catch(util.hideLoad) |
|
|
|
}), |
|
|
|
}, |
|
|
|
payTypeTxt: util.order_pay_type_txt, |
|
|
|
getOrderInfo(order_no = ''){ |
|
|
|
getOrderInfo({ |
|
|
|
order_no = '', |
|
|
|
isEndBilling = false |
|
|
|
}){ |
|
|
|
util.showLoad(); |
|
|
|
server.get({ |
|
|
|
url: ORDER_API.hardwareOrderInfo, |
|
|
@ -193,6 +241,7 @@ export default { |
|
|
|
util.hideLoad(); |
|
|
|
let _order = res || { extension: {} }; |
|
|
|
this.orderInfo = _order; |
|
|
|
this.isShowEndBilling = isEndBilling; |
|
|
|
}) |
|
|
|
}, |
|
|
|
depositRefundBtn: util.debounce(function(){ |
|
|
@ -348,4 +397,5 @@ export default { |
|
|
|
background-color: $themeColor; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
</style> |