xusd
7 days ago 998218675eb243d43912c203174a6b72b299c0f8
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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
// pages/myRegisterFlow/index.js
const $$ = require('../../utils/util');
const app = getApp();
 
// 详情接口
function getByIdApi(param) {
  return $$.request({
    url: 'caseTask/listCaseFlow',
    type: 'get',
    submitData: param || {},
    service: 'mediate'
  })
}
 
// 催办
function saveCaseUrgingApi(submitData) {
  return $$.request({
    url: 'caseUrging/saveCaseUrging',
    type: 'post',
    submitData,
    service: 'mediate'
  })
}
 
// 催办回复量
function countByCaseIdApi(submitData) {
  return $$.request({
    url: 'caseUrging/countByCaseId',
    type: 'get',
    submitData,
    service: 'mediate'
  })
}
 
 
Page({
 
  /**
   * 页面的初始数据
   */
  data: {
    imgUrl: $$.url.img,
    flows: [{
        title: '提交申请',
        status: '1',
        name1: '线上',
        name2: '2024-7-12 12:00',
        name3: '金融纠纷'
      }, {
        title: '事项办理',
        status: '2',
        name4: '2024-7-12 12:00',
        name5: '白云区新市街司法所'
      }, {
        title: '事项办结',
        status: '3',
        name6: '2024-7-12 12:00',
        name7: '1',
        name7_1: '化解成功'
      }
      // , {
      //   title: '事项评价',
      //   status: '4',
      //   name8: '2024-7-12 12:00',
      //   name9: '张孟宇',
      //   name10: '4',
      //   name11: '工作人员认真负责结案结果符合预期'
      // }
    ]
  },
 
  // 获取纠纷案件详情
  async getById(data) {
    $$.showLoading();
    const res = await getByIdApi({
      caseId: data.caseId
    });
    $$.hideLoading();
    if (res.type) {
      let data = res.data || [];
      let urgingShow = res.data.findIndex(i => i.processStep === 3) > -1 ? false : true
      this.setData({
        flows: data,
        urgingShow
      });
    }
  },
 
  // 催办任务
  async urgingClick() {
    $$.showLoading();
    const res = await saveCaseUrgingApi({
      caseId: this.data.caseId
    });
    $$.hideLoading();
    if (res.type) {
      let data = res.data;
      if (!data) {
        $$.showToast({
          icon: 'success',
          title: '催办成功',
          duration: 1000
        });
      } else {
        $$.showToast({
          title: '您的操作过于频繁,请稍后再试',
          duration: 1000
        });
      }
    }
  },
 
  // 催办任务
  async countByCaseId(caseId) {
    $$.showLoading();
    const res = await countByCaseIdApi({
      caseId
    });
    $$.hideLoading();
    if (res.type) {
      let data = res.data || 0;
      this.setData({
        flowNumber: data
      })
    }
  },
 
  // 查看催办回复
  GoPage(e) {
    let url = e.currentTarget.dataset.url;
    wx.navigateTo({
      url: url,
    });
  },
 
  /**
   * 生命周期函数--监听页面加载
   */
  onLoad(options) {
    this.getById(options);
    this.countByCaseId(options.caseId)
    this.setData({
      caseId: options.caseId
    })
  },
})