4 changed files with 0 additions and 3618 deletions
@ -1,623 +0,0 @@ |
|||||
<template> |
|
||||
<div class="resi-container"> |
|
||||
<el-card class="resi-card"> |
|
||||
<el-row class="resi-row-box" |
|
||||
:class="openSearch && 'resi-row-more'"> |
|
||||
<el-row class="resi-row"> |
|
||||
<el-col :span="6"> |
|
||||
<div class="resi-cell"> |
|
||||
<div class="resi-cell-label">所属网格</div> |
|
||||
<div class="resi-cell-value"> |
|
||||
<el-select v-model.trim="form.GRID_ID" |
|
||||
placeholder="请选择" |
|
||||
size="small" |
|
||||
clearable |
|
||||
class="resi-cell-select" |
|
||||
@change="handleChangeGrid"> |
|
||||
<el-option v-for="item in optionsG" |
|
||||
:key="item.value" |
|
||||
:label="item.label" |
|
||||
:value="item.value"> |
|
||||
</el-option> |
|
||||
</el-select> |
|
||||
</div> |
|
||||
</div> |
|
||||
</el-col> |
|
||||
<el-col :span="18"> |
|
||||
<div class="resi-cell"> |
|
||||
<div class="resi-cell-label">所属房屋</div> |
|
||||
<div class="resi-cell-value"> |
|
||||
<el-select v-model.trim="form.VILLAGE_ID" |
|
||||
placeholder="请选择小区" |
|
||||
size="small" |
|
||||
clearable |
|
||||
class="resi-cell-select" |
|
||||
@clear="handleClearVillage" |
|
||||
@change="handleChangeV"> |
|
||||
<el-option v-for="item in optionsV" |
|
||||
:key="item.value" |
|
||||
:label="item.label" |
|
||||
:value="item.value"> |
|
||||
</el-option> |
|
||||
</el-select> |
|
||||
<el-select v-model.trim="form.BUILD_ID" |
|
||||
placeholder="楼号" |
|
||||
size="small" |
|
||||
clearable |
|
||||
style="width: 120px;" |
|
||||
class="resi-cell-select" |
|
||||
:disabled="changeVDisabled" |
|
||||
@clear="handleClearBuild" |
|
||||
@change="handleChangeB"> |
|
||||
<el-option v-for="item in optionsB" |
|
||||
:key="item.value" |
|
||||
:label="item.label" |
|
||||
:value="item.value"> |
|
||||
</el-option> |
|
||||
</el-select> |
|
||||
<el-select v-model.trim="form.UNIT_ID" |
|
||||
:disabled="changeBDisabled" |
|
||||
placeholder="单元" |
|
||||
size="small" |
|
||||
clearable |
|
||||
style="width: 120px;" |
|
||||
class="resi-cell-select" |
|
||||
@click="handleClearDan" |
|
||||
@change="handleChangeD"> |
|
||||
<el-option v-for="item in optionsD" |
|
||||
:key="item.value" |
|
||||
:label="item.label" |
|
||||
:value="item.value"> |
|
||||
</el-option> |
|
||||
</el-select> |
|
||||
<el-select v-model.trim="form.HOME_ID" |
|
||||
:disabled="changeDDisabled" |
|
||||
placeholder="房号" |
|
||||
size="small" |
|
||||
clearable |
|
||||
style="width: 120px;" |
|
||||
class="resi-cell-select"> |
|
||||
<el-option v-for="item in optionsH" |
|
||||
:key="item.value" |
|
||||
:label="item.label" |
|
||||
:value="item.value"> |
|
||||
</el-option> |
|
||||
</el-select> |
|
||||
</div> |
|
||||
</div> |
|
||||
</el-col> |
|
||||
</el-row> |
|
||||
<el-row v-for="(item, index) in sliceList(formList, 4)" |
|
||||
:key="index" |
|
||||
class="resi-row"> |
|
||||
<el-col v-for="n in item" |
|
||||
:key="n.id" |
|
||||
:span="6"> |
|
||||
<div class="resi-cell"> |
|
||||
<div class="resi-cell-label">{{ n.label }}</div> |
|
||||
<div class="resi-cell-value" |
|
||||
:class="n.itemType === 'radio' && 'resi-cell-value-radio'"> |
|
||||
<el-input v-if="n.itemType === 'input' || n.itemType === 'textarea'" |
|
||||
v-model.trim="form[n.columnName]" |
|
||||
class="resi-cell-input" |
|
||||
size="small" |
|
||||
clearable |
|
||||
placeholder="请输入内容"> |
|
||||
</el-input> |
|
||||
<template v-else-if="n.itemType === 'datepicker'"> |
|
||||
<el-date-picker v-if="n.queryType === 'daterange'" |
|
||||
v-model.trim="form[n.columnName]" |
|
||||
type="daterange" |
|
||||
align="right" |
|
||||
unlink-panels |
|
||||
range-separator="至" |
|
||||
start-placeholder="开始日期" |
|
||||
end-placeholder="结束日期" |
|
||||
class="resi-cell--daterange" |
|
||||
size="small" |
|
||||
format="yyyy-MM-dd" |
|
||||
value-format="yyyy-MM-dd"> |
|
||||
</el-date-picker> |
|
||||
<el-date-picker v-else |
|
||||
v-model.trim="form[n.columnName]" |
|
||||
class="resi-cell-input" |
|
||||
type="date" |
|
||||
size="small" |
|
||||
clearable |
|
||||
format="yyyy-MM-dd" |
|
||||
value-format="yyyy-MM-dd" |
|
||||
placeholder="选择日期"> |
|
||||
</el-date-picker> |
|
||||
</template> |
|
||||
<el-select v-else-if="n.itemType === 'select' || n.itemType === 'radio'" |
|
||||
v-model.trim="form[n.columnName]" |
|
||||
placeholder="请选择" |
|
||||
size="small" |
|
||||
clearable |
|
||||
class="resi-cell-select"> |
|
||||
<el-option v-for="item in n.options" |
|
||||
:key="item.value" |
|
||||
:label="item.label" |
|
||||
:value="item.value"> |
|
||||
</el-option> |
|
||||
</el-select> |
|
||||
<el-cascader v-else-if="n.itemType === 'cascader'" |
|
||||
v-model.trim="form[n.columnName]" |
|
||||
:options="n.options" |
|
||||
:props="{ checkStrictly: true }" |
|
||||
clearable |
|
||||
size="small" |
|
||||
class="resi-cell-select"> |
|
||||
</el-cascader> |
|
||||
</div> |
|
||||
</div> |
|
||||
</el-col> |
|
||||
</el-row> |
|
||||
</el-row> |
|
||||
<el-row class="resi-search"> |
|
||||
<!-- <el-col :span="20"> |
|
||||
<el-button type="primary" size="mini">查询</el-button> |
|
||||
</el-col> --> |
|
||||
<el-col :span="24"> |
|
||||
<el-button type="primary" |
|
||||
size="small" |
|
||||
@click="handleSearch">查询</el-button> |
|
||||
<el-button class="diy-button--reset" |
|
||||
size="small" |
|
||||
@click="resetForm">重置</el-button> |
|
||||
</el-col> |
|
||||
</el-row> |
|
||||
<div class="resi-down" |
|
||||
@click="handleOpenSearch"> |
|
||||
<img v-if="openSearch" |
|
||||
src="../../assets/img/arrow-up.png" /> |
|
||||
<img v-else |
|
||||
src="../../assets/img/arrow-down.png" /> |
|
||||
</div> |
|
||||
</el-card> |
|
||||
</div> |
|
||||
</template> |
|
||||
|
|
||||
<script> |
|
||||
export default { |
|
||||
name: 'DeathSearch', |
|
||||
props: { |
|
||||
formList: { |
|
||||
type: Array, |
|
||||
default: () => [] |
|
||||
}, |
|
||||
columnName: { |
|
||||
type: String, |
|
||||
default: '' |
|
||||
} |
|
||||
}, |
|
||||
data () { |
|
||||
let initForm = (arr, columnName) => { |
|
||||
let _form = {} |
|
||||
// console.log('formInfo', obj) |
|
||||
// if (Object.keys(obj).length > 0) { |
|
||||
// _form = { ...obj } |
|
||||
// return _form |
|
||||
// } |
|
||||
arr.forEach((item) => { |
|
||||
if (columnName && columnName === item.columnName) _form[item.columnName] = '1' |
|
||||
else _form[item.columnName] = '' |
|
||||
}) |
|
||||
return _form |
|
||||
} |
|
||||
let form = initForm(this.formList, this.columnName) |
|
||||
let tempFormList = this.formList.map(item => { |
|
||||
|
|
||||
return { |
|
||||
...item, |
|
||||
isChange: this.columnName && this.columnName === item.columnName ? true : false |
|
||||
} |
|
||||
}) |
|
||||
let constForm = { |
|
||||
...form, |
|
||||
GRID_ID: '', |
|
||||
VILLAGE_ID: '', |
|
||||
BUILD_ID: '', |
|
||||
UNIT_ID: '', |
|
||||
HOME_ID: '' |
|
||||
} |
|
||||
return { |
|
||||
pageLoading: false, |
|
||||
openSearch: false, |
|
||||
optionsV: [], |
|
||||
optionsB: [], |
|
||||
optionsH: [], |
|
||||
optionsD: [], |
|
||||
optionsG: [], |
|
||||
value: '', |
|
||||
fixedList: [], |
|
||||
fixedForm: { |
|
||||
GRID_ID: '', |
|
||||
VILLAGE_ID: '', |
|
||||
BUILD_ID: '', |
|
||||
UNIT_ID: '', |
|
||||
HOME_ID: '' |
|
||||
}, |
|
||||
constForm, |
|
||||
form: { |
|
||||
...form, |
|
||||
GRID_ID: '', |
|
||||
VILLAGE_ID: '', |
|
||||
BUILD_ID: '', |
|
||||
UNIT_ID: '', |
|
||||
HOME_ID: '' |
|
||||
}, |
|
||||
tempFormList, |
|
||||
pickerOptions: { |
|
||||
shortcuts: [ |
|
||||
{ |
|
||||
text: '最近一周', |
|
||||
onClick (picker) { |
|
||||
const end = new Date() |
|
||||
const start = new Date() |
|
||||
start.setTime(start.getTime() - 3600 * 1000 * 24 * 7) |
|
||||
picker.$emit('pick', [start, end]) |
|
||||
} |
|
||||
}, |
|
||||
{ |
|
||||
text: '最近一个月', |
|
||||
onClick (picker) { |
|
||||
const end = new Date() |
|
||||
const start = new Date() |
|
||||
start.setTime(start.getTime() - 3600 * 1000 * 24 * 30) |
|
||||
picker.$emit('pick', [start, end]) |
|
||||
} |
|
||||
}, |
|
||||
{ |
|
||||
text: '最近三个月', |
|
||||
onClick (picker) { |
|
||||
const end = new Date() |
|
||||
const start = new Date() |
|
||||
start.setTime(start.getTime() - 3600 * 1000 * 24 * 90) |
|
||||
picker.$emit('pick', [start, end]) |
|
||||
} |
|
||||
} |
|
||||
] |
|
||||
} |
|
||||
} |
|
||||
}, |
|
||||
computed: { |
|
||||
sliceList () { |
|
||||
return function (data, count) { |
|
||||
if (data !== undefined) { |
|
||||
let index = 0 |
|
||||
let arrTemp = [] |
|
||||
for (let i = 0; i < data.length; i++) { |
|
||||
index = parseInt(i / count) |
|
||||
if (arrTemp.length <= index) { |
|
||||
arrTemp.push([]) |
|
||||
} |
|
||||
arrTemp[index].push(data[i]) |
|
||||
} |
|
||||
return arrTemp |
|
||||
} |
|
||||
} |
|
||||
}, |
|
||||
changeVDisabled () { |
|
||||
return !this.form.VILLAGE_ID |
|
||||
}, |
|
||||
changeBDisabled () { |
|
||||
return !this.form.BUILD_ID |
|
||||
}, |
|
||||
changeDDisabled () { |
|
||||
return !this.form.UNIT_ID |
|
||||
} |
|
||||
}, |
|
||||
watch: { |
|
||||
form: { |
|
||||
handler (val, val2) { |
|
||||
// console.log('valpppp----', val, val2) |
|
||||
for (let n in val) { |
|
||||
if (this.constForm[n] !== val[n]) { |
|
||||
this.handleChangeForm(n) |
|
||||
console.log('nnnnnn', n) |
|
||||
} |
|
||||
} |
|
||||
this.constForm = { ...val } |
|
||||
}, |
|
||||
deep: true |
|
||||
} |
|
||||
}, |
|
||||
created () { |
|
||||
// this.initForm() |
|
||||
// console.log('formcccc---', this.form) |
|
||||
this.getGridList() |
|
||||
this.getValiheList() |
|
||||
if (this.columnName) this.handleChangeForm(this.columnName) |
|
||||
}, |
|
||||
methods: { |
|
||||
initForm () { |
|
||||
this.formList.forEach((item) => { |
|
||||
this.$set(this.form, item.columnName, '') |
|
||||
}) |
|
||||
console.log('formcccc---', this.form) |
|
||||
}, |
|
||||
handleClearVillage () { |
|
||||
this.form.BUILD_ID = '' |
|
||||
this.form.HOME_ID = '' |
|
||||
}, |
|
||||
handleClearBuild () { |
|
||||
this.form.BUILD_ID = '' |
|
||||
this.form.UNIT_ID = '' |
|
||||
this.form.HOME_ID = '' |
|
||||
}, |
|
||||
handleClearDan () { |
|
||||
this.form.UNIT_ID = '' |
|
||||
this.form.HOME_ID = '' |
|
||||
}, |
|
||||
resetForm (formName) { |
|
||||
for (const n in this.form) { |
|
||||
this.form[n] = '' |
|
||||
} |
|
||||
this.handleSearch() |
|
||||
}, |
|
||||
handleSearch () { |
|
||||
// console.log('formmmmm---', this.form) |
|
||||
const itemTypes = ['daterange', 'timerange'] |
|
||||
let arr = this.tempFormList |
|
||||
.filter((n) => n.isChange) |
|
||||
.map((item) => { |
|
||||
return { |
|
||||
queryType: item.queryType, |
|
||||
tableName: item.tableName, |
|
||||
columnName: item.columnName, |
|
||||
// columnValue: [] |
|
||||
columnValue: |
|
||||
itemTypes.includes(item.queryType) || |
|
||||
itemTypes.includes(item.itemType) |
|
||||
? this.form[item.columnName] |
|
||||
: [this.form[item.columnName].toString()] |
|
||||
} |
|
||||
}) |
|
||||
let arr1 = this.fixedList |
|
||||
.filter((n) => n.columnValue.length > 0) |
|
||||
.map((item) => { |
|
||||
return { |
|
||||
...item |
|
||||
} |
|
||||
}) |
|
||||
let arr3 = [...arr1, ...arr] |
|
||||
this.$emit('search', arr3) |
|
||||
}, |
|
||||
handleOpenSearch () { |
|
||||
this.openSearch = !this.openSearch |
|
||||
}, |
|
||||
handleChangeGrid (val) { |
|
||||
console.log('val', val) |
|
||||
this.form.VILLAGE_ID = '' |
|
||||
this.form.BUILD_ID = '' |
|
||||
this.form.UNIT_ID = '' |
|
||||
this.form.HOME_ID = '' |
|
||||
this.getValiheList() |
|
||||
}, |
|
||||
handleChangeV (val) { |
|
||||
console.log('val', val) |
|
||||
this.form.BUILD_ID = '' |
|
||||
this.form.UNIT_ID = '' |
|
||||
this.form.HOME_ID = '' |
|
||||
this.getBuildList() |
|
||||
}, |
|
||||
handleChangeB (val) { |
|
||||
console.log('val', val) |
|
||||
this.form.UNIT_ID = '' |
|
||||
this.form.HOME_ID = '' |
|
||||
this.getUniList() |
|
||||
}, |
|
||||
handleChangeD (val) { |
|
||||
console.log('val', val) |
|
||||
this.form.HOME_ID = '' |
|
||||
this.getHouseList() |
|
||||
}, |
|
||||
// 监听基础form |
|
||||
handleChangeForm (val) { |
|
||||
for (let n in this.fixedForm) { |
|
||||
if (n === val) { |
|
||||
if (this.fixedList.length > 0) { |
|
||||
let _item = {} |
|
||||
let hasVal = false |
|
||||
this.fixedList.forEach((item, index) => { |
|
||||
if (item.columnName == val) { |
|
||||
hasVal = true |
|
||||
item.columnValue[0] = this.form[val] |
|
||||
if (!this.form[val]) this.fixedList.splice(index, 1) |
|
||||
console.log('fixedList----val', this.fixedList) |
|
||||
} else { |
|
||||
_item = { |
|
||||
queryType: 'equal', |
|
||||
tableName: 'ic_resi_user', |
|
||||
columnName: val, |
|
||||
columnValue: [this.form[val]] |
|
||||
} |
|
||||
console.log('fixedList----else', _item) |
|
||||
// this.$set(this.fixedList, index, _item) |
|
||||
} |
|
||||
}) |
|
||||
if (Object.keys(_item).length > 0 && !hasVal) this.fixedList.push(_item) |
|
||||
} else { |
|
||||
this.$set(this.fixedList, 0, { |
|
||||
queryType: 'equal', |
|
||||
tableName: 'ic_resi_user', |
|
||||
columnName: val, |
|
||||
columnValue: [this.form[val]] |
|
||||
}) |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
console.log('fixedList----999', this.fixedList) |
|
||||
this.tempFormList.forEach((item) => { |
|
||||
if (item.columnName === val) item.isChange = true |
|
||||
}) |
|
||||
}, |
|
||||
getGridList () { |
|
||||
const { user } = this.$store.state |
|
||||
this.$http |
|
||||
.post('/gov/org/customergrid/gridoption', { agencyId: user.agencyId, purpose: 'query' }) |
|
||||
.then(({ data: res }) => { |
|
||||
if (res.code !== 0) { |
|
||||
return this.$message.error(res.msg) |
|
||||
} else { |
|
||||
console.log('获取查询详情成功', res.data) |
|
||||
this.optionsG = res.data |
|
||||
} |
|
||||
}) |
|
||||
.catch(() => { |
|
||||
return this.$message.error('网络错误') |
|
||||
}) |
|
||||
}, |
|
||||
getValiheList () { |
|
||||
const { user } = this.$store.state |
|
||||
this.$http |
|
||||
.post('/actual/base/communityQuarters/listQuartersOptions', { |
|
||||
gridId: this.form.GRID_ID, |
|
||||
agencyId: '' |
|
||||
// agencyId: user.agencyId |
|
||||
}) |
|
||||
.then(({ data: res }) => { |
|
||||
if (res.code !== 0) { |
|
||||
return this.$message.error(res.msg) |
|
||||
} else { |
|
||||
console.log('获取查询详情成功', res.data) |
|
||||
this.optionsV = res.data |
|
||||
} |
|
||||
}) |
|
||||
.catch(() => { |
|
||||
return this.$message.error('网络错误') |
|
||||
}) |
|
||||
}, |
|
||||
getBuildList () { |
|
||||
this.$http |
|
||||
.post('/actual/base/communityBuilding/buildingoption', { |
|
||||
quartersId: this.form.VILLAGE_ID |
|
||||
}) |
|
||||
.then(({ data: res }) => { |
|
||||
if (res.code !== 0) { |
|
||||
return this.$message.error(res.msg) |
|
||||
} else { |
|
||||
console.log('获取查询详情成功', res.data) |
|
||||
this.optionsB = res.data |
|
||||
} |
|
||||
}) |
|
||||
.catch(() => { |
|
||||
return this.$message.error('网络错误') |
|
||||
}) |
|
||||
}, |
|
||||
getUniList () { |
|
||||
this.$http |
|
||||
.post('/actual/base/communityBuildingUnit/unitoption', { |
|
||||
buildingId: this.form.BUILD_ID |
|
||||
}) |
|
||||
.then(({ data: res }) => { |
|
||||
if (res.code !== 0) { |
|
||||
return this.$message.error(res.msg) |
|
||||
} else { |
|
||||
console.log('获取查询详情成功', res.data) |
|
||||
this.optionsD = res.data |
|
||||
} |
|
||||
}) |
|
||||
.catch(() => { |
|
||||
return this.$message.error('网络错误') |
|
||||
}) |
|
||||
}, |
|
||||
getHouseList () { |
|
||||
this.$http |
|
||||
.post('/actual/base/communityHouse/houseoption', { unitId: this.form.UNIT_ID }) |
|
||||
.then(({ data: res }) => { |
|
||||
if (res.code !== 0) { |
|
||||
return this.$message.error(res.msg) |
|
||||
} else { |
|
||||
console.log('获取查询详情成功', res.data) |
|
||||
this.optionsH = res.data |
|
||||
} |
|
||||
}) |
|
||||
.catch(() => { |
|
||||
return this.$message.error('网络错误') |
|
||||
}) |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
</script> |
|
||||
|
|
||||
<style lang="scss" scoped> |
|
||||
.resi-container .resi-card { |
|
||||
position: relative; |
|
||||
overflow: visible; |
|
||||
} |
|
||||
.resi-down { |
|
||||
position: absolute; |
|
||||
left: 50%; |
|
||||
bottom: -10px; |
|
||||
display: flex; |
|
||||
justify-content: center; |
|
||||
align-items: center; |
|
||||
width: 46px; |
|
||||
height: 12px; |
|
||||
box-sizing: border-box; |
|
||||
margin-left: -23rpx; |
|
||||
cursor: pointer; |
|
||||
background: #ffffff; |
|
||||
border-radius: 0 0 10px 10px; |
|
||||
img { |
|
||||
display: block; |
|
||||
} |
|
||||
} |
|
||||
.resi-row-box { |
|
||||
height: 104px; |
|
||||
overflow: hidden; |
|
||||
transition: height 0.5s; |
|
||||
} |
|
||||
.resi-row-more { |
|
||||
height: max-content; |
|
||||
transition: height 0.5s; |
|
||||
} |
|
||||
.resi-row { |
|
||||
margin-bottom: 20px; |
|
||||
} |
|
||||
.resi-search { |
|
||||
// padding-right: 20px; |
|
||||
.el-col { |
|
||||
text-align: right; |
|
||||
} |
|
||||
} |
|
||||
.resi-container .resi-cell { |
|
||||
display: flex; |
|
||||
align-items: center; |
|
||||
.resi-cell-label { |
|
||||
flex-shrink: 0; |
|
||||
width: 70px; |
|
||||
box-sizing: border-box; |
|
||||
margin-right: 15px; |
|
||||
text-align: right; |
|
||||
// line-height: 32; |
|
||||
} |
|
||||
.resi-cell-value-radio { |
|
||||
display: flex; |
|
||||
align-items: center; |
|
||||
min-height: 32px; |
|
||||
} |
|
||||
.resi-cell-input { |
|
||||
width: 200px; |
|
||||
} |
|
||||
.resi-cell--daterange { |
|
||||
width: 200px; |
|
||||
} |
|
||||
.resi-cell-select { |
|
||||
width: 200px; |
|
||||
box-sizing: border-box; |
|
||||
margin-right: 10px; |
|
||||
&-middle { |
|
||||
width: 130px; |
|
||||
} |
|
||||
&-small { |
|
||||
width: 88px; |
|
||||
} |
|
||||
} |
|
||||
.resi-cell-select:last-child { |
|
||||
margin-right: 0; |
|
||||
} |
|
||||
} |
|
||||
</style> |
|
||||
@ -1,634 +0,0 @@ |
|||||
<template> |
|
||||
<div> |
|
||||
<div class="dialog-h-content scroll-h"> |
|
||||
<el-form ref="ref_form" |
|
||||
:inline="false" |
|
||||
:model="dataForm" |
|
||||
:rules="dataRule" |
|
||||
class="form"> |
|
||||
|
|
||||
<el-form-item label="当前组织" |
|
||||
label-width="150px" |
|
||||
style="display: block"> |
|
||||
<span>{{ gridName }}</span> |
|
||||
</el-form-item> |
|
||||
|
|
||||
<el-form-item label="姓名" |
|
||||
label-width="150px" |
|
||||
style="display: block"> |
|
||||
<span>{{ dataForm.name }}</span> |
|
||||
</el-form-item> |
|
||||
|
|
||||
<el-form-item label="迁出时间" prop="outOfTime" label-width="150px"> |
|
||||
<el-date-picker v-model="dataForm.outOfTime" |
|
||||
type="date" |
|
||||
value-format="yyyy-MM-dd HH:mm:ss" |
|
||||
format="yyyy-MM-dd" |
|
||||
placeholder="选择日期" |
|
||||
style="width:200px" |
|
||||
:clearable="false"> |
|
||||
</el-date-picker> |
|
||||
</el-form-item> |
|
||||
|
|
||||
<el-form-item label="迁出类型" |
|
||||
prop="type" |
|
||||
label-width="150px" |
|
||||
style="display: block"> |
|
||||
<el-radio-group v-model="dataForm.type"> |
|
||||
|
|
||||
<el-radio :label="'in'">{{'迁往'+rootAgency.organizationName+'内其他区域'}}</el-radio> |
|
||||
<el-radio :label="'out'">其他</el-radio> |
|
||||
|
|
||||
</el-radio-group> |
|
||||
</el-form-item> |
|
||||
|
|
||||
<div v-if="dataForm.type==='in'"> |
|
||||
<el-form-item label="迁出至" |
|
||||
prop='agencyId' |
|
||||
label-width="150px"> |
|
||||
<el-cascader ref="myCascader" |
|
||||
v-model="agencyIdArray" |
|
||||
style="width:480px" |
|
||||
:key="iscascaderShow" |
|
||||
:options="casOptions" |
|
||||
:props="optionProps" |
|
||||
@change="handleChangeAgency" |
|
||||
clearable></el-cascader> |
|
||||
</el-form-item> |
|
||||
|
|
||||
<el-form-item label="所属家庭" |
|
||||
label-width="150px" |
|
||||
prop="villageId"> |
|
||||
|
|
||||
<div class="resi-cell-col"> |
|
||||
|
|
||||
<el-select v-model.trim="dataForm.villageId" |
|
||||
placeholder="请选择小区" |
|
||||
clearable |
|
||||
class="item_width_1" |
|
||||
@change="handleChangeCommunity($event)"> |
|
||||
<el-option v-for="item in communityList" |
|
||||
:key="item.value" |
|
||||
:label="item.label" |
|
||||
:value="item.value"> |
|
||||
</el-option> |
|
||||
</el-select> |
|
||||
|
|
||||
<el-select v-model.trim="dataForm.buildId" |
|
||||
placeholder="请选择楼号" |
|
||||
clearable |
|
||||
class="item_width_1 margin_left10" |
|
||||
@change="handleChangeBuilding($event)"> |
|
||||
<el-option v-for="item in buildingList" |
|
||||
:key="item.value" |
|
||||
:label="item.label" |
|
||||
:value="item.value"> |
|
||||
</el-option> |
|
||||
</el-select> |
|
||||
|
|
||||
<el-select v-model.trim="dataForm.unitId" |
|
||||
placeholder="请选择单元" |
|
||||
clearable |
|
||||
class="item_width_1 margin_left10" |
|
||||
@change="handleChangeUnit($event)"> |
|
||||
<el-option v-for="item in unitList" |
|
||||
:key="item.value" |
|
||||
:label="item.label" |
|
||||
:value="item.value"> |
|
||||
</el-option> |
|
||||
</el-select> |
|
||||
|
|
||||
<el-select v-model.trim="dataForm.homeId" |
|
||||
placeholder="请选择房号" |
|
||||
clearable |
|
||||
class="item_width_1 margin_left10" |
|
||||
@change="handleChangeHome($event)"> |
|
||||
<el-option v-for="item in roomList" |
|
||||
:key="item.value" |
|
||||
:label="item.label" |
|
||||
:value="item.value"> |
|
||||
</el-option> |
|
||||
</el-select> |
|
||||
|
|
||||
</div> |
|
||||
|
|
||||
</el-form-item> |
|
||||
|
|
||||
</div> |
|
||||
<div v-if="dataForm.type==='out'"> |
|
||||
<el-form-item label="外迁详细地址" |
|
||||
prop="address" |
|
||||
label-width="150px"> |
|
||||
<el-input type="textarea" |
|
||||
:autosize="{ minRows: 2, maxRows: 7}" |
|
||||
:rows="5" |
|
||||
resize="none" |
|
||||
style="width:600px" |
|
||||
placeholder='请输入外迁详细地址' |
|
||||
v-model="dataForm.address"> |
|
||||
</el-input> |
|
||||
</el-form-item> |
|
||||
</div> |
|
||||
<el-form-item label="迁出原因" |
|
||||
prop="reason" |
|
||||
label-width="150px"> |
|
||||
<el-input type="textarea" |
|
||||
:autosize="{ minRows: 4, maxRows: 7}" |
|
||||
:rows="5" |
|
||||
resize="none" |
|
||||
style="width:600px" |
|
||||
placeholder='请输入迁出原因' |
|
||||
v-model="dataForm.reason"> |
|
||||
</el-input> |
|
||||
</el-form-item> |
|
||||
<el-form-item label="" |
|
||||
prop="welfareFlag" |
|
||||
label-width="150px"> |
|
||||
<el-checkbox v-model="dataForm.welfareFlag">享受福利</el-checkbox> |
|
||||
</el-form-item> |
|
||||
</el-form> |
|
||||
|
|
||||
</div> |
|
||||
<!-- <div class="div_btn"> |
|
||||
<el-button @click="handleCancle">取 消</el-button> |
|
||||
<el-button type="primary" |
|
||||
:disabled="btnDisable" |
|
||||
@click="handleComfirm">确 定</el-button> |
|
||||
</div> --> |
|
||||
<div class="resi-btns"> |
|
||||
<el-button size="small" |
|
||||
@click="handleCancle">取消</el-button> |
|
||||
<el-button type="primary" |
|
||||
size="small" |
|
||||
:loading="btnDisable" |
|
||||
@click="handleComfirm">提交</el-button> |
|
||||
</div> |
|
||||
</div> |
|
||||
</template> |
|
||||
|
|
||||
<script> |
|
||||
import util from '@js/util.js'; |
|
||||
import { Loading } from 'element-ui' // 引入Loading服务 |
|
||||
import { requestPost, requestGet } from '@/js/dai/request' |
|
||||
|
|
||||
let loading // 加载动画 |
|
||||
export default { |
|
||||
data () { |
|
||||
return { |
|
||||
|
|
||||
btnDisable: false, |
|
||||
communityList: [], |
|
||||
buildingList: [], |
|
||||
unitList: [], |
|
||||
roomList: [], |
|
||||
|
|
||||
dataForm: { |
|
||||
icUserId: '', // 被调动人ID |
|
||||
type: 'in',//操作类型【客户外out,客户内in】 |
|
||||
agencyId: '',//调动到的组织Id |
|
||||
gridId: '',//调动到的网格Id |
|
||||
gridName: '', |
|
||||
villageId: '',//调动到的小区ID |
|
||||
villageName: '', |
|
||||
buildId: '',//调动到的楼宇Id |
|
||||
buildName: '', |
|
||||
unitId: '',//调动到的单元Id |
|
||||
unitName: '', |
|
||||
homeId: '', //调动到的房屋Id |
|
||||
homeName: '', |
|
||||
transferTime: '', //调动时间【日期类型】 |
|
||||
reason: '', //备注 |
|
||||
customerId: '', |
|
||||
oldHome: '', |
|
||||
oldDept: '', |
|
||||
oldAddress: '', |
|
||||
ownerName: '', |
|
||||
name: '', |
|
||||
gender: '', |
|
||||
age: '', |
|
||||
address: '', |
|
||||
outOfTime: '', |
|
||||
welfareFlag: false |
|
||||
}, |
|
||||
|
|
||||
customerId: '',//客户id |
|
||||
userId: '',//操作人员id |
|
||||
gridName: '', |
|
||||
rootAgency: {}, |
|
||||
|
|
||||
casOptions: [], |
|
||||
agencyIdArray: [], |
|
||||
customerList: [], |
|
||||
iscascaderShow: 0, |
|
||||
|
|
||||
optionProps: { |
|
||||
multiple: false, |
|
||||
value: 'agencyId', |
|
||||
label: 'agencyName', |
|
||||
children: 'subAgencyList', |
|
||||
// checkStrictly: true |
|
||||
}, |
|
||||
|
|
||||
selGrid: {}, |
|
||||
|
|
||||
|
|
||||
} |
|
||||
}, |
|
||||
components: { |
|
||||
|
|
||||
}, |
|
||||
mounted () { |
|
||||
}, |
|
||||
computed: { |
|
||||
dataRule () { |
|
||||
return { |
|
||||
type: [ |
|
||||
{ required: true, message: '操作类型不能为空', trigger: 'blur' }, |
|
||||
], |
|
||||
agencyId: [ |
|
||||
{ required: true, message: '所选组织不能为空', trigger: 'blur' } |
|
||||
], |
|
||||
villageId: [ |
|
||||
{ required: true, message: '所属家庭不能为空', trigger: 'blur' } |
|
||||
], |
|
||||
address: [ |
|
||||
{ required: true, message: '外迁详细地址不能为空', trigger: 'blur' } |
|
||||
], |
|
||||
outOfTime: [ |
|
||||
{ required: true, message: '迁出时间不能为空', trigger: 'blur' } |
|
||||
] |
|
||||
|
|
||||
} |
|
||||
}, |
|
||||
|
|
||||
}, |
|
||||
methods: { |
|
||||
async initForm (row) { |
|
||||
|
|
||||
this.customerId = localStorage.getItem("customerId"); |
|
||||
|
|
||||
this.$refs.ref_form.resetFields(); |
|
||||
|
|
||||
// this.icUserId = row.icResiUserId |
|
||||
this.gridName = row.GRID_ID |
|
||||
this.dataForm.icUserId = row.icResiUserId |
|
||||
|
|
||||
// 添加参数 |
|
||||
if(row.DOOR_NAME !== null && row.DOOR_NAME !== '' && row.DOOR_NAME !== undefined){ |
|
||||
this.dataForm.oldHome = row.DOOR_NAME |
|
||||
}else{ |
|
||||
this.dataForm.oldHome = '' |
|
||||
} |
|
||||
this.dataForm.customerId = this.customerId |
|
||||
this.dataForm.idCard = row.ID_CARD |
|
||||
this.dataForm.mobile = row.MOBILE |
|
||||
|
|
||||
await this.loadHouseInfo(row.HOME_ID_VALUE) |
|
||||
|
|
||||
this.dataForm.name = row.NAME |
|
||||
this.dataForm.gender = row.GENDER |
|
||||
this.dataForm.age = '' |
|
||||
|
|
||||
|
|
||||
await this.loadRootAgency() |
|
||||
await this.getAgencylist() |
|
||||
|
|
||||
}, |
|
||||
async loadHouseInfo (homeIdValue) { |
|
||||
const url = "/gov/org/ichouse/" + homeIdValue |
|
||||
const { data, code, msg } = await requestGet(url) |
|
||||
if (code === 0) { |
|
||||
this.dataForm.oldDept = '' |
|
||||
this.dataForm.oldAddress = data.houseName |
|
||||
this.dataForm.ownerName = data.ownerName |
|
||||
} else { |
|
||||
this.$message.error(msg) |
|
||||
} |
|
||||
|
|
||||
}, |
|
||||
|
|
||||
//根据人员id获取根组织信息 |
|
||||
async loadRootAgency () { |
|
||||
|
|
||||
await this.$http.post('/gov/org/agency/customerrootagency/' + this.customerId).then(({ data: res }) => { |
|
||||
if (res.code !== 0) { |
|
||||
return this.$message.error(res.msg) |
|
||||
} |
|
||||
|
|
||||
if (res.data) { |
|
||||
this.rootAgency = res.data |
|
||||
} |
|
||||
}).catch(() => { }) |
|
||||
|
|
||||
}, |
|
||||
|
|
||||
async getAgencylist () { |
|
||||
|
|
||||
const url = '/gov/org/customeragency/rootagencygridtree' |
|
||||
|
|
||||
|
|
||||
const params = { |
|
||||
agencyId: this.rootAgency.id |
|
||||
} |
|
||||
const { data, code, msg } = await requestPost(url, params) |
|
||||
if (code === 0) { |
|
||||
++this.iscascaderShow |
|
||||
this.casOptions = [] |
|
||||
this.agencyIdArray.length = [] |
|
||||
|
|
||||
if (data) { |
|
||||
let treeData = [data] |
|
||||
this.resolveAgencyTree(treeData) |
|
||||
this.casOptions.push(data) |
|
||||
} |
|
||||
|
|
||||
} else { |
|
||||
this.$message.error(msg) |
|
||||
} |
|
||||
}, |
|
||||
|
|
||||
resolveAgencyTree (treeData) { |
|
||||
treeData.forEach(element => { |
|
||||
if (!element.subAgencyList || element.subAgencyList.length === 0) {//不存在下级,且level=grid的是true |
|
||||
|
|
||||
if (element.level === 'grid') { |
|
||||
element.disabled = false |
|
||||
} else { |
|
||||
element.disabled = true |
|
||||
} |
|
||||
|
|
||||
} else { |
|
||||
this.resolveAgencyTree(element.subAgencyList) |
|
||||
} |
|
||||
}); |
|
||||
}, |
|
||||
|
|
||||
handleChangeAgency () { |
|
||||
console.log(this.$refs["myCascader"].getCheckedNodes()[0].data) |
|
||||
this.selGrid = this.$refs["myCascader"].getCheckedNodes()[0].data |
|
||||
this.dataForm.agencyId = this.selGrid.pid |
|
||||
this.dataForm.gridId = this.selGrid.agencyId |
|
||||
this.dataForm.gridName = this.selGrid.agencyName |
|
||||
this.loadCommunityList() |
|
||||
this.dataForm.villageId = ''//调动到的小区ID |
|
||||
this.dataForm.villageName = '' |
|
||||
this.dataForm.buildId = ''//调动到的楼宇Id |
|
||||
this.dataForm.buildName = '' |
|
||||
this.dataForm.unitId = ''//调动到的单元Id |
|
||||
this.dataForm.unitName = '' |
|
||||
this.dataForm.homeId = '' //调动到的房屋Id |
|
||||
this.dataForm.homeName = '' |
|
||||
|
|
||||
}, |
|
||||
|
|
||||
async loadCommunityList () { |
|
||||
const url = '/actual/base/communityQuarters/listQuartersOptions' |
|
||||
|
|
||||
let params = { |
|
||||
gridId: this.dataForm.gridId, |
|
||||
agencyId: this.dataForm.agencyId |
|
||||
} |
|
||||
|
|
||||
const { data, code, msg } = await requestPost(url, params) |
|
||||
|
|
||||
if (code === 0) { |
|
||||
this.communityList = [] |
|
||||
this.communityList = [...data] |
|
||||
|
|
||||
} else { |
|
||||
this.$message.error(msg) |
|
||||
} |
|
||||
}, |
|
||||
|
|
||||
async handleChangeCommunity (id) { |
|
||||
// 小区 |
|
||||
this.communityList.find((item) => { |
|
||||
if (item.value === id) { |
|
||||
this.dataForm.villageName = item.label |
|
||||
} |
|
||||
}) |
|
||||
|
|
||||
const url = '/actual/base/communityBuilding/buildingoption' |
|
||||
|
|
||||
let params = { |
|
||||
quartersId: this.dataForm.villageId |
|
||||
} |
|
||||
|
|
||||
const { data, code, msg } = await requestPost(url, params) |
|
||||
|
|
||||
if (code === 0) { |
|
||||
this.buildingList = [] |
|
||||
this.buildingList = [...data] |
|
||||
this.dataForm.buildId = ''//调动到的楼宇Id |
|
||||
this.dataForm.unitId = ''//调动到的单元Id |
|
||||
this.dataForm.homeId = '' //调动到的房屋Id |
|
||||
|
|
||||
} else { |
|
||||
this.$message.error(msg) |
|
||||
} |
|
||||
}, |
|
||||
|
|
||||
async handleChangeBuilding (id) { |
|
||||
|
|
||||
// 楼号 |
|
||||
this.buildingList.find((item) => { |
|
||||
if (item.value === id) { |
|
||||
this.dataForm.buildName = item.label |
|
||||
} |
|
||||
}) |
|
||||
|
|
||||
const url = '/actual/base/communityBuildingUnit/unitoption' |
|
||||
|
|
||||
let params = { |
|
||||
buildingId: this.dataForm.buildId |
|
||||
} |
|
||||
|
|
||||
const { data, code, msg } = await requestPost(url, params) |
|
||||
|
|
||||
if (code === 0) { |
|
||||
this.unitList = [] |
|
||||
this.unitList = [...data] |
|
||||
this.dataForm.unitId = ''//调动到的单元Id |
|
||||
this.dataForm.homeId = '' //调动到的房屋Id |
|
||||
|
|
||||
|
|
||||
} else { |
|
||||
this.$message.error(msg) |
|
||||
} |
|
||||
}, |
|
||||
|
|
||||
async handleChangeUnit (id) { |
|
||||
// 单元号 |
|
||||
this.unitList.find((item) => { |
|
||||
if (item.value === id) { |
|
||||
this.dataForm.unitName = item.label |
|
||||
} |
|
||||
}) |
|
||||
|
|
||||
const url = '/actual/base/communityHouse/houseoption' |
|
||||
|
|
||||
let params = { |
|
||||
unitId: this.dataForm.unitId |
|
||||
} |
|
||||
|
|
||||
const { data, code, msg } = await requestPost(url, params) |
|
||||
|
|
||||
if (code === 0) { |
|
||||
this.roomList = [] |
|
||||
this.roomList = [...data] |
|
||||
this.dataForm.homeId = '' //调动到的房屋Id |
|
||||
} else { |
|
||||
this.$message.error(msg) |
|
||||
} |
|
||||
}, |
|
||||
|
|
||||
async handleChangeHome (id) { |
|
||||
// 房屋号 |
|
||||
this.roomList.find((item) => { |
|
||||
if (item.value === id) { |
|
||||
this.dataForm.homeName = item.label |
|
||||
} |
|
||||
}) |
|
||||
}, |
|
||||
|
|
||||
async handleComfirm () { |
|
||||
this.btnDisable = true |
|
||||
setTimeout(() => { |
|
||||
this.btnDisable = false |
|
||||
}, 2000) |
|
||||
this.$refs['ref_form'].validate((valid, messageObj) => { |
|
||||
if (!valid) { |
|
||||
// app.util.validateRule(messageObj) |
|
||||
console.log('error submit!') |
|
||||
|
|
||||
} else { |
|
||||
if (this.dataForm.type === 'in') { |
|
||||
if (!this.dataForm.buildId) { |
|
||||
this.$message.warning('楼栋') |
|
||||
return false |
|
||||
} |
|
||||
if (!this.dataForm.unitId) { |
|
||||
this.$message.warning('请选择单元') |
|
||||
return false |
|
||||
} |
|
||||
if (!this.dataForm.homeId) { |
|
||||
this.$message.warning('请选择房间') |
|
||||
return false |
|
||||
} |
|
||||
} |
|
||||
this.saveForm() |
|
||||
} |
|
||||
|
|
||||
}) |
|
||||
}, |
|
||||
|
|
||||
async saveForm () { |
|
||||
|
|
||||
// saveOutOfInfo |
|
||||
const url = '/epmetuser/changeRelocation/moveOutHome' |
|
||||
let noData = new Date() |
|
||||
noData = util.dateFormatter(noData, 'time') |
|
||||
this.dataForm.transferTime = noData |
|
||||
|
|
||||
const { data, code, msg } = await requestPost(url, this.dataForm) |
|
||||
|
|
||||
if (code === 0) { |
|
||||
this.$message.success('操作成功') |
|
||||
this.handleCancle() |
|
||||
} else { |
|
||||
this.$message.error(msg) |
|
||||
} |
|
||||
}, |
|
||||
// async saveForm () { |
|
||||
// const url = '/epmetuser/icusertransferrecord/add' |
|
||||
// let noData = new Date() |
|
||||
// noData = util.dateFormatter(noData, 'time') |
|
||||
// this.dataForm.transferTime = noData |
|
||||
// |
|
||||
// console.log('-----------3--------------') |
|
||||
// console.log(this.dataForm) |
|
||||
// const { data, code, msg } = await requestPost(url, this.dataForm) |
|
||||
// |
|
||||
// if (code === 0) { |
|
||||
// this.$message.success('调动成功') |
|
||||
// this.handleCancle() |
|
||||
// } else { |
|
||||
// this.$message.error(msg) |
|
||||
// } |
|
||||
// }, |
|
||||
|
|
||||
handleCancle () { |
|
||||
this.resetData() |
|
||||
this.$emit('dialogCancle') |
|
||||
|
|
||||
}, |
|
||||
|
|
||||
resetData () { |
|
||||
this.dataForm = { |
|
||||
icUserId: '', // 被调动人ID |
|
||||
type: 'in',//操作类型【客户外out,客户内in】 |
|
||||
agencyId: '',//调动到的组织Id |
|
||||
gridId: '',//调动到的网格Id |
|
||||
villageId: '',//调动到的小区ID |
|
||||
buildId: '',//调动到的楼宇Id |
|
||||
unitId: '',//调动到的单元Id |
|
||||
homeId: '', //调动到的房屋Id |
|
||||
transferTime: '', //调动时间【日期类型】 |
|
||||
reason: '', //备注 |
|
||||
outOfTime: '', |
|
||||
welfareFlag: false |
|
||||
} |
|
||||
|
|
||||
this.customerId = ''//客户id |
|
||||
this.userId = ''//操作人员id |
|
||||
this.gridName = '' |
|
||||
this.rootAgency = {} |
|
||||
|
|
||||
this.selGrid = {} |
|
||||
|
|
||||
}, |
|
||||
// 开启加载动画 |
|
||||
startLoading () { |
|
||||
loading = Loading.service({ |
|
||||
lock: true, // 是否锁定 |
|
||||
text: '正在加载……', // 加载中需要显示的文字 |
|
||||
background: 'rgba(0,0,0,.7)' // 背景颜色 |
|
||||
}) |
|
||||
}, |
|
||||
// 结束加载动画 |
|
||||
endLoading () { |
|
||||
// clearTimeout(timer); |
|
||||
if (loading) { |
|
||||
loading.close() |
|
||||
} |
|
||||
} |
|
||||
}, |
|
||||
props: {} |
|
||||
} |
|
||||
</script> |
|
||||
<style lang="scss" scoped> |
|
||||
.item_width_1 { |
|
||||
width: 150px; |
|
||||
} |
|
||||
.item_width_2 { |
|
||||
width: 400px; |
|
||||
} |
|
||||
.item_width_3 { |
|
||||
margin-left: 10px; |
|
||||
width: 200px; |
|
||||
} |
|
||||
|
|
||||
.div_btn { |
|
||||
display: flex; |
|
||||
justify-content: flex-end; |
|
||||
} |
|
||||
.resi-cell-col { |
|
||||
width: 750px; |
|
||||
display: flex; |
|
||||
justify-content: flex-start; |
|
||||
} |
|
||||
|
|
||||
.margin_left10 { |
|
||||
margin-left: 10px; |
|
||||
} |
|
||||
</style> |
|
||||
@ -1,813 +0,0 @@ |
|||||
<template> |
|
||||
<div class="resi-container"> |
|
||||
<!-- <el-card class="resi-card"> --> |
|
||||
<el-row class="resi-row-box" :class="!isArrow && 'resi-row-more'"> |
|
||||
<el-row v-if="showGrid" class="resi-row"> |
|
||||
<el-col :span="6"> |
|
||||
<div class="resi-cell"> |
|
||||
<div class="resi-cell-label">所属组织</div> |
|
||||
<div class="resi-cell-value"> |
|
||||
<el-cascader class="customer_cascader" |
|
||||
ref="myCascader" |
|
||||
v-model="agencyIdArray" |
|
||||
:options="orgOptions" |
|
||||
:props="orgOptionProps" |
|
||||
:show-all-levels="false" |
|
||||
@change="handleChangeAgency"></el-cascader> |
|
||||
</div> |
|
||||
</div> |
|
||||
</el-col> |
|
||||
<!-- <el-col :span="6"> |
|
||||
<div class="resi-cell"> |
|
||||
<div class="resi-cell-label">所属网格</div> |
|
||||
<div class="resi-cell-value"> |
|
||||
<el-select |
|
||||
v-model.trim="form.GRID_ID" |
|
||||
placeholder="请选择" |
|
||||
size="small" |
|
||||
clearable |
|
||||
class="resi-cell-select" |
|
||||
@change="handleChangeGrid" |
|
||||
> |
|
||||
<el-option |
|
||||
v-for="item in optionsG" |
|
||||
:key="item.value" |
|
||||
:label="item.label" |
|
||||
:value="item.value" |
|
||||
> |
|
||||
</el-option> |
|
||||
</el-select> |
|
||||
</div> |
|
||||
</div> |
|
||||
</el-col>--> |
|
||||
<el-col :span="18"> |
|
||||
<div class="resi-cell"> |
|
||||
<div class="resi-cell-label">所属房屋</div> |
|
||||
<div class="resi-cell-value"> |
|
||||
<el-select |
|
||||
v-model.trim="form.VILLAGE_ID" |
|
||||
placeholder="请选择小区" |
|
||||
size="small" |
|
||||
filterable |
|
||||
clearable |
|
||||
class="resi-cell-select" |
|
||||
@clear="handleClearVillage" |
|
||||
@change="handleChangeV" |
|
||||
> |
|
||||
<el-option |
|
||||
v-for="item in optionsV" |
|
||||
:key="item.value" |
|
||||
:label="item.label" |
|
||||
:value="item.value" |
|
||||
> |
|
||||
</el-option> |
|
||||
</el-select> |
|
||||
<el-select |
|
||||
v-model.trim="form.BUILD_ID" |
|
||||
placeholder="楼号" |
|
||||
size="small" |
|
||||
filterable |
|
||||
clearable |
|
||||
style="width: 120px;" |
|
||||
class="resi-cell-select" |
|
||||
:disabled="changeVDisabled" |
|
||||
@clear="handleClearBuild" |
|
||||
@change="handleChangeB" |
|
||||
> |
|
||||
<el-option |
|
||||
v-for="item in optionsB" |
|
||||
:key="item.value" |
|
||||
:label="item.label" |
|
||||
:value="item.value" |
|
||||
> |
|
||||
</el-option> |
|
||||
</el-select> |
|
||||
<el-select |
|
||||
v-model.trim="form.UNIT_ID" |
|
||||
:disabled="changeBDisabled" |
|
||||
placeholder="单元" |
|
||||
size="small" |
|
||||
filterable |
|
||||
clearable |
|
||||
style="width: 120px;" |
|
||||
class="resi-cell-select" |
|
||||
@click="handleClearDan" |
|
||||
@change="handleChangeD" |
|
||||
> |
|
||||
<el-option |
|
||||
v-for="item in optionsD" |
|
||||
:key="item.value" |
|
||||
:label="item.label" |
|
||||
:value="item.value" |
|
||||
> |
|
||||
</el-option> |
|
||||
</el-select> |
|
||||
<el-select |
|
||||
v-model.trim="form.HOME_ID" |
|
||||
:disabled="changeDDisabled" |
|
||||
placeholder="房号" |
|
||||
size="small" |
|
||||
filterable |
|
||||
clearable |
|
||||
style="width: 120px;" |
|
||||
class="resi-cell-select" |
|
||||
> |
|
||||
<el-option |
|
||||
v-for="item in optionsH" |
|
||||
:key="item.value" |
|
||||
:label="item.label" |
|
||||
:value="item.value" |
|
||||
> |
|
||||
</el-option> |
|
||||
</el-select> |
|
||||
</div> |
|
||||
</div> |
|
||||
</el-col> |
|
||||
</el-row> |
|
||||
<el-row |
|
||||
v-for="(item, index) in sliceList(itemList, 4)" |
|
||||
:key="index" |
|
||||
class="resi-row" |
|
||||
> |
|
||||
<el-col v-for="n in item" :key="n.id" :span="computdSpan(item.length)"> |
|
||||
<div class="resi-cell"> |
|
||||
<div class="resi-cell-label" :class="item.length != 4 && 'resi-cell-label1'">{{ n.label }}</div> |
|
||||
<div |
|
||||
class="resi-cell-value" |
|
||||
:class="n.itemType === 'radio' && 'resi-cell-value-radio'" |
|
||||
> |
|
||||
<el-input |
|
||||
v-if="n.itemType === 'input' || n.itemType === 'textarea'" |
|
||||
v-model.trim="form[n.columnName]" |
|
||||
class="resi-cell-input" |
|
||||
size="small" |
|
||||
clearable |
|
||||
placeholder="请输入内容" |
|
||||
> |
|
||||
</el-input> |
|
||||
<template v-else-if="n.itemType == 'inputRange'"> |
|
||||
<!-- <el-input |
|
||||
v-model.trim="form[n.columnName]" |
|
||||
class="resi-cell-input" |
|
||||
size="small" |
|
||||
clearable |
|
||||
placeholder="请输入内容" |
|
||||
/> --> |
|
||||
<inputRange v-model="form[n.columnName]" :type="n.validType" @change="handleAgeChange" /> |
|
||||
</template> |
|
||||
<template v-else-if="n.itemType === 'datepicker'"> |
|
||||
<el-date-picker |
|
||||
v-if="n.queryType === 'daterange'" |
|
||||
v-model.trim="form[n.columnName]" |
|
||||
type="daterange" |
|
||||
align="right" |
|
||||
unlink-panels |
|
||||
range-separator="至" |
|
||||
start-placeholder="开始日期" |
|
||||
end-placeholder="结束日期" |
|
||||
class="resi-cell--daterange" |
|
||||
size="small" |
|
||||
format="yyyy-MM-dd" |
|
||||
value-format="yyyy-MM-dd" |
|
||||
> |
|
||||
</el-date-picker> |
|
||||
<el-date-picker |
|
||||
v-else |
|
||||
v-model.trim="form[n.columnName]" |
|
||||
class="resi-cell-input" |
|
||||
type="date" |
|
||||
size="small" |
|
||||
clearable |
|
||||
format="yyyy-MM-dd" |
|
||||
value-format="yyyy-MM-dd" |
|
||||
placeholder="选择日期" |
|
||||
> |
|
||||
</el-date-picker> |
|
||||
</template> |
|
||||
<el-select |
|
||||
v-else-if="n.itemType === 'select' || n.itemType === 'radio'" |
|
||||
v-model.trim="form[n.columnName]" |
|
||||
placeholder="请选择" |
|
||||
size="small" |
|
||||
clearable |
|
||||
class="resi-cell-select" |
|
||||
:collapse-tags="n.multiSelect == 1 ? true : false" |
|
||||
:multiple="n.multiSelect == 1 ? true : false" |
|
||||
> |
|
||||
<el-option |
|
||||
v-for="item in n.options" |
|
||||
:key="item.value" |
|
||||
:label="item.label" |
|
||||
:value="item.value" |
|
||||
> |
|
||||
</el-option> |
|
||||
</el-select> |
|
||||
<el-cascader |
|
||||
v-else-if="n.itemType === 'cascader'" |
|
||||
v-model.trim="form[n.columnName]" |
|
||||
:options="n.options" |
|
||||
:props="{ checkStrictly: true }" |
|
||||
clearable |
|
||||
size="small" |
|
||||
class="resi-cell-select" |
|
||||
> |
|
||||
</el-cascader> |
|
||||
<template v-else-if="n.itemType === 'checkbox'"> |
|
||||
<el-checkbox-group v-model="form[n.columnName]"> |
|
||||
<el-checkbox v-for="ns in n.options" :key="ns.value" :label="ns.value">{{ns.label}}</el-checkbox> |
|
||||
<!-- <el-checkbox label="n.la"></el-checkbox> --> |
|
||||
</el-checkbox-group> |
|
||||
</template> |
|
||||
</div> |
|
||||
</div> |
|
||||
</el-col> |
|
||||
</el-row> |
|
||||
</el-row> |
|
||||
<el-row v-if="isArrow" class="resi-search"> |
|
||||
<!-- <el-col :span="20"> |
|
||||
<el-button type="primary" size="mini">查询</el-button> |
|
||||
</el-col> --> |
|
||||
<el-col :span="24"> |
|
||||
<el-button type="primary" size="small" @click="handleSearch">查询</el-button> |
|
||||
<el-button class="diy-button--reset" size="small" @click="resetForm">重置</el-button> |
|
||||
</el-col> |
|
||||
</el-row> |
|
||||
<!-- <div v-if="isArrow" class="resi-down" @click="handleOpenSearch"> |
|
||||
<img v-if="openSearch" src="../../assets/img/arrow-up.png" /> |
|
||||
<img v-else src="../../assets/img/arrow-down.png" /> |
|
||||
</div> --> |
|
||||
<!-- </el-card> --> |
|
||||
</div> |
|
||||
</template> |
|
||||
|
|
||||
<script> |
|
||||
import inputRange from './rangeInput.vue' |
|
||||
export default { |
|
||||
name: 'ResiSearch', |
|
||||
components: { |
|
||||
inputRange |
|
||||
}, |
|
||||
props: { |
|
||||
formList: { |
|
||||
type: Array, |
|
||||
default: () => [] |
|
||||
}, |
|
||||
columnName: { |
|
||||
type: String, |
|
||||
default: '' |
|
||||
}, |
|
||||
showGrid: { |
|
||||
type: Boolean, |
|
||||
default: false |
|
||||
}, |
|
||||
isArrow: { |
|
||||
type: Boolean, |
|
||||
default: false |
|
||||
} |
|
||||
}, |
|
||||
data() { |
|
||||
let initForm = (arr, columnName) => { |
|
||||
let _form = {} |
|
||||
// console.log('formInfo', obj) |
|
||||
// if (Object.keys(obj).length > 0) { |
|
||||
// _form = { ...obj } |
|
||||
// return _form |
|
||||
// } |
|
||||
arr.forEach((item) => { |
|
||||
if (item.itemType == 'checkbox') _form[item.columnName] = [] |
|
||||
else if (item.queryType == 'resi_category' && columnName ){ |
|
||||
_form[item.columnName] = [columnName] |
|
||||
} else if (columnName && columnName === item.columnName) _form[item.columnName] = '1' |
|
||||
else if (item.itemType == 'inputRange') _form[item.columnName] = { start: '', end: ''} |
|
||||
else _form[item.columnName] = '' |
|
||||
}) |
|
||||
return _form |
|
||||
} |
|
||||
let itemList = this.formList.map(item => { |
|
||||
if (item.itemType == 'inputRange' && item.funType == 'agetoyear') { |
|
||||
item.columnName = 'age' |
|
||||
} |
|
||||
return { |
|
||||
...item |
|
||||
} |
|
||||
}) |
|
||||
let form = initForm(itemList, this.columnName) |
|
||||
let tempFormList = itemList.map(item => { |
|
||||
|
|
||||
return { |
|
||||
...item, |
|
||||
isChange:( item.queryType == 'resi_category' && this.columnName) || this.columnName === item.columnName ? true : false |
|
||||
} |
|
||||
}) |
|
||||
let constForm = { |
|
||||
...form, |
|
||||
GRID_ID: '', |
|
||||
VILLAGE_ID: '', |
|
||||
BUILD_ID: '', |
|
||||
UNIT_ID: '', |
|
||||
HOME_ID: '' |
|
||||
} |
|
||||
let orgOptionProps = { |
|
||||
multiple: false, |
|
||||
value: 'agencyId', |
|
||||
label: 'agencyName', |
|
||||
children: 'subAgencyList', |
|
||||
checkStrictly: true |
|
||||
} |
|
||||
|
|
||||
return { |
|
||||
pageLoading: false, |
|
||||
openSearch: false, |
|
||||
optionsV: [], |
|
||||
optionsB: [], |
|
||||
optionsH: [], |
|
||||
optionsD: [], |
|
||||
optionsG: [], |
|
||||
orgOptions: [], |
|
||||
orgOptionProps, |
|
||||
agencyIdArray:[], |
|
||||
value: '', |
|
||||
itemList, |
|
||||
fixedList: [], |
|
||||
fixedForm: { |
|
||||
AGENCY_ID: '', |
|
||||
GRID_ID: '', |
|
||||
VILLAGE_ID: '', |
|
||||
BUILD_ID: '', |
|
||||
UNIT_ID: '', |
|
||||
HOME_ID: '' |
|
||||
}, |
|
||||
constForm, |
|
||||
form: { |
|
||||
...form, |
|
||||
AGENCY_ID: '', |
|
||||
GRID_ID: '', |
|
||||
VILLAGE_ID: '', |
|
||||
BUILD_ID: '', |
|
||||
UNIT_ID: '', |
|
||||
HOME_ID: '' |
|
||||
}, |
|
||||
tempFormList, |
|
||||
pickerOptions: { |
|
||||
shortcuts: [ |
|
||||
{ |
|
||||
text: '最近一周', |
|
||||
onClick(picker) { |
|
||||
const end = new Date() |
|
||||
const start = new Date() |
|
||||
start.setTime(start.getTime() - 3600 * 1000 * 24 * 7) |
|
||||
picker.$emit('pick', [start, end]) |
|
||||
} |
|
||||
}, |
|
||||
{ |
|
||||
text: '最近一个月', |
|
||||
onClick(picker) { |
|
||||
const end = new Date() |
|
||||
const start = new Date() |
|
||||
start.setTime(start.getTime() - 3600 * 1000 * 24 * 30) |
|
||||
picker.$emit('pick', [start, end]) |
|
||||
} |
|
||||
}, |
|
||||
{ |
|
||||
text: '最近三个月', |
|
||||
onClick(picker) { |
|
||||
const end = new Date() |
|
||||
const start = new Date() |
|
||||
start.setTime(start.getTime() - 3600 * 1000 * 24 * 90) |
|
||||
picker.$emit('pick', [start, end]) |
|
||||
} |
|
||||
} |
|
||||
] |
|
||||
}, |
|
||||
|
|
||||
queryType:{ |
|
||||
'AGENCY_ID':'like' |
|
||||
} |
|
||||
} |
|
||||
}, |
|
||||
computed: { |
|
||||
sliceList() { |
|
||||
return function (data, count) { |
|
||||
if (data !== undefined) { |
|
||||
let index = 0 |
|
||||
let arrTemp = [] |
|
||||
for (let i = 0; i < data.length; i++) { |
|
||||
index = parseInt(i / count) |
|
||||
if (arrTemp.length <= index) { |
|
||||
arrTemp.push([]) |
|
||||
} |
|
||||
arrTemp[index].push(data[i]) |
|
||||
} |
|
||||
return arrTemp |
|
||||
} |
|
||||
} |
|
||||
}, |
|
||||
changeVDisabled () { |
|
||||
return !this.form.VILLAGE_ID |
|
||||
}, |
|
||||
changeBDisabled () { |
|
||||
return !this.form.BUILD_ID |
|
||||
}, |
|
||||
changeDDisabled () { |
|
||||
return !this.form.UNIT_ID |
|
||||
}, |
|
||||
}, |
|
||||
watch: { |
|
||||
form: { |
|
||||
handler(val, val2) { |
|
||||
// console.log('valpppp----', val, val2) |
|
||||
for (let n in val) { |
|
||||
if (this.constForm[n] !== val[n]) { |
|
||||
this.handleChangeForm(n) |
|
||||
console.log('nnnnnn', n) |
|
||||
} |
|
||||
} |
|
||||
this.constForm = { ...val } |
|
||||
}, |
|
||||
deep: true |
|
||||
} |
|
||||
}, |
|
||||
created () { |
|
||||
// this.initForm() |
|
||||
// console.log('formcccc---', this.form) |
|
||||
this.getOrgTreeList() |
|
||||
this.getGridList() |
|
||||
this.getValiheList() |
|
||||
if (this.columnName) this.handleChangeForm(this.columnName) |
|
||||
}, |
|
||||
methods: { |
|
||||
initForm() { |
|
||||
this.formList.forEach((item) => { |
|
||||
this.$set(this.form, item.columnName, '') |
|
||||
}) |
|
||||
console.log('formcccc---', this.form) |
|
||||
}, |
|
||||
computdSpan(len) { |
|
||||
return len == 1 ? 24 : 6 |
|
||||
}, |
|
||||
handleClearVillage() { |
|
||||
this.form.BUILD_ID = '' |
|
||||
this.form.HOME_ID = '' |
|
||||
}, |
|
||||
handleClearBuild() { |
|
||||
this.form.BUILD_ID = '' |
|
||||
this.form.UNIT_ID = '' |
|
||||
this.form.HOME_ID = '' |
|
||||
}, |
|
||||
handleClearDan() { |
|
||||
this.form.UNIT_ID = '' |
|
||||
this.form.HOME_ID = '' |
|
||||
}, |
|
||||
resetForm(formName) { |
|
||||
for(const n in this.form) { |
|
||||
if (n == 'age') { |
|
||||
this.form.age = { |
|
||||
start: '', |
|
||||
end: '' |
|
||||
} |
|
||||
} else if (typeof this.form[n] == 'object') this.form[n] = [] |
|
||||
else this.form[n] = '' |
|
||||
|
|
||||
} |
|
||||
this. agencyIdArray=[] |
|
||||
// let arr3 = [...arr1, ...arr] |
|
||||
this.$emit('search', []) |
|
||||
// this.handleSearch() |
|
||||
// this.orgOptions = []; |
|
||||
}, |
|
||||
handleSearch() { |
|
||||
// console.log('formmmmm---', this.form) |
|
||||
const itemTypes = ['daterange', 'timerange', 'checkbox'] |
|
||||
let a = this.tempFormList.filter(item => item.itemType != 'inputRange') |
|
||||
let arr = a.filter((n) => n.isChange).map((item) => { |
|
||||
return { |
|
||||
queryType: item.queryType, |
|
||||
tableName: item.tableName, |
|
||||
columnName: item.columnName, |
|
||||
// columnValue: [] |
|
||||
columnValue: this.form[item.columnName] && |
|
||||
(itemTypes.includes(item.queryType) || |
|
||||
itemTypes.includes(item.itemType) || item.multiSelect == 1 |
|
||||
? this.form[item.columnName] |
|
||||
: [this.form[item.columnName].toString()]) |
|
||||
} |
|
||||
}) |
|
||||
const arr2 = arr.filter(item => item.columnValue.length > 0) |
|
||||
let arr1 = this.fixedList |
|
||||
.filter((n) => n.columnValue.length > 0) |
|
||||
.map((item) => { |
|
||||
return { |
|
||||
...item |
|
||||
} |
|
||||
}) |
|
||||
let arr3 = [...arr1, ...arr2] |
|
||||
this.$emit('search', arr3) |
|
||||
return arr3 |
|
||||
}, |
|
||||
handleOpenSearch() { |
|
||||
this.openSearch = !this.openSearch |
|
||||
}, |
|
||||
handleAgeChange(val) { |
|
||||
console.log('val----age---', val) |
|
||||
if (val.end) { |
|
||||
const s = this.computedBirth(val.end) |
|
||||
const e = this.computedBirth(val.start) |
|
||||
this.form.BIRTHDAY = [s, e] |
|
||||
} |
|
||||
}, |
|
||||
handleChangeAgency(val) { |
|
||||
let obj = this.$refs["myCascader"].getCheckedNodes()[0].data |
|
||||
if (obj) { |
|
||||
if(obj.level === 'grid'){ |
|
||||
this.form.GRID_ID = this.agencyIdArray.length > 0 ? this.agencyIdArray[this.agencyIdArray.length - 1] : ''; |
|
||||
this.form.AGENCY_ID='' |
|
||||
}else{ |
|
||||
this.form.AGENCY_ID = this.agencyIdArray.length > 0 ? this.agencyIdArray[this.agencyIdArray.length - 1] : ''; |
|
||||
this.form.GRID_ID = '' |
|
||||
} |
|
||||
|
|
||||
}else{ |
|
||||
this.form.AGENCY_ID='' |
|
||||
this.form.GRID_ID = '' |
|
||||
} |
|
||||
|
|
||||
this.form.VILLAGE_ID = '' |
|
||||
this.form.BUILD_ID = '' |
|
||||
this.form.UNIT_ID = '' |
|
||||
this.form.HOME_ID = '' |
|
||||
this.getValiheList() |
|
||||
}, |
|
||||
handleChangeGrid(val) { |
|
||||
console.log('val', val) |
|
||||
this.form.VILLAGE_ID = '' |
|
||||
this.form.BUILD_ID = '' |
|
||||
this.form.UNIT_ID = '' |
|
||||
this.form.HOME_ID = '' |
|
||||
this.getValiheList() |
|
||||
}, |
|
||||
handleChangeV(val) { |
|
||||
console.log('val', val) |
|
||||
this.form.BUILD_ID = '' |
|
||||
this.form.UNIT_ID = '' |
|
||||
this.form.HOME_ID = '' |
|
||||
this.getBuildList() |
|
||||
}, |
|
||||
handleChangeB(val) { |
|
||||
console.log('val', val) |
|
||||
this.form.UNIT_ID = '' |
|
||||
this.form.HOME_ID = '' |
|
||||
this.getUniList() |
|
||||
}, |
|
||||
handleChangeD(val) { |
|
||||
console.log('val', val) |
|
||||
this.form.HOME_ID = '' |
|
||||
this.getHouseList() |
|
||||
}, |
|
||||
// 监听基础form |
|
||||
handleChangeForm(val) { |
|
||||
for (let n in this.fixedForm) { |
|
||||
|
|
||||
if (n === val) { |
|
||||
if (this.fixedList.length > 0) { |
|
||||
let _item = {} |
|
||||
let hasVal = false |
|
||||
this.fixedList.forEach((item, index) => { |
|
||||
if (item.columnName == val) { |
|
||||
hasVal = true |
|
||||
item.columnValue[0] = this.form[val] |
|
||||
if (!this.form[val]) this.fixedList.splice(index, 1) |
|
||||
console.log('fixedList----val', this.fixedList) |
|
||||
} else { |
|
||||
_item = { |
|
||||
queryType: this.queryType[val]?this.queryType[val]:'equal',//'equal', |
|
||||
tableName: 'ic_resi_user', |
|
||||
columnName: val, |
|
||||
columnValue: [this.form[val]] |
|
||||
} |
|
||||
console.log('fixedList----else', _item) |
|
||||
// this.$set(this.fixedList, index, _item) |
|
||||
} |
|
||||
}) |
|
||||
if (Object.keys(_item).length > 0 && !hasVal) this.fixedList.push(_item) |
|
||||
} else { |
|
||||
this.$set(this.fixedList, 0, { |
|
||||
queryType: this.queryType[val]?this.queryType[val]:'equal',//'equal', |
|
||||
tableName: 'ic_resi_user', |
|
||||
columnName: val, |
|
||||
columnValue: [this.form[val]] |
|
||||
}) |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
console.log('fixedList----999', this.fixedList) |
|
||||
this.tempFormList.forEach((item) => { |
|
||||
if (item.columnName === val) item.isChange = true |
|
||||
}) |
|
||||
}, |
|
||||
getOrgTreeList() { |
|
||||
const { user } = this.$store.state |
|
||||
this.$http |
|
||||
.post('/gov/org/customeragency/agencygridtree', {}) |
|
||||
.then(({ data: res }) => { |
|
||||
if (res.code !== 0) { |
|
||||
return this.$message.error(res.msg) |
|
||||
} else { |
|
||||
console.log('获取组织树成功', res.data) |
|
||||
this.orgOptions=[] |
|
||||
this.orgOptions .push( res.data) |
|
||||
} |
|
||||
}) |
|
||||
.catch(() => { |
|
||||
return this.$message.error('网络错误') |
|
||||
}) |
|
||||
}, |
|
||||
getGridList() { |
|
||||
const { user } = this.$store.state |
|
||||
this.$http |
|
||||
.post('/gov/org/customergrid/gridoption', { agencyId: user.agencyId, purpose: 'query' }) |
|
||||
.then(({ data: res }) => { |
|
||||
if (res.code !== 0) { |
|
||||
return this.$message.error(res.msg) |
|
||||
} else { |
|
||||
console.log('获取查询详情成功', res.data) |
|
||||
this.optionsG = res.data |
|
||||
} |
|
||||
}) |
|
||||
.catch(() => { |
|
||||
return this.$message.error('网络错误') |
|
||||
}) |
|
||||
}, |
|
||||
getValiheList() { |
|
||||
const { user } = this.$store.state |
|
||||
this.$http |
|
||||
.post('/actual/base/communityQuarters/listQuartersOptions', { |
|
||||
gridId: this.form.GRID_ID, |
|
||||
agencyId: this.form.AGENCY_ID, |
|
||||
// agencyId: user.agencyId |
|
||||
}) |
|
||||
.then(({ data: res }) => { |
|
||||
if (res.code !== 0) { |
|
||||
return this.$message.error(res.msg) |
|
||||
} else { |
|
||||
console.log('获取查询详情成功', res.data) |
|
||||
this.optionsV = res.data |
|
||||
} |
|
||||
}) |
|
||||
.catch(() => { |
|
||||
return this.$message.error('网络错误') |
|
||||
}) |
|
||||
}, |
|
||||
getBuildList() { |
|
||||
this.$http |
|
||||
.post('/actual/base/communityBuilding/buildingoption', { |
|
||||
quartersId: this.form.VILLAGE_ID |
|
||||
}) |
|
||||
.then(({ data: res }) => { |
|
||||
if (res.code !== 0) { |
|
||||
return this.$message.error(res.msg) |
|
||||
} else { |
|
||||
console.log('获取查询详情成功', res.data) |
|
||||
this.optionsB = res.data |
|
||||
} |
|
||||
}) |
|
||||
.catch(() => { |
|
||||
return this.$message.error('网络错误') |
|
||||
}) |
|
||||
}, |
|
||||
getUniList() { |
|
||||
this.$http |
|
||||
.post('/actual/base/communityBuildingUnit/unitoption', { |
|
||||
buildingId: this.form.BUILD_ID |
|
||||
}) |
|
||||
.then(({ data: res }) => { |
|
||||
if (res.code !== 0) { |
|
||||
return this.$message.error(res.msg) |
|
||||
} else { |
|
||||
console.log('获取查询详情成功', res.data) |
|
||||
this.optionsD = res.data |
|
||||
} |
|
||||
}) |
|
||||
.catch(() => { |
|
||||
return this.$message.error('网络错误') |
|
||||
}) |
|
||||
}, |
|
||||
getHouseList() { |
|
||||
this.$http |
|
||||
.post('/actual/base/communityHouse/houseoption', { unitId: this.form.UNIT_ID }) |
|
||||
.then(({ data: res }) => { |
|
||||
if (res.code !== 0) { |
|
||||
return this.$message.error(res.msg) |
|
||||
} else { |
|
||||
console.log('获取查询详情成功', res.data) |
|
||||
this.optionsH = res.data |
|
||||
} |
|
||||
}) |
|
||||
.catch(() => { |
|
||||
return this.$message.error('网络错误') |
|
||||
}) |
|
||||
}, |
|
||||
computedBirth(age) { |
|
||||
let now = new Date(); |
|
||||
let nowYear = now.getFullYear(); |
|
||||
let nowMonth = now.getMonth()+1; |
|
||||
let nowDay = now.getDate(); // 按照减法原理,先day相减,不够向month借;然后month相减,不够向year借;最后year相减。 |
|
||||
let subYear = nowYear - age |
|
||||
if(nowMonth < 10){ |
|
||||
nowMonth = '0'+ nowMonth |
|
||||
} |
|
||||
if(nowDay < 10){ |
|
||||
nowDay = '0' + nowDay |
|
||||
} |
|
||||
console.log(subYear+'-'+nowMonth+'-'+nowDay); |
|
||||
return subYear + '-' + nowMonth + '-' + nowDay |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
</script> |
|
||||
|
|
||||
<style lang="scss" scoped> |
|
||||
// .resi-container { |
|
||||
// position: relative; |
|
||||
// overflow: visible; |
|
||||
// } |
|
||||
// .resi-container .resi-card { |
|
||||
// position: relative; |
|
||||
// overflow: visible; |
|
||||
// } |
|
||||
.resi-down { |
|
||||
position: absolute; |
|
||||
left: 50%; |
|
||||
bottom: -10px; |
|
||||
display: flex; |
|
||||
justify-content: center; |
|
||||
align-items: center; |
|
||||
width: 46px; |
|
||||
height: 12px; |
|
||||
box-sizing: border-box; |
|
||||
margin-left: -23rpx; |
|
||||
cursor: pointer; |
|
||||
background: #ffffff; |
|
||||
border-radius: 0 0 10px 10px; |
|
||||
img { |
|
||||
display: block; |
|
||||
} |
|
||||
} |
|
||||
.resi-row-box { |
|
||||
height: 214px; |
|
||||
overflow: hidden; |
|
||||
transition: height 0.5s; |
|
||||
} |
|
||||
.resi-row-more { |
|
||||
height: max-content; |
|
||||
transition: height 0.5s; |
|
||||
} |
|
||||
.resi-row { |
|
||||
margin-bottom: 20px; |
|
||||
} |
|
||||
.resi-search { |
|
||||
// padding-right: 20px; |
|
||||
.el-col { |
|
||||
text-align: right; |
|
||||
} |
|
||||
} |
|
||||
.resi-container .resi-cell { |
|
||||
display: flex; |
|
||||
align-items: center; |
|
||||
.resi-cell-label { |
|
||||
flex-shrink: 0; |
|
||||
min-width: 70px; |
|
||||
box-sizing: border-box; |
|
||||
margin-right: 15px; |
|
||||
text-align: right; |
|
||||
// line-height: 32; |
|
||||
} |
|
||||
.resi-cell-label1 { |
|
||||
width: max-content; |
|
||||
} |
|
||||
.resi-cell-value-radio { |
|
||||
display: flex; |
|
||||
align-items: center; |
|
||||
min-height: 32px; |
|
||||
} |
|
||||
.resi-cell-input { |
|
||||
max-width: 200px; |
|
||||
} |
|
||||
.resi-cell--daterange { |
|
||||
max-width: 240px; |
|
||||
} |
|
||||
.resi-cell-select { |
|
||||
max-width: 200px; |
|
||||
box-sizing: border-box; |
|
||||
margin-right: 10px; |
|
||||
&-middle { |
|
||||
width: 130px; |
|
||||
} |
|
||||
&-small { |
|
||||
width: 88px; |
|
||||
} |
|
||||
} |
|
||||
.resi-cell-select:last-child { |
|
||||
margin-right: 0; |
|
||||
} |
|
||||
} |
|
||||
</style> |
|
||||
File diff suppressed because it is too large
Loading…
Reference in new issue