jinlin
2024-07-26 1b765e3dfdf8ab0d38e587a0a8beaee47a60e32c
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
<template>
    <div class="fa-card-a">
      <el-row :gutter="24">
        <el-col :span="15">
          <zt-table-wraper ref="tableObj" v-slot="{ table }" :paging="true"
                           delete-url="/workflowConfig"
                           query-url="/workflowConfig/queryStepsList">
                <el-form :inline="true" :model="dataForm" @keyup.enter.native="table.query()">
                  <el-form-item>
                    <el-button class="form-title" type="text">流程步骤配置</el-button>
                    <!--                <zt-button style="left: 75%" type="primary" @click="addDept">添加</zt-button>-->
                  </el-form-item>
                  <!-- <zt-button type="query" @click="table.query()"/>-->
                  <zt-form-item label="流程模型" prop="name" style="margin-left: 23px;line-height: 56px">
                    <zt-select v-model="dataForm.id" :datas="defList" clearable></zt-select>
                  </zt-form-item>
                  <zt-form-item>
                    <zt-button v-show="true" type="add" @click="table.editHandle()"/>
                    <zt-button style="left: 75%" type="primary" @click="refreshFlowMenu">刷新菜单权限</zt-button>
                  </zt-form-item>
                </el-form>
                <el-table v-loading="table.dataLoading"
                          v-adaptive="{bottomOffset:70}"
                          height="100"
                          :data="table.dataList" border
                          highlight-current-row @current-change="showWorkflowConfigUser">
                  <el-table-column label="步骤名称" prop="name"/>
                  <el-table-column label="待办任务" prop="stepRouterName"/>
                  <el-table-column label="已办任务" prop="stepReadRouterName"/>
                  <!--<el-table-column prop="isCounterSign" label="是否启用">-->
                  <!--<template slot-scope="scope">   -->
                  <!--<el-checkbox v-model="scope.row.isCounterSign" :true-label="1" disabled></el-checkbox>    -->
                  <!--</template>-->
                  <!--</el-table-column>-->
                  <el-table-column align="center" label="本部门" prop="isSelfDept">
                    <template slot-scope="scope">   
                      <el-checkbox v-model="scope.row.isSelfDept" :true-label="1" disabled></el-checkbox>
                          
                    </template>
                  </el-table-column>
                  <el-table-column align="center" label="可以驳回" prop="canRefuse">
                    <template slot-scope="scope">     
                      <el-checkbox v-model="scope.row.canRefuse" :true-label="1" disabled></el-checkbox>
                        
                    </template>
                  </el-table-column>
 
 
                  <el-table-column align="center" label="步骤标识" prop="stepMarker"/>
                  <!--              <zt-table-column-handle :table="table" :has-edit="true" :has-view="false" :has-delete="true"/>-->
                  <el-table-column align="center" fixed="right" label="操作">
                    <template slot-scope="scope">
                      <zt-table-button type="primary" @click="editWorkflow(scope.row)">修改</zt-table-button>
                      <zt-table-button type="danger" @click="deleteWorkflow(scope.row)">删除</zt-table-button>
                    </template>
                  </el-table-column>
                </el-table>
            <!-- 弹窗, 新增 / 修改 -->
            <add-t-o ref="addTO" @refreshDataList="table.query"/>
            <add-or-update ref="addOrUpdate" :wfDefId="dataForm.wfDefId" @refreshDataList="table.query"/>
          </zt-table-wraper>
        </el-col>
        <!--        <el-col :span="14">-->
        <!--          <workflow-config-user ref="workflowConfigUserObj"/>-->
        <!--        </el-col>-->
        <el-col :span="9">
          <workflow-config-role ref="workflowConfigRoleObj"/>
        </el-col>
      </el-row>
    </div>
 
</template>
 
<script>
import AddOrUpdate from './workflow-config-add-update'
import WorkflowConfigUser from './workflow-config-user'
import WorkflowConfigRole from './workflow-config-role'
import addTO from "./addTO";
 
export default {
  data() {
    return {
      dataForm: {
        id: '',
        name: '',
        wfDefId: ''
      },
      selectedWorkflowConfig: null,
      checked: false,
      defList: [],
      isCounterSign: '',
      canRefuse: ''
    }
  },
  components: {
    WorkflowConfigUser,
    AddOrUpdate,
    WorkflowConfigRole,
    addTO
  },
  watch: {
    'dataForm.id'() {
      this.dataForm.wfDefId = this.dataForm.id
      this.$refs.tableObj.query()
    }
  },
  mounted: function () {
    this.getSelect()
  },
  methods: {
    async getSelect() {
      let res = await this.$http.get(`/workflowConfig/workflowSelect`)
      if (res.success) {
        this.defList = res.data
        for (let i = 0; i < this.defList.length; i++) {
          if (this.defList[i] && this.defList[i].id) {
            this.dataForm.id = this.defList[i].id
            break
          }
        }
      }
    },
    async deleteWorkflow(row) {
      if (await this.$tip.confirm('确定这些项目进行[删除]操作?')) {
        let res = await this.$http.delete
        (
          "/workflowConfig/" + row.id
        )
        if (res.success) {
          await this.$tip.success()
          this.$refs.tableObj.query()
        }
      }
    },
    editWorkflow(row) {
      this.$refs.addOrUpdate.$refs.dialog.init(row)
    },
    showWorkflowConfigUser(row) {
      this.selectedWorkflowConfig = row
      //this.$refs.workflowConfigUserObj.initTable(row ? row.id : null)
      this.$refs.workflowConfigRoleObj.initTable(row ? row.id : null)
    },
    addDept() {
      this.$refs.addTO.$refs.dialog.init()
      //打开弹出层
      /*this.dialogVisible=true
      //改变弹出成title
      this.dialogTitle="添加"
      //清空弹出层数据
      this.dept.id='';
      this.dept.name='';
      this.dept.code='';
      this.dept.type='';
      this.dept.status='';
      this.dept.tableName='';
      this.dept.remark='';
      this.dept.bizSql='';*/
    },
    refreshFlowMenu() {
      this.$http.get(`/workflowConfig/refreshFlowMenu`)
    }
  }
}
</script>