rev:部门树修改
This commit is contained in:
@@ -11,7 +11,7 @@
|
||||
<label slot="label">设备档案编码:</label>
|
||||
<el-input v-model.trim="form.devicerecord_code" disabled placeholder="系统生成" style="width: 210px" />
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="设备状态" prop="status">
|
||||
<el-form-item label="设备状态" prop="status">
|
||||
<el-select
|
||||
v-model="form.status"
|
||||
placeholder="设备状态"
|
||||
@@ -26,7 +26,7 @@
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>-->
|
||||
</el-form-item>
|
||||
<el-form-item label="设备编码" prop="device_code">
|
||||
<label slot="label">设备编码:</label>
|
||||
<el-input v-model.trim="form.device_code" clearable style="width: 210px" />
|
||||
@@ -78,7 +78,7 @@
|
||||
@select="typeChange"
|
||||
/>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="生产用途" prop="is_produceuse">
|
||||
<el-form-item label="生产用途" prop="is_produceuse">
|
||||
<el-select
|
||||
v-model="form.is_produceuse"
|
||||
placeholder="生产用途"
|
||||
@@ -92,26 +92,18 @@
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>-->
|
||||
</el-form-item>
|
||||
<el-form-item label="使用部门" prop="use_deptid">
|
||||
<treeselect
|
||||
v-model="form.use_deptid"
|
||||
:options="depts"
|
||||
:load-options="loadDepts"
|
||||
:normalizer="normalizer"
|
||||
style="width: 210px"
|
||||
placeholder="使用部门"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="使用班组" prop="use_groupid">
|
||||
<treeselect
|
||||
v-model="form.use_groupid"
|
||||
:options="depts"
|
||||
:load-options="loadDepts"
|
||||
style="width: 210px"
|
||||
placeholder="使用班组"
|
||||
/>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="设备属性" prop="device_type">
|
||||
<el-form-item label="设备属性" prop="device_type">
|
||||
<el-select
|
||||
v-model="form.device_type"
|
||||
placeholder="设备属性"
|
||||
@@ -125,8 +117,8 @@
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>-->
|
||||
<!-- <el-form-item label="设备等级" prop="device_level">
|
||||
</el-form-item>
|
||||
<el-form-item label="设备等级" prop="device_level">
|
||||
<el-select
|
||||
v-model="form.device_level"
|
||||
placeholder="设备等级"
|
||||
@@ -140,7 +132,7 @@
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>-->
|
||||
</el-form-item>
|
||||
<el-form-item label="内部自编号" prop="extend_code">
|
||||
<label slot="label">内部自编号:</label>
|
||||
<el-input v-model.trim="form.extend_code" clearable style="width: 210px" />
|
||||
@@ -163,6 +155,7 @@
|
||||
:options="depts"
|
||||
:load-options="loadDepts"
|
||||
style="width: 210px"
|
||||
:normalizer="normalizer"
|
||||
placeholder="选择部门"
|
||||
/>
|
||||
</el-form-item>
|
||||
@@ -260,7 +253,7 @@ import crudMaterialbase from '@/api/wms/basedata/master/materialbase'
|
||||
import equipmentfile from '@/views/wms/device_manage/deviceFile/equipmentfile/equipmentfile'
|
||||
import Treeselect, { LOAD_CHILDREN_OPTIONS } from '@riophae/vue-treeselect'
|
||||
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
|
||||
// import { getDepts, getDeptSuperior } from '@/api/system/dept'
|
||||
import crudDept from '@/views/system/dept/dept'
|
||||
// import crudDevicebom from '@/api/wms/basedata/em/devicebom'
|
||||
|
||||
const defaultForm = {
|
||||
@@ -313,7 +306,7 @@ export default {
|
||||
default: false
|
||||
}
|
||||
},
|
||||
// dicts: ['device_type', 'is_produceuse', 'device_status', 'device_level'],
|
||||
dicts: ['device_type', 'is_produceuse', 'device_status', 'device_level'],
|
||||
data() {
|
||||
return {
|
||||
dialogVisible: false,
|
||||
@@ -360,6 +353,14 @@ export default {
|
||||
crudWorkProcedure.downSelect().then(res => {
|
||||
this.workProcedureList = res
|
||||
})
|
||||
const param = {
|
||||
'materOpt_code': '23'
|
||||
}
|
||||
crudMaterialbase.getMaterOptType(param).then(res => {
|
||||
this.class_idStr = res.class_idStr
|
||||
this.queryClassId()
|
||||
})
|
||||
this.deptTree()
|
||||
},
|
||||
methods: {
|
||||
close() {
|
||||
@@ -395,23 +396,6 @@ export default {
|
||||
})
|
||||
}
|
||||
},
|
||||
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
|
||||
}
|
||||
})
|
||||
},
|
||||
queryClassId() {
|
||||
const param = {
|
||||
'class_idStr': this.class_idStr
|
||||
@@ -440,56 +424,40 @@ export default {
|
||||
})
|
||||
}
|
||||
},
|
||||
getSupDepts(deptId) {
|
||||
var number = parseFloat(deptId)
|
||||
getDeptSuperior(number).then(res => {
|
||||
const date = res.content
|
||||
this.buildDepts(date)
|
||||
this.depts = date
|
||||
})
|
||||
},
|
||||
buildDepts(depts) {
|
||||
depts.forEach(data => {
|
||||
if (data.children) {
|
||||
this.buildDepts(data.children)
|
||||
}
|
||||
if (data.hasChildren && !data.children) {
|
||||
data.children = null
|
||||
}
|
||||
})
|
||||
},
|
||||
// 获取弹窗内部门数据
|
||||
|
||||
// 获取部门
|
||||
loadDepts({ action, parentNode, callback }) {
|
||||
if (action === LOAD_CHILDREN_OPTIONS) {
|
||||
getDepts({ enabled: true, pid: parentNode.id }).then(res => {
|
||||
crudDept.getDeptvo({ is_used: true, pid: parentNode.dept_id }).then(res => {
|
||||
parentNode.children = res.content.map(function(obj) {
|
||||
if (obj.hasChildren) {
|
||||
obj.children = null
|
||||
}
|
||||
obj.children = null
|
||||
return obj
|
||||
})
|
||||
setTimeout(() => {
|
||||
callback()
|
||||
}, 200)
|
||||
}, 100)
|
||||
})
|
||||
}
|
||||
},
|
||||
getDepts() {
|
||||
getDepts({ enabled: true }).then(res => {
|
||||
this.depts = res.content.map(function(obj) {
|
||||
if (obj.hasChildren) {
|
||||
obj.children = null
|
||||
}
|
||||
return obj
|
||||
deptTree() {
|
||||
setTimeout(() => {
|
||||
crudDept.getDeptTree().then(res => {
|
||||
this.depts = res.content
|
||||
})
|
||||
})
|
||||
}, 100)
|
||||
},
|
||||
normalizer(node) {
|
||||
return {
|
||||
id: node.dept_id,
|
||||
label: node.name,
|
||||
children: node.children
|
||||
}
|
||||
},
|
||||
typeChange(old) {
|
||||
debugger
|
||||
this.form.device_bom_id = ''
|
||||
/*this.form.device_bom_id = ''
|
||||
equipmentfile.queryBomList({ material_type_id: old.class_id }).then(res => {
|
||||
this.bomlist = res
|
||||
})
|
||||
})*/
|
||||
},
|
||||
[CRUD.HOOK.beforeSubmit]() {
|
||||
}
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
v-model="query.use_deptid"
|
||||
:options="depts"
|
||||
:load-options="loadDepts"
|
||||
:normalizer="normalizer"
|
||||
clearable
|
||||
style="width: 200px"
|
||||
placeholder="选择部门"
|
||||
@@ -287,6 +288,7 @@ import crudWorkProcedure from '@/api/wms/basedata/pdm/workProcedure'
|
||||
import Treeselect, { LOAD_CHILDREN_OPTIONS } from '@riophae/vue-treeselect'
|
||||
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
|
||||
// import { getDepts } from '@/api/system/dept'
|
||||
import crudDept, { getDeptTree } from '@/views/system/dept/dept'
|
||||
import crudClassstandard from '@/api/wms/basedata/master/classstandard'
|
||||
import crudMaterialbase from '@/api/wms/basedata/master/materialbase'
|
||||
import { download } from '@/api/data'
|
||||
@@ -346,7 +348,7 @@ export default {
|
||||
this.class_idStr = res.class_idStr
|
||||
this.queryClassId()
|
||||
})
|
||||
// this.getDepts()
|
||||
this.deptTree()
|
||||
},
|
||||
methods: {
|
||||
canUd(row) {
|
||||
@@ -394,32 +396,36 @@ export default {
|
||||
})
|
||||
}
|
||||
},
|
||||
// 获取弹窗内部门数据
|
||||
|
||||
// 获取部门
|
||||
loadDepts({ action, parentNode, callback }) {
|
||||
if (action === LOAD_CHILDREN_OPTIONS) {
|
||||
getDepts({ enabled: true, pid: parentNode.id }).then(res => {
|
||||
crudDept.getDeptvo({ is_used: true, pid: parentNode.dept_id }).then(res => {
|
||||
parentNode.children = res.content.map(function(obj) {
|
||||
if (obj.hasChildren) {
|
||||
obj.children = null
|
||||
}
|
||||
obj.children = null
|
||||
return obj
|
||||
})
|
||||
setTimeout(() => {
|
||||
callback()
|
||||
}, 200)
|
||||
}, 100)
|
||||
})
|
||||
}
|
||||
},
|
||||
getDepts() {
|
||||
getDepts({ enabled: true }).then(res => {
|
||||
this.depts = res.content.map(function(obj) {
|
||||
if (obj.hasChildren) {
|
||||
obj.children = null
|
||||
}
|
||||
return obj
|
||||
deptTree() {
|
||||
setTimeout(() => {
|
||||
crudDept.getDeptTree().then(res => {
|
||||
this.depts = res.content
|
||||
})
|
||||
})
|
||||
}, 100)
|
||||
},
|
||||
normalizer(node) {
|
||||
return {
|
||||
id: node.dept_id,
|
||||
label: node.name,
|
||||
children: node.children
|
||||
}
|
||||
},
|
||||
|
||||
mySelectionChange(rows) {
|
||||
this.buttonChange(rows)
|
||||
},
|
||||
|
||||
@@ -20,15 +20,6 @@
|
||||
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"
|
||||
|
||||
@@ -24,15 +24,7 @@
|
||||
<treeselect
|
||||
v-model="query.dept_id"
|
||||
:load-options="loadDepts"
|
||||
:options="depts"
|
||||
style="width: 200px;"
|
||||
placeholder="请选择"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="使用班组">
|
||||
<treeselect
|
||||
v-model="query.use_groupid"
|
||||
:load-options="loadDepts"
|
||||
:normalizer="normalizer"
|
||||
:options="depts"
|
||||
style="width: 200px;"
|
||||
placeholder="请选择"
|
||||
@@ -217,6 +209,7 @@ import DeviceDialog from '@/views/wms/device_manage/repair/devicevprs/DeviceDial
|
||||
import FaultDialog from '@/views/wms/device_manage/repair/devicevprs/FaultDialog'
|
||||
// import { getDepts, getDeptSuperior } from '@/api/system/dept'
|
||||
import { mapGetters } from 'vuex'
|
||||
import crudDept from '@/views/system/dept/dept'
|
||||
|
||||
const defaultForm = { material_type_id: null, 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 {
|
||||
@@ -291,7 +284,7 @@ export default {
|
||||
this.crud.toQuery()
|
||||
this.queryClassId()
|
||||
})
|
||||
this.getDepts()
|
||||
this.deptTree()
|
||||
this.query.use_groupid = this.user.dept.id
|
||||
this.getSupDepts(this.user.dept.id)
|
||||
this.crud.toQuery()
|
||||
@@ -397,37 +390,30 @@ export default {
|
||||
// 获取弹窗内部门数据
|
||||
loadDepts({ action, parentNode, callback }) {
|
||||
if (action === LOAD_CHILDREN_OPTIONS) {
|
||||
getDepts({ enabled: true, pid: parentNode.id }).then(res => {
|
||||
crudDept.getDeptvo({ is_used: true, pid: parentNode.dept_id }).then(res => {
|
||||
parentNode.children = res.content.map(function(obj) {
|
||||
if (obj.hasChildren) {
|
||||
obj.children = null
|
||||
}
|
||||
obj.children = null
|
||||
return obj
|
||||
})
|
||||
setTimeout(() => {
|
||||
callback()
|
||||
}, 200)
|
||||
}, 100)
|
||||
})
|
||||
}
|
||||
},
|
||||
getDepts() {
|
||||
getDepts({ enabled: true }).then(res => {
|
||||
this.depts = res.content.map(function(obj) {
|
||||
if (obj.hasChildren) {
|
||||
obj.children = null
|
||||
}
|
||||
return obj
|
||||
deptTree() {
|
||||
setTimeout(() => {
|
||||
crudDept.getDeptTree().then(res => {
|
||||
this.depts = res.content
|
||||
})
|
||||
})
|
||||
}, 100)
|
||||
},
|
||||
getSupDepts(deptId) {
|
||||
debugger
|
||||
var number = parseFloat(deptId)
|
||||
getDeptSuperior(number).then(res => {
|
||||
const date = res.content
|
||||
this.buildDepts(date)
|
||||
this.depts = date
|
||||
})
|
||||
normalizer(node) {
|
||||
return {
|
||||
id: node.dept_id,
|
||||
label: node.name,
|
||||
children: node.children
|
||||
}
|
||||
},
|
||||
buildDepts(depts) {
|
||||
depts.forEach(data => {
|
||||
|
||||
Reference in New Issue
Block a user