<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-date placeholder='请选择批次日期' v-model='queryParam.batchDate' style='width: 100%' />
|
</a-form-item>
|
</a-col>
|
|
<a-col :xl='6' :lg='7' :md='8' :sm='24'>
|
<a-form-item label='批次号'>
|
<j-input placeholder='请输入批次号' v-model='queryParam.batchCode' style='width: 100%' />
|
</a-form-item>
|
</a-col>
|
<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_batch')">导出</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 @click='handleEdit(record)'>编辑</a>
|
|
<a-divider type='vertical' />
|
<a @click='openSample(record)'>样本</a>
|
<a-divider type='vertical' />
|
<a @click='openResult(record)'>结果</a>
|
<a-divider type='vertical' />
|
<a @click='openReport(record)'>报表</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>
|
<a-popconfirm title='确定删除吗?' @confirm='() => handleDelete(record.id)'>
|
<a>删除</a>
|
</a-popconfirm>
|
</a-menu-item>
|
</a-menu>
|
</a-dropdown>
|
</span>
|
|
</a-table>
|
</div>
|
|
<lims-testing-batch-modal2 ref='modalForm2' @ok='modalFormOk'></lims-testing-batch-modal2>
|
<lims-testing-batch-modal :proOptions='proOptions' :standOptions='standOptions' ref='modalForm'
|
@ok='modalFormOk'></lims-testing-batch-modal>
|
</a-card>
|
</template>
|
|
<script>
|
|
import '@/assets/less/TableExpand.less'
|
import { mixinDevice } from '@/utils/mixin'
|
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
|
import LimsTestingBatchModal2 from './modules/LimsTestingBatchModal2'
|
import LimsTestingBatchModal from './modules/LimsTestingBatchModal'
|
import { queryProductList, queryStandList } from '@api/lims'
|
|
export default {
|
name: 'LimsTestingBatchList',
|
mixins: [JeecgListMixin, mixinDevice],
|
components: {
|
LimsTestingBatchModal,
|
LimsTestingBatchModal2
|
},
|
data() {
|
return {
|
description: 'lims_testing_batch管理页面',
|
proOptions: [],
|
standOptions: [],
|
// 表头
|
columns: [
|
{
|
title: '#',
|
dataIndex: '',
|
key: 'rowIndex',
|
width: 60,
|
align: 'center',
|
customRender: function(t, r, index) {
|
return parseInt(index) + 1
|
}
|
},
|
{
|
title: '批次日期',
|
align: 'center',
|
dataIndex: 'batchDate',
|
customRender: function(text) {
|
return !text ? '' : (text.length > 10 ? text.substr(0, 10) : text)
|
}
|
},
|
{
|
title: '批次号',
|
align: 'center',
|
dataIndex: 'batchCode'
|
},
|
{
|
title: '批次类型(样机、小批、自测)',
|
align: 'center',
|
dataIndex: 'batchType_dictText'
|
},
|
{
|
title: '待测产品',
|
align: 'center',
|
dataIndex: 'prodName'
|
},
|
{
|
title: '产品型号',
|
align: 'center',
|
dataIndex: 'prodModels'
|
},
|
{
|
title: '类型通道',
|
align: 'center',
|
dataIndex: 'channels'
|
},
|
{
|
title: '技术标准',
|
align: 'center',
|
dataIndex: 'standName'
|
},
|
{
|
title: '产品批次',
|
align: 'center',
|
dataIndex: 'prodBatch'
|
},
|
{
|
title: '样本数量',
|
align: 'center',
|
dataIndex: 'sampleNum'
|
},
|
{
|
title: '检验状态',
|
align: 'center',
|
dataIndex: 'batchStatus'
|
},
|
{
|
title: '说明',
|
align: 'center',
|
dataIndex: 'explain'
|
},
|
{
|
title: '检验结果',
|
align: 'center',
|
dataIndex: 'batchResult'
|
},
|
{
|
title: '鉴定结论',
|
align: 'center',
|
dataIndex: 'conclusion', customRender: function(text) {
|
return !text ? '' : (text == 1 ? '合格' : '不合格')
|
}
|
},
|
{
|
title: '编制人',
|
align: 'center',
|
dataIndex: 'inspector_dictText'
|
},
|
{
|
title: '编制日期',
|
align: 'center',
|
dataIndex: 'inspectTime',
|
customRender: function(text) {
|
return !text ? '' : (text.length > 10 ? text.substr(0, 10) : text)
|
}
|
},
|
{
|
title: '审核人',
|
align: 'center',
|
dataIndex: 'auditor_dictText'
|
},
|
{
|
title: '审核日期',
|
align: 'center',
|
dataIndex: 'auditTime',
|
customRender: function(text) {
|
return !text ? '' : (text.length > 10 ? text.substr(0, 10) : text)
|
}
|
},
|
{
|
title: '批准人',
|
align: 'center',
|
dataIndex: 'approver_dictText'
|
},
|
{
|
title: '批准日期',
|
align: 'center',
|
dataIndex: 'approveTime',
|
customRender: function(text) {
|
return !text ? '' : (text.length > 10 ? text.substr(0, 10) : text)
|
}
|
},
|
{
|
title: '备注',
|
align: 'center',
|
dataIndex: 'remark'
|
},
|
{
|
title: '操作',
|
dataIndex: 'action',
|
align: 'center',
|
fixed: 'right',
|
width: 147,
|
scopedSlots: { customRender: 'action' }
|
}
|
],
|
url: {
|
list: '/lims/testing/batch/list',
|
delete: '/lims/testing/batch/delete',
|
deleteBatch: '/lims/testing/batch/deleteBatch',
|
exportXlsUrl: '/lims/testing/batch/exportXls',
|
importExcelUrl: '/lims/testing/batch/importExcel'
|
|
},
|
dictOptions: {},
|
superFieldList: []
|
}
|
},
|
created() {
|
this.getSuperFieldList()
|
},
|
computed: {
|
importExcelUrl: function() {
|
return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`
|
}
|
},
|
methods: {
|
openSample(record) {
|
this.$router.push({ path: '/test/sample', query: { id: record.id, prodId: record.prodId } })
|
},
|
openResult(record) {
|
this.$router.push({ path: '/test/result', query: { id: record.id, prodId: record.prodId } })
|
},
|
openReport(record) {
|
this.$router.push({ path: '/test/inspectResult', query: { batch: record.id } })
|
},
|
handleAdd: function() {
|
this.$refs.modalForm2.add()
|
this.$refs.modalForm2.title = '新增'
|
this.$refs.modalForm2.disableSubmit = false
|
},
|
initDictConfig() {
|
//产品列表
|
queryProductList({ 'pageNo': 1, 'pageSize': 1000 }).then(res => {
|
if (res.success) {
|
this.proOptions = []
|
res.result.records.forEach(item => {
|
this.proOptions.push({ 'text': item.name, 'value': item.id })
|
})
|
|
}
|
|
})
|
//技术标准列表
|
queryStandList({ 'pageNo': 1, 'pageSize': 1000 }).then(res => {
|
if (res.success) {
|
this.standOptions = []
|
res.result.records.forEach(item => {
|
this.standOptions.push({ 'text': item.name, 'value': item.id })
|
})
|
}
|
})
|
},
|
getSuperFieldList() {
|
let fieldList = []
|
fieldList.push({ type: 'date', value: 'batchDate', text: '批次日期' })
|
fieldList.push({ type: 'string', value: 'batchCode', text: '批次号' })
|
fieldList.push({ type: 'string', value: 'batchType', text: '批次类型(样机、小批、自测)' })
|
fieldList.push({ type: 'string', value: 'prodId', text: '待测产品' })
|
fieldList.push({ type: 'string', value: 'prodModels', text: '产品型号' })
|
fieldList.push({ type: 'string', value: 'channels', text: '类型通道' })
|
fieldList.push({ type: 'int', value: 'standardId', text: '技术标准' })
|
fieldList.push({ type: 'string', value: 'prodBatch', text: '产品批次' })
|
fieldList.push({ type: 'int', value: 'sampleNum', text: '样本数量' })
|
fieldList.push({ type: 'string', value: 'batchStatus', text: '检验状态' })
|
fieldList.push({ type: 'string', value: 'explain', text: '说明' })
|
fieldList.push({ type: 'string', value: 'batchResult', text: '检验结果' })
|
fieldList.push({ type: 'string', value: 'conclusion', text: '鉴定结论' })
|
fieldList.push({ type: 'string', value: 'inspector', text: '编制人' })
|
fieldList.push({ type: 'date', value: 'inspectTime', text: '编制日期' })
|
fieldList.push({ type: 'string', value: 'auditor', text: '审核人' })
|
fieldList.push({ type: 'date', value: 'auditTime', text: '审核日期' })
|
fieldList.push({ type: 'string', value: 'approver', text: '批准人' })
|
fieldList.push({ type: 'date', value: 'approveTime', text: '批准日期' })
|
fieldList.push({ type: 'string', value: 'remark', text: '备注' })
|
this.superFieldList = fieldList
|
}
|
}
|
}
|
</script>
|
<style scoped>
|
@import '~@assets/less/common.less';
|
</style>
|