<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 :lg='7' :md='8' :sm='24' :xl='6'>
|
<a-form-item label='刀柄号'>
|
<a-input v-model='queryParam.hiltCode' placeholder='请输入刀柄号'></a-input>
|
</a-form-item>
|
</a-col>
|
<a-col :lg='7' :md='8' :sm='24' :xl='6'>
|
<a-form-item label='状态'>
|
<j-dict-select-tag v-model='queryParam.status' dictCode='combined_knife_state' placeholder='请选择状态' />
|
</a-form-item>
|
</a-col>
|
<a-col :lg='7' :md='8' :sm='24' :xl='6'>
|
<span class='table-page-search-submitButtons' style='float: left;overflow: hidden;'>
|
<a-button icon='search' type='primary' @click='searchQuery'>查询</a-button>
|
<a-button icon='reload' style='margin-left: 8px' type='primary' @click='searchReset'>重置</a-button>
|
</span>
|
</a-col>
|
</a-row>
|
</a-form>
|
</div>
|
<!-- 查询区域-END -->
|
|
<!-- 操作按钮区域 -->
|
<div class='table-operator'>
|
<a-button icon='plus' type='primary' @click='handleAdd'>刀具组装</a-button>
|
</div>
|
|
<!-- table区域-begin -->
|
<div>
|
<a-table
|
ref='table'
|
:columns='columns'
|
:customRow='clickThenSelect'
|
:dataSource='dataSource'
|
:loading='loading'
|
:pagination='ipagination'
|
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange, type:'radio'}"
|
:scroll='{x:true}'
|
bordered
|
class='j-table-force-nowrap'
|
rowKey='id'
|
size='middle'
|
@change='handleTableChange'>
|
|
<template slot='htmlSlot' slot-scope='text'>
|
<div v-html='text'></div>
|
</template>
|
<template slot='imgSlot' slot-scope='text,record'>
|
<span v-if='!text' style='font-size: 12px;font-style: italic;'>无图片</span>
|
<img v-else :preview='record.id' :src='getImgView(text)' alt='' height='25px'
|
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'
|
icon='download'
|
size='small'
|
type='primary'
|
@click='downloadFile(text)'>
|
下载
|
</a-button>
|
</template>
|
|
<span slot='action' slot-scope='text, record'>
|
<a-popconfirm title='确定拆卸吗?' @confirm='() => handleDelete(record.id)'>
|
<a>刀具拆卸</a>
|
</a-popconfirm>
|
</span>
|
|
</a-table>
|
</div>
|
|
<a-tabs defaultActiveKey='1'>
|
<a-tab-pane key='1' tab='组合刀记录'>
|
<ToolCombinationDetailList :mainId='toolCombinationDetailMainId' />
|
</a-tab-pane>
|
</a-tabs>
|
|
<!-- <toolCombination-modal ref='modalForm' @ok='modalFormOk'></toolCombination-modal>-->
|
<inbound-order-model ref="modalForm" @ok="modalFormOk"></inbound-order-model>
|
</a-card>
|
</template>
|
|
<script>
|
|
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
|
import InboundOrderModel from './modules/InboundOrderModel'
|
// import ToolCombinationModal from './modules/ToolCombinationModal'
|
import { getAction } from '@/api/manage'
|
import ToolCombinationDetailList from './ToolCombinationDetailList'
|
import '@/assets/less/TableExpand.less'
|
|
export default {
|
name: 'ToolCombinationList',
|
mixins: [JeecgListMixin],
|
components: {
|
InboundOrderModel,
|
ToolCombinationDetailList,
|
// ToolCombinationModal
|
},
|
data() {
|
return {
|
description: '组合刀记录主表管理页面',
|
// 表头
|
columns: [
|
{
|
title: '刀柄号',
|
align: 'center',
|
dataIndex: 'hiltCode'
|
},
|
{
|
title: '状态',
|
align: 'center',
|
dataIndex: 'status_dictText'
|
},
|
{
|
title: '组装人',
|
align: 'center',
|
dataIndex: 'bindPerson'
|
},
|
{
|
title: '组装时间',
|
align: 'center',
|
dataIndex: 'bindDate',
|
customRender: function(text) {
|
return !text ? '' : (text.length > 10 ? text.substr(0, 10) : text)
|
}
|
},
|
{
|
title: '拆卸人',
|
align: 'center',
|
dataIndex: 'disassemblePerson'
|
},
|
{
|
title: '拆卸时间',
|
align: 'center',
|
dataIndex: 'disassembleDate',
|
customRender: function(text) {
|
return !text ? '' : (text.length > 10 ? text.substr(0, 10) : text)
|
}
|
},
|
{
|
title: '操作',
|
dataIndex: 'action',
|
align: 'center',
|
fixed: 'right',
|
width: 147,
|
scopedSlots: { customRender: 'action' }
|
}
|
],
|
url: {
|
list: '/tms/toolCombination/list',
|
delete: '/tms/toolCombination/delete',
|
deleteBatch: '/tms/toolCombination/deleteBatch',
|
exportXlsUrl: '/tms/toolCombination/exportXls',
|
importExcelUrl: 'tms/toolCombination/importExcel'
|
},
|
dictOptions: {
|
status: []
|
},
|
/* 分页参数 */
|
ipagination: {
|
current: 1,
|
pageSize: 5,
|
pageSizeOptions: ['5', '10', '50'],
|
showTotal: (total, range) => {
|
return range[0] + '-' + range[1] + ' 共' + total + '条'
|
},
|
showQuickJumper: true,
|
showSizeChanger: true,
|
total: 0
|
},
|
selectedMainId: '',
|
superFieldList: [],
|
toolCombinationDetailMainId: ''
|
}
|
},
|
created() {
|
this.getSuperFieldList()
|
},
|
computed: {
|
importExcelUrl: function() {
|
return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`
|
}
|
},
|
methods: {
|
initDictConfig() {
|
},
|
clickThenSelect(record) {
|
return {
|
on: {
|
click: () => {
|
this.onSelectChange(record.id.split(','), [record])
|
}
|
}
|
}
|
},
|
onClearSelected() {
|
this.selectedRowKeys = []
|
this.selectionRows = []
|
this.selectedMainId = ''
|
},
|
onSelectChange(selectedRowKeys, selectionRows) {
|
this.selectedMainId = selectedRowKeys[0]
|
this.selectedRowKeys = selectedRowKeys
|
this.selectionRows = selectionRows
|
this.toolCombinationDetailMainId = selectionRows[0]['id']
|
},
|
loadData(arg) {
|
if (!this.url.list) {
|
this.$message.error('请设置url.list属性!')
|
return
|
}
|
//加载数据 若传入参数1则加载第一页的内容
|
if (arg === 1) {
|
this.ipagination.current = 1
|
}
|
this.onClearSelected()
|
var params = this.getQueryParams()//查询条件
|
this.loading = true
|
getAction(this.url.list, params).then((res) => {
|
if (res.success) {
|
this.dataSource = res.result.records
|
this.ipagination.total = res.result.total
|
// 子表信息展示
|
if (this.dataSource.length !== 0) {
|
// 刷新子表格
|
this.selectedMainId = this.dataSource[0].id
|
this.selectedRowKeys.push(this.dataSource[0].id);
|
this.selectionRows = this.dataSource[0]
|
this.toolCombinationDetailMainId = this.dataSource[0].id
|
} else {
|
// 刷新子表格
|
this.toolCombinationDetailMainId = ''
|
}
|
}
|
if (res.code === 510) {
|
this.$message.warning(res.message)
|
}
|
this.loading = false
|
})
|
},
|
getSuperFieldList() {
|
let fieldList = []
|
fieldList.push({ type: 'string', value: 'id', text: '主键', dictCode: '' })
|
fieldList.push({ type: 'string', value: 'hiltCode', text: '刀柄号', dictCode: '' })
|
fieldList.push({ type: 'string', value: 'status', text: '状态', dictCode: 'combined_knife_state' })
|
fieldList.push({ type: 'string', value: 'bindPerson', text: '组装人', dictCode: '' })
|
fieldList.push({ type: 'date', value: 'bindDate', text: '组装时间' })
|
fieldList.push({ type: 'string', value: 'disassemblePerson', text: '拆卸人', dictCode: '' })
|
fieldList.push({ type: 'date', value: 'disassembleDate', text: '拆卸时间' })
|
this.superFieldList = fieldList
|
}
|
}
|
}
|
</script>
|
<style scoped>
|
@import '~@assets/less/common.less'
|
</style>
|