| | |
| | | |
| | | Page({ |
| | | data: { |
| | | valuereject: '', |
| | | showreject: false, |
| | | arraySex: [ |
| | | { sex: '男', id: 1 }, |
| | | { sex: '女', id: 0 } |
| | | ], |
| | | sex: '男', |
| | | sexId: 0, |
| | | datae: null, |
| | | idCardMaterials: [], // 身份证 |
| | | contractMaterials: [],// 合同 |
| | | transactionMaterials: [],// 交易 |
| | | elseMaterials: [],// 其他 |
| | | reportDetail: {}, |
| | | isShow: false, |
| | | causeList: [], |
| | | causeIndex: 0, |
| | | images:[], |
| | | array:["2022/08/19/5040f71639fd44b48228ce0e5c242727.jpeg", "2022/08/19/47bbd7c1d7bd4c07a0b17d671fe47010.jpeg"] |
| | | causeIndex: null, |
| | | images: [], |
| | | array: ["2022/08/19/5040f71639fd44b48228ce0e5c242727.jpeg", "2022/08/19/47bbd7c1d7bd4c07a0b17d671fe47010.jpeg"] |
| | | }, |
| | | onChangereject(e) { |
| | | console.log(e); |
| | | this.setData({ |
| | | valuereject: e.detail |
| | | }) |
| | | }, |
| | | deny() { |
| | | this.setData({ showreject: true }); |
| | | }, |
| | | subreject() { |
| | | console.log('6666666666'); |
| | | let parms = { |
| | | id: this.data.reportDetail.id, |
| | | reason: this.data.valuereject |
| | | } |
| | | wx.request( |
| | | { |
| | | url: managerReportDetail.globalData.url + "/report/reject", |
| | | method: "POST", |
| | | data: parms, |
| | | header: { 'token': wx.getStorageSync('token') }, |
| | | success: (res) => { |
| | | console.log(res); |
| | | wx.reLaunch({ |
| | | url: '/pages/user/index' |
| | | }) |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | onClose() { |
| | | this.setData({ showreject: false }); |
| | | }, |
| | | |
| | | // 事件处理函数 |
| | | bindViewTap() { |
| | | wx.navigateTo({ |
| | | url: '../logs/logs', |
| | | }) |
| | | }, |
| | | //查看图片 |
| | | face(){ |
| | | wx.previewMedia({ |
| | | sources:[{url:managerCauseDetail.globalData.imageUrl+"/img/"+this.data.reportDetail.pic}] |
| | | }) |
| | | }, |
| | | //选择案件 |
| | | pickCause(e) { |
| | | this.data.reportDetail.causeId = this.data.causeList[e.detail.value].id |
| | | console.log(this.data.reportDetail) |
| | | bindPickerChangeSex(e) { |
| | | console.log(e); |
| | | |
| | | this.setData({ |
| | | sexId: e.detail.value |
| | | }) |
| | | this.setData({ |
| | | sex: this.data.arraySex[e.detail.value].sex |
| | | }) |
| | | }, |
| | | //查看图片 |
| | | face() { |
| | | wx.previewMedia({ |
| | | sources: [{ url: managerReportDetail.globalData.imageUrl + "/img/" + this.data.reportDetail.pic }] |
| | | }) |
| | | }, |
| | | //选择案件 |
| | | pickCause(e: { detail: { value: string | number; }; }) { |
| | | console.log(e); |
| | | this.setData({ |
| | | causeIndex: e.detail.value |
| | | }) |
| | | this.data.reportDetail.causeId = this.data.causeList[e.detail.value].id |
| | | }, |
| | | cancel() { |
| | | console.log("cancel") |
| | | wx.navigateBack({ |
| | | }) |
| | | }, |
| | | //通过 |
| | | pass(){ |
| | | wx.request( |
| | | { |
| | | url: managerReportDetail.globalData.url +"/report/audit" , |
| | | method:"POST", |
| | | data:this.data.reportDetail, |
| | | header: { 'token':wx.getStorageSync('token') , |
| | | 'content-type': 'application/json' |
| | | } ,success:(res)=>{ |
| | | console.log(res) |
| | | wx.reLaunch({ |
| | | url:'../../cause/index' |
| | | }) |
| | | } |
| | | }) |
| | | |
| | | |
| | | }, |
| | | onLoad(e) { |
| | | console.log(e) |
| | | wx.request( |
| | | { |
| | | url:managerReportDetail.globalData.url+"/report/" + e.id, |
| | | method: "GET", |
| | | // header: { 'token':wx.getStorageSync('token') }, |
| | | success: (res) => { |
| | | this.setData({ |
| | | reportDetail: res.data.data, |
| | | images:res.data.data.reportMaterials.split(",") |
| | | }) |
| | | console.log(this.data.reportDetail) |
| | | for (let index = 0; index < this.data.images.length; index++) { |
| | | if(this.data.images!=null&&this.data.images[index]!=""&&this.data.images!=undefined){ |
| | | this.data.images[index]=managerCauseDetail.globalData.imageUrl+"/img/"+this.data.images[index] |
| | | } else{ |
| | | this.data.images=[] |
| | | } |
| | | } |
| | | this.setData({ |
| | | images:this.data.images |
| | | }) |
| | | console.log(this.data.images) |
| | | } |
| | | pass() { |
| | | if (this.data.reportDetail.causeId == null) { |
| | | wx.showToast({ |
| | | title: "请选择关联案件", |
| | | icon: "error" |
| | | }) |
| | | } else { |
| | | wx.request( |
| | | { |
| | | url: managerReportDetail.globalData.url + "/report/audit", |
| | | method: "POST", |
| | | data: this.data.reportDetail, |
| | | header: { |
| | | 'token': wx.getStorageSync('token'), |
| | | 'content-type': 'application/json' |
| | | }, success: (res) => { |
| | | console.log(res) |
| | | wx.reLaunch({ |
| | | url: '../../cause/index' |
| | | }) |
| | | } |
| | | }) |
| | | } |
| | | }, |
| | | onChangeTabs(e) { |
| | | console.log(e); |
| | | |
| | | }, |
| | | onLoad(e) { |
| | | wx.request( |
| | | { |
| | | url: managerReportDetail.globalData.url+ "/cause/getCauseList", |
| | | url: managerReportDetail.globalData.url + "/cause/getCauseList", |
| | | method: "GET", |
| | | // header: { 'token': wx.getStorageSync('token')}, |
| | | header: { 'token': wx.getStorageSync('token') }, |
| | | success: (res) => { |
| | | this.data.causeList = res.data.data.records |
| | | this.setData({ |
| | | causeList: res.data.data.records |
| | | }) |
| | | this.getDataList(e) |
| | | } |
| | | }) |
| | | }, |
| | | getDataList(e) { |
| | | wx.request( |
| | | { |
| | | url: managerReportDetail.globalData.url + "/report/" + e.id, |
| | | method: "GET", |
| | | header: { 'token': wx.getStorageSync('token') }, |
| | | success: (res) => { |
| | | let detail = res.data.data |
| | | console.log(this.data.causeList); |
| | | this.setData({ |
| | | causeIndex: this.data.causeList.findIndex(val => { return val.id == detail.causeId }), |
| | | reportDetail: detail, |
| | | sex: detail.sex, |
| | | contractMaterials: this.materialStringToArray(detail.contractMaterials), |
| | | idCardMaterials: this.materialStringToArray(detail.idCardMaterials), |
| | | transactionMaterials: this.materialStringToArray(detail.transactionMaterials), |
| | | elseMaterials: this.materialStringToArray(detail.elseMaterials) |
| | | }) |
| | | console.log(this.data.idCardMaterials); |
| | | } |
| | | }) |
| | | }, |
| | | materialStringToArray(s: string): string[] { |
| | | if (s == '' || s == null) { |
| | | return [] |
| | | } else { |
| | | return s.split(',').map(i => managerReportDetail.globalData.imageUrl + "/img/" + i) |
| | | } |
| | | } |
| | | }) |