+
-
+
取 消
- 确 定
+
+
+
+
@@ -207,6 +220,8 @@ export default {
data () {
return {
formType: 'add', //表单操作类型 add新增,edit编辑,detail详情
+ hideUploadEdit: false, // 隐藏'上传按钮'
+ limitNum: 1,
enterType: '1',//录入方式1 手动输入 2 选择居民
isFromResi: false,//是否从已有居民信息中选择
@@ -215,46 +230,54 @@ export default {
btnDisable: false,
- natId: '',
+ icNatId: '',
formData: {
+ icNatId: '',
+ agencyId: '',//当前网格所属组织Id
+ userId: '',//居民端小程序的用户id、数字社区的icResiUserId、其他情况无值
+ userType: 'icresi',//居民端小程序的人:resi;数字社区的居民:icresi;导入的:import;同步的:synchro
name: '',
idCard: '',
- phone: '',
- checkTime: '',
- address: '',
- result: '',
- noticeWay: [],
- noticeContent: '',
- attachmentList: []
+ mobile: '',
+ natTime: '',
+ natAddress: '',
+ natResult: '',
+ channel: [],
+ content: '',
+
+ fileName: '',//附件名
+ attachmentType: '',//附件类型((图片 - image、 视频 - video、 语音 - voice、 文档 - doc))
+ attachmentUrl: '',//附件地址
},
-
fileList: [],
uploadUlr: window.SITE_CONFIG['apiURL'] + '/oss/file/uploadvariedfile',
dialogImageUrl: '',
dialogVisible: false,
-
}
},
components: {},
async mounted () {
const { user } = this.$store.state
this.agencyId = user.agencyId
+ this.formData.agencyId = user.agencyId
//获取网格下拉框数据
await this.loadGrid()
},
methods: {
- async initForm (type, natId) {
+ async initForm (type, icNatId) {
this.startLoading()
this.$refs['ref_form'].resetFields();
this.formType = type
- if (natId) {
- this.natId = natId
- this.formData.id = natId
+
+ if (icNatId) {
+ this.icNatId = icNatId
+ this.formData.icNatId = icNatId
+ this.isFromResi = false
await this.loadFormData()
}
this.endLoading()
@@ -263,10 +286,10 @@ export default {
handleChangeEnterType (value) {
this.formData.name = ''
- this.formData.phone = ''
+ this.formData.mobile = ''
this.formData.idCard = ''
this.formData.gridId = ''
- this.formData.personId = ''
+ this.formData.userId = ''
if (value === '2') {
this.isFromResi = true
} else {
@@ -312,72 +335,52 @@ export default {
},
async handleSelPerson (personItem) {
+ this.formData.userId = personItem.demandUserId
this.formData.name = personItem.demandUserName
- this.formData.phone = personItem.demandUserMobile
+ this.formData.mobile = personItem.demandUserMobile
this.formData.idCard = personItem.idCard
-
-
},
-
- handleTime () {
- if (!this.formData.remindTime) return
- var startAt = new Date(this.formData.remindTime) * 1000 / 1000;
- if (startAt < Date.now()) {
- this.formData.remindTime = dateFormats('YYYY-mm-dd HH:MM', new Date());
- }
- },
-
-
async loadFormData () {
- // const url = 'http://yapi.elinkservice.cn/mock/245/gov/project/memoConcern'
- const url = '/gov/project/memoConcern'
+ // const url = 'http://yapi.elinkservice.cn/mock/245/epmetuser/icNat/detail'
+ const url = '/epmetuser/icNat/detail'
let params = {
- id: this.natId,
- readFlag: '0',
+ icNatId: this.icNatId,
}
const { data, code, msg } = await requestPost(url, params)
if (code === 0) {
this.formData = data
-
- if (data.attachmentList) {
- data.attachmentList.forEach(element => {
- element.name = element.fileName
- element.type = element.attachmentType
- element.size = element.attachmentSize
- });
- this.fileList = data.attachmentList
+ 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;
+
} else {
this.$message.error(msg)
}
},
- async handleComfirm () {
-
+ async handleComfirm () {
this.btnDisable = true
setTimeout(() => {
this.btnDisable = false
}, 5000)
- this.$refs['ref_form'].validate(async (valid, messageObj) => {
- if (!valid) {
- app.util.validateRule(messageObj)
- this.btnDisable = false
- } else {
-
- await this.addNat()
- }
-
- })
-
- },
- async addNat () {
- console.log(this.formData)
- return false
const regPhone = /^1(3|4|5|6|7|8|9)\d{9}$/; //手机号码
// if (regPhone.test(this.formData.mobile) === false) {
@@ -387,21 +390,26 @@ export default {
// message: '请输入正确的手机号码'
// })
// return false;
- // }
-
- if (this.fileList.length > 0) {
- this.formData.attachmentList = this.fileList
- }
+ // }
+ const regCard = /(^\d{15}$)|(^\d{17}(\d|X)$)/; //身份证号码为15位或者18位,15位时全为数字,18位前17位为数字,最后一位是校验位,可能为数字或字符X
+ // if (regCard.test(this.formData.idCard) === false) {
+ // this.btnDisable = false
+ // this.$message({
+ // type: 'warning',
+ // message: '请输入正确的身份证号码'
+ // })
+ // return false;
+ // }
let url = ''
if (this.formType === 'add') {
- url = '/gov/project/memoConcern/save'
- // url = "http://yapi.elinkservice.cn/mock/245/gov/project/memoConcern/save"
- this.formData.id = ''
+ url = '/epmetuser/icNat/add'
+ // url = "http://yapi.elinkservice.cn/mock/102/epmetuser/icNat/add"
+ this.formData.icNatId = ''
} else {
- url = '/gov/project/memoConcern/update'
- // url = "http://yapi.elinkservice.cn/mock/245/gov/project/memoConcern/update"
+ url = '/epmetuser/icNat/edit'
+ // url = "http://yapi.elinkservice.cn/mock/245/epmetuser/icNat/edit"
}
@@ -415,8 +423,7 @@ export default {
this.resetData()
this.$emit('dialogOk')
this.btnDisable = false
- this.$store.dispatch('setTipsList')
- this.$store.dispatch('setTipsTime')
+
} else {
this.btnDisable = false
this.$message.error(msg)
@@ -425,81 +432,85 @@ export default {
},
handleCancle () {
-
this.resetData()
this.$emit('dialogCancle')
},
+ 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 !== 'xls'
- && extension !== 'xlsx'
- && extension !== 'doc'
- && extension !== 'docx'
- && extension !== 'pdf') {
- this.$message.error('只能上传word、excel、pdf文件!')
+ // 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!')
- }
+ // if (!isLt1M) {
+ // this.$message.error('上传文件大小不能超过 5MB!')
+ // }
return isLt1M
},
- handleFileRemove (file) {
-
- if (file && file.status === "success") {
- this.fileList.splice(this.fileList.findIndex(item => item.uid === file.uid), 1)
- }
- },
-
handleFileSuccess (res, file) {
if (res.code === 0 && res.msg === 'success') {
const array = file.name.split('.')
const fileType = array[array.length - 1]
- file.fileName = file.name
- file.attachmentUrl = res.data.url
- file.attachmentSize = file.size
- file.attachmentType = 'doc'
+ this.formData.fileName = file.name
+ this.formData.attachmentUrl = res.data.url
+ this.formData.attachmentType = 'image'
+
file.attachmentFormat = fileType
+ file.attachmentSize = file.size
- this.fileList.push(file)
- console.log(this.fileList)
} else this.$message.error(res.msg)
},
- //下载
- handleFileDownload (file) {
-
- var a = document.createElement('a');
- var event = new MouseEvent('click');
- a.download = file.fileName;
- console.log(a)
- a.href = file.attachmentUrl;
- a.dispatchEvent(event);
-
-
- },
-
resetData () {
- this.natId = ''
+ this.icNatId = ''
+ this.fileList = []
+ this.hideUploadEdit = false
this.formData = {
+ icNatId: '',
+ agencyId: '',//当前网格所属组织Id
+ userId: '',//居民端小程序的用户id、数字社区的icResiUserId、其他情况无值
+ userType: 'icresi',//居民端小程序的人:resi;数字社区的居民:icresi;导入的:import;同步的:synchro
name: '',
idCard: '',
- phone: '',
- checkTime: '',
- address: '',
- result: '',
- noticeWay: [],
- noticeContent: '',
- attachmentList: []
+ mobile: '',
+ natTime: '',
+ natAddress: '',
+ natResult: '',
+ channel: [],
+ content: '',
+
+ fileName: '',//附件名
+ attachmentType: '',//附件类型((图片 - image、 视频 - video、 语音 - voice、 文档 - doc))
+ attachmentUrl: '',//附件地址
}
},
@@ -528,26 +539,26 @@ export default {
idCard: [
{ required: true, message: '身份证号不能为空', trigger: 'blur' }
],
- phone: [
+ mobile: [
{ required: true, message: '手机号不能为空', trigger: 'blur' },
],
- checkTime: [
+ natTime: [
{ required: true, message: '检测时间不能为空', trigger: 'blur' },
],
- address: [
+ natAddress: [
{ required: false },
],
- result: [
+ natResult: [
{ required: true },
],
- address: [
+ natAddress: [
{ required: false },
],
- noticeWay: [
+ channel: [
{ required: false },
],
- noticeContent: [
+ content: [
{ required: false },
],
@@ -572,4 +583,16 @@ export default {
@import "@/assets/scss/modules/management/epidemic.scss";
+
+
+
diff --git a/src/views/modules/base/epidemic/natInfo/natList.vue b/src/views/modules/base/epidemic/natInfo/natList.vue
index bca48bb5..5057e6a4 100644
--- a/src/views/modules/base/epidemic/natInfo/natList.vue
+++ b/src/views/modules/base/epidemic/natInfo/natList.vue
@@ -6,10 +6,22 @@
ref="ref_searchform"
:label-width="'90px'">
+
+
+
+
+
+
-
+
-
+ placeholder="请输入手机号">
-
-
-
-
+
+
+
-
- 查询
- 重置
+
+
+
+
+
+
+
+
+ 查询
+ 重置
+
@@ -97,11 +122,11 @@
type="index"
width="50">
-