index.vue 5.39 KB
<template>
  <div class="timedTask from-clues">
 <div class="from-clues-header">
      <el-form ref="ruleForm" :model="form" label-width="100px">
        <el-row class="mb-5">
          <el-col :span="2" class="btnColRight">
            <btn nativeType="cx" @click="handleAdd">增加角色</btn>
          </el-col>

        </el-row>
      </el-form>
    </div>
    <div class="from-clues-content">
      <lb-table :page-size="pageData.size" :current-page.sync="pageData.current" :total="pageData.total"
        @size-change="handleSizeChange" @p-current-change="handleCurrentChange" :column="tableData.columns"
        :data="tableData.data">
       </lb-table>
    </div>
     <EditDialog ref="dialogForm" />
  <Roleslistdiglog ref="rolesForm" />
  </div>

</template>
<script>
// 定时任务
import data from "./data"
import sjsbTask from '@/api/sjsbTask.js'
import tableMixin from '@/mixins/tableMixin.js'
import EditDialog from "./edit-dialog.vue";
import Roleslistdiglog from "./roleslistdiglog.vue";
export default {
  name: "menus",
  mixins: [tableMixin],
  components: {
    EditDialog,Roleslistdiglog
  },
  data () {
    return {
      taskData: null,
      form: {
        job_name: '',
        currentPage: 1
      },
      title: '',
      queryParam: {},
      selectType: '0',
      queryName: '',
      organizationId: '', // 组织机构ID
      departmentId: '', // 部门ID
      departmentList: [], // 部门列表
      levelList: [], // 职务级别
      tableData: [],
      sexList: [],
      typeOptions: [
        {
          value: '0',
          label: '姓名'
        },
        {
          value: '1',
          label: '工号'
        },
        {
          value: '2',
          label: '部门'
        },
        {
          value: '3',
          label: '机构'
        }
      ],

      selectionList: [],
      tableData: {
        columns: [{
          label: '序号',
          type: 'index',
          width: '50',
          index: this.indexMethod,
        }].concat(data.columns()).concat([ {
            label: "操作",
            width: 380,
            render: (h, scope) => {
              return (
                <div>
                  <el-button type="text" size="mini"
                    icon="el-icon-video-pause"
                    onClick={() => { this.personnel(scope.row) }}>人员
                  </el-button>
                  <el-button type="text" size="mini"
                    icon="el-icon-edit"

                    onClick={() => { this.handleEdit(scope.row) }}>修改
                  </el-button>
                  <el-button type="text" size="mini"
                    icon="el-icon-delete" style="color:#F56C6C"
                    onClick={() => { this.handleDel(scope.row) }}>删除
                  </el-button>
                </div>
              );
            },
          },
        ]),
        data: []
      },
      pageData: {
        total: 5,
        pageSize: 15,
        current: 1,
      },
    }
  },
  methods: {
      // 新增角色
    handleAdd() {
      // this.$refs.addEditDialog.menuType = this.menuType
      // this.$refs.addEditDialog.roleId = value.id
      // this.roleSort = value.sort ? value.sort : 0
      // if (value.id) {
      //   this.$refs.addEditDialog.dialogForm.roleName = value.name
      //   this.$refs.addEditDialog.dialogForm.roleType = value.type
      //   this.$refs.addEditDialog.dialogForm.roleTextArea = value.description
      // }
      this.$refs.dialogForm.showAddEditDialog = true
      // this.$refs.addEditDialog.dialogTitle = value.id ? '修改' : '新增'
    },
    //  修改角色
    handleEdit(row) {
      // this.$refs.addEditDialog.menuType = this.menuType
      // this.$refs.addEditDialog.roleId = row.id
      // this.roleSort = row.sort ? row.sort : 0
      // if (row.id) {
      //   this.$refs.addEditDialog.dialogForm.roleName = row.name
      //   this.$refs.addEditDialog.dialogForm.roleType = row.type
      //   this.$refs.addEditDialog.dialogForm.roleTextArea = row.description
      // }
      this.$refs.dialogForm.showAddEditDialog = true
      // this.$refs.addEditDialog.dialogTitle = row.id ? '修改' : '新增'
    },
   featchData () {

        this.tableData.data = [
        {
          job_name: "人事部材料管理员",
          description: "材料管理员",
          cron_expression: "管理内部材料",
        },
     ]
    },

    personnel(){
      this.$refs.rolesForm.adds();
      // this.$refs.rolesForm.title = "人员配置";
    },
    handleDel (row) {
      this.$confirm('此操将进行删除操作, 是否继续?', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning',
      })
        .then(() => {
          sjsbTask.sjsbTaskRemove(row.id)
            .then((res) => {
              if ((res.code = 200)) {
                this.$message({
                  type: 'success',
                  message: res.message,
                })
                this.featchData()
              }
            })
            .catch((error) => {
              this.$alert(error, '提示', {
                confirmButtonText: '确定',
                type: 'error'
              })
            })
        })
        .catch(() => {
          this.$message({
            type: 'info',
            message: '已取消',
          })
        })
    }
  }
}
</script>
<style scoped lang="scss">
@import "~@/styles/mixin.scss";
@import "~@/styles/public.scss";
</style>