Browse Source

新旧件保存修改

pengyh 1 year ago
parent
commit
55a5b2e01b

+ 6 - 6
src/views/auxiliaryFittings/salesManagement/components/attachmentNewReturnDetail.vue

@@ -162,7 +162,7 @@
 			<div class="footer">
 				<el-button v-if="formType == 0 || (formType == 1 && formData.flag == 'SAVE')" size="small" type="primary" @click="save()">保存</el-button>
 				<el-button v-if="formType != 0 && formData.flag == 'SAVE'" size="small" type="primary" @click="submit()">提交</el-button>
-				<el-button v-if="formData.flag == 'SUBMIT'" size="small" type="primary"  @click="confirm()">确认收货</el-button>
+				<el-button v-if="formType != 0 && formData.flag == 'SUBMIT'" size="small" type="primary"  @click="confirm()">确认收货</el-button>
 				<el-button size="small" type="info" @click="goBack">返回</el-button>
 			</div>
 		</div>
@@ -367,17 +367,17 @@
 				});
 			},
 			async checkForm(){
+				let is_save = true
 				this.dataList.forEach(item=>{
-					if(!item.newRefundQty || item.newRefundQty < 1){
+					if(!item.oldRefundQty || item.oldRefundQty < 1){
 						this.$message.warning('请输入配件数量并且数量大于0!')
-						return false
+						is_save = false
 					}else if(!item.refundAmount || item.refundAmount <= 0){
 						this.$message.warning('请输入配件退货金额并且大于0!')
-						return false
-					}else{
-						return true
+						is_save = false
 					}
 				})
+				return is_save
 			},
 			async submit(){
 				let is_save = await this.checkForm()

+ 7 - 5
src/views/auxiliaryFittings/salesManagement/components/attachmentOldReturnDetail.vue

@@ -167,7 +167,7 @@
 			<div class="footer">
 				<el-button v-if="formType == 0 || (formType == 1 && formData.flag == 'SAVE')" size="small" type="primary" @click="save()">保存</el-button>
 				<el-button v-if="formType != 0 && formData.flag == 'SAVE'" size="small" type="primary" @click="submit()">提交</el-button>
-				<el-button v-if="formData.flag == 'SUBMIT'" size="small" type="primary"  @click="confirm()">确认收货</el-button>
+				<el-button v-if="formType != 0 && formData.flag == 'SUBMIT'" size="small" type="primary"  @click="confirm()">确认收货</el-button>
 				<el-button size="small" type="info" @click="goBack">返回</el-button>
 			</div>
 		</div>
@@ -358,17 +358,18 @@
 				})
 			},
 			async checkForm(){
+				let is_save = true
 				this.dataList.forEach(item=>{
 					if(!item.oldRefundQty || item.oldRefundQty < 1){
 						this.$message.warning('请输入配件数量并且数量大于0!')
-						return false
+						is_save = false
 					}else if(!item.refundAmount || item.refundAmount <= 0){
 						this.$message.warning('请输入配件退货金额并且大于0!')
-						return false
-					}else{
-						return true
+						is_save = false
 					}
 				})
+				return is_save
+				
 			},
 			confirm(){
 				this.$confirm(`请确定是否确认提货, 是否继续?`, '提示', {
@@ -421,6 +422,7 @@
 			},
 			async save(){
 				let is_save = await this.checkForm()
+				console.log(is_save)
 				if(!is_save){return false}
 				this.$refs.formData.validate((valid, invalidFields, errLabels) => {
 					if (valid) {