Browse Source

2024-01-06

节点更新,流程干预
master
fengyuan_yang 1 year ago
parent
commit
d5ca313853
  1. 4
      src/api/processManagement/processManagement.js
  2. 2
      src/views/modules/part/partInformation.vue
  3. 502
      src/views/modules/processManagement/processFlowInfo.vue

4
src/api/processManagement/processManagement.js

@ -96,3 +96,7 @@ export const getProcessControlList = data => createAPI(`/plm/request/getProcessC
export const saveProcessControlList = data => createAPI(`/plm/request/saveProcessControlList`,'post',data) export const saveProcessControlList = data => createAPI(`/plm/request/saveProcessControlList`,'post',data)
export const getProcessFlowInformation = data => createAPI(`/plm/request/getProcessFlowInformation`,'post',data)
export const processIntervention = data => createAPI(`/plm/request/processIntervention`,'post',data)

2
src/views/modules/part/partInformation.vue

@ -4840,7 +4840,6 @@
}) })
} }
}) })
}).catch(() => {
}) })
}, },
@ -5375,7 +5374,6 @@
}) })
} }
}) })
}).catch(() => {
}) })
}, },

502
src/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>
Loading…
Cancel
Save