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. 88
      src/views/modules/base/huji/immigration/edit.vue
  2. 141
      src/views/modules/base/huji/immigration/index.vue

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

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

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

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

Loading…
Cancel
Save