From 51b98525a4ec6e01caa7e2cd2b9546183a20493d Mon Sep 17 00:00:00 2001 From: mk <2403457699@qq.com> Date: Thu, 14 Sep 2023 14:41:40 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=9F=A5=E8=AE=B0=E5=BD=95=E8=81=94?= =?UTF-8?q?=E8=B0=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/mine/mine.js | 1 - .../dissatisfactionDetails.js | 3 +- .../dissatisfactionDetails.wxss | 4 +- .../pages/followUpDetail/followUpDetail.js | 91 +++++++++++++++++-- .../pages/followUpDetail/followUpDetail.wxml | 21 +++-- .../pages/followUpDetail/followUpDetail.wxss | 44 +++++++-- .../pages/followUpList/followUpList.js | 25 +++-- .../pages/followUpList/followUpList.wxml | 2 +- .../pages/followUpList/followUpList.wxss | 4 +- .../pages/historyQuery/historyQuery.js | 1 - .../pages/synthesis/synthesis.js | 1 - utils/api.js | 12 ++- 12 files changed, 168 insertions(+), 41 deletions(-) diff --git a/pages/mine/mine.js b/pages/mine/mine.js index 01bb905..a4cde51 100644 --- a/pages/mine/mine.js +++ b/pages/mine/mine.js @@ -83,7 +83,6 @@ Page({ }) }, toFollowUpList(){ - console.log(1); wx.navigateTo({ url: '/subpages/communitySelfInsp/pages/followUpList/followUpList', }) diff --git a/subpages/communitySelfInsp/pages/dissatisfactionDetails/dissatisfactionDetails.js b/subpages/communitySelfInsp/pages/dissatisfactionDetails/dissatisfactionDetails.js index 9d60634..914e890 100644 --- a/subpages/communitySelfInsp/pages/dissatisfactionDetails/dissatisfactionDetails.js +++ b/subpages/communitySelfInsp/pages/dissatisfactionDetails/dissatisfactionDetails.js @@ -116,9 +116,8 @@ Page({ }) }, toFollowUpDetails(e){ - console.log(JSON.stringify(e.currentTarget.dataset.item)); wx.navigateTo({ - url: `/subpages/communitySelfInsp/pages/followUpDetail/followUpDetail?resiInfo=${JSON.stringify(e.currentTarget.dataset.item)}`, + url: `/subpages/communitySelfInsp/pages/followUpDetail/followUpDetail?resiInfo=${JSON.stringify(e.currentTarget.dataset.item)}&type=add`, }) }, /** diff --git a/subpages/communitySelfInsp/pages/dissatisfactionDetails/dissatisfactionDetails.wxss b/subpages/communitySelfInsp/pages/dissatisfactionDetails/dissatisfactionDetails.wxss index 571aa3d..26d4805 100644 --- a/subpages/communitySelfInsp/pages/dissatisfactionDetails/dissatisfactionDetails.wxss +++ b/subpages/communitySelfInsp/pages/dissatisfactionDetails/dissatisfactionDetails.wxss @@ -44,9 +44,10 @@ page { width: 100%; padding:0 20rpx ; box-sizing: border-box; + margin-top: 20rpx; } .content .scroll { - height: calc(100vh - 100rpx); + height: calc(100vh - 50rpx); overflow-y: scroll; } .content .card{ @@ -58,7 +59,6 @@ page { border-radius: 20rpx; padding: 30rpx 30rpx; box-sizing: border-box; - margin-top: 20rpx; overflow: hidden; color: #333; diff --git a/subpages/communitySelfInsp/pages/followUpDetail/followUpDetail.js b/subpages/communitySelfInsp/pages/followUpDetail/followUpDetail.js index 9b4bfaf..819c751 100644 --- a/subpages/communitySelfInsp/pages/followUpDetail/followUpDetail.js +++ b/subpages/communitySelfInsp/pages/followUpDetail/followUpDetail.js @@ -1,4 +1,5 @@ const app = getApp() +import api from "../../../../utils/api"; Page({ /** @@ -6,6 +7,7 @@ Page({ */ data: { resiInfo:{}, + followUpWayName:"", title:'回访记录', formType:'add', followUpWayList:[ @@ -18,16 +20,21 @@ Page({ value:'2' } ], + inspResultId:'', form:{ - - } + riskFlag:null,//风险标识 0无风险 1有风险 + description:'',//回访记录详情 + followUpWay:'',//1电话回访 2上门回访 + }, }, /** * 生命周期函数--监听页面加载 */ onLoad(options) { - console.log(JSON.parse(options.resiInfo)); + console.log(options); + let temp = JSON.parse(options.resiInfo); + console.log(temp); this.setData({ statusHeight: app.globalData.deviceInfo.statusHeight, navigationHeight: app.globalData.deviceInfo.navigationHeight, @@ -35,8 +42,20 @@ Page({ }) if(options.type == 'add'){ this.setData({ - resiInfo:JSON.parse(options.resiInfo), + resiInfo:temp, + inspResultId:temp.id, }) + }else{ + this.setData({ + resiInfo:temp, + 'resiInfo.reason':temp.reason, + inspResultId:temp.inspResultId, + "form.followUpWay":temp.followUpWay, + "form.description":temp.description, + "form.riskFlag":temp.riskFlag, + followUpWayName:temp.followUpWayName + }) + } }, @@ -92,11 +111,71 @@ Page({ const selectedIndex = e.detail.value; const selectedVillage = this.data.followUpWayList[selectedIndex]; this.setData({ - 'form.followUpWay': selectedVillage.label, + 'form.followUpWay': selectedVillage.value, + followUpWayName:selectedVillage.label }); }, - handleChangeRadio(e){ + handleBlurDescription(e){ + this.setData({ + 'form.description': e.detail.value + }) + }, + handleChangeRisk(e){ console.log(e); + this.setData({ + 'form.riskFlag': Number(e.detail.value) + }) + }, + + submit(){ + let parm ={ + ...this.data.form, + inspResultId:this.data.inspResultId, + id:this.data.formType == 'add'?'':this.data.resiInfo.id + } + console.log(parm); + wx.showLoading({ + title: '加载中', + }) + api.followUpSave(parm).then(res=>{ + console.log(res); + if(res.code == 0){ + wx.hideLoading() + wx.showToast({ + title: this.data.formType == 'add'?'新增成功':'修改成功', + duration:3000, + success:function(){ + setTimeout(()=>{ + wx.navigateBack({ + delta: 1 + }) + },3000) + } + }) + } + }).catch(err=>{ + console.log(err); + }) + }, + del(){ + api.followUpDelete(this.data.resiInfo.id).then(res=>{ + if(res.code == 0){ + wx.hideLoading() + wx.showToast({ + title: '删除成功', + duration:3000, + success:function(){ + setTimeout(()=>{ + wx.navigateBack({ + delta: 1 + }) + },3000) + } + }) + } + }).catch(err=>{ + console.log(err); + }) }, back(){ wx.navigateBack({ diff --git a/subpages/communitySelfInsp/pages/followUpDetail/followUpDetail.wxml b/subpages/communitySelfInsp/pages/followUpDetail/followUpDetail.wxml index 0250365..8726891 100644 --- a/subpages/communitySelfInsp/pages/followUpDetail/followUpDetail.wxml +++ b/subpages/communitySelfInsp/pages/followUpDetail/followUpDetail.wxml @@ -6,12 +6,12 @@ - - 马魁 177777777777 - 河南省鹤壁市 + + {{resiInfo.reporterName}} {{resiInfo.reporterMobile}} + {{resiInfo.addressDetail?resiInfo.addressDetail:'--'}} - - 不满意原因:aacece + + 不满意原因:{{resiInfo.reason}} @@ -32,19 +32,20 @@ 回访情况记录 -