Bläddra i källkod

5.25合并树形包含下一级

AlanWong 2 år sedan
förälder
incheckning
69017b7de2

+ 1 - 1
src/benyun/components/byBill/byBill.vue

@@ -378,7 +378,7 @@ export default class ByBill extends VueViews {
     border-right: solid #EEE 1px;
     padding-right:16px;
     flex-shrink: 0;
-    // box-sizing: border-box;
+    min-height: 820px;
     .bill-tab{
       width: 200px;
       height: 100%;

+ 35 - 19
src/views/audit/agencyGoods/index.vue

@@ -3,8 +3,9 @@
 		<div class="bill-left">
 			<div class="bill-tab">
 				<div class="tab-title">导航</div>
-				<el-tree :data="data" node-key="id" :default-expanded-keys="expandedKeys" :props="props"
-					@node-click="handleNodeClick"></el-tree>
+<!-- 				<el-tree :data="data" node-key="id" :default-expanded-keys="expandedKeys" :props="props"
+					@node-click="handleNodeClick"></el-tree> -->
+					<side-tree :propConfig="treeConfig" @onChange="onChangeTree" />
 			</div>
 		</div>
 		<div class="bill-main">
@@ -55,6 +56,21 @@
 		popTitle : any = ''
 		radio : any = 0
 		dialogFormVisible : boolean = false
+		treeConfig = {
+			attr: {
+				retConfig: {
+					id: 'id',
+					name: 'name'
+				},
+				defaultExpandAll: true,
+				label: 'name',
+				resType: 'data'
+			},
+			request: {
+				url: '/maindata/maindataMaterialOrganizationCategory/treeList',
+				method: 'GET'
+			}
+		}
 		config : any = {
 			search: {
 				attr: {
@@ -231,11 +247,26 @@
 			]
 		}
 		mounted() {
-			this.getTreeList()
+			// this.getTreeList()
 			this.timer = setInterval(() => {
 				this.getDataList()
 			}, 300)
 		}
+		//点击树获取数据
+		onChangeTree(e : any) {
+			this.parentId = e.id[0]
+			api.childrenTreeList({ id: e.id[0] }, 'maindataMaterialOrganizationCategory').then((res : any) => {
+				if (res.code === 200) {
+					(this.$refs.moduleView as any).setTableValue(res.data);
+					let page = {
+						pageNo: res.data.current, //当前页
+						pageSize: res.data.size, //每页条数
+						total: res.data.total //总条数
+					};
+					(this.$refs.moduleView as any).setPage(page)
+				}
+			})
+		}
 		// 获取树型导航数据
 		getTreeList() {
 			api.treeList('maindataMaterialOrganizationCategory').then((res : any) => {
@@ -402,21 +433,6 @@
 				});
 			});
 		}
-		// 导航切换
-		handleNodeClick(e : any) {
-			this.parentId = e.id
-			api.childrenTreeList({ id: e.id }, 'maindataMaterialOrganizationCategory').then((res : any) => {
-				if (res.code === 200) {
-					(this.$refs.moduleView as any).setTableValue(res.data);
-					let page = {
-						pageNo: res.data.current, //当前页
-						pageSize: res.data.size, //每页条数
-						total: res.data.total //总条数
-					};
-					(this.$refs.moduleView as any).setPage(page)
-				}
-			})
-		}
 		// 刷新
 		onRefresh(){
 			this.loading = this.$loading({ target: '.main-container' });
@@ -469,7 +485,7 @@
 			border-right: solid #EEE 1px;
 			padding-right: 16px;
 			flex-shrink: 0;
-
+			height: 740px;
 			// box-sizing: border-box;
 			.bill-tab {
 				width: 150px;

+ 9 - 9
src/views/audit/orderTask/index.vue

@@ -42,11 +42,6 @@
 					attr: {
 						size: 'small',
 						readonly: false,
-						rules: {
-							// orderNumber: [{
-							// 	required: true, message: '请输入单据编号', trigger: 'blur'
-							// }]
-						}
 					},
 					columns: [
 						[
@@ -284,7 +279,7 @@
 				},
 				tool: {
 					tools: {
-						delete: true,
+						// delete: true,
 						search: true,
 						refresh: true
 					}
@@ -309,6 +304,11 @@
 							title: '机构名称',
 							field: 'organizationName',
 						},
+						{
+							width: 80,
+							title: '来源类型',
+							field: 'sourceType',
+						},
 						{
 							width: 130,
 							title: '交货人',
@@ -345,8 +345,8 @@
 							title: '操作',
 							action: true,
 							plugins: [{
-								icon: 'el-icon-edit',
-								name: '编辑',
+								// icon: 'el-icon-edit',
+								name: '查看',
 								audit: '',
 								event: {
 									click: (e : any) => {
@@ -354,7 +354,7 @@
 									}
 								}
 							}, {
-								name: '删除',
+								name: '反提交',
 								event: {
 									click: (item : any) => (this as any).doDelete2(item)
 								}

+ 16 - 20
src/views/audit/productClassification/index.vue

@@ -123,7 +123,6 @@
 			tool: {
 				tools: {
 					add: true,
-					// delete: true,
 					search: true,
 					refresh: true
 				}
@@ -244,14 +243,26 @@
 			]
 		}
 		mounted() {
-			this.getTreeList()
+			// this.getTreeList()
 			this.timer = setInterval(() => {
 				this.getDataList()
 			}, 500)
 		}
 		//点击树获取数据
-		onChangeTree(data:any){
-			console.log('点击结果:',data)
+		onChangeTree(e:any){
+			console.log('点击结果:',e)
+			this.parentId = e.id[0]
+			api.childrenTreeList({ id: e.id[0], pageNo: 1, pageSize: 999 }, 'maindataMaterialCategory').then((res : any) => {
+				if (res.code === 200) {
+					(this.$refs.moduleView as any).setTableValue(res.data);
+					let page = {
+						pageNo: res.data.current, //当前页
+						pageSize: res.data.size, //每页条数
+						total: res.data.total //总条数
+					};
+					(this.$refs.moduleView as any).setPage(page)
+				}
+			})
 		}
 		// 获取树型导航数据
 		getTreeList() {
@@ -422,21 +433,6 @@
 				});
 			});
 		}
-		// 导航切换
-		handleNodeClick(e : any) {
-			this.parentId = e.id
-			api.childrenTreeList({ id: e.id, pageNo: 1, pageSize: 999 }, 'maindataMaterialCategory').then((res : any) => {
-				if (res.code === 200) {
-					(this.$refs.moduleView as any).setTableValue(res.data);
-					let page = {
-						pageNo: res.data.current, //当前页
-						pageSize: res.data.size, //每页条数
-						total: res.data.total //总条数
-					};
-					(this.$refs.moduleView as any).setPage(page)
-				}
-			})
-		}
 		// 刷新
 		onRefresh(){
 			this.loading = this.$loading({ target: '.main-container' });
@@ -489,7 +485,7 @@
 			border-right: solid #EEE 1px;
 			padding-right: 16px;
 			flex-shrink: 0;
-
+			height: 740px;
 			// box-sizing: border-box;
 			.bill-tab {
 				width: 150px;

+ 44 - 28
src/views/audit/productManagement/index.vue

@@ -4,8 +4,9 @@
 			<div class="bill-left" v-show="isShow==='home'" key="item">
 				<div class="bill-tab">
 					<div class="bill-title">导航</div>
-					<el-tree :data="data" node-key="id" :default-expanded-keys="expandedKeys" :props="props"
-						@node-click="handleNodeClick"></el-tree>
+					<!-- 					<el-tree :data="data" node-key="id" :default-expanded-keys="expandedKeys" :props="props"
+						@node-click="handleNodeClick"></el-tree> -->
+					<side-tree :propConfig="treeConfig" @onChange="onChangeTree" />
 				</div>
 			</div>
 			<div class="bill-main" v-show="isShow==='home'" key="item2">
@@ -148,6 +149,21 @@
 				save: true,
 			}
 		}
+		treeConfig = {
+			attr: {
+				retConfig: {
+					id: 'id',
+					name: 'name'
+				},
+				defaultExpandAll: true,
+				label: 'name',
+				resType: 'data'
+			},
+			request: {
+				url: '/maindata/maindataMaterialCategory/treeList',
+				method: 'GET'
+			}
+		}
 		singleTable : any = {
 			attr: {
 				size: 'mini',
@@ -869,21 +885,26 @@
 			},
 		}
 		mounted() {
-			this.getTreeList()
+			// this.getTreeList()
 			this.getAttribute()
 			this.timer = setInterval(() => {
 				this.getDataList()
 			}, 500)
 		}
-		// 监听单表格数据
-		getSingleValue(e : any) {
-			// console.log('监听单表格 ==> ', e);
-			e.volume = (e.length * e.width * e.height).toFixed(2);
-		}
-		// 监听表格数据
-		getInputValue(e : any) {
-			// console.log('监听表格 ==> ', e);
-			e.volume = (e.length * e.width * e.height).toFixed(2);
+		//点击树获取数据
+		onChangeTree(e : any) {
+			this.categoryId = e.id[0]
+			other.single({ categoryId: e.id[0] }).then((res : any) => {
+				if (res.code === 200) {
+					(this.$refs.moduleView as any).setTableValue(res.data.records);
+					let page = {
+						pageNo: res.data.current, //当前页
+						pageSize: res.data.size, //每页条数
+						total: res.data.total //总条数
+					};
+					(this.$refs.moduleView as any).setPage(page)
+				}
+			})
 		}
 		// 保存编辑/新增
 		doFormData() {
@@ -1245,6 +1266,16 @@
 				});
 			});
 		}
+		// 监听单表格数据
+		getSingleValue(e : any) {
+			// console.log('监听单表格 ==> ', e);
+			e.volume = (e.length * e.width * e.height).toFixed(2);
+		}
+		// 监听表格数据
+		getInputValue(e : any) {
+			// console.log('监听表格 ==> ', e);
+			e.volume = (e.length * e.width * e.height).toFixed(2);
+		}
 		// 排序生成
 		forFun(data : any, i : number, v ?: any) {
 			if (data.list) {
@@ -1516,21 +1547,6 @@
 				});
 			});
 		}
-		// 导航切换
-		handleNodeClick(e : any) {
-			this.categoryId = e.id
-			other.single({ categoryId: e.id }).then((res : any) => {
-				if (res.code === 200) {
-					(this.$refs.moduleView as any).setTableValue(res.data.records);
-					let page = {
-						pageNo: res.data.current, //当前页
-						pageSize: res.data.size, //每页条数
-						total: res.data.total //总条数
-					};
-					(this.$refs.moduleView as any).setPage(page)
-				}
-			})
-		}
 		// 刷新
 		onRefresh() {
 			this.loading = this.$loading({ target: '.main-container' });
@@ -1602,7 +1618,7 @@
 			border-right: solid #EEE 1px;
 			padding-right: 16px;
 			flex-shrink: 0;
-
+			height: 740px;
 			// box-sizing: border-box;
 			.bill-tab {
 				width: 150px;

+ 1 - 1
src/views/audit/saleOrder/components/byBill/byBill.vue

@@ -388,7 +388,7 @@ export default class ByBill extends VueViews {
     border-right: solid #EEE 1px;
     padding-right:16px;
     flex-shrink: 0;
-    // box-sizing: border-box;
+		min-height: 820px;
     .bill-tab{
       width: 200px;
       height: 100%;

+ 7 - 0
src/views/audit/saleOrder/index.vue

@@ -310,6 +310,13 @@
 							width: 178,
 							title: '单据编号',
 							field: 'orderNumber',
+							// component: 'by-input',
+							// compConfig: {
+							// 	attr: {
+							// 		placeholder: '请输入单据编号',
+							// 		clearable: true
+							// 	}
+							// },
 							isDetail: true,
 						},
 						{

+ 39 - 23
src/views/audit/virtually/index.vue

@@ -3,7 +3,8 @@
 		<div class="bill-left">
 			<div class="bill-tab">
 				<div class="tab-title">导航</div>
-				<el-tree :data="data" node-key="id" :default-expanded-keys="expandedKeys" :props="props" @node-click="handleNodeClick"></el-tree>
+				<!-- 				<el-tree :data="data" node-key="id" :default-expanded-keys="expandedKeys" :props="props" @node-click="handleNodeClick"></el-tree> -->
+				<side-tree :propConfig="treeConfig" @onChange="onChangeTree" />
 			</div>
 		</div>
 		<div class="bill-main">
@@ -36,7 +37,7 @@
 		// 左边
 		data : any = []
 		expandedKeys : any = []
-		parentId:any=''
+		parentId : any = ''
 		props = {
 			label: 'name',
 			children: 'children'
@@ -48,6 +49,21 @@
 		popTitle : any = ''
 		radio : any = 0
 		dialogFormVisible : boolean = false
+		treeConfig = {
+			attr: {
+				retConfig: {
+					id: 'id',
+					name: 'name'
+				},
+				defaultExpandAll: true,
+				label: 'name',
+				resType: 'data'
+			},
+			request: {
+				url: '/maindata/maindataMaterialVmcategory/treeList',
+				method: 'GET'
+			}
+		}
 		config : any = {
 			search: {
 				attr: {
@@ -224,11 +240,26 @@
 			]
 		}
 		mounted() {
-			this.getTreeList()
+			// this.getTreeList()
 			this.timer = setInterval(() => {
 				this.getDataList()
 			}, 500)
 		}
+		//点击树获取数据
+		onChangeTree(e : any) {
+			this.parentId = e.id[0]
+			api.childrenTreeList({ id: e.id[0] }, 'maindataMaterialVmcategory').then((res : any) => {
+				if (res.code === 200) {
+					(this.$refs.moduleView as any).setTableValue(res.data);
+					let page = {
+						pageNo: res.data.current, //当前页
+						pageSize: res.data.size, //每页条数
+						total: res.data.total //总条数
+					};
+					(this.$refs.moduleView as any).setPage(page)
+				}
+			})
+		}
 		// 获取树型导航数据
 		getTreeList() {
 			api.treeList('maindataMaterialVmcategory').then((res : any) => {
@@ -286,7 +317,7 @@
 			clearInterval(this.timer)
 			let query = (this.$refs.moduleView as any).getQuery();
 			query.parentId = this.parentId;
-			let newData:any = {}
+			let newData : any = {}
 			for (let key in query) {
 				if (query[key].toString()) {
 					newData[key] = query[key]
@@ -325,8 +356,8 @@
 			this.popTitle = '编辑'
 			this.dialogFormVisible = true;
 			this.radio = e.status
-			api.single({id:e.parentId},'maindataMaterialVmcategory').then((res:any) =>{
-				if(res.code===200){
+			api.single({ id: e.parentId }, 'maindataMaterialVmcategory').then((res : any) => {
+				if (res.code === 200) {
 					e.parentName = res.data.name
 					setTimeout(() => {
 						if ((this as any).$refs.addFormId) (this as any).$refs.addFormId.setValue(e);
@@ -397,23 +428,8 @@
 				});
 			});
 		}
-		// 导航切换
-		handleNodeClick(e : any) {
-			this.parentId=e.id
-			api.childrenTreeList({ id: e.id }, 'maindataMaterialVmcategory').then((res : any) => {
-				if (res.code === 200) {
-					(this.$refs.moduleView as any).setTableValue(res.data);
-					let page = {
-						pageNo: res.data.current, //当前页
-						pageSize: res.data.size, //每页条数
-						total: res.data.total //总条数
-					};
-					(this.$refs.moduleView as any).setPage(page)
-				}
-			})
-		}
 		// 刷新
-		onRefresh(){
+		onRefresh() {
 			this.loading = this.$loading({ target: '.main-container' });
 			(this as any).$refs.moduleView.clearSearch();
 			api.pageList({}, 'maindataMaterialVmcategory').then((res : any) => {
@@ -464,7 +480,7 @@
 			border-right: solid #EEE 1px;
 			padding-right: 16px;
 			flex-shrink: 0;
-
+			height: 740px;
 			// box-sizing: border-box;
 			.bill-tab {
 				width: 150px;