Browse Source

找回代码

bihuisong 3 tháng trước cách đây
mục cha
commit
79b98c6e7a

+ 1 - 0
src/main/java/com/ruoyi/system/service/impl/CenterdataTDailyServiceImpl.java

@@ -58,6 +58,7 @@ public class CenterdataTDailyServiceImpl extends BaseServiceImpl implements ICen
     public int insertCenterdataTDaily(CenterdataTDaily centerdataTDaily) {
         centerdataTDaily.setId(IdUtils.simpleUUID());
         centerdataTDaily.setCreateBy(SecurityUtils.getUserId().toString());
+        centerdataTDaily.setCreateName(SecurityUtils.getUsername());
         centerdataTDaily.setCreateTime(DateUtils.getNowDate());
         return centerdataTDailyMapper.insertCenterdataTDaily(centerdataTDaily);
     }

+ 2 - 0
src/main/resources/mapper/data/CenterdataTDailyMapper.xml

@@ -61,6 +61,7 @@
             <if test="id != null">id,</if>
             <if test="createBy != null">create_by,</if>
             <if test="createTime != null">create_time,</if>
+            <if test="createName != null">create_name,</if>
             <if test="updateBy != null">update_by,</if>
             <if test="updateTime != null">update_time,</if>
             <if test="dataStatus != null">data_status,</if>
@@ -77,6 +78,7 @@
             <if test="id != null">#{id},</if>
             <if test="createBy != null">#{createBy},</if>
             <if test="createTime != null">#{createTime},</if>
+            <if test="createName != null">#{createName},</if>
             <if test="updateBy != null">#{updateBy},</if>
             <if test="updateTime != null">#{updateTime},</if>
             <if test="dataStatus != null">#{dataStatus},</if>

+ 431 - 0
system_ui/src/views/data/communication/index.vue

@@ -0,0 +1,431 @@
+<template>
+  <div class="app-container">
+    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch"  @submit.native.prevent>
+      <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="mobile">
+        <el-input
+          v-model="queryParams.mobile"
+          placeholder="请输入手机"
+          clearable
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item prop="deptId">
+        <template slot="label">
+          <span @click="changeQueryType" v-if="queryParams.deptName == 0">本级及下级</span>
+          <span @click="changeQueryType" v-if="queryParams.deptName == 1">只查询本级</span>
+        </template>
+        <treeselect v-model="queryParams.deptId" :options="deptOptions" multiple:false :show-count="true"
+                    placeholder="请选择部门" @select="hx" :noResultsText="'空'" :noOptionsText="'空'" style="width: 240px"/>
+        <el-input v-model="queryParams.deptName" v-if="false"/>
+      </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="['communication:communication: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="['communication:communication: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="['communication:communication:remove']"
+        >删除
+        </el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="warning"
+          plain
+          icon="el-icon-download"
+          size="mini"
+          @click="handleExport"
+          v-hasPermi="['communication:communication:export']"
+        >导出
+        </el-button>
+      </el-col>
+      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
+    </el-row>
+
+    <el-table v-loading="loading" :data="communicationList" @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="createName" />
+       <el-table-column label="更新人姓名" align="center" prop="updateName" />
+       <el-table-column label="数据状态(1-可用 2-不可用 )" align="center" prop="dataStatus" />
+       <el-table-column label="数据所属部门(政或党的id)" align="center" prop="dataDeptId" />-->
+      <el-table-column label="姓名" align="center" prop="name"/>
+      <!--<el-table-column label="性别" align="center" prop="sex"/>-->
+      <el-table-column label="电话" align="center" prop="phone"/>
+      <el-table-column label="手机" align="center" prop="mobile"/>
+      <el-table-column label="地址" align="center" prop="address"/>
+      <el-table-column label="拼音首字母" align="center" prop="firstLetter"/>
+      <el-table-column label="拼音全拼" align="center" prop="pinyin"/>
+      <el-table-column label="所属部门" align="center" prop="deptName"/>
+      <el-table-column label="发布状态" align="center" prop="varieties">
+        <template slot-scope="scope">
+          <dict-tag :options="dict.type.centerdata_release_status" :value="scope.row.releaseStatus"/>
+        </template>
+      </el-table-column>
+      <el-table-column label="创建人" align="center" prop="createName"/>
+      <el-table-column label="创建时间" align="center" prop="createTime"/>
+      <el-table-column label="修改人" align="center" prop="updateName"/>
+      <el-table-column label="修改时间" align="center" prop="updateTime"/>
+      <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="['communication:communication:edit']"
+          >修改
+          </el-button>
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-delete"
+            @click="handleDelete(scope.row)"
+            v-hasPermi="['communication:communication:remove']"
+          >删除
+          </el-button>
+          <el-button v-if="scope.row.releaseStatus == 'centerdata_release_status_yes'" size="mini" type="text" icon="el-icon-refresh-left" @click="handlePublish(scope.row)" v-hasPermi="['system:reserve:edit']">
+            撤销
+          </el-button>
+          <el-button v-else-if="scope.row.releaseStatus == 'centerdata_release_status_no'" size="mini" type="text" icon="el-icon-upload" @click="handlePublish(scope.row)" v-hasPermi="['system:reserve:edit']">
+            发布
+          </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="800px" class="form-style">
+      <el-form ref="form" :model="form" :rules="rules" label-width="100px">
+        <el-row>
+          <el-col :span="12">
+            <!-- <el-form-item label="所属部门" prop="deptId">
+               <deptselector :setValue=setDataDeptId :dataDeptId="form.deptId" :disabled="true"></deptselector>
+             </el-form-item>-->
+            <!--<el-form-item label="所属部门" prop="deptId">
+              <treeselect v-model="form.deptId" :options="deptOptions" multiple:false :show-count="true"
+                          placeholder="请选择部门" @select="hx"/>
+            </el-form-item>-->
+            <el-form-item label="所属部门" prop="deptId">
+              <treeselect v-model="form.deptId" :options="deptOptions" multiple:false :show-count="true"
+                          placeholder="请选择部门" @select="hx" :noResultsText="'空'" :noOptionsText="'空'"/>
+            </el-form-item>
+            <el-form-item label="手机" prop="mobile">
+              <el-input v-model="form.mobile" placeholder="请输入手机"  maxlength="13"/>
+            </el-form-item>
+            <el-form-item label="地址" prop="address">
+              <el-input v-model="form.address" placeholder="请输入地址" maxlength="50"/>
+            </el-form-item>
+            <el-form-item label="拼音全拼" prop="pinyin">
+              <el-input v-model="form.pinyin" placeholder="请输入拼音全拼" maxlength="40"/>
+            </el-form-item>
+          </el-col>
+
+          <el-col :span="12">
+            <el-form-item label="姓名" prop="name">
+              <el-input v-model="form.name" placeholder="请输入姓名" maxlength="20"/>
+            </el-form-item>
+            <el-form-item label="电话" prop="phone">
+              <el-input v-model="form.phone" placeholder="请输入电话"   maxlength="13"/>
+            </el-form-item>
+            <el-form-item label="拼音首字母" prop="firstLetter">
+              <el-input v-model="form.firstLetter" placeholder="请输入拼音首字母" maxlength="10"/>
+            </el-form-item>
+          </el-col>
+        </el-row>
+      </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 {
+  addCommunication,
+  delCommunication,
+  getCommunication,
+  listCommunication,
+  updateCommunication,
+  updateRelease
+} from "@/api/data/communication/communication";
+import deptselector from '@/views/components/deptselector.vue'
+import {englishOnly, validPhoneMobile} from "@/api/rules/rules";
+import {treeselect} from "@/api/system/dept";
+import Treeselect from "@riophae/vue-treeselect";
+import "@riophae/vue-treeselect/dist/vue-treeselect.css";
+
+export default {
+  name: "Communication",
+  components: {deptselector,Treeselect},
+  dicts: ["centerdata_release_status"],
+  data() {
+    return {
+      deptOptions: [],
+      // 遮罩层
+      loading: true,
+      // 选中数组
+      ids: [],
+      // 非单个禁用
+      single: true,
+      // 非多个禁用
+      multiple: true,
+      // 显示搜索条件
+      showSearch: true,
+      // 总条数
+      total: 0,
+      // 通讯录表格数据
+      communicationList: [],
+      // 弹出层标题
+      title: "",
+      // 是否显示弹出层
+      open: false,
+      // 查询参数
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        createName: null,
+        updateName: null,
+        dataStatus: null,
+        dataDeptId: null,
+        releaseStatus: null,
+        name: null,
+        sex: null,
+        phone: null,
+        deptId: null,
+        deptName: 0,
+        mobile: null,
+        address: null,
+        firstLetter: null,
+        pinyin: null
+      },
+      // 表单参数
+      form: {},
+      // 表单校验
+      rules: {
+        deptId: [
+          {required: true, message: '所属部门不能为空', trigger: 'change'},
+        ],
+        name: [
+          {required: true, message: "姓名不能为空", trigger: "blur"}
+        ],
+        phone: [
+          {validator: validPhoneMobile, trigger: 'blur'}
+        ],
+        mobile: [
+          {required: true, message: "手机不能为空", trigger: "change"},
+          {validator: validPhoneMobile, trigger: 'blur'}
+        ],
+        pinyin: [
+          {validator: englishOnly, trigger: 'blur'}
+        ],
+        firstLetter: [
+          {validator: englishOnly, trigger: 'blur'}
+        ]
+      }
+    };
+  },
+  created() {
+    this.getList();
+    this.getTreeselect();
+  },
+  methods: {
+    /** 查询部门下拉树结构 */
+    getTreeselect() {
+      treeselect().then(response => {
+        this.deptOptions = response.data
+      })
+    },
+    hx(node) {
+
+      this.form.deptId = node.id
+      this.form.deptName = node.label
+    },
+    setDataDeptId(e) {
+      this.form.deptId = e.deptId
+      this.form.deptName = e.deptName
+    },
+    /** 查询通讯录列表 */
+    getList() {
+      this.loading = true;
+      listCommunication(this.queryParams).then(response => {
+        this.communicationList = response.rows;
+        this.total = response.total;
+        this.loading = false;
+      });
+    },
+    // 取消按钮
+    cancel() {
+      this.open = false;
+      this.reset();
+    },
+    // 表单重置
+    reset() {
+      this.form = {
+        id: null,
+        createBy: null,
+        createName: null,
+        createTime: null,
+        updateBy: null,
+        updateName: null,
+        updateTime: null,
+        dataStatus: "0",
+        deptId: null,
+        deptName: null,
+        name: null,
+        sex: null,
+        phone: null,
+        mobile: null,
+        address: null,
+        firstLetter: null,
+        pinyin: null
+      };
+      this.resetForm("form");
+    },
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.queryParams.pageNum = 1;
+      this.getList();
+    },
+    /** 重置按钮操作 */
+    resetQuery() {
+      this.queryParams.deptName = 0;
+      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
+      getCommunication(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) {
+            updateCommunication(this.form).then(response => {
+              this.$modal.msgSuccess("修改成功");
+              this.open = false;
+              this.getList();
+            });
+          } else {
+            this.form.releaseStatus = "centerdata_release_status_no";
+            addCommunication(this.form).then(response => {
+              this.$modal.msgSuccess("新增成功");
+              this.open = false;
+              this.getList();
+            });
+          }
+        }
+      });
+    },
+    /** 删除按钮操作 */
+    handleDelete(row) {
+      const ids = row.id || this.ids;
+      this.$modal.confirm('是否删除选中的数据?').then(function () {
+        return delCommunication(ids);
+      }).then(() => {
+        this.getList();
+        this.$modal.msgSuccess("删除成功");
+      }).catch(() => {
+      });
+    },
+    handlePublish(row){
+      let ids = row.id || this.ids;
+      let status = "发布", releaseStatus = "centerdata_release_status_yes";
+      if(!ids.includes(",")) {
+        ids = [ids];
+        if (row.releaseStatus.includes("centerdata_release_status_yes")) {
+          status = "撤销";
+          releaseStatus = "centerdata_release_status_no";
+        }
+        this.$modal.confirm('是否' + status + '选中的数据?').then(function () {
+          return updateRelease(ids, releaseStatus);
+        }).then(() => {
+          this.getList();
+          this.$modal.msgSuccess(status + "成功");
+        }).catch((e) => {
+          console.log(e)
+        });
+      }
+    },
+    /** 导出按钮操作 */
+    handleExport() {
+      this.download('sooka-sponest-center-data/communication/export', {
+        ...this.queryParams
+      }, `通讯录_${new Date().getTime()}.xlsx`)
+    },
+    // 点击按钮修改是否只查询本级部门用户
+    changeQueryType() {
+      this.queryParams.deptName = this.queryParams.deptName == 0 ? 1 : 0;
+    }
+  }
+};
+</script>

+ 326 - 0
system_ui/src/views/data/daily/index.vue

@@ -0,0 +1,326 @@
+<template>
+  <div class="app-container">
+    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" l @submit.native.prevent>
+      <el-form-item label="日报时间" prop="dailyTime">
+        <el-date-picker clearable v-model="queryParams.dailyTime" type="date" value-format="yyyy-MM-dd" placeholder="请选择日报时间"></el-date-picker>
+      </el-form-item>
+      <el-form-item label="日报标题" prop="dailyTitle">
+        <el-input v-model="queryParams.dailyTitle" placeholder="请输入日报标题" clearable @keyup.enter.native="handleQuery" />
+      </el-form-item>
+      <el-form-item prop="deptId">
+        <template slot="label">
+          <span @click="changeQueryType" v-if="queryParams.deptName === 0">本级及下级</span>
+          <span @click="changeQueryType" v-if="queryParams.deptName === 1">只查询本级</span>
+        </template>
+        <treeselect v-model="queryParams.deptId" :options="deptOptions" multiple:false :show-count="true"
+                    placeholder="请选择部门" @select="hx" :noResultsText="'空'" :noOptionsText="'空'" style="width: 240px"/>
+      </el-form-item>
+      <!--<el-form-item label="部门名称" prop="deptName">
+        <el-input
+          v-model="queryParams.deptName"
+          placeholder="请输入部门名称"
+          clearable
+          @keyup.enter.native="handleQuery"
+        />
+      </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:daily: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:daily: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:daily:remove']"
+        >删除</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="warning"
+          plain
+          icon="el-icon-download"
+          size="mini"
+          @click="handleExport"
+          v-hasPermi="['system:daily:export']"
+        >导出</el-button>
+      </el-col>
+      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
+    </el-row>
+
+    <el-table v-loading="loading" :data="dailyList" @selection-change="handleSelectionChange">
+      <el-table-column type="selection" width="55" align="center" />
+      <!--<el-table-column label="日报类型(字典)" align="center" prop="dailyType" />-->
+      <el-table-column label="日报时间" align="center" prop="dailyTime" width="180">
+        <template slot-scope="scope">
+          <span>{{ parseTime(scope.row.dailyTime, '{y}-{m}-{d}') }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="日报标题" align="center" prop="dailyTitle" />
+      <el-table-column label="日报内容" align="center" prop="dailyContent" />
+      <el-table-column label="所属部门" align="center" prop="deptName" />
+      <el-table-column label="创建人" align="center" prop="createName" />
+      <el-table-column label="审计状态" align="center" prop="status" >
+        <template slot-scope="scope">
+          <span>{{ scope.row.status === '0' ? "未审计":"已审计"}}</span>
+        </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)"
+            v-hasPermi="['system:daily:edit']"
+          >修改</el-button>
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-delete"
+            @click="handleDelete(scope.row)"
+            v-hasPermi="['system:daily:remove']"
+          >删除</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="dailyTime">
+          <el-date-picker clearable v-model="form.dailyTime" type="date" value-format="yyyy-MM-dd" placeholder="请选择日报时间"></el-date-picker>
+        </el-form-item>
+        <el-form-item label="日报标题" prop="dailyTitle"><el-input v-model="form.dailyTitle" placeholder="请输入日报标题" maxlength="50" /></el-form-item>
+        <el-form-item label="日报内容"><editor v-model="form.dailyContent" :min-height="192" maxlength="2000" /></el-form-item>
+        <el-form-item label="所属部门" prop="deptName">
+          <treeselect v-model="form.deptId" :options="deptOptions" multiple:false :show-count="true"
+                      placeholder="请选择部门" @select="hx" :noResultsText="'空'" :noOptionsText="'空'" style="width: 240px"/>
+        </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 { listDaily, getDaily, delDaily, addDaily, updateDaily } from '@/api/data/daily/daily';
+import {treeselect} from "@/api/system/dept";
+import Treeselect from "@riophae/vue-treeselect";
+import "@riophae/vue-treeselect/dist/vue-treeselect.css";
+import deptselector from '@/views/components/deptselector.vue'
+import fileUpload from '@/views/components/FileUpload/index.vue'
+
+export default {
+  components:{
+    Treeselect,
+    deptselector,
+    fileUpload
+  },
+  name: 'Daily',
+  data() {
+    return {
+      // 遮罩层
+      loading: true,
+      // 选中数组
+      ids: [],
+      // 非单个禁用
+      single: true,
+      // 非多个禁用
+      multiple: true,
+      // 显示搜索条件
+      showSearch: true,
+      // 总条数
+      total: 0,
+      // 日报表格数据
+      dailyList: [],
+      // 弹出层标题
+      title: '',
+      // 是否显示弹出层
+      open: false,
+      // 部门树选项
+      deptOptions: [],
+      // 查询参数
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        dataStatus: null,
+        dataDeptId: null,
+        dailyType: null,
+        dailyTime: null,
+        dailyTitle: null,
+        dailyContent: null,
+        deptId: null,
+        deptName: 0,
+        createName:null
+      },
+      // 表单参数
+      form: {},
+      // 表单校验
+      rules: {}
+    };
+  },
+  created() {
+    this.getList();
+    this.getTreeselect();
+  },
+  methods: {
+    hx(node) {
+      this.form.deptId = node.id
+      this.form.deptName = node.label
+    },
+    /** 查询部门下拉树结构 */
+    getTreeselect() {
+      treeselect().then(response => {
+        this.deptOptions = response.data;
+      });
+    },
+    /** 查询日报列表 */
+    getList() {
+      this.loading = true;
+      listDaily(this.queryParams).then(response => {
+        this.dailyList = response.rows;
+        this.total = response.total;
+        this.loading = false;
+      });
+    },
+    // 取消按钮
+    cancel() {
+      this.open = false;
+      this.reset();
+    },
+    // 表单重置
+    reset() {
+      this.form = {
+        id: null,
+        createBy: null,
+        createTime: null,
+        updateBy: null,
+        updateTime: null,
+        dataStatus: '0',
+        dataDeptId: null,
+        dailyType: null,
+        dailyTime: null,
+        dailyTitle: null,
+        dailyContent: null,
+        deptId: null,
+        deptName: null
+      };
+      this.resetForm('form');
+    },
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.queryParams.pageNum = 1;
+      this.getList();
+    },
+    /** 重置按钮操作 */
+    resetQuery() {
+      this.queryParams.deptName = 0;
+      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;
+      getDaily(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) {
+            updateDaily(this.form).then(response => {
+              this.$modal.msgSuccess('修改成功');
+              this.open = false;
+              this.getList();
+            });
+          } else {
+            addDaily(this.form).then(response => {
+              this.$modal.msgSuccess('新增成功');
+              this.open = false;
+              this.getList();
+            });
+          }
+        }
+      });
+    },
+    /** 删除按钮操作 */
+    handleDelete(row) {
+      const ids = row.id || this.ids;
+      this.$modal
+        .confirm('是否确认删除数据项?')
+        .then(function() {
+          return delDaily(ids);
+        })
+        .then(() => {
+          this.getList();
+          this.$modal.msgSuccess('删除成功');
+        })
+        .catch(() => {});
+    },
+    /** 导出按钮操作 */
+    handleExport() {
+      this.download(
+        'system/daily/export',
+        {
+          ...this.queryParams
+        },
+        `daily_${new Date().getTime()}.xlsx`
+      );
+    },
+    // 点击按钮修改是否只查询本级部门用户
+    changeQueryType() {
+      this.queryParams.deptName = this.queryParams.deptName === 0 ? 1 : 0;
+    }
+  }
+};
+</script>

+ 360 - 0
system_ui/src/views/data/daily/index2.vue

@@ -0,0 +1,360 @@
+<template>
+  <div class="app-container">
+    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" l
+             @submit.native.prevent
+    >
+      <el-form-item label="日报时间" prop="dailyTime">
+        <el-date-picker clearable v-model="queryParams.dailyTime" type="date" value-format="yyyy-MM-dd"
+                        placeholder="请选择日报时间"
+        ></el-date-picker>
+      </el-form-item>
+      <el-form-item label="日报标题" prop="dailyTitle">
+        <el-input v-model="queryParams.dailyTitle" placeholder="请输入日报标题" clearable
+                  @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item prop="deptId">
+        <template slot="label">
+          <span @click="changeQueryType" v-if="queryParams.deptName === 0">本级及下级</span>
+          <span @click="changeQueryType" v-if="queryParams.deptName === 1">只查询本级</span>
+        </template>
+        <treeselect v-model="queryParams.deptId" :options="deptOptions" multiple:false :show-count="true"
+                    placeholder="请选择部门" @select="hx" :noResultsText="'空'" :noOptionsText="'空'"
+                    style="width: 240px"
+        />
+        <el-input v-model="queryParams.deptName" v-if="false"/>
+      </el-form-item>
+      <!--<el-form-item label="部门名称" prop="deptName">
+        <el-input
+          v-model="queryParams.deptName"
+          placeholder="请输入部门名称"
+          clearable
+          @keyup.enter.native="handleQuery"
+        />
+      </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:daily: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:daily: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:daily:remove']"-->
+    <!--        >删除</el-button>-->
+    <!--      </el-col>-->
+    <!--      <el-col :span="1.5">-->
+    <!--        <el-button-->
+    <!--          type="warning"-->
+    <!--          plain-->
+    <!--          icon="el-icon-download"-->
+    <!--          size="mini"-->
+    <!--          @click="handleExport"-->
+    <!--          v-hasPermi="['system:daily:export']"-->
+    <!--        >导出</el-button>-->
+    <!--      </el-col>-->
+    <!--      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>-->
+    <!--    </el-row>-->
+
+    <el-table v-loading="loading" :data="dailyList" @selection-change="handleSelectionChange">
+      <el-table-column type="selection" width="55" align="center"/>
+      <!--<el-table-column label="日报类型(字典)" align="center" prop="dailyType" />-->
+      <el-table-column label="日报时间" align="center" prop="dailyTime" width="180">
+        <template slot-scope="scope">
+          <span>{{ parseTime(scope.row.dailyTime, '{y}-{m}-{d}') }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="日报标题" align="center" prop="dailyTitle"/>
+      <el-table-column label="日报内容" align="center" prop="dailyContent"/>
+      <el-table-column label="所属部门" align="center" prop="deptName"/>
+      <el-table-column label="创建人" align="center" prop="createName"/>
+      <el-table-column label="审计状态" align="center" prop="status">
+        <template slot-scope="scope">
+          <span>{{ scope.row.status === '0' ? '未审计' : '已审计' }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
+        <template slot-scope="scope">
+          <el-button
+            :disabled="scope.row.status !== '0'"
+            size="mini"
+            type="text"
+            icon="el-icon-edit"
+            @click="handleUpdate(scope.row)"
+            v-hasPermi="['system:daily:edit']"
+          >审计
+          </el-button>
+          <!--          <el-button-->
+          <!--            size="mini"-->
+          <!--            type="text"-->
+          <!--            icon="el-icon-delete"-->
+          <!--            @click="handleDelete(scope.row)"-->
+          <!--            v-hasPermi="['system:daily:remove']"-->
+          <!--          >删除</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="dailyTime">
+          <el-date-picker clearable v-model="form.dailyTime" type="date" value-format="yyyy-MM-dd"
+                          placeholder="请选择日报时间"
+          ></el-date-picker>
+        </el-form-item>
+        <el-form-item label="日报标题" prop="dailyTitle">
+          <el-input v-model="form.dailyTitle" placeholder="请输入日报标题" maxlength="50"/>
+        </el-form-item>
+        <el-form-item label="日报内容">
+          <editor v-model="form.dailyContent" :min-height="192" maxlength="2000"/>
+        </el-form-item>
+        <el-form-item label="所属部门" prop="deptName">
+          <el-input v-model="form.deptName" placeholder="请输入部门名称" maxlength="50"/>
+        </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 { listDaily, getDaily, delDaily, addDaily, updateDaily } from '@/api/data/daily/daily'
+import { treeselect } from '@/api/system/dept'
+import Treeselect from '@riophae/vue-treeselect'
+import '@riophae/vue-treeselect/dist/vue-treeselect.css'
+import deptselector from '@/views/components/deptselector.vue'
+import fileUpload from '@/views/components/FileUpload/index.vue'
+
+export default {
+  components: {
+    Treeselect,
+    deptselector,
+    fileUpload
+  },
+  name: 'Daily',
+  data() {
+    return {
+      // 遮罩层
+      loading: true,
+      // 选中数组
+      ids: [],
+      // 非单个禁用
+      single: true,
+      // 非多个禁用
+      multiple: true,
+      // 显示搜索条件
+      showSearch: true,
+      // 总条数
+      total: 0,
+      // 日报表格数据
+      dailyList: [],
+      // 弹出层标题
+      title: '',
+      // 是否显示弹出层
+      open: false,
+      // 部门树选项
+      deptOptions: [],
+      // 查询参数
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        dataStatus: null,
+        dataDeptId: null,
+        dailyType: null,
+        dailyTime: null,
+        dailyTitle: null,
+        dailyContent: null,
+        deptId: null,
+        deptName: 0,
+        createName: null
+      },
+      // 表单参数
+      form: {},
+      // 表单校验
+      rules: {}
+    }
+  },
+  created() {
+    this.getList()
+    this.getTreeselect()
+  },
+  methods: {
+    hx(node) {
+      this.form.deptId = node.id
+      this.form.deptName = node.label
+    },
+    /** 查询部门下拉树结构 */
+    getTreeselect() {
+      treeselect().then(response => {
+        this.deptOptions = response.data
+      })
+    },
+    /** 查询日报列表 */
+    getList() {
+      this.loading = true
+      listDaily(this.queryParams).then(response => {
+        this.dailyList = response.rows
+        this.total = response.total
+        this.loading = false
+      })
+    },
+    // 取消按钮
+    cancel() {
+      this.open = false
+      this.reset()
+    },
+    // 表单重置
+    reset() {
+      this.form = {
+        id: null,
+        createBy: null,
+        createTime: null,
+        updateBy: null,
+        updateTime: null,
+        dataStatus: '0',
+        dataDeptId: null,
+        dailyType: null,
+        dailyTime: null,
+        dailyTitle: null,
+        dailyContent: null,
+        deptId: null,
+        deptName: null
+      }
+      this.resetForm('form')
+    },
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.queryParams.pageNum = 1
+      this.getList()
+    },
+    /** 重置按钮操作 */
+    resetQuery() {
+      this.queryParams.deptName = 0
+      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;
+      // getDaily(id).then(response => {
+      //   this.form = response.data;
+      //   this.open = true;
+      //   this.title = '修改日报';
+      // });
+      this.$confirm('是否审计?', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        let data = {
+          id: row.id,
+          status: '1'
+        }
+        updateDaily(data).then(response => {
+          this.$modal.msgSuccess('审计成功')
+          this.open = false
+          this.getList()
+        })
+      })
+    },
+    /** 提交按钮 */
+    submitForm() {
+      this.$refs['form'].validate(valid => {
+        if (valid) {
+          if (this.form.id != null) {
+            updateDaily(this.form).then(response => {
+              this.$modal.msgSuccess('修改成功')
+              this.open = false
+              this.getList()
+            })
+          } else {
+            addDaily(this.form).then(response => {
+              this.$modal.msgSuccess('新增成功')
+              this.open = false
+              this.getList()
+            })
+          }
+        }
+      })
+    },
+    /** 删除按钮操作 */
+    handleDelete(row) {
+      const ids = row.id || this.ids
+      this.$modal
+        .confirm('是否确认删除数据项?')
+        .then(function() {
+          return delDaily(ids)
+        })
+        .then(() => {
+          this.getList()
+          this.$modal.msgSuccess('删除成功')
+        })
+        .catch(() => {
+        })
+    },
+    /** 导出按钮操作 */
+    handleExport() {
+      this.download(
+        'system/daily/export',
+        {
+          ...this.queryParams
+        },
+        `daily_${new Date().getTime()}.xlsx`
+      )
+    },
+    // 点击按钮修改是否只查询本级部门用户
+    changeQueryType() {
+      this.queryParams.deptName = this.queryParams.deptName === 0 ? 1 : 0
+    }
+  }
+}
+</script>

+ 655 - 0
system_ui/src/views/data/leave/index.vue

@@ -0,0 +1,655 @@
+<template>
+  <div class="app-container">
+    <el-form
+      :model="queryParams"
+      ref="queryForm"
+      size="small"
+      :inline="true"
+      v-show="showSearch"
+      @submit.native.prevent
+    >
+      <!--<el-form-item label="数据所属部门(政或党的id)" prop="dataDeptId">-->
+      <!--<el-input-->
+      <!--v-model="queryParams.dataDeptId"-->
+      <!--placeholder="请输入数据所属部门(政或党的id)"-->
+      <!--clearable-->
+      <!--@keyup.enter.native="handleQuery"-->
+      <!--/>-->
+      <!--</el-form-item>-->
+      <!--<el-form-item label="开始时间" prop="leaveStartTime" label-width="120px">-->
+      <!--<el-date-picker clearable-->
+      <!--v-model="queryParams.leaveStartTime"-->
+      <!--type="date"-->
+      <!--value-format="yyyy-MM-dd"-->
+      <!--placeholder="请选择开始时间">-->
+      <!--</el-date-picker>-->
+      <!--</el-form-item>-->
+      <!--<el-form-item label="结束时间" prop="leaveEndTime" label-width="120px">-->
+      <!--<el-date-picker clearable-->
+      <!--v-model="queryParams.leaveEndTime"-->
+      <!--type="date"-->
+      <!--value-format="yyyy-MM-dd"-->
+      <!--placeholder="请选择结束时间">-->
+      <!--</el-date-picker>-->
+      <!--</el-form-item>-->
+      <el-form-item label-width="100px" label="请假人姓名" prop="leaveUserName">
+        <el-input
+          v-model="queryParams.leaveUserName"
+          placeholder="请输入请假人姓名"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item prop="deptId">
+        <template slot="label">
+          <span @click="changeQueryType" v-if="queryParams.deptName == 0">本级及下级</span>
+          <span @click="changeQueryType" v-if="queryParams.deptName == 1">只查询本级</span>
+        </template>
+        <treeselect v-model="queryParams.deptId" :options="deptOptions" multiple:false :show-count="true"
+                    placeholder="请选择部门" @select="hx" :noResultsText="'空'" :noOptionsText="'空'" style="width: 240px"/>
+        <el-input v-model="queryParams.deptName" v-if="false"/>
+      </el-form-item>
+      <!--  <el-form-item label-width="auto" label="所属部门" prop="deptName">
+        <el-input
+          v-model="queryParams.deptName"
+          placeholder="请输入所属部门"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>-->
+      <!--<el-form-item label="请假人事由" prop="leaveMatter">
+        <el-input
+          v-model="queryParams.leaveMatter"
+          placeholder="请输入请假人事由"
+          clearable
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="部门名称" prop="deptId" >
+        <treeselect :options="deptOptions" v-model="queryParams.deptId"  :show-count="true" placeholder="请选择所属部门"
+                    @select="hxQuery"/>
+      </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:leave: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:leave: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:leave:remove']"
+        >删除
+        </el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="warning"
+          plain
+          icon="el-icon-download"
+          size="mini"
+          @click="handleExport"
+          v-hasPermi="['system:leave:export']"
+        >导出
+        </el-button>
+      </el-col>
+      <right-toolbar
+        :showSearch.sync="showSearch"
+        @queryTable="getList"
+      ></right-toolbar>
+    </el-row>
+
+    <el-table
+      v-loading="loading"
+      :data="leaveList"
+      @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="数据状态(1-可用 2-不可用 )" align="center" prop="dataStatus" />-->
+      <!--      <el-table-column label="数据所属部门(政或党的id)" align="center" prop="dataDeptId" />-->
+      <el-table-column
+        label="开始时间"
+        align="center"
+        prop="leaveStartTime"
+        width="180"
+      >
+        <template slot-scope="scope">
+          <span>{{ parseTime(scope.row.leaveStartTime, "{y}-{m}-{d} {h}:{i}:{s}") }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column
+        label="结束时间"
+        align="center"
+        prop="leaveEndTime"
+        width="180"
+      >
+        <template slot-scope="scope">
+          <span>{{ parseTime(scope.row.leaveEndTime, "{y}-{m}-{d} {h}:{i}:{s}") }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="状态" align="center" prop="forestLeaveStatus" >
+        <template slot-scope="scope">
+          <dict-tag
+            :options="dict.type.app_leave"
+            :value="scope.row.forestLeaveStatus"
+          />
+        </template>
+      </el-table-column>
+      <el-table-column label="请假事由" align="center" prop="leaveMatter" />
+      <el-table-column label="所属部门" align="center" prop="deptName" />
+      <el-table-column label="请假人姓名" align="center" prop="leaveUserName" />
+      <el-table-column label="创建人" align="center" prop="createName"/>
+      <el-table-column label="创建时间" align="center" prop="createTime"/>
+      <el-table-column label="修改人" align="center" prop="updateName"/>
+      <el-table-column label="修改时间" align="center" prop="updateTime"/>
+      <el-table-column
+        label="操作"
+        align="center"
+        class-name="small-padding fixed-width"
+      >
+        <template slot-scope="scope">
+          <el-button v-if="scope.row.forestLeaveStatus == 'app_leave_1'"
+                     size="mini"
+                     type="text"
+                     icon="el-icon-edit"
+                     @click="handleUpdate(scope.row)"
+                     v-hasPermi="['system:leave:edit']"
+          >修改
+          </el-button>
+          <el-button v-if="scope.row.forestLeaveStatus == 'app_leave_1'"
+                     size="mini"
+                     type="text"
+                     icon="el-icon-delete"
+                     @click="handleDelete(scope.row)"
+                     v-hasPermi="['system:leave:remove']"
+          >删除
+          </el-button>
+
+          <el-button v-if="scope.row.forestLeaveStatus == 'app_leave_1'"
+                     size="mini"
+                     type="text"
+                     icon="el-icon-edit"
+                     @click="See(scope.row)"
+                     v-hasPermi="['forest:regulations:edit']"
+          >审批
+          </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"
+      label-width="600px"
+      class="form-style"
+    >
+      <el-form ref="form" :model="form" :rules="rules" label-width="120px">
+        <el-row>
+          <el-col :span="24">
+            <el-form-item label="申请人" prop="leaveUserName" class="form-style">
+              <el-select
+                v-model="form.leaveUserName"
+                filterable
+                placeholder="请选择申请人"
+              >
+                <el-option
+                  v-for="dict in userList"
+                  :key="dict.userId"
+                  :label="dict.nickName"
+                  :value="String(dict.userId)"
+                  @click.native="a(dict)"
+                ></el-option>
+              </el-select>
+            </el-form-item>
+            <el-form-item label="所属部门" prop="deptId">
+              <treeselect
+                :options="deptOptions"
+                v-model="form.deptId"
+                :show-count="true"
+                placeholder="请选择所属部门"
+                @select="hx"
+                :noResultsText="'空'"
+                :noOptionsText="'空'"
+              />
+            </el-form-item>
+            <el-form-item
+              label="开始时间"
+              prop="leaveStartTime"
+              label-width="120px"
+            >
+              <el-date-picker
+                clearable
+                v-model="form.leaveStartTime"
+                type="datetime"
+                :picker-options="pickerOptionsStart"
+                value-format="yyyy-MM-dd HH:mm:ss"
+                placeholder="请选择开始时间"
+              >
+              </el-date-picker>
+            </el-form-item>
+            <el-form-item
+              label="结束时间"
+              prop="leaveEndTime"
+              label-width="120px"
+            >
+              <el-date-picker
+                clearable
+                v-model="form.leaveEndTime"
+                type="datetime"
+                :picker-options="pickerOptionsEnd"
+                value-format="yyyy-MM-dd HH:mm:ss"
+                placeholder="请选择结束时间"
+              >
+              </el-date-picker>
+            </el-form-item>
+            <el-form-item
+              label="请假事由"
+              prop="leaveMatter"
+              label-width="120px"
+            >
+              <el-input
+                v-model="form.leaveMatter"
+                type="textarea"
+                placeholder="请输入内容"
+                maxlength="100"
+              />
+            </el-form-item>
+          </el-col>
+        </el-row>
+      </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="title"-->
+    <!--      :visible.sync="seeopen"-->
+    <!--      width="600px"-->
+    <!--      class="form-style"-->
+    <!--    >-->
+    <!--      <el-form ref="form" :model="form" :rules="rules" label-width="120px">-->
+    <!--        <el-form-item-->
+    <!--          label="开始时间"-->
+    <!--          prop="leaveStartTime"-->
+    <!--          label-width="120px"-->
+    <!--        >-->
+    <!--          <el-date-picker-->
+    <!--            clearable-->
+    <!--            :disabled="true"-->
+    <!--            v-model="form.leaveStartTime"-->
+    <!--            type="datetime"-->
+    <!--            value-format="yyyy-MM-dd HH:mm:ss"-->
+    <!--            placeholder="请选择开始时间"-->
+    <!--          >-->
+    <!--          </el-date-picker>-->
+    <!--        </el-form-item>-->
+    <!--        <el-form-item label="结束时间" prop="leaveEndTime" label-width="120px">-->
+    <!--          <el-date-picker-->
+    <!--            clearable-->
+    <!--            :disabled="true"-->
+    <!--            v-model="form.leaveEndTime"-->
+    <!--            type="datetime"-->
+    <!--            value-format="yyyy-MM-dd HH:mm:ss"-->
+    <!--            placeholder="请选择结束时间"-->
+    <!--          >-->
+    <!--          </el-date-picker>-->
+    <!--        </el-form-item>-->
+    <!--        &lt;!&ndash;        <el-form-item label="请假事由" prop="leaveMatter">-->
+    <!--          <el-input v-model="form.leaveMatter" placeholder="请输入请假人事由" :disabled="true" maxlength="50"/>-->
+    <!--        </el-form-item>&ndash;&gt;-->
+    <!--        <el-form-item label="请假事由" prop="leaveMatter" label-width="120px">-->
+    <!--          <el-input-->
+    <!--            v-model="form.leaveMatter"-->
+    <!--            type="textarea"-->
+    <!--            placeholder="请输入内容"-->
+    <!--            maxlength="100"-->
+    <!--          />-->
+    <!--        </el-form-item>-->
+    <!--        <el-form-item label="所属部门" prop="deptId">-->
+    <!--          <treeselect-->
+    <!--            :options="deptOptions"-->
+    <!--            v-model="form.deptId"-->
+    <!--            :show-count="true"-->
+    <!--            placeholder="请选择所属部门"-->
+    <!--            @select="hx"-->
+    <!--            :disabled="true"-->
+    <!--          />-->
+    <!--        </el-form-item>-->
+    <!--        <el-form-item label="请假人姓名" prop="leaveUserName">-->
+    <!--          <el-input-->
+    <!--            v-model="form.leaveUserName"-->
+    <!--            placeholder="请输入请假人姓名"-->
+    <!--            maxlength="20"-->
+    <!--            :disabled="true"-->
+    <!--          />-->
+    <!--        </el-form-item>-->
+    <!--      </el-form>-->
+    <!--      <div slot="footer" class="dialog-footer">-->
+    <!--        <el-button type="primary" @click="agreeSel">同意</el-button>-->
+    <!--        <el-button @click="cancelSel">拒绝</el-button>-->
+    <!--      </div>-->
+    <!--    </el-dialog>-->
+  </div>
+</template>
+
+<script>
+import {
+  addLeave,
+  delLeave,
+  getLeave,
+  listLeave,
+  updateLeave,
+  changeStatus,
+} from "@/api/data/leave/leave";
+import { treeselect } from "@/api/system/dept";
+import Treeselect from "@riophae/vue-treeselect";
+import "@riophae/vue-treeselect/dist/vue-treeselect.css";
+import { selectUserList } from "@/api/data/leave/linleader";
+
+export default {
+  name: "Leave",
+  components: { Treeselect },
+  dicts: ["app_leave"],
+  data() {
+    return {
+      // 遮罩层
+      loading: true,
+      // 选中数组
+      ids: [],
+      userList: [],
+      // 非单个禁用
+      single: true,
+      // 非多个禁用
+      multiple: true,
+      // 显示搜索条件
+      showSearch: true,
+      // 总条数
+      total: 0,
+      // 请假表格数据
+      leaveList: [],
+      // 弹出层标题
+      title: "",
+      // 是否显示弹出层
+      open: false,
+      seeopen: false,
+      // 部门树选项
+      deptOptions: [],
+      // 查询参数
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        dataStatus: null,
+        dataDeptId: null,
+        leaveStartTime: null,
+        leaveEndTime: null,
+        forestLeaveStatus: null,
+        leaveMatter: null,
+        deptId: null,
+        deptName: 0,
+        leaveUserId: null,
+        leaveUserName: null,
+        id:null
+      },
+      // 表单参数
+      form: {},
+      // 表单校验
+      rules: {
+        leaveStartTime: [
+          { required: true, message: "开始时间不能为空", trigger: "blur" },
+        ],
+        leaveEndTime: [
+          { required: true, message: "结束时间不能为空", trigger: "blur" },
+        ],
+        deptId: [
+          { required: true, message: "所属部门不能为空", trigger: "change" },
+        ],
+        leaveUserName: [
+          { required: true, message: "申请人姓名不能为空", trigger: "blur" },
+        ],
+      },
+      pickerOptionsStart: {
+        disabledDate: (time) => {
+          if (this.form.leaveEndTime) {
+            return time.getTime() > new Date(this.form.leaveEndTime).getTime();
+          }
+        },
+      },
+      pickerOptionsEnd: {
+        disabledDate: (time) => {
+          return (
+            time.getTime() <
+            new Date(this.form.leaveStartTime).getTime() -
+            1 * 24 * 60 * 60 * 1000
+          );
+        },
+      },
+    };
+  },
+  created() {
+    this.queryParams.type = this.$route.query.type;
+    this.getList();
+    this.getTreeselect();
+    selectUserList().then((response) => {
+      this.userList = response.data;
+    });
+  },
+  methods: {
+    a(event) {
+      this.form.leaveUserName = event.nickName;
+      this.form.leaveUserId = event.userId;
+    },
+    /** 查询请假列表 */
+    getList() {
+      this.loading = true;
+      listLeave(this.queryParams).then((response) => {
+        this.leaveList = response.rows;
+        this.total = response.total;
+        this.loading = false;
+      });
+    },
+    // 取消按钮
+    cancel() {
+      this.open = false;
+      this.reset();
+    },
+    // 拒绝按钮
+    cancelSel() {
+      this.seeopen = false;
+      this.reset();
+    },
+
+    hx(node) {
+      this.form.deptId = node.id;
+      this.form.deptName = node.label;
+      this.$refs.form.validate();
+    },
+    hxQuery(node) {
+      this.queryParams.deptId = node.id;
+    },
+    See(row) {
+      const id = row.id ;
+      let forestLeaveStatus = "app_leave_2";
+      this.$modal
+        .confirm("是否同意?")
+        .then(function () {
+          return changeStatus(id,forestLeaveStatus);
+        })
+        .then(() => {
+          this.getList();
+          this.$modal.msgSuccess("已同意");
+        })
+        .catch(() => {});
+    },
+    /** 查询部门下拉树结构 */
+    getTreeselect() {
+      treeselect().then((response) => {
+        this.deptOptions = response.data;
+      });
+    },
+    // 表单重置
+    reset() {
+      this.form = {
+        id: null,
+        createBy: null,
+        createTime: null,
+        updateBy: null,
+        updateTime: null,
+        dataDeptId: null,
+        leaveStartTime: null,
+        leaveEndTime: null,
+        forestLeaveStatus: "app_leave_1",
+        leaveMatter: null,
+        deptId: null,
+        deptName: null,
+        leaveUserId: null,
+        leaveUserName: null,
+        type: this.queryParams.type
+      };
+      this.resetForm("form");
+    },
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.queryParams.pageNum = 1;
+      this.getList();
+    },
+    /** 重置按钮操作 */
+    resetQuery() {
+      this.queryParams.deptName = 0;
+      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;
+      getLeave(id).then((response) => {
+        this.form = response.data;
+        this.open = true;
+        this.title = "修改请假";
+      });
+    },
+    /** 提交按钮 */
+    submitForm() {
+      this.$refs["form"].validate((valid) => {
+        if (valid) {
+          if (
+            new Date(this.form.leaveStartTime).getTime() >=
+            new Date(this.form.leaveEndTime).getTime()
+          ) {
+            this.$message({
+              message: "请重新确认起始时间和结束时间",
+              type: "error",
+            });
+          } else {
+            if (this.form.id != null) {
+              updateLeave(this.form).then((response) => {
+                this.$modal.msgSuccess("修改成功");
+                this.open = false;
+                this.getList();
+              });
+            } else {
+              addLeave(this.form).then((response) => {
+                this.$modal.msgSuccess("新增成功");
+                this.open = false;
+                this.getList();
+              });
+            }
+          }
+        }
+      });
+    },
+    /** 删除按钮操作 */
+    handleDelete(row) {
+      const ids = row.id || this.ids;
+      this.$modal
+        .confirm("是否删除选中的数据?")
+        .then(function () {
+          return delLeave(ids);
+        })
+        .then(() => {
+          this.getList();
+          this.$modal.msgSuccess("删除成功");
+        })
+        .catch(() => {});
+    },
+    /** 导出按钮操作 */
+    handleExport() {
+      this.download(
+        "sooka-sponest-center-data/leave/export",
+        {
+          ...this.queryParams,
+        },
+        `请假申请_${new Date().getTime()}.xlsx`
+      );
+    },
+    // 点击按钮修改是否只查询本级部门用户
+    changeQueryType() {
+      this.queryParams.deptName = this.queryParams.deptName === 0 ? 1 : 0;
+    }
+  },
+};
+</script>

+ 569 - 0
system_ui/src/views/data/leave/index2.vue

@@ -0,0 +1,569 @@
+<template>
+  <div class="app-container">
+    <el-form
+      :model="queryParams"
+      ref="queryForm"
+      size="small"
+      :inline="true"
+      v-show="showSearch"
+      @submit.native.prevent
+    >
+      <!--<el-form-item label="数据所属部门(政或党的id)" prop="dataDeptId">-->
+      <!--<el-input-->
+      <!--v-model="queryParams.dataDeptId"-->
+      <!--placeholder="请输入数据所属部门(政或党的id)"-->
+      <!--clearable-->
+      <!--@keyup.enter.native="handleQuery"-->
+      <!--/>-->
+      <!--</el-form-item>-->
+      <el-form-item label-width="100px" label="请假人姓名" prop="leaveUserName">
+        <el-input
+          v-model="queryParams.leaveUserName"
+          placeholder="请输入请假人姓名"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="开始时间" prop="leaveStartTime" label-width="120px">
+        <el-date-picker clearable
+                        v-model="queryParams.leaveStartTime"
+                        type="date"
+                        value-format="yyyy-MM-dd"
+                        placeholder="请选择开始时间">
+        </el-date-picker>
+      </el-form-item>
+      <el-form-item label="结束时间" prop="leaveEndTime" label-width="120px">
+        <el-date-picker clearable
+                        v-model="queryParams.leaveEndTime"
+                        type="date"
+                        value-format="yyyy-MM-dd"
+                        placeholder="请选择结束时间">
+        </el-date-picker>
+      </el-form-item>
+      <el-form-item prop="deptId">
+        <template slot="label">
+          <span @click="changeQueryType" v-if="queryParams.deptName == 0">本级及下级</span>
+          <span @click="changeQueryType" v-if="queryParams.deptName == 1">只查询本级</span>
+        </template>
+        <treeselect v-model="queryParams.deptId" :options="deptOptions" multiple:false :show-count="true"
+                    placeholder="请选择部门" @select="hx" :noResultsText="'空'" :noOptionsText="'空'" style="width: 240px"/>
+        <el-input v-model="queryParams.deptName" v-if="false"/>
+      </el-form-item>
+      <!--  <el-form-item label-width="auto" label="所属部门" prop="deptName">
+        <el-input
+          v-model="queryParams.deptName"
+          placeholder="请输入所属部门"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>-->
+      <!--<el-form-item label="请假人事由" prop="leaveMatter">
+        <el-input
+          v-model="queryParams.leaveMatter"
+          placeholder="请输入请假人事由"
+          clearable
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="部门名称" prop="deptId" >
+        <treeselect :options="deptOptions" v-model="queryParams.deptId"  :show-count="true" placeholder="请选择所属部门"
+                    @select="hxQuery"/>
+      </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-table
+      v-loading="loading"
+      :data="leaveList"
+      @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="数据状态(1-可用 2-不可用 )" align="center" prop="dataStatus" />-->
+      <!--      <el-table-column label="数据所属部门(政或党的id)" align="center" prop="dataDeptId" />-->
+      <el-table-column
+        label="开始时间"
+        align="center"
+        prop="leaveStartTime"
+        width="180"
+      >
+        <template slot-scope="scope">
+          <span>{{ parseTime(scope.row.leaveStartTime, "{y}-{m}-{d} {h}:{i}:{s}") }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column
+        label="结束时间"
+        align="center"
+        prop="leaveEndTime"
+        width="180"
+      >
+        <template slot-scope="scope">
+          <span>{{ parseTime(scope.row.leaveEndTime, "{y}-{m}-{d} {h}:{i}:{s}") }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="状态" align="center" prop="forestLeaveStatus" >
+        <template slot-scope="scope">
+          <dict-tag
+            :options="dict.type.app_leave"
+            :value="scope.row.forestLeaveStatus"
+          />
+        </template>
+      </el-table-column>
+      <el-table-column label="请假事由" align="center" prop="leaveMatter" />
+      <el-table-column label="所属部门" align="center" prop="deptName" />
+      <el-table-column label="请假人姓名" align="center" prop="leaveUserName" />
+      <el-table-column label="创建人" align="center" prop="createName"/>
+      <el-table-column label="创建时间" align="center" prop="createTime"/>
+      <el-table-column label="修改人" align="center" prop="updateName"/>
+      <el-table-column label="修改时间" align="center" prop="updateTime"/>
+    </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"
+      label-width="600px"
+      class="form-style"
+    >
+      <el-form ref="form" :model="form" :rules="rules" label-width="120px">
+        <el-row>
+          <el-col :span="24">
+            <el-form-item label="申请人" prop="leaveUserName" class="form-style">
+              <el-select
+                v-model="form.leaveUserName"
+                filterable
+                placeholder="请选择申请人"
+              >
+                <el-option
+                  v-for="dict in userList"
+                  :key="dict.userId"
+                  :label="dict.nickName"
+                  :value="String(dict.userId)"
+                  @click.native="a(dict)"
+                ></el-option>
+              </el-select>
+            </el-form-item>
+            <el-form-item label="所属部门" prop="deptId">
+              <treeselect
+                :options="deptOptions"
+                v-model="form.deptId"
+                :show-count="true"
+                placeholder="请选择所属部门"
+                @select="hx"
+                :noResultsText="'空'"
+                :noOptionsText="'空'"
+              />
+            </el-form-item>
+            <el-form-item
+              label="开始时间"
+              prop="leaveStartTime"
+              label-width="120px"
+            >
+              <el-date-picker
+                clearable
+                v-model="form.leaveStartTime"
+                type="datetime"
+                :picker-options="pickerOptionsStart"
+                value-format="yyyy-MM-dd HH:mm:ss"
+                placeholder="请选择开始时间"
+              >
+              </el-date-picker>
+            </el-form-item>
+            <el-form-item
+              label="结束时间"
+              prop="leaveEndTime"
+              label-width="120px"
+            >
+              <el-date-picker
+                clearable
+                v-model="form.leaveEndTime"
+                type="datetime"
+                :picker-options="pickerOptionsEnd"
+                value-format="yyyy-MM-dd HH:mm:ss"
+                placeholder="请选择结束时间"
+              >
+              </el-date-picker>
+            </el-form-item>
+            <el-form-item
+              label="请假事由"
+              prop="leaveMatter"
+              label-width="120px"
+            >
+              <el-input
+                v-model="form.leaveMatter"
+                type="textarea"
+                placeholder="请输入内容"
+                maxlength="100"
+              />
+            </el-form-item>
+          </el-col>
+        </el-row>
+      </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="title"-->
+    <!--      :visible.sync="seeopen"-->
+    <!--      width="600px"-->
+    <!--      class="form-style"-->
+    <!--    >-->
+    <!--      <el-form ref="form" :model="form" :rules="rules" label-width="120px">-->
+    <!--        <el-form-item-->
+    <!--          label="开始时间"-->
+    <!--          prop="leaveStartTime"-->
+    <!--          label-width="120px"-->
+    <!--        >-->
+    <!--          <el-date-picker-->
+    <!--            clearable-->
+    <!--            :disabled="true"-->
+    <!--            v-model="form.leaveStartTime"-->
+    <!--            type="datetime"-->
+    <!--            value-format="yyyy-MM-dd HH:mm:ss"-->
+    <!--            placeholder="请选择开始时间"-->
+    <!--          >-->
+    <!--          </el-date-picker>-->
+    <!--        </el-form-item>-->
+    <!--        <el-form-item label="结束时间" prop="leaveEndTime" label-width="120px">-->
+    <!--          <el-date-picker-->
+    <!--            clearable-->
+    <!--            :disabled="true"-->
+    <!--            v-model="form.leaveEndTime"-->
+    <!--            type="datetime"-->
+    <!--            value-format="yyyy-MM-dd HH:mm:ss"-->
+    <!--            placeholder="请选择结束时间"-->
+    <!--          >-->
+    <!--          </el-date-picker>-->
+    <!--        </el-form-item>-->
+    <!--        &lt;!&ndash;        <el-form-item label="请假事由" prop="leaveMatter">-->
+    <!--          <el-input v-model="form.leaveMatter" placeholder="请输入请假人事由" :disabled="true" maxlength="50"/>-->
+    <!--        </el-form-item>&ndash;&gt;-->
+    <!--        <el-form-item label="请假事由" prop="leaveMatter" label-width="120px">-->
+    <!--          <el-input-->
+    <!--            v-model="form.leaveMatter"-->
+    <!--            type="textarea"-->
+    <!--            placeholder="请输入内容"-->
+    <!--            maxlength="100"-->
+    <!--          />-->
+    <!--        </el-form-item>-->
+    <!--        <el-form-item label="所属部门" prop="deptId">-->
+    <!--          <treeselect-->
+    <!--            :options="deptOptions"-->
+    <!--            v-model="form.deptId"-->
+    <!--            :show-count="true"-->
+    <!--            placeholder="请选择所属部门"-->
+    <!--            @select="hx"-->
+    <!--            :disabled="true"-->
+    <!--          />-->
+    <!--        </el-form-item>-->
+    <!--        <el-form-item label="请假人姓名" prop="leaveUserName">-->
+    <!--          <el-input-->
+    <!--            v-model="form.leaveUserName"-->
+    <!--            placeholder="请输入请假人姓名"-->
+    <!--            maxlength="20"-->
+    <!--            :disabled="true"-->
+    <!--          />-->
+    <!--        </el-form-item>-->
+    <!--      </el-form>-->
+    <!--      <div slot="footer" class="dialog-footer">-->
+    <!--        <el-button type="primary" @click="agreeSel">同意</el-button>-->
+    <!--        <el-button @click="cancelSel">拒绝</el-button>-->
+    <!--      </div>-->
+    <!--    </el-dialog>-->
+  </div>
+</template>
+
+<script>
+import {
+  addLeave,
+  delLeave,
+  getLeave,
+  listLeave,
+  updateLeave,
+  changeStatus,
+} from "@/api/data/leave/leave";
+import { treeselect } from "@/api/system/dept";
+import Treeselect from "@riophae/vue-treeselect";
+import "@riophae/vue-treeselect/dist/vue-treeselect.css";
+import { selectUserList } from "@/api/data/leave/linleader";
+
+export default {
+  name: "Leave",
+  components: { Treeselect },
+  dicts: ["app_leave"],
+  data() {
+    return {
+      // 遮罩层
+      loading: true,
+      // 选中数组
+      ids: [],
+      userList: [],
+      // 非单个禁用
+      single: true,
+      // 非多个禁用
+      multiple: true,
+      // 显示搜索条件
+      showSearch: true,
+      // 总条数
+      total: 0,
+      // 请假表格数据
+      leaveList: [],
+      // 弹出层标题
+      title: "",
+      // 是否显示弹出层
+      open: false,
+      seeopen: false,
+      // 部门树选项
+      deptOptions: [],
+      // 查询参数
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        dataStatus: null,
+        dataDeptId: null,
+        leaveStartTime: null,
+        leaveEndTime: null,
+        forestLeaveStatus: null,
+        leaveMatter: null,
+        deptId: null,
+        deptName: 0,
+        leaveUserId: null,
+        leaveUserName: null,
+        id:null
+      },
+      // 表单参数
+      form: {},
+      // 表单校验
+      rules: {
+        leaveStartTime: [
+          { required: true, message: "开始时间不能为空", trigger: "blur" },
+        ],
+        leaveEndTime: [
+          { required: true, message: "结束时间不能为空", trigger: "blur" },
+        ],
+        deptId: [
+          { required: true, message: "所属部门不能为空", trigger: "change" },
+        ],
+        leaveUserName: [
+          { required: true, message: "申请人姓名不能为空", trigger: "blur" },
+        ],
+      },
+      pickerOptionsStart: {
+        disabledDate: (time) => {
+          if (this.form.leaveEndTime) {
+            return time.getTime() > new Date(this.form.leaveEndTime).getTime();
+          }
+        },
+      },
+      pickerOptionsEnd: {
+        disabledDate: (time) => {
+          return (
+            time.getTime() <
+            new Date(this.form.leaveStartTime).getTime() -
+            1 * 24 * 60 * 60 * 1000
+          );
+        },
+      },
+    };
+  },
+  created() {
+    this.queryParams.type = this.$route.query.type;
+    this.getList();
+    this.getTreeselect();
+    selectUserList().then((response) => {
+      this.userList = response.data;
+    });
+  },
+  methods: {
+    a(event) {
+      this.form.leaveUserName = event.nickName;
+      this.form.leaveUserId = event.userId;
+    },
+    /** 查询请假列表 */
+    getList() {
+      this.loading = true;
+      listLeave(this.queryParams).then((response) => {
+        this.leaveList = response.rows;
+        this.total = response.total;
+        this.loading = false;
+      });
+    },
+    // 取消按钮
+    cancel() {
+      this.open = false;
+      this.reset();
+    },
+    // 拒绝按钮
+    cancelSel() {
+      this.seeopen = false;
+      this.reset();
+    },
+
+    hx(node) {
+      this.form.deptId = node.id;
+      this.form.deptName = node.label;
+      this.$refs.form.validate();
+    },
+    hxQuery(node) {
+      this.queryParams.deptId = node.id;
+    },
+    See(row) {
+      const id = row.id ;
+      let forestLeaveStatus = "app_leave_2";
+      this.$modal
+        .confirm("是否同意?")
+        .then(function () {
+          return changeStatus(id,forestLeaveStatus);
+        })
+        .then(() => {
+          this.getList();
+          this.$modal.msgSuccess("已同意");
+        })
+        .catch(() => {});
+    },
+    /** 查询部门下拉树结构 */
+    getTreeselect() {
+      treeselect().then((response) => {
+        this.deptOptions = response.data;
+      });
+    },
+    // 表单重置
+    reset() {
+      this.form = {
+        id: null,
+        createBy: null,
+        createTime: null,
+        updateBy: null,
+        updateTime: null,
+        dataDeptId: null,
+        leaveStartTime: null,
+        leaveEndTime: null,
+        forestLeaveStatus: "app_leave_1",
+        leaveMatter: null,
+        deptId: null,
+        deptName: null,
+        leaveUserId: null,
+        leaveUserName: null,
+        type: this.queryParams.type
+      };
+      this.resetForm("form");
+    },
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.queryParams.pageNum = 1;
+      this.getList();
+    },
+    /** 重置按钮操作 */
+    resetQuery() {
+      this.queryParams.deptName = 0;
+      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;
+      getLeave(id).then((response) => {
+        this.form = response.data;
+        this.open = true;
+        this.title = "修改请假";
+      });
+    },
+    /** 提交按钮 */
+    submitForm() {
+      this.$refs["form"].validate((valid) => {
+        if (valid) {
+          if (
+            new Date(this.form.leaveStartTime).getTime() >=
+            new Date(this.form.leaveEndTime).getTime()
+          ) {
+            this.$message({
+              message: "请重新确认起始时间和结束时间",
+              type: "error",
+            });
+          } else {
+            if (this.form.id != null) {
+              updateLeave(this.form).then((response) => {
+                this.$modal.msgSuccess("修改成功");
+                this.open = false;
+                this.getList();
+              });
+            } else {
+              addLeave(this.form).then((response) => {
+                this.$modal.msgSuccess("新增成功");
+                this.open = false;
+                this.getList();
+              });
+            }
+          }
+        }
+      });
+    },
+    /** 删除按钮操作 */
+    handleDelete(row) {
+      const ids = row.id || this.ids;
+      this.$modal
+        .confirm("是否删除选中的数据?")
+        .then(function () {
+          return delLeave(ids);
+        })
+        .then(() => {
+          this.getList();
+          this.$modal.msgSuccess("删除成功");
+        })
+        .catch(() => {});
+    },
+    /** 导出按钮操作 */
+    handleExport() {
+      this.download(
+        "sooka-sponest-center-data/leave/export",
+        {
+          ...this.queryParams,
+        },
+        `请假申请_${new Date().getTime()}.xlsx`
+      );
+    },
+    // 点击按钮修改是否只查询本级部门用户
+    changeQueryType() {
+      this.queryParams.deptName = this.queryParams.deptName === 0 ? 1 : 0;
+    }
+  },
+};
+</script>

+ 501 - 0
system_ui/src/views/data/regulations/index.vue

@@ -0,0 +1,501 @@
+<template>
+  <div class="app-container">
+    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" @submit.native.prevent>
+      <!--      <el-form-item label="数据所属部门(政或党的id)" prop="dataDeptId">-->
+      <!--        <el-input-->
+      <!--          v-model="queryParams.dataDeptId"-->
+      <!--          placeholder="请输入数据所属部门(政或党的id)"-->
+      <!--          clearable-->
+      <!--          @keyup.enter.native="handleQuery"-->
+      <!--        />-->
+      <!--      </el-form-item>-->
+      <el-form-item label="标题" prop="resTitle">
+        <el-input
+          v-model="queryParams.resTitle"
+          placeholder="请输入标题"
+          clearable
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item prop="deptId">
+        <template slot="label">
+          <span @click="changeQueryType" v-if="queryParams.deptName === 0">本级及下级</span>
+          <span @click="changeQueryType" v-if="queryParams.deptName === 1">只查询本级</span>
+        </template>
+        <treeselect v-model="queryParams.deptId" :options="deptOptions" multiple:false :show-count="true"
+                    placeholder="请选择部门" @select="hx" :noResultsText="'空'" :noOptionsText="'空'" style="width: 240px"/>
+        <el-input v-model="queryParams.deptName" v-if="false"/>
+      </el-form-item>
+
+      <!-- <el-form-item label="简介" prop="resIntroduction">
+         <el-input
+           v-model="queryParams.resIntroduction"
+           placeholder="请输入简介"
+           clearable
+           @keyup.enter.native="handleQuery"
+         />
+       </el-form-item>-->
+      <!--  <el-form-item label="所属部门" prop="deptId">
+          <treeselect :options="deptOptions" v-model="queryParams.deptId"  :show-count="true" placeholder="请选择所属部门"
+                      @select="hxQuery"/>
+        </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:reserve: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:reserve: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:reserve:remove']"
+        >删除
+        </el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="warning"
+          plain
+          icon="el-icon-download"
+          size="mini"
+          @click="handleExport"
+          v-hasPermi="['system:reserve:export']"
+        >导出
+        </el-button>
+      </el-col>
+      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
+    </el-row>
+
+    <el-table v-loading="loading" :data="reserveList" @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="数据状态(1-可用 2-不可用 )" align="center" prop="dataStatus" />-->
+      <!--      <el-table-column label="数据所属部门(政或党的id)" align="center" prop="dataDeptId" />-->
+      <el-table-column label="标题" align="center" prop="resTitle"/>
+      <el-table-column label="简介" align="center" prop="resIntroduction"/>
+      <!--      <el-table-column label="部门id" align="center" prop="deptId"/>-->
+      <el-table-column label="所属部门" align="center" prop="deptName" @select="hx"/>
+      <el-table-column label="发布状态" align="center" prop="varieties">
+        <template slot-scope="scope">
+          <dict-tag :options="dict.type.centerdata_release_status" :value="scope.row.releaseStatus"/>
+        </template>
+      </el-table-column>
+      <el-table-column label="创建人" align="center" prop="createName"/>
+      <el-table-column label="创建时间" align="center" prop="createTime"/>
+      <el-table-column label="修改人" align="center" prop="updateName"/>
+      <el-table-column label="修改时间" align="center" prop="updateTime"/>
+      <!--      <el-table-column label="附件" align="center" prop="attachId"/>-->
+      <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:reserve:edit']"
+          >修改
+          </el-button>
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-delete"
+            @click="handleDelete(scope.row)"
+            v-hasPermi="['system:reserve:remove']"
+          >删除
+          </el-button>
+          <el-button v-if="scope.row.releaseStatus == 'centerdata_release_status_yes'" size="mini" type="text" icon="el-icon-refresh-left" @click="handlePublish(scope.row)" v-hasPermi="['system:reserve:edit']">
+            撤销
+          </el-button>
+          <el-button v-else-if="scope.row.releaseStatus == 'centerdata_release_status_no'" size="mini" type="text" icon="el-icon-upload" @click="handlePublish(scope.row)" v-hasPermi="['system:reserve:edit']">
+            发布
+          </el-button>
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-edit"
+            @click="See(scope.row)"
+            v-hasPermi="['forest:reserve:edit']"
+          >查看
+          </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="resTitle">
+          <el-input v-model="form.resTitle" placeholder="请输入标题" maxlength="50"/>
+        </el-form-item>
+        <el-form-item label="所属部门" prop="deptId">
+          <treeselect :options="deptOptions" v-model="form.deptId" :show-count="true" placeholder="请选择所属部门"
+                      @select="hx" :noResultsText="'空'" :noOptionsText="'空'"/>
+        </el-form-item>
+        <!--        <el-form-item label="发布状态" prop="releaseStatus">
+                  <el-select v-model="form.releaseStatus" placeholder="请选择发布状态" filterable>
+                    <el-option
+                      v-for="dict in dict.type.centerdata_release_status"
+                      :key="dict.value"
+                      :label="dict.label"
+                      :value="dict.value"
+                    ></el-option>
+                  </el-select>
+                </el-form-item>-->
+        <!--        <el-form-item label="简介" prop="resIntroduction">
+                  <editor v-model="form.resIntroduction" :min-height="192" maxlength="512"/>
+                </el-form-item>-->
+        <el-form-item label="简介" prop="resIntroduction">
+          <el-input v-model="form.resIntroduction" type="textarea" placeholder="请输入内容" maxlength="200"/>
+        </el-form-item>
+        <el-form-item label="附件" prop="attachId">
+          <fileUpload :value="[form.fileUrl,form.fileName]" v-model="form.fileUrl" :setFileName="setFileName"
+                      :removeFileName="removeFileName" :limit="1"></fileUpload>
+        </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="title" :visible.sync="seeopen" width="600px" append-to-body>
+      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
+
+        <el-form-item label="标题" prop="resTitle">
+          <el-input v-model="form.resTitle" placeholder="请输入标题" :disabled="true" maxlength="50"/>
+        </el-form-item>
+
+        <!--        <el-form-item label="简介" prop="resIntroduction">
+                  <el-input v-model="form.resIntroduction" placeholder="请输入简介" :disabled="true" maxlength="512"/>
+                </el-form-item>-->
+
+        <el-form-item label="所属部门" prop="deptId">
+          <treeselect :options="deptOptions" v-model="form.deptId" :show-count="true" placeholder="请选择所属部门"
+                      @select="hx" :disabled="true" :noResultsText="'空'" :noOptionsText="'空'"/>
+        </el-form-item>
+
+        <el-form-item label="简介" prop="resIntroduction" label-width="120px">
+          <el-input v-model="form.resIntroduction" type="textarea" placeholder="请输入内容" maxlength="500"/>
+        </el-form-item>
+
+        <el-form-item label="附件" prop="attachId">
+          <fileUpload :value="form.fileUrl" @input="getUrl" v-model="form.fileUrl"></fileUpload>
+        </el-form-item>
+
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button @click="cancelSel">取 消</el-button>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import {
+  addReserve,
+  delReserve,
+  getReserve,
+  listReserve,
+  updateReserve,
+  updateRelease
+} from "@/api/data/reserve/reserve";
+import Treeselect from "@riophae/vue-treeselect";
+import {treeselect} from "@/api/system/dept";
+import deptselector from '@/views/components/deptselector.vue'
+import "@riophae/vue-treeselect/dist/vue-treeselect.css";
+import fileUpload from '@/views/components/FileUpload/index.vue'
+
+export default {
+  name: "Reserve",
+  dicts: ["centerdata_release_status"],
+  components: {
+    Treeselect,
+    deptselector,
+    fileUpload
+  },
+  data() {
+    return {
+      // 遮罩层
+      loading: true,
+      // 选中数组
+      ids: [],
+      // 非单个禁用
+      single: true,
+      // 非多个禁用
+      multiple: true,
+      // 显示搜索条件
+      showSearch: true,
+      // 总条数
+      total: 0,
+      // 应急预案表格数据
+      reserveList: [],
+      fileNames: [],
+      // 部门树选项
+      deptOptions: [],
+      // 弹出层标题
+      title: "",
+      // 是否显示弹出层
+      open: false,
+      seeopen: false,
+      // 查询参数
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        dataStatus: null,
+        dataDeptId: null,
+        resTitle: null,
+        resIntroduction: null,
+        releaseStatus: null,
+        deptId: null,
+        deptName: 0,
+        attachId: null
+      },
+      // 表单参数
+      form: {
+        dataDeptId: 0,
+        releaseStatus: 'centerdata_release_status_no',
+        fileUrl: '',
+        fileName: '',
+        fileUrlList: [],
+        fileNameList: []
+      },
+      // 表单校验
+      rules: {
+        resTitle: [
+          {required: true, message: "标题不能为空", trigger: "blur"}
+        ],
+        deptId: [
+          {required: true, message: "所属部门不能为空", trigger: "change"}
+        ]
+      }
+    };
+  },
+  created() {
+    this.getList();
+    this.getTreeselect();
+  },
+  methods: {
+    getUrl(url) {
+      this.form.fileUrl = url;
+    },
+    setFileName(fileName) {
+      let that = this
+      that.fileNames.push(fileName)
+    },
+    removeFileName(index) {
+      let that = this
+      that.fileNames.splice(index, 1);
+      let fileurls = that.form.fileUrl.split(",")
+      fileurls.splice(index, 1)
+      that.form.fileUrl = fileurls.toString()
+    },
+    /** 查询部门下拉树结构 */
+    getTreeselect() {
+      treeselect().then(response => {
+        this.deptOptions = response.data;
+      });
+    },
+    setDataDeptId(e) {
+      this.form.dataDeptId = e.deptId
+      this.form.dataDeptName = e.deptName
+    },
+    hx(node) {
+      this.form.deptId = node.id
+      this.form.deptName = node.label
+      this.$refs.form.validate()
+    },
+    /** 查询应急预案列表 */
+    getList() {
+      this.loading = true;
+      listReserve(this.queryParams).then(response => {
+        this.reserveList = response.rows;
+        this.total = response.total;
+        this.loading = false;
+      });
+    },
+    // 取消按钮
+    cancel() {
+      this.open = false;
+      this.reset();
+    },
+    // 取消按钮
+    cancelSel() {
+      this.seeopen = false;
+      this.reset();
+    },
+    See(row) {
+      this.reset();
+      const id = row.id || this.ids
+      getReserve(id).then(response => {
+        this.form = response.data;
+        this.seeopen = true;
+        this.title = "查看";
+      });
+    },
+    // 表单重置
+    reset() {
+      this.form = {
+        id: null,
+        createBy: null,
+        createTime: null,
+        updateBy: null,
+        updateTime: null,
+        dataStatus: "0",
+        dataDeptId: null,
+        resTitle: null,
+        resIntroduction: null,
+        deptId: null,
+        deptName: null,
+        attachId: null
+      };
+      this.fileNames = []
+      this.resetForm("form");
+    },
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.queryParams.pageNum = 1;
+      this.getList();
+    },
+    /** 重置按钮操作 */
+    resetQuery() {
+      this.queryParams.deptName = 0;
+      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
+      getReserve(id).then(response => {
+        const list = response.data.fileUrl.split(',');
+        var item1
+        if (response.data.fileUrl != "") {
+          for (var a = 0; a < list.length; a++) {
+            let listurl = list[a].split('+')
+            this.fileNames.push(listurl[1])
+          }
+        }
+        this.form = response.data;
+        this.open = true;
+        this.title = "修改应急预案";
+      });
+    },
+
+    /** 提交按钮 */
+    submitForm() {
+      this.$refs["form"].validate(valid => {
+        if (valid) {
+          this.form.fileName = this.fileNames.toString()
+          this.form.fileUrlList = Array.from(document.querySelectorAll('.el-upload-list__item')).map(item => item.querySelector('a').getAttribute('href'))
+          this.form.fileNameList = this.fileNames;
+          if (this.form.id != null) {
+            updateReserve(this.form).then(response => {
+              this.$modal.msgSuccess("修改成功");
+              this.open = false;
+              this.getList();
+            });
+          } else {
+            this.form.releaseStatus = "centerdata_release_status_no";
+            addReserve(this.form).then(response => {
+              this.$modal.msgSuccess("新增成功");
+              this.open = false;
+              this.getList();
+            });
+          }
+        }
+      });
+    },
+    /** 删除按钮操作 */
+    handleDelete(row) {
+      const ids = row.id || this.ids;
+      this.$modal.confirm('是否删除选中的数据?').then(function () {
+        return delReserve(ids);
+      }).then(() => {
+        this.getList();
+        this.$modal.msgSuccess("删除成功");
+      }).catch(() => {
+      });
+    },
+
+    handlePublish(row){
+      let ids = row.id || this.ids;
+      let status = "发布", releaseStatus = "centerdata_release_status_yes";
+      if(!ids.includes(",")) {
+        ids = [ids];
+        if (row.releaseStatus.includes("centerdata_release_status_yes")) {
+          status = "撤销";
+          releaseStatus = "centerdata_release_status_no";
+        }
+        this.$modal.confirm('是否' + status + '选中的数据?').then(function () {
+          return updateRelease(ids, releaseStatus);
+        }).then(() => {
+          this.getList();
+          this.$modal.msgSuccess(status + "成功");
+        }).catch((e) => {
+          console.log(e)
+        });
+      }
+    },
+    /** 导出按钮操作 */
+    handleExport() {
+      this.download('sooka-sponest-center-data/reserve/export', {
+        ...this.queryParams
+      }, `应急预案_${new Date().getTime()}.xlsx`)
+    },
+    // 点击按钮修改是否只查询本级部门用户
+    changeQueryType() {
+      this.queryParams.deptName = this.queryParams.deptName === 0 ? 1 : 0;
+    }
+  }
+};
+</script>