From fadcb77c2368a3401ec7c2e62c71801ae533ac53 Mon Sep 17 00:00:00 2001 From: xyq <392009588@qq.com> Date: Wed, 28 Jun 2023 13:11:43 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=85=E5=9F=BA=E5=9C=B0=E8=B0=83=E6=9F=A5?= =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/store/modules/user.js | 2 ++ src/views/homesteadSurvey/index.vue | 5 ++++- src/views/homesteadSurvey/nmfwAdd.vue | 9 +++++---- src/views/homesteadSurvey/zrzAdd.vue | 2 ++ 4 files changed, 13 insertions(+), 5 deletions(-) diff --git a/src/store/modules/user.js b/src/store/modules/user.js index fe1cc16d..dbfdf5d9 100644 --- a/src/store/modules/user.js +++ b/src/store/modules/user.js @@ -74,6 +74,7 @@ const user = { commit('SET_TOKEN', res.token) getInfo(res.token).then(response => { const user = response.user + console.info(user.nickName); // const avatar = user.avatar == "" ? require("@/assets/images/profile.jpg") : process.env.VUE_APP_BASE_API + user.avatar; const avatar = ""; if (response.roles && response.roles.length > 0) { // 验证返回的roles是否是一个非空数组 @@ -180,6 +181,7 @@ const user = { logout(state.token).then(() => { commit('SET_TOKEN', '') commit('SET_businessLevel', '') + commit('SET_NICKNAME', '') commit('SET_ROLES', []) commit('SET_PERMISSIONS', []) removeToken() diff --git a/src/views/homesteadSurvey/index.vue b/src/views/homesteadSurvey/index.vue index adbc8535..907cf191 100644 --- a/src/views/homesteadSurvey/index.vue +++ b/src/views/homesteadSurvey/index.vue @@ -223,9 +223,12 @@ userList().then(response => { this.taskExecutortions = response.data }) + console.info(this.checked); if(this.checked){ let userId = this.$store.getters.userId; - this.nickName = this.$store.getters.nickName; + setTimeout(() => { + this.nickName = this.$store.state.user.nickName; + },1000) this.$set(this.queryParams, "rwzxr", userId); this.getList(); }else{ diff --git a/src/views/homesteadSurvey/nmfwAdd.vue b/src/views/homesteadSurvey/nmfwAdd.vue index 22e66b96..16e7e30c 100644 --- a/src/views/homesteadSurvey/nmfwAdd.vue +++ b/src/views/homesteadSurvey/nmfwAdd.vue @@ -580,12 +580,12 @@ export default { this.permission = localStorage.getItem("executePermission"); this.zjdzdxxItem = JSON.parse(localStorage.getItem("zjdzdxxItem")); if(this.form.id == null){ - this.$set(this.form, 'hx', "01"); + this.$set(this.form, 'hx', "03"); this.$set(this.form, 'hxjg', "01"); this.$set(this.form, 'fwlx', "01"); - this.$set(this.form, 'fwxz', "6"); - this.$set(this.form, 'fwjg', "01"); - this.$set(this.form, 'sjly', "01"); + this.$set(this.form, 'fwxz', "10"); + this.$set(this.form, 'fwjg', "02"); + this.$set(this.form, 'sjly', "04"); this.$set(this.form, 'sffz', "0"); this.$set(this.form, 'sfjf', "0"); this.$set(this.form, 'sfcf', "0"); @@ -595,6 +595,7 @@ export default { this.$set(this.form, 'fwzt', "01"); this.$set(this.form, 'fwyt', "10"); this.$set(this.form, 'sfytrgy', "0"); + this.$set(this.form, 'sjcs', 1); }else{ if(this.form.sffz === "1"){ this.showFzxx = true; diff --git a/src/views/homesteadSurvey/zrzAdd.vue b/src/views/homesteadSurvey/zrzAdd.vue index eaa507a0..636805ff 100644 --- a/src/views/homesteadSurvey/zrzAdd.vue +++ b/src/views/homesteadSurvey/zrzAdd.vue @@ -167,6 +167,8 @@ placeholder="请选择数据来源" remote-url="/open/zdzh/list/sjly" :on-remote-response="'data'" + :rules="[{ required: true }]" + required />