1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
| // index.ts
| // 获取应用实例
| const managerReportDetail = getApp()
|
| Page({
| data: {
| reportDetail: {},
| isShow: false,
| causeList: [],
| causeIndex: 0,
| images:[],
| array:["2022/08/19/5040f71639fd44b48228ce0e5c242727.jpeg", "2022/08/19/47bbd7c1d7bd4c07a0b17d671fe47010.jpeg"]
| },
| // 事件处理函数
| bindViewTap() {
| wx.navigateTo({
| url: '../logs/logs',
| })
| },
| //查看图片
| face(){
| wx.previewMedia({
| sources:[{url:managerReportDetail.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)
|
| },
| cancel(){
| console.log("cancel")
| wx.navigateBack({
|
| })
| },
| //通过
| 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'
| })
| }
| })
| }
| },
| 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]=managerReportDetail.globalData.imageUrl+"/img/"+this.data.images[index]
| } else{
| this.data.images=[]
| }
| }
| this.setData({
| images:this.data.images
| })
| console.log(this.data.images)
| }
| })
| wx.request(
| {
| url: managerReportDetail.globalData.url+ "/cause/getCauseList",
| method: "GET",
| header: { 'token': wx.getStorageSync('token')},
| success: (res) => {
| this.setData({
| causeList: res.data.data.records
| })
| }
| })
| }
| })
|
|