报修+维修+委外

yangwl
A0010407 1 year ago
parent 6c7fa5fdc0
commit 916a954461

@ -17,7 +17,7 @@ export function getRepairOrder(workId) {
}); });
} }
// 新增维修工单 // 快速工单
export function addRepairOrder(data) { export function addRepairOrder(data) {
return request({ return request({
url: '/device/repairOrder', url: '/device/repairOrder',
@ -43,4 +43,13 @@ export function delRepairOrder(workId) {
}); });
} }
//申请委外
export function applyOutsource(data) {
return request({
url: '/device/repairOrder/apply',
method: 'post',
data: data
});
}

@ -159,7 +159,7 @@
label="报修单号" label="报修单号"
align="center" align="center"
prop="orderCode" prop="orderCode"
width="150" width="200"
/> />
<el-table-column <el-table-column
label="设备编码" label="设备编码"
@ -438,6 +438,7 @@
</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="请选择维修组" />
@ -455,7 +456,17 @@
</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 label="是否停机维修" prop="workDownMachine">
<el-radio-group v-model="form.workDownMachine">
<el-radio label="1"></el-radio>
<el-radio label="0"></el-radio>
</el-radio-group>
</el-form-item>
</el-col>
<el-col :span="8" v-if="form.repairDestination == '计划性维修' && form.workDownMachine == '1' ">
<el-form-item prop="workPlanDownTime" label="计划停机时间"> <el-form-item prop="workPlanDownTime" label="计划停机时间">
<el-date-picker <el-date-picker
clearable clearable
@ -467,6 +478,20 @@
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8" v-if="form.repairDestination == '计划性维修' && form.workDownMachine == '0' ">
<el-form-item prop="workPlanDownTime" label="计划停机时间">
<el-date-picker
clearable
v-model="form.workPlanDownTime"
type="datetime"
value-format="yyyy-MM-dd HH:mm:ss"
disabled
>
</el-date-picker>
</el-form-item>
</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="请选择维修组" />
@ -483,17 +508,41 @@
</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 label="是否停机维修" prop="workDownMachine">
<el-radio-group v-model="form.workDownMachine">
<el-radio label="1"></el-radio>
<el-radio label="0"></el-radio>
</el-radio-group>
</el-form-item>
</el-col>
<el-col :span="8" v-if="form.repairDestination == '立即维修' && form.workDownMachine == '1' ">
<el-form-item prop="workPlanDownTime" label="计划停机时间"> <el-form-item prop="workPlanDownTime" label="计划停机时间">
<el-date-picker <el-date-picker
clearable clearable
v-model="form.workPlanDownTime" v-model="form.workPlanDownTime"
type="datetime" type="datetime"
placeholder="" value-format="yyyy-MM-dd HH:mm:ss"
placeholder="请选择计划停机时间"
> >
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8" v-if="form.repairDestination == '立即维修' && form.workDownMachine == '0' ">
<el-form-item prop="workPlanDownTime" label="计划停机时间">
<el-date-picker
clearable
v-model="form.workPlanDownTime"
type="datetime"
disabled
>
</el-date-picker>
</el-form-item>
</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="workOutsourcingUnit" label="委外单位"> <el-form-item prop="workOutsourcingUnit" label="委外单位">
<el-input v-model="form.workOutsourcingUnit" placeholder="请填写委外单位" /> <el-input v-model="form.workOutsourcingUnit" placeholder="请填写委外单位" />
@ -509,6 +558,8 @@
<el-input v-model="form.workConnection" placeholder="请填写委外联系方式" /> <el-input v-model="form.workConnection" 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="outSourceReason" label="委外原因"> <el-form-item prop="outSourceReason" label="委外原因">
<el-input <el-input
@ -519,6 +570,7 @@
/> />
</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>
@ -526,6 +578,320 @@
</div> </div>
</el-dialog> </el-dialog>
<!-- 查看审核故障报修对话框 -->
<el-dialog
:title="title"
:visible.sync="viewCheck"
width="1000px"
append-to-body
>
<el-form ref="form" :model="form" :rules="rules" label-width="100px">
<el-row :gutter="10" class="mb8">
<el-col :span="8">
<el-form-item label="设备编码" prop="equipmentCode">
<el-input
v-model="form.equipmentCode"
disabled
style="width: 195px"
>
</el-input>
<ItemSelect
ref="itemSelect"
@onSelected="onItemSelectedEquipment"
>
</ItemSelect>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="设备名称" prop="equipmentName">
<el-input
v-model="form.equipmentName"
disabled
style="width: 195px"
>
</el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="设备类型" prop="equipmentTypeName">
<el-input
v-model="form.equipmentTypeName"
disabled
style="width: 195px"
>
</el-input>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="10" class="mb8">
<el-col :span="8">
<el-form-item label="规格型号" prop="equipmentSpec">
<el-input
v-model="form.equipmentSpec"
disabled
style="width: 195px"
>
</el-input>
<ItemSelect
ref="itemSelect"
@onSelected="onItemSelectedEquipment"
>
</ItemSelect>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="所在部门" prop="department">
<el-input v-model="form.department" disabled style="width: 195px">
</el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="所在位置" prop="equipmentLocation">
<el-input
v-model="form.equipmentLocation"
disabled
style="width: 195px"
>
</el-input>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="10" class="mb8">
<el-col :span="8">
<el-form-item label="故障时间" prop="orderBreakdownTime">
<el-date-picker
clearable
v-model="form.orderBreakdownTime"
type="datetime"
placeholder="选择日期时间"
disabled
style="width: 195px"
>
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="报修来源" prop="orderSource">
<el-select
v-model="form.orderSource"
style="width: 195px"
disabled
>
<el-option
v-for="dict in dict.type.device_order_source"
:key="dict.value"
:label="dict.label"
:value="dict.value"
></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="报修时间" prop="orderTime">
<el-date-picker
clearable
v-model="form.orderTime"
type="datetime"
disabled
style="width: 195px"
placeholder="报修时间"
>
</el-date-picker>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="10" class="mb8">
<el-col :span="8">
<el-form-item label="报修人" prop="orderRepairman">
<el-input
v-model="form.orderRepairman"
placeholder="请输入报修人"
disabled
style="width: 195px"
/>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="联系方式" prop="orderConnection">
<el-input
v-model="form.orderConnection"
placeholder="请输入联系方式"
disabled
style="width: 195px"
/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-form-item label="故障描述" prop="orderDesc">
<el-input
v-model="form.orderDesc"
placeholder="请输入故障描述"
type="textarea"
:autosize="{ minRows: 2, maxRows: 4 }"
disabled
/>
</el-form-item>
</el-row>
<el-form-item label="故障图片" prop="orderPicture">
<el-input v-model="form.orderPicture" placeholder="请输入故障图片" />
</el-form-item>
<el-divider>报修信息审核</el-divider>
<el-row>
<el-col :span="24">
<el-form-item label="报修去向" prop="repairDestination">
<el-radio-group v-model="form.repairDestination">
<el-radio label="计划性维修">计划性维修</el-radio>
<el-radio label="不维修">不维修</el-radio>
<el-radio label="委外维修">委外维修</el-radio>
<el-radio label="立即维修" @click="timeBackFilling"
>立即维修</el-radio
>
</el-radio-group>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="8" v-if="form.repairDestination == '计划性维修'">
<el-form-item prop="workTeam" label="维修组">
<el-input v-model="form.workTeam" disabled/>
</el-form-item>
</el-col>
<el-col :span="8" v-if="form.repairDestination == '计划性维修'">
<el-form-item prop="workPlanTime" label="计划维修时间">
<el-date-picker
clearable
v-model="form.workPlanTime"
type="datetime"
value-format="yyyy-MM-dd HH:mm:ss"
disabled
>
</el-date-picker>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="8" v-if="form.repairDestination == '计划性维修'">
<el-form-item label="是否停机维修" prop="workDownMachine">
<el-radio-group v-model="form.workDownMachine">
<el-radio label="1"></el-radio>
<el-radio label="0"></el-radio>
</el-radio-group>
</el-form-item>
</el-col>
<el-col :span="8" v-if="form.repairDestination == '计划性维修' && form.workDownMachine == '1' ">
<el-form-item prop="workPlanDownTime" label="计划停机时间">
<el-date-picker
clearable
v-model="form.workPlanDownTime"
type="datetime"
value-format="yyyy-MM-dd HH:mm:ss"
disabled
>
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="8" v-if="form.repairDestination == '计划性维修' && form.workDownMachine == '0' ">
<el-form-item prop="workPlanDownTime" label="计划停机时间">
<el-date-picker
clearable
v-model="form.workPlanDownTime"
type="datetime"
value-format="yyyy-MM-dd HH:mm:ss"
disabled
>
</el-date-picker>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="8" v-if="form.repairDestination == '立即维修'">
<el-form-item prop="workTeam" label="维修组">
<el-input v-model="form.workTeam" disabled />
</el-form-item>
</el-col>
<el-col :span="8" v-if="form.repairDestination == '立即维修'">
<el-form-item prop="workPlanTime" label="计划维修时间">
<el-date-picker
clearable
v-model="form.workPlanTime"
type="datetime"
disabled
>
</el-date-picker>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="8" v-if="form.repairDestination == '立即维修'">
<el-form-item label="是否停机维修" prop="workDownMachine">
<el-radio-group v-model="form.workDownMachine">
<el-radio label="1"></el-radio>
<el-radio label="0"></el-radio>
</el-radio-group>
</el-form-item>
</el-col>
<el-col :span="8" v-if="form.repairDestination == '立即维修' && form.workDownMachine == '1' ">
<el-form-item prop="workPlanDownTime" label="计划停机时间">
<el-date-picker
clearable
v-model="form.workPlanDownTime"
type="datetime"
value-format="yyyy-MM-dd HH:mm:ss"
disabled
>
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="8" v-if="form.repairDestination == '立即维修' && form.workDownMachine == '0' ">
<el-form-item prop="workPlanDownTime" label="计划停机时间">
<el-date-picker
clearable
v-model="form.workPlanDownTime"
type="datetime"
disabled
>
</el-date-picker>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="8" v-if="form.repairDestination == '委外维修'">
<el-form-item prop="workOutsourcingUnit" label="委外单位">
<el-input v-model="form.workOutsourcingUnit" disabled />
</el-form-item>
</el-col>
<el-col :span="8" v-if="form.repairDestination == '委外维修'">
<el-form-item prop="outSourcePerson" label="委外维修人员">
<el-input v-model="form.outSourcePerson" disabled />
</el-form-item>
</el-col>
<el-col :span="8" v-if="form.repairDestination == '委外维修'">
<el-form-item prop="workConnection" label="联系方式">
<el-input v-model="form.workConnection" disabled />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="24" v-if="form.repairDestination == '委外维修'">
<el-form-item prop="outSourceReason" label="委外原因">
<el-input
v-model="form.outSourceReason"
disabled
type="textarea"
:autosize="{ minRows: 2, maxRows: 4 }"
/>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="cancelCheckForm"> </el-button>
</div>
</el-dialog>
<!-- 添加或修改故障报修对话框 --> <!-- 添加或修改故障报修对话框 -->
<el-dialog <el-dialog
:title="title" :title="title"
@ -688,6 +1054,8 @@ export default {
open: false, open: false,
// //
openCheck: false, openCheck: false,
//
viewCheck:false,
// //
queryParams: { queryParams: {
pageNum: 1, pageNum: 1,
@ -820,8 +1188,7 @@ export default {
}, },
// //
cancelCheckForm() { cancelCheckForm() {
this.openCheck = false; this.viewCheck = false;
this.reset();
}, },
// //
reset() { reset() {
@ -889,7 +1256,10 @@ export default {
const orderId = row.orderId || this.ids; const orderId = row.orderId || this.ids;
getFaultReport(orderId).then((response) => { getFaultReport(orderId).then((response) => {
if(response.data.orderStatus == "审核通过" || response.data.orderStatus == "驳回"){ if(response.data.orderStatus == "审核通过" || response.data.orderStatus == "驳回"){
Message.warning("该报修记录已审核,请勿重复审核!"); Message.warning("该报修记录已审核!");
this.form = response.data;
this.viewCheck = true;
this.title = "查看审核故障报修";
}else{ }else{
this.form = response.data; this.form = response.data;
this.openCheck = true; this.openCheck = true;

@ -1,19 +1,49 @@
<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="98px"> <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="98px">
<el-form-item label="维修单号" prop="workCode">
<el-input
v-model="queryParams.workCode"
placeholder="请输入维修单号"
clearable
style="width:200px"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="报修单号" prop="orderCode"> <el-form-item label="报修单号" prop="orderCode">
<el-input <el-input
v-model="queryParams.orderCode" v-model="queryParams.orderCode"
placeholder="请输入报修单号" placeholder="请输入报修单号"
style="width:200px"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="设备编码" prop="equipmentCode">
<el-input
v-model="queryParams.equipmentCode"
placeholder="请输入设备编码"
clearable clearable
style="width:200px"
@keyup.enter.native="handleQuery" @keyup.enter.native="handleQuery"
/> />
</el-form-item> </el-form-item>
<el-form-item label="是否停机维修" prop="workDownMachine">
<el-select
v-model="queryParams.workDownMachine"
placeholder="请选择是否停机"
@change="$forceUpdate()"
clearable
style="width:200px"
@keyup.enter.native="handleQuery">
<el-option v-for="item in workDownMachineOption" :key="item.workDownMachine" :label="item.label" :value="item.workDownMachine"></el-option>
</el-select>
</el-form-item>
<el-form-item label="计划维修时间" prop="workPlanTime"> <el-form-item label="计划维修时间" prop="workPlanTime">
<el-date-picker clearable <el-date-picker clearable
v-model="queryParams.workPlanTime" v-model="queryParams.workPlanTime"
type="date" type="date"
value-format="yyyy-MM-dd" value-format="yyyy-MM-dd HH:mm:ss"
placeholder="请选择计划维修时间"> placeholder="请选择计划维修时间">
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
@ -21,7 +51,7 @@
<el-date-picker clearable <el-date-picker clearable
v-model="queryParams.workPlanDownTime" v-model="queryParams.workPlanDownTime"
type="date" type="date"
value-format="yyyy-MM-dd" value-format="yyyy-MM-dd HH:mm:ss"
placeholder="请选择计划停机时间"> placeholder="请选择计划停机时间">
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
@ -52,25 +82,7 @@
<el-option v-for="item in workOutsourceOption" :key="item.workOutsource" :label="item.label" :value="item.workOutsource"></el-option> <el-option v-for="item in workOutsourceOption" :key="item.workOutsource" :label="item.label" :value="item.workOutsource"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="是否停机维修" prop="workDownMachine">
<el-select
v-model="queryParams.workDownMachine"
placeholder="请选择是否停机"
@change="$forceUpdate()"
clearable
style="width:220px"
@keyup.enter.native="handleQuery">
<el-option v-for="item in workDownMachineOption" :key="item.workDownMachine" :label="item.label" :value="item.workDownMachine"></el-option>
</el-select>
</el-form-item>
<el-form-item label="设备编码" prop="equipmentCode">
<el-input
v-model="queryParams.equipmentCode"
placeholder="请输入设备编码"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="委外工单编码" prop="outWorkCode"> <el-form-item label="委外工单编码" prop="outWorkCode">
<el-input <el-input
v-model="queryParams.outWorkCode" v-model="queryParams.outWorkCode"
@ -79,15 +91,6 @@
@keyup.enter.native="handleQuery" @keyup.enter.native="handleQuery"
/> />
</el-form-item> </el-form-item>
<el-form-item label="工厂编码" prop="factoryCode">
<el-input
v-model="queryParams.factoryCode"
placeholder="请输入工厂编码"
clearable
style="width:220px"
@keyup.enter.native="handleQuery"
/>
</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 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-button icon="el-icon-refresh" size="mini" @click="resetQuery"></el-button>
@ -103,7 +106,7 @@
size="mini" size="mini"
@click="handleAdd" @click="handleAdd"
v-hasPermi="['device: repairOrder:add']" v-hasPermi="['device: repairOrder:add']"
>新增</el-button> >快速工单</el-button>
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
<el-button <el-button
@ -137,11 +140,23 @@
v-hasPermi="['device: repairOrder:export']" v-hasPermi="['device: repairOrder:export']"
>导出</el-button> >导出</el-button>
</el-col> </el-col>
<el-col :span="1.5">
<el-button
type="success"
:disabled="single"
plain
icon="el-icon-document-add"
size="mini"
@click="handleApply"
v-hasPermi="['device: repairOrder:apply']"
>委外申请</el-button>
</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=" repairOrderList" @selection-change="handleSelectionChange"> <el-table v-loading="loading" :data=" repairOrderList" @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="workCode" width="180"/>
<el-table-column label="报修单号" align="center" prop="orderCode" width="180"/> <el-table-column label="报修单号" align="center" prop="orderCode" width="180"/>
<el-table-column label="设备编码" align="center" prop="equipmentCode" /> <el-table-column label="设备编码" align="center" prop="equipmentCode" />
<el-table-column label="计划维修时间" align="center" prop="workPlanTime" width="180"> <el-table-column label="计划维修时间" align="center" prop="workPlanTime" width="180">
@ -163,7 +178,7 @@
<el-table-column label="维修组" align="center" prop="workTeam" /> <el-table-column label="维修组" align="center" prop="workTeam" />
<el-table-column label="是否委外" align="center" prop="workOutsource" > <el-table-column label="是否委外" align="center" prop="workOutsource" >
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.workOutsource == "1" ? "委外" : "不委外" }} {{ scope.row.workOutsource == "1" ? "委外" : "不委外" }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="委外工单编码" align="center" prop="outWorkCode" width="180"/> <el-table-column label="委外工单编码" align="center" prop="outWorkCode" width="180"/>
@ -204,104 +219,223 @@
@pagination="getList" @pagination="getList"
/> />
<!-- 添加或修改维修工单对话框 --> <!-- 快速维修工单对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body> <el-dialog :title="title" :visible.sync="openAdd" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px"> <el-form ref="form" :model="form" :rules="rules" label-width="120px">
<el-form-item label="报修主键" prop="orderId">
<el-input v-model="form.orderId" placeholder="请输入报修主键" />
</el-form-item>
<el-form-item label="报修单号" prop="orderCode"> <el-form-item label="报修单号" prop="orderCode">
<el-input v-model="form.orderCode" placeholder="请输入报修单号" /> <el-input v-model="form.orderCode" placeholder="请输入报修单号" style="width:250px"/>
</el-form-item> </el-form-item>
<el-form-item label="是否立即处理" prop="workHandle"> <el-form-item label="设备编码" prop="equipmentCode">
<el-input v-model="form.workHandle" placeholder="请输入是否立即处理" /> <el-input v-model="form.equipmentCode" placeholder="请输入设备编码" style="width:250px">
<el-button
slot="append"
@click="handleSelectEquipment"
icon="el-icon-search"
></el-button>
</el-input>
<ItemSelect
ref="itemSelect"
@onSelected="onItemSelectedEquipment"
>
</ItemSelect>
</el-form-item> </el-form-item>
<el-form-item label="计划维修时间" prop="workPlanTime"> <el-form-item label="计划维修时间" prop="workPlanTime">
<el-date-picker clearable <el-date-picker clearable
v-model="form.workPlanTime" v-model="form.workPlanTime"
type="date" type="datetime"
value-format="yyyy-MM-dd" value-format="yyyy-MM-dd HH:mm:ss"
style="width:250px"
placeholder="请选择计划维修时间"> placeholder="请选择计划维修时间">
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
<el-form-item label="计划停机时间" prop="workPlanDownTime"> <el-form-item label="计划停机时间" prop="workPlanDownTime">
<el-date-picker clearable <el-date-picker clearable
v-model="form.workPlanDownTime" v-model="form.workPlanDownTime"
type="date" type="datetime"
value-format="yyyy-MM-dd" style="width:250px"
value-format="yyyy-MM-dd HH:mm:ss"
placeholder="请选择计划停机时间"> placeholder="请选择计划停机时间">
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
<el-form-item label="关联计划" prop="orderRelevance"> <el-form-item label="维修人员" prop="workPerson" >
<el-input v-model="form.orderRelevance" placeholder="请输入关联计划" /> <el-input v-model="form.workPerson" placeholder="请输入维修人员" style="width:250px">
<el-button
slot="append"
@click="handleSelectPerson"
icon="el-icon-search"
></el-button>
</el-input>
<ItemSelectPerson
ref="itemSelectPerson"
@onSelected="onItemSelectedPerson"
>
</ItemSelectPerson>
</el-form-item>
<el-form-item label="维修组" prop="workTeam" style="width:250px">
<el-input v-model="form.workTeam" placeholder="请输入维修组" style="width:250px"/>
</el-form-item> </el-form-item>
<el-form-item label="维修人员" prop="workPerson"> </el-form>
<el-input v-model="form.workPerson" placeholder="请输入维修人员" /> <div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancelAddForm"> </el-button>
</div>
</el-dialog>
<!-- 修改维修工单对话框 -->
<el-dialog :title="title" :visible.sync="openUpdate" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
<el-form-item label="报修单号" prop="orderCode">
<el-input v-model="form.orderCode" placeholder="请输入报修单号" style="width:250px" disabled/>
</el-form-item> </el-form-item>
<el-form-item label="维修组" prop="workTeam"> <el-form-item label="设备编码" prop="equipmentCode">
<el-input v-model="form.workTeam" placeholder="请输入维修组" /> <el-input v-model="form.equipmentCode" placeholder="请输入设备编码" style="width:250px" disabled/>
</el-form-item> </el-form-item>
<el-form-item label="是否委外" prop="workOutsource"> <el-form-item label="计划维修时间" prop="workPlanTime">
<el-input v-model="form.workOutsource" placeholder="请输入是否委外" /> <el-date-picker clearable
v-model="form.workPlanTime"
type="datetime"
value-format="yyyy-MM-dd HH:mm:ss"
style="width:250px"
placeholder="请选择计划维修时间">
</el-date-picker>
</el-form-item> </el-form-item>
<el-form-item label="是否停机维修" prop="workDownMachine"> <el-form-item label="计划停机时间" prop="workPlanDownTime">
<el-input v-model="form.workDownMachine" placeholder="请输入是否停机维修" /> <el-date-picker clearable
v-model="form.workPlanDownTime"
type="datetime"
style="width:250px"
value-format="yyyy-MM-dd HH:mm:ss"
placeholder="请选择计划停机时间">
</el-date-picker>
</el-form-item> </el-form-item>
<el-form-item label="设备编码" prop="equipmentCode"> <el-form-item label="维修人员" prop="workPerson" >
<el-input v-model="form.equipmentCode" placeholder="请输入设备编码" /> <el-input v-model="form.workPerson" placeholder="请输入维修人员" style="width:250px"/>
</el-form-item> </el-form-item>
<el-form-item label="原因分析" prop="workReason"> <el-form-item label="维修组" prop="workTeam" style="width:250px">
<el-input v-model="form.workReason" placeholder="请输入原因分析" /> <el-input v-model="form.workTeam" placeholder="请输入维修组" style="width:250px"/>
</el-form-item> </el-form-item>
<el-form-item label="故障描述" prop="workFaultDesc"> </el-form>
<el-input v-model="form.workFaultDesc" placeholder="请输入故障描述" /> <div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancelUpdateForm"> </el-button>
</div>
</el-dialog>
<!-- 委外申请 -->
<el-dialog
:title="title"
:visible.sync="openApply"
width="1000px"
append-to-body
>
<el-form ref="form" :model="form" :rules="rules" label-width="100px">
<el-row :gutter="10" class="mb8">
<el-col :span="8">
<el-form-item label="设备编码" prop="equipmentCode" >
<el-input
v-model="form.equipmentCode"
style="width: 195px"
disabled
>
</el-input>
</el-form-item> </el-form-item>
<el-form-item label="维修用时" prop="workCostTime"> </el-col>
<el-date-picker clearable <el-col :span="8">
v-model="form.workCostTime" <el-form-item label="设备名称" prop="equipmentName" >
type="date" <el-input
value-format="yyyy-MM-dd" v-model="form.equipmentName"
placeholder="请选择维修用时"> style="width: 195px"
</el-date-picker> disabled
>
</el-input>
</el-form-item> </el-form-item>
<el-form-item label="维修费用" prop="workCost"> </el-col>
<el-input v-model="form.workCost" placeholder="请输入维修费用" /> <el-col :span="8">
<el-form-item label="设备类型" prop="equipmentTypeName" >
<el-input
v-model="form.equipmentTypeName"
style="width: 195px"
disabled
>
</el-input>
</el-form-item> </el-form-item>
<el-form-item label="委外工单id" prop="outWorkId"> </el-col>
<el-input v-model="form.outWorkId" placeholder="请输入委外工单id" /> </el-row>
<el-row :gutter="10" class="mb8">
<el-col :span="8">
<el-form-item label="规格型号" prop="equipmentSpec" >
<el-input
v-model="form.equipmentSpec"
style="width: 195px"
disabled
>
</el-input>
</el-form-item> </el-form-item>
<el-form-item label="委外工单编码" prop="outWorkCode"> </el-col>
<el-input v-model="form.outWorkCode" placeholder="请输入委外工单编码" /> <el-col :span="8">
<el-form-item label="所在部门" prop="department">
<el-input v-model="form.department" style="width: 195px" disabled>
</el-input>
</el-form-item> </el-form-item>
<el-form-item label="备用字段1" prop="attr1"> </el-col>
<el-input v-model="form.attr1" placeholder="请输入备用字段1" /> <el-col :span="8">
<el-form-item label="所在位置" prop="equipmentLocation">
<el-input
v-model="form.equipmentLocation"
style="width: 195px"
disabled
>
</el-input>
</el-form-item> </el-form-item>
<el-form-item label="备用字段2" prop="attr2"> </el-col>
<el-input v-model="form.attr2" placeholder="请输入备用字段2" /> </el-row>
<el-row>
<el-col :span="8">
<el-form-item prop="workOutsourcingUnit" label="委外单位">
<el-input v-model="form.workOutsourcingUnit" placeholder="请填写委外单位" style="width: 195px"/>
</el-form-item> </el-form-item>
<el-form-item label="备用字段3" prop="attr3"> </el-col>
<el-input v-model="form.attr3" placeholder="请输入备用字段3" /> <el-col :span="8">
<el-form-item prop="outSourcePerson" label="委外维修人员">
<el-input v-model="form.outSourcePerson" placeholder="请填写委外维修人员" style="width: 195px"/>
</el-form-item> </el-form-item>
<el-form-item label="删除标志" prop="delFlag"> </el-col>
<el-input v-model="form.delFlag" placeholder="请输入删除标志" /> <el-col :span="8">
<el-form-item prop="workConnection" label="联系方式">
<el-input v-model="form.workConnection" placeholder="请填写委外联系方式" style="width: 195px"/>
</el-form-item> </el-form-item>
<el-form-item label="工厂编码" prop="factoryCode"> </el-col>
<el-input v-model="form.factoryCode" placeholder="请输入工厂编码" /> </el-row>
<el-row>
<el-col :span="24">
<el-form-item prop="outSourceReason" label="委外原因">
<el-input
v-model="form.outSourceReason"
placeholder="请输入委外原因"
type="textarea"
:autosize="{ minRows: 2, maxRows: 4 }"
/>
</el-form-item> </el-form-item>
</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="submitForm"> </el-button> <el-button type="primary" @click="submitApplyForm"> </el-button>
<el-button @click="cancel"> </el-button> <el-button @click="cancelApplyForm"> </el-button>
</div> </div>
</el-dialog> </el-dialog>
</div> </div>
</template> </template>
<script> <script>
import { listRepairOrder, getRepairOrder, delRepairOrder, addRepairOrder, updateRepairOrder } from "@/api/device/repairOrder"; import { listRepairOrder, getRepairOrder, delRepairOrder, addRepairOrder, updateRepairOrder,applyOutsource } from "@/api/device/repairOrder";
import ItemSelect from "./selectSingleEquipment.vue";
import ItemSelectPerson from "./selectSinglePerson.vue";
import { Message } from 'element-ui'
export default { export default {
name: " repairOrder", name: " repairOrder",
components: { ItemSelect,ItemSelectPerson },
data() { data() {
return { return {
// //
@ -320,14 +454,19 @@ export default {
repairOrderList: [], repairOrderList: [],
// //
title: "", title: "",
// //
open: false, openAdd: false,
//
openUpdate: false,
//
openApply: false,
// //
queryParams: { queryParams: {
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
orderId: null, orderId: null,
orderCode: null, orderCode: null,
workCode: null,
workHandle: null, workHandle: null,
workPlanTime: null, workPlanTime: null,
workPlanDownTime: null, workPlanDownTime: null,
@ -350,7 +489,7 @@ export default {
}, },
workOutsourceOption: [{ workOutsourceOption: [{
workOutsource: "1", workOutsource: "1",
label: '委外' label: '委外'
}, { }, {
workOutsource: "0", workOutsource: "0",
label: '不委外' label: '不委外'
@ -382,9 +521,19 @@ export default {
this.loading = false; this.loading = false;
}); });
}, },
// //
cancel() { cancelAddForm() {
this.open = false; this.openAdd = false;
this.reset();
},
//
cancelUpdateForm() {
this.openUpdate = false;
this.reset();
},
//
cancelApplyForm() {
this.openApply = false;
this.reset(); this.reset();
}, },
// //
@ -439,8 +588,18 @@ export default {
/** 新增按钮操作 */ /** 新增按钮操作 */
handleAdd() { handleAdd() {
this.reset(); this.reset();
this.open = true; this.openAdd = true;
this.title = "添加维修工单"; this.title = "快速工单";
},
/** 委外申请按钮操作 */
handleApply(row) {
this.reset();
const workId = row.workId || this.ids
getRepairOrder(workId).then(response => {
this.form = response.data;
this.openApply = true;
this.title = "委外申请";
});
}, },
/** 修改按钮操作 */ /** 修改按钮操作 */
handleUpdate(row) { handleUpdate(row) {
@ -448,10 +607,20 @@ export default {
const workId = row.workId || this.ids const workId = row.workId || this.ids
getRepairOrder(workId).then(response => { getRepairOrder(workId).then(response => {
this.form = response.data; this.form = response.data;
this.open = true; this.openUpdate = true;
this.title = "修改维修工单"; this.title = "修改维修工单";
}); });
}, },
/** 提交委外申请 */
submitApplyForm() {
applyOutsource(this.form).then(response => {
this.$modal.msgSuccess("委外申请成功");
this.openApply = false;
this.getList();
});
},
/** 提交按钮 */ /** 提交按钮 */
submitForm() { submitForm() {
this.$refs["form"].validate(valid => { this.$refs["form"].validate(valid => {
@ -459,19 +628,35 @@ export default {
if (this.form.workId != null) { if (this.form.workId != null) {
updateRepairOrder(this.form).then(response => { updateRepairOrder(this.form).then(response => {
this.$modal.msgSuccess("修改成功"); this.$modal.msgSuccess("修改成功");
this.open = false; this.openUpdate = false;
this.getList(); this.getList();
}); });
} else { } else {
addRepairOrder(this.form).then(response => { addRepairOrder(this.form).then(response => {
this.$modal.msgSuccess("新增成功"); this.$modal.msgSuccess("新增成功");
this.open = false; this.openAdd = false;
this.getList(); this.getList();
}); });
} }
} }
}); });
}, },
//
handleSelectEquipment() {
this.$refs.itemSelect.showFlag = true;
},
//
handleSelectPerson() {
this.$refs.itemSelectPerson.showFlag = true;
},
//
onItemSelectedPerson(obj) {
this.form.workPerson = obj;
},
//
onItemSelectedEquipment(obj) {
this.form.equipmentCode = obj;
},
/** 删除按钮操作 */ /** 删除按钮操作 */
handleDelete(row) { handleDelete(row) {
const workIds = row.workId || this.ids; const workIds = row.workId || this.ids;

@ -0,0 +1,246 @@
<template>
<el-dialog title="设备选择"
v-if="showFlag"
:visible.sync="showFlag"
:modal= false
width="1100px"
center
:before-close="cancelEquipmentForm"
>
<el-row :gutter="20">
<!--分类数据-->
<el-col :span="5" :xs="24">
<el-card >
<span>请选择设备类型</span>
<div class="head-container" style="text-align: center">
<el-tree
:data="treeData1"
:props = "{id:'equipmentTypeCode',label:'equipmentTypeName'}"
node-key="id"
:expand-on-click-node="false"
:filter-node-method="filterNode"
ref="tree"
default-expand-all
@node-click="handleNodeClick"
/>
</div>
</el-card>
</el-col>
<!--设备数据-->
<el-col :span="19" :xs="24">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="设备编码" prop="itemCode">
<el-input
v-model="queryParams.itemCode"
placeholder="请输入设备编码"
clearable
style="width: 240px"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="设备名称" prop="itemName">
<el-input
v-model="queryParams.itemName"
placeholder="请输入设备名称"
clearable
style="width: 240px"
@keyup.enter.native="handleQuery"
/>
</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-table v-loading="loading" :data="itemList" @selection-change="handleEquipmentSelectionChange" ref="myTable">
<el-table-column width="50" align="center" type="selection">
<!-- <template v-slot="scope">
<el-radio v-model="selectedItemId" :label="scope.row.itemId" @change="handleRowChange(scope.row)">{{""}}</el-radio>
</template> -->
</el-table-column>
<!-- 序号 -->
<el-table-column type="index" width="90" align="center" :index="indexMethod" label="序号"></el-table-column>
<el-table-column label="设备编码" align="center" key="itemCode" prop="equipmentCode" v-if="columns[0].visible" >
</el-table-column>
<el-table-column label="设备类型编码" align="center" key="itemTypeCode" prop="equipmentTypeCode" v-if="columns[2].visible" >
</el-table-column>
<el-table-column label="设备名称" align="left" key="itemName" prop="equipmentName" v-if="columns[1].visible" :show-overflow-tooltip="true" />
</el-table>
<pagination
v-show="total > 0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
</el-col>
</el-row>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitEquipmentForm"> </el-button>
<el-button @click="cancelEquipmentForm"> </el-button>
</div>
</el-dialog>
</template>
<script>
import { getEquipmentList,getEquipmentTypeList} from "@/api/device/faultReport";
import { treeselect } from "@/api/wms/equipment";
import { Message } from 'element-ui'
export default {
name: "MdItemSingle",
// components: { Treeselect },
data() {
return {
treeData1:[],
showFlag:false,
//
selectedItemId: undefined,
selectedRows: undefined,
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total:0,
//
itemList: null,
//
itemTypeOptions: undefined,
//
equipmentTypeCode: undefined,
//
queryParams: {
pageNum: 1,
pageSize: 10,
itemName: undefined,
equipmentTypeCode: undefined,
itemTypeId: 0,
itemCodeGet: '',
itemCode : undefined,
},
//
columns: [
{ key: 0, label: `设备编码`, visible: true },
{ key: 1, label: `设备名称`, visible: true },
{ key: 2, label: `设备类型`, visible: true },
]
};
},
created() {
this.getList();
this.getEquipmentType();
},
methods: {
//
reset() {
this.form = {
itemId: null,
itemCode: this.processId,
itemType: null,
};
this.resetForm("form");
},
handleEquipmentSelectionChange (val) {
this.itemList = val
},
//
indexMethod(index){
return index+1 ;
},
/** 查询设备编码列表*/
getList() {
this.loading = true;
getEquipmentList(this.queryParams).then(response => {
this.itemList = response.rows;
this.total = response.total;
this.loading = false;
}
);
},
/** 查询分类下拉树结构 */
getEquipmentType() {
getEquipmentTypeList().then(response => {
console.log(response.rows);
this.treeData1 = response.rows;
console.log(this.treeData1);
});
},
//
filterNode(value, data) {
console.log(value, data);
if (!value) return true;
return data.label.indexOf(value) !== -1;
},
//
handleNodeClick(data) {
console.log('id',data.id);
this.queryParams.equipmentTypeCode = data.equipmentTypeCode;
console.log(this.equipmentTypeCode);
this.handleQuery();
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.queryParams.equipmentTypeCode = null;
this.resetForm("queryForm");
this.handleQuery();
},
//
handleEquipmentSelectionChange(selection) {
this.ids = selection.map(item => item.equipmentCode);
this.single = selection.length!==1;
this.multiple = !selection.length;
console.log("多选框",this.ids);
},
submitEquipmentForm() {
const data = this.ids;
if(data.length >1){
Message.warning("只能选择一个报修机器,请勿选择多个!");
}else{
const equipmentCode = data.toString();
if(this.queryParams.itemCodeGet == ""){
this.queryParams.itemCodeGet = equipmentCode;
}else{
this.queryParams.itemCodeGet = this.queryParams.itemCodeGet + ','+ equipmentCode;
}
this.selectedRows = this.queryParams.itemCodeGet;
this.$emit('onSelected', this.selectedRows);
this.queryParams.equipmentTypeCode = null;
this.getList();
console.log('111111',this.queryParams.equipmentTypeCode);
this.showFlag = false;
this.queryParams.itemCodeGet = "";
}
},
cancelEquipmentForm(){
this.queryParams.equipmentTypeCode = null;
this.getList();
console.log('111111',this.queryParams.equipmentTypeCode);
this.showFlag = false;
}
}
};
</script>

@ -0,0 +1,183 @@
<template>
<el-dialog title="人员选择"
v-if="showFlag"
:visible.sync="showFlag"
:modal= false
width="800px"
center
:before-close="cancelEquipmentForm"
>
<el-row :gutter="20">
<!--人员数据-->
<el-col :span="24">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="人员编码" prop="itemCode">
<el-input
v-model="queryParams.itemCode"
placeholder="请输入人员编码"
clearable
style="width: 150px"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="人员名称" prop="itemName">
<el-input
v-model="queryParams.itemName"
placeholder="请输入人员名称"
clearable
style="width: 150px"
@keyup.enter.native="handleQuery"
/>
</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-table v-loading="loading" :data="itemList" @selection-change="handleEquipmentSelectionChange" ref="myTable">
<el-table-column width="50" align="center" type="selection"></el-table-column>
<!-- 序号 -->
<el-table-column type="index" width="90" align="center" :index="indexMethod" label="序号"></el-table-column>
<el-table-column label="人员编码" align="center" key="itemCode" prop="userName" v-if="columns[0].visible" >
</el-table-column>
<el-table-column label="人员名称" align="left" key="itemName" prop="nickName" v-if="columns[1].visible" :show-overflow-tooltip="true" />
</el-table>
<pagination
v-show="total > 0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
</el-col>
</el-row>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitPersonForm"> </el-button>
<el-button @click="cancelEquipmentForm"> </el-button>
</div>
</el-dialog>
</template>
<script>
import { getPersonList} from "@/api/device/faultReport";
import { Message } from 'element-ui'
export default {
name: "MdItemSingle",
data() {
return {
treeData1:[],
showFlag:false,
//
selectedItemId: undefined,
selectedRows: undefined,
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total:0,
//
itemList: null,
//
queryParams: {
pageNum: 1,
pageSize: 10,
itemName: undefined,
itemCodeGet: '',
itemCode : undefined,
},
//
columns: [
{ key: 0, label: `人员编码`, visible: true },
{ key: 1, label: `人员名称`, visible: true },
]
};
},
created() {
this.getList();
},
methods: {
//
reset() {
this.form = {
itemId: null,
itemCode: this.processId,
itemType: null,
};
this.resetForm("form");
},
handleEquipmentSelectionChange (val) {
this.itemList = val;
},
//
indexMethod(index){
return index+1 ;
},
//
/** 查询设备编码列表*/
getList() {
this.loading = true;
getPersonList(this.queryParams).then(response => {
this.itemList = response.rows;
this.total = response.total;
this.loading = false;
}
);
},
//
handleNodeClick(data) {
console.log('id',data.id);
this.queryParams.equipmentTypeCode = data.equipmentTypeCode;
console.log(this.equipmentTypeCode);
this.handleQuery();
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.queryParams.equipmentTypeCode = null;
this.resetForm("queryForm");
this.handleQuery();
},
//
handleEquipmentSelectionChange(selection) {
this.ids = selection.map(item => item.nickName);
this.single = selection.length!==1;
this.multiple = !selection.length;
console.log("多选框",this.ids);
},
submitPersonForm() {
const data = this.ids;
const nickName = data.toString();
if(data.length >1){
Message.warning("只能选择一个维修人,请勿选择多个!");
}else{
if(this.queryParams.itemCodeGet == ""){
this.queryParams.itemCodeGet = nickName;
}
this.selectedRows = this.queryParams.itemCodeGet;
this.$emit('onSelected', this.selectedRows);
this.getList();
this.showFlag = false;
this.queryParams.itemCodeGet = "";
}
}
}
};
</script>
Loading…
Cancel
Save