<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 :xl='6' :lg='7' :md='8' :sm='24'>
|
<a-form-item label='产品'>
|
<j-search-select-tag placeholder='请选择产品' v-model='queryParam.prodId' :dictOptions='proOptions' />
|
</a-form-item>
|
</a-col>
|
<a-col :xl='6' :lg='7' :md='8' :sm='24'>
|
<a-form-item label='大纲'>
|
<j-search-select-tag placeholder='请选择大纲' v-model='queryParam.outlineId' :dictOptions='outOptions' />
|
</a-form-item>
|
</a-col>
|
<template v-if='toggleSearchStatus'>
|
<a-col :xl='6' :lg='7' :md='8' :sm='24'>
|
<a-form-item label='启用状态'>
|
<a-select placeholder="请输入启用状态" v-model="queryParam.enabled">
|
<a-select-option :value="0">禁用</a-select-option>
|
<a-select-option :value="1">启用</a-select-option>
|
</a-select>
|
</a-form-item>
|
</a-col>
|
|
<a-col :xl='6' :lg='7' :md='8' :sm='24'>
|
<a-form-item label='发布状态'>
|
<j-dict-select-tag v-model='queryParam.status' placeholder='发布状态' dictCode='outline_status' />
|
</a-form-item>
|
</a-col>
|
</template>
|
<a-col :xl='6' :lg='7' :md='8' :sm='24'>
|
<span style='float: left;overflow: hidden;' class='table-page-search-submitButtons'>
|
<a-button type='primary' @click='searchQuery' icon='search'>查询</a-button>
|
<a-button type='primary' @click='searchReset' icon='reload' style='margin-left: 8px'>重置</a-button>
|
<a @click='handleToggleSearch' style='margin-left: 8px'>
|
{{ toggleSearchStatus ? '收起' : '展开' }}
|
<a-icon :type="toggleSearchStatus ? 'up' : 'down'" />
|
</a>
|
</span>
|
</a-col>
|
</a-row>
|
</a-form>
|
</div>
|
<!-- 查询区域-END -->
|
|
<!-- 操作按钮区域 -->
|
<div class='table-operator'>
|
<a-button @click='handleAdd' type='primary' icon='plus'>新增</a-button>
|
<a-button type='primary' icon='download' @click="handleExportXls('lims_testing_standard')">导出</a-button>
|
<a-upload name='file' :showUploadList='false' :multiple='false' :headers='tokenHeader' :action='importExcelUrl'
|
@change='handleImportExcel'>
|
<a-button type='primary' icon='import'>导入</a-button>
|
</a-upload>
|
<!-- 高级查询区域 -->
|
<j-super-query :fieldList='superFieldList' ref='superQueryModal'
|
@handleSuperQuery='handleSuperQuery'></j-super-query>
|
<a-dropdown v-if='selectedRowKeys.length > 0'>
|
<a-menu slot='overlay'>
|
<a-menu-item key='1' @click='batchDel'>
|
<a-icon type='delete' />
|
删除
|
</a-menu-item>
|
</a-menu>
|
<a-button style='margin-left: 8px'> 批量操作
|
<a-icon type='down' />
|
</a-button>
|
</a-dropdown>
|
</div>
|
|
<!-- table区域-begin -->
|
<div>
|
<div class='ant-alert ant-alert-info' style='margin-bottom: 16px;'>
|
<i class='anticon anticon-info-circle ant-alert-icon'></i> 已选择 <a
|
style='font-weight: 600'>{{ selectedRowKeys.length }}</a>项
|
<a style='margin-left: 24px' @click='onClearSelected'>清空</a>
|
</div>
|
|
<a-table
|
ref='table'
|
size='middle'
|
:scroll='{x:true}'
|
bordered
|
rowKey='id'
|
:columns='columns'
|
:dataSource='dataSource'
|
:pagination='ipagination'
|
:loading='loading'
|
:rowSelection='{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}'
|
class='j-table-force-nowrap'
|
@change='handleTableChange'>
|
|
<template slot='htmlSlot' slot-scope='text'>
|
<div v-html='text'></div>
|
</template>
|
<template slot='imgSlot' slot-scope='text'>
|
<span v-if='!text' style='font-size: 12px;font-style: italic;'>无图片</span>
|
<img v-else :src='getImgView(text)' height='25px' alt=''
|
style='max-width:80px;font-size: 12px;font-style: italic;' />
|
</template>
|
<template slot='fileSlot' slot-scope='text'>
|
<span v-if='!text' style='font-size: 12px;font-style: italic;'>无文件</span>
|
<a-button
|
v-else
|
:ghost='true'
|
type='primary'
|
icon='download'
|
size='small'
|
@click='downloadFile(text)'>
|
下载
|
</a-button>
|
</template>
|
|
<span slot='action' slot-scope='text, record'>
|
<a :disabled='record.status != STATU.S0' @click='handleEdit(record)'>编辑</a>
|
|
<a-divider type='vertical' />
|
<a @click="handleMaintain(record)">{{ record.status != STATU.S0 ? '查看' : '维护' }}</a>
|
|
<a-divider type='vertical' />
|
<a-dropdown>
|
<a class='ant-dropdown-link'>更多 <a-icon type='down' /></a>
|
<a-menu slot='overlay'>
|
<a-menu-item>
|
<a @click='handleDetail(record)'>详情</a>
|
</a-menu-item>
|
<a-menu-item v-if='record.status == STATU.S0'>
|
<a @click='handleReport(record)'>发布</a>
|
</a-menu-item>
|
<a-menu-item v-if='record.status == STATU.S1'>
|
<a @click='handleVersion(record)'>生成新版</a>
|
</a-menu-item>
|
<a-menu-item>
|
<a-popconfirm title='确定删除吗?' @confirm='() => handleDelete(record.id)'>
|
<a>删除</a>
|
</a-popconfirm>
|
</a-menu-item>
|
</a-menu>
|
</a-dropdown>
|
</span>
|
|
</a-table>
|
</div>
|
|
<lims-testing-standard-modal ref='modalForm' @ok='modalFormOk'></lims-testing-standard-modal>
|
</a-card>
|
</template>
|
|
<script>
|
|
import '@/assets/less/TableExpand.less'
|
import { mixinDevice } from '@/utils/mixin'
|
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
|
import LimsTestingStandardModal from './modules/LimsTestingStandardModal'
|
import { filterMultiDictText } from '@/components/dict/JDictSelectUtil'
|
import { editStand, queryOutlineList, queryProductList } from '@api/lims'
|
|
export default {
|
name: 'LimsTestingStandardList',
|
mixins: [JeecgListMixin, mixinDevice],
|
components: {
|
LimsTestingStandardModal
|
},
|
data() {
|
return {
|
description: 'lims_testing_standard管理页面',
|
proOptions: [],
|
outOptions: [],
|
//技术标准的状态 0-新建 1-发布 2-废止
|
STATU: { S0: 0, S1: 1, S2: 2 },
|
isorter: {
|
column: 'createTime,ver',
|
order: 'desc',
|
},
|
// 表头
|
columns: [
|
{
|
title: '#',
|
dataIndex: '',
|
key: 'rowIndex',
|
width: 60,
|
align: 'center',
|
customRender: function(t, r, index) {
|
return parseInt(index) + 1
|
}
|
},
|
{
|
title: '名称',
|
align: 'center',
|
dataIndex: 'name'
|
},
|
{
|
title: '编码',
|
align: 'center',
|
dataIndex: 'code'
|
},
|
{
|
title: '版本',
|
align: 'center',
|
dataIndex: 'ver'
|
},
|
{
|
title: '产品',
|
align: 'center',
|
dataIndex: 'prodId',
|
customRender: (text) => (text ? filterMultiDictText(this.proOptions, text) : '')
|
|
},
|
{
|
title: '大纲',
|
align: 'center',
|
dataIndex: 'outlineId',
|
customRender: (text) => (text ? filterMultiDictText(this.outOptions, text) : '')
|
},
|
|
{
|
title: '启用状态',
|
align: 'center',
|
dataIndex: 'enabled',
|
customRender: function(t, r, index) {
|
return t == null ? '' : (t == 0 ? '未启用' : '启用')
|
}
|
},
|
{
|
title: '发布状态',
|
align: 'center',
|
dataIndex: 'status_dictText'
|
},
|
{
|
title: '备注',
|
align: 'center',
|
dataIndex: 'remark'
|
},
|
{
|
title: '创建人',
|
align: 'center',
|
dataIndex: 'createBy_dictText'
|
},
|
{
|
title: '创建时间',
|
align: 'center',
|
dataIndex: 'createTime'
|
}, {
|
title: '更新人',
|
align: 'center',
|
dataIndex: 'updateBy_dictText'
|
},
|
{
|
title: '更新时间',
|
align: 'center',
|
dataIndex: 'updateTime'
|
},
|
{
|
title: '操作',
|
dataIndex: 'action',
|
align: 'center',
|
fixed: 'right',
|
width: 147,
|
scopedSlots: { customRender: 'action' }
|
}
|
],
|
url: {
|
list: '/lims/testing/stand/list',
|
delete: '/lims/testing/stand/delete',
|
deleteBatch: '/lims/testing/stand/deleteBatch',
|
exportXlsUrl: '/lims/testing/stand/exportXls',
|
importExcelUrl: '/lims/testing/stand/importExcel'
|
|
},
|
superFieldList: []
|
}
|
},
|
created() {
|
this.getSuperFieldList()
|
},
|
mounted() {
|
this.initOptions()
|
},
|
computed: {
|
importExcelUrl: function() {
|
return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`
|
}
|
},
|
methods: {
|
initDictConfig() {
|
},
|
getSuperFieldList() {
|
let fieldList = []
|
fieldList.push({ type: 'switch', value: 'enabled', text: '启用状态' })
|
|
this.superFieldList = fieldList
|
},
|
handleMaintain(record){
|
this.$router.push({path:"/test/stand/maintain",query:{id:record.id}})
|
},
|
initOptions() {
|
//产品列表
|
queryProductList({ 'pageNo': 1, 'pageSize': 1000 }).then(res => {
|
if (res.success) {
|
this.proOptions = []
|
let result = res.result.records
|
if (result) {
|
result.forEach(item => {
|
this.proOptions.push({ 'text': item.name, 'value': item.id })
|
})
|
}
|
}
|
|
})
|
//大纲列表
|
queryOutlineList({ 'pageNo': 1, 'pageSize': 1000 }).then(res => {
|
if (res.success) {
|
let result = res.result.records
|
if (result) {
|
result.forEach(item => {
|
this.outOptions.push({ 'text': item.name, 'value': item.id })
|
})
|
}
|
}
|
|
})
|
|
|
},
|
editStand(record,_this) {
|
editStand(record).then(res => {
|
if (res.success) {
|
_this.$message.success(res.message)
|
_this.loadData(1)
|
}
|
})
|
|
},
|
//发布
|
handleReport(record) {
|
let _this = this
|
this.$confirm({
|
title: '提示',
|
content: '发布后废止旧版本且当前新版本无法再编辑,确定吗?',
|
okText: '确认',
|
cancelText: '取消',
|
onOk() {
|
record.status = _this.STATU.S1
|
_this.editStand(record,_this)
|
|
},
|
onCancel() {
|
|
}
|
})
|
},
|
//生成新版本
|
handleVersion(record) {
|
let _this = this
|
this.$confirm({
|
title: '提示',
|
content: '完全复制一个新版,确定继续?',
|
okText: '确认',
|
cancelText: '取消',
|
onOk() {
|
record.status = _this.STATU.S2
|
_this.editStand(record,_this)
|
|
},
|
onCancel() {
|
|
}
|
})
|
|
},
|
}
|
}
|
</script>
|
<style scoped>
|
@import '~@assets/less/common.less';
|
</style>
|