|
|
@ -69,7 +69,7 @@ |
|
|
|
:disabled="isFromResi" |
|
|
|
v-model="formData.name" style="margin-right:10px;"> |
|
|
|
</el-input> |
|
|
|
<el-checkbox v-model="heSuanCheck">添加到核酸检测关注名单</el-checkbox> |
|
|
|
<el-checkbox v-model="formData.heSuanCheck">添加到核酸检测关注名单</el-checkbox> |
|
|
|
</el-form-item> |
|
|
|
|
|
|
|
<el-form-item label="手机号" |
|
|
@ -99,10 +99,14 @@ |
|
|
|
prop="presentAddress" |
|
|
|
style="display: block" |
|
|
|
label-width="150px"> |
|
|
|
<el-select class="item_width_2" |
|
|
|
<el-input v-if="isFromResi" class="item_width_2" |
|
|
|
placeholder="请输入现居地" |
|
|
|
clearable |
|
|
|
:disabled="isFromResi" |
|
|
|
v-model="formData.presentAddress" /> |
|
|
|
<el-select v-else class="item_width_2" |
|
|
|
v-model.trim="formData.presentAddress" |
|
|
|
placeholder="请选择" |
|
|
|
:disabled="isFromResi" |
|
|
|
filterable |
|
|
|
clearable> |
|
|
|
<el-option v-for="item in personList" |
|
|
@ -112,6 +116,7 @@ |
|
|
|
:value="item.demandUserId"> |
|
|
|
</el-option> |
|
|
|
</el-select> |
|
|
|
|
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="详细地址" |
|
|
|
prop="detailAddress" |
|
|
@ -129,7 +134,14 @@ |
|
|
|
prop="sourceAddress" |
|
|
|
style="display: block" |
|
|
|
label-width="150px"> |
|
|
|
<el-select class="item_width_2" |
|
|
|
<!-- <el-input class="item_width_2" |
|
|
|
placeholder="请输入来自地区" |
|
|
|
clearable |
|
|
|
:disabled="isFromResi" |
|
|
|
v-model="formData.sourceAddress"> |
|
|
|
</el-input> --> |
|
|
|
<el-cascader :props="areaProps"></el-cascader> |
|
|
|
<!-- <el-select class="item_width_2" |
|
|
|
v-model.trim="formData.sourceAddress" |
|
|
|
placeholder="请选择" |
|
|
|
filterable |
|
|
@ -140,7 +152,7 @@ |
|
|
|
:label="item.demandUserName" |
|
|
|
:value="item.demandUserId"> |
|
|
|
</el-option> |
|
|
|
</el-select> |
|
|
|
</el-select> --> |
|
|
|
</el-form-item> |
|
|
|
|
|
|
|
<el-form-item label="来到本地时间" |
|
|
@ -220,7 +232,7 @@ |
|
|
|
size="small" |
|
|
|
type="primary" |
|
|
|
:disabled="btnDisable" |
|
|
|
@click="handleComfirm">确 定</el-button> |
|
|
|
@click="handleComfirm('ref_form')">确 定</el-button> |
|
|
|
</div> |
|
|
|
|
|
|
|
<el-dialog :visible.sync="dialogVisible" |
|
|
@ -240,11 +252,31 @@ |
|
|
|
import { Loading } from 'element-ui' // 引入Loading服务 |
|
|
|
import { requestPost } from '@/js/dai/request' |
|
|
|
import { dateFormats } from '@/utils/index' |
|
|
|
|
|
|
|
import { isCard, isMobile } from '@/utils/validate' |
|
|
|
|
|
|
|
let loading // 加载动画 |
|
|
|
export default { |
|
|
|
data () { |
|
|
|
let checkMObile = (rule, value, callback) => { |
|
|
|
if (value === '') { |
|
|
|
callback(new Error('手机号不能为空')) |
|
|
|
} else { |
|
|
|
if (!isMobile(value)) { |
|
|
|
callback(new Error('手机号格式不正确')) |
|
|
|
} |
|
|
|
callback() |
|
|
|
} |
|
|
|
} |
|
|
|
let checkIdCard = (rule, value, callback) => { |
|
|
|
if (value === '') { |
|
|
|
callback(new Error('身份证不能为空')) |
|
|
|
} else { |
|
|
|
if (!isCard(value)) { |
|
|
|
callback(new Error('身份证号格式不正确')) |
|
|
|
} |
|
|
|
callback() |
|
|
|
} |
|
|
|
} |
|
|
|
return { |
|
|
|
formType: 'add', //表单操作类型 add新增,edit编辑,detail详情 |
|
|
|
hideUploadEdit: false, // 隐藏'上传按钮' |
|
|
@ -270,12 +302,14 @@ export default { |
|
|
|
presentAddress: '', |
|
|
|
presentAddressCode: '', |
|
|
|
detailAddress: '', |
|
|
|
sourceAddressCode: '', |
|
|
|
sourceAddress: '', |
|
|
|
sourceAddressCode: '370203', |
|
|
|
presentAddressPathCode: '', |
|
|
|
sourceAddress: '市北区', |
|
|
|
sourceAddressPathCode: '', |
|
|
|
arriveDate: '', |
|
|
|
remark: '', |
|
|
|
leaveDate: '', |
|
|
|
userType: '', |
|
|
|
userType: 'input', |
|
|
|
content: '', |
|
|
|
channel: [] |
|
|
|
|
|
|
@ -285,10 +319,10 @@ export default { |
|
|
|
{ required: true, message: '姓名不能为空', trigger: 'blur' } |
|
|
|
], |
|
|
|
idCard: [ |
|
|
|
{ required: true, message: '身份证号不能为空', trigger: 'blur' } |
|
|
|
{ validator: checkIdCard, trigger: 'blur' } |
|
|
|
], |
|
|
|
mobile: [ |
|
|
|
{ required: true, message: '手机号不能为空', trigger: 'blur' }, |
|
|
|
{ validator: checkMObile, trigger: 'blur' }, |
|
|
|
], |
|
|
|
presentAddress: [ |
|
|
|
{ required: true, message: '现居地不能为空', trigger: 'blur' }, |
|
|
@ -303,11 +337,10 @@ export default { |
|
|
|
{ required: true, message: '来到本地时间不能为空', trigger: 'blur' }, |
|
|
|
] |
|
|
|
}, |
|
|
|
|
|
|
|
fileList: [], |
|
|
|
uploadUlr: window.SITE_CONFIG['apiURL'] + '/oss/file/uploadvariedfile', |
|
|
|
dialogImageUrl: '', |
|
|
|
dialogVisible: false, |
|
|
|
areaProps: { |
|
|
|
lazy: true, |
|
|
|
lazyLoad: this.lzayLoadArea |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
}, |
|
|
@ -320,22 +353,21 @@ export default { |
|
|
|
}, |
|
|
|
|
|
|
|
methods: { |
|
|
|
|
|
|
|
async initForm (type, icNatId) { |
|
|
|
|
|
|
|
lzayLoadArea(node, resolve) { |
|
|
|
this.getArea(node, resolve) |
|
|
|
}, |
|
|
|
async initForm (type, row) { |
|
|
|
console.log('row----', row) |
|
|
|
if (type != 'add') { |
|
|
|
this.formData = { ...row, channel: [], content: '' } |
|
|
|
if (row.userType == 'icresi') this.isFromResi = true |
|
|
|
} |
|
|
|
this.formData.agencyId = this.agencyId |
|
|
|
|
|
|
|
this.$refs['ref_form'].resetFields(); |
|
|
|
// this.$refs['ref_form'].resetFields(); |
|
|
|
|
|
|
|
this.formType = type |
|
|
|
|
|
|
|
if (icNatId) { |
|
|
|
this.icNatId = icNatId |
|
|
|
this.formData.icNatId = icNatId |
|
|
|
this.isFromResi = false |
|
|
|
await this.loadFormData() |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
@ -347,8 +379,10 @@ export default { |
|
|
|
this.formData.userId = '' |
|
|
|
if (value === '2') { |
|
|
|
this.isFromResi = true |
|
|
|
this.formData.userType = 'icresi' |
|
|
|
} else { |
|
|
|
this.isFromResi = false |
|
|
|
this.formData.userType = 'input' |
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
@ -388,12 +422,54 @@ export default { |
|
|
|
this.$message.error(msg) |
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
async getArea (node, resolve) { |
|
|
|
|
|
|
|
const url = "/commonservice/areacode/nextarea" |
|
|
|
|
|
|
|
let params = { |
|
|
|
parentLevel: this.agencyId, |
|
|
|
parentAreaCode: node.data ? node.data.value : '' |
|
|
|
} |
|
|
|
|
|
|
|
const { data, code, msg } = await requestPost(url, params) |
|
|
|
|
|
|
|
if (code === 0) { |
|
|
|
const nodes = data.map(item => ({ |
|
|
|
value: item.areaCode, // |
|
|
|
label: item.areaName, |
|
|
|
code1: item.parentCode, |
|
|
|
leaf: node.level >= 5 // 5层级 |
|
|
|
})) |
|
|
|
resolve(nodes) |
|
|
|
|
|
|
|
} else { |
|
|
|
this.$message.error(msg) |
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
async handleSelAddress(value) { |
|
|
|
|
|
|
|
const url = "/gov/org/house/gethouseinfo/" + value |
|
|
|
|
|
|
|
const { data, code, msg } = await requestPost(url) |
|
|
|
|
|
|
|
if (code === 0) { |
|
|
|
this.formData.presentAddress = data.agencyPathName |
|
|
|
this.formData.presentAddressCode = data.areaCode |
|
|
|
this.formData.detailAddress = data.allName |
|
|
|
|
|
|
|
} else { |
|
|
|
this.$message.error(msg) |
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
async handleSelPerson (personItem) { |
|
|
|
this.formData.userId = personItem.demandUserId |
|
|
|
this.formData.name = personItem.demandUserName |
|
|
|
this.formData.mobile = personItem.demandUserMobile |
|
|
|
this.formData.idCard = personItem.idCard |
|
|
|
this.handleSelAddress(personItem.houseId) |
|
|
|
}, |
|
|
|
|
|
|
|
async loadFormData () { |
|
|
@ -431,28 +507,9 @@ export default { |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
async handleComfirm () { |
|
|
|
|
|
|
|
|
|
|
|
const regPhone = /^1(3|4|5|6|7|8|9)\d{9}$/; //手机号码 |
|
|
|
if (regPhone.test(this.formData.mobile) === false) { |
|
|
|
this.btnDisable = false |
|
|
|
this.$message({ |
|
|
|
type: 'warning', |
|
|
|
message: '请输入正确的手机号码' |
|
|
|
}) |
|
|
|
return false; |
|
|
|
} |
|
|
|
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; |
|
|
|
} |
|
|
|
|
|
|
|
async handleComfirm (formName) { |
|
|
|
this.$refs[formName].validate(async (valid) => { |
|
|
|
if (valid) { |
|
|
|
if (this.formData.channel.length > 0 && !this.formData.content) { |
|
|
|
this.$message({ |
|
|
|
type: 'warning', |
|
|
@ -467,16 +524,8 @@ export default { |
|
|
|
}, 5000) |
|
|
|
|
|
|
|
let url = '' |
|
|
|
if (this.formType === 'add') { |
|
|
|
url = '/epmetuser/icNat/add' |
|
|
|
// url = "http://yapi.elinkservice.cn/mock/102/epmetuser/icNat/add" |
|
|
|
this.formData.icNatId = '' |
|
|
|
|
|
|
|
} else { |
|
|
|
url = '/epmetuser/icNat/edit' |
|
|
|
// url = "http://yapi.elinkservice.cn/mock/245/epmetuser/icNat/edit" |
|
|
|
} |
|
|
|
|
|
|
|
if (this.formType === 'add') url = '/epmetuser/tripreport/save' |
|
|
|
else url = '/epmetuser/tripreport/update' |
|
|
|
|
|
|
|
const { data, code, msg } = await requestPost(url, this.formData) |
|
|
|
|
|
|
@ -493,6 +542,12 @@ export default { |
|
|
|
this.btnDisable = false |
|
|
|
this.$message.error(msg) |
|
|
|
} |
|
|
|
} else { |
|
|
|
console.log('error submit!!'); |
|
|
|
return false; |
|
|
|
} |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
@ -555,29 +610,11 @@ export default { |
|
|
|
}, |
|
|
|
|
|
|
|
resetData () { |
|
|
|
this.icNatId = '' |
|
|
|
this.fileList = [] |
|
|
|
this.hideUploadEdit = false |
|
|
|
|
|
|
|
this.formData = { |
|
|
|
icNatId: '', |
|
|
|
agencyId: '',//当前网格所属组织Id |
|
|
|
userId: '',//居民端小程序的用户id、数字社区的icResiUserId、其他情况无值 |
|
|
|
userType: 'icresi',//居民端小程序的人:resi;数字社区的居民:icresi;导入的:import;同步的:synchro |
|
|
|
name: '', |
|
|
|
idCard: '', |
|
|
|
mobile: '', |
|
|
|
natTime: '', |
|
|
|
natAddress: '', |
|
|
|
natResult: '', |
|
|
|
channel: [], |
|
|
|
content: '', |
|
|
|
|
|
|
|
fileName: '',//附件名 |
|
|
|
attachmentType: '',//附件类型((图片 - image、 视频 - video、 语音 - voice、 文档 - doc)) |
|
|
|
attachmentUrl: '',//附件地址 |
|
|
|
|
|
|
|
} |
|
|
|
this.$refs.ref_form.resetFields() |
|
|
|
this.formData.sourceAddressCode = '' |
|
|
|
this.formData.presentAddressCode = '' |
|
|
|
this.formData.sourceAddressPathCode = '' |
|
|
|
this.formData.presentAddressPathCode = '' |
|
|
|
}, |
|
|
|
// 开启加载动画 |
|
|
|
startLoading () { |
|
|
|