819527061@qq.com
2024-05-31 1034136b2a8e95d131f90ea12fcc4945691c4652
pages/quality-inspection-page/edc-sampling/edc-sampling.vue
@@ -1,10 +1,26 @@
<template>
   <view class="edc-sampling-wrap">
     <view class="edc-sampling-main">
       <u-empty
           class="empty-box"
           mode="data"
           icon="http://cdn.uviewui.com/uview/empty/data.png"
           textSize="30"
           width="300"
           height="300"
           text="暂无数据"
           v-if="emptyShow">
       </u-empty>
       <view class="edc-sampling-card" v-for="(item,index) in edcList" :key="index">
         <view class="edc-sampling-line">
           <h1>{{item.carNo}}</h1>
           <view class="status red" v-if="item.status">{{statusComputed(item.status)}}</view>
           <!--    #ifdef H5        -->
           <view class="status" :class="statusClassComputed(item.status)" v-if="item.status">{{statusComputed(item.status)}}</view>
           <!--    #endif   -->
           <!--    #ifdef MP-WEIXIN -->
           <view class="status" v-if="item.status">{{statusComputed(item.status)}}</view>
           <!--    #endif     -->
         </view>
         <view class="edc-sampling-line">
           <h2>供应商:{{item.customerName}}</h2>
@@ -65,6 +81,7 @@
  data() {
    return {
      edcList:[],
      emptyShow:false, //空页面是否显示
      size:10,
      current:1,
      total:0,
@@ -78,6 +95,7 @@
    this.getPageList()
  },
  methods: {
    /* #ifdef H5 */
    statusComputed(status) {
      if(status == 1) {
        return '已取样'
@@ -93,6 +111,26 @@
        return '审定中'
      }else if(status == 7) {
        return '已完成'
      }else {
        return ''
      }
    },
    /* #endif */
    statusClassComputed(status) {
      if(status == 1) {
        return 'blue'
      }else if(status == 2) {
        return 'red'
      }else if(status == 3) {
        return 'red'
      }else if(status == 4) {
        return 'red'
      }else if(status == 5) {
        return 'red'
      }else if(status == 6) {
        return 'red'
      }else if(status == 7) {
        return 'black'
      }else {
        return ''
      }
@@ -114,6 +152,11 @@
        const res = await this.$reqGet('getTaskCoalOfNoDetection',{current:this.current,size:this.size,productId:this.productId})
        uni.hideLoading()
        this.edcList = [...this.edcList,...res.data.records]
        if(this.edcList == 0) {
          this.emptyShow = true
        }else {
          this.emptyShow = false
        }
        this.total = res.data.total
        callBack && callBack()
      }catch (err) {
@@ -144,6 +187,9 @@
      })
    },
    handleEDCClick(item) {  //创建EDC质检单
      uni.showLoading({
        title: "加载中"
      })
      uni.showModal({
        title: '确认',
        content: '确认创建EDC质检单吗',
@@ -153,6 +199,7 @@
            this.$reqPost('edcSampling',item,'json').then(res => {
              console.log(res,'res=====-----')
              if(res.code == 0) {
                uni.hideLoading()
                this.$u.toast('创建成功');
                this.edcList = []
                this.getPageList()
@@ -160,6 +207,7 @@
            })
          }else if(res.cancel){
            uni.hideLoading()
            return true
          }
        }
@@ -216,13 +264,21 @@
          display: flex;
          align-self: baseline;
        }
        .blue{
          color: #184edd;
          border: 1px solid #184edd;
        }
        .red{
          color: #f56c6c;
          border: 1px solid #f56c6c;
        }
        .black{
          color: black;
          border: 1px solid black;
        }
        .yellow{
          color: #f9ae3d;
          border: 1px solid #f9ae3d;
          color: #fcbd20;
          border: 1px solid #fcbd20;
        }
      }
      .edc-sampling-btn-box{
@@ -242,6 +298,14 @@
        }
      }
    }
    .empty-box{
      margin: auto;
      position: absolute;
      top: 24%;
      left: 50%;
      transition: (50%, -50%);
      transform: translate(-50%, -24%);
    }
  }
}