first commit

This commit is contained in:
2026-09-20 15:46:34 +08:00
parent 72fb5eae10
commit e558339dcc
3340 changed files with 671310 additions and 251 deletions
@@ -0,0 +1,833 @@
<!--#
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" v-if="false">
<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">
<text-editor v-model="formData.brief"></text-editor>
<!-- <div id="briefEditor"></div>-->
</el-form-item>
<el-form-item class="is-required" label="可行性分析" prop="measures">
<!-- <div id="measuresEditor"></div>-->
<text-editor v-model="formData.measures"></text-editor>
</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-input>
</div>
<div class="btn-group tool-button">
<el-select v-model="pageForm2.jdhid" filterable clearable placeholder="请选择届次"
@change="jdhChange">
<el-option
v-for="item in jdhList"
:key="item.id"
:label="item.jdhallname"
:value="item.id">
</el-option>
</el-select>
</div>
<div class="btn-group tool-button">
<el-select v-model="pageForm2.dbtid" filterable clearable placeholder="请选择代表团"
@change="delegationChange">
<el-option
v-for="item in delegations"
:key="item.id"
:label="item.dbtname"
:value="item.id">
</el-option>
</el-select>
</div>
<div class="btn-group tool-button">
<el-select v-model="pageForm2.unionid" filterable clearable placeholder="请选择工会"
@change="unitList = allUnitList.filter(v => pageForm2.unionid?v.unionid === pageForm2.unionid:true)">
<el-option
v-for="item in unionList"
:key="item.id"
:label="item.unionname"
:value="item.id">
</el-option>
</el-select>
</div>
<div class="btn-group tool-button">
<el-select v-model="pageForm2.unitid" filterable clearable placeholder="请选择单位">
<el-option
v-for="item in unitList"
:key="item.id"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
</div>
<div class="btn-group tool-button ">
<el-radio-group v-model="pageForm2.isAudit" @change="queryDb">
<el-radio-button :label="true">已邀请 <span style="color: red">({{secondedNum}})</span>
</el-radio-button>
<el-radio-button :label="false">待邀请</el-radio-button>
</el-radio-group>
</div>
<div class="btn-group tool-button">
<el-button type="primary" icon="el-icon-search" @click="queryDb"></el-button>
</div>
</el-card>
<el-card shadow="never" class="mt10">
<table-tool label="邀请附议人" :app="this">
<template #label_end>
<el-button type="primary" plain class="ml20" @click="addSeconded(0)"
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" style="width: 100%" row-key="id"
v-loading="dBTableDataLoading" :size="tableSize" class="vi-table"
ref="multipleTable"
@selection-change="handleSelectionChange">
<el-table-column
type="selection"
width="55">
</el-table-column>
<el-table-column label="序号" type="index" header-align="center" align="center">
<template scope="scope">
<span>{{ scope.$index + (pageForm2.pageNumber - 1) * pageForm2.pageSize + 1 }} </span>
</template>
</el-table-column>
<el-table-column
show-overflow-tooltip
align="center"
header-align="center"
v-for="column in dBTableColumns"
:label="column.label"
:prop="column.prop"
:sortable="column.sortable"
>
<template v-if="column.prop=='isAgree'" scope="{row:{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 header-align="center" align="center" label="操作" width="100"
v-if="!pageForm2.isAudit">
<template slot-scope="{row}">
<el-button size="mini" @click="addSeconded(row.id)">邀请</el-button>
</template>
</el-table-column>
</el-table>
<el-row class="el-pagination-container" style="margin-bottom: 0px">
<el-pagination
@size-change="pageSizeChange2"
@current-change="pageNumberChange2"
:current-page="pageForm2.pageNumber"
:page-sizes="[5,10, 20, 30, 50]"
:page-size="pageForm2.pageSize"
layout="total, sizes, prev, pager, next"
:total="pageForm2.totalCount">
</el-pagination>
</el-row>
</el-card>
</template>
</guava>
<el-dialog :close-on-click-modal="false" :visible.sync="writeRemindDialog" title="撰写须知"
top="50px" width="60%">
<!-- <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
const 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 + '字'));
//callback();
} 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: ''
},
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)
})
requestLaterFun(resp, () => {
this.$notify.success({title: '成功', message: resp.msg})
sublime.jumpPagePjax('/platform/proposal/transact/compose')
}, () => {
this.$notify.warning({title: '警告', message: 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 && 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
})
if (resp.code===0){
await this.editProposal()
this.pageForm2.proposalId = this.formData.id ? this.formData.id : resp.data
if (resp.data) {
this.formData.id = resp.data
}
this.pageForm2.proposalName = this.formData.proposalName
await this.queryDb()
await this.getProposalSecondedNum()
this.$refs.guava.public()
}else{
this.$message.warning(resp.msg)
}
// sublime.jumpPagePjax('/platform/proposal/transact/compose?operation=invite&id=' + resp.data)
}
// if (this.formData.id == "") {
// this.$notify.warning({title: '警告', message: "请先保存后在邀请附议人"});
// return
// }
/* 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),
})
requestLaterFun(resp, () => {
this.$notify.success({title: '成功', message: '邀请附议人成功'});
this.$refs.multipleTable.clearSelection();
this.queryDb()
this.getProposalSecondedNum()
}, () => {
this.$notify.error({title: '失败', message: 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 getProposalSecondedNum() {
const resp = await $.get('/platform/proposal/transact/compose/getProposalSecondedNum', {proposalId: this.pageForm2.proposalId})
this.secondedNum = resp.data
},
async getDictByCode() {
const {data} = await $.get("/platform/proposal/basics/config/getDictByCode", {code: "proposal_manner"})
return data
},
async initData() {
this.config = await proposal.getProposalConfig()
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 getAllJdh()
if (this.jdhList.length > 0) {
this.pageForm2.jdhid = this.jdhList[0].id
this.delegations = await getDbt(this.jdhList[0].id)
}
this.unionList = await getUnion();
this.allUnitList = await getUnit();
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) {
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>
<!--#
}
#-->