瀏覽代碼

物料属性必填添加提示

hcf 1 年之前
父節點
當前提交
56e5e2a477
共有 2 個文件被更改,包括 38 次插入2 次删除
  1. 29 2
      src/views/audit/productManagement/index.vue
  2. 9 0
      src/views/audit/sku/index.vue

+ 29 - 2
src/views/audit/productManagement/index.vue

@@ -34,7 +34,7 @@
 						<el-radio v-model="status" :label="2">禁用</el-radio>
 					</template>
 					<template v-slot:ismakeup>
-						<el-radio v-model="ismakeup" :label="0">是</el-radio>
+						<el-radio v-model="ismakeup" :label="0" :disabled="materialSpec==1">是</el-radio>
 						<el-radio v-model="ismakeup" :label="1">否</el-radio>
 						<el-button v-show="ismakeup===0" @click="openMakeup">选择商品</el-button>
 					</template>
@@ -271,6 +271,14 @@
 			attr: {
 				size: 'mini',
 				align: 'left',
+				editRules: {
+					skuTitle: [
+						{ required: true, message: '请输入标题'}
+					],
+					skuCode: [
+						{ required: true, message: '请输入物料编码'}
+					]
+				}
 			},
 			columns: [
 				{
@@ -466,6 +474,14 @@
 			attr: {
 				size: 'mini',
 				align: 'left',
+				editRules: {
+					skuTitle: [
+						{ required: true, message: '请输入标题'}
+					],
+					skuCode: [
+						{ required: true, message: '请输入物料编码'}
+					]
+				}
 			},
 			columns: [
 				{
@@ -1210,11 +1226,13 @@
 						// if (parseInt(v.width) <= 0) return this.$message.warning('物料属性宽度不能小于1');
 						// if (!v.height) return this.$message.warning('物料属性高度必填');
 						// if (parseInt(v.height) <= 0) return this.$message.warning('物料属性高度不能小于1');
+						(this.$refs.table as any).validate();
 						if (!v.skuTitle) return this.$message.warning('物料标题必填');
 						if (!v.skuCode) return this.$message.warning('物料编码必填');
 						// if(v.weight&&v.weight!=0){
 						// 	v.weight = v.weight/1000
 						// }
+						// v.isDeleted = 0
 					};
 					data = { maindataMaterialReceiveParam: query, maindataMaterialSkus: this.tableList }
 					let newArray : any = []
@@ -1256,13 +1274,14 @@
 						// if (parseInt(v.width) <= 0) return this.$message.warning('物料宽不能小于1');
 						// if (!v.height) return this.$message.warning('物料高必填');
 						// if (parseInt(v.height) <= 0) return this.$message.warning('物料高不能小于1');
+						(this.$refs.singeTable as any).validate();
 						if (!v.skuTitle) return this.$message.warning('物料属性的标题需必填');
 						if (!v.skuCode) return this.$message.warning('物料属性的物料编码需必填');
 						
 						// if(v.weight&&v.weight!=0){
 						// 	v.weight = v.weight/1000
 						// }
-						v.ismakeup = 1
+						// v.isDeleted = 1
 					};
 					data.maindataMaterialSkus[0].isDeleted = 0;
 					data.maindataMaterialReceiveParam.attributeList = ""
@@ -1357,6 +1376,11 @@
 					this.tagsData = data.tags.split(",")
 				} else this.tagsData = [];
 				this.materialSpec = data.materialSpec
+				if(this.materialSpec == 1){
+					this.ismakeup = 1
+				}else{
+					this.ismakeup = 0
+				}
 				this.isSingle = data.materialSpec === 0 ? true : false;
 				if (data.attributeList) this.attributeList = JSON.parse(data.attributeList);
 				 
@@ -1732,6 +1756,9 @@
 		}
 		// 切换商品规格
 		changeSingle() {
+			if(this.materialSpec == 1){
+				this.ismakeup = 1
+			}
 			if (this.isSingle) {
 				if ((this as any).$refs.singeTable) this.singeTable = (this as any).$refs.singeTable.getValue()
 				this.isSingle = false;

+ 9 - 0
src/views/audit/sku/index.vue

@@ -45,6 +45,14 @@
 			attr: {
 				size: 'mini',
 				align: 'left',
+				editRules: {
+					skuTitle: [
+						{ required: true, message: '请输入标题'}
+					],
+					skuCode: [
+						{ required: true, message: '请输入物料编码'}
+					]
+				}
 			},
 			columns: [
 				{
@@ -424,6 +432,7 @@
 		// 保存
 		doFormData() {
 			let data : any = (this as any).$refs.addFormId.getValue();
+			(this.$refs.addFormId as any).validate();
 			if (!data[0].skuTitle) return this.$message.warning('物料标题不能为空');
 			if (!data[0].skuCode) return this.$message.warning('物料编号不能为空');
 			api.updateList(data[0], 'maindataMaterialSku').then((res : any) => {