Commit 8d94f76a by 李伟康

修复BUG

1 parent 0b159100
...@@ -604,13 +604,13 @@ export default { ...@@ -604,13 +604,13 @@ export default {
}, },
showConfig (row, index, type = 0) { showConfig (row, index, type = 0) {
row.oilList ||= []
row.couponList ||= []
this.configParams = { this.configParams = {
show: true, show: true,
row, row,
type, type,
index index,
oilList: JSON.parse(JSON.stringify(row.oilList || [])),
couponList: JSON.parse(JSON.stringify(row.couponList || [])),
} }
}, },
setRowTotal (row, index) { setRowTotal (row, index) {
......
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
<el-input-number <el-input-number
size="small" size="small"
:min="1" :min="1"
:max="10" :max="scope.scope.maxStock"
:step="1" :step="1"
v-model="scope.scope.amount" v-model="scope.scope.amount"
@change="changeAmount(...arguments,scope.scope,'oilCouponId')" @change="changeAmount(...arguments,scope.scope,'oilCouponId')"
...@@ -112,8 +112,10 @@ export default { ...@@ -112,8 +112,10 @@ export default {
this.$apis.points.getOilCouponList(params).then(res => { this.$apis.points.getOilCouponList(params).then(res => {
this.loading = false this.loading = false
res.list.map(e => { res.list.map(e => {
let maxStock = e.stock - e.usedStock
e.amount = 1 e.amount = 1
e.oilCouponId = e.id e.oilCouponId = e.id
e.maxStock = maxStock > 10 ? 10 : maxStock
}) })
// 重置分页组件 // 重置分页组件
this.serviceList = res.list this.serviceList = res.list
......
...@@ -4,7 +4,6 @@ ...@@ -4,7 +4,6 @@
class="points-panel" class="points-panel"
bigTitle="选择" bigTitle="选择"
okText="提交" okText="提交"
:before-close="handleGiftClose"
@onCancel="handleGiftClose" @onCancel="handleGiftClose"
@onOk="handleConfirm" @onOk="handleConfirm"
:visible.sync="configParams.show" :visible.sync="configParams.show"
...@@ -19,13 +18,13 @@ ...@@ -19,13 +18,13 @@
v-show="currentComponent == 'gas'" v-show="currentComponent == 'gas'"
ref="gasRef" ref="gasRef"
:merchantId="merchantId" :merchantId="merchantId"
:selectedGasList="configParams.row.oilList || []" :selectedGasList="configParams.oilList"
/> />
<service <service
v-show="currentComponent == 'service'" v-show="currentComponent == 'service'"
ref="serviceRef" ref="serviceRef"
:merchantId="merchantId" :merchantId="merchantId"
:selectedServiceList="configParams.row.couponList || []" :selectedServiceList="configParams.couponList"
/> />
</div> </div>
</template> </template>
......
...@@ -74,7 +74,7 @@ ...@@ -74,7 +74,7 @@
<el-input-number <el-input-number
size="small" size="small"
:min="1" :min="1"
:max="10" :max="scope.scope.maxStock"
:step="1" :step="1"
v-model="scope.scope.amount" v-model="scope.scope.amount"
@change="changeAmount(...arguments,scope.scope,'couponId')" @change="changeAmount(...arguments,scope.scope,'couponId')"
...@@ -185,8 +185,10 @@ export default { ...@@ -185,8 +185,10 @@ export default {
this.$apis.points.getghDirectionalGiftListApi(params).then(res => { this.$apis.points.getghDirectionalGiftListApi(params).then(res => {
this.loading = false this.loading = false
res.list.map(e => { res.list.map(e => {
let maxStock = e.residueAmount
e.amount = 1 e.amount = 1
e.couponId = e.id e.couponId = e.id
e.maxStock = maxStock > 10 ? 10 : maxStock
}) })
// 重置分页组件 // 重置分页组件
this.serviceList = res.list this.serviceList = res.list
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!