|
@@ -117,7 +117,7 @@
|
|
|
v-model="scope.row.singlePrice"
|
|
v-model="scope.row.singlePrice"
|
|
|
placeholder="请输入"
|
|
placeholder="请输入"
|
|
|
@input="changeCount(scope.row, scope.$index)"
|
|
@input="changeCount(scope.row, scope.$index)"
|
|
|
- :disabled="scope.row.orderCategory != 4"
|
|
|
|
|
|
|
+ :disabled="item.orderCategory != 4"
|
|
|
type="number"
|
|
type="number"
|
|
|
>
|
|
>
|
|
|
<template slot="append">元</template>
|
|
<template slot="append">元</template>
|
|
@@ -139,7 +139,7 @@
|
|
|
placeholder="请输入"
|
|
placeholder="请输入"
|
|
|
type="number"
|
|
type="number"
|
|
|
@input="getNotaxSinglePrice(scope.row, scope.$index)"
|
|
@input="getNotaxSinglePrice(scope.row, scope.$index)"
|
|
|
- :disabled="scope.row.orderCategory != 4"
|
|
|
|
|
|
|
+ :disabled="item.orderCategory != 4"
|
|
|
>
|
|
>
|
|
|
<template slot="append">%</template>
|
|
<template slot="append">%</template>
|
|
|
</el-input>
|
|
</el-input>
|
|
@@ -161,7 +161,7 @@
|
|
|
type="number"
|
|
type="number"
|
|
|
:min="0"
|
|
:min="0"
|
|
|
:max="100"
|
|
:max="100"
|
|
|
- :disabled="scope.row.orderCategory != 4"
|
|
|
|
|
|
|
+ :disabled="item.orderCategory != 4"
|
|
|
@input="getDiscountRatioPrice(scope.row, scope.$index)"
|
|
@input="getDiscountRatioPrice(scope.row, scope.$index)"
|
|
|
>
|
|
>
|
|
|
<template slot="append">%</template>
|
|
<template slot="append">%</template>
|
|
@@ -633,7 +633,7 @@ export default {
|
|
|
console.log('changeCount~~~', item)
|
|
console.log('changeCount~~~', item)
|
|
|
console.log('this.datasource[index]~~~', this.datasource[index])
|
|
console.log('this.datasource[index]~~~', this.datasource[index])
|
|
|
// row.totalPrice = parseFloat((item.totalCount * item.singlePrice).toFixed(2))
|
|
// row.totalPrice = parseFloat((item.totalCount * item.singlePrice).toFixed(2))
|
|
|
- if (item.singlePrice && item.taxRate) {
|
|
|
|
|
|
|
+ if (item.singlePrice && item.totalCount) {
|
|
|
// this.$set(
|
|
// this.$set(
|
|
|
// this.datasource[index],
|
|
// this.datasource[index],
|
|
|
// 'totalPrice',
|
|
// 'totalPrice',
|
|
@@ -751,8 +751,13 @@ export default {
|
|
|
validationPromises.push(
|
|
validationPromises.push(
|
|
|
new Promise((formResolve, formReject) => {
|
|
new Promise((formResolve, formReject) => {
|
|
|
const formRef = this.$refs['form' + index];
|
|
const formRef = this.$refs['form' + index];
|
|
|
- if (formRef) {
|
|
|
|
|
- formRef.validate((valid, errors) => {
|
|
|
|
|
|
|
+ console.log(formRef, 'formRef');
|
|
|
|
|
+
|
|
|
|
|
+ // 处理表单引用可能是数组的情况
|
|
|
|
|
+ const actualFormRef = Array.isArray(formRef) ? formRef[0] : formRef;
|
|
|
|
|
+
|
|
|
|
|
+ if (actualFormRef && typeof actualFormRef.validate === 'function') {
|
|
|
|
|
+ actualFormRef.validate((valid, errors) => {
|
|
|
if (!valid) {
|
|
if (!valid) {
|
|
|
formReject({ index, errors });
|
|
formReject({ index, errors });
|
|
|
} else {
|
|
} else {
|
|
@@ -760,9 +765,9 @@ export default {
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
} else {
|
|
} else {
|
|
|
- // 如果表单引用不存在,检查数据直接验证
|
|
|
|
|
|
|
+ // 如果表单引用不存在或没有validate方法,检查数据直接验证
|
|
|
if (!item.singlePrice || !item.taxRate || !item.discountRatio) {
|
|
if (!item.singlePrice || !item.taxRate || !item.discountRatio) {
|
|
|
- formReject({ index, message: `第${index + 1}项缺少必填字段` });
|
|
|
|
|
|
|
+ formReject({ index, message: `缺少必填字段` });
|
|
|
} else {
|
|
} else {
|
|
|
formResolve(true);
|
|
formResolve(true);
|
|
|
}
|
|
}
|
|
@@ -780,7 +785,7 @@ export default {
|
|
|
if (error.message) {
|
|
if (error.message) {
|
|
|
this.$message.error(error.message);
|
|
this.$message.error(error.message);
|
|
|
} else {
|
|
} else {
|
|
|
- this.$message.error(`第${error.index + 1}项表单验证失败`);
|
|
|
|
|
|
|
+ this.$message.error(`表单未填写完整`);
|
|
|
}
|
|
}
|
|
|
reject(false);
|
|
reject(false);
|
|
|
});
|
|
});
|