diff --git a/src/components/house/HouseApplyUploadComp.vue b/src/components/house/HouseApplyUploadComp.vue
index 3d200979..e312720d 100644
--- a/src/components/house/HouseApplyUploadComp.vue
+++ b/src/components/house/HouseApplyUploadComp.vue
@@ -14,6 +14,8 @@
:disabled="disabled || !item.current"
:show-upload="!disabled && item.current"
:before-delete="handleRemove"
+ :deletable="!disabled && item.current"
+ :before-read="checkFile"
>
@@ -29,6 +31,7 @@
import { treeSingleProcessView , attach , removeFile , getAttachmentConfigTree, attachmentFind } from "@/api/onlineHome/homestead/application";
import {getToken} from "@/utils/auth";
import request from '@/utils/request'
+import {Notify} from "vant";
/** 导入JS方法 */
export default {
@@ -73,12 +76,17 @@ export default {
params: item.postData,
data: formData,
}).then((resp) => {
- file.response = resp;
- console.log(resp);
- file.fileList = item.fileList;
- this.onFileListChanged("ADD", resp.id);
- this.setFileStatus(file, 'done', '文件上传成功');
- this.$emit('onUploadSuccess', file);
+ if(resp.code == 200)
+ {
+ file.response = resp;
+ console.log(resp);
+ file.fileList = item.fileList;
+ this.onFileListChanged("ADD", resp.id);
+ this.setFileStatus(file, 'done', '文件上传成功');
+ this.$emit('onUploadSuccess', file);
+ }
+ else
+ this.setFileStatus(file, 'fail', '文件上传失败!');
}).catch((e) => {
this.setFileStatus(file, 'fail', '文件上传失败!');
});
@@ -238,6 +246,24 @@ export default {
file.status = status;
file.message = message;
},
+ checkFile(file) {
+ let mime = file.type;
+ if([
+ "image/png",
+ "image/jpeg",
+ "image/gif",
+ "image/bmp",
+ ].indexOf(mime) === -1)
+ {
+ this.notify('请上传jpg/png/gif/bmp等格式图片!', 'danger');
+ return false;
+ }
+ return true;
+ },
+ notify(message, type) {
+ Notify.clear();
+ Notify({ type: type || 'primary', message: message });
+ },
}
};
diff --git a/src/permission.js b/src/permission.js
index f4dc612d..c1dee66a 100644
--- a/src/permission.js
+++ b/src/permission.js
@@ -129,7 +129,7 @@ router.beforeEach((to, from, next) => {
store.dispatch('LogOut').then(() => {
try {
let loginUrl = Cookies.get("_Login_url");
- if(loginUrl && loginUrl.endsWith("onlineHomeLogin"))
+ if(loginUrl && loginUrl.indexOf("onlineHomeLogin") !== -1)
{
next({ path: '/onlineHomeLogin' })
return;
@@ -168,7 +168,7 @@ router.beforeEach((to, from, next) => {
} else {
try {
let loginUrl = Cookies.get("_Login_url");
- if(loginUrl && loginUrl.endsWith("onlineHomeLogin"))
+ if(loginUrl && loginUrl.indexOf("onlineHomeLogin") !== -1)
{
next({ path: `/onlineHomeLogin?redirect=${to.fullPath}` })
return;
diff --git a/src/utils/request.js b/src/utils/request.js
index f01bcfb4..324d3c18 100644
--- a/src/utils/request.js
+++ b/src/utils/request.js
@@ -72,7 +72,7 @@ service.interceptors.response.use(res => {
store.dispatch('LogOut').then(() => {
try {
let loginUrl = Cookies.get("_Login_url");
- if(loginUrl && loginUrl.endsWith("onlineHomeLogin"))
+ if(loginUrl && loginUrl.indexOf("onlineHomeLogin") !== -1)
{
window.location.href = loginUrl;
return;
diff --git a/src/views/onlineHome/homestead/circulation/circulationAdd.vue b/src/views/onlineHome/homestead/circulation/circulationAdd.vue
index 3a8143ed..0b0b0b38 100644
--- a/src/views/onlineHome/homestead/circulation/circulationAdd.vue
+++ b/src/views/onlineHome/homestead/circulation/circulationAdd.vue
@@ -361,17 +361,19 @@
houseAdd(this.circulation).then(response => {
if(response.code = 200){
this.$toast.success('保存成功');
+ this.$router.back(-1);
}
});
- this.$router.push({name: this.$router.back(-1)});
},
goSubmit(){
- goApply(this.$route.query.id).then(response => {
+ houseAdd(this.circulation).then(response => {
if(response.code = 200){
- this.$toast.success('提交成功');
- setTimeout(function(){
- window.location.replace("circulationList")
- },1000)
+ goApply(response.data).then(response => {
+ if(response.code = 200){
+ this.$toast.success('提交成功');
+ this.$router.back(-1);
+ }
+ });
}
});
},
diff --git a/src/views/onlineHome/homestead/circulation/circulationModify.vue b/src/views/onlineHome/homestead/circulation/circulationModify.vue
index 8ceee677..29e2465a 100644
--- a/src/views/onlineHome/homestead/circulation/circulationModify.vue
+++ b/src/views/onlineHome/homestead/circulation/circulationModify.vue
@@ -364,6 +364,7 @@ export default {
edit(this.circulation).then(response => {
if(response.code = 200){
this.$toast.success('保存成功');
+ this.$router.back(-1);
}
});
},
diff --git a/src/views/onlineHome/homestead/homeApplication/applicationList.vue b/src/views/onlineHome/homestead/homeApplication/applicationList.vue
index d7a0d0f8..ce83e835 100644
--- a/src/views/onlineHome/homestead/homeApplication/applicationList.vue
+++ b/src/views/onlineHome/homestead/homeApplication/applicationList.vue
@@ -84,6 +84,7 @@ export default {
this.houseGetDicts("house_apply_status").then((response) => {
console.log(response)
this.houseApplyStatus = response.data;
+ //this.refresh();
});
},
methods: {
@@ -146,9 +147,10 @@ export default {
});
},
refresh() {
+ this.applicationList = [];
+ this.queryParams.pageNum = 1;
this.refreshing = true;
this.finished = false;
- this.applicationList = []
},
submitApplyProposer(item) {
this.$dialog.confirm({
diff --git a/src/views/onlineHome/homestead/homeApplication/proposerLite.vue b/src/views/onlineHome/homestead/homeApplication/proposerLite.vue
index 10046831..4f415d88 100644
--- a/src/views/onlineHome/homestead/homeApplication/proposerLite.vue
+++ b/src/views/onlineHome/homestead/homeApplication/proposerLite.vue
@@ -42,7 +42,7 @@
/>
-
+
@@ -88,7 +88,7 @@
-
+
@@ -318,7 +318,7 @@
自然
资源
部门
意见
- ㎡
+ ㎡
{
this.notify("保存失败!", 'danger');
@@ -1878,7 +1881,7 @@ export default {
submitApplyProposer() {
customSubmitWLHT(this.id).then((resp) => {
this.notify("提交成功", 'success');
- this.$router.back(-1);
+ this.goBack();
}).catch((e) => {
this.notify("提交失败!", 'danger');
}).finally(() => {
@@ -2075,7 +2078,7 @@ export default {
params: data,
}).then((response) => {
this.notify("操作成功", 'success');
- this.$router.back(-1);
+ this.goBack();
}).catch(e => {
this.notify("操作失败!", 'danger');
});
@@ -2139,7 +2142,7 @@ export default {
{
submitStartWLHT(this.applicationDetail.tHouseApplyStart.id).then(resp => {
this.notify("操作成功", 'success');
- this.$router.back(-1);
+ this.goBack();
}).catch((e) => {
this.notify("操作失败!", 'danger');
});
@@ -2147,7 +2150,7 @@ export default {
else
{
this.notify("保存成功", 'success');
- this.$router.back(-1);
+ this.goBack();
}
}).catch((e) => {
this.notify('保存失败', 'danger');
@@ -2181,7 +2184,7 @@ export default {
{
submitEndWLHT(this.applicationDetail.tHouseApplyEnd.id).then(resp => {
this.notify("操作成功", 'success');
- this.$router.back(-1);
+ this.goBack();
}).catch(err => {
this.notify("操作失败!", 'danger');
});
@@ -2189,7 +2192,7 @@ export default {
else
{
this.notify("保存成功", 'success');
- this.$router.back(-1);
+ this.goBack();
}
}).catch(err => {
this.notify('保存失败', 'danger');
@@ -2238,11 +2241,11 @@ export default {
if (this.checkString(this.applicationDetail.tHouseApplyProposer.age)) {
return "户主年龄不能为空";
}
- if (this.checkString(this.applicationDetail.tHouseApplyProposer.phone)) {
- return "联系电话不能为空";
+ if (this.checkString(this.applicationDetail.tHouseApplyProposer.phone, /(^\d{7}(\d{4})?$)/)) {
+ return "请填写有效的联系电话";
}
- if (this.checkString(this.applicationDetail.tHouseApplyProposer.idcard)) {
- return "身份证号不能为空";
+ if (this.checkString(this.applicationDetail.tHouseApplyProposer.idcard, /^[1-9]\d{5}(18|19|20|(3\d))\d{2}((0[1-9])|(1[0-2]))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$/)) {
+ return "请填写有效的身份证号";
}
if (this.checkString(this.applicationDetail.tHouseApplyProposer.householdRegister)) {
return "户口所在地不能为空";
@@ -2269,8 +2272,8 @@ export default {
if (this.checkString(v.familyStatusName)) {
return "与户主关系不能为空";
}
- if (this.checkString(v.idcard)) {
- return "家庭成员身份证不能为空";
+ if (this.checkString(v.idcard, /^[1-9]\d{5}(18|19|20|(3\d))\d{2}((0[1-9])|(1[0-2]))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$/)) {
+ return "请填写有效的家庭成员身份证";
}
if (this.checkString(v.householdRegister)) {
return "户口所在地不能为空";
@@ -2656,6 +2659,34 @@ export default {
}
return false;
},
+ parseIDCard(idcard) {
+ if(!idcard)
+ return false;
+ if(idcard.length !== 18)
+ return false;
+ if(!/^[1-9]\d{5}(18|19|20|(3\d))\d{2}((0[1-9])|(1[0-2]))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$/.test(idcard))
+ return false;
+ let sex = (parseInt(idcard.substr(16, 1)) % 2) ^ 1;
+ let now = new Date().getFullYear();
+ let y = parseInt(idcard.substr(6, 4));
+ let age = Math.max(now - y, 0);
+ return [sex, age];
+ },
+ updateUserInfo() {
+ let res = this.parseIDCard(this.applicationDetail.tHouseApplyProposer.idcard);
+ if(res)
+ {
+ this.applicationDetail.tHouseApplyProposer.sex = res[0];
+ this.applicationDetail.tHouseApplyProposer.age = res[1];
+ }
+ },
+ updateMemberInfo(index) {
+ let res = this.parseIDCard(this.applicationDetail.tHouseApplyFamilyMembers[index].idcard);
+ if(res)
+ {
+ this.applicationDetail.tHouseApplyFamilyMembers[index].age = res[1];
+ }
+ },
},
watch: {
selectedTabName: function (newVal, oldVal) {