|
|
@@ -1612,16 +1612,28 @@ import LuckyExcel from 'luckyexcel';
|
|
|
}
|
|
|
console.log(restoredData)
|
|
|
// console.log(formData3.value.formattedArray)
|
|
|
- const response = await JunkDetailEdit(restoredData);
|
|
|
- console.log(response)
|
|
|
- if (response.code === 0) {
|
|
|
- ElMessage({
|
|
|
- type: 'success',
|
|
|
- message: '成功'
|
|
|
- })
|
|
|
- dialogFormVisible.value = false
|
|
|
+ const isValid = Object.keys(restoredData)
|
|
|
+ .filter(key => key.startsWith('JL_Je')) // 过滤奖励金额的值
|
|
|
+ .every(key => restoredData[key] <= 200); // 判断每个值是否小于等于200
|
|
|
+
|
|
|
+ if (!isValid) {
|
|
|
+ ElMessage({
|
|
|
+ type: 'warning',
|
|
|
+ message: '请确保所有的奖励金额都小于或等于 200'
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ const response = await JunkDetailEdit(restoredData);
|
|
|
+ console.log(response)
|
|
|
+ if (response.code === 0) {
|
|
|
+ ElMessage({
|
|
|
+ type: 'success',
|
|
|
+ message: '成功'
|
|
|
+ })
|
|
|
+ dialogFormVisible.value = false
|
|
|
+ }
|
|
|
+ getTableData()
|
|
|
}
|
|
|
- getTableData()
|
|
|
+
|
|
|
}
|
|
|
const add = async () => {
|
|
|
const restoredData = {
|
|
|
@@ -1688,19 +1700,31 @@ import LuckyExcel from 'luckyexcel';
|
|
|
sys_id: sys_id,
|
|
|
}
|
|
|
console.log(restoredData)
|
|
|
+ const isValid = Object.keys(restoredData)
|
|
|
+ .filter(key => key.startsWith('JL_Je')) // 过滤奖励金额的值
|
|
|
+ .every(key => restoredData[key] <= 200); // 判断每个值是否小于等于200
|
|
|
+
|
|
|
+ if (!isValid) {
|
|
|
+ ElMessage({
|
|
|
+ type: 'warning',
|
|
|
+ message: '请确保所有的奖励金额都小于或等于 200'
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ const response = await JunkDetailAdd(restoredData);
|
|
|
+ console.log(response)
|
|
|
+ if (response.code === 0) {
|
|
|
+ ElMessage({
|
|
|
+ type: 'success',
|
|
|
+ message: '成功'
|
|
|
+ })
|
|
|
+ dialogFormVisible.value = false
|
|
|
+ }
|
|
|
+
|
|
|
+ getTableData()
|
|
|
+ }
|
|
|
// return;
|
|
|
// console.log(formData3.value.formattedArray)
|
|
|
- const response = await JunkDetailAdd(restoredData);
|
|
|
- console.log(response)
|
|
|
- if (response.code === 0) {
|
|
|
- ElMessage({
|
|
|
- type: 'success',
|
|
|
- message: '成功'
|
|
|
- })
|
|
|
- dialogFormVisible.value = false
|
|
|
- }
|
|
|
|
|
|
- getTableData()
|
|
|
}
|
|
|
|
|
|
|