| <template> | 
|     <view> | 
|         <view style="position: relative;"> | 
|             <u-empty mode="data" | 
|                 icon="http://cdn.uviewui.com/uview/empty/data.png" | 
|                 textSize="30" | 
|                 iconSize="1000" | 
|                 v-if="detailData.length == 0"></u-empty> | 
|         </view> | 
|         <view class="collection-form"> | 
|             <view class="collection-form-item" | 
|                 v-for="(item, index) in detailData" | 
|                 :key="index"> | 
|                 <view class="weigh-item"> | 
|                     <view class="item"> | 
|                         <view class="concrete" | 
|                             :style="{ backgroundImage: `url(${onlineurl}/appimg/image/banner/skin.png)`, backgroundSize: 'cover', backgroundRepeat: 'no-repeat' }"> | 
|                             皮 | 
|                         </view> | 
|                         <view class="num">{{ item.skin }}</view> | 
|                     </view> | 
|                     <view class="item"> | 
|                         <view class="concrete" | 
|                             :style="{ backgroundImage: `url(${onlineurl}/appimg/image/banner/hair.png)`, backgroundSize: 'cover', backgroundRepeat: 'no-repeat' }"> | 
|                             毛 | 
|                         </view> | 
|                         <view class="num">{{ item.hair }}</view> | 
|                     </view> | 
|                     <view class="item"> | 
|                         <view class="concrete" | 
|                             :style="{ backgroundImage: `url(${onlineurl}/appimg/image/banner/clean.png)`, backgroundSize: 'cover', backgroundRepeat: 'no-repeat' }"> | 
|                             净 | 
|                         </view> | 
|                         <view class="num">{{ item.clean }}</view> | 
|                     </view> | 
|                 </view> | 
|                 <view class="order-type info"> | 
|                     订单类型:{{item.orderType}} | 
|                 </view> | 
|                 <view class="car-num info"> | 
|                     车牌号:{{item.carNo}} | 
|                 </view> | 
|                 <view class="file-name info"> | 
|                     煤场名称:{{item.filedName}} | 
|                 </view> | 
|                 <view class="order-margin info"> | 
|                     煤种名称:{{item.coalName}} | 
|                 </view> | 
|                 <view class="confirm-button info"> | 
|                     <u-button plain | 
|                         type="primary" | 
|                         text="确定装卸" | 
|                         shape="circle" | 
|                         @click.stop="loadOrder(item.id)" | 
|                         :loading="loading" | 
|                         loadingText="确认"></u-button> | 
|                 </view> | 
|             </view> | 
|         </view> | 
|         <u-modal :show="loadShow" | 
|             content='确认装卸此提煤单' | 
|             :showCancelButton="true" | 
|             @confirm="confirmUnload" | 
|             @cancel="cancelUnload"></u-modal> | 
|     </view> | 
| </template> | 
|   | 
| <script> | 
|     import { onlineurl } from '@/api/request.js' | 
|     export default { | 
|         data() { | 
|             return { | 
|                 name: "", | 
|                 detailData: [], | 
|                 onlineurl, | 
|                 loadShow: false, // 确认弹窗控制 | 
|                 loading: false, | 
|                 id: "" | 
|             } | 
|         }, | 
|         onLoad(params) { | 
|             this.name = params.coalName ? params.coalName : '' | 
|             this.init() | 
|         }, | 
|         methods: { | 
|             init() { | 
|                 uni.showLoading({ | 
|                     title: "加载中" | 
|                 }) | 
|                 this.$reqGet('getAccordingCoalNameAll', { coalName: this.name }).then(res => { | 
|                     uni.hideLoading() | 
|                     if (res.code === 0) { | 
|                         this.detailData = res.data | 
|                     } else { | 
|                         this.$u.toast('加载失败') | 
|                     } | 
|                 }) | 
|             }, | 
|             loadOrder(id) { | 
|                 this.loadShow = true; | 
|                 this.id = id; | 
|             }, | 
|             confirmUnload() { | 
|                 this.loadShow = false; | 
|                 this.loading = true | 
|                 this.$reqPost('confirmLoadAndUnload', { tmId: this.id }, 'params').then(res => { | 
|                     this.loading = false; | 
|                     if (res.code === 0) { | 
|                         this.$u.toast('装卸成功') | 
|                         this.init() | 
|                     } else { | 
|                         this.$u.toast(res.msg ? res.msg : '装卸失败') | 
|                     } | 
|                 }) | 
|             }, | 
|             cancelUnload() { | 
|                 this.loadShow = false | 
|             }, | 
|         } | 
|     } | 
| </script> | 
|   | 
| <style lang="scss" | 
|     scoped> | 
|     .collection-form { | 
|         width: vww(345); | 
|         margin: 0 vww(15); | 
|         position: relative; | 
|   | 
|         .collection-form-item { | 
|             width: 690rpx; | 
|             height: 400rpx; | 
|             background: #ffffff; | 
|             box-shadow: 4rpx 6rpx 25rpx 0rpx rgba(73, 120, 240, 0.15); | 
|             border-radius: 20rpx; | 
|             overflow: hidden; | 
|             @include flex; | 
|             flex-direction: column; | 
|             position: relative; | 
|             justify-content: center; | 
|             margin-top: vww(10); | 
|   | 
|             .weigh-item { | 
|                 width: 100%; | 
|                 height: vww(36); | 
|                 margin: vww(10); | 
|                 @include flex; | 
|                 justify-content: space-around; | 
|   | 
|                 .item { | 
|                     min-width: vww(50); | 
|                     height: vww(45); | 
|                     font-size: 21rpx; | 
|                     font-weight: 400; | 
|                     color: #ffffff; | 
|                     text-align: center; | 
|                     line-height: vww(30); | 
|                     @include flex; | 
|   | 
|                     .concrete { | 
|                         width: vww(36); | 
|                         height: vww(36); | 
|                     } | 
|   | 
|                     .num { | 
|                         font-size: 40rpx; | 
|                         font-weight: 300; | 
|                         color: #303030; | 
|                     } | 
|                 } | 
|             } | 
|   | 
|             .info { | 
|                 height: vww(20); | 
|                 color: #515151; | 
|                 margin: vww(5); | 
|                 margin-left: vww(20); | 
|             } | 
|   | 
|             .confirm-button { | 
|                 width: vww(80); | 
|                 position: absolute; | 
|                 bottom: vww(20); | 
|                 right: vww(10); | 
|             } | 
|         } | 
|     } | 
| </style> |