wente
2024-01-12 c21bf35f523ee1430fc5fa02ab1b4171492009b6
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
<template>
  <zt-dialog ref="dialog" title="添加用户" :hasConfirm="false" @close="close()" append-to-body>
    <zt-table-wraper ref="tableObj" query-url="/workflowConfig/getUserList" delete-url="" :lazy="true" v-slot="{ table }" :page-size="10">
      <el-form :inline="true" :model="detailForm" @keyup.enter.native="table.query()">
        <el-form-item class="toolbar">
        <el-form-item style="float: left">
          <el-input v-model="detailForm.userName" placeholder="用户名" clearable style="width: 200px"/>
          <zt-button type="query" @click="table.query()" style="margin-left: 20px"/>
        </el-form-item>
        </el-form-item>
      </el-form>
      <el-table ref="table" v-loading="table.dataLoading" :data="table.dataList" border highlight-current-row v-if="isShow"
                row-key="id" width="120%" @selection-change="table.selectionChangeHandle" @current-change="showWorkflowConfigUser">
        <el-table-column prop="userName" label="用户名" align="center" width="180px"/>
        <el-table-column prop="realName" label="姓名" align="center" width="180px"/>
        <el-table-column prop="deptName" label="部门名称" align="center" />
        <el-table-column prop="companyName" label="公司名称" align="center" />
      </el-table>
    </zt-table-wraper>
  </zt-dialog>
</template>
 
<script>
  export default {
    data() {
      return {
        detailForm : {
          userName: '',
          stepId: '',
          userId: ''
        },
        isShow: true,
        userList: []
      }
    },
    methods: {
      init(id) {
        this.isShow = false
        this.$nextTick(()=>{
          this.isShow = true
          this.detailForm.stepId = id
          this.detailForm.userName = ''
          this.$refs.tableObj.query()
        })
      },
      async showWorkflowConfigUser(row) {
        if(this.detailForm.stepId !== '' && this.detailForm.stepId !== null) {
          row.stepId = this.detailForm.stepId
          console.log(row.stepId)
            let res = await this.$http.get(`/workflowConfig/addWorkflowStepsUser?userId=${row.userId}&stepId=${row.stepId}`)
            if (res.success) {
              this.$tip.success()
              this.$refs.dialog.close()
              this.$emit('refreshDataList')
            }
        }
      },
      close() {
        this.detailForm.userName = ''
        this.$refs.tableObj.query()
      }
    }
  }
</script>