Files
laws_weilai/jero-web/src/views/virtualAuthenticationList/virtualAuthenticationListDesign/certificationListMaintenance.vue
T

723 lines
25 KiB
Java

<template>
<div class="doc-detail">
<div class="Virtual-detail-header" style="position: fixed;top: 0">
<div class="Virtual-detail-title">
<span>
{{isTrue ? $t('certificationListMaintenance'):$t('marketCertificationListDetails')}}
</span>
</div>
<div class="Virtual-detail-right">
<div @click="UpdateLogClick" v-has="'dummyLog:page'" class="operator-text-text"
style="margin-right: 37px;cursor: pointer"
:title="$t('UpdateLog')">
<a-icon type="reload"/>
{{$t('UpdateLog')}}
</div>
</div>
</div>
<div style="padding-top: 88px;background: #fff;height: 100%">
<div class="detail-content" style="height: 100%">
<div class="Virtual-detail-content">
<div class="box-title-text-add">
<div class="title-text-add">
<span class="text-left" :title="$t('CertificationListName')">
{{$t('CertificationListName')}}
</span>
<span class="text-right" style="margin-right: 100px" :title="$route.query.name">
{{$route.query.name}}
</span>
<span class="text-left" style="width: 72px" :title="$t('instructionForUse')">
{{$t('instructionForUse')}}
</span>
<span class="text-right" :title="$route.query.useExplain">
{{$route.query.useExplain}}
</span>
</div>
</div>
</div>
<a-card :bordered="false" class="card">
<div class="table-page-search-wrapper">
<a-form layout="inline" @keyup.enter.native="searchQuery">
<a-row :gutter="24">
<a-col :md="6" :sm="8">
<div class="box-title-text">
<div class="title-text" :title="$t('category')">
<span>{{$t('category')}}</span>
</div>
<j-input class="box-input" :placeholder="$t('PleaseEnter')+$t('category')"
v-model="queryParam.category"></j-input>
</div>
</a-col>
<a-col :md="6" :sm="8">
<div class="box-title-text">
<div class="title-text" :title="$t('inspectionItems')">
<span>{{$t('inspectionItems')}}</span>
</div>
<j-input class="box-input" :placeholder="$t('PleaseEnter')+$t('inspectionItems')"
v-model="queryParam.inspectionItem"></j-input>
</div>
</a-col>
<a-col :md="6" :sm="8">
<div class="box-title-text">
<div class="title-text" :title="$t('standard')">
<span>{{$t('standard')}}</span>
</div>
<j-input class="box-input" :placeholder="$t('PleaseEnter')+$t('standard')"
v-model="queryParam.serialNumber"></j-input>
</div>
</a-col>
<template v-if="toggleSearchStatus">
<a-col :md="6" :sm="8">
<div class="box-title-text">
<div class="title-text" :title="$t('areaOfResponsibility')">
<span>{{$t('areaOfResponsibility')}}</span>
</div>
<j-dict-select-tag class="box-input"
v-model="queryParam.dutyTerritory"
:placeholder="$t('PleaseSelect')+$t('areaOfResponsibility')"
:type="'select'"
:triggerChange="false" :dictCode="'duty_territory'"/>
</div>
</a-col>
</template>
<span style="float: right;overflow: hidden;margin-right: 11px" class="table-page-search-submitButtons">
<a-col :md="6" :sm="24">
<a @click="handleToggleSearch">
{{ !toggleSearchStatus ? $t('open') : $t('away') }}
<a-icon :type="toggleSearchStatus ? 'up' : 'down'"/>
</a>
<a-button class="box-button" style="margin-left: 8px" @click="searchReset">{{$t('reset')}}</a-button>
<a-button class="box-button" style="margin-left: 8px" type="primary" @click="searchQuery">{{$t('query')}}</a-button>
</a-col>
</span>
</a-row>
</a-form>
</div>
<div class="table-operator" style="margin-bottom: 16px">
<!-- 导入-->
<!-- <div class="operator-text"-->
<!-- style="float: left;font-size: 16px;font-weight: 400;color: #040B29;">-->
<!-- {{$t('DocumentStandard')}}-->
<!-- </div>-->
<!-- v-if="isTrue"-->
<div v-if="isTrue" class="operator-text" v-has="'dummyInventoryInfo:importData'">
<ImportFile :url="url" :authDummyInventoryBaseId="$route.query.id" :isTrue="true"
@getList="getPersonnelList"
:accept="'.zip'"/>
</div>
<!-- 模板下载-->
<!-- v-if="isTrue"-->
<div @click="handleModule"
v-if="isTrue"
v-has="'dummyInventoryInfo:exportTemplate'"
class="operator-text">
<a-icon type="download"/>
{{$t('templateDownload')}}
</div>
<!-- 导出-->
<div @click="handleExport"
v-has="'dummyInventoryInfo:exportData'"
class="operator-text">
<a-icon type="export" :rotate="-90"/>
{{$t('export')}}
</div>
<!-- 调取-->
<!-- v-if="isTrue"-->
<div v-if="isTrue"
@click="transferClick"
v-has="'dummyInventoryInfo:copyInfoByIds'"
class="operator-text">
<a-icon type="profile"/>
{{$t('Transfer')}}
</div>
<!-- 添加-->
<!-- v-if="isTrue"-->
<div v-if="isTrue"
@click="handleAdd"
v-has="'dummyInventoryInfo:add'"
class="operator-text">
<a-icon type="plus"/>
{{$t('add')}}
</div>
<!-- 复制-->
<!-- v-if="isTrue"-->
<div @click="copyClick"
v-if="isTrue"
v-has="'dummyInventoryInfo:copyInfoByIds'"
class="operator-text">
<a-icon type="copy"/>
{{$t('copy')}}
</div>
<!-- 批量设置-->
<!-- v-if="isTrue"-->
<div v-if="isTrue"
@click="batSettingClick"
v-has="'dummyInventoryInfo:setBatch'"
class="operator-text">
<a-icon type="setting"/>
{{$t('batSetting')}}
</div>
<!-- 批量删除-->
<!-- v-if="isTrue"-->
<div @click="handleDel"
v-if="isTrue"
v-has="'dummyInventoryInfo:deleteBatch'"
class="operator-text">
<a-icon type="delete"/>
{{$t('BatchDelete')}}
</div>
<!-- 自定义表头-->
<!-- <a-popconfirm :visible="customizevisible" overlayClassName='popconfirmmize' placement="bottomRight" >-->
<!-- <template slot="title" id="popconfirmmize">-->
<!-- <div style="height:320px;overflow:scroll;overflow-x: auto;">-->
<!-- <a-checkbox-->
<!-- style='margin-bottom: 22px;'-->
<!-- v-if="customizeList && customizeList.length"-->
<!-- v-model="checkAll"-->
<!-- :indeterminate="indeterminate"-->
<!-- @change="onCheckAllChange"-->
<!-- >{{$t('selectAll')}}-->
<!-- </a-checkbox>-->
<!-- <a-checkbox-group @change="onChange" v-model="checkedList" class="customize-text">-->
<!-- <a-checkbox class="customize-text-title" :disabled='item.disabled' v-for="(item, key) in customizeList" :key="key" :value="item.field">{{ item.name }}-->
<!-- </a-checkbox>-->
<!-- </a-checkbox-group>-->
<!-- <div class="drawer-bootom-button">-->
<!-- <a-button @click="cancel" style="margin-right: 16px">{{$t('cancel')}}</a-button>-->
<!-- <a-button @click="handleSubmit" type="primary" :loading="confirmLoading">{{$t('determine')}}</a-button>-->
<!-- </div>-->
<!-- </div>-->
<!-- </template>-->
<!-- <div class="operator-text" style="position: relative" @click='getcustomize'>-->
<!-- <a-icon type="setting"/>-->
<!-- {{ $t('customize') }}-->
<!-- </div>-->
<!-- </a-popconfirm>-->
</div>
<div style="width: 100%">
<a-table
class="table"
:loading="loading"
:pagination="false"
:components="drag(columns,'columns')"
:scroll="{x: '100%',y:'calc(100vh - 356px)'}"
rowKey="id"
:data-source="dataSource"
@change="tableOnChange"
:row-selection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"
:columns="columns">
<span slot="deliverableTemplate" slot-scope="text,result">
<span class="viewFile"
@click="viewFileClick(result.deliverableTemplate)"
v-if="result.deliverableTemplate">
{{$t('viewFile')}}
</span>
<span v-else>--</span>
</span>
<span slot="serialNumber" slot-scope="text,result" :title="text">
<a @click="standardClick(result)">
{{text}}
</a>
</span>
<!-- <span slot="item" slot-scope="text,record">-->
<!-- <a @click="itemClick(record)">{{text}}</a>-->
<!-- </span>-->
<span slot="operation" slot-scope="text,record">
<a v-if="isTrue"
class="text-operation"
v-has="'dummyInventoryInfo:edit'"
@click="edit(record)">{{$t('edit')}}</a>
<a v-if="isTrue"
class="text-operation"
v-has="'dummyInventoryInfo:deleteBatch'"
@click="deleteLib(record)">{{$t('deleteLib')}}</a>
<a v-if="isFalse"
class="text-operation"
@click="view(record)">{{$t('view')}}</a>
</span>
</a-table>
<div class="buttom-box" v-if="dataSource && dataSource.length > 0">
{{$t('total')+' '+this.dataSource.length+' '+ $t('strip')}}
</div>
</div>
</a-card>
</div>
</div>
<UpdateLog :url="url" ref="UpdateLogRef"/>
<transferList :url="url" @transferListForm="transferListForm" ref="transferListRef"/>
<addModel :url="url" ref="addModelRef" @addModelList="addModelList"/>
<edit-model :url="url" ref="editModelRef" @editModelList="editModelList"></edit-model>
<bat-setting :url="url" ref="batSettingRef" @batSettingList="batSettingList"></bat-setting>
<viewFileModel ref="viewFileModelRef"/>
</div>
</template>
<script>
import { Base64 } from 'js-base64'
import { mapGetters } from 'vuex'
import { getAction, postAction, downloadFile, deleteAction } from '@/api/manage'
import globalAdvancedQuery from '@/components/globalAdvancedQuery/index'
import UpdateLog from '@/components/UpdateLog/index'
import ImportFile from '@/components/ImportFile/index'
import transferList from '../components/transferList'
import addModel from '../components/addModel'
import editModel from '../components/editModel'
import batSetting from '../components/batSetting'
import viewFileModel from '@/components/viewFileModel/index'
import { ResizeHeader, ResizeColumnProvide } from '@/mixins/header'
export default {
name: 'certificationListMaintenance',
components: {
globalAdvancedQuery,
ImportFile,
UpdateLog,
transferList,
addModel,
editModel,
batSetting,
viewFileModel
},
mixins: [ResizeHeader, ResizeColumnProvide],
data() {
return {
title: '认证清单维护',
isTrue: false,
isFalse: false,
isbutton: false,
toggleSearchStatus:false,
dataSource: [],
url: {
list: '/authDummy/authDummyInventoryInfoEO/list',
logList: '/authDummy/authDummyLog/page',//更新log
exportTemplate: '/authDummy/authDummyInventoryInfoEO/exportTemplate',//模板下载
exportData: '/authDummy/authDummyInventoryInfoEO/exportData',//导出
addModel: '/authDummy/authDummyInventoryInfoEO/batchAdd',//添加
copyInfo: '/authDummy/authDummyInventoryInfoEO/copyInfoByIds',//复制
deleteBatch: '/authDummy/authDummyInventoryInfoEO/deleteBatch',//批量删除
editModel: '/authDummy/authDummyInventoryInfoEO/edit',//编辑
setBatch: '/authDummy/authDummyInventoryInfoEO/setBatch',//批量设置
importZipUrl: '/authDummy/authDummyInventoryInfoEO/importData',//导入
number: '/project/projectLawsInventoryEO/list'
},
queryParam: {},
orderByField: '',
columns: [
{
title: this.$t('category'),
align: 'left',
dataIndex: 'category',
width: 200,
sorter: true,
// fixed: 'left',
ellipsis: true
},
{
title: this.$t('inspectionItems'),
align: 'left',
dataIndex: 'inspectionItem',
width: 200,
ellipsis: true,
sorter: true,
// fixed: 'left',
scopedSlots: { customRender: 'inspectionItems' }
},
{
title: this.$t('configurationItem'),
align: 'left',
sorter: true,
dataIndex: 'configItem',
width: 200,
ellipsis: true
},
{
title: this.$t('certificationType'),
align: 'left',
dataIndex: 'attestationTypeName',
width: 100,
ellipsis: true
},
{
title: 'WVTA ID',
align: 'left',
sorter: true,
dataIndex: 'wvtaId',
width: 75,
ellipsis: true
},
{
title: this.$t('standard'),
align: 'left',
dataIndex: 'serialNumber',
width: 210,
sorter: true,
ellipsis: true,
scopedSlots: { customRender: 'serialNumber' }
},
{
title: this.$t('areaOfResponsibility'),
align: 'left',
dataIndex: 'dutyTerritoryName',
width: 150,
sorter: true,
ellipsis: true
},
{
title: this.$t('typeOfDeliverables'),
align: 'left',
sorter: true,
dataIndex: 'deliverableTypeName',
width: 330,
ellipsis: true
},
{
title: this.$t('deliverableTemplate'),
align: 'left',
dataIndex: 'deliverableTemplate',
width: 330,
ellipsis: true,
scopedSlots: { customRender: 'deliverableTemplate' }
},
{
title: this.$t('operation'),
align: 'left',
fixed: 'right',
width: 250,
scopedSlots: { customRender: 'operation' }
}
],
selectedRowKeys: [],
loading: false
}
},
created() {
if (this.$route.query.title == '市场认证清单详情') {
document.title = this.$t('marketCertificationListDetails')
this.columns.splice(7, 1)
} else {
document.title = this.$t('certificationListMaintenance')
}
},
mounted() {
this.title = this.$route.query.title
this.isTrue = this.$route.query.title == '市场认证清单详情' ? false : true
this.isFalse = this.$route.query.title == '市场认证清单详情' ? true : false
this.getList()
},
computed: {},
methods: {
...mapGetters(['userInfo']),
onSelectChange(value) {
this.selectedRowKeys = value
},
handleToggleSearch() {
this.toggleSearchStatus = !this.toggleSearchStatus
},
UpdateLogClick() {
this.$refs.UpdateLogRef.getList({ authDummyInventoryBaseId: this.$route.query.id })
},
//搜索
searchQuery() {
this.getList()
},
transferListForm() {
this.selectedRowKeys = []
this.getList()
},
//清空
searchReset() {
this.queryParam = {}
this.getList()
},
//模板下载
handleModule() {
downloadFile(this.url.exportTemplate, this.$t('marketCertificationList') + this.$t('importTemplate') + '.xls', {})
},
//调取
transferClick() {
this.$refs.transferListRef.transferModel()
},
//添加
handleAdd() {
this.$refs.addModelRef.addModel()
},
//导出
handleExport() {
let selectedRowKeys = JSON.parse(JSON.stringify(this.selectedRowKeys))
let query = {
...this.queryParam,
ids: selectedRowKeys.join(','),
authDummyInventoryBaseId: this.$route.query.id
}
downloadFile(this.url.exportData, this.$route.query.name + this.$t('marketCertificationList') + '.zip', query, this.Deselect)
},
Deselect() {
this.selectedRowKeys = []
},
//复制
copyClick() {
if (this.selectedRowKeys.length > 0) {
let _this = this
this.$confirm({
content: _this.$t('confirmCopy'),
onOk() {
let selectedRowKeys = JSON.parse(JSON.stringify(_this.selectedRowKeys))
getAction(_this.url.copyInfo, { ids: selectedRowKeys.join(',') }).then((res) => {
if (res.success) {
_this.$message.success(_this.$t('OperationSuccessful'))
_this.selectedRowKeys = []
_this.getList()
} else {
_this.$message.warning(res.message)
}
})
}
})
} else {
this.$message.warning(this.$t('selectLeastOne'))
}
},
//批量设置
batSettingClick() {
if (this.selectedRowKeys && this.selectedRowKeys.length > 0) {
this.$refs.batSettingRef.edit(JSON.parse(JSON.stringify(this.selectedRowKeys)))
} else {
this.$message.warning(this.$t('selectLeastOne'))
}
},
//批量删除
handleDel() {
if (this.selectedRowKeys.length > 0) {
let _this = this
this.$confirm({
content: _this.$t('ConfirmBatchDeletion'),
onOk() {
let idList = JSON.parse(JSON.stringify(_this.selectedRowKeys))
deleteAction(_this.url.deleteBatch, { ids: idList.join(',') }).then((res) => {
if (res.success) {
_this.$message.success(_this.$t('OperationSuccessful'))
_this.selectedRowKeys = []
_this.getList()
} else {
_this.$message.warning(res.message)
}
})
}
})
} else {
this.$message.warning(this.$t('selectLeastOne'))
}
},
addModelList() {
this.getList()
},
editModelList() {
this.getList()
},
batSettingList() {
this.getList()
},
tableOnChange(pagination, filters, sorter) {
this.orderBy = sorter.order == 'ascend' ? '1' : '2'
if (sorter.columnKey == 'dutyTerritoryName') {
this.orderByField = 'dutyTerritory'
} else if (sorter.columnKey == 'deliverableTypeName') {
this.orderByField = 'deliverableType'
} else {
this.orderByField = sorter.columnKey
}
this.getList()
},
getPersonnelList(){
this.getList()
},
getList() {
let query = {
...this.queryParam,
orderBy: this.orderBy,
orderByField: this.orderByField,
authDummyInventoryBaseId: this.$route.query.id
}
this.loading = true
getAction(this.url.list, query).then((res) => {
if (res.success) {
this.dataSource = res.result || []
this.loading = false
} else {
this.loading = false
}
})
},
edit(item) {
this.$refs.editModelRef.editModel(JSON.parse(JSON.stringify(item)))
},
view(item) {
this.$refs.editModelRef.editModel(JSON.parse(JSON.stringify(item)),1)
},
deleteLib(val) {
let _this = this
this.$confirm({
content: _this.$t('ConfirmDelete'),
onOk() {
deleteAction(_this.url.deleteBatch, { ids: val.id }).then((res) => {
if (res.success) {
_this.$message.success(_this.$t('OperationSuccessful'))
_this.getList()
} else {
_this.$message.warning(res.message)
}
})
}
})
},
// 交付物模板
viewFileClick(item) {
this.$refs.viewFileModelRef.clickButtonToUpload(item)
},
standardClick(row) {
let newUrl = this.$router.resolve({
path: '/docManage/library/detail',
query: {
id: row.bussDocumentLibraryId
}
})
window.open(newUrl.href, '_blank')
},
}
}
</script>
<style lang='less' scoped>
@import'~@assets/less/common.less';
.doc-detail {
background: #fff;
height: 100%;
.Virtual-detail-header {
width: 100%;
height: 68px;
line-height: 68px;
padding: 0 32px 0 32px;
box-sizing: border-box;
display: flex;
justify-content: space-between;
border-bottom: 2px #eff1f3 solid;
background: #fff;
z-index: 1000;
.Virtual-detail-title {
display: inline-block;
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
font-size: 20px;
font-weight: 400;
color: #040B29;
line-height: 68px;
}
.doc-detail-right {
width: 800px;
line-height: 68px;
display: flex;
}
}
.Virtual-detail-content {
padding: 0 32px 0 32px;
box-sizing: border-box;
font-size: 16px;
.box-title-text-add {
line-height: 1.4;
}
.title-text-add {
display: inline-block;
width: 100%;
font-weight: 500;
margin-right: 16px;
height: 42px;
line-height: 42px;
}
}
}
.text-left {
font-size: 14px;
font-weight: 400;
color: #6F7385;
display: inline-block;
width: 100px;
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
}
.text-right {
font-size: 16px;
font-weight: 400;
color: #040B29;
display: inline-block;
max-width: calc(50% - 240px);
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
}
.box-title-text {
line-height: 1.4;
display: flex;
align-items: center;
margin-bottom: 10px;
margin-right: 20px;
}
.title-text {
width: 110px;
color: #000F16;
display: inline-block;
font-weight: 500;
font-size: 14px;
margin-right: 16px;
margin-top: 3px;
text-align: right;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.box-input {
display: inline-block;
height: 38px;
margin-top: 2px;
}
.box-button {
height: 38px;
}
.text-operation {
margin-right: 8px;
}
.buttom-box {
width: 100%;
text-align: right;
font-size: 16px;
font-weight: 500;
color: #000F16;
}
::v-deep .ant-table-placeholder {
margin-top: 8px !important;
}
.viewFile {
color: #00B3BE;
cursor: pointer;
}
</style>