Files
UNION_NSI/target/classes/views/platform/proposal/transact/write.html
T
2026-09-08 19:49:21 +08:00

805 lines
38 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<!--#
layout("/layouts/platform.html"){
#-->
<style>
.el-select {
width: 100%;
}
.remindTextArea textarea {
resize: none;
}
.remindClass {
width: 100%;
white-space: break-spaces;
font-size: 14px;
line-height: 25px;
background-color: white;
max-height: 600px;
overflow-y: scroll;
}
</style>
<div id="app" v-cloak>
<guava ref="guava">
<template>
<el-card shadow="never">
<template #header>
<h3 style="color: #1867b0">撰写提案</h3>
</template>
<template>
<el-form :model="formData" :rules="formRules" label-width="120px" ref="addForm">
<el-row :gutter="20" type="flex">
<el-col :span="12">
<el-form-item label="代表姓名" prop="username">
<el-input readonly type="text" v-model="formData.username"></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="提案时间" prop="createTime">
<el-input readonly type="text" v-model="formData.createTime"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20" type="flex">
<el-col :span="12">
<el-form-item label="提案名称" prop="proposalName">
<el-input maxlength="100" placeholder="提案名称"
v-model="formData.proposalName"></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="提案方式" prop="mannerCode">
<el-radio :key="item.id" :label="item.code" border
size="medium"
v-for="item in mannerList" v-model="formData.mannerCode">
{{item.name}}
</el-radio>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20" type="flex">
<el-col :span="12">
<el-form-item label="所属教代会" prop="teacherMeetingId">
<el-select @change="meetingChange" clearable filterable
placeholder="所属教代会"
v-model="formData.teacherMeetingId">
<el-option :key="item.id" :label="item.jdhallname"
:value="item.id"
v-for="item in meetingOptions">
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="所属代表团" prop="delegationId" v-if="formData.mannerCode!='W03'">
<el-select clearable filterable placeholder="所属代表团"
v-model="formData.delegationId">
<el-option :key="item.id" :label="item.dbtname"
:value="item.id"
v-for="item in delegationOptions">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="所属委员会" prop="committeeId" v-if="formData.mannerCode=='W03'">
<el-select clearable filterable placeholder="所属委员会"
v-model="formData.committeeId">
<el-option :key="item.id" :label="item.name" :value="item.id"
v-for="item in committeeOptions">
</el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20" type="flex">
<el-col :span="12">
<el-form-item label="提案类型" prop="typeId">
<el-select clearable filterable placeholder="提案类型"
v-model="formData.typeId">
<el-option
:key="item.id"
:label="item.typeName"
:value="item.id"
v-for="item in typeOptions">
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<!-- <el-form-item label="建议落实部门" prop="implementUnitId">-->
<!-- <el-select clearable filterable placeholder="建议落实部门"-->
<!-- v-model="formData.implementUnitId">-->
<!-- <el-option-->
<!-- :key="item.id"-->
<!-- :label="item.unitName"-->
<!-- :value="item.id"-->
<!-- v-for="item in unitOptions">-->
<!-- </el-option>-->
<!-- </el-select>-->
<!-- </el-form-item>-->
</el-col>
</el-row>
<el-form-item class="is-required" label="案由" prop="brief">
<div id="briefEditor"></div>
</el-form-item>
<el-form-item class="is-required" label="建议措施" prop="measures">
<div id="measuresEditor"></div>
</el-form-item>
<el-form-item label="附件上传" prop="files">
<file-upload :files.sync="formData.files" card></file-upload>
</el-form-item>
<el-form-item label="签&emsp;字" prop="sign" v-if="isSign()">
<sign :qz.sync="formData.sign" prefix="proposal"></sign>
</el-form-item>
<el-form-item>
<el-row justify="center" type="flex">
<el-button @click="doAdd" type="primary" v-throttle>保存到我的提案</el-button>
<el-button @click="openSeconded" type="primary" v-if="formData.mannerCode=='W01'">邀请附议人
</el-button>
<el-button @click="doSubmit" type="primary" v-if="formData.mannerCode!='W01'">提交
</el-button>
</el-row>
</el-form-item>
</el-form>
</template>
</el-card>
</template>
<!-- <template #public>
<el-card shadow="never">
<div class="btn-group tool-button">
<el-input clearable placeholder="请输入内容" v-model="pageForm2.searchKeyword">
<el-select placeholder="查询" slot="prepend" style="width: 100px;"
v-model="pageForm2.searchName">
<el-option label="工号" value="u.loginname"></el-option>
<el-option label="姓名" value="u.username"></el-option>
</el-select>
</el-input>
</div>
<div class="btn-group tool-button">
<el-select @change="jdhChange" clearable filterable placeholder="请选择届次" v-model="pageForm2.jdhid">
<el-option
:key="item.id"
:label="item.jdhallname"
:value="item.id"
v-for="item in jdhList">
</el-option>
</el-select>
</div>
<div class="btn-group tool-button">
<el-select @change="delegationChange" clearable filterable placeholder="请选择代表团"
v-model="pageForm2.dbtid">
<el-option
:key="item.id"
:label="item.dbtname"
:value="item.id"
v-for="item in delegations">
</el-option>
</el-select>
</div>
<div class="btn-group tool-button">
<el-select
@change="unitList = allUnitList.filter(v => pageForm2.unionid?v.unionid === pageForm2.unionid:true)"
clearable filterable placeholder="请选择工会"
v-model="pageForm2.unionid">
<el-option
:key="item.id"
:label="item.unionname"
:value="item.id"
v-for="item in unionList">
</el-option>
</el-select>
</div>
<div class="btn-group tool-button">
<el-select clearable filterable placeholder="请选择单位" v-model="pageForm2.unitid">
<el-option
:key="item.id"
:label="item.name"
:value="item.id"
v-for="item in unitList">
</el-option>
</el-select>
</div>
<div class="btn-group tool-button">
<el-button @click="queryDb" icon="el-icon-search" type="primary"></el-button>
</div>
<div class="btn-group tool-button mt5">
<el-radio-group @change="queryDb" v-model="pageForm2.isAudit">
<el-radio-button :label="true">已邀请({{secondedNum}}</el-radio-button>
<el-radio-button :label="false">待邀请</el-radio-button>
</el-radio-group>
</div>
</el-card>
<el-card class="mt10" shadow="never">
<table-tool :app="this" label="邀请附议人">
<template #label_end>
<el-button @click="addSeconded(0)" class="ml20" plain type="primary" v-if="!pageForm2.isAudit">
批量邀请
</el-button>
</template>
<template #func>
<span>
温馨提醒:请选择
<span style="color:red;font-size: 16px;font-weight: bold">
{{config.seconderNum ? config.seconderNum : 0}}
</span>
位附议人,否则无法提交提案!
</span>
</template>
</table-tool>
<el-table :data="dBTableData" :size="tableSize" @selection-change="handleSelectionChange"
class="vi-table" ref="multipleTable" row-key="id" style="width: 100%"
v-loading="dBTableDataLoading">
<el-table-column
type="selection"
width="55">
</el-table-column>
<el-table-column align="center" header-align="center" label="序号" type="index">
<template scope="scope">
<span>{{ scope.$index + (pageForm2.pageNumber - 1) * pageForm2.pageSize + 1 }} </span>
</template>
</el-table-column>
<el-table-column
:label="column.label"
:prop="column.prop"
:sortable="column.sortable"
align="center"
header-align="center"
show-overflow-tooltip
v-for="column in dBTableColumns"
>
<template scope="{row:{isAgree}}" v-if="column.prop=='isAgree'">
<template v-if="typeof isAgree === 'undefined'">
<span class="text-success">待邀请</span>
</template>
<template v-else>
<span class="text-info" v-if="isAgree == null">未附议</span>
<span class="text-danger" v-if="isAgree == false">不通过</span>
<span class="text-success" v-if="isAgree == true">通过</span>
</template>
</template>
</el-table-column>
<el-table-column align="center" header-align="center" label="操作" v-if="!pageForm2.isAudit"
width="100">
<template slot-scope="{row}">
<el-button @click="addSeconded(row.id)" size="mini">邀请</el-button>
</template>
</el-table-column>
</el-table>
<el-row class="el-pagination-container" style="margin-bottom: 0px">
<el-pagination
:current-page="pageForm2.pageNumber"
:page-size="pageForm2.pageSize"
:page-sizes="[5,10, 20, 30, 50]"
:total="pageForm2.totalCount"
@current-change="pageNumberChange2"
@size-change="pageSizeChange2"
layout="total, sizes, prev, pager, next">
</el-pagination>
</el-row>
</el-card>
</template>-->
</guava>
<el-dialog :close-on-click-modal="false" :visible.sync="writeRemindDialog" title="撰写须知" top="50px" width="60%"
append-to-body>
<!-- <pre class="remindClass">-->
<!-- {{config.writeRemind}}-->
<!-- </pre>-->
<el-input
:autosize="{ minRows: 10, maxRows: 30}"
class="remindTextArea"
readonly
type="textarea"
v-model="config.writeRemind">
</el-input>
<!-- <div v-html="config.writeRemind"></div>-->
<div class="text-center" slot="footer">
<el-button @click="writeRemindDialog = false" type="primary">我已知晓</el-button>
</div>
</el-dialog>
</div>
<script>
const E = window.wangEditor
let briefEditor, measuresEditor = null
var vue = new Vue({
el: '#app',
mixins: [initTableMixins],
data() {
const validBrief = (rule, value, callback) => {
if (!this.formData.brief || !dd3s.html2txt(this.formData.brief)) {
callback(new Error('请填写提案内容、案由和案据'));
} else if (dd3s.html2txt(this.formData.brief).length < this.config.words) {
callback(new Error('提案内容至少需要' + this.config.words + '字'));
} else {
callback();
}
};
const validMeasures = (rule, value, callback) => {
if (!this.formData.measures || !dd3s.html2txt(this.formData.measures)) {
callback(new Error('请填写提案实施的可行性建议'));
} else {
callback();
}
};
return {
pageForm2: {
searchName: 'u.username',
searchKeyword: "",
pageNumber: 1,
pageSize: 10,
totalCount: 0,
pageOrderName: "",
pageOrderBy: "",
isAudit: false,
jdhid: '',
dbtid: '',
unionid: '',
unitid: ''
},
jdhList: [],
delegations: [],
userOptions: [],
unionList: [],
unitList: [],
secondedNum: 0,
dBTableDataLoading: false,
dBTableData: [],
secondedFormData: {users: []},
secondedDialog: false,
userLoading: false,
subDisabled: false,
secondedTableData: [],
config: {},
formData: {
sign: '',
mannerCode: ''
},
meetingOptions: [],
typeOptions: [],
unitOptions: [],
allMannerList: [],
mannerList: [],
delegationOptions: [],
committeeOptions: [],
formRules: {
username: [{required: true, message: '请填写提案人', trigger: ['blur', 'change']}],
createTime: [{required: true, message: '请填写提案时间', trigger: ['blur', 'change']}],
proposalName: [{required: true, message: '请填写提案名称', trigger: ['blur', 'change']}],
mannerCode: [{required: true, message: '请选择提案方式', trigger: ['blur', 'change']}],
delegationId: [{required: true, message: '请选择所属代表团', trigger: ['blur', 'change']}],
teacherMeetingId: [{required: true, message: '请选择所属教代会', trigger: ['blur', 'change']}],
committeeId: [{required: true, message: '请选择所属委员会', trigger: ['blur', 'change']}],
/*typeId: [{required: true, message: '请选择提案类型', trigger: ['blur', 'change']}],*/
implementUnitId: [{required: false, message: '请选择建以落实部门', trigger: ['blur', 'change']}],
sign: [{required: true, message: '请扫描二维码进行签字', trigger: ['blur', 'change']}],
brief: [{validator: validBrief, trigger: ['blur', 'change']}],
measures: [{validator: validMeasures, trigger: ['blur', 'change']}],
},
dBTableColumns: [
{prop: 'loginname', label: '工号', sortable: true},
{prop: 'username', label: '姓名'},
{prop: 'sex', label: '性别', sortable: true},
{prop: 'mobile', label: '联系方式'},
{prop: 'dbUnitName', label: '所属单位'},
{prop: 'dbUnionName', label: '所属工会'},
{prop: 'jdhAllName', label: '届次', sortable: true},
{prop: 'dbtName', label: '代表团', sortable: true},
{prop: 'isAgree', label: '附议状态', sortable: true},
],
isSign: () => {
return proposal.needSignState.map(v => v.stateCode).includes(proposal.UNSUBMIT)
},
writeRemindDialog: false
}
},
components: {
'file-upload': httpVueLoader('/components/plugins/FileUpload.vue')
},
methods: {
async doAdd() {
let method = this.formData.id ? "/doEdit" : "/doAdd"
this.$refs["addForm"].validate(async (valid) => {
if (valid) {
const loading = this.$loading({
lock: true,
text: '正在提交...',
spinner: 'el-icon-loading',
background: COVER_LAYER_COLOR
});
let data = clone(this.formData)
if (data.files) {
data.files = JSON.stringify(data.files)
}
$.post('/platform/proposal/transact/compose' + method, {
data: JSON.stringify(data),
sign: data.sign
}).then(res => {
if (res.code == 0) {
loading.close()
this.$notify.success({title: '成功', message: res.msg});
sublime.jumpPagePjax('/platform/proposal/transact/compose')
} else {
this.$notify.error({title: '失败', message: res.msg});
}
})
loading.close()
}
});
},
async doSubmit() {
const valid = await this.$refs["addForm"].validate()
if (valid) {
const confirm = await this.$confirm('确定要提交此提案吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'info',
})
if ("confirm" === confirm) {
let data = clone(this.formData)
if (data.files) {
data.files = JSON.stringify(data.files)
}
const resp = await $.post(loc() + "/doSubmit", {
data: JSON.stringify(data)
})
if (resp.code === 0) {
this.notifySuccess(resp.msg)
sublime.jumpPagePjax('/platform/proposal/transact/compose')
} else {
this.notifyWarning(resp.msg)
}
}
}
},
handleSelectionChange(val) {
this.dbUserSelection = val.map(v => v.id);
},
pageNumberChange2(val) {
this.pageForm2.pageNumber = val;
this.queryDb();
},
pageSizeChange2(val) {
this.pageForm2.pageSize = val;
this.queryDb();
},
async delegationChange(val) {
this.unionList = await getUnions(val)
},
async jdhChange(val) {
this.delegations = await getDbt(val)
},
async queryDb() {
const {jdhid, dbtid, unionid, unitid, proposalId} = this.pageForm2
const data = await $.get("/platform/proposal/transact/compose/queryDb", {
...this.pageForm2,
pageForm2: this.pageForm2,
proposalId: proposalId,
jdhid: jdhid,
dbtid: dbtid,
unionid: unionid,
unitid: unitid
})
sublime.closeLoadingbar();
this.dBTableDataLoading = false
if (data.code == 0) {
this.dBTableData = data.data.list;
if (data.data.list[0].secondedNum != undefined) {
this.secondedNum = data.data.list[0].secondedNum
}
this.pageForm2.totalCount = data.data.totalCount;
} else {
this.$message.error(data.msg);
}
},
async openSeconded() {
let method = this.formData.id ? "/doEdit" : "/doAdd"
const valid = await this.$refs["addForm"].validate()
if (valid) {
let data = clone(this.formData)
if (data.files) {
data.files = JSON.stringify(data.files)
}
const resp = await $.post('/platform/proposal/transact/compose' + method, {
data: JSON.stringify(data),
sign: data.sign
})
sublime.jumpPagePjax('/platform/proposal/transact/compose?operation=invite&id=' + resp.data)
}
// if (this.formData.id == "") {
// this.$notify.warning({title: '警告', message: "请先保存后在邀请附议人"});
// return
// }
// this.pageForm2.proposalId = this.formData.id
// this.pageForm2.proposalName = this.formData.proposalName
// await this.queryDb()
// this.$refs.guava.public()
/* this.secondedFormData = {
proposalId: this.formData.id,
users: [],
}
this.secondedData()
this.userOptions = []
this.userLoading = false
this.secondedDialog = true*/
},
async secondedData() {
const {data} = await $.get("/platform/proposal/transact/compose/getSecondedData", {proposalId: this.secondedFormData.proposalId})
this.secondedTableData = data
},
async userRemoteMethod(query) {
if (query) {
this.userLoading = true
const arr = await this.queryUser(this.secondedFormData.proposalId, query)
this.userOptions = this.userOptions.filter(v => {
return this.secondedFormData.users.includes(v.id)
}).concat(arr.filter(v => {
return !this.secondedFormData.users.includes(v.id)
}));
this.userLoading = false
}
},
async queryUser(proposalId, query) {
const {data} = await $.get("/platform/proposal/transact/compose/queryDelegate", {proposalId, query})
return data
},
async addSeconded(id) {
const {proposalName, proposalId} = this.pageForm2
if (id === 0 && this.dbUserSelection.length === 0) {
this.$message.warning('请先选择附议人后再点击邀请按钮')
return
}
if (id != 0) this.dbUserSelection = [].concat(id)
let aa = "请确认所选代表是否作为本提案的附议人?"
if (this.dBTableData[0].secondedNum >= this.config.seconderNum) aa = "您已邀请了" + this.dBTableData[0].secondedNum + " 名附议人,是否继续邀请?"
const confirm = await this.$confirm(aa + '确定后会有信息通知!', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
if (confirm === "confirm") {
const resp = await $.post("/platform/proposal/transact/compose/addSeconded", {
proposalId: proposalId,
proposalName: proposalName,
users: JSON.stringify(this.dbUserSelection),
})
if (resp.code === 0) {
this.notifySuccess(resp.msg)
this.$refs.multipleTable.clearSelection();
this.queryDb()
} else {
this.notifyWarning(resp.msg)
}
}
/* if (this.secondedFormData.users.length === 0) {
this.$message.warning('请先选择附议人后再点击邀请按钮')
return
}
this.$confirm('确认邀请吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(async () => {
this.subDisabled = true
const {proposalId, users, proposalName} = this.secondedFormData
const resp = await $.post(loc() + "/addSeconded", {
proposalId: proposalId,
proposalName: proposalName,
users: JSON.stringify(users)
})
requestLaterFun(resp, () => {
this.$notify.success({title: '成功', message: '邀请附议人成功'});
this.userOptions = []
this.secondedFormData.users = []
this.secondedData()
}, () => {
this.$notify.error({title: '失败', message: resp.msg});
}, () => {
this.subDisabled = false
})
}).catch(() => {
});*/
},
async getDictByCode() {
const {data} = await $.get("/platform/proposal/basics/config/getDictByCode", {code: "proposal_manner"})
return data
},
async initData() {
this.config = await proposal.getProposalConfig()
const {startWriteTime, endWriteTime} = this.config
if (moment().isBefore(moment(startWriteTime))) {
this.$alert('提案征集开始时间为' + startWriteTime, '提示', {
confirmButtonText: '确定'
}).then(() => {
headerNavBarVueApp.goHome()
}).catch(() => {
headerNavBarVueApp.goHome()
})
}
if (moment().isAfter(moment(endWriteTime))) {
this.$alert('提案征集已经结束', '提示', {
confirmButtonText: '确定',
}).then(() => {
headerNavBarVueApp.goHome()
}).catch(() => {
headerNavBarVueApp.goHome()
})
}
this.meetingOptions = await proposal.getOpenMeeting()
this.typeOptions = await proposal.getProposalType()
this.unitOptions = await proposal.getProposalUndertake()
this.allMannerList = await this.getDictByCode("proposal_manner");
this.pageForm.teacherMeetingId = this.meetingOptions ? this.meetingOptions[0].id : null
this.jdhList = await proposal.getAllMeeting()
if (this.jdhList.length > 0) {
this.pageForm2.jdhid = this.jdhList[0].id
this.delegations = await getDbt(this.jdhList[0].id)
}
this.unionList = await getUnions();
this.allUnitList = await getUnits();
this.unitList = clone(this.allUnitList);
if (this.meetingOptions.length === 0) {
this.notifyWarning('当前没有开启的教代会,无法撰写提案!')
return
}
this.delegationOptions = await proposal.getDelegation(this.pageForm.teacherMeetingId)
this.committeeOptions = await proposal.getCommittee(this.pageForm.teacherMeetingId)
const {teacherMeetingId} = this.pageForm
const data = await proposal.getDelegationId(teacherMeetingId)
const jgcy = await $.post(loc() + "/getJdhJgcy", {jdhid: teacherMeetingId})
const cbdwFzr = await $.post(loc() + "/getCbdwFzr")
if (jgcy.data > 0) {
const jgName = await $.post(loc() + "/getJgNameByuser")
this.committeeOptions = jgName.data
}
if (this.allMannerList.length > 0) {
this.config.manner.forEach(v => {
if ("${@shiro.hasRole('sysadmin')||@shiro.hasRole('jdhdb01')}" === 'true' && v === "W01") {
this.mannerList.push(this.allMannerList.find(z => z.code == v))
}
if ("${@shiro.hasRole('sysadmin')||(@shiro.hasRole('jdhdb01')&&@shiro.hasRole('jdhdbt01'))}" === 'true' && v === "W02") {
this.mannerList.push(this.allMannerList.find(z => z.code == v))
}
if ("${@shiro.hasRole('sysadmin')||@shiro.hasRole('jdhdb01')}" === 'true' && v === "W03" && jgcy.data > 0) {
this.mannerList.push(this.allMannerList.find(z => z.code == v))
}
if ("${@shiro.hasRole('sysadmin')||@shiro.hasRole('jdhdb01')}" === 'true' && v === "W04" && cbdwFzr.data > 0) {
this.mannerList.push(this.allMannerList.find(z => z.code == v))
}
})
}
this.formData = {
username: '${@shiro.getPrincipalProperty("username")}',
createTime: moment().format('YYYY-MM-DD'),
teacherMeetingId: teacherMeetingId,
delegationId: data ? data.dbtid : '',
id: '',
sign: '',
mannerCode: 'W01'
}
this.$nextTick(() => {
$("#briefEditor").html("")
$("#measuresEditor").html("")
briefEditor = new E("#briefEditor")
briefEditor.config.onchange = (html) => {
this.formData.brief = html
}
measuresEditor = new E("#measuresEditor")
measuresEditor.config.onchange = (html) => {
this.formData.measures = html
}
briefEditor.create()
measuresEditor.create()
})
if (this.$refs["addForm"])
this.$refs["addForm"].resetFields();
const id = GetQueryString("proposalId")
if (id) {
await this.editProposal()
} else {
if (this.config.writeRemind && moment(startWriteTime).isBefore(moment()) && moment().isBefore(moment(endWriteTime))) {
this.writeRemindDialog = true
}
}
// await this.editProposal()
},
async editProposal() {
const id = GetQueryString("proposalId")
if (id) {
const resp = await $.get("/platform/proposal/transact/compose/findOne", {id})
if (resp.data.files) {
// resp.data.files = JSON.parse(resp.data.files)
}
this.formData = resp.data
this.$nextTick(() => {
briefEditor.txt.html(resp.data.brief)
measuresEditor.txt.html(resp.data.measures)
})
}
},
async meetingChange(val) {
this.formData.delegationId = null
this.formData.committeeId = null
this.delegationOptions = await proposal.getDelegation(val)
this.committeeOptions = await proposal.getCommittee(val)
},
},
created() {
this.initData()
}
})
</script>
<!--#
}
#-->