794 lines
36 KiB
HTML
794 lines
36 KiB
HTML
<!--#
|
||
layout("/layouts/platform.html"){
|
||
#-->
|
||
<style>
|
||
.item-button .el-button {
|
||
padding: 12px 30px;
|
||
}
|
||
|
||
.el-select {
|
||
width: 100%;
|
||
}
|
||
</style>
|
||
|
||
<div id="app" v-cloak>
|
||
<guava ref="guava">
|
||
<template>
|
||
<proposal-search :page="pageForm" :has_add="false" :audit="false" @search="doSearch"
|
||
@add="openAdd" @import="openImport"></proposal-search>
|
||
|
||
<el-card shadow="never" class="mt20">
|
||
<table-tool :app="this" label="我的提案">
|
||
<template #func>
|
||
|
||
</template>
|
||
</table-tool>
|
||
<el-table :data="tableData" :loading="tableLoading" :size="tableSize" highlight-current-row
|
||
style="width: 100%;">
|
||
<el-table-column
|
||
type="index"
|
||
width="50" label="序号">
|
||
</el-table-column>
|
||
<el-table-column
|
||
align="center"
|
||
header-align="center"
|
||
v-for="column in tableColumns"
|
||
:label="column.label"
|
||
:prop="column.prop" :sortable="column.sortable"
|
||
:sortable="column.sortable" show-overflow-tooltip>
|
||
|
||
<template scope="{row}" v-if="column.prop=='proposalName'">
|
||
<el-link type="primary" @click="openView(row)">{{ row.proposalName }}</el-link>
|
||
</template>
|
||
|
||
<template scope="{row}" v-else-if="column.prop=='stateId'">
|
||
<vi-table-state :state="row"></vi-table-state>
|
||
</template>
|
||
|
||
</el-table-column>
|
||
<el-table-column align="center" header-align="center" label="操作" fixed="right" width="400px">
|
||
<template scope="{row}">
|
||
<el-button size="mini" type="primary" @click="openSeconded(row.id,row.proposalName)"
|
||
v-if="[proposal.UNSUBMIT,proposal.INVIRTE,proposal.DELEGATION_BACK,].includes(row.stateCode)&&row.mannerCode=='W01'">
|
||
邀请附议人
|
||
</el-button>
|
||
<el-button size="mini" type="primary" @click="doSubmit(row)"
|
||
v-if="showSubmitBtn(row)">
|
||
提交
|
||
</el-button>
|
||
<el-button size="mini" type="primary" @click="openView(row)">
|
||
查看
|
||
</el-button>
|
||
<el-button size="mini" type="primary" @click="openEdit(row.id)"
|
||
v-if="[proposal.UNSUBMIT].includes(row.stateCode)">
|
||
编辑
|
||
</el-button>
|
||
<el-button size="mini" type="primary" @click="doDelete(row)"
|
||
v-if="[proposal.UNSUBMIT].includes(row.stateCode)&&row.stateCode!==proposal.FINISH">
|
||
删除
|
||
</el-button>
|
||
</template>
|
||
</el-table-column>
|
||
|
||
</el-table>
|
||
<!--#include("/layouts/pagination.html"){}#-->
|
||
</el-card>
|
||
|
||
</template>
|
||
|
||
<template #view>
|
||
<proposal-info ref="info"></proposal-info>
|
||
</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
|
||
title="提案导入"
|
||
:visible.sync="importVisible"
|
||
:close-on-click-modal="false"
|
||
width="50%"
|
||
>
|
||
<el-timeline>
|
||
<el-timeline-item timestamp="下载模板" placement="top">
|
||
<el-card>
|
||
<el-button size="medium" type="" style="width: 200px"
|
||
@click="location.href='/platform/basics/downloadTemplate?filePath=Proposal/proposal.xlsx&fileName=教职工代表大会提案表.xlsx'"
|
||
icon="el-icon-download">下载模板
|
||
</el-button>
|
||
</el-card>
|
||
</el-timeline-item>
|
||
<el-timeline-item timestamp="上传文件" placement="top">
|
||
<el-card>
|
||
<el-upload
|
||
name="file"
|
||
ref="upload"
|
||
:on-remove="(file, fileList) => {
|
||
importData.fileList = fileHandleRemove(file, fileList)
|
||
}"
|
||
:on-change="(file, fileList) => {
|
||
importData.fileList = fileHandleChange(file, fileList,{type:['xlsx']})
|
||
}"
|
||
:auto-upload="false"
|
||
:limit="1"
|
||
:file-list="importData.fileList">
|
||
<el-button size="medium" type="" icon="el-icon-upload" style="width: 200px">选择文件
|
||
</el-button>
|
||
</el-upload>
|
||
</el-card>
|
||
</el-timeline-item>
|
||
</el-timeline>
|
||
|
||
<span slot="footer" class="dialog-footer">
|
||
<el-button @click="importVisible = false" :disabled="importLoading">取 消</el-button>
|
||
<el-button type="primary" @click="doImport" :loading="importLoading">确定</el-button>
|
||
</span>
|
||
</el-dialog>
|
||
|
||
<el-dialog
|
||
:visible.sync="composeDialogVisible"
|
||
title="温馨提醒"
|
||
width="30%" :close-on-click-modal="false"
|
||
|
||
>
|
||
<div v-html="tipsContent"></div>
|
||
<span class="dialog-footer" slot="footer">
|
||
<el-button @click="composeDialogVisible = false" type="primary">确 定</el-button>
|
||
</span>
|
||
</el-dialog>
|
||
|
||
|
||
</div>
|
||
|
||
<script>
|
||
<!--#include("/platform/proposal/include/proposal_include.js"){}#-->
|
||
|
||
let E = window.wangEditor
|
||
let briefEditor, measuresEditor = null
|
||
|
||
var vue = new Vue({
|
||
el: '#app',
|
||
mixins: [initTableMixins],
|
||
data() {
|
||
let validBrief = (rule, value, callback) => {
|
||
if (!this.formData.brief || !dd3s.html2txt(this.formData.brief)) {
|
||
callback(new Error('请填写提案内容、案由和案据'));
|
||
} else {
|
||
callback();
|
||
}
|
||
};
|
||
let validMeasures = (rule, value, callback) => {
|
||
if (!this.formData.measures || !dd3s.html2txt(this.formData.measures)) {
|
||
callback(new Error('请填写提案实施的可行性建议'));
|
||
} else {
|
||
callback();
|
||
}
|
||
};
|
||
return {
|
||
composeDialogVisible: false,
|
||
importLoading: false,
|
||
importVisible: false,
|
||
importData: {},
|
||
secondedNum: 0,
|
||
jdhList: [],
|
||
delegations: [],
|
||
unitList: [],
|
||
allUnitList: [],
|
||
unionList: [],
|
||
dBTableData: [],
|
||
dbUserSelection: [],
|
||
dBTableDataLoading: false,
|
||
secondedTableData: [],
|
||
secondedDialog: false,
|
||
secondedFormData: {users: []},
|
||
delegationOptions: [],
|
||
committeeOptions: [],
|
||
unitOptions: [],
|
||
typeOptions: [],
|
||
mannerOptions: [],
|
||
meetingOptions: [],
|
||
pageForm2: {
|
||
searchName: 'u.username',
|
||
searchKeyword: "",
|
||
pageNumber: 1,
|
||
pageSize: 10,
|
||
totalCount: 0,
|
||
pageOrderName: "",
|
||
pageOrderBy: "",
|
||
isAudit: false,
|
||
jdhid: '',
|
||
dbtid: '',
|
||
unionid: '',
|
||
unitid: ''
|
||
},
|
||
|
||
pageForm: {searchName: 'proposalName'},
|
||
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: true, message: '请选择建以落实部门', trigger: ['blur', 'change']}],
|
||
brief: [{validator: validBrief, trigger: ['blur', 'change']}],
|
||
measures: [{validator: validMeasures, trigger: ['blur', 'change']}],
|
||
},
|
||
subDisabled: false,
|
||
userOptions: [],
|
||
userLoading: false,
|
||
config: {},
|
||
tableColumns: [
|
||
{prop: 'proposalCode', label: '提案编号', sortable: true, disabled: true},
|
||
{prop: 'proposalName', label: '提案名称', disabled: true},
|
||
{prop: 'createTime', label: '提案时间', sortable: true},
|
||
{prop: 'typeName', label: '提案类型', sortable: true},
|
||
{prop: 'typeCode', label: '提案类型编码', sortable: true, checked: 0},
|
||
{prop: 'mannerName', label: '提案方式', sortable: true},
|
||
{prop: 'mannerCode', label: '提案方式编码', sortable: true, checked: 0},
|
||
{prop: 'meetingName', label: '届次'},
|
||
{prop: 'stateId', label: '提案状态', sortable: true},
|
||
],
|
||
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},
|
||
],
|
||
proposalConfig: {},
|
||
tipsContent: ''
|
||
}
|
||
},
|
||
components: {
|
||
'file-upload': httpVueLoader('/components/plugins/FileUpload.vue'),
|
||
'proposal-info': httpVueLoader('/components/proposal/ProposalInfo.vue'),
|
||
'proposal-search': httpVueLoader('/components/proposal/ProposalSearch.vue'),
|
||
'proposal-table': httpVueLoader('/components/proposal/ProposalTable.vue'),
|
||
},
|
||
methods: {
|
||
showSubmitBtn(row) {
|
||
const {alreadySecondedCount, stateCode} = row
|
||
if (row.mannerCode === 'W01') {
|
||
if (stateCode !== proposal.INVIRTE) {
|
||
return false
|
||
}
|
||
const {submitMode, seconderNum} = this.proposalConfig
|
||
if (submitMode === 'AMT' || submitMode === "manual") {
|
||
return alreadySecondedCount === seconderNum
|
||
} else {
|
||
return false
|
||
}
|
||
} else {
|
||
return stateCode === proposal.UNSUBMIT
|
||
}
|
||
|
||
// [proposal.UNSUBMIT].includes(row.stateCode) && row.mannerCode != 'W01' || (!config.isAutoSubmit && row.mannerCode == 'W01')
|
||
},
|
||
openImport() {
|
||
this.importData = {
|
||
fileList: []
|
||
}
|
||
this.importVisible = true;
|
||
},
|
||
doImport() {
|
||
if (!this.importData.fileList.length) {
|
||
this.notifyWarning("请选择文件!")
|
||
return
|
||
}
|
||
const data = new FormData();
|
||
this.importData.fileList.forEach((val) => {
|
||
data.append("file", val.raw, val.raw.name);
|
||
});
|
||
this.importLoading = true
|
||
$.ajax({
|
||
url: loc() + "/importProposal",
|
||
type: "post",
|
||
data: data,
|
||
processData: false,
|
||
contentType: false,
|
||
success: (data) => {
|
||
if (!data.code) {
|
||
this.notifySuccess(data.msg);
|
||
this.pageData();
|
||
this.importVisible = false
|
||
} else {
|
||
this.notifyWarning(data.msg)
|
||
}
|
||
this.importLoading = false
|
||
},
|
||
error: (data) => {
|
||
this.notifyWarning("导入失败")
|
||
this.importLoading = false
|
||
}
|
||
});
|
||
},
|
||
delSeconded(row) {
|
||
const {proposalId, seconderId} = row
|
||
this.$confirm('确定要删除该附议人吗?', '提示', {type: 'warning'}).then(async () => {
|
||
this.$set(row, "loading", true)
|
||
const resp = await $.post(loc() + "/deleteSeconder", {proposalId, seconderId});
|
||
this.$set(row, "loading", false)
|
||
if (resp.code === 0) {
|
||
await this.secondedData()
|
||
} else {
|
||
this.notifyWarning(resp.msg)
|
||
}
|
||
}).catch(() => {
|
||
this.$set(row, "loading", false)
|
||
});
|
||
},
|
||
dropdownCommand(command) {
|
||
const {type, data} = command
|
||
if (type === 'view') {
|
||
this.openView(data)
|
||
} else if (type === 'edit') {
|
||
this.openEdit(data.id)
|
||
} else if (type === 'delete') {
|
||
this.doDelete(data)
|
||
} else if (type === 'seconded') {
|
||
this.openSeconded(data)
|
||
} else if (type === 'submit') {
|
||
this.doSubmit(data)
|
||
}
|
||
},
|
||
async meetingChange(val) {
|
||
this.formData.delegationId = null
|
||
this.formData.committeeId = null
|
||
this.delegationOptions = await proposal.getDelegation(val)
|
||
// this.committeeOptions = await proposal.getCommittee(val)
|
||
},
|
||
async secondedData() {
|
||
const {data} = await $.get(loc() + "/getSecondedData", {proposalId: this.secondedFormData.proposalId})
|
||
this.secondedTableData = 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.secondedNum >= this.config.seconderNum) aa = "您已邀请了" + this.secondedNum + " 名附议人,是否继续邀请?"
|
||
const confirm = await this.$confirm(aa + '确定后会有信息通知!', '提示', {
|
||
confirmButtonText: '确定',
|
||
cancelButtonText: '取消',
|
||
type: 'warning'
|
||
})
|
||
|
||
if (confirm === "confirm") {
|
||
const resp = await $.post(loc() + "/addSeconded", {
|
||
proposalId: proposalId,
|
||
proposalName: proposalName,
|
||
users: JSON.stringify(this.dbUserSelection),
|
||
})
|
||
if (resp.code === 0) {
|
||
this.notifySuccess(resp.msg)
|
||
this.$refs.multipleTable.clearSelection();
|
||
this.pageForm2.searchKeyword = ''
|
||
this.doSearch()
|
||
this.queryDb()
|
||
this.getProposalSecondedNum()
|
||
} 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 queryUser(proposalId, query) {
|
||
const {data} = await $.get(loc() + "/queryDelegate", {proposalId, query})
|
||
return 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
|
||
}
|
||
},
|
||
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(loc() + "/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 getProposalSecondedNum() {
|
||
const resp = await $.get(loc() + '/getProposalSecondedNum', {proposalId: this.pageForm2.proposalId})
|
||
this.secondedNum = resp.data
|
||
},
|
||
async openSeconded(id, proposalName) {
|
||
this.pageForm2.proposalId = id
|
||
this.pageForm2.proposalName = proposalName
|
||
await this.queryDb()
|
||
await this.getProposalSecondedNum()
|
||
this.$refs.guava.public()
|
||
this.composeDialogVisible = true
|
||
/* this.secondedFormData = {
|
||
proposalId: id,
|
||
proposalName: proposalName,
|
||
users: [],
|
||
}
|
||
this.secondedData()
|
||
this.userOptions = []
|
||
this.userLoading = false
|
||
this.secondedDialog = true*/
|
||
},
|
||
handleSelectionChange(val) {
|
||
this.dbUserSelection = val.map(v => v.id);
|
||
},
|
||
doDelete(row) {
|
||
this.$confirm('此操作将删除【' + row.proposalName + '】提案的所有信息!', '提示', {
|
||
confirmButtonText: '确定',
|
||
cancelButtonText: '取消',
|
||
type: 'warning',
|
||
callback: async (a) => {
|
||
if ("confirm" === a) {
|
||
const resp = await $.post(loc() + "/doDelete", {id: row.id})
|
||
if (resp.code === 0) {
|
||
this.notifySuccess(resp.msg)
|
||
this.pageData()
|
||
} else {
|
||
this.notifyWarning(resp.msg)
|
||
}
|
||
}
|
||
}
|
||
});
|
||
},
|
||
async doSubmit(row) {
|
||
this.$confirm('确定要提交此提案吗?', '提示', {
|
||
confirmButtonText: '确定',
|
||
cancelButtonText: '取消',
|
||
type: 'info',
|
||
callback: async (a) => {
|
||
if ("confirm" === a) {
|
||
const resp = await $.post(loc() + "/doSubmit", {id: row.id, mannerCode: row.mannerCode})
|
||
if (resp.code === 0) {
|
||
this.notifySuccess(resp.msg)
|
||
this.pageData()
|
||
} else {
|
||
this.notifyWarning(resp.msg)
|
||
}
|
||
}
|
||
}
|
||
})
|
||
},
|
||
async operation() {
|
||
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)
|
||
}
|
||
|
||
const resp = await $.post(loc() + method, {data: JSON.stringify(data), sign: data.sign})
|
||
loading.close()
|
||
if (resp.code === 0) {
|
||
this.notifySuccess(resp.msg)
|
||
this.pageData()
|
||
this.$refs.guava.index()
|
||
} else {
|
||
this.notifyWarning(resp.msg)
|
||
}
|
||
}
|
||
});
|
||
},
|
||
openView(row) {
|
||
this.$refs.guava.view()
|
||
this.$refs.info.openView(row.id)
|
||
},
|
||
async openEdit(id) {
|
||
sublime.jumpPagePjax("/platform/proposal/transact/writeproposal?proposalId=" + id)
|
||
|
||
/* const resp = await $.get(loc() + "/findOne", {id})
|
||
|
||
requestLaterFun(resp, () => {
|
||
if (resp.data.files) {
|
||
resp.data.files = JSON.parse(resp.data.files)
|
||
}
|
||
|
||
this.formData = resp.data
|
||
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()
|
||
briefEditor.txt.html(resp.data.brief)
|
||
measuresEditor.txt.html(resp.data.measures)
|
||
})
|
||
this.$refs.guava.edit()
|
||
}, () => {
|
||
this.$notify.error({title: '失败', message: resp.msg});
|
||
})*/
|
||
},
|
||
|
||
async openAdd() {
|
||
sublime.jumpPagePjax('/platform/proposal/transact/writeproposal')
|
||
},
|
||
async initData() {
|
||
this.config = await proposal.getProposalConfig()
|
||
this.meetingOptions = await proposal.getOpenMeeting()
|
||
this.typeOptions = await proposal.getProposalType()
|
||
this.unitOptions = await proposal.getProposalUndertake()
|
||
this.mannerOptions = await getDictByCode("proposal_manner")
|
||
this.pageForm.teacherMeetingId = this.meetingOptions ? this.meetingOptions[0].id : null
|
||
this.delegationOptions = await proposal.getDelegation(this.pageForm.teacherMeetingId)
|
||
// this.committeeOptions = await proposal.getCommittee(this.pageForm.teacherMeetingId)
|
||
|
||
const jgName = await $.post("/platform/proposal/transact/writeproposal/getJgNameByuser")
|
||
this.committeeOptions = jgName.data
|
||
//this.jdhList = await proposal.getAllMeeting()
|
||
this.jdhList = await getOpenMeeting()
|
||
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);
|
||
},
|
||
checkOperation() {
|
||
const operation = GetQueryString("operation")
|
||
const id = GetQueryString("id")
|
||
if (operation && operation === 'invite' && id) {
|
||
this.openSeconded(id, null)
|
||
}
|
||
},
|
||
initTipsContent() {
|
||
this.tipsContent =
|
||
`<p> (1)请选择<sapn style="color: red">` + this.proposalConfig.seconderNum + `</sapn>位以上(含2位)代表附议。</p>` +
|
||
`<p> (2)如果附议人全部附议后,系统会自动提交该提案。</p>` /*+
|
||
`<p> (3)如果该提案已经有<sapn style="color: red">` + this.proposalConfig.seconderNum + `</sapn>个附议人附议,还未全部完成附议,提案人必须手动才能<p>` +
|
||
`<p> 完成提案提交!一旦邀请附议人成功,系统会发送邀请信息,不可撤销。</p>`*/
|
||
}
|
||
},
|
||
async created() {
|
||
await this.initData()
|
||
this.proposalConfig = await getProposalConfig()
|
||
this.pageData();
|
||
if (getLocationVariable("action") === 'add') {
|
||
this.openAdd()
|
||
}
|
||
this.checkOperation()
|
||
this.initTipsContent()
|
||
}
|
||
})
|
||
</script>
|
||
<!--#
|
||
}
|
||
#-->
|