diff --git a/subpages/searchResult/pages/resiInfo/resiInfo.js b/subpages/searchResult/pages/resiInfo/resiInfo.js index a854f38..65a8655 100644 --- a/subpages/searchResult/pages/resiInfo/resiInfo.js +++ b/subpages/searchResult/pages/resiInfo/resiInfo.js @@ -1,6 +1,7 @@ // subpages/searchResult/pages/resiInfo/resiInfo.js import api from "../../../../utils/api" +import { getComplainList, getShengList, getShequList, getshijianList, getxuqiuList, getfuwuList, getMultiLogList } from "../../../../utils/businessRecords.js"; var http = require('../../../../utils/request.js') const QQMapWX = require('../../../../utils/qqmap-wx-jssdk') const app = getApp() @@ -531,7 +532,8 @@ Page({ householdSituationArr:[], houseHolderRelArr:[] }, - password:'' + password:'', + ywData: { "12345": [], "provinceSurvey": [], "selfSurvey": [], "event": [], "need": [], "serve": [], "punchRecord": [] } }, /** @@ -549,6 +551,8 @@ Page({ }) await this.getResiInfo() + this.getChangeRecordsById() + this.getTabData() } // this.data.qqMapWX = new QQMapWX({ // key: 'CMJBZ-4DECI-JXGGN-5B4WU-QLV2H-B5BEJ' @@ -634,7 +638,9 @@ Page({ ensure_house: "保障房信息", chronic_disease: "慢病信息", base: "基本信息", - graph:"关系图谱" + graph:"关系图谱", + update:"更新记录", + business:"业务记录" }; let list = Object.entries( value @@ -649,6 +655,12 @@ Page({ list.push({ name:'关系图谱', id:"graph" + },{ + name:'业务记录', + id:"business" + },{ + name:'更新记录', + id:"update" }, ) this.setData({ @@ -774,6 +786,175 @@ Page({ console.log(err); }) }, + // 获取业务记录 + async getTabData() { + + let params1 = { + "residList": [this.data.resiId], + "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.resiId] + } + 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 params2 = { + "resiIdList": [this.data.resiId], + 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 + }) + }, + // 获取更新记录 + getChangeRecordsById() { + api.getChangeRecordsById(this.data.resiId).then(res => { + console.log(res); + this.setData({ + logs:res.data + }) + }).catch(err => { + console.log(err); + }) + }, toAddResi() { this.setData({ checkPassword:true diff --git a/subpages/searchResult/pages/resiInfo/resiInfo.json b/subpages/searchResult/pages/resiInfo/resiInfo.json index b454563..1b49899 100644 --- a/subpages/searchResult/pages/resiInfo/resiInfo.json +++ b/subpages/searchResult/pages/resiInfo/resiInfo.json @@ -1,7 +1,8 @@ { "usingComponents": { "van-dialog": "@vant/weapp/dialog/index", - "resi-graph":"./component/graph/graph" + "resi-graph":"./component/graph/graph", + "BusinessRecord": "../../../businessRecord/businessRecord" }, "navigationBarTitleText": "详情" } \ No newline at end of file diff --git a/subpages/searchResult/pages/resiInfo/resiInfo.wxml b/subpages/searchResult/pages/resiInfo/resiInfo.wxml index e6bdb89..2529ce9 100644 --- a/subpages/searchResult/pages/resiInfo/resiInfo.wxml +++ b/subpages/searchResult/pages/resiInfo/resiInfo.wxml @@ -314,6 +314,56 @@ + + + 业务记录 + + + + + + + 更新记录 + + + + + + + + {{item.typeName}}-{{item.operatorName}} + {{item.changeTime}} + + + + + 变更信息: + {{item.fieldName}} + + + 变更后: + {{item.beforeChangeName}} + + + 备注: + {{item.remark||'--'}} + + + + + 变更前: + {{item.afterChangeName}} + + + 操作人: + {{item.operatorName}} + + + + + + +