|
@@ -93,7 +93,7 @@
|
|
</el-radio-group>
|
|
</el-radio-group>
|
|
</div>
|
|
</div>
|
|
</ProductCard>
|
|
</ProductCard>
|
|
- <el-form v-show="product.canSelect" class="product-form" :model="product.form" :rules="FormRules" label-width="80px">
|
|
|
|
|
|
+ <el-form v-show="product.canSelect" :disabled="!product.canSelect" ref="pForm" class="product-form" :model="product.form" :rules="FormRules" label-width="80px">
|
|
<el-form-item label="退款金额" prop="money">
|
|
<el-form-item label="退款金额" prop="money">
|
|
<el-input v-model="product.form.money" @blur="formatInputMoney(product.form)" placeholder="请输入退款金额"></el-input>
|
|
<el-input v-model="product.form.money" @blur="formatInputMoney(product.form)" placeholder="请输入退款金额"></el-input>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
@@ -264,15 +264,33 @@ export default {
|
|
formatInputMoney (f) {
|
|
formatInputMoney (f) {
|
|
f.money = this.formatNumber((f.money || 0) * 100)
|
|
f.money = this.formatNumber((f.money || 0) * 100)
|
|
},
|
|
},
|
|
- getProductForm () {
|
|
|
|
- return this.productData.filter(v => v.canSelect)
|
|
|
|
|
|
+ async getProductForm () {
|
|
|
|
+ let vCount = 0
|
|
|
|
+ let vCountSuccess = 0
|
|
|
|
+ for (let i = 0; i < this.$refs.pForm.length; i++) {
|
|
|
|
+ const v = this.$refs.pForm[i]
|
|
|
|
+ if (!v.disabled) {
|
|
|
|
+ vCount++
|
|
|
|
+ await v.validate().then(() => {
|
|
|
|
+ vCountSuccess++
|
|
|
|
+ })
|
|
|
|
+ } else {
|
|
|
|
+ v.resetFields()
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if (vCount === vCountSuccess && vCountSuccess >= 1) {
|
|
|
|
+ return this.productData.filter(v => v.canSelect)
|
|
|
|
+ } else {
|
|
|
|
+ return []
|
|
|
|
+ }
|
|
},
|
|
},
|
|
init() {
|
|
init() {
|
|
this.orderData = this.orderDetailInfo?.orderData || {}
|
|
this.orderData = this.orderDetailInfo?.orderData || {}
|
|
let productData = this.orderDetailInfo?.productData || []
|
|
let productData = this.orderDetailInfo?.productData || []
|
|
if(productData.length > 0) {
|
|
if(productData.length > 0) {
|
|
- productData = productData.map(product => {
|
|
|
|
- product.canSelect = false
|
|
|
|
|
|
+ productData = productData.map((product, index) => {
|
|
|
|
+ product.canSelect = index === 0
|
|
product.form = {
|
|
product.form = {
|
|
money: '',
|
|
money: '',
|
|
reason: '',
|
|
reason: '',
|