Commit 30971675 authored by 高宇's avatar 高宇

2024/01/24 需求变更

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