opt:物料相关页面添加物料分类字段
This commit is contained in:
@@ -46,10 +46,7 @@ public class MaterialbaseServiceImpl implements MaterialbaseService {
|
|||||||
//只查询木箱
|
//只查询木箱
|
||||||
String box = MapUtil.getStr(whereJson, "box");
|
String box = MapUtil.getStr(whereJson, "box");
|
||||||
//物料限制的时候使用,初始化页面
|
//物料限制的时候使用,初始化页面
|
||||||
String class_idStr = MapUtil.getStr(whereJson, "class_idStr");
|
|
||||||
String material_type_id = MapUtil.getStr(whereJson, "material_type_id");
|
String material_type_id = MapUtil.getStr(whereJson, "material_type_id");
|
||||||
String class_code = MapUtil.getStr(whereJson, "class_code");
|
|
||||||
String ids = MapUtil.getStr(whereJson, "ids");
|
|
||||||
|
|
||||||
|
|
||||||
HashMap<String, String> map = new HashMap<>();
|
HashMap<String, String> map = new HashMap<>();
|
||||||
@@ -71,35 +68,26 @@ public class MaterialbaseServiceImpl implements MaterialbaseService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//处理物料当前节点的所有子节点
|
//处理物料当前节点的所有子节点
|
||||||
if (!StrUtil.isEmpty(material_type_id)) {
|
|
||||||
map.put("material_type_id", material_type_id);
|
|
||||||
String classIds = classstandardService.getChildIdStr(material_type_id);
|
|
||||||
map.put("classIds", classIds);
|
|
||||||
} else if (ObjectUtil.isNotEmpty(class_idStr)) {
|
|
||||||
String classIds = classstandardService.getAllChildIdStr(class_idStr);
|
|
||||||
map.put("classIds", classIds);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!StrUtil.isEmpty(class_code)) {
|
|
||||||
map.put("class_code", class_code + "%");
|
|
||||||
}
|
|
||||||
|
|
||||||
StringBuffer where = new StringBuffer();
|
StringBuffer where = new StringBuffer();
|
||||||
if (StrUtil.isNotEmpty(ids)) {
|
if (StrUtil.isNotEmpty(material_type_id)) {
|
||||||
ids = ids.replaceAll("\'", "");
|
material_type_id = material_type_id.replaceAll("\'", "");
|
||||||
String[] strs = ids.split(",");
|
String[] strs = material_type_id.split(",");
|
||||||
where.append("(");
|
where.append("(");
|
||||||
for (int i = 0; i < strs.length; ) {
|
for (int i = 0; i < strs.length; ) {
|
||||||
where.append("class.class_code like '" + strs[i] + "%'");
|
if(i!=0){
|
||||||
i++;
|
where.append(",");
|
||||||
if (i < strs.length) {
|
|
||||||
where.append(" or ");
|
|
||||||
}
|
}
|
||||||
|
i++;
|
||||||
|
where.append("'");
|
||||||
|
if (i <= strs.length) {
|
||||||
|
where.append(strs[i-1]);
|
||||||
|
}
|
||||||
|
where.append("'");
|
||||||
}
|
}
|
||||||
where.append(")");
|
where.append(")");
|
||||||
map.put("idssql", where.toString());
|
map.put("material_type_ids", where.toString());
|
||||||
} else {
|
} else {
|
||||||
map.put("idssql", "1=1");
|
map.put("material_type_ids", "");
|
||||||
}
|
}
|
||||||
|
|
||||||
JSONObject jo = WQL.getWO("QMD_ME_MATERIAL").addParamMap(map).pageQuery(WqlUtil.getHttpContext(page), "material_id");
|
JSONObject jo = WQL.getWO("QMD_ME_MATERIAL").addParamMap(map).pageQuery(WqlUtil.getHttpContext(page), "material_id");
|
||||||
|
|||||||
@@ -16,7 +16,7 @@
|
|||||||
输入.flag TYPEAS s_string
|
输入.flag TYPEAS s_string
|
||||||
输入.search TYPEAS s_string
|
输入.search TYPEAS s_string
|
||||||
输入.box TYPEAS s_string
|
输入.box TYPEAS s_string
|
||||||
输入.class_code TYPEAS s_string
|
输入.material_type_ids TYPEAS f_string
|
||||||
输入.idssql TYPEAS f_string
|
输入.idssql TYPEAS f_string
|
||||||
输入.classIds TYPEAS f_string
|
输入.classIds TYPEAS f_string
|
||||||
|
|
||||||
@@ -47,24 +47,28 @@
|
|||||||
SELECT
|
SELECT
|
||||||
mb.*,
|
mb.*,
|
||||||
unit_name,
|
unit_name,
|
||||||
unit_name as base_unit_id_name
|
unit_name as base_unit_id_name,
|
||||||
|
mb.material_type_id as class_code,
|
||||||
|
dict.label as class_name
|
||||||
FROM
|
FROM
|
||||||
md_me_materialbase mb
|
md_me_materialbase mb
|
||||||
LEFT JOIN md_pb_measureunit unit ON unit.measure_unit_id = mb.base_unit_id
|
LEFT JOIN md_pb_measureunit unit ON unit.measure_unit_id = mb.base_unit_id
|
||||||
|
LEFT JOIN sys_dict dict ON (dict.value = mb.material_type_id and dict.code='material_type')
|
||||||
WHERE
|
WHERE
|
||||||
mb.is_delete = '0'
|
mb.is_delete = '0'
|
||||||
OPTION 输入.search <> ""
|
OPTION 输入.search <> ""
|
||||||
(
|
(
|
||||||
mb.material_code like 输入.search
|
mb.material_code like 输入.search
|
||||||
OR
|
OR
|
||||||
mb.material_name like 输入.search
|
mb.material_name like 输入.search
|
||||||
)
|
)
|
||||||
ENDOPTION
|
ENDOPTION
|
||||||
OPTION 输入.box <> ""
|
OPTION 输入.box <> ""
|
||||||
(
|
mb.material_name like 输入.box
|
||||||
mb.material_name like 输入.box
|
ENDOPTION
|
||||||
)
|
OPTION 输入.material_type_ids <> ""
|
||||||
ENDOPTION
|
mb.material_type_id in 输入.material_type_ids
|
||||||
|
ENDOPTION
|
||||||
ENDSELECT
|
ENDSELECT
|
||||||
ENDPAGEQUERY
|
ENDPAGEQUERY
|
||||||
ENDIF
|
ENDIF
|
||||||
|
|||||||
@@ -89,7 +89,7 @@
|
|||||||
</el-table>
|
</el-table>
|
||||||
<!--分页组件-->
|
<!--分页组件-->
|
||||||
<pagination />
|
<pagination />
|
||||||
<MaterDialog :dialog-show.sync="materShow" @setMaterValue="tableChanged" />
|
<MaterDialog :dialog-show.sync="materShow" :mater-opt-code="materType" @setMaterValue="tableChanged" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@@ -142,6 +142,7 @@ export default {
|
|||||||
del: ['admin', 'paper:del']
|
del: ['admin', 'paper:del']
|
||||||
},
|
},
|
||||||
materShow: false,
|
materShow: false,
|
||||||
|
materType: '',
|
||||||
rules: {
|
rules: {
|
||||||
standard_weight: [
|
standard_weight: [
|
||||||
{ required: true, message: '标准重量不能为空', trigger: 'blur' }
|
{ required: true, message: '标准重量不能为空', trigger: 'blur' }
|
||||||
@@ -159,6 +160,7 @@ export default {
|
|||||||
},
|
},
|
||||||
async queryMater() {
|
async queryMater() {
|
||||||
this.materShow = true
|
this.materShow = true
|
||||||
|
this.materType = '7019,4822'
|
||||||
},
|
},
|
||||||
print() {
|
print() {
|
||||||
const _selectData = this.$refs.table.selection
|
const _selectData = this.$refs.table.selection
|
||||||
|
|||||||
@@ -9,13 +9,21 @@
|
|||||||
<span style="line-height:36px;text-align: center">物料类别:</span>
|
<span style="line-height:36px;text-align: center">物料类别:</span>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<treeselect
|
<el-select
|
||||||
|
size="mini"
|
||||||
v-model="query.material_type_id"
|
v-model="query.material_type_id"
|
||||||
:load-options="loadChildNodes"
|
placeholder="全部"
|
||||||
:options="classes1"
|
clearable
|
||||||
style="width: 200px;"
|
class="filter-item"
|
||||||
placeholder="请选择"
|
@change="crud.toQuery"
|
||||||
/>
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="item in dict.material_type"
|
||||||
|
:key="item.value"
|
||||||
|
:label="item.label"
|
||||||
|
:value="item.value"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
</el-col>
|
</el-col>
|
||||||
@@ -79,34 +87,23 @@
|
|||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-form-item label="物料分类" prop="material_type_id">
|
<el-form-item label="物料分类" prop="material_type_id">
|
||||||
<treeselect
|
<el-select
|
||||||
|
size="mini"
|
||||||
v-model="form.material_type_id"
|
v-model="form.material_type_id"
|
||||||
:load-options="loadChildNodes"
|
|
||||||
:options="classes2"
|
|
||||||
style="width: 200px;"
|
|
||||||
placeholder="请选择"
|
placeholder="请选择"
|
||||||
/>
|
class="filter-item"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="item in dict.material_type"
|
||||||
|
:key="item.value"
|
||||||
|
:label="item.label"
|
||||||
|
:value="item.value"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-col :span="8">
|
|
||||||
<el-form-item label="产品系列">
|
|
||||||
<treeselect
|
|
||||||
v-model="form.product_series"
|
|
||||||
:options="classes3"
|
|
||||||
:auto-load-root-options="false"
|
|
||||||
:load-options="loadChildNodes"
|
|
||||||
style="width: 200px;"
|
|
||||||
placeholder="请选择"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="8">
|
|
||||||
<el-form-item label="静置时间" prop="standing_time">
|
|
||||||
<el-input-number v-model="form.standing_time" :controls="false" :min="0" label="分钟" style="width: 200px;" />
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-form-item label="是否启用" prop="is_used">
|
<el-form-item label="是否启用" prop="is_used">
|
||||||
<el-radio v-model="form.is_used" label="0">否</el-radio>
|
<el-radio v-model="form.is_used" label="0">否</el-radio>
|
||||||
@@ -133,10 +130,10 @@
|
|||||||
<el-table-column prop="material_name" label="物料名称" width="180" show-overflow-tooltip />
|
<el-table-column prop="material_name" label="物料名称" width="180" show-overflow-tooltip />
|
||||||
<el-table-column prop="material_spec" label="物料规格" width="140" />
|
<el-table-column prop="material_spec" label="物料规格" width="140" />
|
||||||
<el-table-column prop="material_model" label="物料型号" />
|
<el-table-column prop="material_model" label="物料型号" />
|
||||||
|
<el-table-column prop="class_code" label="物料分类编码" width="120" />
|
||||||
<el-table-column prop="class_name" label="物料分类" width="140" />
|
<el-table-column prop="class_name" label="物料分类" width="140" />
|
||||||
<el-table-column prop="unit_name" label="计量单位" />
|
<el-table-column prop="unit_name" label="计量单位" />
|
||||||
<el-table-column prop="standing_time" label="静置时间(分钟)" width="130px" />
|
<el-table-column prop="standing_time" label="静置时间(分钟)" width="130px" />
|
||||||
<el-table-column prop="product_series_name" label="系列" />
|
|
||||||
<el-table-column label="启用" align="center" prop="is_used">
|
<el-table-column label="启用" align="center" prop="is_used">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-switch
|
<el-switch
|
||||||
@@ -179,9 +176,6 @@ import rrOperation from '@crud/RR.operation'
|
|||||||
import crudOperation from '@crud/CRUD.operation'
|
import crudOperation from '@crud/CRUD.operation'
|
||||||
import udOperation from '@crud/UD.operation'
|
import udOperation from '@crud/UD.operation'
|
||||||
import pagination from '@crud/Pagination'
|
import pagination from '@crud/Pagination'
|
||||||
import Treeselect, { LOAD_CHILDREN_OPTIONS } from '@riophae/vue-treeselect'
|
|
||||||
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
|
|
||||||
import crudClassstandard from '@/views/wms/basedata/master/customer/customerbase'
|
|
||||||
import crudMdPbMeasureunit from '@/views/wms/basedata/master/measure/mdPbMeasureunit'
|
import crudMdPbMeasureunit from '@/views/wms/basedata/master/measure/mdPbMeasureunit'
|
||||||
|
|
||||||
const defaultForm = {
|
const defaultForm = {
|
||||||
@@ -215,14 +209,13 @@ const defaultForm = {
|
|||||||
is_used: null,
|
is_used: null,
|
||||||
is_delete: null,
|
is_delete: null,
|
||||||
ext_id: null,
|
ext_id: null,
|
||||||
material_height_type: null,
|
|
||||||
product_series: null
|
product_series: null
|
||||||
}
|
}
|
||||||
export default {
|
export default {
|
||||||
name: 'Materialbase',
|
name: 'Materialbase',
|
||||||
// 数据字典
|
// 数据字典
|
||||||
dicts: ['is_used'],
|
dicts: ['is_used', 'material_type'],
|
||||||
components: { pagination, crudOperation, rrOperation, udOperation, Treeselect },
|
components: { pagination, crudOperation, rrOperation, udOperation },
|
||||||
mixins: [presenter(), header(), form(defaultForm), crud()],
|
mixins: [presenter(), header(), form(defaultForm), crud()],
|
||||||
cruds() {
|
cruds() {
|
||||||
return CRUD({
|
return CRUD({
|
||||||
@@ -236,9 +229,6 @@ export default {
|
|||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
classes1: [],
|
|
||||||
classes2: [],
|
|
||||||
classes3: [],
|
|
||||||
fullscreenLoading: false,
|
fullscreenLoading: false,
|
||||||
measure_unit: [],
|
measure_unit: [],
|
||||||
productSeries: [],
|
productSeries: [],
|
||||||
@@ -262,104 +252,23 @@ export default {
|
|||||||
is_used: [
|
is_used: [
|
||||||
{ required: true, message: '是否启用不能为空', trigger: 'blur' }
|
{ required: true, message: '是否启用不能为空', trigger: 'blur' }
|
||||||
],
|
],
|
||||||
material_height_type: [
|
material_type_id: [
|
||||||
{ required: true, message: '不能为空', trigger: 'blur' }
|
{ required: true, message: '不能为空', trigger: 'blur' }
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.initClass1()
|
|
||||||
this.initClass2()
|
|
||||||
this.initClass3()
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
// 钩子:在获取表格数据之前执行,false 则代表不获取数据
|
// 钩子:在获取表格数据之前执行,false 则代表不获取数据
|
||||||
[CRUD.HOOK.beforeRefresh]() {
|
[CRUD.HOOK.beforeRefresh]() {
|
||||||
return true
|
return true
|
||||||
},
|
},
|
||||||
initClass1() {
|
|
||||||
const param = {
|
|
||||||
parent_class_code: '09'
|
|
||||||
}
|
|
||||||
crudClassstandard.getClassType(param).then(res => {
|
|
||||||
const data = res.content
|
|
||||||
this.buildTree(data)
|
|
||||||
this.classes1 = data
|
|
||||||
})
|
|
||||||
},
|
|
||||||
initClass2() {
|
|
||||||
const param = {
|
|
||||||
parent_class_code: '09'
|
|
||||||
}
|
|
||||||
crudClassstandard.getClassType(param).then(res => {
|
|
||||||
const data = res.content
|
|
||||||
this.buildTree(data)
|
|
||||||
this.classes2 = data
|
|
||||||
})
|
|
||||||
},
|
|
||||||
initClass3() {
|
|
||||||
const param = {
|
|
||||||
parent_class_code: '07'
|
|
||||||
}
|
|
||||||
crudClassstandard.getClassType(param).then(res => {
|
|
||||||
const data = res.content
|
|
||||||
this.buildTree(data)
|
|
||||||
this.classes3 = data
|
|
||||||
})
|
|
||||||
},
|
|
||||||
[CRUD.HOOK.beforeToCU](crud, form) {
|
[CRUD.HOOK.beforeToCU](crud, form) {
|
||||||
crudMdPbMeasureunit.getUnit().then(res => {
|
crudMdPbMeasureunit.getUnit().then(res => {
|
||||||
this.measure_unit = res.content
|
this.measure_unit = res.content
|
||||||
})
|
})
|
||||||
// 物料标识为空,新增
|
|
||||||
if (!form.material_type_id) {
|
|
||||||
form.material_type_id = null // 必须为null,否则会出现unknown
|
|
||||||
} else { // 更新
|
|
||||||
this.getSubTypes('02', form.material_type_id)
|
|
||||||
}
|
|
||||||
// 物料系列为空,新增
|
|
||||||
if (!form.product_series) {
|
|
||||||
form.product_series = null // 必须为null,否则会出现unknown
|
|
||||||
} else { // 更新
|
|
||||||
this.getSubTypes('03', form.product_series)
|
|
||||||
}
|
|
||||||
},
|
|
||||||
getSubTypes(type, id) {
|
|
||||||
const that = this
|
|
||||||
crudClassstandard.getClassSuperior(id).then(res => {
|
|
||||||
const data = res.content
|
|
||||||
that.buildTree(data)
|
|
||||||
if (type == '02') {
|
|
||||||
that.classes2 = data
|
|
||||||
}
|
|
||||||
if (type == '03') {
|
|
||||||
that.classes3 = data
|
|
||||||
}
|
|
||||||
})
|
|
||||||
},
|
|
||||||
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
|
|
||||||
})
|
|
||||||
})
|
|
||||||
},
|
|
||||||
buildTree(classes) {
|
|
||||||
classes.forEach(data => {
|
|
||||||
if (data.children) {
|
|
||||||
this.buildTree(data.children)
|
|
||||||
}
|
|
||||||
if (data.hasChildren && !data.children) {
|
|
||||||
data.children = null // 重点代码
|
|
||||||
}
|
|
||||||
})
|
|
||||||
},
|
},
|
||||||
// 改变状态
|
// 改变状态
|
||||||
changeEnabled(data, val) {
|
changeEnabled(data, val) {
|
||||||
@@ -388,22 +297,6 @@ export default {
|
|||||||
data.is_used = '0'
|
data.is_used = '0'
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
|
||||||
// 获取子节点数据
|
|
||||||
loadChildNodes({ 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)
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,21 +15,12 @@
|
|||||||
label-width="80px"
|
label-width="80px"
|
||||||
label-suffix=":"
|
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-form-item label="模糊搜索">
|
||||||
<el-input
|
<el-input
|
||||||
v-model="query.search"
|
v-model="query.search"
|
||||||
clearable
|
clearable
|
||||||
size="mini"
|
size="mini"
|
||||||
placeholder="编码、名称"
|
placeholder="可物料编码、物料名称"
|
||||||
@keyup.enter.native="crud.toQuery"
|
@keyup.enter.native="crud.toQuery"
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
@@ -79,13 +70,10 @@ import crudMaterialbase from '@/views/wms/basedata/master/material/materialbase'
|
|||||||
import CRUD, { header, presenter } from '@crud/crud'
|
import CRUD, { header, presenter } from '@crud/crud'
|
||||||
import rrOperation from '@crud/RR.operation'
|
import rrOperation from '@crud/RR.operation'
|
||||||
import pagination from '@crud/Pagination'
|
import pagination from '@crud/Pagination'
|
||||||
import Treeselect, { LOAD_CHILDREN_OPTIONS } from '@riophae/vue-treeselect'
|
|
||||||
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
|
|
||||||
import crudClassstandard from '@/views/wms/basedata/master/customer/customerbase'
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'MaterDtl',
|
name: 'MaterDtl',
|
||||||
components: { rrOperation, pagination, Treeselect },
|
components: { rrOperation, pagination },
|
||||||
cruds() {
|
cruds() {
|
||||||
return CRUD({ title: '物料', url: 'api/Materialbase', crudMethod: { ...crudMaterialbase }, optShow: {}})
|
return CRUD({ title: '物料', url: 'api/Materialbase', crudMethod: { ...crudMaterialbase }, optShow: {}})
|
||||||
},
|
},
|
||||||
@@ -102,15 +90,13 @@ export default {
|
|||||||
},
|
},
|
||||||
materOptCode: {
|
materOptCode: {
|
||||||
type: String,
|
type: String,
|
||||||
default: '00'
|
default: ''
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
dialogVisible: false,
|
dialogVisible: false,
|
||||||
classes: [],
|
|
||||||
tableRadio: null,
|
tableRadio: null,
|
||||||
class_idStr: null,
|
|
||||||
checkrow: null,
|
checkrow: null,
|
||||||
rows: []
|
rows: []
|
||||||
}
|
}
|
||||||
@@ -130,28 +116,8 @@ export default {
|
|||||||
return this.dict.label.product_series[row.product_series]
|
return this.dict.label.product_series[row.product_series]
|
||||||
},
|
},
|
||||||
open() {
|
open() {
|
||||||
const param = {
|
this.crud.query.material_type_id = this.materOptCode
|
||||||
'materOpt_code': this.materOptCode
|
this.crud.toQuery()
|
||||||
}
|
|
||||||
crudMaterialbase.getMaterOptType(param).then(res => {
|
|
||||||
this.class_idStr = res.class_idStr
|
|
||||||
this.crud.query.class_idStr = res.class_idStr
|
|
||||||
this.crud.toQuery()
|
|
||||||
this.queryClassId()
|
|
||||||
})
|
|
||||||
},
|
|
||||||
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
|
|
||||||
})
|
|
||||||
})
|
|
||||||
},
|
},
|
||||||
handleSelectionChange(val, row) {
|
handleSelectionChange(val, row) {
|
||||||
if (this.isSingle) {
|
if (this.isSingle) {
|
||||||
@@ -185,21 +151,6 @@ export default {
|
|||||||
this.crud.resetQuery(false)
|
this.crud.resetQuery(false)
|
||||||
this.$emit('update:dialogShow', false)
|
this.$emit('update:dialogShow', false)
|
||||||
this.$emit('setMaterValue', this.rows)
|
this.$emit('setMaterValue', 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)
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user