代码更新

This commit is contained in:
2022-09-16 11:11:02 +08:00
parent 7eafeaba51
commit 585e037018
12 changed files with 322 additions and 33 deletions

View File

@@ -20,6 +20,15 @@
placeholder="请选择"
/>
</el-form-item>
<el-form-item label="所属部门">
<treeselect
v-model="query.dept_id"
:load-options="loadDepts"
:options="depts"
style="width: 200px;"
placeholder="请选择"
/>
</el-form-item>
<el-form-item label="设备">
<el-input
v-model="query.device_code"
@@ -95,6 +104,11 @@
</el-row>
<el-row>
<el-col span="12">
<el-form-item label="班组配合人:" prop="product_person_name">
<el-input v-model="form.product_person_name" style="width: 200px;" />
</el-form-item>
</el-col>
<el-col span="12">
<el-form-item label="故障等级:" prop="fault_level">
<el-select
@@ -141,6 +155,9 @@
<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="dept_name" label="所属部门" show-overflow-tooltip />
<el-table-column prop="use_name" label="使用班组" show-overflow-tooltip />
<el-table-column prop="product_person_name" 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"/>
@@ -187,8 +204,9 @@ 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'
import { getDepts } from '@/api/system/dept'
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 }
const defaultForm = { product_person_name: null, 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'],
@@ -197,7 +215,7 @@ export default {
cruds() {
return CRUD({
title: '设备报修',
url: 'api/devicerepairrequest',
url: 'api/devicerepairrequest/query2',
idField: 'request_id',
sort: 'request_id,desc',
crudMethod: { ...crudDevicerepairrequest },
@@ -216,6 +234,7 @@ export default {
faultDialog: false,
classes: [],
class_idStr: null,
depts: [],
materOpt_code: '23',
statusList: [
{ 'label': '生成', 'value': '01' },
@@ -234,6 +253,9 @@ export default {
],
fault_level: [
{ required: true, message: '故障等级不能为空', trigger: 'blur' }
],
product_person_name: [
{ required: true, message: '班组配合人不能为空', trigger: 'blur' }
]
}
}
@@ -248,6 +270,7 @@ export default {
this.crud.toQuery()
this.queryClassId()
})
this.getDepts()
},
methods: {
// 钩子在获取表格数据之前执行false 则代表不获取数据
@@ -350,6 +373,32 @@ export default {
tableChanged(row) {
this.form.device_faultclass_id = row.device_faultclass_id
this.form.device_faultclass_name = row.device_faultclass_name
},
// 获取弹窗内部门数据
loadDepts({ action, parentNode, callback }) {
if (action === LOAD_CHILDREN_OPTIONS) {
getDepts({ enabled: true, pid: parentNode.id }).then(res => {
parentNode.children = res.content.map(function(obj) {
if (obj.hasChildren) {
obj.children = null
}
return obj
})
setTimeout(() => {
callback()
}, 200)
})
}
},
getDepts() {
getDepts({ enabled: true }).then(res => {
this.depts = res.content.map(function(obj) {
if (obj.hasChildren) {
obj.children = null
}
return obj
})
})
}
}
}