update 企标稽查计划
This commit is contained in:
+284
-79
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<internal-detail-page :title="pageTitle" :content-padding="0">
|
||||
<internal-detail-page :title="pageTitle" :content-padding="0" :loading="loading">
|
||||
<!-- 标题右侧tab -->
|
||||
<template v-slot:titleRightCustom>
|
||||
<div class="table-operator-tab">
|
||||
@@ -27,7 +27,7 @@
|
||||
@change="event => event.target.value = event.target.value.trim()"
|
||||
:disabled="disabled || processDisabled"
|
||||
:maxLength="50"
|
||||
v-decorator="['processName', validatorRules.processName]" />
|
||||
v-decorator="['prcName', validatorRules.processName]" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
@@ -37,7 +37,7 @@
|
||||
style="width: 100%"
|
||||
:disabled="disabled || processDisabled"
|
||||
value-format="YYYY-MM-DD"
|
||||
v-decorator="['expirationDate']" />
|
||||
v-decorator="['dueTime']" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
@@ -47,7 +47,7 @@
|
||||
:maxLength="500"
|
||||
:rows="4"
|
||||
:disabled="disabled || processDisabled"
|
||||
v-decorator="['processExplain']" />
|
||||
v-decorator="['prcMes']" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
@@ -55,9 +55,9 @@
|
||||
|
||||
<!-- 业务基本信息 -->
|
||||
<div class="process-part-title">{{ $t('basicServiceInformation') }}</div>
|
||||
<inspection-plan-table :current-node="currentNode" />
|
||||
<inspection-plan-table ref="inspectionPlanTable" :current-node="currentNode" />
|
||||
<!-- 会签表单 -->
|
||||
<a-form :form="countersignForm" v-if="currentNode === '3'">
|
||||
<a-form :form="countersignForm" v-if="currentNode === EsInspectionPlan.liaisonCollect.value">
|
||||
<a-row type="flex">
|
||||
<a-col :span="12">
|
||||
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('workCenter.esInspectionPlan.isCountersign')">
|
||||
@@ -65,7 +65,7 @@
|
||||
type="radio"
|
||||
dictCode="yn"
|
||||
@change="changeIsCountersign"
|
||||
v-decorator="['isCountersign', validatorRules.isCountersign]" />
|
||||
v-decorator="['pass', validatorRules.isCountersign]" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12"></a-col>
|
||||
@@ -73,7 +73,7 @@
|
||||
<a-form-item v-if="isCountersign" :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('workCenter.esInspectionPlan.countersignRelevantPersonnel')">
|
||||
<user-selection :placeholder="$t('pleaseSelect') + $t('workCenter.esInspectionPlan.countersignRelevantPersonnel')"
|
||||
type="checkbox"
|
||||
v-decorator="['countersignRelevantPersonnel', validatorRules.countersignRelevantPersonnel]" />
|
||||
v-decorator="['involveList', validatorRules.countersignRelevantPersonnel]" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
@@ -86,92 +86,66 @@
|
||||
<a-textarea :placeholder="$t('pleaseEnter') + $t('remarks')"
|
||||
:maxLength="500"
|
||||
:rows="4"
|
||||
v-decorator="['remarks', validatorRules.remarks]" />
|
||||
v-decorator="['commitText', validatorRules.remarks]" />
|
||||
</a-form-item>
|
||||
<!--附件-->
|
||||
<a-form-item :labelCol="longLabelCol" :wrapperCol="longWrapperCol" :label="$t('businessSupport.questionAnswer.attach')">
|
||||
<j-upload v-decorator="['file']" return-id />
|
||||
<j-upload v-decorator="['commitFile']" return-id />
|
||||
</a-form-item>
|
||||
</a-form>
|
||||
</div>
|
||||
<!-- 人员信息 -->
|
||||
<div v-if="switchValue === 'user'" class="detail-page-scroll-content p-0">
|
||||
<process-detail-list :url="url">
|
||||
<personnel-info slot="personnelInfo" :data="personnelInfoData" :currentNode="currentNode"></personnel-info>
|
||||
<div v-show="switchValue === 'user'" class="detail-page-scroll-content p-0">
|
||||
<process-detail-list>
|
||||
<template #personnelInfo>
|
||||
<personnel-info ref="personnelInfo" :data="personnelInfoData" />
|
||||
</template>
|
||||
</process-detail-list>
|
||||
</div>
|
||||
|
||||
<div class="detail-page-bottom-operate-box">
|
||||
<a-button type="primary" :loading="loading" @click="handleSave" ghost><i class="iconfont icon-save" />{{ $t('preservation') }}</a-button>
|
||||
<a-button type="primary" :loading="loading" @click="handleSubmit" icon="upload">{{ $t('submit') }}</a-button>
|
||||
<a-button type="primary" :loading="loading" @click="handleAgree" icon="check-circle">{{ $t('agree') }}</a-button>
|
||||
<!--转办-->
|
||||
<a-button v-if="1 & btn" type="primary" :loading="loading" @click="handleTurnTo" ghost icon="arrow-up">{{ $t('turnTo') }}</a-button>
|
||||
<!--保存-->
|
||||
<a-button v-if="2 & btn" type="primary" :loading="loading" @click="handleSave" ghost><i class="iconfont icon-save" />{{ $t('preservation') }}</a-button>
|
||||
<!--提交-->
|
||||
<a-button v-if="4 & btn" type="primary" :loading="loading" @click="handleSubmit" icon="upload">{{ $t('submit') }}</a-button>
|
||||
<!--同意-->
|
||||
<a-button v-if="8 & btn" type="primary" :loading="loading" @click="handleAgree" icon="check-circle">{{ $t('agree') }}</a-button>
|
||||
<!--驳回-->
|
||||
<a-button v-if="16 & btn" type="primary" :loading="loading" @click="handleReject" icon="close-circle">{{ $t('reject') }}</a-button>
|
||||
</div>
|
||||
<!--转办选人-->
|
||||
<user-select-modal ref="userSelectModal" check-required @change="continueTurnTo" />
|
||||
</internal-detail-page>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import '@assets/less/common.less'
|
||||
import Vue from 'vue'
|
||||
import InternalDetailPage from '@comp/InternalDetailPage'
|
||||
import PersonnelInfo from '@comp/PersonnelInfo'
|
||||
import ProcessDetailList from '@comp/ProcessDetailList'
|
||||
import { USER_INFO } from '@/store/mutation-types'
|
||||
import InspectionPlanTable from '@views/workCenter/enterpriseStandardInspectionPlan/modules/InspectionPlanTable'
|
||||
import UserSelection from '@comp/selection/UserSelection'
|
||||
|
||||
const { realname, username } = Vue.ls.get(USER_INFO)
|
||||
// 标准立项的人员信息
|
||||
const approvalPersonalInfo = [ // 人员信息的数据
|
||||
{
|
||||
id: 1,
|
||||
nodeName: '稽查联络人发起计划',
|
||||
nodeRoleName: '稽查联络人',
|
||||
canChoose: false,
|
||||
userList: `${realname}(${username})`
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
nodeName: '稽查征求意见对象填写征求意见',
|
||||
nodeRoleName: '征求意见对象',
|
||||
canChoose: true,
|
||||
chooseType: 'checkbox',
|
||||
// chooseSource: 'contactManage',
|
||||
fieldName: 'contactUser'
|
||||
},
|
||||
{
|
||||
id: 3,
|
||||
nodeName: '稽查联络人汇总',
|
||||
nodeRoleName: '稽查联络人',
|
||||
canChoose: true,
|
||||
chooseType: 'checkbox',
|
||||
// chooseSource: 'contactManage',
|
||||
fieldName: 'contactUser'
|
||||
},
|
||||
{
|
||||
id: 4,
|
||||
nodeName: '相关人员会签',
|
||||
nodeRoleName: '相关人员',
|
||||
canChoose: true,
|
||||
chooseType: 'checkbox',
|
||||
// chooseSource: 'contactManage',
|
||||
fieldName: 'contactUser'
|
||||
},
|
||||
{
|
||||
id: 5,
|
||||
nodeName: '联络人主管级领导批准',
|
||||
nodeRoleName: '联络人主管级领导',
|
||||
canChoose: true,
|
||||
chooseType: 'radio',
|
||||
// chooseSource: 'contactManage',
|
||||
fieldName: 'contactUser'
|
||||
}
|
||||
]
|
||||
import { WorkCenterMixin } from '@/mixins/WorkCenterMixin'
|
||||
import { EsInspectionPlan, ProcessKey } from '@/enums/commonEnums'
|
||||
import {
|
||||
approvalInspectPlan,
|
||||
getInspectPlanDetail,
|
||||
getInspectPlanProjectId,
|
||||
refusalInspectPlan,
|
||||
saveInspectPlan,
|
||||
startInspectPlan, transferInspectPlan
|
||||
} from '@api/workCenter'
|
||||
import UserSelectModal from '@comp/selection/UserSelectModal'
|
||||
|
||||
export default {
|
||||
name: 'EnterpriseStandardInspectionPlanFlow',
|
||||
components: { UserSelection, InspectionPlanTable, ProcessDetailList, PersonnelInfo, InternalDetailPage },
|
||||
components: { UserSelectModal, UserSelection, InspectionPlanTable, ProcessDetailList, PersonnelInfo, InternalDetailPage },
|
||||
mixins: [WorkCenterMixin],
|
||||
data () {
|
||||
return {
|
||||
EsInspectionPlan,
|
||||
loading: false,
|
||||
switchValue: 'base',
|
||||
disabled: false,
|
||||
@@ -191,8 +165,10 @@ export default {
|
||||
xs: { span: 24 },
|
||||
sm: { span: 22 }
|
||||
},
|
||||
currentNode: '4',
|
||||
personnelInfoData: [], // 人员信息数据
|
||||
currentNode: '',
|
||||
// 项目id
|
||||
projectId: '',
|
||||
btn: 0,
|
||||
validatorRules: {
|
||||
// 流程名称
|
||||
processName: {
|
||||
@@ -222,6 +198,7 @@ export default {
|
||||
validateTrigger: 'change'
|
||||
}
|
||||
},
|
||||
// 流程基本信息
|
||||
processInfoForm: this.$form.createForm(this),
|
||||
countersignForm: this.$form.createForm(this),
|
||||
approvalInfoForm: this.$form.createForm(this),
|
||||
@@ -234,27 +211,237 @@ export default {
|
||||
},
|
||||
computed: {
|
||||
pageTitle () {
|
||||
return this.$t('flowCenter') + this.$route.meta.title
|
||||
return this.$t('flowCenter') + this.$route.meta.title + '(' + this.subTitle + ')'
|
||||
},
|
||||
subTitle () {
|
||||
return this.$route.query.taskName || this.$t('workCenter.esInspectionPlan.node1')
|
||||
},
|
||||
processDisabled () {
|
||||
return +this.currentNode > 1
|
||||
return this.currentNode !== EsInspectionPlan.initiate.value
|
||||
}
|
||||
},
|
||||
created () {
|
||||
// 查询人员信息
|
||||
this.getPersonInfoStructure(ProcessKey.ES_Inspection_Plan.value)
|
||||
// 如果是待办进来,就获取详情数据
|
||||
const { projectId, taskId } = this.$route.query
|
||||
if (projectId || taskId) {
|
||||
this.loadPage({ projectId, taskId })
|
||||
return
|
||||
}
|
||||
// 否则就是创建一个新的流程
|
||||
getInspectPlanProjectId().then(res => {
|
||||
if (res) {
|
||||
this.projectId = res
|
||||
this.currentNode = EsInspectionPlan.initiate.value
|
||||
this.btn = EsInspectionPlan.initiate.btn
|
||||
}
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
/**
|
||||
* 获取页面详情
|
||||
*/
|
||||
loadPage (params) {
|
||||
this.currentNode = this.$route.query.nodeId
|
||||
this.projectId = this.$route.query.projectId
|
||||
switch (this.currentNode) {
|
||||
case EsInspectionPlan.initiate.value:
|
||||
this.btn = EsInspectionPlan.initiate.btn
|
||||
break
|
||||
case EsInspectionPlan.fillInComments.value:
|
||||
this.btn = EsInspectionPlan.fillInComments.btn
|
||||
break
|
||||
case EsInspectionPlan.liaisonCollect.value:
|
||||
this.btn = EsInspectionPlan.liaisonCollect.btn
|
||||
break
|
||||
case EsInspectionPlan.relevantPersonnelCountersign.value:
|
||||
this.btn = EsInspectionPlan.relevantPersonnelCountersign.btn
|
||||
break
|
||||
case EsInspectionPlan.liaisonLeaderApproval.value:
|
||||
this.btn = EsInspectionPlan.liaisonLeaderApproval.btn
|
||||
break
|
||||
}
|
||||
getInspectPlanDetail(params).then(res => {
|
||||
if (res.success) {
|
||||
const data = res.result || {}
|
||||
this.processInfoForm.setFieldsValue({
|
||||
prcName: data.processAll.prcName,
|
||||
dueTime: data.processAll.dueTime,
|
||||
prcMes: data.processAll.prcMes
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
switchChange (value) {
|
||||
this.switchValue = value
|
||||
},
|
||||
handleSave () {
|
||||
// if (this.loading) return
|
||||
|
||||
// 获取页面参数
|
||||
getPageParams (isValidate = true) {
|
||||
return new Promise((resolve, reject) => {
|
||||
// 人员信息的数据, 处理成对象
|
||||
const personnelObj = this.$refs.personnelInfo.getDataObjVerify()
|
||||
// List拆成数组
|
||||
for (const key in personnelObj) {
|
||||
if (key.includes('List')) {
|
||||
personnelObj[key] = personnelObj[key].split(',')
|
||||
}
|
||||
}
|
||||
// 获取表格数据
|
||||
const params = {
|
||||
processEsInspectPlanList: this.$refs.inspectionPlanTable.getData()
|
||||
}
|
||||
if (isValidate) {
|
||||
this.validateFormList(
|
||||
this.processInfoForm,
|
||||
this.countersignForm,
|
||||
this.approvalInfoForm
|
||||
).then(res => {
|
||||
params.processAll = res[0]
|
||||
if (params.processAll.dueTime && params.processAll.dueTime.includes(' 00:00:00')) {
|
||||
params.processAll.dueTime = params.processAll.dueTime + ' 00:00:00'
|
||||
}
|
||||
params.processAll.projectId = this.projectId
|
||||
params.processAll.taskId = this.$route.query.taskId
|
||||
params.processApprovalRecord = res[2]
|
||||
params.processApprovalRecord.projectId = this.projectId
|
||||
params.map = {}
|
||||
Object.assign(params.map, res[1], personnelObj)
|
||||
params.map.pass = params.map.pass === '1'
|
||||
resolve(params)
|
||||
}).catch(err => {
|
||||
reject(err)
|
||||
})
|
||||
} else {
|
||||
params.processAll = this.processInfoForm.getFieldsValue()
|
||||
if (params.processAll.dueTime && params.processAll.dueTime.includes(' 00:00:00')) {
|
||||
params.processAll.dueTime = params.processAll.dueTime + ' 00:00:00'
|
||||
}
|
||||
params.processAll.projectId = this.projectId
|
||||
params.processApprovalRecord = this.approvalInfoForm.getFieldsValue()
|
||||
params.processApprovalRecord.projectId = this.projectId
|
||||
params.map = {}
|
||||
Object.assign(params.map, this.countersignForm.getFieldsValue(), personnelObj)
|
||||
if (params.map.pass) {
|
||||
params.map.pass = params.map.pass === '1'
|
||||
}
|
||||
resolve(params)
|
||||
}
|
||||
})
|
||||
},
|
||||
/**
|
||||
* 转办弹框
|
||||
*/
|
||||
handleTurnTo () {
|
||||
this.$refs.userSelectModal.open()
|
||||
},
|
||||
/**
|
||||
* 转办
|
||||
*/
|
||||
continueTurnTo () {
|
||||
if (this.loading) return
|
||||
this.loading = true
|
||||
this.getPageParams().then(res => {
|
||||
console.log(res)
|
||||
return transferInspectPlan(res)
|
||||
}).then(res => {
|
||||
if (res.success) {
|
||||
this.$message.success(res.message)
|
||||
this.goBack()
|
||||
} else {
|
||||
this.$message.warn(res.message)
|
||||
}
|
||||
}).finally(() => {
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
/**
|
||||
* 保存
|
||||
*/
|
||||
handleSave () {
|
||||
if (this.loading) return
|
||||
this.loading = true
|
||||
this.getPageParams(false).then(res => {
|
||||
console.log(res)
|
||||
return saveInspectPlan(res)
|
||||
}).then(res => {
|
||||
if (res.success) {
|
||||
this.$message.success(res.message)
|
||||
this.goBack()
|
||||
} else {
|
||||
this.$message.warn(res.message)
|
||||
}
|
||||
}).finally(() => {
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
/**
|
||||
* 提交
|
||||
*/
|
||||
handleSubmit () {
|
||||
if (this.loading) return
|
||||
this.currentNode = +this.currentNode + 1 + ''
|
||||
this.loading = true
|
||||
let fn
|
||||
if (this.currentNode === EsInspectionPlan.initiate.value) {
|
||||
fn = startInspectPlan
|
||||
} else if (this.currentNode === EsInspectionPlan.fillInComments.value) {
|
||||
fn = approvalInspectPlan
|
||||
} else if (this.currentNode === EsInspectionPlan.liaisonCollect.value) {
|
||||
fn = approvalInspectPlan
|
||||
}
|
||||
this.getPageParams().then(res => {
|
||||
console.log(res)
|
||||
return fn && fn(res)
|
||||
}).then(res => {
|
||||
if (res.success) {
|
||||
this.$message.success(res.message)
|
||||
this.goBack()
|
||||
} else {
|
||||
this.$message.warn(res.message)
|
||||
}
|
||||
}).finally(() => {
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
/**
|
||||
* 同意
|
||||
*/
|
||||
handleAgree () {
|
||||
if (this.loading) return
|
||||
this.currentNode = +this.currentNode + 1 + ''
|
||||
this.loading = true
|
||||
this.getPageParams().then(res => {
|
||||
console.log(res)
|
||||
return approvalInspectPlan(res)
|
||||
}).then(res => {
|
||||
if (res.success) {
|
||||
this.$message.success(res.message)
|
||||
this.goBack()
|
||||
} else {
|
||||
this.$message.warn(res.message)
|
||||
}
|
||||
}).finally(() => {
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
/**
|
||||
* 驳回
|
||||
*/
|
||||
handleReject () {
|
||||
if (this.loading) return
|
||||
this.loading = true
|
||||
this.getPageParams().then(res => {
|
||||
console.log(res)
|
||||
return refusalInspectPlan(res)
|
||||
}).then(res => {
|
||||
if (res.success) {
|
||||
this.$message.success(res.message)
|
||||
this.goBack()
|
||||
} else {
|
||||
this.$message.warn(res.message)
|
||||
}
|
||||
}).finally(() => {
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
// 是否会签改变
|
||||
changeIsCountersign (val) {
|
||||
@@ -265,10 +452,28 @@ export default {
|
||||
} else {
|
||||
this.isCountersign = null
|
||||
}
|
||||
},
|
||||
/**
|
||||
* 验证所有表单
|
||||
* @param formList - 多个需要校验的表单实例
|
||||
*/
|
||||
validateFormList (...formList) {
|
||||
const promiseList = []
|
||||
for (const form of formList) {
|
||||
promiseList.push(
|
||||
new Promise((resolve, reject) => {
|
||||
form.validateFields((err, val) => {
|
||||
if (!err) {
|
||||
resolve(val)
|
||||
} else {
|
||||
reject(err)
|
||||
}
|
||||
})
|
||||
})
|
||||
)
|
||||
}
|
||||
return Promise.all(promiseList)
|
||||
}
|
||||
},
|
||||
mounted () {
|
||||
this.personnelInfoData = approvalPersonalInfo
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user