<template>
|
<a-card>
|
<!-- 查询区域 -->
|
<div class="table-page-search-wrapper">
|
<a-form layout="inline" @keyup.enter.native="searchQuery">
|
<a-row :gutter="24">
|
|
<a-col :md="4" :sm="4">
|
<a-form-item label="零件号">
|
<a-input placeholder="请输入零件号" v-model="queryParam.partsCode"></a-input>
|
</a-form-item>
|
</a-col>
|
|
<a-col :md="4" :sm="4">
|
<a-form-item label="物料号">
|
<a-input placeholder="请输入物料号" v-model="queryParam.materialCode"></a-input>
|
</a-form-item>
|
</a-col>
|
|
<a-col :md="4" :sm="4">
|
<a-form-item label="添加时间">
|
<a-date-picker style="width: 200px" v-model="queryParam.operateTime" format='YYYY-MM-DD'
|
valueFormat="YYYY-MM-DD"/>
|
</a-form-item>
|
</a-col>
|
|
<a-col :md="4" :sm="4">
|
<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-col>
|
</a-row>
|
|
</a-form>
|
</div>
|
|
<!-- 操作按钮区域 -->
|
<div class="table-operator" style="border-top: 5px">
|
<a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
|
<a-button type="primary" icon="download" @click="handleExportXls('零件与物料信息')">导出</a-button>
|
<a-dropdown v-if="selectedRowKeys.length > 0">
|
<a-menu slot="overlay" @click="handleMenuClick">
|
<a-menu-item key="1">
|
<a-icon type="delete" @click="batchDel"/>
|
删除
|
</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"
|
bordered
|
size="middle"
|
rowKey="id"
|
:scroll="{x:'max-content',y:465}"
|
:columns="columns"
|
:dataSource="dataSource"
|
:pagination="ipagination"
|
:loading="loading"
|
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
|
@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 href="javascript:;" @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>
|
<!-- table区域-end -->
|
|
<PartsAndMaterialInfoModal ref="modalForm" @ok="modalFormOk"/>
|
</a-card>
|
</template>
|
|
<script>
|
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
|
import PartsAndMaterialInfoModal from './modules/PartsAndMaterialInfo/PartsAndMaterialInfoModal'
|
|
export default {
|
name: 'PartsAndMaterialInfo',
|
components: { PartsAndMaterialInfoModal },
|
mixins: [JeecgListMixin],
|
data() {
|
return {
|
queryParam: {},
|
url: {
|
list: '/mdc/mdcEquipment/list',
|
exportXlsUrl: ''
|
},
|
columns: [
|
{
|
title: '#',
|
dataIndex: '',
|
key: 'rowIndex',
|
width: 60,
|
align: 'center',
|
customRender: function(t, r, index) {
|
return parseInt(index) + 1
|
}
|
},
|
{
|
title: '零件号',
|
align: 'center',
|
dataIndex: 'partsCode',
|
width: 400
|
},
|
{
|
title: '物料号',
|
align: 'center',
|
width: 400,
|
dataIndex: 'materialCode'
|
},
|
{
|
title: '添加时间',
|
align: 'center',
|
width: 400,
|
dataIndex: 'operateTime'
|
},
|
{
|
title: '操作员',
|
align: 'center',
|
width: 350,
|
dataIndex: 'operator'
|
},
|
{
|
title: '操作',
|
dataIndex: 'action',
|
scopedSlots: { customRender: 'action' },
|
align: 'center',
|
width: 150,
|
fixed: 'right'
|
}
|
|
]
|
}
|
},
|
methods: {
|
handleAdd: function() {
|
this.$refs.modalForm.add()
|
this.$refs.modalForm.title = '新增'
|
|
// 调用抽屉表单组件中的清除表单验证方法
|
this.$refs.modalForm.removeValidate()
|
},
|
handleEdit: function(record) {
|
this.$refs.modalForm.edit(record)
|
this.$refs.modalForm.title = '编辑'
|
|
// 调用抽屉表单组件中的清除表单验证方法
|
this.$refs.modalForm.removeValidate()
|
},
|
handleMenuClick(e) {
|
if (e.key == 1) {
|
this.batchDel()
|
}
|
}
|
}
|
}
|
</script>
|
|
<style scoped>
|
|
</style>
|