结合elementui校验table表单里的值是否输入
【结合elementui校验table表单里的值是否输入】
文章图片
{lineMountChange(scope.row.lineTicketAmount, 'lineTicketAmount', scope.$index)})" />
{lineMountChange(scope.row.lineTaxAmount, 'lineTaxAmount', scope.$index)})" />
{selectTypeChange(val, scope.$index)})" />
{{ settleDetail && settleDetail.settlePeriod }}
{selectCompany(val, scope.$index)})"
>
{{ scope.$index + 1 }}
{{ scope.row[item.prop] || '-' }}
复制
删除
{{ scope.row.lineTicketType === 'special' ? '增值税专用发票' : '增值税普通发票' }}
{{ scope.row.lineTicketType === 'electronic' ? '电子发票' : '纸质发票' }}
{{ scope.row[item.prop] ? $filter.dateFilter(scope.row[item.prop] / 1000, 2) : '' }}
{{ scope.row[item.prop] || '-' }}
data() {
return {
formData: {
lineInfoList: undefined
},
formDataRules: {
lineTicketType: [{ required: true, message: '请选择发票类型', trigger: 'change' }],
lineTicketClassify: [{ required: true, message: '请选择发票种类', trigger: 'change' }],
lineTicketAmount: [{ required: true, message: '请输入开票金额', trigger: 'blur' }],
lineTaxAmount: [{ required: true, message: '请输入开票税额', trigger: 'blur' },
{
pattern: /^[+]{0,1}(\d+)$|^[+]{0,1}(\d+\.\d+)$/, message: '请输入大于0的正整数', trigger: 'blur'
}],
invoiceDate: [{ required: true, message: '请输入开票时间', trigger: 'change' }],
companyName: [{ required: true, message: '请选择开票公司名称', trigger: 'change' }]
},
domains: []
}
mounted() {
this.$set(this.formData, 'lineInfoList', this.lineInfoList)
},
methods: {
async handleAddDetails() {
try {
await this.$refs.form.validate()
this.lineInfoList.unshift({})
} catch (err) {
console.error(err)
}
}
}
推荐阅读
- Jsr303做前端数据校验
- 【38】“劳逸结合”的重要性
- springboot结合redis实现搜索栏热搜功能及文字过滤
- 产融结合—黄生
- 囚徒健身与传统中医健身结合
- RxJava结合Retrofit使用
- 参数校验别再写满屏的 if/else 了,差点被劝退……
- nlp|Keras(十一)梯度带(GradientTape)的基本使用方法,与tf.keras结合使用
- 浅谈产品思维
- 16.vue中Js动画与Velocity.js库结合