481 lines
18 KiB
HTML
481 lines
18 KiB
HTML
<!--#
|
|
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, .van-button--mini {
|
|
border-radius: 15px;
|
|
height: 23px;
|
|
width: 50px;
|
|
}
|
|
|
|
.van-col {
|
|
line-height: 25px;
|
|
}
|
|
|
|
.title_span {
|
|
font-size: 16px;
|
|
font-weight: bold;
|
|
position: absolute;
|
|
left: -1px;
|
|
top: 11px;
|
|
}
|
|
|
|
.train-title {
|
|
margin-top: 10px;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: space-between;
|
|
}
|
|
|
|
.train-title .van-button--small, .van-button--mini {
|
|
max-width: 100px;
|
|
width: auto;
|
|
min-width: 50px;
|
|
}
|
|
|
|
|
|
</style>
|
|
<div id="app" v-cloak>
|
|
|
|
<m-page-loading v-if="mLoading"></m-page-loading>
|
|
<van-nav-bar
|
|
title="我的提案"
|
|
left-arrow
|
|
placeholder
|
|
fixed
|
|
@click-left="history.back()"
|
|
safe-area-inset-top
|
|
></van-nav-bar>
|
|
|
|
<div class="search-fixed">
|
|
<van-search
|
|
v-model="pageForm.searchKeyWord"
|
|
shape="round"
|
|
maxlength="10"
|
|
@search="doSearch"
|
|
placeholder="请输入提案名称或者提案编号进行查询"
|
|
>
|
|
|
|
</van-search>
|
|
|
|
|
|
<van-dropdown-menu>
|
|
<van-dropdown-item v-model="pageForm.meetingId" :options="sessionList"
|
|
@change="doSearch"></van-dropdown-item>
|
|
<van-dropdown-item v-model="pageForm.proposalTypeId" :options="proposalTypeList"
|
|
@change="doSearch"></van-dropdown-item>
|
|
<van-dropdown-item v-model="pageForm.proposalResultCode" :options="resultList"
|
|
@change="doSearch"></van-dropdown-item>
|
|
|
|
</van-dropdown-menu>
|
|
</div>
|
|
|
|
|
|
<div style="margin-top: 120px">
|
|
<van-list
|
|
v-model="loading"
|
|
:finished="finished"
|
|
:finished-text="tableData.length>0?'没有更多了':''"
|
|
@load="onLoad">
|
|
|
|
<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">
|
|
<div>
|
|
<span style="color: grey">立案结果:</span>{{o.resultName ? o.resultName : '暂无'}}
|
|
</div>
|
|
<div>
|
|
<van-button v-if="o.mannerCode==='W01' && o.stateCode < 200"
|
|
@click.stop="openFuyi(o)" color="#1867b0" size="small"
|
|
type="primary">邀请附议人
|
|
</van-button>
|
|
|
|
<van-button v-if="showSubmitBtn(o)"
|
|
@click.stop="doSubmit(o)" color="#1867b0" size="mini"
|
|
type="primary">提交
|
|
</van-button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</van-list>
|
|
<van-empty
|
|
v-if="mLoading==false&&tableData.length==0"
|
|
class="custom-image"
|
|
image="/none.svg"
|
|
description="暂无数据"
|
|
></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" :key="c.k">
|
|
<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" :key="x.id">
|
|
<van-cell
|
|
v-if="c.isShow && x.isShow"
|
|
:id="'van-cell-'+x.id"
|
|
:key="x.id"
|
|
:title="x.username + '-' + x.loginname + '-' + x.dbtName"
|
|
@click="fuyiToggle(x.id)"
|
|
clickable
|
|
>
|
|
<template #right-icon>
|
|
<van-checkbox :name="x.id" @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))
|
|
var 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,
|
|
proposalConfig: {},
|
|
}
|
|
},
|
|
methods: {
|
|
async showSubmitBtn(row) {
|
|
const {alreadySecondedCount, stateCode} = row
|
|
if (row.mannerCode === 'W01') {
|
|
if (stateCode !== 150) {
|
|
return false
|
|
}
|
|
const {submitMode, seconderNum} = this.proposalConfig
|
|
if (submitMode === 'AMT' || submitMode === "manual") {
|
|
return alreadySecondedCount === seconderNum
|
|
} else {
|
|
return false
|
|
}
|
|
} else {
|
|
return stateCode === 100
|
|
}
|
|
|
|
// [proposal.UNSUBMIT].includes(row.stateCode) && row.mannerCode != 'W01' || (!config.isAutoSubmit && row.mannerCode == 'W01')
|
|
},
|
|
|
|
|
|
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 => {
|
|
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) || c.loginname.includes(this.searchSecondedUserKeyWord)
|
|
})
|
|
x.v.sort()
|
|
}
|
|
})
|
|
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) {
|
|
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() {
|
|
const userIds = this.helpDb
|
|
const userNames = this.dbList.filter(v => userIds.includes(v.id)).map(v => v.username).join('、')
|
|
vant.Dialog.confirm({
|
|
title: '',
|
|
message: this.helpDb.length > 0 ? ('您邀请了' + userNames + this.helpDb.length + '位附议人,您确定要邀请吗?确定后会有信息通知') : '您没有选择附议人请确认',
|
|
}).then(async () => {
|
|
const resp = await $.post("/platform/proposal/transact/compose/addSeconded", {
|
|
proposalId: this.proposalId,
|
|
users: JSON.stringify(userIds),
|
|
})
|
|
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(loc() + '/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 = '/mobile/proposal/compose/view?biz_key=' + null + '&proposal_id=' + id + '&mobile=' + true
|
|
},
|
|
doSubmit({id, mannerCode}) {
|
|
vant.Dialog.confirm({
|
|
title: '提示',
|
|
message: '您确认要提交吗?',
|
|
}).then(async () => {
|
|
const resp = await $.post('/platform/proposal/transact/compose/doSubmit', {
|
|
id,
|
|
mannerCode
|
|
})
|
|
if (resp.code === 0) {
|
|
this.$toast.success('提交成功')
|
|
this.doSearch()
|
|
} else {
|
|
this.$toast.fail(resp.msg)
|
|
}
|
|
}).catch(() => {
|
|
});
|
|
}
|
|
},
|
|
async created() {
|
|
this.proposalConfig = await mProposal.getProposalConfig()
|
|
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)
|
|
}
|
|
}
|
|
})
|
|
window.addEventListener('pageshow', e => {
|
|
if (e.persisted || (window.performance && window.performance.navigation.type === 2)) {
|
|
// vue.onLoad()
|
|
}
|
|
})
|
|
</script>
|
|
|
|
<!--#
|
|
}
|
|
#-->
|