Kaynağa Gözat

树形导航查询问题

AlanWong 2 yıl önce
ebeveyn
işleme
d19bfb7fac

+ 17 - 1
src/api/currency.ts

@@ -7,6 +7,13 @@ function treeList(url : any) {
 		method: 'GET',
 	})
 }
+// 树形查询不包含禁用
+function treeUseList(url : any) {
+	return request({
+		url: '/maindata/' + url + '/treeUseList',
+		method: 'GET',
+	})
+}
 // 通过父级id查子集
 function childrenTreeList(data : any, url : any) {
 	return request({
@@ -15,6 +22,14 @@ function childrenTreeList(data : any, url : any) {
 		params: data
 	})
 }
+// 根据分类ID(数组)分页查询数据
+function ByCategoryPage(data : any, url : any) {
+	return request({
+		url: '/maindata/' + url + '/ByCategoryPage',
+		method: 'GET',
+		params: data
+	})
+}
 // 通过主建id查单条数据
 function single(data : any, url : any) {
 	return request({
@@ -31,7 +46,6 @@ function pageList(data : any, url : any) {
 		params: data
 	})
 }
-
 // 新增数据
 function saveList(data : any, url : any) {
 	return request({
@@ -58,7 +72,9 @@ function deleteList(data : any, url : any) {
 }
 export default {
 	treeList,
+	treeUseList,
 	childrenTreeList,
+	ByCategoryPage,
 	single,
 	pageList,
 	saveList,

+ 9 - 6
src/api/order.ts

@@ -7,7 +7,13 @@ function treeList(url : any) {
 		method: 'GET',
 	})
 }
-
+// 树形查询不包含禁用
+function treeUseList(url : any) {
+	return request({
+		url: '/supply/' + url + '/treeUseList',
+		method: 'GET',
+	})
+}
 // 分页查询数据
 function pageList(data : any, url : any) {
 	return request({
@@ -16,7 +22,6 @@ function pageList(data : any, url : any) {
 		params: data
 	})
 }
-
 // 保存数据
 function saveList(data : any, url : any) {
 	return request({
@@ -49,7 +54,6 @@ function cancelSubmission(data : any, url : any) {
 		params: data
 	})
 }
-
 // 修改数据
 function updateList(data : any, url : any) {
 	return request({
@@ -82,7 +86,6 @@ function ordersaccepting(data : any, url : any) {
 		params: data
 	})
 }
-
 // 拆单
 function splitOrder(data : any, url : any) {
 	return request({
@@ -114,7 +117,6 @@ function getInventoryByStoridAndSkuid(data : any) {
 		params: data
 	})
 }
-// 
 // 批量根据获取仓位主键和物料SKU主键获取对应库存数量
 function getInventoryByStoridsAndSkuids(data : any) {
 	return request({
@@ -124,7 +126,7 @@ function getInventoryByStoridsAndSkuids(data : any) {
 	})
 }
 // 详情
-function single(data:any, url : any) {
+function single(data : any, url : any) {
 	return request({
 		url: '/supply/' + url + '/single',
 		method: 'GET',
@@ -133,6 +135,7 @@ function single(data:any, url : any) {
 }
 export default {
 	treeList,
+	treeUseList,
 	pageList,
 	saveList,
 	outbound,

+ 2 - 2
src/components/Assembly/material.vue

@@ -1,7 +1,7 @@
 <template>
 	<div>
-		<el-tag size='mini' :type="propValue===1?'primary':'danger'"
-			disable-transitions>{{propValue===1?'正常':'禁用'}}</el-tag>
+		<el-tag size='mini' :type="propValue===0?'primary':'danger'"
+			disable-transitions>{{propValue===0?'正常':'禁用'}}</el-tag>
 	</div>
 </template>
 <script lang="ts">

+ 1 - 1
src/components/Assembly/nature.vue

@@ -1,7 +1,7 @@
 <template>
 	<div>
 		<el-tag size='mini' type="primary"
-			disable-transitions>{{propValue===1?'销售属性':'基本属性'}}</el-tag>
+			disable-transitions>{{propValue===0?'销售属性':'基本属性'}}</el-tag>
 	</div>
 </template>
 <script lang="ts">

+ 10 - 3
src/views/audit/agencyGoods/index.vue

@@ -250,10 +250,17 @@
 		}
 		//点击树获取数据
 		onChangeTree(e : any) {
-			this.parentId = e.id[0]
-			api.childrenTreeList({ id: e.id[0] }, 'maindataMaterialOrganizationCategory').then((res : any) => {
+			this.parentId = e.id;
+			let data : any = {};
+			if (e.id.length > 1) {
+				data.ids = e.id;
+				if(data.ids[0] === 100) data.ids.shift(); 
+			} else {
+				data.parentId = e.id;
+			}
+			api.childrenTreeList(data, 'maindataMaterialOrganizationCategory').then((res : any) => {
 				if (res.code === 200) {
-					(this.$refs.moduleView as any).setTableValue(res.data);
+					(this.$refs.moduleView as any).setTableValue(res.data.records);
 					let page = {
 						pageNo: res.data.current, //当前页
 						pageSize: res.data.size, //每页条数

+ 12 - 12
src/views/audit/attribute/index.vue

@@ -9,8 +9,8 @@
 		<el-dialog :title="popTitle+'属性'" :visible.sync="dialogFormVisible" width="50%">
 			<by-form :propConfig="addConfig" ref="addFormId">
 				<template v-slot:status class="clearfix">
-					<el-radio class="fl" style="margin-top: 8px;" v-model="radio" :label="1">正常</el-radio>
-					<el-radio class="fl" style="margin-top: 8px;" v-model="radio" :label="2">禁用</el-radio>
+					<el-radio class="fl" style="margin-top: 8px;" v-model="radio" :label="0">正常</el-radio>
+					<el-radio class="fl" style="margin-top: 8px;" v-model="radio" :label="1">禁用</el-radio>
 				</template>
 				<template v-slot:attributeValue="{value}">
 					<div style="margin-bottom: 20px;" v-if="tableConfig.length>0">
@@ -66,7 +66,7 @@
 		timeNum = 0;
 		timer : any = null
 		popTitle : any = ''
-		radio : any = 1
+		radio : any = 0
 		dialogFormVisible : boolean = false
 		tableConfig : any = []
 		config : any = {
@@ -99,10 +99,10 @@
 								placeholder: '请选择数据',
 								clearable: true,
 								data: [{
-									value: 1,
+									value: 0,
 									label: '正常'
 								}, {
-									value: 2,
+									value: 1,
 									label: '禁用'
 								}]
 							}
@@ -119,10 +119,10 @@
 								placeholder: '请选择数据',
 								clearable: true,
 								data: [{
-									value: 1,
+									value: 0,
 									label: '销售属性'
 								}, {
-									value: 2,
+									value: 1,
 									label: '基本属性'
 								}]
 							}
@@ -229,10 +229,10 @@
 								placeholder: '请选择数据',
 								clearable: true,
 								data: [{
-									value: 1,
+									value: 0,
 									label: '销售属性'
 								}, {
-									value: 2,
+									value: 1,
 									label: '基本属性'
 								}]
 							}
@@ -358,13 +358,13 @@
 		}
 		// 打开编辑
 		openEdit(e : any) {
+			console.log('编辑 ==> ', e);
 			this.popTitle = '编辑'
 			this.dialogFormVisible = true;
 			this.radio = e.status
 			this.tableConfig = JSON.parse(e.attributeValue);
-			e.attributeTypeName = e.attributeType === 1 ? '销售属性' : '基本属性';
+			e.attributeTypeName = e.attributeType === 0 ? '销售属性' : '基本属性';
 			setTimeout(() => {
-				console.log('编辑 ==> ', e);
 				if ((this as any).$refs.addFormId) (this as any).$refs.addFormId.setValue(e);
 			}, 0)
 		}
@@ -425,7 +425,7 @@
 			});
 		}
 		// 刷新
-		onRefresh(){
+		onRefresh() {
 			this.loading = this.$loading({ target: '.main-container' });
 			(this as any).$refs.moduleView.clearSearch();
 			api.pageList({}, 'maindataMaterialAttribute').then((res : any) => {

+ 5 - 5
src/views/audit/brand/index.vue

@@ -9,8 +9,8 @@
 		<el-dialog :title="popTitle+'品牌'" :visible.sync="dialogFormVisible" width="30%">
 			<by-form :propConfig="addConfig" ref="addFormId">
 				<template v-slot:status class="clearfix">
-					<el-radio class="fl" style="margin-top: 8px;" v-model="radio" :label="1">正常</el-radio>
-					<el-radio class="fl" style="margin-top: 8px;" v-model="radio" :label="2">禁用</el-radio>
+					<el-radio class="fl" style="margin-top: 8px;" v-model="radio" :label="0">正常</el-radio>
+					<el-radio class="fl" style="margin-top: 8px;" v-model="radio" :label="1">禁用</el-radio>
 				</template>
 			</by-form>
 			<div slot="footer" class="dialog-footer">
@@ -31,7 +31,7 @@
 		timeNum = 0;
 		timer : any = null
 		popTitle : any = ''
-		radio : any = 1
+		radio : any = 0
 		dialogFormVisible : boolean = false
 		config : any = {
 			search: {
@@ -75,10 +75,10 @@
 								placeholder: '请选择状态',
 								clearable: true,
 								data: [{
-									value: 1,
+									value: 0,
 									label: '正常'
 								}, {
-									value: 2,
+									value: 1,
 									label: '禁用'
 								}]
 							}

+ 491 - 0
src/views/audit/distributor/index.vue

@@ -0,0 +1,491 @@
+<template>
+	<div class="my-container">
+		<div class="bill-left">
+			<div class="bill-tab">
+				<div class="tab-title">导航</div>
+				<side-tree :propConfig="treeConfig" @onChange="onChangeTree" ref="sideTree" />
+			</div>
+		</div>
+		<div class="bill-main">
+			<module-view :propConfig="config" ref="moduleView" @pagination="getDataList" @search="getDataList"
+				@resert="getDataList" @clickHandle="clickHandle" @detail="openEdit" @onRefresh="onRefresh">
+			</module-view>
+		</div>
+		<!-- 新增/编辑弹窗 -->
+		<el-dialog :title="popTitle+'供应商'" :visible.sync="dialogFormVisible" width="30%">
+			<by-form :propConfig="addConfig" ref="addFormId">
+				<template v-slot:status class="clearfix">
+					<el-radio class="fl" style="margin-top: 8px;" v-model="radio" :label="1">正常</el-radio>
+					<el-radio class="fl" style="margin-top: 8px;" v-model="radio" :label="2">禁用</el-radio>
+				</template>
+			</by-form>
+			<div slot="footer" class="dialog-footer">
+				<el-button @click="dialogFormVisible = false">取 消</el-button>
+				<el-button type="primary" @click="confirm">确 定</el-button>
+			</div>
+		</el-dialog>
+	</div>
+</template>
+<script lang="ts">
+	import { Component, Prop, Vue, Watch } from "vue-property-decorator";
+	import api from "@/api/currency";
+	import Assembly from "@/components/Assembly/material.vue";
+	@Component
+	export default class Supplier extends Vue {
+		baseURL : any = process.env.VUE_APP_BASE_API
+		loading : any = null
+		timeNum = 0;
+		timer : any = null
+		popTitle : any = ''
+		radio : any = 1
+		dialogFormVisible : boolean = false
+		parentId: any = '';
+		treeConfig = {
+			attr: {
+				retConfig: {
+					id: 'id',
+					name: 'name'
+				},
+				defaultExpandAll: true,
+				label: 'name',
+				resType: 'data'
+			},
+			request: {
+				url: '/maindata/maindataOrganizationCategory/treeList',
+				method: 'GET'
+			}
+		}
+		config : any = {
+			search: {
+				attr: {
+					size: 'mini'
+				},
+				columns: [
+					[{
+						span: 6,
+						label: '名称',
+						prop: 'name',
+						component: 'by-input',
+						labelWidth: '70px',
+						compConfig: {
+							attr: {
+								placeholder: '请输入名称',
+								clearable: true
+							},
+						},
+					}, {
+						span: 6,
+						label: '负责人',
+						prop: 'contacts',
+						component: 'by-input',
+						labelWidth: '70px',
+						compConfig: {
+							attr: {
+								placeholder: '请输入负责人',
+								clearable: true
+							}
+						}
+					},
+					{
+						span: 6,
+						label: '状态',
+						prop: 'status',
+						labelWidth: '70px',
+						component: 'by-select',
+						compConfig: {
+							attr: {
+								placeholder: '请选择状态',
+								clearable: true,
+								data: [{
+									value: 1,
+									label: '正常'
+								}, {
+									value: 2,
+									label: '禁用'
+								}]
+							}
+						}
+					},
+					]
+				]
+			},
+			tool: {
+				tools: {
+					add: true,
+					delete: true,
+					search: true,
+					refresh: true
+				}
+			},
+			table: {
+				attr: {
+					size: 'mini',
+					seq: true,
+					align: 'center',
+					checkbox: true,
+					height: 600
+				},
+				columns: [{
+					title: '名称',
+					field: 'name',
+					isDetail: true,
+					width: 300,
+				},
+				{
+					title: '负责人',
+					field: 'contacts',
+					width: 300,
+				},
+				{
+					width: 80,
+					title: '状态',
+					field: 'status',
+					component: Assembly,
+				}, {
+					width: 500,
+					title: '备注',
+					field: 'remark',
+				}, {
+					width: 120,
+					title: '操作',
+					action: true,
+					plugins: [{
+						icon: 'el-icon-edit',
+						name: '编辑',
+						audit: '',
+						event: {
+							click: (item : any) => {
+								(this as any).openEdit(item)
+							}
+						}
+					}, {
+						name: '删除',
+						event: {
+							click: (item : any) => (this as any).doDelete2(item)
+						}
+					}]
+				}]
+			},
+		}
+		addConfig = {
+			attr: {
+				size: 'small',
+				rules: {
+					name: [{
+						required: true, message: '请输入名称', trigger: 'blur'
+					}],
+					contacts: [{
+						required: true, message: '请输入负责人', trigger: 'blur'
+					}]
+				}
+			},
+			columns: [
+				[
+					{
+						span: 23,
+						labelWidth: '70px',
+						label: '名称',
+						prop: 'name',
+						component: 'by-input',
+					},
+					{
+						span: 23,
+						labelWidth: '70px',
+						label: '负责人',
+						prop: 'contacts',
+						component: 'by-input',
+					},
+					{
+						span: 23,
+						labelWidth: '70px',
+						label: '状态',
+						slot: true,
+						prop: 'status',
+					},
+				],
+				[
+					{
+						span: 23,
+						labelWidth: '70px',
+						label: '备注',
+						prop: 'remark',
+						component: 'by-input',
+						compConfig: {
+							attr: {
+								size: 'mini',
+								placeholder: '请输入备注',
+								type: 'textarea'
+							},
+						}
+					},
+				]
+			]
+		}
+		mounted() {
+			this.timer = setInterval(() => {
+				this.getDataList()
+			}, 300)
+		}
+		//点击树获取数据
+		onChangeTree(e : any) {
+			console.log('点击结果:', e)
+			this.parentId = e.id[0]
+			api.childrenTreeList({ id: e.id[0], pageNo: 1, pageSize: 999 }, 'maindataMaterialDistributor').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)
+				}
+			})
+		}
+		// 确认新增/编辑
+		confirm() {
+			(this as any).$refs.addFormId.validate().then(() => {
+				let query = (this as any).$refs.addFormId.getValue();
+				console.log(query);
+				query.status = this.radio;
+				this.dialogFormVisible = false;
+				if (this.popTitle === '新增') {
+					api.saveList(query, 'maindataMaterialDistributor').then((res : any) => {
+						if (res.code === 200) {
+							this.$message.success(this.popTitle + '成功!');
+							(this as any).$refs.sideTree.request();
+							this.getDataList();
+						} else this.$message.error(res.msg);
+					})
+				} else if (this.popTitle === '编辑') {
+					api.updateList(query, 'maindataMaterialDistributor').then((res : any) => {
+						if (res.code === 200) {
+							this.$message.success(this.popTitle + '成功!');
+							(this as any).$refs.sideTree.request();
+							this.getDataList();
+						} else this.$message.error(res.msg);
+					})
+				}
+			})
+		}
+		// 获取列表数据
+		getDataList() {
+			if (!this.$refs.moduleView) {
+				if (this.timeNum > 5) {
+					clearInterval(this.timer)
+				}
+				this.timeNum++;
+				return
+			}
+			clearInterval(this.timer)
+			let query = (this.$refs.moduleView as any).getQuery();
+			api.pageList(query, 'maindataMaterialDistributor').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)
+				} else this.$message.error(res.msg);
+			})
+		}
+		// 工具栏方法
+		clickHandle(e : any) {
+			if (e === 'onAdd') this.onAdd();
+			if (e === 'onDelete') this.onDelete();
+			if (e === 'onExport') this.onExport();
+		}
+		// 打开新增
+		onAdd() {
+			this.popTitle = '新增'
+			this.dialogFormVisible = true;
+			this.radio = 1
+			setTimeout(() => {
+				if ((this as any).$refs.addFormId) (this as any).$refs.addFormId.setValue('');
+			}, 0)
+		}
+		// 打开编辑
+		openEdit(e : any) {
+			this.popTitle = '编辑'
+			this.dialogFormVisible = true;
+			this.radio = e.status
+			setTimeout(() => {
+				if ((this as any).$refs.addFormId) (this as any).$refs.addFormId.setValue(e);
+			}, 0)
+		}
+		// 工具栏删除
+		onDelete() {
+			let selectData = (this.$refs.moduleView as any).getSelectData()
+			let ids = '';
+			if (selectData.length > 0) {
+				selectData.map((v : any) => {
+					ids += v.id + ','
+				})
+			} else return this.$message.warning('请选择删除数据');
+			ids = ids.slice(0, ids.length - 1);
+			this.$confirm('确定删除吗,此操作不能撤销!', '注意', {
+				confirmButtonText: '确定',
+				cancelButtonText: '取消',
+				type: 'warning',
+				center: true
+			}).then(() => {
+				api.deleteList({ ids: ids }, 'maindataMaterialDistributor').then((res : any) => {
+					if (res.code === 200) {
+						(this as any).$refs.sideTree.request();
+						this.getDataList();
+						this.$message.success('删除成功!');
+					} else this.$message.error(res.msg);
+				})
+			}).catch(() => this.$message.info('已取消删除'));
+		}
+		// 操作删除
+		doDelete2(item : any) {
+			this.$confirm('确定删除吗,此操作不能撤销!', '注意', {
+				confirmButtonText: '确定',
+				cancelButtonText: '取消',
+				type: 'warning',
+				center: true
+			}).then(() => {
+				api.deleteList({ ids: item.id }, 'maindataMaterialDistributor').then((res : any) => {
+					if (res.code === 200) {
+						(this as any).$refs.sideTree.request();
+						this.getDataList();
+						this.$message.success('删除成功!');
+					} else this.$message.error(res.msg);
+				})
+			}).catch(() => {
+				this.$message.info('已取消删除');
+			});
+		}
+		// 刷新
+		onRefresh() {
+			this.loading = this.$loading({ target: '.main-container' });
+			(this as any).$refs.moduleView.clearSearch();
+			api.pageList({}, 'maindataMaterialDistributor').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);
+					this.loading.close();
+				} else this.$message.error(res.msg);
+			})
+		}
+		//导出
+		onExport() {
+			let urlArr = '/maindata/maindataMaterial';
+			let query = (this.$refs.moduleView as any).getQuery();
+			(this as any).$download(urlArr + '/export', {
+				...query
+			}, urlArr[urlArr.length - 1] + `_${new Date().getTime()}.xlsx`)
+		}
+	}
+</script>
+<style lang="scss" scoped>
+	.my-container {
+		width: 100%;
+		box-sizing: border-box;
+		display: flex;
+		padding: 16px;
+
+		.search-btn {
+			width: 100%;
+			display: flex;
+			justify-content: flex-end;
+			margin-bottom: 20px;
+		}
+
+		.bill-left {
+			position: relative;
+			border-right: solid #EEE 1px;
+			padding-right: 16px;
+			flex-shrink: 0;
+
+			// box-sizing: border-box;
+			.bill-tab {
+				width: 150px;
+				height: 100%;
+				transition: all .5s;
+				overflow: hidden;
+			}
+
+			.title {
+				font-size: 16px;
+				padding-bottom: 16px;
+				width: 200px;
+			}
+
+			.bill-nav {
+				font-size: 14px;
+				height: 30px;
+				line-height: 30px;
+				width: 200px;
+				box-sizing: border-box;
+				padding: 0 8px;
+				cursor: pointer;
+				margin-bottom: 2px;
+				border-radius: 5px;
+			}
+
+			.onBill {
+				background-color: #bde3f7;
+			}
+
+			.bill-nav:hover {
+				background-color: #bde3f7;
+			}
+
+			.close {
+				height: 22px;
+				width: 22px;
+				border-radius: 50%;
+				border: solid #EEE 1px;
+				position: absolute;
+				top: 30px;
+				right: -11px;
+				background-color: #FFF;
+				display: flex;
+				justify-content: center;
+				align-items: center;
+				cursor: pointer;
+			}
+		}
+
+		.bill-main {
+			width: calc(100% - 16px);
+			box-sizing: border-box;
+			margin-left: 16px;
+			position: relative;
+
+			.bill-box {
+				width: 100%;
+				position: absolute;
+				left: 0;
+				top: 0;
+				opacity: 0;
+				z-index: -1;
+				transition: all .5s;
+
+				.bill-tool,
+				.table-tool {
+					width: 100%;
+					padding-bottom: 16px;
+				}
+
+				.form {
+					margin-bottom: 8px;
+				}
+			}
+
+			.on-show {
+				opacity: 1;
+				z-index: 1;
+			}
+		}
+	}
+</style>

+ 491 - 0
src/views/audit/manufacturer/index.vue

@@ -0,0 +1,491 @@
+<template>
+	<div class="my-container">
+		<div class="bill-left">
+			<div class="bill-tab">
+				<div class="tab-title">导航</div>
+				<side-tree :propConfig="treeConfig" @onChange="onChangeTree" ref="sideTree" />
+			</div>
+		</div>
+		<div class="bill-main">
+			<module-view :propConfig="config" ref="moduleView" @pagination="getDataList" @search="getDataList"
+				@resert="getDataList" @clickHandle="clickHandle" @detail="openEdit" @onRefresh="onRefresh">
+			</module-view>
+		</div>
+		<!-- 新增/编辑弹窗 -->
+		<el-dialog :title="popTitle+'供应商'" :visible.sync="dialogFormVisible" width="30%">
+			<by-form :propConfig="addConfig" ref="addFormId">
+				<template v-slot:status class="clearfix">
+					<el-radio class="fl" style="margin-top: 8px;" v-model="radio" :label="1">正常</el-radio>
+					<el-radio class="fl" style="margin-top: 8px;" v-model="radio" :label="2">禁用</el-radio>
+				</template>
+			</by-form>
+			<div slot="footer" class="dialog-footer">
+				<el-button @click="dialogFormVisible = false">取 消</el-button>
+				<el-button type="primary" @click="confirm">确 定</el-button>
+			</div>
+		</el-dialog>
+	</div>
+</template>
+<script lang="ts">
+	import { Component, Prop, Vue, Watch } from "vue-property-decorator";
+	import api from "@/api/currency";
+	import Assembly from "@/components/Assembly/material.vue";
+	@Component
+	export default class Supplier extends Vue {
+		baseURL : any = process.env.VUE_APP_BASE_API
+		loading : any = null
+		timeNum = 0;
+		timer : any = null
+		popTitle : any = ''
+		radio : any = 1
+		dialogFormVisible : boolean = false
+		parentId: any = '';
+		treeConfig = {
+			attr: {
+				retConfig: {
+					id: 'id',
+					name: 'name'
+				},
+				defaultExpandAll: true,
+				label: 'name',
+				resType: 'data'
+			},
+			request: {
+				url: '/maindata/maindataOrganizationCategory/treeList',
+				method: 'GET'
+			}
+		}
+		config : any = {
+			search: {
+				attr: {
+					size: 'mini'
+				},
+				columns: [
+					[{
+						span: 6,
+						label: '名称',
+						prop: 'name',
+						component: 'by-input',
+						labelWidth: '70px',
+						compConfig: {
+							attr: {
+								placeholder: '请输入名称',
+								clearable: true
+							},
+						},
+					}, {
+						span: 6,
+						label: '负责人',
+						prop: 'contacts',
+						component: 'by-input',
+						labelWidth: '70px',
+						compConfig: {
+							attr: {
+								placeholder: '请输入负责人',
+								clearable: true
+							}
+						}
+					},
+					{
+						span: 6,
+						label: '状态',
+						prop: 'status',
+						labelWidth: '70px',
+						component: 'by-select',
+						compConfig: {
+							attr: {
+								placeholder: '请选择状态',
+								clearable: true,
+								data: [{
+									value: 1,
+									label: '正常'
+								}, {
+									value: 2,
+									label: '禁用'
+								}]
+							}
+						}
+					},
+					]
+				]
+			},
+			tool: {
+				tools: {
+					add: true,
+					delete: true,
+					search: true,
+					refresh: true
+				}
+			},
+			table: {
+				attr: {
+					size: 'mini',
+					seq: true,
+					align: 'center',
+					checkbox: true,
+					height: 600
+				},
+				columns: [{
+					title: '名称',
+					field: 'name',
+					isDetail: true,
+					width: 300,
+				},
+				{
+					title: '负责人',
+					field: 'contacts',
+					width: 300,
+				},
+				{
+					width: 80,
+					title: '状态',
+					field: 'status',
+					component: Assembly,
+				}, {
+					width: 500,
+					title: '备注',
+					field: 'remark',
+				}, {
+					width: 120,
+					title: '操作',
+					action: true,
+					plugins: [{
+						icon: 'el-icon-edit',
+						name: '编辑',
+						audit: '',
+						event: {
+							click: (item : any) => {
+								(this as any).openEdit(item)
+							}
+						}
+					}, {
+						name: '删除',
+						event: {
+							click: (item : any) => (this as any).doDelete2(item)
+						}
+					}]
+				}]
+			},
+		}
+		addConfig = {
+			attr: {
+				size: 'small',
+				rules: {
+					name: [{
+						required: true, message: '请输入名称', trigger: 'blur'
+					}],
+					contacts: [{
+						required: true, message: '请输入负责人', trigger: 'blur'
+					}]
+				}
+			},
+			columns: [
+				[
+					{
+						span: 23,
+						labelWidth: '70px',
+						label: '名称',
+						prop: 'name',
+						component: 'by-input',
+					},
+					{
+						span: 23,
+						labelWidth: '70px',
+						label: '负责人',
+						prop: 'contacts',
+						component: 'by-input',
+					},
+					{
+						span: 23,
+						labelWidth: '70px',
+						label: '状态',
+						slot: true,
+						prop: 'status',
+					},
+				],
+				[
+					{
+						span: 23,
+						labelWidth: '70px',
+						label: '备注',
+						prop: 'remark',
+						component: 'by-input',
+						compConfig: {
+							attr: {
+								size: 'mini',
+								placeholder: '请输入备注',
+								type: 'textarea'
+							},
+						}
+					},
+				]
+			]
+		}
+		mounted() {
+			this.timer = setInterval(() => {
+				this.getDataList()
+			}, 300)
+		}
+		//点击树获取数据
+		onChangeTree(e : any) {
+			console.log('点击结果:', e)
+			this.parentId = e.id[0]
+			api.childrenTreeList({ id: e.id[0], pageNo: 1, pageSize: 999 }, 'maindataMaterialManufacturer').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)
+				}
+			})
+		}
+		// 确认新增/编辑
+		confirm() {
+			(this as any).$refs.addFormId.validate().then(() => {
+				let query = (this as any).$refs.addFormId.getValue();
+				console.log(query);
+				query.status = this.radio;
+				this.dialogFormVisible = false;
+				if (this.popTitle === '新增') {
+					api.saveList(query, 'maindataMaterialManufacturer').then((res : any) => {
+						if (res.code === 200) {
+							this.$message.success(this.popTitle + '成功!');
+							(this as any).$refs.sideTree.request();
+							this.getDataList();
+						} else this.$message.error(res.msg);
+					})
+				} else if (this.popTitle === '编辑') {
+					api.updateList(query, 'maindataMaterialManufacturer').then((res : any) => {
+						if (res.code === 200) {
+							this.$message.success(this.popTitle + '成功!');
+							(this as any).$refs.sideTree.request();
+							this.getDataList();
+						} else this.$message.error(res.msg);
+					})
+				}
+			})
+		}
+		// 获取列表数据
+		getDataList() {
+			if (!this.$refs.moduleView) {
+				if (this.timeNum > 5) {
+					clearInterval(this.timer)
+				}
+				this.timeNum++;
+				return
+			}
+			clearInterval(this.timer)
+			let query = (this.$refs.moduleView as any).getQuery();
+			api.pageList(query, 'maindataMaterialManufacturer').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)
+				} else this.$message.error(res.msg);
+			})
+		}
+		// 工具栏方法
+		clickHandle(e : any) {
+			if (e === 'onAdd') this.onAdd();
+			if (e === 'onDelete') this.onDelete();
+			if (e === 'onExport') this.onExport();
+		}
+		// 打开新增
+		onAdd() {
+			this.popTitle = '新增'
+			this.dialogFormVisible = true;
+			this.radio = 1
+			setTimeout(() => {
+				if ((this as any).$refs.addFormId) (this as any).$refs.addFormId.setValue('');
+			}, 0)
+		}
+		// 打开编辑
+		openEdit(e : any) {
+			this.popTitle = '编辑'
+			this.dialogFormVisible = true;
+			this.radio = e.status
+			setTimeout(() => {
+				if ((this as any).$refs.addFormId) (this as any).$refs.addFormId.setValue(e);
+			}, 0)
+		}
+		// 工具栏删除
+		onDelete() {
+			let selectData = (this.$refs.moduleView as any).getSelectData()
+			let ids = '';
+			if (selectData.length > 0) {
+				selectData.map((v : any) => {
+					ids += v.id + ','
+				})
+			} else return this.$message.warning('请选择删除数据');
+			ids = ids.slice(0, ids.length - 1);
+			this.$confirm('确定删除吗,此操作不能撤销!', '注意', {
+				confirmButtonText: '确定',
+				cancelButtonText: '取消',
+				type: 'warning',
+				center: true
+			}).then(() => {
+				api.deleteList({ ids: ids }, 'maindataMaterialManufacturer').then((res : any) => {
+					if (res.code === 200) {
+						(this as any).$refs.sideTree.request();
+						this.getDataList();
+						this.$message.success('删除成功!');
+					} else this.$message.error(res.msg);
+				})
+			}).catch(() => this.$message.info('已取消删除'));
+		}
+		// 操作删除
+		doDelete2(item : any) {
+			this.$confirm('确定删除吗,此操作不能撤销!', '注意', {
+				confirmButtonText: '确定',
+				cancelButtonText: '取消',
+				type: 'warning',
+				center: true
+			}).then(() => {
+				api.deleteList({ ids: item.id }, 'maindataMaterialManufacturer').then((res : any) => {
+					if (res.code === 200) {
+						(this as any).$refs.sideTree.request();
+						this.getDataList();
+						this.$message.success('删除成功!');
+					} else this.$message.error(res.msg);
+				})
+			}).catch(() => {
+				this.$message.info('已取消删除');
+			});
+		}
+		// 刷新
+		onRefresh() {
+			this.loading = this.$loading({ target: '.main-container' });
+			(this as any).$refs.moduleView.clearSearch();
+			api.pageList({}, 'maindataMaterialManufacturer').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);
+					this.loading.close();
+				} else this.$message.error(res.msg);
+			})
+		}
+		//导出
+		onExport() {
+			let urlArr = '/maindata/maindataMaterial';
+			let query = (this.$refs.moduleView as any).getQuery();
+			(this as any).$download(urlArr + '/export', {
+				...query
+			}, urlArr[urlArr.length - 1] + `_${new Date().getTime()}.xlsx`)
+		}
+	}
+</script>
+<style lang="scss" scoped>
+	.my-container {
+		width: 100%;
+		box-sizing: border-box;
+		display: flex;
+		padding: 16px;
+
+		.search-btn {
+			width: 100%;
+			display: flex;
+			justify-content: flex-end;
+			margin-bottom: 20px;
+		}
+
+		.bill-left {
+			position: relative;
+			border-right: solid #EEE 1px;
+			padding-right: 16px;
+			flex-shrink: 0;
+
+			// box-sizing: border-box;
+			.bill-tab {
+				width: 150px;
+				height: 100%;
+				transition: all .5s;
+				overflow: hidden;
+			}
+
+			.title {
+				font-size: 16px;
+				padding-bottom: 16px;
+				width: 200px;
+			}
+
+			.bill-nav {
+				font-size: 14px;
+				height: 30px;
+				line-height: 30px;
+				width: 200px;
+				box-sizing: border-box;
+				padding: 0 8px;
+				cursor: pointer;
+				margin-bottom: 2px;
+				border-radius: 5px;
+			}
+
+			.onBill {
+				background-color: #bde3f7;
+			}
+
+			.bill-nav:hover {
+				background-color: #bde3f7;
+			}
+
+			.close {
+				height: 22px;
+				width: 22px;
+				border-radius: 50%;
+				border: solid #EEE 1px;
+				position: absolute;
+				top: 30px;
+				right: -11px;
+				background-color: #FFF;
+				display: flex;
+				justify-content: center;
+				align-items: center;
+				cursor: pointer;
+			}
+		}
+
+		.bill-main {
+			width: calc(100% - 16px);
+			box-sizing: border-box;
+			margin-left: 16px;
+			position: relative;
+
+			.bill-box {
+				width: 100%;
+				position: absolute;
+				left: 0;
+				top: 0;
+				opacity: 0;
+				z-index: -1;
+				transition: all .5s;
+
+				.bill-tool,
+				.table-tool {
+					width: 100%;
+					padding-bottom: 16px;
+				}
+
+				.form {
+					margin-bottom: 8px;
+				}
+			}
+
+			.on-show {
+				opacity: 1;
+				z-index: 1;
+			}
+		}
+	}
+</style>

+ 464 - 0
src/views/audit/organClassify/index.vue

@@ -0,0 +1,464 @@
+<template>
+	<div class="my-container">
+		<div class="bill-left">
+			<div class="bill-tab">
+				<div class="tab-title">导航</div>
+				<side-tree :propConfig="treeConfig" @onChange="onChangeTree" ref="sideTree" />
+			</div>
+		</div>
+		<div class="bill-main">
+			<module-view :propConfig="config" ref="moduleView" @pagination="getDataList" @search="getDataList"
+				@resert="getDataList" @clickHandle="clickHandle" @detail="openEdit" @onRefresh="onRefresh">
+			</module-view>
+		</div>
+		<!-- 新增/编辑弹窗 -->
+		<el-dialog :title="popTitle+'供应商'" :visible.sync="dialogFormVisible" width="30%">
+			<by-form :propConfig="addConfig" ref="addFormId">
+				<template v-slot:status class="clearfix">
+					<el-radio class="fl" style="margin-top: 8px;" v-model="radio" :label="1">正常</el-radio>
+					<el-radio class="fl" style="margin-top: 8px;" v-model="radio" :label="2">禁用</el-radio>
+				</template>
+			</by-form>
+			<div slot="footer" class="dialog-footer">
+				<el-button @click="dialogFormVisible = false">取 消</el-button>
+				<el-button type="primary" @click="confirm">确 定</el-button>
+			</div>
+		</el-dialog>
+	</div>
+</template>
+<script lang="ts">
+	import { Component, Prop, Vue, Watch } from "vue-property-decorator";
+	import api from "@/api/currency";
+	import Assembly from "@/components/Assembly/material.vue";
+	@Component
+	export default class Supplier extends Vue {
+		baseURL : any = process.env.VUE_APP_BASE_API
+		loading : any = null
+		timeNum = 0;
+		timer : any = null
+		popTitle : any = ''
+		radio : any = 1
+		dialogFormVisible : boolean = false
+		parentId: any = '';
+		treeConfig = {
+			attr: {
+				retConfig: {
+					id: 'id',
+					name: 'name'
+				},
+				defaultExpandAll: true,
+				label: 'name',
+				resType: 'data'
+			},
+			request: {
+				url: '/maindata/maindataOrganizationCategory/treeList',
+				method: 'GET'
+			}
+		}
+		config : any = {
+			search: {
+				attr: {
+					size: 'mini'
+				},
+				columns: [
+					[{
+						span: 6,
+						label: '名称',
+						prop: 'name',
+						component: 'by-input',
+						labelWidth: '70px',
+						compConfig: {
+							attr: {
+								placeholder: '请输入名称',
+								clearable: true
+							},
+						},
+					},
+					{
+						span: 6,
+						label: '状态',
+						prop: 'status',
+						labelWidth: '70px',
+						component: 'by-select',
+						compConfig: {
+							attr: {
+								placeholder: '请选择状态',
+								clearable: true,
+								data: [{
+									value: 1,
+									label: '正常'
+								}, {
+									value: 2,
+									label: '禁用'
+								}]
+							}
+						}
+					},
+					]
+				]
+			},
+			tool: {
+				tools: {
+					add: true,
+					delete: true,
+					search: true,
+					refresh: true
+				}
+			},
+			table: {
+				attr: {
+					size: 'mini',
+					seq: true,
+					align: 'center',
+					checkbox: true,
+					height: 600
+				},
+				columns: [{
+					title: '名称',
+					field: 'name',
+					isDetail: true,
+					width: 300,
+				},
+				{
+					width: 80,
+					title: '状态',
+					field: 'status',
+					component: Assembly,
+				}, {
+					width: 500,
+					title: '备注',
+					field: 'remark',
+				}, {
+					width: 120,
+					title: '操作',
+					action: true,
+					plugins: [{
+						icon: 'el-icon-edit',
+						name: '编辑',
+						audit: '',
+						event: {
+							click: (item : any) => {
+								(this as any).openEdit(item)
+							}
+						}
+					}, {
+						name: '删除',
+						event: {
+							click: (item : any) => (this as any).doDelete2(item)
+						}
+					}]
+				}]
+			},
+		}
+		addConfig = {
+			attr: {
+				size: 'small',
+				rules: {
+					name: [{
+						required: true, message: '请输入名称', trigger: 'blur'
+					}],
+				}
+			},
+			columns: [
+				[
+					{
+						span: 23,
+						labelWidth: '70px',
+						label: '名称',
+						prop: 'name',
+						component: 'by-input',
+					},
+					{
+						span: 23,
+						labelWidth: '70px',
+						label: '状态',
+						slot: true,
+						prop: 'status',
+					},
+				],
+				[
+					{
+						span: 23,
+						labelWidth: '70px',
+						label: '备注',
+						prop: 'remark',
+						component: 'by-input',
+						compConfig: {
+							attr: {
+								size: 'mini',
+								placeholder: '请输入备注',
+								type: 'textarea'
+							},
+						}
+					},
+				]
+			]
+		}
+		mounted() {
+			this.timer = setInterval(() => {
+				this.getDataList()
+			}, 300)
+		}
+		//点击树获取数据
+		onChangeTree(e : any) {
+			console.log('点击结果:', e)
+			this.parentId = e.id[0]
+			api.childrenTreeList({ id: e.id[0], pageNo: 1, pageSize: 999 }, 'maindataOrganizationCategory').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)
+				}
+			})
+		}
+		// 确认新增/编辑
+		confirm() {
+			(this as any).$refs.addFormId.validate().then(() => {
+				let query = (this as any).$refs.addFormId.getValue();
+				console.log(query);
+				query.status = this.radio;
+				this.dialogFormVisible = false;
+				if (this.popTitle === '新增') {
+					api.saveList(query, 'maindataOrganizationCategory').then((res : any) => {
+						if (res.code === 200) {
+							this.$message.success(this.popTitle + '成功!');
+							(this as any).$refs.sideTree.request();
+							this.getDataList();
+						} else this.$message.error(res.msg);
+					})
+				} else if (this.popTitle === '编辑') {
+					api.updateList(query, 'maindataOrganizationCategory').then((res : any) => {
+						if (res.code === 200) {
+							this.$message.success(this.popTitle + '成功!');
+							(this as any).$refs.sideTree.request();
+							this.getDataList();
+						} else this.$message.error(res.msg);
+					})
+				}
+			})
+		}
+		// 获取列表数据
+		getDataList() {
+			if (!this.$refs.moduleView) {
+				if (this.timeNum > 5) {
+					clearInterval(this.timer)
+				}
+				this.timeNum++;
+				return
+			}
+			clearInterval(this.timer)
+			let query = (this.$refs.moduleView as any).getQuery();
+			api.pageList(query, 'maindataOrganizationCategory').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)
+				} else this.$message.error(res.msg);
+			})
+		}
+		// 工具栏方法
+		clickHandle(e : any) {
+			if (e === 'onAdd') this.onAdd();
+			if (e === 'onDelete') this.onDelete();
+			if (e === 'onExport') this.onExport();
+		}
+		// 打开新增
+		onAdd() {
+			this.popTitle = '新增'
+			this.dialogFormVisible = true;
+			this.radio = 1
+			setTimeout(() => {
+				if ((this as any).$refs.addFormId) (this as any).$refs.addFormId.setValue('');
+			}, 0)
+		}
+		// 打开编辑
+		openEdit(e : any) {
+			this.popTitle = '编辑'
+			this.dialogFormVisible = true;
+			this.radio = e.status
+			setTimeout(() => {
+				if ((this as any).$refs.addFormId) (this as any).$refs.addFormId.setValue(e);
+			}, 0)
+		}
+		// 工具栏删除
+		onDelete() {
+			let selectData = (this.$refs.moduleView as any).getSelectData()
+			let ids = '';
+			if (selectData.length > 0) {
+				selectData.map((v : any) => {
+					ids += v.id + ','
+				})
+			} else return this.$message.warning('请选择删除数据');
+			ids = ids.slice(0, ids.length - 1);
+			this.$confirm('确定删除吗,此操作不能撤销!', '注意', {
+				confirmButtonText: '确定',
+				cancelButtonText: '取消',
+				type: 'warning',
+				center: true
+			}).then(() => {
+				api.deleteList({ ids: ids }, 'maindataOrganizationCategory').then((res : any) => {
+					if (res.code === 200) {
+						(this as any).$refs.sideTree.request();
+						this.getDataList();
+						this.$message.success('删除成功!');
+					} else this.$message.error(res.msg);
+				})
+			}).catch(() => this.$message.info('已取消删除'));
+		}
+		// 操作删除
+		doDelete2(item : any) {
+			this.$confirm('确定删除吗,此操作不能撤销!', '注意', {
+				confirmButtonText: '确定',
+				cancelButtonText: '取消',
+				type: 'warning',
+				center: true
+			}).then(() => {
+				api.deleteList({ ids: item.id }, 'maindataOrganizationCategory').then((res : any) => {
+					if (res.code === 200) {
+						(this as any).$refs.sideTree.request();
+						this.getDataList();
+						this.$message.success('删除成功!');
+					} else this.$message.error(res.msg);
+				})
+			}).catch(() => {
+				this.$message.info('已取消删除');
+			});
+		}
+		// 刷新
+		onRefresh() {
+			this.loading = this.$loading({ target: '.main-container' });
+			(this as any).$refs.moduleView.clearSearch();
+			api.pageList({}, 'maindataOrganizationCategory').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);
+					this.loading.close();
+				} else this.$message.error(res.msg);
+			})
+		}
+		//导出
+		onExport() {
+			let urlArr = '/maindata/maindataMaterial';
+			let query = (this.$refs.moduleView as any).getQuery();
+			(this as any).$download(urlArr + '/export', {
+				...query
+			}, urlArr[urlArr.length - 1] + `_${new Date().getTime()}.xlsx`)
+		}
+	}
+</script>
+<style lang="scss" scoped>
+	.my-container {
+		width: 100%;
+		box-sizing: border-box;
+		display: flex;
+		padding: 16px;
+
+		.search-btn {
+			width: 100%;
+			display: flex;
+			justify-content: flex-end;
+			margin-bottom: 20px;
+		}
+
+		.bill-left {
+			position: relative;
+			border-right: solid #EEE 1px;
+			padding-right: 16px;
+			flex-shrink: 0;
+
+			// box-sizing: border-box;
+			.bill-tab {
+				width: 150px;
+				height: 100%;
+				transition: all .5s;
+				overflow: hidden;
+			}
+
+			.title {
+				font-size: 16px;
+				padding-bottom: 16px;
+				width: 200px;
+			}
+
+			.bill-nav {
+				font-size: 14px;
+				height: 30px;
+				line-height: 30px;
+				width: 200px;
+				box-sizing: border-box;
+				padding: 0 8px;
+				cursor: pointer;
+				margin-bottom: 2px;
+				border-radius: 5px;
+			}
+
+			.onBill {
+				background-color: #bde3f7;
+			}
+
+			.bill-nav:hover {
+				background-color: #bde3f7;
+			}
+
+			.close {
+				height: 22px;
+				width: 22px;
+				border-radius: 50%;
+				border: solid #EEE 1px;
+				position: absolute;
+				top: 30px;
+				right: -11px;
+				background-color: #FFF;
+				display: flex;
+				justify-content: center;
+				align-items: center;
+				cursor: pointer;
+			}
+		}
+
+		.bill-main {
+			width: calc(100% - 16px);
+			box-sizing: border-box;
+			margin-left: 16px;
+			position: relative;
+
+			.bill-box {
+				width: 100%;
+				position: absolute;
+				left: 0;
+				top: 0;
+				opacity: 0;
+				z-index: -1;
+				transition: all .5s;
+
+				.bill-tool,
+				.table-tool {
+					width: 100%;
+					padding-bottom: 16px;
+				}
+
+				.form {
+					margin-bottom: 8px;
+				}
+			}
+
+			.on-show {
+				opacity: 1;
+				z-index: 1;
+			}
+		}
+	}
+</style>

+ 39 - 25
src/views/audit/productClassification/index.vue

@@ -3,20 +3,20 @@
 		<div class="bill-left">
 			<div class="bill-tab">
 				<div class="tab-title">导航</div>
-					<side-tree :propConfig="treeConfig" @onChange="onChangeTree" ref="sideTree" />
+				<side-tree :propConfig="treeConfig" @onChange="onChangeTree" ref="sideTree" />
 			</div>
 		</div>
 		<div class="bill-main">
 			<module-view :propConfig="config" ref="moduleView" @pagination="getDataList" @search="getDataList"
-				@resert="onRefresh" @clickHandle="clickHandle" @detail="openEdit"  @onRefresh="onRefresh">
+				@resert="onRefresh" @clickHandle="clickHandle" @detail="openEdit" @onRefresh="onRefresh">
 			</module-view>
 		</div>
 		<!-- 新增/编辑弹窗 -->
 		<el-dialog :title="popTitle+'商品分类'" :visible.sync="dialogFormVisible" width="30%">
 			<by-form :propConfig="addConfig" ref="addFormId">
 				<template v-slot:status class="clearfix">
-					<el-radio class="fl" style="margin-top: 8px;" v-model="radio" :label="1">正常</el-radio>
-					<el-radio class="fl" style="margin-top: 8px;" v-model="radio" :label="2">禁用</el-radio>
+					<el-radio class="fl" style="margin-top: 8px;" v-model="radio" :label="0">正常</el-radio>
+					<el-radio class="fl" style="margin-top: 8px;" v-model="radio" :label="1">禁用</el-radio>
 				</template>
 			</by-form>
 			<div slot="footer" class="dialog-footer">
@@ -37,26 +37,27 @@
 		data : any = []
 		expandedKeys : any = []
 		parentId : any = ''
+		parentIds : any = ''
 		// 右边
 		baseURL : any = process.env.VUE_APP_BASE_API
 		timeNum = 0;
 		timer : any = null
 		popTitle : any = ''
-		radio : any = 1
+		radio : any = 0
 		dialogFormVisible : boolean = false
-		treeConfig={
-			attr:{
-				retConfig:{
-					id:'id',
-					name:'name'
+		treeConfig = {
+			attr: {
+				retConfig: {
+					id: 'id',
+					name: 'name'
 				},
-				defaultExpandAll:true,
+				defaultExpandAll: true,
 				label: 'name',
-				resType:'data'
+				resType: 'data'
 			},
-			request:{
-				url:'/maindata/maindataMaterialCategory/treeList',
-				method:'GET'
+			request: {
+				url: '/maindata/maindataMaterialCategory/treeList',
+				method: 'GET'
 			}
 		}
 		config : any = {
@@ -102,10 +103,10 @@
 								placeholder: '请选择数据',
 								clearable: true,
 								data: [{
-									value: 1,
+									value: 0,
 									label: '正常'
 								}, {
-									value: 2,
+									value: 1,
 									label: '禁用'
 								}]
 							}
@@ -242,12 +243,24 @@
 			}, 500)
 		}
 		//点击树获取数据
-		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) => {
+		onChangeTree(e : any) {
+			console.log(e);
+			let data : any = {};
+			this.parentIds = e.id;
+			data.ids = e.id;
+			if (data.ids[0] === 100) data.ids.shift();
+			// if (e.id.length > 1) {
+			// 	this.parentIds = e.id;
+			// 	data.ids = e.id;
+			// 	if(data.ids[0] === 100) data.ids.shift(); 
+			// } else {
+			// 	this.parentId = e.id;
+			// 	data.parentId = e.id;
+			// }
+
+			api.childrenTreeList(data, 'maindataMaterialCategory').then((res : any) => {
 				if (res.code === 200) {
-					(this.$refs.moduleView as any).setTableValue(res.data);
+					(this.$refs.moduleView as any).setTableValue(res.data.records);
 					let page = {
 						pageNo: res.data.current, //当前页
 						pageSize: res.data.size, //每页条数
@@ -295,7 +308,7 @@
 			}
 			clearInterval(this.timer)
 			let query = (this.$refs.moduleView as any).getQuery();
-			if(this.parentId)query.parentId = this.parentId;
+			if (this.parentId) query.parentId = this.parentId;
 			let newData : any = {}
 			for (let key in query) {
 				if (query[key].toString()) {
@@ -305,7 +318,7 @@
 			console.log('表单字段 ==> ', newData);
 			this.getPageList(newData)
 		}
-		getPageList(query:any){
+		getPageList(query : any) {
 			api.pageList(query, 'maindataMaterialCategory').then((res : any) => {
 				if (res.code === 200) {
 					(this.$refs.moduleView as any).setTableValue(res.data.records);
@@ -328,7 +341,7 @@
 		onAdd() {
 			this.popTitle = '新增'
 			this.dialogFormVisible = true;
-			this.radio = 1
+			this.radio = 0
 			setTimeout(() => {
 				if ((this as any).$refs.addFormId) (this as any).$refs.addFormId.setValue({});
 			}, 0)
@@ -446,6 +459,7 @@
 			padding-right: 16px;
 			flex-shrink: 0;
 			height: 740px;
+
 			// box-sizing: border-box;
 			.bill-tab {
 				width: 150px;

+ 2 - 2
src/views/audit/productManagement/index.vue

@@ -863,8 +863,8 @@
 		}
 		//点击树获取数据
 		onChangeTree(e : any) {
-			this.categoryId = e.id[0]
-			other.single({ categoryId: e.id[0] }).then((res : any) => {
+			this.categoryId = e.id;
+			api.ByCategoryPage({ categoryId: e.id },'maindataMaterialCategory').then((res : any) => {
 				if (res.code === 200) {
 					(this.$refs.moduleView as any).setTableValue(res.data.records);
 					let page = {

+ 109 - 76
src/views/audit/supplier/index.vue

@@ -8,11 +8,11 @@
 		</div>
 		<div class="bill-main">
 			<module-view :propConfig="config" ref="moduleView" @pagination="getDataList" @search="getDataList"
-				@resert="getDataList" @clickHandle="clickHandle" @detail="openEdit" @onRefresh="onRefresh">
+				@resert="onRefresh" @clickHandle="clickHandle" @detail="openEdit" @onRefresh="onRefresh">
 			</module-view>
 		</div>
 		<!-- 新增/编辑弹窗 -->
-		<el-dialog :title="popTitle+'供应商'" :visible.sync="dialogFormVisible" width="30%">
+		<el-dialog :title="popTitle+'虚拟分类'" :visible.sync="dialogFormVisible" width="30%">
 			<by-form :propConfig="addConfig" ref="addFormId">
 				<template v-slot:status class="clearfix">
 					<el-radio class="fl" style="margin-top: 8px;" v-model="radio" :label="1">正常</el-radio>
@@ -31,15 +31,18 @@
 	import api from "@/api/currency";
 	import Assembly from "@/components/Assembly/material.vue";
 	@Component
-	export default class Supplier extends Vue {
+	export default class Virtually extends Vue {
+		// 左边
+		data : any = []
+		expandedKeys : any = []
+		parentId : any = ''
+		// 右边
 		baseURL : any = process.env.VUE_APP_BASE_API
-		loading : any = null
 		timeNum = 0;
 		timer : any = null
 		popTitle : any = ''
 		radio : any = 1
 		dialogFormVisible : boolean = false
-		parentId: any = '';
 		treeConfig = {
 			attr: {
 				retConfig: {
@@ -51,7 +54,7 @@
 				resType: 'data'
 			},
 			request: {
-				url: '/maindata/maindataMaterialCategory/treeList',
+				url: '/maindata/maindataOrganizationCategory/treeList',
 				method: 'GET'
 			}
 		}
@@ -73,28 +76,29 @@
 								clearable: true
 							},
 						},
-					}, {
+					},
+					{
 						span: 6,
-						label: '负责人',
-						prop: 'contacts',
+						label: '简称',
+						prop: 'shortName',
 						component: 'by-input',
 						labelWidth: '70px',
 						compConfig: {
 							attr: {
-								placeholder: '请输入负责人',
+								placeholder: '请输入简称',
 								clearable: true
-							}
-						}
+							},
+						},
 					},
 					{
 						span: 6,
 						label: '状态',
 						prop: 'status',
-						labelWidth: '70px',
 						component: 'by-select',
+						labelWidth: '70px',
 						compConfig: {
 							attr: {
-								placeholder: '请选择状态',
+								placeholder: '请选择数据',
 								clearable: true,
 								data: [{
 									value: 1,
@@ -112,7 +116,7 @@
 			tool: {
 				tools: {
 					add: true,
-					delete: true,
+					// delete: true,
 					search: true,
 					refresh: true
 				}
@@ -122,27 +126,24 @@
 					size: 'mini',
 					seq: true,
 					align: 'center',
-					checkbox: true,
+					checkbox: false,
 					height: 600
 				},
 				columns: [{
+					width: 300,
 					title: '名称',
 					field: 'name',
 					isDetail: true,
-					width: 300,
-				},
-				{
-					title: '负责人',
-					field: 'contacts',
-					width: 300,
-				},
-				{
+				}, {
+					title: '简称',
+					field: 'shortName'
+				}, {
 					width: 80,
 					title: '状态',
 					field: 'status',
 					component: Assembly,
-				}, {
-					width: 500,
+				},
+				{
 					title: '备注',
 					field: 'remark',
 				}, {
@@ -174,13 +175,34 @@
 					name: [{
 						required: true, message: '请输入名称', trigger: 'blur'
 					}],
-					contacts: [{
-						required: true, message: '请输入负责人', trigger: 'blur'
-					}]
+					parentName: [{
+						required: true, message: '请选择父级', trigger: 'change'
+					}],
 				}
 			},
 			columns: [
 				[
+					{
+						span: 23,
+						label: '父级',
+						labelWidth: '70px',
+						prop: 'parentName',
+						component: 'select-tree',
+						compConfig: {
+							attr: {
+								label: 'name',
+								clearable: true,
+								retConfig: {
+									parentId: 'id',
+									parentName: 'name',
+								},
+								defaultExpandAll: true
+							},
+							request: {
+								url: '/maindata/maindataMaterialSupplier/treeList'
+							}
+						}
+					},
 					{
 						span: 23,
 						labelWidth: '70px',
@@ -191,8 +213,9 @@
 					{
 						span: 23,
 						labelWidth: '70px',
-						label: '负责人',
-						prop: 'contacts',
+						label: '简称',
+						slot: true,
+						prop: 'shortName',
 						component: 'by-input',
 					},
 					{
@@ -202,37 +225,35 @@
 						slot: true,
 						prop: 'status',
 					},
-				],
-				[
 					{
 						span: 23,
 						labelWidth: '70px',
 						label: '备注',
+						slot: true,
 						prop: 'remark',
 						component: 'by-input',
-						compConfig: {
-							attr: {
-								size: 'mini',
-								placeholder: '请输入备注',
-								type: 'textarea'
-							},
-						}
 					},
-				]
+				],
 			]
 		}
 		mounted() {
 			this.timer = setInterval(() => {
 				this.getDataList()
-			}, 300)
+			}, 500)
 		}
 		//点击树获取数据
 		onChangeTree(e : any) {
-			console.log('点击结果:', e)
-			this.parentId = e.id[0]
-			api.childrenTreeList({ id: e.id[0], pageNo: 1, pageSize: 999 }, 'maindataMaterialSupplier').then((res : any) => {
+			this.parentId = e.id;
+			let data : any = {};
+			if (e.id.length > 1) {
+				data.ids = e.id;
+				if(data.ids[0] === 100) data.ids.shift(); 
+			} else {
+				data.parentId = e.id;
+			}
+			api.childrenTreeList(data, 'maindataMaterialSupplier').then((res : any) => {
 				if (res.code === 200) {
-					(this.$refs.moduleView as any).setTableValue(res.data);
+					(this.$refs.moduleView as any).setTableValue(res.data.records);
 					let page = {
 						pageNo: res.data.current, //当前页
 						pageSize: res.data.size, //每页条数
@@ -279,6 +300,17 @@
 			}
 			clearInterval(this.timer)
 			let query = (this.$refs.moduleView as any).getQuery();
+			if (this.parentId) query.parentId = this.parentId;
+			let newData : any = {}
+			for (let key in query) {
+				if (query[key].toString()) {
+					newData[key] = query[key]
+				}
+			}
+			console.log('表单字段 ==> ', newData);
+			this.getPageList(newData)
+		}
+		getPageList(query : any) {
 			api.pageList(query, 'maindataMaterialSupplier').then((res : any) => {
 				if (res.code === 200) {
 					(this.$refs.moduleView as any).setTableValue(res.data.records);
@@ -287,7 +319,7 @@
 						pageSize: res.data.size, //每页条数
 						total: res.data.total //总条数
 					};
-					(this.$refs.moduleView as any).setPage(page)
+					(this.$refs.moduleView as any).setPage(page);
 				} else this.$message.error(res.msg);
 			})
 		}
@@ -303,21 +335,27 @@
 			this.dialogFormVisible = true;
 			this.radio = 1
 			setTimeout(() => {
-				if ((this as any).$refs.addFormId) (this as any).$refs.addFormId.setValue('');
+				if ((this as any).$refs.addFormId) (this as any).$refs.addFormId.setValue({});
 			}, 0)
 		}
 		// 打开编辑
 		openEdit(e : any) {
+			console.log(e);
 			this.popTitle = '编辑'
 			this.dialogFormVisible = true;
 			this.radio = e.status
-			setTimeout(() => {
-				if ((this as any).$refs.addFormId) (this as any).$refs.addFormId.setValue(e);
-			}, 0)
+			api.single({ id: e.parentId }, 'maindataMaterialSupplier').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);
+					}, 0)
+				}
+			})
 		}
 		// 工具栏删除
 		onDelete() {
-			let selectData = (this.$refs.moduleView as any).getSelectData()
+			let selectData = (this.$refs.moduleView as any).getSelectData();
 			let ids = '';
 			if (selectData.length > 0) {
 				selectData.map((v : any) => {
@@ -348,33 +386,27 @@
 				type: 'warning',
 				center: true
 			}).then(() => {
-				api.deleteList({ ids: item.id }, 'maindataMaterialSupplier').then((res : any) => {
-					if (res.code === 200) {
-						(this as any).$refs.sideTree.request();
-						this.getDataList();
-						this.$message.success('删除成功!');
-					} else this.$message.error(res.msg);
+				api.childrenTreeList({ id: item.id }, 'maindataMaterialSupplier').then((v : any) => {
+					if (v.code === 200) {
+						if (v.data.length > 0) return this.$message.error('此数据有子节点,不能进行删除!')
+						api.deleteList({ ids: item.id }, 'maindataMaterialSupplier').then((res : any) => {
+							if (res.code === 200) {
+								(this as any).$refs.sideTree.request();
+								this.getDataList();
+								this.$message.success('删除成功!');
+							} else this.$message.error(res.msg);;
+						})
+					} else this.$message.error('删除失败!请稍后再试');
 				})
-			}).catch(() => {
-				this.$message.info('已取消删除');
-			});
+			}).catch(() => this.$message.info('已取消删除'));
 		}
-		// 刷新
+		// 刷新/重置
 		onRefresh() {
-			this.loading = this.$loading({ target: '.main-container' });
+			let loading = this.$loading({ target: '.main-container' });
 			(this as any).$refs.moduleView.clearSearch();
-			api.pageList({}, 'maindataMaterialSupplier').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);
-					this.loading.close();
-				} else this.$message.error(res.msg);
-			})
+			this.parentId = '';
+			this.getPageList({});
+			loading.close();
 		}
 		//导出
 		onExport() {
@@ -405,6 +437,7 @@
 			border-right: solid #EEE 1px;
 			padding-right: 16px;
 			flex-shrink: 0;
+			height: 740px;
 
 			// box-sizing: border-box;
 			.bill-tab {
@@ -414,7 +447,7 @@
 				overflow: hidden;
 			}
 
-			.title {
+			.tab-title {
 				font-size: 16px;
 				padding-bottom: 16px;
 				width: 200px;

+ 16 - 9
src/views/audit/virtually/index.vue

@@ -15,8 +15,8 @@
 		<el-dialog :title="popTitle+'虚拟分类'" :visible.sync="dialogFormVisible" width="30%">
 			<by-form :propConfig="addConfig" ref="addFormId">
 				<template v-slot:status class="clearfix">
-					<el-radio class="fl" style="margin-top: 8px;" v-model="radio" :label="1">正常</el-radio>
-					<el-radio class="fl" style="margin-top: 8px;" v-model="radio" :label="2">禁用</el-radio>
+					<el-radio class="fl" style="margin-top: 8px;" v-model="radio" :label="0">正常</el-radio>
+					<el-radio class="fl" style="margin-top: 8px;" v-model="radio" :label="1">禁用</el-radio>
 				</template>
 			</by-form>
 			<div slot="footer" class="dialog-footer">
@@ -41,7 +41,7 @@
 		timeNum = 0;
 		timer : any = null
 		popTitle : any = ''
-		radio : any = 1
+		radio : any = 0
 		dialogFormVisible : boolean = false
 		treeConfig = {
 			attr: {
@@ -101,10 +101,10 @@
 								placeholder: '请选择数据',
 								clearable: true,
 								data: [{
-									value: 1,
+									value: 0,
 									label: '正常'
 								}, {
-									value: 2,
+									value: 1,
 									label: '禁用'
 								}]
 							}
@@ -243,10 +243,17 @@
 		}
 		//点击树获取数据
 		onChangeTree(e : any) {
-			this.parentId = e.id[0]
-			api.childrenTreeList({ id: e.id[0] }, 'maindataMaterialVmcategory').then((res : any) => {
+			this.parentId = e.id;
+			let data : any = {};
+			if (e.id.length > 1) {
+				data.ids = e.id;
+				if(data.ids[0] === 100) data.ids.shift(); 
+			} else {
+				data.parentId = e.id;
+			}
+			api.childrenTreeList(data, 'maindataMaterialVmcategory').then((res : any) => {
 				if (res.code === 200) {
-					(this.$refs.moduleView as any).setTableValue(res.data);
+					(this.$refs.moduleView as any).setTableValue(res.data.records);
 					let page = {
 						pageNo: res.data.current, //当前页
 						pageSize: res.data.size, //每页条数
@@ -326,7 +333,7 @@
 		onAdd() {
 			this.popTitle = '新增'
 			this.dialogFormVisible = true;
-			this.radio = 1
+			this.radio = 0
 			setTimeout(() => {
 				if ((this as any).$refs.addFormId) (this as any).$refs.addFormId.setValue({});
 			}, 0)