Commit a17b65f7 authored by jingnan's avatar jingnan 👀

调整占用分配数量组件修改

parent d42d93f5
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
*/ */
<template> <template>
<div class="outStorageAdjustOccupy-reqAmount"> <div class="outStorageAdjustOccupy-reqAmount">
<el-input-number v-model="reqAmount" :min="0" size="small" :max="maxNum" @change="handleChange" /> <el-input-number v-model="scope.row.allocatedAmount" :min="0" size="small" :max="scope.row.usableAmount" @change="handleChange" />
</div> </div>
</template> </template>
<script> <script>
...@@ -18,6 +18,10 @@ export default { ...@@ -18,6 +18,10 @@ export default {
type: Object, type: Object,
default: () => {} default: () => {}
}, },
scope: {
type: Object,
default: () => { return {} }
},
value: { value: {
type: Number, type: Number,
default: 0 default: 0
...@@ -25,25 +29,27 @@ export default { ...@@ -25,25 +29,27 @@ export default {
}, },
data() { data() {
return { return {
reqAmount: 0, reqAmount: 0
maxNum: 0
} }
}, },
computed: {}, computed: {
},
created() { created() {
// 初始化数据 // 初始化数据
if (this.value !== '0') { // if (this.value !== '0') {
this.reqAmount = Number(this.value) // this.reqAmount = Number(this.value)
} // }
if (this.form.reqAmount) { // if (this.form.reqAmount) {
this.maxNum = this.form.reqAmount // this.maxNum = this.form.reqAmount
} else { // } else {
this.maxNum = 9999 // this.maxNum = 9999
} // }
}, },
methods: { methods: {
handleChange() { handleChange(val) {
this.$emit('input', this.reqAmount) this.$emit('input', val)
// const scope = this.scope
// this.$emit('cell-data-change', { rowIndex: scope.$index, key: 'allocatedAmount', value: scope.row.allocatedAmount, row: scope.row })
} }
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment