[update] 增加企标详情页,未完全写完,添加企标操作弹框
This commit is contained in:
@@ -0,0 +1,231 @@
|
||||
<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.publicize.enterpriseStandardNum')" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||
<a-input :placeholder="$t('pleaseEnter')+$t('enterpriseStandardLibrary.publicize.enterpriseStandardNum')" v-model="queryParam.standardNo"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="6">
|
||||
<a-form-item :label="$t('enterpriseStandardLibrary.publicize.enterpriseStandardName')" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||
<a-input :placeholder="$t('pleaseEnter')+$t('enterpriseStandardLibrary.publicize.enterpriseStandardName')" v-model="queryParam.standardName"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="6">
|
||||
<a-form-item :label="$t('enterpriseStandardLibrary.publicize.publicizeData')" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||
<a-range-picker
|
||||
:placeholder="$t('pleaseEnter')+$t('enterpriseStandardLibrary.publicize.publicizeData')"
|
||||
value-format="YYYY-MM-DD"
|
||||
format="YYYY-MM-DD"
|
||||
@change="publicizeDataChange"
|
||||
v-model="queryParam.publicizeData">
|
||||
</a-range-picker>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<template v-if="toggleSearchStatus">
|
||||
<a-col :span="6">
|
||||
<a-form-item :label="$t('enterpriseStandardLibrary.publicize.publicist')" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||
<a-input :placeholder="$t('pleaseEnter')+$t('enterpriseStandardLibrary.publicize.publicist')" v-model="queryParam.declareUserName"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</template>
|
||||
|
||||
<div style="float: right;overflow: hidden;" class="table-page-search-submitButtons">
|
||||
<a @click="handleToggleSearch">
|
||||
{{ toggleSearchStatus ? $t('putAway') : $t('open') }}
|
||||
<a-icon :type="toggleSearchStatus ? 'up' : 'down'"/>
|
||||
</a>
|
||||
<a-button type="primary" @click="searchQuery" icon="search" style="margin-left: 8px">{{ $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.publicize.exportName'))">
|
||||
{{ $t('export') }}
|
||||
</a-button>
|
||||
<a-button icon="upload" type="primary" ghost @click="handleFileExport($t('enterpriseStandardLibrary.publicize.fileExportName'))">{{ $t('exportWithFile') }}</a-button>
|
||||
<!-- 模板下载-->
|
||||
<a-button type="primary" icon="download" ghost @click="downTemplate('enterpriseStandardLibrary.publicize.templateName')">
|
||||
{{ $t('templateDownload') }}
|
||||
</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:enterpriseStandardNum="{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 v-slot:enterpriseStandardName="{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 v-slot:relatedMaterial="{text, record}">
|
||||
<a-tooltip overlay-class-name="tooltip-style">
|
||||
<template slot="title">{{ text || text === 0 ? text : global.emptyLine }}</template>
|
||||
<a class="link-a" @click="handleRelatedMaterialClick(record)">{{ text }}</a>
|
||||
</a-tooltip>
|
||||
</template>
|
||||
|
||||
</j-table>
|
||||
</div>
|
||||
</a-card>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import '@assets/less/common.less'
|
||||
import JTable from '@/components/jero/JTable'
|
||||
import { JeroListMixin } from '@/mixins/JeroListMixin'
|
||||
import Vue from 'vue'
|
||||
import { ACCESS_TOKEN } from '@/store/mutation-types'
|
||||
import { previewPdf } from '@/utils/previewPdf'
|
||||
import { getFileAccessHttpUrl } from '@/api/manage'
|
||||
|
||||
const FILE_TYPE_IMGS = ['jpg', 'jpeg', 'png', 'raw']
|
||||
const FILE_TYPE_PDF = 'pdf'
|
||||
const Base64 = require('js-base64').Base64
|
||||
|
||||
export default {
|
||||
name: 'EnterpriseStandardPublicize',
|
||||
components: { JTable },
|
||||
mixins: [JeroListMixin],
|
||||
data () {
|
||||
return {
|
||||
labelCol: {
|
||||
span: 4
|
||||
},
|
||||
wrapperCol: {
|
||||
span: 18
|
||||
},
|
||||
columns: [
|
||||
{
|
||||
title: this.$t('enterpriseStandardLibrary.publicize.enterpriseStandardNum'),
|
||||
align: 'center',
|
||||
width: 180,
|
||||
dataIndex: 'standardNo',
|
||||
scopedSlots: { customRender: 'enterpriseStandardNum' }
|
||||
},
|
||||
{
|
||||
title: this.$t('enterpriseStandardLibrary.publicize.enterpriseStandardName'),
|
||||
align: 'center',
|
||||
width: 180,
|
||||
dataIndex: 'standardName',
|
||||
scopedSlots: { customRender: 'enterpriseStandardName' }
|
||||
},
|
||||
{
|
||||
title: this.$t('enterpriseStandardLibrary.publicize.releaseDate'),
|
||||
align: 'center',
|
||||
width: 180,
|
||||
dataIndex: 'releaseDate',
|
||||
scopedSlots: { customRender: 'text' }
|
||||
},
|
||||
{
|
||||
title: this.$t('enterpriseStandardLibrary.publicize.materialDate'),
|
||||
align: 'center',
|
||||
width: 180,
|
||||
dataIndex: 'implementationDate',
|
||||
scopedSlots: { customRender: 'text' }
|
||||
},
|
||||
{
|
||||
title: this.$t('enterpriseStandardLibrary.publicize.publicizeData'),
|
||||
align: 'center',
|
||||
width: 180,
|
||||
dataIndex: 'declareDate',
|
||||
scopedSlots: { customRender: 'text' }
|
||||
},
|
||||
{
|
||||
title: this.$t('enterpriseStandardLibrary.publicize.publicist'),
|
||||
align: 'center',
|
||||
width: 180,
|
||||
dataIndex: 'declareUserName',
|
||||
scopedSlots: { customRender: 'text' }
|
||||
},
|
||||
{
|
||||
title: this.$t('enterpriseStandardLibrary.publicize.relatedMaterial'),
|
||||
align: 'center',
|
||||
width: 180,
|
||||
dataIndex: 'declareFileName',
|
||||
scopedSlots: { customRender: 'relatedMaterial' }
|
||||
}
|
||||
],
|
||||
url: {
|
||||
list: '/enterprise/declare/page'
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
publicizeDataChange (date) {
|
||||
console.log(date)
|
||||
this.queryParam.declareStartDate = date[0]
|
||||
this.queryParam.declareEndDate = date[1]
|
||||
},
|
||||
// 点击跳转企标详情
|
||||
handleGoDetail (record) {
|
||||
this.$openPageNewSheet({
|
||||
path: '/enterpriseStandardLibrary/enterpriseStandardDetail',
|
||||
query: {
|
||||
id: record.id
|
||||
}
|
||||
})
|
||||
},
|
||||
// 点击相关材料
|
||||
handleRelatedMaterialClick (record) {
|
||||
// 截取文件后缀名
|
||||
const fileSuffix = record.declareFileName ? record.declareFileName.split('.')[record.declareFileName.split('.').length - 1] : ''
|
||||
const fileFullUrl = `${window._CONFIG.domianWebSocketURL}/sys/common/download/${record.declareFile}?token=${Vue.ls.get(ACCESS_TOKEN)}&fullfilename=${record.declareFileName}`
|
||||
// 图片预览,使用自己添加的组件
|
||||
if (FILE_TYPE_IMGS.includes(fileSuffix)) {
|
||||
this.imageUrl = getFileAccessHttpUrl(record.declareFile)
|
||||
// 获取viewer实例
|
||||
const viewer = this.$el.querySelector('.image').$viewer
|
||||
// 调用show方法进行显示预览图
|
||||
viewer.show()
|
||||
// this.$refs.imagePreviewModal.open(file)
|
||||
return
|
||||
}
|
||||
// pdf预览
|
||||
if (FILE_TYPE_PDF.includes(fileSuffix)) {
|
||||
const url = previewPdf(record.declareFile)
|
||||
window.open(url)
|
||||
return
|
||||
}
|
||||
// 其余可预览文件仍使用KKFile进行预览
|
||||
const url = `${window._CONFIG.onlinePreviewDomainURL}?url=${encodeURIComponent(Base64.encode(fileFullUrl))}`
|
||||
window.open(url)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
Reference in New Issue
Block a user