|
@ -346,21 +346,20 @@ export default { |
|
|
return w + 'px' |
|
|
return w + 'px' |
|
|
}, |
|
|
}, |
|
|
lzayLoadArea(node, resolve) { |
|
|
lzayLoadArea(node, resolve) { |
|
|
this.getArea(node, resolve) |
|
|
// this.getArea(node, resolve) |
|
|
// setTimeout(() => { |
|
|
setTimeout(() => { |
|
|
|
|
|
this.getArea(node, resolve) |
|
|
// }, 1000) |
|
|
}, 200) |
|
|
}, |
|
|
}, |
|
|
async initForm (type, row) { |
|
|
async initForm (type, row) { |
|
|
console.log('row----', row) |
|
|
console.log('row----', row) |
|
|
this.formType = type |
|
|
this.formType = type |
|
|
this.formData.agencyId = this.agencyId |
|
|
this.formData.agencyId = this.agencyId |
|
|
if (type != 'add') { |
|
|
if (type != 'add') { |
|
|
this.formData = { ...row, channel: [], content: '' } |
|
|
// this.formData = { ...row, channel: [], content: '' } |
|
|
this.sourceAllCode = row.sourceAddressPathCode && row.sourceAddressPathCode.split(',') |
|
|
await this.loadFormData(row.id) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (row.userType == 'icresi') this.isFromResi = true |
|
|
|
|
|
else this.nowAllCode = row.presentAddressPathCode && row.presentAddressPathCode.split(',') |
|
|
|
|
|
} else { |
|
|
} else { |
|
|
const { user } = this.$store.state |
|
|
const { user } = this.$store.state |
|
|
this.nowAllCode = user.areaCodePath |
|
|
this.nowAllCode = user.areaCodePath |
|
@ -507,35 +506,20 @@ export default { |
|
|
this.handleSelAddress(personItem.houseId) |
|
|
this.handleSelAddress(personItem.houseId) |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
async loadFormData () { |
|
|
async loadFormData (id) { |
|
|
|
|
|
|
|
|
// const url = 'http://yapi.elinkservice.cn/mock/245/epmetuser/icNat/detail' |
|
|
const url = '/epmetuser/tripreport/detail' |
|
|
const url = '/epmetuser/icNat/detail' |
|
|
|
|
|
let params = { |
|
|
let params = { |
|
|
icNatId: this.icNatId, |
|
|
id, |
|
|
} |
|
|
} |
|
|
const { data, code, msg } = await requestPost(url, params) |
|
|
const { data, code, msg } = await requestPost(url, params) |
|
|
if (code === 0) { |
|
|
if (code === 0) { |
|
|
this.formData = data |
|
|
console.log('deda-------', data) |
|
|
this.formData.icNatId = this.icNatId |
|
|
this.formData = { ...data, channel: [], content: '' } |
|
|
this.fileList = [] |
|
|
this.sourceAllCode = data.sourceAddressPathCode && data.sourceAddressPathCode.split(',') |
|
|
if (data.fileName) { |
|
|
|
|
|
let obj = { |
|
|
if (data.userType == 'icresi') this.isFromResi = true |
|
|
name: data.fileName, |
|
|
else this.nowAllCode = data.presentAddressPathCode && data.presentAddressPathCode.split(',') |
|
|
type: data.attachmentType, |
|
|
|
|
|
url: data.attachmentUrl, |
|
|
|
|
|
} |
|
|
|
|
|
// data.attachmentList.forEach(element => { |
|
|
|
|
|
// element.name = element.fileName |
|
|
|
|
|
// element.type = element.attachmentType |
|
|
|
|
|
// element.size = element.attachmentSize |
|
|
|
|
|
// }); |
|
|
|
|
|
this.fileList.push(obj) |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
this.hideUploadEdit = this.fileList.length >= this.limitNum; |
|
|
|
|
|
|
|
|
|
|
|
} else { |
|
|
} else { |
|
|
this.$message.error(msg) |
|
|
this.$message.error(msg) |
|
|
} |
|
|
} |
|
@ -592,58 +576,6 @@ export default { |
|
|
|
|
|
|
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
handleRemove (file, fileList) { |
|
|
|
|
|
this.hideUploadEdit = fileList.length >= this.limitNum; |
|
|
|
|
|
this.formData.fileName = '' |
|
|
|
|
|
this.formData.attachmentUrl = '' |
|
|
|
|
|
this.formData.attachmentType = '' |
|
|
|
|
|
this.fileList = [] |
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
|
handlePictureCardPreview (file) { |
|
|
|
|
|
this.dialogImageUrl = file.url; |
|
|
|
|
|
this.dialogVisible = true; |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
handleEditChange (file, fileList) { |
|
|
|
|
|
this.hideUploadEdit = fileList.length >= this.limitNum; |
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
beforeUpload (file) { |
|
|
|
|
|
const array = file.name.split('.') |
|
|
|
|
|
const extension = array[array.length - 1] |
|
|
|
|
|
// const isLt1M = (file.size / 1024 / 1024) < 5 |
|
|
|
|
|
if (extension !== 'jpg' |
|
|
|
|
|
&& extension !== 'png' |
|
|
|
|
|
&& extension !== 'gif' |
|
|
|
|
|
) { |
|
|
|
|
|
this.$message.error('只能上传jpg、png、gif文件!') |
|
|
|
|
|
return false |
|
|
|
|
|
} |
|
|
|
|
|
// if (!isLt1M) { |
|
|
|
|
|
// this.$message.error('上传文件大小不能超过 5MB!') |
|
|
|
|
|
// } |
|
|
|
|
|
// return isLt1M |
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
handleFileSuccess (res, file) { |
|
|
|
|
|
|
|
|
|
|
|
if (res.code === 0 && res.msg === 'success') { |
|
|
|
|
|
const array = file.name.split('.') |
|
|
|
|
|
const fileType = array[array.length - 1] |
|
|
|
|
|
|
|
|
|
|
|
this.formData.fileName = file.name |
|
|
|
|
|
this.formData.attachmentUrl = res.data.url |
|
|
|
|
|
this.formData.attachmentType = 'image' |
|
|
|
|
|
|
|
|
|
|
|
file.attachmentFormat = fileType |
|
|
|
|
|
file.attachmentSize = file.size |
|
|
|
|
|
|
|
|
|
|
|
} else this.$message.error(res.msg) |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
resetData () { |
|
|
resetData () { |
|
|
this.$refs.ref_form.resetFields() |
|
|
this.$refs.ref_form.resetFields() |
|
|
this.formData.sourceAddressCode = '' |
|
|
this.formData.sourceAddressCode = '' |
|
|