yangan
2024-07-05 9a0876466b8d98816294f2cae5f564b2e69972ef
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
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
<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>
      <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>
      <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>
            <!--    #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.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>-->
        <!--             &lt;!&ndash;           <view class="watch">&ndash;&gt;-->
        <!--             &lt;!&ndash;             <u-button type="primary" :plain="true">查看</u-button>&ndash;&gt;-->
        <!--             &lt;!&ndash;           </view>&ndash;&gt;-->
        <!--           </view>-->
        <!--         </view>-->
      </div>
    </div>
  </view>
</template>
 
<script>
export default {
  name: "salt-total-sampling",
  components: {},
 
  data() {
    return {
      edcList:[],
      emptyShow: false,
      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 ''
      }
    },
    /* #ifdef H5 */
    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 ''
      }
    },
    /* #endif */
    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]
        if(this.edcList == 0) {
          this.emptyShow = true
        }else {
          this.emptyShow = false
        }
        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;
    }
    .empty-box{
      margin: auto;
      position: absolute;
      top: 24%;
      left: 50%;
      transition: (50%, -50%);
      transform: translate(-50%, -24%);
    }
  }
}
</style>