cdk
2025-03-24 06e6cf5719a7de9d7919cee2f6fcc3cfc6f9eb9d
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
<template>
  <view>
 
    <view class="form-container">
      <form :modelValue="topData">
        <view class="form-group">
          <label class="form-label">标题:</label>
          <input class="form-input" disabled="true" type="text" v-model="topData.title"/>
        </view>
        <view class="form-group">
          <label class="form-label">单据号:</label>
          <input class="form-input" disabled="true" type="text" v-model="topData.route"/>
        </view>
        <view class="form-group">
          <label class="form-label">发送人:</label>
          <input class="form-input" disabled="true" type="text" v-model="topData.createBy"/>
        </view>
        <view class="form-group">
          <label class="form-label">发送时间:</label>
          <input class="form-input" disabled="true" type="text" v-model="topData.createDate"/>
        </view>
        <view class="form-group">
          <label class="form-label">失败原因:</label>
          <uni-easyinput class="form-input" type="textarea" v-model="topData.resultData"
          ></uni-easyinput>
        </view>
 
      </form>
    </view>
 
    <view class="text" v-if="Message">
      <text v-text="Message"></text>
    </view>
 
    <view class="plus-button">
      <button type="primary" @click="go">跳转到原单据</button>
    </view>
 
    <view class="plus-button">
      <button type="primary" @click="resendRequests">重新推送</button>
    </view>
 
  </view>
</template>
 
<script>
 
export default {
  data() {
    return {
      id: 0,
      data: [],
      customData: {},
      topData: {},
      Message: ""
    }
  },
  methods: {
 
    resendRequests() {
 
      this.topData.updateBy = this.$loginInfo.account;
 
      this.$post({
        url: "/MessageCenter/Resend",
        data: this.topData
      }).then(res => {
        // 在此处处理返回的数据
        this.Message = "返回的信息为:" + res.data.tbBillList;
      });
    },
    go() {
      uni.navigateTo({
        url: '../' + this.topData.pageName+ "&msgId="+ this.id
      });
    },
    setTitle(title) {
      // 修改页面标题的方法,uni-app中可以通过api直接设置当前页面的标题
      uni.setNavigationBarTitle({
        title: title
      });
    },
    init() {
      this.$post({
        url: "/MessageCenter/GetByPid",
        data: {
          pid: this.id
        }
      }).then(res => {
        let api = res.data.tbBillList;
        api.sort((a, b) => a.seq - b.seq);
        this.topData = api[0];
        this.customData = api[0];
        this.data = api;
      }).catch(error => {
        console.error("Error in init:", error);
      });
    },
  },
  onLoad(options) {
    this.setTitle(options.title);
    this.id = options.id;
    this.init();
  }
}
</script>
 
<style>
/* Add your styles here */
.text {
  background-color: #ffee6f;
}
 
.form-group {
  display: flex;
  align-items: center;
  border-bottom: 1px solid #c9c9c9;
}
 
.form-label {
  margin-bottom: 0;
  padding: 5px;
}
 
.form-input {
  flex: 1;
  margin-bottom: 0;
  padding: 5px;
}
 
.form-container {
  padding: 10px;
  /* 可选:添加一些内边距,使表单内容更美观 */
}
 
 
.plus-button {
  line-height: 59px;
  font-size: 24px;
  cursor: pointer;
  z-index: 1000;
  margin-bottom: 10px;
}
</style>