Parcourir la source

第一波代码优化

AlanWong il y a 2 ans
Parent
commit
9aeaba4031

+ 1 - 1
src/api/currency.ts

@@ -25,7 +25,7 @@ function childrenTreeList(data : any, url : any) {
 // 根据分类ID(数组)分页查询数据
 function byCategoryPage(data : any, url : any) {
 	return request({
-		url: '/maindata/' + url + '/byCategoryPage',
+		url: '/maindata/' + url + '/ByCategoryPage',
 		method: 'GET',
 		params: data
 	})

+ 23 - 23
src/views/audit/agencyGoods/index.vue

@@ -8,7 +8,7 @@
 		</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>
 		<!-- 新增/编辑弹窗 -->
@@ -123,7 +123,6 @@
 			tool: {
 				tools: {
 					add: true,
-					// delete: true,
 					search: true,
 					refresh: true
 				}
@@ -131,8 +130,8 @@
 			table: {
 				attr: {
 					size: 'mini',
-					seq: true,
-					align: 'center',
+					// seq: true,
+					align: 'left',
 					checkbox: false,
 					height: 600
 				},
@@ -239,6 +238,13 @@
 						slot: true,
 						prop: 'remark',
 						component: 'by-input',
+						compConfig: {
+							attr: {
+								size: 'mini',
+								placeholder: '请输入备注',
+								type:'textarea'
+							},
+						}
 					},
 				],
 			]
@@ -250,14 +256,13 @@
 		}
 		//点击树获取数据
 		onChangeTree(e : any) {
-			this.parentId = e.id;
 			let data : any = {};
-			if (e.id.length > 1) {
+			if (e.isContain) {
 				data.ids = e.id;
-				if(data.ids[0] === 100) data.ids.shift(); 
 			} else {
 				data.parentId = e.id;
-			}
+			};
+			this.parentId = e.id;
 			api.childrenTreeList(data, 'maindataMaterialOrganizationCategory').then((res : any) => {
 				if (res.code === 200) {
 					(this.$refs.moduleView as any).setTableValue(res.data.records);
@@ -314,7 +319,10 @@
 				}
 			}
 			console.log('表单字段 ==> ', newData);
-			api.pageList(newData, 'maindataMaterialOrganizationCategory').then((res : any) => {
+			this.getPageList(newData)
+		}
+		getPageList(query : any) {
+			api.pageList(query, 'maindataMaterialOrganizationCategory').then((res : any) => {
 				if (res.code === 200) {
 					(this.$refs.moduleView as any).setTableValue(res.data.records);
 					let page = {
@@ -402,22 +410,14 @@
 				})
 			}).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({}, 'maindataMaterialOrganizationCategory').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 as any).$refs.sideTree.request();
+			this.getPageList({});
+			loading.close();
 		}
 		//导出
 		onExport() {

+ 14 - 20
src/views/audit/attribute/index.vue

@@ -2,7 +2,7 @@
 	<div class="my-container">
 		<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>
 		<!-- 新增/编辑弹窗 -->
@@ -142,8 +142,7 @@
 			table: {
 				attr: {
 					size: 'mini',
-					seq: true,
-					align: 'center',
+					align: 'left',
 					checkbox: true,
 					height: 600
 				},
@@ -222,7 +221,7 @@
 						labelWidth: '80px',
 						label: '属性类型',
 						slot: true,
-						prop: 'attributeTypeName',
+						prop: 'attributeType',
 						component: 'by-select',
 						compConfig: {
 							attr: {
@@ -293,6 +292,7 @@
 				query.attributeValue = JSON.stringify(this.tableConfig)
 				this.dialogFormVisible = false;
 				console.log(query);
+				
 				if (this.popTitle === '新增') {
 					api.saveList(query, 'maindataMaterialAttribute').then((res : any) => {
 						if (res.code === 200) {
@@ -314,6 +314,7 @@
 						} else this.failHandle(res)
 					})
 				}
+				
 			})
 		}
 		// 获取列表数据
@@ -328,6 +329,9 @@
 			clearInterval(this.timer)
 			let query = (this.$refs.moduleView as any).getQuery();
 			// console.log('表单字段 ==> ', query);
+			this.getPageList(query)
+		}
+		getPageList(query : any) {
 			api.pageList(query, 'maindataMaterialAttribute').then((res : any) => {
 				if (res.code === 200) {
 					(this.$refs.moduleView as any).setTableValue(res.data.records);
@@ -337,7 +341,7 @@
 						total: res.data.total //总条数
 					};
 					(this.$refs.moduleView as any).setPage(page)
-				} else this.failHandle(res)
+				} else this.$message.error(res.msg);
 			})
 		}
 		// 工具栏方法
@@ -363,7 +367,6 @@
 			this.dialogFormVisible = true;
 			this.radio = e.status
 			this.tableConfig = JSON.parse(e.attributeValue);
-			e.attributeTypeName = e.attributeType === 0 ? '销售属性' : '基本属性';
 			setTimeout(() => {
 				if ((this as any).$refs.addFormId) (this as any).$refs.addFormId.setValue(e);
 			}, 0)
@@ -424,22 +427,13 @@
 				});
 			});
 		}
-		// 刷新
+		// 刷新/重置
 		onRefresh() {
-			this.loading = this.$loading({ target: '.main-container' });
+			let loading = this.$loading({ target: '.main-container' });
 			(this as any).$refs.moduleView.clearSearch();
-			api.pageList({}, 'maindataMaterialAttribute').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 as any).$refs.sideTree.request();
+			this.getPageList({});
+			loading.close();
 		}
 		//导出
 		onExport() {

+ 18 - 22
src/views/audit/brand/index.vue

@@ -2,7 +2,7 @@
 	<div class="my-container">
 		<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>
 		<!-- 新增/编辑弹窗 -->
@@ -98,8 +98,8 @@
 			table: {
 				attr: {
 					size: 'mini',
-					seq: true,
-					align: 'center',
+					// seq: true,
+					align: 'left',
 					checkbox: true,
 					height: 600
 				},
@@ -113,16 +113,18 @@
 					field: 'shortName',
 					width: 300,
 				},
+				{
+					width: 500,
+					title: '备注',
+					field: 'remark',
+				},
 				{
 					width: 80,
 					title: '状态',
 					field: 'status',
 					component: Assembly,
-				}, {
-					width: 500,
-					title: '备注',
-					field: 'remark',
-				}, {
+				}, 
+				{
 					width: 120,
 					title: '操作',
 					action: true,
@@ -241,6 +243,9 @@
 			}
 			clearInterval(this.timer)
 			let query = (this.$refs.moduleView as any).getQuery();
+			this.getPageList(query);
+		}
+		getPageList(query : any) {
 			api.pageList(query, 'maindataMaterialBrand').then((res : any) => {
 				if (res.code === 200) {
 					(this.$refs.moduleView as any).setTableValue(res.data.records);
@@ -330,22 +335,13 @@
 				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({}, 'maindataMaterialBrand').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 as any).$refs.sideTree.request();
+			this.getPageList({});
+			loading.close();
 		}
 		//导出
 		onExport() {

+ 77 - 34
src/views/audit/distributor/index.vue

@@ -12,11 +12,11 @@
 			</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>
-					<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,9 +37,9 @@
 		timeNum = 0;
 		timer : any = null
 		popTitle : any = ''
-		radio : any = 1
+		radio : any = 0
 		dialogFormVisible : boolean = false
-		parentId: any = '';
+		categoryId : any = '';
 		treeConfig = {
 			attr: {
 				retConfig: {
@@ -51,7 +51,7 @@
 				resType: 'data'
 			},
 			request: {
-				url: '/maindata/maindataOrganizationCategory/treeList',
+				url: '/maindata/maindataOrganizationCategory/treeUseList',
 				method: 'GET'
 			}
 		}
@@ -97,10 +97,10 @@
 								placeholder: '请选择状态',
 								clearable: true,
 								data: [{
-									value: 1,
+									value: 0,
 									label: '正常'
 								}, {
-									value: 2,
+									value: 1,
 									label: '禁用'
 								}]
 							}
@@ -112,7 +112,6 @@
 			tool: {
 				tools: {
 					add: true,
-					delete: true,
 					search: true,
 					refresh: true
 				}
@@ -120,31 +119,40 @@
 			table: {
 				attr: {
 					size: 'mini',
-					seq: true,
-					align: 'center',
-					checkbox: true,
+					align: 'left',
 					height: 600
 				},
 				columns: [{
 					title: '名称',
 					field: 'name',
 					isDetail: true,
-					width: 300,
+					width: 150,
 				},
 				{
 					title: '负责人',
 					field: 'contacts',
+					width: 120,
+				},
+				{
+					title: '联系电话',
+					field: 'phonenum',
+					width: 150,
+				},
+				{
+					title: '手机号码',
+					field: 'telephone',
+					width: 150,
+				},
+				{
 					width: 300,
+					title: '财务系统类型',
+					field: 'financeType',
 				},
 				{
 					width: 80,
 					title: '状态',
 					field: 'status',
 					component: Assembly,
-				}, {
-					width: 500,
-					title: '备注',
-					field: 'remark',
 				}, {
 					width: 120,
 					title: '操作',
@@ -171,16 +179,43 @@
 			attr: {
 				size: 'small',
 				rules: {
+					categoryName: [{
+						required: true, message: '请输入父级', trigger: 'blur'
+					}],
 					name: [{
 						required: true, message: '请输入名称', trigger: 'blur'
 					}],
 					contacts: [{
 						required: true, message: '请输入负责人', trigger: 'blur'
-					}]
+					}],
+					financeType: [{
+						required: true, message: '请输入财务系统类型', trigger: 'change'
+					}],
 				}
 			},
 			columns: [
 				[
+					{
+						span: 23,
+						label: '父级',
+						labelWidth: '70px',
+						prop: 'categoryName',
+						component: 'select-tree',
+						compConfig: {
+							attr: {
+								label: 'name',
+								clearable: true,
+								retConfig: {
+									categoryId: 'id',
+									categoryName: 'name',
+								},
+								defaultExpandAll: true
+							},
+							request: {
+								url: '/maindata/maindataOrganizationCategory/treeUseList'
+							}
+						}
+					},
 					{
 						span: 23,
 						labelWidth: '70px',
@@ -202,23 +237,29 @@
 						slot: true,
 						prop: 'status',
 					},
-				],
-				[
 					{
 						span: 23,
-						labelWidth: '70px',
-						label: '备注',
-						prop: 'remark',
-						component: 'by-input',
+						labelWidth: '110px',
+						label: '财务系统类型',
+						prop: 'financeType',
+						component: 'by-select',
 						compConfig: {
 							attr: {
-								size: 'mini',
-								placeholder: '请输入备注',
-								type: 'textarea'
-							},
+								placeholder: '请选择财务系统类型',
+								clearable: true,
+								data: [
+									{
+										value: '金蝶K3',
+										label: '金蝶K3'
+									}, {
+										value: '用友U8',
+										label: '用友U8'
+									},
+								]
+							}
 						}
 					},
-				]
+				],
 			]
 		}
 		mounted() {
@@ -229,8 +270,8 @@
 		//点击树获取数据
 		onChangeTree(e : any) {
 			console.log('点击结果:', e)
-			this.parentId = e.id[0]
-			api.childrenTreeList({ id: e.id[0]}, 'maindataMaterialDistributor').then((res : any) => {
+			this.categoryId = e.id
+			api.byCategoryPage({ categoryId: e.id }, 'maindataOrganizationCategory').then((res : any) => {
 				if (res.code === 200) {
 					(this.$refs.moduleView as any).setTableValue(res.data.records);
 					let page = {
@@ -249,6 +290,7 @@
 				console.log(query);
 				query.status = this.radio;
 				this.dialogFormVisible = false;
+
 				if (this.popTitle === '新增') {
 					api.saveList(query, 'maindataMaterialDistributor').then((res : any) => {
 						if (res.code === 200) {
@@ -266,6 +308,7 @@
 						} else this.$message.error(res.msg);
 					})
 				}
+
 			})
 		}
 		// 获取列表数据
@@ -299,9 +342,9 @@
 		}
 		// 打开新增
 		onAdd() {
-			this.popTitle = '新增'
+			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)
@@ -310,7 +353,7 @@
 		openEdit(e : any) {
 			this.popTitle = '编辑'
 			this.dialogFormVisible = true;
-			this.radio = e.status
+			this.radio = e.status;
 			setTimeout(() => {
 				if ((this as any).$refs.addFormId) (this as any).$refs.addFormId.setValue(e);
 			}, 0)

+ 38 - 20
src/views/audit/manufacturer/index.vue

@@ -230,6 +230,20 @@
 						prop: 'contacts',
 						component: 'by-input',
 					},
+					{
+						span: 23,
+						labelWidth: '70px',
+						label: '手机号码',
+						prop: 'telephone',
+						component: 'by-input',
+					},
+					{
+						span: 23,
+						labelWidth: '70px',
+						label: '联系电话',
+						prop: 'phonenum',
+						component: 'by-input',
+					},
 					{
 						span: 23,
 						labelWidth: '70px',
@@ -289,25 +303,30 @@
 				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);
-				// 	})
-				// }
+				// 手机验证
+				let reg = /^1[3456789]\d{9}$/;
+				let reg2 = /^0\d{2,3}-\d{7,8}$/; 
+				if (query.telephone && !reg.test(query.telephone)) return this.$message.warning('请输入正确手机号码');
+				if (query.phonenum && !reg2.test(query.phonenum)) return this.$message.warning('请输入正确联系电话');
+				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);
+					})
+				}
 
 			})
 		}
@@ -322,7 +341,6 @@
 			}
 			clearInterval(this.timer)
 			let query = (this.$refs.moduleView as any).getQuery();
-			console.log(query);
 			api.pageList(query, 'maindataMaterialManufacturer').then((res : any) => {
 				if (res.code === 200) {
 					(this.$refs.moduleView as any).setTableValue(res.data.records);

+ 3 - 3
src/views/audit/order/index.vue

@@ -204,10 +204,10 @@
 										placeholder: '请选择状态',
 										clearable: true,
 										data: [{
-											value: 1,
+											value: 0,
 											label: '未接单'
 										}, {
-											value: 2,
+											value: 1,
 											label: '已接单'
 										}]
 									}
@@ -292,7 +292,7 @@
 								name: '接单',
 								event: {
 									show: (item : any) => {
-										return item.status === 1
+										return item.status === 0
 									},
 									click: (item : any) => {
 										(this as any).getOrder(item)

+ 5 - 1
src/views/audit/orderTask/index.vue

@@ -366,6 +366,9 @@
 							}, {
 								name: '反提交',
 								event: {
+									show: (item : any) => {
+										return item.sourceType == '手工输入'
+									},
 									click: (item : any) => (this as any).onReturnSmt(item)
 								}
 							}]
@@ -907,7 +910,8 @@
 			console.log('新增tabType ==>', this.tabType);
 			if (e === 'billTable_0') {
 				(this.$refs.product as any).setShow(true); // 打开sku弹窗
-				// let obj = (this.$refs.bill as any).getBillFormValue();
+				let obj = (this.$refs.bill as any).getBillFormValue();
+				console.log(obj);
 				// if (!this.tableData) this.tableData = obj.suborderList;
 				// console.log('this.tableData ==> ', this.tableData);
 				// (this.$refs.bill as any).setBillTableValue(this.tableData, 0);// 设置第1张单据表格数据

+ 23 - 30
src/views/audit/organClassify/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">
@@ -37,13 +37,13 @@
 		timeNum = 0;
 		timer : any = null
 		popTitle : any = ''
-		radio : any = 1
+		radio : any = 0
 		dialogFormVisible : boolean = false
 		parentIds: any = '';
 		treeConfig = {
 			attr: {
 				retConfig: {
-					parentId: 'parentId',
+					id: 'id',
 				},
 				defaultExpandAll: true,
 				label: 'name',
@@ -84,10 +84,10 @@
 								placeholder: '请选择状态',
 								clearable: true,
 								data: [{
-									value: 1,
+									value: 0,
 									label: '正常'
 								}, {
-									value: 2,
+									value: 1,
 									label: '禁用'
 								}]
 							}
@@ -107,27 +107,27 @@
 			table: {
 				attr: {
 					size: 'mini',
-					seq: true,
-					align: 'center',
-					checkbox: true,
+					align: 'left',
 					height: 600
 				},
 				columns: [{
 					title: '名称',
 					field: 'name',
 					isDetail: true,
-					width: 300,
+					width: 500,
 				},
+				{
+					width: 300,
+					title: '备注',
+					field: 'remark',
+				}, 
 				{
 					width: 80,
 					title: '状态',
 					field: 'status',
 					component: Assembly,
-				}, {
-					width: 500,
-					title: '备注',
-					field: 'remark',
-				}, {
+				}, 
+				{
 					width: 120,
 					title: '操作',
 					action: true,
@@ -136,9 +136,7 @@
 						name: '编辑',
 						audit: '',
 						event: {
-							click: (item : any) => {
-								(this as any).openEdit(item)
-							}
+							click: (item : any) => (this as any).openEdit(item)
 						}
 					}, {
 						name: '删除',
@@ -202,17 +200,11 @@
 		onChangeTree(e : any) {
 			console.log(e);
 			let data : any = {};
-			this.parentIds = e.parentId;
-			data.ids = e.parentId;
-			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;
-			// }
+			if (e.isContain) {
+				data.ids = e.id;
+			} else {
+				data.parentId = e.id;
+			};
 			api.childrenTreeList(data, 'maindataOrganizationCategory').then((res : any) => {
 				if (res.code === 200) {
 					(this.$refs.moduleView as any).setTableValue(res.data.records);
@@ -284,13 +276,14 @@
 		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)
 		}
 		// 打开编辑
 		openEdit(e : any) {
+			console.log(e);
 			this.popTitle = '编辑'
 			this.dialogFormVisible = true;
 			this.radio = e.status

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

@@ -49,7 +49,6 @@
 			attr: {
 				retConfig: {
 					id: 'id',
-					name: 'name'
 				},
 				defaultExpandAll: true,
 				label: 'name',
@@ -125,8 +124,8 @@
 			table: {
 				attr: {
 					size: 'mini',
-					seq: true,
-					align: 'center',
+					// seq: true,
+					align: 'left',
 					checkbox: false,
 					height: 600,
 				},
@@ -233,6 +232,13 @@
 						slot: true,
 						prop: 'remark',
 						component: 'by-input',
+						compConfig: {
+							attr: {
+								size: 'mini',
+								placeholder: '请输入备注',
+								type:'textarea'
+							},
+						}
 					},
 				],
 			]
@@ -246,18 +252,12 @@
 		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;
-			// }
-
+			if (e.isContain) {
+				data.ids = e.id;
+			} else {
+				data.parentId = e.id;
+			};
+			this.parentId = e.id;
 			api.childrenTreeList(data, 'maindataMaterialCategory').then((res : any) => {
 				if (res.code === 200) {
 					(this.$refs.moduleView as any).setTableValue(res.data.records);
@@ -426,6 +426,7 @@
 			let loading = this.$loading({ target: '.main-container' });
 			(this as any).$refs.moduleView.clearSearch();
 			this.parentId = '';
+			(this as any).$refs.sideTree.request();
 			this.getPageList({});
 			loading.close();
 		}

+ 6 - 7
src/views/audit/productManagement/index.vue

@@ -158,14 +158,13 @@
 			attr: {
 				retConfig: {
 					id: 'id',
-					name: 'name'
 				},
 				defaultExpandAll: true,
 				label: 'name',
 				resType: 'data'
 			},
 			request: {
-				url: '/maindata/maindataMaterialCategory/treeList',
+				url: '/maindata/maindataMaterialCategory/treeUseList',
 				method: 'GET'
 			}
 		}
@@ -608,7 +607,7 @@
 								defaultExpandAll: true
 							},
 							request: {
-								url: '/maindata/maindataMaterialCategory/treeList'
+								url: '/maindata/maindataMaterialCategory/treeUseList'
 							}
 						}
 					},
@@ -628,7 +627,7 @@
 								defaultExpandAll: true
 							},
 							request: {
-								url: '/maindata/maindataMaterialVmcategory/treeList'
+								url: '/maindata/maindataMaterialVmcategory/treeUseList'
 							}
 						}
 					},
@@ -649,7 +648,7 @@
 								defaultExpandAll: true
 							},
 							request: {
-								url: '/maindata/maindataMaterialOrganizationCategory/treeList'
+								url: '/maindata/maindataMaterialOrganizationCategory/treeUseList'
 							}
 						}
 					},
@@ -800,8 +799,8 @@
 			table: {
 				attr: {
 					size: 'mini',
-					seq: true,
-					align: 'center',
+					// seq: true,
+					align: 'left',
 					checkbox: true,
 					height: 560,
 				},

+ 22 - 15
src/views/audit/saleOrder/index.vue

@@ -674,22 +674,29 @@
 		}
 		// 打开拆单
 		orderTaking(item : any) {
-			this.vxeValue = true;
-			this.baseInfo = item;
-			this.regularData = (this as any).$lodash.cloneDeep(item.suborderList);
-			let rightData = (this as any).$lodash.cloneDeep(item.suborderList);
-			this.regularData.map((v : any) => {
-				v.splitNumber = v.number - v.splitOrderNumber;
+			let loading = this.$loading({ target: '.main-container' });
+			api.single({ id: item.id }, 'supplyPurchaseOrder').then((res : any) => {
+				console.log(res);
+				if (res.code === 200) {
+					this.vxeValue = true;
+					this.baseInfo = res.data;
+					this.regularData = (this as any).$lodash.cloneDeep(res.data.suborderList);
+					let rightData = (this as any).$lodash.cloneDeep(res.data.suborderList);
+					this.regularData.map((v : any) => {
+						v.splitNumber = v.number - v.splitOrderNumber;
+					})
+					rightData.map((v : any, i : any) => {
+						v.number = '0';
+						v.dataIndex = i;
+						v.splitNumber = v.number - v.splitOrderNumber;
+					});
+					loading.close();
+					setTimeout(() => {
+						(this.$refs.leftTable as any).setValue(this.regularData);
+						(this.$refs.rightTable as any).setValue(rightData);
+					}, 0)
+				}
 			})
-			rightData.map((v : any, i : any) => {
-				v.number = '0';
-				v.dataIndex = i;
-				v.splitNumber = v.number - v.splitOrderNumber;
-			});
-			setTimeout(() => {
-				(this.$refs.leftTable as any).setValue(this.regularData);
-				(this.$refs.rightTable as any).setValue(rightData);
-			}, 0)
 		}
 		// 确认拆单
 		doConfirm() {

+ 109 - 100
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="onRefresh" @clickHandle="clickHandle" @detail="openEdit" @onRefresh="onRefresh">
+				@resert="getDataList" @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="0">正常</el-radio>
@@ -31,30 +31,26 @@
 	import api from "@/api/currency";
 	import Assembly from "@/components/Assembly/material.vue";
 	@Component
-	export default class Virtually extends Vue {
-		// 左边
-		data : any = []
-		expandedKeys : any = []
-		parentId : any = ''
-		// 右边
+	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 = 0
 		dialogFormVisible : boolean = false
+		categoryId : any = '';
 		treeConfig = {
 			attr: {
 				retConfig: {
 					id: 'id',
-					name: 'name'
 				},
 				defaultExpandAll: true,
 				label: 'name',
 				resType: 'data'
 			},
 			request: {
-				url: '/maindata/maindataOrganizationCategory/treeList',
+				url: '/maindata/maindataOrganizationCategory/treeUseList',
 				method: 'GET'
 			}
 		}
@@ -76,29 +72,28 @@
 								clearable: true
 							},
 						},
-					},
-					{
+					}, {
 						span: 6,
-						label: '简称',
-						prop: 'shortName',
+						label: '负责人',
+						prop: 'contacts',
 						component: 'by-input',
 						labelWidth: '70px',
 						compConfig: {
 							attr: {
-								placeholder: '请输入简称',
+								placeholder: '请输入负责人',
 								clearable: true
-							},
-						},
+							}
+						}
 					},
 					{
 						span: 6,
 						label: '状态',
 						prop: 'status',
-						component: 'by-select',
 						labelWidth: '70px',
+						component: 'by-select',
 						compConfig: {
 							attr: {
-								placeholder: '请选择数据',
+								placeholder: '请选择状态',
 								clearable: true,
 								data: [{
 									value: 0,
@@ -123,28 +118,40 @@
 			table: {
 				attr: {
 					size: 'mini',
-					seq: true,
-					align: 'center',
-					checkbox: false,
+					align: 'left',
 					height: 600
 				},
 				columns: [{
-					width: 300,
 					title: '名称',
 					field: 'name',
 					isDetail: true,
-				}, {
-					title: '简称',
-					field: 'shortName'
-				}, {
+					width: 150,
+				},
+				{
+					title: '负责人',
+					field: 'contacts',
+					width: 120,
+				},
+				{
+					title: '联系电话',
+					field: 'phonenum',
+					width: 150,
+				},
+				{
+					title: '手机号码',
+					field: 'telephone',
+					width: 150,
+				},
+				{
+					width: 300,
+					title: '财务系统类型',
+					field: 'financeType',
+				},
+				{
 					width: 80,
 					title: '状态',
 					field: 'status',
 					component: Assembly,
-				},
-				{
-					title: '备注',
-					field: 'remark',
 				}, {
 					width: 120,
 					title: '操作',
@@ -171,11 +178,17 @@
 			attr: {
 				size: 'small',
 				rules: {
+					categoryName: [{
+						required: true, message: '请输入父级', trigger: 'blur'
+					}],
 					name: [{
 						required: true, message: '请输入名称', trigger: 'blur'
 					}],
-					parentName: [{
-						required: true, message: '请选择父级', trigger: 'change'
+					contacts: [{
+						required: true, message: '请输入负责人', trigger: 'blur'
+					}],
+					financeType: [{
+						required: true, message: '请输入财务系统类型', trigger: 'change'
 					}],
 				}
 			},
@@ -185,20 +198,20 @@
 						span: 23,
 						label: '父级',
 						labelWidth: '70px',
-						prop: 'parentName',
+						prop: 'categoryName',
 						component: 'select-tree',
 						compConfig: {
 							attr: {
 								label: 'name',
 								clearable: true,
 								retConfig: {
-									parentId: 'id',
-									parentName: 'name',
+									categoryId: 'id',
+									categoryName: 'name',
 								},
 								defaultExpandAll: true
 							},
 							request: {
-								url: '/maindata/maindataOrganizationCategory/treeList'
+								url: '/maindata/maindataOrganizationCategory/treeUseList'
 							}
 						}
 					},
@@ -212,9 +225,8 @@
 					{
 						span: 23,
 						labelWidth: '70px',
-						label: '简称',
-						slot: true,
-						prop: 'shortName',
+						label: '负责人',
+						prop: 'contacts',
 						component: 'by-input',
 					},
 					{
@@ -226,11 +238,25 @@
 					},
 					{
 						span: 23,
-						labelWidth: '70px',
-						label: '备注',
-						slot: true,
-						prop: 'remark',
-						component: 'by-input',
+						labelWidth: '110px',
+						label: '财务系统类型',
+						prop: 'financeType',
+						component: 'by-select',
+						compConfig: {
+							attr: {
+								placeholder: '请选择财务系统类型',
+								clearable: true,
+								data: [
+									{
+										value: '金蝶K3',
+										label: '金蝶K3'
+									}, {
+										value: '用友U8',
+										label: '用友U8'
+									},
+								]
+							}
+						}
 					},
 				],
 			]
@@ -238,19 +264,13 @@
 		mounted() {
 			this.timer = setInterval(() => {
 				this.getDataList()
-			}, 500)
+			}, 300)
 		}
 		//点击树获取数据
 		onChangeTree(e : 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) => {
+			console.log('点击结果:', e)
+			this.categoryId = e.id
+			api.byCategoryPage({ categoryId: e.id }, 'maindataOrganizationCategory').then((res : any) => {
 				if (res.code === 200) {
 					(this.$refs.moduleView as any).setTableValue(res.data.records);
 					let page = {
@@ -269,6 +289,7 @@
 				console.log(query);
 				query.status = this.radio;
 				this.dialogFormVisible = false;
+
 				if (this.popTitle === '新增') {
 					api.saveList(query, 'maindataMaterialSupplier').then((res : any) => {
 						if (res.code === 200) {
@@ -286,6 +307,7 @@
 						} else this.$message.error(res.msg);
 					})
 				}
+
 			})
 		}
 		// 获取列表数据
@@ -299,17 +321,6 @@
 			}
 			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);
@@ -318,7 +329,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);
 			})
 		}
@@ -330,32 +341,25 @@
 		}
 		// 打开新增
 		onAdd() {
-			this.popTitle = '新增'
+			this.popTitle = '新增';
 			this.dialogFormVisible = true;
-			this.radio = 0
+			this.radio = 0;
 			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;
-			e.parentId = e.id;
-			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)
-				}
-			})
+			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) => {
@@ -386,27 +390,33 @@
 				type: 'warning',
 				center: true
 			}).then(() => {
-				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('删除失败!请稍后再试');
+				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);
 				})
-			}).catch(() => this.$message.info('已取消删除'));
+			}).catch(() => {
+				this.$message.info('已取消删除');
+			});
 		}
-		// 刷新/重置
+		// 刷新
 		onRefresh() {
-			let loading = this.$loading({ target: '.main-container' });
+			this.loading = this.$loading({ target: '.main-container' });
 			(this as any).$refs.moduleView.clearSearch();
-			this.parentId = '';
-			this.getPageList({});
-			loading.close();
+			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);
+			})
 		}
 		//导出
 		onExport() {
@@ -437,7 +447,6 @@
 			border-right: solid #EEE 1px;
 			padding-right: 16px;
 			flex-shrink: 0;
-			height: 740px;
 
 			// box-sizing: border-box;
 			.bill-tab {
@@ -447,7 +456,7 @@
 				overflow: hidden;
 			}
 
-			.tab-title {
+			.title {
 				font-size: 16px;
 				padding-bottom: 16px;
 				width: 200px;

+ 19 - 12
src/views/audit/virtually/index.vue

@@ -47,7 +47,6 @@
 			attr: {
 				retConfig: {
 					id: 'id',
-					name: 'name'
 				},
 				defaultExpandAll: true,
 				label: 'name',
@@ -116,7 +115,6 @@
 			tool: {
 				tools: {
 					add: true,
-					// delete: true,
 					search: true,
 					refresh: true
 				}
@@ -124,8 +122,8 @@
 			table: {
 				attr: {
 					size: 'mini',
-					seq: true,
-					align: 'center',
+					// seq: true,
+					align: 'left',
 					checkbox: false,
 					height: 600
 				},
@@ -137,16 +135,18 @@
 				}, {
 					title: '简称',
 					field: 'shortName'
-				}, {
+				}, 
+				{
+					title: '备注',
+					field: 'remark',
+				}, 
+				{
 					width: 80,
 					title: '状态',
 					field: 'status',
 					component: Assembly,
 				},
 				{
-					title: '备注',
-					field: 'remark',
-				}, {
 					width: 120,
 					title: '操作',
 					action: true,
@@ -232,6 +232,13 @@
 						slot: true,
 						prop: 'remark',
 						component: 'by-input',
+						compConfig: {
+							attr: {
+								size: 'mini',
+								placeholder: '请输入备注',
+								type:'textarea'
+							},
+						}
 					},
 				],
 			]
@@ -243,14 +250,13 @@
 		}
 		//点击树获取数据
 		onChangeTree(e : any) {
-			this.parentId = e.id;
 			let data : any = {};
-			if (e.id.length > 1) {
+			if (e.isContain) {
 				data.ids = e.id;
-				if(data.ids[0] === 100) data.ids.shift(); 
 			} else {
 				data.parentId = e.id;
-			}
+			};
+			this.parentId = e.id;
 			api.childrenTreeList(data, 'maindataMaterialVmcategory').then((res : any) => {
 				if (res.code === 200) {
 					(this.$refs.moduleView as any).setTableValue(res.data.records);
@@ -405,6 +411,7 @@
 			let loading = this.$loading({ target: '.main-container' });
 			(this as any).$refs.moduleView.clearSearch();
 			this.parentId = '';
+			(this as any).$refs.sideTree.request();
 			this.getPageList({});
 			loading.close();
 		}

+ 11 - 3
src/views/audit/warehousing/components/towInOne.vue

@@ -34,7 +34,13 @@
 		@Prop()
 		propConfig : any;
 		get getPropConfig() {
-			return this.propConfig?.isSelect;
+			let boolean : any = null
+			if (this.parentValue.submitState && this.parentValue.submitState === 1) {
+				boolean = false
+			} else {
+				boolean = true
+			};
+			return boolean
 		}
 		config = {
 			attr: {
@@ -73,7 +79,9 @@
 				}]
 			]
 		}
-
+		created() {
+			// console.log(this.getPropConfig());
+		}
 		// 打开弹窗
 		openModal() {
 			let data = (this as any).$lodash.cloneDeep(this.propValue);
@@ -93,7 +101,7 @@
 		// 确定仓库仓位
 		doConfirm() {
 			let data : any = (this as any).$refs.form.getValue();
-			console.log('data',data);
+			console.log('data', data);
 			// console.log(this.parentValue);
 			if (!data.storehouseId || !data.storingLocationId) return this.$message.warning('仓库仓位为必填项');
 			data.towInOne = data.storehouseName + ',' + data.storingLocationName;

+ 14 - 17
src/views/audit/warehousing/index.vue

@@ -44,11 +44,11 @@
 						save: true,
 					}
 				},
-				log:{
-				  request:{
-				    url:'/supply/supplyEntryOrderOperateLog/page',
-				    method:'GET'
-				  }
+				log: {
+					request: {
+						url: '/supply/supplyEntryOrderOperateLog/page',
+						method: 'GET'
+					}
 				},
 				form: {
 					attr: {
@@ -144,9 +144,6 @@
 										title: '仓库,仓位',
 										field: 'towInOne',
 										component: towInOne,
-										compConfig: {
-											isSelect: true
-										}
 									},
 									{
 										width: 110,
@@ -776,19 +773,19 @@
 			console.log('新增 ==>', e);
 			if (e === 'billTable_0') {
 				(this.$refs.product as any).setShow(true); // 打开sku弹窗
-				let obj = (this.$refs.bill as any).getBillFormValue();
-				if (!this.tableData) this.tableData = obj.suborderList;
-				console.log('this.tableData ==> ', this.tableData);
-				(this.$refs.bill as any).setBillTableValue(this.tableData, 0);// 设置第1张单据表格数据
+				// let obj = (this.$refs.bill as any).getBillFormValue();
+				// if (!this.tableData) this.tableData = obj.suborderList;
+				// console.log('this.tableData ==> ', this.tableData);
+				// (this.$refs.bill as any).setBillTableValue(this.tableData, 0);// 设置第1张单据表格数据
 			} else {
 				let billConfig = (this as any).$lodash.cloneDeep(this.config.bill);
 				billConfig.form.attr.readonly = false; // 设置只读
 				billConfig.tool.tools = { save: true, };
-				// if (e === 'all') {
-				// 	billConfig.tool.tools = { save: true, smt: true };
-				// 	this.tableData = [];
-				// 	(this.$refs.bill as any).setBillTableValue(this.tableData, 0);// 设置第1张单据表格数据
-				// }
+				if (e === 'all') {
+					billConfig.tool.tools = { save: true, smt: true };
+					this.tableData = [];
+					(this.$refs.bill as any).setBillTableValue(this.tableData, 0);// 设置第1张单据表格数据
+				}
 				billConfig.tableConfig[0].tool.tools = { add: true };
 				this.isAdd = true;
 				(this.$refs.bill as any).setBillConfig(billConfig);

+ 1 - 1
vue.config.js

@@ -32,7 +32,7 @@ module.exports = defineConfig({
       // detail: https://cli.vuejs.org/config/#devserver-proxy
       [process.env.VUE_APP_BASE_API]: {
         ws:false,
-        // target: `http://192.168.1.79:9207`,
+        // target: `http://192.168.1.78:8080`,
         target: `http://192.168.2.202:8080`,
         // target: `http://192.168.1.86:8080`,
         changeOrigin: true,