Commit 30971675 authored by 高宇's avatar 高宇

2024/01/24 需求变更

parent 52c40b8c
...@@ -559,19 +559,14 @@ export default { ...@@ -559,19 +559,14 @@ export default {
// 新增的初始化 unlockUsername 的逻辑 // 新增的初始化 unlockUsername 的逻辑
if (this.unlockButtonVisible) { if (this.unlockButtonVisible) {
// 如果 unlockButtonVisible 为 true,从 sessionStorage 中恢复 unlockUsername 的值 // 如果 unlockButtonVisible 为 true,从 sessionStorage 中恢复 unlockUsername 的值
this.unlockUsername = sessionStorage.getItem('unlockUsername') || ""; this.unlockUsername = sessionStorage.getItem('unlockUsername') || ''
} else { } else {
// 否则将 unlockUsername 初始化为空字符串 // 否则将 unlockUsername 初始化为空字符串
this.unlockUsername = ""; this.unlockUsername = ''
} }
}, },
methods: { methods: {
validateWjb(value, callback) { 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 (this.wjbEnabled) {
// 检查是否开启验证 // 检查是否开启验证
if (value) { if (value) {
...@@ -595,11 +590,6 @@ export default { ...@@ -595,11 +590,6 @@ export default {
}, },
validateJlcod(value, callback) { validateJlcod(value, callback) {
if (value === null || value === undefined || value === '') {
this.jlcodEnabled = false
} else {
this.jlcodEnabled = false
}
if (this.jlcodEnabled) { if (this.jlcodEnabled) {
// 检查是否开启验证 // 检查是否开启验证
if (value) { if (value) {
...@@ -623,11 +613,6 @@ export default { ...@@ -623,11 +613,6 @@ export default {
}, },
validateField(value, callback, fieldName) { validateField(value, callback, fieldName) {
if (value === null || value === undefined || value === '') {
this[fieldName + 'Enabled'] = false
} else {
this[fieldName + 'Enabled'] = true
}
if (this[fieldName + 'Enabled']) { if (this[fieldName + 'Enabled']) {
// 检查是否开启验证 // 检查是否开启验证
if (value) { if (value) {
...@@ -653,10 +638,10 @@ export default { ...@@ -653,10 +638,10 @@ export default {
/** 查询按钮操作 */ /** 查询按钮操作 */
handleQuery: function() { handleQuery: function() {
// 先触发表单验证 // 先触发表单验证
console.log('111',this.form) console.log('111', this.form)
this.$refs.form.validate(valid => { this.$refs.form.validate(valid => {
if (valid) { if (valid) {
console.log('222',this.form) console.log('222', this.form)
// 表单验证通过,执行查询操作 // 表单验证通过,执行查询操作
queryList({ queryList({
pn: this.form.pn, pn: this.form.pn,
...@@ -670,49 +655,42 @@ export default { ...@@ -670,49 +655,42 @@ export default {
// 如果后端返回成功信息,显示成功提示 // 如果后端返回成功信息,显示成功提示
this.queryInputsEnabled = true this.queryInputsEnabled = true
console.log('data', response.data) console.log('data', response.data)
if (response.data.jbcode !== '') { if (response.data.jbcode !== '' && response.data.jbcode !== null) {
this.wjbEnabled = true this.wjbEnabled = true
} else { } else {
this.wjbEnabled = false this.wjbEnabled = false
} }
if (response.data.wb !== '') { if (response.data.wb !== '' && response.data.wb !== null) {
this.wbcodeEnabled = true this.wbcodeEnabled = true
this.wblotEnabled = true this.wblotEnabled = true
} else { } else {
this.wbcodeEnabled = false this.wbcodeEnabled = false
this.wblotEnabled = false this.wblotEnabled = false
} }
if (response.data.jl !== '') { if (response.data.jl !== '' && response.data.jl !== null ) {
this.jlcodEnabled = true this.jlcodEnabled = true
} else { } else {
this.jlcodEnabled = false this.jlcodEnabled = false
} }
if ( if (
response.data.jbcode === '' && (response.data.jbcode === null || response.data.jbcode === '') &&
response.data.wb === '' && (response.data.wb === '' || response.data.wb === null) &&
response.data.jl === '' (response.data.jl === '' || response.data.jl === null)
) { ) {
// 所有输入框都锁定,报错 // 所有输入框都锁定,报错
this.wjbEnabled = false this.wjbEnabled = false
this.wbcodeEnabled = false this.wbcodeEnabled = false
this.wblotEnabled = false this.wblotEnabled = false
this.jlcodEnabled = false this.jlcodEnabled = false
this.queryInputsEnabled = true this.queryInputsEnabled = false
this.lockUserEnabled = true this.lockUserEnabled = false
this.unlockButtonVisible = true this.unlockButtonVisible = false
this.saveButtonVisible = false this.saveButtonVisible = false
this.form.wjb = '' this.form.wjb = ''
this.form.wbcode = '' this.form.wbcode = ''
this.form.wblot = '' this.form.wblot = ''
this.form.jlcod = '' this.form.jlcod = ''
MessageBox.alert( this.$message.error('jbcode,wb,jl内容均为空,查询无效,请解锁后重新查询')
'jbcode,wb,jl内容均为空,查询无效,请解锁后重新查询',
'错误',
{
confirmButtonText: '确定',
type: 'error'
}
)
} }
this.queryButtonVisible = false this.queryButtonVisible = false
this.saveButtonVisible = true this.saveButtonVisible = true
......
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