173 lines
5.8 KiB
HTML
173 lines
5.8 KiB
HTML
<!--#
|
|
layout("/mobile/platform.html"){
|
|
#-->
|
|
<style>
|
|
#app {
|
|
height: 100%;
|
|
}
|
|
|
|
.cell-card {
|
|
padding: 20px;
|
|
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, .1);
|
|
width: 90%;
|
|
margin: 20px auto;
|
|
border-radius: 20px;
|
|
}
|
|
|
|
.text-overflow {
|
|
white-space: nowrap;
|
|
text-overflow: ellipsis;
|
|
overflow: hidden;
|
|
}
|
|
|
|
</style>
|
|
<div id="app" v-cloak>
|
|
<van-nav-bar
|
|
title="个人提案"
|
|
left-arrow
|
|
placeholder
|
|
fixed
|
|
@click-left="history.back()"
|
|
></van-nav-bar>
|
|
|
|
<div>
|
|
<van-pull-refresh v-model="refreshing" @refresh="onRefresh">
|
|
<van-list
|
|
v-model="loading"
|
|
:finished="finished"
|
|
:finished-text="tableData.length>0?'没有更多了':''"
|
|
@load="onLoad">
|
|
|
|
<van-cell v-for="o in tableData" class="cell-card">
|
|
<div style="width: 100%;display: flex;flex-direction:row">
|
|
<div class="text-overflow" style="font-weight: bold;color: #409EFF;width: calc(100% - 50px)"
|
|
@click="openView(o.id)">
|
|
{{o.proposalName}}
|
|
</div>
|
|
|
|
<div v-if="o.stateCode==100&&!config.isAutoSubmit" @click="doSubmit(o)"
|
|
style="width: 50px;display: flex;flex-direction:column;align-items: center;justify-content: center;font-size: 20px;color: #409EFF">
|
|
<van-icon name="share"/>
|
|
<div style="font-size: 8px">提交</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div style="font-size: 12px">编号:{{o.proposalCode}}</div>
|
|
<van-divider></van-divider>
|
|
<div style="display: flex;font-size: 12px">
|
|
<div style="width: 38%">
|
|
<div style="color: gray">教代会届次</div>
|
|
<div class="text-overflow">{{o.meetingName}}</div>
|
|
</div>
|
|
<div style="width: 38%">
|
|
<div style="color: gray">提案类型</div>
|
|
<div class="text-overflow">{{o.typeName}}</div>
|
|
</div>
|
|
<div style="width: 23%">
|
|
<div style="color: gray">提案状态</div>
|
|
<div class="text-overflow">{{o.stateName}}</div>
|
|
</div>
|
|
</div>
|
|
</van-cell>
|
|
</van-list>
|
|
</van-pull-refresh>
|
|
<van-empty
|
|
v-if="tableData.length==0"
|
|
class="custom-image"
|
|
image="/none.svg"
|
|
description="暂无数据"
|
|
></van-empty>
|
|
</div>
|
|
</div>
|
|
|
|
<script>
|
|
new Vue({
|
|
el: '#app',
|
|
data() {
|
|
return {
|
|
list: [],
|
|
config: [],
|
|
loading: false,
|
|
finished: false,
|
|
refreshing: false,
|
|
pageForm: {
|
|
pageNumber: 1,
|
|
pageSize: 5,
|
|
totalCount: 0
|
|
},
|
|
tableData: []
|
|
}
|
|
},
|
|
methods: {
|
|
async doSubmit(row) {
|
|
vant.Dialog.confirm({
|
|
title: '提示',
|
|
message: '是否提交提案?',
|
|
})
|
|
.then(async () => {
|
|
const toast = vant.Toast.loading({
|
|
duration: 0,
|
|
forbidClick: true,
|
|
message: '正在提交...',
|
|
});
|
|
|
|
const {code, msg} = await $.post('/platform/proposal/transact/compose/doSubmit', {
|
|
id: row.id,
|
|
mannerCode: row.mannerCode
|
|
})
|
|
if (code === 0) {
|
|
toast.icon = 'success'
|
|
toast.message = '提交成功'
|
|
await this.onRefresh()
|
|
} else {
|
|
toast.icon = 'fail'
|
|
toast.message = msg
|
|
}
|
|
|
|
setTimeout(() => {
|
|
vant.Toast.clear();
|
|
}, 500)
|
|
});
|
|
},
|
|
async onRefresh() {
|
|
this.tableData = []
|
|
this.pageForm = {
|
|
pageNumber: 1,
|
|
pageSize: 5,
|
|
totalCount: 0
|
|
}
|
|
await this.onLoad()
|
|
setTimeout(() => {
|
|
this.refreshing = false
|
|
}, 1000)
|
|
|
|
},
|
|
async onLoad() {
|
|
this.loading = true
|
|
$.post('/platform/mobile/proposal/compose/pageData', this.pageForm).then(res => {
|
|
this.loading = false
|
|
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++
|
|
}
|
|
}
|
|
})
|
|
},
|
|
openView(id) {
|
|
window.location.href = '/platform/mobile/proposal/compose/detail?id=' + id
|
|
}
|
|
},
|
|
async created() {
|
|
this.config = await getProposalConfig()
|
|
console.log(this.config)
|
|
}
|
|
})
|
|
</script>
|
|
|
|
<!--#
|
|
}
|
|
#-->
|