yangan
2024-06-05 589231104e74c362512f656f8a50b4bb6c26e182
pages/loadUnload-page/selectTarget/selectTarget.vue
@@ -3,7 +3,6 @@
      <!-- 当前选择仓库 -->
      <view class="top-tag">
         <u-tag 
         size='large'
         :text="dataForm.firstClass ? dataForm.firstClass : '请选择仓库'"
         @click="firstClassSelect"
         ></u-tag>
@@ -46,8 +45,7 @@
         <zh-collapse @change='change' accordion     v-for="item,i in detailData"       
         :key="i">
            <zh-collapse-item 
         class="collItem"
                @clickContent='clickContent'>
         class="collItem">
                <view class="" slot='title'>
               <view class="history-information">
                     <view class="first">
@@ -96,7 +94,48 @@
               </view>
            
            </view>
                <view class="" slot='cont'>支持定义内容</view>
                <view class="" slot='cont'>
                      <view class="table">
         <uni-table border stripe
         emptyText="暂无更多数据">
               <uni-tr>
                   <uni-th align="center" width='100'>产品</uni-th>
                  <uni-th align="center">车牌号</uni-th>
                  <uni-th align="center" width='100'>类型</uni-th>
                  <uni-th align="center" width='100'>皮重</uni-th>
                  <uni-th align="center" width='100'>毛重</uni-th>
                   <!-- <uni-th align="center">仓库</uni-th> -->
                  <uni-th align="center" width='100'>状态</uni-th>
                  <uni-th width='200' class="fixed" align="center">操作</uni-th>
               </uni-tr>
               <uni-tr v-for="(subItem, index) in item.tmTaskCoalList" :key="index">
                  <uni-td align="center">
                     <view>{{ subItem.productName }}</view></uni-td>
                     <uni-td align="center">
                     <view style="width:150rpx">{{ subItem.carNo }}</view></uni-td>
               <uni-td>
                  <view class="name">{{ subItem.orderType }}</view>
               </uni-td>
               <uni-td>
                  <view class="name">{{ subItem.skin }}</view>
               </uni-td>
               <uni-td>
                  <view class="name">{{ subItem.hair }}</view>
               </uni-td>
<!--
                <uni-td align="center">
               <view>{{ subItem.bunkerName }}</view></uni-td> -->
                 <uni-td align="center">
               <view>{{ subItem.statusView }}</view></uni-td>
                 <uni-td  align="center">
               <view class="btnBox">
                  <text  @click="viewDetail(subItem)">查看</text>
                  <text v-if="subItem.flag" @click="enterOk(subItem)">确认装卸</text>
                  </view></uni-td>
            </uni-tr>
            </uni-table>
       </view>
            </view>
            </zh-collapse-item>
        </zh-collapse>
@@ -107,6 +146,27 @@
         :closeOnClickOverlay='true'
         @close='firstClassClose'
         @select="firstClassSelectClick"></u-action-sheet>
         <u-modal :show="enterZx"
            :title="'提示'"
            @close="closeModal"
            @cancel="cancelModal"
            @confirm="confirmModal"
            :closeOnClickOverlay="true"
            :showCancelButton="true">
            <view class="slot-content">
               是否确认装卸?
               <view v-if="isNumOk">
                  <text>产品名称:{{activeObj.productName}}</text>
                  <view>
                       <u--input
                        placeholder="请输入数量"
                        border="surround"
                        v-model="checkNum"
                     ></u--input>
                     </view>
               </view>
            </view>
         </u-modal>
      <!-- 煤仓 -->
      <!-- <u-action-sheet :actions="secondClassActionsList"
         :show="secondClassShow"
@@ -135,6 +195,8 @@
               bunkerId:""
            },
            index: '',
            enterZx:false,
            isNumOk:false,
            // 煤场操作菜单
            firstClassActionsList: [],
            firstClassShow: false,
@@ -143,6 +205,8 @@
            secondClassShow: false,
            coalList: [],
            checkedCoal: [],
            checkNum:'',
            activeObj:{},
            userInfo: {},
            detailData:[],
            filedId: "",
@@ -163,6 +227,13 @@
         };
      },
      methods: {
         viewDetail(item){
            //查看收发单详情
            uni.navigateTo({
               url: `/pages/loadUnload-page/loadUnlaodPageDetail/detail?id=${item.id}&checkId=${item.checkId}`
            });
         },
         getUserInfo() {
            this.$reqGet('getUserEntity').then(res => {
               this.userInfo = res.data;
@@ -182,11 +253,6 @@
                     this.dataForm.bunkerId = res.data[0].id;
                        uni.setStorageSync('bunkerId',res.data[0].id)
                     this.dataForm.firstClass = res.data[0].name;
                     setTimeout(()=>{
                        uni.navigateTo({
                     url: `/pages/loadUnload-page/loadUnload-detail/loadUnload-detail?bunkerId=${this.dataForm.bunkerId}`
               })
                     },300)
               
                  }
               } else {
@@ -202,19 +268,32 @@
         firstClassClose() {
            this.firstClassShow = false
         },
         firstClassSelectClick(val) {
            this.dataForm.firstClass = val.name;
            this.dataForm.bunkerId= val.id;
            uni.setStorageSync('bunkerId', val.id);
            this.$reqGet('getTaskCoalListByBunkerId', { bunkerId:this.dataForm.bunkerId }).then(res => {
               uni.hideLoading()
         getDetailData(){
                 uni.showLoading({
                    title:'加载中'
                })
               this.$reqGet('getTaskCoalListByBunkerId', { bunkerId:this.dataForm.bunkerId }).then(res => {
               if (res.code === 0) {
                  this.detailData = res.data;
                  this.detailData = res.data.map(item=>{
                     item.tmTaskCoalList.map(el=>{
                      el.flag = el.isPretendDischar ? false : true
                     return el
                     })
                   return item;
                  });
                  console.log(this.detailData,'detailData')
               uni.hideLoading();
               } else {
                  this.$u.toast('加载失败')
               }
            })
         },
         firstClassSelectClick(val) {
            this.dataForm.firstClass = val.name;
            this.dataForm.bunkerId= val.id;
            uni.setStorageSync('bunkerId', val.id);
            this.getDetailData();
            this.filedId = val.id
         },
         // 获取煤仓
@@ -274,7 +353,38 @@
         close(){
         },
         open(){}
         open(){},
         enterOk(item){
            console.log('123',item)
            this.activeObj = item;
            if(item.productQuantity){
               this.isNumOk = true;
            }
            this.enterZx = true;
         },
         closeModal(){
            this.enterZx = false;
         },
         cancelModal(){
            this.enterZx = false;
         },
         confirmModal(){
            this.enterZx = false;
            this.$reqPost('confirmLoadAndUnload',{
               id: this.activeObj.id,
               productQuantity:this.isNumOk ? this.checkNum :this.activeObj.skin,
               isPretendDischar:this.activeObj.isPretendDischar
             },'json').then(res=>{
               console.log(res,'rez')
               if(res.code === 0){
                 this.$u.toast('操作成功');
                    this.getDetailData();
               }
            })
         }
      },
      onShow(){
@@ -303,6 +413,41 @@
<style lang="scss"
   scoped>
   .table{
      width: 94%;
      margin-left: 20rpx;
        overflow-x: auto;
      /deep/   .uni-table-th{
         font-size: 12px;
        }
      /deep/   .uni-table-td {
         font-size: 12px;
        }
   /deep/ .uni-table{
         min-width: 340rpx!important;
      }
   /deep/    .uni-table-body-wrapper {
  position: relative;
}
 /deep/ .uni-table-body {
  display: flex;
}
.fixed {
  position: sticky;
  right: 0;
  z-index: 1;
  background-color: #ffffff;
}
   }
   .btnBox{
      min-width: 150rpx;
      display: flex;
      justify-content: space-between;
       text{
         color: #035cfb;
      }
   }
   .main {
      width: 94%;
      margin: 10px;
@@ -356,6 +501,9 @@
   }
            .collItem{
               margin-top: 30rpx;
               /deep/ .content{
                  background: none!important;
               }
            }
            .history-information {