update 稽查延期申请
This commit is contained in:
+88
-13
@@ -11,6 +11,7 @@
|
||||
:dataSource="dataSource"
|
||||
:can-drag="true"
|
||||
rowKey="id"
|
||||
:loading="loading"
|
||||
:pagination="false"
|
||||
:scroll="{x: '100%'}"
|
||||
@change="tableOnChange">
|
||||
@@ -28,7 +29,7 @@
|
||||
<!-- 稽查联络人 -->
|
||||
<template v-slot:inspectionContactPerson="{text, record}">
|
||||
<div class="table-form" v-if="isInitiate">
|
||||
<a-select v-model="record.inspectionContactPerson" style="width: 100%" allowClear
|
||||
<a-select v-model="record.liaisons" style="width: 100%" allowClear @change="changeRowData(record, 'liaisons')"
|
||||
: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>
|
||||
@@ -45,7 +46,7 @@
|
||||
<!-- 节点1,显示申请延期和删除,后续不显示操作列 -->
|
||||
<a @click="handleRequestExtension(record, index)" >{{ $t('workCenter.incExtensionRequest.requestExtension') }}</a>
|
||||
<a-divider type="vertical" />
|
||||
<a @click="handleDelete(record, index)" >{{ $t('delete') }}</a>
|
||||
<a @click="handleDelete(record.id)" >{{ $t('delete') }}</a>
|
||||
</template>
|
||||
</j-table>
|
||||
</div>
|
||||
@@ -64,6 +65,8 @@ import ExtensionRequestTableModal
|
||||
from '@views/workCenter/inspectionExtensionRequestProcess/modules/ExtensionRequestTableModal'
|
||||
import RequestExtensionModal from '@views/workCenter/inspectionExtensionRequestProcess/modules/RequestExtensionModal'
|
||||
import { InspectionExtensionRequestProcess } from '@/enums/commonEnums'
|
||||
import { editInspectExtensionTable } from '@api/workCenter'
|
||||
import { getAction } from '@api/manage'
|
||||
export default {
|
||||
name: 'ExtensionRequestTable',
|
||||
components: { RequestExtensionModal, ExtensionRequestTableModal, JTable },
|
||||
@@ -73,12 +76,19 @@ export default {
|
||||
currentNode: {
|
||||
type: String,
|
||||
required: true
|
||||
},
|
||||
// 项目id
|
||||
projectId: {
|
||||
type: String,
|
||||
required: true
|
||||
}
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
disableMixinCreated: true,
|
||||
url: {
|
||||
list: ''
|
||||
list: '/esinspectdelayapply/processEsInspectDelayApply/queryByList',
|
||||
delete: '/esinspectdelayapply/processEsInspectDelayApply/delete'
|
||||
},
|
||||
model: {},
|
||||
userList: [],
|
||||
@@ -98,56 +108,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: 'planInspectObject_dictText',
|
||||
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: 'inspectUserDictText',
|
||||
scopedSlots: { customRender: 'text' }
|
||||
},
|
||||
{ // 状态
|
||||
title: this.$t('workCenter.incExtensionRequest.state'),
|
||||
align: 'center',
|
||||
width: 120,
|
||||
dataIndex: 'state',
|
||||
dataIndex: 'inspectStatus_dictText',
|
||||
scopedSlots: { customRender: 'text' }
|
||||
},
|
||||
{ // 申请延期日期
|
||||
title: this.$t('workCenter.incExtensionRequest.requestExtensionDate'),
|
||||
align: 'center',
|
||||
width: 120,
|
||||
dataIndex: 'requestExtensionDate',
|
||||
dataIndex: 'requestDelayDate',
|
||||
scopedSlots: { customRender: 'text' }
|
||||
},
|
||||
{ // 延期说明
|
||||
title: this.$t('workCenter.incExtensionRequest.extensionDescription'),
|
||||
align: 'center',
|
||||
width: 120,
|
||||
dataIndex: 'extensionDescription',
|
||||
dataIndex: 'delayDescription',
|
||||
scopedSlots: { customRender: 'text' }
|
||||
},
|
||||
{ // 稽查联络人
|
||||
@@ -157,7 +167,7 @@ export default {
|
||||
],
|
||||
align: 'center',
|
||||
width: 200,
|
||||
dataIndex: 'inspectionContactPerson',
|
||||
dataIndex: 'liaisons',
|
||||
scopedSlots: { customRender: 'inspectionContactPerson' }
|
||||
},
|
||||
{
|
||||
@@ -204,12 +214,41 @@ export default {
|
||||
})
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
// 列表查询带上项目id
|
||||
projectId: {
|
||||
immediate: true,
|
||||
handler (val) {
|
||||
if (!val) {
|
||||
return
|
||||
}
|
||||
this.filters.projectId = this.projectId
|
||||
if (this.currentNode === InspectionExtensionRequestProcess.contactEvaluation.value) {
|
||||
this.filters.nodeId = this.$route.query.nodeId
|
||||
}
|
||||
this.loadData()
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted () {
|
||||
if (this.isInitiate) {
|
||||
this.getUserList()
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// 修改:稽查联络人
|
||||
changeRowData (record, field) {
|
||||
editInspectExtensionTable({
|
||||
id: record.id,
|
||||
[field]: record[field]
|
||||
}).then(res => {
|
||||
if (res.success) {
|
||||
this.$message.success(res.message)
|
||||
} else {
|
||||
this.$message.warn(res.message)
|
||||
}
|
||||
})
|
||||
},
|
||||
// 申请延期
|
||||
handleRequestExtension (record) {
|
||||
this.$refs.requestExtensionModal.edit(record)
|
||||
@@ -245,7 +284,43 @@ export default {
|
||||
return this.getNumParentNode(el.parentNode, n - 1)
|
||||
},
|
||||
handleAdd () {
|
||||
this.$refs.extensionRequestTableModal.show()
|
||||
this.$refs.extensionRequestTableModal.show({
|
||||
projectId: this.projectId
|
||||
})
|
||||
},
|
||||
loadData (arg) {
|
||||
if (!this.url.list) {
|
||||
this.$message.warning('请设置url.list属性!')
|
||||
return
|
||||
}
|
||||
// 加载数据 若传入参数1则加载第一页的内容
|
||||
if (arg === 1) {
|
||||
this.ipagination.current = 1
|
||||
}
|
||||
const params = this.getQueryParams()// 查询条件
|
||||
this.loading = true
|
||||
getAction(this.url.list, params).then((res) => {
|
||||
if (res.success) {
|
||||
// update-begin---author:zhangyafei Date:20201118 for:适配不分页的数据列表------------
|
||||
const data = res.result.records || res.result
|
||||
this.dataSource = data.map(item => {
|
||||
return {
|
||||
...item,
|
||||
liaisons: item.liaisons || undefined
|
||||
}
|
||||
})
|
||||
if (res.result.total) {
|
||||
this.ipagination.total = res.result.total
|
||||
} else {
|
||||
this.ipagination.total = 0
|
||||
}
|
||||
// update-end---author:zhangyafei Date:20201118 for:适配不分页的数据列表------------
|
||||
} else {
|
||||
this.$message.warning(res.message)
|
||||
}
|
||||
}).finally(() => {
|
||||
this.loading = false
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user