wl
2022-11-16 096f265df6dcf07df93806e2da461c2cad4a331f
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
// 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: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)
 
    },
    //通过
    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)
                }
            })
        wx.request(
            {
                url: managerReportDetail.globalData.url+  "/cause/getCauseList",
                method: "GET",
                // header: { 'token': wx.getStorageSync('token')},
                success: (res) => {
                    this.setData({
                        causeList: res.data.data.records
                    })
                }
            })
    }
})