Commit 52c40b8c authored by 高宇's avatar 高宇

2024/01/24 需求变更

parent 8e3bac74
......@@ -45,15 +45,13 @@
icon="el-icon-search"
size="small"
@click="handleQuery"
>查询</el-button
>
>查询</el-button>
<el-button
style="padding: 8px 7px"
icon="el-icon-refresh"
size="small"
@click="resetQuery"
>重置</el-button
>
>重置</el-button>
</el-form-item>
<div style="float: right">
<el-form-item>
......@@ -63,8 +61,7 @@
size="small"
icon="el-icon-plus"
@click="handleAdd"
>新增</el-button
>
>新增</el-button>
</el-form-item>
</div>
</el-form>
......@@ -142,18 +139,18 @@
type="text"
style="color: #49cec9"
@click="handleUpdate(scope.row)"
>修改</el-button
>
<el-button size="mini" type="text" @click="handleDetail(scope.row)"
>详情</el-button
>
>修改</el-button>
<el-button
size="mini"
type="text"
@click="handleDetail(scope.row)"
>详情</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
>删除</el-button
>
>删除</el-button>
</template>
</el-table-column>
<!-- <el-table-column label="操作">-->
......@@ -356,60 +353,60 @@ export default {
validator: (rule, value, callback) => {
if (this.form.jbcode && !value) {
// 如果 jbcode 有数据且 jbrank 为空,则执行验证并返回错误信息
return callback(new Error('请输入jbrank'));
return callback(new Error('请输入jbrank'))
}
callback(); // 否则,验证通过
},
trigger: 'blur',
callback() // 否则,验证通过
},
trigger: 'blur'
}
],
wb: [
{
validator: (rule, value, callback) => {
// 三选一必填验证逻辑
const wb = this.form.wb || '';
const jbcode = this.form.jbcode || '';
const jl = this.form.jl || '';
if (!(wb || jbcode || jl)) {
return callback(new Error('请至少填写一个选项:wb、jbcode、jl 中的一个'));
}
callback();
},
trigger: 'blur',
// const wb = this.form.wb || ''
// const jbcode = this.form.jbcode || ''
// const jl = this.form.jl || ''
//
// if (!(wb || jbcode || jl)) {
// return callback(new Error('请至少填写一个选项:wb、jbcode、jl 中的一个'))
// }
callback()
},
trigger: 'blur'
}
],
jl: [
{
validator: (rule, value, callback) => {
// 三选一必填验证逻辑
const wb = this.form.wb || '';
const jbcode = this.form.jbcode || '';
const jl = this.form.jl || '';
if (!(wb || jbcode || jl)) {
return callback(new Error('请至少填写一个选项:wb、jbcode、jl 中的一个'));
}
callback();
},
trigger: 'blur',
// const wb = this.form.wb || ''
// const jbcode = this.form.jbcode || ''
// const jl = this.form.jl || ''
//
// if (!(wb || jbcode || jl)) {
// return callback(new Error('请至少填写一个选项:wb、jbcode、jl 中的一个'))
// }
callback()
},
trigger: 'blur'
}
],
jbcode: [
{
validator: (rule, value, callback) => {
// 三选一必填验证逻辑
const wb = this.form.wb || '';
const jbcode = this.form.jbcode || '';
const jl = this.form.jl || '';
// const wb = this.form.wb || ''
// const jbcode = this.form.jbcode || ''
// const jl = this.form.jl || ''
if (!(wb || jbcode || jl)) {
return callback(new Error('请至少填写一个选项:wb、jbcode、jl 中的一个'));
}
callback();
},
trigger: 'blur',
// if (!(wb || jbcode || jl)) {
// return callback(new Error('请至少填写一个选项:wb、jbcode、jl 中的一个'))
// }
callback()
},
trigger: 'blur'
}
]
},
pissbList: [],
......@@ -561,7 +558,7 @@ export default {
this.title = '编辑基础信息表单'
const id = row.businessId
getDetailById(id).then(res => {
console.log("res",res);
console.log('res', res)
this.form = res.data
this.open = true
})
......
......@@ -567,6 +567,11 @@ export default {
},
methods: {
validateWjb(value, callback) {
if (this.form.wjb === '' || this.form.wjb.wjb === undefined || this.form.wjb === null) {
this.wjbEnabled = false
} else {
this.wjbEnabled = true
}
if (this.wjbEnabled) {
// 检查是否开启验证
if (value) {
......@@ -590,6 +595,11 @@ export default {
},
validateJlcod(value, callback) {
if (value === null || value === undefined || value === '') {
this.jlcodEnabled = false
} else {
this.jlcodEnabled = false
}
if (this.jlcodEnabled) {
// 检查是否开启验证
if (value) {
......@@ -613,6 +623,11 @@ export default {
},
validateField(value, callback, fieldName) {
if (value === null || value === undefined || value === '') {
this[fieldName + 'Enabled'] = false
} else {
this[fieldName + 'Enabled'] = true
}
if (this[fieldName + 'Enabled']) {
// 检查是否开启验证
if (value) {
......@@ -638,8 +653,10 @@ export default {
/** 查询按钮操作 */
handleQuery: function() {
// 先触发表单验证
console.log('111',this.form)
this.$refs.form.validate(valid => {
if (valid) {
console.log('222',this.form)
// 表单验证通过,执行查询操作
queryList({
pn: this.form.pn,
......@@ -899,7 +916,11 @@ export default {
type: 'success',
duration: 5000
})
this.resetForm()
this.form.pn = ''
this.form.lot = ''
this.form.gx = ''
this.form.machine = ''
this.$refs.form.clearValidate()
}
} else {
// 保存失败,设置字段状态和显示错误消息
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment