From 8de62cfb1327e490390879c8bef27440219f5a9d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=83=91=E6=98=8E=E6=A2=81?= <2429105222@qq.com> Date: Thu, 16 Mar 2023 11:52:31 +0800 Subject: [PATCH] =?UTF-8?q?=E8=80=97=E6=9D=90=E5=AD=97=E5=85=B8=E7=BB=B4?= =?UTF-8?q?=E6=8A=A4=E7=BC=96=E8=BE=91=E6=B7=BB=E5=8A=A0=E9=99=A2=E5=86=85?= =?UTF-8?q?=E5=88=86=E7=B1=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/basic/product/productEdit.vue | 52 ++++++++++++++++++++++++- 1 file changed, 50 insertions(+), 2 deletions(-) diff --git a/src/views/basic/product/productEdit.vue b/src/views/basic/product/productEdit.vue index eb1573a9..16169242 100644 --- a/src/views/basic/product/productEdit.vue +++ b/src/views/basic/product/productEdit.vue @@ -230,12 +230,24 @@ - + + + + + + @@ -415,6 +427,9 @@ import {isBlank} from "@/utils/strUtil"; import {filterByUuid} from "@/api/basic/product/udiInfo"; import ProductSingleEdit from "@/views/basic/product/productSingleEdit"; import selectErp from "./udiInfoselectErpUdi"; +import {getListMenu} from "@/api/basic/basicHospType"; +import "@riophae/vue-treeselect/dist/vue-treeselect.css"; +import Treeselect from "@riophae/vue-treeselect"; export default { @@ -462,6 +477,7 @@ export default { detailList: [], defaultSys: null, isImport: false, + fromDeptOptions: [], selectErpDialogVisible: false, //选入ERP产品 editSingleDiDialogVisible: false, editSingleFormat: { @@ -476,13 +492,15 @@ export default { }, components: { selectErp, - ProductSingleEdit + ProductSingleEdit, + Treeselect }, created() { if(this.editQuery.isDateBy==1){ this.editQuery.recentDateTime=this.editQuery.recentDateTime/24; } console.log(this.editQuery) + this.getTreeselect(); this.useMutiChange(true) this.getThirdSysDetail(); let ttquery = { @@ -599,6 +617,25 @@ export default { .catch(() => { }); }, + getTreeselect() { + getListMenu().then(response => { + this.fromDeptOptions = []; + const menu = {id: 0, name: '主类目', children: []}; + menu.children = this.handleTree(response.data,"code", "parentCode"); + this.fromDeptOptions.push(menu); + }); + }, + /** 转换菜单数据结构 */ + normalizer(node) { + if (node.children && !node.children.length) { + delete node.children; + } + return { + id: node.code, + label: node.name, + children: node.children + }; + }, useDyCheckChange(val) { this.editQuery.useNum = 0; }, @@ -668,5 +705,16 @@ export default {