Commit 54d8a52a authored by shifangwuji's avatar shifangwuji

9/27

parent 738ee561
......@@ -350,11 +350,11 @@
<el-col :span="12">
<el-form-item style="flex-basis: 50%">
<el-button
v-if="!unlockButtonVisible"
v-if="saveButtonVisible"
type="primary"
@click="submitForm"
>
保存
提交
</el-button>
<el-button v-if="!unlockButtonVisible" @click="resetQuery">
清空
......@@ -393,6 +393,7 @@ export default {
jlcodEnabled: false,
lockUserEnabled: false,
isRequired: false,
saveButtonVisible: false,
unlockButtonVisible: false,
queryInputsEnabled: false,
queryButtonVisible: true,
......@@ -521,6 +522,7 @@ export default {
lockUserEnabled: this.lockUserEnabled,
isRequired: this.isRequired,
unlockButtonVisible: this.unlockButtonVisible,
saveButtonVisible: this.saveButtonVisible,
queryInputsEnabled: this.queryInputsEnabled,
queryButtonVisible: this.queryButtonVisible
}
......@@ -529,6 +531,7 @@ export default {
next()
},
created() {
this.getDict()
let buttonExist = false
console.log('buttonStatus', sessionStorage.getItem('buttonStatus'))
sessionStorage.getItem('buttonStatus') ? buttonExist = true : buttonExist = false
......@@ -542,6 +545,7 @@ export default {
this.lockUserEnabled = buttonStatus.lockUserEnabled
this.isRequired = buttonStatus.isRequired
this.unlockButtonVisible = buttonStatus.unlockButtonVisible
this.saveButtonVisible = buttonStatus.saveButtonVisible
this.queryInputsEnabled = buttonStatus.queryInputsEnabled
this.queryButtonVisible = buttonStatus.queryButtonVisible
}
......@@ -551,7 +555,14 @@ export default {
if (this.exist) {
this.form = JSON.parse(sessionStorage.getItem('applicationForm'))
}
this.init()
// 新增的初始化 unlockUsername 的逻辑
if (this.unlockButtonVisible) {
// 如果 unlockButtonVisible 为 true,从 sessionStorage 中恢复 unlockUsername 的值
this.unlockUsername = sessionStorage.getItem('unlockUsername') || "";
} else {
// 否则将 unlockUsername 初始化为空字符串
this.unlockUsername = "";
}
},
methods: {
validateWjb(value, callback) {
......@@ -670,6 +681,7 @@ export default {
this.queryInputsEnabled = true
this.lockUserEnabled = true
this.unlockButtonVisible = true
this.saveButtonVisible = false
this.form.wjb = ''
this.form.wbcode = ''
this.form.wblot = ''
......@@ -684,6 +696,7 @@ export default {
)
}
this.queryButtonVisible = false
this.saveButtonVisible = true
}
})
.catch(() => {
......@@ -696,6 +709,7 @@ export default {
this.queryInputsEnabled = true
this.lockUserEnabled = true
this.unlockButtonVisible = true
this.saveButtonVisible = false
this.queryButtonVisible = false
})
}
......@@ -750,9 +764,11 @@ export default {
if (this.form.wjb || this.form.wbcode || this.form.wblot || this.form.jlcod) {
this.queryInputsEnabled = true
this.queryButtonVisible = false
this.saveButtonVisible = true
} else {
this.queryInputsEnabled = false
this.queryButtonVisible = true
this.saveButtonVisible = false
}
this.unlockButtonVisible = false
this.form.unlockUsername = ''
......@@ -806,6 +822,7 @@ export default {
this.wblotEnabled = false
this.jlcodEnabled = false
this.lockUserEnabled = false
this.saveButtonVisible = false
this.queryButtonVisible = true
sessionStorage.setItem('applicationForm', JSON.stringify(this.form))
......@@ -866,6 +883,7 @@ export default {
this.lockUserEnabled = false
this.queryInputsEnabled = false
this.unlockButtonVisible = false
this.saveButtonVisible = false
this.queryButtonVisible = true
this.form.wjb = ''
this.form.wbcode = ''
......@@ -896,6 +914,7 @@ export default {
this.queryInputsEnabled = true
this.lockUserEnabled = true
this.unlockButtonVisible = true
this.saveButtonVisible = false
this.queryButtonVisible = false
this.form.unlockUsername = ''
})
......@@ -917,6 +936,7 @@ export default {
this.queryInputsEnabled = !enabled
this.lockUserEnabled = enabled
this.unlockButtonVisible = enabled
this.saveButtonVisible = enabled
},
// 显示错误消息
showErrorMessage(message) {
......
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