This commit is contained in:
那些花儿
2025-09-06 14:50:08 +08:00
parent fc15ba1d39
commit 602c9379a2
11 changed files with 829 additions and 1166 deletions
@@ -67,6 +67,12 @@ public class ProposalMineController {
public void index() { public void index() {
} }
@At(value = "/platform/h5/proposal/mine",top = true)
@Ok("beetl:/platform/zhghh5/democratic/proposal/transact/mine/index.html")
@SaCheckPermission("proposal.mine")
public void h5Index() {
}
@At @At
@SaCheckPermission("proposal.mine") @SaCheckPermission("proposal.mine")
@Aop(TransAop.READ_COMMITTED) @Aop(TransAop.READ_COMMITTED)
@@ -59,6 +59,14 @@ public class ProposalWriteController {
public void index() { public void index() {
} }
@At("")
@Ok("beetl:/platform/zhghh5/democratic/proposal/transact/write/index.html")
@SaCheckPermission("proposal.write")
public void h5Index(){
}
@At @At
@SaCheckPermission("proposal.write") @SaCheckPermission("proposal.write")
@Aop(TransAop.READ_COMMITTED) @Aop(TransAop.READ_COMMITTED)
@@ -183,136 +183,6 @@ body {
} }
/*****************************列表list css********************************/
.table-list-container {
padding: 0;
margin-top: 10px;
}
.table-list-container .table-list-item {
background-color: #fff;
border-bottom: 1px solid #eaecef;
padding: 16px;
position: relative;
margin-bottom: 10px;
}
.table-list-container .table-list-item:last-child {
border-bottom: none;
margin-bottom: 0;
}
.table-list-container .table-list-item .item-header {
display: flex;
justify-content: space-between;
align-items: flex-start;
margin-bottom: 10px;
}
.table-list-container .table-list-item .item-title {
font-size: 16px;
font-weight: 500;
color: #1f2f3d;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
flex: 1;
padding-right: 10px;
}
.table-list-container .table-list-item .item-meta {
display: flex;
color: #606266;
font-size: 14px;
margin-bottom: 5px;
padding: 4px 0;
}
.table-list-container .table-list-item .meta-item {
display: flex;
align-items: center;
gap: 8px;
width: 100%;
}
.table-list-container .table-list-item .meta-item i {
font-size: 14px;
color: #909399;
width: 16px;
text-align: center;
}
.table-list-container .table-list-item .item-content {
color: #606266;
font-size: 14px;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
line-height: 1.5;
}
.table-list-container .table-list-item .item-footer {
display: flex;
justify-content: space-between;
margin-top: 12px;
padding-top: 8px;
border-top: 1px dashed #eaecef;
color: #909399;
font-size: 13px;
}
.table-list-container .table-list-item .item-actions {
display: flex;
column-gap: 20px;
justify-content: end;
margin-top: 15px;
padding-top: 12px;
border-top: 1px solid #eaecef;
}
.table-list-container .table-list-item .action-btn {
display: flex;
align-items: center;
justify-content: end;
font-size: 14px;
color: var(--color-primary);
padding: 4px 0;
}
.table-list-container .table-list-item .action-btn i {
margin-right: 6px;
font-size: 16px;
}
.table-list-container .table-list-item .action-btn.delete {
color: #ff0000;
}
.table-list-container .table-list-item .action-btn.review {
color: #67c23a;
}
.table-list-container .empty-state {
text-align: center;
padding: 60px 20px;
color: #909399;
}
.table-list-container .empty-state i {
font-size: 60px;
margin-bottom: 16px;
color: #dcdee0;
}
.table-list-container .empty-state p {
margin-top: 10px;
font-size: 14px;
}
/*****************************申请表单CSS********************************/ /*****************************申请表单CSS********************************/
.form-container { .form-container {
padding-bottom: 80px; padding-bottom: 80px;
@@ -0,0 +1,61 @@
<script>
module.exports = {
name: "TableColumn",
props: {
label: {
type: String,
default: ""
},
value: {
type: [String, Number],
required: false
},
label_suffix:{
type: String,
default: ""
}
},
}
</script>
<template>
<div class="table-column">
<!-- 左侧 Label -->
<div class="label">
<slot name="label">
{{ label }}
{{label_suffix}}
</slot>
</div>
<!-- 右侧 Value -->
<div class="value">
<slot>{{ value }}</slot>
</div>
</div>
</template>
<style scoped>
.table-column {
display: flex;
padding: 8px 0;
}
.label {
color: #333;
font-size: 14px;
flex-shrink: 0;
max-width: 120px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.value {
color: #555;
font-size: 14px;
flex-grow: 1; /* 动态占据剩余部分 */
white-space: nowrap; /* 防止换行 */
overflow: hidden; /* 隐藏溢出的部分 */
text-overflow: ellipsis; /* 省略号 */
}
</style>
@@ -0,0 +1,225 @@
<template>
<van-pull-refresh v-model="tableRefreshing" @refresh="doSearch">
<div v-if="tableData.length === 0" class="empty-state">
<van-empty description="暂无数据"></van-empty>
</div>
<van-list v-if="tableData && tableData.length>0"
v-model="tableLoading"
:finished="tableFinished"
finished-text=""
@load="pageData">
<div class="table-list-container">
<div v-for="(row, index) in tableData" :key="index" class="table-list-item">
<slot name="header" :index="index" :row="row">
<div class="item-header">
<div class="item-title">{{row.name}}</div>
<enum-tag :value="row.instanceState" name="ProcessInstanceStateEnum" label_key="message" size="small"></enum-tag>
</div>
</slot>
<slot :index="index" :row="row"></slot>
<div class="item-actions">
<slot name="actions" :index="index" :row="row"></slot>
</div>
</div>
</div>
</van-list>
</van-pull-refresh>
</template>
<script>
module.exports = {
name: "TableList",
props: {
api: {
type: String,
required: true
},
page_form: {
type: Object,
required: true,
default: () => {
return {
pageNumber: 1,
pageSize: 10,
totalCount: 0,
searchKeyword: ""
}
}
},
json:{
type: Boolean,
default: false
}
},
data() {
return {
tableData: [],
tableLoading: false,
tableFinished: false,
tableRefreshing: false,
localPageForm: {...this.page_form}
}
},
methods: {
pageData() {
this.tableLoading = true
this.localPageForm = {...this.page_form}
const loading = createListLoading()
this.$axios.post(this.api, this.json ? ({pageForm:JSON.stringify(this.localPageForm)}) : this.localPageForm).then((res) => {
if (res.code === 0) {
this.tableData = this.tableData.concat(res.data.list)
this.localPageForm.totalCount = res.data.totalCount
if (this.tableData.length >= this.localPageForm.totalCount) {
this.tableFinished = true
}
this.localPageForm.pageNumber++
// 触发事件更新父组件的pageForm
this.$emit('update:page_form', {...this.localPageForm});
}
}).finally(() => {
loading.close()
this.tableLoading = false
this.tableRefreshing = false
})
},
doSearch() {
this.tableFinished = false;
this.tableData = [];
this.pageData();
}
},
created() {
// this.pageData();
}
}
</script>
<style scoped>
.table-list-container {
padding: 0;
margin-top: 10px;
}
.table-list-container .table-list-item {
background-color: #fff;
border-bottom: 1px solid #eaecef;
padding: 16px;
position: relative;
margin-bottom: 10px;
}
.table-list-container .table-list-item:last-child {
border-bottom: none;
margin-bottom: 0;
}
.table-list-container .table-list-item .item-header {
display: flex;
justify-content: space-between;
align-items: flex-start;
margin-bottom: 10px;
}
.table-list-container .table-list-item .item-title {
font-size: 16px;
font-weight: 500;
color: #1f2f3d;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
flex: 1;
padding-right: 10px;
}
.table-list-container .table-list-item .item-meta {
display: flex;
color: #606266;
font-size: 14px;
margin-bottom: 5px;
padding: 4px 0;
}
.table-list-container .table-list-item .meta-item {
display: flex;
align-items: center;
gap: 8px;
width: 100%;
}
.table-list-container .table-list-item .meta-item i {
font-size: 14px;
color: #909399;
width: 16px;
text-align: center;
}
.table-list-container .table-list-item .item-content {
color: #606266;
font-size: 14px;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
line-height: 1.5;
}
.table-list-container .table-list-item .item-footer {
display: flex;
justify-content: space-between;
margin-top: 12px;
padding-top: 8px;
border-top: 1px dashed #eaecef;
color: #909399;
font-size: 13px;
}
.table-list-container .table-list-item .item-actions {
display: flex;
column-gap: 20px;
justify-content: end;
margin-top: 15px;
padding-top: 12px;
border-top: 1px solid #eaecef;
}
.table-list-container .table-list-item .action-btn {
display: flex;
align-items: center;
justify-content: end;
font-size: 14px;
color: var(--color-primary);
padding: 4px 0;
}
.table-list-container .table-list-item .action-btn i {
margin-right: 6px;
font-size: 16px;
}
.table-list-container .table-list-item .action-btn.delete {
color: #ff0000;
}
.table-list-container .table-list-item .action-btn.review {
color: #67c23a;
}
.table-list-container .empty-state {
text-align: center;
padding: 60px 20px;
color: #909399;
}
.table-list-container .empty-state i {
font-size: 60px;
margin-bottom: 16px;
color: #dcdee0;
}
.table-list-container .empty-state p {
margin-top: 10px;
font-size: 14px;
}
</style>
@@ -369,7 +369,8 @@
Vue.component("year-van-dropdown-item", httpVueLoader("/components/plugins/vantMore/yearVanDropDownItem.vue?v=" + new Date().getTime())) Vue.component("year-van-dropdown-item", httpVueLoader("/components/plugins/vantMore/yearVanDropDownItem.vue?v=" + new Date().getTime()))
Vue.component("van-text-dialog", httpVueLoader("/components/plugins/vantMore/vantTextDialog.vue?v=" + new Date().getTime())) Vue.component("van-text-dialog", httpVueLoader("/components/plugins/vantMore/vantTextDialog.vue?v=" + new Date().getTime()))
Vue.component("enum-tag", httpVueLoader("/components/plugins/sysEnum/EnumTag.vue?v=" + new Date().getTime())) Vue.component("enum-tag", httpVueLoader("/components/plugins/sysEnum/EnumTag.vue?v=" + new Date().getTime()))
Vue.component("h5-table-list", httpVueLoader("/components/plugins/h5/h5TableList.vue?v=" + new Date().getTime())) Vue.component("table-list", httpVueLoader("/components/plugins/h5/TableList.vue?v=" + new Date().getTime()))
Vue.component("table-column", httpVueLoader("/components/plugins/h5/TableColumn.vue?v=" + new Date().getTime()))
</script> </script>
</head> </head>
<body> <body>
@@ -5,57 +5,27 @@ layout("/layouts/platform_h5.html"){
<van-nav-bar @click-left="historyBack" left-arrow left-text="返回" title="我的提案" placeholder fixed></van-nav-bar> <van-nav-bar @click-left="historyBack" left-arrow left-text="返回" title="我的提案" placeholder fixed></van-nav-bar>
<van-sticky offset-top="46px"> <van-sticky offset-top="46px">
<van-search <van-search
:reverse-color="false" :reverse-color="false"
:show-action="false" :show-action="false"
@search="doSearch" @search="doSearch"
input-align="left" input-align="left"
placeholder="请输入提案名称搜索" placeholder="请输入提案名称搜索"
v-model="pageForm.name" v-model="pageForm.name"
></van-search> ></van-search>
<van-dropdown-menu :close-on-click-outside="false" :close-on-click-overlay="false"> <van-dropdown-menu :close-on-click-outside="false" :close-on-click-overlay="false">
<van-dropdown-item :multiple="false" :options="sessionOptions" @change="sessionChange" v-model="pageForm.sessionId"></van-dropdown-item> <van-dropdown-item :multiple="false" :options="sessionOptions" @change="sessionChange"
v-model="pageForm.sessionId"></van-dropdown-item>
</van-dropdown-menu> </van-dropdown-menu>
</van-sticky> </van-sticky>
<van-pull-refresh v-model="tableRefreshing" @refresh="doSearch" style="min-height: calc(100vh - 90px)"> <table-list api="/platform/proposal/mine/pageData" :page_form.sync="pageForm">
<van-list v-if="tableData && tableData.length>0" v-model="tableLoading" :finished="tableFinished" finished-text="" @load="pageData"> <template v-slot="{index,row}">
<div v-for="row in tableData" :key="row.id" class="list-card"> <table-column label="提案类型">{{row.typeName}}</table-column>
<div class="list-card-body"> </template>
<div class="van-multi-ellipsis--l2" style="padding: 0 16px; font-weight: bold">{{row.name}}</div> <template #actions="{index,row}">
<van-cell :value="row.code" title="提案编号"></van-cell> {{index}}
<van-cell :value="row.createUserName" title="提案人"></van-cell> </template>
<van-cell :value="row.typeName" title="提案类型"></van-cell> </table-list>
<van-cell :value="row.sessionName" title="届次"></van-cell>
<van-cell :value="row.delegationName" title="代表团"></van-cell>
<van-cell :value="row.processInstanceNodeName" title="当前节点"></van-cell>
<div class="list-card-footer">
<van-button @click="openView(row)" size="small">查看</van-button>
<van-button @click="openEdit(row)" v-if="[10,40].includes(row.processInstanceNodeCode)" size="small">编辑</van-button>
<van-button
@click="$refs.inviteSeconderRef.onOpen(row)"
v-if="[10,20].includes(row.processInstanceNodeCode)"
size="small"
type="primary"
>
邀请附议人
</van-button>
<van-button
@click="openRevoke(row)"
v-if="[20].includes(row.processInstanceNodeCode) && !row.nextTaskIsComplete"
size="small"
type="danger"
>
撤销
</van-button>
<van-button v-if="[10,40,50].includes(row.processInstanceNodeCode)" @click="del(row.id)" size="small" type="danger">
删除
</van-button>
</div>
</div>
</div>
</van-list>
<van-empty image="/assets/platform/plugins/vant-green/images/nodata/nodata.png" description="暂无数据" v-else></van-empty>
</van-pull-refresh>
<invite-seconder @refresh="doSearch" ref="inviteSeconderRef"></invite-seconder> <invite-seconder @refresh="doSearch" ref="inviteSeconderRef"></invite-seconder>
@@ -88,10 +58,6 @@ layout("/layouts/platform_h5.html"){
searchKeyword: "", searchKeyword: "",
sessionId: null sessionId: null
}, },
tableData: [],
tableLoading: false,
tableFinished: false,
tableRefreshing: false,
sessionOptions: [], sessionOptions: [],
infoShow: false infoShow: false
@@ -109,7 +75,7 @@ layout("/layouts/platform_h5.html"){
text: v.fullName, text: v.fullName,
value: v.id value: v.id
})) }))
.concat([{ text: "全部届次", value: null }]) .concat([{text: "全部届次", value: null}])
if (this.sessionOptions.length > 0) { if (this.sessionOptions.length > 0) {
this.pageForm.sessionId = this.sessionOptions[0].value this.pageForm.sessionId = this.sessionOptions[0].value
this.pageData() this.pageData()
@@ -129,31 +95,33 @@ layout("/layouts/platform_h5.html"){
}, },
pageData() { pageData() {
this.tableLoading = true this.$refs.tableListRef.pageData()
const loading = createListLoading() // this.tableLoading = true
this.$axios // const loading = createListLoading()
.post("/platform/proposal/mine/pageData", this.pageForm) // this.$axios
.then((res) => { // .post("/platform/proposal/mine/pageData", this.pageForm)
if (res.code === 0) { // .then((res) => {
this.tableData = this.tableData.concat(res.data.list) // if (res.code === 0) {
this.pageForm.totalCount = res.data.totalCount // this.tableData = this.tableData.concat(res.data.list)
if (this.tableData.length >= this.pageForm.totalCount) { // this.pageForm.totalCount = res.data.totalCount
this.tableFinished = true // if (this.tableData.length >= this.pageForm.totalCount) {
} // this.tableFinished = true
this.pageForm.pageNumber++ // }
} // this.pageForm.pageNumber++
}) // }
.finally(() => { // })
loading.close() // .finally(() => {
this.tableLoading = false // loading.close()
this.tableRefreshing = false // this.tableLoading = false
}) // this.tableRefreshing = false
// })
}, },
doSearch() { doSearch() {
this.pageForm.pageNumber = 1 this.$refs.tableListRef.doSearch()
this.pageForm.totalCount = 0 // this.pageForm.pageNumber = 1
this.tableData = [] // this.pageForm.totalCount = 0
this.pageData() // this.tableData = []
// this.pageData()
}, },
openRevoke(row) { openRevoke(row) {
this.$dialog this.$dialog
@@ -162,7 +130,7 @@ layout("/layouts/platform_h5.html"){
message: "您确定要撤销申请吗?" message: "您确定要撤销申请吗?"
}) })
.then(() => { .then(() => {
this.$axios.post("/platform/proposal/mine/revokeApply", { id: row.id }).then((resp) => { this.$axios.post("/platform/proposal/mine/revokeApply", {id: row.id}).then((resp) => {
this.$toast.success(resp.msg) this.$toast.success(resp.msg)
this.doSearch() this.doSearch()
}) })
@@ -175,7 +143,7 @@ layout("/layouts/platform_h5.html"){
message: "您确定要删除吗?" message: "您确定要删除吗?"
}) })
.then(() => { .then(() => {
this.$axios.post("/platform/proposal/mine/delete", { id }).then((resp) => { this.$axios.post("/platform/proposal/mine/delete", {id}).then((resp) => {
if (resp.code === 0) { if (resp.code === 0) {
this.$toast.success(resp.msg) this.$toast.success(resp.msg)
this.doSearch() this.doSearch()
@@ -1,381 +1,497 @@
<!--# <!--#
layout("/layouts/platform_h5.html"){ layout("/layouts/platform_h5.html"){
#--> #-->
<style>
</style>
<div id="app" v-cloak> <div id="app" v-cloak>
<van-nav-bar title="撰写提案" left-text="返回" left-arrow @click-left="historyBack" placeholder fixed></van-nav-bar> <van-nav-bar title="撰写提案" left-text="返回" left-arrow @click-left="onClickLeft" placeholder fixed z-index="999"
class="custom-nav"></van-nav-bar>
<van-text-dialog <div class="form-container">
:show="noticeDialogVisible" <van-form ref="addForm" @submit="onSubmit">
:able-close="false" <!-- 基本信息 -->
title="提案撰写须知" <van-cell-group title="基本信息">
mask
button-text="我已知晓"
@confirm="noticeDialogVisible=false"
>
<div slot="body" v-html="proposalConfig.writeRemind"></div>
</van-text-dialog>
<van-cell-group>
<form ref="formRef">
<van-field v-model="formData.createUserName" label="代表姓名" readonly></van-field>
<van-field v-model="formData.createTime" label="提案时间" readonly></van-field>
<van-field
v-model="formData.sessionName"
name="sessionName"
label="所属教代会"
required
readonly
clickable
@click="showSessionPicker = true"
placeholder="请选择"
></van-field>
<van-popup v-model="showSessionPicker" position="bottom">
<van-picker
show-toolbar
:columns="sessionOptions"
value-key="fullName"
@cancel="showSessionPicker = false"
@confirm="sessionConfirm"
></van-picker>
</van-popup>
<van-field
v-model="formData.delegationName"
name="delegationName"
label="所属代表团"
required
readonly
clickable
@click="showDelegationPicker = true"
placeholder="请选择"
></van-field>
<van-popup v-model="showDelegationPicker" position="bottom">
<van-picker
show-toolbar
:columns="delegationOptions"
value-key="name"
@cancel="showDelegationPicker = false"
@confirm="delegationConfirm"
></van-picker>
</van-popup>
<van-field v-model="formData.name" name="name" label="提案名称" required placeholder="请输入提案名称"></van-field>
<van-field
v-model="formData.sourceName"
name="sourceName"
label="提案方式"
required
readonly
clickable
@click="showSourcePicker = true"
placeholder="请选择"
></van-field>
<van-popup v-model="showSourcePicker" position="bottom">
<van-picker
show-toolbar
:columns="sourceOptions"
value-key="name"
@cancel="showSourcePicker = false"
@confirm="sourceConfirm"
></van-picker>
</van-popup>
<template v-if="formData.mannerCode=='W03'">
<van-field <van-field
v-model="formData.committeeId" v-model="formData.createUserName"
label="所属委员会" label="代表姓名"
readonly readonly
clickable :rules="[{ required: true, message: '请填写提案人' }]"
@click="showCommitteePicker = true" ></van-field>
placeholder="请选择"
<van-field
v-model="formData.createTime"
label="提案时间"
readonly
:rules="[{ required: true, message: '请填写提案时间' }]"
></van-field>
<van-field
v-model="formData.sessionName"
is-link
readonly
name="教代会"
label="所属教代会"
placeholder="请选择所属教代会"
@click="showSessionPicker = true"
:rules="[{ required: true, message: '请选择所属教代会' }]"
></van-field>
<van-popup v-model="showSessionPicker" position="bottom">
<van-picker
show-toolbar
:columns="sessionOptions.map(item => ({text: item.fullName, value: item.id}))"
@confirm="onSessionConfirm"
@cancel="showSessionPicker = false"
></van-picker>
</van-popup>
<van-field
v-model="formData.delegationName"
label="所属代表团"
readonly
:rules="[{ required: true, message: '请选择所属代表团' }]"
></van-field>
<van-field
v-if="formData.mannerCode=='W03'"
v-model="formData.committeeName"
is-link
readonly
name="委员会"
label="所属委员会"
placeholder="请选择所属委员会"
@click="showCommitteePicker = true"
:rules="[{ required: true, message: '请选择所属委员会' }]"
></van-field> ></van-field>
<van-popup v-model="showCommitteePicker" position="bottom"> <van-popup v-model="showCommitteePicker" position="bottom">
<van-picker <van-picker
show-toolbar show-toolbar
:columns="delegationOptions" :columns="committeeOptions.map(item => ({text: item.name, value: item.id}))"
value-key="name" @confirm="onCommitteeConfirm"
@cancel="showCommitteePicker = false" @cancel="showCommitteePicker = false"
@confirm="committeeConfirm"
></van-picker> ></van-picker>
</van-popup> </van-popup>
</template>
<van-field <van-field
v-model="formData.typeName" v-model="formData.unitName"
name="typeName" label="单位"
label="提案类型" readonly
required :rules="[{ required: true, message: '请填写单位' }]"
readonly ></van-field>
clickable
@click="showTypePicker = true"
placeholder="请选择"
></van-field>
<van-popup v-model="showTypePicker" position="bottom">
<van-picker show-toolbar :columns="typeOptions" value-key="name" @cancel="showTypePicker = false" @confirm="typeConfirm"></van-picker>
</van-popup>
<van-field label="提案内容" name="brief" v-model="formData.brief" required class="direction-column-field"> <van-field
<template #input> v-model="formData.mobile"
<text-editor v-model="formData.brief"></text-editor> label="联系电话"
</template> type="tel"
</van-field> placeholder="请输入联系电话"
:rules="[{ required: true, message: '请填写联系电话' }]"
></van-field>
<van-field label="可行性分析" name="measures" v-model="formData.measures" required class="direction-column-field"> </van-cell-group>
<template #input>
<text-editor v-model="formData.measures"></text-editor>
</template>
</van-field>
<van-field label="附件" name="files" required class="direction-column-field"> <van-cell-group title="提案信息" class="form-group">
<h5-file-upload <van-field
slot="input" v-model="formData.name"
:value.sync="formData.files" label="提案名称"
:upload_number="10" placeholder="请输入提案名称"
upload_mode="file" :rules="[{ required: true, message: '请填写提案名称' }]"
upload_result_category="array" maxlength="100"
upload_result_type="url" show-word-limit
complete_result ></van-field>
></h5-file-upload>
</van-field>
<van-field label="签字" name="signature" v-model="formData.signature" required class="direction-column-field"> <van-field
<h5-signature v-model="formData.signature" slot="input"></h5-signature> v-model="formData.sourceName"
</van-field> is-link
readonly
name="提案方式"
label="提案方式"
placeholder="请选择提案方式"
@click="showSourcePicker = true"
:rules="[{ required: true, message: '请选择提案方式' }]"
></van-field>
<van-popup v-model="showSourcePicker" position="bottom">
<van-picker
show-toolbar
:columns="sourceOptions.map(item => ({text: item.name, value: item.code}))"
@confirm="onSourceConfirm"
@cancel="showSourcePicker = false"
></van-picker>
</van-popup>
<van-cell cell-class="form-button-cell" v-if="isWriteTime"> <van-field
<van-button type="primary" @click="onSave">保存</van-button> v-model="formData.typeName"
<van-button type="info" @click="onSubmit" v-if="!taskId">提交</van-button> is-link
<van-button type="info" @click="onSubmitAgain" v-else>提交</van-button> readonly
</van-cell> name="提案类别"
</form> label="提案类别"
</van-cell-group> placeholder="请选择提案类别"
@click="showTypePicker = true"
:rules="[{ required: true, message: '请选择提案类别' }]"
></van-field>
<van-popup v-model="showTypePicker" position="bottom">
<van-picker
show-toolbar
:columns="typeOptions.map(item => ({text: item.name, value: item.id}))"
@confirm="onTypeConfirm"
@cancel="showTypePicker = false"
></van-picker>
</van-popup>
</van-cell-group>
<van-cell-group title="提案内容" class="form-group">
<van-field
v-model="formData.researchFindings"
label="调研情况"
type="textarea"
rows="4"
autosize
placeholder="请输入调研情况"
:rules="[{ required: true, message: '请填写调研情况' }]"
></van-field>
<van-field
v-model="formData.brief"
label="案由"
type="textarea"
rows="6"
autosize
placeholder="请输入案由"
:rules="[{ required: true, message: '请填写案由' }]"
></van-field>
<van-field
v-model="formData.measures"
label="建议措施"
type="textarea"
rows="6"
autosize
placeholder="请输入建议措施"
:rules="[{ required: true, message: '请填写建议措施' }]"
></van-field>
</van-cell-group>
<!-- 附件上传 -->
<van-cell-group title="附件上传" class="form-group">
<van-field label="附件" name="files" required class="direction-column-field">
<h5-file-upload
slot="input"
:value.sync="formData.files"
:upload_number="10"
upload_mode="file"
upload_result_category="array"
upload_result_type="url"
complete_result
></h5-file-upload>
</van-field>
</van-cell-group>
<!-- 按钮区域 -->
<div class="form-actions" v-if="isWriteTime">
<van-button plain type="info" @click="onSave">保存</van-button>
<van-button type="primary" @click="onSubmit" v-if="!taskId">提交</van-button>
<van-button type="primary" @click="onSubmitAgain" v-else>提交</van-button>
</div>
</van-form>
</div>
<!-- 提案撰写须知弹窗 -->
<van-dialog
v-model="noticeDialogVisible"
title="提案撰写须知"
show-cancel-button
confirm-button-text="我已知晓"
@confirm="noticeDialogVisible = false"
>
<div class="notice-dialog-content" v-html="proposalConfig.writeRemind"></div>
</van-dialog>
</div> </div>
<script> <script>
const vue = new Vue({ new Vue({
el: "#app", el: '#app',
store, store,
dicts: ["PROPOSAL_TYPE"],
data() { data() {
return { return {
bizId: GetQueryString("bizId"), bizId: GetQueryString("bizId"),
taskId: GetQueryString("taskId"), taskId: GetQueryString("taskId"),
formData: {}, formData: {},
showSourcePicker: false,
showSessionPicker: false,
showDelegationPicker: false,
showCommitteePicker: false,
showTypePicker: false,
sourceOptions: [],
sessionOptions: [], sessionOptions: [],
sourceOptions: [],
delegationOptions: [], delegationOptions: [],
committeeOptions: [],
typeOptions: [], typeOptions: [],
showSessionPicker: false,
showSourcePicker: false,
showTypePicker: false,
showCommitteePicker: false,
// 移除不必要的变量声明,这些值现在直接存储在formData对象中
fileList: [],
proposalConfig: {}, proposalConfig: {},
noticeDialogVisible: false, noticeDialogVisible: false,
rules: { isWriteTime: true
name: [{ required: true, message: "请输入提案名称" }],
source: [{ required: true, message: "请选择提案方式" }],
sessionId: [{ required: true, message: "请选择所属教代会" }],
delegationId: [{ required: true, message: "请选择所属代表团" }],
typeId: [{ required: true, message: "请选择提案类型" }],
brief: [{ required: true, message: "请输入提案内容" }],
measures: [{ required: true, message: "请输入可行性分析" }],
signature: [{ required: true, message: "请输入签字" }],
files: [{ required: false, message: "请上传附件" }]
},
showButton: false
} }
}, },
methods: { methods: {
historyBack, onClickLeft() {
history.back();
async onSave() {
this.$refs['formRef'].validate().then(async valid => {
console.log( valid)
})
// const valid = await this.$refs["addForm"].validate()
// if (valid) {
// if (!this.formData.name || this.formData.name.trim().length < 1) {
// this.$message.warning("请填写提案名称")
// return
// }
//
// this.$axios.post("/platform/proposal/write/save", {info: JSON.stringify(this.formData)}).then((res) => {
// if (res.code === 0) {
// this.$message.success(res.msg)
// this.formData = res.data
// window.location.href = '/platform/proposal/mine'
// }
// })
// }
}, },
// 选择器确认事件
onSessionConfirm(value) {
this.formData.sessionId = value.value;
const selectedOption = this.sessionOptions.find(item => item.id === value.value);
if (selectedOption) {
this.$set(this.formData, 'sessionName', selectedOption.fullName);
}
this.showSessionPicker = false;
this.meetingChange(value.value);
},
onSourceConfirm(value) {
this.formData.source = value.value;
this.$set(this.formData, 'sourceName', value.text);
this.showSourcePicker = false;
},
onTypeConfirm(value) {
this.formData.typeId = value.value;
this.$set(this.formData, 'typeName', value.text);
this.showTypePicker = false;
},
onCommitteeConfirm(value) {
this.formData.committeeId = value.value;
this.$set(this.formData, 'committeeName', value.text);
this.showCommitteePicker = false;
},
async onSave() {
// 表单验证
try {
await this.$refs.addForm.validate();
if (!this.formData.name || this.formData.name.trim().length < 1) {
this.$toast("请填写提案名称");
return;
}
this.$toast.loading({
message: '保存中...',
forbidClick: true,
});
this.$axios.post("/platform/proposal/write/save", {info: JSON.stringify(this.formData)})
.then((res) => {
this.$toast.clear();
if (res.code === 0) {
this.$toast.success(res.msg);
this.formData = res.data;
setTimeout(() => {
pjaxReplace('/platform/h5/proposal/mine')
}, 1500);
} else {
this.$toast.fail(res.msg || '保存失败');
}
})
.catch(err => {
this.$toast.clear();
this.$toast.fail('网络错误,请稍后重试');
});
} catch (error) {
// 表单验证失败
console.log('表单验证失败', error);
}
},
// 提交 // 提交
async onSubmit() { async onSubmit() {
const valid = await this.$refs["addForm"].validate() try {
if (valid) { await this.$refs.addForm.validate();
if (!this.formData.name || this.formData.name.trim().length < 1) { if (!this.formData.name || this.formData.name.trim().length < 1) {
this.$message.warning("请填写提案名称") this.$toast("请填写提案名称");
return return;
}
if (this.formData.brief.length < this.proposalConfig.briefMinLength) {
this.$message.warning("提案内容和依据最少为" + this.proposalConfig.briefMinLength + "字")
return
} }
this.$confirm("您确定要提交吗?", "提示", { if (this.formData.brief.length < this.proposalConfig.briefMinLength) {
confirmButtonText: "确定", this.$toast("提案内容和依据最少为" + this.proposalConfig.briefMinLength + "");
cancelButtonText: "取消", return;
type: "warning" }
this.$dialog.confirm({
title: '提示',
message: '您确定要提交吗?',
}).then(() => { }).then(() => {
this.$axios.post('/platform/proposal/write/submit', {info: JSON.stringify(this.formData)}).then(res => { this.$toast.loading({
if (res.code === 0) { message: '提交中...',
this.$message.success("提交成功") forbidClick: true,
window.location.href = '/platform/proposal/mine' });
}
}) this.$axios.post('/platform/proposal/write/submit', {info: JSON.stringify(this.formData)})
}) .then(res => {
this.$toast.clear();
if (res.code === 0) {
this.$toast.success("提交成功");
setTimeout(() => {
pjaxReplace('/platform/h5/proposal/mine')
}, 1500);
} else {
this.$toast.fail(res.msg || '提交失败');
}
})
.catch(err => {
this.$toast.clear();
this.$toast.fail('网络错误,请稍后重试');
});
}).catch(() => {
// 取消提交
});
} catch (error) {
// 表单验证失败
console.log('表单验证失败', error);
} }
}, },
// 重新提交 // 重新提交
async onSubmitAgain() { async onSubmitAgain() {
const valid = await this.$refs["addForm"].validate() try {
if (valid) { await this.$refs.addForm.validate();
if (!this.formData.name || this.formData.name.trim().length < 1) { if (!this.formData.name || this.formData.name.trim().length < 1) {
this.$message.warning("请填写提案名称") this.$toast("请填写提案名称");
return return;
}
if (this.formData.brief.length < this.proposalConfig.briefMinLength) {
this.$message.warning("提案内容和依据最少为" + this.proposalConfig.briefMinLength + "字")
return
} }
this.$confirm("您确定要提交吗?", "提示", { if (this.formData.brief.length < this.proposalConfig.briefMinLength) {
confirmButtonText: "确定", this.$toast("提案内容和依据最少为" + this.proposalConfig.briefMinLength + "");
cancelButtonText: "取消", return;
type: "warning" }
this.$dialog.confirm({
title: '提示',
message: '您确定要提交吗?',
}).then(() => { }).then(() => {
this.$toast.loading({
message: '提交中...',
forbidClick: true,
});
this.$axios.post('/platform/proposal/write/submitAgain', { this.$axios.post('/platform/proposal/write/submitAgain', {
info: JSON.stringify(this.formData), info: JSON.stringify(this.formData),
taskId: GetQueryString("taskId") taskId: this.$utils.getQueryString("taskId")
}).then(res => { }).then(res => {
this.$toast.clear();
if (res.code === 0) { if (res.code === 0) {
this.$message.success("提交成功") this.$toast.success("提交成功");
window.location.href = '/platform/proposal/mine' setTimeout(() => {
pjaxReplace('/platform/h5/proposal/mine')
}, 1500);
} else {
this.$toast.fail(res.msg || '提交失败');
} }
}) }).catch(err => {
}) this.$toast.clear();
this.$toast.fail('网络错误,请稍后重试');
});
}).catch(() => {
// 取消提交
});
} catch (error) {
// 表单验证失败
console.log('表单验证失败', error);
} }
}, },
sourceConfirm(val) {
this.showSourcePicker = false
this.formData.source = val.code
this.formData.sourceName = val.name
},
sessionConfirm(val) {
this.showSessionPicker = false
this.formData.sessionName = val.fullName
this.formData.sessionId = val.id
},
delegationConfirm(val) {
this.showDelegationPicker = false
this.formData.delegationId = val.id
this.formData.delegationName = val.name
},
committeeConfirm(val) {
this.showCommitteePicker = false
this.formData.committeeId = val.id
this.formData.committeeName = val.name
},
typeConfirm(val) {
this.showTypePicker = false
this.formData.typeId = val.id
this.formData.typeName = val.name
},
// 获取提案类别 // 获取提案类别
listProposalType() { listProposalType() {
this.$axios.post("/platform/proposal/common/listProposalType").then((res) => { this.$axios.post("/platform/proposal/common/listProposalType").then((res) => {
if (res.code === 0) { if (res.code === 0) {
this.typeOptions = res.data this.typeOptions = res.data;
} }
}) });
}, },
// 获取配置 // 获取配置
getProposalConfig() { getProposalConfig() {
return this.$axios.post("/platform/proposal/common/config").then((res) => { return this.$axios.post("/platform/proposal/common/config").then((res) => {
if (res.code === 0) { if (res.code === 0) {
this.proposalConfig = res.data this.proposalConfig = res.data;
} }
}) });
}, },
//教代会change //教代会change
async meetingChange(val) { async meetingChange(val) {
this.formData.delegationId = null this.formData.delegationId = null;
this.formData.committeeId = null this.formData.committeeId = null;
this.listDelegation() this.formData.delegationName = '';
this.searchMineDelegation() this.formData.committeeName = '';
// this.delegationOptions = await proposal.getDelegation(val) await this.listDelegation();
// this.committeeOptions = await this.getInstitutions(val) await this.searchMineDelegation();
await this.listSource();
// 检查是否在撰写时间内
this.checkWriteTime();
}, },
// 获取代表团 // 获取代表团
listDelegation() { listDelegation() {
return this.$axios.post("/platform/proposal/common/listDelegation", {sessionId: this.formData.sessionId}).then((res) => { return this.$axios.post("/platform/proposal/common/listDelegation", {sessionId: this.formData.sessionId}).then((res) => {
if (res.code === 0) { if (res.code === 0) {
this.delegationOptions = res.data this.delegationOptions = res.data;
} }
}) });
}, },
// 查询开启的教代会 // 查询开启的教代会
listOpenSession(isModify = false) { listOpenSession(isModify = false) {
this.$axios.post("/platform/proposal/common/listOpenSession").then(async (res) => { this.$axios.post("/platform/proposal/common/listOpenSession").then(async (res) => {
if (res.code === 0) { if (res.code === 0) {
this.sessionOptions = res.data this.sessionOptions = res.data;
if (!isModify && this.sessionOptions) { if (!isModify && this.sessionOptions && this.sessionOptions.length > 0) {
this.$set(this.formData, "sessionId", this.sessionOptions[0].id) this.$set(this.formData, "sessionId", this.sessionOptions[0].id);
this.$set(this.formData, "sessionName", this.sessionOptions[0].fullName);
await this.listDelegation();
await this.listSource();
// 获取代表团 // 获取代表团
await this.searchMineDelegation() await this.searchMineDelegation();
// 检查是否在撰写时间内 // 检查是否在撰写时间内
this.checkWriteTime() this.checkWriteTime();
} }
await this.listDelegation()
await this.listSource()
} }
}) });
}, },
//查询自己有权限的撰写方式 //查询自己有权限的撰写方式
listSource() { listSource() {
return this.$axios.post("/platform/proposal/write/listSource", { sessionId: this.formData.sessionId }).then((res) => { return this.$axios.post("/platform/proposal/write/listSource", {sessionId: this.formData.sessionId}).then((res) => {
if (res.code === 0) { if (res.code === 0) {
this.sourceOptions = res.data this.sourceOptions = res.data;
} }
}) });
}, },
//查询自己有权限的代表团 //查询自己有权限的代表团
searchMineDelegation() { searchMineDelegation() {
return this.$axios.post("/platform/proposal/write/searchMineDelegation", { sessionId: this.formData.sessionId }).then((res) => { return this.$axios.post("/platform/proposal/write/searchMineDelegation", {sessionId: this.formData.sessionId}).then((res) => {
if (res.code === 0) { if (res.code === 0) {
this.$set(this.formData, "delegationId", res.data) this.$set(this.formData, "delegationId", res.data);
// 设置代表团名称
const delegation = this.delegationOptions.find(item => item.id === res.data);
if (delegation) {
this.formData.delegationName = delegation.name;
}
} }
}) });
}, },
// 检查是否在撰写时间内 // 检查是否在撰写时间内
@@ -383,40 +499,58 @@ layout("/layouts/platform_h5.html"){
this.$axios.post("/platform/proposal/write/checkWriteTime", {sessionId: this.formData.sessionId}).then((res) => { this.$axios.post("/platform/proposal/write/checkWriteTime", {sessionId: this.formData.sessionId}).then((res) => {
if (res.code === 0) { if (res.code === 0) {
if (!res.data) { if (!res.data) {
this.$message.warning("当前时间不在撰写时间段内") this.$toast("当前时间不在撰写时间段内");
this.isWriteTime = false this.isWriteTime = false;
} else { } else {
this.isWriteTime = true this.isWriteTime = true;
} }
} }
}) });
}, },
init() { init() {
if (this.bizId) { if (this.bizId) {
this.$axios.post("/platform/proposal/write/detail", {id: this.bizId}).then((res) => { this.$axios.post("/platform/proposal/write/detail", {id: this.bizId}).then((res) => {
if (res.code === 0) { if (res.code === 0) {
this.formData = res.data this.formData = res.data;
this.listOpenSession(true)
}
})
} else {
// this.noticeDialogVisible = true
this.listOpenSession(false)
this.$set(this.formData, "createUserId", this.$store.state.user.id) // // 设置选择器显示值
this.$set(this.formData, "createUserName", this.$store.state.user.username) // const delegation = this.delegationOptions.find(item => item.id === this.formData.delegationId);
this.$set(this.formData, "createUserLoginName", this.$store.state.user.loginname) // if (delegation) {
this.$set(this.formData, "createTime", this.$moment().format("YYYY-MM-DD")) // this.formData.delegationName = delegation.name;
this.$set(this.formData, "mobile", this.$store.state.user.mobile) // }
this.$set(this.formData, "unitName", this.$store.state.user.unit?.name) //
// const source = this.sourceOptions.find(item => item.code === this.formData.source);
// if (source) {
// this.sourceName = source.name;
// }
//
// const type = this.typeOptions.find(item => item.id === this.formData.typeId);
// if (type) {
// this.typeName = type.name;
// }
this.listOpenSession(true);
}
});
} else {
// this.noticeDialogVisible = true;
this.listOpenSession(false);
// 设置用户信息
this.$set(this.formData, "createUserId", this.$store.state.user.id);
this.$set(this.formData, "createUserName", this.$store.state.user.username);
this.$set(this.formData, "createUserLoginName", this.$store.state.user.loginname);
this.$set(this.formData, "createTime", this.$moment().format("YYYY-MM-DD"));
this.$set(this.formData, "mobile", this.$store.state.user.mobile);
this.$set(this.formData, "unitName", this.$store.state.user.unit?.name);
} }
} }
}, },
created() { created() {
this.init() this.init();
this.listProposalType() this.listProposalType();
this.getProposalConfig() this.getProposalConfig();
} }
}) })
</script> </script>
@@ -1,560 +0,0 @@
<!--#
layout("/layouts/platform_h5.html"){
#-->
<style>
</style>
<div id="app" v-cloak>
<van-nav-bar title="撰写提案" left-text="返回" left-arrow @click-left="onClickLeft" placeholder fixed z-index="999"
class="custom-nav"></van-nav-bar>
<div class="form-container">
<van-form ref="addForm" @submit="onSubmit">
<!-- 基本信息 -->
<van-cell-group title="基本信息">
<van-field
v-model="formData.createUserName"
label="代表姓名"
readonly
:rules="[{ required: true, message: '请填写提案人' }]"
></van-field>
<van-field
v-model="formData.createTime"
label="提案时间"
readonly
:rules="[{ required: true, message: '请填写提案时间' }]"
></van-field>
<van-field
v-model="formData.sessionName"
is-link
readonly
name="教代会"
label="所属教代会"
placeholder="请选择所属教代会"
@click="showSessionPicker = true"
:rules="[{ required: true, message: '请选择所属教代会' }]"
></van-field>
<van-popup v-model="showSessionPicker" position="bottom">
<van-picker
show-toolbar
:columns="sessionOptions.map(item => ({text: item.fullName, value: item.id}))"
@confirm="onSessionConfirm"
@cancel="showSessionPicker = false"
></van-picker>
</van-popup>
<van-field
v-model="formData.delegationName"
label="所属代表团"
readonly
:rules="[{ required: true, message: '请选择所属代表团' }]"
></van-field>
<van-field
v-if="formData.mannerCode=='W03'"
v-model="formData.committeeName"
is-link
readonly
name="委员会"
label="所属委员会"
placeholder="请选择所属委员会"
@click="showCommitteePicker = true"
:rules="[{ required: true, message: '请选择所属委员会' }]"
></van-field>
<van-popup v-model="showCommitteePicker" position="bottom">
<van-picker
show-toolbar
:columns="committeeOptions.map(item => ({text: item.name, value: item.id}))"
@confirm="onCommitteeConfirm"
@cancel="showCommitteePicker = false"
></van-picker>
</van-popup>
<van-field
v-model="formData.unitName"
label="单位"
readonly
:rules="[{ required: true, message: '请填写单位' }]"
></van-field>
<van-field
v-model="formData.mobile"
label="联系电话"
type="tel"
placeholder="请输入联系电话"
:rules="[{ required: true, message: '请填写联系电话' }]"
></van-field>
</van-cell-group>
<van-cell-group title="提案信息" class="form-group">
<van-field
v-model="formData.name"
label="提案名称"
placeholder="请输入提案名称"
:rules="[{ required: true, message: '请填写提案名称' }]"
maxlength="100"
show-word-limit
></van-field>
<van-field
v-model="formData.sourceName"
is-link
readonly
name="提案方式"
label="提案方式"
placeholder="请选择提案方式"
@click="showSourcePicker = true"
:rules="[{ required: true, message: '请选择提案方式' }]"
></van-field>
<van-popup v-model="showSourcePicker" position="bottom">
<van-picker
show-toolbar
:columns="sourceOptions.map(item => ({text: item.name, value: item.code}))"
@confirm="onSourceConfirm"
@cancel="showSourcePicker = false"
></van-picker>
</van-popup>
<van-field
v-model="formData.typeName"
is-link
readonly
name="提案类别"
label="提案类别"
placeholder="请选择提案类别"
@click="showTypePicker = true"
:rules="[{ required: true, message: '请选择提案类别' }]"
></van-field>
<van-popup v-model="showTypePicker" position="bottom">
<van-picker
show-toolbar
:columns="typeOptions.map(item => ({text: item.name, value: item.id}))"
@confirm="onTypeConfirm"
@cancel="showTypePicker = false"
></van-picker>
</van-popup>
</van-cell-group>
<van-cell-group title="提案内容" class="form-group">
<van-field
v-model="formData.researchFindings"
label="调研情况"
type="textarea"
rows="4"
autosize
placeholder="请输入调研情况"
:rules="[{ required: true, message: '请填写调研情况' }]"
></van-field>
<van-field
v-model="formData.brief"
label="案由"
type="textarea"
rows="6"
autosize
placeholder="请输入案由"
:rules="[{ required: true, message: '请填写案由' }]"
></van-field>
<van-field
v-model="formData.measures"
label="建议措施"
type="textarea"
rows="6"
autosize
placeholder="请输入建议措施"
:rules="[{ required: true, message: '请填写建议措施' }]"
></van-field>
</van-cell-group>
<!-- 附件上传 -->
<van-cell-group title="附件上传" class="form-group">
<van-field label="附件" name="files" required class="direction-column-field">
<h5-file-upload
slot="input"
:value.sync="formData.files"
:upload_number="10"
upload_mode="file"
upload_result_category="array"
upload_result_type="url"
complete_result
></h5-file-upload>
</van-field>
</van-cell-group>
<!-- 按钮区域 -->
<div class="form-actions" v-if="isWriteTime">
<van-button plain type="info" @click="onSave">保存</van-button>
<van-button type="primary" @click="onSubmit" v-if="!taskId">提交</van-button>
<van-button type="primary" @click="onSubmitAgain" v-else>提交</van-button>
</div>
</van-form>
</div>
<!-- 提案撰写须知弹窗 -->
<van-dialog
v-model="noticeDialogVisible"
title="提案撰写须知"
show-cancel-button
confirm-button-text="我已知晓"
@confirm="noticeDialogVisible = false"
>
<div class="notice-dialog-content" v-html="proposalConfig.writeRemind"></div>
</van-dialog>
</div>
<script>
new Vue({
el: '#app',
store,
data() {
return {
bizId: GetQueryString("bizId"),
taskId: GetQueryString("taskId"),
formData: {},
sessionOptions: [],
sourceOptions: [],
delegationOptions: [],
committeeOptions: [],
typeOptions: [],
showSessionPicker: false,
showSourcePicker: false,
showTypePicker: false,
showCommitteePicker: false,
// 移除不必要的变量声明,这些值现在直接存储在formData对象中
fileList: [],
proposalConfig: {},
noticeDialogVisible: false,
isWriteTime: true
}
},
methods: {
onClickLeft() {
history.back();
},
// 选择器确认事件
onSessionConfirm(value) {
this.formData.sessionId = value.value;
const selectedOption = this.sessionOptions.find(item => item.id === value.value);
if (selectedOption) {
this.$set(this.formData, 'sessionName', selectedOption.fullName);
}
this.showSessionPicker = false;
this.meetingChange(value.value);
},
onSourceConfirm(value) {
this.formData.source = value.value;
this.$set(this.formData, 'sourceName', value.text);
this.showSourcePicker = false;
},
onTypeConfirm(value) {
this.formData.typeId = value.value;
this.$set(this.formData, 'typeName', value.text);
this.showTypePicker = false;
},
onCommitteeConfirm(value) {
this.formData.committeeId = value.value;
this.$set(this.formData, 'committeeName', value.text);
this.showCommitteePicker = false;
},
async onSave() {
// 表单验证
try {
await this.$refs.addForm.validate();
if (!this.formData.name || this.formData.name.trim().length < 1) {
this.$toast("请填写提案名称");
return;
}
this.$toast.loading({
message: '保存中...',
forbidClick: true,
});
this.$axios.post("/platform/proposal/write/save", {info: JSON.stringify(this.formData)})
.then((res) => {
this.$toast.clear();
if (res.code === 0) {
this.$toast.success(res.msg);
this.formData = res.data;
setTimeout(() => {
pjaxReplace('/platform/h5/proposal/mine')
}, 1500);
} else {
this.$toast.fail(res.msg || '保存失败');
}
})
.catch(err => {
this.$toast.clear();
this.$toast.fail('网络错误,请稍后重试');
});
} catch (error) {
// 表单验证失败
console.log('表单验证失败', error);
}
},
// 提交
async onSubmit() {
try {
await this.$refs.addForm.validate();
if (!this.formData.name || this.formData.name.trim().length < 1) {
this.$toast("请填写提案名称");
return;
}
if (this.formData.brief.length < this.proposalConfig.briefMinLength) {
this.$toast("提案内容和依据最少为" + this.proposalConfig.briefMinLength + "字");
return;
}
this.$dialog.confirm({
title: '提示',
message: '您确定要提交吗?',
}).then(() => {
this.$toast.loading({
message: '提交中...',
forbidClick: true,
});
this.$axios.post('/platform/proposal/write/submit', {info: JSON.stringify(this.formData)})
.then(res => {
this.$toast.clear();
if (res.code === 0) {
this.$toast.success("提交成功");
setTimeout(() => {
pjaxReplace('/platform/h5/proposal/mine')
}, 1500);
} else {
this.$toast.fail(res.msg || '提交失败');
}
})
.catch(err => {
this.$toast.clear();
this.$toast.fail('网络错误,请稍后重试');
});
}).catch(() => {
// 取消提交
});
} catch (error) {
// 表单验证失败
console.log('表单验证失败', error);
}
},
// 重新提交
async onSubmitAgain() {
try {
await this.$refs.addForm.validate();
if (!this.formData.name || this.formData.name.trim().length < 1) {
this.$toast("请填写提案名称");
return;
}
if (this.formData.brief.length < this.proposalConfig.briefMinLength) {
this.$toast("提案内容和依据最少为" + this.proposalConfig.briefMinLength + "字");
return;
}
this.$dialog.confirm({
title: '提示',
message: '您确定要提交吗?',
}).then(() => {
this.$toast.loading({
message: '提交中...',
forbidClick: true,
});
this.$axios.post('/platform/proposal/write/submitAgain', {
info: JSON.stringify(this.formData),
taskId: this.$utils.getQueryString("taskId")
}).then(res => {
this.$toast.clear();
if (res.code === 0) {
this.$toast.success("提交成功");
setTimeout(() => {
pjaxReplace('/platform/h5/proposal/mine')
}, 1500);
} else {
this.$toast.fail(res.msg || '提交失败');
}
}).catch(err => {
this.$toast.clear();
this.$toast.fail('网络错误,请稍后重试');
});
}).catch(() => {
// 取消提交
});
} catch (error) {
// 表单验证失败
console.log('表单验证失败', error);
}
},
// 获取提案类别
listProposalType() {
this.$axios.post("/platform/proposal/common/listProposalType").then((res) => {
if (res.code === 0) {
this.typeOptions = res.data;
}
});
},
// 获取配置
getProposalConfig() {
return this.$axios.post("/platform/proposal/common/config").then((res) => {
if (res.code === 0) {
this.proposalConfig = res.data;
}
});
},
//教代会change
async meetingChange(val) {
this.formData.delegationId = null;
this.formData.committeeId = null;
this.formData.delegationName = '';
this.formData.committeeName = '';
await this.listDelegation();
await this.searchMineDelegation();
await this.listSource();
// 检查是否在撰写时间内
this.checkWriteTime();
},
// 获取代表团
listDelegation() {
return this.$axios.post("/platform/proposal/common/listDelegation", {sessionId: this.formData.sessionId}).then((res) => {
if (res.code === 0) {
this.delegationOptions = res.data;
}
});
},
// 查询开启的教代会
listOpenSession(isModify = false) {
this.$axios.post("/platform/proposal/common/listOpenSession").then(async (res) => {
if (res.code === 0) {
this.sessionOptions = res.data;
if (!isModify && this.sessionOptions && this.sessionOptions.length > 0) {
this.$set(this.formData, "sessionId", this.sessionOptions[0].id);
this.$set(this.formData, "sessionName", this.sessionOptions[0].fullName);
await this.listDelegation();
await this.listSource();
// 获取代表团
await this.searchMineDelegation();
// 检查是否在撰写时间内
this.checkWriteTime();
}
}
});
},
//查询自己有权限的撰写方式
listSource() {
return this.$axios.post("/platform/proposal/write/listSource", {sessionId: this.formData.sessionId}).then((res) => {
if (res.code === 0) {
this.sourceOptions = res.data;
}
});
},
//查询自己有权限的代表团
searchMineDelegation() {
return this.$axios.post("/platform/proposal/write/searchMineDelegation", {sessionId: this.formData.sessionId}).then((res) => {
if (res.code === 0) {
this.$set(this.formData, "delegationId", res.data);
// 设置代表团名称
const delegation = this.delegationOptions.find(item => item.id === res.data);
if (delegation) {
this.formData.delegationName = delegation.name;
}
}
});
},
// 检查是否在撰写时间内
checkWriteTime() {
this.$axios.post("/platform/proposal/write/checkWriteTime", {sessionId: this.formData.sessionId}).then((res) => {
if (res.code === 0) {
if (!res.data) {
this.$toast("当前时间不在撰写时间段内");
this.isWriteTime = false;
} else {
this.isWriteTime = true;
}
}
});
},
init() {
if (this.bizId) {
this.$axios.post("/platform/proposal/write/detail", {id: this.bizId}).then((res) => {
if (res.code === 0) {
this.formData = res.data;
// // 设置选择器显示值
// const delegation = this.delegationOptions.find(item => item.id === this.formData.delegationId);
// if (delegation) {
// this.formData.delegationName = delegation.name;
// }
//
// const source = this.sourceOptions.find(item => item.code === this.formData.source);
// if (source) {
// this.sourceName = source.name;
// }
//
// const type = this.typeOptions.find(item => item.id === this.formData.typeId);
// if (type) {
// this.typeName = type.name;
// }
this.listOpenSession(true);
}
});
} else {
// this.noticeDialogVisible = true;
this.listOpenSession(false);
// 设置用户信息
this.$set(this.formData, "createUserId", this.$store.state.user.id);
this.$set(this.formData, "createUserName", this.$store.state.user.username);
this.$set(this.formData, "createUserLoginName", this.$store.state.user.loginname);
this.$set(this.formData, "createTime", this.$moment().format("YYYY-MM-DD"));
this.$set(this.formData, "mobile", this.$store.state.user.mobile);
this.$set(this.formData, "unitName", this.$store.state.user.unit?.name);
}
}
},
created() {
this.init();
this.listProposalType();
this.getProposalConfig();
}
})
</script>
<!--#
}
#-->
@@ -127,67 +127,34 @@ layout("/layouts/platform_h5.html"){
></van-search> ></van-search>
</van-sticky> </van-sticky>
<!-- style="min-height: calc(100vh - 106px)"--> <table-list api="/platform/proposal/mine/pageData" :page_form.sync="pageForm">
<van-pull-refresh v-model="tableRefreshing" @refresh="doSearch"> <template v-slot="{index,row}">
<van-list v-if="tableData && tableData.length>0" v-model="tableLoading" :finished="tableFinished" <table-column label="申请人">{{row.userName}}</table-column>
finished-text="" @load="pageData"> <table-column label="所属单位">{{row.unitName}}</table-column>
<table-column label="申请时间">{{row.submitTime}}</table-column>
<div class="table-list-container"> <table-column label="当前节点">{{row.taskName}}</table-column>
<div v-if="tableData.length === 0" class="empty-state"> </template>
<i class="fa fa-file-alt"></i> <template #actions="{index,row}">
</div> <div class="action-btn" @click="onView(row)">
<i class="fa fa-eye"></i>
<div v-for="(item, index) in tableData" :key="index" class="table-list-item"> <span>查看</span>
<div class="item-header" @click="viewDetail(item)">
<div class="item-title">{{ item.title || '无标题' }}</div>
<enum-tag :value="item.instanceState" name="ProcessInstanceStateEnum" label_key="message"
size="small"></enum-tag>
</div>
<div class="item-meta" @click="viewDetail(item)">
<div class="meta-item">
<span><span>申请人:</span>{{ item.userName || '未知' }}</span>
</div>
</div>
<div class="item-meta" @click="viewDetail(item)">
<div class="meta-item">
<span><span>所属单位:</span>{{ item.unitName || '未知' }}</span>
</div>
</div>
<div class="item-meta" @click="viewDetail(item)">
<div class="meta-item">
<span><span>申请时间:</span>{{ item.submitTime || '未知' }}</span>
</div>
</div>
<div class="item-meta" @click="viewDetail(item)">
<div class="meta-item">
<span><span>当前节点:</span>{{ item.taskName || '未知' }}</span>
</div>
</div>
<div class="item-actions">
<div class="action-btn" @click="onView(item)">
<i class="fa fa-eye"></i>
<span>查看</span>
</div>
<div class="action-btn" v-if="item.taskKey === 'startTask' || !item.instanceId"
@click="onEdit(item)">
<i class="fa fa-edit"></i>
<span>编辑</span>
</div>
<div class="action-btn delete" v-if="item.canRevoke" @click="onRevoke(item)">
<i class="fa fa-undo"></i>
<span>撤回</span>
</div>
<div class="action-btn delete" v-if="item.taskKey === 'startTask' || !item.instanceId"
@click="onDelete(item)">
<i class="fa fa-trash"></i>
<span>删除</span>
</div>
</div>
</div>
</div> </div>
<div class="action-btn" v-if="row.taskKey === 'startTask' || !row.instanceId"
</van-list> @click="onEdit(row)">
</van-pull-refresh> <i class="fa fa-edit"></i>
<span>编辑</span>
</div>
<div class="action-btn delete" v-if="row.canRevoke" @click="onRevoke(item)">
<i class="fa fa-undo"></i>
<span>撤回</span>
</div>
<div class="action-btn delete" v-if="row.taskKey === 'startTask' || !row.instanceId"
@click="onDelete(row)">
<i class="fa fa-trash"></i>
<span>删除</span>
</div>
</template>
</table-list>
</div> </div>
<script> <script>
@@ -203,10 +170,6 @@ layout("/layouts/platform_h5.html"){
searchKeyword: "", searchKeyword: "",
sessionId: null sessionId: null
}, },
tableData: [],
tableLoading: false,
tableFinished: false,
tableRefreshing: false,
} }
}, },
methods: { methods: {
@@ -33,25 +33,21 @@ layout("/layouts/platform_h5.html"){
</van-dropdown-menu> </van-dropdown-menu>
</van-sticky> </van-sticky>
<div>
<van-pull-refresh v-if="tableData.length>0" v-model="tableRefreshing" @refresh="doSearch"> <table-list api="/platform/teacherCongress/delegate/read/pageData" :page_form.sync="pageForm" json ref="tableListRef">
<van-list v-model="tableLoading" :finished="tableFinished" finished-text="没有更多了" @load="pageData"> <template v-slot="{index,row}">
<div class="table-list"> <table-column label="代表姓名">{{row.userName}}</table-column>
<div class="table-card" v-for="row in tableData" :key="row.id+row.processTaskId"> <table-column label="代表工号">{{row.loginName}}</table-column>
<van-cell title="代表姓名" :value="row.userName"></van-cell> <table-column label="代表团">{{delegationOptions.find(v=>v.id===row.delegationId)?.name}}</table-column>
<van-cell title="代表工号" :value="row.loginName"></van-cell> <table-column label="代表身份">{{moreOptions.find(v=>v.title==='代表身份')?.options.find(v=>v.id===row.roleId)?.name}}</table-column>
<van-cell title="代表团">{{delegationOptions.find(v=>v.id===row.delegationId)?.name}}</van-cell> </template>
<van-cell title="代表身份"> <template #actions="{index,row}">
{{moreOptions.find(v=>v.title==='代表身份')?.options.find(v=>v.id===row.roleId)?.name}} <div class="action-btn">
</van-cell> <i class="fa fa-eye"></i>
<van-cell class="table-card-footer"></van-cell> <span>查看</span>
</div> </div>
</div> </template>
</van-list> </table-list>
</van-pull-refresh>
<van-empty v-else image="/assets/platform/plugins/vant-green/images/nodata/nodata.png"
description="暂无数据"></van-empty>
</div>
</div> </div>
<script> <script>
@@ -69,10 +65,6 @@ layout("/layouts/platform_h5.html"){
delegationId: null, delegationId: null,
roleId: null roleId: null
}, },
tableData: [],
tableLoading: false,
tableFinished: false,
tableRefreshing: false,
sessionOptions: [], sessionOptions: [],
delegationOptions: [], delegationOptions: [],
@@ -84,10 +76,6 @@ layout("/layouts/platform_h5.html"){
methods: { methods: {
historyBack, historyBack,
updateTableData(data) {
this.tableData = data;
},
moreOptionChange(options) { moreOptionChange(options) {
this.moreOptions = options this.moreOptions = options
this.moreOptions.forEach((item) => { this.moreOptions.forEach((item) => {
@@ -148,27 +136,26 @@ layout("/layouts/platform_h5.html"){
}) })
}, },
pageData() { pageData() {
this.tableLoading = true // this.tableLoading = true
this.$axios // this.$axios
.post("/platform/teacherCongress/delegate/read/pageData", { // .post("/platform/teacherCongress/delegate/read/pageData", {
pageForm: JSON.stringify(this.pageForm) // pageForm: JSON.stringify(this.pageForm)
}) // })
.then((resp) => { // .then((resp) => {
this.tableData = this.tableData.concat(resp.data.list) // this.tableData = this.tableData.concat(resp.data.list)
this.pageForm.totalCount = resp.data.totalCount // this.pageForm.totalCount = resp.data.totalCount
if (this.tableData.length >= this.pageForm.totalCount) { // if (this.tableData.length >= this.pageForm.totalCount) {
this.tableFinished = true // this.tableFinished = true
} else { // } else {
this.pageForm.pageNumber++ // this.pageForm.pageNumber++
} // }
this.tableLoading = false // this.tableLoading = false
}) // })
}, },
doSearch() { doSearch() {
this.pageForm.pageNumber = 1 this.pageForm.pageNumber = 1
this.pageForm.totalCount = 0 this.pageForm.totalCount = 0
this.tableData = [] this.$refs.tableListRef.doSearch()
this.pageData()
} }
}, },
created() { created() {