浏览代码

修复商品关联问题
优化分销商

hcf 1 年之前
父节点
当前提交
2c46b23c83
共有 2 个文件被更改,包括 100 次插入65 次删除
  1. 38 38
      src/views/audit/distributor/index.vue
  2. 62 27
      src/views/audit/productManagement/index.vue

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

@@ -303,44 +303,44 @@
 						}
 					},
 				],
-				[
-					{
-						span: 18,
-						label: 'URL地址',
-						slot: true,
-						prop: 'k3ServerUrl',
-					},
-				],
-				[
-					{
-						span: 6,
-						label: '登录授权ID',
-						slot: true,
-						prop: 'k3AppId',
-						component: 'by-input',
-					},
-					{
-						span: 6,
-						label: '用户名称',
-						slot: true,
-						prop: 'k3UserName',
-						component: 'by-input',
-					},
-					{
-						span: 6,
-						label: '数据中心ID',
-						slot: true,
-						prop: 'k3AcctId',
-						component: 'by-input',
-					},
-					{
-						span: 6,
-						label: '应用秘钥',
-						slot: true,
-						prop: 'k3AppSec',
-						component: 'by-input',
-					},
-				],
+				// [
+				// 	{
+				// 		span: 18,
+				// 		label: 'URL地址',
+				// 		slot: true,
+				// 		prop: 'k3ServerUrl',
+				// 	},
+				// ],
+				// [
+				// 	{
+				// 		span: 6,
+				// 		label: '登录授权ID',
+				// 		slot: true,
+				// 		prop: 'k3AppId',
+				// 		component: 'by-input',
+				// 	},
+				// 	{
+				// 		span: 6,
+				// 		label: '用户名称',
+				// 		slot: true,
+				// 		prop: 'k3UserName',
+				// 		component: 'by-input',
+				// 	},
+				// 	{
+				// 		span: 6,
+				// 		label: '数据中心ID',
+				// 		slot: true,
+				// 		prop: 'k3AcctId',
+				// 		component: 'by-input',
+				// 	},
+				// 	{
+				// 		span: 6,
+				// 		label: '应用秘钥',
+				// 		slot: true,
+				// 		prop: 'k3AppSec',
+				// 		component: 'by-input',
+				// 	},
+				// ],
 				[{
 					span: 18,
 					label: '地址',

+ 62 - 27
src/views/audit/productManagement/index.vue

@@ -1273,7 +1273,7 @@
 						// v.isDeleted = 0
 						v.ismakeup = this.ismakeup
 					};
-					data = { maindataMaterialReceiveParam: query, maindataMaterialSkus: this.tableList }
+					data = { maindataMaterialReceiveParam: query, maindataMaterialSkus: (this.$refs.table as any).getValue() }
 					let newArray : any = []
 					let materialSpecData : any = []
 					let attributeLength = this.attributeList.length
@@ -1766,33 +1766,68 @@
 			val2.name = this.tableRadio.fname;
 			val2.shortName = this.tableRadio.fname;
 			// 物料属性赋值
-			var val = (this as any).$refs.singeTable.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('物料 '+val[0].skuTitle+' 信息变更为 '+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;
+			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);
+			}
+			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 as any).$refs.table.setValue(val);
 			}
-			(this as any).$refs.singeTable.setValue(val);
 			(this as any).$refs.form.setValue(val2);
 			this.vxeValue = false;
 		}