<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="5" :lg="6" :md="8" :sm="12">
|
<a-form-item label="统一编码">
|
<lx-search-equipment-select placeholder="请输入统一编码或名称搜索" v-model="queryParam.equipmentId"/>
|
</a-form-item>
|
</a-col>
|
<a-col :xl="4" :lg="6" :md="8" :sm="12">
|
<a-form-item label="工单号">
|
<a-input placeholder="请输入工单号" v-model="queryParam.orderNum"/>
|
</a-form-item>
|
</a-col>
|
<a-col :xl="5" :lg="6" :md="8" :sm="12">
|
<a-form-item label="计划保养日期">
|
<a-range-picker v-model="queryParam.maintenanceDate" value-format="YYYY-MM-DD"
|
@change="handleDateRangeChange"/>
|
</a-form-item>
|
</a-col>
|
<a-col :xl="5" :lg="6" :md="8" :sm="12">
|
<a-form-item label="保养状态">
|
<j-dict-select-tag placeholder="请选择保养状态" v-model="queryParam.maintenanceStatus"
|
dict-code="third_maintenance_furnace_status"/>
|
</a-form-item>
|
</a-col>
|
<a-col :xl="4" :lg="6" :md="8" :sm="12">
|
<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>
|
|
<!-- 操作按钮区域 -->
|
<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="handleBatchCollect">
|
<a-icon type="form"/>
|
领取
|
</a-menu-item>
|
<a-menu-item key="1" @click="handleBatchAbolish">
|
<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" bordered rowKey="id" :columns="columns" :dataSource="dataSource"
|
:pagination="ipagination" :loading="loading" :scroll="{x:'max-content'}"
|
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}" @change="handleTableChange">
|
|
<!--能否满足加工需求-->
|
<template slot="processingRequirementsFlag" slot-scope="text">
|
<a-switch v-if="text" checked-children="是" un-checked-children="否" :checked="Boolean(+text)" disabled/>
|
</template>
|
|
<span slot="action" slot-scope="text, record">
|
<template v-if="record.maintenanceStatus==='WAIT_MAINTENANCE'">
|
<a @click="handleEdit(record)">编辑</a>
|
|
<a-divider type="vertical"/>
|
|
<a-popconfirm title="确定领取吗?" @confirm="() => handleCollect(record.id)">
|
<a>领取</a>
|
</a-popconfirm>
|
|
<a-divider type="vertical"/>
|
|
<a-popconfirm title="确定作废吗?" @confirm="() => handleAbolish(record.id)">
|
<a>作废</a>
|
</a-popconfirm>
|
</template>
|
|
<a v-else @click="handleDetail(record)">详情</a>
|
</span>
|
|
</a-table>
|
</div>
|
<!-- table区域-end -->
|
|
<!-- 表单区域 -->
|
<eamThirdMaintenanceFurnace-modal ref="modalForm" @ok="modalFormOk"/>
|
|
<!--审批窗口-->
|
<third-maintenance-furnace-approval-modal ref="thirdMaintenanceFurnaceApprovalModal"
|
:selectShenpiData="selectedRowData"/>
|
</a-card>
|
</template>
|
|
<script>
|
import EamThirdMaintenanceFurnaceModal from './modules/EamThirdMaintenanceFurnaceModal'
|
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
|
import LxSearchEquipmentSelect from '../equipment/modules/LxSearchEquipmentSelect'
|
import { getAction, deleteAction } from '@/api/manage'
|
import ThirdMaintenanceFurnaceApprovalModal
|
from '../../flowable/workflow/thirdMaintenance/ThirdMaintenanceFurnaceApprovalModal'
|
|
export default {
|
name: 'EamThirdMaintenanceFurnaceList',
|
mixins: [JeecgListMixin],
|
components: {
|
ThirdMaintenanceFurnaceApprovalModal,
|
LxSearchEquipmentSelect,
|
EamThirdMaintenanceFurnaceModal
|
},
|
data() {
|
return {
|
description: '真空热处理炉三保管理页面',
|
selectedRowData: {},
|
// 表头
|
columns: [
|
{
|
title: '#',
|
dataIndex: '',
|
key: 'rowIndex',
|
width: 60,
|
align: 'center',
|
customRender: function(t, r, index) {
|
return parseInt(index) + 1
|
},
|
fixed: 'left'
|
},
|
{
|
title: '统一编码',
|
align: 'center',
|
dataIndex: 'equipmentCode',
|
fixed: 'left'
|
},
|
{
|
title: '设备名称',
|
align: 'center',
|
dataIndex: 'equipmentName',
|
fixed: 'left'
|
},
|
{
|
title: '设备型号',
|
align: 'center',
|
dataIndex: 'equipmentModel',
|
fixed: 'left'
|
},
|
{
|
title: '保养状态',
|
align: 'center',
|
dataIndex: 'maintenanceStatus_dictText',
|
fixed: 'left'
|
},
|
{
|
title: '工单号',
|
align: 'center',
|
dataIndex: 'orderNum'
|
},
|
{
|
title: '计划保养日期',
|
align: 'center',
|
dataIndex: 'maintenanceDate'
|
},
|
{
|
title: '保养人',
|
align: 'center',
|
dataIndex: 'operator_dictText'
|
},
|
{
|
title: '保养时间',
|
align: 'center',
|
dataIndex: 'operateTime'
|
},
|
{
|
title: '压缩空气压力(MPa)',
|
align: 'center',
|
dataIndex: 'compressedAirPressureValue'
|
},
|
{
|
title: '极限真空(Pa)',
|
align: 'center',
|
dataIndex: 'ultimateVacuumValue'
|
},
|
{
|
title: '泄漏率(Pa/h)',
|
align: 'center',
|
dataIndex: 'leakRate'
|
},
|
{
|
title: '净化处理',
|
align: 'center',
|
dataIndex: 'purificationTreatment'
|
},
|
{
|
title: '炉温均匀性检测',
|
align: 'center',
|
dataIndex: 'furnaceTemperatureUniformityTesting'
|
},
|
{
|
title: '加热功率测试',
|
align: 'center',
|
dataIndex: 'heatingPowerTest'
|
},
|
{
|
title: '能否满足加工需求',
|
align: 'center',
|
dataIndex: 'processingRequirementsFlag',
|
scopedSlots: { customRender: 'processingRequirementsFlag' }
|
},
|
{
|
title: '确认人',
|
align: 'center',
|
dataIndex: 'confirmUser_dictText'
|
},
|
{
|
title: '确认日期',
|
align: 'center',
|
dataIndex: 'confirmTime'
|
},
|
{
|
title: 'HF编码',
|
align: 'center',
|
dataIndex: 'hfCode'
|
},
|
{
|
title: '操作',
|
dataIndex: 'action',
|
align: 'center',
|
scopedSlots: { customRender: 'action' },
|
fixed: 'right',
|
width: 200
|
}
|
],
|
url: {
|
list: '/eam/eamThirdMaintenanceFurnace/list',
|
collect: '/eam/eamThirdMaintenanceFurnace/collect',
|
collectBatch: '/eam/eamThirdMaintenanceFurnace/collectBatch',
|
abolish: '/eam/eamThirdMaintenanceFurnace/abolish',
|
abolishBatch: '/eam/eamThirdMaintenanceFurnace/abolishBatch'
|
}
|
}
|
},
|
methods: {
|
/**
|
* 保养日期发生改变时触发
|
* @param dateStringArray
|
*/
|
handleDateRangeChange(dateStringArray) {
|
this.queryParam.maintenanceDateBegin = dateStringArray[0]
|
this.queryParam.maintenanceDateEnd = dateStringArray[1]
|
},
|
|
/**
|
* 点击领取时触发
|
* @param id 行记录id
|
*/
|
handleCollect(id) {
|
let that = this
|
this.loading = true
|
getAction(that.url.collect, { id })
|
.then((res) => {
|
if (res.success) {
|
that.$notification.success({
|
message: '消息',
|
description: res.message
|
})
|
that.loadData()
|
} else {
|
that.$notification.warning({
|
message: '消息',
|
description: res.message
|
})
|
this.loading = false
|
}
|
})
|
},
|
|
// 批量领取
|
handleBatchCollect() {
|
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
|
deleteAction(that.url.collectBatch, { ids })
|
.then((res) => {
|
if (res.success) {
|
//重新计算分页问题
|
that.$notification.success({
|
message: '消息',
|
description: res.message
|
})
|
that.loadData()
|
that.onClearSelected()
|
} else {
|
that.$notification.warning({
|
message: '消息',
|
description: res.message
|
})
|
that.loading = false
|
}
|
})
|
}
|
})
|
},
|
|
/**
|
* 点击作废时触发
|
* @param id 行记录id
|
*/
|
handleAbolish(id) {
|
var that = this
|
this.loading = true
|
getAction(that.url.abolish, { id })
|
.then((res) => {
|
if (res.success) {
|
that.$notification.success({
|
message: '消息',
|
description: res.message
|
})
|
that.loadData()
|
} else {
|
that.$notification.warning({
|
message: '消息',
|
description: res.message
|
})
|
this.loading = false
|
}
|
})
|
},
|
|
// 批量作废
|
handleBatchAbolish() {
|
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
|
deleteAction(that.url.abolishBatch, { ids })
|
.then((res) => {
|
if (res.success) {
|
that.$notification.success({
|
message: '消息',
|
description: res.message
|
})
|
that.loadData()
|
that.onClearSelected()
|
} else {
|
that.$notification.warning({
|
message: '消息',
|
description: res.message
|
})
|
that.loading = false
|
}
|
})
|
}
|
})
|
},
|
|
/**
|
* 点击详情时触发时触发
|
* @param record
|
*/
|
handleDetail(record) {
|
this.selectedRowData = Object.assign({}, record)
|
this.$refs.thirdMaintenanceFurnaceApprovalModal.title = '详情'
|
this.$refs.thirdMaintenanceFurnaceApprovalModal.disableSubmit = true
|
this.$refs.thirdMaintenanceFurnaceApprovalModal.visible = true
|
this.$refs.thirdMaintenanceFurnaceApprovalModal.handleDetail(record)
|
}
|
}
|
}
|
</script>
|