|
@@ -10,7 +10,22 @@
|
|
|
<div class="binContainer">
|
|
|
<div class="processTree">
|
|
|
<el-scrollbar>
|
|
|
- <el-input v-model="list1SearchStr" placeholder="搜索工序名称" />
|
|
|
+ <el-select
|
|
|
+ v-model="list1SearchGroupDictKey"
|
|
|
+ placeholder="搜索工序分组"
|
|
|
+ clearable
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="dict in dictsArray"
|
|
|
+ :label="dict.dictLabel"
|
|
|
+ :value="dict.dictValue"
|
|
|
+ />
|
|
|
+ </el-select>
|
|
|
+ <el-input
|
|
|
+ v-model="list1SearchStr"
|
|
|
+ placeholder="搜索工序名称"
|
|
|
+ clearable
|
|
|
+ />
|
|
|
<el-collapse v-model="activeNames">
|
|
|
<el-collapse-item
|
|
|
v-for="(pProcess, pIndex) in showList"
|
|
@@ -319,8 +334,15 @@ const download = () => {};
|
|
|
const activeNames = ref([0]);
|
|
|
const list1 = ref([]);
|
|
|
const list1SearchStr = ref("");
|
|
|
+const list1SearchGroupDictKey = ref("");
|
|
|
const showList = computed(() => {
|
|
|
- const array = _.cloneDeep(list1.value);
|
|
|
+ let array = _.cloneDeep(list1.value);
|
|
|
+ if (list1SearchGroupDictKey.value) {
|
|
|
+ array = array.filter((item) => {
|
|
|
+ return item.workSection === list1SearchGroupDictKey.value;
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
array.forEach((item) => {
|
|
|
item.baseOperationList = item.baseOperationList.filter((op) => {
|
|
|
return op.operationName.includes(list1SearchStr.value);
|
|
@@ -399,8 +421,27 @@ const cancelInfo = () => {
|
|
|
const loadTreeData = () => {
|
|
|
processTreeList().then((res) => {
|
|
|
list1.value = res.data ?? [];
|
|
|
+ filterDicts();
|
|
|
});
|
|
|
};
|
|
|
+
|
|
|
+// 用于搜索的数据字典数组
|
|
|
+const dictsArray = ref([]);
|
|
|
+// 从dicts?.workshop_section筛选出list1中返回的字典值,用于最上方的选择框
|
|
|
+const filterDicts = () => {
|
|
|
+ const workSectionArray = list1.value.map((item) => {
|
|
|
+ return item.workSection;
|
|
|
+ });
|
|
|
+
|
|
|
+ const arr = [];
|
|
|
+ dicts?.workshop_section?.forEach((item) => {
|
|
|
+ if (workSectionArray.includes(item?.dictValue)) {
|
|
|
+ arr.push(_.cloneDeep(item));
|
|
|
+ }
|
|
|
+ });
|
|
|
+ dictsArray.value = arr;
|
|
|
+};
|
|
|
+
|
|
|
const cancelStatus = ref(true);
|
|
|
//通过id获取现存储信息
|
|
|
const loadProcessesFlow = async () => {
|