<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="4" :lg="7" :md="8" :sm="24">
|
<a-form-item label="刀具名称">
|
<j-input placeholder="请输入刀具名称" v-model="queryParam.toolName"></j-input>
|
</a-form-item>
|
</a-col>
|
<a-col :xl="4" :lg="7" :md="8" :sm="24">
|
<a-form-item label="刃磨结果">
|
<j-input placeholder="请输入刃磨结果" v-model="queryParam.grindingResult"></j-input>
|
</a-form-item>
|
</a-col>
|
<a-col :xl="6" :lg="7" :md="8" :sm="24">
|
<a-form-item label="刃磨时间">
|
<a-range-picker v-model="queryParam.inspectionDateRange" @change="onInspectionDateChange" format="YYYY-MM-DD" value-format="YYYY-MM-DD" />
|
</a-form-item>
|
</a-col>
|
<a-col :xl="4" :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="info" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
|
</span>
|
</a-col>
|
</a-row>
|
</a-form>
|
</div>
|
<!-- 查询区域-END -->
|
|
<!-- 操作按钮区域 -->
|
<div class="table-operator">
|
<div class="table-operator">
|
<a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
|
</div>
|
</div>
|
|
<!-- table区域-begin -->
|
<div>
|
|
|
<a-table
|
ref="table"
|
size="middle"
|
:scroll="{x:true}"
|
bordered
|
rowKey="id"
|
:columns="columns"
|
:dataSource="dataSource"
|
:pagination="ipagination"
|
:loading="loading"
|
:rowSelection="null"
|
class="j-table-force-nowrap"
|
@change="handleTableChange">
|
|
|
|
<span slot="action" slot-scope="text, record">
|
<a @click="handleDetail(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="handleEdit(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>
|
|
<tools-sharpening-modal ref="modalForm" @ok="modalFormOk"></tools-sharpening-modal>
|
</a-card>
|
</template>
|
|
<script>
|
|
import '@/assets/less/TableExpand.less'
|
import { mixinDevice } from '@/utils/mixin'
|
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
|
import ToolsSharpeningModal from './modules/ToolsSharpeningModal'
|
import { getAction, putAction, deleteAction } from '../../../api/manage'
|
|
export default {
|
name: 'ToolSharpeningList ',
|
mixins:[JeecgListMixin, mixinDevice],
|
components: {
|
ToolsSharpeningModal
|
},
|
data () {
|
return {
|
description: '刀具刃磨',
|
// 表头
|
columns: [
|
{
|
title: '#',
|
dataIndex: '',
|
key:'rowIndex',
|
width:60,
|
align:"center",
|
customRender:function (t,r,index) {
|
return parseInt(index)+1;
|
}
|
},
|
{
|
title:'刀具分类',
|
align:"center",
|
dataIndex: 'paramaTableName_dictText'
|
},
|
{
|
title:'刀具编号',
|
align:"center",
|
dataIndex: 'toolId'
|
},
|
{
|
title:'刀具名称',
|
align:"center",
|
dataIndex: 'typeName'
|
},
|
|
{
|
title:'厂家',
|
align:"center",
|
dataIndex: 'supplierId',
|
},
|
{
|
title:'刃磨时间',
|
align:"center",
|
dataIndex: 'sharpeningTime'
|
},
|
{
|
title:'刃磨结果及建议',
|
align:"center",
|
dataIndex: 'sharpeningResult'
|
},
|
{
|
title:'责任人',
|
align:"center",
|
dataIndex: 'responsiblePerson_dictText'
|
},
|
|
{
|
title:'创建人',
|
align:"center",
|
dataIndex: 'createBy'
|
},
|
|
{
|
title:'创建时间',
|
align:"center",
|
dataIndex: 'createTime'
|
},
|
{
|
title: '操作',
|
dataIndex: 'action',
|
align:"center",
|
fixed:"right",
|
width:147,
|
scopedSlots: { customRender: 'action' }
|
}
|
],
|
url: {
|
list: "/tms/toolSharpening/listToolSharpening",
|
add: "/tms/toolSharpening/add",
|
delete: "/tms/toolSharpening/delete",
|
edit: "/tms/toolSharpening/edit",
|
deleteBatch: "/tms/toolSharpening/deleteBatch",
|
exportXlsUrl: "/tms/toolSharpening/exportXls",
|
importExcelUrl: "tms/toolSharpening/importExcel",
|
|
},
|
dictOptions:{},
|
superFieldList:[],
|
|
}
|
},
|
created() {},
|
computed: {
|
importExcelUrl: function(){
|
return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
|
},
|
},
|
|
methods: {
|
onInspectionDateChange: function(value, dateString) {
|
this.queryParam.inspectionDateBegin = dateString[0]
|
this.queryParam.inspectionDateEnd = dateString[1]
|
},
|
|
|
handleEdit: function (record) {
|
console.log('record:', record)
|
this.$refs.modalForm.title = '编辑'
|
this.$refs.modalForm.disableSubmit = false
|
this.$refs.modalForm.edit(record)
|
|
},
|
handleDetail:function(record){
|
this.$refs.modalForm.title="详情";
|
this.$refs.modalForm.disableSubmit = true;
|
this.$refs.modalForm.edit(record);
|
},
|
|
|
handleDelete: function (id) {
|
if (!this.url.delete) {
|
this.$message.error('请设置url.delete属性!')
|
return
|
}
|
deleteAction(this.url.delete, { id: id }).then((res) => {
|
if (res.success) {
|
//重新计算分页问题
|
this.reCalculatePage(1)
|
this.$message.success(res.message)
|
this.$refs.toolStockingBoundDetail.dataSource = []
|
this.loadData()
|
} else {
|
this.$message.warning(res.message)
|
}
|
})
|
},
|
searchReset() {
|
this.loadData(1)
|
},
|
modalFormOk() {
|
this.loadData()
|
},
|
|
|
}
|
}
|
</script>
|
<style scoped>
|
@import '~@assets/less/common.less';
|
.enable {
|
color: green;
|
}
|
.disable {
|
color: red;
|
}
|
</style>
|