<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-input placeholder="请输入工单号" v-model="queryParam.orderNum"></a-input>
|
</a-form-item>
|
</a-col>
|
<a-col :xl="6" :lg="7" :md="8" :sm="24">
|
<a-form-item label="设备ID">
|
<a-input placeholder="请输入设备ID" v-model="queryParam.equipmentId"></a-input>
|
</a-form-item>
|
</a-col>
|
<template v-if="toggleSearchStatus">
|
<a-col :xl="6" :lg="7" :md="8" :sm="24">
|
<a-form-item label="点检日期">
|
<j-date placeholder="请选择点检日期" v-model="queryParam.inspectionDate"></j-date>
|
</a-form-item>
|
</a-col>
|
<a-col :xl="6" :lg="7" :md="8" :sm="24">
|
<a-form-item label="点检时间">
|
<j-date placeholder="请选择点检时间" v-model="queryParam.operateTime"></j-date>
|
</a-form-item>
|
</a-col>
|
</template>
|
<a-col :xl="6" :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="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
|
<a @click="handleToggleSearch" style="margin-left: 8px">
|
{{ toggleSearchStatus ? '收起' : '展开' }}
|
<a-icon :type="toggleSearchStatus ? 'up' : 'down'"/>
|
</a>
|
</span>
|
</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="batchZf(5)"><a-icon type="snippets"/>作废</a-menu-item>
|
<a-menu-item key="2" @click="batchLq(2)"><a-icon type="form"/>领取</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:true}"
|
bordered
|
rowKey="id"
|
:columns="columns"
|
:dataSource="dataSource"
|
:pagination="ipagination"
|
:loading="loading"
|
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
|
class="j-table-force-nowrap"
|
@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 v-if="record.inspectionStatus === '1'" @click="handleEdit(record)">编辑</a>
|
|
<a-divider v-if="record.inspectionStatus === '1'" type="vertical" />
|
|
<a-popconfirm v-if="record.inspectionStatus === '1'" title="确定领取吗?" @confirm="() => handleInspection(record.id)">
|
<a>领取</a>
|
</a-popconfirm>
|
|
<a-divider v-if="record.inspectionStatus === '1'" 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 v-if="record.inspectionStatus === '1'" >
|
<a-popconfirm title="确定作废吗?" @confirm="() => handleDelete(record.id)">
|
<a>作废</a>
|
</a-popconfirm>
|
</a-menu-item>
|
</a-menu>
|
</a-dropdown>
|
</span>
|
|
</a-table>
|
</div>
|
|
<eam-inspection-order-modal ref="modalForm" @ok="modalFormOk"></eam-inspection-order-modal>
|
<EamInspectionOrderModalXq ref="modalFormXq" @ok="modalFormOk"></EamInspectionOrderModalXq>
|
</a-card>
|
</template>
|
|
<script>
|
|
import '@/assets/less/TableExpand.less'
|
import { mixinDevice } from '@/utils/mixin'
|
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
|
import EamInspectionOrderModal from './modules/EamInspectionOrderModal'
|
import EamInspectionOrderModalXq from './modules/EamInspectionOrderModalXq.vue'
|
import { deleteAction, getAction } from '@api/manage'
|
|
export default {
|
name: 'EamInspectionOrderList',
|
mixins:[JeecgListMixin, mixinDevice],
|
components: {
|
EamInspectionOrderModal,
|
EamInspectionOrderModalXq
|
},
|
data () {
|
return {
|
description: 'eam_inspection_order管理页面',
|
// 表头
|
columns: [
|
{
|
title: '#',
|
dataIndex: '',
|
key:'rowIndex',
|
width:60,
|
align:"center",
|
customRender:function (t,r,index) {
|
return parseInt(index)+1;
|
}
|
},
|
{
|
title:'工单号',
|
align:"center",
|
dataIndex: 'orderNum'
|
},
|
{
|
title:'设备编号',
|
align:"center",
|
dataIndex: 'equipmentId_dictText'
|
},
|
{
|
title:'标准编码',
|
align:"center",
|
dataIndex: 'standardId_dictText'
|
},
|
{
|
title:'点检日期',
|
align:"center",
|
dataIndex: 'inspectionDate',
|
customRender:function (text) {
|
return !text?"":(text.length>10?text.substr(0,10):text)
|
}
|
},
|
{
|
title:'点检过期时间',
|
align:"center",
|
dataIndex: 'expirationTime',
|
customRender:function (text) {
|
return !text?"":(text.length>10?text.substr(0,10):text)
|
}
|
},
|
{
|
title:'创建方式',
|
align:"center",
|
dataIndex: 'creationMethod_dictText'
|
},
|
{
|
title:'点检状态',
|
align:"center",
|
dataIndex: 'inspectionStatus_dictText'
|
},
|
{
|
title:'点检时间',
|
align:"center",
|
dataIndex: 'operateTime',
|
customRender:function (text) {
|
return !text?"":(text.length>10?text.substr(0,10):text)
|
}
|
},
|
{
|
title:'点检人',
|
align:"center",
|
dataIndex: 'operator_dictText'
|
},
|
{
|
title:'班组长确认',
|
align:"center",
|
dataIndex: 'confirmUser'
|
},
|
{
|
title:'确认时间',
|
align:"center",
|
dataIndex: 'confirmTime',
|
customRender:function (text) {
|
return !text?"":(text.length>10?text.substr(0,10):text)
|
}
|
},
|
{
|
title: '操作',
|
dataIndex: 'action',
|
align:"center",
|
fixed:"right",
|
width:147,
|
scopedSlots: { customRender: 'action' }
|
}
|
],
|
url: {
|
list: "/eam/eamInspectionOrder/list",
|
delete: "/eam/eamInspectionOrder/cancelInspectionOrder",
|
deleteBatch: "/eam/eamInspectionOrder/deleteBatch",
|
exportXlsUrl: "/eam/eamInspectionOrder/exportXls",
|
importExcelUrl: "eam/eamInspectionOrder/importExcel",
|
receiveInspectionOrder : "eam/eamInspectionOrder/receiveInspectionOrder",
|
cancelOrReceive: "eam/eamInspectionOrder/cancelOrReceive"
|
},
|
dictOptions:{},
|
superFieldList:[],
|
}
|
},
|
created() {
|
this.getSuperFieldList();
|
},
|
computed: {
|
importExcelUrl: function(){
|
return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
|
},
|
},
|
methods: {
|
initDictConfig(){
|
},
|
getSuperFieldList(){
|
let fieldList=[];
|
fieldList.push({type:'string',value:'orderNum',text:'工单号',dictCode:''})
|
fieldList.push({type:'string',value:'equipmentId',text:'设备ID',dictCode:''})
|
fieldList.push({type:'string',value:'standardId',text:'标准ID',dictCode:''})
|
fieldList.push({type:'date',value:'inspectionDate',text:'点检日期'})
|
fieldList.push({type:'date',value:'operateTime',text:'点检时间'})
|
fieldList.push({type:'string',value:'operator',text:'点检人',dictCode:''})
|
fieldList.push({type:'date',value:'expirationTime',text:'点检过期时间'})
|
fieldList.push({type:'string',value:'creationMethod',text:'创建方式',dictCode:''})
|
fieldList.push({type:'string',value:'inspectionStatus',text:'点检状态',dictCode:''})
|
fieldList.push({type:'string',value:'confirmUser',text:'设备管理员确认',dictCode:''})
|
fieldList.push({type:'date',value:'confirmTime',text:'确认时间'})
|
fieldList.push({type:'string',value:'remark',text:'备注',dictCode:''})
|
fieldList.push({type:'string',value:'imageFiles',text:'照片文件ids;id以逗号分隔',dictCode:''})
|
this.superFieldList = fieldList
|
},
|
//详情
|
handleDetail: function(record) {
|
this.$refs.modalFormXq.edit(record);
|
this.$refs.modalFormXq.title = "详情";
|
this.$refs.modalFormXq.disableSubmit = true;
|
},
|
handleInspection(id) {
|
if (!this.url.receiveInspectionOrder) {
|
this.$message.error("请设置url.receiveInspectionOrder!")
|
return
|
}
|
var that = this;
|
getAction(that.url.receiveInspectionOrder, { id: id }).then((res) => {
|
if (res.success) {
|
that.$notification.success({
|
message: '消息',
|
description: res.message
|
});
|
that.loadData();
|
} else {
|
// that.$message.warning(res.message);
|
that.$notification.warning({
|
message: '消息',
|
description: res.message
|
});
|
}
|
});
|
},
|
batchZf(type){
|
if (this.selectedRowKeys.length <= 0) {
|
this.$notification.warning({
|
message:'消息',
|
description:"请选择一条记录"
|
});
|
} else {
|
var ids = "";
|
for (var a = 0; a < this.selectedRowKeys.length; a++) {
|
ids += this.selectedRowKeys[a] + ",";
|
}
|
var that = this;
|
this.$confirm({
|
title: "确认作废",
|
content: "是否作废选中数据,只有待点检状态的数据才可作废成功?",
|
onOk: function () {
|
that.loading = true;
|
getAction(that.url.cancelOrReceive, {ids: ids,type:type}).then((res) => {
|
if (res.success) {
|
that.$notification.success({
|
message:'消息',
|
description:res.message
|
});
|
that.loadData();
|
that.onClearSelected();
|
} else {
|
// that.$message.warning(res.message);
|
that.$notification.warning({
|
message:'消息',
|
description:res.message
|
});
|
}
|
}).finally(() => {
|
that.loading = false;
|
});
|
}
|
});
|
}
|
},
|
batchLq(type){
|
if (this.selectedRowKeys.length <= 0) {
|
this.$notification.warning({
|
message:'消息',
|
description:"请选择一条记录"
|
});
|
} else {
|
var ids = "";
|
for (var a = 0; a < this.selectedRowKeys.length; a++) {
|
ids += this.selectedRowKeys[a] + ",";
|
}
|
var that = this;
|
this.$confirm({
|
title: "确认领取",
|
content: "是否领取选中数据,只有待点检状态的数据才可领取成功?",
|
onOk: function () {
|
that.loading = true;
|
getAction(that.url.cancelOrReceive, {ids: ids,type:type}).then((res) => {
|
if (res.success) {
|
that.$notification.success({
|
message:'消息',
|
description:res.message
|
});
|
that.loadData();
|
that.onClearSelected();
|
} else {
|
// that.$message.warning(res.message);
|
that.$notification.warning({
|
message:'消息',
|
description:res.message
|
});
|
}
|
}).finally(() => {
|
that.loading = false;
|
});
|
}
|
});
|
}
|
},
|
}
|
}
|
</script>
|
<style scoped>
|
@import '~@assets/less/common.less';
|
</style>
|