update 企标稽查计划

This commit is contained in:
danshihao
2023-11-21 11:37:37 +08:00
parent afa76d0f29
commit 1c9cdf249a
9 changed files with 406 additions and 146 deletions
@@ -45,13 +45,13 @@
<!-- 操作 -->
<template slot="action" slot-scope="{text, record, index}">
<!-- 编辑 and 删除:节点1 或 节点3 或 节点2且当前登录人是创建人 -->
<template v-if="['1', '3'].includes(currentNode) || (currentNode === '2' && $store.getters.userInfo.id === record.userId)">
<template v-if="isInitiateOrLiaisonCollect || (currentNode === EsInspectionPlan.fillInComments.value && $store.getters.userInfo.id === record.userId)">
<a @click="handleEdit(record, index)" >{{ $t('edit') }}</a>
<a-divider type="vertical" />
<a @click="handleDelete(record, index)" >{{ $t('delete') }}</a>
</template>
<!-- 意见 or 填写意见:节点2非自己创建的就是意见和填写意见 -->
<template v-else-if="currentNode === '2'">
<template v-else-if="currentNode === EsInspectionPlan.fillInComments.value">
<a v-if="!!record.opinion" @click="handleShowOpinion(record, index)" >{{ $t('workCenter.esInspectionPlan.opinion') }}</a>
<a v-else @click="handleWriteOpinion(record, index)" >{{ $t('workCenter.esInspectionPlan.writeOpinion') }}</a>
</template>
@@ -61,7 +61,7 @@
</div>
<!-- 新增/编辑稽查计划 -->
<inspection-plan-drawer ref="modalForm" @ok="modalFormOk"/>
<inspection-plan-drawer ref="modalForm" @ok="addOrEditOk"/>
<!-- 填写意见、意见回显 -->
<write-opinion-modal ref="writeOpinionModal" @ok="modalFormOk"/>
<!-- 节点3:所属部门意见-查看 -->
@@ -75,6 +75,7 @@ import JTable from '@comp/jero/JTable'
import InspectionPlanDrawer from '@views/workCenter/enterpriseStandardInspectionPlan/modules/InspectionPlanDrawer'
import WriteOpinionModal from '@views/workCenter/enterpriseStandardInspectionPlan/modules/WriteOpinionModal'
import ShowOpinionModal from '@views/workCenter/enterpriseStandardInspectionPlan/modules/ShowOpinionModal'
import { EsInspectionPlan } from '@/enums/commonEnums'
export default {
name: 'InspectionPlanTable',
@@ -89,38 +90,13 @@ export default {
},
data () {
return {
EsInspectionPlan,
disableMixinCreated: true,
url: {
list: ''
list: '/process/processEsInspectPlan/page'
},
model: {},
dataSource: [
{
id: 1,
inspectionBasisStandardName: '123',
inspectionBasisStandardNumber: '123',
detailFlag: true,
departOpinion: '123',
mainDutyStandardizationGroup: '1699358097292472322'
},
{
id: 3,
inspectionBasisStandardName: 'qaaa',
inspectionBasisStandardNumber: '12asdasdas3',
detailFlag: true,
departOpinion: '123',
opinion: [],
mainDutyStandardizationGroup: '1699358097292472322'
},
{
id: 2,
inspectionBasisStandardName: '123',
inspectionBasisStandardNumber: '123',
detailFlag: true,
departOpinion: '123',
userId: 'e9ca23d68d884d4ebb19d07889727dae'
// mainDutyStandardizationGroup: '1699358097292472322'
}
],
dataSource: [],
allColumns: [
{
title: this.$t('serialNumber'),
@@ -136,56 +112,56 @@ export default {
title: this.$t('workCenter.esInspectionPlan.inspectionBasisStandardNumber'),
align: 'center',
width: 180,
dataIndex: 'inspectionBasisStandardNumber',
dataIndex: 'inspectNo',
scopedSlots: { customRender: 'standard' }
},
{ // 稽查依据标准名称
title: this.$t('workCenter.esInspectionPlan.inspectionBasisStandardName'),
align: 'center',
width: 180,
dataIndex: 'inspectionBasisStandardName',
dataIndex: 'inspectName',
scopedSlots: { customRender: 'standard' }
},
{ // 计划稽查对象
title: this.$t('workCenter.esInspectionPlan.planInspectionObjects'),
align: 'center',
width: 120,
dataIndex: 'planInspectionObjects',
dataIndex: 'inspectObject',
scopedSlots: { customRender: 'text' }
},
{ // 主责标准化工作组
title: this.$t('workCenter.esInspectionPlan.mainDutyStandardizationGroup'),
align: 'center',
width: 150,
dataIndex: 'mainDutyStandardizationGroup',
dataIndex: 'standardizationWorkGroup',
scopedSlots: { customRender: 'text' }
},
{ // 所属部门
title: this.$t('workCenter.esInspectionPlan.department'),
align: 'center',
width: 120,
dataIndex: 'department',
dataIndex: 'belongDept',
scopedSlots: { customRender: 'text' }
},
{ // 计划稽查日期
title: this.$t('workCenter.esInspectionPlan.planInspectionDate'),
align: 'center',
width: 120,
dataIndex: 'planInspectionDate',
dataIndex: 'planInspectDate',
scopedSlots: { customRender: 'text' }
},
{ // 稽查负责人
title: this.$t('workCenter.esInspectionPlan.inspectionDirector'),
align: 'center',
width: 120,
dataIndex: 'inspectionDirector',
dataIndex: 'inspectUser',
scopedSlots: { customRender: 'text' }
},
{ // 标准化组对接人
title: this.$t('workCenter.esInspectionPlan.standardizationGroupContactPerson'),
align: 'center',
width: 140,
dataIndex: 'standardizationGroupContactPerson',
dataIndex: 'standardizationDockingUser',
scopedSlots: { customRender: 'text' }
},
{ // 所属部门人员
@@ -193,15 +169,15 @@ export default {
align: 'center',
width: 120,
dataIndex: 'departmentPersonnel',
showCodeList: ['1'],
showCodeList: [EsInspectionPlan.initiate.value],
scopedSlots: { customRender: 'text' }
},
{ // 创建人
title: this.$t('workCenter.esInspectionPlan.creator'),
align: 'center',
width: 120,
dataIndex: 'creator',
showCodeList: ['2'],
dataIndex: 'createBy',
showCodeList: [EsInspectionPlan.fillInComments.value],
scopedSlots: { customRender: 'text' }
},
{ // 发起人
@@ -209,23 +185,31 @@ export default {
align: 'center',
width: 120,
dataIndex: 'initiator',
showCodeList: ['3', '4', '5'],
showCodeList: [
EsInspectionPlan.liaisonCollect.value,
EsInspectionPlan.relevantPersonnelCountersign.value,
EsInspectionPlan.liaisonLeaderApproval.value
],
scopedSlots: { customRender: 'text' }
},
{ // 所属部门意见
title: this.$t('workCenter.esInspectionPlan.departOpinion'),
align: 'center',
width: 120,
dataIndex: 'departOpinion',
showCodeList: ['3'],
dataIndex: 'opinion',
showCodeList: [EsInspectionPlan.liaisonCollect.value],
scopedSlots: { customRender: 'departOpinion' }
},
{
fixed: 'right',
// 操作
showCodeList: ['1', '2', '3'],
showCodeList: [
EsInspectionPlan.initiate.value,
EsInspectionPlan.fillInComments.value,
EsInspectionPlan.liaisonCollect.value
],
title: this.$t('operation'),
// dataIndex: 'action',
dataIndex: 'action',
align: 'center',
width: 180,
scopedSlots: { customRender: 'action' }
@@ -234,6 +218,11 @@ export default {
}
},
computed: {
// 是否发起节点和联络人汇总节点
isInitiateOrLiaisonCollect () {
const arr = [EsInspectionPlan.initiate.value, EsInspectionPlan.liaisonCollect.value]
return arr.includes(this.currentNode)
},
// 按节点进行过滤
columns () {
return this.allColumns.filter(item => {
@@ -250,6 +239,30 @@ export default {
},
methods: {
getData () {
return this.dataSource
},
// 表单提交
addOrEditOk (formData) {
console.log(formData)
if (formData.id) {
// 编辑
for (let i = 0; i < this.dataSource.length; i++) {
if (this.dataSource[i].id === formData.id) {
this.dataSource.splice(i, 1, formData)
return
}
}
} else {
// 添加
formData.id = this.dataSource.length
this.dataSource.push(formData)
}
},
// 更新表格数据
updateData (list) {
this.dataSource = list || []
},
// 跳转详情
detailClick (record) {
this.$openPageNewSheet({