<template>
|
<view class="yanGaiMei-sampling-wrap">
|
<div class="edc-sampling-main">
|
<view class="yanGaiMei-sampling-add">
|
<view class="add-box" @click="addYanGaiMeiForm">
|
<u-image src="/static/image/quality/addIcon.png" mode="widthFix"></u-image>
|
<h1>添加原盐全检取样</h1>
|
</view>
|
</view>
|
<div class="edc-sampling-main-inside">
|
<view class="edc-sampling-card" v-for="item in edcList" :key="item.id">
|
<view class="edc-sampling-line">
|
<h1>供应商:{{item.customerName}}</h1>
|
<view class="status" :class="statusClassComputed(item.status)" v-if="item.status">{{statusComputed(item.status)}}</view>
|
</view>
|
<view class="edc-sampling-line">
|
<h2>采样地点:{{item.bunkerName}}</h2>
|
</view>
|
<view class="edc-sampling-btn-box">
|
<view class="watch">
|
<u-button type="primary" @click="handleWatchClick(item)">查看</u-button>
|
</view>
|
<!-- <view class="watch">-->
|
<!-- <u-button type="primary" :plain="true">查看</u-button>-->
|
<!-- </view>-->
|
</view>
|
</view>
|
<view class="isOver" v-if="flag">------我是有底线的------</view>
|
<!-- <view class="edc-sampling-card">-->
|
<!-- <view class="edc-sampling-line">-->
|
<!-- <h1>供应商:冀中无人值守</h1>-->
|
<!-- <view class="status yellow">待质检</view>-->
|
<!-- </view>-->
|
<!-- <view class="edc-sampling-line">-->
|
<!-- <h2>采样地点:石家庄市跃进路天元商务大厦</h2>-->
|
<!-- </view>-->
|
<!-- <view class="edc-sampling-btn-box">-->
|
<!-- <view class="watch">-->
|
<!-- <u-button type="primary" @click="handleWatchClick">查看</u-button>-->
|
<!-- </view>-->
|
<!-- <!– <view class="watch">–>-->
|
<!-- <!– <u-button type="primary" :plain="true">查看</u-button>–>-->
|
<!-- <!– </view>–>-->
|
<!-- </view>-->
|
<!-- </view>-->
|
</div>
|
</div>
|
</view>
|
</template>
|
|
<script>
|
export default {
|
name: "salt-total-sampling",
|
components: {},
|
|
data() {
|
return {
|
edcList:[],
|
size:10,
|
current:1,
|
total:0,
|
flag:false,
|
type:8, //1 EDC、2 PVC、3 硫酸、4 氢氧化钠 5 液氯 6、原盐钙镁 7、原盐TOC 8、原盐全检
|
}
|
},
|
onShow() {
|
this.edcList = []
|
this.current = 1
|
this.getPageList()
|
},
|
methods: {
|
statusComputed(status) {
|
if(status == 1) {
|
return '已取样'
|
}else if(status == 2) {
|
return '质检中'
|
}else if(status == 3) {
|
return '待复核'
|
}else if(status == 4) {
|
return '复核中'
|
}else if(status == 5) {
|
return '待审定'
|
}else if(status == 6) {
|
return '审定中'
|
}else if(status == 7) {
|
return '已完成'
|
}else {
|
return ''
|
}
|
},
|
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 ''
|
}
|
},
|
async getPageList(callBack) {
|
uni.showLoading({
|
title: "加载中"
|
})
|
// this.$reqGet('pageList').then(res => {
|
// console.log(res,'原盐钙镁----')
|
// if(res.code == 0) {
|
// uni.hideLoading()
|
// this.edcList = [...this.edcList,...res.data.records]
|
// }else {
|
// uni.hideLoading()
|
// }
|
// })
|
try{
|
const res = await this.$reqGet('pageList',{current:this.current,size:this.size,type:this.type})
|
uni.hideLoading()
|
this.edcList = [...this.edcList,...res.data.records]
|
this.total = res.data.total
|
callBack && callBack()
|
}catch (err) {
|
uni.hideLoading()
|
console.log(err,'err')
|
}
|
},
|
onReachBottom() { //上拉加载
|
console.log('上拉加载------')
|
console.log('this.size------',this.size)
|
console.log('this.current------',this.current)
|
console.log('this.edcList.length------',this.edcList.length)
|
if(this.edcList.length < this.current*this.size) return this.flag = true
|
this.current ++;
|
this.getPageList()
|
},
|
onPullDownRefresh() { //下拉刷新
|
console.log()
|
this.flag = false
|
this.current = 1
|
this.edcList = []
|
setTimeout(() => {
|
this.getPageList(() => {
|
uni.stopPullDownRefresh()
|
})
|
},1000)
|
},
|
|
handleWatchClick(item) { //查看详情
|
uni.navigateTo({
|
url: '/pages/quality-inspection-page/salt-total-sampling/salt-total-sampling-form/salt-total-sampling-form?params='+JSON.stringify(item)
|
})
|
},
|
addYanGaiMeiForm() { //新增
|
uni.navigateTo({
|
url: '/pages/quality-inspection-page/salt-total-sampling/salt-total-sampling-form/salt-total-sampling-form'
|
})
|
}
|
}
|
}
|
</script>
|
|
<style lang="scss" scoped>
|
@mixin commonBtn($h:62rpx){
|
background-image: linear-gradient(to right,#497bfb,#2467fd);
|
height: $h!important;
|
box-shadow: 0 0 10px rgba(43,98,239,0.5);
|
}
|
.yanGaiMei-sampling-wrap{
|
width: 100%;
|
.edc-sampling-main{
|
width: 100%;
|
display: flex;
|
flex-direction: column;
|
padding: 30rpx 20rpx;
|
box-sizing: border-box;
|
.edc-sampling-main-inside{
|
width: 100%;
|
display: flex;
|
flex-direction: column;
|
}
|
.yanGaiMei-sampling-add{
|
width: 100%;
|
border-radius: 20rpx;
|
background: #fff;
|
box-shadow: 0 0 25px rgba(73,120,240,0.15);
|
display: flex;
|
justify-content: center;
|
padding: 20rpx 0;
|
box-sizing: border-box;
|
position: sticky;
|
top: 10rpx;
|
z-index: 999;
|
.add-box{
|
display: flex;
|
align-content:center;
|
::v-deep {
|
.u-image{
|
width: auto!important;
|
height: auto!important;
|
}
|
.u-image__image{
|
width: 60rpx!important;
|
height: 60rpx!important;;
|
}
|
}
|
h1{
|
font-size: 30rpx;
|
color: #fcbd20;
|
margin-left: 30rpx;
|
align-self: center;
|
display: flex;
|
}
|
}
|
}
|
.edc-sampling-card{
|
width: 100%;
|
border-radius: 20rpx;
|
background: #fff;
|
box-shadow: 0 0 25px rgba(73,120,240,0.15);
|
padding: 30rpx;
|
box-sizing: border-box;
|
margin-top: 20rpx;
|
.edc-sampling-line{
|
width: 100%;
|
display: flex;
|
justify-content: space-between;
|
align-items: baseline;
|
h1{
|
font-size: 34rpx;
|
color: #1c1c1c;
|
font-weight: 550;
|
line-height: 2;
|
width: calc(100% - 124rpx);
|
overflow: hidden;
|
white-space: nowrap;
|
text-overflow: ellipsis;
|
}
|
h2{
|
font-size: 30rpx;
|
color: #515151;
|
line-height: 2;
|
}
|
.status{
|
color: #184edd;
|
border: 1px solid #184edd;
|
border-radius: 10rpx;
|
font-size: 28rpx;
|
padding: 0 10rpx;
|
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: #fcbd20;
|
border: 1px solid #fcbd20;
|
}
|
}
|
.edc-sampling-btn-box{
|
display: flex;
|
justify-content: flex-end;
|
margin-top:20rpx;
|
::v-deep{
|
.u-button{
|
border-radius: 50rpx;
|
margin: 0 10rpx;
|
padding: 0 50rpx;
|
@include commonBtn
|
}
|
}
|
.watch{
|
margin: 0 15rpx;
|
}
|
}
|
}
|
.isOver{
|
width: 100%;
|
display: flex;
|
justify-content: center;
|
padding: 40rpx 0;
|
font-size: 30rpx;
|
color: #999999;
|
}
|
}
|
}
|
</style>
|