|
|
|
@ -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)" /> |
|
|
|
<div v-show="isShowOther(row[col.prop])" class="flex flex1"> |
|
|
|
<div class="other-title">{{ col.otherLabel ? $t(col.otherLabel) : $t("template.common.other") }} |
|
|
|
</div> |
|
|
|
<div class="flex flex1"> |
|
|
|
<HandleFormItem :field-item-label="fieldItemLabel" :field-key="prefixKey + '_' + col.otherCode" |
|
|
|
@blur="onBlur(rowIndex, col.prop, $event)" :item="getOtherItem(col)" v-model="row[col.otherCode]" |
|
|
|
:error="hasError(rowIndex, colIndex, col.otherCode)" |
|
|
|
@update:error="onErrorUpdate(rowIndex, colIndex, col.otherCode, $event)" |
|
|
|
:orange-bg="hasOrangeBg(rowIndex, colIndex, col.otherCode)" /> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
</template> |
|
|
|
@ -89,8 +79,20 @@ |
|
|
|
<template v-else> |
|
|
|
{{ row[col.prop] }} |
|
|
|
</template> |
|
|
|
|
|
|
|
</div> |
|
|
|
<div v-show="isShowOther(row[col.prop])" class="flex flex1"> |
|
|
|
<div class="other-title">{{ col.otherLabel ? $t(col.otherLabel) : $t("template.common.other") }} |
|
|
|
</div> |
|
|
|
<div class="flex flex1"> |
|
|
|
<HandleFormItem :field-item-label="fieldItemLabel" :field-key="prefixKey + '_' + col.otherCode" |
|
|
|
@blur="onBlur(rowIndex, col.prop, $event)" :item="getOtherItem(col)" v-model="row[col.otherCode]" |
|
|
|
:error="hasError(rowIndex, colIndex, col.otherCode)" |
|
|
|
@update:error="onErrorUpdate(rowIndex, colIndex, col.otherCode, $event)" |
|
|
|
:orange-bg="hasOrangeBg(rowIndex, colIndex, col.otherCode)" /> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div class="m-l-5 flex1" v-if="isShowBodySub(col,row)"> |
|
|
|
<div class="m-l-5 flex1" v-if="isShowBodySub(col, row)"> |
|
|
|
<template v-if="col.bodySubType === 'inputNumber'"> |
|
|
|
<HandleFormItem :fieldKey="prefixKey + '_' + col.bodySubKey + '_' + rowIndex" |
|
|
|
:fieldItemLabel="fieldItemLabel" type="inputNumber" |
|
|
|
@ -111,7 +113,7 @@ |
|
|
|
:orange-bg="hasOrangeBg(rowIndex, colIndex, col.bodySubKey)" /> |
|
|
|
</template> |
|
|
|
|
|
|
|
<template v-else-if = "col.bodySubType === 'span'"> |
|
|
|
<template v-else-if="col.bodySubType === 'span'"> |
|
|
|
{{ row[col.bodySubKey] }} |
|
|
|
</template> |
|
|
|
</div> |
|
|
|
@ -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; |
|
|
|
} |
|
|
|
</style> |