|
@@ -91,9 +91,10 @@
|
|
@selection-change="handleSelectionChange"
|
|
@selection-change="handleSelectionChange"
|
|
>
|
|
>
|
|
<el-table-column type="selection" width="55" align="center" />
|
|
<el-table-column type="selection" width="55" align="center" />
|
|
- <el-table-column label="工具编号" align="center" prop="id" />
|
|
|
|
<el-table-column label="工具品种" align="center" prop="toolName" />
|
|
<el-table-column label="工具品种" align="center" prop="toolName" />
|
|
<el-table-column label="工具别名" align="center" prop="aliasName" />
|
|
<el-table-column label="工具别名" align="center" prop="aliasName" />
|
|
|
|
+ <el-table-column label="大类" align="center" prop="ancestors" :formatter="(row)=>getTypeName(row,1)"/>
|
|
|
|
+ <el-table-column label="二级分类" align="center" prop="ancestors" :formatter="(row)=>getTypeName(row,2)"/>
|
|
<el-table-column label="规格标准说明" align="center" prop="specifications" />
|
|
<el-table-column label="规格标准说明" align="center" prop="specifications" />
|
|
<el-table-column label="举例" align="center" prop="example" />
|
|
<el-table-column label="举例" align="center" prop="example" />
|
|
<el-table-column label="描述" align="center" prop="describe" />
|
|
<el-table-column label="描述" align="center" prop="describe" />
|
|
@@ -115,13 +116,13 @@
|
|
<el-button
|
|
<el-button
|
|
link
|
|
link
|
|
type="primary"
|
|
type="primary"
|
|
- icon="Edit"
|
|
|
|
|
|
+ icon="Memo"
|
|
@click="handlePageToToolsMaterial(scope.row)"
|
|
@click="handlePageToToolsMaterial(scope.row)"
|
|
>物料管理</el-button
|
|
>物料管理</el-button
|
|
>
|
|
>
|
|
<el-button
|
|
<el-button
|
|
link
|
|
link
|
|
- type="primary"
|
|
|
|
|
|
+ type="danger"
|
|
icon="Delete"
|
|
icon="Delete"
|
|
@click="handleDelete(scope.row)"
|
|
@click="handleDelete(scope.row)"
|
|
>删除</el-button
|
|
>删除</el-button
|
|
@@ -256,13 +257,6 @@ import useSearchForm from "./hooks/useSearchForm.js";
|
|
import useSubmitForm from "./hooks/useSubmitForm.js";
|
|
import useSubmitForm from "./hooks/useSubmitForm.js";
|
|
import useTable from "./hooks/useTable.js";
|
|
import useTable from "./hooks/useTable.js";
|
|
|
|
|
|
-import {
|
|
|
|
- listPost,
|
|
|
|
- addPost,
|
|
|
|
- delPost,
|
|
|
|
- getPost,
|
|
|
|
- updatePost,
|
|
|
|
-} from "@/api/system/post";
|
|
|
|
import { listTools, queryToolDict } from "@/api/bussiness";
|
|
import { listTools, queryToolDict } from "@/api/bussiness";
|
|
|
|
|
|
const { proxy } = getCurrentInstance();
|
|
const { proxy } = getCurrentInstance();
|
|
@@ -294,13 +288,35 @@ const getList = (params = {}) => {
|
|
};
|
|
};
|
|
// 大类的下拉选项
|
|
// 大类的下拉选项
|
|
const levelOneDict = ref([]);
|
|
const levelOneDict = ref([]);
|
|
|
|
+const levelTowDictAll = ref([])
|
|
// 获取大类的下拉选项
|
|
// 获取大类的下拉选项
|
|
const updateTypeOneDict = () => {
|
|
const updateTypeOneDict = () => {
|
|
queryToolDict("1").then((data) => {
|
|
queryToolDict("1").then((data) => {
|
|
levelOneDict.value = data || [];
|
|
levelOneDict.value = data || [];
|
|
});
|
|
});
|
|
};
|
|
};
|
|
|
|
+
|
|
|
|
+// 获取所有二级类别
|
|
|
|
+const updateTypeTwoDictAll = () => {
|
|
|
|
+ queryToolDict("2").then((data) => {
|
|
|
|
+ levelTowDictAll.value = data || [];
|
|
|
|
+ });
|
|
|
|
+};
|
|
updateTypeOneDict();
|
|
updateTypeOneDict();
|
|
|
|
+updateTypeTwoDictAll();
|
|
|
|
+// 根据类型获取对应类别的中文
|
|
|
|
+const getTypeName = (row,level) => {
|
|
|
|
+ const ancestorsList = row.ancestors.split(',');
|
|
|
|
+ const targetId = ancestorsList[level];
|
|
|
|
+ let target = null;
|
|
|
|
+ if(level === 1){
|
|
|
|
+ target = levelOneDict.value.find(item => +item.id === +targetId);
|
|
|
|
+ }else {
|
|
|
|
+ target = levelTowDictAll.value.find(item => +item.id === +targetId);
|
|
|
|
+ }
|
|
|
|
+ return target ? target.label : targetId
|
|
|
|
+}
|
|
|
|
+
|
|
// 搜索表单
|
|
// 搜索表单
|
|
const {
|
|
const {
|
|
queryParams,
|
|
queryParams,
|