| | |
| | | |
| | | 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: [], |
| | |
| | | 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', |
| | | }) |
| | | }, |
| | | bindPickerChangeSex(e) { |
| | | console.log(e); |
| | | |
| | | this.setData({ |
| | | sexId: e.detail.value |
| | | }) |
| | | this.setData({ |
| | | sex: this.data.arraySex[e.detail.value].sex |
| | | }) |
| | | }, |
| | | //查看图片 |
| | |
| | | }) |
| | | } |
| | | }, |
| | | onChangeTabs(e) { |
| | | console.log(e); |
| | | |
| | | }, |
| | | onLoad(e) { |
| | | wx.request( |
| | | { |
| | | url: managerReportDetail.globalData.url + "/report/" + e.id, |
| | | method: "GET", |
| | | header: { 'token': wx.getStorageSync('token') }, |
| | | success: (res) => { |
| | | let contractMaterials = res.data.data.contractMaterials.split(",") |
| | | let elseMaterials = res.data.data.elseMaterials.split(",") |
| | | let idCardMaterials = res.data.data.idCardMaterials.split(",") |
| | | let transactionMaterials = res.data.data.transactionMaterials.split(",") |
| | | this.setData({ |
| | | reportDetail: res.data.data, |
| | | images: [...idCardMaterials,...contractMaterials,...transactionMaterials,...elseMaterials] |
| | | }) |
| | | 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] = managerReportDetail.globalData.imageUrl + "/img/" + this.data.images[index] |
| | | } else { |
| | | this.data.images = [] |
| | | } |
| | | } |
| | | this.setData({ |
| | | images: this.data.images |
| | | }) |
| | | } |
| | | }) |
| | | wx.request( |
| | | { |
| | | url: managerReportDetail.globalData.url + "/cause/getCauseList", |
| | | method: "GET", |
| | | 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) |
| | | } |
| | | } |
| | | }) |