[add] 企标稽查

This commit is contained in:
lideqin
2023-09-12 10:30:11 +08:00
parent 8810d2dca5
commit c722b2a719
8 changed files with 913 additions and 4 deletions
@@ -0,0 +1,392 @@
<template>
<a-card :bordered="false">
<!-- 搜索区域 -->
<div class="table-page-search-wrapper">
<a-form layout="inline" @keyup.enter.native="searchQuery">
<a-row :gutter="24">
<a-col :span="6">
<a-form-item :label="$t('enterpriseStandardLibrary.check.enterpriseStandardNum')" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input :placeholder="$t('pleaseEnter')+$t('enterpriseStandardLibrary.check.enterpriseStandardNum')" v-model="queryParam.standardNo"></a-input>
</a-form-item>
</a-col>
<a-col :span="6">
<a-form-item :label="$t('enterpriseStandardLibrary.check.enterpriseStandardName')" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input :placeholder="$t('pleaseEnter')+$t('enterpriseStandardLibrary.check.enterpriseStandardName')" v-model="queryParam.standardName"></a-input>
</a-form-item>
</a-col>
<a-col :span="6">
<a-form-item :label="$t('enterpriseStandardLibrary.check.status')" :labelCol="labelCol" :wrapperCol="wrapperCol">
<j-dict-select-tag
:placeholder="$t('pleaseEnter')+$t('enterpriseStandardLibrary.check.status')"
dict-code=""
v-model="queryParam.standardName">
</j-dict-select-tag>
</a-form-item>
</a-col>
<template v-if="toggleSearchStatus">
<a-col :span="6">
<a-form-item :label="$t('enterpriseStandardLibrary.check.scheduledCheckDate')" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-range-picker
value-format="YYYY-MM-DD"
format="YYYY-MM-DD"
@change="checkDateChange"
v-model="queryParam.checkDate">
</a-range-picker>
</a-form-item>
</a-col>
<a-col :span="6">
<a-form-item :label="$t('enterpriseStandardLibrary.check.createdDate')" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-range-picker
value-format="YYYY-MM-DD"
format="YYYY-MM-DD"
@change="createDateChange"
v-model="queryParam.createDate">
</a-range-picker>
</a-form-item>
</a-col>
<a-col :span="6">
<a-form-item :label="$t('enterpriseStandardLibrary.check.department')">
<a-tree-select
tree-node-filter-prop="title"
v-model="queryParam.departId"
:maxTagCount="1"
:show-search="true"
:getPopupContainer="triggerNode=> triggerNode.parentNode"
class="box-input"
style="width: 100%"
:tree-data="categoryTreeList"
:placeholder="$t('pleaseSelect') + $t('enterpriseStandardLibrary.check.department')"
/>
</a-form-item>
</a-col>
</template>
<div style="float: right;overflow: hidden;" class="table-page-search-submitButtons">
<a-button type="primary" @click="searchQuery" icon="search">{{ $t('query') }}</a-button>
<a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">{{ $t('reset') }}</a-button>
</div>
</a-row>
</a-form>
</div>
<!-- 操作区域 -->
<div class="table-operator">
<!-- 导出-->
<a-button icon="upload" type="primary" ghost @click="handleExportXls($t('enterpriseStandardLibrary.check.exportFileName'))">
{{ $t('export') }}
</a-button>
<!-- 导出延期数据-->
<a-button icon="upload" type="primary" ghost @click="handleExportPostponeData($t('enterpriseStandardLibrary.check.exportPostponeDataName'))">
{{ $t('enterpriseStandardLibrary.check.exportPostponeData') }}
</a-button>
<!-- 导出整改计划-->
<a-button icon="upload" type="primary" ghost @click="handleExportRectificationPlan($t('enterpriseStandardLibrary.check.exportRectificationPlanName'))">
{{ $t('enterpriseStandardLibrary.check.exportRectificationPlan') }}
</a-button>
</div>
<div>
<j-table
:can-drag="true"
:scroll="{x: '100%'}"
ref="table"
size="middle"
rowKey="id"
:columns="columns"
:dataSource="dataSource"
:pagination="ipagination"
:loading="loading"
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
@change="handleTableChange">
<!-- 企标编号/企标名称 -->
<template v-slot:toDetail="{text, record}">
<a-tooltip overlay-class-name="tooltip-style">
<template slot="title">{{ text || text === 0 ? text : global.emptyLine }}</template>
<a class="link-a" @click="handleGoDetail(record)">{{ text }}</a>
</a-tooltip>
</template>
<!-- 计划稽查日期 到期前一周标红 -->
<template slot="scheduledCheckDate" slot-scope="text">
<a-tooltip overlay-class-name="tooltip-style">
<template slot="title">{{ text || text === 0 ? text : global.emptyLine }}</template>
<div class="table-text">{{ text || text === 0 ? text : global.emptyLine }}</div>
</a-tooltip>
</template>
<!-- 操作栏 -->
<div slot="action" slot-scope="{text, record}" class="action-span-cell">
<a @click="handleDeferredCheck(record)" class="table-ope-btn">{{ $t('enterpriseStandardLibrary.check.deferredCheck') }}</a>
<a @click="handleCheckReport(record)" class="table-ope-btn">{{ $t('enterpriseStandardLibrary.check.checkReport') }}</a>
<a @click="handleRectificationPlan(record)" class="table-ope-btn">{{ $t('enterpriseStandardLibrary.check.rectificationPlan') }}</a>
</div>
</j-table>
</div>
<!-- 延期稽查弹框 -->
<deferred-check-modal ref="deferredCheckModal"></deferred-check-modal>
<!-- 稽查报告弹框 -->
<check-report-modal ref="checkReportModal"></check-report-modal>
<!-- 整改计划弹框 -->
<rectification-plan-modal ref="rectificationPlanModal"></rectification-plan-modal>
</a-card>
</template>
<script>
import '@assets/less/common.less'
import { queryDepartTreeList } from '@/api/api'
import { JeroListMixin } from '@/mixins/JeroListMixin'
import { downFile } from '@/api/manage'
import JTable from '@/components/jero/JTable'
// 延期稽查弹框
import DeferredCheckModal from './modules/DeferredCheckModal'
// 稽查报告弹框
import CheckReportModal from './modules/CheckReportModal'
import RectificationPlanModal from './modules/RectificationPlanModal'
export default {
name: 'CheckList',
components: { RectificationPlanModal, JTable, CheckReportModal, DeferredCheckModal },
mixins: [JeroListMixin],
data () {
return {
categoryTreeList: [], // 组织机构查询的组织机构树数据
columns: [
{
title: this.$t('serialNumber'),
dataIndex: '',
key: 'rowIndex',
width: 60,
align: 'center',
customRender: function (t, r, index) {
return parseInt(index) + 1
}
},
{
title: this.$t('enterpriseStandardLibrary.check.basedStandardNo'),
align: 'center',
width: 180,
dataIndex: 'standardNo',
scopedSlots: { customRender: 'toDetail' }
},
{
title: this.$t('enterpriseStandardLibrary.check.basedStandardName'),
align: 'center',
width: 180,
dataIndex: 'standardName',
scopedSlots: { customRender: 'toDetail' }
},
{
title: this.$t('enterpriseStandardLibrary.check.planCheckTarget'),
align: 'center',
width: 180,
dataIndex: 'planCheckTarget',
scopedSlots: { customRender: 'text' }
},
{
title: this.$t('enterpriseStandardLibrary.check.workGroup'),
align: 'center',
width: 180,
dataIndex: 'workGroup',
scopedSlots: { customRender: 'text' }
},
{
title: this.$t('enterpriseStandardLibrary.check.department'),
align: 'center',
width: 180,
dataIndex: 'department',
scopedSlots: { customRender: 'text' }
},
{
title: this.$t('enterpriseStandardLibrary.check.scheduledCheckDate'),
align: 'center',
width: 180,
dataIndex: 'scheduledCheckDate',
scopedSlots: { customRender: 'scheduledCheckDate' }
},
{
title: this.$t('enterpriseStandardLibrary.check.headOfCheck'),
align: 'center',
width: 180,
dataIndex: 'headOfCheck',
scopedSlots: { customRender: 'text' }
},
{
title: this.$t('enterpriseStandardLibrary.check.contactPerson'),
align: 'center',
width: 180,
dataIndex: 'contactPerson',
scopedSlots: { customRender: 'text' }
},
{
title: this.$t('enterpriseStandardLibrary.check.checkFinishDate'),
align: 'center',
width: 180,
dataIndex: 'checkFinishDate',
scopedSlots: { customRender: 'text' }
},
{
title: this.$t('enterpriseStandardLibrary.check.actualChecker'),
align: 'center',
width: 180,
dataIndex: 'actualChecker',
scopedSlots: { customRender: 'text' }
},
{
title: this.$t('enterpriseStandardLibrary.check.status'),
align: 'center',
width: 180,
dataIndex: 'status',
scopedSlots: { customRender: 'text' }
},
{
title: this.$t('enterpriseStandardLibrary.check.createDate'),
align: 'center',
width: 180,
dataIndex: 'createDate',
scopedSlots: { customRender: 'text' }
},
{
title: this.$t('operation'),
scopedSlots: { customRender: 'action' },
align: 'center',
width: 200
}
],
url: {
list: '/enterprise/inspect/page',
exportPostponeDataUrl: '', // 导出延期数据
exportRectificationPlanUrl: '' // 导出整改计划
}
}
},
mounted () {
this.getSysCategoryTree()
},
methods: {
// 获取组织机构树
getSysCategoryTree () {
queryDepartTreeList().then((res) => {
if (res.success) {
this.categoryTreeList = res.result
} else {
this.categoryTreeList = []
}
})
},
// 点击跳转企标详情
handleGoDetail (record) {
this.$openPageNewSheet({
path: '/enterpriseStandardLibrary/enterpriseStandardDetail',
query: {
id: record.id
}
})
},
// 导出延期数据
handleExportPostponeData (fileName) {
if (!fileName || typeof fileName !== 'string') {
fileName = '导出文件'
}
const param = this.getQueryParams()
if (this.selectedRowKeys && this.selectedRowKeys.length > 0) {
param.selections = this.selectedRowKeys.join(',')
}
console.log('导出参数', param)
// 加一个大的提示
const modalLoading = this.$info({
title: '提示',
content: <span>正在导出请稍候 <a-spin size="small" /></span>,
keyboard: false
})
// 把知道了这个按钮去掉
this.$nextTick(() => {
document.getElementsByClassName('ant-modal-confirm-btns')[0].style = 'display:none'
})
downFile(this.url.exportPostponeDataUrl, param).then((data) => {
if (!data) {
this.$message.warning('文件下载失败')
return
}
if (typeof window.navigator.msSaveBlob !== 'undefined') {
window.navigator.msSaveBlob(new Blob([data], { type: 'application/vnd.ms-excel' }), fileName + '.xls')
} else {
const url = window.URL.createObjectURL(new Blob([data], { type: 'application/vnd.ms-excel' }))
const link = document.createElement('a')
link.style.display = 'none'
link.href = url
link.setAttribute('download', fileName + '.xls')
document.body.appendChild(link)
link.click()
document.body.removeChild(link) // 下载完成移除元素
window.URL.revokeObjectURL(url) // 释放掉blob对象
}
}).finally(() => {
// 销毁这个提示
modalLoading.destroy()
})
},
// 导出整改计划
handleExportRectificationPlan (fileName) {
if (!fileName || typeof fileName !== 'string') {
fileName = '导出文件'
}
const param = this.getQueryParams()
if (this.selectedRowKeys && this.selectedRowKeys.length > 0) {
param.selections = this.selectedRowKeys.join(',')
}
console.log('导出参数', param)
// 加一个大的提示
const modalLoading = this.$info({
title: '提示',
content: <span>正在导出请稍候 <a-spin size="small" /></span>,
keyboard: false
})
// 把知道了这个按钮去掉
this.$nextTick(() => {
document.getElementsByClassName('ant-modal-confirm-btns')[0].style = 'display:none'
})
downFile(this.url.exportRectificationPlanUrl, param).then((data) => {
if (!data) {
this.$message.warning('文件下载失败')
return
}
if (typeof window.navigator.msSaveBlob !== 'undefined') {
window.navigator.msSaveBlob(new Blob([data], { type: 'application/vnd.ms-excel' }), fileName + '.xls')
} else {
const url = window.URL.createObjectURL(new Blob([data], { type: 'application/vnd.ms-excel' }))
const link = document.createElement('a')
link.style.display = 'none'
link.href = url
link.setAttribute('download', fileName + '.xls')
document.body.appendChild(link)
link.click()
document.body.removeChild(link) // 下载完成移除元素
window.URL.revokeObjectURL(url) // 释放掉blob对象
}
}).finally(() => {
// 销毁这个提示
modalLoading.destroy()
})
},
// 延期稽查
handleDeferredCheck (record) {
this.$refs.deferredCheckModal.open(record)
},
// 稽查报告
handleCheckReport (record) {
this.$refs.checkReportModal.open(record)
},
// 整改计划
handleRectificationPlan (record) {
this.$refs.rectificationPlanModal.open(record)
}
}
}
</script>
<style scoped>
</style>