update 项目合规流程
This commit is contained in:
+181
-30
@@ -92,7 +92,7 @@
|
||||
|
||||
<!--发起第二步选择项目、第三步添加标准,采用引入组件的方式-->
|
||||
<keep-alive>
|
||||
<component :is="comp" v-if="comp" ref="projectStandardTable" :project-id="projectId"/>
|
||||
<component :is="comp" v-if="comp" ref="projectStandardTable" :project-id="projectId" />
|
||||
</keep-alive>
|
||||
|
||||
<!--业务分派信息-->
|
||||
@@ -109,29 +109,42 @@
|
||||
:can-drag="true"
|
||||
:scroll="{x: '100%'}"
|
||||
ref="table"
|
||||
rowKey="id"
|
||||
:rowKey="(record,index)=>{return index}"
|
||||
:columns="columns"
|
||||
:dataSource="dataSource"
|
||||
:pagination="false"
|
||||
:pagination="ipagination"
|
||||
:row-selection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"
|
||||
@change="handleTableChange"
|
||||
v-bind="$attrs">
|
||||
|
||||
<!--条文内容-->
|
||||
<template v-slot:clauseContent="{text}">
|
||||
<div class="table-text" @click="showContent(text)" v-if="text">
|
||||
{{ text && text !== 'null' ? text.replace(/<.*?>/ig, ' ') : '' }}
|
||||
</div>
|
||||
<div class="table-text" v-else>{{ global.emptyLine }}</div>
|
||||
</template>
|
||||
|
||||
<!--责任单位-->
|
||||
<template v-slot:depart="{text, record, index}">
|
||||
<j-select-depart multi
|
||||
<j-select-depart v-if="record.canAssignFlag"
|
||||
multi
|
||||
:back-depart="true"
|
||||
:value="record.depart"
|
||||
:value="record.responsibleUnits"
|
||||
@change="value => handleDepartChange(value, record, index)" />
|
||||
<div class="table-text" v-else>{{ global.emptyLine }}</div>
|
||||
</template>
|
||||
|
||||
<!--责任单位负责人-->
|
||||
<template v-slot:user="{text, record, index}">
|
||||
<user-selection :name-str="record.user_dictText"
|
||||
<user-selection v-if="record.canAssignFlag"
|
||||
:name-str="record.responsibleUnitLeader_dictText"
|
||||
:show-btn="false"
|
||||
:value="record.user"
|
||||
:value="record.responsibleUnitLeaders"
|
||||
:placeholder="$t('pleaseSelect') + $t('workCenter.projectComplianceEvaluationProcess.responsibleUnitHead')"
|
||||
type="checkbox"
|
||||
@listChange="value => handleUserChange(value, record, index, 'user')" />
|
||||
@listChange="value => handleUserChange(value, record, index, 'responsibleUnitLeaders')" />
|
||||
<div class="table-text" v-else>{{ global.emptyLine }}</div>
|
||||
</template>
|
||||
|
||||
<!--模块负责人-->
|
||||
@@ -291,6 +304,8 @@
|
||||
<user-select-modal type="checkbox" ref="userSelectModal" @listChange="handleBatchSelectorOk" />
|
||||
<!--不涉及-->
|
||||
<uninvolved-modal ref="uninvolvedModal" @ok="handleUninvolvedOk" />
|
||||
<!--条文内容-->
|
||||
<split-clause-detail ref="clauseDetail" />
|
||||
</internal-detail-page>
|
||||
</template>
|
||||
|
||||
@@ -299,13 +314,15 @@ import PersonnelInfo from '../../../components/PersonnelInfo'
|
||||
import InternalDetailPage from '../../../components/InternalDetailPage'
|
||||
import ProcessDetailList from '../../../components/ProcessDetailList'
|
||||
import { WorkCenterMixin } from '../../../mixins/WorkCenterMixin'
|
||||
import { ProcessKey, ProjectComplianceEvaluationProcessNode } from '../../../enums/commonEnums'
|
||||
import { ProcessKey, ProjectComplianceEvaluationProcessNode, StandardSource } from '../../../enums/commonEnums'
|
||||
import JTable from '../../../components/jero/JTable'
|
||||
import ProjectTable from './components/ProjectTable'
|
||||
import UserSelection from '../../../components/selection/UserSelection'
|
||||
import UserSelectModal from '../../../components/selection/UserSelectModal'
|
||||
import UninvolvedModal from './modules/UninvolvedModal'
|
||||
import JExpandTable from '../../../components/JExpandTable'
|
||||
import { queryStandardClauseList, initiateProjectComplianceEvaluation, submitProjectComplianceEvaluation } from '../../../api/workCenter'
|
||||
import SplitClauseDetail from '../../documentTool/documentSplit/modules/SplitClauseDetail'
|
||||
|
||||
export default {
|
||||
name: 'ProjectComplianceEvaluationProcess',
|
||||
@@ -318,7 +335,8 @@ export default {
|
||||
ProjectTable,
|
||||
UserSelection,
|
||||
UserSelectModal,
|
||||
UninvolvedModal
|
||||
UninvolvedModal,
|
||||
SplitClauseDetail
|
||||
},
|
||||
mixins: [WorkCenterMixin],
|
||||
data () {
|
||||
@@ -350,6 +368,18 @@ export default {
|
||||
xs: { span: 24 },
|
||||
sm: { span: 21 }
|
||||
},
|
||||
/* 分页参数 */
|
||||
ipagination: {
|
||||
current: 1,
|
||||
pageSize: 10,
|
||||
pageSizeOptions: ['10', '30', '50', '100', '150', '200'],
|
||||
showTotal: (total, range) => {
|
||||
return range[0] + '-' + range[1] + ' ' + this.$t('total') + total + this.$t('strip')
|
||||
},
|
||||
showQuickJumper: true,
|
||||
showSizeChanger: true,
|
||||
total: 0
|
||||
},
|
||||
validatorRules: {
|
||||
// 流程名称
|
||||
processName: {
|
||||
@@ -402,7 +432,7 @@ export default {
|
||||
},
|
||||
// 标准编号/条款号
|
||||
{
|
||||
dataIndex: 'workNumber',
|
||||
dataIndex: 'termNumber',
|
||||
title: this.$t('projectLibrary.vehicleItemLibrary.standardNumberClauseNumber'),
|
||||
width: 150,
|
||||
align: 'center',
|
||||
@@ -410,7 +440,7 @@ export default {
|
||||
},
|
||||
// 标准名称/条款名称
|
||||
{
|
||||
dataIndex: 'projectName',
|
||||
dataIndex: 'termName',
|
||||
title: this.$t('workCenter.projectComplianceEvaluationProcess.standardNameClauseName'),
|
||||
width: 160,
|
||||
align: 'center',
|
||||
@@ -418,11 +448,11 @@ export default {
|
||||
},
|
||||
// 条款内容
|
||||
{
|
||||
dataIndex: 'projectSource_dictText',
|
||||
dataIndex: 'termText',
|
||||
title: this.$t('workCenter.projectComplianceEvaluationProcess.terms'),
|
||||
width: 150,
|
||||
align: 'center',
|
||||
scopedSlots: { customRender: 'text' }
|
||||
scopedSlots: { customRender: 'clauseContent' }
|
||||
}
|
||||
],
|
||||
dataSource: [],
|
||||
@@ -614,14 +644,14 @@ export default {
|
||||
// 责任单位
|
||||
{
|
||||
title: this.$t('workCenter.projectComplianceEvaluationProcess.accountabilityUnit'),
|
||||
dataIndex: 'depart',
|
||||
dataIndex: 'responsibleUnits',
|
||||
width: 150,
|
||||
scopedSlots: { customRender: 'depart' }
|
||||
},
|
||||
// 责任单位负责人
|
||||
{
|
||||
title: this.$t('workCenter.projectComplianceEvaluationProcess.responsibleUnitHead'),
|
||||
dataIndex: 'user',
|
||||
dataIndex: 'responsibleUnitLeaders',
|
||||
width: 150,
|
||||
scopedSlots: { customRender: 'user' }
|
||||
},
|
||||
@@ -767,11 +797,12 @@ export default {
|
||||
// 第三步选择标准
|
||||
if (this.currentStep === 2) {
|
||||
this.standardDataSource = this.$refs.projectStandardTable.getData()
|
||||
console.log(this.standardDataSource)
|
||||
if (!this.standardDataSource || this.standardDataSource.length === 0) {
|
||||
this.$message.warning(this.$t('addAtLeastOneRowOfData'))
|
||||
flag = false
|
||||
} else {
|
||||
// TODO 这块应该需要调接口把标准转成第四步要的条款
|
||||
this.getDispatchList()
|
||||
}
|
||||
}
|
||||
if (!flag) {
|
||||
@@ -779,6 +810,23 @@ export default {
|
||||
}
|
||||
this.currentStep++
|
||||
},
|
||||
/**
|
||||
* 获取业务分派信息列表
|
||||
*/
|
||||
getDispatchList () {
|
||||
const params = this.standardDataSource.map(item => {
|
||||
return {
|
||||
sarFileSplitInfoId: item.sarFileSplitInfoId,
|
||||
standardNumber: item.standardNumber,
|
||||
standardName: item.standardName
|
||||
}
|
||||
})
|
||||
queryStandardClauseList(params).then(res => {
|
||||
if (res.success) {
|
||||
this.dataSource = res.result || []
|
||||
}
|
||||
})
|
||||
},
|
||||
/**
|
||||
* 跳转项目详情
|
||||
*/
|
||||
@@ -794,9 +842,34 @@ export default {
|
||||
/**
|
||||
* 跳转标准详情
|
||||
*/
|
||||
toStandardDetail (standard) {
|
||||
// todo 需要标准类别
|
||||
console.log(standard)
|
||||
toStandardDetail ({ source, standardId }) {
|
||||
let path
|
||||
// 根据来源跳转不同的详情页
|
||||
switch (source) {
|
||||
// 国内
|
||||
case StandardSource.DOMESTIC.value:
|
||||
path = '/standardRegulationLibrary/DomesticStandardDetail'
|
||||
break
|
||||
// 海外
|
||||
case StandardSource.OVERSEAS.value:
|
||||
path = '/standardRegulationLibrary/OverseasStandardDetail'
|
||||
break
|
||||
// 企标
|
||||
case StandardSource.ENTERPRISE.value:
|
||||
path = '/enterpriseStandardLibrary/enterpriseStandardDetail'
|
||||
break
|
||||
default:
|
||||
break
|
||||
}
|
||||
if (!path) {
|
||||
return
|
||||
}
|
||||
const query = {
|
||||
id: standardId
|
||||
}
|
||||
this.$openPageNewSheet({
|
||||
path, query
|
||||
})
|
||||
},
|
||||
/**
|
||||
* 批量选择人员
|
||||
@@ -813,7 +886,7 @@ export default {
|
||||
switch (this.currentNode) {
|
||||
// 发起节点,批量选择的是责任单位负责人
|
||||
case ProjectComplianceEvaluationProcessNode.initiate.value:
|
||||
fieldName = 'user'
|
||||
fieldName = 'responsibleUnitLeaders'
|
||||
break
|
||||
// 各部门主管级领导下发,批量选择的是模块负责人
|
||||
case ProjectComplianceEvaluationProcessNode.departLeaderIssued.value:
|
||||
@@ -830,12 +903,13 @@ export default {
|
||||
return
|
||||
}
|
||||
this.dataSource.forEach((item, index) => {
|
||||
if (this.selectedRowKeys.includes(item.id)) {
|
||||
if (this.selectedRowKeys.includes(index)) {
|
||||
item[fieldName] = list.map(tt => tt.id).join(',')
|
||||
item[fieldName + '_dictText'] = list.map(tt => tt.realname + '(' + tt.username + ')').join(',')
|
||||
this.$set(this.dataSource, index, item)
|
||||
}
|
||||
})
|
||||
console.log(this.dataSource)
|
||||
this.selectedRowKeys = []
|
||||
},
|
||||
onSelectChange (selectedRowKeys) {
|
||||
@@ -848,7 +922,7 @@ export default {
|
||||
* @param index
|
||||
*/
|
||||
handleDepartChange (value, record, index) {
|
||||
record.depart = value
|
||||
record.responsibleUnits = value
|
||||
this.$set(this.dataSource, index, record)
|
||||
},
|
||||
/**
|
||||
@@ -896,21 +970,92 @@ export default {
|
||||
record.evaluationFeedback = value
|
||||
this.$set(this.dataSource, index, record)
|
||||
},
|
||||
dealFormData (isSave) {
|
||||
let formData = {}, processProjectAssess = {}
|
||||
dealFormData () {
|
||||
let formData = {}, basicTaskInfoDTO = {}, flag = true
|
||||
// 流程信息
|
||||
formData.basicProcessInfoDTO = { ...this.processInfo }
|
||||
// 业务基本信息(项目信息)
|
||||
if (this.projectDataSource && this.projectDataSource.length > 0) {
|
||||
processProjectAssess.projectId = this.projectDataSource[0].id
|
||||
// 发起节点需要多传一些参数
|
||||
if (this.currentNode === ProjectComplianceEvaluationProcessNode.initiate.value) {
|
||||
let processProjectAssess = {}, processProjectAssessLinkList = [], processProjectAssessTermList = []
|
||||
// 项目信息(发起第二步)
|
||||
if (this.projectDataSource && this.projectDataSource.length > 0) {
|
||||
processProjectAssess.projectId = this.projectDataSource[0].id
|
||||
}
|
||||
// 关联标准列表(发起第三步)
|
||||
processProjectAssessLinkList = JSON.parse(JSON.stringify(this.standardDataSource))
|
||||
// 关联条款列表(发起第四步)
|
||||
processProjectAssessTermList = JSON.parse(JSON.stringify(this.dataSource))
|
||||
// 校验责任单位必填
|
||||
if (processProjectAssessTermList.some(tt => !tt.responsibleUnits)) {
|
||||
this.$message.warning(this.$t('workCenter.projectComplianceEvaluationProcess.pleaseSelectResponsibleUnit'))
|
||||
flag = false
|
||||
}
|
||||
// 校验责任单位负责人必填
|
||||
if (processProjectAssessTermList.some(tt => !tt.responsibleUnitLeaders)) {
|
||||
this.$message.warning(this.$t('workCenter.projectComplianceEvaluationProcess.pleaseSelectResponsibleUnitLeader'))
|
||||
flag = false
|
||||
}
|
||||
// 校验责任单位和责任单位负责人是一对一的关系
|
||||
if (processProjectAssessTermList.some(tt => {
|
||||
const responsibleUnitList = (tt.responsibleUnits || '').split(',')
|
||||
const responsibleUnitLeadersList = (tt.responsibleUnitLeaders || '').split(',')
|
||||
return responsibleUnitList.length !== responsibleUnitLeadersList.length
|
||||
})) {
|
||||
this.$message.warning(this.$t('workCenter.projectComplianceEvaluationProcess.aUnitOnlyALeader'))
|
||||
flag = false
|
||||
}
|
||||
formData.businessInfoDTO = {
|
||||
processProjectAssess, processProjectAssessLinkList, processProjectAssessTermList
|
||||
}
|
||||
}
|
||||
// 流程审批意见数据
|
||||
this.approvalInfoForm.validateFields((errors, values) => {
|
||||
if (!errors) {
|
||||
basicTaskInfoDTO = Object.assign(this.approvalInfo, values)
|
||||
} else {
|
||||
flag = false
|
||||
}
|
||||
})
|
||||
formData.basicTaskInfoDTO = basicTaskInfoDTO
|
||||
console.log(formData)
|
||||
if (!flag) {
|
||||
return false
|
||||
}
|
||||
return formData
|
||||
},
|
||||
handleSave () {
|
||||
const formData = this.dealFormData(true)
|
||||
console.log('保存表单数据===', formData)
|
||||
|
||||
},
|
||||
/**
|
||||
* 提交
|
||||
*/
|
||||
handleSubmit () {
|
||||
const formData = this.dealFormData()
|
||||
console.log('提交表单数据===', formData)
|
||||
if (!formData) {
|
||||
return
|
||||
}
|
||||
let submitFunc
|
||||
// 发起和提交的接口判断
|
||||
if (this.currentNode === ProjectComplianceEvaluationProcessNode.initiate.value) {
|
||||
submitFunc = initiateProjectComplianceEvaluation
|
||||
} else {
|
||||
submitFunc = submitProjectComplianceEvaluation
|
||||
}
|
||||
if (!submitFunc) {
|
||||
return
|
||||
}
|
||||
this.loading = true
|
||||
submitFunc(formData).then(res => {
|
||||
if (res.success) {
|
||||
this.$message.success(res.message)
|
||||
this.goBack()
|
||||
} else {
|
||||
this.$message.warning(res.message)
|
||||
}
|
||||
}).finally(() => {
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
handleTurnTo () {
|
||||
|
||||
@@ -920,6 +1065,12 @@ export default {
|
||||
},
|
||||
handleReject () {
|
||||
|
||||
},
|
||||
handleTableChange (pagination) {
|
||||
this.ipagination = pagination
|
||||
},
|
||||
showContent (text) {
|
||||
this.$refs.clauseDetail.open(text)
|
||||
}
|
||||
},
|
||||
beforeRouteLeave (to, form, next) {
|
||||
|
||||
+30
-21
@@ -22,10 +22,14 @@
|
||||
|
||||
<!--分解单来源-->
|
||||
<template v-slot:salvageListSource="{text, record, index}">
|
||||
<j-dict-select-tag style="width: 100%"
|
||||
:value="record.salvageSource"
|
||||
:options="standardFileType"
|
||||
@change="value => handleSourceChange(value, record, index)" />
|
||||
<a-select :placeholder="$t('pleaseSelect') + $t('workCenter.projectComplianceEvaluationProcess.salvageListSource')"
|
||||
:value="record.decompositionOrderSource"
|
||||
style="width: 100%"
|
||||
@change="value => handleSourceChange(value, record, index)">
|
||||
<a-select-option v-for="item in record.dictOptions" :key="item.value" :value="item.value" :disabled="item.disabled">
|
||||
{{ item.text }}
|
||||
</a-select-option>
|
||||
</a-select>
|
||||
</template>
|
||||
|
||||
</j-table>
|
||||
@@ -38,7 +42,6 @@
|
||||
<script>
|
||||
import JTable from '../../../../components/jero/JTable'
|
||||
import SelectStandardListDrawer from '../modules/SelectStandardListDrawer'
|
||||
import { ajaxGetDictItems } from '../../../../api/api'
|
||||
|
||||
export default {
|
||||
name: 'StandardList',
|
||||
@@ -87,7 +90,7 @@ export default {
|
||||
// 分解单来源
|
||||
{
|
||||
title: this.$t('workCenter.projectComplianceEvaluationProcess.salvageListSource'),
|
||||
dataIndex: 'salvageSource',
|
||||
dataIndex: 'decompositionOrderSource',
|
||||
width: 150,
|
||||
scopedSlots: { customRender: 'salvageListSource' }
|
||||
},
|
||||
@@ -112,21 +115,10 @@ export default {
|
||||
],
|
||||
dataSource: [],
|
||||
selectedRowKeys: [],
|
||||
rowIds: [],
|
||||
standardFileType: []
|
||||
rowIds: []
|
||||
}
|
||||
},
|
||||
created () {
|
||||
this.initDict()
|
||||
},
|
||||
methods: {
|
||||
initDict () {
|
||||
ajaxGetDictItems('decomposition_order_source').then(res => {
|
||||
if (res.success) {
|
||||
this.standardFileType = res.result
|
||||
}
|
||||
})
|
||||
},
|
||||
handleAdd () {
|
||||
this.$refs.selectStandardDrawer.open(this.projectId)
|
||||
},
|
||||
@@ -150,8 +142,18 @@ export default {
|
||||
},
|
||||
handleOk (rows) {
|
||||
this.dataSource = rows.map(item => {
|
||||
if (!item.salvageSource) {
|
||||
item.salvageSource = '0'
|
||||
// 默认选中不带入
|
||||
if (!item.decompositionOrderSource) {
|
||||
item.decompositionOrderSource = '0'
|
||||
}
|
||||
// 处理没有拆分单的来源禁用
|
||||
if (item.decompositionOrderSourceVOList && item.decompositionOrderSourceVOList.length > 0) {
|
||||
item.dictOptions = item.decompositionOrderSourceVOList.map(dictItem => {
|
||||
if (dictItem.value !== '0' && !dictItem.sarFileSplitInfoId) {
|
||||
dictItem.disabled = true
|
||||
}
|
||||
return dictItem
|
||||
})
|
||||
}
|
||||
return item
|
||||
})
|
||||
@@ -159,8 +161,15 @@ export default {
|
||||
getData () {
|
||||
return this.dataSource
|
||||
},
|
||||
/**
|
||||
* 分解单来源变化
|
||||
* @param value
|
||||
* @param record
|
||||
* @param index
|
||||
*/
|
||||
handleSourceChange (value, record, index) {
|
||||
record.salvageSource = value
|
||||
record.decompositionOrderSource = value
|
||||
record.sarFileSplitInfoId = record.dictOptions.find(tt => tt.value === value).sarFileSplitInfoId
|
||||
this.$set(this.dataSource, index, record)
|
||||
},
|
||||
handleTableChange (pagination) {
|
||||
|
||||
Reference in New Issue
Block a user