浏览代码

Boutons de paiement

refactoring
父节点
当前提交
7eb39983f0
共有 2 个文件被更改,包括 16 次插入6 次删除
  1. +12
    -5
      backend/views/distribution/index.php
  2. +4
    -1
      backend/web/js/vuejs/distribution-index.js

+ 12
- 5
backend/views/distribution/index.php 查看文件

@@ -265,12 +265,19 @@ $this->setPageTitle('Distributions') ;
</td>
<td>
<div class="btn-group" v-if="order.user">
<button class="btn btn-xs btn-default" :data-id-order="order.id">
<span class="glyphicon glyphicon-euro"></span>
<span v-if="order.amount_paid == order.amount">Rembourser</span>
<span v-else-if="order.amount_paid == 0 || order.amount_paid < order.amount">Payer</span>
<span v-else-if="order.amount_paid > order.amount">Rembourser</span>
<button class="btn btn-xs btn-default" v-if="order.amount_paid == order.amount" @click="orderPaymentClick" :data-id-order="order.id" data-type="refund" :data-amount="order.amount">
<span class="glyphicon glyphicon-euro"></span> Rembourser
</button>
<button class="btn btn-xs btn-default" v-else-if="order.amount_paid == 0" @click="orderPaymentClick" :data-id-order="order.id" data-type="payment" :data-amount="order.amount">
<span class="glyphicon glyphicon-euro"></span> Payer
</button>
<button class="btn btn-xs btn-default" v-else-if="order.amount_paid < order.amount" @click="orderPaymentClick" :data-id-order="order.id" data-type="payment" :data-amount="order.amount_remaining">
<span class="glyphicon glyphicon-euro"></span> Payer
</button>
<button class="btn btn-xs btn-default" v-else-if="order.amount_paid > order.amount" @click="orderPaymentClick" :data-id-order="order.id" data-type="refund" :data-amount="order.amount_surplus">
<span class="glyphicon glyphicon-euro"></span> Rembourser
</button>
<button type="button" class="btn btn-xs btn-default dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<span class="caret"></span>
<span class="sr-only">Toggle Dropdown</span>

+ 4
- 1
backend/web/js/vuejs/distribution-index.js 查看文件

@@ -313,8 +313,11 @@ var app = new Vue({
orderPaymentClick: function(event) {
var app = this ;
var idOrder = event.currentTarget.getAttribute('data-id-order') ;
if(!idOrder) {
idOrder = this.idOrderPayment ;
}
axios.get(UrlManager.getBaseUrlAbsolute()+"order/ajax-payment",{params: {
idOrder: this.idOrderPayment,
idOrder: idOrder,
type: event.currentTarget.getAttribute('data-type'),
amount: event.currentTarget.getAttribute('data-amount')
}})

正在加载...
取消
保存