|
@ -22,7 +22,19 @@ |
|
|
/> |
|
|
/> |
|
|
<!-- text / number / textarea / popover --> |
|
|
<!-- text / number / textarea / popover --> |
|
|
<!-- :validate-event="isDisabled" --> |
|
|
<!-- :validate-event="isDisabled" --> |
|
|
<el-input v-if="item.isInputClass !== 'select' && item.isInputClass !== 'date' && item.fieldName !== 'barcode' " v-model="addOrUpdateForm[item.fieldName]" :type="item.isInputClass === 'popover'? 'text' : item.isInputClass" :rows="item.isInputClass === 'textarea' ? 3 : ''" :class="{'input-popover':(item.isInputClass === 'popover')}" :style="{ width: item.editLength+'px'}" :disabled="isDisabled" :validate-event="!isDisabled" @keyup.enter.native="isRepeatHandle(item)" @blur="isRepeatHandle(item)"> |
|
|
|
|
|
|
|
|
<el-input |
|
|
|
|
|
v-if="item.isInputClass !== 'select' && item.isInputClass !== 'date' && item.fieldName !== 'barcode' " |
|
|
|
|
|
v-model="addOrUpdateForm[item.fieldName]" |
|
|
|
|
|
:type="item.isInputClass === 'popover'? 'text' : item.isInputClass" |
|
|
|
|
|
:rows="item.isInputClass === 'textarea' ? 3 : ''" |
|
|
|
|
|
:class="{'input-popover':(item.isInputClass === 'popover')}" |
|
|
|
|
|
:style="{ width: item.editLength+'px'}" |
|
|
|
|
|
:disabled="isDisabled" |
|
|
|
|
|
:validate-event="!isDisabled" |
|
|
|
|
|
@keyup.enter.native="isRepeatHandle(item)" |
|
|
|
|
|
@input="autoAddZero(item.isFilling, item.fieldName, addOrUpdateForm[item.fieldName], item.fillingDigit)" |
|
|
|
|
|
@blur="isRepeatHandle(item)" |
|
|
|
|
|
> |
|
|
<i v-if="item.isInputClass === 'popover'" slot="suffix" class="el-input__icon iconfont icon-weibiaoti-2" @click="handleCurrentFieldName(item)" /> |
|
|
<i v-if="item.isInputClass === 'popover'" slot="suffix" class="el-input__icon iconfont icon-weibiaoti-2" @click="handleCurrentFieldName(item)" /> |
|
|
</el-input> |
|
|
</el-input> |
|
|
<!-- date --> |
|
|
<!-- date --> |
|
@ -133,6 +145,9 @@ export default { |
|
|
arcId: function(newValue, oldValue) { |
|
|
arcId: function(newValue, oldValue) { |
|
|
}, |
|
|
}, |
|
|
parentsId: function(newValue, oldValue) { |
|
|
parentsId: function(newValue, oldValue) { |
|
|
|
|
|
}, |
|
|
|
|
|
formPreviewData: function() { |
|
|
|
|
|
this.editFormRow() |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
created() { |
|
|
created() { |
|
@ -243,6 +258,12 @@ export default { |
|
|
this.currentFieldName = item.fieldName |
|
|
this.currentFieldName = item.fieldName |
|
|
this.getAllSubset(item) |
|
|
this.getAllSubset(item) |
|
|
}, |
|
|
}, |
|
|
|
|
|
// 预览和输入时,自动补零 |
|
|
|
|
|
autoAddZero(isFilling, fieldName, value, fillingDigit) { |
|
|
|
|
|
if (isFilling) { |
|
|
|
|
|
this.addOrUpdateForm[fieldName] = value.toString().padStart(fillingDigit, '0').slice(-1 * fillingDigit) |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
// 动态生成表单 |
|
|
// 动态生成表单 |
|
|
editFormRow() { |
|
|
editFormRow() { |
|
|
this.rules = {} |
|
|
this.rules = {} |
|
@ -259,13 +280,13 @@ export default { |
|
|
this.$set(this.addOrUpdateForm, item.fieldName, null) // 防止unkonwn |
|
|
this.$set(this.addOrUpdateForm, item.fieldName, null) // 防止unkonwn |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
this.rules[item.fieldName] = [ |
|
|
|
|
|
|
|
|
this.$set(this.rules, item.fieldName, [ |
|
|
{ |
|
|
{ |
|
|
required: !!item.isRequired, |
|
|
required: !!item.isRequired, |
|
|
message: (item.isInputClass === 'text' ? '请输入' : '请选择') + item.fieldCnName, |
|
|
message: (item.isInputClass === 'text' ? '请输入' : '请选择') + item.fieldCnName, |
|
|
trigger: item.isInputClass === 'text' ? 'blur' : 'change' |
|
|
trigger: item.isInputClass === 'text' ? 'blur' : 'change' |
|
|
} |
|
|
} |
|
|
] |
|
|
|
|
|
|
|
|
]) |
|
|
}) |
|
|
}) |
|
|
}, |
|
|
}, |
|
|
// 预览界面排序 |
|
|
// 预览界面排序 |
|
|