yangwl
A0010407 1 year ago
parent ca2adc7909
commit 5dae96df0a

@ -1,6 +1,13 @@
<template> <template>
<div class="app-container"> <div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px"> <el-form
:model="queryParams"
ref="queryForm"
size="small"
:inline="true"
v-show="showSearch"
label-width="68px"
>
<el-form-item label="报修单号" prop="orderCode"> <el-form-item label="报修单号" prop="orderCode">
<el-input <el-input
v-model="queryParams.orderCode" v-model="queryParams.orderCode"
@ -27,11 +34,16 @@
start-placeholder="开始日期" start-placeholder="开始日期"
end-placeholder="结束日期" end-placeholder="结束日期"
value-format="yyyy-MM-dd" value-format="yyyy-MM-dd"
:picker-options="pickerOptions1"> :picker-options="pickerOptions1"
>
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
<el-form-item label="报修来源" prop="orderSource"> <el-form-item label="报修来源" prop="orderSource">
<el-select v-model="queryParams.orderSource" style="width:195px" clearable> <el-select
v-model="queryParams.orderSource"
style="width: 195px"
clearable
>
<el-option <el-option
v-for="dict in dict.type.device_order_source" v-for="dict in dict.type.device_order_source"
:key="dict.value" :key="dict.value"
@ -50,7 +62,8 @@
start-placeholder="开始日期" start-placeholder="开始日期"
end-placeholder="结束日期" end-placeholder="结束日期"
value-format="yyyy-MM-dd" value-format="yyyy-MM-dd"
:picker-options="pickerOptions2"> :picker-options="pickerOptions2"
>
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
<el-form-item label="报修人" prop="orderRepairman"> <el-form-item label="报修人" prop="orderRepairman">
@ -70,8 +83,16 @@
/> />
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery"></el-button> <el-button
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"></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-item>
</el-form> </el-form>
@ -84,7 +105,8 @@
size="mini" size="mini"
@click="handleAdd" @click="handleAdd"
v-hasPermi="['device:faultReport:add']" v-hasPermi="['device:faultReport:add']"
>添加报修</el-button> >添加报修</el-button
>
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
<el-button <el-button
@ -95,7 +117,8 @@
:disabled="single" :disabled="single"
@click="handleUpdate" @click="handleUpdate"
v-hasPermi="['device:faultReport:edit']" v-hasPermi="['device:faultReport:edit']"
>修改</el-button> >修改</el-button
>
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
<el-button <el-button
@ -106,7 +129,8 @@
:disabled="multiple" :disabled="multiple"
@click="handleDelete" @click="handleDelete"
v-hasPermi="['device:faultReport:remove']" v-hasPermi="['device:faultReport:remove']"
>删除</el-button> >删除</el-button
>
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
<el-button <el-button
@ -116,39 +140,92 @@
size="mini" size="mini"
@click="handleExport" @click="handleExport"
v-hasPermi="['device:faultReport:export']" v-hasPermi="['device:faultReport:export']"
>导出</el-button> >导出</el-button
>
</el-col> </el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> <right-toolbar
:showSearch.sync="showSearch"
@queryTable="getList"
></right-toolbar>
</el-row> </el-row>
<el-table v-loading="loading" :data="faultReportList" @selection-change="handleSelectionChange"> <el-table
v-loading="loading"
:data="faultReportList"
@selection-change="handleSelectionChange"
>
<el-table-column type="selection" width="55" align="center" /> <el-table-column type="selection" width="55" align="center" />
<el-table-column label="报修单号" align="center" prop="orderCode" width="150"/> <el-table-column
<el-table-column label="设备编码" align="center" prop="equipmentCode" width="100"/> label="报修单号"
<el-table-column label="故障描述" align="center" prop="orderDesc" width="200"/> align="center"
<el-table-column label="故障时间" align="center" prop="orderBreakdownTime" width="180"> prop="orderCode"
width="150"
/>
<el-table-column
label="设备编码"
align="center"
prop="equipmentCode"
width="100"
/>
<el-table-column
label="故障描述"
align="center"
prop="orderDesc"
width="200"
/>
<el-table-column
label="故障时间"
align="center"
prop="orderBreakdownTime"
width="180"
>
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ parseTime(scope.row.orderBreakdownTime) }}</span> <span>{{ parseTime(scope.row.orderBreakdownTime) }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="报修来源" align="center" prop="orderSource" /> <el-table-column label="报修来源" align="center" prop="orderSource" />
<el-table-column label="报修时间" align="center" prop="orderTime" width="180"> <el-table-column
label="报修时间"
align="center"
prop="orderTime"
width="180"
>
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ parseTime(scope.row.orderTime) }}</span> <span>{{ parseTime(scope.row.orderTime) }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="报修人" align="center" prop="orderRepairman" /> <el-table-column label="报修人" align="center" prop="orderRepairman" />
<el-table-column label="联系方式" align="center" prop="orderConnection" width="120"/> <el-table-column
label="联系方式"
align="center"
prop="orderConnection"
width="120"
/>
<el-table-column label="处理状态" align="center" prop="orderStatus" /> <el-table-column label="处理状态" align="center" prop="orderStatus" />
<el-table-column label="报修去向" align="center" prop="repairDestination" width="120"/> <el-table-column
label="报修去向"
align="center"
prop="repairDestination"
width="120"
/>
<el-table-column label="故障图片" align="center" prop="orderPicture" /> <el-table-column label="故障图片" align="center" prop="orderPicture" />
<el-table-column label="创建人" align="center" prop="createBy" /> <el-table-column label="创建人" align="center" prop="createBy" />
<el-table-column label="创建时间" align="center" prop="createTime" width="180"> <el-table-column
label="创建时间"
align="center"
prop="createTime"
width="180"
>
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ parseTime(scope.row.orderBreakdownTime) }}</span> <span>{{ parseTime(scope.row.orderBreakdownTime) }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="180"> <el-table-column
label="操作"
align="center"
class-name="small-padding fixed-width"
width="180"
>
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button
size="mini" size="mini"
@ -156,27 +233,30 @@
icon="el-icon-edit" icon="el-icon-edit"
@click="handleUpdate(scope.row)" @click="handleUpdate(scope.row)"
v-hasPermi="['device:faultReport:edit']" v-hasPermi="['device:faultReport:edit']"
>修改</el-button> >修改</el-button
>
<el-button <el-button
size="mini" size="mini"
type="text" type="text"
icon="el-icon-delete" icon="el-icon-delete"
@click="handleDelete(scope.row)" @click="handleDelete(scope.row)"
v-hasPermi="['device:faultReport:remove']" v-hasPermi="['device:faultReport:remove']"
>删除</el-button> >删除</el-button
>
<el-button <el-button
size="mini" size="mini"
type="text" type="text"
icon="el-icon-circle-check" icon="el-icon-circle-check"
@click="handleCheck(scope.row)" @click="handleCheck(scope.row)"
v-hasPermi="['device:faultReport:check']" v-hasPermi="['device:faultReport:check']"
>审核</el-button> >审核</el-button
>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<pagination <pagination
v-show="total>0" v-show="total > 0"
:total="total" :total="total"
:page.sync="queryParams.pageNum" :page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize" :limit.sync="queryParams.pageSize"
@ -184,25 +264,46 @@
/> />
<!-- 审核故障报修对话框 --> <!-- 审核故障报修对话框 -->
<el-dialog :title="title" :visible.sync="openCheck" width="1000px" append-to-body> <el-dialog
:title="title"
:visible.sync="openCheck"
width="1000px"
append-to-body
>
<el-form ref="form" :model="form" :rules="rules" label-width="100px"> <el-form ref="form" :model="form" :rules="rules" label-width="100px">
<el-row :gutter="10" class="mb8"> <el-row :gutter="10" class="mb8">
<el-col :span="8"> <el-col :span="8">
<el-form-item label="设备编码" prop="equipmentCode"> <el-form-item label="设备编码" prop="equipmentCode">
<el-input v-model="form.equipmentCode" disabled style="width:195px"> <el-input
v-model="form.equipmentCode"
disabled
style="width: 195px"
>
</el-input> </el-input>
<ItemSelect ref="itemSelect" @onSelected="onItemSelectedEquipment" > </ItemSelect> <ItemSelect
ref="itemSelect"
@onSelected="onItemSelectedEquipment"
>
</ItemSelect>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
<el-form-item label="设备名称" prop="equipmentName"> <el-form-item label="设备名称" prop="equipmentName">
<el-input v-model="form.equipmentName" disabled style="width:195px"> <el-input
v-model="form.equipmentName"
disabled
style="width: 195px"
>
</el-input> </el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
<el-form-item label="设备类型" prop="equipmentTypeName"> <el-form-item label="设备类型" prop="equipmentTypeName">
<el-input v-model="form.equipmentTypeName" disabled style="width:195px"> <el-input
v-model="form.equipmentTypeName"
disabled
style="width: 195px"
>
</el-input> </el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -211,20 +312,32 @@
<el-row :gutter="10" class="mb8"> <el-row :gutter="10" class="mb8">
<el-col :span="8"> <el-col :span="8">
<el-form-item label="规格型号" prop="equipmentSpec"> <el-form-item label="规格型号" prop="equipmentSpec">
<el-input v-model="form.equipmentSpec" disabled style="width:195px"> <el-input
v-model="form.equipmentSpec"
disabled
style="width: 195px"
>
</el-input> </el-input>
<ItemSelect ref="itemSelect" @onSelected="onItemSelectedEquipment" > </ItemSelect> <ItemSelect
ref="itemSelect"
@onSelected="onItemSelectedEquipment"
>
</ItemSelect>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
<el-form-item label="所在部门" prop="department"> <el-form-item label="所在部门" prop="department">
<el-input v-model="form.department" disabled style="width:195px"> <el-input v-model="form.department" disabled style="width: 195px">
</el-input> </el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
<el-form-item label="所在位置" prop="equipmentLocation"> <el-form-item label="所在位置" prop="equipmentLocation">
<el-input v-model="form.equipmentLocation" disabled style="width:195px"> <el-input
v-model="form.equipmentLocation"
disabled
style="width: 195px"
>
</el-input> </el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -239,14 +352,18 @@
type="datetime" type="datetime"
placeholder="选择日期时间" placeholder="选择日期时间"
disabled disabled
style="width:195px" style="width: 195px"
> >
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
<el-form-item label="报修来源" prop="orderSource"> <el-form-item label="报修来源" prop="orderSource">
<el-select v-model="form.orderSource" style="width:195px" disabled> <el-select
v-model="form.orderSource"
style="width: 195px"
disabled
>
<el-option <el-option
v-for="dict in dict.type.device_order_source" v-for="dict in dict.type.device_order_source"
:key="dict.value" :key="dict.value"
@ -263,8 +380,9 @@
v-model="form.orderTime" v-model="form.orderTime"
type="datetime" type="datetime"
disabled disabled
style="width:195px" style="width: 195px"
placeholder="报修时间"> placeholder="报修时间"
>
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -272,18 +390,34 @@
<el-row :gutter="10" class="mb8"> <el-row :gutter="10" class="mb8">
<el-col :span="8"> <el-col :span="8">
<el-form-item label="报修人" prop="orderRepairman"> <el-form-item label="报修人" prop="orderRepairman">
<el-input v-model="form.orderRepairman" placeholder="请输入报修人" disabled style="width:195px"/> <el-input
v-model="form.orderRepairman"
placeholder="请输入报修人"
disabled
style="width: 195px"
/>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
<el-form-item label="联系方式" prop="orderConnection"> <el-form-item label="联系方式" prop="orderConnection">
<el-input v-model="form.orderConnection" placeholder="请输入联系方式" disabled style="width:195px"/> <el-input
v-model="form.orderConnection"
placeholder="请输入联系方式"
disabled
style="width: 195px"
/>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<el-row> <el-row>
<el-form-item label="故障描述" prop="orderDesc"> <el-form-item label="故障描述" prop="orderDesc">
<el-input v-model="form.orderDesc" placeholder="请输入故障描述" type="textarea" :autosize="{ minRows: 2, maxRows: 4}" disabled/> <el-input
v-model="form.orderDesc"
placeholder="请输入故障描述"
type="textarea"
:autosize="{ minRows: 2, maxRows: 4 }"
disabled
/>
</el-form-item> </el-form-item>
</el-row> </el-row>
<el-form-item label="故障图片" prop="orderPicture"> <el-form-item label="故障图片" prop="orderPicture">
@ -297,12 +431,13 @@
<el-radio label="计划性维修">计划性维修</el-radio> <el-radio label="计划性维修">计划性维修</el-radio>
<el-radio label="不维修">不维修</el-radio> <el-radio label="不维修">不维修</el-radio>
<el-radio label="委外维修">委外维修</el-radio> <el-radio label="委外维修">委外维修</el-radio>
<el-radio label="立即维修" @click="timeBackFilling"></el-radio> <el-radio label="立即维修" @click="timeBackFilling"
>立即维修</el-radio
>
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<el-row>
<el-col :span="8" v-if="form.repairDestination == '计划性维修'"> <el-col :span="8" v-if="form.repairDestination == '计划性维修'">
<el-form-item prop="workTeam" label="维修组"> <el-form-item prop="workTeam" label="维修组">
<el-input v-model="form.workTeam" placeholder="请选择维修组" /> <el-input v-model="form.workTeam" placeholder="请选择维修组" />
@ -314,7 +449,8 @@
clearable clearable
v-model="form.workPlanTime" v-model="form.workPlanTime"
type="datetime" type="datetime"
placeholder="请选择计划维修时间"> placeholder="请选择计划维修时间"
>
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -324,14 +460,11 @@
clearable clearable
v-model="form.workPlanDownTime" v-model="form.workPlanDownTime"
type="datetime" type="datetime"
placeholder="请选择计划停机时间"> placeholder="请选择计划停机时间"
>
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row>
<el-row>
<el-col :span="8" v-if="form.repairDestination == '立即维修'"> <el-col :span="8" v-if="form.repairDestination == '立即维修'">
<el-form-item prop="workTeam" label="维修组"> <el-form-item prop="workTeam" label="维修组">
<el-input v-model="form.workTeam" placeholder="请选择维修组" /> <el-input v-model="form.workTeam" placeholder="请选择维修组" />
@ -343,7 +476,8 @@
clearable clearable
v-model="form.workPlanTime" v-model="form.workPlanTime"
type="datetime" type="datetime"
placeholder=""> placeholder=""
>
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -353,14 +487,11 @@
clearable clearable
v-model="form.workPlanDownTime" v-model="form.workPlanDownTime"
type="datetime" type="datetime"
placeholder=""> placeholder=""
>
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row>
<el-row>
<el-col :span="8" v-if="form.repairDestination == '委外维修'"> <el-col :span="8" v-if="form.repairDestination == '委外维修'">
<el-form-item prop="workTeam" label="委外单位"> <el-form-item prop="workTeam" label="委外单位">
<el-input v-model="form.workTeam" placeholder="请选填写委外单位" /> <el-input v-model="form.workTeam" placeholder="请选填写委外单位" />
@ -371,14 +502,16 @@
<el-input v-model="form.workTeam" placeholder="请选填写委外人员" /> <el-input v-model="form.workTeam" placeholder="请选填写委外人员" />
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row>
<el-row>
<el-col :span="24" v-if="form.repairDestination == '委外维修'"> <el-col :span="24" v-if="form.repairDestination == '委外维修'">
<el-form-item prop="workPlanDownTime" label="委外原因"> <el-form-item prop="workPlanDownTime" label="委外原因">
<el-input v-model="form.orderDesc" placeholder="请输入委外原因" type="textarea" :autosize="{ minRows: 2, maxRows: 4}"/> <el-input
v-model="form.orderDesc"
placeholder="请输入委外原因"
type="textarea"
:autosize="{ minRows: 2, maxRows: 4 }"
/>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row>
</el-form> </el-form>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitCheckForm"> </el-button> <el-button type="primary" @click="submitCheckForm"> </el-button>
@ -387,15 +520,31 @@
</el-dialog> </el-dialog>
<!-- 添加或修改故障报修对话框 --> <!-- 添加或修改故障报修对话框 -->
<el-dialog :title="title" :visible.sync="open" width="1000px" append-to-body> <el-dialog
:title="title"
:visible.sync="open"
width="1000px"
append-to-body
>
<el-form ref="form" :model="form" :rules="rules" label-width="100px"> <el-form ref="form" :model="form" :rules="rules" label-width="100px">
<el-row :gutter="10" class="mb8"> <el-row :gutter="10" class="mb8">
<el-col :span="8"> <el-col :span="8">
<el-form-item label="设备编码" prop="equipmentCode"> <el-form-item label="设备编码" prop="equipmentCode">
<el-input v-model="form.equipmentCode" placeholder="请选择辅助设备" > <el-input
<el-button slot="append" @click="handleSelectEquipment" icon="el-icon-search"></el-button> v-model="form.equipmentCode"
placeholder="请选择辅助设备"
>
<el-button
slot="append"
@click="handleSelectEquipment"
icon="el-icon-search"
></el-button>
</el-input> </el-input>
<ItemSelect ref="itemSelect" @onSelected="onItemSelectedEquipment" > </ItemSelect> <ItemSelect
ref="itemSelect"
@onSelected="onItemSelectedEquipment"
>
</ItemSelect>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
@ -403,13 +552,14 @@
<el-date-picker <el-date-picker
clearable clearable
v-model="form.orderBreakdownTime" v-model="form.orderBreakdownTime"
placeholder="选择日期时间"> placeholder="选择日期时间"
>
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
<el-form-item label="报修来源" prop="orderSource"> <el-form-item label="报修来源" prop="orderSource">
<el-select v-model="form.orderSource" style="width:195px"> <el-select v-model="form.orderSource" style="width: 195px">
<el-option <el-option
v-for="dict in dict.type.device_order_source" v-for="dict in dict.type.device_order_source"
:key="dict.value" :key="dict.value"
@ -428,24 +578,36 @@
v-model="form.orderTime" v-model="form.orderTime"
type="datetime" type="datetime"
value-format="yyyy-MM-dd HH:mm:ss" value-format="yyyy-MM-dd HH:mm:ss"
placeholder="报修时间"> placeholder="报修时间"
>
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
<el-form-item label="报修人" prop="orderRepairman"> <el-form-item label="报修人" prop="orderRepairman">
<el-input v-model="form.orderRepairman" placeholder="请输入报修人" /> <el-input
v-model="form.orderRepairman"
placeholder="请输入报修人"
/>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
<el-form-item label="联系方式" prop="orderConnection"> <el-form-item label="联系方式" prop="orderConnection">
<el-input v-model="form.orderConnection" placeholder="请输入联系方式" /> <el-input
v-model="form.orderConnection"
placeholder="请输入联系方式"
/>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<el-row> <el-row>
<el-form-item label="故障描述" prop="orderDesc"> <el-form-item label="故障描述" prop="orderDesc">
<el-input v-model="form.orderDesc" placeholder="请输入故障描述" type="textarea" :autosize="{ minRows: 2, maxRows: 4}"/> <el-input
v-model="form.orderDesc"
placeholder="请输入故障描述"
type="textarea"
:autosize="{ minRows: 2, maxRows: 4 }"
/>
</el-form-item> </el-form-item>
</el-row> </el-row>
<el-form-item label="故障图片" prop="orderPicture"> <el-form-item label="故障图片" prop="orderPicture">
@ -457,20 +619,27 @@
<el-button @click="cancel"> </el-button> <el-button @click="cancel"> </el-button>
</div> </div>
</el-dialog> </el-dialog>
</div> </div>
</template> </template>
<script> <script>
import { listFaultReport, getFaultReport, delFaultReport, addFaultReport, updateFaultReport,getEquipmentList,checkFaultReport } from "@/api/device/faultReport"; import {
listFaultReport,
getFaultReport,
delFaultReport,
addFaultReport,
updateFaultReport,
getEquipmentList,
checkFaultReport,
} from "@/api/device/faultReport";
import ItemSelect from "./single.vue"; import ItemSelect from "./single.vue";
export default { export default {
name: "FaultReport", name: "FaultReport",
components: {ItemSelect}, components: { ItemSelect },
dicts: ['device_order_source'], dicts: ["device_order_source"],
data() { data() {
return { return {
equipmentCodeOption:[], equipmentCodeOption: [],
// //
loading: true, loading: true,
// //
@ -512,90 +681,97 @@ export default {
attr3: null, attr3: null,
createBy: null, createBy: null,
orderBreakdownTimeArray: [], orderBreakdownTimeArray: [],
orderTimeArray: [] orderTimeArray: [],
}, },
// //
pickerOptions1: { pickerOptions1: {
shortcuts: [{ shortcuts: [
text: '最近一周', {
text: "最近一周",
onClick(picker) { onClick(picker) {
const end = new Date(); const end = new Date();
const start = new Date(); const start = new Date();
start.setTime(start.getTime() - 3600 * 1000 * 24 * 7); start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
picker.$emit('pick', [start, end]); picker.$emit("pick", [start, end]);
} },
}, { },
text: '最近一个月', {
text: "最近一个月",
onClick(picker) { onClick(picker) {
const end = new Date(); const end = new Date();
const start = new Date(); const start = new Date();
start.setTime(start.getTime() - 3600 * 1000 * 24 * 30); start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
picker.$emit('pick', [start, end]); picker.$emit("pick", [start, end]);
} },
}, { },
text: '最近三个月', {
text: "最近三个月",
onClick(picker) { onClick(picker) {
const end = new Date(); const end = new Date();
const start = new Date(); const start = new Date();
start.setTime(start.getTime() - 3600 * 1000 * 24 * 90); start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
picker.$emit('pick', [start, end]); picker.$emit("pick", [start, end]);
} },
}] },
],
}, },
pickerOptions2: { pickerOptions2: {
shortcuts: [{ shortcuts: [
text: '最近一周', {
text: "最近一周",
onClick(picker) { onClick(picker) {
const end = new Date(); const end = new Date();
const start = new Date(); const start = new Date();
start.setTime(start.getTime() - 3600 * 1000 * 24 * 7); start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
picker.$emit('pick', [start, end]); picker.$emit("pick", [start, end]);
} },
}, { },
text: '最近一个月', {
text: "最近一个月",
onClick(picker) { onClick(picker) {
const end = new Date(); const end = new Date();
const start = new Date(); const start = new Date();
start.setTime(start.getTime() - 3600 * 1000 * 24 * 30); start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
picker.$emit('pick', [start, end]); picker.$emit("pick", [start, end]);
} },
}, { },
text: '最近三个月', {
text: "最近三个月",
onClick(picker) { onClick(picker) {
const end = new Date(); const end = new Date();
const start = new Date(); const start = new Date();
start.setTime(start.getTime() - 3600 * 1000 * 24 * 90); start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
picker.$emit('pick', [start, end]); picker.$emit("pick", [start, end]);
} },
}] },
],
}, },
// //
form: {}, form: {},
// //
rules: { rules: {},
}
}; };
}, },
created() { created() {
this.getList(); this.getList();
}, },
methods: { methods: {
timeBackFilling(){ timeBackFilling() {
this.form.workPlanTime = new Date(); this.form.workPlanTime = new Date();
log("时间时间",new Date()); log("时间时间", new Date());
}, },
// //
handleSelectEquipment(){ handleSelectEquipment() {
this.$refs.itemSelect.showFlag = true; this.$refs.itemSelect.showFlag = true;
}, },
// //
onItemSelectedEquipment(obj){ onItemSelectedEquipment(obj) {
this.form.equipmentCode = obj; this.form.equipmentCode = obj;
}, },
/** 查询故障报修列表 */ /** 查询故障报修列表 */
getList() { getList() {
this.loading = true; this.loading = true;
listFaultReport(this.queryParams).then(response => { listFaultReport(this.queryParams).then((response) => {
this.faultReportList = response.rows; this.faultReportList = response.rows;
this.total = response.total; this.total = response.total;
this.loading = false; this.loading = false;
@ -633,7 +809,7 @@ export default {
createBy: null, createBy: null,
createTime: null, createTime: null,
updateBy: null, updateBy: null,
updateTime: null updateTime: null,
}; };
this.resetForm("form"); this.resetForm("form");
}, },
@ -649,9 +825,9 @@ export default {
}, },
// //
handleSelectionChange(selection) { handleSelectionChange(selection) {
this.ids = selection.map(item => item.orderId) this.ids = selection.map((item) => item.orderId);
this.single = selection.length!==1 this.single = selection.length !== 1;
this.multiple = !selection.length this.multiple = !selection.length;
}, },
/** 新增按钮操作 */ /** 新增按钮操作 */
handleAdd() { handleAdd() {
@ -663,8 +839,8 @@ export default {
/** 修改按钮操作 */ /** 修改按钮操作 */
handleUpdate(row) { handleUpdate(row) {
this.reset(); this.reset();
const orderId = row.orderId || this.ids const orderId = row.orderId || this.ids;
getFaultReport(orderId).then(response => { getFaultReport(orderId).then((response) => {
this.form = response.data; this.form = response.data;
this.open = true; this.open = true;
this.title = "修改故障报修"; this.title = "修改故障报修";
@ -673,8 +849,8 @@ export default {
/** 审核按钮操作 */ /** 审核按钮操作 */
handleCheck(row) { handleCheck(row) {
this.reset(); this.reset();
const orderId = row.orderId || this.ids const orderId = row.orderId || this.ids;
getFaultReport(orderId).then(response => { getFaultReport(orderId).then((response) => {
this.form = response.data; this.form = response.data;
this.openCheck = true; this.openCheck = true;
this.title = "审核故障报修"; this.title = "审核故障报修";
@ -682,16 +858,16 @@ export default {
}, },
/** 提交按钮 */ /** 提交按钮 */
submitForm() { submitForm() {
this.$refs["form"].validate(valid => { this.$refs["form"].validate((valid) => {
if (valid) { if (valid) {
if (this.form.orderId != null) { if (this.form.orderId != null) {
updateFaultReport(this.form).then(response => { updateFaultReport(this.form).then((response) => {
this.$modal.msgSuccess("修改成功"); this.$modal.msgSuccess("修改成功");
this.open = false; this.open = false;
this.getList(); this.getList();
}); });
} else { } else {
addFaultReport(this.form).then(response => { addFaultReport(this.form).then((response) => {
this.$modal.msgSuccess("新增成功"); this.$modal.msgSuccess("新增成功");
this.open = false; this.open = false;
this.getList(); this.getList();
@ -702,10 +878,10 @@ export default {
}, },
/** 审核提交按钮 */ /** 审核提交按钮 */
submitCheckForm() { submitCheckForm() {
this.$refs["form"].validate(valid => { this.$refs["form"].validate((valid) => {
if (valid) { if (valid) {
if (this.form.orderId != null) { if (this.form.orderId != null) {
checkFaultReport(this.form).then(response => { checkFaultReport(this.form).then((response) => {
this.$modal.msgSuccess("审核成功"); this.$modal.msgSuccess("审核成功");
this.openCheck = false; this.openCheck = false;
this.getList(); this.getList();
@ -717,19 +893,27 @@ export default {
/** 删除按钮操作 */ /** 删除按钮操作 */
handleDelete(row) { handleDelete(row) {
const orderIds = row.orderId || this.ids; const orderIds = row.orderId || this.ids;
this.$modal.confirm('是否确认删除故障报修编号为"' + orderIds + '"的数据项?').then(function() { this.$modal
.confirm('是否确认删除故障报修编号为"' + orderIds + '"的数据项?')
.then(function () {
return delFaultReport(orderIds); return delFaultReport(orderIds);
}).then(() => { })
.then(() => {
this.getList(); this.getList();
this.$modal.msgSuccess("删除成功"); this.$modal.msgSuccess("删除成功");
}).catch(() => {}); })
.catch(() => {});
}, },
/** 导出按钮操作 */ /** 导出按钮操作 */
handleExport() { handleExport() {
this.download('device/faultReport/export', { this.download(
...this.queryParams "device/faultReport/export",
}, `faultReport_${new Date().getTime()}.xlsx`) {
} ...this.queryParams,
} },
`faultReport_${new Date().getTime()}.xlsx`
);
},
},
}; };
</script> </script>

Loading…
Cancel
Save