新增报修管理
This commit is contained in:
@@ -109,10 +109,18 @@ public class DevicerepairrequestServiceImpl implements DevicerepairrequestServic
|
|||||||
String nickName = SecurityUtils.getNickName();
|
String nickName = SecurityUtils.getNickName();
|
||||||
String now = DateUtil.now();
|
String now = DateUtil.now();
|
||||||
|
|
||||||
|
JwtUserDto currentUser = (JwtUserDto) SecurityUtils.getCurrentUser();
|
||||||
|
Long deptId = currentUser.getDeptId();
|
||||||
|
|
||||||
dto.setRequest_id(IdUtil.getSnowflake(1, 1).nextId());
|
dto.setRequest_id(IdUtil.getSnowflake(1, 1).nextId());
|
||||||
|
dto.setRequest_code(CodeUtil.getNewCode("BXD_CODE"));
|
||||||
|
dto.setFault_time(now);
|
||||||
|
dto.setStatus("01");
|
||||||
dto.setCreate_id(currentUserId);
|
dto.setCreate_id(currentUserId);
|
||||||
dto.setCreate_name(nickName);
|
dto.setCreate_name(nickName);
|
||||||
dto.setCreate_time(now);
|
dto.setCreate_time(now);
|
||||||
|
dto.setSyscompanyid(deptId);
|
||||||
|
dto.setSysdeptid(deptId);
|
||||||
|
|
||||||
WQLObject wo = WQLObject.getWQLObject("em_bi_devicerepairrequest");
|
WQLObject wo = WQLObject.getWQLObject("em_bi_devicerepairrequest");
|
||||||
JSONObject json = JSONObject.parseObject(JSON.toJSONString(dto));
|
JSONObject json = JSONObject.parseObject(JSON.toJSONString(dto));
|
||||||
@@ -125,11 +133,6 @@ public class DevicerepairrequestServiceImpl implements DevicerepairrequestServic
|
|||||||
DevicerepairrequestDto entity = this.findById(dto.getRequest_id());
|
DevicerepairrequestDto entity = this.findById(dto.getRequest_id());
|
||||||
if (entity == null) throw new BadRequestException("被删除或无权限,操作失败!");
|
if (entity == null) throw new BadRequestException("被删除或无权限,操作失败!");
|
||||||
|
|
||||||
Long currentUserId = SecurityUtils.getCurrentUserId();
|
|
||||||
String nickName = SecurityUtils.getNickName();
|
|
||||||
|
|
||||||
String now = DateUtil.now();
|
|
||||||
|
|
||||||
WQLObject wo = WQLObject.getWQLObject("em_bi_devicerepairrequest");
|
WQLObject wo = WQLObject.getWQLObject("em_bi_devicerepairrequest");
|
||||||
JSONObject json = JSONObject.parseObject(JSON.toJSONString(dto));
|
JSONObject json = JSONObject.parseObject(JSON.toJSONString(dto));
|
||||||
wo.update(json);
|
wo.update(json);
|
||||||
|
|||||||
@@ -138,7 +138,7 @@ export default {
|
|||||||
mixins: [presenter(), header(), form(defaultForm), crud()],
|
mixins: [presenter(), header(), form(defaultForm), crud()],
|
||||||
cruds() {
|
cruds() {
|
||||||
return CRUD({
|
return CRUD({
|
||||||
title: '设备报修',
|
title: '设备报修处理',
|
||||||
url: 'api/devicerepairrequest',
|
url: 'api/devicerepairrequest',
|
||||||
idField: 'request_id',
|
idField: 'request_id',
|
||||||
sort: 'request_id,desc',
|
sort: 'request_id,desc',
|
||||||
|
|||||||
236
mes/qd/src/views/wms/sb/repair/devicevprs/FaultDialog.vue
Normal file
236
mes/qd/src/views/wms/sb/repair/devicevprs/FaultDialog.vue
Normal file
@@ -0,0 +1,236 @@
|
|||||||
|
<template>
|
||||||
|
<el-dialog
|
||||||
|
title="故障类型"
|
||||||
|
append-to-body
|
||||||
|
:visible.sync="dialogVisible"
|
||||||
|
destroy-on-close
|
||||||
|
width="1000px"
|
||||||
|
@close="close"
|
||||||
|
>
|
||||||
|
<el-form
|
||||||
|
:inline="true"
|
||||||
|
class="demo-form-inline"
|
||||||
|
label-position="right"
|
||||||
|
label-width="80px"
|
||||||
|
label-suffix=":"
|
||||||
|
>
|
||||||
|
<el-form-item label="模糊搜索">
|
||||||
|
<el-input
|
||||||
|
v-model="query.device_faultclass_code"
|
||||||
|
clearable
|
||||||
|
size="mini"
|
||||||
|
placeholder="请输入编码或者名称"
|
||||||
|
@keyup.enter.native="crud.toQuery"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="设备类别">
|
||||||
|
<treeselect
|
||||||
|
v-model="query.material_type_id"
|
||||||
|
:load-options="loadClass"
|
||||||
|
:options="classes"
|
||||||
|
style="width: 200px;"
|
||||||
|
placeholder="请选择"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<rrOperation />
|
||||||
|
</el-form>
|
||||||
|
|
||||||
|
<!--表格渲染-->
|
||||||
|
<el-table
|
||||||
|
ref="table"
|
||||||
|
v-loading="crud.loading"
|
||||||
|
:data="crud.data"
|
||||||
|
style="width: 100%;"
|
||||||
|
size="mini"
|
||||||
|
border
|
||||||
|
:header-cell-style="{background:'#f5f7fa',color:'#606266'}"
|
||||||
|
@select="handleSelectionChange"
|
||||||
|
@select-all="onSelectAll"
|
||||||
|
@current-change="clickChange"
|
||||||
|
>
|
||||||
|
<el-table-column v-if="!isSingle" type="selection" width="55" />
|
||||||
|
<el-table-column v-if="isSingle" label="选择" width="55">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-radio v-model="tableRadio" :label="scope.row"><i /></el-radio>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
|
<!-- <el-table-column type="selection" width="55" />-->
|
||||||
|
<el-table-column v-if="false" prop="device_faultclass_id" label="设备故障分类标识" />
|
||||||
|
<el-table-column prop="class_name" label="设备类别" />
|
||||||
|
<el-table-column prop="device_faultclass_code" label="设备故障分类编码" />
|
||||||
|
<el-table-column prop="device_faultclass_name" label="设备故障分类名称" />
|
||||||
|
<el-table-column prop="solutions" label="解决措施" />
|
||||||
|
<el-table-column prop="remark" label="备注" />
|
||||||
|
</el-table>
|
||||||
|
<!--分页组件-->
|
||||||
|
<pagination />
|
||||||
|
<span slot="footer" class="dialog-footer">
|
||||||
|
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||||
|
<el-button type="primary" @click="submit">确 定</el-button>
|
||||||
|
</span>
|
||||||
|
</el-dialog>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
|
||||||
|
import CRUD, { header, presenter } from '@crud/crud'
|
||||||
|
import rrOperation from '@crud/RR.operation'
|
||||||
|
import pagination from '@crud/Pagination'
|
||||||
|
import crudDevicemaintenanceplanmst from '@/api/wms/sb/devicemaintenanceplanmst'
|
||||||
|
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 crudDevicebom from '@/api/wms/basedata/em/devicebom'
|
||||||
|
import crudClassstandard from '@/api/wms/basedata/master/classstandard'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'Device',
|
||||||
|
components: { rrOperation, pagination, Treeselect },
|
||||||
|
cruds() {
|
||||||
|
return CRUD({
|
||||||
|
title: '故障分类',
|
||||||
|
url: 'api/devicefaultclass',
|
||||||
|
crudMethod: { ...crudDevicemaintenanceplanmst }, optShow: {}})
|
||||||
|
},
|
||||||
|
mixins: [presenter(), header()],
|
||||||
|
props: {
|
||||||
|
dialogShow: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false
|
||||||
|
},
|
||||||
|
isSingle: {
|
||||||
|
type: Boolean,
|
||||||
|
default: true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
dialogVisible: false,
|
||||||
|
tableRadio: null,
|
||||||
|
checkrow: null,
|
||||||
|
classes: [],
|
||||||
|
class_idStr: null,
|
||||||
|
materOpt_code: '23',
|
||||||
|
materOpt_code_2: '26',
|
||||||
|
classBj_id: null,
|
||||||
|
rows: [],
|
||||||
|
XLList: []
|
||||||
|
}
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
dialogShow: {
|
||||||
|
handler(newValue) {
|
||||||
|
this.dialogVisible = newValue
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
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 data = {
|
||||||
|
'materOpt_code': this.materOpt_code_2
|
||||||
|
}
|
||||||
|
crudDevicebom.getBjId(data).then(res => {
|
||||||
|
this.classBj_id = res.class_idStr
|
||||||
|
})
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
clickChange(item) {
|
||||||
|
this.tableRadio = item
|
||||||
|
},
|
||||||
|
handleSelectionChange(val, row) {
|
||||||
|
if (this.isSingle) {
|
||||||
|
if (val.length > 1) {
|
||||||
|
this.$refs.table.clearSelection()
|
||||||
|
this.$refs.table.toggleRowSelection(val.pop())
|
||||||
|
} else {
|
||||||
|
this.checkrow = row
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onSelectAll() {
|
||||||
|
this.$refs.table.clearSelection()
|
||||||
|
},
|
||||||
|
close() {
|
||||||
|
this.crud.resetQuery(false)
|
||||||
|
this.$emit('update:dialogShow', false)
|
||||||
|
},
|
||||||
|
submit() {
|
||||||
|
// 处理单选
|
||||||
|
if (this.isSingle && this.tableRadio) {
|
||||||
|
this.$emit('update:dialogShow', false)
|
||||||
|
this.$emit('tableChanged', this.tableRadio)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
this.rows = this.$refs.table.selection
|
||||||
|
if (this.rows.length <= 0) {
|
||||||
|
this.$message('请先勾选设备')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
this.crud.resetQuery(false)
|
||||||
|
this.$emit('update:dialogShow', false)
|
||||||
|
this.$emit('tableChanged', this.rows)
|
||||||
|
},
|
||||||
|
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
|
||||||
|
})
|
||||||
|
})
|
||||||
|
},
|
||||||
|
getSubTypes(id) {
|
||||||
|
crudClassstandard.getClassSuperior2(id).then(res => {
|
||||||
|
const date = res.content
|
||||||
|
this.buildClass(date)
|
||||||
|
this.classes = date
|
||||||
|
})
|
||||||
|
},
|
||||||
|
buildClass(classes) {
|
||||||
|
classes.forEach(data => {
|
||||||
|
if (data.children) {
|
||||||
|
this.buildClass(data.children)
|
||||||
|
}
|
||||||
|
if (data.hasChildren && !data.children) {
|
||||||
|
data.children = null
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||||
|
::v-deep .el-dialog__body {
|
||||||
|
padding-top: 0px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
||||||
177
mes/qd/src/views/wms/sb/repair/devicevprs/PicDialog.vue
Normal file
177
mes/qd/src/views/wms/sb/repair/devicevprs/PicDialog.vue
Normal file
@@ -0,0 +1,177 @@
|
|||||||
|
<template>
|
||||||
|
<el-dialog
|
||||||
|
title="报修单图片"
|
||||||
|
append-to-body
|
||||||
|
:visible.sync="dialogVisible"
|
||||||
|
destroy-on-close
|
||||||
|
:show-close="true"
|
||||||
|
fullscreen
|
||||||
|
@close="close"
|
||||||
|
@open="open"
|
||||||
|
>
|
||||||
|
<div class="head-container">
|
||||||
|
<div v-if="crud.props.searchToggle">
|
||||||
|
<!-- 搜索 -->
|
||||||
|
<el-input v-model="query.request_code" disabled clearable size="mini" placeholder="报修单单号" style="width: 200px;" class="filter-item" @keyup.enter.native="crud.toQuery" />
|
||||||
|
<!-- <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']"
|
||||||
|
@change="crud.toQuery"
|
||||||
|
/>-->
|
||||||
|
<!-- <rrOperation />-->
|
||||||
|
</div>
|
||||||
|
<crudOperation :permission="permission" />
|
||||||
|
</div>
|
||||||
|
<!--表格渲染-->
|
||||||
|
<el-table ref="table" v-loading="crud.loading" :data="crud.data" style="width: 100%;" @selection-change="crud.selectionChangeHandler">
|
||||||
|
<el-table-column type="selection" width="55" />
|
||||||
|
<el-table-column prop="name" label="文件名(点击查看照片)" width="280">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-popover
|
||||||
|
:content="'file/' + scope.row.type + '/' + scope.row.real_name"
|
||||||
|
placement="top-start"
|
||||||
|
title="路径"
|
||||||
|
width="200"
|
||||||
|
trigger="hover"
|
||||||
|
>
|
||||||
|
<a
|
||||||
|
slot="reference"
|
||||||
|
:href="baseApi + '/file/' + scope.row.type + '/' + scope.row.real_name"
|
||||||
|
class="el-link--primary"
|
||||||
|
style="word-break:keep-all;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color: #1890ff;font-size: 13px;"
|
||||||
|
target="_blank"
|
||||||
|
>
|
||||||
|
{{ scope.row.name }}
|
||||||
|
</a>
|
||||||
|
</el-popover>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="path" label="预览图">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-image
|
||||||
|
:src=" baseApi + '/file/' + scope.row.type + '/' + scope.row.real_name"
|
||||||
|
:preview-src-list="[baseApi + '/file/' + scope.row.type + '/' + scope.row.real_name]"
|
||||||
|
fit="contain"
|
||||||
|
lazy
|
||||||
|
class="el-avatar"
|
||||||
|
>
|
||||||
|
<div slot="error">
|
||||||
|
<i class="el-icon-document" />
|
||||||
|
</div>
|
||||||
|
</el-image>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="suffix" label="文件类型" />
|
||||||
|
<el-table-column prop="type" label="类别" />
|
||||||
|
<el-table-column prop="size" label="大小" />
|
||||||
|
<el-table-column prop="source_bill_code" label="来源单号" />
|
||||||
|
<el-table-column prop="create_name" label="创建人" />
|
||||||
|
<el-table-column prop="create_time" label="创建日期" width="180"/>
|
||||||
|
</el-table>
|
||||||
|
<!--分页组件-->
|
||||||
|
<pagination />
|
||||||
|
</el-dialog>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { mapGetters } from 'vuex'
|
||||||
|
import crudFile from '@/api/tools/localStorage'
|
||||||
|
import CRUD, { presenter, header, form, crud } from '@crud/crud'
|
||||||
|
import rrOperation from '@crud/RR.operation'
|
||||||
|
import crudOperation from '@crud/CRUD.operation'
|
||||||
|
import pagination from '@crud/Pagination'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
components: { pagination, crudOperation, rrOperation },
|
||||||
|
cruds() {
|
||||||
|
return CRUD({ title: '文件',idField: 'storage_id', url: 'api/devicerepairrequest/localStorage', crudMethod: { ...crudFile },
|
||||||
|
optShow: {
|
||||||
|
add: false,
|
||||||
|
edit: false,
|
||||||
|
del: true,
|
||||||
|
download: false,
|
||||||
|
reset: true
|
||||||
|
},
|
||||||
|
query:{request_code:''}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
mixins: [presenter(), header(), crud()],
|
||||||
|
props: {
|
||||||
|
dialogShow: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
dialogVisible: false,
|
||||||
|
loading: false,
|
||||||
|
permission: {
|
||||||
|
edit: ['admin', 'storage:edit'],
|
||||||
|
del: ['admin', 'storage:del']
|
||||||
|
},
|
||||||
|
request_code: ''
|
||||||
|
}
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
...mapGetters([
|
||||||
|
'baseApi',
|
||||||
|
'fileUploadApi'
|
||||||
|
])
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
dialogShow: {
|
||||||
|
handler(newValue, oldValue) {
|
||||||
|
this.dialogVisible = newValue
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
open() {
|
||||||
|
this.crud.query.request_code = this.request_code
|
||||||
|
this.crud.toQuery()
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* 接受父组件传值
|
||||||
|
* @param msg
|
||||||
|
*/
|
||||||
|
setForm(msg) {
|
||||||
|
this.request_code = msg
|
||||||
|
},
|
||||||
|
close() {
|
||||||
|
this.crud.resetQuery(false)
|
||||||
|
this.$emit('update:dialogShow', false)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
.crud-opts2 {
|
||||||
|
padding: 0;
|
||||||
|
display: -webkit-flex;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.crud-opts2 .el-dialog__title2 {
|
||||||
|
line-height: 24px;
|
||||||
|
font-size:20px;
|
||||||
|
color:#303133;
|
||||||
|
}
|
||||||
|
|
||||||
|
.crud-opts2 .role-span {
|
||||||
|
padding: 10px 0px 10px 0px;
|
||||||
|
}
|
||||||
|
.crud-opts2 .crud-opts-form {
|
||||||
|
padding: 10px 0px 0px 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.input-with-select {
|
||||||
|
background-color: #fff;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
360
mes/qd/src/views/wms/sb/repair/devicevprs/index.vue
Normal file
360
mes/qd/src/views/wms/sb/repair/devicevprs/index.vue
Normal file
@@ -0,0 +1,360 @@
|
|||||||
|
<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="设备">
|
||||||
|
<el-input
|
||||||
|
v-model="query.device_code"
|
||||||
|
clearable
|
||||||
|
size="mini"
|
||||||
|
placeholder="请输入设备编码、名称"
|
||||||
|
@keyup.enter.native="crud.toQuery"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="报修单号">
|
||||||
|
<el-input
|
||||||
|
v-model="query.request_code"
|
||||||
|
clearable
|
||||||
|
size="mini"
|
||||||
|
placeholder="请输入编码、名称"
|
||||||
|
@keyup.enter.native="crud.toQuery"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="报修日期">
|
||||||
|
<date-range-picker v-model="query.createTime" class="date-item" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="状态">
|
||||||
|
<el-select
|
||||||
|
v-model="query.status"
|
||||||
|
clearable
|
||||||
|
size="mini"
|
||||||
|
placeholder="请选择"
|
||||||
|
class="filter-item"
|
||||||
|
@change="hand"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="item in statusList"
|
||||||
|
:label="item.label"
|
||||||
|
:value="item.value"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<rrOperation />
|
||||||
|
</el-form>
|
||||||
|
</div>
|
||||||
|
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'-->
|
||||||
|
<crudOperation :permission="permission" />
|
||||||
|
<el-dialog :close-on-click-modal="false" :before-close="crud.cancelCU" :visible.sync="crud.status.cu > 0" :title="crud.status.title" width="800px">
|
||||||
|
<el-form ref="form" :model="form" :rules="rules" size="mini" label-width="100px">
|
||||||
|
<el-row>
|
||||||
|
<el-col span="12">
|
||||||
|
<el-form-item label="报修单号:" prop="request_code">
|
||||||
|
<el-input v-model="form.request_code" style="width: 200px;" disabled placeholder="系统生成" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col span="12">
|
||||||
|
<el-form-item label="设备" prop="devicerecord_id">
|
||||||
|
<el-input v-model="form.device_code" :disabled="true" style="width: 200px;">
|
||||||
|
<el-button slot="append" icon="el-icon-plus" :disabled="crud.status.view > 0" @click="putDevice" />
|
||||||
|
</el-input>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
|
||||||
|
<el-row>
|
||||||
|
<el-col span="12">
|
||||||
|
<el-form-item label="故障类型" prop="device_faultclass_id">
|
||||||
|
<el-input v-model="form.device_faultclass_name" :disabled="true" style="width: 200px;">
|
||||||
|
<el-button slot="append" icon="el-icon-plus" :disabled="crud.status.view > 0" @click="putFault" />
|
||||||
|
</el-input>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col span="12">
|
||||||
|
<el-form-item label="故障描述:" prop="solutions">
|
||||||
|
<el-input v-model="form.fault_desc" style="width: 200px;" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
|
||||||
|
<el-row>
|
||||||
|
<el-col span="12">
|
||||||
|
<el-form-item label="故障等级:" prop="fault_level">
|
||||||
|
<el-select
|
||||||
|
v-model="form.fault_level"
|
||||||
|
size="mini"
|
||||||
|
style="width: 200px;"
|
||||||
|
placeholder="请选择"
|
||||||
|
:disabled="crud.status.view > 0"
|
||||||
|
class="filter-item"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="item in dict.EM_FAULT_LEVEL"
|
||||||
|
:label="item.label"
|
||||||
|
:value="item.value"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
|
||||||
|
<el-row>
|
||||||
|
<el-col span="24">
|
||||||
|
<el-form-item label="备注:" prop="remark">
|
||||||
|
<el-input v-model="form.remark" style="width: 650px;" rows="2" type="textarea" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</el-form>
|
||||||
|
<div slot="footer" class="dialog-footer">
|
||||||
|
<el-button type="text" @click="crud.cancelCU">取消</el-button>
|
||||||
|
<el-button :loading="crud.cu === 2" type="primary" @click="crud.submitCU">确认</el-button>
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
|
<!--表格渲染-->
|
||||||
|
<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 v-if="false" prop="request_id" label="报修标识" />
|
||||||
|
<el-table-column prop="request_code" width="120px" label="报修单号" show-overflow-tooltip />
|
||||||
|
<el-table-column prop="path" label="故障图片" width="80px">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-button type="primary" icon="el-icon-folder-opened" circle @click="Picconfirm(scope.$index, scope.row)" />
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="device_code" label="设备编码" show-overflow-tooltip />
|
||||||
|
<el-table-column prop="device_name" label="设备名称" show-overflow-tooltip />
|
||||||
|
<el-table-column prop="extend_code" label="设备自编码" width="90px" show-overflow-tooltip />
|
||||||
|
<el-table-column prop="device_faultclass_name" label="故障分类" />
|
||||||
|
<el-table-column prop="fault_level" label="故障等级" :formatter="formaLevelName" />
|
||||||
|
<el-table-column prop="status" label="状态" :formatter="formatStatusName"/>
|
||||||
|
<el-table-column prop="is_passed" label="是否通过" :formatter="formatPassedName"/>
|
||||||
|
<el-table-column prop="fault_desc" label="故障描述" show-overflow-tooltip width="120px" />
|
||||||
|
<el-table-column prop="remark" label="备注" show-overflow-tooltip width="120px" />
|
||||||
|
<el-table-column prop="fault_time" label="故障时间" width="150px" />
|
||||||
|
<el-table-column prop="create_name" label="创建人" />
|
||||||
|
<el-table-column prop="create_time" label="创建时间" width="150px" />
|
||||||
|
<el-table-column prop="process_name" label="处理人" />
|
||||||
|
<el-table-column prop="process_time" label="处理时间" width="150px" />
|
||||||
|
<el-table-column v-permission="[]" label="操作" width="120px" align="center" fixed="right">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<udOperation
|
||||||
|
:data="scope.row"
|
||||||
|
:permission="permission"
|
||||||
|
:disabled-edit="scope.row.status !== '01'"
|
||||||
|
:disabled-dle="scope.row.status !== '01'"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
<!--分页组件-->
|
||||||
|
<pagination />
|
||||||
|
</div>
|
||||||
|
<PicDialog ref="child" :dialog-show.sync="PicDialog" />
|
||||||
|
<DeviceDialog :dialog-show.sync="deviceDialog" :is-single="true" @tableChanged2="tableChanged2"/>
|
||||||
|
<FaultDialog :dialog-show.sync="faultDialog" :is-single="true" @tableChanged="tableChanged"/>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import crudDevicerepairrequest from '@/api/wms/sb/devicerepairrequest'
|
||||||
|
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 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 PicDialog from '@/views/wms/sb/repair/devicerepairrequest/PicDialog'
|
||||||
|
import DeviceDialog from '@/views/wms/sb/upkeep/devicemaintenanceplan/DeviceDialog'
|
||||||
|
import FaultDialog from '@/views/wms/sb/repair/devicevprs/FaultDialog'
|
||||||
|
|
||||||
|
const defaultForm = { device_faultclass_name: null, device_code: null, request_id: null, request_code: null, devicerecord_id: null, fault_time: null, device_faultclass_id: null, fault_desc: null, fault_level: null, remark: null, status: null, create_id: null, create_name: null, create_time: null, is_passed: null, process_id: null, process_name: null, process_time: null, finish_id: null, finish_name: null, finish_time: null, is_delete: null, sysdeptid: null, syscompanyid: null }
|
||||||
|
export default {
|
||||||
|
name: 'Devicevprs',
|
||||||
|
dicts: ['EM_FAULT_LEVEL'],
|
||||||
|
components: { pagination, crudOperation, rrOperation, udOperation, DateRangePicker, Treeselect, PicDialog, DeviceDialog, FaultDialog },
|
||||||
|
mixins: [presenter(), header(), form(defaultForm), crud()],
|
||||||
|
cruds() {
|
||||||
|
return CRUD({
|
||||||
|
title: '设备报修',
|
||||||
|
url: 'api/devicerepairrequest',
|
||||||
|
idField: 'request_id',
|
||||||
|
sort: 'request_id,desc',
|
||||||
|
crudMethod: { ...crudDevicerepairrequest },
|
||||||
|
optShow: {
|
||||||
|
add: true,
|
||||||
|
edit: false,
|
||||||
|
del: false,
|
||||||
|
download: false,
|
||||||
|
reset: true
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
deviceDialog: false,
|
||||||
|
faultDialog: false,
|
||||||
|
classes: [],
|
||||||
|
class_idStr: null,
|
||||||
|
materOpt_code: '23',
|
||||||
|
statusList: [
|
||||||
|
{ 'label': '生成', 'value': '01' },
|
||||||
|
{ 'label': '维修中', 'value': '02' },
|
||||||
|
{ 'label': '完毕', 'value': '03' }
|
||||||
|
],
|
||||||
|
PicDialog: false,
|
||||||
|
permission: {
|
||||||
|
},
|
||||||
|
rules: {
|
||||||
|
devicerecord_id: [
|
||||||
|
{ required: true, message: '设备不能为空', trigger: 'blur' }
|
||||||
|
],
|
||||||
|
device_faultclass_id: [
|
||||||
|
{ required: true, message: '故障类型不能为空', trigger: 'blur' }
|
||||||
|
],
|
||||||
|
fault_level: [
|
||||||
|
{ required: true, message: '故障等级不能为空', trigger: 'blur' }
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
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()
|
||||||
|
})
|
||||||
|
},
|
||||||
|
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
|
||||||
|
})
|
||||||
|
})
|
||||||
|
},
|
||||||
|
formaLevelName(row, cloum) {
|
||||||
|
if (row.fault_level === '01') {
|
||||||
|
return '一级'
|
||||||
|
} else if (row.fault_level === '02') {
|
||||||
|
return '二级'
|
||||||
|
} else if (row.fault_level === '03') {
|
||||||
|
return '三级'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
formatStatusName(row, cloum) {
|
||||||
|
if (row.status === '01') {
|
||||||
|
return '生成'
|
||||||
|
} else if (row.status === '02') {
|
||||||
|
return '维修中'
|
||||||
|
} else if (row.status === '99') {
|
||||||
|
return '完毕'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
formatPassedName(row, cloum) {
|
||||||
|
if (row.is_passed === '0') {
|
||||||
|
return '否'
|
||||||
|
} else if (row.is_passed === '1') {
|
||||||
|
return '是'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
repair() {
|
||||||
|
const _selectData = this.$refs.table.selection
|
||||||
|
const data = _selectData[0]
|
||||||
|
if (data.status !== '01') {
|
||||||
|
return this.crud.notify('只能对生成状态的单据进行维修', CRUD.NOTIFICATION_TYPE.INFO)
|
||||||
|
}
|
||||||
|
crudDevicerepairrequest.repair(data).then(res => {
|
||||||
|
this.crud.notify('操作成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||||
|
this.crud.toQuery()
|
||||||
|
})
|
||||||
|
},
|
||||||
|
notRepair() {
|
||||||
|
const _selectData = this.$refs.table.selection
|
||||||
|
const data = _selectData[0]
|
||||||
|
if (data.status !== '01') {
|
||||||
|
return this.crud.notify('只能对生成状态的单据进行操作', CRUD.NOTIFICATION_TYPE.INFO)
|
||||||
|
}
|
||||||
|
crudDevicerepairrequest.notRepair(data).then(res => {
|
||||||
|
this.crud.notify('操作成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||||
|
this.crud.toQuery()
|
||||||
|
})
|
||||||
|
},
|
||||||
|
Picconfirm(index, row) {
|
||||||
|
debugger
|
||||||
|
this.$refs.child.setForm(row.request_code)
|
||||||
|
this.PicDialog = true
|
||||||
|
},
|
||||||
|
putDevice() {
|
||||||
|
this.deviceDialog = true
|
||||||
|
},
|
||||||
|
tableChanged2(row) {
|
||||||
|
this.form.devicerecord_id = row.devicerecord_id
|
||||||
|
this.form.device_code = row.device_code
|
||||||
|
},
|
||||||
|
putFault() {
|
||||||
|
this.faultDialog = true
|
||||||
|
},
|
||||||
|
tableChanged(row) {
|
||||||
|
this.form.device_faultclass_id = row.device_faultclass_id
|
||||||
|
this.form.device_faultclass_name = row.device_faultclass_name
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
|
||||||
|
</style>
|
||||||
Reference in New Issue
Block a user