add 稽查延期申请流程

This commit is contained in:
danshihao
2023-11-01 15:33:13 +08:00
parent 050f884fc5
commit e25bbfbc5c
9 changed files with 786 additions and 3 deletions
@@ -0,0 +1,268 @@
<template>
<div>
<div class="table-operator" v-if="['1'].includes(currentNode)">
<!-- 新增 -->
<a-button icon="plus" type="primary" @click="handleAdd" v-has="'enterpriseStandard:add'">{{ $t('newlyAdded') }}</a-button>
</div>
<div>
<j-table
v-if="columns && columns.length > 0"
:columns="columns"
:dataSource="dataSource"
:can-drag="true"
rowKey="id"
:row-selection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"
:pagination="ipagination"
:scroll="{x: '100%'}"
@change="tableOnChange">
<!-- 企标号企标名称 -->
<template v-slot:standard="{text, record}">
<a-tooltip overlay-class-name="tooltip-style">
<template slot="title">{{ text || text === 0 ? text : global.emptyLine }}</template>
<a class="table-text can-click-table-text" @click="detailClick(record)" v-if="(text || text === 0) && record.detailFlag">{{ text }}</a>
<div class="table-text" v-else-if="(text || text === 0) && !record.detailFlag">{{ text }}</div>
<div class="table-text" v-else>{{ global.emptyLine }}</div>
</a-tooltip>
</template>
<!-- 稽查联络人 -->
<template v-slot:inspectionContactPerson="{text, record}">
<div class="table-form" v-if="currentNode === '1'">
<a-select v-model="record.inspectionContactPerson" style="width: 100%" allowClear
:placeholder="$t('pleaseSelect')+$t('workCenter.incExtensionRequest.inspectionContactPerson')">
<a-select-option v-for="item in userList" :key="item.id" :value="item.id">{{ item.realname + '(' + item.username + ')' }}</a-select-option>
</a-select>
</div>
<a-tooltip v-else overlay-class-name="tooltip-style">
<template slot="title">{{ text || text === 0 ? text : global.emptyLine }}</template>
<div class="table-text" v-if="text || text === 0">{{ text }}</div>
<div class="table-text" v-else>{{ global.emptyLine }}</div>
</a-tooltip>
</template>
<!-- 操作 -->
<template slot="action" slot-scope="{text, record, index}">
<!-- 节点1显示申请延期和删除后续不显示操作列 -->
<a @click="handleRequestExtension(record, index)" >{{ $t('workCenter.incExtensionRequest.requestExtension') }}</a>
<a-divider type="vertical" />
<a @click="handleDelete(record, index)" >{{ $t('delete') }}</a>
</template>
</j-table>
</div>
<!-- 新增 -->
<extension-request-table-modal ref="extensionRequestTableModal" @ok="modalFormOk"/>
<!-- 申请延期 -->
<request-extension-modal ref="requestExtensionModal" @ok="modalFormOk"/>
</div>
</template>
<script>
import JTable from '@comp/jero/JTable'
import { JeroListMixin } from '@/mixins/JeroListMixin'
import { getUserList } from '@api/api'
import ExtensionRequestTableModal
from '@views/workCenter/inspectionExtensionRequestProcess/modules/ExtensionRequestTableModal'
import RequestExtensionModal from '@views/workCenter/inspectionExtensionRequestProcess/modules/RequestExtensionModal'
export default {
name: 'ExtensionRequestTable',
components: { RequestExtensionModal, ExtensionRequestTableModal, JTable },
mixins: [JeroListMixin],
props: {
// 当前节点
currentNode: {
type: String,
required: true
}
},
data () {
return {
url: {
list: ''
},
model: {},
userList: [],
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'
}
],
allColumns: [
{
title: this.$t('serialNumber'),
dataIndex: '',
key: 'rowIndex',
align: 'center',
width: 80,
customRender: function (t, r, index) {
return parseInt(index) + 1
}
},
{ // 稽查依据标准号
title: this.$t('workCenter.esInspectionPlan.inspectionBasisStandardNumber'),
align: 'center',
width: 180,
dataIndex: 'inspectionBasisStandardNumber',
scopedSlots: { customRender: 'standard' }
},
{ // 稽查依据标准名称
title: this.$t('workCenter.esInspectionPlan.inspectionBasisStandardName'),
align: 'center',
width: 180,
dataIndex: 'inspectionBasisStandardName',
scopedSlots: { customRender: 'standard' }
},
{ // 计划稽查对象
title: this.$t('workCenter.esInspectionPlan.planInspectionObjects'),
align: 'center',
width: 120,
dataIndex: 'planInspectionObjects',
scopedSlots: { customRender: 'text' }
},
{ // 计划稽查日期
title: this.$t('workCenter.esInspectionPlan.planInspectionDate'),
align: 'center',
width: 120,
dataIndex: 'planInspectionDate',
scopedSlots: { customRender: 'text' }
},
{ // 稽查负责人
title: this.$t('workCenter.esInspectionPlan.inspectionDirector'),
align: 'center',
width: 120,
dataIndex: 'inspectionDirector',
scopedSlots: { customRender: 'text' }
},
{ // 状态
title: this.$t('workCenter.incExtensionRequest.state'),
align: 'center',
width: 120,
dataIndex: 'state',
scopedSlots: { customRender: 'text' }
},
{ // 申请延期日期
title: this.$t('workCenter.incExtensionRequest.requestExtensionDate'),
align: 'center',
width: 120,
dataIndex: 'requestExtensionDate',
scopedSlots: { customRender: 'text' }
},
{ // 延期说明
title: this.$t('workCenter.incExtensionRequest.extensionDescription'),
align: 'center',
width: 120,
dataIndex: 'extensionDescription',
scopedSlots: { customRender: 'text' }
},
{ // 稽查联络人
title: this.$t('workCenter.incExtensionRequest.inspectionContactPerson'),
showCodeList: ['1'],
align: 'center',
width: 200,
dataIndex: 'inspectionContactPerson',
scopedSlots: { customRender: 'inspectionContactPerson' }
},
{
// 操作
fixed: 'right',
title: this.$t('operation'),
showCodeList: ['1'],
// dataIndex: 'action',
align: 'center',
width: 180,
scopedSlots: { customRender: 'action' }
}
]
}
},
computed: {
// 按节点进行过滤
columns () {
return this.allColumns.filter(item => {
// 没有这个属性,就默认显示
if (!item.showCodeList) {
return true
}
// 如果有,就根据当前节点显示
return item.showCodeList.includes(this.currentNode)
})
}
},
mounted () {
if (this.currentNode === '1') {
this.getUserList()
}
},
methods: {
// 申请延期
handleRequestExtension (record) {
this.$refs.requestExtensionModal.edit(record)
},
// 返回用户列表
getUserList () {
getUserList({ pageNo: -1, pageSize: -1, order: 'desc', column: 'createTime' }).then(res => {
if (res.success) {
this.userList = res.result.records || []
}
})
},
// 跳转详情
detailClick (record) {
this.$openPageNewSheet({
path: '/enterpriseStandardLibrary/enterpriseStandardDetail',
query: {
id: record.id
}
})
},
tableOnChange (pagination, filters, sorter) {
this.orderBy = sorter.order === 'ascend' ? '1' : '2'
this.orderByField = sorter.columnKey
this.ipagination = pagination
this.getTableList()
},
// 获取向上第n个父节点
getNumParentNode (el, n) {
if (n < 1 || el === document.body) {
return el.parentNode || document.body
}
return this.getNumParentNode(el.parentNode, n - 1)
},
handleAdd () {
this.$refs.extensionRequestTableModal.show()
}
}
}
</script>
<style lang="less" scoped>
.table-form {
position: relative;
/deep/ .ant-calendar-picker {
min-width: 130px !important;
}
}
</style>