Merge remote-tracking branch 'origin/dev_ksck' into dev_ksck
commit
e673b2a932
@ -0,0 +1,212 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-card>
|
||||
<div slot="header" class="clearfix">
|
||||
<!-- <div class="fl">-->
|
||||
<!-- {{ `巡检记录表--${itemRow.itemName}[${itemRow.itemCode}]` }}-->
|
||||
<!-- </div>-->
|
||||
<div class="fr">
|
||||
<el-button @click="itemRow = null">取消</el-button>
|
||||
<el-button type="primary" @click="commitItemCheck">提交</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<el-form :model="itemRow" :rules="itemRules" ref="itemForm" label-width="auto">
|
||||
<el-descriptions border :column="2" label-style="width:100px">
|
||||
<el-descriptions-item label="所属部门">
|
||||
{{ itemRow.deptName }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="设备名称">
|
||||
{{ itemRow.productName }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="设备编码">
|
||||
{{ itemRow.deviceCode }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="规格型号">
|
||||
{{ itemRow.ggxh }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="巡检项目内容" :span="2">
|
||||
<el-table :data="itemList" v-loading="itemLoading" :border="false"
|
||||
:row-style="{height:'35px'}"
|
||||
:cell-style="{padding:'10px'}"
|
||||
:show-header="false"
|
||||
style="width: 100%;margin-top: 20px;margin-bottom: 20px">
|
||||
<el-table-column label="序号" width="50" type="index"/>
|
||||
<el-table-column label="项目编码" width="120" prop="itemCode"/>
|
||||
<el-table-column label="项目名称" width="140" prop="itemName"/>
|
||||
<el-table-column label="项目内容" width="220" prop="itemContent"/>
|
||||
<el-table-column label="完成情况" width="180" prop="finishFlag">
|
||||
<template slot-scope="scope">
|
||||
<div>
|
||||
<el-radio-group v-model="scope.row.normalFlag" size="mini">
|
||||
<el-radio :label="true" border>正常</el-radio>
|
||||
<el-radio :label="false" border style="margin-left: -15px">异常</el-radio>
|
||||
</el-radio-group>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
</el-descriptions-item>
|
||||
|
||||
<el-descriptions-item label="补充说明" :span="2">
|
||||
<el-form-item label=" " prop="suggestion" style="margin-bottom: 10px">
|
||||
<el-input type="textarea" resize="none" :autosize="{ minRows: 4, maxRows: 4 }" clearable
|
||||
show-word-limit
|
||||
maxlength="300" v-model.trim="itemRow.suggestion"/>
|
||||
</el-form-item>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="现场图片" :span="2" label-style="height:100px">
|
||||
<el-upload
|
||||
multiple
|
||||
:action="uploadFileUrl"
|
||||
:before-upload="handleBeforeUpload"
|
||||
:file-list="fileList"
|
||||
:limit="limit"
|
||||
:on-error="handleUploadError"
|
||||
:on-exceed="handleExceed"
|
||||
:on-success="handleUploadSuccess"
|
||||
:show-file-list="false"
|
||||
:headers="headers"
|
||||
class="upload-file-uploader"
|
||||
ref="fileUpload"
|
||||
>
|
||||
<!-- 上传按钮 -->
|
||||
<el-button size="mini" type="primary">选取文件</el-button>
|
||||
<!-- 上传提示 -->
|
||||
<div class="el-upload__tip" slot="tip" v-if="showTip">
|
||||
请上传
|
||||
<template v-if="fileSize"> 大小不超过 <b style="color: #f56c6c">{{ fileSize }}MB</b></template>
|
||||
<template v-if="fileType"> 格式为 <b style="color: #f56c6c">{{ fileType.join("/") }}</b></template>
|
||||
的文件
|
||||
</div>
|
||||
</el-upload>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="巡检结果" :span="2">
|
||||
<el-form-item label=" " prop="normalFlag" style="margin-bottom: 0px">
|
||||
<el-radio-group v-model="itemRow.normalFlag">
|
||||
<el-radio :label="true">正常</el-radio>
|
||||
<el-radio :label="false">异常</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
</el-form>
|
||||
</el-card>
|
||||
</div>
|
||||
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {getLoading} from "@/utils";
|
||||
import {deviceCheckDetailItemFinish, deviceCheckDetailItemPage} from "@/api/dev/deviceCheckDetailItemApi";
|
||||
import {deviceCheckDetailFinish} from "@/api/dev/deviceCheckDetailApi";
|
||||
|
||||
let itemQuery = {
|
||||
page: 1,
|
||||
limit: 10,
|
||||
taskId: null,
|
||||
deviceCode: null,
|
||||
}
|
||||
export default {
|
||||
name: "deptDeviceCheckDetail",
|
||||
computed: {
|
||||
iRowStyle: function ({row, rowIndex}) {
|
||||
return 'height:50px';
|
||||
},
|
||||
iHeaderRowStyle: function ({row, rowIndex}) {
|
||||
return 'height:50px';
|
||||
},
|
||||
iCellStyle: function ({row, column, rowIndex, columnIndex}) {
|
||||
return 'padding:0px'
|
||||
},
|
||||
},
|
||||
props: {
|
||||
originData: {
|
||||
type: Object,
|
||||
required: true
|
||||
},
|
||||
closeCheckDialog: {required: false, type: Function}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
itemRow: {},
|
||||
itemLoading: false,
|
||||
itemList: [],
|
||||
itemTotal: 0,
|
||||
itemQuery: {...itemQuery},
|
||||
itemRules: {
|
||||
normalFlag: [{required: true, message: "请选择异常情况", trigger: ["change", "blur"]}],
|
||||
suggestion: [{required: true, message: "巡检意见不能为空", trigger: ["change", "blur"]}],
|
||||
},
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
commitItemCheck() {
|
||||
this.$refs.itemForm.validate(b => {
|
||||
if (!b) {
|
||||
return
|
||||
}
|
||||
for (let item of this.itemList) {
|
||||
if (item.normalFlag == null) {
|
||||
this.$message.error(item.itemName + "未勾选,请检查后提交");
|
||||
return
|
||||
}
|
||||
}
|
||||
let load = getLoading(this)
|
||||
let itemParam = {
|
||||
taskId: this.itemRow.taskId,
|
||||
deviceCode: this.itemRow.deviceCode,
|
||||
suggestion: this.itemRow.suggestion,
|
||||
normalFlag: this.itemRow.normalFlag,
|
||||
detailItemEntities: this.itemList
|
||||
}
|
||||
deviceCheckDetailFinish(itemParam).then(res => {
|
||||
load.close()
|
||||
if (res.code != 20000) {
|
||||
this.$message.error(res.message)
|
||||
return
|
||||
}
|
||||
this.$message.success(res.message)
|
||||
this.closeCheckDialog();
|
||||
}).catch(() => {
|
||||
load.close()
|
||||
})
|
||||
})
|
||||
},
|
||||
|
||||
//获取巡检项目
|
||||
getDetailItemList() {
|
||||
this.itemLoading = true
|
||||
deviceCheckDetailItemPage(this.itemQuery).then(res => {
|
||||
this.itemLoading = false
|
||||
if (res.code != 20000) {
|
||||
this.$message.error(res.message)
|
||||
return
|
||||
}
|
||||
this.itemList = res.data.list || []
|
||||
this.itemTotal = res.data.total || 0
|
||||
}).catch(e => {
|
||||
this.itemLoading = false
|
||||
this.itemList = []
|
||||
this.itemTotal = 0
|
||||
})
|
||||
},
|
||||
|
||||
|
||||
},
|
||||
created() {
|
||||
this.itemRow = this.originData
|
||||
this.itemQuery = {...itemQuery, deviceCode: this.itemRow.deviceCode, taskId: this.itemRow.taskId}
|
||||
this.getDetailItemList()
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
/* 假设你想要更改表格的字体大小 */
|
||||
|
||||
.custom-table .el-table__row {
|
||||
height: 100px;
|
||||
}
|
||||
</style>
|
@ -1,220 +0,0 @@
|
||||
import {detailByUserPage, deviceLogs, devicePage} from "@/api/dev/deviceInfoApi";
|
||||
import {deviceChangeStatus, deviceChangeType, deviceStatus} from "@/utils/enum";
|
||||
import {
|
||||
deviceCheckPage,
|
||||
deviceCheckPageByDept,
|
||||
deviceCheckPrint,
|
||||
deviceCheckPrintByDeviceCode
|
||||
} from "@/api/dev/deviceCheckApi";
|
||||
import {deviceCheckDetailPage, deviceCheckDetailRepair} from "@/api/dev/deviceCheckDetailApi";
|
||||
import {deviceCheckDetailItemFinish, deviceCheckDetailItemPage} from "@/api/dev/deviceCheckDetailItemApi";
|
||||
import {copyProperties, getLoading} from "@/utils";
|
||||
|
||||
let query = {
|
||||
page: 1,
|
||||
limit: 10,
|
||||
chargeDeptCode: null,
|
||||
finishFlag: null,
|
||||
}
|
||||
|
||||
let detailQuery = {
|
||||
page: 1,
|
||||
limit: 10,
|
||||
taskId: null,
|
||||
deviceCode:null,
|
||||
}
|
||||
|
||||
let itemQuery = {
|
||||
page: 1,
|
||||
limit: 10,
|
||||
taskId: null,
|
||||
deviceCode: null,
|
||||
}
|
||||
let repairData = {
|
||||
taskId: null,
|
||||
deviceCode: null,
|
||||
description: null,
|
||||
diagnosisInfo: null,
|
||||
innerFlag: true,
|
||||
repairUserName: null,
|
||||
repairUserPhone: null,
|
||||
}
|
||||
|
||||
export default {
|
||||
name: "deptDeviceCheck",
|
||||
computed: {},
|
||||
data() {
|
||||
return {
|
||||
clickRow: null,
|
||||
showSearch: true,
|
||||
loading: false,
|
||||
total: .0,
|
||||
list: [],
|
||||
query: {...query},
|
||||
//设备详情=============================================
|
||||
detailLoading: false,
|
||||
detailQuery: {...detailQuery},
|
||||
detailList: [],
|
||||
detailTotal: 0,
|
||||
showLog: false,
|
||||
//===================================================
|
||||
itemDialogFlag: false,
|
||||
itemQuery: {...itemQuery},
|
||||
itemList: [],
|
||||
itemTotal: 0,
|
||||
itemLoading: false,
|
||||
checkPrintData: null,
|
||||
itemRow: null,
|
||||
itemRules: {
|
||||
normalFlag: [{required: true, message: "请选择异常情况", trigger: ["change", "blur"]}],
|
||||
suggestion: [{required: true, message: "巡检意见不能为空", trigger: ["change", "blur"]}],
|
||||
},
|
||||
repairRow: null,
|
||||
repairRules: {
|
||||
innerFlag: [{
|
||||
required: true,
|
||||
message: "请选择维修方式",
|
||||
trigger: ["change", "blur"]
|
||||
}],
|
||||
repairUserName: [{
|
||||
required: true,
|
||||
message: "维修人姓名不能为空",
|
||||
trigger: ["change", "blur"]
|
||||
}],
|
||||
repairUserPhone: [{
|
||||
required: true,
|
||||
message: "维修人电话不能为空",
|
||||
trigger: ["change", "blur"]
|
||||
}],
|
||||
description: [{required: true, message: "问题描述不能为空", trigger: ["change", "blur"]}],
|
||||
diagnosisInfo: [{required: true, message: "诊断信息不能为空", trigger: ["change", "blur"]}],
|
||||
},
|
||||
repairId:null,
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getList()
|
||||
},
|
||||
methods: {
|
||||
commitRepair(){
|
||||
this.$refs.repairForm.validate(b => {
|
||||
if (!b) {
|
||||
return
|
||||
}
|
||||
let load = getLoading(this)
|
||||
deviceCheckDetailRepair(this.repairRow).then(res => {
|
||||
load.close()
|
||||
if (res.code != 20000) {
|
||||
this.$message.error(res.message)
|
||||
return
|
||||
}
|
||||
this.$message.success(res.message)
|
||||
this.getDetailList()
|
||||
this.getList()
|
||||
this.repairRow = null
|
||||
}).catch(() => {
|
||||
load.close()
|
||||
})
|
||||
})
|
||||
},
|
||||
createRepair(row) {
|
||||
let data = copyProperties(row, {...repairData});
|
||||
this.repairRow = _.extend({}, row, data)
|
||||
},
|
||||
commitItemCheck() {
|
||||
this.$refs.itemForm.validate(b => {
|
||||
if (!b) {
|
||||
return
|
||||
}
|
||||
let load = getLoading(this)
|
||||
deviceCheckDetailItemFinish(this.itemRow).then(res => {
|
||||
load.close()
|
||||
if (res.code != 20000) {
|
||||
this.$message.error(res.message)
|
||||
return
|
||||
}
|
||||
this.$message.success(res.message)
|
||||
this.getDetailItemList()
|
||||
this.getDetailList()
|
||||
this.getList()
|
||||
this.itemRow = null
|
||||
}).catch(() => {
|
||||
load.close()
|
||||
})
|
||||
})
|
||||
},
|
||||
openItem(row) {
|
||||
this.itemQuery = {
|
||||
...itemQuery,
|
||||
taskId: row.taskId,
|
||||
deviceCode: row.deviceCode,
|
||||
title: `[${row.deviceCode}]--${row.productName}(${row.nameCode})`
|
||||
}
|
||||
this.itemDialogFlag = true
|
||||
this.getDetailItemList()
|
||||
},
|
||||
getDetailItemList() {
|
||||
this.itemLoading = true
|
||||
deviceCheckDetailItemPage(this.itemQuery).then(res => {
|
||||
this.itemLoading = false
|
||||
if (res.code != 20000) {
|
||||
this.$message.error(res.message)
|
||||
return
|
||||
}
|
||||
this.itemList = res.data.list || []
|
||||
this.itemTotal = res.data.total || 0
|
||||
}).catch(e => {
|
||||
this.itemLoading = false
|
||||
this.itemList = []
|
||||
this.itemTotal = 0
|
||||
})
|
||||
},
|
||||
rowClick(row) {
|
||||
if (this.clickRow && row.taskId == this.clickRow.taskId) {
|
||||
return false
|
||||
}
|
||||
this.clickRow = row
|
||||
this.detailQuery = {...detailQuery, taskId: row.taskId}
|
||||
this.getDetailList()
|
||||
},
|
||||
getDetailList() {
|
||||
this.detailLoading = true
|
||||
deviceCheckDetailPage(this.detailQuery).then(res => {
|
||||
this.detailLoading = false
|
||||
if (res.code != 20000) {
|
||||
this.$message.error(res.message)
|
||||
return
|
||||
}
|
||||
this.detailList = res.data.list || []
|
||||
this.detailTotal = res.data.total || 0
|
||||
}).catch(e => {
|
||||
this.detailLoading = false
|
||||
})
|
||||
},
|
||||
search() {
|
||||
this.query.page = 1
|
||||
this.getList()
|
||||
},
|
||||
onReset() {
|
||||
this.query = {...query}
|
||||
this.getList()
|
||||
},
|
||||
getList() {
|
||||
this.loading = true
|
||||
deviceCheckPageByDept(this.query).then(res => {
|
||||
this.loading = false
|
||||
if (res.code != 20000) {
|
||||
this.$message.error(res.message)
|
||||
return
|
||||
}
|
||||
this.list = res.data.list || []
|
||||
this.total = res.data.total || 0
|
||||
|
||||
}).catch(e => {
|
||||
this.list = []
|
||||
this.total = 0
|
||||
this.loading = false
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue