Browse Source

Merge remote-tracking branch 'origin/master'

wangzhe 1 year ago
parent
commit
c47fc2f632

+ 42 - 0
src/api/department/department.js

@@ -0,0 +1,42 @@
+import request from '@/utils/request'
+
+// 查询部门列表
+export function listDepts(query) {
+  return request({
+    url: '/system/department/list',
+    method: 'get',
+    params: query
+  })
+}
+
+// 查询部门详细
+export function getDept(id) {
+  return request({
+    url: '/system/department/lists/' + id,
+    method: 'get'
+  })
+}
+// 新增部门
+export function addDept(data) {
+  return request({
+    url: '/system/department/add',
+    method: 'post',
+    data: data
+  })
+}
+
+// 修改部门
+export function updateDept(data) {
+  return request({
+    url: '/system/department/update/',
+    method: 'put',
+    data: data
+  })
+}
+
+// 删除部门
+export function delDept(id) {
+  return request({
+    url: '/system/department/delete/' + id,
+    method: 'delete'
+  })}

+ 52 - 0
src/api/matter/matter.js

@@ -0,0 +1,52 @@
+import request from '@/utils/request'
+
+// 查询事项列表
+export function listDept(query) {
+  return request({
+    url: '/system/matter/list',
+    method: 'get',
+    params: query
+  })
+}
+
+// 查询事项详细
+export function getDept(id) {
+  return request({
+    url: '/system/matter/lists/' + id,
+    method: 'get'
+  })
+}
+
+// 新增事项
+export function addDept(data) {
+  return request({
+    url: '/system/matter/add',
+    method: 'post',
+    data: data
+  })
+}
+
+// 修改事项
+export function updateDept(data) {
+  return request({
+    url: '/system/matter/update/',
+    method: 'put',
+    data: data
+  })
+}
+
+// 审核事项
+export function examine(data) {
+  return request({
+    url: '/system/matter/examine/',
+    method: 'put',
+    data: data
+  })
+}
+
+// 删除事项
+export function delDept(id) {
+  return request({
+    url: '/system/matter/delete/' + id,
+    method: 'delete'
+  })}

+ 44 - 0
src/api/my/announcement.js

@@ -0,0 +1,44 @@
+import request from '@/utils/request'
+
+// 查询公告列表
+export function listAnnouncement(query) {
+  return request({
+    url: '/my/announcement/list',
+    method: 'get',
+    params: query
+  })
+}
+
+// 查询公告详细
+export function getAnnouncement(id) {
+  return request({
+    url: '/my/announcement/' + id,
+    method: 'get'
+  })
+}
+
+// 新增公告
+export function addAnnouncement(data) {
+  return request({
+    url: '/my/announcement',
+    method: 'post',
+    data: data
+  })
+}
+
+// 修改公告
+export function updateAnnouncement(data) {
+  return request({
+    url: '/my/announcement',
+    method: 'put',
+    data: data
+  })
+}
+
+// 删除公告
+export function delAnnouncement(id) {
+  return request({
+    url: '/my/announcement/' + id,
+    method: 'delete'
+  })
+}

+ 1 - 1
src/components/Editor/index.vue

@@ -196,7 +196,7 @@ export default {
         // 获取光标所在位置
         let length = quill.getSelection().index;
         // 插入图片  res.url为服务器返回的图片地址
-        quill.insertEmbed(length, "image", process.env.VUE_APP_BASE_API + res.fileName);
+        quill.insertEmbed(length, "image", res.url);
         // 调整光标到最后
         quill.setSelection(length + 1);
       } else {

+ 291 - 0
src/views/configuration/department.vue

@@ -0,0 +1,291 @@
+<template>
+  <div class="app-container">
+    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
+      <el-form-item label="部门名称" prop="name">
+        <el-input
+          v-model="queryParams.name"
+          placeholder="请输入部门名称"
+          clearable
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+
+      <el-form-item label="办理对象" prop="application">
+        <el-select v-model="queryParams.application" placeholder="请选择办理对象" clearable>
+          <el-option
+            v-for="dict in dict.type.object_application"
+            :key="dict.value"
+            :label="dict.label"
+            :value="dict.value"
+          />
+        </el-select>
+      </el-form-item>
+      <el-form-item>
+        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
+        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
+      </el-form-item>
+    </el-form>
+    <el-row :gutter="10" class="mb8">
+      <el-col :span="1.5">
+        <el-button
+          type="primary"
+          plain
+          icon="el-icon-plus"
+          size="mini"
+          @click="handleAdd"
+        >新增</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="success"
+          plain
+          icon="el-icon-edit"
+          size="mini"
+          :disabled="single"
+          @click="handleUpdate"
+        >修改</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="danger"
+          plain
+          icon="el-icon-delete"
+          size="mini"
+          :disabled="multiple"
+          @click="handleDelete"
+        >删除</el-button>
+      </el-col>
+      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
+    </el-row>
+    <el-table v-loading="loading" :data="deptList" @selection-change="handleSelectionChange">
+      <el-table-column label="部门名称" align="center" prop="name" />
+      <el-table-column label="办理对象" align="center" prop="application" width="90" >
+        <template slot-scope="scope">
+          <dict-tag :options="dict.type.object_application" :value="scope.row.application"/>
+        </template>
+      </el-table-column>
+      <el-table-column label="是否首页展示" align="center" key="shows" >
+        <template slot-scope="scope">
+          <el-switch
+            v-model="scope.row.shows"
+            active-value="0"
+            inactive-value="1"
+            @change="handleStatusChange(scope.row)"
+          ></el-switch>
+        </template>
+      </el-table-column>
+      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
+        <template slot-scope="scope">
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-edit"
+            @click="handleUpdate(scope.row)"
+          >修改</el-button>
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-delete"
+            @click="handleDelete(scope.row)"
+          >删除</el-button>
+        </template>
+      </el-table-column>
+    </el-table>
+
+    <pagination
+      v-show="total>0"
+      :total="total"
+      :page.sync="queryParams.pageNum"
+      :limit.sync="queryParams.pageSize"
+      @pagination="getList"
+    />
+
+    <!-- 添加或修改部门对话框 -->
+    <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
+      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
+        <el-form-item label="部门名称" prop="name">
+          <el-input v-model="form.name" placeholder="请输入部门名称" />
+        </el-form-item>
+        <el-form-item label="办理对象" prop="application">
+          <el-select v-model="form.application" placeholder="请选择办理对象">
+            <el-option v-for="dict in dict.type.object_application" :key="dict.value" :label="dict.label" :value="dict.value" />
+          </el-select>
+        </el-form-item>
+        <el-col :span="12">
+          <el-form-item label="是否首页展示" >
+            <el-radio-group v-model="form.shows">
+              <el-radio
+                v-for="dict in dict.type.sys_normal_disable"
+                :key="dict.value"
+                :label="dict.value"
+              >{{dict.label}}</el-radio>
+            </el-radio-group>
+          </el-form-item>
+        </el-col>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="submitForm">确 定</el-button>
+        <el-button @click="cancel">取 消</el-button>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+  import { listDepts, getDept, delDept, addDept, updateDept } from "@/api/department/department";
+
+  export default {
+    name: "Dept",
+    dicts: ['object_application','sys_normal_disable'],
+    data() {
+      return {
+        // 遮罩层
+        loading: true,
+        // 选中数组
+        ids: [],
+        // 非单个禁用
+        single: true,
+        // 非多个禁用
+        multiple: true,
+        // 显示搜索条件
+        showSearch: true,
+        // 总条数
+        total: 0,
+        // 部门表格数据
+        deptList: [],
+        // 弹出层标题
+        title: "",
+        // 是否显示弹出层
+        open: false,
+        // 查询参数
+        queryParams: {
+
+          pageNum: 1,
+          pageSize: 10,
+          id:null,
+          name: null,
+          shows: null,
+          application: null,
+          orderNum: null,
+          leader: null,
+          phone: null,
+          email: null,
+          status: null,
+        },
+        // 表单参数
+        form: {},
+        // 表单校验
+        rules: {
+          name: [
+            { required: true, message: "部门名称不能为空", trigger: "blur" }
+          ],
+          application: [
+            { required: true, message: "办理对象不能为空", trigger: "blur" }
+          ],
+        }
+      };
+    },
+    created() {
+      this.getList();
+    },
+    methods: {
+      /** 查询部门列表 */
+      getList() {
+        this.loading = true;
+        listDepts(this.queryParams).then(response => {
+          this.deptList = response.rows;
+          this.total = response.total;
+          this.loading = false;
+        });
+      },
+      // 取消按钮
+      cancel() {
+        this.open = false;
+        this.reset();
+      },
+      // 表单重置
+      reset() {
+        this.form = {
+          name: null,
+          shows: null,
+          application: null,
+        };
+        this.resetForm("form");
+      },
+      /** 搜索按钮操作 */
+      handleQuery() {
+        this.queryParams.pageNum = 1;
+        this.getList();
+      },
+      /** 重置按钮操作 */
+      resetQuery() {
+        this.resetForm("queryForm");
+        this.handleQuery();
+      },
+      // 多选框选中数据
+      handleSelectionChange(selection) {
+        this.ids = selection.map(item => item.deptId)
+        this.single = selection.length!==1
+        this.multiple = !selection.length
+      },
+      /** 新增按钮操作 */
+      handleAdd() {
+        this.reset();
+        this.open = true;
+        this.title = "添加部门";
+      },
+      /** 修改按钮操作 */
+      handleUpdate(row) {
+        this.reset();
+        const id = row.id || this.id
+        getDept(row.id).then(response => {
+          this.form = response.data;
+          this.open = true;
+          this.title = "修改部门";
+        });
+      },
+      /** 提交按钮 */
+      submitForm() {
+        this.$refs["form"].validate(valid => {
+          if (valid) {
+            if (this.form.id != null) {
+              updateDept(this.form).then(response => {
+                this.$modal.msgSuccess("修改成功");
+                this.open = false;
+                this.getList();
+              });
+            } else {
+              addDept(this.form).then(response => {
+                this.$modal.msgSuccess("新增成功");
+                this.open = false;
+                this.getList();
+              });
+            }
+          }
+        });
+      },
+      handleStatusChange(row) {
+
+        let text = row.shows === "0" ? "开启" : "关闭";
+        this.$modal.confirm('确认要' + text + '' + row.name + '部门首页展示吗?').then(function() {
+          return updateDept(row);
+        }).then(() => {
+          this.$modal.msgSuccess(text + "成功");
+        }).catch(function() {
+          row.shows = row.shows === "0" ? "1" : "0";
+        });
+      },
+      /** 删除按钮操作 */
+      handleDelete(row) {
+        const id = row.id || this.id;
+        this.$modal.confirm('是否确认删除该部门').then(function() {
+          return delDept(id);
+        }).then(() => {
+          this.getList();
+          this.$modal.msgSuccess("删除成功");
+        }).catch(() => {});
+      },
+
+    }
+  };
+</script>

+ 18 - 16
src/views/handleAffairs/topicType/index.vue

@@ -10,16 +10,16 @@
         />
       </el-form-item>
 
-      <el-form-item label="办理对象" prop="objectOfHandling">
-        <el-select v-model="queryParams.objectOfHandling" placeholder="请选择办理对象" clearable>
-          <el-option
-            v-for="dict in dict.type.object_application"
-            :key="dict.value"
-            :label="dict.label"
-            :value="dict.value"
-          />
-        </el-select>
-      </el-form-item>
+<!--      <el-form-item label="办理对象" prop="objectOfHandlingArray">-->
+<!--        <el-select v-model="queryParams.objectOfHandlingArray" placeholder="请选择办理对象" clearable multiple>-->
+<!--          <el-option-->
+<!--            v-for="dict in dict.type.object_application"-->
+<!--            :key="dict.value"-->
+<!--            :label="dict.label"-->
+<!--            :value="dict.value"-->
+<!--          />-->
+<!--        </el-select>-->
+<!--      </el-form-item>-->
       <el-form-item>
         <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
         <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
@@ -75,9 +75,9 @@
     <el-table v-loading="loading" :data="topicTypeList" @selection-change="handleSelectionChange">
       <el-table-column type="selection" width="55" align="center" />
       <el-table-column label="部门名称" align="center" prop="deptName" />
-      <el-table-column label="办理对象" align="center" prop="objectOfHandling">
+      <el-table-column label="办理对象" align="center" prop="objectOfHandling0">
         <template slot-scope="scope">
-          <dict-tag :options="dict.type.object_application" :value="scope.row.objectOfHandling"/>
+          <dict-tag :options="dict.type.object_application" :value="scope.row.objectOfHandlingArray"/>
         </template>
       </el-table-column>
       <el-table-column label="是否首页展示" align="center" prop="yesOrNoShow">
@@ -130,8 +130,8 @@
         </el-row>
         <el-row :gutter="24">
           <el-col :span="24">
-            <el-form-item label="办理对象" prop="objectOfHandling">
-              <el-select v-model="form.objectOfHandling" placeholder="请选择办理对象" style="width: 100%">
+            <el-form-item label="办理对象" prop="objectOfHandlingArray">
+              <el-select v-model="form.objectOfHandlingArray" placeholder="请选择办理对象" style="width: 100%" multiple>
                 <el-option
                   v-for="dict in dict.type.object_application"
                   :key="dict.value"
@@ -196,7 +196,8 @@ export default {
         pageSize: 10,
         deptName: null,
         yesOrNoShow: null,
-        objectOfHandling: null
+        objectOfHandling: null,
+        objectOfHandlingArray: null,
       },
       // 表单参数
       form: {},
@@ -205,9 +206,10 @@ export default {
         deptName: [
           { required: true, message: "部门名称不能为空", trigger: "blur" }
         ],
-        objectOfHandling: [
+        objectOfHandlingArray: [
           { required: true, message: "办理对象不能为空", trigger: "blur" }
         ],
+
       }
     };
   },

+ 3 - 2
src/views/highServer/assistance/index.vue

@@ -228,7 +228,7 @@ export default {
     handleUpdate(row) {
       this.reset();
       const id = row.id || this.ids
-      getServer(id).then(response => {
+      getServer(id,row.type).then(response => {
         this.form = response.data;
         this.open = true;
         this.title = "修改帮扶救助";
@@ -257,8 +257,9 @@ export default {
     /** 删除按钮操作 */
     handleDelete(row) {
       const ids = row.id || this.ids;
+      const type = this.$route.query.type
       this.$modal.confirm('是否确认删除此条数据项?').then(function () {
-        return delServer(ids);
+        return delServer(ids,type);
       }).then(() => {
         this.getList();
         this.$modal.msgSuccess("删除成功");

+ 24 - 19
src/views/highServer/knowledge/index.vue

@@ -82,7 +82,7 @@
       <el-table-column type="selection" width="55" align="center"/>
       <el-table-column label="序号" align="center" type="index"/>
       <el-table-column label="标题" align="center" prop="titleName"/>
-<!--      <el-table-column label="正文" align="center" prop="textDetails"/>-->
+      <!--      <el-table-column label="正文" align="center" prop="textDetails"/>-->
       <el-table-column label="是否热门" align="center" prop="popular">
         <template slot-scope="scope">
           <el-switch
@@ -268,7 +268,7 @@ export default {
     handleUpdate(row) {
       this.reset();
       const id = row.id || this.ids
-      getBase(id,row.type).then(response => {
+      getBase(id, row.type).then(response => {
         this.form = response.data;
         this.open = true;
         this.title = "修改知识库";
@@ -276,29 +276,34 @@ export default {
     },
     /** 提交按钮 */
     submitForm() {
-      this.$refs["form"].validate(valid => {
-        if (valid) {
-          if (this.form.id != null) {
-            updateBase(this.form).then(response => {
-              this.$modal.msgSuccess("修改成功");
-              this.open = false;
-              this.getList();
-            });
-          } else {
-            addBase(this.form).then(response => {
-              this.$modal.msgSuccess("新增成功");
-              this.open = false;
-              this.getList();
-            });
+      if (this.form.imgUrlList != null && this.form.imgUrlList != "" && this.form.imgUrlList.split(',').length > 1) {
+          this.$modal.msgWarning("图片只能上传一张");
+      } else {
+        this.$refs["form"].validate(valid => {
+          if (valid) {
+            if (this.form.id != null) {
+              updateBase(this.form).then(response => {
+                this.$modal.msgSuccess("修改成功");
+                this.open = false;
+                this.getList();
+              });
+            } else {
+              addBase(this.form).then(response => {
+                this.$modal.msgSuccess("新增成功");
+                this.open = false;
+                this.getList();
+              });
+            }
           }
-        }
-      });
+        });
+      }
+
     },
     /** 删除按钮操作 */
     handleDelete(row) {
       const ids = row.id || this.ids;
       this.$modal.confirm('是否确认删除知识库编号为"' + ids + '"的数据项?').then(function () {
-        return delBase(ids,row.type);
+        return delBase(ids, row.type);
       }).then(() => {
         this.getList();
         this.$modal.msgSuccess("删除成功");

+ 3 - 2
src/views/highServer/onlineConsultation/index.vue

@@ -228,7 +228,7 @@ export default {
     handleUpdate(row) {
       this.reset();
       const id = row.id || this.ids
-      getServer(id).then(response => {
+      getServer(id,row.type).then(response => {
         this.form = response.data;
         this.open = true;
         this.title = "修改线上问诊";
@@ -257,8 +257,9 @@ export default {
     /** 删除按钮操作 */
     handleDelete(row) {
       const ids = row.id || this.ids;
+      const type = this.$route.query.type
       this.$modal.confirm('是否确认删除此条数据项?').then(function () {
-        return delServer(ids);
+        return delServer(ids,type);
       }).then(() => {
         this.getList();
         this.$modal.msgSuccess("删除成功");

+ 3 - 2
src/views/highServer/psychologicalCounseling/index.vue

@@ -228,7 +228,7 @@ export default {
     handleUpdate(row) {
       this.reset();
       const id = row.id || this.ids
-      getServer(id).then(response => {
+      getServer(id,row.type).then(response => {
         this.form = response.data;
         this.open = true;
         this.title = "修改心理咨询";
@@ -257,8 +257,9 @@ export default {
     /** 删除按钮操作 */
     handleDelete(row) {
       const ids = row.id || this.ids;
+      const type = this.$route.query.type
       this.$modal.confirm('是否确认删除此条数据项?').then(function () {
-        return delServer(ids);
+        return delServer(ids,type);
       }).then(() => {
         this.getList();
         this.$modal.msgSuccess("删除成功");

+ 3 - 2
src/views/highServer/travelGuide/index.vue

@@ -228,7 +228,7 @@ export default {
     handleUpdate(row) {
       this.reset();
       const id = row.id || this.ids
-      getServer(id).then(response => {
+      getServer(id,row.type).then(response => {
         this.form = response.data;
         this.open = true;
         this.title = "修改旅游向导";
@@ -257,8 +257,9 @@ export default {
     /** 删除按钮操作 */
     handleDelete(row) {
       const ids = row.id || this.ids;
+      const type = this.$route.query.type
       this.$modal.confirm('是否确认删除此条数据项?').then(function () {
-        return delServer(ids);
+        return delServer(ids,type);
       }).then(() => {
         this.getList();
         this.$modal.msgSuccess("删除成功");

+ 516 - 0
src/views/matter/matter.vue

@@ -0,0 +1,516 @@
+<template>
+  <div class="app-container">
+    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
+      <el-form-item label="事项名称" prop="title">
+        <el-input
+          v-model="queryParams.title"
+          placeholder="请输入事项名称"
+          clearable
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="审核状态" prop="examine">
+        <el-select v-model="queryParams.examine" placeholder="请选择审核状态" clearable>
+          <el-option
+            v-for="dict in dict.type.examine_state"
+            :key="dict.value"
+            :label="dict.label"
+            :value="dict.value"
+          />
+        </el-select>
+      </el-form-item>
+      <el-form-item>
+        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
+        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
+      </el-form-item>
+    </el-form>
+
+    <el-row :gutter="10" class="mb8">
+      <el-col :span="1.5">
+        <el-button
+          type="primary"
+          plain
+          icon="el-icon-plus"
+          size="mini"
+          @click="handleAdd"
+        >新增</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="success"
+          plain
+          icon="el-icon-edit"
+          size="mini"
+          :disabled="single"
+          @click="handleUpdate"
+        >修改</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="danger"
+          plain
+          icon="el-icon-delete"
+          size="mini"
+          :disabled="multiple"
+          @click="handleDelete"
+        >删除</el-button>
+      </el-col>
+
+      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
+    </el-row>
+    <el-table v-loading="loading" :data="deptList" @selection-change="handleSelectionChange">
+      <el-table-column label="事项标题" align="center" prop="title" />
+      <el-table-column label="主题类型" align="center" prop="type" />
+      <el-table-column label="所属部门" align="center" prop="department" />
+
+      <el-table-column label="是否展示" align="center" key="operation">
+        <template slot-scope="scope">
+          <el-switch
+            v-model="scope.row.operation"
+            :active-value="0"
+            :inactive-value="1"
+            @change="handleStatusChange(scope.row)"
+          ></el-switch>
+        </template>
+      </el-table-column>
+      <el-table-column label="电话" align="center" prop="address" />
+      <el-table-column label="地址" align="center" prop="phone" />
+      <el-table-column label="图片" align="center" prop="picture" width="100">
+        <template slot-scope="scope">
+          <image-preview :src="scope.row.picture" :width="50" :height="50"/>
+        </template>
+      </el-table-column>
+      <el-table-column label="审核状态" align="center" prop="examine" width="90" >
+        <template slot-scope="scope">
+          <dict-tag :options="dict.type.examine_state" :value="scope.row.examine"/>
+        </template>
+      </el-table-column>
+      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
+        <template slot-scope="scope">
+          <el-button
+            v-if="scope.row.examine != 1"
+          size="mini"
+          type="text"
+          icon="el-icon-edit"
+          @click="handleUpdate(scope.row)"
+          >修改</el-button>
+
+          <el-button
+            v-if="scope.row.examine != 1"
+            size="mini"
+            type="text"
+            icon="el-icon-delete"
+            @click="handleDelete(scope.row)"
+          >删除</el-button>
+          <el-button
+            v-if="scope.row.examine != 1"
+            size="mini"
+            type="text"
+            icon="el-icon-delete"
+            @click="handleExamine(scope.row)"
+          >审核</el-button>
+
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-delete"
+            @click="handleview(scope.row)"
+          >查看</el-button>
+        </template>
+      </el-table-column>
+    </el-table>
+
+    <pagination
+      v-show="total>0"
+      :total="total"
+      :page.sync="queryParams.pageNum"
+      :limit.sync="queryParams.pageSize"
+      @pagination="getList"
+    />
+
+    <!-- 添加或修改部门对话框 -->
+    <el-dialog :title="title" :visible.sync="open" width="600px" append-to-body>
+      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
+        <el-form-item label="事项标题" prop="title">
+          <el-input v-model="form.title" placeholder="请输入事项标题" style="width: 230px;" />
+        </el-form-item>
+        <el-form-item label="正文" prop="content">
+          <editor v-model="form.content" :min-height="122" v-if="open" />
+        </el-form-item>
+        <el-form-item label="主题类型" prop="type">
+          <el-select v-model="form.type" placeholder="请选择主题类型">
+            <el-option
+              v-for="item in deptLists"
+              :key="item.id"
+              :label="item.deptName"
+              :value="item.deptName"
+            />
+          </el-select>
+        </el-form-item>
+        <el-form-item label="所属部门" prop="department">
+          <el-select v-model="form.department" placeholder="请输入所属部门">
+            <el-option
+              v-for="item in departmentList"
+              :key="item.id"
+              :label="item.name"
+              :value="item.name"
+            />
+          </el-select>
+        </el-form-item>
+        <el-form-item label="是否常办">
+          <el-radio-group v-model="form.operation">
+            <el-radio
+              v-for="dict in dict.type.sys_normal_disable"
+              :key="dict.value"
+              :label="dict.value"
+            >{{dict.label}}</el-radio>
+          </el-radio-group>
+        </el-form-item>
+        <el-form-item label="电话" prop="address" style="width: 300px;">
+          <el-input v-model="form.address" placeholder="请输入电话" />
+        </el-form-item>
+        <el-form-item label="地址" prop="phone" style="width: 300px;">
+          <el-input v-model="form.phone" placeholder="请输入地址" />
+        </el-form-item>
+        <el-form-item label="图片" prop="picture">
+          <image-upload v-model="form.picture" :fileSize="10" :limit="1"/>
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="submitForm">确 定</el-button>
+        <el-button @click="cancel">取 消</el-button>
+      </div>
+    </el-dialog>
+    <!-- 审核对话框 -->
+    <el-dialog title="审核" :visible.sync="dialogVisible" width="20%" :before-close="handleDialogClose">
+      <el-form ref="form" :model="form" :rules="rules" label-width="50px">
+        <el-form-item label="审核" prop="examine">
+          <el-select v-model="form.examine" placeholder="请选择此事项审核状态">
+            <el-option v-for="dict in dict.type.examine_state" :key="dict.value" :label="dict.label" :value="dict.value" />
+          </el-select>
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="confirmExamine">确认</el-button>
+        <el-button @click="cancelExamine">取消</el-button>
+      </div>
+    </el-dialog>
+
+    <!-- 详情 -->
+    <el-dialog :title="title" :visible.sync="openSee" width="600px" append-to-body>
+
+      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
+
+        <el-form-item label="事项标题" prop="title" >
+          <el-input v-model="form.title" placeholder="请输入事项标题" style="width: 230px;" :readonly="true" />
+        </el-form-item>
+        <el-form-item label="正文" prop="content" >
+          <editor v-model="form.content" :min-height="122" :readonly="true" />
+        </el-form-item>
+        <el-form-item label="主体类型" prop="type" >
+          <el-select v-model="form.type" placeholder="请选择主体类型" :disabled="true">
+            <el-option
+              v-for="item in deptLists"
+              :readonly="true"
+              :key="item.id"
+              :label="item.deptName"
+              :value="item.deptName"
+            />
+          </el-select>
+        </el-form-item>
+        <el-form-item label="所属部门" prop="department" >
+          <el-select v-model="form.department" placeholder="请输入所属部门":disabled="true">
+            <el-option
+              v-for="item in departmentList"
+              :key="item.id"
+              :label="item.name"
+              :value="item.name"
+            />
+          </el-select>
+        </el-form-item>
+        <el-form-item label="是否常办" >
+          <el-radio-group v-model="form.operation">
+            <el-radio
+              v-for="dict in dict.type.sys_normal_disable"
+              :key="dict.value"
+              :disabled="true"
+              :label="dict.value"
+            >{{dict.label}}</el-radio>
+          </el-radio-group>
+        </el-form-item>
+        <el-form-item label="电话" prop="address" style="width: 300px;" >
+          <el-input v-model="form.address" placeholder="请输入电话" :readonly="true" />
+        </el-form-item>
+        <el-form-item label="地址" prop="phone" style="width: 300px;" >
+          <el-input v-model="form.phone" placeholder="请输入地址" :readonly="true" />
+        </el-form-item>
+        <el-form-item label="图片" prop="picture" >
+          <image-upload v-model="form.picture" :fileSize="10" :limit="1"  />
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button @click="cancel">取 消</el-button>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+  import { listDept, getDept, delDept, addDept, updateDept,examine } from "@/api/matter/matter";
+  import { listTopicType } from "@/api/handleAffairs/topicType";
+  import { listDepts } from "@/api/department/department";
+  export default {
+    name: "Dept",
+    dicts: ['object_application','sys_normal_disable','examine_state'],
+    data() {
+      return {
+        // 遮罩层
+        loading: true,
+        // 选中数组
+        ids: [],
+        // 非单个禁用
+        single: true,
+        // 非多个禁用
+        multiple: true,
+        // 显示搜索条件
+        showSearch: true,
+        // 是否显示详情弹出层
+        openSee: false,
+        // 总条数
+        dialogVisible: false,
+        total: 0,
+        // 部门表格数据
+        deptList: [],
+        deptLists:[],
+        departmentList:[],
+        // 弹出层标题
+        title: "",
+        // 是否显示弹出层
+        open: false,
+        // 查询参数
+        queryParams: {
+          id:null,
+          title: null,
+          type: null,
+          department: null,
+          operation: null,
+          address: null,
+          phone: null,
+          picture: null,
+          pageNum: 1,
+          pageSize: 10,
+          email: null,
+          content:null,
+          examine:null,
+
+        },
+        queryParamss: {
+          id:null,
+          deptName: null,
+
+        },
+        queryParamsss: {
+          id:null,
+          name: null,
+
+        },
+        // 表单参数
+        form: {},
+        // 表单校验
+        rules: {
+          title: [
+            { required: true, message: "事项标题不能为空", trigger: "blur" }
+          ],
+          type: [
+            { required: true, message: "主题类型不能为空", trigger: "blur" }
+          ],
+          department: [
+            { required: true, message: "所属部门不能为空", trigger: "blur" }
+          ],
+          operation: [
+            { required: true, message: "请选择是否常办", trigger: "blur" }
+          ],
+        }
+      };
+    },
+    created() {
+      this.getList();
+      this.getgrid();
+      this.getdepartment();
+    },
+    methods: {
+      /** 查询部门列表 */
+      getList() {
+        this.loading = true;
+        listDept(this.queryParams).then(response => {
+          this.deptList = response.rows;
+          this.total = response.total;
+          this.loading = false;
+        });
+      },
+      getgrid() {
+        this.loading = true;
+        listTopicType(this.queryParamss).then(response => {
+          this.deptLists = response.rows;
+          this.total = response.total;
+          this.loading = false;
+        });
+      },
+      getdepartment() {
+        this.loading = true;
+        listDepts(this.queryParamss).then(response => {
+          this.departmentList = response.rows;
+          this.total = response.total;
+          this.loading = false;
+        });
+      },
+      /** 查询事项详情 */
+      handleview(row) {
+        this.reset();
+        console.log("999999999999",row)
+        getDept(row.id).then(response => {
+          this.form = response.data;
+           this.$nextTick(() => {
+            this.form.operation = this.form.operation.toString();
+          });
+          this.openSee = true;
+          this.title = "详情";
+        });
+      },
+  //     getDept(row.id).then(response => {
+  //   this.form = response.data;
+  //   this.$nextTick(() => {
+  //     this.form.operation = this.form.operation.toString();
+  //   });
+  //   this.open = true;
+  //   this.title = "修改事项";
+  // });
+      // 取消按钮
+      cancel() {
+        this.open = false;
+        this.reset();
+        this.openSee = false;
+      },
+      // 表单重置
+      reset() {
+        this.form = {
+          name: null,
+          operation: null,
+          application: null,
+          content:null,
+        };
+        this.resetForm("form");
+      },
+      /** 搜索按钮操作 */
+      handleQuery() {
+        this.queryParams.pageNum = 1;
+        this.getList();
+      },
+      /** 重置按钮操作 */
+      resetQuery() {
+        this.resetForm("queryForm");
+        this.handleQuery();
+      },
+      // 多选框选中数据
+      handleSelectionChange(selection) {
+        this.ids = selection.map(item => item.deptId)
+        this.single = selection.length!==1
+        this.multiple = !selection.length
+      },
+      /** 新增按钮操作 */
+      handleAdd() {
+        this.reset();
+        this.open = true;
+        this.title = "添加事项";
+      },
+      /** 修改按钮操作 */
+      handleUpdate(row) {
+        if (row.examine != 3) {
+          this.$message.error('禁止修改:此事项不符合修改条件!');
+        } else {
+          this.reset();
+          const id = row.id || this.id;
+          getDept(row.id).then(response => {
+            this.form = response.data;
+            this.$nextTick(() => {
+              this.form.operation = this.form.operation.toString();
+            });
+            this.open = true;
+            this.title = "修改事项";
+          });
+        }
+
+
+      },
+      /** 提交按钮 */
+      submitForm() {
+        this.$refs["form"].validate(valid => {
+          if (valid) {
+            if (this.form.id != null ) {
+              updateDept(this.form).then(response => {
+                this.$modal.msgSuccess("修改成功");
+                this.open = false;
+                this.getList();
+              });
+            } else {
+              addDept(this.form).then(response => {
+                this.$modal.msgSuccess("新增成功");
+                this.open = false;
+                this.getList();
+              });
+            }
+          }
+        });
+      },
+      handleExamine(row) {
+        this.dialogVisible = true;
+        this.form=row
+      },
+      confirmExamine() {
+        // 提交审核后关闭弹窗
+        this.$refs["form"].validate(valid => {
+          if (valid) {
+              examine(this.form).then(response => {
+                this.$modal.msgSuccess("修改成功");
+                this.getList();
+                this.dialogVisible = false;
+              });
+          }
+        });
+      },
+      cancelExamine() {
+        // 关闭弹窗
+        this.dialogVisible = false;
+      },
+      handleDialogClose(done) {
+        done(); // 关闭弹窗
+      },
+      // 用户状态修改
+      handleStatusChange(row) {
+        let text = row.operation === "0" ? "启用" : "停用";
+        this.$modal.confirm('确认要"' + text + '""' + row.userName + '"用户吗?').then(function() {
+          return updateDept(row);
+        }).then(() => {
+          this.$modal.msgSuccess(text + "成功");
+        }).catch(function() {
+          row.operation = row.operation === "0" ? "1" : "0";
+        });
+      },
+      /** 删除按钮操作 */
+      handleDelete(row) {
+        if (row.examine != 3) {
+          this.$message.error('禁止删除:此事项不允许删除!');
+        } else {
+          const id = row.id || this.id;
+          this.$modal.confirm('是否确认删除此事项?').then(function() {
+            return delDept(id);
+          }).then(() => {
+            this.getList();
+            this.$modal.msgSuccess("删除成功");
+          }).catch(() => {
+          });
+        }
+      }
+    }
+  };
+</script>

+ 348 - 0
src/views/my/announcement.vue

@@ -0,0 +1,348 @@
+<template>
+  <div class="app-container">
+    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
+      <el-form-item label="公告标题" prop="announcementTitle">
+        <el-input
+          v-model="queryParams.announcementTitle"
+          placeholder="请输入公告标题"
+          clearable
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="开始时间" prop="validityStartTime">
+        <el-date-picker clearable
+                        v-model="queryParams.validityStartTime"
+                        type="date"
+                        value-format="yyyy-MM-dd"
+                        placeholder="请选择开始时间">
+        </el-date-picker>
+      </el-form-item>
+      <el-form-item label="结束时间" prop="validityEndTime">
+        <el-date-picker clearable
+                        v-model="queryParams.validityEndTime"
+                        type="date"
+                        value-format="yyyy-MM-dd"
+                        placeholder="请选择结束时间">
+        </el-date-picker>
+      </el-form-item>
+      <el-form-item>
+        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
+        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
+      </el-form-item>
+    </el-form>
+
+    <el-row :gutter="10" class="mb8">
+      <el-col :span="1.5">
+        <el-button
+          type="primary"
+          plain
+          icon="el-icon-plus"
+          size="mini"
+          @click="handleAdd"
+          v-hasPermi="['system:announcement:add']"
+        >新增
+        </el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="success"
+          plain
+          icon="el-icon-edit"
+          size="mini"
+          :disabled="single"
+          @click="handleUpdate"
+          v-hasPermi="['system:announcement:edit']"
+        >修改
+        </el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="danger"
+          plain
+          icon="el-icon-delete"
+          size="mini"
+          :disabled="multiple"
+          @click="handleDelete"
+          v-hasPermi="['system:announcement:del']"
+        >删除
+        </el-button>
+      </el-col>
+      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
+    </el-row>
+
+    <el-table v-loading="loading" :data="announcementList" @selection-change="handleSelectionChange">
+      <el-table-column type="selection" width="55" align="center"/>
+<!--      <el-table-column label="数据id" align="center" prop="id"/>-->
+      <el-table-column label="公告标题" align="center" prop="announcementTitle"/>
+<!--      <el-table-column label="公告内容" align="center" prop="announcementBody"/>-->
+      <el-table-column label="公告有效期开始时间" align="center" prop="validityStartTime">
+        <template slot-scope="scope">
+          <span>{{ parseTime(scope.row.validityStartTime, '{y}-{m}-{d}') }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="公告有效期结束时间" align="center" prop="validityEndTime">
+        <template slot-scope="scope">
+          <span>{{ parseTime(scope.row.validityEndTime, '{y}-{m}-{d}') }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="公告图片" align="center" prop="announcementImg">
+        <template slot-scope="scope">
+          <image-preview :src="scope.row.announcementImg" :width="50" :height="50"/>
+        </template>
+      </el-table-column>
+<!--      <el-table-column label="所属人员id" align="center" prop="userId"/>-->
+      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
+        <template slot-scope="scope">
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-edit"
+            @click="handleUpdate(scope.row)"
+            v-hasPermi="['system:announcement:edit']"
+          >修改
+          </el-button>
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-delete"
+            @click="handleDelete(scope.row)"
+            v-hasPermi="['system:announcement:del']"
+          >删除
+          </el-button>
+        </template>
+      </el-table-column>
+    </el-table>
+
+    <pagination
+      v-show="total>0"
+      :total="total"
+      :page.sync="queryParams.pageNum"
+      :limit.sync="queryParams.pageSize"
+      @pagination="getList"
+    />
+
+    <!-- 添加或修改公告对话框 -->
+    <el-dialog :title="title" :visible.sync="open" width="665px" append-to-body>
+      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
+        <el-row>
+          <el-form-item label="公告标题" prop="announcementTitle">
+            <el-input v-model="form.announcementTitle" placeholder="请输入公告标题"/>
+          </el-form-item>
+        </el-row>
+        <el-row :gutter="24">
+          <el-col :span="12">
+            <el-form-item label="开始时间" prop="validityStartTime">
+              <el-date-picker clearable
+                              v-model="form.validityStartTime"
+                              type="date"
+                              value-format="yyyy-MM-dd"
+                              placeholder="请选择开始时间">
+              </el-date-picker>
+            </el-form-item>
+          </el-col>
+          <el-col :span="12">
+            <el-form-item label="结束时间" prop="validityEndTime">
+              <el-date-picker clearable
+                              v-model="form.validityEndTime"
+                              type="date"
+                              value-format="yyyy-MM-dd"
+                              placeholder="请选择结束时间">
+              </el-date-picker>
+            </el-form-item>
+          </el-col>
+        </el-row>
+
+        <el-form-item label="公告内容">
+          <editor v-model="form.announcementBody" :min-height="192"/>
+        </el-form-item>
+
+        <el-form-item label="公告图片" prop="path">
+          <image-upload v-model="form.announcementImg" :limit="1"/>
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="submitForm">确 定</el-button>
+        <el-button @click="cancel">取 消</el-button>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import {
+  listAnnouncement,
+  getAnnouncement,
+  delAnnouncement,
+  addAnnouncement,
+  updateAnnouncement
+} from "@/api/my/announcement";
+
+export default {
+  name: "Announcement",
+  data() {
+    return {
+      // 遮罩层
+      loading: true,
+      // 选中数组
+      ids: [],
+      // 非单个禁用
+      single: true,
+      // 非多个禁用
+      multiple: true,
+      // 显示搜索条件
+      showSearch: true,
+      // 总条数
+      total: 0,
+      // 公告表格数据
+      announcementList: [],
+      // 弹出层标题
+      title: "",
+      // 是否显示弹出层
+      open: false,
+      // 所属人员id时间范围
+      daterangeValidityStartTime: [],
+      // 查询参数
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        id: null,
+        announcementTitle: null,
+        announcementBody: null,
+        validityStartTime: null,
+        validityEndTime: null,
+        announcementImg: null,
+        userId: null,
+      },
+      // 表单参数
+      form: {
+        announcementTitle: '',
+        announcementBody: '',
+        validityStartTime: '',
+        validityEndTime: ''
+      },
+      // 表单校验
+      rules: {
+        announcementTitle: [
+          {required: true, message: "公告标题不能为空", trigger: "blur"}
+        ],
+        announcementBody: [
+          {required: true, message: "公告内容不能为空", trigger: "blur"}
+        ],
+        validityStartTime: [
+          {required: true, message: "开始时间不能为空", trigger: "blur"}
+        ],
+        validityEndTime: [
+          {required: true, message: "结束时间不能为空", trigger: "blur"}
+        ],
+      }
+    };
+  },
+  created() {
+    this.getList();
+  },
+  methods: {
+    /** 查询公告列表 */
+    getList() {
+      this.loading = true;
+      this.queryParams.params = {};
+      listAnnouncement(this.queryParams).then(response => {
+        this.announcementList = response.rows;
+        this.total = response.total;
+        this.loading = false;
+      });
+    },
+    // 取消按钮
+    cancel() {
+      this.open = false;
+      this.reset();
+    },
+    // 表单重置
+    reset() {
+      this.form = {
+        id: null,
+        announcementTitle: null,
+        announcementBody: null,
+        validityStartTime: null,
+        validityEndTime: null,
+        announcementImg: null,
+        userId: null,
+        createBy: null,
+        createTime: null,
+        updateBy: null,
+        updateTime: null
+      };
+      this.resetForm("form");
+    },
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.queryParams.pageNum = 1;
+      this.getList();
+    },
+    /** 重置按钮操作 */
+    resetQuery() {
+      this.daterangeValidityStartTime = [];
+      this.resetForm("queryForm");
+      this.handleQuery();
+    },
+    // 多选框选中数据
+    handleSelectionChange(selection) {
+      this.ids = selection.map(item => item.id)
+      this.single = selection.length !== 1
+      this.multiple = !selection.length
+    },
+    /** 新增按钮操作 */
+    handleAdd() {
+      this.reset();
+      this.open = true;
+      this.title = "添加公告";
+    },
+    /** 修改按钮操作 */
+    handleUpdate(row) {
+      this.reset();
+      const id = row.id || this.ids
+      getAnnouncement(id).then(response => {
+        this.form = response.data;
+        this.open = true;
+        this.title = "修改公告";
+      });
+    },
+    /** 提交按钮 */
+    submitForm() {
+      this.$refs["form"].validate(valid => {
+        if (valid) {
+          if (this.form.id != null) {
+            updateAnnouncement(this.form).then(response => {
+              this.$modal.msgSuccess("修改成功");
+              this.open = false;
+              this.getList();
+            });
+          } else {
+            addAnnouncement(this.form).then(response => {
+              this.$modal.msgSuccess("新增成功");
+              this.open = false;
+              this.getList();
+            });
+          }
+        }
+      });
+    },
+    /** 删除按钮操作 */
+    handleDelete(row) {
+      const ids = row.id || this.ids;
+      this.$modal.confirm('是否确认删除公告编号为"' + ids + '"的数据项?').then(function () {
+        return delAnnouncement(ids);
+      }).then(() => {
+        this.getList();
+        this.$modal.msgSuccess("删除成功");
+      }).catch(() => {
+      });
+    },
+    /** 导出按钮操作 */
+    handleExport() {
+      this.download('my/announcement/export', {
+        ...this.queryParams
+      }, `announcement_${new Date().getTime()}.xlsx`)
+    }
+  }
+};
+</script>