This commit is contained in:
2026-05-26 17:49:58 +08:00
parent 49b44937d1
commit d8a4cfa250
@@ -39,8 +39,8 @@ layout("/mobile/platform.html"){
<van-field :value="formData.teacherMeeting" label="所属教代会" name="teacherMeeting" <van-field :value="formData.teacherMeeting" label="所属教代会" name="teacherMeeting"
readonly></van-field> readonly></van-field>
<van-field v-show="false" :rules="[{ required:true, message: '请选择所属代表团'}]" <van-field :rules="[{ required:true, message: '请选择所属代表团'}]"
@click="${@shiro.hasRole('jdhdb01')} ? '' : showDelegationNamePicker = true" @click="showDelegationNamePicker = true"
clickable label="所属代表团" clickable label="所属代表团"
name="delegationName" name="delegationName"
placeholder="点击选择所属代表团" placeholder="点击选择所属代表团"
@@ -284,18 +284,25 @@ layout("/mobile/platform.html"){
this.delegationOptions.push({value: v.id, text: v.dbtname}) this.delegationOptions.push({value: v.id, text: v.dbtname})
}) })
this.typeOptions = typeOptions.filter(v => v.value) this.typeOptions = typeOptions.filter(v => v.value)
console.log(this.typeOptions)
// typeOptions.forEach(v => { // typeOptions.forEach(v => {
// this.typeOptions.push({value: v.id, text: v.typeName}) // this.typeOptions.push({value: v.id, text: v.typeName})
// }) // })
this.$set(this.formData, "delegationId", this.delegationOptions.length > 0 ? this.delegationOptions[0].value : '') // 与PC端保持一致:默认取当前登录用户在当前教代会下的代表团,取不到时再使用代表团列表第一项。
this.$set(this.formData, "delegationName", this.delegationOptions.length > 0 ? this.delegationOptions[0].text : '') $.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 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) { if (jgcy.data > 0) {
const jgName = await $.post("/platform/proposal/transact/writeproposal/getJgNameByuser") const jgName = await $.post("/platform/proposal/transact/writeproposal/getJgNameByuser")
jgName.data.forEach(v => { jgName.data.forEach(v => {
@@ -305,26 +312,30 @@ layout("/mobile/platform.html"){
if (this.allMannerList.length > 0) { if (this.allMannerList.length > 0) {
const hasOfficialDelegateRole = "${@shiro.hasRole('jdhdb01')}" === 'true'
const hasOfficialTeamLeaderRole = "${@shiro.hasRole('jdhdbt01')}" === 'true'
this.config.manner.forEach(v => { 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) 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) 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) 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 === "W04" && cbdwFzr.data > 0) { }
const data = this.allMannerList.find(z => z.code == v)
this.mannerList.push({value: data.code, text: data.name})
} }
}) })
this.$set(this.formData, "mannerId", this.mannerList ? this.mannerList[0].value : '') this.$set(this.formData, "mannerCode", this.mannerList.length > 0 ? this.mannerList[0].value : '')
this.$set(this.formData, "mannerName", this.mannerList ? this.mannerList[0].text : '') this.$set(this.formData, "mannerName", this.mannerList.length > 0 ? this.mannerList[0].text : '')
} }
} }