Browse Source

Merge branch 'yantai_dev' into dev

# Conflicts:
#	src/views/components/resiSearch.vue
dev
mk 3 years ago
parent
commit
94a999ee88
  1. 9
      src/views/components/rangeInput.vue
  2. 489
      src/views/components/resiSearch.vue
  3. 2
      src/views/modules/base/resi.vue
  4. 96
      src/views/modules/census/census-accountActiveList.vue
  5. 65
      src/views/modules/census/census-houseList.vue
  6. 8
      src/views/modules/census/census-residentList.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 () {

489
src/views/components/resiSearch.vue

@ -14,7 +14,6 @@
:options="orgOptions" :options="orgOptions"
:props="orgOptionProps" :props="orgOptionProps"
:show-all-levels="false" :show-all-levels="false"
collapse-tags
@change="handleChangeAgency"></el-cascader> @change="handleChangeAgency"></el-cascader>
</div> </div>
</div> </div>
@ -70,7 +69,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"
@ -91,7 +90,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"
@ -111,7 +110,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
@ -133,7 +132,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'"
@ -150,12 +154,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
@ -216,7 +224,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>
@ -230,8 +243,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">
@ -244,80 +261,82 @@
<script> <script>
import inputRange from './rangeInput.vue' import inputRange from './rangeInput.vue'
import Ar from 'element-ui/src/locale/lang/ar'
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 == 'agetoyear') { };
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: '',
GRID_IDS: '',
VILLAGE_ID: '', VILLAGE_ID: '',
BUILD_ID: '', BUILD_ID: '',
UNIT_ID: '', UNIT_ID: '',
HOME_ID: '' HOME_ID: ''
} }
let orgOptionProps = { let orgOptionProps = {
multiple: true,// 2023-04-06 multiple: false,
value: 'agencyId', value: 'agencyId',
label: 'agencyName', label: 'agencyName',
children: 'subAgencyList', children: 'subAgencyList',
checkStrictly: true, checkStrictly: true
} }
return { return {
@ -331,14 +350,12 @@ export default {
orgOptions: [], orgOptions: [],
orgOptionProps, orgOptionProps,
agencyIdArray: [], agencyIdArray: [],
value: '', value: "",
itemList, itemList,
fixedList: [], fixedList: [],
fixedForm: { fixedForm: {
AGENCY_ID: '', AGENCY_ID: '',
AGENCY_IDS: [],
GRID_ID: '', GRID_ID: '',
GRID_IDS: [],
VILLAGE_ID: '', VILLAGE_ID: '',
BUILD_ID: '', BUILD_ID: '',
UNIT_ID: '', UNIT_ID: '',
@ -348,9 +365,7 @@ export default {
form: { form: {
...form, ...form,
AGENCY_ID: '', AGENCY_ID: '',
AGENCY_IDS: [],
GRID_ID: '', GRID_ID: '',
GRID_IDS:[],
VILLAGE_ID: '', VILLAGE_ID: '',
BUILD_ID: '', BUILD_ID: '',
UNIT_ID: '', UNIT_ID: '',
@ -360,65 +375,66 @@ export default {
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':'list_equal' 'AGENCY_ID':'like'
} }
} }
}, },
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])
} }
return arrTemp arrTemp[index].push(data[i]);
} }
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: {
@ -427,128 +443,141 @@ 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.ageObj = {};
this. agencyIdArray=[] 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) console.log(arr);
const arr2 = arr.filter((item) => item.columnValue != null&& 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 (val.end) { if (type == "s") {
const s = this.computedBirth(val.end) this.ageObj.start = val.start;
const e = this.computedBirth(val.start) } else {
this.form.BIRTHDAY = [s, e] this.ageObj.end = val.end;
} }
// const s = this.computedBirth(val.end)
// const e = this.computedBirth(val.start)
}, },
handleChangeAgency(val) { handleChangeAgency(val) {
// let checkedNodes = this.$refs["myCascader"].getCheckedNodes()[0].data let obj = this.$refs["myCascader"].getCheckedNodes()[0].data
this.$nextTick(()=> { if (obj) {
let checkedNodes = this.$refs["myCascader"].getCheckedNodes(); if(obj.level === 'grid'){
if (checkedNodes) { this.form.GRID_ID = this.agencyIdArray.length > 0 ? this.agencyIdArray[this.agencyIdArray.length - 1] : '';
// this.form.AGENCY_ID=''
// 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);
}else{ }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{ }else{
this.form.AGENCY_IDS = [] this.form.AGENCY_ID=''
this.form.GRID_IDS = [] this.form.GRID_ID = ''
} }
this.form.VILLAGE_ID = '' this.form.VILLAGE_ID = ''
@ -556,9 +585,9 @@ export default {
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)
this.form.VILLAGE_ID = '' this.form.VILLAGE_ID = ''
this.form.BUILD_ID = '' this.form.BUILD_ID = ''
this.form.UNIT_ID = '' this.form.UNIT_ID = ''
@ -566,41 +595,34 @@ export default {
this.getValiheList() this.getValiheList()
}, },
handleChangeV(val) { handleChangeV(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
let valueInForm = this.form[val]
if (valueInForm instanceof Array) {
//
item.columnValue = valueInForm
} else {
//
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 {
@ -615,149 +637,156 @@ export default {
} }
_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: columnValue 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)
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', {
gridIds: this.form.GRID_IDS, gridId: this.form.GRID_ID,
agencyIds: this.form.AGENCY_IDS, 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) { if (nowDay < 10) {
nowDay = '0' + nowDay nowDay = "0" + nowDay;
}
console.log(subYear+'-'+nowMonth+'-'+nowDay);
return subYear + '-' + nowMonth + '-' + nowDay
}
}
} }
console.log(subYear + "-" + nowMonth + "-" + nowDay);
return subYear + "-" + nowMonth + "-" + nowDay;
},
},
};
</script> </script>
<style lang="scss" scope> <style lang="scss" scope>

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

@ -664,8 +664,8 @@ export default {
this.getTableData(); this.getTableData();
}, },
handleSearch (val) { handleSearch (val) {
console.log("searchhh--", val);
this.currentPage = 1; this.currentPage = 1;
console.log(val);
this.conditions = val; this.conditions = val;
this.getTableData(); this.getTableData();
}, },

96
src/views/modules/census/census-accountActiveList.vue

@ -72,6 +72,15 @@
<el-table-column prop="accountActivityCount" label="活跃账号数" align="center" :show-overflow-tooltip="true"></el-table-column> <el-table-column prop="accountActivityCount" label="活跃账号数" align="center" :show-overflow-tooltip="true"></el-table-column>
<el-table-column prop="accountCount" align="center" width="110" label="总账号数" :show-overflow-tooltip="true"></el-table-column> <el-table-column prop="accountCount" align="center" width="110" label="总账号数" :show-overflow-tooltip="true"></el-table-column>
</el-table> </el-table>
<el-pagination
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page.sync="pageNo"
:page-sizes="[10, 20, 50, 100, 200]"
:page-size="parseInt(pageSize)"
layout="sizes, prev, pager, next, total"
:total="total"
></el-pagination>
</div> </div>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
@ -99,6 +108,15 @@
<el-table-column label="序号" fixed="left" type="index" align="center" width="50" /> <el-table-column label="序号" fixed="left" type="index" align="center" width="50" />
<el-table-column prop="agencyName" align="center" label="组织名称" :show-overflow-tooltip="true"></el-table-column> <el-table-column prop="agencyName" align="center" label="组织名称" :show-overflow-tooltip="true"></el-table-column>
</el-table> </el-table>
<el-pagination
@size-change="handleSizeChange2"
@current-change="handleCurrentChange2"
:current-page.sync="pageNo2"
:page-sizes="[10, 20, 50, 100, 200]"
:page-size="parseInt(pageSize2)"
layout="sizes, prev, pager, next, total"
:total="total2"
></el-pagination>
</div> </div>
</el-col> </el-col>
</el-row> </el-row>
@ -155,17 +173,21 @@ export default {
value: 'agencyId' value: 'agencyId'
}, },
tableData: [], tableData: [],
tableData2: [],
formData: { formData: {
orgId: '', orgId: '',
startDate: '', startDate: '',
endDate: '' endDate: ''
}, },
orgId: '',
cateOptions: [], cateOptions: [],
eventTypeCheck: [], eventTypeCheck: [],
pageNo: 1, pageNo: 1,
pageSize: window.localStorage.getItem('pageSize') || 20, pageSize: window.localStorage.getItem('pageSize') || 20,
total: 1, pageNo2: 1,
pageSize2: window.localStorage.getItem('pageSize2') || 20,
total: 0,
total2: 0,
endPickerOptions: { endPickerOptions: {
disabledDate: endDisabledDate disabledDate: endDisabledDate
}, },
@ -177,16 +199,16 @@ export default {
}, },
computed: { computed: {
maxTableHeight() { maxTableHeight() {
return this.$store.state.inIframe ? this.clientHeight - 400 + this.iframeHeigh : this.clientHeight - 400; return this.$store.state.inIframe ? this.clientHeight - 439 + this.iframeHeigh : this.clientHeight - 439;
}, },
...mapGetters(['clientHeight', 'iframeHeight']) ...mapGetters(['clientHeight', 'iframeHeight'])
}, },
watch: { watch: {
'formData.endTime': function(val) { 'formData.endDate': function(val) {
if (val && val != '') { if (val && val != '') {
let arrayTemp = val.split(' '); let arrayTemp = val.split(' ');
this.formData.endTime = arrayTemp[0] + ' 23:59:59'; this.formData.endDate = arrayTemp[0] + ' 23:59:59';
} }
} }
}, },
@ -194,12 +216,31 @@ export default {
console.log(this.$store.state); console.log(this.$store.state);
this.user = this.$store.state.user; this.user = this.$store.state.user;
this.agencyId = this.user.agencyId; this.agencyId = this.user.agencyId;
this.orgId = this.agencyId;
this.getOrgTreeList(); this.getOrgTreeList();
this.getTableData(); this.getTableData();
this.getTableData2(); this.getTableData2();
this.getCountLevel(); this.getCountLevel();
}, },
methods: { methods: {
handleSizeChange(val) {
this.pageSize = val;
window.localStorage.setItem('pageSize', val);
this.getTableData();
},
handleCurrentChange(val) {
this.pageNo = val;
this.getTableData();
},
handleSizeChange2(val) {
this.pageSize2 = val;
window.localStorage.setItem('pageSize2', val);
this.getTableData2();
},
handleCurrentChange2(val) {
this.pageNo2 = val;
this.getTableData2();
},
handleChangeAgency(val) { handleChangeAgency(val) {
let obj = this.$refs['myCascader'].getCheckedNodes()[0].data; let obj = this.$refs['myCascader'].getCheckedNodes()[0].data;
console.log(obj); console.log(obj);
@ -209,11 +250,13 @@ export default {
handleSearch(val) { handleSearch(val) {
let tmp = this.formData.orgId; let tmp = this.formData.orgId;
if (!(tmp && typeof tmp != 'undefined' && tmp != 0 && tmp != null)) { if (!(tmp && typeof tmp != 'undefined' && tmp != 0 && tmp != null)) {
this.formData.orgId = ''; this.orgId = this.agencyId;
this.formData.level = ''; this.formData.level = '';
} else {
this.orgId = this.formData.orgId;
} }
console.log(this.formData); console.log(this.formData);
this.pageNo = 1; this.pageNo = 1;this.pageNo2 = 1;
this.getTableData(); this.getTableData();
this.getTableData2(); this.getTableData2();
this.getCountLevel(); this.getCountLevel();
@ -240,13 +283,17 @@ export default {
async handleExport(type) { async handleExport(type) {
const url = '/gov/org/staffLoginLog/accountActivityInfo-export'; const url = '/gov/org/staffLoginLog/accountActivityInfo-export';
const { formData } = this;
const { data, code, msg } = await requestPost(url, param);
axios({ axios({
url: window.SITE_CONFIG['apiURL'] + url, url: window.SITE_CONFIG['apiURL'] + url,
method: 'post', method: 'post',
data: { data: {
isActivity: type, isActivity: type,
...formData orgId: this.orgId,
startDate: this.formData.startDate,
endDate: this.formData.endDate
}, },
responseType: 'blob' responseType: 'blob'
}) })
@ -291,7 +338,7 @@ export default {
async getCountLevel() { async getCountLevel() {
const url = '/gov/org/staffLoginLog/getActivityTotal'; const url = '/gov/org/staffLoginLog/getActivityTotal';
// const url = 'http://yapi.elinkservice.cn/mock/356/gov/org/staffLoginLog/count-level'; // const url = 'http://yapi.elinkservice.cn/mock/356/gov/org/staffLoginLog/count-level';
let param = { ...this.formData }; let param = { orgId: this.orgId, startDate: this.formData.startDate, endDate: this.formData.endDate };
const { data, code, msg } = await requestPost(url, param); const { data, code, msg } = await requestPost(url, param);
console.log('getCountLeveldata', data); console.log('getCountLeveldata', data);
if (code === 0) { if (code === 0) {
@ -306,14 +353,20 @@ export default {
const url = '/gov/org/staffLoginLog/getAccountActivityInfo'; const url = '/gov/org/staffLoginLog/getAccountActivityInfo';
const { formData } = this; let param = {
const { data, code, msg } = await requestPost(url, { orgId: this.orgId,
startDate: this.formData.startDate,
endDate: this.formData.endDate,
isActivity: 1, isActivity: 1,
...formData isPage: true,
}); pageNo: this.pageNo,
pageSize: this.pageSize
};
const { data, code, msg } = await requestPost(url, param);
this.tableLoading = false; this.tableLoading = false;
if (code === 0) { if (code === 0) {
this.total = data.total || 0;
this.tableData = data.list this.tableData = data.list
? data.list.map(item => { ? data.list.map(item => {
return item; return item;
@ -328,14 +381,21 @@ export default {
const url = '/gov/org/staffLoginLog/getAccountActivityInfo'; const url = '/gov/org/staffLoginLog/getAccountActivityInfo';
const { formData } = this; let param = {
const { data, code, msg } = await requestPost(url, { orgId: this.orgId,
startDate: this.formData.startDate,
endDate: this.formData.endDate,
isActivity: 0, isActivity: 0,
...formData isPage: true,
}); pageNo: this.pageNo2,
pageSize: this.pageSize2
};
const { data, code, msg } = await requestPost(url, param);
this.tableLoading2 = false; this.tableLoading2 = false;
if (code === 0) { if (code === 0) {
this.total2 = data.total || 0;
console.log(this.total2)
this.tableData2 = data.list this.tableData2 = data.list
? data.list.map(item => { ? data.list.map(item => {
return item; return item;

65
src/views/modules/census/census-houseList.vue

@ -238,7 +238,8 @@ export default {
pieData2: [], pieData2: [],
orgId: '', orgId: '',
purpose: '', purpose: '',
rentFlag: '' rentFlag: '',
orgIdPath: ''
}; };
}, },
computed: { computed: {
@ -249,10 +250,10 @@ export default {
...mapGetters(['clientHeight', 'iframeHeight']) ...mapGetters(['clientHeight', 'iframeHeight'])
}, },
watch: { watch: {
'formData.endTime': function(val) { 'formData.endDate': function(val) {
if (val && val != '') { if (val && val != '') {
let arrayTemp = val.split(' '); let arrayTemp = val.split(' ');
this.formData.endTime = arrayTemp[0] + ' 23:59:59'; this.formData.endDate = arrayTemp[0] + ' 23:59:59';
} }
} }
}, },
@ -260,19 +261,15 @@ export default {
console.log(this.$store.state); console.log(this.$store.state);
this.user = this.$store.state.user; this.user = this.$store.state.user;
this.agencyId = this.user.agencyId; this.agencyId = this.user.agencyId;
this.orgId = this.agencyId;
this.getOrgTreeList(); this.getOrgTreeList();
this.getTableData();
this.getsubData();
this.getsubData2();
}, },
methods: { methods: {
show(row) { show(row) {
this.dialogVisible = true; this.dialogVisible = true;
this.pageType = 'view'; this.pageType = 'view';
this.detailId = row.houseId; this.detailId = row.houseId;
console.log('detailId', row);
console.log('detailId', this.detailId);
this.detailData = row; this.detailData = row;
}, },
handleClose() { handleClose() {
@ -290,7 +287,9 @@ export default {
const { data, code, msg } = await requestPost(url, { const { data, code, msg } = await requestPost(url, {
pageSize, pageSize,
pageNo, pageNo,
orgIdPath: this.orgId, orgIdPath: this.orgIdPath,
orgId: this.orgId,
orgType: this.orgType,
timeStart: this.formData.startDate, timeStart: this.formData.startDate,
timeEnd: this.formData.endDate, timeEnd: this.formData.endDate,
purpose: this.purpose, purpose: this.purpose,
@ -322,9 +321,11 @@ export default {
this.$refs.pieChart.showLoading(); this.$refs.pieChart.showLoading();
let url = '/gov/org/ichouse/getHousePurposeCount'; let url = '/gov/org/ichouse/getHousePurposeCount';
let param = { let param = {
orgIdPath: this.orgId, orgIdPath: this.orgIdPath,
timeStart: this.formData.startDate, timeStart: this.formData.startDate,
timeEnd: this.formData.endDate timeEnd: this.formData.endDate,
orgId: this.orgId,
orgType: this.orgType
}; };
const { data, code, msg } = await requestPost(url, param); const { data, code, msg } = await requestPost(url, param);
this.$refs.pieChart.hideLoading(); this.$refs.pieChart.hideLoading();
@ -339,15 +340,17 @@ export default {
this.$refs.pieChart2.showLoading(); this.$refs.pieChart2.showLoading();
let url = '/gov/org/ichouse/getHouseStatusCount'; let url = '/gov/org/ichouse/getHouseStatusCount';
let param = { let param = {
orgIdPath: this.orgId, orgIdPath: this.orgIdPath,
timeStart: this.formData.startDate, timeStart: this.formData.startDate,
timeEnd: this.formData.endDate timeEnd: this.formData.endDate,
orgId: this.orgId,
orgType: this.orgType
}; };
const { data, code, msg } = await requestPost(url, param); const { data, code, msg } = await requestPost(url, param);
this.$refs.pieChart2.hideLoading(); this.$refs.pieChart2.hideLoading();
if (code === 0) { if (code === 0) {
this.pieData2 = data; this.pieData2 = data;
console.log('this.pieData2', this.pieData2);
this.getPie2(); this.getPie2();
} else { } else {
this.$message.error(msg); this.$message.error(msg);
@ -398,11 +401,9 @@ export default {
}; };
}); });
console.log('chartData', this.chartData);
this.iniPieChart(this.chartData); this.iniPieChart(this.chartData);
}, },
setPieData2() { setPieData2() {
console.log(this.pieData2)
let data = [...this.pieData2.list]; let data = [...this.pieData2.list];
let type = { let type = {
1: '出租', 1: '出租',
@ -420,7 +421,6 @@ export default {
}; };
}); });
console.log('chartData', this.chartData2);
this.iniPieChart2(this.chartData2); this.iniPieChart2(this.chartData2);
}, },
// //
@ -660,11 +660,13 @@ export default {
data: { data: {
pageSize, pageSize,
pageNo, pageNo,
orgIdPath: this.orgId, orgIdPath: this.orgIdPath,
timeStart: this.formData.startDate, timeStart: this.formData.startDate,
timeEnd: this.formData.endDate, timeEnd: this.formData.endDate,
purpose: this.purpose, purpose: this.purpose,
rentFlag: this.rentFlag rentFlag: this.rentFlag,
orgId: this.orgId,
orgType: this.orgType
}, },
responseType: 'blob' responseType: 'blob'
}) })
@ -695,12 +697,19 @@ export default {
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); let data = res.data;
// let { agencyList, subAgencyList } = res.data; console.log('获取组织树成功', data);
// let { agencyList, subAgencyList } = data;
// const _arr = [{ ...agencyList, subAgencyList: [...subAgencyList] }]; // const _arr = [{ ...agencyList, subAgencyList: [...subAgencyList] }];
// this.orgOptions = this.deepTree(_arr); // this.orgOptions = this.deepTree(_arr);
this.orgOptions = []; this.orgOptions = [];
this.orgOptions.push(res.data); this.orgOptions.push(data);
this.orgId = data.agencyId;
this.orgIdPath = data.orgIdPath;
this.orgType = data.level;
this.getTableData();
this.getsubData();
this.getsubData2();
} }
}) })
.catch(() => { .catch(() => {
@ -716,16 +725,18 @@ export default {
this.getsubData2(); this.getsubData2();
}, },
handleChangeAgency(val) { handleChangeAgency(val) {
// let obj = this.$refs['myCascader'].getCheckedNodes()[0].data; let obj = this.$refs['myCascader'].getCheckedNodes()[0].data;
let tmp = this.formData.orgId; let tmp = this.formData.orgId;
if (tmp && typeof tmp != 'undefined' && tmp != 0 && tmp != null) { if (tmp && typeof tmp != 'undefined' && tmp != 0 && tmp != null) {
this.orgId = this.formData.orgId; this.orgId = this.formData.orgId;
this.orgIdPath = obj.orgIdPath;
this.orgType = obj.level;
} else { } else {
console.log('ww'); this.orgId = this.orgOptions.agencyId;
this.orgId = this.agencyId; this.orgIdPath = this.orgOptions.orgIdPath;
this.orgType = this.orgOptions.level;
} }
console.log('this.orgId', this.orgId);
}, },
deepTree(arr) { deepTree(arr) {

8
src/views/modules/census/census-residentList.vue

@ -605,24 +605,24 @@ export default {
}, },
handelClickMyPei(param) { handelClickMyPei(param) {
this.code = param.data.code; this.code = param.data.code;
this.codeType = 'education'; this.codeType = 'age';
this.getTableData(); this.getTableData();
}, },
handelClickMyPei2(param) { handelClickMyPei2(param) {
this.code = param.data.code; this.code = param.data.code;
this.codeType = 'age'; this.codeType = 'education';
this.getTableData(); this.getTableData();
}, },
handleClickItem(item) { handleClickItem(item) {
this.code = item.code; this.code = item.code;
this.codeType = 'education'; this.codeType = 'age';
this.getTableData(); this.getTableData();
}, },
handleClickItem2(item) { handleClickItem2(item) {
this.code = item.code; this.code = item.code;
this.codeType = 'age'; this.codeType = 'education';
this.getTableData(); this.getTableData();
}, },
async handleExport() { async handleExport() {

Loading…
Cancel
Save