Browse Source

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

shibei_master
jiangyy 3 years ago
parent
commit
d83a757a4c
  1. 90
      src/views/modules/base/huji/immigration/edit.vue
  2. 157
      src/views/modules/base/huji/immigration/index.vue

90
src/views/modules/base/huji/immigration/edit.vue

@ -123,8 +123,6 @@
>
<el-input
class="item_width_1"
maxlength="50"
show-word-limit
style="margin-right: 20px"
placeholder="请输入姓名 "
v-model="fmData.name"
@ -213,16 +211,16 @@
</el-form-item>
<el-form-item
label="迁入时间"
label="迁入日期"
prop="inTime"
label-width="150px"
style="display: block"
>
<el-date-picker
v-model="fmData.inTime"
type="date"
type="datetime"
placeholder="迁入时间"
value-format="yyyy-MM-dd"
value-format="yyyy-MM-dd HH:mm:ss"
class="item_width_1"
>
</el-date-picker>
@ -288,27 +286,26 @@
<el-form-item
label="户主姓名"
prop="houseHolderName"
prop="householderName"
label-width="150px"
style="display: block"
>
<el-input
class="item_width_1"
placeholder="请输入户主姓名"
:disabled="fmData.alreadyHaveMaster"
v-model="fmData.houseName"
v-model="fmData.householderName"
>
</el-input>
</el-form-item>
<el-form-item
label="与户主关系"
prop="houseHolderRelation"
prop="householderRelation"
label-width="150px"
style="display: block"
>
<el-select
v-model.trim="fmData.houseRelation"
v-model.trim="fmData.householderRelation"
placeholder="与户主关系"
size="small"
clearable
@ -365,9 +362,11 @@ function iniFmData() {
address: '',
sourceAddressPathCode: '',
sourceAddressCode: '',
houseName: '',
houseRelation: '',
alreadyHaveMaster: false
householderName: '',
moveNumber: '',
householderRelation: '',
alreadyHaveMaster: false,
isReplace: '0'
}
}
@ -401,7 +400,8 @@ export default {
// checkStrictly: true,
lazy: true,
lazyLoad: this.lzayLoadArea
}
},
userInfo: {}
}
},
components: {},
@ -489,7 +489,9 @@ export default {
type: 'error',
message: `请联系${data.resiAgencyName}迁出该居民后操作`
})
this.btnDisable = true
}
this.userInfo = { ...data }
} else {
this.$message.error(msg)
}
@ -500,15 +502,15 @@ export default {
console.log('label-----', this.$refs.nowArea.getCheckedNodes())
if (val.length > 0) {
const labels = this.$refs.nowArea.getCheckedNodes()[0].pathLabels
this.fmData.presentAddressCode = val[val.length - 1]
this.fmData.presentAddress = labels.join('-')
this.fmData.presentAddressPathCode = val.join(',')
console.log('presentAddress', this.formData.presentAddress)
this.$refs.ref_form.clearValidate('presentAddress')
this.fmData.sourceAddressCode = val[val.length - 1]
this.fmData.sourceAddress = labels.join('-')
this.fmData.sourceAddressPathCode = val.join(',')
console.log('sourceAddress', this.fmData.sourceAddressPathCode)
this.$refs.ref_form.clearValidate('sourceAddress')
} else {
this.fmData.presentAddressCode = ''
this.fmData.presentAddress = ''
this.fmData.presentAddressPathCode = ''
this.fmData.sourceAddressCode = ''
this.fmData.sourceAddress = ''
this.fmData.sourceAddressPathCode = ''
}
},
handleBlurId(val) {
@ -707,9 +709,10 @@ export default {
return this.$message.error(res.msg)
} else {
console.log('获取户主信息成功', res.data)
const { name } = res.data
if (name) {
this.fmData.houseHolderName = name
if (res.data) {
const { name } = res.data
this.fmData.householderName = name
this.alreadyHaveMaster = true
} else {
this.alreadyHaveMaster = false
@ -725,8 +728,14 @@ export default {
this.$refs.ref_form.resetFields()
this.formType = type
if (id) {
this.getDatail(id)
await this.getDatail(id)
}
if (this.formType != 'add') {
this.getBuildList()
this.getUniList()
this.getHouseList()
}
},
async getDatail(moveInId) {
@ -735,17 +744,18 @@ export default {
const params = {
moveInId: moveInId || ''
}
const { data, code, msg } = await requestPost(url, this.fmData)
const { data, code, msg } = await requestPost(url, params)
if (code === 0) {
this.fmData = { ...data }
this.nowAllCode = data.sourceAddressPathCode && data.sourceAddressPathCode.split(',')
} else this.$message.error(msg)
},
async handleComfirm() {
this.btnDisable = true
setTimeout(() => {
this.btnDisable = false
}, 10000)
// setTimeout(() => {
// this.btnDisable = false
// }, 10000)
this.$refs['ref_form'].validate((valid, messageObj) => {
if (!valid) {
app.util.validateRule(messageObj)
@ -763,9 +773,27 @@ export default {
},
async submit() {
if (this.fmData.isCHeck && this.userInfo && this.userInfo.resiHomeId) {
const { user } = this.$store.state
if (user.agencyId == this.userInfo.resiAgencyId) {
if (this.userInfo.resiHomeId !== this.fmData.homeId) {
this.$confirm('居民信息中房屋信息与当前选择房屋不一致,是否更新?', '提示', {
confirmButtonText: '更新',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.fmData.isReplace = '1'
}).catch(() => {
this.fmData.isReplace = '0'
});
return
}
}
}
let url = ''
if (this.formType === 'add') {
url = '/epmetuser/icMoveIn/save'
url = '/epmetuser/icMoveIn/add'
} else {
url = '/epmetuser/icMoveIn/edit'

157
src/views/modules/base/huji/immigration/index.vue

@ -235,7 +235,7 @@
border
style="width: 100%"
class="resi-table"
:height="maxTableHeight"
:height="tableHeight"
>
<el-table-column
label="序号"
@ -269,13 +269,12 @@
</el-table-column>
<el-table-column
prop="homeName"
prop="allName"
label="所属房屋"
align="center"
min-width="160"
:show-overflow-tooltip="true"
>
</el-table-column>
/>
<el-table-column
prop="mobile"
@ -317,7 +316,7 @@
</el-table-column>
<el-table-column
prop="source"
prop="sourceAddress"
min-width="160"
align="center"
label="由何地迁入"
@ -333,7 +332,7 @@
</el-table-column>
<el-table-column
prop="houseName"
prop="householderName"
min-width="100"
align="center"
label="户主姓名"
@ -341,7 +340,7 @@
</el-table-column>
<el-table-column
prop="houseRelationName"
prop="householderRelationName"
align="center"
min-width="100"
label="与户主关系"
@ -432,7 +431,7 @@ export default {
openSearch: false,
formShow: false,
formTitle: '出生登记',
formTitle: '迁入登记',
pageNo: 1,
pageSize: window.localStorage.getItem('pageSize') || 20,
@ -475,18 +474,21 @@ export default {
importBtnTitle: '导入',
importLoading: false,
//
scoreDiaTitle: '积分记录',
scoreDiaShow: false
searchH: 0,
tableHeight: 0
}
},
computed: {
...mapGetters(['clientHeight', 'iframeHeight']),
maxTableHeight() {
return this.$store.state.inIframe
? this.clientHeight - 360 + this.iframeHeigh
: this.clientHeight - 360
console.log('computed-searchH---', this.searchH)
const h = this.clientHeight - this.searchH + this.iframeHeight
const _h = this.clientHeight - this.searchH
console.log('computed-searchH---_h', _h)
return this.$store.state.inIframe ? h : _h
},
...mapGetters(['clientHeight', 'iframeHeight']),
changeVDisabled() {
return !this.fmData.villageId
},
@ -506,12 +508,23 @@ export default {
this.fmData.startTime = ''
this.fmData.endTime = ''
}
},
searchH() {
const h = this.clientHeight - this.searchH + this.iframeHeight
const _h = this.clientHeight - this.searchH
console.log('computed-searchH---_h', _h)
this.$nextTick(() => {
this.tableHeight = this.$store.state.inIframe ? h : _h
})
}
},
mounted() {
this.getGridList()
this.getValiheList()
this.getTableData()
this.searchH = this.$refs.searchCard.$el.offsetHeight + 260
console.log('searchH----', this.$refs.searchCard.$el.offsetHeight)
},
methods: {
handleClearVillage() {
@ -796,38 +809,99 @@ export default {
async handleChu() {
const url =
'/heart/iccommunityselforganization/exportcommunityselforganization'
'/epmetuser/icMoveIn/export'
const { pageSize, pageNo, fmData } = this
axios({
url: window.SITE_CONFIG['apiURL'] + url,
method: 'post',
await this.$http({
method: 'POST',
url,
responseType: 'blob',
data: {
pageSize,
pageNo,
...fmData
},
responseType: 'blob'
}
})
.then((res) => {
let fileName = window.decodeURI(
res.headers['content-disposition'].split(';')[1].split('=')[1]
)
console.log('filename', fileName)
let blob = new Blob([res.data], { type: 'application/vnd.ms-excel' })
var url = window.URL.createObjectURL(blob)
var aLink = document.createElement('a')
aLink.style.display = 'none'
aLink.href = url
aLink.setAttribute('download', fileName)
document.body.appendChild(aLink)
aLink.click()
document.body.removeChild(aLink) //
window.URL.revokeObjectURL(url) //blob
.then(res => {
console.log('res----dddd', res)
// this.download(res.data, title + '.xls')
// this.getTemplateList()
// this.exportLoading = false
// if (res.data.code && res.data.code == 9999) {
// return this.$message.error(res.data.msg)
// }
this.formatData(res)
})
.catch((err) => {
console.log('获取导出情失败', err)
.catch(err => {
console.log('err', err)
this.exportLoading = false
return this.$message.error('网络错误')
})
// axios({
// url: window.SITE_CONFIG['apiURL'] + url,
// method: 'post',
// data: {
// pageSize,
// pageNo,
// ...fmData
// },
// responseType: 'blob'
// })
// .then((res) => {
// let fileName = window.decodeURI(
// res.headers['content-disposition'].split(';')[1].split('=')[1]
// )
// console.log('filename', fileName)
// let blob = new Blob([res.data], { type: 'application/vnd.ms-excel' })
// var url = window.URL.createObjectURL(blob)
// var aLink = document.createElement('a')
// aLink.style.display = 'none'
// aLink.href = url
// aLink.setAttribute('download', fileName)
// document.body.appendChild(aLink)
// aLink.click()
// document.body.removeChild(aLink) //
// window.URL.revokeObjectURL(url) //blob
// })
// .catch((err) => {
// console.log('', err)
// return this.$message.error('')
// })
},
formatData(res) {
const fileReader = new FileReader()
fileReader.onloadend = () => {
try {
const jsonData = JSON.parse(fileReader.result) //
//
console.log('jsonData---1', jsonData)
return this.$message.error(jsonData.msg)
} catch (err) { //
//
console.log('errr-----', err, this)
this.downloadFile(res)
}
}
fileReader.readAsText(res.data)
},
downloadFile(res) {
if (res.headers["content-disposition"]) {
let fileName = window.decodeURI(res.headers["content-disposition"].split(";")[1].split("=")[1])
console.log('filename', fileName)
let blob = new Blob([res.data], { type: 'application/vnd.ms-excel' })
var url = window.URL.createObjectURL(blob)
var aLink = document.createElement('a')
aLink.style.display = 'none'
aLink.href = url
aLink.setAttribute('download', fileName)
document.body.appendChild(aLink)
aLink.click()
document.body.removeChild(aLink) //
window.URL.revokeObjectURL(url) //blob
this.$message.success('导出成功')
this.$emit('close')
} else this.$message.error('下载失败')
},
async handleWatch(rowIndex) {
@ -923,9 +997,9 @@ export default {
overflow: visible;
}
.demo-form-inline .resi-cell {
display: flex;
align-items: center;
.demo-form-inline {
// display: flex;
// align-items: center;
// margin-bottom: 20px;
.resi-cell-label {
@ -965,6 +1039,7 @@ export default {
margin-right: 0;
}
}
.mt10 {
margin-top: 10px;
}

Loading…
Cancel
Save