4 changed files with 468 additions and 0 deletions
@ -0,0 +1,49 @@ |
|||
import request from '@/utils/request' |
|||
|
|||
// 获取菜单 分页列表
|
|||
export function pageList(data) { |
|||
return request({ |
|||
url: '/portal/v1/sysflowcc/listPage', |
|||
method: 'post', |
|||
data: data, |
|||
headers: { 'Content-Type': 'application/json' } |
|||
}) |
|||
} |
|||
|
|||
// 新增
|
|||
export function save(data) { |
|||
return request({ |
|||
url: '/portal/v1/sysflowcc/save', |
|||
method: 'post', |
|||
data: data, |
|||
headers: { 'Content-Type': 'application/json' } |
|||
}) |
|||
} |
|||
|
|||
// 初始化应用
|
|||
export function fetchSid(data) { |
|||
return request({ |
|||
url: '/portal/v1/sysflowcc/fetchDetailsBySid/' + data, |
|||
method: 'get' |
|||
}) |
|||
} |
|||
|
|||
// 删除
|
|||
export function delBySids(data) { |
|||
return request({ |
|||
url: '/portal/v1/sysflowcc/delBySids', |
|||
method: 'DELETE', |
|||
data: data, |
|||
headers: { 'Content-Type': 'application/json' } |
|||
}) |
|||
} |
|||
|
|||
// 查询角色列表
|
|||
export function roleList(data){ |
|||
return request({ |
|||
url: '/portal/v1/sysrole/listAll', |
|||
method: 'post', |
|||
data: data, |
|||
headers: { 'Content-Type': 'application/json' } |
|||
}) |
|||
} |
@ -0,0 +1,178 @@ |
|||
<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 class="icon">*</span>流程名称</span> |
|||
</el-col> |
|||
<el-col :span="20"> |
|||
<el-form-item prop="flowName"> |
|||
<el-select v-model="formobj.flowName" placeholder="请选择" @change="changeFlow" filterable> |
|||
<el-option v-for="item in flow_list" :key="item.dictKey" :label="item.dictValue" :value="item.dictValue"></el-option> |
|||
</el-select> |
|||
</el-form-item> |
|||
</el-col> |
|||
</el-row> |
|||
<el-row> |
|||
<el-col :span="4" class="tleftb"> |
|||
<span>角色</span> |
|||
</el-col> |
|||
<el-col :span="20"> |
|||
<el-form-item> |
|||
<el-select v-model="recipientList" placeholder="请选择" filterable multiple> |
|||
<el-option v-for="item in role_list" :key="item.sid" :label="item.name" :value="item.sid"></el-option> |
|||
</el-select> |
|||
</el-form-item> |
|||
</el-col> |
|||
</el-row> |
|||
</el-form> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import { fetchSid, save, roleList } from '@/api/system/liuchengchaosong/liuchengchaosong' |
|||
import { pullDown } from '@/api/system/postManage/index' |
|||
|
|||
export default { |
|||
name: 'liuchengchaosongAdd', |
|||
data() { |
|||
return { |
|||
viewTitle: '', |
|||
index: 0, |
|||
tableKey: 0, |
|||
role_list: [], |
|||
flow_list: [], |
|||
recipientList: [], |
|||
// 表单数据 |
|||
formobj: { |
|||
sid: '', // 一条数据的sid |
|||
flowName: '', |
|||
flowKey: '', |
|||
roleNames: [], |
|||
roleSids: [] |
|||
}, |
|||
rules: { |
|||
flowName: [{ required: true, message: '流程名称不能为空', trigger: 'change' }] |
|||
}, |
|||
submitdisabled: false |
|||
} |
|||
}, |
|||
methods: { |
|||
init() { |
|||
roleList({}).then((res) => { |
|||
if (res.success) { |
|||
this.role_list = res.data |
|||
} |
|||
}) |
|||
pullDown({ type: 'flow' }).then((res) => { |
|||
if (res.success) { |
|||
this.flow_list = res.data |
|||
} |
|||
}) |
|||
}, |
|||
showAdd() { |
|||
this.init() |
|||
this.$nextTick(() => { |
|||
this.$refs['form_obj'].clearValidate() |
|||
}) |
|||
this.viewTitle = '【新增】流程抄送' |
|||
}, |
|||
showEdit(row) { |
|||
this.init() |
|||
this.$nextTick(() => { |
|||
this.$refs['form_obj'].clearValidate() |
|||
}) |
|||
this.viewTitle = '【设置】流程抄送' |
|||
console.log('编辑回显', row.sid) |
|||
fetchSid(row.sid).then((resp) => { |
|||
this.formobj = resp.data |
|||
this.recipientList = this.formobj.roleSids |
|||
}).catch((e) => { |
|||
this.formobj = row |
|||
}) |
|||
}, |
|||
changeFlow(value) { |
|||
const choose = this.flow_list.filter((item) => item.dictValue === value) |
|||
this.formobj.flowKey = choose[0].dictKey |
|||
}, |
|||
save() { |
|||
console.log(this.formobj) |
|||
if (this.recipientList.length === 0) { |
|||
this.$message({ showClose: true, type: 'error', message: '角色不能为空' }) |
|||
return |
|||
} else { |
|||
const aa = [] |
|||
const bb = [] |
|||
for (var i = 0; i < this.recipientList.length; i++) { |
|||
for (var k = 0; k < this.role_list.length; k++) { |
|||
if (this.recipientList[i] === this.role_list[k].sid) { |
|||
aa.push(this.role_list[k].name) |
|||
bb.push(this.role_list[k].sid) |
|||
} |
|||
} |
|||
} |
|||
this.formobj.roleNames = aa |
|||
this.formobj.roleSids = bb |
|||
} |
|||
this.$refs['form_obj'].validate((valid) => { |
|||
if (valid) { |
|||
this.submitdisabled = true |
|||
save(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: '', // 一条数据的sid |
|||
flowName: '', |
|||
flowKey: '', |
|||
roleNames: [], |
|||
roleSids: [] |
|||
} |
|||
this.recipientList = [] |
|||
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> |
|||
|
@ -0,0 +1,228 @@ |
|||
<template> |
|||
<div class="app-container"> |
|||
<div v-show="viewState == 1"> |
|||
<button-bar view-title="流程抄送设置" ref="btnbar" :btndisabled="btndisabled" @btnhandle="btnHandle"/> |
|||
<div class="main-content"> |
|||
<div class="searchcon"> |
|||
<el-button size="small" class="searchbtn" @click="clicksearchShow">{{ searchxianshitit }}</el-button> |
|||
<div v-show="isSearchShow" class="search"> |
|||
<el-form ref="listQueryform" :inline="true" :model="listQuery" label-width="100px" class="tab-header"> |
|||
<el-form-item label="流程名称"> |
|||
<el-select v-model="listQuery.params.flowName" placeholder="请选择" filterable> |
|||
<el-option v-for="item in flow_list" :key="item.dictKey" :label="item.dictValue" :value="item.dictValue"></el-option> |
|||
</el-select> |
|||
</el-form-item> |
|||
</el-form> |
|||
<div class="btn" style="text-align: center;"> |
|||
<el-button type="primary" size="small" icon="el-icon-search" @click="handleFilter">查询</el-button> |
|||
<el-button type="primary" size="small" icon="el-icon-refresh" @click="handleReset">重置</el-button> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="listtop"> |
|||
<div class="tit">业务流程列表</div> |
|||
<pageye v-show="list.length > 0" :total="listQuery.total" :page.sync="listQuery.current" :limit.sync="listQuery.size" class="pagination" @pagination="getList"/> |
|||
</div> |
|||
<div class=""> |
|||
<el-table :key="tableKey" v-loading="listLoading" :data="list" border style="width: 100%"> |
|||
<el-table-column width="60" label="序号" type="index" :index="indexMethod" align="center"/> |
|||
<el-table-column width="180" label="操作" align="center"> |
|||
<template slot-scope="scope"> |
|||
<el-button size="small" type="primary" @click="handleUpdate(scope.row)">设置</el-button> |
|||
<el-button size="small" type="danger" @click="handleDelete(scope.row)">删除</el-button> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column label="流程名称" align="center" width="400"> |
|||
<template slot-scope="scope"> |
|||
<span>{{ scope.row.flowName }}</span> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column label="抄送角色" align="left" header-align="center"> |
|||
<template slot-scope="scope"> |
|||
<span>{{ scope.row.roleName }}</span> |
|||
</template> |
|||
</el-table-column> |
|||
</el-table> |
|||
</div> |
|||
<div class="pages"> |
|||
<div class="tit"/> |
|||
<!-- 翻页 --> |
|||
<pagination v-show="list.length > 0" :total="listQuery.total" :page.sync="listQuery.current" :limit.sync="listQuery.size" class="pagination" @pagination="getList"/> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<liuchengchaosongAdd v-show="viewState == 2 ||viewState == 3" ref="divadd" @doback="resetState" @reloadlist="getList" /> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import { pageList, delBySids } from '@/api/system/liuchengchaosong/liuchengchaosong' |
|||
import { pullDown } from '@/api/system/postManage/index' |
|||
import Pagination from '@/components/pagination' |
|||
import pageye from '@/components/pagination/pageye' |
|||
import ButtonBar from '@/components/ButtonBar' |
|||
import liuchengchaosongAdd from './liuchengchaosongAdd' |
|||
|
|||
export default { |
|||
name: 'liuchengchaosong', |
|||
components: { |
|||
Pagination, |
|||
pageye, |
|||
ButtonBar, |
|||
liuchengchaosongAdd |
|||
}, |
|||
data() { |
|||
return { |
|||
btndisabled: false, |
|||
btnList: [ |
|||
{ |
|||
type: 'primary', |
|||
size: 'small', |
|||
icon: 'plus', |
|||
btnKey: 'toAdd', |
|||
btnLabel: '新增' |
|||
}, |
|||
{ |
|||
type: 'info', |
|||
size: 'small', |
|||
icon: 'cross', |
|||
btnKey: 'doClose', |
|||
btnLabel: '关闭' |
|||
} |
|||
], |
|||
isSearchShow: false, |
|||
searchxianshitit: '显示查询条件', |
|||
viewState: 1, // 1、列表 2、添加-车辆预订 3、编辑 4、查看 5、订金-订金收取 |
|||
// 查询 ----------- |
|||
flow_list: [], // 分公司 |
|||
tableKey: 0, |
|||
list: [], |
|||
sids: [], |
|||
FormLoading: false, |
|||
listLoading: false, |
|||
listQuery: { |
|||
current: 1, |
|||
size: 5, |
|||
total: 0, |
|||
params: { |
|||
flowName: '' |
|||
} |
|||
} |
|||
} |
|||
}, |
|||
mounted() { |
|||
this.$refs['btnbar'].setButtonList(this.btnList) |
|||
}, |
|||
created() { |
|||
// 初始化变量 |
|||
this.init() |
|||
// 加载列表 |
|||
this.getList() |
|||
}, |
|||
methods: { |
|||
init() { |
|||
pullDown({ type: 'flow' }).then((res) => { |
|||
if (res.success) { |
|||
this.flow_list = res.data |
|||
} |
|||
}) |
|||
}, |
|||
btnHandle(btnKey) { |
|||
console.log('XXXXXXXXXXXXXXX ' + btnKey) |
|||
switch (btnKey) { |
|||
case 'toAdd': |
|||
this.toAdd() |
|||
break |
|||
case 'doClose': |
|||
this.doClose() |
|||
break |
|||
default: |
|||
break |
|||
} |
|||
}, |
|||
// 搜索条件效果 |
|||
clicksearchShow() { |
|||
this.isSearchShow = !this.isSearchShow |
|||
if (this.isSearchShow) { |
|||
this.searchxianshitit = '隐藏查询条件' |
|||
} else { |
|||
this.searchxianshitit = '显示查询条件' |
|||
} |
|||
}, |
|||
// 序号 |
|||
indexMethod(index) { |
|||
var pagestart = (this.listQuery.current - 1) * this.listQuery.size |
|||
var pageindex = index + 1 + pagestart |
|||
return pageindex |
|||
}, |
|||
// 查询列表信息 |
|||
getList() { |
|||
this.listLoading = true |
|||
this.listQuery.params.orgSidPath = window.sessionStorage.getItem('orgSidPath') |
|||
pageList(this.listQuery).then((response) => { |
|||
this.listLoading = false |
|||
if (response.success) { |
|||
this.list = response.data.records |
|||
this.listQuery.total = response.data.total |
|||
} else { |
|||
this.list = [] |
|||
this.listQuery.total = 0 |
|||
} |
|||
}) |
|||
}, |
|||
// 查询按钮 |
|||
handleFilter() { |
|||
this.listQuery.current = 1 |
|||
this.getList() |
|||
}, |
|||
// 重置 |
|||
handleReset() { |
|||
this.listQuery = { |
|||
current: 1, |
|||
size: 5, |
|||
total: 0, |
|||
params: { |
|||
flowName: '' |
|||
} |
|||
} |
|||
this.getList() |
|||
}, |
|||
toAdd() { |
|||
this.viewState = 2 |
|||
this.$refs['divadd'].showAdd() |
|||
}, |
|||
// 编辑 |
|||
handleUpdate(row) { |
|||
this.viewState = 3 |
|||
this.$refs['divadd'].showEdit(row) |
|||
}, |
|||
handleDelete(row) { |
|||
const tip = '请确认是否删除' |
|||
this.$confirm(tip, '提示', { |
|||
confirmButtonText: '确定', |
|||
cancelButtonText: '取消', |
|||
type: 'warning' |
|||
}).then(() => { |
|||
const aa = [] |
|||
aa.push(row.sid) |
|||
delBySids(aa).then((res) => { |
|||
if (res.success) { |
|||
this.$message({ showClose: true, type: 'success', message: '删除成功' }) |
|||
this.getList() |
|||
} |
|||
}) |
|||
}) |
|||
}, |
|||
resetState() { |
|||
this.viewState = 1 |
|||
}, |
|||
doClose() { |
|||
this.$store.dispatch('tagsView/delView', this.$route) |
|||
this.$router.go(-1) |
|||
} |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style scoped> |
|||
</style> |
Loading…
Reference in new issue