|
|
@ -1,32 +1,18 @@ |
|
|
// subpages/house/pages/housePortrait/housePortrait.js
|
|
|
// subpages/house/pages/housePortrait/housePortrait.js
|
|
|
import api from "../../../../utils/api" |
|
|
import api from "../../../../utils/api" |
|
|
|
|
|
import { getComplainList, getShengList, getPunchRecord, getShequList, getshijianList, getxuqiuList, getfuwuList, getMultiLogList } from "../../../../utils/businessRecords"; |
|
|
Page({ |
|
|
Page({ |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* 页面的初始数据 |
|
|
* 页面的初始数据 |
|
|
*/ |
|
|
*/ |
|
|
data: { |
|
|
data: { |
|
|
|
|
|
houseId: '', |
|
|
detail: {}, |
|
|
detail: {}, |
|
|
logs: [ |
|
|
logs: [], |
|
|
{ |
|
|
residIds: [], |
|
|
"resiName": "栈-1-1-101-001", |
|
|
ywData: {}, |
|
|
"operatorName": "王显章6", |
|
|
ywVisible: false, |
|
|
"type": "edit", |
|
|
|
|
|
"typeName": "修改", |
|
|
|
|
|
"beforeChange": "是否低保户:是,", |
|
|
|
|
|
"afterChange": "是否低保户:否,", |
|
|
|
|
|
"changeTime": "2024-02-21 16:43:05" |
|
|
|
|
|
}, |
|
|
|
|
|
{ |
|
|
|
|
|
"resiName": "栈-1-1-101-001", |
|
|
|
|
|
"operatorName": "王显章6", |
|
|
|
|
|
"type": "edit", |
|
|
|
|
|
"typeName": "修改", |
|
|
|
|
|
"beforeChange": "是否特殊人群:否,", |
|
|
|
|
|
"afterChange": "是否特殊人群:是,", |
|
|
|
|
|
"changeTime": "2024-02-20 17:58:27" |
|
|
|
|
|
}, |
|
|
|
|
|
] |
|
|
|
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
@ -38,21 +24,29 @@ Page({ |
|
|
}) |
|
|
}) |
|
|
this.getData() |
|
|
this.getData() |
|
|
}, |
|
|
}, |
|
|
getData() {// this.data.houseId
|
|
|
getData() { |
|
|
api.getClearHouseDeatilById(this.data.houseId).then((res) => { |
|
|
api.getClearHouseDeatilById(this.data.houseId).then((res) => { |
|
|
this.setData({ |
|
|
this.setData({ |
|
|
detail: res.data |
|
|
detail: res.data |
|
|
}) |
|
|
}) |
|
|
}).catch((error) => { |
|
|
}).catch((error) => { |
|
|
}); |
|
|
}); |
|
|
// this.data.houseId
|
|
|
api.houseResidentChangeRecord({ houseId: this.data.houseId }).then((res) => { |
|
|
api.getLogList({ resiId: this.data.houseId }).then((res) => { |
|
|
|
|
|
this.setData({ |
|
|
this.setData({ |
|
|
logs: res.data.list |
|
|
logs: res.data |
|
|
}) |
|
|
}) |
|
|
}).catch((error) => { |
|
|
}).catch((error) => { |
|
|
console.error("发生错误:", error); |
|
|
console.error("发生错误:", error); |
|
|
}); |
|
|
}); |
|
|
|
|
|
api.getResiList({ homeId: this.data.houseId, pageNo: 1, pageSize: 1000 }).then(res => { |
|
|
|
|
|
const arr = res.data.list.map(item => { |
|
|
|
|
|
return item.resiId |
|
|
|
|
|
}) |
|
|
|
|
|
this.setData({ |
|
|
|
|
|
residIds: arr, |
|
|
|
|
|
}) |
|
|
|
|
|
this.getTabData() |
|
|
|
|
|
}) |
|
|
}, |
|
|
}, |
|
|
/** |
|
|
/** |
|
|
* 生命周期函数--监听页面初次渲染完成 |
|
|
* 生命周期函数--监听页面初次渲染完成 |
|
|
@ -105,9 +99,174 @@ Page({ |
|
|
|
|
|
|
|
|
gotopage({ currentTarget: { dataset } }) { |
|
|
gotopage({ currentTarget: { dataset } }) { |
|
|
const { url } = dataset |
|
|
const { url } = dataset |
|
|
console.log(url) |
|
|
|
|
|
wx.navigateTo({ |
|
|
wx.navigateTo({ |
|
|
url |
|
|
url |
|
|
}) |
|
|
}) |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
async getTabData() { |
|
|
|
|
|
if (this.data.residIds.length === 0) { |
|
|
|
|
|
this.setData({ |
|
|
|
|
|
ywVisible: true, |
|
|
|
|
|
ywData: { "12345": [], "provinceSurvey": [], "selfSurvey": [], "event": [], "need": [], "serve": [], "punchRecord": [] } |
|
|
|
|
|
}) |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
|
|
|
let params1 = { |
|
|
|
|
|
"residList": this.data.residIds, |
|
|
|
|
|
"eventType": "3" |
|
|
|
|
|
} |
|
|
|
|
|
await getComplainList(params1).then(res => { |
|
|
|
|
|
this.data.ywData['12345'] = res.data.list.map(item => { |
|
|
|
|
|
return { |
|
|
|
|
|
...item, |
|
|
|
|
|
categorycode: item.categorycode || '--', |
|
|
|
|
|
eventcontent: item.eventcontent || '--' |
|
|
|
|
|
} |
|
|
|
|
|
}); |
|
|
|
|
|
this.setData({ |
|
|
|
|
|
data: this.data.ywData |
|
|
|
|
|
}) |
|
|
|
|
|
}) |
|
|
|
|
|
let params = { |
|
|
|
|
|
"residList": this.data.residIds |
|
|
|
|
|
} |
|
|
|
|
|
await getShengList(params).then(res => { |
|
|
|
|
|
if (res.data && res.data.length > 0) { |
|
|
|
|
|
let renamedArray = []; |
|
|
|
|
|
res.data.forEach(item => { |
|
|
|
|
|
let renamedItem = { |
|
|
|
|
|
categorycode: item.scope || '--', |
|
|
|
|
|
eventcontent: item.problemDesc || '--' |
|
|
|
|
|
}; |
|
|
|
|
|
renamedArray.push(renamedItem); |
|
|
|
|
|
}); |
|
|
|
|
|
this.data.ywData['provinceSurvey'] = renamedArray; |
|
|
|
|
|
this.setData({ |
|
|
|
|
|
ywData: this.data.ywData |
|
|
|
|
|
}) |
|
|
|
|
|
} else { |
|
|
|
|
|
this.data.ywData['provinceSurvey'] = []; |
|
|
|
|
|
this.setData({ |
|
|
|
|
|
ywData: this.data.ywData |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
await getShequList(params).then(res => { |
|
|
|
|
|
if (res.data && res.data.length > 0) { |
|
|
|
|
|
let renamedArray = []; |
|
|
|
|
|
res.data.forEach(item => { |
|
|
|
|
|
let renamedItem = { |
|
|
|
|
|
categorycode: item.scope || '--', |
|
|
|
|
|
eventcontent: item.problemDesc || '--' |
|
|
|
|
|
}; |
|
|
|
|
|
renamedArray.push(renamedItem); |
|
|
|
|
|
}); |
|
|
|
|
|
this.data.ywData['selfSurvey'] = renamedArray; |
|
|
|
|
|
this.setData({ |
|
|
|
|
|
ywData: this.data.ywData |
|
|
|
|
|
}) |
|
|
|
|
|
} else { |
|
|
|
|
|
this.data.ywData['selfSurvey'] = []; |
|
|
|
|
|
this.setData({ |
|
|
|
|
|
ywData: this.data.ywData |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
await getshijianList(params).then(res => { |
|
|
|
|
|
if (res.data && res.data.length > 0) { |
|
|
|
|
|
let renamedArray = []; |
|
|
|
|
|
res.data.forEach(item => { |
|
|
|
|
|
let renamedItem = { |
|
|
|
|
|
categorycode: item.categorycode || '--', |
|
|
|
|
|
eventcontent: item.eventcontent || '--' |
|
|
|
|
|
}; |
|
|
|
|
|
renamedArray.push(renamedItem); |
|
|
|
|
|
}); |
|
|
|
|
|
this.data.ywData['event'] = renamedArray; |
|
|
|
|
|
this.setData({ |
|
|
|
|
|
ywData: this.data.ywData |
|
|
|
|
|
}) |
|
|
|
|
|
} else { |
|
|
|
|
|
this.data.ywData['event'] = []; |
|
|
|
|
|
this.setData({ |
|
|
|
|
|
ywData: this.data.ywData |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
await getxuqiuList(params).then(res => { |
|
|
|
|
|
if (res.data && res.data.length > 0) { |
|
|
|
|
|
let renamedArray = []; |
|
|
|
|
|
res.data.forEach(item => { |
|
|
|
|
|
let renamedItem = { |
|
|
|
|
|
categorycode: item.parentName || '--', |
|
|
|
|
|
eventcontent: item.content || '--' |
|
|
|
|
|
}; |
|
|
|
|
|
renamedArray.push(renamedItem); |
|
|
|
|
|
}); |
|
|
|
|
|
this.data.ywData['need'] = renamedArray; |
|
|
|
|
|
this.setData({ |
|
|
|
|
|
ywData: this.data.ywData |
|
|
|
|
|
}) |
|
|
|
|
|
} else { |
|
|
|
|
|
this.data.ywData['need'] = []; |
|
|
|
|
|
this.setData({ |
|
|
|
|
|
ywData: this.data.ywData |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
await getfuwuList(params).then(res => { |
|
|
|
|
|
if (res.data && res.data.length > 0) { |
|
|
|
|
|
let renamedArray = []; |
|
|
|
|
|
res.data.forEach(item => { |
|
|
|
|
|
let renamedItem = { |
|
|
|
|
|
categorycode: item.serviceCategoryKey || '--', |
|
|
|
|
|
eventcontent: item.serviceName || '--' |
|
|
|
|
|
}; |
|
|
|
|
|
renamedArray.push(renamedItem); |
|
|
|
|
|
}); |
|
|
|
|
|
this.data.ywData['serve'] = renamedArray; |
|
|
|
|
|
this.setData({ |
|
|
|
|
|
ywData: this.data.ywData |
|
|
|
|
|
}) |
|
|
|
|
|
} else { |
|
|
|
|
|
this.data.ywData['serve'] = []; |
|
|
|
|
|
this.setData({ |
|
|
|
|
|
ywData: this.data.ywData |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
const residIds = this.data.residIds.map(function(item) { |
|
|
|
|
|
|
|
|
|
|
|
return encodeURIComponent(item); |
|
|
|
|
|
}).join(','); |
|
|
|
|
|
const params2 = { |
|
|
|
|
|
"resiIdList": residIds, |
|
|
|
|
|
pageNo: 1, |
|
|
|
|
|
pageSize: 1000, |
|
|
|
|
|
} |
|
|
|
|
|
await getMultiLogList(params2).then(res => { |
|
|
|
|
|
if (res.data && res.data.length > 0) { |
|
|
|
|
|
let arr = []; |
|
|
|
|
|
res.data.forEach(item => { |
|
|
|
|
|
item.list.forEach(item1=>{ |
|
|
|
|
|
arr.push(item1) |
|
|
|
|
|
}) |
|
|
|
|
|
}) |
|
|
|
|
|
this.data.ywData['punchRecord'] = arr; |
|
|
|
|
|
this.setData({ |
|
|
|
|
|
ywData: this.data.ywData, |
|
|
|
|
|
}) |
|
|
|
|
|
} else { |
|
|
|
|
|
this.data.ywData['punchRecord'] = []; |
|
|
|
|
|
this.setData({ |
|
|
|
|
|
ywData: this.data.ywData |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
this.setData({ |
|
|
|
|
|
ywVisible: true |
|
|
|
|
|
}) |
|
|
|
|
|
}, |
|
|
}) |
|
|
}) |