优化
This commit is contained in:
@@ -73,7 +73,9 @@
|
||||
:options="classes"
|
||||
:load-options="loadClass"
|
||||
style="width: 210px;"
|
||||
:clearable= "false"
|
||||
placeholder="设备类别"
|
||||
@select="typeChange"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="生产用途" prop="is_produceuse">
|
||||
@@ -101,19 +103,13 @@
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="使用班组" prop="use_groupid">
|
||||
<el-select
|
||||
<treeselect
|
||||
v-model="form.use_groupid"
|
||||
placeholder="使用班组"
|
||||
:options="depts"
|
||||
:load-options="loadDepts"
|
||||
style="width: 210px"
|
||||
class="filter-item"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in dict.device_type"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
placeholder="使用班组"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="设备属性" prop="device_type">
|
||||
<el-select
|
||||
@@ -271,7 +267,7 @@ const defaultForm = {
|
||||
supplier_id: '',
|
||||
supplier_code: '',
|
||||
is_produceuse: '1',
|
||||
use_groupid: '',
|
||||
use_groupid: null,
|
||||
user_id: '',
|
||||
user_code: '',
|
||||
user_name: '',
|
||||
@@ -351,17 +347,12 @@ export default {
|
||||
crudWorkProcedure.downSelect().then(res => {
|
||||
this.workProcedureList = res
|
||||
})
|
||||
|
||||
equipmentfile.queryBomList().then(res => {
|
||||
this.bomlist = res
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
close() {
|
||||
this.$emit('AddChanged')
|
||||
},
|
||||
[CRUD.HOOK.afterToCU](crud, form) {
|
||||
debugger
|
||||
if (!form.devicerecord_code) {
|
||||
this.getDepts()
|
||||
|
||||
@@ -372,13 +363,18 @@ export default {
|
||||
this.class_idStr = res.class_idStr
|
||||
this.queryClassId()
|
||||
})
|
||||
equipmentfile.queryBomList({ material_type_id: '-1' }).then(res => {
|
||||
this.bomlist = res
|
||||
})
|
||||
} else {
|
||||
equipmentfile.queryBomList({ material_type_id: form.material_type_id }).then(res => {
|
||||
this.bomlist = res
|
||||
})
|
||||
this.getSupDepts(form.use_deptid)
|
||||
const param = {
|
||||
'materOpt_code': '26'
|
||||
}
|
||||
crudDevicebom.getBjId(param).then(res => {
|
||||
debugger
|
||||
const data = {}
|
||||
data.id = form.material_type_id
|
||||
data.goal_id = res.class_idStr
|
||||
@@ -387,9 +383,7 @@ export default {
|
||||
}
|
||||
},
|
||||
getSubTypes(id) {
|
||||
debugger
|
||||
crudClassstandard.getClassSuperior2(id).then(res => {
|
||||
debugger
|
||||
const date = res.content
|
||||
this.buildClass(date)
|
||||
this.classes = date
|
||||
@@ -434,7 +428,6 @@ export default {
|
||||
}
|
||||
},
|
||||
getSupDepts(deptId) {
|
||||
debugger
|
||||
var number = parseFloat(deptId)
|
||||
getDeptSuperior(number).then(res => {
|
||||
const date = res.content
|
||||
@@ -443,7 +436,6 @@ export default {
|
||||
})
|
||||
},
|
||||
buildDepts(depts) {
|
||||
debugger
|
||||
depts.forEach(data => {
|
||||
if (data.children) {
|
||||
this.buildDepts(data.children)
|
||||
@@ -479,6 +471,13 @@ export default {
|
||||
})
|
||||
})
|
||||
},
|
||||
typeChange(old) {
|
||||
debugger
|
||||
this.form.device_bom_id = ''
|
||||
equipmentfile.queryBomList({ material_type_id: old.class_id }).then(res => {
|
||||
this.bomlist = res
|
||||
})
|
||||
},
|
||||
[CRUD.HOOK.beforeSubmit]() {
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user