添加注释, 优化代码

This commit is contained in:
mengxiaolong
2020-09-17 15:23:48 +08:00
parent 52ff285e38
commit 1f426eb9c1
2 changed files with 11 additions and 10 deletions

View File

@@ -395,17 +395,21 @@ export default {
async submit() {
// 校验回复内容
if (this.issueType === 'TB89') {
if (this.newContract.feedback.trim() === '') return this.$toast('请填写具体回复信息')
if (this.newContract.feedback.trim().length < 4 || this.newContract.feedback.trim().length > 400) return this.$toast('请输入4-400个字符')
let reply = this.newContract.feedback.trim()
if (reply === '') return this.$toast('请填写具体回复信息')
if (reply.length < 4 || reply.length > 400) return this.$toast('请输入4-400个字符')
}
// 校验补充资料
if (this.issueType === '828601') {
if (!this.checkSupplementData()) return this.$toast('请上传补充资料')
if (!this.checked) {
return this.$toast('请先阅读并勾选协议')
}
this.$toast.loading()
this.imageResultList.splice(0)
/**
* 上传补充资料
* 微信端特殊处理:
* 因为微信端签名会跳转页面, 为了签名回跳回显用户填过的信息, 用户填写过的信息都会被保存在localstorage中
* 补充资料图片是以base64格式存储, 所以需要转换为file之后再上传
*/
if (this.isWeixin) {
for (let image of this.imageList) {
let file = this.dataURLtoFile(image.content, '.png')
@@ -621,6 +625,7 @@ export default {
async created() {
// 问题件类型
this.issueType = this.$route.params.type
// 根据问题件类型修改标题
if (this.issueType === 'TB89') {
document.title = '新契约基本问题件通知书'
} else if (this.issueType === '818901') {