jiangping
2024-05-28 d154966cc9492a30c47809aa2824ba61d18e6fef
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
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
<template>
  <view class="box">
    <scroll-view scroll-x class="box_head">
      <view class="box_head_list">
        <view
          class="box_head_item"
          :class="{ active: status == '' }"
          @click="tabsClick('')"
          >全部</view
        >
        <view
          class="box_head_item"
          @click="tabsClick('0')"
          :class="{ active: status == '0' }"
          >待审核</view
        >
        <view
          class="box_head_item"
          @click="tabsClick('2')"
          :class="{ active: status == '2' }"
          >审核通过</view
        >
        <view
          class="box_head_item"
          @click="tabsClick('3')"
          :class="{ active: status == '3' }"
          >审核驳回</view
        >
      </view>
    </scroll-view>
    <view class="box_list">
      <view
        @click="handleDetail(item.id)"
        class="box_list_item"
        v-for="(item, index) in list"
        :key="index"
      >
        <view class="box_list_item_head">
          <text>{{ item.name }}的劳务入厂申请</text>
          <text class="loading">{{ statusMap[item.status] }}</text>
        </view>
        <view class="box_list_item_nr">
          <view class="box_list_item_nr_item">
            <text>被访问人:</text>
            <text
              >{{ item.receptMemberDepartment }}-{{
                item.receptMemberName
              }}</text
            >
          </view>
          <view class="box_list_item_nr_item">
            <text>进厂时间:</text>
            <text>{{ item.starttime }}</text>
          </view>
          <view class="box_list_item_nr_item">
            <text>离厂时间:</text>
            <text>{{ item.endtime }}</text>
          </view>
          <view class="box_list_item_nr_item">
            <text>来访事由:</text>
            <text>{{ item.reason }}</text>
          </view>
          <view class="box_list_item_nr_x"></view>
          <view class="box_list_item_nr_text">{{ item.createDate }} 提交</view>
        </view>
      </view>
    </view>
  </view>
</template>
 
<script>
import { getVisitedRecord } from '@/api'
export default {
  data() {
    return {
      pagination: {
        page: 0,
        capacity: 10
      },
      list: [],
      total: 0,
      status: '',
 
      statusMap: {
        0: '待审核',
        1: '已提交',
        2: '审核通过',
        3: '审核不通过',
        4: '取消',
        5: '下发成功',
        6: '下发失败',
      }
    }
  },
  onLoad() {
    this.getList()
  },
  onReachBottom() {
    if (this.total > 10) {
      this.getList()
    }
 
  },
  methods: {
    handleDetail(id) {
      uni.navigateTo({
        url: "/pages/appointmentDetails/appointmentDetails?id=" + id
      })
    },
    tabsClick(val) {
      this.pagination.page = 0
      this.status = val
      this.getList()
    },
    getList() {
      const { pagination, status, list } = this
      pagination.page = pagination.page + 1
      getVisitedRecord({
        ...pagination,
        model: {
          openid: this.$store.state.openId,
          status
        },
      }).then(res => {
        if (res.data.records.length > 0) {
          if(pagination.page === 1){
            this.list = res.data.records
          }else{
            this.list = [...list, ...res.data.records]
          }
          this.total = res.data.total
        }
      })
    }
 
  }
}
</script>
<style>
page {
  background-color: #f7f7f7 !important;
}
</style>
<style lang="scss" scoped>
.box {
  width: 100%;
  .box_head {
    width: 100%;
    height: 108rpx;
    padding: 0 30rpx;
    box-sizing: border-box;
    background: #ffffff;
    position: sticky;
    top: 0;
    left: 0;
    .box_head_list {
      width: 100%;
      height: 100%;
      display: flex;
      align-items: center;
      .active {
        border: 1rpx solid #279baa !important;
        color: #279baa !important;
      }
      .box_head_item {
        padding: 0 30rpx;
        height: 60rpx;
        line-height: 60rpx;
        box-sizing: border-box;
        border-radius: 30rpx;
        border: 1rpx solid #999999;
        font-size: 26rpx;
        font-weight: 400;
        color: #333333;
        margin-right: 20rpx;
      }
    }
  }
  .box_list {
    width: 100%;
    padding: 30rpx;
    box-sizing: border-box;
    .box_list_item {
      width: 100%;
      margin-bottom: 20rpx;
      &:last-child {
        margin: 0 !important;
      }
      .box_list_item_head {
        width: 100%;
        height: 100rpx;
        padding: 0 30rpx;
        box-sizing: border-box;
        background: linear-gradient(270deg, #fefeff 0%, #e1f7fe 100%);
        border-radius: 8rpx 8rpx 0rpx 0rpx;
        display: flex;
        align-items: center;
        justify-content: space-between;
        .loading {
          color: #279baa;
        }
        .success {
          color: #03c68f;
        }
        .error {
          color: #e0312a;
        }
        text {
          &:nth-child(1) {
            font-size: 32rpx;
            font-weight: 500;
            color: #222222;
          }
          &:nth-child(2) {
            font-size: 26rpx;
            font-weight: 400;
          }
        }
      }
      .box_list_item_nr {
        padding: 30rpx;
        width: 100%;
        box-sizing: border-box;
        background-color: #ffffff;
        .box_list_item_nr_x {
          width: 100%;
          height: 1rpx;
          background-color: #e5e5e5;
        }
        .box_list_item_nr_text {
          width: 100%;
          font-size: 26rpx;
          font-weight: 400;
          color: #999999;
          margin-top: 32rpx;
        }
        .box_list_item_nr_item {
          width: 100%;
          display: flex;
          align-items: center;
          margin-bottom: 20rpx;
          text {
            &:nth-child(1) {
              font-size: 26rpx;
              font-weight: 400;
              color: #666666;
            }
            &:nth-child(2) {
              font-size: 26rpx;
              font-weight: 400;
              color: #333333;
            }
          }
        }
      }
    }
  }
}
</style>