Browse Source

Merge branch 'dev-0420' of http://git.elinkit.com.cn:7070/r/epmet-oper-gov into dev-0420

shibei_master
dai 3 years ago
parent
commit
067f63fc32
  1. 6
      src/views/components/rangeInput.vue
  2. 96
      src/views/modules/base/epidemic/travelForm.vue

6
src/views/components/rangeInput.vue

@ -102,9 +102,9 @@ export default {
display: flex;
align-items: center;
}
.wd50 {
// width: 45%;
}
// .wd50 {
// // width: 45%;
// }
.demo-form-inline {
::v-deep .el-form-item {
width: 40%;

96
src/views/modules/base/epidemic/travelForm.vue

@ -346,21 +346,20 @@ export default {
return w + 'px'
},
lzayLoadArea(node, resolve) {
// this.getArea(node, resolve)
setTimeout(() => {
this.getArea(node, resolve)
// setTimeout(() => {
// }, 1000)
}, 200)
},
async initForm (type, row) {
console.log('row----', row)
this.formType = type
this.formData.agencyId = this.agencyId
if (type != 'add') {
this.formData = { ...row, channel: [], content: '' }
this.sourceAllCode = row.sourceAddressPathCode && row.sourceAddressPathCode.split(',')
// this.formData = { ...row, channel: [], content: '' }
await this.loadFormData(row.id)
if (row.userType == 'icresi') this.isFromResi = true
else this.nowAllCode = row.presentAddressPathCode && row.presentAddressPathCode.split(',')
} else {
const { user } = this.$store.state
this.nowAllCode = user.areaCodePath
@ -507,35 +506,20 @@ export default {
this.handleSelAddress(personItem.houseId)
},
async loadFormData () {
async loadFormData (id) {
// const url = 'http://yapi.elinkservice.cn/mock/245/epmetuser/icNat/detail'
const url = '/epmetuser/icNat/detail'
const url = '/epmetuser/tripreport/detail'
let params = {
icNatId: this.icNatId,
id,
}
const { data, code, msg } = await requestPost(url, params)
if (code === 0) {
this.formData = data
this.formData.icNatId = this.icNatId
this.fileList = []
if (data.fileName) {
let obj = {
name: data.fileName,
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;
console.log('deda-------', data)
this.formData = { ...data, channel: [], content: '' }
this.sourceAllCode = data.sourceAddressPathCode && data.sourceAddressPathCode.split(',')
if (data.userType == 'icresi') this.isFromResi = true
else this.nowAllCode = data.presentAddressPathCode && data.presentAddressPathCode.split(',')
} else {
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 () {
this.$refs.ref_form.resetFields()
this.formData.sourceAddressCode = ''

Loading…
Cancel
Save