Browse Source

Merge branch 'master' of http://47.107.53.207:3000/ymy/oms

ymy 2 years ago
parent
commit
21c4924248

+ 3 - 3
src/api/currency.ts

@@ -23,9 +23,9 @@ function childrenTreeList(data : any, url : any) {
 	})
 }
 // 根据分类ID(数组)分页查询数据
-function ByCategoryPage(data : any, url : any) {
+function byCategoryPage(data : any, url : any) {
 	return request({
-		url: '/maindata/' + url + '/ByCategoryPage',
+		url: '/maindata/' + url + '/byCategoryPage',
 		method: 'GET',
 		params: data
 	})
@@ -74,7 +74,7 @@ export default {
 	treeList,
 	treeUseList,
 	childrenTreeList,
-	ByCategoryPage,
+	byCategoryPage,
 	single,
 	pageList,
 	saveList,

+ 2 - 2
src/benyun/utils/request.ts

@@ -30,11 +30,11 @@ service.interceptors.request.use((config:any) => {
   const user = store.getters.userInfo;
   //设置租户id
   if(user.tenantId){
-    config.headers['Tenantid'] = user.tenantId
+    config.headers['tenantId'] = user.tenantId
   }
   if (getToken() && !isToken) {
     config.headers['Authorization'] = 'Bearer ' + getToken() // 让每个请求携带自定义token 请根据实际情况自行修改
-		config.headers['tenantId'] = '000000';
+		// config.headers['tenantId'] = '000000';
   }
   // get请求映射params参数
   if ((config.method === 'get' || config.method === 'post') && config.params) {

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

@@ -230,9 +230,9 @@
 		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) => {
+			api.childrenTreeList({ id: e.id[0]}, 'maindataMaterialDistributor').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, //每页条数

+ 97 - 53
src/views/audit/manufacturer/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,10 +270,10 @@
 		//点击树获取数据
 		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) => {
+			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);
+					(this.$refs.moduleView as any).setTableValue(res.data.records);
 					let page = {
 						pageNo: res.data.current, //当前页
 						pageSize: res.data.size, //每页条数
@@ -248,24 +289,26 @@
 				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);
-					})
-				}
+				// 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);
+				// 	})
+				// }
+
 			})
 		}
 		// 获取列表数据
@@ -279,6 +322,7 @@
 			}
 			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);
@@ -299,9 +343,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 +354,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 - 35
src/views/audit/orderTask/index.vue

@@ -31,6 +31,7 @@
 		// 右边
 		supplierInfo : any = {} // 机构信息
 		tableData : any = []
+		newTableData : any = []
 		mergeObj : any = []
 		setStatusData : any = ''
 		timeNum = 0;
@@ -906,10 +907,10 @@
 			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();
-				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; // 设置只读
@@ -1135,34 +1136,6 @@
 			e.realityPrice = parseFloat((e.number * e.unitPrice).toFixed(2));
 			e.totalPrice = e.realityPrice - e.prePrice;
 		}
-		// 确定商品新增
-		confirmProduct(e : any) {
-			let contents : any = [], goodsData = e, newArr : any = [], obj : any = {};
-			goodsData = goodsData.map((item : any) => {
-				item.materialName = item.skuTitle
-				item.prePrice = 0
-				item.unitPrice = item.price
-				item.materialSku = item.id
-				const { id, ...newData } = item
-				return newData
-			})
-			this.tableData = this.tableData.concat(goodsData);
-			newArr = this.tableData.reduce((prev : any, current : any) => {
-				obj[current.materialSku] ? contents.push(current.materialName) : (obj[current.materialSku] = true && prev.push(current))
-				return prev
-			}, []);
-			this.tableData = newArr;
-			this.tableData.map((v : any, i : any) => {
-				v.dataIndex = i;
-				if (!v.prePrice) v.prePrice = '0';
-			});
-			if (contents.length > 0) {
-				this.$alert('商品 “' + contents + '” 已存在!', '提示', {
-					confirmButtonText: '确定',
-				});
-			};
-			(this.$refs.bill as any).setBillTableValue(this.tableData, 0);// 设置第1张单据表格数据
-		}
 		// 派单
 		onDispatch(e : any) {
 			console.log('派单 ==>', e);
@@ -1292,6 +1265,36 @@
 			if (data === 'smt') this.getPageList({ submitState: 1 }, 'smt'); // 已提交数据
 			if (data === 'recycleBin') this.getSelectDeleteList({}) // 回收站数据
 		}
+		// 确定商品新增
+		confirmProduct(e : any) {
+			let contents : any = [], goodsData = e, newArr : any = [], obj : any = {};
+			goodsData = goodsData.map((item : any) => {
+				item.materialName = item.skuTitle
+				item.prePrice = 0
+				item.unitPrice = item.price
+				item.materialSku = item.id
+				const { id, ...newData } = item
+				return newData
+			})
+			console.log('newTableData ==> ', this.newTableData);
+			this.tableData = this.newTableData.concat(goodsData);
+			console.log('tableData ==> ', this.tableData);
+			newArr = this.tableData.reduce((prev : any, current : any) => {
+				obj[current.materialSku] ? contents.push(current.materialName) : (obj[current.materialSku] = true && prev.push(current))
+				return prev
+			}, []);
+			this.tableData = newArr;
+			this.tableData.map((v : any, i : any) => {
+				v.dataIndex = i;
+				if (!v.prePrice) v.prePrice = '0';
+			});
+			if (contents.length > 0) {
+				this.$alert('商品 “' + contents + '” 已存在!', '提示', {
+					confirmButtonText: '确定',
+				});
+			};
+			(this.$refs.bill as any).setBillTableValue(this.tableData, 0);// 设置第1张单据表格数据
+		}
 		// 单据表格删除
 		changeTable(item : any) {
 			this.$confirm('确定删除吗!', '注意', {
@@ -1301,10 +1304,10 @@
 				center: true
 			}).then(() => {
 				this.tableData[item.dataIndex].isDeleted = 1;
-				let newData = this.tableData.filter((res : any) => res.isDeleted === 0);
+				this.newTableData = this.tableData.filter((res : any) => res.isDeleted === 0);
 				console.log('原表格数据 ==> ', this.tableData);
-				console.log('新表格数据 ==> ', newData);
-				(this.$refs.bill as any).setBillTableValue(newData, 0);// 设置第1张单据表格数据
+				console.log('新表格数据 ==> ', this.newTableData);
+				(this.$refs.bill as any).setBillTableValue(this.newTableData, 0);// 设置第1张单据表格数据
 				this.$message.success('删除成功');
 			}).catch(() => this.$message.info('已取消删除'));
 		}

+ 17 - 7
src/views/audit/organClassify/index.vue

@@ -39,12 +39,11 @@
 		popTitle : any = ''
 		radio : any = 1
 		dialogFormVisible : boolean = false
-		parentId: any = '';
+		parentIds: any = '';
 		treeConfig = {
 			attr: {
 				retConfig: {
-					id: 'id',
-					name: 'name'
+					parentId: 'parentId',
 				},
 				defaultExpandAll: true,
 				label: 'name',
@@ -201,11 +200,22 @@
 		}
 		//点击树获取数据
 		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) => {
+			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;
+			// }
+			api.childrenTreeList(data, 'maindataOrganizationCategory').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, //每页条数

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

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

+ 10 - 10
src/views/audit/supplier/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: '禁用'
 								}]
 							}
@@ -116,7 +116,6 @@
 			tool: {
 				tools: {
 					add: true,
-					// delete: true,
 					search: true,
 					refresh: true
 				}
@@ -199,7 +198,7 @@
 								defaultExpandAll: true
 							},
 							request: {
-								url: '/maindata/maindataMaterialSupplier/treeList'
+								url: '/maindata/maindataOrganizationCategory/treeList'
 							}
 						}
 					},
@@ -247,7 +246,7 @@
 			let data : any = {};
 			if (e.id.length > 1) {
 				data.ids = e.id;
-				if(data.ids[0] === 100) data.ids.shift(); 
+				if (data.ids[0] === 100) data.ids.shift();
 			} else {
 				data.parentId = e.id;
 			}
@@ -333,7 +332,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)
@@ -343,7 +342,8 @@
 			console.log(e);
 			this.popTitle = '编辑'
 			this.dialogFormVisible = true;
-			this.radio = e.status
+			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