|
|
@@ -0,0 +1,276 @@
|
|
|
+<template>
|
|
|
+ <div>
|
|
|
+ <el-breadcrumb class="heading">
|
|
|
+ <el-breadcrumb-item :to="{ path: '/' }">平台首页</el-breadcrumb-item>
|
|
|
+ <el-breadcrumb-item :to="{ path: '/documentmanage/notice' }">通知管理</el-breadcrumb-item>
|
|
|
+ </el-breadcrumb>
|
|
|
+ <el-card class="box-card">
|
|
|
+ <div slot="header">
|
|
|
+ <span>
|
|
|
+ <i class="icon icon-table2"> 通知列表</i>
|
|
|
+ </span>
|
|
|
+ <span style="float: right">
|
|
|
+ <el-button size="small" type="primary" @click="toadddoc">添加</el-button>
|
|
|
+ </span>
|
|
|
+ </div>
|
|
|
+ <el-row :gutter="20">
|
|
|
+ <el-col :span="4">
|
|
|
+ <el-tree highlight-current :expand-on-click-node="true" node-key="id" :data="orgtreelist" :props="orgtreeprops" :default-expanded-keys="userdepartment"
|
|
|
+ @node-click="orgtreeNodeClick" ref="orgmanagetree">
|
|
|
+ </el-tree>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="20">
|
|
|
+ <el-collapse>
|
|
|
+ <el-collapse-item title="通知查询">
|
|
|
+ <el-form ref="form" :model="searchForm" label-width="120px">
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item label="通知名称">
|
|
|
+ <el-input v-model="searchForm.Name" placeholder="请输入通知名称"> ></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-row>
|
|
|
+ <el-col class="line" :span="24" style="background-color:lightgrey; line-height: 1px"> </el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-row :gutter="0" style="text-align:right;margin-top:10px;">
|
|
|
+ <el-button @click="initData" size="small" type="primary">查询</el-button>
|
|
|
+ <el-button type="primary" class="el-button--small" @click="clearSearch" style="margin-left:8px">重 置</el-button>
|
|
|
+ </el-row>
|
|
|
+ </el-form>
|
|
|
+ </el-collapse-item>
|
|
|
+ </el-collapse>
|
|
|
+ <el-table :data="list" border style="width: 100%">
|
|
|
+ <el-table-column label="操作" width="120" align="center" header-align="center">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <router-link :to="'/documentmanage/'+scope.row.Id+'/edit'">
|
|
|
+ <el-button size="medium" type="text" icon="el-icon-edit" title="编辑"></el-button>
|
|
|
+ </router-link>
|
|
|
+ <el-button size="medium" style="margin-left:3px;" type="text"
|
|
|
+ icon="el-icon-delete" title="删除" @click="deletedata(scope.row.Id)">
|
|
|
+ </el-button>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="Name" label="文档名称" align="center" header-align="center" show-overflow-tooltip></el-table-column>
|
|
|
+ <el-table-column prop="NoticeTab" label="文档类型" width="120" align="center" header-align="center" show-overflow-tooltip>
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-tag v-if="scope.row.NoticeTab">通知公告</el-tag>
|
|
|
+ <!-- <el-tag v-if="scope.row.DocTab">文件资料</el-tag> -->
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="VersionInfo" label="文档版本" width="100" align="center" header-align="center" show-overflow-tooltip></el-table-column>
|
|
|
+ <el-table-column prop="CreateBy" label="编辑人" align="center" header-align="center" show-overflow-tooltip></el-table-column>
|
|
|
+ <el-table-column prop="CreateOn" label="编辑时间" align="center" header-align="center" show-overflow-tooltip>
|
|
|
+ <template slot-scope="scope">
|
|
|
+ {{ jstimehandle(scope.row.CreateOn+'') }}
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="ValidityTime" label="有效期至" align="center" header-align="center" show-overflow-tooltip>
|
|
|
+ <template slot-scope="scope">
|
|
|
+ {{ jstimehandle(scope.row.ValidityTime+'') }}
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+ <el-pagination style="float:right;margin:10px 0 10px 0;" @size-change="handleSizeChange" @current-change="handleCurrentChange"
|
|
|
+ :current-page="currentPage" :page-size="size" :page-sizes="[10, 15, 20 ]" layout="total, sizes, prev, pager, next, jumper"
|
|
|
+ :total="currentItemCount">
|
|
|
+ </el-pagination>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ </el-card>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+ export default {
|
|
|
+ name: 'noticeDetail',
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ currentItemCount: 0,
|
|
|
+ currentPage: 1,
|
|
|
+ size: 10,
|
|
|
+ orgtreelist: [],
|
|
|
+ orgtreeprops: {
|
|
|
+ value: 'id',
|
|
|
+ label: 'ItemName',
|
|
|
+ children: 'children'
|
|
|
+ },
|
|
|
+ userdepartment: [],
|
|
|
+ list: [], //文档列表
|
|
|
+ exId: '323', //当前选中结构ID,默认基础文档id:323
|
|
|
+ searchForm: {
|
|
|
+ Name: '' //文档名称
|
|
|
+ },
|
|
|
+ }
|
|
|
+ },
|
|
|
+ created() {
|
|
|
+ this.initData()
|
|
|
+ this.gettreelist(218)
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ initData() {
|
|
|
+ let _this = this
|
|
|
+ const params = {
|
|
|
+ _currentPage: this.currentPage,
|
|
|
+ _size: this.size,
|
|
|
+ Id: 218,//Base_ItemTreeDetails表中的ItemsId
|
|
|
+ DirectoryId: this.exId,
|
|
|
+ Name: this.searchForm.Name,
|
|
|
+ NoticeTab: 1
|
|
|
+ }
|
|
|
+ this.$axios.get("/document/getdocumentlist", {
|
|
|
+ params
|
|
|
+ })
|
|
|
+ .then(function (response) {
|
|
|
+ _this.list = response.data.items
|
|
|
+ _this.currentItemCount = response.data.currentItemCount
|
|
|
+ })
|
|
|
+ .catch(function (error) {
|
|
|
+ console.log(error);
|
|
|
+ });
|
|
|
+ },
|
|
|
+ orgtreeNodeClick(data) {
|
|
|
+ this.exId = data.id + ''
|
|
|
+ this.currentPage = 1
|
|
|
+ this.initData()
|
|
|
+ },
|
|
|
+ //删除文件
|
|
|
+ deletedata(val) {
|
|
|
+ let _this = this
|
|
|
+ _this.$confirm('此操作将彻底删除该数据, 是否继续?', '提示', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ type: 'warning'
|
|
|
+ })
|
|
|
+ .then(() => {
|
|
|
+ _this.$axios.delete('/document/deletedocumentdata/' + val, {})
|
|
|
+ .then(function (response) {
|
|
|
+ if (response.data.code === 0) {
|
|
|
+ _this.$message({
|
|
|
+ type: "success",
|
|
|
+ message: response.data.message
|
|
|
+ });
|
|
|
+ // 更新界面
|
|
|
+ _this.initData()
|
|
|
+ } else {
|
|
|
+ _this.$message({
|
|
|
+ type: "warning",
|
|
|
+ message: response.data.message
|
|
|
+ });
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .catch(function (error) {
|
|
|
+ console.log(error)
|
|
|
+ });
|
|
|
+ })
|
|
|
+ .catch(() => {});
|
|
|
+ },
|
|
|
+ //获取文档目录列表
|
|
|
+ gettreelist(pid) {
|
|
|
+ let _this = this
|
|
|
+ let params = {
|
|
|
+ pid: pid + ''
|
|
|
+ }
|
|
|
+ _this.$axios.get('/items/gettreeitemsdetail', {
|
|
|
+ params
|
|
|
+ })
|
|
|
+ .then(res => {
|
|
|
+ _this.orgtreelist = window.toolfun_gettreejson(res.data.items, 'Id', 'ParentId', 'Id,ItemName')
|
|
|
+ })
|
|
|
+ .catch(err => {
|
|
|
+ // handle error
|
|
|
+ console.error(err)
|
|
|
+ })
|
|
|
+ },
|
|
|
+ toadddoc() {
|
|
|
+ this.$router.push({
|
|
|
+ path: `/documentmanage/add?exid=${this.exId}&type=1`
|
|
|
+ })
|
|
|
+ },
|
|
|
+ jstimehandle(val) {
|
|
|
+ if (val === '') {
|
|
|
+ return '----'
|
|
|
+ } else if (val === '0001-01-01T08:00:00+08:00') {
|
|
|
+ return '----'
|
|
|
+ } else if (val === '5000-01-01T23:59:59+08:00') {
|
|
|
+ return '永久'
|
|
|
+ } else {
|
|
|
+ val = val.replace('T', ' ')
|
|
|
+ return val.substring(0, 19)
|
|
|
+ }
|
|
|
+ },
|
|
|
+ handleSizeChange(value) {
|
|
|
+ this.size = value
|
|
|
+ this.currentPage = 1
|
|
|
+ this.initData()
|
|
|
+ },
|
|
|
+ handleCurrentChange(value) {
|
|
|
+ this.currentPage = value
|
|
|
+ this.initData()
|
|
|
+ },
|
|
|
+ clearSearch() {
|
|
|
+ this.searchForm.Name = ''
|
|
|
+ this.initData()
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+</script>
|
|
|
+
|
|
|
+<style lang="scss">
|
|
|
+ .time {
|
|
|
+ font-size: 13px;
|
|
|
+ color: #999;
|
|
|
+ }
|
|
|
+
|
|
|
+ .bottom {
|
|
|
+ margin-top: 13px;
|
|
|
+ line-height: 12px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .button {
|
|
|
+ padding: 0;
|
|
|
+ float: right;
|
|
|
+ }
|
|
|
+
|
|
|
+ .image {
|
|
|
+ width: 100%;
|
|
|
+ display: block;
|
|
|
+ }
|
|
|
+
|
|
|
+ .clearfix:before,
|
|
|
+ .clearfix:after {
|
|
|
+ display: table;
|
|
|
+ content: "";
|
|
|
+ }
|
|
|
+
|
|
|
+ .clearfix:after {
|
|
|
+ clear: both
|
|
|
+ }
|
|
|
+
|
|
|
+ .el-pagination {
|
|
|
+ margin: 1rem 0 2rem;
|
|
|
+ text-align: right;
|
|
|
+ }
|
|
|
+
|
|
|
+ .plab {
|
|
|
+ font-size: 13px;
|
|
|
+ color: #999;
|
|
|
+ }
|
|
|
+
|
|
|
+ .triggerone {
|
|
|
+ font-size: 13px;
|
|
|
+ margin-left: 80px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .plab {
|
|
|
+ font-size: 13px;
|
|
|
+ color: #999;
|
|
|
+ }
|
|
|
+
|
|
|
+ .docdelete .el-radio {
|
|
|
+ padding: 8px 15px 0 0;
|
|
|
+ margin-left: -2px;
|
|
|
+ }
|
|
|
+
|
|
|
+</style>
|