<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="车间名称">
|
<a-tree-select v-model="queryParam.productionId" :treeData="workshopTreeData" placeholder="请选择车间"
|
:treeDefaultExpandedKeys="treeDefaultExpandedKeys"></a-tree-select>
|
</a-form-item>
|
</a-col>
|
<a-col :md="2" :sm="2" :xs="2">
|
<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-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:'max-content',y:465}"
|
bordered
|
rowKey="id"
|
: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-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
|
<a>删除</a>
|
</a-popconfirm>
|
</span>
|
|
</a-table>
|
</div>
|
|
<ProblemFeedbackModal ref="modalRef" :visible="modalVisible" :title="modalTitle"
|
:workshopTreeData="workshopTreeData" :treeDefaultExpandedKeys="treeDefaultExpandedKeys"
|
@handleCloseModal="handleCloseModal" @modalFormOk="modalFormOk"/>
|
</a-card>
|
</template>
|
|
<script>
|
|
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
|
import { queryProductionTreeList } from '@/api/api'
|
import ProblemFeedbackModal from './modules/ProblemFeedbackList/ProblemFeedbackModal'
|
|
export default {
|
name: 'ProblemFeedbackList',
|
mixins: [JeecgListMixin],
|
components: {
|
ProblemFeedbackModal
|
},
|
data() {
|
return {
|
description: '问题反馈',
|
/* 分页参数 */
|
ipagination: {
|
current: 1,
|
pageSize: 30,
|
pageSizeOptions: ['30', '50', '100'],
|
showTotal: (total, range) => {
|
return range[0] + '-' + range[1] + ' 共' + total + '条'
|
},
|
showQuickJumper: true,
|
showSizeChanger: true,
|
total: 0
|
},
|
// 表头
|
columns: [
|
{
|
title: '#',
|
dataIndex: '',
|
key: 'rowIndex',
|
width: 60,
|
align: 'center',
|
customRender: function(t, r, index) {
|
return parseInt(index) + 1
|
}
|
},
|
{
|
title: '车间',
|
align: 'center',
|
dataIndex: 'productionId_dictText',
|
width: 450
|
},
|
{
|
title: '问题内容',
|
align: 'center',
|
dataIndex: 'content',
|
width: 660,
|
ellipsis: true,
|
},
|
{
|
title: '时间',
|
align: 'center',
|
dataIndex: 'createTime',
|
width: 450
|
},
|
{
|
title: '操作',
|
dataIndex: 'action',
|
align: 'center',
|
width: 150,
|
fixed: 'right',
|
scopedSlots: { customRender: 'action' }
|
}
|
],
|
url: {
|
list: '/mdc/mdcFeedback/list',
|
delete: '/mdc/mdcFeedback/delete',
|
deleteBatch: '/mdc/mdcFeedback/deleteBatch'
|
},
|
workshopTreeData: [],
|
treeDefaultExpandedKeys: [],
|
modalVisible: false,
|
modalTitle: ''
|
}
|
},
|
created() {
|
this.getWorkshopListByApi()
|
},
|
methods: {
|
/**
|
* 调用接口获取查询区域车间树列表
|
*/
|
getWorkshopListByApi() {
|
queryProductionTreeList().then(res => {
|
if (res.success) {
|
this.workshopTreeData = res.result
|
this.treeDefaultExpandedKeys = [...res.result].map(item => item.key)
|
}
|
})
|
},
|
|
handleAdd() {
|
this.modalTitle = '新增'
|
this.$refs.modalRef.model = {}
|
this.modalVisible = true
|
},
|
|
/**
|
* 点击编辑按钮打开编辑窗口
|
* @param record 点击表格行信息
|
*/
|
handleEdit(record) {
|
this.modalTitle = '编辑'
|
this.$refs.modalRef.model = Object.assign({}, record)
|
this.modalVisible = true
|
},
|
|
modalFormOk() {
|
// 新增/修改 成功时,重载列表
|
this.loadData()
|
//清空列表选中
|
this.onClearSelected()
|
this.handleCloseModal()
|
},
|
|
handleCloseModal() {
|
this.modalVisible = false
|
}
|
}
|
}
|
</script>
|
<style scoped>
|
@import '~@assets/less/common.less';
|
</style>
|