3 changed files with 506 additions and 2 deletions
-
4src/api/processManagement/processManagement.js
-
2src/views/modules/part/partInformation.vue
-
502src/views/modules/processManagement/processFlowInfo.vue
@ -0,0 +1,502 @@ |
|||
<template> |
|||
<div class="mod-config"> |
|||
<el-form :inline="true" label-position="top" :model="searchData"> |
|||
<el-form-item :label="'单据号'"> |
|||
<el-input v-model="searchData.documentNo" clearable style="width: 120px"></el-input> |
|||
</el-form-item> |
|||
<el-form-item :label="'流程ID'"> |
|||
<el-input v-model="searchData.workflowId" clearable style="width: 80px"></el-input> |
|||
</el-form-item> |
|||
<el-form-item :label="'流程名称'"> |
|||
<el-input v-model="searchData.workflowName" clearable style="width: 200px"></el-input> |
|||
</el-form-item> |
|||
<el-form-item :label="'当前节点ID'"> |
|||
<el-input v-model="searchData.nodeId" clearable style="width: 80px"></el-input> |
|||
</el-form-item> |
|||
<el-form-item :label="'当前节点名称'"> |
|||
<el-input v-model="searchData.nodeName" clearable style="width: 200px"></el-input> |
|||
</el-form-item> |
|||
<el-form-item :label="'流程创建人'"> |
|||
<el-input v-model="searchData.createBy" clearable style="width: 100px"></el-input> |
|||
</el-form-item> |
|||
<el-form-item :label="'当前节点审批人'"> |
|||
<el-input v-model="searchData.updateBy" clearable style="width: 100px"></el-input> |
|||
</el-form-item> |
|||
<el-form-item :label="' '"> |
|||
<el-button type="primary" @click="getDataList()">查询</el-button> |
|||
<download-excel |
|||
:fields="fields()" |
|||
:data="exportData" |
|||
type="xls" |
|||
:name="exportName" |
|||
:header="exportHeader" |
|||
:footer="exportFooter" |
|||
:fetch="createExportData" |
|||
:before-generate="startDownload" |
|||
:before-finish="finishDownload" |
|||
worksheet="导出信息" |
|||
class="el-button el-button--primary el-button--medium"> |
|||
{{ "导出" }} |
|||
</download-excel> |
|||
<el-button type="primary" @click="processIntervention()">节点更新</el-button> |
|||
<el-button type="primary" @click="processIntervention2()">流程干预</el-button> |
|||
</el-form-item> |
|||
</el-form> |
|||
|
|||
<el-table |
|||
:height="height" |
|||
:data="dataList" |
|||
border |
|||
ref="processTable" |
|||
:row-style="rowStyle" |
|||
@row-click="processClickRow" |
|||
@selection-change="selectionProcess" |
|||
style="width: 100%;"> |
|||
<el-table-column |
|||
type="selection" |
|||
header-align="center" |
|||
align="center" |
|||
width="50"> |
|||
</el-table-column> |
|||
<el-table-column |
|||
v-for="(item,index) in columnList" :key="index" |
|||
:sortable="item.columnSortable" |
|||
:prop="item.columnProp" |
|||
:header-align="item.headerAlign" |
|||
:show-overflow-tooltip="item.showOverflowTooltip" |
|||
:align="item.align" |
|||
:fixed="item.fixed==''?false:item.fixed" |
|||
:min-width="item.columnWidth" |
|||
:label="item.columnLabel"> |
|||
<template slot-scope="scope"> |
|||
<span v-if="!item.columnHidden">{{ scope.row[item.columnProp] }}</span> |
|||
<span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span> |
|||
</template> |
|||
</el-table-column> |
|||
</el-table> |
|||
|
|||
<selectDiv ref="selectDiv"></selectDiv> |
|||
|
|||
<!-- 分页栏 --> |
|||
<el-pagination style="margin-top: 0px" |
|||
@size-change="sizeChangeHandle" |
|||
@current-change="currentChangeHandle" |
|||
:current-page="pageIndex" |
|||
:page-sizes="[20, 50, 100, 200, 500]" |
|||
:page-size="pageSize" |
|||
:total="totalPage" |
|||
layout="total, sizes, prev, pager, next, jumper"> |
|||
</el-pagination> |
|||
|
|||
</div> |
|||
</template> |
|||
|
|||
|
|||
<script> |
|||
import { |
|||
getProcessFlowInformation, // 流程流转信息 |
|||
processIntervention, // 流程干预 |
|||
} from '@/api/processManagement/processManagement.js' |
|||
import Chooselist from '@/views/modules/common/Chooselist' |
|||
export default { |
|||
components: { |
|||
Chooselist |
|||
}, |
|||
data () { |
|||
return { |
|||
// 导出 |
|||
exportData: [], |
|||
exportName: '制造商' + this.dayjs().format('YYYYMMDDHHmmss'), |
|||
exportHeader: ['制造商'], |
|||
exportFooter: [], |
|||
resultList: [], |
|||
// ======== 行高 ======== |
|||
height: 200, |
|||
// ======== 分页 ======== |
|||
pageIndex: 1, |
|||
pageSize: 50, |
|||
totalPage: 0, |
|||
// 条件查询 |
|||
searchData: { |
|||
site: this.$store.state.user.site, |
|||
workflowId: '', |
|||
workflowName: '', |
|||
nodeId: '', |
|||
nodeName: '', |
|||
documentNo: '', |
|||
page: 1, |
|||
limit: 10 |
|||
}, |
|||
// ======== 复选数据集 ======== |
|||
processSelections: [], |
|||
// ======== 选中的当前行数据 ======== |
|||
processCurrentRow: {}, |
|||
// ======== 数据列表 ======== |
|||
dataList: [], |
|||
// 展示列集 |
|||
columnList: [ |
|||
{ |
|||
userId: this.$store.state.user.name, |
|||
functionId: 109002, |
|||
serialNumber: '109002Table1DocumentNo', |
|||
tableId: "109002Table1", |
|||
tableName: "流程流转信息表", |
|||
columnProp: 'documentNo', |
|||
headerAlign: "center", |
|||
align: "left", |
|||
columnLabel: '单据号', |
|||
columnHidden: false, |
|||
columnImage: false, |
|||
columnSortable: false, |
|||
sortLv: 0, |
|||
status: true, |
|||
fixed: '', |
|||
columnWidth: 120 |
|||
}, |
|||
{ |
|||
userId: this.$store.state.user.name, |
|||
functionId: 109002, |
|||
serialNumber: '109002Table1WorkflowId', |
|||
tableId: "109002Table1", |
|||
tableName: "流程流转信息表", |
|||
columnProp: 'workflowId', |
|||
headerAlign: "center", |
|||
align: "left", |
|||
columnLabel: '流程ID', |
|||
columnHidden: false, |
|||
columnImage: false, |
|||
columnSortable: false, |
|||
sortLv: 0, |
|||
status: true, |
|||
fixed: '', |
|||
columnWidth: 80 |
|||
}, |
|||
{ |
|||
userId: this.$store.state.user.name, |
|||
functionId: 109002, |
|||
serialNumber: '109002Table1WorkflowName', |
|||
tableId: "109002Table1", |
|||
tableName: "流程流转信息表", |
|||
columnProp: 'workflowName', |
|||
headerAlign: "center", |
|||
align: "left", |
|||
columnLabel: '流程名称', |
|||
columnHidden: false, |
|||
columnImage: false, |
|||
columnSortable: false, |
|||
sortLv: 0, |
|||
status: true, |
|||
fixed: '', |
|||
columnWidth: 200 |
|||
}, |
|||
{ |
|||
functionId: 109002, |
|||
serialNumber: '109002Table1NodeId', |
|||
tableId: '109002Table1', |
|||
tableName: '流程流转信息表', |
|||
columnProp: 'nodeId', |
|||
headerAlign: 'center', |
|||
align: 'left', |
|||
columnLabel: '当前节点ID', |
|||
columnHidden: false, |
|||
columnImage: false, |
|||
columnSortable: false, |
|||
sortLv: 0, |
|||
status: true, |
|||
fixed: '', |
|||
columnWidth: 80 |
|||
}, |
|||
{ |
|||
userId: this.$store.state.user.name, |
|||
functionId: 109002, |
|||
serialNumber: '109002Table1NodeName', |
|||
tableId: '109002Table1', |
|||
tableName: '流程流转信息表', |
|||
columnProp: 'nodeName', |
|||
headerAlign: 'center', |
|||
align: 'left', |
|||
columnLabel: '当前节点名称', |
|||
columnHidden: false, |
|||
columnImage: false, |
|||
columnSortable: false, |
|||
sortLv: 0, |
|||
status: true, |
|||
fixed: '', |
|||
columnWidth: 200 |
|||
}, |
|||
{ |
|||
userId: this.$store.state.user.name, |
|||
functionId: 109002, |
|||
serialNumber: '109002Table1RejectFlagDesc', |
|||
tableId: "109002Table1", |
|||
tableName: "流程流转信息表", |
|||
columnProp: 'rejectFlagDesc', |
|||
headerAlign: "center", |
|||
align: "center", |
|||
columnLabel: '是否被驳回', |
|||
columnHidden: false, |
|||
columnImage: false, |
|||
columnSortable: false, |
|||
sortLv: 0, |
|||
status: true, |
|||
fixed: '', |
|||
columnWidth: 80 |
|||
}, |
|||
{ |
|||
userId: this.$store.state.user.name, |
|||
functionId: 109002, |
|||
serialNumber: '109002Table1RejectOpinion', |
|||
tableId: "109002Table1", |
|||
tableName: "流程流转信息表", |
|||
columnProp: 'rejectOpinion', |
|||
headerAlign: "center", |
|||
align: "left", |
|||
columnLabel: '驳回意见', |
|||
columnHidden: false, |
|||
columnImage: false, |
|||
columnSortable: false, |
|||
sortLv: 0, |
|||
status: true, |
|||
fixed: '', |
|||
columnWidth: 200 |
|||
}, |
|||
{ |
|||
userId: this.$store.state.user.name, |
|||
functionId: 109002, |
|||
serialNumber: '109002Table1CreateBy', |
|||
tableId: "109002Table1", |
|||
tableName: "流程流转信息表", |
|||
columnProp: 'createBy', |
|||
headerAlign: "center", |
|||
align: "center", |
|||
columnLabel: '流程创建人', |
|||
columnHidden: false, |
|||
columnImage: false, |
|||
columnSortable: false, |
|||
sortLv: 0, |
|||
status: true, |
|||
fixed: '', |
|||
columnWidth: 100 |
|||
}, |
|||
{ |
|||
userId: this.$store.state.user.name, |
|||
functionId: 109002, |
|||
serialNumber: '109002Table1CreateDate', |
|||
tableId: "109002Table1", |
|||
tableName: "流程流转信息表", |
|||
columnProp: 'createDate', |
|||
headerAlign: "center", |
|||
align: "center", |
|||
columnLabel: '流程创建时间', |
|||
columnHidden: false, |
|||
columnImage: false, |
|||
columnSortable: false, |
|||
sortLv: 0, |
|||
status: true, |
|||
fixed: '', |
|||
columnWidth: 170 |
|||
}, |
|||
{ |
|||
userId: this.$store.state.user.name, |
|||
functionId: 109002, |
|||
serialNumber: '109002Table1UpdateBy', |
|||
tableId: "109002Table1", |
|||
tableName: "流程流转信息表", |
|||
columnProp: 'updateBy', |
|||
headerAlign: "center", |
|||
align: "center", |
|||
columnLabel: '当前节点审批人', |
|||
columnHidden: false, |
|||
columnImage: false, |
|||
columnSortable: false, |
|||
sortLv: 0, |
|||
status: true, |
|||
fixed: '', |
|||
columnWidth: 100 |
|||
}, |
|||
], |
|||
} |
|||
}, |
|||
|
|||
mounted () { |
|||
this.$nextTick(() => { |
|||
this.height = window.innerHeight - 170 |
|||
}) |
|||
}, |
|||
|
|||
created () { |
|||
this.getDataList() |
|||
}, |
|||
|
|||
methods: { |
|||
rowStyle ({row}) { |
|||
if (this.processCurrentRow.id === row.id) { |
|||
return { 'background-color': '#E8F7F6', cursor: 'pointer' } |
|||
} |
|||
}, |
|||
|
|||
// 单机选中物料信息 |
|||
processClickRow (row,column) { |
|||
this.processCurrentRow = JSON.parse(JSON.stringify(row)) |
|||
}, |
|||
|
|||
// 复选物料信息 |
|||
selectionProcess (val) { |
|||
this.processSelections = val |
|||
this.$refs.selectDiv.setLengthselected(this.processSelections.length) |
|||
}, |
|||
|
|||
// 每页数 |
|||
sizeChangeHandle (val) { |
|||
this.pageSize = val |
|||
this.pageIndex = 1 |
|||
this.getDataList() |
|||
}, |
|||
|
|||
// 当前页 |
|||
currentChangeHandle (val) { |
|||
this.pageIndex = val |
|||
this.getDataList() |
|||
}, |
|||
|
|||
// 获取数据列表 |
|||
getDataList () { |
|||
this.searchData.limit = this.pageSize |
|||
this.searchData.page = this.pageIndex |
|||
getProcessFlowInformation(this.searchData).then(({data}) => { |
|||
if (data.code === 0) { |
|||
this.dataList = data.page.list |
|||
this.pageIndex = data.page.currPage |
|||
this.pageSize = data.page.pageSize |
|||
this.totalPage = data.page.totalCount |
|||
this.$refs.selectDiv.setLengthAll( this.dataList.length) |
|||
// 判断是否全部存在数据 |
|||
if (this.dataList.length > 0) { |
|||
// 设置选中行 |
|||
this.$refs.processTable.setCurrentRow(this.dataList[0]) |
|||
this.processClickRow(this.dataList[0]) |
|||
} else { |
|||
this.processCurrentRow = {} |
|||
} |
|||
} |
|||
}) |
|||
}, |
|||
|
|||
// 节点更新 |
|||
processIntervention () { |
|||
if (this.processSelections.length === 0) { |
|||
this.$message.warning('请勾选要更新的流程流转信息!') |
|||
return |
|||
} |
|||
// 获取第一个对象的单据类型作为参考 |
|||
const firstItem = this.processSelections[0] |
|||
const firstDocumentType = firstItem.documentType |
|||
if (!this.processSelections.every(item => item.documentType === firstDocumentType)) { |
|||
this.$message.warning('所选流程流转信息的单据类型必须一致!') |
|||
return |
|||
} |
|||
this.$confirm(`是否更新这 `+ this.processSelections.length +` 条流程流转信息?`, '提示', { |
|||
confirmButtonText: '确定', |
|||
cancelButtonText: '取消', |
|||
type: 'warning' |
|||
}).then(() => { |
|||
let tempData = { |
|||
processFlag: 'update', |
|||
userId: this.$store.state.user.name, |
|||
informationList: this.processSelections |
|||
} |
|||
processIntervention(tempData).then(({data}) => { |
|||
if (data && data.code === 0) { |
|||
this.getDataList() |
|||
this.processSelections = [] |
|||
this.$message({ |
|||
message: '操作成功', |
|||
type: 'success', |
|||
duration: 1500, |
|||
onClose: () => {} |
|||
}) |
|||
} else { |
|||
this.$alert(data.msg, '错误', { |
|||
confirmButtonText: '确定' |
|||
}) |
|||
} |
|||
}) |
|||
}) |
|||
}, |
|||
|
|||
// 流程干预 |
|||
processIntervention2 () { |
|||
if (this.processSelections.length === 0) { |
|||
this.$message.warning('请勾选要干预的流程流转信息!') |
|||
return |
|||
} |
|||
// 获取第一个对象的单据类型作为参考 |
|||
const firstItem = this.processSelections[0] |
|||
const firstDocumentType = firstItem.documentType |
|||
if (!this.processSelections.every(item => item.documentType === firstDocumentType)) { |
|||
this.$message.warning('所选流程流转信息的单据类型必须一致!') |
|||
return |
|||
} |
|||
this.$confirm(`是否干预这 `+ this.processSelections.length +` 条流程流转信息?`, '提示', { |
|||
confirmButtonText: '确定', |
|||
cancelButtonText: '取消', |
|||
type: 'warning' |
|||
}).then(() => { |
|||
let tempData = { |
|||
processFlag: 'intervention', |
|||
userId: this.$store.state.user.name, |
|||
informationList: this.processSelections |
|||
} |
|||
processIntervention(tempData).then(({data}) => { |
|||
if (data && data.code === 0) { |
|||
this.getDataList() |
|||
this.processSelections = [] |
|||
this.$message({ |
|||
message: '操作成功', |
|||
type: 'success', |
|||
duration: 1500, |
|||
onClose: () => {} |
|||
}) |
|||
} else { |
|||
this.$alert(data.msg, '错误', { |
|||
confirmButtonText: '确定' |
|||
}) |
|||
} |
|||
}) |
|||
}) |
|||
}, |
|||
|
|||
//导出excel |
|||
async createExportData() { |
|||
this.searchData.limit = -1 |
|||
this.searchData.page = 1 |
|||
await getProcessFlowInformation(this.searchData).then(({data}) => { |
|||
this.exportList= data.page.list |
|||
}) |
|||
return this.exportList |
|||
}, |
|||
startDownload() {}, |
|||
finishDownload() {}, |
|||
fields() { |
|||
let json = "{" |
|||
this.columnList.forEach((item, index) => { |
|||
if (index == this.columnList.length - 1) { |
|||
json += "\"" + item.columnLabel + "\"" + ":" + "\"" + item.columnProp + "\"" |
|||
} else { |
|||
json += "\"" + item.columnLabel + "\"" + ":" + "\"" + item.columnProp + "\"" + "," |
|||
} |
|||
}) |
|||
json += "}" |
|||
let s = eval("(" + json + ")") |
|||
return s |
|||
}, |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style scoped lang="scss"> |
|||
/deep/ .customer-tab .el-tabs__content { |
|||
padding: 0px !important; |
|||
height: 459px; |
|||
} |
|||
</style> |
|||
Write
Preview
Loading…
Cancel
Save
Reference in new issue