first commit
This commit is contained in:
@@ -0,0 +1,421 @@
|
||||
<!--#
|
||||
layout("/mobile/platform.html"){
|
||||
#-->
|
||||
<style>
|
||||
.register-icon {
|
||||
position: absolute;
|
||||
bottom: 50px;
|
||||
right: 50px;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.register-sapn {
|
||||
position: absolute;
|
||||
bottom: 30px;
|
||||
right: 38px;
|
||||
z-index: 1;
|
||||
font-size: 10px;
|
||||
}
|
||||
|
||||
.van-index-bar__sidebar {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.van-doc-card {
|
||||
margin: 14px;
|
||||
padding: 12px 12px 12px 12px;
|
||||
background-color: #fff;
|
||||
border-radius: 10px;
|
||||
box-shadow: 0 8px 12px #ebedf0;
|
||||
line-height: 20px;
|
||||
font-size: 12px;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.van-divider {
|
||||
margin: 12px 0 12px 0px;
|
||||
border-color: lightgray;
|
||||
}
|
||||
|
||||
.van-button--small {
|
||||
border-top-right-radius: 16px;
|
||||
border-bottom-left-radius: 16px;
|
||||
height: 26px;
|
||||
}
|
||||
|
||||
.van-col {
|
||||
line-height: 25px;
|
||||
}
|
||||
|
||||
.title_span {
|
||||
font-size: 16px;
|
||||
font-weight: bold;
|
||||
position: absolute;
|
||||
left: -1px;
|
||||
top: 11px;
|
||||
}
|
||||
|
||||
</style>
|
||||
<div id="app" v-cloak>
|
||||
|
||||
<m-page-loading v-if="mLoading"></m-page-loading>
|
||||
<van-nav-bar
|
||||
@click-left="location.href='/mobile/index/toHome?type=民主管理'"
|
||||
fixed
|
||||
left-arrow
|
||||
placeholder
|
||||
safe-area-inset-top
|
||||
title="我的提案"
|
||||
></van-nav-bar>
|
||||
|
||||
<div class="search-fixed">
|
||||
<van-search
|
||||
@search="doSearch"
|
||||
maxlength="10"
|
||||
placeholder="请输入提案名称或者提案编号进行查询"
|
||||
shape="round"
|
||||
v-model="pageForm.searchKeyWord"
|
||||
>
|
||||
|
||||
</van-search>
|
||||
|
||||
|
||||
<van-dropdown-menu>
|
||||
<van-dropdown-item :options="sessionList" @change="doSearch"
|
||||
v-model="pageForm.meetingId"></van-dropdown-item>
|
||||
<van-dropdown-item :options="proposalTypeList" @change="doSearch"
|
||||
v-model="pageForm.proposalTypeId"></van-dropdown-item>
|
||||
<van-dropdown-item :options="resultList" @change="doSearch"
|
||||
v-model="pageForm.proposalResultCode"></van-dropdown-item>
|
||||
|
||||
</van-dropdown-menu>
|
||||
</div>
|
||||
|
||||
|
||||
<div style="margin-top: 120px">
|
||||
<van-list
|
||||
:finished="finished"
|
||||
:finished-text="tableData.length>0?'没有更多了':''"
|
||||
@load="onLoad"
|
||||
v-model="loading">
|
||||
|
||||
<div class="van-doc-card" v-for="o in tableData">
|
||||
<div @click="openView(o.id)">
|
||||
<div>
|
||||
<div class="van-ellipsis"
|
||||
style="font-size: 13px;font-weight: bold;flex: 1;width:80%;overflow: hidden;white-space: nowrap">
|
||||
<span :style="'color:'+o.stateColor" class="title_span">|</span>提案名称:{{o.proposalName}}
|
||||
</div>
|
||||
<div style="position: absolute; right: 14px;top: 12.3px;text-align: right">
|
||||
<van-tag :style="'color:'+o.stateColor" plain round size="medium" type="primary">{{
|
||||
o.stateName }}
|
||||
</van-tag>
|
||||
</div>
|
||||
</div>
|
||||
<van-divider></van-divider>
|
||||
<div>
|
||||
<van-row>
|
||||
<van-col span="12"><span style="color: grey">提案编号:</span>{{o.proposalCode}}</van-col>
|
||||
<van-col span="12"><span style="color: grey">提案类型:</span>{{o.typeName}}</van-col>
|
||||
</van-row>
|
||||
<van-row>
|
||||
<van-col span="12" style="overflow: hidden;white-space: nowrap;text-overflow: ellipsis;">
|
||||
<span style="color: grey">代 表 团:</span>{{o.delegationName}}
|
||||
</van-col>
|
||||
<van-col span="12"><span style="color: grey">提案届次:</span>{{o.meetingName}}</van-col>
|
||||
</van-row>
|
||||
<van-divider></van-divider>
|
||||
</div>
|
||||
<div class="train-title" style="margin-top: 11px">
|
||||
<span style="color: grey">立案结果:</span>{{o.resultName ? o.resultName : '暂无'}}
|
||||
<van-button @click.stop="openFuyi(o)" color="#1867b0" size="small"
|
||||
style="position: absolute;right: 16px;top:78.9%"
|
||||
type="primary" v-if="o.stateCode < 200">邀请附议人
|
||||
</van-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</van-list>
|
||||
<van-empty
|
||||
class="custom-image"
|
||||
description="暂无数据"
|
||||
image="/none.svg"
|
||||
v-if="mLoading==false&&tableData.length==0"
|
||||
></van-empty>
|
||||
</div>
|
||||
<van-popup :close-on-click-overlay="false" :lazy-render="false"
|
||||
:style="{ height: '80%'}"
|
||||
@click-close-icon="closeInvitePopup"
|
||||
closeable get-container="#app" position="bottom"
|
||||
round
|
||||
safe-area-inset-bottom v-model="fuyiShowPicker">
|
||||
|
||||
<van-search @search="onSearchSecondedUser"
|
||||
close-icon="close"
|
||||
placeholder="请输入姓名搜索"
|
||||
show-action
|
||||
style="width: 85%"
|
||||
v-model="searchSecondedUserKeyWord">
|
||||
<template #action>
|
||||
<div @click="onSearchSecondedUser">搜索</div>
|
||||
</template>
|
||||
</van-search>
|
||||
|
||||
<div style="padding:0px 20px;margin-top:20px;box-sizing: border-box;max-height: calc(100% - 150px);overflow-y: auto">
|
||||
<van-checkbox-group :checked-color="themeColor" style="font-size: 12px" v-model="helpDb">
|
||||
<van-cell-group>
|
||||
<van-index-bar :sticky="false" highlight-color="red" ref="indexBar">
|
||||
<template v-for="c,ci in dBData">
|
||||
<van-index-anchor :index="c.k" v-if="c.v && c.v.length>0 && c.isShow"></van-index-anchor>
|
||||
<template v-for="x,xi in c.v">
|
||||
<van-cell
|
||||
:id="'van-cell-'+x.id"
|
||||
:key="x.id"
|
||||
:title="x.username + '-' + x.dbtName"
|
||||
@click="fuyiToggle(x.id)"
|
||||
clickable
|
||||
v-show="c.isShow && x.isShow"
|
||||
>
|
||||
<template #right-icon>
|
||||
<van-checkbox :name="x" @click.stop="fuyiToggle(x.id)"
|
||||
ref="fuyiCheckboxes"></van-checkbox>
|
||||
</template>
|
||||
</van-cell>
|
||||
</template>
|
||||
|
||||
</template>
|
||||
</van-index-bar>
|
||||
</van-cell-group>
|
||||
</van-checkbox-group>
|
||||
</div>
|
||||
|
||||
<van-row gutter="20" style="position:absolute;bottom: 20px;width: 100%">
|
||||
<van-col span="12" style="text-align: center">
|
||||
<van-button @click="cleanSelectedUser" color="red" style="width: 60%">清空</van-button>
|
||||
</van-col>
|
||||
<van-col span="12" style="text-align: center">
|
||||
<van-button :color="themeColor" @click="fuyiDwselclose" style="width: 60%">
|
||||
确定({{hasSelectedUser}})
|
||||
</van-button>
|
||||
</van-col>
|
||||
</van-row>
|
||||
|
||||
<!-- <div style="position: absolute;width: 80%;bottom: 20px;left: 50%;transform: translateX(-50%)">-->
|
||||
<!-- <van-button :color="themeColor" @click="cleanSelectedUser">清空</van-button>-->
|
||||
<!-- <van-button :color="themeColor" @click="fuyiDwselclose">确定</van-button>-->
|
||||
<!-- </div>-->
|
||||
|
||||
</van-popup>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<script>
|
||||
const py = new Pinyin()
|
||||
const pyArr = [...Array(26).keys()].map(i => String.fromCharCode(i + 65))
|
||||
const vue = new Vue({
|
||||
el: '#app',
|
||||
mixins: [mobileMixins],
|
||||
data() {
|
||||
return {
|
||||
dBData: [],
|
||||
SecondedData: [],
|
||||
helpDb: [],
|
||||
formData: {
|
||||
helpDb: [],
|
||||
proposalId: ''
|
||||
},
|
||||
dbList: [],
|
||||
fuyiShowPicker: false,
|
||||
list: [],
|
||||
sessionList: [],
|
||||
delegationList: [],
|
||||
proposalTypeList: [],
|
||||
resultList: [],
|
||||
searchSecondedUserKeyWord: '',
|
||||
hasSelectedUser: 0
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
closeInvitePopup() {
|
||||
this.fuyiShowPicker = false
|
||||
this.cleanSelectedUser()
|
||||
},
|
||||
cleanSelectedUser() {
|
||||
this.$refs.fuyiCheckboxes.forEach(v => {
|
||||
if (v.checked) {
|
||||
v.toggle()
|
||||
}
|
||||
})
|
||||
|
||||
setTimeout(() => {
|
||||
const hasSelectedUser = this.$refs.fuyiCheckboxes.filter(v => v.checked).length
|
||||
|
||||
console.log(hasSelectedUser)
|
||||
this.hasSelectedUser = hasSelectedUser
|
||||
}, 100)
|
||||
|
||||
},
|
||||
|
||||
dbListTransToA2Z(list) {
|
||||
const py = new Pinyin()
|
||||
let arr = []
|
||||
pyArr.forEach(p => {
|
||||
const c = list.filter(x => {
|
||||
return py.getCamelChars(x.username).substr(0, 1) === p
|
||||
})
|
||||
arr.push({k: p, v: c})
|
||||
})
|
||||
return arr
|
||||
},
|
||||
|
||||
onSearchSecondedUser(val) {
|
||||
// if (!this.searchSecondedUserKeyWord) {
|
||||
// this.dBData = this.dbListTransToA2Z(this.dbList)
|
||||
// } else {
|
||||
// const filterUserList = this.dbList.filter(v => v.username.includes(this.searchSecondedUserKeyWord))
|
||||
// this.dBData = this.dbListTransToA2Z(filterUserList)
|
||||
// }
|
||||
|
||||
if (!this.searchSecondedUserKeyWord) {
|
||||
this.dBData.forEach(v => {
|
||||
console.log(v)
|
||||
v.isShow = true
|
||||
})
|
||||
} else {
|
||||
const firstName = py.getCamelChars(this.searchSecondedUserKeyWord).substr(0, 1)
|
||||
|
||||
this.dBData.forEach(x => {
|
||||
x.isShow = x.k === firstName
|
||||
if (x.isShow) {
|
||||
x.v.forEach(c => {
|
||||
c.isShow = c.username.includes(this.searchSecondedUserKeyWord)
|
||||
})
|
||||
}
|
||||
})
|
||||
this.$forceUpdate()
|
||||
|
||||
}
|
||||
},
|
||||
|
||||
cellShow(username) {
|
||||
if (!this.searchSecondedUserKeyWord) {
|
||||
return true
|
||||
}
|
||||
const firstName = py.getCamelChars(username).substr(0, 1)
|
||||
|
||||
this.dBData.forEach(x => {
|
||||
x.isShow = x.k === firstName
|
||||
})
|
||||
|
||||
},
|
||||
|
||||
fuyiToggle(id) {
|
||||
this.$refs.fuyiCheckboxes.some(v => {
|
||||
if (v.name.id === id) {
|
||||
v.toggle()
|
||||
return true
|
||||
}
|
||||
})
|
||||
setTimeout(() => {
|
||||
const hasSelectedUser = this.$refs.fuyiCheckboxes.filter(v => v.checked).length
|
||||
console.log(hasSelectedUser)
|
||||
this.hasSelectedUser = hasSelectedUser
|
||||
}, 100)
|
||||
|
||||
},
|
||||
async getSecondedList(proposalId, jdhid) {
|
||||
const {data} = await $.post("/platform/proposal/transact/compose/getSecondedList", {
|
||||
proposalId: proposalId,
|
||||
jdhid: jdhid
|
||||
})
|
||||
data.sort((a, b) => a.username.localeCompare(b.username, 'zh'))
|
||||
this.dbList = data
|
||||
pyArr.forEach(p => {
|
||||
const c = this.dbList.filter(x => {
|
||||
x.isShow = true
|
||||
return py.getCamelChars(x.username).substr(0, 1) === p
|
||||
})
|
||||
this.dBData.push({k: p, v: c, isShow: true})
|
||||
})
|
||||
},
|
||||
fuyiDwselclose() {
|
||||
let aa = ''
|
||||
if (this.helpDb.length > 0) {
|
||||
this.formData.helpDb = this.helpDb.map(v => v.id)
|
||||
aa = this.helpDb.map(v => v.username).toString()
|
||||
}
|
||||
vant.Dialog.confirm({
|
||||
title: '',
|
||||
message: this.helpDb.length > 0 ? ('您邀请了' + aa + ',' + this.helpDb.length + '位附议人您确定要邀请吗?确定后会有信息通知') : '您没有选择附议人请确认',
|
||||
}).then(async () => {
|
||||
const resp = await $.post("/platform/proposal/transact/compose/addSeconded", {
|
||||
proposalId: this.proposalId,
|
||||
users: JSON.stringify(this.formData.helpDb),
|
||||
})
|
||||
if (resp.code == 0) {
|
||||
this.$toast.success(resp.msg);
|
||||
this.doSearch()
|
||||
this.fuyiShowPicker = false
|
||||
}
|
||||
|
||||
}).catch(() => {
|
||||
this.fuyiShowPicker = false
|
||||
});
|
||||
|
||||
},
|
||||
openFuyi(row) {
|
||||
this.formData.helpDb = []
|
||||
this.helpDb = []
|
||||
this.dBData = []
|
||||
this.proposalId = row.id
|
||||
this.getSecondedList(row.id, row.teacherMeetingId)
|
||||
this.fuyiShowPicker = true
|
||||
this.searchSecondedUserKeyWord = ''
|
||||
},
|
||||
doSearch() {
|
||||
this.pageForm.pageNumber = 1
|
||||
this.tableData = []
|
||||
this.finished = false
|
||||
this.onLoad()
|
||||
},
|
||||
async onLoad() {
|
||||
this.loading = true
|
||||
$.post('/platform/mobile/proposal/compose/pageData', this.pageForm).then(res => {
|
||||
if (res.code === 0) {
|
||||
this.tableData = this.tableData.concat(res.data.list)
|
||||
if (this.tableData.length === res.data.totalCount) {
|
||||
this.finished = true
|
||||
} else {
|
||||
this.pageForm.pageNumber++
|
||||
}
|
||||
}
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
openView(id) {
|
||||
window.location.href = '/platform/mobile/proposal/compose/view?biz_key=' + null + '&proposal_id=' + id + '&mobile=' + true
|
||||
}
|
||||
},
|
||||
async created() {
|
||||
this.sessionList = await mProposal.getAllSession()
|
||||
this.proposalTypeList = await mProposal.getProposalType()
|
||||
this.resultList = await mProposal.getProposalDict()
|
||||
if (this.sessionList && this.sessionList.length > 0) {
|
||||
this.$set(this.pageForm, "meetingId", this.sessionList[0].value)
|
||||
}
|
||||
if (this.proposalTypeList && this.proposalTypeList.length > 0) {
|
||||
this.$set(this.pageForm, "proposalTypeId", this.proposalTypeList[0].value)
|
||||
}
|
||||
if (this.resultList && this.resultList.length > 0) {
|
||||
this.$set(this.pageForm, "proposalResultCode", this.resultList[0].value)
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
Reference in New Issue
Block a user