From b532cc9a9353d08e9ca6a273e7861f13e937bfff Mon Sep 17 00:00:00 2001
From: lld <15027638633@163.com>
Date: Fri, 20 Feb 2026 14:51:28 +0800
Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=A6=96=E9=A1=B5=E6=B7=BB?=
=?UTF-8?q?=E5=8A=A0=E5=A4=A7=E6=A3=9A?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
components/addAgri/addAgri.vue | 35 +++++++++++++++++++++-------------
pages/index.vue | 2 +-
utils/TimeUtil.js | 2 +-
3 files changed, 24 insertions(+), 15 deletions(-)
diff --git a/components/addAgri/addAgri.vue b/components/addAgri/addAgri.vue
index 01ccbff..3150ad4 100644
--- a/components/addAgri/addAgri.vue
+++ b/components/addAgri/addAgri.vue
@@ -83,28 +83,37 @@ export default {
},
methods:{
close() {
+ this.$emit("reload")
this.$refs.addForm.close();
},
confirm() {
this.$refs.form.validate().then(res => {
- if (!res) {
- addAgriMobile(this.formData).then((response) => {
- if (response.code===200) {
- uni.showModal({
- title: `${response.data.code===1?"✅":"⚠️"}操作提示`,
- content: `${response.data.msg}`,
- showCancal: false,
- confirmText: '确定',
- })
- }
- })
- }
+ addAgriMobile(this.formData).then((response) => {
+ if (response.code===200) {
+ uni.showModal({
+ title: `${response.data.code===1?"✅":"⚠️"}操作提示`,
+ content: `${response.data.msg}`,
+ showCancal: false,
+ confirmText: '确定',
+ })
+ }
+ })
this.close();
}).catch(err => {
- console.log('表单错误信息:', err);
+ uni.showModal({
+ title: `❌操作提示`,
+ content: `${err.errorMessage}`,
+ showCancal: false,
+ confirmText: '确定',
+ })
})
},
open() {
+ this.formData = {
+ agriName: null,
+ imei: null,
+ sourceCode:0
+ };
this.$refs.addForm.open();
},
getScanCode(res){
diff --git a/pages/index.vue b/pages/index.vue
index a652e33..d60c59b 100644
--- a/pages/index.vue
+++ b/pages/index.vue
@@ -78,7 +78,7 @@
-
+
diff --git a/utils/TimeUtil.js b/utils/TimeUtil.js
index 1cc6434..67ea01a 100644
--- a/utils/TimeUtil.js
+++ b/utils/TimeUtil.js
@@ -70,7 +70,7 @@ class TimeUtil {
// 情况4:不支持的类型
else {
- console.error(`不支持的时间类型:${typeof time},仅支持数字、Date对象、字符串`);
+ console.warn(`不支持的时间类型:${typeof time},仅支持数字、Date对象、字符串`);
return null;
}