Browse Source

bug#1963自动检查数据统计条件出现错误。数据不回显

luckysheet
mk 1 year ago
parent
commit
87b9dc98e7
  1. 160
      src/views/modules/base/smartExcel/cpts/export-search.vue
  2. 2
      src/views/modules/base/smartExcel/cpts/export-view.vue

160
src/views/modules/base/smartExcel/cpts/export-search.vue

@ -13,7 +13,7 @@
:props="orgOptionProps"
:show-all-levels="false"
@change="handleChangeAgency"
clearable :disabled="disabled"></el-cascader>
clearable ></el-cascader>
</el-form-item>
<el-form-item prop="villageId">
<div class="resi-cell">
@ -43,7 +43,7 @@
clearable
style="margin-left: 5px"
class="u-item-width-buildcascader"
:disabled="changeVDisabled"
:disabled=" disabled"
@clear="handleClearBuild"
@change="handleChangeB">
<el-option v-for="item in optionsB"
@ -53,7 +53,7 @@
</el-option>
</el-select>
<el-select v-model.trim="form.unitId"
:disabled="changeBDisabled"
:disabled="disabled"
placeholder="单元"
size="small"
filterable
@ -69,7 +69,7 @@
</el-option>
</el-select>
<el-select v-model.trim="form.homeId"
:disabled="changeDDisabled"
:disabled="disabled"
placeholder="房号"
size="small"
filterable
@ -949,15 +949,35 @@ export default {
if (this.columnName) this.handleChangeForm(this.columnName)
},
mounted(){
this.$nextTick(()=>{
this.$nextTick( async ()=>{
if(this.infoObj){
this.form = this.infoObj;
if(this.infoObj.agencyId){
await this.getOrgTreeList()
this.cascaderAgencyId =this.findParentIds(this.orgOptions, this.infoObj.agencyId);
await this.getValiheList()
await this.getBuildList()
await this.getUniList()
await this.getHouseList()
}
}
})
},
methods: {
findParentIds(tree, targetId, parentIds = []) {
for (let node of tree) {
if (node.agencyId === targetId) {
return parentIds;
}
if (node.subAgencyList) {
const result = this.findParentIds(node.subAgencyList, targetId, [...parentIds, node.agencyId]);
if (result) {
return result;
}
}
}
return null;
},
handleCategoryChange(newVal, oldVal) {
console.log(newVal, oldVal,"slkdfjlfj");
let formCopy = JSON.parse(JSON.stringify(this.form));
@ -1162,91 +1182,79 @@ export default {
if (item.columnName === val) item.isChange = true
})
},
getOrgTreeList() {
this.$http
.post('/gov/org/customeragency/agencygridtree', {})
.then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
} else {
this.orgOptions = []
this.orgOptions.push(res.data)
}
})
.catch(() => {
return this.$message.error('网络错误')
})
async getOrgTreeList() {
try {
const { data: res } = await this.$http.post('/gov/org/customeragency/agencygridtree', {});
if (res.code !== 0) {
return this.$message.error(res.msg);
}
this.orgOptions = [];
this.orgOptions.push(res.data);
} catch (error) {
return this.$message.error('网络错误');
}
},
loadmore() {
this.optionsVPageNo++;
this.getValiheList();
},
getValiheList() {
this.$http
.post('/actual/base/communityQuarters/listQuartersOptions', {
async getValiheList() {
try {
const { data: res } = await this.$http.post('/actual/base/communityQuarters/listQuartersOptions', {
gridId: this.form.agencyId,
agencyId: this.$store.state.user.agencyId,
pageNo: this.optionsVPageNo,
pageSize: 20
// agencyId: user.agencyId
})
.then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
} else {
this.optionsV = [...this.optionsV, ...res.data];
}
})
.catch(() => {
return this.$message.error('网络错误')
})
});
if (res.code !== 0) {
return this.$message.error(res.msg);
}
this.optionsV = [...this.optionsV, ...res.data];
} catch (error) {
return this.$message.error('网络错误');
}
},
getBuildList() {
this.$http
.post('/actual/base/communityBuilding/buildingoption', {
async getBuildList() {
try {
const { data: res } = await this.$http.post('/actual/base/communityBuilding/buildingoption', {
quartersId: this.form.villageId
})
.then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
} else {
this.optionsB = res.data
}
})
.catch(() => {
return this.$message.error('网络错误')
})
});
if (res.code !== 0) {
return this.$message.error(res.msg);
}
this.optionsB = res.data;
} catch (error) {
return this.$message.error('网络错误');
}
},
getUniList() {
this.$http
.post('/actual/base/communityBuildingUnit/unitoption', {
async getUniList() {
try {
const { data: res } = await this.$http.post('/actual/base/communityBuildingUnit/unitoption', {
buildingId: this.form.buildId
})
.then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
} else {
this.optionsD = res.data
}
})
.catch(() => {
return this.$message.error('网络错误')
})
});
if (res.code !== 0) {
return this.$message.error(res.msg);
}
this.optionsD = res.data;
} catch (error) {
return this.$message.error('网络错误');
}
},
getHouseList() {
this.$http
.post('/actual/base/communityHouse/houseoption', { buildingId: this.form.buildId, unitId: this.form.unitId })
.then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
} else {
this.optionsH = res.data
}
})
.catch(() => {
return this.$message.error('网络错误')
})
async getHouseList() {
try {
const { data: res } = await this.$http.post('/actual/base/communityHouse/houseoption', {
buildingId: this.form.buildId,
unitId: this.form.unitId
});
if (res.code !== 0) {
return this.$message.error(res.msg);
}
this.optionsH = res.data;
} catch (error) {
return this.$message.error('网络错误');
}
},
getTreeData(data) {
if (!Array.isArray(data)) return [];

2
src/views/modules/base/smartExcel/cpts/export-view.vue

@ -509,7 +509,7 @@ export default {
this.currentTable = newArrar.filter(item => item.status == '1');
if(list){
if(this.currentTable[0].data.length <= list.length){
luckysheet.insertRow(this.currentTable[0].data.length, { number: list.length - this.currentTable[0].data.length + 5 });
luckysheet.insertRow(this.currentTable[0].data.length, { number: list.length - this.currentTable[0].data.length + 5 });
}else if(list.length !== 0 && this.currentTable[0].data.length !== 1){
luckysheet.deleteRow(list.length, this.currentTable[0].data.length )
}

Loading…
Cancel
Save