瀏覽代碼

1.供应商、分销商添加财务编号字段
2.修复所有分类上级选择下拉问题
3.商品管理关联物料确定前添加提示

hcf 1 年之前
父節點
當前提交
556afdbf26

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

@@ -22,6 +22,10 @@
 				</template>
 				<template v-slot:select-tree class="clearfix">
 					
+				</template>
+				<template v-slot:parentName class="clearfix">
+					<i class="el-icon-loading" v-if="selectTreeLoading"></i>
+					<select-tree v-else ref="selectTree" :propConfig="selectTreeConfig" @onChange="selectTree"></select-tree>
 				</template>
 				<template v-slot:status class="clearfix">
 					<el-radio class="fl" style="margin-top: 8px;" v-model="radio" :label="0">正常</el-radio>
@@ -29,7 +33,7 @@
 				</template>
 			</by-form>
 			<div slot="footer" class="dialog-footer">
-				<el-button @click="dialogFormVisible = false">取 消</el-button>
+				<el-button @click="dialogFormVisible = false; selectTreeChange = {}">取 消</el-button>
 				<el-button type="primary" @click="confirm">确 定</el-button>
 			</div>
 		</el-dialog>
@@ -39,6 +43,7 @@
 	import { Component, Prop, Vue, Watch } from "vue-property-decorator";
 	import api from "@/api/currency";
 	import Assembly from "@/components/Assembly/material.vue";
+	import selectTree from "@/benyun/components/selectTree/selectTree.vue";
 	@Component
 	export default class AgencyGoods extends Vue {
 		parentId : any = 0
@@ -48,6 +53,8 @@
 		popTitle : any = ''
 		radio : any = 0
 		dialogFormVisible : boolean = false
+		selectTreeChange: any = {}
+		selectTreeLoading : boolean = false
 		treeConfig = {
 			attr: {
 				retConfig: {
@@ -176,6 +183,17 @@
 				}]
 			},
 		}
+		selectTreeConfig = {
+			attr: {
+				label: 'name',
+				clearable: true,
+				retConfig: {
+					parentId: 'id',
+					parentName: 'name',
+				},
+				defaultExpandAll: true
+			},
+		}
 		addConfig = {
 			attr: {
 				size: 'small',
@@ -195,22 +213,22 @@
 						label: '上级',
 						labelWidth: '70px',
 						prop: 'parentName',
-						component: 'select-tree',
+						// component: 'select-tree',
 						slot: true,
-						compConfig: {
-							attr: {
-								label: 'name',
-								clearable: true,
-								retConfig: {
-									parentId: 'id',
-									parentName: 'name',
-								},
-								defaultExpandAll: true
-							},
-							request: {
-								url: '/maindata/maindataMaterialOrganizationCategory/treeUseList'
-							}
-						}
+						// compConfig: {
+						// 	attr: {
+						// 		label: 'name',
+						// 		clearable: true,
+						// 		retConfig: {
+						// 			parentId: 'id',
+						// 			parentName: 'name',
+						// 		},
+						// 		defaultExpandAll: true
+						// 	},
+						// 	request: {
+						// 		url: '/maindata/maindataMaterialOrganizationCategory/treeUseList'
+						// 	}
+						// }
 					},
 					{
 						labelWidth: '70px',
@@ -283,6 +301,15 @@
 		confirm() {
 			(this as any).$refs.addFormId.validate().then(() => {
 				let query = (this as any).$refs.addFormId.getValue();
+				if(this.selectTreeChange&&this.selectTreeChange.parentId||this.selectTreeChange.parentId==0){
+					if(this.selectTreeChange.parentId==0){
+						query.parentId = this.selectTreeChange.parentId;
+						query.parentName = null;
+					}else{
+						query.parentId = this.selectTreeChange.parentId;
+						query.parentName = this.selectTreeChange.parentName;
+					}
+				}
 				query.status = this.radio;
 				if (this.popTitle === '新增') {
 					if(!query.parentId){
@@ -294,6 +321,7 @@
 							// (this as any).$refs.sideTree.request();
 							this.dialogFormVisible = false;
 							this.getDataList();
+							this.selectTreeChange = {};
 						} else this.$message.error(res.msg);
 					}).catch(() => {});
 				} else if (this.popTitle === '编辑') {
@@ -310,6 +338,7 @@
 							// (this as any).$refs.sideTree.request();
 							this.dialogFormVisible = false;
 							this.getDataList();
+							this.selectTreeChange = {};
 						} else this.$message.error(res.msg);
 					}).catch(() => {});
 				}
@@ -357,6 +386,31 @@
 				}
 			}).catch(() => loading.close());
 		}
+		getSelectTreeList(){
+			this.selectTreeLoading = true;
+			api.treeList('maindataMaterialOrganizationCategory').then((treeRes : any) => {
+				if (treeRes.code === 200) {
+					this.selectTreeLoading = false;
+					setTimeout(()=>{
+						var data:any = [{
+							id: 0,
+							name: '机构商品分类',
+							children: treeRes.data
+						}];
+						(this as any).$refs.selectTree.setData(data);
+						let query = (this as any).$refs.addFormId.getValue();
+						if(query.parentId==0){
+							(this as any).$refs.selectTree.setValue("机构商品分类");
+						}else{
+							(this as any).$refs.selectTree.setValue(query.parentName);
+						}
+					},0)
+				}
+			}).catch(() => {});
+		}
+		selectTree(e:any){
+			this.selectTreeChange = e
+		}
 		// 工具栏方法
 		clickHandle(e : any) {
 			if (e === 'onAdd') this.onAdd();
@@ -366,6 +420,7 @@
 			this.popTitle = '新增'
 			this.dialogFormVisible = true;
 			this.radio = 0
+			this.getSelectTreeList();
 			setTimeout(() => {
 				if(this.parentId!=0){
 					var data = {
@@ -382,7 +437,7 @@
 					}).catch(() => {});
 				}else{
 					(this as any).$refs.addFormId.setValue();
-					(this as any).$refs.addFormId.$refs['parentName--comp'][0].request();
+					// (this as any).$refs.addFormId.$refs['parentName--comp'][0].request();
 				}
 			}, 0)
 		}
@@ -401,13 +456,19 @@
 							if (v.code === 200) {
 								data.parentName = v.data.name;
 								this.dialogFormVisible = true;
-								setTimeout(() => { (this as any).$refs.addFormId.setValue(data) }, 0);
+								setTimeout(() => { 
+									(this as any).$refs.addFormId.setValue(data)
+									this.getSelectTreeList();
+								}, 0);
 							}
 						}).catch(() => loading.close());
 					}else{
 						loading.close();
 						this.dialogFormVisible = true;
-						setTimeout(() => { (this as any).$refs.addFormId.setValue(data) }, 0);
+						setTimeout(() => { 
+							(this as any).$refs.addFormId.setValue(data) 
+							this.getSelectTreeList();
+						}, 0);
 					}
 					
 				}

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

@@ -302,6 +302,12 @@
 							}
 						}
 					},
+					{
+						span: 6,
+						label: '财务编号',
+						prop: 'financeNumber',
+						component: 'by-input',
+					}
 				],
 				// [
 				// 	{

+ 81 - 19
src/views/audit/organClassify/index.vue

@@ -14,13 +14,17 @@
 		<!-- 新增/编辑弹窗 -->
 		<el-dialog :title="popTitle+'机构分类'" :visible.sync="dialogFormVisible" width="30%" :destroy-on-close="true">
 			<by-form :propConfig="addConfig" ref="addFormId">
+				<template v-slot:parentName class="clearfix">
+					<i class="el-icon-loading" v-if="selectTreeLoading"></i>
+					<select-tree v-else ref="selectTree" :propConfig="selectTreeConfig" @onChange="selectTree"></select-tree>
+				</template>
 				<template v-slot:status class="clearfix">
 					<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">
-				<el-button @click="dialogFormVisible = false">取 消</el-button>
+				<el-button @click="dialogFormVisible = false; selectTreeChange = {}">取 消</el-button>
 				<el-button type="primary" @click="confirm">确 定</el-button>
 			</div>
 		</el-dialog>
@@ -30,6 +34,7 @@
 	import { Component, Prop, Vue, Watch } from "vue-property-decorator";
 	import api from "@/api/currency";
 	import Assembly from "@/components/Assembly/material.vue";
+	import selectTree from "@/benyun/components/selectTree/selectTree.vue";
 	@Component
 	export default class OrganClassify extends Vue {
 		timeNum = 0;
@@ -39,6 +44,8 @@
 		dialogFormVisible : boolean = false
 		parentId : any = 0
 		parentIds : any = '';
+		selectTreeChange: any = {}
+		selectTreeLoading : boolean = false
 		treeConfig = {
 			attr: {
 				retConfig: {
@@ -148,6 +155,17 @@
 				}]
 			},
 		}
+		selectTreeConfig = {
+			attr: {
+				label: 'name',
+				clearable: true,
+				retConfig: {
+					parentId: 'id',
+					parentName: 'name',
+				},
+				defaultExpandAll: true
+			},
+		}
 		addConfig = {
 			attr: {
 				size: 'small',
@@ -167,21 +185,22 @@
 						label: '父级',
 						labelWidth: '70px',
 						prop: 'parentName',
-						component: 'select-tree',
-						compConfig: {
-							attr: {
-								label: 'name',
-								clearable: true,
-								retConfig: {
-									parentId: 'id',
-									parentName: 'name',
-								},
-								defaultExpandAll: true
-							},
-							request: {
-								url: '/maindata/maindataOrganizationCategory/treeUseList'
-							}
-						}
+						slot: true,
+						// component: 'select-tree',
+						// compConfig: {
+						// 	attr: {
+						// 		label: 'name',
+						// 		clearable: true,
+						// 		retConfig: {
+						// 			parentId: 'id',
+						// 			parentName: 'name',
+						// 		},
+						// 		defaultExpandAll: true
+						// 	},
+						// 	request: {
+						// 		url: '/maindata/maindataOrganizationCategory/treeUseList'
+						// 	}
+						// }
 					},
 					{
 						span: 23,
@@ -258,6 +277,15 @@
 			(this as any).$refs.addFormId.validate().then(() => {
 				let query = (this as any).$refs.addFormId.getValue();
 				// console.log(query);
+				if(this.selectTreeChange&&this.selectTreeChange.parentId||this.selectTreeChange.parentId==0){
+					if(this.selectTreeChange.parentId==0){
+						query.parentId = this.selectTreeChange.parentId;
+						query.parentName = null;
+					}else{
+						query.parentId = this.selectTreeChange.parentId;
+						query.parentName = this.selectTreeChange.parentName;
+					}
+				}
 				query.status = this.radio;
 				this.dialogFormVisible = false;
 				if (this.popTitle === '新增') {
@@ -270,6 +298,7 @@
 							// (this as any).$refs.sideTree.request();
 							this.getTreeList();
 							this.getDataList();
+							this.selectTreeChange = {};
 						} else this.$message.error(res.msg);
 					}).catch(() => {});
 				} else if (this.popTitle === '编辑') {
@@ -287,6 +316,7 @@
 							// (this as any).$refs.sideTree.request();
 							this.getTreeList();
 							this.getDataList();
+							this.selectTreeChange = {};
 						} else this.$message.error(res.msg);
 					}).catch(() => {});
 				}
@@ -321,6 +351,31 @@
 				} else this.$message.error(res.msg);
 			}).catch(() => loading.close());
 		}
+		getSelectTreeList(){
+			this.selectTreeLoading = true;
+			api.treeList('maindataOrganizationCategory').then((treeRes : any) => {
+				if (treeRes.code === 200) {
+					this.selectTreeLoading = false;
+					setTimeout(()=>{
+						var data:any = [{
+							id: 0,
+							name: '机构分类',
+							children: treeRes.data
+						}];
+						(this as any).$refs.selectTree.setData(data);
+						let query = (this as any).$refs.addFormId.getValue();
+						if(query.parentId==0){
+							(this as any).$refs.selectTree.setValue("机构分类");
+						}else{
+							(this as any).$refs.selectTree.setValue(query.parentName);
+						}
+					},0)
+				}
+			}).catch(() => {});
+		}
+		selectTree(e:any){
+			this.selectTreeChange = e
+		}
 		// 工具栏方法
 		clickHandle(e : any) {
 			if (e === 'onAdd') this.onAdd();
@@ -331,6 +386,7 @@
 			this.dialogFormVisible = true;
 			this.radio = 0
 			this.getTreeList();
+			this.getSelectTreeList();
 			setTimeout(() => {
 				if(this.parentId!=0){
 					var data = {
@@ -347,7 +403,7 @@
 					}).catch(() => {});
 				}else{
 					(this as any).$refs.addFormId.setValue();
-					(this as any).$refs.addFormId.$refs['parentName--comp'][0].request();
+					// (this as any).$refs.addFormId.$refs['parentName--comp'][0].request();
 				}
 			}, 0)
 		}
@@ -366,13 +422,19 @@
 							if (res.code === 200) {
 								data.parentName = res.data.name;
 								this.dialogFormVisible = true;
-								this.$nextTick(() => (this as any).$refs.addFormId.setValue(data));
+								this.$nextTick(() => {
+									(this as any).$refs.addFormId.setValue(data);
+									this.getSelectTreeList();
+								});
 							}
 						}).catch(() => loading.close());
 					}else{
 						loading.close();
 						this.dialogFormVisible = true;
-						setTimeout(() => { (this as any).$refs.addFormId.setValue(data) }, 0);
+						setTimeout(() => { 
+							(this as any).$refs.addFormId.setValue(data) 
+							this.getSelectTreeList();
+						}, 0);
 					}
 				}
 			}).catch(() => loading.close());

+ 87 - 23
src/views/audit/productClassification/index.vue

@@ -14,13 +14,17 @@
 		<!-- 新增/编辑弹窗 -->
 		<el-dialog :title="popTitle+'商品分类'" :visible.sync="dialogFormVisible" width="30%" :destroy-on-close="true">
 			<by-form :propConfig="addConfig" ref="addFormId">
+				<template v-slot:parentName class="clearfix">
+					<i class="el-icon-loading" v-if="selectTreeLoading"></i>
+					<select-tree v-else ref="selectTree" :propConfig="selectTreeConfig" @onChange="selectTree"></select-tree>
+				</template>
 				<template v-slot:status class="clearfix">
 					<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">
-				<el-button @click="dialogFormVisible = false">取 消</el-button>
+				<el-button @click="dialogFormVisible = false; selectTreeChange = {}">取 消</el-button>
 				<el-button type="primary" @click="confirm">确 定</el-button>
 			</div>
 		</el-dialog>
@@ -30,6 +34,7 @@
 	import { Component, Prop, Vue, Watch } from "vue-property-decorator";
 	import api from "@/api/currency";
 	import Assembly from "@/components/Assembly/material.vue";
+	import selectTree from "@/benyun/components/selectTree/selectTree.vue";
 	@Component
 	export default class ProductClassification extends Vue {
 		// 左边
@@ -41,6 +46,8 @@
 		popTitle : any = ''
 		radio : any = 0
 		dialogFormVisible : boolean = false
+		selectTreeChange: any = {}
+		selectTreeLoading : boolean = false
 		treeConfig = {
 			attr: {
 				retConfig: {
@@ -169,6 +176,17 @@
 				}]
 			},
 		}
+		selectTreeConfig = {
+			attr: {
+				label: 'name',
+				clearable: true,
+				retConfig: {
+					parentId: 'id',
+					parentName: 'name',
+				},
+				defaultExpandAll: true
+			},
+		}
 		addConfig = {
 			attr: {
 				size: 'small',
@@ -187,23 +205,24 @@
 						span: 23,
 						label: '上级',
 						labelWidth: '70px',
+						slot: true,
 						prop: 'parentName',
-						component: 'select-tree',
-						compConfig: {
-							attr: {
-								label: 'name',
-								clearable: true,
-								retConfig: {
-									parentId: 'id',
-									parentName: 'name',
-								},
-								defaultExpandAll: true
-							},
-							request: {
-								url: '/maindata/maindataMaterialCategory/treeUseList',
-								method: 'GET'
-							}
-						}
+						// component: 'select-tree',
+						// compConfig: {
+						// 	attr: {
+						// 		label: 'name',
+						// 		clearable: true,
+						// 		retConfig: {
+						// 			parentId: 'id',
+						// 			parentName: 'name',
+						// 		},
+						// 		defaultExpandAll: true
+						// 	},
+						// 	request: {
+						// 		url: '/maindata/maindataMaterialCategory/treeUseList',
+						// 		method: 'GET'
+						// 	}
+						// }
 					},
 					{
 						span: 23,
@@ -278,7 +297,16 @@
 		confirm() {
 			(this as any).$refs.addFormId.validate().then(() => {
 				let query = (this as any).$refs.addFormId.getValue();
-				// console.log('确认新增/编辑 ==> ', query);
+				// console.log('确认新增/编辑 ==> ', query, this.selectTreeChange);
+				if(this.selectTreeChange&&this.selectTreeChange.parentId||this.selectTreeChange.parentId==0){
+					if(this.selectTreeChange.parentId==0){
+						query.parentId = this.selectTreeChange.parentId;
+						query.parentName = null;
+					}else{
+						query.parentId = this.selectTreeChange.parentId;
+						query.parentName = this.selectTreeChange.parentName;
+					}
+				}
 				query.status = this.radio;
 				this.dialogFormVisible = false;
 				if (this.popTitle === '新增') {
@@ -290,6 +318,7 @@
 							this.$message.success(this.popTitle + '成功!');
 							// (this as any).$refs.sideTree.request();
 							this.getDataList();
+							this.selectTreeChange = {};
 						} else this.$message.error(res.msg);
 					}).catch(() => {});
 				} else if (this.popTitle === '编辑') {
@@ -305,6 +334,7 @@
 							this.$message.success(this.popTitle + '成功!');
 							// (this as any).$refs.sideTree.request();
 							this.getDataList();
+							this.selectTreeChange = {};
 						} else this.$message.error(res.msg);
 					}).catch(() => {});
 				}
@@ -350,6 +380,31 @@
 				}
 			}).catch(() => loading.close());
 		}
+		getSelectTreeList(){
+			this.selectTreeLoading = true;
+			api.treeList('maindataMaterialCategory').then((treeRes : any) => {
+				if (treeRes.code === 200) {
+					this.selectTreeLoading = false;
+					setTimeout(()=>{
+						var data:any = [{
+							id: 0,
+							name: '物料分类',
+							children: treeRes.data
+						}];
+						(this as any).$refs.selectTree.setData(data);
+						let query = (this as any).$refs.addFormId.getValue();
+						if(query.parentId==0){
+							(this as any).$refs.selectTree.setValue("物料分类");
+						}else{
+							(this as any).$refs.selectTree.setValue(query.parentName);
+						}
+					},0)
+				}
+			}).catch(() => {});
+		}
+		selectTree(e:any){
+			this.selectTreeChange = e
+		}
 		// 工具栏方法
 		clickHandle(e : any) {
 			if (e === 'onAdd') this.onAdd();
@@ -358,7 +413,8 @@
 		onAdd() {
 			this.popTitle = '新增'
 			this.dialogFormVisible = true;
-			this.radio = 0
+			this.radio = 0;
+			this.getSelectTreeList();
 			setTimeout(() => {
 				if(this.parentId!=0){
 					var data = {
@@ -370,12 +426,14 @@
 							data.parentName = res.data.name;
 							data.parentId = res.data.id;
 							this.dialogFormVisible = true;
-							setTimeout(() => { (this as any).$refs.addFormId.setValue(data) }, 0);
+							setTimeout(() => { 
+								(this as any).$refs.addFormId.setValue(data)
+							}, 0);
 						}
 					}).catch(() => {});
 				}else{
 					(this as any).$refs.addFormId.setValue();
-					(this as any).$refs.addFormId.$refs['parentName--comp'][0].request();
+					// (this as any).$refs.addFormId.$refs['parentName--comp'][0].request();
 				}
 			}, 0)
 		}
@@ -394,13 +452,19 @@
 							if (res.code === 200) {
 								data.parentName = res.data.name;
 								this.dialogFormVisible = true;
-								setTimeout(() => { (this as any).$refs.addFormId.setValue(data) }, 0);
+								setTimeout(() => { 
+									this.getSelectTreeList();
+									(this as any).$refs.addFormId.setValue(data) 
+								}, 0);
 							}
 						}).catch(() => loading.close());
 					}else{
 						loading.close();
 						this.dialogFormVisible = true;
-						setTimeout(() => { (this as any).$refs.addFormId.setValue(data) }, 0);
+						setTimeout(() => { 
+							this.getSelectTreeList();
+							(this as any).$refs.addFormId.setValue(data) 
+						}, 0);
 					}
 				}
 			}).catch(() => loading.close());

+ 72 - 66
src/views/audit/productManagement/index.vue

@@ -1767,75 +1767,81 @@
 		// 确定关联金蝶财务系统物料
 		doConfirm() {
 			if(JSON.stringify(this.tableRadio) === "{}" || this.tableRadio === null || this.tableRadio === {}) { return this.$message.warning('请选择物料'); }
-			// 表单赋值赋值
-			var val2 = (this as any).$refs.form.getValue();
-			val2.name = this.tableRadio.fname;
-			val2.shortName = this.tableRadio.fname;
-			// 物料属性赋值
-			// console.log(this.materialSpec)
-			if(this.materialSpec==0){
-				var val = (this.$refs.singeTable as any).getValue();
-				if(JSON.stringify(val[0]) === "{}" || val[0] === null){
-					val = [{
-						skuTitle: this.tableRadio.fname,
-						skuSubtitle: this.tableRadio.fname,
-						// skuCode: '',
-						financialCode: this.tableRadio.fnumber,
-						// price: '0',
-						unit: this.tableRadio.fbaseUnitName,
-						unitCode: this.tableRadio.fbaseUnitCode,
-						// shelfLife: '0',
-						// weight: '0',
-						// length: '0',
-						// width: '0',
-						// height: '0',
-						// volume: '0',
-					}];
-					this.$message.success('关联物料 '+this.tableRadio.fname+' 成功');
-				}else{
-					this.$message.success('关联物料 '+this.tableRadio.fname+' 成功');
-					val[0].skuTitle = this.tableRadio.fname;
-					val[0].skuSubtitle = this.tableRadio.fname;
-					val[0].financialCode = this.tableRadio.fnumber;
-					val[0].unit = this.tableRadio.fbaseUnitName;
-					val[0].unitCode = this.tableRadio.fbaseUnitCode;
+			this.$confirm('原商品名称会被覆盖,是否继续', '提示', {
+				confirmButtonText: '确定',
+				cancelButtonText: '取消',
+				type: 'warning'
+			}).then(() => {
+				// 表单赋值赋值
+				var val2 = (this as any).$refs.form.getValue();
+				val2.name = this.tableRadio.fname;
+				val2.shortName = this.tableRadio.fname;
+				// 物料属性赋值
+				// console.log(this.materialSpec)
+				if(this.materialSpec==0){
+					var val = (this.$refs.singeTable as any).getValue();
+					if(JSON.stringify(val[0]) === "{}" || val[0] === null){
+						val = [{
+							skuTitle: this.tableRadio.fname,
+							skuSubtitle: this.tableRadio.fname,
+							// skuCode: '',
+							financialCode: this.tableRadio.fnumber,
+							// price: '0',
+							unit: this.tableRadio.fbaseUnitName,
+							unitCode: this.tableRadio.fbaseUnitCode,
+							// shelfLife: '0',
+							// weight: '0',
+							// length: '0',
+							// width: '0',
+							// height: '0',
+							// volume: '0',
+						}];
+						this.$message.success('关联物料 '+this.tableRadio.fname+' 成功');
+					}else{
+						this.$message.success('关联物料 '+this.tableRadio.fname+' 成功');
+						val[0].skuTitle = this.tableRadio.fname;
+						val[0].skuSubtitle = this.tableRadio.fname;
+						val[0].financialCode = this.tableRadio.fnumber;
+						val[0].unit = this.tableRadio.fbaseUnitName;
+						val[0].unitCode = this.tableRadio.fbaseUnitCode;
+					}
+					(this as any).$refs.singeTable.setValue(val);
 				}
-				(this as any).$refs.singeTable.setValue(val);
-			}
-			if(this.materialSpec==1){
-				var val = (this.$refs.table as any).getValue();
-				// console.log(val)
-				if(!val || JSON.stringify(val[0]) === "{}" || val[0] === null || val.length==0){
-					val = [{
-						skuTitle: this.tableRadio.fname,
-						skuSubtitle: this.tableRadio.fname,
-						// skuCode: '',
-						financialCode: this.tableRadio.fnumber,
-						// price: '0',
-						unit: this.tableRadio.fbaseUnitName,
-						unitCode: this.tableRadio.fbaseUnitCode,
-						// shelfLife: '0',
-						// weight: '0',
-						// length: '0',
-						// width: '0',
-						// height: '0',
-						// volume: '0',
-					}];
-					this.$message.success('关联物料 '+this.tableRadio.fname+' 成功');
-				}else{
-					for (var i = 0; i < val.length; i++) {
-						val[i].skuTitle = this.tableRadio.fname;
-						val[i].skuSubtitle = this.tableRadio.fname;
-						val[i].financialCode = this.tableRadio.fnumber;
-						val[i].unit = this.tableRadio.fbaseUnitName;
-						val[i].unitCode = this.tableRadio.fbaseUnitCode;
+				if(this.materialSpec==1){
+					var val = (this.$refs.table as any).getValue();
+					// console.log(val)
+					if(!val || JSON.stringify(val[0]) === "{}" || val[0] === null || val.length==0){
+						val = [{
+							skuTitle: this.tableRadio.fname,
+							skuSubtitle: this.tableRadio.fname,
+							// skuCode: '',
+							financialCode: this.tableRadio.fnumber,
+							// price: '0',
+							unit: this.tableRadio.fbaseUnitName,
+							unitCode: this.tableRadio.fbaseUnitCode,
+							// shelfLife: '0',
+							// weight: '0',
+							// length: '0',
+							// width: '0',
+							// height: '0',
+							// volume: '0',
+						}];
+						this.$message.success('关联物料 '+this.tableRadio.fname+' 成功');
+					}else{
+						for (var i = 0; i < val.length; i++) {
+							val[i].skuTitle = this.tableRadio.fname;
+							val[i].skuSubtitle = this.tableRadio.fname;
+							val[i].financialCode = this.tableRadio.fnumber;
+							val[i].unit = this.tableRadio.fbaseUnitName;
+							val[i].unitCode = this.tableRadio.fbaseUnitCode;
+						}
+						this.$message.success('关联物料 '+this.tableRadio.fname+' 成功');
 					}
-					this.$message.success('关联物料 '+this.tableRadio.fname+' 成功');
+					(this as any).$refs.table.setValue(val);
 				}
-				(this as any).$refs.table.setValue(val);
-			}
-			(this as any).$refs.form.setValue(val2);
-			this.vxeValue = false;
+				(this as any).$refs.form.setValue(val2);
+				this.vxeValue = false;
+			}).catch(() => {});
 		}
 		// 切换组合商品
 		openMakeup() {

+ 32 - 26
src/views/audit/supplier/index.vue

@@ -276,32 +276,38 @@
 						component: 'by-input',
 					},
 				],
-				// [
-				// 	{
-				// 		span: 6,
-				// 		labelWidth: '110px',
-				// 		label: '财务系统类型',
-				// 		prop: 'financeType',
-				// 		component: 'by-select',
-				// 		compConfig: {
-				// 			attr: {
-				// 				placeholder: '请选择财务系统类型',
-				// 				clearable: true,
-				// 				size: 'small',
-				// 				data: [
-				// 					{
-				// 						value: 'kingdee',
-				// 						label: '金蝶K3'
-				// 					},
-				// 					// {
-				// 					// 	value: 'yonbip',
-				// 					// 	label: '用友U8'
-				// 					// },
-				// 				]
-				// 			}
-				// 		}
-				// 	},
-				// ],
+				[
+					{
+						span: 6,
+						labelWidth: '110px',
+						label: '财务系统类型',
+						prop: 'financeType',
+						component: 'by-select',
+						compConfig: {
+							attr: {
+								placeholder: '请选择财务系统类型',
+								clearable: true,
+								size: 'small',
+								data: [
+									{
+										value: 'kingdee',
+										label: '金蝶K3'
+									},
+									// {
+									// 	value: 'yonbip',
+									// 	label: '用友U8'
+									// },
+								]
+							}
+						}
+					},
+					{
+						span: 6,
+						label: '财务编号',
+						prop: 'financeNumber',
+						component: 'by-input',
+					}
+				],
 				// [
 				// 	{
 				// 		span: 18,

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

@@ -14,13 +14,17 @@
 		<!-- 新增/编辑弹窗 -->
 		<el-dialog :title="popTitle+'虚拟分类'" :visible.sync="dialogFormVisible" width="30%" :destroy-on-close="true">
 			<by-form :propConfig="addConfig" ref="addFormId">
+				<template v-slot:parentName class="clearfix">
+					<i class="el-icon-loading" v-if="selectTreeLoading"></i>
+					<select-tree v-else ref="selectTree" :propConfig="selectTreeConfig" @onChange="selectTree"></select-tree>
+				</template>
 				<template v-slot:status class="clearfix">
 					<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">
-				<el-button @click="dialogFormVisible = false">取 消</el-button>
+				<el-button @click="dialogFormVisible = false; selectTreeChange = {}">取 消</el-button>
 				<el-button type="primary" @click="confirm">确 定</el-button>
 			</div>
 		</el-dialog>
@@ -30,6 +34,7 @@
 	import { Component, Prop, Vue, Watch } from "vue-property-decorator";
 	import api from "@/api/currency";
 	import Assembly from "@/components/Assembly/material.vue";
+	import selectTree from "@/benyun/components/selectTree/selectTree.vue";
 	@Component
 	export default class Virtually extends Vue {
 		// 左边
@@ -41,6 +46,8 @@
 		popTitle : any = ''
 		radio : any = 0
 		dialogFormVisible : boolean = false
+		selectTreeChange: any = {}
+		selectTreeLoading : boolean = false
 		treeConfig = {
 			attr: {
 				retConfig: {
@@ -169,6 +176,17 @@
 				}]
 			},
 		}
+		selectTreeConfig = {
+			attr: {
+				label: 'name',
+				clearable: true,
+				retConfig: {
+					parentId: 'id',
+					parentName: 'name',
+				},
+				defaultExpandAll: true
+			},
+		}
 		addConfig = {
 			attr: {
 				size: 'small',
@@ -188,21 +206,22 @@
 						label: '上级',
 						labelWidth: '70px',
 						prop: 'parentName',
-						component: 'select-tree',
-						compConfig: {
-							attr: {
-								label: 'name',
-								clearable: true,
-								retConfig: {
-									parentId: 'id',
-									parentName: 'name',
-								},
-								defaultExpandAll: true
-							},
-							request: {
-								url: '/maindata/maindataMaterialVmcategory/treeUseList'
-							}
-						}
+						slot: true,
+						// component: 'select-tree',
+						// compConfig: {
+						// 	attr: {
+						// 		label: 'name',
+						// 		clearable: true,
+						// 		retConfig: {
+						// 			parentId: 'id',
+						// 			parentName: 'name',
+						// 		},
+						// 		defaultExpandAll: true
+						// 	},
+						// 	request: {
+						// 		url: '/maindata/maindataMaterialVmcategory/treeUseList'
+						// 	}
+						// }
 					},
 					{
 						span: 23,
@@ -287,6 +306,15 @@
 		confirm() {
 			(this as any).$refs.addFormId.validate().then(() => {
 				let query = (this as any).$refs.addFormId.getValue();
+				if(this.selectTreeChange&&this.selectTreeChange.parentId||this.selectTreeChange.parentId==0){
+					if(this.selectTreeChange.parentId==0){
+						query.parentId = this.selectTreeChange.parentId;
+						query.parentName = null;
+					}else{
+						query.parentId = this.selectTreeChange.parentId;
+						query.parentName = this.selectTreeChange.parentName;
+					}
+				}
 				// console.log(query);
 				query.status = this.radio;
 				this.dialogFormVisible = false;
@@ -300,6 +328,7 @@
 							// (this as any).$refs.sideTree.request();
 							this.getTreeList();
 							this.getDataList();
+							this.selectTreeChange = {};
 						} else this.$message.error(res.msg);
 					}).catch(() => {});
 				} else if (this.popTitle === '编辑') {
@@ -316,6 +345,7 @@
 							// (this as any).$refs.sideTree.request();
 							this.getTreeList();
 							this.getDataList();
+							this.selectTreeChange = {};
 						} else this.$message.error(res.msg);
 					}).catch(() => {});
 				}
@@ -363,6 +393,31 @@
 				}
 			}).catch(() => loading.close());
 		}
+		getSelectTreeList(){
+			this.selectTreeLoading = true;
+			api.treeList('maindataMaterialVmcategory').then((treeRes : any) => {
+				if (treeRes.code === 200) {
+					this.selectTreeLoading = false;
+					setTimeout(()=>{
+						var data:any = [{
+							id: 0,
+							name: '虚拟分类',
+							children: treeRes.data
+						}];
+						(this as any).$refs.selectTree.setData(data);
+						let query = (this as any).$refs.addFormId.getValue();
+						if(query.parentId==0){
+							(this as any).$refs.selectTree.setValue("虚拟分类");
+						}else{
+							(this as any).$refs.selectTree.setValue(query.parentName);
+						}
+					},0)
+				}
+			}).catch(() => {});
+		}
+		selectTree(e:any){
+			this.selectTreeChange = e
+		}
 		// 工具栏方法
 		clickHandle(e : any) {
 			if (e === 'onAdd') this.onAdd();
@@ -373,6 +428,7 @@
 			this.dialogFormVisible = true;
 			this.radio = 0
 			this.getTreeList();
+			this.getSelectTreeList();
 			setTimeout(() => {
 				if(this.parentId!=0){
 					var data = {
@@ -389,7 +445,7 @@
 					}).catch(() => {});
 				}else{
 					(this as any).$refs.addFormId.setValue();
-					(this as any).$refs.addFormId.$refs['parentName--comp'][0].request();
+					// (this as any).$refs.addFormId.$refs['parentName--comp'][0].request();
 				}
 			}, 0)
 		}
@@ -410,13 +466,19 @@
 								data.parentName = res.data.name;
 								this.dialogFormVisible = true;
 								console.log(data, 'data');
-								setTimeout(() => { (this as any).$refs.addFormId.setValue(data) }, 0);
+								setTimeout(() => { 
+									(this as any).$refs.addFormId.setValue(data) 
+									this.getSelectTreeList();
+								}, 0);
 							}
 						}).catch(() => {});
 					}else{
 						loading.close();
 						this.dialogFormVisible = true;
-						setTimeout(() => { (this as any).$refs.addFormId.setValue(data) }, 0);
+						setTimeout(() => { 
+							(this as any).$refs.addFormId.setValue(data) 
+							this.getSelectTreeList();
+						}, 0);
 					}
 				}
 			}).catch(() => loading.close());