Files
2026-09-08 19:49:21 +08:00

281 lines
12 KiB
HTML

<!--#
layout("/layouts/platform.html"){
#-->
<style>
.el-row--flex .el-form-item {
flex: 1;
}
.w-e-toolbar, .w-e-text-container {
z-index: 1 !important;
}
.w-e-text-container {
height: 200px !important;
}
</style>
<div id="app" v-cloak>
<guava ref="guava">
<template>
<el-card shadow="never">
<div class="btn-group tool-button">
<el-input v-model="pageForm.suggestionName" clearable placeholder="请输入名称"></el-input>
</div>
<div class="btn-group tool-button">
<el-input placeholder="请输入内容" clearable v-model="pageForm.searchKeyword"
@keyup.enter.native="doSearch">
<el-select v-model="pageForm.searchName" slot="prepend" placeholder="查询类型"
style="width: 120px;">
<el-option label="姓名" value="au.username"></el-option>
<el-option label="工号" value="au.loginname"></el-option>
</el-select>
</el-input>
</div>
<div class="btn-group tool-button">
<el-button icon="el-icon-search" type="primary" @click="doSearch"></el-button>
</div>
<div class="offscreen-right pull-right">
<el-radio-group v-model="pageForm.isAdopt" @change="doSearch">
<el-radio-button :label="true">已审核</el-radio-button>
<el-radio-button :label="false">未审核</el-radio-button>
</el-radio-group>
</div>
</el-card>
<el-card shadow="never" class="mt20">
<el-table :data="tableData" @sort-change="pageOrder">
<el-table-column type="index" width="50" label="序号"></el-table-column>
<el-table-column v-for="i in tableColumns" :prop="i.prop" :label="i.label" show-overflow-tooltip>
<template scope="{row}" v-if="i.prop=='state'">
<span :style="{color:x.color}" v-for="x in suggestionApi.suggestionState" :key="x.state"
v-if="x.state===row.state">
{{x.name}}
</span>
</template>
<template scope="{row}" v-else-if="i.prop=='handleDescript'">
<template v-if="row.depResult==='自行处理'">
<span v-if="row.handleDescript" class="text-primary">
已填写
</span>
<span v-else class="text-danger">
未填写
</span>
</template>
<template v-else>
<span class="text-muted">
无需填写
</span>
</template>
</template>
<template scope="{row}" v-else-if="i.prop=='adopt'">
<el-tag v-if="row.proposalId" type="success">提案采纳</el-tag>
<el-tag v-else type="warning">暂无</el-tag>
</template>
</el-table-column>
<el-table-column label="操作" width="200">
<template slot-scope="{row}">
<el-button v-if="row.state>3" size="mini" type="primary" @click="openView(row,'view')">查看
</el-button>
<el-button v-if="row.depResult==='自行处理' && !row.handleDescript " size="mini" type="primary"
@click="openView(row,'editAgain')">回填处理情况
</el-button>
<el-button v-if="row.state===3" size="mini" type="primary" @click="openView(row,'edit')">
处理
</el-button>
</template>
</el-table-column>
</el-table>
<!--#include("/layouts/pagination.html"){}#-->
</el-card>
</template>
<template #view>
<suggestion-info ref="info"></suggestion-info>
<template v-if="handleType==='edit'">
<el-form :model="formData" ref="Form" :rules="formRules">
<!-- <el-form-item prop="depResult">
<template #label>
<span class="text-primary bolder">处理方式</span>
</template>
<el-radio-group v-model="formData.depResult">
<el-radio-button label="采纳建议"></el-radio-button>
<el-radio-button label="自行处理"></el-radio-button>
</el-radio-group>
</el-form-item>-->
<el-form-item prop="handleDescript" label="处理情况" v-show="formData.depResult==='自行处理'">
<template #label>
<span class="text-primary bolder">处理情况</span>
</template>
</el-form-item>
<div id="handleDescriptEditor" v-show="formData.depResult==='自行处理'"></div>
<el-form-item prop="levelJdhUser" v-show="formData.depResult==='采纳建议'">
<template #label>
<span class="text-primary bolder">请选择代表</span>
</template>
<el-select
v-model="formData.levelJdhUser"
clearable
filterable
remote
reserve-keyword
placeholder="请选择本部门教代会代表"
:remote-method="searchUser">
<el-option
v-for="item in userList"
:key="item.id"
:label="item.username+'-'+item.loginname"
:value="item.id">
</el-option>
</el-select>
</el-form-item>
</el-form>
<el-row type="flex" justify="center">
<el-button type="primary" @click="doSubmit">提交</el-button>
</el-row>
</template>
<template v-if="handleType==='editAgain'">
<el-form :model="formData" ref="Form" label-position="top" :rules="formRules">
<el-form-item prop="handleDescript">
<template #label>
<span class="text-primary bolder">处理情况</span>
</template>
<div id="handleDescriptEditor"></div>
</el-form-item>
</el-form>
<el-row type="flex" justify="center">
<el-button type="primary" @click="doSubmit">提交</el-button>
</el-row>
</template>
</template>
</guava>
</div>
<script>
const E = window.wangEditor
let handleDescriptEditor = null
var vue = new Vue({
el: '#app',
mixins: [initTableMixins],
components: {
'suggestion-info': httpVueLoader('/components/suggestion/SuggestionInfo.vue')
},
data() {
return {
formRules: {
levelJdhUser: [{required: true, message: '请搜索并选择一位教代会代表', trigger: ['blur', 'change']}],
},
typeOptions: [],
tableColumns:
suggestionApi.tableColums.concat([
// {prop: 'depResult', label: '处理方式'},
// {prop: 'handleDescript', label: '处理情况'}
]),
// [
// {prop: 'suggestionName', label: '名称'},
// {prop: 'createUserName', label: '撰写人'},
// {prop: 'applyTime', label: '撰写时间'},
// {prop: 'typeName', label: '类型'},
// {prop: 'createUserUnionName', label: '工会'},
// {prop: 'state', label: '状态'},
//
// ],
handleType: null,
formData: {
depResult: '采纳建议'
},
userList: [],
pageForm: {
isAdopt: false,
searchName: "au.username"
}
}
},
methods: {
openView(row, val) {
this.formData.id = row.id
this.handleType = val
if (val === "edit") {
this.$set(this.formData, "depResult", "自行处理")
}
this.$refs.guava.view()
this.$refs.info.getData(row.id)
this.$nextTick(() => {
$("#handleDescriptEditor").html("")
handleDescriptEditor = new E("#handleDescriptEditor")
handleDescriptEditor.config.onchange = (html) => {
this.formData.handleDescript = html
}
handleDescriptEditor.create()
})
},
async searchUser(key) {
if (key) {
const resp_data = await $.post('/platform/suggestions/depExamine/searchUser', {key})
if (resp_data.code === 0) {
this.userList = resp_data.data.list
}
}
},
doSubmit() {
const validAy = (rule, value, callback) => {
if (!this.formData.handleDescript || !dd3s.html2txt(this.formData.handleDescript)) {
callback(new Error('请填写自行处理情况'));
} else {
callback();
}
}
if (this.handleType === 'edit' && this.formData.depResult === '采纳建议') {
this.formRules = {
levelJdhUser: [{required: true, message: '请搜索并选择一位教代会代表', trigger: ['blur', 'change']}]
}
} else {
this.formRules = {}
}
if (this.handleType === 'editAgain') {
this.formData.depResult = undefined
this.formRules = {
handleDescript: [{validator: validAy, trigger: ['blur', 'change']}],
}
}
this.$refs["Form"].validate(async (valid) => {
console.log(valid)
if (valid) {
const resp_data = await $.post('/platform/suggestions/depExamine/doSubmit', this.formData)
if (resp_data.code === 0) {
this.$refs.guava.index()
this.notifySuccess(resp_data.msg)
this.doSearch()
}
}
})
}
},
async created() {
this.pageData()
this.typeOptions = await getProposalType()
}
})
</script>
<!--#
}
#-->