| | |
| | | export const personnelCollect = (params) => { |
| | | return request({ |
| | | url: '/api/ubcs-flow/taskUser/su', |
| | | method: 'get', |
| | | params: params |
| | | method: 'post', |
| | | data: params |
| | | }) |
| | | } |
| | | // 人员设置取消收藏 |
| | | export const cancelCollect = (params) => { |
| | | return request({ |
| | | url: '/api/ubcs-flow/taskUser/du', |
| | | method: 'get', |
| | | params: params |
| | | method: 'post', |
| | | data: params |
| | | }) |
| | | } |
| | | // 人员设置保存 |
| | | export const personnelSave = (params) => { |
| | | return request({ |
| | | url: '/api/', |
| | | method: 'post', |
| | | data: params |
| | | url: '/api/ubcs-flow/vciflow/start', |
| | | method: 'get', |
| | | params: params |
| | | }) |
| | | } |
| | | // 人员设置保存 |
| | | export const personnelDict = (params) => { |
| | | return request({ |
| | | url: '/api/ubcs-user/allPage', |
| | | method: 'get', |
| | | params: params |
| | | }) |
| | | } |
| | | |
| | |
| | | <template> |
| | | <el-dialog :title="title" :visible.sync="dialogVisible" append-to-body="true" width="30%"> |
| | | <el-tag v-for="tag in tags" :key="tag" closable effect="dark" @click="handleClickTag(tag)" |
| | | @close="handleCloseTag(tag)"> |
| | | <span> {{ tag }}</span> |
| | | </el-tag> |
| | | <el-divider></el-divider> |
| | | <el-form :model="formInline" class="demo-form-inline" label-position="left"> |
| | | <el-form-item :label="item.taskName" v-for="(item,index) in initFrom" :key="index"> |
| | | <el-select v-model="formInline[index].userId" :placeholder="item.taskName"> |
| | | <el-option label="区域一" value="shanghai"></el-option> |
| | | <el-option label="区域二" value="beijing"></el-option> |
| | | <el-dialog :title="title" :visible.sync="dialogVisible" append-to-body="true"> |
| | | <div> |
| | | <el-tag v-for="tag in tags" :key="tag" closable disable-transitions effect="dark" @click="handleClickTag(tag)" |
| | | @close="handleCloseTag(tag)"> |
| | | <span> {{ tag.name }}</span> |
| | | </el-tag> |
| | | </div> |
| | | |
| | | <el-divider v-if="tags.length !== 0"></el-divider> |
| | | <div class="btns-icon"> |
| | | <el-button type="primary" icon="el-icon-star-off" @click="handleCollect"></el-button> |
| | | <!-- <el-button type="primary" icon="el-icon-refresh" ></el-button> --> |
| | | </div> |
| | | <el-form :model="saveParam" class="demo-form-inline" label-position="left"> |
| | | <el-form-item :label="item.taskName" v-for="(item, index) in initFrom" :key="index"> |
| | | <el-select style="width: 50%;" v-model="saveParam.flowTaskUsers[index]['userId']" |
| | | :placeholder="item.taskName" @change="handleSelect($event, index)"> |
| | | <el-option :label="key.userNames" :value="key.userId" v-for="(key, keyi) in typeName" |
| | | :key="keyi"></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-form> |
| | |
| | | </el-dialog> |
| | | </template> |
| | | <script> |
| | | import { personnelInit, personnelCollect, cancelCollect, personnelSave } from '@/api/template/setPersonnel.js' |
| | | import { personnelInit, personnelCollect, cancelCollect, personnelSave, personnelDict } from '@/api/template/setPersonnel.js' |
| | | export default { |
| | | name: 'SetPersonnel', |
| | | props: { |
| | |
| | | typeof: Boolean, |
| | | default: false |
| | | }, |
| | | // 标题 |
| | | title: { |
| | | typeof: String, |
| | | default: '人员设置' |
| | | }, |
| | | code:{ |
| | | // 模板id |
| | | code: { |
| | | typeof: String, |
| | | default: '' |
| | | }, |
| | | // 模板用途 |
| | | type: { |
| | | typeof: String, |
| | | default: '' |
| | | } |
| | |
| | | return { |
| | | dialogVisible: this.visible, |
| | | initFrom: [], |
| | | tags: ['标签1', '标签2', '标签3', '标签4'], |
| | | formInline: [] |
| | | tags: [], |
| | | typeName: [], |
| | | saveParam: {}, |
| | | users: [], |
| | | |
| | | } |
| | | }, |
| | | mounted() { |
| | | this.apiInit() |
| | | this.apiDict() |
| | | }, |
| | | methods: { |
| | | async apiInit() { |
| | | const response = await personnelInit({type:'PUBLIC',templateId:'8b5e2017-990f-454a-9c39-4c4eeeb57553'}) |
| | | const response = await personnelInit({ type: this.type, templateId: this.code }) |
| | | if (response.status === 200) { |
| | | console.log(response) |
| | | this.initFrom = response.data.data.user |
| | | this.formInline = response.data.data.user |
| | | this.tags = response.data.data.collect |
| | | const { modelKey, templateId } = response.data.data.flow |
| | | let flowTaskUsers = response.data.data.user |
| | | this.saveParam = { modelKey, templateId, flowTaskUsers: flowTaskUsers } |
| | | this.handleClickTag(this.tags[0]) |
| | | } |
| | | }, |
| | | async apiCollect() { |
| | | const response = await personnelCollect() |
| | | async apiDict() { |
| | | const response = await personnelDict() |
| | | if (response.status === 200) { |
| | | console.log(response) |
| | | const data = response.data.data |
| | | this.typeName = data.map(item => { |
| | | const { account, deptName, id, realName } = item |
| | | let userNames = `${deptName} - ${realName} - ${account}` |
| | | return { userId: id, userName: realName, userNames: userNames } |
| | | }) |
| | | } |
| | | }, |
| | | async canCollect(id) { |
| | | const response = await cancelCollect() |
| | | |
| | | handleCollect() { |
| | | this.$prompt('请输入一个名字', '操作', { |
| | | confirmButtonText: '确定', |
| | | cancelButtonText: '取消', |
| | | }).then(async ({ value }) => { |
| | | console.log(this.users) |
| | | this.saveParam.flowTaskUsers = this.users |
| | | this.saveParam = { ...this.saveParam, name: value } |
| | | console.log(this.saveParam) |
| | | const response = await personnelCollect(this.saveParam) |
| | | if (response.status === 200) { |
| | | this.$nextTick(() => { |
| | | this.apiInit() |
| | | }) |
| | | console.log(response) |
| | | } |
| | | }).catch(() => { |
| | | |
| | | }); |
| | | }, |
| | | async canCollect(name) { |
| | | const response = await cancelCollect({ name: name }) |
| | | if (response.status === 200) { |
| | | console.log(response) |
| | | this.apiInit() |
| | | this.$message({ |
| | | type: 'success', |
| | | message: response.data.msg |
| | | }); |
| | | } |
| | | }, |
| | | async apiSave() { |
| | | const response = await personnelSave() |
| | | if (response.status === 200) { |
| | | console.log(response) |
| | | try { |
| | | const { modelKey, templateId } = this.saveParam |
| | | const response = await personnelSave({ modelKey, templateId }) |
| | | if (response.status === 200) { |
| | | console.log(response) |
| | | this.$message({ |
| | | type: 'success', |
| | | message: response.data.msg |
| | | }); |
| | | this.done() |
| | | } |
| | | } catch { |
| | | console.error('接口调用失败') |
| | | } |
| | | }, |
| | | handleClickTag(event) { |
| | | console.log(event) |
| | | const flowTaskUsers = event.flowTaskUsers |
| | | this.saveParam.flowTaskUsers = flowTaskUsers.map(item => { |
| | | const { taskId, taskName, userId, userName } = item |
| | | return { taskId, taskName, userId, userName } |
| | | }) |
| | | }, |
| | | handleCloseTag(event) { |
| | | console.log(event) |
| | | this.canCollect(event) |
| | | this.canCollect(event.name) |
| | | }, |
| | | handleSelect(event, index) { |
| | | const res = this.typeName.find(item => item.userId === event) |
| | | const { userName } = res |
| | | let users = { ... this.saveParam.flowTaskUsers[index], userName } |
| | | console.log(users) |
| | | this.users[index] = users |
| | | }, |
| | | done() { |
| | | this.dialogVisible = false |
| | |
| | | this.done() |
| | | }, |
| | | handleConfirm() { |
| | | // this.done() |
| | | console.log(this.formInline) |
| | | console.log(this.users) |
| | | console.log(this.saveParam) |
| | | this.apiSave() |
| | | } |
| | | } |
| | | } |
| | |
| | | <style lang="scss"> |
| | | .el-tag+.el-tag { |
| | | margin-left: 10px; |
| | | margin-top: 10px; |
| | | } |
| | | |
| | | .button-new-tag { |
| | |
| | | margin-left: 10px; |
| | | vertical-align: bottom; |
| | | } |
| | | |
| | | .btns-icon { |
| | | display: flex; |
| | | justify-content: end; |
| | | padding-bottom: 10px; |
| | | } |
| | | </style> |
| | |
| | | <el-button @click="outerVisible = true">流程测试</el-button> |
| | | <el-button @click="handleTable">人员设置</el-button> |
| | | <flow-business :visible.sync="outerVisible"></flow-business> |
| | | <set-personnel :visible.sync="visibleFlow"></set-personnel> |
| | | <set-personnel :visible.sync="visibleFlow" code="8b5e2017-990f-454a-9c39-4c4eeeb57553" type="PUBLIC"></set-personnel> |
| | | </div> |
| | | </template> |
| | | |
| | |
| | | }, |
| | | async getDataList() { |
| | | this.loading = true |
| | | console.log(this.searchParam) |
| | | const { pageSize, currentPage, total } = this.page |
| | | let param = { size: pageSize, current: currentPage } |
| | | console.log(this.searchParam) |
| | | this.searchParam = Object.keys(this.searchParam) |
| | | .filter((key) => this.searchParam[key] !== null && this.searchParam[key] !== undefined && this.searchParam[key] !== "") |
| | | .reduce((acc, key) => ({ ...acc, [key]: this.searchParam[key] }), {}); |
| | | console.log(this.searchParam) |
| | | const response = await getList({ ...param, ...this.searchParam }) |
| | | if (response.status === 200) { |
| | | this.loading = false |
| | |
| | | }, |
| | | handleReset() { |
| | | this.searchParam = {} |
| | | this.getDataList() |
| | | }, |
| | | handleSearch(form, done) { |
| | | console.log(form) |
| | | const { id, groupCode, operationType } = form |
| | | let dataTime = { id, groupCode, operationType } |
| | | if (form.hasOwnProperty('createTime')) { |
| | |
| | | if (form.hasOwnProperty('lastModifyTime')) { |
| | | dataTime = { lastModifyTime: dateFormat(form.lastModifyTime), ...dataTime } |
| | | } |
| | | console.log(dataTime) |
| | | this.searchParam = dataTime |
| | | this.page.currentPage = 1 |
| | | this.getDataList() |
| | |
| | | @refresh-change="handleRefresh" @size-change="handleSizePage" @current-change="handleCurrentPage" |
| | | @selection-change="selectionChange" @row-click="handleRowClick"> |
| | | <template slot="menuLeft"> |
| | | <el-button icon="el-icon-search" size="small" type="primary" @click="handleStatus">查 询 |
| | | </el-button> |
| | | <!-- <el-button icon="el-icon-search" size="small" type="primary" @click="handleStatus">查 询 |
| | | </el-button> --> |
| | | <el-button icon="el-icon-delete" size="small" type="danger" @click="handleDeleteByIds">删 除 |
| | | </el-button> |
| | | </template> |
| | |
| | | required: true, |
| | | message: '系统编号不能为空', |
| | | trigger: 'blur' |
| | | }] |
| | | }], |
| | | // maxlength: 30, //字数限制 |
| | | }, { |
| | | label: '系统名称', |
| | | prop: 'name', |
| | |
| | | required: true, |
| | | message: '系统名称不能为空', |
| | | trigger: 'blur' |
| | | }] |
| | | }], |
| | | // maxlength: 30, //字数限制 |
| | | }, |
| | | { |
| | | label: '系统描述', |
| | |
| | | console.log(this.search) |
| | | const { pageSize, currentPage } = this.page |
| | | let param = { size: pageSize, current: currentPage } |
| | | this.search = Object.keys(this.search) |
| | | .filter((key) => this.search[key] !== null && this.search[key] !== undefined && this.search[key] !== "") |
| | | .reduce((acc, key) => ({ ...acc, [key]: this.search[key] }), {}); |
| | | const response = await getSysInfoList({ ...param, ...this.search }) |
| | | if (response.status === 200) { |
| | | console.log(response) |
| | |
| | | }, |
| | | // 新增 |
| | | async handleSave(row, done, loading) { |
| | | const response = await sysInfoAdd(row) |
| | | if (response.status === 200) { |
| | | try { |
| | | const response = await sysInfoAdd(row) |
| | | if (response.status === 200) { |
| | | this.$message({ |
| | | type: 'success', |
| | | message: '新增数据成功!' |
| | | }) |
| | | done(row) |
| | | // this.$refs.crud.refreshTable() |
| | | // this.getDataList() |
| | | } |
| | | } catch { |
| | | loading() |
| | | this.$message({ |
| | | type: 'success', |
| | | message: '新增数据成功!' |
| | | }) |
| | | done() |
| | | this.$refs.crud.refreshTable() |
| | | this.getDataList() |
| | | } |
| | | }, |
| | | // 编辑 |
| | | async handleEdit(row, index, done, loading) { |
| | | console.log(row) |
| | | const { oid, id, name, description } = row |
| | | const response = await sysInfoEdit({ oid, id, name, description }) |
| | | if (response.status === 200) { |
| | | try { |
| | | const { oid, id, name, description } = row |
| | | const response = await sysInfoEdit({ oid, id, name, description }) |
| | | if (response.status === 200) { |
| | | loading() |
| | | this.$message({ |
| | | type: 'success', |
| | | message: '修改数据成功!' |
| | | }) |
| | | done(row) |
| | | } |
| | | } catch { |
| | | loading() |
| | | this.$message({ |
| | | type: 'success', |
| | | message: '修改数据成功!' |
| | | }) |
| | | done() |
| | | this.getDataList() |
| | | } |
| | | }, |
| | | // 删除单条 |