add:设备统计分析管理:设备故障分析、维修记录
This commit is contained in:
@@ -0,0 +1,158 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
title="报修单"
|
||||
append-to-body
|
||||
:visible.sync="dialogVisible"
|
||||
destroy-on-close
|
||||
width="1400px"
|
||||
@close="close"
|
||||
@open="open"
|
||||
>
|
||||
<div class="head-container">
|
||||
<div v-if="crud.props.searchToggle">
|
||||
<el-form
|
||||
size="mini"
|
||||
:inline="true"
|
||||
class="demo-form-inline"
|
||||
label-position="right"
|
||||
label-width="80px"
|
||||
label-suffix=":"
|
||||
>
|
||||
<el-form-item label="日期">
|
||||
<date-range-picker v-model="query.createTime" class="date-item" />
|
||||
</el-form-item>
|
||||
|
||||
<rrOperation />
|
||||
</el-form>
|
||||
</div>
|
||||
<crudOperation :permission="permission">
|
||||
<el-button
|
||||
slot="right"
|
||||
class="filter-item"
|
||||
type="success"
|
||||
icon="el-icon-check"
|
||||
size="mini"
|
||||
@click="downdtl"
|
||||
>
|
||||
导出Excel
|
||||
</el-button>
|
||||
</crudOperation>
|
||||
<!--表格渲染-->
|
||||
<el-table
|
||||
ref="deviceTable"
|
||||
v-loading="crud.loading"
|
||||
:data="crud.data"
|
||||
style="width: 100%;"
|
||||
size="mini"
|
||||
@selection-change="crud.selectionChangeHandler"
|
||||
>
|
||||
<el-table-column show-overflow-tooltip prop="create_time" label="报修时间" width="140px" />
|
||||
<el-table-column show-overflow-tooltip prop="name" label="使用部门" width="140px" />
|
||||
<el-table-column show-overflow-tooltip prop="class_name" label="故障类型" width="140px" />
|
||||
<el-table-column show-overflow-tooltip prop="process_time" label="受理时间" width="140px" />
|
||||
<el-table-column show-overflow-tooltip prop="real_start_date" label="开始维修" width="140px" />
|
||||
<el-table-column show-overflow-tooltip prop="real_end_date" label="结束维修" width="140px" />
|
||||
<el-table-column show-overflow-tooltip prop="confirm_time" label="生产验收" width="140px" />
|
||||
<el-table-column show-overflow-tooltip prop="audit_time" label="维修确认" width="140px" />
|
||||
<el-table-column show-overflow-tooltip prop="product_person_name" label="生产配合人" width="140px" />
|
||||
<el-table-column show-overflow-tooltip prop="update_optname" label="维修人" width="140px" />
|
||||
</el-table>
|
||||
<!--分页组件-->
|
||||
<pagination />
|
||||
</div>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
import CRUD, { presenter, header, crud } from '@crud/crud'
|
||||
import rrOperation from '@crud/RR.operation'
|
||||
import crudOperation from '@crud/CRUD.operation'
|
||||
import udOperation from '@crud/UD.operation'
|
||||
import pagination from '@crud/Pagination'
|
||||
import crudDevicefaultcae from '@/views/wms/device_manage/stat/devicefaultcae/devicefaultcae'
|
||||
import DateRangePicker from '@/components/DateRangePicker'
|
||||
import { download } from '@/api/data'
|
||||
import { downloadFile } from '@/utils'
|
||||
|
||||
export default {
|
||||
name: 'ReceiveDialog',
|
||||
components: { crudOperation, pagination, rrOperation, udOperation, DateRangePicker },
|
||||
mixins: [presenter(), header(), crud()],
|
||||
cruds() {
|
||||
return CRUD({
|
||||
url: 'api/devicefaultcae/dtlQuery',
|
||||
idField: 'request_id',
|
||||
sort: 'request_id,desc',
|
||||
crudMethod: { ... crudDevicefaultcae },
|
||||
optShow: {
|
||||
add: false,
|
||||
edit: false,
|
||||
del: false,
|
||||
download: false,
|
||||
reset: false
|
||||
}
|
||||
})
|
||||
},
|
||||
props: {
|
||||
dialogShow: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
openParam: {
|
||||
type: String
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogVisible: false
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
dialogShow: {
|
||||
handler(newValue, oldValue) {
|
||||
this.dialogVisible = newValue
|
||||
this.crud.query.devicerecord_id = this.openParam
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
handleClose(done) {
|
||||
this.$confirm('确认关闭?')
|
||||
.then(_ => {
|
||||
done()
|
||||
})
|
||||
.catch(_ => {
|
||||
})
|
||||
},
|
||||
close() {
|
||||
this.$emit('update:dialogShow', false)
|
||||
},
|
||||
open() {
|
||||
this.crud.toQuery()
|
||||
},
|
||||
formatName(row, cloum) {
|
||||
if (row.outsourceaskfor_optid === '') {
|
||||
return '否'
|
||||
} else {
|
||||
return '是'
|
||||
}
|
||||
},
|
||||
downdtl() {
|
||||
if (this.currentRow !== null) {
|
||||
crud.downloadLoading = true
|
||||
download('/api/devicefaultcae/download', this.crud.query).then(result => {
|
||||
downloadFile(result, '报修明细', 'xlsx')
|
||||
crud.downloadLoading = false
|
||||
}).catch(() => {
|
||||
crud.downloadLoading = false
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
@@ -0,0 +1,34 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
export function add(data) {
|
||||
return request({
|
||||
url: 'api/devicefaultcae',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function del(ids) {
|
||||
return request({
|
||||
url: 'api/devicefaultcae/',
|
||||
method: 'delete',
|
||||
data: ids
|
||||
})
|
||||
}
|
||||
|
||||
export function edit(data) {
|
||||
return request({
|
||||
url: 'api/devicefaultcae',
|
||||
method: 'put',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function getFaultList() {
|
||||
return request({
|
||||
url: 'api/devicefaultcae/getFaultList',
|
||||
method: 'post'
|
||||
})
|
||||
}
|
||||
|
||||
export default { add, edit, del, getFaultList }
|
||||
339
mes/qd/src/views/wms/device_manage/stat/devicefaultcae/index.vue
Normal file
339
mes/qd/src/views/wms/device_manage/stat/devicefaultcae/index.vue
Normal file
@@ -0,0 +1,339 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<!--工具栏-->
|
||||
<div class="head-container">
|
||||
<div v-if="crud.props.searchToggle">
|
||||
<el-form
|
||||
size="mini"
|
||||
:inline="true"
|
||||
class="demo-form-inline"
|
||||
label-position="right"
|
||||
label-width="80px"
|
||||
label-suffix=":"
|
||||
>
|
||||
<el-form-item label="设备类别">
|
||||
<treeselect
|
||||
v-model="query.material_type_id"
|
||||
:load-options="loadClass"
|
||||
:options="classes"
|
||||
style="width: 200px;"
|
||||
placeholder="请选择"
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="设备故障">
|
||||
<el-select
|
||||
v-model="query.device_gz"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="请选择"
|
||||
class="filter-item"
|
||||
@change="hand"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in FaultList"
|
||||
:label="item.device_faultclass_name"
|
||||
:value="item.device_faultclass_id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="日期">
|
||||
<date-range-picker v-model="query.createTime" value-format="yyyy-MM-dd" class="date-item" />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="部门">
|
||||
<el-input
|
||||
v-model="query.dept_id"
|
||||
clearable
|
||||
placeholder="编码、名称"
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="设备">
|
||||
<el-input
|
||||
v-model="query.device_code"
|
||||
clearable
|
||||
placeholder="编码、名称"
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
<rrOperation />
|
||||
</el-form>
|
||||
|
||||
</div>
|
||||
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'-->
|
||||
<crudOperation :permission="permission"/>
|
||||
<!-- <div>
|
||||
<h5>MTBF=设备总运行时间/故障次数;MTTR=设备故障时间/故障次数</h5>
|
||||
</div>-->
|
||||
<!--表格渲染-->
|
||||
<el-table ref="table" v-loading="crud.loading" :data="crud.data" size="mini" style="width: 100%;" @selection-change="crud.selectionChangeHandler">
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column prop="dept_name" label="使用部门" min-width="150" show-overflow-tooltip />
|
||||
<el-table-column prop="class_name" label="设备类型" min-width="120" show-overflow-tooltip />
|
||||
<el-table-column prop="device_name" label="设备名称" min-width="120" show-overflow-tooltip />
|
||||
<el-table-column prop="device_code" label="设备编码" min-width="150" show-overflow-tooltip>
|
||||
<template slot-scope="scope">
|
||||
<el-link type="warning" @click="openDtl(scope.row)">{{ scope.row.device_code }}</el-link>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="extend_code" label="自编码" min-width="120" />
|
||||
<el-table-column prop="device_model" label="型号规格" min-width="120" />
|
||||
<el-table-column prop="nunm" label="故障次数" min-width="90" />
|
||||
<el-table-column prop="avgVal_time" label="平均故障间隔时间(小时)" :formatter="crud.formatNum2" min-width="160" />
|
||||
<el-table-column prop="avgRep_time" label="平均故障修复时间(小时)" :formatter="crud.formatNum2" min-width="160" />
|
||||
</el-table>
|
||||
<!--分页组件-->
|
||||
<pagination />
|
||||
</div>
|
||||
<DtlDialog :dialog-show.sync="dtlDialog" :open-param="openParam" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import crudDevicefaultcae from '@/views/wms/device_manage/stat/devicefaultcae/devicefaultcae'
|
||||
import CRUD, { presenter, header, form, crud } from '@crud/crud'
|
||||
import rrOperation from '@crud/RR.operation'
|
||||
import crudOperation from '@crud/CRUD.operation'
|
||||
import udOperation from '@crud/UD.operation'
|
||||
import pagination from '@crud/Pagination'
|
||||
import crudClassstandard from '@/api/wms/basedata/master/classstandard'
|
||||
import Treeselect, { LOAD_CHILDREN_OPTIONS } from '@riophae/vue-treeselect'
|
||||
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
|
||||
import crudMaterialbase from '@/api/wms/basedata/master/materialbase'
|
||||
import DateRangePicker from '@/components/DateRangePicker'
|
||||
import DtlDialog from '@/views/wms/device_manage/stat/devicefaultcae/DtlDialog'
|
||||
|
||||
const defaultForm = { }
|
||||
const start = new Date()
|
||||
export default {
|
||||
name: 'Devicefaultcae',
|
||||
components: { pagination, crudOperation, rrOperation, udOperation, Treeselect, DateRangePicker, DtlDialog },
|
||||
mixins: [presenter(), header(), form(defaultForm), crud()],
|
||||
cruds() {
|
||||
return CRUD({
|
||||
title: '设备故障分析',
|
||||
url: 'api/devicefaultcae',
|
||||
idField: 'stockrecord_id',
|
||||
sort: 'stockrecord_id,desc',
|
||||
crudMethod: { ...crudDevicefaultcae },
|
||||
optShow: {
|
||||
add: false,
|
||||
edit: false,
|
||||
del: false,
|
||||
download: false,
|
||||
reset: true
|
||||
},
|
||||
query: {
|
||||
createTime: [start.daysAgo(30), new Date()]
|
||||
}
|
||||
})
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
classes: [],
|
||||
classes2: [],
|
||||
class_idStr: null,
|
||||
class_idStr2: null,
|
||||
materOpt_code: '23',
|
||||
materOpt_code2: '24',
|
||||
FaultList: [],
|
||||
openParam: null,
|
||||
dtlDialog: false,
|
||||
permission: {
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
const param = {
|
||||
'materOpt_code': this.materOpt_code
|
||||
}
|
||||
crudMaterialbase.getMaterOptType(param).then(res => {
|
||||
this.class_idStr = res.class_idStr
|
||||
this.crud.query.class_idStr = this.class_idStr
|
||||
this.crud.toQuery()
|
||||
this.queryClassId()
|
||||
})
|
||||
// const param2 = {
|
||||
// 'materOpt_code': this.materOpt_code2
|
||||
// }
|
||||
// crudMaterialbase.getMaterOptType(param2).then(res => {
|
||||
// this.class_idStr2 = res.class_idStr
|
||||
// this.crud.query.class_idStr2 = this.class_idStr2
|
||||
// this.crud.toQuery()
|
||||
// this.queryClassId2()
|
||||
// })
|
||||
crudDevicefaultcae.getFaultList().then(res => {
|
||||
this.FaultList = res
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
// 钩子:在获取表格数据之前执行,false 则代表不获取数据
|
||||
[CRUD.HOOK.beforeRefresh]() {
|
||||
return true
|
||||
},
|
||||
hand(value) {
|
||||
this.crud.toQuery()
|
||||
},
|
||||
loadClass({ action, parentNode, callback }) {
|
||||
if (action === LOAD_CHILDREN_OPTIONS) {
|
||||
crudClassstandard.getClass({ pid: parentNode.id }).then(res => {
|
||||
parentNode.children = res.content.map(function(obj) {
|
||||
if (obj.hasChildren) {
|
||||
obj.children = null
|
||||
}
|
||||
return obj
|
||||
})
|
||||
setTimeout(() => {
|
||||
callback()
|
||||
}, 100)
|
||||
})
|
||||
}
|
||||
},
|
||||
queryClassId() {
|
||||
const param = {
|
||||
'class_idStr': this.class_idStr
|
||||
}
|
||||
crudClassstandard.queryClassById(param).then(res => {
|
||||
this.classes = res.content.map(obj => {
|
||||
if (obj.hasChildren) {
|
||||
obj.children = null
|
||||
}
|
||||
return obj
|
||||
})
|
||||
})
|
||||
},
|
||||
queryClassId2() {
|
||||
const param = {
|
||||
'class_idStr': this.class_idStr2
|
||||
}
|
||||
crudClassstandard.queryClassById(param).then(res => {
|
||||
this.classes2 = res.content.map(obj => {
|
||||
if (obj.hasChildren) {
|
||||
obj.children = null
|
||||
}
|
||||
return obj
|
||||
})
|
||||
})
|
||||
},
|
||||
openDtl(row) {
|
||||
this.openParam = row.devicerecord_id
|
||||
this.dtlDialog = true
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
::v-deep {
|
||||
|
||||
.vue-treeselect__menu {
|
||||
|
||||
overflow-x: auto !important;
|
||||
|
||||
width: 300px;
|
||||
|
||||
max-height: 300px !important;
|
||||
|
||||
}
|
||||
|
||||
.vue-treeselect__label {
|
||||
|
||||
overflow: unset;
|
||||
|
||||
text-overflow: unset;
|
||||
|
||||
}
|
||||
|
||||
.vue-treeselect__control {
|
||||
|
||||
height: 20px !important;
|
||||
|
||||
}
|
||||
|
||||
.vue-treeselect__multi-value-item-container,
|
||||
|
||||
.vue-treeselect--has-value .vue-treeselect__multi-value {
|
||||
|
||||
height: 30px;
|
||||
|
||||
line-height: 24px;
|
||||
|
||||
padding: 0;
|
||||
|
||||
}
|
||||
|
||||
.vue-treeselect__limit-tip,
|
||||
|
||||
.vue-treeselect--searchable.vue-treeselect--multi.vue-treeselect--has-value
|
||||
|
||||
.vue-treeselect__input-container {
|
||||
|
||||
padding-top: 0;
|
||||
|
||||
}
|
||||
|
||||
.vue-treeselect--has-value .vue-treeselect__multi-value {
|
||||
|
||||
// margin-bottom: 15px;
|
||||
|
||||
}
|
||||
|
||||
.vue-treeselect__placeholder,
|
||||
|
||||
.vue-treeselect__single-value {
|
||||
|
||||
height: 28px;
|
||||
|
||||
line-height: 32px;
|
||||
|
||||
font-size: small;
|
||||
|
||||
color: "#CCCFD6";
|
||||
|
||||
|
||||
}
|
||||
|
||||
.vue-treeselect--has-value .vue-treeselect__input {
|
||||
|
||||
height: 18px !important;
|
||||
|
||||
line-height: 18px !important;
|
||||
|
||||
}
|
||||
|
||||
.vue-treeselect div,
|
||||
|
||||
.vue-treeselect span {
|
||||
|
||||
box-sizing: content-box;
|
||||
|
||||
}
|
||||
|
||||
// 选中后的溢出隐藏
|
||||
|
||||
.vue-treeselect__multi-value-label {
|
||||
|
||||
display: block;
|
||||
|
||||
width: 140px;
|
||||
|
||||
overflow: hidden;
|
||||
|
||||
white-space: nowrap;
|
||||
|
||||
text-overflow: ellipsis;
|
||||
|
||||
}
|
||||
|
||||
.vue-treeselect__value-container {
|
||||
|
||||
display: block;
|
||||
|
||||
height: 32px;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,439 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<!--工具栏-->
|
||||
<div class="head-container">
|
||||
<div v-if="crud.props.searchToggle">
|
||||
<!-- 搜索 -->
|
||||
<el-form
|
||||
:inline="true"
|
||||
class="demo-form-inline"
|
||||
label-position="right"
|
||||
label-width="110px"
|
||||
label-suffix=":"
|
||||
>
|
||||
<el-form-item label="设备类别">
|
||||
<treeselect
|
||||
v-model="query.material_type_id"
|
||||
:load-options="loadClass"
|
||||
:options="classes"
|
||||
style="width: 200px;"
|
||||
placeholder="请选择"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="使用部门">
|
||||
<treeselect
|
||||
v-model="query.dept_id"
|
||||
:load-options="loadDepts"
|
||||
:normalizer="normalizer"
|
||||
:options="depts"
|
||||
style="width: 200px;"
|
||||
placeholder="请选择"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="单据号">
|
||||
<el-input
|
||||
v-model="query.repair_code"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="请输入编码、名称"
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="设备">
|
||||
<el-input
|
||||
v-model="query.device_code"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="请输入设备编码、名称"
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="维修单日期">
|
||||
<el-date-picker
|
||||
v-model="query.createTime"
|
||||
type="daterange"
|
||||
value-format="yyyy-MM-dd HH:mm:ss"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
:default-time="['00:00:00', '23:59:59']"
|
||||
@input="onInput()"
|
||||
@change="mytoQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="单据状态">
|
||||
<el-select
|
||||
v-model="query.invstatus"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="请选择"
|
||||
class="filter-item"
|
||||
@change="hand"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in dict.EM_DEVICE_WX_INVSTATUS"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<rrOperation />
|
||||
</el-form>
|
||||
</div>
|
||||
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'-->
|
||||
<crudOperation :permission="permission">
|
||||
<el-button
|
||||
slot="right"
|
||||
class="filter-item"
|
||||
type="success"
|
||||
icon="el-icon-check"
|
||||
size="mini"
|
||||
@click="downdtl"
|
||||
>
|
||||
导出
|
||||
</el-button>
|
||||
<!--<el-button
|
||||
slot="right"
|
||||
class="filter-item"
|
||||
type="warning"
|
||||
icon="el-icon-check"
|
||||
:disabled="crud.selections.length !== 1"
|
||||
size="mini"
|
||||
@click="printRepair"
|
||||
>
|
||||
打印
|
||||
</el-button>-->
|
||||
</crudOperation>
|
||||
<!--表格渲染-->
|
||||
<el-table ref="table" v-loading="crud.loading" :data="crud.data" size="mini" style="width: 100%;" @selection-change="crud.selectionChangeHandler">
|
||||
<el-table-column type="selection" min-width="35" />
|
||||
<el-table-column fixed="left" prop="repair_code" label="维修单号" min-width="140px" show-overflow-tooltip />
|
||||
<el-table-column prop="device_code" label="设备编码" min-width="100" show-overflow-tooltip />
|
||||
<el-table-column prop="device_name" label="设备名称" min-width="150" show-overflow-tooltip />
|
||||
<el-table-column prop="extend_code" label="设备自编码" min-width="100" show-overflow-tooltip />
|
||||
<el-table-column prop="use_name" label="使用部门" min-width="130" show-overflow-tooltip />
|
||||
<el-table-column prop="fault_level" label="故障等级" :formatter="formatLevelName" min-width="90" />
|
||||
<el-table-column prop="invstatus" label="单据状态" :formatter="formatStatusName" min-width="90" />
|
||||
<el-table-column prop="plan_start_date" label="计划维修日期" width="120" show-overflow-tooltip />
|
||||
<el-table-column prop="input_optname" label="创建人" min-width="90" />
|
||||
<el-table-column prop="input_time" label="创建时间" min-width="140" />
|
||||
<el-table-column prop="bx_name" label="报修人" min-width="90" show-overflow-tooltip />
|
||||
<el-table-column prop="bx_time" label="报修时间" min-width="140" />
|
||||
<el-table-column prop="update_optname" label="维修人" min-width="150" />
|
||||
<el-table-column prop="real_start_date" label="维修开始时间" min-width="140" />
|
||||
<el-table-column prop="real_end_date" label="维修结束时间" min-width="140" />
|
||||
<el-table-column prop="repair_time" label="维修用时(h)" min-width="120px" />
|
||||
<el-table-column prop="confirm_optname" label="维修确认人" min-width="90" />
|
||||
<el-table-column prop="confirm_time" label="维修确认时间" min-width="140" />
|
||||
<el-table-column prop="device_faultclass_name" label="故障类别" min-width="90" />
|
||||
<el-table-column prop="fault_comment" label="故障描述" min-width="150" show-overflow-tooltip />
|
||||
<el-table-column prop="fault_cause" label="故障原因" min-width="150" show-overflow-tooltip />
|
||||
<el-table-column prop="fault_analysis" label="问题分析" min-width="150" show-overflow-tooltip />
|
||||
<el-table-column prop="measure" label="处理措施" min-width="150" show-overflow-tooltip />
|
||||
<el-table-column prop="audit_optname" label="审核人" min-width="90" />
|
||||
<el-table-column prop="audit_time" label="审核时间" min-width="140" />
|
||||
<el-table-column prop="source_bill_code" label="源单号" min-width="120px" show-overflow-tooltip />
|
||||
<el-table-column prop="source_bill_type" label="源单业务类型" min-width="140" :formatter="fprmatTypeName" />
|
||||
</el-table>
|
||||
<!--分页组件-->
|
||||
<pagination />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import crudDevicerepairmst from '@/views/wms/device_manage/repair/devicerepair/devicerepairmst'
|
||||
import CRUD, { presenter, header, crud } from '@crud/crud'
|
||||
import rrOperation from '@crud/RR.operation'
|
||||
import crudOperation from '@crud/CRUD.operation'
|
||||
import udOperation from '@crud/UD.operation'
|
||||
import pagination from '@crud/Pagination'
|
||||
import DateRangePicker from '@/components/DateRangePicker'
|
||||
import crudClassstandard from '@/api/wms/basedata/master/classstandard'
|
||||
import Treeselect, { LOAD_CHILDREN_OPTIONS } from '@riophae/vue-treeselect'
|
||||
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
|
||||
import crudMaterialbase from '@/api/wms/basedata/master/materialbase'
|
||||
import crudDept from '@/views/system/dept/dept'
|
||||
import { download } from '@/api/data'
|
||||
import { downloadFile } from '@/utils'
|
||||
|
||||
export default {
|
||||
name: 'Devicerepairquery',
|
||||
dicts: ['EM_DEVICE_WX_INVTYPE', 'EM_DEVICE_WX_INVSTATUS', 'EM_FAULT_LEVEL'],
|
||||
components: { pagination, crudOperation, rrOperation, udOperation, DateRangePicker, Treeselect },
|
||||
mixins: [presenter(), header(), crud()],
|
||||
cruds() {
|
||||
return CRUD({
|
||||
title: '维修记录查询',
|
||||
url: 'api/devicerepairquery',
|
||||
idField: 'repair_id',
|
||||
sort: 'repair_id,desc',
|
||||
crudMethod: { ...crudDevicerepairmst },
|
||||
optShow: {
|
||||
add: false,
|
||||
edit: false,
|
||||
del: false,
|
||||
download: false,
|
||||
reset: true
|
||||
}
|
||||
})
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
openParam: null,
|
||||
showViewDialog: false,
|
||||
classes: [],
|
||||
depts: [],
|
||||
class_idStr: null,
|
||||
materOpt_code: '23',
|
||||
permission: {
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
const param = {
|
||||
'materOpt_code': this.materOpt_code
|
||||
}
|
||||
crudMaterialbase.getMaterOptType(param).then(res => {
|
||||
this.class_idStr = res.class_idStr
|
||||
this.crud.query.class_idStr = this.class_idStr
|
||||
this.crud.toQuery()
|
||||
this.queryClassId()
|
||||
})
|
||||
this.deptTree()
|
||||
},
|
||||
methods: {
|
||||
// 钩子:在获取表格数据之前执行,false 则代表不获取数据
|
||||
[CRUD.HOOK.beforeRefresh]() {
|
||||
return true
|
||||
},
|
||||
hand(value) {
|
||||
this.crud.toQuery()
|
||||
},
|
||||
loadClass({ action, parentNode, callback }) {
|
||||
if (action === LOAD_CHILDREN_OPTIONS) {
|
||||
crudClassstandard.getClass({ pid: parentNode.id }).then(res => {
|
||||
parentNode.children = res.content.map(function(obj) {
|
||||
if (obj.hasChildren) {
|
||||
obj.children = null
|
||||
}
|
||||
return obj
|
||||
})
|
||||
setTimeout(() => {
|
||||
callback()
|
||||
}, 100)
|
||||
})
|
||||
}
|
||||
},
|
||||
queryClassId() {
|
||||
const param = {
|
||||
'class_idStr': this.class_idStr
|
||||
}
|
||||
crudClassstandard.queryClassById(param).then(res => {
|
||||
this.classes = res.content.map(obj => {
|
||||
if (obj.hasChildren) {
|
||||
obj.children = null
|
||||
}
|
||||
return obj
|
||||
})
|
||||
})
|
||||
},
|
||||
// 获取弹窗内部门数据
|
||||
loadDepts({ action, parentNode, callback }) {
|
||||
if (action === LOAD_CHILDREN_OPTIONS) {
|
||||
crudDept.getDeptvo({ is_used: true, pid: parentNode.dept_id }).then(res => {
|
||||
parentNode.children = res.content.map(function(obj) {
|
||||
obj.children = null
|
||||
return obj
|
||||
})
|
||||
setTimeout(() => {
|
||||
callback()
|
||||
}, 100)
|
||||
})
|
||||
}
|
||||
},
|
||||
deptTree() {
|
||||
setTimeout(() => {
|
||||
crudDept.getDeptTree().then(res => {
|
||||
this.depts = res.content
|
||||
})
|
||||
}, 100)
|
||||
},
|
||||
normalizer(node) {
|
||||
return {
|
||||
id: node.dept_id,
|
||||
label: node.name,
|
||||
children: node.children
|
||||
}
|
||||
},
|
||||
showView(row) {
|
||||
const data = row
|
||||
crudDevicerepairmst.getDeviceInfo(data).then(res => {
|
||||
this.openParam = res
|
||||
this.showViewDialog = true
|
||||
})
|
||||
},
|
||||
formatStatusName(row, cloum) {
|
||||
return this.dict.label.EM_DEVICE_WX_INVSTATUS[row.invstatus]
|
||||
},
|
||||
formatTypeName(row, cloum) {
|
||||
return this.dict.label.EM_DEVICE_WX_INVTYPE[row.maintenancecycle]
|
||||
},
|
||||
formatLevelName(row, cloum) {
|
||||
return this.dict.label.EM_FAULT_LEVEL[row.fault_level]
|
||||
},
|
||||
fprmatTypeName(row, cloum) {
|
||||
if (row.source_bill_type === 'BXD') {
|
||||
return '报修单'
|
||||
} else {
|
||||
return '维修计划'
|
||||
}
|
||||
},
|
||||
onInput() {
|
||||
this.$forceUpdate()
|
||||
},
|
||||
mytoQuery(array1) {
|
||||
if (array1 === null) {
|
||||
this.crud.query.begin_time = ''
|
||||
this.crud.query.end_time = ''
|
||||
} else {
|
||||
this.crud.query.begin_time = array1[0]
|
||||
this.crud.query.end_time = array1[1]
|
||||
}
|
||||
this.crud.toQuery()
|
||||
},
|
||||
downdtl() {
|
||||
if (this.currentRow !== null) {
|
||||
crud.downloadLoading = true
|
||||
download('/api/devicerepairquery/download', this.crud.query).then(result => {
|
||||
downloadFile(result, '维修明细', 'xlsx')
|
||||
crud.downloadLoading = false
|
||||
}).catch(() => {
|
||||
crud.downloadLoading = false
|
||||
})
|
||||
}
|
||||
},
|
||||
printRepair() {
|
||||
const _selectData = this.$refs.table.selection
|
||||
const data = _selectData[0]
|
||||
download('api/devicerepairmst/createExcel', { 'repair_id': data.repair_id }).then(result => {
|
||||
const name = data.repair_code + '派工单'
|
||||
this.crud.toQuery()
|
||||
downloadFile(result, name, 'xlsx')
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
::v-deep {
|
||||
|
||||
.vue-treeselect__menu {
|
||||
|
||||
overflow-x: auto !important;
|
||||
|
||||
width: 300px;
|
||||
|
||||
max-height: 300px !important;
|
||||
|
||||
}
|
||||
|
||||
.vue-treeselect__label {
|
||||
|
||||
overflow: unset;
|
||||
|
||||
text-overflow: unset;
|
||||
|
||||
}
|
||||
|
||||
.vue-treeselect__control {
|
||||
|
||||
height: 20px !important;
|
||||
|
||||
}
|
||||
|
||||
.vue-treeselect__multi-value-item-container,
|
||||
|
||||
.vue-treeselect--has-value .vue-treeselect__multi-value {
|
||||
|
||||
height: 30px;
|
||||
|
||||
line-height: 24px;
|
||||
|
||||
padding: 0;
|
||||
|
||||
}
|
||||
|
||||
.vue-treeselect__limit-tip,
|
||||
|
||||
.vue-treeselect--searchable.vue-treeselect--multi.vue-treeselect--has-value
|
||||
|
||||
.vue-treeselect__input-container {
|
||||
|
||||
padding-top: 0;
|
||||
|
||||
}
|
||||
|
||||
.vue-treeselect--has-value .vue-treeselect__multi-value {
|
||||
|
||||
// margin-bottom: 15px;
|
||||
|
||||
}
|
||||
|
||||
.vue-treeselect__placeholder,
|
||||
|
||||
.vue-treeselect__single-value {
|
||||
|
||||
height: 28px;
|
||||
|
||||
line-height: 32px;
|
||||
|
||||
font-size: small;
|
||||
|
||||
color: "#CCCFD6";
|
||||
|
||||
|
||||
}
|
||||
|
||||
.vue-treeselect--has-value .vue-treeselect__input {
|
||||
|
||||
height: 18px !important;
|
||||
|
||||
line-height: 18px !important;
|
||||
|
||||
}
|
||||
|
||||
.vue-treeselect div,
|
||||
|
||||
.vue-treeselect span {
|
||||
|
||||
box-sizing: content-box;
|
||||
|
||||
}
|
||||
|
||||
// 选中后的溢出隐藏
|
||||
|
||||
.vue-treeselect__multi-value-label {
|
||||
|
||||
display: block;
|
||||
|
||||
width: 140px;
|
||||
|
||||
overflow: hidden;
|
||||
|
||||
white-space: nowrap;
|
||||
|
||||
text-overflow: ellipsis;
|
||||
|
||||
}
|
||||
|
||||
.vue-treeselect__value-container {
|
||||
|
||||
display: block;
|
||||
|
||||
height: 32px;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user