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
@@ -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********************************/
.form-container {
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("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("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>
</head>
<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-sticky offset-top="46px">
<van-search
:reverse-color="false"
:show-action="false"
@search="doSearch"
input-align="left"
placeholder="请输入提案名称搜索"
v-model="pageForm.name"
:reverse-color="false"
:show-action="false"
@search="doSearch"
input-align="left"
placeholder="请输入提案名称搜索"
v-model="pageForm.name"
></van-search>
<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-sticky>
<van-pull-refresh v-model="tableRefreshing" @refresh="doSearch" style="min-height: calc(100vh - 90px)">
<van-list v-if="tableData && tableData.length>0" v-model="tableLoading" :finished="tableFinished" finished-text="" @load="pageData">
<div v-for="row in tableData" :key="row.id" class="list-card">
<div class="list-card-body">
<div class="van-multi-ellipsis--l2" style="padding: 0 16px; font-weight: bold">{{row.name}}</div>
<van-cell :value="row.code" title="提案编号"></van-cell>
<van-cell :value="row.createUserName" title="提案人"></van-cell>
<van-cell :value="row.typeName" title="提案类型"></van-cell>
<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>
<table-list api="/platform/proposal/mine/pageData" :page_form.sync="pageForm">
<template v-slot="{index,row}">
<table-column label="提案类型">{{row.typeName}}</table-column>
</template>
<template #actions="{index,row}">
{{index}}
</template>
</table-list>
<invite-seconder @refresh="doSearch" ref="inviteSeconderRef"></invite-seconder>
@@ -88,10 +58,6 @@ layout("/layouts/platform_h5.html"){
searchKeyword: "",
sessionId: null
},
tableData: [],
tableLoading: false,
tableFinished: false,
tableRefreshing: false,
sessionOptions: [],
infoShow: false
@@ -109,7 +75,7 @@ layout("/layouts/platform_h5.html"){
text: v.fullName,
value: v.id
}))
.concat([{ text: "全部届次", value: null }])
.concat([{text: "全部届次", value: null}])
if (this.sessionOptions.length > 0) {
this.pageForm.sessionId = this.sessionOptions[0].value
this.pageData()
@@ -129,31 +95,33 @@ layout("/layouts/platform_h5.html"){
},
pageData() {
this.tableLoading = true
const loading = createListLoading()
this.$axios
.post("/platform/proposal/mine/pageData", this.pageForm)
.then((res) => {
if (res.code === 0) {
this.tableData = this.tableData.concat(res.data.list)
this.pageForm.totalCount = res.data.totalCount
if (this.tableData.length >= this.pageForm.totalCount) {
this.tableFinished = true
}
this.pageForm.pageNumber++
}
})
.finally(() => {
loading.close()
this.tableLoading = false
this.tableRefreshing = false
})
this.$refs.tableListRef.pageData()
// this.tableLoading = true
// const loading = createListLoading()
// this.$axios
// .post("/platform/proposal/mine/pageData", this.pageForm)
// .then((res) => {
// if (res.code === 0) {
// this.tableData = this.tableData.concat(res.data.list)
// this.pageForm.totalCount = res.data.totalCount
// if (this.tableData.length >= this.pageForm.totalCount) {
// this.tableFinished = true
// }
// this.pageForm.pageNumber++
// }
// })
// .finally(() => {
// loading.close()
// this.tableLoading = false
// this.tableRefreshing = false
// })
},
doSearch() {
this.pageForm.pageNumber = 1
this.pageForm.totalCount = 0
this.tableData = []
this.pageData()
this.$refs.tableListRef.doSearch()
// this.pageForm.pageNumber = 1
// this.pageForm.totalCount = 0
// this.tableData = []
// this.pageData()
},
openRevoke(row) {
this.$dialog
@@ -162,7 +130,7 @@ layout("/layouts/platform_h5.html"){
message: "您确定要撤销申请吗?"
})
.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.doSearch()
})
@@ -175,7 +143,7 @@ layout("/layouts/platform_h5.html"){
message: "您确定要删除吗?"
})
.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) {
this.$toast.success(resp.msg)
this.doSearch()
@@ -1,381 +1,497 @@
<!--#
layout("/layouts/platform_h5.html"){
#-->
<style>
</style>
<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
:show="noticeDialogVisible"
:able-close="false"
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'">
<div class="form-container">
<van-form ref="addForm" @submit="onSubmit">
<!-- 基本信息 -->
<van-cell-group title="基本信息">
<van-field
v-model="formData.committeeId"
label="所属委员会"
readonly
clickable
@click="showCommitteePicker = true"
placeholder="请选择"
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="delegationOptions"
value-key="name"
@cancel="showCommitteePicker = false"
@confirm="committeeConfirm"
show-toolbar
:columns="committeeOptions.map(item => ({text: item.name, value: item.id}))"
@confirm="onCommitteeConfirm"
@cancel="showCommitteePicker = false"
></van-picker>
</van-popup>
</template>
<van-field
v-model="formData.typeName"
name="typeName"
label="提案类型"
required
readonly
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
v-model="formData.unitName"
label="单位"
readonly
:rules="[{ required: true, message: '请填写单位' }]"
></van-field>
<van-field label="提案内容" name="brief" v-model="formData.brief" required class="direction-column-field">
<template #input>
<text-editor v-model="formData.brief"></text-editor>
</template>
</van-field>
<van-field
v-model="formData.mobile"
label="联系电话"
type="tel"
placeholder="请输入联系电话"
:rules="[{ required: true, message: '请填写联系电话' }]"
></van-field>
<van-field label="可行性分析" name="measures" v-model="formData.measures" required class="direction-column-field">
<template #input>
<text-editor v-model="formData.measures"></text-editor>
</template>
</van-field>
</van-cell-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 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 label="签字" name="signature" v-model="formData.signature" required class="direction-column-field">
<h5-signature v-model="formData.signature" slot="input"></h5-signature>
</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-cell cell-class="form-button-cell" v-if="isWriteTime">
<van-button type="primary" @click="onSave">保存</van-button>
<van-button type="info" @click="onSubmit" v-if="!taskId">提交</van-button>
<van-button type="info" @click="onSubmitAgain" v-else>提交</van-button>
</van-cell>
</form>
</van-cell-group>
<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>
const vue = new Vue({
el: "#app",
new Vue({
el: '#app',
store,
dicts: ["PROPOSAL_TYPE"],
data() {
return {
bizId: GetQueryString("bizId"),
taskId: GetQueryString("taskId"),
formData: {},
showSourcePicker: false,
showSessionPicker: false,
showDelegationPicker: false,
showCommitteePicker: false,
showTypePicker: false,
sourceOptions: [],
sessionOptions: [],
sourceOptions: [],
delegationOptions: [],
committeeOptions: [],
typeOptions: [],
showSessionPicker: false,
showSourcePicker: false,
showTypePicker: false,
showCommitteePicker: false,
// 移除不必要的变量声明,这些值现在直接存储在formData对象中
fileList: [],
proposalConfig: {},
noticeDialogVisible: false,
rules: {
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
isWriteTime: true
}
},
methods: {
historyBack,
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'
// }
// })
// }
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() {
const valid = await this.$refs["addForm"].validate()
if (valid) {
try {
await this.$refs.addForm.validate();
if (!this.formData.name || this.formData.name.trim().length < 1) {
this.$message.warning("请填写提案名称")
return
}
if (this.formData.brief.length < this.proposalConfig.briefMinLength) {
this.$message.warning("提案内容和依据最少为" + this.proposalConfig.briefMinLength + "字")
return
this.$toast("请填写提案名称");
return;
}
this.$confirm("您确定要提交吗?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
if (this.formData.brief.length < this.proposalConfig.briefMinLength) {
this.$toast("提案内容和依据最少为" + this.proposalConfig.briefMinLength + "字");
return;
}
this.$dialog.confirm({
title: '提示',
message: '您确定要提交吗?',
}).then(() => {
this.$axios.post('/platform/proposal/write/submit', {info: JSON.stringify(this.formData)}).then(res => {
if (res.code === 0) {
this.$message.success("提交成功")
window.location.href = '/platform/proposal/mine'
}
})
})
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() {
const valid = await this.$refs["addForm"].validate()
if (valid) {
try {
await this.$refs.addForm.validate();
if (!this.formData.name || this.formData.name.trim().length < 1) {
this.$message.warning("请填写提案名称")
return
}
if (this.formData.brief.length < this.proposalConfig.briefMinLength) {
this.$message.warning("提案内容和依据最少为" + this.proposalConfig.briefMinLength + "字")
return
this.$toast("请填写提案名称");
return;
}
this.$confirm("您确定要提交吗?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
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: GetQueryString("taskId")
taskId: this.$utils.getQueryString("taskId")
}).then(res => {
this.$toast.clear();
if (res.code === 0) {
this.$message.success("提交成功")
window.location.href = '/platform/proposal/mine'
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);
}
},
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() {
this.$axios.post("/platform/proposal/common/listProposalType").then((res) => {
if (res.code === 0) {
this.typeOptions = res.data
this.typeOptions = res.data;
}
})
});
},
// 获取配置
getProposalConfig() {
return this.$axios.post("/platform/proposal/common/config").then((res) => {
if (res.code === 0) {
this.proposalConfig = res.data
this.proposalConfig = res.data;
}
})
});
},
//教代会change
async meetingChange(val) {
this.formData.delegationId = null
this.formData.committeeId = null
this.listDelegation()
this.searchMineDelegation()
// this.delegationOptions = await proposal.getDelegation(val)
// this.committeeOptions = await this.getInstitutions(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
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.$set(this.formData, "sessionId", this.sessionOptions[0].id)
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()
await this.searchMineDelegation();
// 检查是否在撰写时间内
this.checkWriteTime()
this.checkWriteTime();
}
await this.listDelegation()
await this.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) {
this.sourceOptions = res.data
this.sourceOptions = res.data;
}
})
});
},
//查询自己有权限的代表团
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) {
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) => {
if (res.code === 0) {
if (!res.data) {
this.$message.warning("当前时间不在撰写时间段内")
this.isWriteTime = false
this.$toast("当前时间不在撰写时间段内");
this.isWriteTime = false;
} else {
this.isWriteTime = true
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
this.listOpenSession(true)
}
})
} else {
// this.noticeDialogVisible = true
this.listOpenSession(false)
this.formData = res.data;
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)
// // 设置选择器显示值
// 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()
this.init();
this.listProposalType();
this.getProposalConfig();
}
})
</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-sticky>
<!-- style="min-height: calc(100vh - 106px)"-->
<van-pull-refresh v-model="tableRefreshing" @refresh="doSearch">
<van-list v-if="tableData && tableData.length>0" v-model="tableLoading" :finished="tableFinished"
finished-text="" @load="pageData">
<div class="table-list-container">
<div v-if="tableData.length === 0" class="empty-state">
<i class="fa fa-file-alt"></i>
</div>
<div v-for="(item, index) in tableData" :key="index" class="table-list-item">
<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>
<table-list api="/platform/proposal/mine/pageData" :page_form.sync="pageForm">
<template v-slot="{index,row}">
<table-column label="申请人">{{row.userName}}</table-column>
<table-column label="所属单位">{{row.unitName}}</table-column>
<table-column label="申请时间">{{row.submitTime}}</table-column>
<table-column label="当前节点">{{row.taskName}}</table-column>
</template>
<template #actions="{index,row}">
<div class="action-btn" @click="onView(row)">
<i class="fa fa-eye"></i>
<span>查看</span>
</div>
</van-list>
</van-pull-refresh>
<div class="action-btn" v-if="row.taskKey === 'startTask' || !row.instanceId"
@click="onEdit(row)">
<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>
<script>
@@ -203,10 +170,6 @@ layout("/layouts/platform_h5.html"){
searchKeyword: "",
sessionId: null
},
tableData: [],
tableLoading: false,
tableFinished: false,
tableRefreshing: false,
}
},
methods: {
@@ -33,25 +33,21 @@ layout("/layouts/platform_h5.html"){
</van-dropdown-menu>
</van-sticky>
<div>
<van-pull-refresh v-if="tableData.length>0" v-model="tableRefreshing" @refresh="doSearch">
<van-list v-model="tableLoading" :finished="tableFinished" finished-text="没有更多了" @load="pageData">
<div class="table-list">
<div class="table-card" v-for="row in tableData" :key="row.id+row.processTaskId">
<van-cell title="代表姓名" :value="row.userName"></van-cell>
<van-cell title="代表工号" :value="row.loginName"></van-cell>
<van-cell title="代表团">{{delegationOptions.find(v=>v.id===row.delegationId)?.name}}</van-cell>
<van-cell title="代表身份">
{{moreOptions.find(v=>v.title==='代表身份')?.options.find(v=>v.id===row.roleId)?.name}}
</van-cell>
<van-cell class="table-card-footer"></van-cell>
</div>
</div>
</van-list>
</van-pull-refresh>
<van-empty v-else image="/assets/platform/plugins/vant-green/images/nodata/nodata.png"
description="暂无数据"></van-empty>
</div>
<table-list api="/platform/teacherCongress/delegate/read/pageData" :page_form.sync="pageForm" json ref="tableListRef">
<template v-slot="{index,row}">
<table-column label="代表姓名">{{row.userName}}</table-column>
<table-column label="代表工号">{{row.loginName}}</table-column>
<table-column label="代表团">{{delegationOptions.find(v=>v.id===row.delegationId)?.name}}</table-column>
<table-column label="代表身份">{{moreOptions.find(v=>v.title==='代表身份')?.options.find(v=>v.id===row.roleId)?.name}}</table-column>
</template>
<template #actions="{index,row}">
<div class="action-btn">
<i class="fa fa-eye"></i>
<span>查看</span>
</div>
</template>
</table-list>
</div>
<script>
@@ -69,10 +65,6 @@ layout("/layouts/platform_h5.html"){
delegationId: null,
roleId: null
},
tableData: [],
tableLoading: false,
tableFinished: false,
tableRefreshing: false,
sessionOptions: [],
delegationOptions: [],
@@ -84,10 +76,6 @@ layout("/layouts/platform_h5.html"){
methods: {
historyBack,
updateTableData(data) {
this.tableData = data;
},
moreOptionChange(options) {
this.moreOptions = options
this.moreOptions.forEach((item) => {
@@ -148,27 +136,26 @@ layout("/layouts/platform_h5.html"){
})
},
pageData() {
this.tableLoading = true
this.$axios
.post("/platform/teacherCongress/delegate/read/pageData", {
pageForm: JSON.stringify(this.pageForm)
})
.then((resp) => {
this.tableData = this.tableData.concat(resp.data.list)
this.pageForm.totalCount = resp.data.totalCount
if (this.tableData.length >= this.pageForm.totalCount) {
this.tableFinished = true
} else {
this.pageForm.pageNumber++
}
this.tableLoading = false
})
// this.tableLoading = true
// this.$axios
// .post("/platform/teacherCongress/delegate/read/pageData", {
// pageForm: JSON.stringify(this.pageForm)
// })
// .then((resp) => {
// this.tableData = this.tableData.concat(resp.data.list)
// this.pageForm.totalCount = resp.data.totalCount
// if (this.tableData.length >= this.pageForm.totalCount) {
// this.tableFinished = true
// } else {
// this.pageForm.pageNumber++
// }
// this.tableLoading = false
// })
},
doSearch() {
this.pageForm.pageNumber = 1
this.pageForm.totalCount = 0
this.tableData = []
this.pageData()
this.$refs.tableListRef.doSearch()
}
},
created() {