<template>
|
<a-card
|
:bordered="false"
|
title="故障报修"
|
>
|
<!-- 查询区域 -->
|
<div class="table-page-search-wrapper">
|
<a-form
|
layout="inline"
|
@keyup.enter.native="searchQuery"
|
> <a-row
|
:gutter="24"
|
style="margin-bottom: 1%;"
|
>
|
<a-col
|
:md="24"
|
:sm="6"
|
>
|
<a-form-item label="统一编号群">
|
<a-textarea
|
placeholder="请输入所有统一编码,须用换行隔开,否则可能查询出错误信息"
|
v-model="queryParam.nums"
|
:auto-size="{ minRows: 2, maxRows:2 }"
|
></a-textarea>
|
</a-form-item>
|
</a-col>
|
</a-row>
|
<a-row :gutter="24">
|
<a-col
|
:md="6"
|
:sm="6"
|
>
|
<a-form-item label="单据号">
|
<a-input
|
placeholder="请输入单据号"
|
v-model="queryParam.num"
|
></a-input>
|
</a-form-item>
|
</a-col>
|
<a-col
|
:md="6"
|
:sm="6"
|
>
|
<a-form-item label="统一编号">
|
<a-input
|
placeholder="请输入统一编号"
|
v-model="queryParam.equipmentNum"
|
></a-input>
|
</a-form-item>
|
</a-col>
|
<a-col
|
:md="6"
|
:sm="6"
|
>
|
<a-form-item label="设备名称">
|
<a-input
|
placeholder="请输入设备名称"
|
v-model="queryParam.equipmentName"
|
></a-input>
|
</a-form-item>
|
</a-col>
|
<a-col
|
:md="6"
|
:sm="6"
|
>
|
<a-form-item label="设备型号">
|
<a-input
|
placeholder="请输入设备型号"
|
v-model="queryParam.model"
|
></a-input>
|
</a-form-item>
|
</a-col>
|
</a-row>
|
<a-row :gutter="24">
|
<a-col
|
:md="6"
|
:sm="6"
|
>
|
<a-form-item label="设备规格">
|
<a-input
|
placeholder="请输入设备规格"
|
v-model="queryParam.specification"
|
></a-input>
|
</a-form-item>
|
</a-col>
|
<a-col
|
:md="6"
|
:sm="6"
|
>
|
<a-form-item label="使用部门">
|
<a-tree-select
|
style="width: 100%"
|
:dropdown-style="{ maxHeight: '400px', overflow: 'auto' }"
|
:tree-data="treeData"
|
placeholder="请选择使用部门"
|
tree-default-expand-all
|
v-model="queryParam.useId"
|
/>
|
</a-form-item>
|
</a-col>
|
<a-col
|
:md="6"
|
:sm="6"
|
>
|
<a-form-item label="故障时间">
|
<a-range-picker
|
style="width: 100%;"
|
format="YYYY-MM-DD HH:mm:ss"
|
v-model="faultTime"
|
@change="timeChange"
|
/>
|
</a-form-item>
|
</a-col>
|
<a-col
|
:md="6"
|
:sm="6"
|
>
|
<a-form-item label="报修人">
|
<a-input
|
placeholder="请输入报修人"
|
v-model="queryParam.errUda2"
|
></a-input>
|
</a-form-item>
|
</a-col>
|
</a-row>
|
<a-row :gutter="24">
|
<a-col
|
:md="6"
|
:sm="6"
|
>
|
<a-form-item label="单据状态">
|
<j-dict-select-tag
|
allow-clear
|
placeholder="请选择单据状态"
|
:triggerChange="true"
|
dictCode="equipment_report_repair_status"
|
v-model="queryParam.status"
|
/>
|
</a-form-item>
|
</a-col>
|
<a-col
|
:md="6"
|
:sm="6"
|
>
|
<a-form-item label="是否停机维修">
|
<j-dict-select-tag
|
allow-clear
|
placeholder="请选择是否停机维修"
|
:triggerChange="true"
|
dictCode="is_stop"
|
v-model="queryParam.isStop"
|
/>
|
</a-form-item>
|
</a-col>
|
<a-col
|
:md="6"
|
:sm="6"
|
>
|
<a-form-item label="是否加工零件">
|
<j-dict-select-tag
|
allow-clear
|
placeholder="请选择是否在加工零件"
|
:triggerChange="true"
|
dictCode="is_product"
|
v-model="queryParam.errUda1"
|
/>
|
</a-form-item>
|
</a-col>
|
<a-col
|
:md="6"
|
:sm="6"
|
>
|
<a-form-item label="制单人">
|
<a-input
|
placeholder="请输入制单人"
|
v-model="queryParam.createBy"
|
></a-input>
|
</a-form-item>
|
</a-col>
|
<a-col
|
:md="6"
|
:sm="6"
|
>
|
<a-form-item
|
label="是否关键设备"
|
>
|
<j-dict-select-tag
|
allow-clear
|
placeholder="请选择是否关键设备"
|
:triggerChange="true"
|
dictCode="specific_equipment"
|
v-model="queryParam.specificEquipment"
|
/>
|
</a-form-item>
|
</a-col>
|
</a-row>
|
</a-form>
|
</div>
|
<div class="table-operator">
|
<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-button
|
@click="handleAdd"
|
type="primary"
|
icon="plus"
|
v-has="'report:add&edit'"
|
>新增</a-button>
|
<a-button
|
type="primary"
|
icon="download"
|
@click="handleExportXls('故障报修')"
|
>导出</a-button>
|
</div>
|
|
<div>
|
<a-table
|
ref="table"
|
size="middle"
|
:scroll="{ x: 'calc(1900px + 50%)', y: 900 }"
|
bordered
|
rowKey="id"
|
:columns="columns"
|
:dataSource="dataSource"
|
:pagination="ipagination"
|
:loading="loading"
|
class="j-table-force-nowrap"
|
@change="handleTableChange"
|
:customRow="clickThenSelect"
|
>
|
<span
|
slot="specificEquipment"
|
slot-scope="text"
|
>
|
<a-icon type="check" style="color: chartreuse;" v-if="text==='0'" />
|
<a-icon type="close" v-else style="color:red;"/>
|
</span>
|
<span
|
slot="action"
|
slot-scope="text, record"
|
>
|
<a
|
:disabled=" record.status !== '4'"
|
@click="handleAccept(record)"
|
v-has="'report:accept'"
|
>验收</a>
|
<!-- <a-popconfirm
|
v-if="record.status == '1' || record.status == '4'"
|
title="确认提交吗?"
|
@confirm="() =>handleCommit(record, 'commit')"
|
>
|
<a>提交</a>
|
</a-popconfirm>
|
<a-popconfirm
|
v-if="record.status == '2'"
|
title="确认撤回吗?"
|
@confirm="() =>handleCommit(record, 'back')"
|
>
|
<a>撤回</a>
|
</a-popconfirm>
|
|
<a-divider
|
v-if="record.status == '1' || record.status == '2' || record.status == '4'"
|
type="vertical"
|
/>
|
<a
|
v-if="record.status == '1' || record.status == '4'"
|
@click="handleEdit(record)"
|
>编辑</a>
|
<a
|
v-if="record.status == '2'"
|
@click="handleApprove(record)"
|
>审批</a>
|
<a-divider
|
v-if="record.status == '1' || record.status == '2' || record.status == '4'"
|
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.status == '1'">
|
<a-popconfirm
|
v-if="record.status == '1'"
|
title="确定删除吗?"
|
@confirm="() => handleDelete(record.id)"
|
>
|
<a>删除</a>
|
</a-popconfirm>
|
</a-menu-item>
|
<a-menu-item v-if="record.status == '3' || record.status == '4'">
|
<a-popconfirm
|
v-if="record.status == '3' || record.status == '4'"
|
title="确认撤销吗?"
|
@confirm="() =>handleFinish(record, 'revoke')"
|
>
|
<a>撤销</a>
|
</a-popconfirm>
|
</a-menu-item>
|
</a-menu>
|
</a-dropdown> -->
|
</span>
|
<span
|
slot="jell"
|
slot-scope="text"
|
>
|
<j-ellipsis
|
:value="text"
|
:length="10"
|
/>
|
</span>
|
|
</a-table>
|
</div>
|
|
<a-tabs
|
type="card"
|
defaultActiveKey="1"
|
>
|
<a-tab-pane
|
tab="故障描述"
|
key="1"
|
>
|
<div
|
class="table-operator"
|
style="margin-top: 0px"
|
>
|
<FaultDescriptionList
|
ref="FaultDescriptionList"
|
@ok="modalFormOk"
|
/>
|
</div>
|
|
</a-tab-pane>
|
</a-tabs>
|
|
<malfunction-repair-modal
|
ref="modalForm"
|
@ok="modalFormOk"
|
></malfunction-repair-modal>
|
<approvel-modal
|
ref='approvalModalForm'
|
@ok='approvalModalFormOk'
|
@cancel='approvalModalFormOk'
|
></approvel-modal>
|
<accept-model
|
ref="acceptModel"
|
@ok="modalFormOk"
|
></accept-model>
|
</a-card>
|
</template>
|
|
<script>
|
|
import '@/assets/less/TableExpand.less'
|
import { putAction, getAction } from '@/api/manage'
|
import { mixinDevice } from '@/utils/mixin'
|
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
|
import MalfunctionRepairModal from './modules/malfunctionRepair/MalfunctionRepaireModal'
|
import FaultDescriptionList from './modules/malfunctionRepair/FaultDescriptionList'
|
import ApprovelModal from './modules/malfunctionRepair/ApprovelModal'
|
import JEllipsis from '@/components/jeecg/JEllipsis'
|
import moment from 'moment'
|
import AcceptModel from './modules/malfunctionRepair/AcceptModel'
|
|
export default {
|
name: 'MalfunctionRepairList',
|
mixins: [JeecgListMixin, mixinDevice],
|
components: {
|
MalfunctionRepairModal,
|
FaultDescriptionList,
|
ApprovelModal,
|
JEllipsis,
|
AcceptModel,
|
},
|
data() {
|
return {
|
treeData: [],
|
faultTime: [],
|
description: '故障报修',
|
queryParam: { delflag: 0 },
|
selectedRowKeys: [],
|
selectionRows: [],
|
columns: [
|
{
|
title: '#',
|
dataIndex: '',
|
key: 'rowIndex',
|
width: 60,
|
align: "center",
|
customRender: function (t, r, index) {
|
return parseInt(index) + 1;
|
}
|
},
|
{
|
title: '单据号',
|
align: "center",
|
dataIndex: 'num'
|
},
|
{
|
title: '状态',
|
align: "center",
|
dataIndex: 'statusName',
|
},
|
{
|
title: '类型',
|
align: "center",
|
dataIndex: 'type',
|
customRender: (text) => {
|
if (text == '1') {
|
return "被动报修";
|
} else if (text == '2') {
|
return "主动报修";
|
}
|
},
|
},
|
{
|
title: '来源',
|
align: "center",
|
dataIndex: 'source',
|
customRender: (text) => {
|
if (text == '1') {
|
return "手动创建";
|
} else if (text == '2') {
|
return "点检报修";
|
}
|
},
|
},
|
{
|
title: '关键设备',
|
align: "center",
|
dataIndex: 'specificEquipment',
|
scopedSlots: { customRender: 'specificEquipment' }
|
},
|
{
|
title: '统一编号',
|
align: "center",
|
dataIndex: 'equipmentNum'
|
},
|
{
|
title: '设备名称',
|
align: "center",
|
dataIndex: 'equipmentName',
|
},
|
{
|
title: '设备型号',
|
align: "center",
|
dataIndex: 'equipmentModel',
|
},
|
{
|
title: '规格',
|
align: "center",
|
dataIndex: 'equipmentSpecification',
|
},
|
{
|
title: '使用部门',
|
align: "center",
|
dataIndex: 'departName',
|
},
|
// {
|
// title: '紧急程度',
|
// align: "center",
|
// dataIndex: 'urgencyName',
|
// },
|
{
|
title: '故障描述',
|
align: "center",
|
dataIndex: 'faultDescription',
|
scopedSlots: {
|
customRender: 'faultDescription'
|
}
|
|
},
|
// {
|
// title: '故障拍照',
|
// align: "center",
|
// dataIndex: 'photo',
|
// scopedSlots: { customRender: 'imgSlot' }
|
// },
|
{
|
title: '报修人',
|
align: "center",
|
dataIndex: 'errUda2'
|
},
|
{
|
title: '故障时间',
|
align: "center",
|
dataIndex: 'faultTime'
|
},
|
{
|
title: '是否停机待修',
|
align: "center",
|
dataIndex: 'isStopName',
|
},
|
{
|
title: '是否在加工零件',
|
align: "center",
|
dataIndex: 'errUda1_dictText',
|
},
|
{
|
title: '制单人',
|
align: "center",
|
dataIndex: 'createBy'
|
},
|
{
|
title: '验收意见',
|
align: "center",
|
dataIndex: 'errUda5',
|
scopedSlots: {
|
customRender: 'jell'
|
}
|
},
|
{
|
title: '备注',
|
align: "center",
|
dataIndex: 'remark'
|
},
|
{
|
title: '操作',
|
dataIndex: 'action',
|
align: "center",
|
fixed: "right",
|
width: 200,
|
scopedSlots: { customRender: 'action' }
|
}
|
],
|
url: {
|
list: "/eam/equipmentReportRepair/getReportRepairList",
|
delete: "/eam/equipmentReportRepair/delete",
|
deleteBatch: "/eam/equipmentReportRepair/deleteBatch",
|
exportXlsUrl: "/eam/equipmentReportRepair/exportXls",
|
importExcelUrl: "eam/equipmentReportRepair/importExcel",
|
edit: "/eam/equipmentReportRepair/edit",
|
loadOptions: '/sys/sysDepart/loadDepartTreeOptions',
|
},
|
/* 分页参数 */
|
ipagination: {
|
current: 1,
|
pageSize: 5,
|
pageSizeOptions: ['5', '10', '50'],
|
showTotal: (total, range) => {
|
return range[0] + "-" + range[1] + " 共" + total + "条"
|
},
|
showQuickJumper: true,
|
showSizeChanger: true,
|
total: 0
|
},
|
}
|
},
|
created() {
|
this.initOptions();
|
},
|
computed: {
|
importExcelUrl: function () {
|
return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
|
},
|
rowSelection() {
|
return {
|
type: 'checkbox',
|
onChange: (selectedRowKeys, selectedRows) => {
|
this.selectedRowKeys = selectedRowKeys;
|
this.onSelectChange(selectedRowKeys, selectedRows);
|
},
|
getCheckboxProps(record) {
|
return ({
|
props: {
|
// disabled: !(record.equipmentCategoryDtlList.length == 0),
|
}
|
})
|
},
|
selectedRowKeys: this.selectedRowKeys,
|
};
|
},
|
},
|
methods: {
|
|
clickThenSelect(record) {
|
return {
|
on: {
|
click: () => {
|
this.onSelectChange(record.id.split(","), [record]);
|
}
|
}
|
}
|
},
|
|
loadData(arg) {
|
if (!this.url.list) {
|
this.$message.error('请设置url.list属性!')
|
return
|
}
|
//加载数据 若传入参数1则加载第一页的内容
|
if (arg === 1) {
|
this.ipagination.current = 1
|
}
|
var params = this.getQueryParams() //查询条件
|
this.loading = true
|
getAction(this.url.list, params)
|
.then(res => {
|
if (res.success) {
|
//update-begin---author:zhangyafei Date:20201118 for:适配不分页的数据列表------------
|
this.dataSource = res.result.records || res.result
|
if (res.result.total) {
|
this.ipagination.total = res.result.total
|
} else {
|
this.ipagination.total = 0
|
}
|
//update-end---author:zhangyafei Date:20201118 for:适配不分页的数据列表------------
|
} else {
|
this.$message.warning(res.message)
|
}
|
})
|
.finally(() => {
|
this.loading = false
|
this.onClearSelected()
|
this.$refs.FaultDescriptionList.faultId = '-1'
|
})
|
},
|
|
onSelectChange(selectedRowKeys, selectionRows) {
|
this.selectedRowKeys = selectedRowKeys;
|
this.selectionRows = selectionRows;
|
if (selectedRowKeys.length == 1) {
|
this.$refs.FaultDescriptionList.faultId = selectedRowKeys[0]
|
} else {
|
this.$refs.FaultDescriptionList.faultId = '-1'
|
}
|
},
|
|
|
handleCommit(record, type) {
|
type == 'commit' ? record.status = '2' : record.status = '1'
|
putAction(this.url.edit, record).then(res => {
|
if (res.success) {
|
if (type === 'commit') {
|
this.$message.success("提交成功!");
|
} else {
|
this.$message.success("撤回成功!");
|
}
|
|
this.loadData();
|
} else {
|
this.$message.warning(res.message);
|
}
|
})
|
},
|
|
handleFinish(record, type) {
|
if (type == 'agree') {
|
record.status = '3'
|
} else if (type == 'reject') {
|
record.status = '4'
|
} else if (type == 'revoke') {
|
record.status = '2'
|
}
|
putAction(this.url.edit, record).then(res => {
|
if (res.success) {
|
this.$message.success("确认成功!");
|
this.loadData();
|
} else {
|
this.$message.warning(res.message);
|
}
|
})
|
},
|
handleApprove: function (record) {
|
let edit
|
edit = this.url.edit
|
this.$refs.approvalModalForm.showModals(record, edit, '3', '4')
|
this.$refs.approvalModalForm.title = '审批'
|
this.$refs.approvalModalForm.disableSubmit = false
|
|
},
|
approvalModalFormOk() {
|
// 通过/驳回时,重载列表
|
this.loadData()
|
//清空列表选中
|
this.onClearSelected()
|
},
|
|
onClearSelected() {
|
this.selectedRowKeys = []
|
this.selectionRows = []
|
},
|
|
searchQuery() {
|
this.loadData(1)
|
this.onClearSelected()
|
this.$refs.FaultDescriptionList.faultId = '-1'
|
},
|
|
searchReset() {
|
this.queryParam = {}
|
this.loadData(1)
|
this.onClearSelected()
|
this.faultTime = []
|
this.$refs.FaultDescriptionList.faultId = '-1'
|
},
|
initOptions() {
|
getAction(this.url.loadOptions).then(res => {
|
if (res.success) {
|
this.treeData = res.result
|
} else {
|
this.$message.warning(res.message)
|
}
|
})
|
},
|
timeChange() {
|
this.queryParam.faultStartTime = moment(this.faultTime[0]).format("YYYY-MM-DD HH:mm:ss")
|
this.queryParam.faultEndTime = moment(this.faultTime[1]).format("YYYY-MM-DD HH:mm:ss")
|
},
|
handleAccept(record) {
|
this.$refs.acceptModel.title = "验收"
|
this.$refs.acceptModel.edit(record)
|
}
|
}
|
}
|
</script>
|
<style scoped>
|
@import '~@assets/less/common.less';
|
</style>
|