设备-维修-1

master
A0010407 12 months ago
parent 0dc3252cdd
commit 6330eaf83d

@ -418,6 +418,7 @@ export default {
this.title = "修改设备班组维护";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate((valid) => {

@ -135,7 +135,6 @@ import {
getEquipmentList,
getEquipmentTypeList,
} from "@/api/device/faultReport";
import { treeselect } from "@/api/wms/equipment";
import { Message } from "element-ui";
export default {

@ -86,7 +86,6 @@
<script>
import { getEquipmentList,getEquipmentTypeList} from "@/api/device/faultReport";
import { treeselect } from "@/api/wms/equipment";
import { Message } from 'element-ui'
export default {
@ -122,6 +121,8 @@ export default {
itemTypeId: 0,
itemCodeGet: '',
itemCode : undefined,
equipmentCode : null,
equipmentName : null,
},
//
columns: [
@ -159,6 +160,8 @@ export default {
/** 查询设备编码列表*/
getList() {
this.loading = true;
this.queryParams.equipmentCode = this.queryParams.itemCode;
this.queryParams.equipmentName = this.queryParams.itemName;
getEquipmentList(this.queryParams).then(response => {
this.itemList = response.rows;
this.total = response.total;

@ -742,6 +742,53 @@
</div>
</el-dialog>
<!-- 委外申请查看页面 -->
<el-dialog
:title="title"
:visible.sync="openApplyView"
width="1000px"
append-to-body
>
<el-form ref="form" :model="form" :rules="rules" label-width="100px">
<el-descriptions :column="2" border>
<el-descriptions-item label="设备编号">{{
form.equipmentCode
}}</el-descriptions-item>
<el-descriptions-item label="设备名称">{{
form.equipmentName
}}</el-descriptions-item>
<el-descriptions-item label="设备类型">{{
form.equipmentTypeName
}}</el-descriptions-item>
<el-descriptions-item label="设备位置">{{
form.equipmentLocation
}}</el-descriptions-item>
<el-descriptions-item label="工作中心编码">{{
form.workshopCode
}}</el-descriptions-item>
<el-descriptions-item label="工作中心名称">{{
form.workshopName
}}</el-descriptions-item>
<el-descriptions-item label="委外单位">{{
form.workOutsourcingUnit
}}</el-descriptions-item>
<el-descriptions-item label="委外维修人员">{{
form.outSourcePerson
}}</el-descriptions-item>
<el-descriptions-item label="委外联系方式">{{
form.workConnection
}}</el-descriptions-item>
<el-descriptions-item label="委外原因">{{
form.outSourceReason
}}</el-descriptions-item>
</el-descriptions>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="cancelApplyViewForm"> </el-button>
</div>
</el-dialog>
<!-- 填写维修记录对话框 -->
<el-dialog
:title="title"
@ -749,7 +796,7 @@
width="1000px"
append-to-body
>
<el-form ref="form" :model="form" :rules="rules" label-width="90px">
<el-form ref="form" :model="form" :rules="rules" label-width="100px">
<el-tabs type="border-card">
<el-tab-pane label="维修基本信息">
<el-descriptions :column="2" border>
@ -822,23 +869,64 @@
:src="item"
></el-image
></el-descriptions-item>
</el-descriptions>
<el-descriptions :column="1" border>
<el-descriptions-item label="维修后故障图片">
<el-image
v-for="(item, index) in urlAfterLists"
:key="index"
:src="item"
></el-image
></el-descriptions-item>
</el-descriptions>
</el-tab-pane>
<el-tab-pane label="检查项信息">
<el-table :data="detailList" border style="width: 100%">
<el-table-column prop="itemName" label="检查项名称" width="150">
</el-table-column>
<el-table-column prop="standardName" label="标准名称" width="180">
<el-table-column prop="itemMethod" label="检查项方法" width="150">
</el-table-column>
<el-table-column prop="standardType" label="标准类型" width="100">
<el-table-column prop="standardName" label="标准名称" width="150">
</el-table-column>
<el-table-column prop="detailReach" label="是否达标" width="50">
<el-table-column
prop="detailReach"
label="维修前是否达标"
width="67"
>
<template slot-scope="scope">
{{ scope.row.detailReach == "1" ? "达标" : "不达标" }}
</template>
</el-table-column>
<el-table-column prop="actualValue" label="实际值" width="50">
<el-table-column
prop="repairReach"
label="维修后是否达标"
width="110"
>
<template scope="scope">
<el-radio-group v-model="scope.row.repairReach">
<el-radio label="1">达标</el-radio>
<el-radio label="0">不达标</el-radio>
</el-radio-group>
</template>
</el-table-column>
<el-table-column
prop="actualValue"
label="维修前实际值"
width="50"
>
</el-table-column>
<el-table-column
prop="repairValue"
label="维修后实际值"
width="100"
>
<template slot-scope="scope">
<el-input
size="small"
v-model="scope.row.repairValue"
v-if="scope.row.standardType == 'quantify'"
></el-input>
</template>
</el-table-column>
<el-table-column prop="detailUpLimit" label="上限" width="50">
</el-table-column>
@ -846,8 +934,6 @@
</el-table-column>
<el-table-column prop="detailUnit" label="单位" width="50">
</el-table-column>
<el-table-column prop="detailUnit" label="故障图片">
</el-table-column>
</el-table>
</el-tab-pane>
@ -876,7 +962,7 @@
<el-col :span="8">
<el-form-item label="维修状态" prop="workStatus">
<el-select
v-model="queryParams.workStatus"
v-model="form.workStatus"
placeholder="请选择维修状态"
style="width: 195px"
>
@ -922,7 +1008,7 @@
v-model="form.workEndTime"
type="datetime"
style="width: 195px"
@change="listening"
@change="listeningTime"
value-format="yyyy-MM-dd HH:mm:ss"
placeholder="请选择结束维修时间"
></el-date-picker>
@ -944,14 +1030,6 @@
</el-radio-group>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="停机时长" prop="orderBreakdownTime">
<el-input
v-model="form.orderBreakdownTime"
style="width: 195px"
/>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="10" class="mb8">
<el-col :span="24">
@ -966,6 +1044,13 @@
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<el-form-item label="故障图片" prop="afterRepairFile">
<FileUpload v-model="form.afterRepairFile" />
</el-form-item>
</el-col>
</el-row>
</el-tab-pane>
<el-tab-pane label="填写备件申领记录">
<!-- 使用备件领用记录 -->
@ -980,11 +1065,7 @@
</el-form>
<div slot="footer" class="dialog-footer">
<el-button
type="primary"
@click="submitWriteForm"
> </el-button
>
<el-button type="primary" @click="submitWriteForm"> </el-button>
<el-button @click="cancelWriteForm"> </el-button>
</div>
</el-dialog>
@ -1006,7 +1087,7 @@ import ItemSelect from "./selectSingleEquipment.vue";
import ItemSelectPerson from "./selectSinglePerson.vue";
import { Message } from "element-ui";
import ItemSelectSpareParts from "./selectSpareParts.vue";
import moment from 'moment';
import moment from "moment";
export default {
name: " RepairOrder",
@ -1014,6 +1095,10 @@ export default {
dicts: ["device_repair_status"],
data() {
return {
//
urlBeforeLists: [],
//
urlAfterLists: [],
//
teamOption: [],
optType: undefined,
@ -1039,6 +1124,8 @@ export default {
openUpdate: false,
//
openApply: false,
//
openApplyView: false,
//
openWrite: false,
//
@ -1128,7 +1215,21 @@ export default {
//
form: {},
//
rules: {},
rules: {
//
workOutsourcingUnit: [
{ required: true, message: "委外单位不能为空", trigger: "blur" },
],
outSourceReason: [
{ required: true, message: "委外原因不能为空", trigger: "blur" },
],
workConnection: [
{ required: true, message: "委外联系方式不能为空", trigger: "blur" },
],
outSourcePerson: [
{ required: true, message: "委外维修人员不能为空", trigger: "blur" },
],
},
};
},
created() {
@ -1137,7 +1238,7 @@ export default {
},
methods: {
// -
listening() {
listeningTime() {
if (this.form.workEndTime != null && this.form.workStartTime != null) {
var time1 = moment(this.form.workStartTime);
var time2 = moment(this.form.workEndTime);
@ -1145,9 +1246,45 @@ export default {
let { _data } = duration;
console.log("打印维修时间", _data);
//
this.form.workCostTime = _data.years + "年" + _data.months + "月" + _data.days + "日" + _data.hours + "小时" + _data.minutes + "分" + _data.seconds + "秒";
this.form.workCostTime =
_data.years +
"年" +
_data.months +
"月" +
_data.days +
"日" +
_data.hours +
"小时" +
_data.minutes +
"分" +
_data.seconds +
"秒";
}
},
// -
// listeningDownTime() {
// if (this.form.actualDownEndTime != null && this.form.actualDownStartTime != null) {
// var time1 = moment(this.form.actualDownStartTime);
// var time2 = moment(this.form.actualDownEndTime);
// let duration = moment.duration(time2.diff(time1));
// let { _data } = duration;
// console.log("", _data);
// //
// this.form.workCostTime =
// _data.years +
// "" +
// _data.months +
// "" +
// _data.days +
// "" +
// _data.hours +
// "" +
// _data.minutes +
// "" +
// _data.seconds +
// "";
// }
// },
/** 查询维修工单列表 */
getList() {
this.loading = true;
@ -1165,7 +1302,10 @@ export default {
this.teamOption = response.rows;
});
},
// -
cancelApplyViewForm() {
this.openApplyView = false;
},
// -
cancelAddForm() {
this.openAdd = false;
@ -1257,6 +1397,66 @@ export default {
const workId = row.workId || this.ids;
getRepairOrder(workId).then((response) => {
this.form = response.data;
//response.data.beforeRepairFiles
if (response.data.beforeRepairFiles != null) {
var beforeNewFiles = [];
response.data.beforeRepairFiles.forEach((item) => {
var beforeNewFile = {};
beforeNewFile.name = item.fileName;
beforeNewFile.url = item.fileAddress;
beforeNewFiles.push(beforeNewFile);
});
this.form.beforeRepairFiles = beforeNewFiles;
//
var urlBeforeLists = [];
beforeNewFiles.forEach((item) => {
urlBeforeLists.push(item.url);
});
this.urlBeforeLists = urlBeforeLists;
}
//response.data.afterRepairFiles
if (response.data.afterRepairFiles != null) {
var afterNewFiles = [];
response.data.afterRepairFiles.forEach((item) => {
var afterNewFile = {};
afterNewFile.name = item.fileName;
afterNewFile.url = item.fileAddress;
afterNewFiles.push(afterNewFile);
});
this.form.afterRepairFiles = afterNewFiles;
//
var urlAfterLists = [];
afterNewFiles.forEach((item) => {
urlAfterLists.push(item.url);
});
this.urlAfterLists = urlAfterLists;
}
this.detailList = response.data.detailList;
//
var standards = [];
this.detailList.forEach((item1) => {
//
item1.standardList.forEach((item) => {
var standard = {};
standard.id = item.id;
standard.itemName = item1.itemName;
standard.itemMethod = item1.itemMethod;
standard.standardName = item.standardName;
standard.detailUpLimit = item.detailUpLimit;
standard.detailDownLimit = item.detailDownLimit;
standard.detailUnit = item.detailUnit;
standard.detailReach = item.detailReach;
standard.actualValue = item.actualValue;
standard.standardType = item.standardType;
standards.push(standard);
});
});
this.detailList = standards;
this.openWrite = true;
this.title = "填写维修记录";
});
@ -1267,8 +1467,17 @@ export default {
const workId = row.workId || this.ids;
getRepairOrder(workId).then((response) => {
this.form = response.data;
console.log("打印委外信息", this.form.workOutsourcingUnit);
if (
this.form.workOutsourcingUnit == null ||
this.form.workOutsourcingUnit == ""
) {
this.openApply = true;
this.title = "委外申请";
} else {
this.openApplyView = true;
this.title = "查看委外申请";
}
});
},
/** 修改按钮操作 */
@ -1311,9 +1520,15 @@ export default {
},
/** 提交填写维修记录按钮 */
submitWriteForm() {
if (Array.isArray(this.form.afterRepairFile)) {
this.form.afterRepairFile = this.listToString(
this.form.afterRepairFile
);
}
this.$refs["form"].validate((valid) => {
if (valid) {
if (this.form.workId != null) {
this.form.standardList = this.detailList;
writeRepairOrder(this.form).then((response) => {
this.openWrite = false;
this.$modal.msgSuccess("填写维修记录成功!");
@ -1383,3 +1598,4 @@ export default {
}
</style>

@ -122,6 +122,8 @@ export default {
itemTypeId: 0,
itemCodeGet: '',
itemCode : undefined,
equipmentCode: null,
equipmentName: null,
},
//
columns: [
@ -159,6 +161,8 @@ export default {
/** 查询设备编码列表*/
getList() {
this.loading = true;
this.queryParams.equipmentCode = this.queryParams.itemCode;
this.queryParams.equipmentName = this.queryParams.itemName;
getEquipmentList(this.queryParams).then(response => {
this.itemList = response.rows;
this.total = response.total;

@ -89,6 +89,8 @@ export default {
itemName: undefined,
itemCodeGet: '',
itemCode : undefined,
nickName: null,
userName: null,
},
//
columns: [
@ -122,9 +124,11 @@ export default {
},
//
/** 查询设备编码列表*/
/** 查询人员列表*/
getList() {
this.loading = true;
this.queryParams.userName = this.queryParams.itemCode;
this.queryParams.nickName = this.queryParams.itemName;
getRepairPersonList(this.queryParams).then(response => {
this.itemList = response.rows;
this.total = response.total;

Loading…
Cancel
Save