<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 :md="6" :sm="8">
|
<a-form-item label="修磨单状态">
|
<j-search-select-tag
|
placeholder="请选择修磨单状态"
|
v-model="queryParam.orderStatus"
|
dict="order_status"
|
/>
|
</a-form-item>
|
</a-col>
|
<a-col :md="6" :sm="8">
|
<a-form-item label="申请人">
|
<j-search-select-tag
|
placeholder="请选择申请人"
|
v-model="queryParam.applicant"
|
dict="sys_user,realname,id,del_flag!=1"
|
/>
|
</a-form-item>
|
</a-col>
|
<a-col
|
:md="6"
|
:sm="8"
|
>
|
<span
|
style="float: left;overflow: hidden;"
|
class="table-page-search-submitButtons"
|
>
|
<a-button
|
type="primary"
|
@click="searchQuery"
|
icon="search"
|
>查询</a-button>
|
<a-button
|
type="primary"
|
@click="searchReset"
|
icon="reload"
|
style="margin-left: 8px"
|
>重置</a-button>
|
</span>
|
</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="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> -->
|
</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:true}"
|
bordered
|
rowKey="id"
|
:columns="columns"
|
:dataSource="dataSource"
|
:pagination="ipagination"
|
:loading="loading"
|
class="j-table-force-nowrap"
|
:customRow="customRow"
|
@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 :src="getImgView(text)" :preview="record.id" height="25px" alt="" 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"
|
type="primary"
|
icon="download"
|
size="small"
|
@click="downloadFile(text)">
|
下载
|
</a-button>
|
</template>
|
|
<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>
|
<a-tabs defaultActiveKey="1">
|
<a-tab-pane tab="刀具修磨明细" key="1">
|
<edge-grinding-detail-list ref="edgeGrindingDetailList"></edge-grinding-detail-list>
|
</a-tab-pane>
|
</a-tabs>
|
<edge-grinding-modal ref="modalForm" @ok="modalFormOk"></edge-grinding-modal>
|
</a-card>
|
</template>
|
|
<script>
|
|
import '@/assets/less/TableExpand.less'
|
import { mixinDevice } from '@/utils/mixin'
|
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
|
import EdgeGrindingModal from './modules/EdgeGrindingModal'
|
import EdgeGrindingDetailList from './EdgeGrindingDetailList'
|
|
export default {
|
name: 'EdgeGrindingList',
|
mixins:[JeecgListMixin, mixinDevice],
|
components: {
|
EdgeGrindingModal,
|
EdgeGrindingDetailList
|
},
|
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: 'applicant_dictText'
|
},
|
{
|
title:'申请时间',
|
align:"center",
|
dataIndex: 'applicationTime',
|
customRender:function (text) {
|
return !text?"":(text.length>10?text.substr(0,10):text)
|
}
|
},
|
{
|
title:'申请说明',
|
align:"center",
|
dataIndex: 'applicationComment'
|
},
|
{
|
title:'确认人',
|
align:"center",
|
dataIndex: 'confirmer_dictText'
|
},
|
{
|
title:'确认时间',
|
align:"center",
|
dataIndex: 'confirmTime',
|
customRender:function (text) {
|
return !text?"":(text.length>10?text.substr(0,10):text)
|
}
|
},
|
{
|
title:'确认意见',
|
align:"center",
|
dataIndex: 'confirmComment'
|
},
|
{
|
title:'归还时间',
|
align:"center",
|
dataIndex: 'returnTime',
|
customRender:function (text) {
|
return !text?"":(text.length>10?text.substr(0,10):text)
|
}
|
},
|
{
|
title:'归还说明',
|
align:"center",
|
dataIndex: 'returnComment'
|
},
|
{
|
title:'归还确认人',
|
align:"center",
|
dataIndex: 'returnConfirmer_dictText'
|
},
|
{
|
title:'归还确认时间',
|
align:"center",
|
dataIndex: 'returnConfirmTime',
|
customRender:function (text) {
|
return !text?"":(text.length>10?text.substr(0,10):text)
|
}
|
},
|
{
|
title:'归还确认意见',
|
align:"center",
|
dataIndex: 'returnConfirmComment'
|
},
|
{
|
title:'修磨单状态',
|
align:"center",
|
dataIndex: 'orderStatus'
|
},
|
{
|
title: '操作',
|
dataIndex: 'action',
|
align:"center",
|
fixed:"right",
|
width:147,
|
scopedSlots: { customRender: 'action' }
|
}
|
],
|
url: {
|
list: "/cms/edgeGrinding/list",
|
delete: "/cms/edgeGrinding/delete",
|
deleteBatch: "/cms/edgeGrinding/deleteBatch",
|
exportXlsUrl: "/cms/edgeGrinding/exportXls",
|
importExcelUrl: "cms/edgeGrinding/importExcel",
|
|
},
|
dictOptions:{},
|
superFieldList:[],
|
}
|
},
|
created() {
|
this.getSuperFieldList();
|
},
|
computed: {
|
importExcelUrl: function(){
|
return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
|
},
|
},
|
methods: {
|
searchReset() {
|
this.queryParam = {}
|
this.$refs.edgeGrindingDetailList.dataSource = []
|
this.loadData(1);
|
},
|
handleEdit: function (record) {
|
this.$refs.modalForm.edit(record)
|
this.$refs.modalForm.title = '编辑'
|
this.$refs.modalForm.disableSubmit = false
|
},
|
handleAdd() {
|
this.$refs.modalForm.add()
|
this.$refs.modalForm.title = '新增'
|
this.$refs.modalForm.disableSubmit = false
|
},
|
handleDetail:function(record){
|
this.$refs.modalForm.edit(record);
|
this.$refs.modalForm.title="详情";
|
this.$refs.modalForm.disableSubmit = true;
|
},
|
customRow(record) {
|
return {
|
on: {
|
click: (e) => {
|
//将当前选中的记录传到子页面
|
this.$bus.$emit('getToolingStorageData', record)
|
//点击当前行变色
|
let oldList = document.querySelectorAll('.checked-td-of-add-table')
|
if (oldList) {
|
for (let j = 0; j < oldList.length; j++) {
|
oldList[j].classList.remove('checked-td-of-add-table')
|
}
|
}
|
let children = e.target.parentNode.children
|
for (let i = 0; i < children.length; i++) {
|
children[i].classList.add('checked-td-of-add-table')
|
}
|
},
|
},
|
}
|
},
|
}
|
}
|
</script>
|
<style scoped>
|
@import '~@assets/less/common.less';
|
</style>
|