liukangdong
2024-06-12 a11bc1bed7953b88213330582c2085f60b5a73b1
h5/pages/applicationRecord/applicationRecord.vue
@@ -2,42 +2,71 @@
  <view class="box">
    <scroll-view scroll-x class="box_head">
      <view class="box_head_list">
        <view class="box_head_item active">全部</view>
        <view class="box_head_item">待审核</view>
        <view class="box_head_item">审核通过</view>
        <view class="box_head_item">审核驳回</view>
        <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 class="box_list_item" v-for="(item, index) in 3" :key="index">
      <view
        @click="handleDetail(item.id)"
        class="box_list_item"
        v-for="(item, index) in list"
        :key="index"
      >
        <view class="box_list_item_head">
          <text>丁恩凯的劳务入厂申请</text>
          <text class="loading">待审核</text>
          <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>人事部-王亚蓝</text>
            <text
              >{{ item.receptMemberDepartment }}-{{
                item.receptMemberName
              }}</text
            >
          </view>
          <view class="box_list_item_nr_item">
            <text>进厂时间:</text>
            <text>12-12 09:00</text>
            <text>{{ item.starttime }}</text>
          </view>
          <view class="box_list_item_nr_item">
            <text>离厂时间:</text>
            <text>12-12 12:00</text>
          </view>
          <view class="box_list_item_nr_item">
            <text>入厂人数:</text>
            <text>10</text>
            <text>离园时间:</text>
            <text>{{ item.endtime }}</text>
          </view>
          <view class="box_list_item_nr_item">
            <text>来访事由:</text>
            <text>业务来往</text>
            <text>{{ item.reason }}</text>
          </view>
          <view class="box_list_item_nr_x"></view>
          <view class="box_list_item_nr_text"> 2023-12-12 09:00提交 </view>
          <view class="box_list_item_nr_text">{{ item.createDate }} 提交</view>
        </view>
      </view>
      <view v-if="list.length === 0"  style="text-align: center;">
        <image src="@/static/empty.png" style="width: 320rpx;margin: 120rpx auto 0" mode="widthFix" />
        <view class="placeholder9 fs24">暂无数据</view>
      </view>
    </view>
  </view>
@@ -49,29 +78,69 @@
  data() {
    return {
      pagination: {
        page: 1,
        page: 0,
        capacity: 10
      },
      list: []
      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.list = []
      this.status = val
      this.getList()
    },
    getList() {
      const { pagination } = this
      const { pagination, status, list } = this
      pagination.page = pagination.page + 1
      getVisitedRecord({
        pageWrap: { ...pagination }
        ...pagination,
        model: {
          openid: this.$store.state.openId,
          status
        },
      }).then(res => {
        this.list = res.data
        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>
<style lang="scss">
page {
  background-color: #f7f7f7 !important;
}
@@ -94,8 +163,8 @@
      display: flex;
      align-items: center;
      .active {
        border: 1rpx solid #279baa !important;
        color: #279baa !important;
        border: 1rpx solid $uni-color-primary !important;
        color: $uni-color-primary !important;
      }
      .box_head_item {
        padding: 0 30rpx;
@@ -132,7 +201,7 @@
        align-items: center;
        justify-content: space-between;
        .loading {
          color: #279baa;
          color: $uni-color-primary;
        }
        .success {
          color: #03c68f;