故障审核和广告审核完善
This commit is contained in:
parent
4823497fc6
commit
f2a77b3ab8
|
@ -43,6 +43,14 @@ export function handleAudit(data){
|
|||
})
|
||||
}
|
||||
|
||||
export function handleComplete(data){
|
||||
return request({
|
||||
url: '/bst/fault/complete',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除故障
|
||||
export function delFault(id) {
|
||||
return request({
|
||||
|
|
|
@ -1,317 +1,416 @@
|
|||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<el-form-item label="设备SN" prop="vehicleCode">
|
||||
<el-input
|
||||
v-model="queryParams.vehicleCode"
|
||||
placeholder="请输入设备Sn"
|
||||
clearable
|
||||
@input="handleQuery"
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<el-form-item label="设备SN" prop="vehicleCode">
|
||||
<el-input
|
||||
v-model="queryParams.vehicleCode"
|
||||
placeholder="请输入设备Sn"
|
||||
clearable
|
||||
@input="handleQuery"
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="报修进度" prop="appealStatus">
|
||||
<el-select v-model="queryParams.appealStatus" placeholder="请选择报修进度" clearable @change="handleQuery">
|
||||
<el-option
|
||||
v-for="dict in dict.type.appeal_status"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="报修进度" prop="appealStatus">
|
||||
<el-select v-model="queryParams.appealStatus" placeholder="请选择报修进度" clearable @change="handleQuery">
|
||||
<el-option
|
||||
v-for="dict in dict.type.appeal_status"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="warning"
|
||||
plain
|
||||
icon="el-icon-download"
|
||||
size="mini"
|
||||
@click="handleExport"
|
||||
v-has-permi="['bst:fault:export']"
|
||||
>导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList" :columns="columns"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="faultList" @selection-change="handleSelectionChange" :default-sort="defaultSort" @sort-change="onSortChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<template v-for="column of showColumns">
|
||||
<el-table-column
|
||||
:key="column.key"
|
||||
:label="column.label"
|
||||
:prop="column.key"
|
||||
:align="column.align"
|
||||
:min-width="column.minWidth"
|
||||
:sort-orders="orderSorts"
|
||||
:sortable="column.sortable"
|
||||
:show-overflow-tooltip="column.overflow"
|
||||
:width="column.width"
|
||||
>
|
||||
<template slot-scope="d">
|
||||
<template v-if="column.key === 'id'">
|
||||
{{d.row[column.key]}}
|
||||
</template>
|
||||
<template v-else-if="column.key === 'faultSite'">
|
||||
<dict-tag :options="dict.type.fault_site" :value="d.row[column.key]"/>
|
||||
</template>
|
||||
<template v-else-if="column.key === 'picture'">
|
||||
<image-preview
|
||||
:src="d.row[column.key]"
|
||||
alt="故障图片"
|
||||
:width="50" :height="50"
|
||||
/>
|
||||
</template>
|
||||
<template v-else-if="column.key === 'appealStatus'">
|
||||
<dict-tag :options="dict.type.appeal_status" :value="d.row[column.key]" />
|
||||
</template>
|
||||
<template v-else>
|
||||
{{d.row[column.key]}}
|
||||
</template>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</template>
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="warning"
|
||||
plain
|
||||
icon="el-icon-download"
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-audit"
|
||||
@click="handleReject(scope.row, 0)"
|
||||
v-has-permi="['bst:fault:edit']"
|
||||
v-if="scope.row.appealStatus ==='1'"
|
||||
>驳回</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
:icon="scope.row.appealStatus === '1' ? 'el-icon-audit' : 'el-icon-check'"
|
||||
@click="handleNext(scope.row, 1)"
|
||||
v-has-permi="['bst:fault:edit']"
|
||||
v-if="scope.row.appealStatus === '1' || scope.row.appealStatus === '2'"
|
||||
@click="handleExport"
|
||||
v-has-permi="['bst:fault:export']"
|
||||
>导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList" :columns="columns"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="faultList" @selection-change="handleSelectionChange" :default-sort="defaultSort" @sort-change="onSortChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<template v-for="column of showColumns">
|
||||
<el-table-column
|
||||
:key="column.key"
|
||||
:label="column.label"
|
||||
:prop="column.key"
|
||||
:align="column.align"
|
||||
:min-width="column.minWidth"
|
||||
:sort-orders="orderSorts"
|
||||
:sortable="column.sortable"
|
||||
:show-overflow-tooltip="column.overflow"
|
||||
:width="column.width"
|
||||
>
|
||||
{{ scope.row.appealStatus === '1' ? '处理' : '完成' }}
|
||||
</el-button>
|
||||
<template slot-scope="d">
|
||||
<template v-if="column.key === 'id'">
|
||||
{{d.row[column.key]}}
|
||||
</template>
|
||||
<template v-else-if="column.key === 'faultSite'">
|
||||
<dict-tag :options="dict.type.fault_site" :value="d.row[column.key]"/>
|
||||
</template>
|
||||
<template v-else-if="column.key === 'picture'">
|
||||
<image-preview
|
||||
:src="d.row[column.key]"
|
||||
alt="故障图片"
|
||||
:width="50" :height="50"
|
||||
/>
|
||||
</template>
|
||||
<template v-else-if="column.key === 'appealStatus'">
|
||||
<dict-tag :options="dict.type.appeal_status" :value="d.row[column.key]" />
|
||||
</template>
|
||||
<template v-else>
|
||||
{{d.row[column.key]}}
|
||||
</template>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</template>
|
||||
<!-- <template slot-scope="scope">-->
|
||||
<!-- <el-button-->
|
||||
<!-- size="mini"-->
|
||||
<!-- type="text"-->
|
||||
<!-- icon="el-icon-delete"-->
|
||||
<!-- @click="handleDelete(scope.row)"-->
|
||||
<!-- v-has-permi="['bst:fault:remove']"-->
|
||||
<!-- >删除</el-button>-->
|
||||
<!-- </template>-->
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-view"
|
||||
@click="handleView(scope.row)"
|
||||
v-hasPermi="['bst:fault:list']"
|
||||
>查看详情</el-button>
|
||||
</template>
|
||||
<!-- <template slot-scope="scope">-->
|
||||
<!-- <el-button-->
|
||||
<!-- size="mini"-->
|
||||
<!-- type="text"-->
|
||||
<!-- icon="el-icon-delete"-->
|
||||
<!-- @click="handleDelete(scope.row)"-->
|
||||
<!-- v-has-permi="['bst:fault:remove']"-->
|
||||
<!-- >删除</el-button>-->
|
||||
<!-- </template>-->
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
<script>
|
||||
import {handleAudit, listFault} from "@/api/bst/fault";
|
||||
import { $showColumns } from '@/utils/mixins';
|
||||
import FormCol from "@/components/FormCol/index.vue";
|
||||
import FaultEditDialog from "@/views/bst/fault/components/FaultEditDialog.vue";
|
||||
|
||||
// 默认排序字段
|
||||
const defaultSort = {
|
||||
prop: "createTime",
|
||||
order: "descending"
|
||||
}
|
||||
<!-- 在index.vue的template中添加弹窗结构 -->
|
||||
<el-dialog
|
||||
:title="`故障申报详情`"
|
||||
:visible.sync="detailVisible"
|
||||
width="800px"
|
||||
append-to-body>
|
||||
|
||||
export default {
|
||||
name: "Fault",
|
||||
mixins: [$showColumns],
|
||||
components: {FaultEditDialog, FormCol},
|
||||
dicts: ['fault_site','appeal_status'],
|
||||
props: {
|
||||
query: {
|
||||
type: Object,
|
||||
default: () => ({})
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
span: 24,
|
||||
// 字段列表
|
||||
columns: [
|
||||
{key: 'id', visible: false, label: 'ID', minWidth: null, sortable: true, overflow: false, align: 'center', width: "80"},
|
||||
{key: 'userName', visible: true, label: '用户', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
||||
{key: 'areaName', visible: true, label: '运营区', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
||||
{key: 'orderId', visible: true, label: '订单号', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
||||
{key: 'vehicleCode', visible: true, label: 'SN', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
||||
{key: 'faultSite', visible: true, label: '故障原因', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
||||
{key: 'picture', visible: true, label: '图片', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
||||
{key: 'faultDetail', visible: true, label: '故障详情', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
||||
{key: 'appealStatus', visible: true, label: '状态', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
||||
{key: 'createTime', visible: true, label: '提交时间', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
||||
],
|
||||
// 排序方式
|
||||
orderSorts: ['ascending', 'descending', null],
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 故障表格数据
|
||||
faultList: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 选中的ID
|
||||
selectedId: null,
|
||||
defaultSort,
|
||||
<!-- 申请信息区块 -->
|
||||
<div class="info-section">
|
||||
<el-descriptions title="申报信息" :column="2" border>
|
||||
<el-descriptions-item label="申报用户">{{ detailForm.userName }}</el-descriptions-item>
|
||||
<el-descriptions-item label="申报时间">{{ detailForm.createTime }}</el-descriptions-item>
|
||||
<el-descriptions-item label="设备SN">{{ detailForm.vehicleCode }}</el-descriptions-item>
|
||||
<el-descriptions-item label="所属运营区">{{ detailForm.areaName }}</el-descriptions-item>
|
||||
<el-descriptions-item label="故障图片" :span="2">
|
||||
<image-preview :src="detailForm.picture" :width="200" />
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="故障详情" :span="2">
|
||||
<pre class="content-pre">{{ detailForm.faultDetail }}</pre>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="审核状态">
|
||||
<dict-tag :value="detailForm.appealStatus" :options="dict.type.appeal_status"/>
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
</div>
|
||||
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 20,
|
||||
orderByColumn: defaultSort.prop,
|
||||
isAsc: defaultSort.order,
|
||||
userName: null,
|
||||
vehicleCode: null,
|
||||
picture: null,
|
||||
orderId: null,
|
||||
faultSiteList:[],
|
||||
faultDetail: null,
|
||||
appealStatus: null,
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {
|
||||
userName: [
|
||||
{ required: true, message: "用户不能为空", trigger: "blur" }
|
||||
],
|
||||
vehicleCode: [
|
||||
{ required: true, message: "车辆编码不能为空", trigger: "blur" }
|
||||
],
|
||||
picture: [
|
||||
{ required: true, message: "图片不能为空", trigger: "blur" }
|
||||
],
|
||||
faultSite: [
|
||||
{ required: true, message: "故障部位不能为空", trigger: "blur" }
|
||||
],
|
||||
appealStatus: [
|
||||
{ required: true, message: "申诉状态:0-已驳回 1-已提交 2-维修中不能为空", trigger: "change" }
|
||||
],
|
||||
createTime: [
|
||||
{ required: true, message: "创建时间不能为空", trigger: "blur" }
|
||||
]
|
||||
}
|
||||
};
|
||||
},
|
||||
created() {
|
||||
Object.assign(this.queryParams, this.query, this.$route.query);
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
handleReject(row, status) {
|
||||
this.$modal.confirm('确认驳回该故障申报吗?').then(() => {
|
||||
this.handleAudit(row.id, status); // 调用统一接口
|
||||
});
|
||||
},
|
||||
handleNext(row, status) {
|
||||
this.$modal.confirm('确认处理该故障申报吗?').then(() => {
|
||||
this.handleAudit(row.id, status); // 调用统一接口
|
||||
});
|
||||
},
|
||||
handleAudit(id, handle) {
|
||||
// 调用后端接口,传递handle参数(0或1)
|
||||
handleAudit({id, handle}).then(response => {
|
||||
this.$modal.msgSuccess("操作成功");
|
||||
this.getList(); // 刷新列表
|
||||
});
|
||||
},
|
||||
/** 当排序按钮被点击时触发 **/
|
||||
onSortChange(column) {
|
||||
if (column.order == null) {
|
||||
this.queryParams.orderByColumn = defaultSort.prop;
|
||||
this.queryParams.isAsc = defaultSort.order;
|
||||
} else {
|
||||
this.queryParams.orderByColumn = column.prop;
|
||||
this.queryParams.isAsc = column.order;
|
||||
}
|
||||
this.getList();
|
||||
},
|
||||
/** 查询故障列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
listFault(this.queryParams).then(response => {
|
||||
this.faultList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false;
|
||||
this.reset();
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {
|
||||
id: null,
|
||||
userName: null,
|
||||
vehicleCode: null,
|
||||
picture: null,
|
||||
orderId: null,
|
||||
faultSite: null,
|
||||
faultDetail: null,
|
||||
appealStatus: null,
|
||||
createTime: null
|
||||
};
|
||||
this.resetForm("form");
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1;
|
||||
this.getList();
|
||||
},
|
||||
/** 查看详情 */
|
||||
handleView(row){
|
||||
this.selectedId = row.id
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.resetForm("queryForm");
|
||||
this.handleQuery();
|
||||
},
|
||||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map(item => item.id)
|
||||
this.single = selection.length!==1
|
||||
this.multiple = !selection.length
|
||||
},
|
||||
<!-- 审核区块 -->
|
||||
<template v-if="detailForm.appealStatus === '1'">
|
||||
<el-divider />
|
||||
<div class="verify-area">
|
||||
<el-input
|
||||
v-model="verifyRemark"
|
||||
type="textarea"
|
||||
:rows="4"
|
||||
placeholder="请输入审核意见"
|
||||
style="margin:20px 0"
|
||||
/>
|
||||
<div class="dialog-footer" style="display: flex; justify-content: flex-end; gap: 10px;">
|
||||
<el-button type="danger" @click="reject" v-hasPermi="['bst:fault:edit']">驳 回</el-button>
|
||||
<el-button type="success" @click="audit" v-hasPermi="['bst:fault:edit']">通 过</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
this.download('bst/fault/export', {
|
||||
...this.queryParams
|
||||
}, `fault_${new Date().getTime()}.xlsx`)
|
||||
}
|
||||
|
||||
<template v-if="['0','2','3'].includes(detailForm.appealStatus)">
|
||||
<el-divider />
|
||||
<el-descriptions title="审核信息" :column="1" border>
|
||||
<el-descriptions-item label="审核人">{{ detailForm.verifyName || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="审核时间">{{ detailForm.verifyEndTime || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="审核意见">
|
||||
<pre style="white-space: pre-wrap;">{{ detailForm.verifyRemark || '无' }}</pre>
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
</template>
|
||||
|
||||
<div v-if="detailForm.appealStatus === '2'" class="dialog-footer" style="margin-top:20px;text-align:center">
|
||||
<el-button
|
||||
type="primary"
|
||||
@click="complete"
|
||||
v-hasPermi="['bst:fault:edit']"
|
||||
>维修完成</el-button>
|
||||
</div>
|
||||
|
||||
|
||||
</el-dialog>
|
||||
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {getFault, handleAudit, handleComplete, listFault} from "@/api/bst/fault";
|
||||
import { $showColumns } from '@/utils/mixins';
|
||||
import FormCol from "@/components/FormCol/index.vue";
|
||||
import FaultEditDialog from "@/views/bst/fault/components/FaultEditDialog.vue";
|
||||
|
||||
// 默认排序字段
|
||||
const defaultSort = {
|
||||
prop: "createTime",
|
||||
order: "descending"
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
export default {
|
||||
name: "Fault",
|
||||
mixins: [$showColumns],
|
||||
components: {FaultEditDialog, FormCol},
|
||||
dicts: ['fault_site','appeal_status'],
|
||||
props: {
|
||||
query: {
|
||||
type: Object,
|
||||
default: () => ({})
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
span: 24,
|
||||
// 字段列表
|
||||
columns: [
|
||||
{key: 'id', visible: true, label: '故障反馈ID', minWidth: null, sortable: true, overflow: false, align: 'center', width: "80"},
|
||||
{key: 'userName', visible: true, label: '用户', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
||||
{key: 'areaName', visible: true, label: '运营区', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
||||
//{key: 'orderId', visible: true, label: '订单号', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
||||
{key: 'vehicleCode', visible: true, label: 'SN', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
||||
{key: 'faultSite', visible: true, label: '故障原因', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
||||
//{key: 'picture', visible: true, label: '图片', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
||||
//{key: 'faultDetail', visible: true, label: '故障详情', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
||||
{key: 'appealStatus', visible: true, label: '状态', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
||||
{key: 'createTime', visible: true, label: '提交时间', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
||||
],
|
||||
// 排序方式
|
||||
orderSorts: ['ascending', 'descending', null],
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 故障表格数据
|
||||
faultList: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
|
||||
detailVisible: false, // 控制详情弹窗显示
|
||||
detailForm: {}, // 详情数据存储
|
||||
verifyRemark: '',
|
||||
// 选中的ID
|
||||
selectedId: null,
|
||||
defaultSort,
|
||||
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 20,
|
||||
orderByColumn: defaultSort.prop,
|
||||
isAsc: defaultSort.order,
|
||||
userName: null,
|
||||
vehicleCode: null,
|
||||
picture: null,
|
||||
orderId: null,
|
||||
faultSiteList:[],
|
||||
faultDetail: null,
|
||||
appealStatus: null,
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {
|
||||
userName: [
|
||||
{ required: true, message: "用户不能为空", trigger: "blur" }
|
||||
],
|
||||
vehicleCode: [
|
||||
{ required: true, message: "车辆编码不能为空", trigger: "blur" }
|
||||
],
|
||||
picture: [
|
||||
{ required: true, message: "图片不能为空", trigger: "blur" }
|
||||
],
|
||||
faultSite: [
|
||||
{ required: true, message: "故障部位不能为空", trigger: "blur" }
|
||||
],
|
||||
appealStatus: [
|
||||
{ required: true, message: "申诉状态:0-已驳回 1-已提交 2-维修中不能为空", trigger: "change" }
|
||||
],
|
||||
createTime: [
|
||||
{ required: true, message: "创建时间不能为空", trigger: "blur" }
|
||||
]
|
||||
}
|
||||
};
|
||||
},
|
||||
created() {
|
||||
Object.assign(this.queryParams, this.query, this.$route.query);
|
||||
this.getList();
|
||||
},
|
||||
computed: {
|
||||
isApproving() {
|
||||
return ['1'].includes(this.detailForm.appealStatus)
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
// 审核通过
|
||||
audit() {
|
||||
this.handleVerify(true);
|
||||
},
|
||||
// 完成
|
||||
complete() {
|
||||
this.$modal.confirm('确定当前设备故障已维修完成?').then(() => {
|
||||
handleComplete({
|
||||
id: this.detailForm.id,
|
||||
pass: true,
|
||||
}).then(() => {
|
||||
this.$message.success('维修已完成')
|
||||
this.detailVisible = false
|
||||
this.getList()
|
||||
})
|
||||
})
|
||||
},
|
||||
// 审核驳回
|
||||
reject() {
|
||||
this.handleVerify(false);
|
||||
},
|
||||
|
||||
// 处理审核
|
||||
handleVerify(Pass) {
|
||||
if (!this.verifyRemark) {
|
||||
this.$message.warning('请填写审核意见');
|
||||
return;
|
||||
}
|
||||
const action = Pass ? '通过' : '驳回';
|
||||
this.$modal.confirm(`确认${action}该申请吗?`).then(() => {
|
||||
handleAudit({
|
||||
id: this.detailForm.id,
|
||||
pass: Pass, // true表示通过,false表示驳回
|
||||
verifyRemark: this.verifyRemark
|
||||
}).then(() => {
|
||||
this.$modal.msgSuccess(`${action}成功`);
|
||||
this.detailVisible = false;
|
||||
this.getList();
|
||||
});
|
||||
});
|
||||
},
|
||||
/** 当排序按钮被点击时触发 **/
|
||||
onSortChange(column) {
|
||||
if (column.order == null) {
|
||||
this.queryParams.orderByColumn = defaultSort.prop;
|
||||
this.queryParams.isAsc = defaultSort.order;
|
||||
} else {
|
||||
this.queryParams.orderByColumn = column.prop;
|
||||
this.queryParams.isAsc = column.order;
|
||||
}
|
||||
this.getList();
|
||||
},
|
||||
/** 查询故障列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
listFault(this.queryParams).then(response => {
|
||||
this.faultList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false;
|
||||
this.reset();
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {
|
||||
id: null,
|
||||
userName: null,
|
||||
vehicleCode: null,
|
||||
picture: null,
|
||||
orderId: null,
|
||||
faultSite: null,
|
||||
faultDetail: null,
|
||||
appealStatus: null,
|
||||
createTime: null
|
||||
};
|
||||
this.resetForm("form");
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1;
|
||||
this.getList();
|
||||
},
|
||||
/** 查看详情 */
|
||||
handleView(row) {
|
||||
this.loading = true;
|
||||
getFault(row.id).then(response => {
|
||||
this.detailForm = response.data;
|
||||
this.detailVisible = true;
|
||||
this.verifyRemark = '';
|
||||
}).finally(() => {
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.resetForm("queryForm");
|
||||
this.handleQuery();
|
||||
},
|
||||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map(item => item.id)
|
||||
this.single = selection.length!==1
|
||||
this.multiple = !selection.length
|
||||
},
|
||||
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
this.download('bst/fault/export', {
|
||||
...this.queryParams
|
||||
}, `fault_${new Date().getTime()}.xlsx`)
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
|
Loading…
Reference in New Issue
Block a user