[add] 企标稽查计划

This commit is contained in:
danshihao
2023-12-07 15:54:02 +08:00
parent b5318f6882
commit 4d0d039721
7 changed files with 459 additions and 3 deletions
+13 -1
View File
@@ -121,6 +121,14 @@ const transferProcurementProcess = (params) => postAction('/process/fb/processFb
// 抄送
const carbonCopyProcurementProcess = (params) => getAction('/process/fb/processFbStandardPurchase/carbonCopy', params)
/* 企标稽查计划 */
// 详情信息
const getInspectPlanDetail = (params) => getAction('/process/esInspectPlanFlow/queryDetailByProjectId', params)
// 转办
const transferInspectPlan = (params) => getAction('/process/esInspectPlanFlow/flowTransfer', params)
// 审批(通过、驳回)
const approvalInspectPlan = (params) => postAction('/process/esInspectPlanFlow/flowApproval', params)
export {
queryPermissionsByUser,
getFormDictTreeList,
@@ -174,5 +182,9 @@ export {
agreeProcurementProcess,
rejectProcurementProcess,
transferProcurementProcess,
carbonCopyProcurementProcess
carbonCopyProcurementProcess,
getInspectPlanDetail,
transferInspectPlan,
approvalInspectPlan
}
+24
View File
@@ -147,5 +147,29 @@ module.exports = {
pleaseUpload: '请上传',
theFollowingDocuments: 'M以下文件',
file: '文件'
},
// 企标稽查计划
esInspectionPlan: {
inspectionPlan: '稽查计划',
inspectionBasisStandardNumber: '稽查依据标准号',
inspectionBasisStandardName: '稽查依据标准名称',
planInspectionObjects: '计划稽查对象',
mainDutyStandardizationGroup: '主责标准化工作组',
department: '所属部门',
planInspectionDate: '计划稽查日期',
inspectionDirector: '稽查负责人',
standardizationGroupContactPerson: '标准化组对接人',
solicitingOpinionsFrom: '征求意见对象',
remark: '备注',
departmentPersonnel: '所属部门人员',
creator: '创建人',
initiator: '发起人',
departOpinion: '所属部门意见',
opinion: '意见',
writeOpinion: '填写意见',
solicitOpinion: '征求意见',
solicitOpinionObject: '征求意见对象',
isCountersign: '是否会签',
countersignRelevantPersonnel: '会签相关人员'
}
}
+24
View File
@@ -154,5 +154,29 @@ module.exports = {
export: '导出',
goToThePCToExport: '请前往PC端导出',
carbonCopy: '抄送'
},
// 企标稽查计划
esInspectionPlan: {
inspectionPlan: '稽查计划',
inspectionBasisStandardNumber: '稽查依据标准号',
inspectionBasisStandardName: '稽查依据标准名称',
planInspectionObjects: '计划稽查对象',
mainDutyStandardizationGroup: '主责标准化工作组',
department: '所属部门',
planInspectionDate: '计划稽查日期',
inspectionDirector: '稽查负责人',
standardizationGroupContactPerson: '标准化组对接人',
solicitingOpinionsFrom: '征求意见对象',
remark: '备注',
departmentPersonnel: '所属部门人员',
creator: '创建人',
initiator: '发起人',
departOpinion: '所属部门意见',
opinion: '意见',
writeOpinion: '填写意见',
solicitOpinion: '征求意见',
solicitOpinionObject: '征求意见对象',
isCountersign: '是否会签',
countersignRelevantPersonnel: '会签相关人员'
}
}
+1 -1
View File
@@ -1,6 +1,6 @@
<template>
<div>
<van-overlay :show="loading">
<van-overlay :show="loading" :z-index="99999">
<van-loading />
</van-overlay>
<div class="header-switch">
+10 -1
View File
@@ -109,6 +109,15 @@ export const SenderType = {
designEngineer: { text: '设计工程师', value: '2' }
}
// 企标稽查计划
export const EsInspectionPlan = new EsEnums({
initiate: { text: '稽查联络人发起计划', value: 'liaisons_start' },
fillInComments: { text: '稽查征求意见对象填写意见', value: 'opinion_fill' },
liaisonCollect: { text: '稽查联络人汇总', value: 'liaisons_collect' },
relevantPersonnelCountersign: { text: '相关人员会签', value: 'involve_countersign', isMobile: true },
liaisonLeaderApproval: { text: '联络人主管级领导批准', value: 'leader_approval', isMobile: true }
})
// 标准征求意见流程
export const ConsultationProcess = new EsEnums({
initiate: { text: '法规工程师发起', value: 'engineer_start', btn: ['save', 'submit'] },
@@ -128,4 +137,4 @@ export const ProcurementProcessNodes = {
standardLeaderApproval: { text: '标准化主管级领导审批', value: 'Activity_06jy4oo' },
standardSuperiorLeaderApproval: { text: '标准化主管级上一级领导审批', value: 'Activity_1u5337a' },
regulatoryEngineerConfirmation: { text: '法规工程师确认', value: 'Activity_1q01zfq' }
}
}
+10
View File
@@ -69,5 +69,15 @@ export default [
hasBack: true
},
component: () => import('@/views/workCenter/standardProcurementProcess/StandardProcurementProcess')
},
// 企标稽查计划
{
path: '/workCenter/EnterpriseStandardInspectionPlan',
name: 'EnterpriseStandardInspectionPlan',
meta: {
hasNavBar: true,
hasBack: true
},
component: () => import('@/views/workCenter/enterpriseStandardInspectionPlan/EnterpriseStandardInspectionPlanFlow')
}
]
@@ -0,0 +1,377 @@
<template>
<process-common-layout class="page-box" :process-key="processKey" :loading="loading">
<template v-slot:process>
<!-- 流程信息 -->
<div class="process-part">
<div class="process-part-title">{{ $t('processInformation') }}</div>
<van-form
ref="form"
input-align="right"
error-message-align="right">
<!-- 流程名称 -->
<van-field
:label="$t('processName')"
:placeholder="$t('pleaseEnter') + $t('processName')"
readonly
type="textarea"
rows="1"
autosize
:rules="rules.prcName"
v-model="processInfoForm.prcName"/>
<!-- 截止日期 -->
<calendar-field
:label="$t('expirationDate')"
v-model="processInfoForm.dueTime"
readonly
type="date"/>
<!-- 流程说明 -->
<van-field
v-model="processInfoForm.prcMes"
:label="$t('processExplain')"
type="textarea"
autosize
disabled
rows="2"
:placeholder="$t('pleaseEnter')+$t('processExplain')"
:border="false"
input-align="left"
class="vertical-form-item"/>
</van-form>
</div>
<!-- 业务信息 -->
<div class="process-part">
<a-table
row-key="id"
:scroll="{x:'100%', y: '50vh'}"
:columns="columns"
:data-source="dataSource"
:loading="tableLoading"
:pagination="false"/>
</div>
<!-- 流程审批信息 -->
<div class="process-part">
<div class="process-part-title">{{ $t('processApprovalInformation') }}</div>
<van-form
ref="approvalInfoForm"
input-align="right"
error-message-align="right">
<!-- 备注 -->
<van-field
v-model="approvalInfoForm.commitText"
:label="$t('remark')"
:rules="rules.commitText"
name="commitText"
type="textarea"
autosize
rows="2"
:placeholder="$t('pleaseEnter')+$t('remark')"
:border="false"
input-align="left"
class="vertical-form-item"/>
<!--附件-->
<z-upload v-model="approvalInfoForm.commitFile" />
</van-form>
</div>
</template>
<template v-slot:operation>
<!-- 转办 -->
<van-button class="operation-common-btn" @click="handleTurnTo">
<template #icon>
<van-icon class="iconfont" class-prefix="icon" name="xunhuan" />
</template>
{{ $t('turnTo') }}
</van-button>
<!-- 同意 -->
<van-button class="operation-common-btn" type="primary" @click="handleAgree">
<template #icon>
<van-icon class="iconfont" class-prefix="icon" name="check" />
</template>
{{ $t('agree') }}
</van-button>
<!-- 驳回 -->
<van-button class="operation-common-btn light-color-button" @click="handleReject">
<template #icon>
<van-icon class="iconfont" class-prefix="icon" name="close" />
</template>
{{ $t('reject') }}
</van-button>
</template>
<select-user ref="selectUserRef" @selected-change="selectUserChange"></select-user>
</process-common-layout>
</template>
<script>
import ProcessCommonLayout from '@/components/ProcessCommonLayout'
import { EsInspectionPlan, ProcessKey } from '@/enums/commonEnums'
import SelectUser from '@/components/SelectUser'
import CalendarField from '@/components/CalendarField'
import ZUpload from '@/components/ZUpload'
import { approvalInspectPlan, getInspectPlanDetail, transferInspectPlan } from '@/api/api'
import { getAction } from '@/api/manage'
export default {
name: 'EnterpriseStandardInspectionPlanFlow',
components: { ZUpload, CalendarField, SelectUser, ProcessCommonLayout },
data () {
return {
// 流程加载
loading: false,
// 表格加载
tableLoading: false,
processKey: ProcessKey.ES_INSPECTION_PLAN.value,
rules: {
// 备注
commitText: [
{ required: false, message: this.$t('pleaseEnter') + this.$t('remark') }
]
},
// 获取到的流程信息
info: {},
// 流程信息
processInfoForm: {},
// 审批意见信息
approvalInfoForm: {},
// 业务表相关
url: {
list: '/process/processEsInspectPlan/list'
},
columns: [
{
title: this.$t('serialNumber'),
dataIndex: '',
key: 'rowIndex',
align: 'center',
width: 50,
customRender: function (t, r, index) {
return parseInt(index) + 1
}
},
{ // 稽查依据标准号
title: this.$t('esInspectionPlan.inspectionBasisStandardNumber'),
align: 'center',
width: 150,
dataIndex: 'inspectNo'
},
{ // 稽查依据标准名称
title: this.$t('esInspectionPlan.inspectionBasisStandardName'),
align: 'center',
width: 150,
dataIndex: 'inspectName'
},
{ // 计划稽查对象
title: this.$t('esInspectionPlan.planInspectionObjects'),
align: 'center',
width: 120,
dataIndex: 'inspectObject_dictText'
},
{ // 主责标准化工作组
title: this.$t('esInspectionPlan.mainDutyStandardizationGroup'),
align: 'center',
width: 150,
dataIndex: 'standardizationWorkGroup'
},
{ // 所属部门
title: this.$t('esInspectionPlan.department'),
align: 'center',
width: 120,
dataIndex: 'belongDept_dictText'
},
{ // 计划稽查日期
title: this.$t('esInspectionPlan.planInspectionDate'),
align: 'center',
width: 120,
dataIndex: 'planInspectDate'
},
{ // 稽查负责人
title: this.$t('esInspectionPlan.inspectionDirector'),
align: 'center',
width: 120,
dataIndex: 'inspectUserDictText'
},
{ // 标准化组对接人
title: this.$t('esInspectionPlan.standardizationGroupContactPerson'),
align: 'center',
width: 140,
dataIndex: 'standardizationDockingUserDictText'
},
{ // 发起人
title: this.$t('esInspectionPlan.initiator'),
align: 'center',
width: 120,
dataIndex: 'createByDictText'
}
],
dataSource: []
}
},
computed: {
// 当前项目id
projectId () {
return this.$route.query.projectId
}
},
// 组件内路由拦截
beforeRouteEnter (to, from, next) {
// 如果不是移动端支持的节点,就跳转NoMobile
if (!EsInspectionPlan.propertyOfValue('isMobile', to.query.nodeId)) {
next({ path: '/noMobile' })
}
next()
},
created () {
this.loadPage()
},
methods: {
// 加载页面数据
loadPage () {
this.loading = true
const { projectId, taskId } = this.$route.query
Promise.all([
// 获取业务数据
getAction(this.url.list, { projectId }).then(res => {
if (res.success) {
this.dataSource = res.result || []
}
}).finally(() => {}),
// 获取流程数据
getInspectPlanDetail({ projectId, taskId }).then(res => {
if (res.success) {
const data = res.result || {}
this.info = data
const processAll = data.processAll || {}
const processApprovalRecord = data.processApprovalRecord || {}
// 回显流程信息
this.processInfoForm = {
prcName: processAll.prcName,
dueTime: processAll.dueTime,
prcMes: processAll.prcMes
}
// 回显审批信息
this.approvalInfoForm = {
commitText: processApprovalRecord.commitText,
commitFile: processApprovalRecord.commitFile
}
}
}).finally(() => {})
]).finally(() => {
this.loading = false
})
},
// 转办
handleTurnTo () {
if (this.loading) return
// 点击显示选人组件
this.$refs.selectUserRef.open()
},
// 转办选完人的回调
selectUserChange (userIds) {
this.loading = true
const param = {}
param.userId = userIds
param.taskId = this.$route.query.taskId
transferInspectPlan(param).then(res => {
if (res.success) {
this.$message.success(res.message)
this.goBack()
} else {
this.$message.fail(res.message)
}
}).finally(() => {
this.loading = false
})
},
// 获取页面参数
async getPageParams () {
const params = {}
let validateError = null
// 流程信息
params.processAll = Object.assign({}, this.info.processAll, {
projectId: this.projectId,
taskId: this.$route.query.taskId
})
// 审批意见
await this.$refs.approvalInfoForm.validate().then(() => {
params.processApprovalRecord = Object.assign({}, this.info.processApprovalRecord, this.approvalInfoForm, {
projectId: this.projectId
})
}).catch(err => {
// 验证失败滚动到验证失败的位置
console.log(err)
validateError = err
this.$refs.approvalInfoForm.scrollToField(err[0].name)
})
// 验证失败就返回一个错误
if (validateError) {
throw new Error(validateError)
}
// 其他参数
params.map = {}
return params
},
// 同意
handleAgree () {
if (this.loading) return
this.loading = true
this.rules.commitText[0].required = false
this.getPageParams().then(params => {
params.map.pass = true
// 如果没有填写注释,就默认同意
if (!params.processApprovalRecord.commitText) {
params.processApprovalRecord.commitText = '同意'
}
console.log(params)
return approvalInspectPlan(params)
}).then(res => {
if (res.success) {
this.$message.success(res.message)
this.goBack()
} else {
this.$message.fail(res.message)
}
}).catch((err) => {
console.log(err)
}).finally(() => {
this.loading = false
})
},
// 驳回
handleReject () {
if (this.loading) return
this.rules.commitText[0].required = true
// 驳回需要填写备注
if (!this.approvalInfoForm.commitText) {
this.$message.fail(this.$t('pleaseEnterRemarks'))
}
this.getPageParams().then(params => {
params.map.pass = false
console.log(params)
return approvalInspectPlan(params)
}).then(res => {
if (res.success) {
this.$message.success(res.message)
this.goBack()
} else {
this.$message.fail(res.message)
}
}).catch((err) => {
console.log(err)
}).finally(() => {
this.loading = false
this.rules.commitText[0].required = false
})
},
goBack () {
// this.$router.go(-1)
}
}
}
</script>
<style scoped lang="less">
@import '~@/assets/less/common.less';
</style>