Commit 6ff29717 authored by 张伯涛's avatar 张伯涛

新增修改页面路由离开前判断表单变化

parent 1f961a6c
...@@ -99,6 +99,24 @@ export default { ...@@ -99,6 +99,24 @@ export default {
ZCOMPYREL: '', ZCOMPYREL: '',
ZBPNATURE: '', ZBPNATURE: '',
phone: '' phone: ''
},
saveForm: {
ZBPNAME_ZH: '',
ZBPTYPE: '',
ZOIBC: '',
ZBPNAME_EN: '',
ZBPNAME_LOC: '',
ZUSCC: '',
ZBRNO: '',
ZTRNO: '',
ZOSRNO: '',
ZIDNO: '',
ZSSNO: '',
ZZCOUNTRY: '',
ZETPSPROPERTY: '',
ZCOMPYREL: '',
ZBPNATURE: '',
phone: ''
} }
} }
}, },
...@@ -107,9 +125,29 @@ export default { ...@@ -107,9 +125,29 @@ export default {
this.getDetail() this.getDetail()
} }
}, },
beforeRouteLeave(to, from, next) {
if (this.agreeBack) { next() } else {
if (JSON.stringify(this.form) !== JSON.stringify(this.saveForm)) {
this.$confirm('您已经对信息进行了修改,离开后不会保存您所做的更改,是否确定离开?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
closeOnHashChange: false
}).then(() => {
this.agreeBack = true
this.$router.replace(to.path)
}).catch(() => {
})
} else {
this.agreeBack = true
this.$router.replace(to.fullPath)
}
}
},
methods: { methods: {
getDetail() { getDetail() {
this.form = this.$route.query.data this.form = JSON.parse(JSON.stringify(this.$route.query.data))
this.saveForm = JSON.parse(JSON.stringify(this.$route.query.data))
} }
} }
} }
......
...@@ -1742,6 +1742,114 @@ export default { ...@@ -1742,6 +1742,114 @@ export default {
BUSITYPEName: '', BUSITYPEName: '',
amount: '' amount: ''
}, },
saveForm: {
SPXX: [
{ EXAMDATE: '', EXAMROLE: '', OPERATOR: '', EXAMOPINION: '', EXAMRESULT: '' }
],
PARTIESAUTHORIZED: '',
PERFORMSCHEDULE: '',
SignOptions: [
// { signName: '', sianID: '' }
],
HTDFXX: [{
ISSQR: '',
ISYZDW: '',
UNITID: '',
UNITNAME: '',
ORGUNITID: '',
ORGUNITNAME: '',
AUTHORIZEDNAME: '',
incomeArray: [{ AUTHORIZEDNAMEChild: '', accessIdentify: '' }],
listHTDFXX: [], // 详情逗号分隔的list
finalList: []
}],
USERID: localStorage.getItem('UserID'),
// eslint-disable-next-line no-undef
BUSINESSTYPE: this.$route.query.idNumber,
BUSINESSTYPEName: this.$route.query.id,
ISSUPPLYCONTRACT: '0',
SUPCONMAINCODE: '',
CONNAMECN: '',
CONLANGUAGE: 'chi',
CONCODE: '',
CONNAME: '',
OPPOSITECONMAINCODE: '',
PROJNAME: '',
INCOMEEXPENDTYPE: '01',
CONSTATUS: '',
CONPERFORMCOUNTRY: '',
CONPERFORMPROVINCES: '',
CONPERFORMCITY: '',
CONPERFORMXIAN: '',
SIGNDATE: '',
PARTIESUNITID: '',
CONUNDERTAKERID: '',
CONUNDERTAKER: '',
CONUNDERTAKERCONTACT: '',
OID: '',
ONAME: '',
CONSUMMARY: '',
DISPUTESOLUTIONWAY: '',
CONMODELUSECONDITION: '',
SJLYDWID: '',
ACCOUNTUNITCODE: '',
CURRENCY: '156',
TAXRATE: '',
TAXAMT: '',
HSAMT: '',
HSBGAMT: '',
ISYZDW: '0',
TZXX: {
EXITDATE: '',
DEFECTPERIOD: '',
ISAGREEMENT: '',
PURCHASEMETHOD: '',
ISSFYDB: '',
GCWKYZFDATE: '',
PAYMENTMETHOD: '',
FINISHRULE: '',
FINISHRATIO: '',
PROGRESSRULE: '',
PROGRESSRATIO: '',
FINISHVERIFYMETHOD: '',
ISMATADJUSTMENT: '1',
BGBDWCDBFHTETAXAMT: '',
BGBDWCDBFHTETAX: '',
BGBDWCDHTEHSAMT: '',
BDWCDBFHTETAXAMT: '',
BDWCDBFHTETAX: '',
BDWCDHTEHSAMT: '',
ISCOALITION: '1',
PERIOD: '',
ENDDATE: '',
STARTDATE: '',
PAYAMT: '',
PAYRATIO: '',
CONTRACTPAYMENTTERMS: '',
INVOICETYPE: '',
PAYMETHOD: '',
ISSFYYFK: '1',
PAYRULE: '',
ISSFYBZJ: '1',
PAYMENTCURRENCY: '156',
RATEMETHOD: ''
},
HTDFXXHTDFXX: [
],
FKDWXX: [],
SKDWXX: [
// { PAYEE: '', PAYEEID: '', PAYEEACCOUNTYPE: '', PAYEEACCOUNNAME: '', PAYEEACCOUNBANK: '', PAYEEACCOUNNUMBER: '', BANKCOUNTRY: '', SWIFTCODE: '' }
],
BZJXX: [
],
DBXX: [
],
FJXX: [
{ BUSINESSID: '', BUSITYPE: '合同签订文本扫描件', FILENAME: '', FILESAVENAME: '' }
],
BUSITYPEName: '',
amount: ''
},
rules: { rules: {
FROMID: [{ required: true, message: '原系统合同 id', trigger: 'blur' }, { max: 64, message: '长度64个字符以内', trigger: 'blur' }], FROMID: [{ required: true, message: '原系统合同 id', trigger: 'blur' }, { max: 64, message: '长度64个字符以内', trigger: 'blur' }],
CONNAMECN: [{ required: true, message: '合同中文名称', trigger: 'blur' }, { max: 450, message: '长度450个字符以内', trigger: 'blur' }], CONNAMECN: [{ required: true, message: '合同中文名称', trigger: 'blur' }, { max: 450, message: '长度450个字符以内', trigger: 'blur' }],
...@@ -1836,6 +1944,25 @@ export default { ...@@ -1836,6 +1944,25 @@ export default {
this.getDetails() this.getDetails()
this.findMap() this.findMap()
}, },
beforeRouteLeave(to, from, next) {
if (this.agreeBack) { next() } else {
if (JSON.stringify(this.form) !== JSON.stringify(this.saveForm)) {
this.$confirm('您已经对信息进行了修改,离开后不会保存您所做的更改,是否确定离开?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
closeOnHashChange: false
}).then(() => {
this.agreeBack = true
this.$router.replace(to.path)
}).catch(() => {
})
} else {
this.agreeBack = true
this.$router.replace(to.fullPath)
}
}
},
methods: { methods: {
SPTime() { SPTime() {
const myDate = new Date() const myDate = new Date()
...@@ -1908,6 +2035,7 @@ export default { ...@@ -1908,6 +2035,7 @@ export default {
this.changeDom1() this.changeDom1()
this.isSup2() this.isSup2()
}) })
this.saveForm = JSON.parse(JSON.stringify(this.form))
} }
}, },
findMap() { findMap() {
......
...@@ -99,6 +99,24 @@ export default { ...@@ -99,6 +99,24 @@ export default {
ZETPSPROPERTY: '', ZETPSPROPERTY: '',
ZCOMPYREL: '', ZCOMPYREL: '',
ZBPNATURE: '' ZBPNATURE: ''
},
saveForm: {
phone: '',
ZBPNAME_ZH: '',
ZBPTYPE: '',
ZOIBC: '',
ZBPNAME_EN: '',
ZBPNAME_LOC: '',
ZUSCC: '',
ZBRNO: '',
ZTRNO: '',
ZOSRNO: '',
ZIDNO: '',
ZSSNO: '',
ZZCOUNTRY: '',
ZETPSPROPERTY: '',
ZCOMPYREL: '',
ZBPNATURE: ''
} }
} }
}, },
...@@ -107,9 +125,29 @@ export default { ...@@ -107,9 +125,29 @@ export default {
this.getDetail() this.getDetail()
} }
}, },
beforeRouteLeave(to, from, next) {
if (this.agreeBack) { next() } else {
if (JSON.stringify(this.form) !== JSON.stringify(this.saveForm)) {
this.$confirm('您已经对信息进行了修改,离开后不会保存您所做的更改,是否确定离开?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
closeOnHashChange: false
}).then(() => {
this.agreeBack = true
this.$router.replace(to.path)
}).catch(() => {
})
} else {
this.agreeBack = true
this.$router.replace(to.fullPath)
}
}
},
methods: { methods: {
getDetail() { getDetail() {
this.form = this.$route.query.data this.form = JSON.parse(JSON.stringify(this.$route.query.data))
this.saveForm = JSON.parse(JSON.stringify(this.$route.query.data))
} }
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment