|
|
|
@ -14,7 +14,6 @@ |
|
|
|
:options="orgOptions" |
|
|
|
:props="orgOptionProps" |
|
|
|
:show-all-levels="false" |
|
|
|
collapse-tags |
|
|
|
@change="handleChangeAgency"></el-cascader> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
@ -70,7 +69,7 @@ |
|
|
|
size="small" |
|
|
|
filterable |
|
|
|
clearable |
|
|
|
style="width: 120px;" |
|
|
|
style="width: 120px" |
|
|
|
class="resi-cell-select" |
|
|
|
:disabled="changeVDisabled" |
|
|
|
@clear="handleClearBuild" |
|
|
|
@ -91,7 +90,7 @@ |
|
|
|
size="small" |
|
|
|
filterable |
|
|
|
clearable |
|
|
|
style="width: 120px;" |
|
|
|
style="width: 120px" |
|
|
|
class="resi-cell-select" |
|
|
|
@click="handleClearDan" |
|
|
|
@change="handleChangeD" |
|
|
|
@ -111,7 +110,7 @@ |
|
|
|
size="small" |
|
|
|
filterable |
|
|
|
clearable |
|
|
|
style="width: 120px;" |
|
|
|
style="width: 120px" |
|
|
|
class="resi-cell-select" |
|
|
|
> |
|
|
|
<el-option |
|
|
|
@ -133,7 +132,12 @@ |
|
|
|
> |
|
|
|
<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-label" |
|
|
|
:class="item.length != 4 && 'resi-cell-label1'" |
|
|
|
> |
|
|
|
{{ n.label }} |
|
|
|
</div> |
|
|
|
<div |
|
|
|
class="resi-cell-value" |
|
|
|
:class="n.itemType === 'radio' && 'resi-cell-value-radio'" |
|
|
|
@ -150,12 +154,16 @@ |
|
|
|
<template v-else-if="n.itemType == 'inputRange'"> |
|
|
|
<!-- <el-input |
|
|
|
v-model.trim="form[n.columnName]" |
|
|
|
class="resi-cell-input" |
|
|
|
class="resi-cell-input"F |
|
|
|
size="small" |
|
|
|
clearable |
|
|
|
placeholder="请输入内容" |
|
|
|
/> --> |
|
|
|
<inputRange v-model="form[n.columnName]" :type="n.validType" @change="handleAgeChange" /> |
|
|
|
<inputRange |
|
|
|
v-model="ageObj" |
|
|
|
:type="n.validType" |
|
|
|
@change="handleAgeChange" |
|
|
|
/> |
|
|
|
</template> |
|
|
|
<template v-else-if="n.itemType === 'datepicker'"> |
|
|
|
<el-date-picker |
|
|
|
@ -216,7 +224,12 @@ |
|
|
|
</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 |
|
|
|
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> |
|
|
|
@ -230,8 +243,12 @@ |
|
|
|
<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-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"> |
|
|
|
@ -244,80 +261,82 @@ |
|
|
|
|
|
|
|
<script> |
|
|
|
import inputRange from './rangeInput.vue' |
|
|
|
import Ar from 'element-ui/src/locale/lang/ar' |
|
|
|
export default { |
|
|
|
name: 'ResiSearch', |
|
|
|
name: "ResiSearch", |
|
|
|
components: { |
|
|
|
inputRange |
|
|
|
inputRange, |
|
|
|
}, |
|
|
|
props: { |
|
|
|
formList: { |
|
|
|
type: Array, |
|
|
|
default: () => [] |
|
|
|
default: () => [], |
|
|
|
}, |
|
|
|
columnName: { |
|
|
|
type: String, |
|
|
|
default: '' |
|
|
|
default: "", |
|
|
|
}, |
|
|
|
showGrid: { |
|
|
|
type: Boolean, |
|
|
|
default: false |
|
|
|
default: false, |
|
|
|
}, |
|
|
|
isArrow: { |
|
|
|
type: Boolean, |
|
|
|
default: false |
|
|
|
} |
|
|
|
default: false, |
|
|
|
}, |
|
|
|
}, |
|
|
|
data() { |
|
|
|
let initForm = (arr, columnName) => { |
|
|
|
let _form = {} |
|
|
|
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' |
|
|
|
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 == "") { |
|
|
|
item.columnName = "age"; |
|
|
|
} |
|
|
|
return { |
|
|
|
...item |
|
|
|
} |
|
|
|
}) |
|
|
|
let form = initForm(itemList, this.columnName) |
|
|
|
let tempFormList = itemList.map(item => { |
|
|
|
|
|
|
|
...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 |
|
|
|
} |
|
|
|
}) |
|
|
|
isChange: |
|
|
|
(item.queryType == "resi_category" && this.columnName) || |
|
|
|
this.columnName === item.columnName |
|
|
|
? true |
|
|
|
: false, |
|
|
|
}; |
|
|
|
}); |
|
|
|
let constForm = { |
|
|
|
...form, |
|
|
|
GRID_ID: '', |
|
|
|
GRID_IDS: '', |
|
|
|
VILLAGE_ID: '', |
|
|
|
BUILD_ID: '', |
|
|
|
UNIT_ID: '', |
|
|
|
HOME_ID: '' |
|
|
|
} |
|
|
|
let orgOptionProps = { |
|
|
|
multiple: true,// 市北项目开启多选,2023-04-06 |
|
|
|
multiple: false, |
|
|
|
value: 'agencyId', |
|
|
|
label: 'agencyName', |
|
|
|
children: 'subAgencyList', |
|
|
|
checkStrictly: true, |
|
|
|
|
|
|
|
checkStrictly: true |
|
|
|
} |
|
|
|
|
|
|
|
return { |
|
|
|
@ -331,14 +350,12 @@ export default { |
|
|
|
orgOptions: [], |
|
|
|
orgOptionProps, |
|
|
|
agencyIdArray: [], |
|
|
|
value: '', |
|
|
|
value: "", |
|
|
|
itemList, |
|
|
|
fixedList: [], |
|
|
|
fixedForm: { |
|
|
|
AGENCY_ID: '', |
|
|
|
AGENCY_IDS: [], |
|
|
|
GRID_ID: '', |
|
|
|
GRID_IDS: [], |
|
|
|
VILLAGE_ID: '', |
|
|
|
BUILD_ID: '', |
|
|
|
UNIT_ID: '', |
|
|
|
@ -348,9 +365,7 @@ export default { |
|
|
|
form: { |
|
|
|
...form, |
|
|
|
AGENCY_ID: '', |
|
|
|
AGENCY_IDS: [], |
|
|
|
GRID_ID: '', |
|
|
|
GRID_IDS:[], |
|
|
|
VILLAGE_ID: '', |
|
|
|
BUILD_ID: '', |
|
|
|
UNIT_ID: '', |
|
|
|
@ -360,65 +375,66 @@ export default { |
|
|
|
pickerOptions: { |
|
|
|
shortcuts: [ |
|
|
|
{ |
|
|
|
text: '最近一周', |
|
|
|
text: "最近一周", |
|
|
|
onClick(picker) { |
|
|
|
const end = new Date() |
|
|
|
const start = new Date() |
|
|
|
start.setTime(start.getTime() - 3600 * 1000 * 24 * 7) |
|
|
|
picker.$emit('pick', [start, end]) |
|
|
|
} |
|
|
|
const end = new Date(); |
|
|
|
const start = new Date(); |
|
|
|
start.setTime(start.getTime() - 3600 * 1000 * 24 * 7); |
|
|
|
picker.$emit("pick", [start, end]); |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
text: '最近一个月', |
|
|
|
text: "最近一个月", |
|
|
|
onClick(picker) { |
|
|
|
const end = new Date() |
|
|
|
const start = new Date() |
|
|
|
start.setTime(start.getTime() - 3600 * 1000 * 24 * 30) |
|
|
|
picker.$emit('pick', [start, end]) |
|
|
|
} |
|
|
|
const end = new Date(); |
|
|
|
const start = new Date(); |
|
|
|
start.setTime(start.getTime() - 3600 * 1000 * 24 * 30); |
|
|
|
picker.$emit("pick", [start, end]); |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
text: '最近三个月', |
|
|
|
text: "最近三个月", |
|
|
|
onClick(picker) { |
|
|
|
const end = new Date() |
|
|
|
const start = new Date() |
|
|
|
start.setTime(start.getTime() - 3600 * 1000 * 24 * 90) |
|
|
|
picker.$emit('pick', [start, end]) |
|
|
|
} |
|
|
|
} |
|
|
|
] |
|
|
|
const end = new Date(); |
|
|
|
const start = new Date(); |
|
|
|
start.setTime(start.getTime() - 3600 * 1000 * 24 * 90); |
|
|
|
picker.$emit("pick", [start, end]); |
|
|
|
}, |
|
|
|
}, |
|
|
|
], |
|
|
|
}, |
|
|
|
|
|
|
|
queryType:{ |
|
|
|
'AGENCY_ID':'list_equal' |
|
|
|
'AGENCY_ID':'like' |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
computed: { |
|
|
|
sliceList() { |
|
|
|
return function (data, count) { |
|
|
|
console.log(data); |
|
|
|
if (data !== undefined) { |
|
|
|
let index = 0 |
|
|
|
let arrTemp = [] |
|
|
|
let index = 0; |
|
|
|
let arrTemp = []; |
|
|
|
for (let i = 0; i < data.length; i++) { |
|
|
|
index = parseInt(i / count) |
|
|
|
index = parseInt(i / count); |
|
|
|
if (arrTemp.length <= index) { |
|
|
|
arrTemp.push([]) |
|
|
|
} |
|
|
|
arrTemp[index].push(data[i]) |
|
|
|
arrTemp.push([]); |
|
|
|
} |
|
|
|
return arrTemp |
|
|
|
arrTemp[index].push(data[i]); |
|
|
|
} |
|
|
|
return arrTemp; |
|
|
|
} |
|
|
|
}; |
|
|
|
}, |
|
|
|
changeVDisabled() { |
|
|
|
return !this.form.VILLAGE_ID |
|
|
|
return !this.form.VILLAGE_ID; |
|
|
|
}, |
|
|
|
changeBDisabled() { |
|
|
|
return !this.form.BUILD_ID |
|
|
|
return !this.form.BUILD_ID; |
|
|
|
}, |
|
|
|
changeDDisabled() { |
|
|
|
return !this.form.UNIT_ID |
|
|
|
return !this.form.UNIT_ID; |
|
|
|
}, |
|
|
|
}, |
|
|
|
watch: { |
|
|
|
@ -427,128 +443,141 @@ export default { |
|
|
|
// console.log('valpppp----', val, val2) |
|
|
|
for (let n in val) { |
|
|
|
if (this.constForm[n] !== val[n]) { |
|
|
|
this.handleChangeForm(n) |
|
|
|
console.log('nnnnnn', n) |
|
|
|
this.handleChangeForm(n); |
|
|
|
console.log("nnnnnn", n); |
|
|
|
} |
|
|
|
} |
|
|
|
this.constForm = { ...val } |
|
|
|
this.constForm = { ...val }; |
|
|
|
}, |
|
|
|
deep: true, |
|
|
|
}, |
|
|
|
deep: true |
|
|
|
} |
|
|
|
}, |
|
|
|
created() { |
|
|
|
// this.initForm() |
|
|
|
// console.log('formcccc---', this.form) |
|
|
|
this.getOrgTreeList() |
|
|
|
this.getGridList() |
|
|
|
this.getValiheList() |
|
|
|
if (this.columnName) this.handleChangeForm(this.columnName) |
|
|
|
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) |
|
|
|
this.$set(this.form, item.columnName, ""); |
|
|
|
}); |
|
|
|
console.log("formcccc---", this.form); |
|
|
|
}, |
|
|
|
computdSpan(len) { |
|
|
|
return len == 1 ? 24 : 6 |
|
|
|
return len == 1 ? 24 : 6; |
|
|
|
}, |
|
|
|
handleClearVillage() { |
|
|
|
this.form.BUILD_ID = '' |
|
|
|
this.form.HOME_ID = '' |
|
|
|
this.form.BUILD_ID = ""; |
|
|
|
this.form.HOME_ID = ""; |
|
|
|
}, |
|
|
|
handleClearBuild() { |
|
|
|
this.form.BUILD_ID = '' |
|
|
|
this.form.UNIT_ID = '' |
|
|
|
this.form.HOME_ID = '' |
|
|
|
this.form.BUILD_ID = ""; |
|
|
|
this.form.UNIT_ID = ""; |
|
|
|
this.form.HOME_ID = ""; |
|
|
|
}, |
|
|
|
handleClearDan() { |
|
|
|
this.form.UNIT_ID = '' |
|
|
|
this.form.HOME_ID = '' |
|
|
|
this.form.UNIT_ID = ""; |
|
|
|
this.form.HOME_ID = ""; |
|
|
|
}, |
|
|
|
resetForm(formName) { |
|
|
|
for (const n in this.form) { |
|
|
|
if (n == 'age') { |
|
|
|
this.form.age = { |
|
|
|
start: '', |
|
|
|
end: '' |
|
|
|
if (typeof this.form[n] == "object") this.form[n] = []; |
|
|
|
else this.form[n] = ""; |
|
|
|
} |
|
|
|
} else if (typeof this.form[n] == 'object') this.form[n] = [] |
|
|
|
else this.form[n] = '' |
|
|
|
|
|
|
|
} |
|
|
|
this. agencyIdArray=[] |
|
|
|
this.ageObj = {}; |
|
|
|
this.agencyIdArray = []; |
|
|
|
// let arr3 = [...arr1, ...arr] |
|
|
|
this.$emit('search', []) |
|
|
|
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) => { |
|
|
|
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] && |
|
|
|
columnValue: |
|
|
|
this.form[item.columnName] && |
|
|
|
(itemTypes.includes(item.queryType) || |
|
|
|
itemTypes.includes(item.itemType) || item.multiSelect == 1 |
|
|
|
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) |
|
|
|
: [this.form[item.columnName].toString()]), |
|
|
|
}; |
|
|
|
}); |
|
|
|
console.log(arr); |
|
|
|
const arr2 = arr.filter((item) => item.columnValue != null&& item.columnValue.length > 0); |
|
|
|
let arr1 = this.fixedList |
|
|
|
.filter((n) => n.columnValue.length > 0) |
|
|
|
.map((item) => { |
|
|
|
return { |
|
|
|
...item |
|
|
|
...item, |
|
|
|
}; |
|
|
|
}); |
|
|
|
let arr3 = []; |
|
|
|
var objKey = JSON.stringify(this.ageObj) == "{}"; |
|
|
|
if (objKey) { |
|
|
|
arr3 = [...arr1, ...arr2]; |
|
|
|
this.$emit("search", arr3); |
|
|
|
return arr3; |
|
|
|
} else { |
|
|
|
let temp = []; |
|
|
|
for (let i in this.ageObj) { |
|
|
|
temp.push(this.ageObj[i]); |
|
|
|
} |
|
|
|
let arr4 = [ |
|
|
|
{ |
|
|
|
columnName: "", |
|
|
|
columnValue: temp, |
|
|
|
queryType: "agerange", |
|
|
|
tableName: "ic_resi_user", |
|
|
|
}, |
|
|
|
]; |
|
|
|
arr3 = [...arr1, ...arr2, ...arr4]; |
|
|
|
|
|
|
|
this.$emit("search", arr3); |
|
|
|
return arr3; |
|
|
|
} |
|
|
|
}) |
|
|
|
let arr3 = [...arr1, ...arr2] |
|
|
|
this.$emit('search', arr3) |
|
|
|
return arr3 |
|
|
|
}, |
|
|
|
handleOpenSearch() { |
|
|
|
this.openSearch = !this.openSearch |
|
|
|
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] |
|
|
|
handleAgeChange(val, type) { |
|
|
|
console.log("val----age---", val); |
|
|
|
if (type == "s") { |
|
|
|
this.ageObj.start = val.start; |
|
|
|
} else { |
|
|
|
this.ageObj.end = val.end; |
|
|
|
} |
|
|
|
// const s = this.computedBirth(val.end) |
|
|
|
// const e = this.computedBirth(val.start) |
|
|
|
}, |
|
|
|
handleChangeAgency(val) { |
|
|
|
// let checkedNodes = this.$refs["myCascader"].getCheckedNodes()[0].data |
|
|
|
this.$nextTick(()=> { |
|
|
|
let checkedNodes = this.$refs["myCascader"].getCheckedNodes(); |
|
|
|
if (checkedNodes) { |
|
|
|
//市北定制化需求,组织与网格多选 |
|
|
|
// this.form.GRID_IDS.push(obj.agencyId); |
|
|
|
// this.form.AGENCY_IDS.push( obj.pid); |
|
|
|
|
|
|
|
// 清空旧的数组,重新组装 |
|
|
|
this.form.GRID_IDS = []; |
|
|
|
this.form.AGENCY_IDS = []; |
|
|
|
|
|
|
|
for (let i in checkedNodes) { |
|
|
|
let nodeData = checkedNodes[i].data; |
|
|
|
if (nodeData.level == 'grid') { |
|
|
|
this.form.GRID_IDS.push(nodeData.agencyId); |
|
|
|
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_IDS.push(nodeData.agencyId); |
|
|
|
} |
|
|
|
this.form.AGENCY_ID = this.agencyIdArray.length > 0 ? this.agencyIdArray[this.agencyIdArray.length - 1] : ''; |
|
|
|
this.form.GRID_ID = '' |
|
|
|
} |
|
|
|
|
|
|
|
}else{ |
|
|
|
this.form.AGENCY_IDS = [] |
|
|
|
this.form.GRID_IDS = [] |
|
|
|
this.form.AGENCY_ID='' |
|
|
|
this.form.GRID_ID = '' |
|
|
|
} |
|
|
|
|
|
|
|
this.form.VILLAGE_ID = '' |
|
|
|
@ -556,9 +585,9 @@ export default { |
|
|
|
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 = '' |
|
|
|
@ -566,41 +595,34 @@ export default { |
|
|
|
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() |
|
|
|
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() |
|
|
|
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 |
|
|
|
let _item = {}; |
|
|
|
let hasVal = false; |
|
|
|
this.fixedList.forEach((item, index) => { |
|
|
|
if (item.columnName == val) { |
|
|
|
hasVal = true |
|
|
|
let valueInForm = this.form[val] |
|
|
|
if (valueInForm instanceof Array) { |
|
|
|
// 如果参数本身就是数组,直接赋值 |
|
|
|
item.columnValue = valueInForm |
|
|
|
} else { |
|
|
|
// 如果参数不是数组,构造为数组 |
|
|
|
item.columnValue[0] = this.form[val] |
|
|
|
} |
|
|
|
if (!this.form[val]) this.fixedList.splice(index, 1) |
|
|
|
console.log('fixedList----val', this.fixedList) |
|
|
|
} else { |
|
|
|
@ -615,149 +637,156 @@ export default { |
|
|
|
} |
|
|
|
|
|
|
|
_item = { |
|
|
|
queryType: this.queryType[val]?this.queryType[val]:'equal',//'equal', |
|
|
|
tableName: 'ic_resi_user', |
|
|
|
queryType: this.queryType[val] |
|
|
|
? this.queryType[val] |
|
|
|
: "equal", //'equal', |
|
|
|
tableName: "ic_resi_user", |
|
|
|
columnName: val, |
|
|
|
columnValue: columnValue |
|
|
|
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) |
|
|
|
}); |
|
|
|
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', |
|
|
|
queryType: this.queryType[val] ? this.queryType[val] : "equal", //'equal', |
|
|
|
tableName: "ic_resi_user", |
|
|
|
columnName: val, |
|
|
|
columnValue: [this.form[val]] |
|
|
|
}) |
|
|
|
columnValue: [this.form[val]], |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
console.log('fixedList----999', this.fixedList) |
|
|
|
this.tempFormList.forEach((item) => { |
|
|
|
if (item.columnName === val) item.isChange = true |
|
|
|
}) |
|
|
|
if (item.columnName === val) item.isChange = true; |
|
|
|
}); |
|
|
|
}, |
|
|
|
getOrgTreeList() { |
|
|
|
const { user } = this.$store.state |
|
|
|
const { user } = this.$store.state; |
|
|
|
this.$http |
|
|
|
.post('/gov/org/customeragency/agencygridtree', {}) |
|
|
|
.post("/gov/org/customeragency/agencygridtree", {}) |
|
|
|
.then(({ data: res }) => { |
|
|
|
if (res.code !== 0) { |
|
|
|
return this.$message.error(res.msg) |
|
|
|
return this.$message.error(res.msg); |
|
|
|
} else { |
|
|
|
console.log('获取组织树成功', res.data) |
|
|
|
this.orgOptions=[] |
|
|
|
this.orgOptions .push( res.data) |
|
|
|
console.log("获取组织树成功", res.data); |
|
|
|
this.orgOptions = []; |
|
|
|
this.orgOptions.push(res.data); |
|
|
|
} |
|
|
|
}) |
|
|
|
.catch(() => { |
|
|
|
return this.$message.error('网络错误') |
|
|
|
}) |
|
|
|
return this.$message.error("网络错误"); |
|
|
|
}); |
|
|
|
}, |
|
|
|
getGridList() { |
|
|
|
const { user } = this.$store.state |
|
|
|
const { user } = this.$store.state; |
|
|
|
this.$http |
|
|
|
.post('/gov/org/customergrid/gridoption', { agencyId: user.agencyId, purpose: 'query' }) |
|
|
|
.post("/gov/org/customergrid/gridoption", { |
|
|
|
agencyId: user.agencyId, |
|
|
|
purpose: "query", |
|
|
|
}) |
|
|
|
.then(({ data: res }) => { |
|
|
|
if (res.code !== 0) { |
|
|
|
return this.$message.error(res.msg) |
|
|
|
return this.$message.error(res.msg); |
|
|
|
} else { |
|
|
|
console.log('获取查询详情成功', res.data) |
|
|
|
this.optionsG = res.data |
|
|
|
console.log("获取查询详情成功", res.data); |
|
|
|
this.optionsG = res.data; |
|
|
|
} |
|
|
|
}) |
|
|
|
.catch(() => { |
|
|
|
return this.$message.error('网络错误') |
|
|
|
}) |
|
|
|
return this.$message.error("网络错误"); |
|
|
|
}); |
|
|
|
}, |
|
|
|
getValiheList() { |
|
|
|
const { user } = this.$store.state |
|
|
|
const { user } = this.$store.state; |
|
|
|
this.$http |
|
|
|
.post('/gov/org/icneighborhood/neighborhoodoption', { |
|
|
|
gridIds: this.form.GRID_IDS, |
|
|
|
agencyIds: this.form.AGENCY_IDS, |
|
|
|
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) |
|
|
|
return this.$message.error(res.msg); |
|
|
|
} else { |
|
|
|
console.log('获取查询详情成功', res.data) |
|
|
|
this.optionsV = res.data |
|
|
|
console.log("获取查询详情成功", res.data); |
|
|
|
this.optionsV = res.data; |
|
|
|
} |
|
|
|
}) |
|
|
|
.catch(() => { |
|
|
|
return this.$message.error('网络错误') |
|
|
|
}) |
|
|
|
return this.$message.error("网络错误"); |
|
|
|
}); |
|
|
|
}, |
|
|
|
getBuildList() { |
|
|
|
this.$http |
|
|
|
.post('/gov/org/icbuilding/buildingoption', { |
|
|
|
neighborHoodId: this.form.VILLAGE_ID |
|
|
|
.post("/gov/org/icbuilding/buildingoption", { |
|
|
|
neighborHoodId: this.form.VILLAGE_ID, |
|
|
|
}) |
|
|
|
.then(({ data: res }) => { |
|
|
|
if (res.code !== 0) { |
|
|
|
return this.$message.error(res.msg) |
|
|
|
return this.$message.error(res.msg); |
|
|
|
} else { |
|
|
|
console.log('获取查询详情成功', res.data) |
|
|
|
this.optionsB = res.data |
|
|
|
console.log("获取查询详情成功", res.data); |
|
|
|
this.optionsB = res.data; |
|
|
|
} |
|
|
|
}) |
|
|
|
.catch(() => { |
|
|
|
return this.$message.error('网络错误') |
|
|
|
}) |
|
|
|
return this.$message.error("网络错误"); |
|
|
|
}); |
|
|
|
}, |
|
|
|
getUniList() { |
|
|
|
this.$http |
|
|
|
.post('/gov/org/icbuildingunit/unitoption', { |
|
|
|
buildingId: this.form.BUILD_ID |
|
|
|
.post("/gov/org/icbuildingunit/unitoption", { |
|
|
|
buildingId: this.form.BUILD_ID, |
|
|
|
}) |
|
|
|
.then(({ data: res }) => { |
|
|
|
if (res.code !== 0) { |
|
|
|
return this.$message.error(res.msg) |
|
|
|
return this.$message.error(res.msg); |
|
|
|
} else { |
|
|
|
console.log('获取查询详情成功', res.data) |
|
|
|
this.optionsD = res.data |
|
|
|
console.log("获取查询详情成功", res.data); |
|
|
|
this.optionsD = res.data; |
|
|
|
} |
|
|
|
}) |
|
|
|
.catch(() => { |
|
|
|
return this.$message.error('网络错误') |
|
|
|
}) |
|
|
|
return this.$message.error("网络错误"); |
|
|
|
}); |
|
|
|
}, |
|
|
|
getHouseList() { |
|
|
|
this.$http |
|
|
|
.post('/gov/org/ichouse/houseoption', { unitId: this.form.UNIT_ID }) |
|
|
|
.post("/gov/org/ichouse/houseoption", { unitId: this.form.UNIT_ID }) |
|
|
|
.then(({ data: res }) => { |
|
|
|
if (res.code !== 0) { |
|
|
|
return this.$message.error(res.msg) |
|
|
|
return this.$message.error(res.msg); |
|
|
|
} else { |
|
|
|
console.log('获取查询详情成功', res.data) |
|
|
|
this.optionsH = res.data |
|
|
|
console.log("获取查询详情成功", res.data); |
|
|
|
this.optionsH = res.data; |
|
|
|
} |
|
|
|
}) |
|
|
|
.catch(() => { |
|
|
|
return this.$message.error('网络错误') |
|
|
|
}) |
|
|
|
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 |
|
|
|
let subYear = nowYear - age; |
|
|
|
if (nowMonth < 10) { |
|
|
|
nowMonth = '0'+ nowMonth |
|
|
|
nowMonth = "0" + nowMonth; |
|
|
|
} |
|
|
|
if (nowDay < 10) { |
|
|
|
nowDay = '0' + nowDay |
|
|
|
} |
|
|
|
console.log(subYear+'-'+nowMonth+'-'+nowDay); |
|
|
|
return subYear + '-' + nowMonth + '-' + nowDay |
|
|
|
} |
|
|
|
} |
|
|
|
nowDay = "0" + nowDay; |
|
|
|
} |
|
|
|
console.log(subYear + "-" + nowMonth + "-" + nowDay); |
|
|
|
return subYear + "-" + nowMonth + "-" + nowDay; |
|
|
|
}, |
|
|
|
}, |
|
|
|
}; |
|
|
|
</script> |
|
|
|
|
|
|
|
<style lang="scss" scope> |
|
|
|
|