Browse Source

完善流程抄送改为工作流设置

master
yunuo970428 8 months ago
parent
commit
d401bbf46e
  1. 139
      anrui-system-ui/src/views/copyofprocess/power.vue
  2. 232
      anrui-system-ui/src/views/copyofprocess/powerAdd.vue

139
anrui-system-ui/src/views/copyofprocess/power.vue

@ -0,0 +1,139 @@
<template>
<div class="app-container">
<div v-show="viewState == 1">
<!--标题按钮部分开始-->
<div class="tab-header webtop">
<!--标题-->
<div>{{ viewTitle }}</div>
<!--start 添加修改按钮-->
<div>
<el-button type="primary" size="small" :disabled="submitdisabled" @click="handleAdd()">新增</el-button>
<el-button type="info" size="small" @click="handleReturn()">关闭</el-button>
</div>
</div>
<!--标题按钮部分结束-->
<!--Start 新增修改部分-->
<div class="listconadd">
<el-form ref="form_obj" :model="formobj" :rules="rules" class="formadd">
<el-row style="border-top: 1px solid #E0E3EB">
<el-col :span="4" class="tleftb">
<span>流程名称</span>
</el-col>
<el-col :span="20">
<el-form-item>
<span>{{ formobj.flowName }}</span>
</el-form-item>
</el-col>
</el-row>
<div class="title">流程审批权限列表</div>
<el-table :key="tableKey" :data="formobj.list" :index="index" border style="width: 100%">
<el-table-column fixed label="序号" type="index" :index="index + 1" align="center" width="60" />
<el-table-column fixed label="操作" align="center" width="180">
<template slot-scope="scope">
<el-button type="primary" size="small" @click="handleEdit(scope.row)">编辑</el-button>
<el-button type="danger" size="small" @click="handleDelete(scope.row, scope.$index)">删除</el-button>
</template>
</el-table-column>
<el-table-column prop="flowName" label="流程名称" header-align="center" align="left" width="200" />
<el-table-column prop="useOrgNames" label="公司" header-align="center" align="left" />
</el-table>
</el-form>
</div>
</div>
<powerAdd v-show="viewState == 2 || viewState == 3" ref="divAdd" @doback="resetState" @reloadlist="reloadlist" />
</div>
</template>
<script>
import { initByPower, delByPower } from '@/api/system/liuchengchaosong/liuchengchaosong'
import powerAdd from './powerAdd'
export default {
name: 'Power',
components: {
powerAdd
},
data() {
return {
viewTitle: '',
viewState: 1,
index: 0,
tableKey: 1,
//
formobj: {
flowName: '',
flowKey: '',
list: []
},
rules: {},
submitdisabled: false
}
},
methods: {
showInit(row) {
this.$nextTick(() => {
this.$refs['form_obj'].clearValidate()
})
this.viewTitle = '流程审批权限设置'
this.formobj.flowName = row.flowName
this.formobj.flowKey = row.flowKey
initByPower({ flowKey: row.flowKey }).then((resp) => {
if (resp.success) {
this.formobj.list = resp.data
}
}).catch((e) => {
this.formobj = {}
})
},
resetState() {
this.viewState = 1
},
reloadlist() {
this.viewState = 1
initByPower({ flowKey: this.formobj.flowKey }).then((resp) => {
if (resp.success) {
this.formobj.list = resp.data
}
})
},
handleAdd() {
this.viewState = 2
this.$refs['divAdd'].showAdd(this.formobj.flowName, this.formobj.flowKey)
},
handleEdit(row) {
this.viewState = 3
this.$refs['divAdd'].showEdit(row, this.formobj.flowName, this.formobj.flowKey)
},
handleDelete(row, index) {
delByPower({ sid: row.sid }).then((res) => {
if (res.success) {
this.$message({ showClose: true, type: 'success', message: '删除成功' })
this.formobj.list.splice(index, 1)
}
})
},
// ===
handleReturn() {
//
this.formobj = {
flowName: '',
flowKey: '',
list: []
}
this.submitdisabled = false
this.$refs['form_obj'].resetFields()
this.$emit('doback')
}
}
}
</script>
<style scoped>
.title {
padding: 7px;
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: center;
}
</style>

232
anrui-system-ui/src/views/copyofprocess/powerAdd.vue

@ -0,0 +1,232 @@
<template>
<div class="app-container">
<div>
<!--标题按钮部分开始-->
<div class="tab-header webtop">
<!--标题-->
<div>{{ viewTitle }}</div>
<!--start 添加修改按钮-->
<div>
<el-button type="primary" size="small" :disabled="submitdisabled" @click="save()">保存
</el-button>
<el-button type="info" size="small" @click="handleReturn()">关闭</el-button>
</div>
</div>
<!--标题按钮部分结束-->
<!--Start 新增修改部分-->
<div class="listconadd">
<el-form ref="form_obj" :model="formobj" :rules="rules" class="formadd">
<el-row style="border-top: 1px solid #E0E3EB">
<el-col :span="4" class="tleftb">
<span>流程名称</span>
</el-col>
<el-col :span="8">
<el-form-item>
<span>{{ formobj.flowName }}</span>
</el-form-item>
</el-col>
<el-col :span="4" class="tleftb">
<span>分公司</span>
</el-col>
<el-col :span="8">
<el-form-item>
<el-select style="width: 80%" v-model="formobj.useOrgSids" placeholder="请选择" clearable filterable multiple>
<el-option v-for="item in useOrg_list" :key="item.sid" :label="item.name" :value="item.sid"></el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
<div class="title">流程审批权限列表</div>
<el-table :key="tableKey" :data="formobj.sysFlowPowerDetailList" :index="index" border style="width: 100%">
<el-table-column fixed width="60" label="序号" type="index" :index="index + 1" align="center"/>
<el-table-column align="center" width="80">
<template slot="header" slot-scope="scope">
<i class="add-btn-icon el-icon-plus" style="color: red;font-size:20px" @click="powerAdd(scope.row)"></i>
</template>
<template slot-scope="scope">
<i class="el-icon-delete" @click="powerDelete(scope.$index)"></i>
</template>
</el-table-column>
<el-table-column label="环节名称" align="center">
<template slot-scope="scope">
<el-select v-model="scope.row.taskDefName" placeholder="请选择" @change="taskChange($event, scope.row)" clearable filterable>
<el-option v-for="item in task_list" :key="item.taskDefKey" :label="item.taskDefName" :value="item.taskDefName"></el-option>
</el-select>
</template>
</el-table-column>
<el-table-column label="参数名称" align="center">
<template slot-scope="scope">
<el-input v-model="scope.row.paramName" clearable placeholder="" />
</template>
</el-table-column>
<el-table-column label="权限范围" align="center">
<template slot-scope="scope">
<el-input v-model="scope.row.powerRange" clearable placeholder="" />
</template>
</el-table-column>
<el-table-column label="逻辑关系" align="center">
<template slot-scope="scope">
<el-radio-group v-model="scope.row.logicRela">
<el-radio label="或"></el-radio>
<el-radio label="与"></el-radio>
</el-radio-group>
</template>
</el-table-column>
</el-table>
</el-form>
</div>
</div>
</div>
</template>
<script>
import { fetchSidByPower, saveByPower, selecTaskByProId, selectOrgSidList } from '@/api/system/liuchengchaosong/liuchengchaosong'
export default {
name: 'PowerAdd',
data() {
return {
viewTitle: '',
index: 0,
tableKey: 0,
task_list: [],
useOrg_list: [],
//
formobj: {
sid: '',
procInstId: '',
flowName: '',
useOrgSids: [],
useOrgNames: [],
sysFlowPowerDetailList: []
},
rules: {},
submitdisabled: false
}
},
methods: {
showAdd(flowName, flowKey) {
this.$nextTick(() => {
this.$refs['form_obj'].clearValidate()
})
this.viewTitle = '【设置】流程审批权限'
this.formobj.flowName = flowName
this.formobj.procInstId = flowKey
selectOrgSidList().then((resp) => {
if (resp.success) {
this.useOrg_list = resp.data
}
})
selecTaskByProId({ flowKey: flowKey }).then((res) => {
if (res.success) {
this.task_list = res.data
}
})
},
showEdit(row, flowName, flowKey) {
this.$nextTick(() => {
this.$refs['form_obj'].clearValidate()
})
this.viewTitle = '【设置】流程审批权限'
this.formobj.flowName = flowName
this.formobj.procInstId = flowKey
selectOrgSidList().then((resp) => {
if (resp.success) {
this.useOrg_list = resp.data
}
})
selecTaskByProId({ flowKey: flowKey }).then((res) => {
if (res.success) {
this.task_list = res.data
}
})
fetchSidByPower(row.sid).then((res) => {
if (res.success) {
this.formobj = res.data
}
})
},
powerAdd() {
this.formobj.sysFlowPowerDetailList.push({
taskDefKey: '',
taskDefName: '',
paramName: '',
powerRange: '',
logicRela: ''
})
},
taskChange(value, row) {
const choose = this.task_list.filter((item) => item.taskDefName === value)
if (choose !== null && choose.length > 0) {
row.taskDefKey = choose[0].taskDefKey
} else {
row.taskDefKey = ''
}
},
powerDelete(index) {
this.formobj.sysFlowPowerDetailList.splice(index, 1)
},
save() {
if (this.formobj.useOrgSids.length > 0) {
const aa = []
this.formobj.useOrgSids.forEach((e) => {
this.useOrg_list.forEach((k) => {
if (e === k.sid) {
aa.push(k.name)
}
})
})
this.formobj.useOrgNames = aa
} else {
this.$message({ showClose: true, type: 'error', message: '分公司不能为空' })
return
}
if (this.formobj.sysFlowPowerDetailList === 0) {
this.$message({ showClose: true, type: 'error', message: '流程审批权限列表不能为空' })
return
}
this.$refs['form_obj'].validate((valid) => {
if (valid) {
this.submitdisabled = true
saveByPower(this.formobj).then((resp) => {
if (resp.success) {
this.$message({ showClose: true, type: 'success', message: '保存成功' })
this.handleReturn('true')
}
}).catch(() => {
this.submitdisabled = false
})
} else {
return false
}
})
},
// ===
handleReturn(isreload) {
if (isreload === 'true') this.$emit('reloadlist')
//
this.formobj = {
sid: '',
procInstId: '',
flowName: '',
useOrgSids: [],
useOrgNames: [],
sysFlowPowerDetailList: []
}
this.submitdisabled = false
this.$refs['form_obj'].resetFields()
this.$emit('doback')
}
}
}
</script>
<style scoped>
.title {
padding: 7px;
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: center;
}
</style>
Loading…
Cancel
Save