|
|
@@ -24,7 +24,7 @@
|
|
|
{{ getSubjectTypeText(text, record) }}
|
|
|
</template>
|
|
|
<template slot="money" slot-scope="text, record">
|
|
|
- <a-input-number v-model=record.money @blur="handleBlur()" :min="0"></a-input-number>
|
|
|
+ <a-input-number v-model='record.money' @blur="handleBlur()" :max="record.oldPrice" :min="0"></a-input-number>
|
|
|
</template>
|
|
|
<template slot="remark" slot-scope="text, record">
|
|
|
<a-textarea v-model=record.remark></a-textarea>
|
|
|
@@ -45,11 +45,11 @@
|
|
|
{{ record.money }}
|
|
|
</template>
|
|
|
<template slot="num" slot-scope="text, record">
|
|
|
- <!-- {{ }} -->
|
|
|
- <a-input-number v-model="record.num" :min="1" :max="record.feeGoodVo.num"></a-input-number>
|
|
|
- <!-- {{ record.feeGoodVo.num }} -->
|
|
|
+ <a-input-number v-model="record.num" :min="1" :max="record.feeGoodVo.num" @change="changeValue(record)"></a-input-number>
|
|
|
+ </template>
|
|
|
+ <template slot="money" slot-scope="text, record">
|
|
|
+ <a-input-number v-model=record.money @blur="handleBlur()" :max="record.oldPrice" :min="0"></a-input-number>
|
|
|
</template>
|
|
|
-
|
|
|
<template slot="remark" slot-scope="text, record">
|
|
|
<a-textarea v-model=record.remark></a-textarea>
|
|
|
</template>
|
|
|
@@ -83,7 +83,7 @@ const columns = [
|
|
|
{
|
|
|
title: '金额',
|
|
|
dataIndex: 'oldPrice',
|
|
|
- width: 60,
|
|
|
+ width: 40,
|
|
|
align: 'center'
|
|
|
},
|
|
|
{
|
|
|
@@ -169,7 +169,7 @@ export default {
|
|
|
data() {
|
|
|
return {
|
|
|
title: '',
|
|
|
- width: 800,
|
|
|
+ width: 1000,
|
|
|
visible: false,
|
|
|
disableSubmit: false,
|
|
|
showYinshou: true,
|
|
|
@@ -182,7 +182,12 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
-
|
|
|
+ // 冲账数量变化
|
|
|
+ changeValue(val) {
|
|
|
+ console.log(val);
|
|
|
+ let tempvalue = val.oldPrice / val.feeGoodVo.num * val.num
|
|
|
+ return val.money = tempvalue
|
|
|
+ },
|
|
|
edit(record, map) {
|
|
|
this.visible = true
|
|
|
console.log(record)
|
|
|
@@ -199,10 +204,12 @@ export default {
|
|
|
this.feesList.forEach(e => {
|
|
|
e.roomName = map.get(e.roomId)
|
|
|
e.oldPrice = e.money
|
|
|
+ e.money = 0
|
|
|
})
|
|
|
this.productList.forEach(e => {
|
|
|
e.roomName = map.get(e.roomId)
|
|
|
e.oldPrice = e.money
|
|
|
+ e.money = 0
|
|
|
let tempnum = JSON.parse(JSON.stringify(e.feeGoodVo))
|
|
|
this.$set(e,'num',tempnum.num)
|
|
|
})
|
|
|
@@ -214,35 +221,63 @@ export default {
|
|
|
this.visible = false
|
|
|
},
|
|
|
handleOk() {
|
|
|
- // console.log(111);
|
|
|
- let fees = []
|
|
|
- if (this.feesList.some(e => e.money > e.oldPrice || e.money < 0)) {
|
|
|
- this.$message.warning('冲账金额不能超过原金额,且不能小于0')
|
|
|
- return
|
|
|
- } else {
|
|
|
- this.feesList.forEach(e => {
|
|
|
- // 一条消费可能有多次冲账,所以传入后端的money是冲账的负数差值
|
|
|
- if (e.oldPrice - e.money > 0) {
|
|
|
- let param = Object.assign({}, e)
|
|
|
- param.money = -param.money
|
|
|
- // param.money = param.money - param.oldPrice
|
|
|
- fees.push(param)
|
|
|
+ if (this.tebdata == 'default') {
|
|
|
+ let productfees = []
|
|
|
+ if (this.productList.some(e => e.money > e.oldPrice || e.money < 0)) {
|
|
|
+ this.$message.warning('冲账金额不能超过原金额,且不能小于0')
|
|
|
+ return
|
|
|
+ } else {
|
|
|
+ this.productList.forEach(e => {
|
|
|
+ // 一条消费可能有多次冲账,所以传入后端的money是冲账的负数差值
|
|
|
+ if (e.oldPrice - e.money > 0) {
|
|
|
+ let param = Object.assign({}, e)
|
|
|
+ param.money = -param.money
|
|
|
+ // param.money = param.money - param.oldPrice
|
|
|
+ productfees.push(param)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ if (productfees.length === 0) {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ postAction('/business/busOrderFee/strike-balance', productfees).then(resp => {
|
|
|
+ if (resp.result === true) {
|
|
|
+ this.$message.success('冲账成功')
|
|
|
+ this.$emit('ok')
|
|
|
+ this.visible = false
|
|
|
+ } else {
|
|
|
+ this.$message.warning('冲账失败')
|
|
|
}
|
|
|
- })
|
|
|
- }
|
|
|
- if (fees.length === 0) {
|
|
|
- return
|
|
|
- }
|
|
|
- console.log(fees);
|
|
|
- postAction('/business/busOrderFee/strike-balance', fees).then(resp => {
|
|
|
- if (resp.result === true) {
|
|
|
- this.$message.success('冲账成功')
|
|
|
- this.$emit('ok')
|
|
|
- this.visible = false
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ let fees = []
|
|
|
+ if (this.feesList.some(e => e.money > e.oldPrice || e.money < 0)) {
|
|
|
+ this.$message.warning('冲账金额不能超过原金额,且不能小于0')
|
|
|
+ return
|
|
|
} else {
|
|
|
- this.$message.warning('冲账失败')
|
|
|
+ this.feesList.forEach(e => {
|
|
|
+ // 一条消费可能有多次冲账,所以传入后端的money是冲账的负数差值
|
|
|
+ if (e.oldPrice - e.money > 0) {
|
|
|
+ let param = Object.assign({}, e)
|
|
|
+ param.money = -param.money
|
|
|
+ // param.money = param.money - param.oldPrice
|
|
|
+ fees.push(param)
|
|
|
+ }
|
|
|
+ })
|
|
|
}
|
|
|
- });
|
|
|
+ if (fees.length === 0) {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ postAction('/business/busOrderFee/strike-balance', fees).then(resp => {
|
|
|
+ if (resp.result === true) {
|
|
|
+ this.$message.success('冲账成功')
|
|
|
+ this.$emit('ok')
|
|
|
+ this.visible = false
|
|
|
+ } else {
|
|
|
+ this.$message.warning('冲账失败')
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
},
|
|
|
handleCancel() {
|
|
|
this.close()
|