AlanWong 2 роки тому
батько
коміт
d380c7bcb0

+ 9 - 1
src/api/currency.ts

@@ -15,7 +15,14 @@ function childrenTreeList(data : any, url : any) {
 		params: data
 	})
 }
-
+// 通过主建id查单条数据
+function single(data : any, url : any) {
+	return request({
+		url: '/maindata/' + url + '/single',
+		method: 'GET',
+		params: data
+	})
+}
 // 分页查询数据
 function pageList(data : any, url : any) {
 	return request({
@@ -52,6 +59,7 @@ function deleteList(data : any, url : any) {
 export default {
 	treeList,
 	childrenTreeList,
+	single,
 	pageList,
 	saveList,
 	updateList,

+ 45 - 0
src/components/ForTab/index.vue

@@ -0,0 +1,45 @@
+<template>
+	<div>
+		<el-tag :key="tag" v-for="tag in dynamicTags" closable :disable-transitions="false" @close="handleClose(tag)">
+			{{tag}}
+		</el-tag>
+		<el-input class="input-new-tag" v-if="inputVisible" v-model="inputValue" ref="saveTagInput" size="small"
+			@keyup.enter.native="handleInputConfirm" @blur="handleInputConfirm">
+		</el-input>
+		<el-button v-else class="button-new-tag" size="small" @click="showInput">+ New Tag</el-button>
+	</div>
+</template>
+
+<script lang="ts">
+	import { Component, Prop, Vue, Mixins, Watch } from "vue-property-decorator";
+	import VueViews from '@/benyun/compVue/VueViews'
+	@Component
+	export default class Tab extends VueViews {
+		dynamicTags = ['标签一', '标签二', '标签三']
+		inputVisible = false
+		inputValue = ''
+
+		handleClose(tag : any) {
+			this.dynamicTags.splice(this.dynamicTags.indexOf(tag), 1);
+		}
+		showInput() {
+			this.inputVisible = true;
+			this.$nextTick(() => {
+				(this as any).$refs.saveTagInput.$refs.input.focus();
+			});
+		}
+		handleInputConfirm() {
+			let inputValue = this.inputValue;
+			if (inputValue) {
+				this.dynamicTags.push(inputValue);
+			}
+			this.inputVisible = false;
+			this.inputValue = '';
+		}
+
+	}
+</script>
+
+<style lang="scss" scoped>
+
+</style>

+ 9 - 1
src/router/index.ts

@@ -95,7 +95,15 @@ export const constantRoutes: Array<any> = [
         meta: {
           title: '弹窗'
         }
-      }
+      },
+			{
+			  path:'tab',
+			  component:()=> import('@/views/demo/tab.vue'),
+			  name:'Tab',
+			  meta: {
+			    title: '标签'
+			  }
+			}
     ]
   }
 ]

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

@@ -40,6 +40,7 @@
 	export default class AgencyGoods extends Vue {
 		// 左边
 		data : any = []
+		parentId:any=''
 		props = {
 			label: 'name',
 			children: 'children'
@@ -94,10 +95,10 @@
 								placeholder: '请选择数据',
 								clearable: true,
 								data: [{
-									value: 1,
+									value: 0,
 									label: '正常'
 								}, {
-									value: 0,
+									value: 1,
 									label: '禁用'
 								}]
 							}
@@ -109,7 +110,7 @@
 			tool: {
 				tools: {
 					add: true,
-					delete: true,
+					// delete: true,
 					search: true,
 					refresh: true
 				}
@@ -119,7 +120,7 @@
 					size: 'mini',
 					seq: true,
 					align: 'center',
-					checkbox: true,
+					checkbox: false,
 					height: 600
 				},
 				columns: [{
@@ -176,7 +177,7 @@
 						span: 23,
 						label: '父级',
 						labelWidth: '70px',
-						prop: 'parentId',
+						prop: 'parentName',
 						component: 'select-tree',
 						compConfig: {
 							attr: {
@@ -224,11 +225,11 @@
 				],
 			]
 		}
-		created() {
+		mounted() {
 			this.getTreeList()
 			this.timer = setInterval(() => {
 				this.getDataList()
-			}, 500)
+			}, 300)
 		}
 		// 获取树型导航数据
 		getTreeList() {
@@ -280,6 +281,7 @@
 			}
 			clearInterval(this.timer)
 			let query = (this.$refs.moduleView as any).getQuery();
+			query.parentId = this.parentId;
 			console.log('表单字段 ==> ', query);
 			api.pageList(query, 'maindataMaterialOrganizationCategory').then((res : any) => {
 				if (res.code === 200) {
@@ -314,9 +316,14 @@
 			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},'maindataMaterialOrganizationCategory').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() {
@@ -359,15 +366,20 @@
 				type: 'warning',
 				center: true
 			}).then(() => {
-				api.deleteList({ ids: item.id }, 'maindataMaterialOrganizationCategory').then((res : any) => {
-					if (res.code === 200) {
-						this.getTreeList();
-						this.getDataList();
-						this.$message({
-							type: 'success',
-							message: '删除成功!'
-						});
-					} else this.failHandle(res)
+				api.childrenTreeList({ id: item.id }, 'maindataMaterialOrganizationCategory').then((v : any) => {
+					if (v.code === 200) {
+						if (v.data.length > 0) return this.$message({ type: 'error', message: '此数据有子节点,不能进行删除!' })
+						api.deleteList({ ids: item.id }, 'maindataMaterialOrganizationCategory').then((res : any) => {
+							if (res.code === 200) {
+								this.getTreeList();
+								this.getDataList();
+								this.$message({
+									type: 'success',
+									message: '删除成功!'
+								});
+							} else this.failHandle(res)
+						})
+					} else this.$message({ type: 'error', message: '删除失败!请稍后再试' })
 				})
 			}).catch(() => {
 				this.$message({
@@ -378,6 +390,7 @@
 		}
 		// 导航切换
 		handleNodeClick(e : any) {
+			this.parentId=e.id
 			api.childrenTreeList({ id: e.id }, 'maindataMaterialOrganizationCategory').then((res : any) => {
 				if (res.code === 200) {
 					(this.$refs.moduleView as any).setTableValue(res.data);

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

@@ -211,21 +211,11 @@
 				],
 			]
 		}
-		created() {
-			// this.getTreeList()
+		mounted() {
 			this.timer = setInterval(() => {
 				this.getDataList()
-			}, 500)
+			}, 300)
 		}
-		// 获取树型导航数据
-		// getTreeList() {
-		// 	materialClass.treeList().then((res : any) => {
-		// 		// console.log(res.data[0]);
-		// 		if (res.code === 200) {
-		// 			this.data = res.data[0].children;
-		// 		} else this.failHandle(res)
-		// 	})
-		// }
 		// 确认新增/编辑
 		confirm() {
 			(this as any).$refs.addFormId.validate().then(() => {

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

@@ -233,10 +233,10 @@
 				]
 			]
 		}
-		created() {
+		mounted() {
 			this.timer = setInterval(() => {
 				this.getDataList()
-			}, 500)
+			}, 300)
 		}
 		// 确认新增/编辑
 		confirm() {

+ 12 - 2
src/views/audit/brand/index.vue

@@ -27,6 +27,7 @@
 	@Component
 	export default class Brand extends Vue {
 		baseURL : any = process.env.VUE_APP_BASE_API
+		loading : any = null
 		timeNum = 0;
 		timer : any = null
 		popTitle : any = ''
@@ -189,10 +190,19 @@
 				]
 			]
 		}
-		created() {
+		mounted() {
+			// this.loading = this.$loading({
+			// 	target:'bill-main',
+			// 	lock: true,
+			// 	text: 'Loading',
+			// 	spinner: 'el-icon-loading',
+			// });
+			// setTimeout(() => {
+			// 	this.loading.close();
+			// },3000)
 			this.timer = setInterval(() => {
 				this.getDataList()
-			}, 500)
+			}, 300)
 		}
 		// 确认新增/编辑
 		confirm() {

+ 0 - 3
src/views/audit/collaborationLog/index.vue

@@ -1,3 +0,0 @@
-<template>
-  <div style="height:1200px">123</div>
-</template>

+ 25 - 67
src/views/audit/depots/index.vue

@@ -3,7 +3,7 @@
 		<transition-group name="fade" style="position: relative;width: 100%;display: flex;">
 			<div class="bill-main" v-show="isShow==='ckb'" key="item">
 				<module-view :propConfig="config" ref="moduleView" @pagination="getDataList" @search="getDataList"
-					@resert="getDataList" @clickHandle="clickHandle" @detail="changeTab">
+					@resert="getDataList" @clickHandle="clickHandle" @detail="openEdit">
 				</module-view>
 				<!-- 新增/编辑弹窗 -->
 				<el-dialog :title="popTitle+'仓库'" :visible.sync="dialogFormVisible" width="30%">
@@ -15,8 +15,7 @@
 				</el-dialog>
 			</div>
 			<div class="bill-main" v-show="isShow==='cwb'" key="item2">
-				<module-view :propConfig="config2" ref="moduleView2" @pagination="getDataList2" @search="getDataList2"
-					@resert="getDataList2" @clickHandle="clickHandle2" @detail="openEdit2">
+				<module-view :propConfig="config2" ref="moduleView2" @clickHandle="clickHandle2" @detail="openEdit2">
 				</module-view>
 				<!-- 新增/编辑弹窗 -->
 				<el-dialog :title="popTitle+'仓位'" :visible.sync="dialogFormVisible2" width="30%">
@@ -38,9 +37,8 @@
 		isShow : any = 'ckb'
 		timeNum = 0;
 		timer : any = null
-		timeNum2 = 0;
-		timer2 : any = null
 		popTitle : any = ''
+		tableData : any = ''
 		dialogFormVisible : boolean = false
 		dialogFormVisible2 : boolean = false
 		config : any = {
@@ -111,7 +109,7 @@
 						audit: '',
 						event: {
 							click: (item : any) => {
-								(this as any).changeTab()
+								(this as any).changeTab(item)
 							}
 						}
 					}]
@@ -279,7 +277,7 @@
 					}, {
 						name: '删除',
 						event: {
-							click: (item : any) => (this as any).doDelete2(item, 'maindataStoringLocation')
+							click: (item : any) => (this as any).doDelete2(item)
 						}
 					}]
 				}]
@@ -371,13 +369,13 @@
 				this.getDataList()
 			}, 500)
 		}
-		changeTab() {
+		changeTab(item : any) {
+			console.log(item);
+			this.tableData = item;
+			(this.$refs.moduleView2 as any).setTableValue(item.subList);
 			this.isShow = 'cwb';
-			this.timer2 = setInterval(() => {
-				this.getDataList2()
-			}, 500)
 		}
-		// 确认新增/编辑
+		// 仓库确认新增/编辑
 		confirm() {
 			(this as any).$refs.addFormId.validate().then(() => {
 				let query = (this as any).$refs.addFormId.getValue();
@@ -405,31 +403,22 @@
 				}
 			})
 		}
+		// 仓位确认新增/编辑
 		confirm2() {
 			(this as any).$refs.addFormId2.validate().then(() => {
 				let query = (this as any).$refs.addFormId2.getValue();
+				this.tableData.subList = [query];
+				console.log(this.tableData);
 				this.dialogFormVisible2 = false;
-				if (this.popTitle === '新增') {
-					api.saveList(query, 'maindataStoringLocation').then((res : any) => {
-						if (res.code === 200) {
-							this.$message({
-								type: 'success',
-								message: this.popTitle + '成功!'
-							});
-							this.getDataList2();
-						} else this.failHandle(res)
-					})
-				} else if (this.popTitle === '编辑') {
-					api.updateList(query, 'maindataStoringLocation').then((res : any) => {
-						if (res.code === 200) {
-							this.$message({
-								type: 'success',
-								message: this.popTitle + '成功!'
-							});
-							this.getDataList2();
-						} else this.failHandle(res)
-					})
-				}
+				api.updateList(this.tableData, 'maindataStorehouse').then((res : any) => {
+					if (res.code === 200) {
+						this.$message({
+							type: 'success',
+							message: this.popTitle + '成功!'
+						});
+						this.getDataList();
+					} else this.failHandle(res)
+				})
 			})
 		}
 		// 获取仓库列表数据
@@ -455,29 +444,6 @@
 				} else this.failHandle(res)
 			})
 		}
-		// 获取仓位列表数据
-		getDataList2() {
-			if (!this.$refs.moduleView2) {
-				if (this.timeNum2 > 5) {
-					clearInterval(this.timer2)
-				}
-				this.timeNum2++;
-				return
-			}
-			clearInterval(this.timer2)
-			let query = (this.$refs.moduleView2 as any).getQuery();
-			api.pageList(query, 'maindataStoringLocation').then((res : any) => {
-				if (res.code === 200) {
-					(this.$refs.moduleView2 as any).setTableValue(res.data.records);
-					let page = {
-						pageNo: res.data.current, //当前页
-						pageSize: res.data.size, //每页条数
-						total: res.data.total //总条数
-					};
-					(this.$refs.moduleView2 as any).setPage(page)
-				} else this.failHandle(res)
-			})
-		}
 		// 工具栏方法
 		clickHandle(e : any) {
 			console.log(e);
@@ -490,7 +456,6 @@
 			console.log(e);
 			if (e === 'onRefresh') (this.$refs.moduleView2 as any).resert();
 			if (e === 'onAdd') this.onAdd2();
-			if (e === 'onDelete') this.onDelete('moduleView2', 'maindataStoringLocation');
 			if (e === 'onExport') this.onExport();
 			if (e === 'onReturn') this.isShow = 'ckb';
 		}
@@ -558,22 +523,15 @@
 			});
 		}
 		// 操作删除
-		doDelete2(item : any, url : any) {
+		doDelete2(item : any) {
+			console.log(item);
 			this.$confirm('确定删除吗,此操作不能撤销!', '注意', {
 				confirmButtonText: '确定',
 				cancelButtonText: '取消',
 				type: 'warning',
 				center: true
 			}).then(() => {
-				api.deleteList({ ids: item.id }, url).then((res : any) => {
-					if (res.code === 200) {
-						this.getDataList();
-						this.$message({
-							type: 'success',
-							message: '删除成功!'
-						});
-					} else this.failHandle(res)
-				})
+
 			}).catch(() => {
 				this.$message({
 					type: 'info',

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

@@ -337,7 +337,7 @@
 				],
 			],
 		}
-		created() {
+		mounted() {
 			setTimeout(() => {
 				if (this.$route.params) (this as any).$refs.form.setValue(this.$route.params.baseInfo)
 			}, 300)

+ 46 - 35
src/views/audit/orderTask/index.vue

@@ -13,7 +13,7 @@
 	@Component
 	export default class OrderTask extends Vue {
 		// 右边
-		baseURL : any = process.env.VUE_APP_BASE_API
+		tableData : any = ''
 		setStatusData : any = ''
 		timeNum = 0;
 		timer : any = null
@@ -171,29 +171,8 @@
 										audit: '',
 										event: {
 											click: (item : any) => {
-												console.log('该行数据:', item)
-												item.isDeleted = 1;
-												this.$confirm('确定删除吗', '注意', {
-													confirmButtonText: '确定',
-													cancelButtonText: '取消',
-													type: 'warning',
-													center: true
-												}).then(() => {
-													// api.deleteList({ ids: item.id }, 'supplyTaskOrder').then((res : any) => {
-													// 	if (res.code === 200) {
-													// 		this.getDataList();
-													// 		this.$message({
-													// 			type: 'success',
-													// 			message: '删除成功!'
-													// 		});
-													// 	} else this.failHandle(res)
-													// })
-												}).catch(() => {
-													this.$message({
-														type: 'info',
-														message: '已取消删除'
-													});
-												});
+												(this as any).changeTable(item)
+
 											}
 										}
 									}]
@@ -823,10 +802,10 @@
 		// 保存
 		onSave(e : any) {
 			console.log('保存 ==>', e);
-			if(e==='bill'){
+			if (e === 'bill') {
 				(this as any).$refs.bill.$refs.billForm.validate().then(() => {
 					let query = (this.$refs.bill as any).getBillFormValue(); // 获取单据数据
-					query.suborderList.unshift({materialName:'test'})
+					query.suborderList = this.tableData.filter((res : any) => res.isDeleted === 0);
 					console.log(query);
 					api.updateList(query, 'supplyTaskOrder').then((res : any) => {
 						if (res.code === 200) {
@@ -842,21 +821,28 @@
 		// 打开新增
 		onAdd(e : any) {
 			console.log('新增 ==>', e);
-			if(e==='billTable_0'){
-				let data = (this.$refs.bill as any).getBillFormValue();
-				data.suborderList.unshift({isDeleted:0,taskOrderId:data.id})
-				console.log(data);
-				(this.$refs.bill as any).setBillTableValue(data, 0);// 设置第1张单据表格数据
+			if (e === 'billTable_0') {
+				let obj = (this.$refs.bill as any).getBillFormValue();
+				if (!this.tableData) this.tableData = obj.suborderList;
+				this.tableData.unshift({ isDeleted: 0, taskOrderId: obj.id })
+				console.log(this.tableData);
+				(this.$refs.bill as any).setBillTableValue(this.tableData, 0);// 设置第1张单据表格数据
 			}
 			// (this.$refs.bill as any).setBillFormValue({}); // 设置单据表单数据
 			// (this.$refs.bill as any).showTab = 'bill';
 		}
 		// 打开编辑
 		openEdit(e : any) {
-			console.log('编辑 ==>', e);
 			e = e.row ? e.row : e;
+			console.log('编辑 ==>', e);
+			let data = e.suborderList
+			data.map((v : any, i : any) => {
+				v.dataIndex = i
+				// v.dataIndex = Math.round(Math.random()*100+1)
+			});
+			this.tableData = data;
 			(this.$refs.bill as any).setBillFormValue(e); // 设置单据表单数据
-			(this.$refs.bill as any).setBillTableValue(e.suborderList, 0);// 设置第1张单据表格数据
+			(this.$refs.bill as any).setBillTableValue(data, 0);// 设置第1张单据表格数据
 			(this.$refs.bill as any).showTab = 'bill';
 		}
 		// 派单
@@ -955,9 +941,34 @@
 			if (e === 'smt') this.getPageList({ submitState: 1 }, 'smt'); // 已提交数据
 			if (e === 'recycleBin') this.getSelectDeleteList('supplyTaskOrder') // 回收站数据
 		}
+		// 单据表格数据更新
+		changeTable(item : any) {
+			this.$confirm('确定删除吗!', '注意', {
+				confirmButtonText: '确定',
+				cancelButtonText: '取消',
+				type: 'warning',
+				center: true
+			}).then(() => {
+				this.tableData[item.dataIndex].isDeleted = 1;
+				let newData = this.tableData.filter((res : any) => res.isDeleted === 0)
+				console.log(this.tableData);
+				console.log(newData);
+				(this.$refs.bill as any).setBillTableValue(newData, 0);// 设置第1张单据表格数据
+				this.$message({
+					type: 'success',
+					message: '删除成功!'
+				});
+			}).catch((res : any) => {
+				console.log(res);
+				this.$message({
+					type: 'info',
+					message: '已取消删除'
+				});
+			});
+		}
 		// 工具栏删除
-		onDelete(e:any) {
-			console.log('工具栏删除 ==> ',e);
+		onDelete(e : any) {
+			console.log('工具栏删除 ==> ', e);
 			let selectData = (this.$refs.bill as any).getTableSelectData(e)
 			let ids = '';
 			if (selectData.length > 0) {

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

@@ -29,12 +29,12 @@
 <script lang="ts">
 	import { Component, Prop, Vue, Watch } from "vue-property-decorator";
 	import api from "@/api/currency";
-	// import other from '@/api/other'
 	import Assembly from "@/components/Assembly/material.vue";
 	@Component
 	export default class ProductClassification extends Vue {
 		// 左边
 		data : any = []
+		parentId:any=''
 		props = {
 			label: 'name',
 			children: 'children'
@@ -89,10 +89,10 @@
 								placeholder: '请选择数据',
 								clearable: true,
 								data: [{
-									value: 1,
+									value: 0,
 									label: '正常'
 								}, {
-									value: 0,
+									value: 1,
 									label: '禁用'
 								}]
 							}
@@ -104,7 +104,7 @@
 			tool: {
 				tools: {
 					add: true,
-					delete: true,
+					// delete: true,
 					search: true,
 					refresh: true
 				}
@@ -114,7 +114,7 @@
 					size: 'mini',
 					seq: true,
 					align: 'center',
-					checkbox: true,
+					checkbox: false,
 					height: 600
 				},
 				columns: [{
@@ -171,7 +171,7 @@
 						span: 23,
 						label: '父级',
 						labelWidth: '70px',
-						prop: 'parentId',
+						prop: 'parentName',
 						component: 'select-tree',
 						compConfig: {
 							attr: {
@@ -219,7 +219,7 @@
 				],
 			]
 		}
-		created() {
+		mounted() {
 			this.getTreeList()
 			this.timer = setInterval(() => {
 				this.getDataList()
@@ -278,8 +278,15 @@
 			}
 			clearInterval(this.timer)
 			let query = (this.$refs.moduleView as any).getQuery();
-			// console.log('表单字段 ==> ', query);
-			api.pageList(query, 'maindataMaterialCategory').then((res : any) => {
+			query.parentId = this.parentId;
+			let newData:any = {}
+			for (let key in query) {
+				if (query[key] && query[key].toString().replaceAll(/(^\s*)|(\s*$)/g, '') !== '') {
+					newData[key]=query[key]
+				}
+			}			
+			console.log('表单字段 ==> ', newData);
+			api.pageList(newData, 'maindataMaterialCategory').then((res : any) => {
 				if (res.code === 200) {
 					(this.$refs.moduleView as any).setTableValue(res.data.records);
 					let page = {
@@ -313,9 +320,14 @@
 			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},'maindataMaterialCategory').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() {
@@ -358,15 +370,20 @@
 				type: 'warning',
 				center: true
 			}).then(() => {
-				api.deleteList({ ids: item.id }, 'maindataMaterialCategory').then((res : any) => {
-					if (res.code === 200) {
-						this.getTreeList();
-						this.getDataList();
-						this.$message({
-							type: 'success',
-							message: '删除成功!'
-						});
-					} else this.failHandle(res)
+				api.childrenTreeList({ id: item.id }, 'maindataMaterialCategory').then((v : any) => {
+					if (v.code === 200) {
+						if (v.data.length > 0) return this.$message({ type: 'error', message: '此数据有子节点,不能进行删除!' })
+						api.deleteList({ ids: item.id }, 'maindataMaterialCategory').then((res : any) => {
+							if (res.code === 200) {
+								this.getTreeList();
+								this.getDataList();
+								this.$message({
+									type: 'success',
+									message: '删除成功!'
+								});
+							} else this.failHandle(res)
+						})
+					}else this.$message({ type: 'error', message: '删除失败!请稍后再试' })
 				})
 			}).catch(() => {
 				this.$message({
@@ -377,6 +394,7 @@
 		}
 		// 导航切换
 		handleNodeClick(e : any) {
+			this.parentId=e.id
 			api.childrenTreeList({ id: e.id }, 'maindataMaterialCategory').then((res : any) => {
 				if (res.code === 200) {
 					(this.$refs.moduleView as any).setTableValue(res.data);

+ 68 - 46
src/views/audit/productManagement/index.vue

@@ -11,6 +11,7 @@
 				<module-view :propConfig="config" ref="moduleView" @pagination="getDataList" @search="getDataList"
 					@resert="getDataList" @clickHandle="clickHandle" @detail="getDetail" />
 			</div>
+			<!-- 新增 -->
 			<div class="detil" v-show="isShow==='add'" key="item3">
 				<by-tool :propConfig="toolConfig" @clickHandle="insideTools" />
 				<div class="box-shadow">
@@ -23,7 +24,9 @@
 							<el-radio v-model="radio" :label="1">单规格</el-radio>
 							<el-radio v-model="radio" :label="2">多规格</el-radio>
 						</template>
-
+						<template v-slot:attribute>
+							<div>物料属性</div>
+						</template>
 						<template v-slot:status>
 							<el-radio v-model="radioStatus" :label="1">启用</el-radio>
 							<el-radio v-model="radioStatus" :label="2">备用</el-radio>
@@ -59,6 +62,7 @@
 		ismakeup : any = 1
 		issued : any = 1
 		textarea : any = ''
+		categoryId : any = ''
 		props = {
 			label: 'name',
 			children: 'children'
@@ -181,7 +185,6 @@
 						}
 					},
 				],
-
 				[
 					{
 						span: 6,
@@ -249,70 +252,81 @@
 						span: 6,
 						label: '物料分类',
 						prop: 'select',
-						component: 'by-select',
+						component: 'select-tree',
 						compConfig: {
 							attr: {
-								placeholder: '请选择数据',
+								label: 'name',
 								clearable: true,
+								retConfig: {
+									// treeName:'name',
+									categoryId: 'id'
+								}
 							},
-							request: '/maindata/maindataMaterialCategory/treeList'
-						},
+							request: {
+								url: '/maindata/maindataMaterialCategory/treeList'
+							}
+						}
 					},
 					{
 						span: 6,
 						label: '虚拟分类',
 						prop: 'select',
-						component: 'by-select',
+						component: 'select-tree',
 						compConfig: {
 							attr: {
-								placeholder: '请选择数据',
+								label: 'name',
 								clearable: true,
+								retConfig: {
+									// treeName:'name',
+									vmCategoryId: 'id'
+								}
 							},
-							request: '/maindata/maindataMaterialCategory/treeList'
-						},
+							request: {
+								url: '/maindata/maindataMaterialVmcategory/treeList'
+							}
+						}
 					},
-					{
-						span: 6,
-						label: '厂家物料',
-						prop: 'factoryId',
-						component: 'by-select',
-						compConfig: {
-							attr: {
-								placeholder: '请选择数据',
-								clearable: true,
-							},
-							request: '/maindata/maindataMaterialCategory/treeList'
-						},
-					}
-				],
-				[
 					{
 						span: 6,
 						label: '机构商品分类',
 						prop: 'select',
-						component: 'by-select',
+						component: 'select-tree',
 						compConfig: {
 							attr: {
-								placeholder: '请选择数据',
+								label: 'name',
 								clearable: true,
+								retConfig: {
+									treeName: 'name',
+									organizationCategoryId: 'id'
+								}
 							},
-							request: '/maindata/maindataMaterialCategory/treeList'
-						},
-					},
-					{
-						span: 6,
-						label: '物料属性表',
-						prop: 'select',
-						component: 'by-select',
-						compConfig: {
-							attr: {
-								placeholder: '请选择数据',
-								clearable: true,
-							},
-							request: '/maindata/maindataMaterialCategory/treeList'
-						},
+							request: {
+								url: '/maindata/maindataMaterialOrganizationCategory/treeList'
+							}
+						}
 					}
 				],
+				[
+					// {
+					// 	span: 6,
+					// 	label: '物料属性表',
+					// 	prop: 'select',
+					// 	component: 'select-tree',
+					// 	compConfig:{
+					// 	  attr:{
+					// 	    label:'name',
+					// 	    clearable:true,
+					// 	    retConfig:{
+					// 	      treeName:'name',
+					// 	      treeId:'id'
+					// 	    }
+					// 	  },
+					// 	  request:{
+					// 	    url:'/maindata/maindataMaterialAttribute/page'
+					// 	  }
+					// 	}
+					// }
+				],
 				[
 					{
 						span: 30,
@@ -544,7 +558,7 @@
 				}]
 			},
 		}
-		created() {
+		mounted() {
 			this.getTreeList()
 			this.timer = setInterval(() => {
 				this.getDataList()
@@ -570,9 +584,15 @@
 			}
 			clearInterval(this.timer)
 			let query = (this.$refs.moduleView as any).getQuery();
-			// console.log(query);
-			api.pageList(query, 'maindataMaterial').then((res : any) => {
-				// console.log(res.data);
+			query.categoryId = this.categoryId;
+			let newData:any = {}
+			for (let key in query) {
+				if (query[key] && query[key].toString().replaceAll(/(^\s*)|(\s*$)/g, '') !== '') {
+					newData[key]=query[key]
+				}
+			}
+			console.log('表单字段 ==> ', newData);
+			api.pageList(newData, 'maindataMaterial').then((res : any) => {
 				if (res.code === 200) {
 					(this.$refs.moduleView as any).setTableValue(res.data.records);
 					let page = {
@@ -601,6 +621,7 @@
 					data.status = this.radioStatus;
 					data.ismakeup = this.ismakeup;
 					data.issued = this.issued;
+					console.log(data);
 					api.saveList(data, 'maindataMaterial').then((res : any) => {
 						if (res.code === 200) {
 							this.isShow = 'home';
@@ -694,6 +715,7 @@
 		}
 		// 导航切换
 		handleNodeClick(e : any) {
+			this.categoryId = e.id
 			other.single({ categoryId: e.id }).then((res : any) => {
 				if (res.code === 200) {
 					(this.$refs.moduleView as any).setTableValue(res.data.records);

+ 46 - 33
src/views/audit/virtually/index.vue

@@ -34,6 +34,7 @@
 	export default class Virtually extends Vue {
 		// 左边
 		data : any = []
+		parentId:any=''
 		props = {
 			label: 'name',
 			children: 'children'
@@ -88,10 +89,10 @@
 								placeholder: '请选择数据',
 								clearable: true,
 								data: [{
-									value: 1,
+									value: 0,
 									label: '正常'
 								}, {
-									value: 0,
+									value: 1,
 									label: '禁用'
 								}]
 							}
@@ -103,7 +104,7 @@
 			tool: {
 				tools: {
 					add: true,
-					delete: true,
+					// delete: true,
 					search: true,
 					refresh: true
 				}
@@ -113,7 +114,7 @@
 					size: 'mini',
 					seq: true,
 					align: 'center',
-					checkbox: true,
+					checkbox: false,
 					height: 600
 				},
 				columns: [{
@@ -167,22 +168,22 @@
 			columns: [
 				[
 					{
-						span:23,
-						label:'父级',
+						span: 23,
+						label: '父级',
 						labelWidth: '70px',
-						prop:'parentId',
-						component:'select-tree',
-						compConfig:{
-						  attr:{
-						    label:'name',
-						    clearable:true,
-						    retConfig:{
-						      parentId:'id',
-						    }
-						  },
-						  request:{
-						    url:'/maindata/maindataMaterialVmcategory/treeList'
-						  }
+						prop: 'parentName',
+						component: 'select-tree',
+						compConfig: {
+							attr: {
+								label: 'name',
+								clearable: true,
+								retConfig: {
+									parentId: 'id',
+								}
+							},
+							request: {
+								url: '/maindata/maindataMaterialVmcategory/treeList'
+							}
 						}
 					},
 					{
@@ -218,7 +219,7 @@
 				],
 			]
 		}
-		created() {
+		mounted() {
 			this.getTreeList()
 			this.timer = setInterval(() => {
 				this.getDataList()
@@ -276,6 +277,7 @@
 			}
 			clearInterval(this.timer)
 			let query = (this.$refs.moduleView as any).getQuery();
+			query.parentId = this.parentId;
 			console.log('表单字段 ==> ', query);
 			api.pageList(query, 'maindataMaterialVmcategory').then((res : any) => {
 				if (res.code === 200) {
@@ -310,9 +312,14 @@
 			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},'maindataMaterialVmcategory').then((res:any) =>{
+				if(res.code===200){
+					e.parentName = res.data.name
+					setTimeout(() => {
+						if ((this as any).$refs.addFormId) (this as any).$refs.addFormId.setValue(e);
+					}, 0)
+				}
+			})
 		}
 		// 工具栏删除
 		onDelete() {
@@ -355,15 +362,20 @@
 				type: 'warning',
 				center: true
 			}).then(() => {
-				api.deleteList({ ids: item.id }, 'maindataMaterialVmcategory').then((res : any) => {
-					if (res.code === 200) {
-						this.getTreeList();
-						this.getDataList();
-						this.$message({
-							type: 'success',
-							message: '删除成功!'
-						});
-					} else this.failHandle(res)
+				api.childrenTreeList({ id: item.id }, 'maindataMaterialVmcategory').then((v : any) => {
+					if (v.code === 200) {
+						if (v.data.length > 0) return this.$message({ type: 'error', message: '此数据有子节点,不能进行删除!' })
+						api.deleteList({ ids: item.id }, 'maindataMaterialVmcategory').then((res : any) => {
+							if (res.code === 200) {
+								this.getTreeList();
+								this.getDataList();
+								this.$message({
+									type: 'success',
+									message: '删除成功!'
+								});
+							} else this.failHandle(res)
+						})
+					} else this.$message({ type: 'error', message: '删除失败!请稍后再试' })
 				})
 			}).catch(() => {
 				this.$message({
@@ -374,7 +386,8 @@
 		}
 		// 导航切换
 		handleNodeClick(e : any) {
-			api.childrenTreeList({ id: e.id },'maindataMaterialVmcategory').then((res : any) => {
+			this.parentId=e.id
+			api.childrenTreeList({ id: e.id }, 'maindataMaterialVmcategory').then((res : any) => {
 				if (res.code === 200) {
 					(this.$refs.moduleView as any).setTableValue(res.data);
 					let page = {

+ 0 - 8
src/views/audit/warehousing/index.vue

@@ -1,8 +0,0 @@
-<template>
-</template>
-
-<script>
-</script>
-
-<style>
-</style>

+ 6 - 1
src/views/demo/index.vue

@@ -40,7 +40,12 @@ export default class DemoIndex extends Vue {
     click:()=>{
       (this as any).$router.push('/demo/dialog')
     }
-  }]
+  },{
+    name:'标签',
+    click:()=>{
+      (this as any).$router.push('/demo/tab')
+    }
+  },]
   arr =[
     {
       title:'尺寸',

+ 18 - 0
src/views/demo/tab.vue

@@ -0,0 +1,18 @@
+<template>
+	<div>
+		<ForTab />
+	</div>
+</template>
+
+<script lang="ts">
+	import { Component, Vue } from "vue-property-decorator";
+	// import ForTab from "@/components/ForTab/index.vue";
+	@Component
+	export default class Test extends Vue {
+		
+	}
+</script>
+
+<style lang="scss" scoped>
+
+</style>

+ 0 - 41
src/views/test.vue

@@ -1,41 +0,0 @@
-<template>
-	<div></div>
-</template>
-
-<script lang="ts">
-	import { Component, Vue } from "vue-property-decorator";
-	@Component
-	export default class Test extends Vue {
-		data : Array<any> = []
-		arr = [
-			[{
-				title: '尺寸',
-				field: 'a1',
-				data: [1, 2, 3]
-			}],
-			[{
-				title: '颜色',
-				field: 'a2',
-				data: [1, 2, 3]
-			}]
-		]
-
-
-		created() {
-			this.forFun(this.arr[0], 0)
-		}
-		forFun(data:any, i:any) {
-			i++;
-			for (const item of data) {
-				// if ()
-					if (this.arr[i]) {
-						this.forFun(this.arr[i], i)
-					}
-			}
-		}
-	}
-</script>
-
-<style lang="scss" scoped>
-
-</style>