Jelajahi Sumber

必填调整

wangqiang 1 tahun lalu
induk
melakukan
a262808d0a

+ 37 - 2
src/views/cw/reimbursementApproval/info/InfoUpdateForm.vue

@@ -557,7 +557,7 @@
 						</vxe-table-column>
 						<vxe-table-column title="操作" width="100">
 							<template v-slot="scope">
-								<el-button size="default" type="danger" @click="removeEvent(scope.row,scope.$rowIndex,'procured')">删除</el-button>
+								<el-button size="default" type="danger" @click="removeEvent(scope.row,scope.$rowIndex,'human')">删除</el-button>
 							</template>
 						</vxe-table-column>
 					</vxe-table>
@@ -957,6 +957,10 @@
           this.$refs.detailTableProcured.remove(row)
           this.inputForm.detailInfoProcured.splice(rowIndex, 1)
         }
+		  if (type === 'human') {
+			  this.$refs.humanTableProcured.remove(row)
+			  this.inputForm.humanInfoProcured.splice(rowIndex, 1)
+		  }
       },
       // 新增
       async insertEvent (type) {
@@ -1721,7 +1725,38 @@
                 }
               }
             }
-          }
+          } else if (this.inputForm.sourceType === '6') {
+			  if (this.commonJS.isEmpty(this.inputForm.humanInfoProcured)) {
+				  this.$message.error('至少填写一条报销详情信息')
+				  this.loading = false
+				  throw new Error('至少填写一条报销详情信息')
+			  } else {
+				  let i = this.inputForm.humanInfoProcured.length
+				  for (let j = 0; j < i; j++) {
+					  let k = j + 1
+					  if (this.commonJS.isEmpty(this.inputForm.humanInfoProcured[j].userName)) {
+						  this.$message.error('报销详情第' + k + '行请选择报销人')
+						  this.loading = false
+						  throw new Error('报销详情第' + k + '行请选择报销人')
+					  }
+					  if (this.commonJS.isEmpty(this.inputForm.humanInfoProcured[j].typeName)) {
+						  this.$message.error('报销详情第' + k + '行请选择报销类型')
+						  this.loading = false
+						  throw new Error('报销详情第' + k + '行请选择报销类型')
+					  }
+					  if (this.commonJS.isEmpty(this.inputForm.humanInfoProcured[j].reimbuserName)) {
+						  this.$message.error('报销详情第' + k + '行请选择报销登记名称')
+						  this.loading = false
+						  throw new Error('报销详情第' + k + '行请选择报销登记名称')
+					  }
+					  if (this.commonJS.isEmpty(this.inputForm.humanInfoProcured[j].number)) {
+						  this.$message.error('报销详情第' + k + '行请填写费用')
+						  this.loading = false
+						  throw new Error('报销详情第' + k + '行请填写费用')
+					  }
+				  }
+			  }
+		  }
         }
       },
       openPurForm () {

+ 37 - 2
src/views/cw/reimbursementApproval/info/ReimbursementForm.vue

@@ -596,7 +596,7 @@
 						</vxe-table-column>
 						<vxe-table-column title="操作" width="100">
 							<template v-slot="scope">
-								<el-button size="default" type="danger" @click="removeEvent(scope.row,scope.$rowIndex,'procured')">删除</el-button>
+								<el-button size="default" type="danger" @click="removeEvent(scope.row,scope.$rowIndex,'human')">删除</el-button>
 							</template>
 						</vxe-table-column>
 					</vxe-table>
@@ -1253,6 +1253,10 @@
           this.$refs.detailTableProcured.remove(row)
           this.inputForm.detailInfoProcured.splice(rowIndex, 1)
         }
+		  if (type === 'human') {
+			  this.$refs.humanTableProcured.remove(row)
+			  this.inputForm.humanInfoProcured.splice(rowIndex, 1)
+		  }
       },
       // 新增
       async insertEvent (type) {
@@ -2171,7 +2175,38 @@
                 }
               }
             }
-          }
+          } else if (this.inputForm.sourceType === '6') {
+			  if (this.commonJS.isEmpty(this.inputForm.humanInfoProcured)) {
+				  this.$message.error('至少填写一条报销详情信息')
+				  this.loading = false
+				  throw new Error('至少填写一条报销详情信息')
+			  } else {
+				  let i = this.inputForm.humanInfoProcured.length
+				  for (let j = 0; j < i; j++) {
+					  let k = j + 1
+					  if (this.commonJS.isEmpty(this.inputForm.humanInfoProcured[j].userName)) {
+						  this.$message.error('报销详情第' + k + '行请选择报销人')
+						  this.loading = false
+						  throw new Error('报销详情第' + k + '行请选择报销人')
+					  }
+					  if (this.commonJS.isEmpty(this.inputForm.humanInfoProcured[j].typeName)) {
+						  this.$message.error('报销详情第' + k + '行请选择报销类型')
+						  this.loading = false
+						  throw new Error('报销详情第' + k + '行请选择报销类型')
+					  }
+					  if (this.commonJS.isEmpty(this.inputForm.humanInfoProcured[j].reimbuserName)) {
+						  this.$message.error('报销详情第' + k + '行请选择报销登记名称')
+						  this.loading = false
+						  throw new Error('报销详情第' + k + '行请选择报销登记名称')
+					  }
+					  if (this.commonJS.isEmpty(this.inputForm.humanInfoProcured[j].number)) {
+						  this.$message.error('报销详情第' + k + '行请填写费用')
+						  this.loading = false
+						  throw new Error('报销详情第' + k + '行请填写费用')
+					  }
+				  }
+			  }
+		  }
         }
 
       },

+ 1 - 3
src/views/human/practice/logwrite/LogWriteAddForm.vue

@@ -311,10 +311,8 @@
 									}
 								}
 							});
+							this.workDay = this.inputForm.amountInfos.length
 						}
-
-
-						this.workDay = this.inputForm.amountInfos.length
 						this.loading = false
 					})
 				})

+ 15 - 0
src/views/human/practice/reimburseRegister/ReimburseRegisterAddForm.vue

@@ -315,6 +315,21 @@
 				this.$refs['inputForm'].validate(async (valid) => {
 					if (valid) {
 						this.loading = true
+
+						if (this.commonJS.isEmpty(this.inputForm.detailList)) {
+							this.$message.error('至少填写一条报销明细')
+							this.loading = false
+							return
+						}
+						this.inputForm.detailList.forEach((item, index) => {
+							if (this.commonJS.isEmpty(item.workName)) {
+								this.loading = false
+								this.$message.warning('报销明细中第 ' + (index + 1) + ' 条数据的 “日志名称” 不能为空')
+								throw new Error()
+							}
+							// 在这里执行对每个元素的操作
+						});
+
 						this.inputForm.type = '2'
 						reimburseRegisterService.save(this.inputForm).then((data) => {
 							this.inputForm.title = `${this.$store.state.user.name} 发起了 - [实习-报销登记]`

+ 15 - 0
src/views/human/practice/reimburseRegister/ReimburseRegisterEditForm.vue

@@ -289,6 +289,21 @@
 				this.$refs['inputForm'].validate((valid) => {
 					if (valid) {
 						this.loading = true
+
+						if (this.commonJS.isEmpty(this.inputForm.detailList)) {
+							this.$message.error('至少填写一条报销明细')
+							this.loading = false
+							return
+						}
+						this.inputForm.detailList.forEach((item, index) => {
+							if (this.commonJS.isEmpty(item.workName)) {
+								this.loading = false
+								this.$message.warning('报销明细中第 ' + (index + 1) + ' 条数据的 “日志名称” 不能为空')
+								throw new Error()
+							}
+							// 在这里执行对每个元素的操作
+						});
+
 						reimburseRegisterService.save(this.inputForm).then((data) => {
 							this.close()
 							this.$message.success(data)