Browse Source

居民信息年龄columnName空

dev
mk 3 years ago
parent
commit
6c00b46dea
  1. 9
      src/views/components/rangeInput.vue
  2. 587
      src/views/components/resiSearch.vue
  3. 6
      src/views/modules/base/resi.vue

9
src/views/components/rangeInput.vue

@ -10,7 +10,7 @@
:type="inputType" :type="inputType"
clearable clearable
placeholder="请输入" placeholder="请输入"
@change="handleChange" /> @change="handleChange($event,'s')" />
</el-form-item> </el-form-item>
<div class="div_middle">-</div> <div class="div_middle">-</div>
<el-form-item prop="end"> <el-form-item prop="end">
@ -20,7 +20,7 @@
:type="inputType" :type="inputType"
clearable clearable
placeholder="请输入" placeholder="请输入"
@change="handleChange" @change="handleChange($event,'e')"
@blur="handleBlur" /> @blur="handleBlur" />
</el-form-item> </el-form-item>
</div> </div>
@ -87,10 +87,9 @@ export default {
}, },
}, },
methods: { methods: {
handleChange (val) { handleChange (val,type) {
// if () // if ()
this.$emit('change', { ...this.inputForm }) this.$emit('change', { ...this.inputForm },type)
}, },
handleBlur () { handleBlur () {

587
src/views/components/resiSearch.vue

@ -7,18 +7,20 @@
<div class="resi-cell"> <div class="resi-cell">
<div class="resi-cell-label">所属组织</div> <div class="resi-cell-label">所属组织</div>
<div class="resi-cell-value"> <div class="resi-cell-value">
<el-cascader class="customer_cascader" <el-cascader
class="customer_cascader"
ref="myCascader" ref="myCascader"
v-model="agencyIdArray" v-model="agencyIdArray"
filterable filterable
:options="orgOptions" :options="orgOptions"
:props="orgOptionProps" :props="orgOptionProps"
:show-all-levels="false" :show-all-levels="false"
@change="handleChangeAgency"></el-cascader> @change="handleChangeAgency"
></el-cascader>
</div> </div>
</div> </div>
</el-col> </el-col>
<!-- <el-col :span="6"> <!-- <el-col :span="6">
<div class="resi-cell"> <div class="resi-cell">
<div class="resi-cell-label">所属网格</div> <div class="resi-cell-label">所属网格</div>
<div class="resi-cell-value"> <div class="resi-cell-value">
@ -69,7 +71,7 @@
size="small" size="small"
filterable filterable
clearable clearable
style="width: 120px;" style="width: 120px"
class="resi-cell-select" class="resi-cell-select"
:disabled="changeVDisabled" :disabled="changeVDisabled"
@clear="handleClearBuild" @clear="handleClearBuild"
@ -90,7 +92,7 @@
size="small" size="small"
filterable filterable
clearable clearable
style="width: 120px;" style="width: 120px"
class="resi-cell-select" class="resi-cell-select"
@click="handleClearDan" @click="handleClearDan"
@change="handleChangeD" @change="handleChangeD"
@ -110,7 +112,7 @@
size="small" size="small"
filterable filterable
clearable clearable
style="width: 120px;" style="width: 120px"
class="resi-cell-select" class="resi-cell-select"
> >
<el-option <el-option
@ -132,7 +134,12 @@
> >
<el-col v-for="n in item" :key="n.id" :span="computdSpan(item.length)"> <el-col v-for="n in item" :key="n.id" :span="computdSpan(item.length)">
<div class="resi-cell"> <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 <div
class="resi-cell-value" class="resi-cell-value"
:class="n.itemType === 'radio' && 'resi-cell-value-radio'" :class="n.itemType === 'radio' && 'resi-cell-value-radio'"
@ -149,12 +156,16 @@
<template v-else-if="n.itemType == 'inputRange'"> <template v-else-if="n.itemType == 'inputRange'">
<!-- <el-input <!-- <el-input
v-model.trim="form[n.columnName]" v-model.trim="form[n.columnName]"
class="resi-cell-input" class="resi-cell-input"F
size="small" size="small"
clearable clearable
placeholder="请输入内容" placeholder="请输入内容"
/> --> /> -->
<inputRange v-model="form[n.columnName]" :type="n.validType" @change="handleAgeChange" /> <inputRange
v-model="ageObj"
:type="n.validType"
@change="handleAgeChange"
/>
</template> </template>
<template v-else-if="n.itemType === 'datepicker'"> <template v-else-if="n.itemType === 'datepicker'">
<el-date-picker <el-date-picker
@ -215,7 +226,12 @@
</el-cascader> </el-cascader>
<template v-else-if="n.itemType === 'checkbox'"> <template v-else-if="n.itemType === 'checkbox'">
<el-checkbox-group v-model="form[n.columnName]"> <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 label="n.la"></el-checkbox> -->
</el-checkbox-group> </el-checkbox-group>
</template> </template>
@ -229,8 +245,12 @@
<el-button type="primary" size="mini">查询</el-button> <el-button type="primary" size="mini">查询</el-button>
</el-col> --> </el-col> -->
<el-col :span="24"> <el-col :span="24">
<el-button type="primary" size="small" @click="handleSearch">查询</el-button> <el-button type="primary" size="small" @click="handleSearch"
<el-button class="diy-button--reset" size="small" @click="resetForm">重置</el-button> >查询</el-button
>
<el-button class="diy-button--reset" size="small" @click="resetForm"
>重置</el-button
>
</el-col> </el-col>
</el-row> </el-row>
<!-- <div v-if="isArrow" class="resi-down" @click="handleOpenSearch"> <!-- <div v-if="isArrow" class="resi-down" @click="handleOpenSearch">
@ -242,79 +262,84 @@
</template> </template>
<script> <script>
import inputRange from './rangeInput.vue' import inputRange from "./rangeInput.vue";
export default { export default {
name: 'ResiSearch', name: "ResiSearch",
components: { components: {
inputRange inputRange,
}, },
props: { props: {
formList: { formList: {
type: Array, type: Array,
default: () => [] default: () => [],
}, },
columnName: { columnName: {
type: String, type: String,
default: '' default: "",
}, },
showGrid: { showGrid: {
type: Boolean, type: Boolean,
default: false default: false,
}, },
isArrow: { isArrow: {
type: Boolean, type: Boolean,
default: false default: false,
} },
}, },
data() { data() {
let initForm = (arr, columnName) => { let initForm = (arr, columnName) => {
let _form = {} let _form = {};
// console.log('formInfo', obj) // console.log('formInfo', obj)
// if (Object.keys(obj).length > 0) { // if (Object.keys(obj).length > 0) {
// _form = { ...obj } // _form = { ...obj }
// return _form // return _form
// } // }
arr.forEach((item) => { arr.forEach((item) => {
if (item.itemType == 'checkbox') _form[item.columnName] = [] if (item.itemType == "checkbox") _form[item.columnName] = [];
else if (item.queryType == 'resi_category' && columnName ){ else if (item.queryType == "resi_category" && columnName) {
_form[item.columnName] = [columnName] _form[item.columnName] = [columnName];
} else if (columnName && columnName === item.columnName) _form[item.columnName] = '1' } else if (columnName && columnName === item.columnName)
else if (item.itemType == 'inputRange') _form[item.columnName] = { start: '', end: ''} _form[item.columnName] = "1";
else _form[item.columnName] = '' else if (item.itemType == "inputRange")
}) _form[item.columnName] = { start: "", end: "" };
return _form else _form[item.columnName] = "";
} });
let itemList = this.formList.map(item => { return _form;
if (item.itemType == 'inputRange' && item.funType == '') { };
item.columnName = 'age' let itemList = this.formList.map((item) => {
if (item.itemType == "inputRange" && item.funType == "") {
item.columnName = "age";
} }
return { return {
...item ...item,
} };
}) });
let form = initForm(itemList, this.columnName) let form = initForm(itemList, this.columnName);
let tempFormList = itemList.map(item => { let tempFormList = itemList.map((item) => {
return { return {
...item, ...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 = { let constForm = {
...form, ...form,
GRID_ID: '', GRID_ID: "",
VILLAGE_ID: '', VILLAGE_ID: "",
BUILD_ID: '', BUILD_ID: "",
UNIT_ID: '', UNIT_ID: "",
HOME_ID: '' HOME_ID: "",
} };
let orgOptionProps = { let orgOptionProps = {
multiple: false, multiple: false,
value: 'agencyId', value: "agencyId",
label: 'agencyName', label: "agencyName",
children: 'subAgencyList', children: "subAgencyList",
checkStrictly: true checkStrictly: true,
} };
return { return {
pageLoading: false, pageLoading: false,
@ -326,91 +351,93 @@ export default {
optionsG: [], optionsG: [],
orgOptions: [], orgOptions: [],
orgOptionProps, orgOptionProps,
agencyIdArray:[], agencyIdArray: [],
value: '', value: "",
itemList, itemList,
fixedList: [], fixedList: [],
fixedForm: { fixedForm: {
AGENCY_ID: '', AGENCY_ID: "",
GRID_ID: '', GRID_ID: "",
VILLAGE_ID: '', VILLAGE_ID: "",
BUILD_ID: '', BUILD_ID: "",
UNIT_ID: '', UNIT_ID: "",
HOME_ID: '' HOME_ID: "",
}, },
constForm, constForm,
form: { form: {
...form, ...form,
AGENCY_ID: '', AGENCY_ID: "",
GRID_ID: '', GRID_ID: "",
VILLAGE_ID: '', VILLAGE_ID: "",
BUILD_ID: '', BUILD_ID: "",
UNIT_ID: '', UNIT_ID: "",
HOME_ID: '' HOME_ID: "",
}, },
tempFormList, tempFormList,
pickerOptions: { pickerOptions: {
shortcuts: [ shortcuts: [
{ {
text: '最近一周', text: "最近一周",
onClick(picker) { onClick(picker) {
const end = new Date() const end = new Date();
const start = new Date() const start = new Date();
start.setTime(start.getTime() - 3600 * 1000 * 24 * 7) start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
picker.$emit('pick', [start, end]) picker.$emit("pick", [start, end]);
} },
}, },
{ {
text: '最近一个月', text: "最近一个月",
onClick(picker) { onClick(picker) {
const end = new Date() const end = new Date();
const start = new Date() const start = new Date();
start.setTime(start.getTime() - 3600 * 1000 * 24 * 30) start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
picker.$emit('pick', [start, end]) picker.$emit("pick", [start, end]);
} },
}, },
{ {
text: '最近三个月', text: "最近三个月",
onClick(picker) { onClick(picker) {
const end = new Date() const end = new Date();
const start = new Date() const start = new Date();
start.setTime(start.getTime() - 3600 * 1000 * 24 * 90) start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
picker.$emit('pick', [start, end]) picker.$emit("pick", [start, end]);
} },
} },
] ],
}, },
queryType:{ queryType: {
'AGENCY_ID':'like' AGENCY_ID: "like",
} },
} ageObj: {},
};
}, },
computed: { computed: {
sliceList() { sliceList() {
return function (data, count) { return function (data, count) {
console.log(data);
if (data !== undefined) { if (data !== undefined) {
let index = 0 let index = 0;
let arrTemp = [] let arrTemp = [];
for (let i = 0; i < data.length; i++) { for (let i = 0; i < data.length; i++) {
index = parseInt(i / count) index = parseInt(i / count);
if (arrTemp.length <= index) { if (arrTemp.length <= index) {
arrTemp.push([]) arrTemp.push([]);
} }
arrTemp[index].push(data[i]) arrTemp[index].push(data[i]);
}
return arrTemp
} }
return arrTemp;
} }
};
}, },
changeVDisabled () { changeVDisabled() {
return !this.form.VILLAGE_ID return !this.form.VILLAGE_ID;
}, },
changeBDisabled () { changeBDisabled() {
return !this.form.BUILD_ID return !this.form.BUILD_ID;
}, },
changeDDisabled () { changeDDisabled() {
return !this.form.UNIT_ID return !this.form.UNIT_ID;
}, },
}, },
watch: { watch: {
@ -419,310 +446,344 @@ export default {
// console.log('valpppp----', val, val2) // console.log('valpppp----', val, val2)
for (let n in val) { for (let n in val) {
if (this.constForm[n] !== val[n]) { if (this.constForm[n] !== val[n]) {
this.handleChangeForm(n) this.handleChangeForm(n);
console.log('nnnnnn', n) console.log("nnnnnn", n);
} }
} }
this.constForm = { ...val } this.constForm = { ...val };
}, },
deep: true deep: true,
}
}, },
created () { },
created() {
// this.initForm() // this.initForm()
// console.log('formcccc---', this.form) // console.log('formcccc---', this.form)
this.getOrgTreeList() this.getOrgTreeList();
this.getGridList() this.getGridList();
this.getValiheList() this.getValiheList();
if (this.columnName) this.handleChangeForm(this.columnName) if (this.columnName) this.handleChangeForm(this.columnName);
}, },
methods: { methods: {
initForm() { initForm() {
this.formList.forEach((item) => { this.formList.forEach((item) => {
this.$set(this.form, item.columnName, '') this.$set(this.form, item.columnName, "");
}) });
console.log('formcccc---', this.form) console.log("formcccc---", this.form);
}, },
computdSpan(len) { computdSpan(len) {
return len == 1 ? 24 : 6 return len == 1 ? 24 : 6;
}, },
handleClearVillage() { handleClearVillage() {
this.form.BUILD_ID = '' this.form.BUILD_ID = "";
this.form.HOME_ID = '' this.form.HOME_ID = "";
}, },
handleClearBuild() { handleClearBuild() {
this.form.BUILD_ID = '' this.form.BUILD_ID = "";
this.form.UNIT_ID = '' this.form.UNIT_ID = "";
this.form.HOME_ID = '' this.form.HOME_ID = "";
}, },
handleClearDan() { handleClearDan() {
this.form.UNIT_ID = '' this.form.UNIT_ID = "";
this.form.HOME_ID = '' this.form.HOME_ID = "";
}, },
resetForm(formName) { resetForm(formName) {
for(const n in this.form) { for (const n in this.form) {
if (n == 'age') { if (typeof this.form[n] == "object") this.form[n] = [];
this.form.age = { else this.form[n] = "";
start: '',
end: ''
}
} else if (typeof this.form[n] == 'object') this.form[n] = []
else this.form[n] = ''
} }
this. agencyIdArray=[]
this.ageObj = {};
this.agencyIdArray = [];
// let arr3 = [...arr1, ...arr] // let arr3 = [...arr1, ...arr]
this.$emit('search', []) this.$emit("search", []);
// this.handleSearch() // this.handleSearch()
// this.orgOptions = []; // this.orgOptions = [];
}, },
handleSearch() { handleSearch() {
// console.log('formmmmm---', this.form) // console.log('formmmmm---', this.form)
const itemTypes = ['daterange', 'timerange', 'checkbox'] const itemTypes = ["daterange", "timerange", "checkbox"];
let a = this.tempFormList.filter(item => item.itemType != 'inputRange') let a = this.tempFormList.filter((item) => item.itemType != "inputRange");
let arr = a.filter((n) => n.isChange).map((item) => { let arr = a
.filter((n) => n.isChange)
.map((item) => {
return { return {
queryType: item.queryType, queryType: item.queryType,
tableName: item.tableName, tableName: item.tableName,
columnName: item.columnName, columnName: item.columnName,
// columnValue: [] // columnValue: []
columnValue: this.form[item.columnName] && columnValue:
this.form[item.columnName] &&
(itemTypes.includes(item.queryType) || (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]
: [this.form[item.columnName].toString()]) : [this.form[item.columnName].toString()]),
} };
}) });
const arr2 = arr.filter(item => item.columnValue.length > 0) const arr2 = arr.filter((item) => item.columnValue.length > 0);
let arr1 = this.fixedList let arr1 = this.fixedList
.filter((n) => n.columnValue.length > 0) .filter((n) => n.columnValue.length > 0)
.map((item) => { .map((item) => {
return { 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() { handleOpenSearch() {
this.openSearch = !this.openSearch this.openSearch = !this.openSearch;
}, },
handleAgeChange(val) { handleAgeChange(val, type) {
console.log('val----age---', val) 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 s = this.computedBirth(val.end)
// const e = this.computedBirth(val.start) // const e = this.computedBirth(val.start)
this.form.BIRTHDAY = [val.start,val.end ]
}, },
handleChangeAgency(val) { handleChangeAgency(val) {
let obj = this.$refs["myCascader"].getCheckedNodes()[0].data let obj = this.$refs["myCascader"].getCheckedNodes()[0].data;
if (obj) { if (obj) {
if(obj.level === 'grid'){ if (obj.level === "grid") {
this.form.GRID_ID = this.agencyIdArray.length > 0 ? this.agencyIdArray[this.agencyIdArray.length - 1] : ''; this.form.GRID_ID =
this.form.AGENCY_ID='' this.agencyIdArray.length > 0
}else{ ? this.agencyIdArray[this.agencyIdArray.length - 1]
this.form.AGENCY_ID = this.agencyIdArray.length > 0 ? this.agencyIdArray[this.agencyIdArray.length - 1] : ''; : "";
this.form.GRID_ID = '' this.form.AGENCY_ID = "";
} else {
this.form.AGENCY_ID =
this.agencyIdArray.length > 0
? this.agencyIdArray[this.agencyIdArray.length - 1]
: "";
this.form.GRID_ID = "";
} }
} else {
}else{ this.form.AGENCY_ID = "";
this.form.AGENCY_ID='' this.form.GRID_ID = "";
this.form.GRID_ID = ''
} }
this.form.VILLAGE_ID = '' this.form.VILLAGE_ID = "";
this.form.BUILD_ID = '' this.form.BUILD_ID = "";
this.form.UNIT_ID = '' this.form.UNIT_ID = "";
this.form.HOME_ID = '' this.form.HOME_ID = "";
this.getValiheList() this.getValiheList();
}, },
handleChangeGrid(val) { handleChangeGrid(val) {
console.log('val', val) console.log("val", val);
this.form.VILLAGE_ID = '' this.form.VILLAGE_ID = "";
this.form.BUILD_ID = '' this.form.BUILD_ID = "";
this.form.UNIT_ID = '' this.form.UNIT_ID = "";
this.form.HOME_ID = '' this.form.HOME_ID = "";
this.getValiheList() this.getValiheList();
}, },
handleChangeV(val) { handleChangeV(val) {
console.log('val', val) console.log("val", val);
this.form.BUILD_ID = '' this.form.BUILD_ID = "";
this.form.UNIT_ID = '' this.form.UNIT_ID = "";
this.form.HOME_ID = '' this.form.HOME_ID = "";
this.getBuildList() this.getBuildList();
}, },
handleChangeB(val) { handleChangeB(val) {
console.log('val', val) console.log("val", val);
this.form.UNIT_ID = '' this.form.UNIT_ID = "";
this.form.HOME_ID = '' this.form.HOME_ID = "";
this.getUniList() this.getUniList();
}, },
handleChangeD(val) { handleChangeD(val) {
console.log('val', val) console.log("val", val);
this.form.HOME_ID = '' this.form.HOME_ID = "";
this.getHouseList() this.getHouseList();
}, },
// form // form
handleChangeForm(val) { handleChangeForm(val) {
for (let n in this.fixedForm) { for (let n in this.fixedForm) {
if (n === val) { if (n === val) {
if (this.fixedList.length > 0) { if (this.fixedList.length > 0) {
let _item = {} let _item = {};
let hasVal = false let hasVal = false;
this.fixedList.forEach((item, index) => { this.fixedList.forEach((item, index) => {
if (item.columnName == val) { if (item.columnName == val) {
hasVal = true hasVal = true;
item.columnValue[0] = this.form[val] item.columnValue[0] = this.form[val];
if (!this.form[val]) this.fixedList.splice(index, 1) if (!this.form[val]) this.fixedList.splice(index, 1);
console.log('fixedList----val', this.fixedList) console.log("fixedList----val", this.fixedList);
} else { } else {
_item = { _item = {
queryType: this.queryType[val]?this.queryType[val]:'equal',//'equal', queryType: this.queryType[val]
tableName: 'ic_resi_user', ? this.queryType[val]
: "equal", //'equal',
tableName: "ic_resi_user",
columnName: val, columnName: val,
columnValue: [this.form[val]] columnValue: [this.form[val]],
} };
console.log('fixedList----else', _item) console.log("fixedList----else", _item);
// this.$set(this.fixedList, index, _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 { } else {
this.$set(this.fixedList, 0, { this.$set(this.fixedList, 0, {
queryType: this.queryType[val]?this.queryType[val]:'equal',//'equal', queryType: this.queryType[val] ? this.queryType[val] : "equal", //'equal',
tableName: 'ic_resi_user', tableName: "ic_resi_user",
columnName: val, columnName: val,
columnValue: [this.form[val]] columnValue: [this.form[val]],
}) });
} }
} }
} }
console.log('fixedList----999', this.fixedList) console.log("fixedList----999", this.fixedList);
this.tempFormList.forEach((item) => { this.tempFormList.forEach((item) => {
if (item.columnName === val) item.isChange = true if (item.columnName === val) item.isChange = true;
}) });
}, },
getOrgTreeList() { getOrgTreeList() {
const { user } = this.$store.state const { user } = this.$store.state;
this.$http this.$http
.post('/gov/org/customeragency/agencygridtree', {}) .post("/gov/org/customeragency/agencygridtree", {})
.then(({ data: res }) => { .then(({ data: res }) => {
if (res.code !== 0) { if (res.code !== 0) {
return this.$message.error(res.msg) return this.$message.error(res.msg);
} else { } else {
console.log('获取组织树成功', res.data) console.log("获取组织树成功", res.data);
this.orgOptions=[] this.orgOptions = [];
this.orgOptions .push( res.data) this.orgOptions.push(res.data);
} }
}) })
.catch(() => { .catch(() => {
return this.$message.error('网络错误') return this.$message.error("网络错误");
}) });
}, },
getGridList() { getGridList() {
const { user } = this.$store.state const { user } = this.$store.state;
this.$http 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 }) => { .then(({ data: res }) => {
if (res.code !== 0) { if (res.code !== 0) {
return this.$message.error(res.msg) return this.$message.error(res.msg);
} else { } else {
console.log('获取查询详情成功', res.data) console.log("获取查询详情成功", res.data);
this.optionsG = res.data this.optionsG = res.data;
} }
}) })
.catch(() => { .catch(() => {
return this.$message.error('网络错误') return this.$message.error("网络错误");
}) });
}, },
getValiheList() { getValiheList() {
const { user } = this.$store.state const { user } = this.$store.state;
this.$http this.$http
.post('/gov/org/icneighborhood/neighborhoodoption', { .post("/gov/org/icneighborhood/neighborhoodoption", {
gridId: this.form.GRID_ID, gridId: this.form.GRID_ID,
agencyId: this.form.AGENCY_ID, agencyId: this.form.AGENCY_ID,
// agencyId: user.agencyId // agencyId: user.agencyId
}) })
.then(({ data: res }) => { .then(({ data: res }) => {
if (res.code !== 0) { if (res.code !== 0) {
return this.$message.error(res.msg) return this.$message.error(res.msg);
} else { } else {
console.log('获取查询详情成功', res.data) console.log("获取查询详情成功", res.data);
this.optionsV = res.data this.optionsV = res.data;
} }
}) })
.catch(() => { .catch(() => {
return this.$message.error('网络错误') return this.$message.error("网络错误");
}) });
}, },
getBuildList() { getBuildList() {
this.$http this.$http
.post('/gov/org/icbuilding/buildingoption', { .post("/gov/org/icbuilding/buildingoption", {
neighborHoodId: this.form.VILLAGE_ID neighborHoodId: this.form.VILLAGE_ID,
}) })
.then(({ data: res }) => { .then(({ data: res }) => {
if (res.code !== 0) { if (res.code !== 0) {
return this.$message.error(res.msg) return this.$message.error(res.msg);
} else { } else {
console.log('获取查询详情成功', res.data) console.log("获取查询详情成功", res.data);
this.optionsB = res.data this.optionsB = res.data;
} }
}) })
.catch(() => { .catch(() => {
return this.$message.error('网络错误') return this.$message.error("网络错误");
}) });
}, },
getUniList() { getUniList() {
this.$http this.$http
.post('/gov/org/icbuildingunit/unitoption', { .post("/gov/org/icbuildingunit/unitoption", {
buildingId: this.form.BUILD_ID buildingId: this.form.BUILD_ID,
}) })
.then(({ data: res }) => { .then(({ data: res }) => {
if (res.code !== 0) { if (res.code !== 0) {
return this.$message.error(res.msg) return this.$message.error(res.msg);
} else { } else {
console.log('获取查询详情成功', res.data) console.log("获取查询详情成功", res.data);
this.optionsD = res.data this.optionsD = res.data;
} }
}) })
.catch(() => { .catch(() => {
return this.$message.error('网络错误') return this.$message.error("网络错误");
}) });
}, },
getHouseList() { getHouseList() {
this.$http 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 }) => { .then(({ data: res }) => {
if (res.code !== 0) { if (res.code !== 0) {
return this.$message.error(res.msg) return this.$message.error(res.msg);
} else { } else {
console.log('获取查询详情成功', res.data) console.log("获取查询详情成功", res.data);
this.optionsH = res.data this.optionsH = res.data;
} }
}) })
.catch(() => { .catch(() => {
return this.$message.error('网络错误') return this.$message.error("网络错误");
}) });
}, },
computedBirth(age) { computedBirth(age) {
let now = new Date(); let now = new Date();
let nowYear = now.getFullYear(); let nowYear = now.getFullYear();
let nowMonth = now.getMonth()+1; let nowMonth = now.getMonth() + 1;
let nowDay = now.getDate(); // daymonthmonthyearyear let nowDay = now.getDate(); // daymonthmonthyearyear
let subYear = nowYear - age let subYear = nowYear - age;
if(nowMonth < 10){ if (nowMonth < 10) {
nowMonth = '0'+ nowMonth nowMonth = "0" + nowMonth;
}
if(nowDay < 10){
nowDay = '0' + nowDay
} }
console.log(subYear+'-'+nowMonth+'-'+nowDay); if (nowDay < 10) {
return subYear + '-' + nowMonth + '-' + nowDay nowDay = "0" + nowDay;
} }
} console.log(subYear + "-" + nowMonth + "-" + nowDay);
} return subYear + "-" + nowMonth + "-" + nowDay;
},
},
};
</script> </script>
<style lang="scss" scope> <style lang="scss" scope>

6
src/views/modules/base/resi.vue

@ -670,11 +670,7 @@ export default {
}, },
handleSearch (val) { handleSearch (val) {
this.currentPage = 1; this.currentPage = 1;
val.forEach(item=>{ console.log(val);
if(item.columnName == "BIRTHDAY"){
item.queryType = 'agerange'
}
})
this.conditions = val; this.conditions = val;
this.getTableData(); this.getTableData();
}, },

Loading…
Cancel
Save