<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>
|