<template>
|
<div class="device_list">
|
<!-- 查询区域 -->
|
<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="设备编号">
|
<a-input placeholder="请输入设备编号" v-model="queryParam.equipmentId"/>
|
</a-form-item>
|
</a-col>
|
<a-col :xl="6" :lg="7" :md="8" :sm="24">
|
<a-form-item label="零件号">
|
<a-input placeholder="请输入零件号" v-model="queryParam.partId" allowClear/>
|
</a-form-item>
|
</a-col>
|
<a-col :xl="6" :lg="7" :md="8" :sm="24">
|
<a-form-item label="日期">
|
<a-range-picker v-model="dates" style="width: 100%" @change="dateParamChange"></a-range-picker>
|
</a-form-item>
|
</a-col>
|
<a-col :xl="6" :lg="7" :md="8" :sm="24">
|
<a-space>
|
<a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
|
<a-button type="primary" @click="searchReset" icon="reload">重置</a-button>
|
</a-space>
|
</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="importTemplate('零件加工管理')">导入模板</a-button>
|
<a-button type="primary" icon="download" @click="handleExportXls('零件加工管理')">导出</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>
|
|
<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 id="DeviceList" style="flex: 1;overflow: hidden">
|
<a-table
|
ref="table"
|
size="middle"
|
:scroll="{x:'max-content',y:scrollY}"
|
bordered
|
rowKey="id"
|
:columns="columns"
|
:dataSource="dataSource"
|
:pagination="ipagination"
|
:loading="loading"
|
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
|
class="j-table-force-nowrap"
|
@change="handleTableChange">
|
|
<span slot="action" slot-scope="text, record">
|
<a @click="handleEdit(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>
|
|
<PartsMatchingModal ref="modalForm" @ok="modalFormOk"/>
|
</div>
|
</template>
|
|
<script>
|
import moment from 'moment'
|
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
|
import PartsMatchingModal from './PartsMatchingModal'
|
|
export default {
|
name: 'PartsMatchingList',
|
mixins: [JeecgListMixin],
|
components: {
|
PartsMatchingModal
|
},
|
props: { nodeTree: '', Type: '', nodePeople: '' },
|
data() {
|
return {
|
description: 'partsMatching管理页面',
|
/* 分页参数 */
|
ipagination: {
|
current: 1,
|
pageSize: 30,
|
pageSizeOptions: ['30', '50', '100'],
|
showTotal: (total, range) => {
|
return range[0] + '-' + range[1] + ' 共' + total + '条'
|
},
|
showQuickJumper: true,
|
showSizeChanger: true,
|
total: 0
|
},
|
queryParam: {},
|
disableMixinCreated: true,
|
dates: [moment().subtract(1, 'day'), moment()],
|
// 表头
|
columns: [
|
{
|
title: '#',
|
dataIndex: '',
|
key: 'rowIndex',
|
width: 60,
|
align: 'center',
|
customRender: function(t, r, index) {
|
return parseInt(index) + 1
|
}
|
},
|
{
|
title: '日期',
|
align: 'center',
|
dataIndex: 'theDate',
|
width: 200
|
},
|
{
|
title: '设备编号',
|
align: 'center',
|
dataIndex: 'equipmentId',
|
width: 230
|
},
|
{
|
title: '零件号',
|
align: 'center',
|
dataIndex: 'partId',
|
width: 150
|
},
|
{
|
title: '标准加工工时(min)',
|
align: 'center',
|
dataIndex: 'standardProcessLong',
|
width: 150
|
},
|
{
|
title: '加工零件数量',
|
align: 'center',
|
dataIndex: 'processCount',
|
width: 150
|
},
|
{
|
title: '合格零件数量',
|
align: 'center',
|
dataIndex: 'passCount',
|
width: 150
|
},
|
{
|
title: '加工总时长',
|
align: 'center',
|
dataIndex: 'totalProcessLong',
|
width: 150
|
},
|
{
|
title: '操作',
|
dataIndex: 'action',
|
align: 'center',
|
fixed: 'right',
|
width: 150,
|
scopedSlots: { customRender: 'action' }
|
}
|
],
|
scrollY: 465,
|
url: {
|
list: '/mdc/mdcPartProcessInfo/list',
|
delete: '/mdc/mdcPartProcessInfo/delete',
|
deleteBatch: '/mdc/mdcPartProcessInfo/deleteBatch',
|
exportXlsUrl: '/mdc/mdcPartProcessInfo/exportXls',
|
importExcelUrl: '/mdc/mdcPartProcessInfo/importExcel'
|
}
|
}
|
},
|
watch: {
|
Type(valmath) {
|
this.dataList = []
|
this.queryParam.typeTree = valmath
|
// console.log(this.queryParam.typeTree)
|
},
|
nodeTree(val) { //监听currSelected 变化,将变化后的数值传递给 getCurrSelected 事件
|
if (JSON.stringify(val) != '{}') {
|
if (val.equipmentId) {
|
this.queryParam.parentId = ''
|
this.queryParam.equipmentId = val.equipmentId
|
} else {
|
this.queryParam.parentId = val.key
|
this.queryParam.equipmentId = ''
|
}
|
this.searchQuery()
|
}
|
},
|
nodePeople(val) {
|
if (JSON.stringify(val) != '{}') {
|
if (val.equipmentId) {
|
this.queryParam.parentId = ''
|
this.queryParam.equipmentId = val.equipmentId
|
} else {
|
this.queryParam.parentId = val.key
|
this.queryParam.equipmentId = ''
|
}
|
this.searchQuery()
|
}
|
}
|
},
|
computed: {
|
importExcelUrl: function() {
|
return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`
|
}
|
},
|
methods: {
|
dateParamChange(v1, v2) {
|
this.queryParam.startTime = v2[0]
|
this.queryParam.endTime = v2[1]
|
this.dates = [v1[0], v1[1]]
|
},
|
importTemplate(fileName) {
|
var a = document.createElement('a')
|
a.href = `/static/${fileName}.xls`
|
a.download = `${fileName}.xls`
|
a.style.display = 'none'
|
document.body.appendChild(a)
|
a.click()
|
a.remove()
|
},
|
searchReset() {
|
this.dates = [moment().subtract(1, 'day'), moment()]
|
this.queryParam = {
|
startTime: this.dates[0].format('YYYY-MM-DD'),
|
endTime: this.dates[1].format('YYYY-MM-DD')
|
}
|
this.loadData(1)
|
},
|
/**
|
* 当浏览器可视窗口尺寸发生改变时触发
|
*/
|
handleWindowResize() {
|
const boxHeight = +window.getComputedStyle(document.getElementById('DeviceList')).height.slice(0, -2)
|
const tableHeadHeight = +window.getComputedStyle(document.querySelector('.ant-table-thead th')).height.slice(0, -2)
|
this.scrollY = boxHeight - tableHeadHeight - 50
|
}
|
},
|
created() {
|
this.queryParam.startTime = this.dates[0].format('YYYY-MM-DD')
|
this.queryParam.endTime = this.dates[1].format('YYYY-MM-DD')
|
this.loadData()
|
},
|
mounted() {
|
window.addEventListener('resize', this.handleWindowResize)
|
this.handleWindowResize()
|
},
|
beforeDestroy() {
|
window.removeEventListener('resize', this.handleWindowResize)
|
}
|
}
|
</script>
|
<style scoped>
|
@import '~@assets/less/common.less';
|
|
.device_list {
|
display: flex;
|
flex-direction: column;
|
overflow: hidden;
|
}
|
|
@media screen and (min-width: 1920px) {
|
.device_list {
|
height: 811px !important;
|
}
|
}
|
|
@media screen and (min-width: 1680px) and (max-width: 1920px) {
|
.device_list {
|
height: 811px !important;
|
}
|
}
|
|
@media screen and (min-width: 1400px) and (max-width: 1680px) {
|
.device_list {
|
height: 663px !important;
|
}
|
}
|
|
@media screen and (min-width: 1280px) and (max-width: 1400px) {
|
.device_list {
|
height: 564px !important;
|
}
|
}
|
|
@media screen and (max-width: 1280px) {
|
.device_list {
|
height: 564px !important;
|
}
|
}
|
</style>
|