diff --git a/src/components/Template/CustomTable.vue b/src/components/Template/CustomTable.vue
index 9ad7981..8973c0e 100644
--- a/src/components/Template/CustomTable.vue
+++ b/src/components/Template/CustomTable.vue
@@ -63,17 +63,7 @@
:error="hasError(rowIndex, colIndex, col.prop)"
@update:error="onErrorUpdate(rowIndex, colIndex, col.prop, $event)"
:orange-bg="hasOrangeBg(rowIndex, colIndex, col.prop)" />
-
-
{{ col.otherLabel ? $t(col.otherLabel) : $t("template.common.other") }}
-
-
-
-
-
+
@@ -89,8 +79,20 @@
{{ row[col.prop] }}
+
+
+
+
{{ col.otherLabel ? $t(col.otherLabel) : $t("template.common.other") }}
+
+
+
+
-
+
-
+
{{ row[col.bodySubKey] }}
@@ -228,7 +230,7 @@ export default {
fillType: sItem.bodyFillType,
maxlength: sItem.otherMaxlength || 50,
parentLabel: sItem.label,
- type:"input"
+ type: "input"
}
},
//判断是否显示其他输入框
@@ -238,10 +240,10 @@ export default {
//和凡哥商量,只要value为负数都显示其他
return arr.some(item => item < 0);
},
- isShowBodySub(col,row) {
+ isShowBodySub(col, row) {
if (col.hasOwnProperty("disabled")) {
return col.showBodySub
- }else if(col.bodySubType === 'span'&&!row[col.bodySubKey]){//如果是span没有值的话就隐藏
+ } else if (col.bodySubType === 'span' && !row[col.bodySubKey]) {//如果是span没有值的话就隐藏
return false;
}
return col.bodySubType && col.bodySubKey;
@@ -369,10 +371,15 @@ export default {
this.formErrors.push(errorItem);
}
}
+ console.log(col.otherCode, "col.otherCode")
+
// 检查其他输入框
- if (col.otherCode && col.bodySubType !== 'span') {
+ if (col.otherCode) {
+ const isSelectedOther = this.isShowOther(mainValue);
+ if (!isSelectedOther) {
+ return;
+ }
const otherValue = row[col.otherCode];
-
if (this.isValueEmpty(otherValue)) {
const errorItem = {
rowIndex,
@@ -736,5 +743,6 @@ export default {
font-size: 14px;
font-weight: normal;
color: #606266;
+ width: auto;
}
\ No newline at end of file