<template>
  <view class="Scanning_Result">
    <view class="Scanning_top">
      <view class="Scanning_top_icon">
        <text class="cubeic-close newicon newicon-chaoshi"></text>
        <view class="text1"> {{queryObj.clothesTypeName}}-异常详情 </view>
      </view>
    </view>

    <view class="Scanning_cont">
      <view class="Scanning_cont_list">
        <scroll-view scroll-y="true" class="Scanning_cont_list_scroll">
          <view class="Scanning_cont_list_item" v-for="(item, j) in dataList" :key="item.id">
            <view class="row">
              <view class="row_item">
                调整数量：<text class="red">{{item.changeNum}}</text>
              </view>
              <view class="row_item">
                原因：<text class="red">{{item.clothesExceptionRe ? item.clothesExceptionRe.name : ''}}</text>
              </view>
            </view>
            <view class="row">
              <view class="row_item">
                备注：{{item.remarks}}
              </view>
            </view>
            <view class="row">
              <view class="row_item">
                调整人：{{item.changerDTO ? item.changerDTO.name : ''}}
              </view>
              <view class="row_item">
                调整时间：{{item.changeTime | formatDate('yyyy-MM-dd hh:mm:ss')}}
              </view>
            </view>
          </view>
        </scroll-view>
      </view>
    </view>

    <view class="foot_btn">
      <view class="btn" @click="goBack()"> 返回 </view>
    </view>
  </view>
</template>
<script>
  import {
    get,
    post,
    SM,
    webHandle
  } from "../../../http/http.js";
  export default {
    data() {
      return {
        hosId: uni.getStorageSync('userData').user.currentHospital.id,
        queryObj: {}, //路由传递过来的数据
        dataList: [],
        // 弹窗model
        models1: {
          disjunctor: false,
        },
      };
    },
    methods: {
      goBack(){
        uni.navigateBack();
      },
      getInfo(){
        uni.showLoading({
          title: "加载中",
          mask: true,
        });
        post("/simple/data/fetchDataList/clothesException", {
            "idx": 0,
            "sum": 9999,
            "clothesException": {
                "hosId": this.hosId,
                "batchId": this.queryObj.batchId,
                "clothesType": {
                  id: this.queryObj.clothesTypeId,
                },
                "clothesDept": this.queryObj.relatedDept,
            }
        }).then((result) => {
          uni.hideLoading();
          if (result.status == 200) {
            this.dataList = result.list || [];
          } else {
            uni.showToast({
              icon: "none",
              title: result.msg || "接口获取数据失败！",
            });
          }
        });
      },
    },
    onLoad(options) {
      console.log(options, "result");
      this.queryObj = options;
      this.getInfo();
      // #ifdef APP-PLUS
      webHandle("no", "app");
      // #endif
      // #ifdef H5
      webHandle("no", "wx");
      // #endif
    },
  };
</script>
<style lang="less" scoped>
  .Scanning_Result {
    height: 100vh;
    display: flex;
    flex-direction: column;
    background-color: #fff;
    .Scanning_top {
      flex-shrink: 0;
      .Scanning_top_icon {
        padding-top: 26rpx;
        display: flex;
        justify-content: center;
        align-items: center;

        .cubeic-ok {
          font-size: 140rpx;
          color: #35b34a;
        }

        .cubeic-close {
          font-size: 48rpx;
          color: #ff3b53;
        }

        .text1 {
          font-size: 48rpx;
          font-weight: bold;
        }
      }
    }

    .Scanning_cont {
      flex: 1;
      min-height: 0;
      display: flex;
      flex-direction: column;
      width: 710rpx;
      margin: 0 20rpx;

      .Scanning_cont_list{
        flex: 1;
        min-height: 0;
        display: flex;
        flex-direction: column;
        .Scanning_cont_list_scroll{
          flex: 1;
          min-height: 0;
        }
        .Scanning_cont_list_item{
          margin-top: 15rpx;
          padding: 30rpx;
          font-size: 28rpx;
          background-color: #FAFBFD;
          .row{
            display: flex;
            justify-content: space-between;
            margin-top: 20rpx;
          }
        }
      }
    }

    .foot_btn {
      flex-shrink: 0;
      line-height: 88rpx;
      display: flex;
      justify-content: center;

      .btn {
        height: 88rpx;
        flex: 1;
        margin-right: 1%;
        background-image: linear-gradient(to right, #72c172, #3bb197);
        color: #fff;
        border-radius: 8rpx;
        font-size: 28rpx;
        text-align: center;
        &:last-of-type{
          margin-right: 0;
        }
      }
    }
  }
</style>
