| | |
| | | <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" :class="statusClassComputed(item.status)" v-if="item.status">{{statusComputed(item.status)}}</view> |
| | | <!-- #ifdef H5 --> |
| | | <view class="status" :class="statusClassComputed(item.checkStatus)" v-if="item.checkStatus">{{statusComputed(item.checkStatus)}}</view> |
| | | <!-- #endif --> |
| | | |
| | | <!-- #ifdef MP-WEIXIN --> |
| | | <view class="status" v-if="item.status">{{statusComputed(item.checkStatus)}}</view> |
| | | <!-- #endif --> |
| | | </view> |
| | | <view class="edc-sampling-line"> |
| | | <h2>供应商:{{item.customerName}}</h2> |
| | |
| | | data() { |
| | | return { |
| | | edcList:[], |
| | | emptyShow:false, //空页面是否显示 |
| | | size:10, |
| | | current:1, |
| | | total:0, |
| | |
| | | this.getPageList() |
| | | }, |
| | | methods: { |
| | | /* #ifdef H5 */ |
| | | statusComputed(status) { |
| | | if(status == 1) { |
| | | return '已取样' |
| | |
| | | return '' |
| | | } |
| | | }, |
| | | /* #endif */ |
| | | statusClassComputed(status) { |
| | | if(status == 1) { |
| | | return 'blue' |
| | |
| | | }else if(status == 7) { |
| | | return 'black' |
| | | }else { |
| | | return '' |
| | | return null |
| | | } |
| | | }, |
| | | async getPageList(callBack) { |
| | |
| | | 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) { |
| | |
| | | }, |
| | | onPullDownRefresh() { //下拉刷新 |
| | | console.log() |
| | | this.flag = false |
| | | this.current = 1 |
| | | this.edcList = [] |
| | | setTimeout(() => { |
| | |
| | | uni.showLoading({ |
| | | title: "加载中" |
| | | }) |
| | | let params = { |
| | | customerId:item.customerId, |
| | | customerName:item.customerName, |
| | | carNo:item.carNo, |
| | | productId:item.productId, |
| | | productName:item.productName, |
| | | bunkerId:item.bunkerId, |
| | | id:item.id |
| | | } |
| | | uni.showModal({ |
| | | title: '确认', |
| | | content: '确认创建EDC质检单吗', |
| | | success: (res) => { |
| | | if(res.confirm) { |
| | | //调用接口 |
| | | this.$reqPost('edcSampling',item,'json').then(res => { |
| | | this.$reqPost('edcSampling',params,'json').then(res => { |
| | | console.log(res,'res=====-----') |
| | | if(res.code == 0) { |
| | | uni.hideLoading() |
| | |
| | | } |
| | | } |
| | | } |
| | | .isOver{ |
| | | width: 100%; |
| | | display: flex; |
| | | justify-content: center; |
| | | padding: 40rpx 0; |
| | | font-size: 30rpx; |
| | | color: #999999; |
| | | } |
| | | .empty-box{ |
| | | margin: auto; |
| | | position: absolute; |
| | | top: 24%; |
| | | left: 50%; |
| | | transition: (50%, -50%); |
| | | transform: translate(-50%, -24%); |
| | | } |
| | | } |
| | | } |
| | | |