update 企标稽查流程

This commit is contained in:
danshihao
2023-11-28 11:36:19 +08:00
parent e277f6488b
commit bbcd8486c2
14 changed files with 582 additions and 177 deletions
@@ -110,7 +110,11 @@ import InspectionProcessTable
import UserSelectModal from '@comp/selection/UserSelectModal'
import { EsInspectionProcess, ProcessKey } from '@/enums/commonEnums'
import { WorkCenterMixin } from '@/mixins/WorkCenterMixin'
import { getInspectPlanDetail, getInspectPlanProjectId } from '@api/workCenter'
import {
approvalInspectProcess,
getInspectProcessDetail,
getInspectProcessProjectId, saveInspectProcess, startInspectProcess, transferInspectProcess
} from '@api/workCenter'
export default {
name: 'EnterpriseStandardInspectionProcess',
@@ -208,7 +212,7 @@ export default {
getProjectId () {
this.loading = true
// 否则就是创建一个新的流程
getInspectPlanProjectId().then(res => {
getInspectProcessProjectId().then(res => {
if (res) {
this.projectId = res + ''
}
@@ -223,7 +227,7 @@ export default {
const { projectId, taskId } = this.$route.query
this.btn = EsInspectionProcess.propertyOfValue('btn', this.currentNode)
this.loading = true
getInspectPlanDetail({
getInspectProcessDetail({
projectId,
taskId
}).then(res => {
@@ -268,15 +272,12 @@ export default {
personnelObj[key] = personnelObj[key].split(',')
}
}
// 通过表格中的所属部门人员获取稽查征求意见对象
const userList = this.$refs.inspectionPlanTable.dataSource.map(item => item.objectOfConsultation.split(',')).flat(Infinity)
personnelObj.opinionFillList = Array.from(new Set(userList))
}
return personnelObj
},
// 获取页面参数
async getPageParams (isValidate = true) {
if (this.$refs.inspectionPlanTable.dataSource.length === 0) {
if (this.$refs.inspectionProcessTable.dataSource.length === 0) {
this.$message.warning(this.$t('addAtLeastOneRowOfData'))
throw new Error('base')
}
@@ -329,7 +330,7 @@ export default {
taskId: this.$route.query.taskId,
userId
}
Promise.resolve(params).then(res => {
transferInspectProcess(params).then(res => {
if (res.success) {
this.$message.success(res.message)
this.goBack()
@@ -348,7 +349,7 @@ export default {
this.loading = true
this.getPageParams(false).then(res => {
console.log(res)
return Promise.resolve(res)
return saveInspectProcess(res)
}).then(res => {
if (res.success) {
this.$message.success(res.message)
@@ -369,16 +370,22 @@ export default {
if (this.loading) return
this.loading = true
let fn
let pass
switch (this.currentNode) {
case EsInspectionProcess.initiate.value:
fn = Promise.resolve
fn = startInspectProcess
break
default:
fn = Promise.resolve
fn = approvalInspectProcess
pass = true
break
}
this.getPageParams().then(res => {
console.log(res)
// 如果是审批,就默认pass为true
if (pass && res.map) {
res.map.pass = pass
}
return fn && fn(res)
}).then(res => {
if (res.success) {
@@ -401,7 +408,7 @@ export default {
this.loading = true
this.getPageParams().then(res => {
res.map.pass = true
return Promise.resolve(res)
return approvalInspectProcess(res)
}).then(res => {
if (res.success) {
this.$message.success(res.message)
@@ -423,7 +430,7 @@ export default {
this.loading = true
this.getPageParams().then(res => {
res.map.pass = false
return Promise.resolve(res)
return approvalInspectProcess(res)
}).then(res => {
if (res.success) {
this.$message.success(res.message)