From d8a4cfa25029581846922b90e5fa9640d5846aaf Mon Sep 17 00:00:00 2001 From: zhouhefeng Date: Tue, 26 May 2026 17:49:58 +0800 Subject: [PATCH] commit --- .../views/mobile/proposal/write/index.html | 49 ++++++++++++------- 1 file changed, 30 insertions(+), 19 deletions(-) diff --git a/src/main/resources/views/mobile/proposal/write/index.html b/src/main/resources/views/mobile/proposal/write/index.html index ad00c08..c794447 100644 --- a/src/main/resources/views/mobile/proposal/write/index.html +++ b/src/main/resources/views/mobile/proposal/write/index.html @@ -39,8 +39,8 @@ layout("/mobile/platform.html"){ - v.value) - console.log(this.typeOptions) // typeOptions.forEach(v => { // this.typeOptions.push({value: v.id, text: v.typeName}) // }) - this.$set(this.formData, "delegationId", this.delegationOptions.length > 0 ? this.delegationOptions[0].value : '') - this.$set(this.formData, "delegationName", this.delegationOptions.length > 0 ? this.delegationOptions[0].text : '') - + // 与PC端保持一致:默认取当前登录用户在当前教代会下的代表团,取不到时再使用代表团列表第一项。 + $.get("/platform/proposal/common/getUserDelegationId", { + meetingId: this.formData.teacherMeetingId + }).then((res) => { + const userDelegations = res.data + const delegationId = userDelegations && userDelegations.dbtid + ? userDelegations.dbtid + : (this.delegationOptions.length > 0 ? this.delegationOptions[0].value : '') + const delegation = this.delegationOptions.find((v) => v.value === delegationId) + this.$set(this.formData, "delegationId", delegationId) + this.$set(this.formData, "delegationName", delegation ? delegation.text : '') + }) const jgcy = await $.post("/platform/proposal/transact/writeproposal/getJdhJgcy", {jdhid: this.formData.teacherMeetingId}) - const cbdwFzr = await $.post("/platform/proposal/transact/writeproposal/getCbdwFzr") if (jgcy.data > 0) { const jgName = await $.post("/platform/proposal/transact/writeproposal/getJgNameByuser") jgName.data.forEach(v => { @@ -305,26 +312,30 @@ layout("/mobile/platform.html"){ if (this.allMannerList.length > 0) { + const hasOfficialDelegateRole = "${@shiro.hasRole('jdhdb01')}" === 'true' + const hasOfficialTeamLeaderRole = "${@shiro.hasRole('jdhdbt01')}" === 'true' this.config.manner.forEach(v => { - if ("${@shiro.hasRole('sysadmin')||@shiro.hasRole('jdhdb01')}" === 'true' && v === "W01") { + if (hasOfficialDelegateRole && v === "W01") { const data = this.allMannerList.find(z => z.code == v) - this.mannerList.push({value: data.code, text: data.name}) + if (data) { + this.mannerList.push({value: data.code, text: data.name}) + } } - if ("${@shiro.hasRole('sysadmin')||(@shiro.hasRole('jdhdb01')&&@shiro.hasRole('jdhdbt01'))}" === 'true' && v === "W02") { + if (hasOfficialTeamLeaderRole && v === "W02") { const data = this.allMannerList.find(z => z.code == v) - this.mannerList.push({value: data.code, text: data.name}) + if (data) { + this.mannerList.push({value: data.code, text: data.name}) + } } - if ("${@shiro.hasRole('sysadmin')||@shiro.hasRole('jdhdb01')}" === 'true' && v === "W03" && jgcy.data > 0) { + if (hasOfficialDelegateRole && v === "W03" && jgcy.data > 0) { const data = this.allMannerList.find(z => z.code == v) - this.mannerList.push({value: data.code, text: data.name}) - } - if ("${@shiro.hasRole('sysadmin')||@shiro.hasRole('jdhdb01')}" === 'true' && v === "W04" && cbdwFzr.data > 0) { - const data = this.allMannerList.find(z => z.code == v) - this.mannerList.push({value: data.code, text: data.name}) + if (data) { + this.mannerList.push({value: data.code, text: data.name}) + } } }) - this.$set(this.formData, "mannerId", this.mannerList ? this.mannerList[0].value : '') - this.$set(this.formData, "mannerName", this.mannerList ? this.mannerList[0].text : '') + this.$set(this.formData, "mannerCode", this.mannerList.length > 0 ? this.mannerList[0].value : '') + this.$set(this.formData, "mannerName", this.mannerList.length > 0 ? this.mannerList[0].text : '') } }