优化
This commit is contained in:
@@ -82,7 +82,7 @@
|
||||
size="small"
|
||||
:controls="false"
|
||||
controls-position="right"
|
||||
precision="3"
|
||||
precision="1"
|
||||
:min="0"
|
||||
@change="change($event,crud.data[scope.$index],scope.$index)"
|
||||
/>
|
||||
@@ -95,7 +95,7 @@
|
||||
size="small"
|
||||
:controls="false"
|
||||
controls-position="right"
|
||||
precision="3"
|
||||
precision="1"
|
||||
:min="0"
|
||||
@change="change($event,crud.data[scope.$index],scope.$index)"
|
||||
/>
|
||||
|
||||
@@ -71,16 +71,6 @@
|
||||
>
|
||||
添加物料
|
||||
</el-button>
|
||||
<!-- <el-button
|
||||
slot="left"
|
||||
class="filter-item"
|
||||
type="danger"
|
||||
icon="el-icon-delete"
|
||||
size="mini"
|
||||
@click="delRow"
|
||||
>
|
||||
删除一行
|
||||
</el-button>-->
|
||||
</span>
|
||||
</div>
|
||||
|
||||
@@ -96,10 +86,10 @@
|
||||
:header-cell-style="{background:'#f5f7fa',color:'#606266'}"
|
||||
>
|
||||
<el-table-column type="index" label="序号" width="55" align="center" />
|
||||
<el-table-column show-overflow-tooltip v-if="false" prop="material_id" label="物料id" align="center" />
|
||||
<el-table-column show-overflow-tooltip v-if="false" prop="base_unit_id" label="单位id" align="center" />
|
||||
<el-table-column show-overflow-tooltip prop="material_code" label="备件物料编码" align="center" />
|
||||
<el-table-column show-overflow-tooltip prop="material_name" label="备件物料名称" align="center" />
|
||||
<el-table-column v-if="false" prop="material_id" label="物料id" align="center" />
|
||||
<el-table-column v-if="false" prop="base_unit_id" label="单位id" align="center" />
|
||||
<el-table-column prop="material_code" label="备件物料编码" align="center" />
|
||||
<el-table-column prop="material_name" label="备件物料名称" align="center" />
|
||||
<el-table-column prop="qty" label="标准数量" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-input-number
|
||||
@@ -112,7 +102,7 @@
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column show-overflow-tooltip prop="base_unit_id_name" label="单位" align="center" />
|
||||
<el-table-column prop="base_unit_id_name" label="单位" align="center" />
|
||||
<el-table-column prop="dtl_remark" label="备注" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-show="!scope.row.edit" v-model="scope.row.dtl_remark" class="input-with-select" :disabled="crud.status.view > 0" />
|
||||
@@ -194,8 +184,6 @@ export default {
|
||||
}
|
||||
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 = {
|
||||
@@ -236,7 +224,6 @@ export default {
|
||||
})
|
||||
},
|
||||
[CRUD.HOOK.afterToCU](crud, form) {
|
||||
debugger
|
||||
if (!form.device_bom_code) {
|
||||
this.queryClassId()
|
||||
} else {
|
||||
@@ -247,9 +234,7 @@ export default {
|
||||
}
|
||||
},
|
||||
getSubTypes(id) {
|
||||
debugger
|
||||
crudClassstandard.getClassSuperior2(id).then(res => {
|
||||
debugger
|
||||
const date = res.content
|
||||
this.buildClass(date)
|
||||
this.classes = date
|
||||
|
||||
@@ -41,7 +41,7 @@
|
||||
<el-row>
|
||||
<el-col span="12">
|
||||
<el-form-item label="故障编码:" prop="device_faultclass_code">
|
||||
<el-input v-model="form.device_faultclass_name" style="width: 280px;" disabled placeholder="系统生成" />
|
||||
<el-input v-model="form.device_faultclass_code" style="width: 280px;" disabled placeholder="系统生成" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col span="12">
|
||||
|
||||
@@ -251,6 +251,17 @@ export default {
|
||||
[CRUD.HOOK.beforeRefresh]() {
|
||||
return true
|
||||
},
|
||||
[CRUD.HOOK.afterToCU](crud, form) {
|
||||
debugger
|
||||
if (!form.maint_item_code) {
|
||||
this.queryClassId()
|
||||
} else {
|
||||
const data = {}
|
||||
data.id = form.material_type_id
|
||||
data.goal_id = this.classBj_id
|
||||
this.getSubTypes(data)
|
||||
}
|
||||
},
|
||||
changeQuery() {
|
||||
this.crud.toQuery()
|
||||
},
|
||||
@@ -290,6 +301,25 @@ export default {
|
||||
return obj
|
||||
})
|
||||
})
|
||||
},
|
||||
getSubTypes(id) {
|
||||
debugger
|
||||
crudClassstandard.getClassSuperior2(id).then(res => {
|
||||
debugger
|
||||
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
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -187,6 +187,16 @@ export default {
|
||||
[CRUD.HOOK.beforeRefresh]() {
|
||||
return true
|
||||
},
|
||||
[CRUD.HOOK.afterToCU](crud, form) {
|
||||
if (!form.repair_item_code) {
|
||||
this.queryClassId()
|
||||
} else {
|
||||
const data = {}
|
||||
data.id = form.material_type_id
|
||||
data.goal_id = this.classBj_id
|
||||
this.getSubTypes(data)
|
||||
}
|
||||
},
|
||||
loadClass({ action, parentNode, callback }) {
|
||||
if (action === LOAD_CHILDREN_OPTIONS) {
|
||||
crudClassstandard.getClass({ pid: parentNode.id }).then(res => {
|
||||
@@ -214,6 +224,25 @@ export default {
|
||||
return obj
|
||||
})
|
||||
})
|
||||
},
|
||||
getSubTypes(id) {
|
||||
debugger
|
||||
crudClassstandard.getClassSuperior2(id).then(res => {
|
||||
debugger
|
||||
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
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user