Pārlūkot izejas kodu

Merge branch 'V0.0.8' of http://10.87.21.221:8000/jzyd_yyds/soc_web into V0.0.8

zhulu 1 gadu atpakaļ
vecāks
revīzija
4f0f1e0250

+ 30 - 0
src/api/core/compensate/compensate.js

@@ -0,0 +1,30 @@
+import request from '@/utils/request'
+
+
+// 分页接口
+export function list(data) {
+  return request({
+    url: '/core/compensate/page',
+    method: 'post',
+    data: data
+  })
+}
+
+
+// 编辑/新增
+export function edit(data) {
+  return request({
+    url: '/core/compensate',
+    method: 'post',
+    data: data
+  })
+}
+
+//根据业务类型查询对应计划
+export function queryPlanBySendModule(sendModule) {
+  return request({
+    url: "/core/reminder/queryPlanBySendModule/" + sendModule,
+    method: "get",
+    // params: query
+  });
+}

+ 468 - 0
src/views/system/compensate/index.vue

@@ -0,0 +1,468 @@
+<template>
+  <div class="app-container">
+    <el-row :gutter="10">
+      <!--机构数据-->
+
+      <!--搜索栏-->
+      <el-col :span="24" :xs="24">
+        <div class="main-right-box">
+          <div class="main-search-box">
+            <el-form
+              :model="queryParams"
+              ref="queryForm"
+              size="small"
+              :inline="true"
+              v-show="showSearch"
+            >
+              <el-form-item label="行社名称">
+                <org-tree
+                  v-model="queryParams.orgId"
+                  @defaultKey="getDefaultKey"
+                  @defaultOrg="getDefaultOrg"
+                  @checkChange="checkChange"
+                  @click="clickTreeNode"
+                  :defaultCheckSub="false"
+                  hangsheTree
+                  ref="orgTree"
+                ></org-tree>
+              </el-form-item>
+              <el-form-item label="业务类型" prop="businessType">
+                <el-select
+                  v-model="queryParams.businessType"
+                  placeholder="请选择业务类型"
+                  clearable
+                >
+                  <el-option
+                    v-for="dict in dict.type.reminder_business_type"
+                    :key="dict.value"
+                    :label="dict.label"
+                    :value="`${dict.value}`"
+                  ></el-option>
+                </el-select>
+              </el-form-item>
+              <el-form-item label="补偿结果" prop="res">
+                <el-select
+                  style="width: 100%"
+                  v-model="queryParams.res"
+                  placeholder="请选择补偿结果"
+                  clearable
+                >
+                  <el-option
+                    v-for="item in resOptions"
+                    :key="item.value"
+                    :label="item.label"
+                    :value="item.value">
+                  </el-option>
+
+                </el-select>
+              </el-form-item>
+            </el-form>
+            <el-row :gutter="10">
+              <el-col :span="1.5">
+                <el-button
+                  type="primary"
+                  icon="el-icon-search"
+                  size="mini"
+                  @click="handleQuery"
+                  v-hasPermi="['core:reminder:list']"
+                >搜索
+                </el-button>
+              </el-col>
+              <el-col :span="1.5">
+                <el-button
+                  type="primary"
+                  icon="el-icon-refresh"
+                  size="mini"
+                  @click="resetQuery"
+                >重置
+                </el-button
+                >
+              </el-col>
+              <el-col :span="1.5">
+                <el-button
+                  type="primary"
+                  icon="el-icon-plus"
+                  size="mini"
+                  @click="handleAdd"
+                  v-hasPermi="['core:reminder:edit']"
+                >新增补偿
+                </el-button>
+              </el-col>
+              <right-toolbar
+                :showSearch.sync="showSearch"
+                @queryTable="getList"
+              ></right-toolbar>
+            </el-row>
+          </div>
+          <el-table
+            border
+            height="600"
+            size="small"
+            v-loading="loading"
+            :data="logDataList"
+            row-key="id"
+          >
+            <el-table-column
+              label="序号"
+              type="index"
+              align="center"
+              width="80"
+            >
+              <template slot-scope="scope">
+                <span>{{
+                    (queryParams.pageNum - 1) * queryParams.pageSize +
+                    scope.$index +
+                    1
+                  }}</span>
+              </template>
+            </el-table-column>
+            <el-table-column
+              label="业务类型"
+              align="center"
+              prop="businessType"
+            >
+              <template slot-scope="scope">
+                <dict-tag
+                  :options="dict.type.reminder_business_type"
+                  :value="scope.row.businessType"
+                />
+              </template>
+            </el-table-column>
+
+            <el-table-column label="计划名称" align="center" prop="planName"/>
+            <el-table-column label="补偿范围" align="center" prop="orgName"/>
+            <el-table-column label="补偿时间" align="center" prop="time"/>
+            <el-table-column label="补偿结果" align="center" prop="res">
+              <template slot-scope="scope">
+                {{ scope.row.res?'成功':'失败' }}
+              </template>
+            </el-table-column>
+            <el-table-column label="错误消息" align="center" prop="errorMsg" show-overflow-tooltip/>
+
+            <!--  <el-table-column
+                label="操作"
+                fixed="right"
+                width="220px"
+                align="center"
+                class-name="small-padding fixed-width"
+              >
+                <template slot-scope="scope">
+                  <el-button
+                    size="mini"
+                    type="text"
+                    icon="el-icon-edit-outline"
+                    @click="handleUpdate(scope.row)"
+                    v-hasPermi="['core:reminder:edit']"
+                  >编辑
+                  </el-button>
+
+                  <el-button
+                    size="mini"
+                    type="text"
+                    icon="el-icon-delete"
+                    @click="handleDelete(scope.row.configId)"
+                    v-hasPermi="['core:reminder: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"
+          />
+        </div>
+      </el-col>
+    </el-row>
+
+    <!-- 添加或修改短信提醒配置对话框 -->
+    <DialogCom :title="title" :visible.sync="open" width="600px" append-to-body>
+      <el-form ref="form" :model="form" :rules="rules" label-width="100px">
+        <el-form-item label="业务类型" prop="businessType">
+          <el-select
+            style="width: 100%"
+            v-model="form.businessType"
+            placeholder="请选择业务类型"
+            clearable
+            @change="selectPlan(form.businessType)"
+          >
+            <el-option
+              v-for="dict in dict.type.reminder_business_type"
+              :key="dict.value"
+              :label="dict.label"
+              :value="`${dict.value}`"
+            ></el-option>
+          </el-select>
+        </el-form-item>
+
+        <el-form-item label="补偿计划" prop="planId">
+          <el-select
+            style="width: 100%"
+            v-model="form.planId"
+            placeholder="请选择补偿计划"
+          >
+            <el-option
+              v-for="item in planList"
+              :key="item.planId"
+              :label="item.planName"
+              :value="item.planId"
+            ></el-option>
+          </el-select>
+        </el-form-item>
+
+        <el-form-item label="补偿范围" prop="orgIdList">
+          <org-tree-select
+            v-model="form.orgIdList"
+            :queryData="4"
+            ref="orgTreeSelect"
+            :disable="true"
+            :checkShow="true"
+          >
+          </org-tree-select>
+        </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>
+    </DialogCom>
+    <DialogThreeState ref="DialogThreeState"></DialogThreeState>
+  </div>
+</template>
+
+<script>
+import OrgTreeSelect from "@/components/orgTreeSelect/index.vue";
+import {list, edit, queryPlanBySendModule} from "@/api/core/compensate/compensate";
+import tableList from "@/mixins/tableList";
+import orgTree from "@/components/orgTree/orgQuerySelector.vue";
+import {deptTreeSelect} from "@/api/system/public";
+import {mapGetters} from "vuex";
+import DialogThreeState from "@/components/message/threeStateMessageBox.vue";
+
+
+export default {
+  dicts: [
+    'sys_org_type',
+    'reminder_business_type',
+  ],
+
+  name: "compensate",
+
+  components: {
+    orgTree,
+    DialogThreeState,
+    OrgTreeSelect,
+  },
+
+  data() {
+    return {
+      resOptions: [{
+        label: "成功",
+        value: true
+      }, {
+        label: "失败",
+        value: false
+      }],
+      // 遮罩层
+      loading: true,
+      // 选中数组
+      ids: [],
+      names: [],
+      // 非单个停用
+      single: true,
+      // 非多个停用
+      multiple: true,
+      // 显示搜索条件
+      showSearch: true,
+      // 总条数
+      total: 0,
+      // 监控调阅计划表格数据
+      logDataList: [],
+      planList: [],
+      timeUnitList: [],
+      check: null,
+      //角色列表
+      roleList: [],
+      // 弹出层标题
+      title: "",
+      // 是否显示弹出层
+      open: false,
+      // 查询参数
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+
+        businessType: null,
+        enabled: null,
+      },
+      // 表单参数
+      form: {
+        businessType: null,
+        planId: null,
+        orgIdList: [],
+      },
+      // 表单校验
+      rules: {
+        businessType: [
+          {required: true, message: "请选择业务类型", trigger: "change"},
+        ],
+        planId: [
+          {required: true, message: "请选择提醒角色", trigger: "change"},
+        ],
+      },
+    };
+  },
+
+  computed: {
+    ...mapGetters(["orgId"]),
+  },
+
+  created() {
+
+  },
+
+  methods: {
+    selectPlan(businessType) {
+      queryPlanBySendModule(businessType).then((response) => {
+        this.planList = response.data;
+      });
+    },
+    getPageIndex($index) {
+      //表格序号
+      return (
+        (this.queryParams.pageNum - 1) * this.queryParams.pageSize + $index + 1
+      );
+    },
+    getDefaultOrg(org) {
+      this.orgName = org.name;
+    },
+    /** 查询监控调阅计划列表 */
+    getList() {
+      this.loading = true;
+      list(this.queryParams).then((response) => {
+        this.logDataList = response.rows;
+        this.total = response.total;
+        this.loading = false;
+      });
+    },
+    // 取消按钮
+    cancel() {
+      this.open = false;
+      this.reset();
+    },
+    // 表单重置
+    reset() {
+      this.form = {
+        businessType: null,
+        planId: null,
+        orgIdList: [],
+      };
+      this.resetForm("form");
+    },
+    getDefaultKey(key) {
+      this.queryParams.orgId = key;
+      this.getList();
+    },
+    //单选框状态改变
+    checkChange(state) {
+      this.queryParams.checkSub = state;
+      this.handleQuery();
+    },
+
+
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.queryParams.pageNum = 1;
+      this.getList();
+    },
+    // 节点单击事件
+    clickTreeNode(data) {
+      this.queryParams.orgId = data.id;
+      this.handleQuery();
+    },
+    /** 查询机构树数据 */
+    getDeptTree() {
+      deptTreeSelect().then((response) => {
+        this.deptOptions = response.data;
+
+        this.handleQuery();
+      });
+    },
+    /** 重置按钮操作 */
+    resetQuery() {
+      this.resetForm("queryForm");
+      this.queryParams.orgId = this.orgId;
+      this.queryParams.checkSub = false;
+      this.$refs["orgTree"].setCheckSub(this.queryParams.checkSub)
+      this.handleQuery();
+    },
+    // 多选框选中数据
+    handleSelectionChange(selection) {
+      this.ids = selection.map((item) => item.id);
+      this.names = selection.map((item) => item.planName);
+      this.single = selection.length !== 1;
+      this.multiple = !selection.length;
+    },
+    /** 新增按钮操作 */
+    handleAdd() {
+      this.reset();
+      this.open = true;
+      this.title = "新增补偿";
+    },
+    /** 修改按钮操作 */
+    handleUpdate(row) {
+      this.reset();
+      const id = row.configId
+      detail(id).then((response) => {
+
+        this.selectPlan(response.data.businessType)
+        this.form = response.data;
+        this.open = true;
+        this.title = "编辑短信提醒配置";
+      });
+    },
+    /** 提交按钮 */
+    submitForm() {
+      this.$refs["form"].validate((valid) => {
+        if (valid) {
+          edit(this.form).then((response) => {
+            this.$modal.msgSuccess("提交成功");
+            this.open = false;
+            this.getList();
+          });
+        }
+      });
+    },
+    /** 删除按钮操作 */
+    handleDelete(id) {
+      this.$modal
+        .confirm("是否确认删除该配置?")
+        .then(function () {
+          return del(id);
+        })
+        .then(() => {
+          this.$modal.msgSuccess("删除成功");
+          this.getList();
+        })
+        .catch(() => {});
+    },
+
+
+    /** 导出按钮操作 */
+    handleExport() {
+      this.download(
+        "system/plan/export",
+        {
+          ...this.queryParams,
+        },
+        `plan_${new Date().getTime()}.xlsx`
+      );
+    },
+  }
+};
+</script>
+