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;
}