Commit 54d8a52a authored by shifangwuji's avatar shifangwuji

9/27

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