<template>
|
<a-modal
|
:title="title"
|
:width="1250"
|
:visible="visible"
|
:confirmLoading="confirmLoading"
|
:okButtonProps="{ props: {disabled: disableSubmit} }"
|
@ok="handleOk"
|
@cancel="handleCancel"
|
cancelText="关闭"
|
>
|
<a-spin :spinning="confirmLoading">
|
<a-form :form="form">
|
<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-input
|
placeholder="请输入单据号检索"
|
v-model="queryParam.num"
|
></j-input>
|
</a-form-item>
|
</a-col>
|
|
<a-col
|
:md="6"
|
:sm="8"
|
>
|
<a-form-item label="设备名称">
|
<j-input
|
placeholder="请输入设备名称检索"
|
v-model="queryParam.equipmentName"
|
></j-input>
|
</a-form-item>
|
</a-col>
|
<a-col
|
:md="6"
|
:sm="8"
|
>
|
<a-button
|
type="primary"
|
@click="searchQuery"
|
icon="search"
|
>查询</a-button>
|
<a-button
|
@click="searchReset"
|
icon="reload"
|
style="margin-left:8px;"
|
>重置</a-button>
|
</a-col>
|
</a-row>
|
<a-row :gutter="24">
|
<a-col :span="24">
|
|
</a-col>
|
</a-row>
|
</a-form>
|
</div>
|
<div style="margin-top:8px;">
|
<a-table
|
ref="table"
|
size="middle"
|
bordered
|
rowKey="id"
|
:columns="columns"
|
:dataSource="dataSource"
|
:pagination="ipagination"
|
:loading="loading"
|
@change="handleTableChange"
|
:customRow="clickThenCheck"
|
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange,type:type}"
|
>
|
|
</a-table>
|
</div>
|
</a-form>
|
</a-spin>
|
|
</a-modal>
|
</template>
|
|
<script>
|
|
import { postAction, getAction } from '@/api/manage'
|
import JDate from '@/components/jeecg/JDate'
|
import Tooltip from 'ant-design-vue/es/tooltip'
|
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
|
import JEllipsis from '@/components/jeecg/JEllipsis'//引入过长裁剪
|
import store from '@/store'
|
|
export default {
|
name: "FaultReportRepair",
|
mixins: [JeecgListMixin],
|
components: {
|
JDate,
|
Tooltip,
|
JEllipsis,
|
},
|
data() {
|
return {
|
title: "选择故障报修信息",
|
visible: false,
|
model: {},
|
dataSource: [],
|
disableSubmit: false,
|
type: "radio",
|
/* 分页参数 */
|
ipagination: {
|
current: 1,
|
pageSize: 10,
|
pageSizeOptions: ['10', '20', '30'],
|
showTotal: (total, range) => {
|
return range[0] + "-" + range[1] + " 共" + total + "条"
|
},
|
showQuickJumper: true,
|
showSizeChanger: true,
|
total: 0
|
},
|
labelCol: {
|
xs: { span: 24 },
|
sm: { span: 6 },
|
},
|
wrapperCol: {
|
xs: { span: 24 },
|
sm: { span: 18 },
|
},
|
confirmLoading: false,
|
form: this.$form.createForm(this),
|
columns: [
|
{
|
title: '#',
|
dataIndex: '',
|
key: 'rowIndex',
|
align: 'center',
|
customRender: function (t, r, index) {
|
return parseInt(index) + 1
|
}
|
},
|
{
|
title: '单据号',
|
align: 'center',
|
dataIndex: 'num',
|
},
|
{
|
title: '设备名称',
|
align: 'center',
|
dataIndex: 'equipmentName',
|
},
|
{
|
title: '故障描述',
|
align: "center",
|
dataIndex: 'faultDescription'
|
},
|
{
|
title: '故障时间',
|
align: "center",
|
dataIndex: 'faultTime'
|
},
|
{
|
title: '紧急程度',
|
align: 'center',
|
dataIndex: 'urgency_dictText',
|
},
|
],
|
url: {
|
list: "/eam/equipmentReportRepair/list",
|
},
|
}
|
},
|
|
|
methods: {
|
|
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
|
params.isCreateOrder = 0
|
getAction(this.url.list, params)
|
.then(res => {
|
if (res.success) {
|
this.dataSource = res.result.records || res.result
|
if (res.result.total) {
|
this.ipagination.total = res.result.total
|
} else {
|
this.ipagination.total = 0
|
}
|
} else {
|
this.$message.warning(res.message)
|
}
|
})
|
.finally(() => {
|
this.loading = false
|
})
|
},
|
|
searchQuery() {
|
this.loadData(1);
|
},
|
searchReset() {
|
this.queryParam = {};
|
this.loadData(1)
|
},
|
list(params) {
|
this.selectedRowKeys = [];
|
this.selectedRowRecord = [];
|
this.visible = true;
|
this.loadData(1);
|
},
|
clickThenCheck(record) {
|
return {
|
on: {
|
click: (e) => {
|
this.selectedRowRecord = record;
|
this.onSelectChange(record.id.split(","), [record]);
|
}
|
}
|
};
|
},
|
onSelectChange(selectedRowKeys, selectedRows) {
|
this.selectedRowKeys = selectedRowKeys;
|
this.selectedRowRecord = selectedRows[0];
|
},
|
close() {
|
this.queryParam = {};
|
this.$emit('close');
|
this.visible = false;
|
},
|
handleOk() {
|
const that = this;
|
// 触发表单验证
|
if (that.selectedRowKeys.length > 0) {
|
if (that.selectedRowRecord.id != null && that.selectedRowRecord.id != "") {
|
that.$emit('sendFaultReportRepairRecord', { record: that.selectedRowRecord });
|
that.close();
|
} else {
|
that.$message.error("请选择故障报修信息!")
|
}
|
} else {
|
that.$message.error("请选择故障报修信息!")
|
}
|
},
|
|
handleCancel() {
|
this.close();
|
},
|
|
},
|
}
|
</script>
|
<style scoped>
|
.ant-btn {
|
padding: 0 10px;
|
margin-left: 3px;
|
}
|
|
.ant-form-item-control {
|
line-height: 0px;
|
}
|
|
.fontweight {
|
font-weight: bold;
|
}
|
|
/** 主表单行间距 */
|
.ant-form .ant-form-item {
|
margin-bottom: 10px;
|
}
|
|
/** Tab页面行间距 */
|
.ant-tabs-content .ant-form-item {
|
margin-bottom: 0px;
|
}
|
.ant-table-tbody .ant-table-row td {
|
padding-top: 10px;
|
padding-bottom: 10px;
|
}
|
|
.anty-row-operator button {
|
margin: 0 5px;
|
}
|
|
.ant-btn-danger {
|
background-color: #ffffff;
|
}
|
|
.ant-modal-cust-warp {
|
height: 100%;
|
}
|
|
.ant-modal-cust-warp .ant-modal-body {
|
height: calc(100% - 110px) !important;
|
overflow-y: auto;
|
}
|
|
.ant-modal-cust-warp .ant-modal-content {
|
height: 90% !important;
|
overflow-y: hidden;
|
}
|
|
/deep/ .notshow {
|
display: none;
|
}
|
|
.frozenRowClass {
|
color: #c9c9c9;
|
}
|
.hight {
|
color: #f5222d;
|
}
|
.middle {
|
color: #fa8c16;
|
}
|
.low {
|
color: #52c41a;
|
}
|
.dataUnKnow {
|
color: #1890ff;
|
}
|
|
/deep/ .frozenRowClass {
|
color: #c9c9c9;
|
}
|
</style>
|