<template>
  <view class="query-wrap">
    <view class="inner-item">
      <view class="text-title">
        <view class="title-circ"> </view>
        <span class="title-text">基本信息</span>
      </view>
      <template v-if="acceptDetaData.isPending">
        <view class="inventory-item" style="margin-top: 40rpx">
          <view class="shuo-item-name">
            <view class="shuo-label-podnme">药品名称:</view>
            <view class="shuo-unit">
              <span>{{ acceptDetaData.drugName }}</span>
            </view>
          </view>
        </view>
        <view class="inventory-item">
          <view class="shuo-item">
            <view class="shuo-label">采购数量:</view>
            <view class="shuo-cont">{{ acceptDetaData.ordCnt || "" }}</view>
          </view>
          <view class="shuo-item">
            <view class="shuo-label">采购总额:</view>
            <view class="shuo-cont">{{ acceptDetaData.purcAmt || "" }}</view>
          </view>
        </view>
        <view class="inventory-item">
          <view class="shuo-item">
            <view class="shuo-label">配送数量:</view>
            <view class="shuo-cont">{{ acceptDetaData.delvCnt || "" }}</view>
          </view>
          <view class="shuo-item">
            <view class="shuo-label">配送总额:</view>
            <view class="shuo-cont">{{ acceptDetaData.delvAmt || "" }}</view>
          </view>
        </view>
        <view class="inventory-item">
          <view class="shuo-item">
            <view class="shuo-label">验收数量:</view>
            <view class="shuo-cont">{{ acceptDetaData.shppCnt || "" }}</view>
          </view>
          <view class="shuo-item">
            <view class="shuo-label">验收总额:</view>
            <view class="shuo-cont">{{ acceptDetaData.delvAmt || "" }}</view>
          </view>
        </view>
      </template>
      <template v-else>
        <!-- 已验收显示原有全部字段 -->
        <view class="inventory-item" style="margin-top: 40rpx">
          <view class="shuo-item-name">
            <view class="shuo-label-podnme">药品名称:</view>
            <view class="shuo-unit">
              <span>{{ acceptDetaData.drugName }}</span>
            </view>
          </view>
        </view>
        <view class="inventory-item">
          <view class="shuo-item-name">
            <view class="shuo-label">药品规格:</view>
            <view class="shuo-cont">
              {{
                "【" +
                acceptDetaData.specName +
                "*" +
                acceptDetaData.convrat +
                acceptDetaData.pac +
                "/" +
                acceptDetaData.pacUnt +
                "】"
              }}
            </view>
          </view>
        </view>
        <view class="inventory-item">
          <view class="shuo-item">
            <view class="shuo-label">采购数量:</view>
            <view class="shuo-cont">{{ acceptDetaData.ordCnt || "" }}</view>
          </view>
          <view class="shuo-item">
            <view class="shuo-label">采购总额:</view>
            <view class="shuo-cont">{{ acceptDetaData.ordAmt || "" }}</view>
          </view>
        </view>
        <view class="inventory-item">
          <view class="shuo-item">
            <view class="shuo-label">配送数量:</view>
            <view class="shuo-cont">{{ acceptDetaData.delvCnt || "" }}</view>
          </view>
          <view class="shuo-item">
            <view class="shuo-label">配送总额:</view>
            <view class="shuo-cont">{{ acceptDetaData.ordAmt || "" }}</view>
          </view>
        </view>
        <view class="inventory-item">
          <view class="shuo-item">
            <view class="shuo-label">验收数量:</view>
            <view class="shuo-cont">{{ acceptDetaData.shppCnt || "" }}</view>
          </view>
          <view class="shuo-item">
            <view class="shuo-label">验收总额:</view>
            <view class="shuo-cont">{{ acceptDetaData.stoinAmt || "" }}</view>
          </view>
        </view>
        <view class="inventory-item">
          <view class="shuo-item">
            <view class="shuo-label">拒收数量:</view>
            <view class="shuo-cont">{{ acceptDetaData.refsCnt || "" }}</view>
          </view>
          <view class="shuo-item">
            <view class="shuo-label">拒收总额:</view>
            <view class="shuo-cont">{{ acceptDetaData.refsAmt || "" }}</view>
          </view>
        </view>
        <view class="inventory-item">
          <view class="shuo-item">
            <view class="shuo-label">拒收原因:</view>
            <view class="shuo-cont">{{ acceptDetaData.refsRea || "" }}</view>
          </view>
        </view>
      </template>
    </view>
    <!-- 药品基础信息部分保持不变 -->
    <view class="inner-item">
      <view class="text-title">
        <view class="title-circ"> </view>
        <span class="title-text">药品基础信息</span>
      </view>
      <view class="inventory-item" style="margin-top: 40rpx">
        <view class="shuo-item-name">
          <view class="shuo-label-podnme"> 药品分类: </view>
          <view class="shuo-unit">
            <span>{{ acceptDetaData.drugType || "" }}</span>
          </view>
        </view>
      </view>
      <view class="inventory-item">
        <view class="shuo-item-name">
          <view class="shuo-label"> 批准文号: </view>
          <view class="shuo-cont">
            <span>{{ acceptDetaData.aprvNo }}</span>
          </view>
        </view>
      </view>
      <view class="inventory-item">
        <view class="shuo-item-name">
          <view class="shuo-label-podnme"> 生产企业: </view>
          <view class="shuo-cont">
            <span>{{ acceptDetaData.prodentpName }}</span>
          </view>
        </view>
      </view>
      <view class="inventory-item">
        <view class="shuo-item-name">
          <view class="shuo-label"> 生产方式: </view>
          <view class="shuo-cont">
            {{ acceptDetaData.prodMode || "" }}
          </view>
        </view>
      </view>
      <view class="inventory-item">
        <view class="shuo-item-name">
          <view class="shuo-label"> 通用名称: </view>
          <view class="shuo-cont">
            {{ acceptDetaData.genName || "" }}
          </view>
        </view>
      </view>
      <view class="inventory-item">
        <view class="shuo-item-name">
          <view class="shuo-label"> 化学名称: </view>
          <view class="shuo-cont">
            <span>{{ acceptDetaData.chemName || "" }}</span>
          </view>
        </view>
      </view>
      <view class="inventory-item">
        <view class="shuo-item-name">
          <view class="shuo-label-podnme"> 限价/参考价: </view>
          <view class="shuo-cont">
            <span>{{ acceptDetaData.lmtPric || "" }}</span>
          </view>
        </view>
      </view>
      <view class="inventory-item">
        <view class="shuo-item-name">
          <view class="shuo-label"> 最小单位: </view>
          <view class="shuo-cont">
            <span>{{ acceptDetaData.pac || "" }}</span>
          </view>
        </view>
      </view>
      <view class="inventory-item">
        <view class="shuo-item-name">
          <view class="shuo-label"> 包装单位: </view>
          <view class="shuo-cont">
            <span>{{ acceptDetaData.pacUnt || "" }}</span>
          </view>
        </view>
      </view>
      <view class="inventory-item">
        <view class="shuo-item-name">
          <view class="shuo-label"> 包装数量: </view>
          <view class="shuo-cont">
            <span>{{ acceptDetaData.convrat || "" }}</span>
          </view>
        </view>
      </view>
      <view class="inventory-item">
        <view class="shuo-item-name">
          <view class="shuo-label"> 件装数量: </view>
          <view class="shuo-cont">
            <span>{{ acceptDetaData.pieceUntNum || "" }}</span>
          </view>
        </view>
      </view>
      <view class="inventory-item">
        <view class="shuo-item-name">
          <view class="shuo-label"> 存储仓库: </view>
          <view class="shuo-cont">
            <span>{{ acceptDetaData.stogWrhs || "" }}</span>
          </view>
        </view>
      </view>
      <view class="inventory-item">
        <view class="shuo-item-name">
          <view class="shuo-label"> 存储条件: </view>
          <view class="shuo-cont">
            <span>{{ acceptDetaData.stogCond || "" }}</span>
          </view>
        </view>
      </view>
      <view class="inventory-item">
        <view class="shuo-item">
          <view class="shuo-label"> 采购价: </view>
          <view class="shuo-cont">
            {{ acceptDetaData.delvPric || "" }}
          </view>
        </view>
      </view>
    </view>
  </view>
</template>
<script>
import moment from "moment";
export default {
  data() {
    return {
      listData: [],
      acceptDetaData: {},
      subMitData: {},
    };
  },
  onShow() {
    let that = this;
    uni.getStorage({
      key: "detailsDrugId",
      success: function (res) {
        that.acceptDetaData = res.data;
        console.log(that.acceptDetaData, "that.acceptDetaData");
      },
    });
  },
  mounted() {},
  methods: {
    forMatTime(row) {
      return moment(row).format("YYYY-MM-DD ");
    },
    //日期格式化
    forMatTime(time) {
      return moment(time).format("YYYY-MM-DD");
    },
    //加时分秒
    forMatTimehs(time) {
      return moment(time).format("YYYY-MM-DD");
    },
  },
  watch: {},
};
</script>

<style lang="scss" scoped>
.query-wrap {
  width: 100%;
  height: 100%;
  padding: 20rpx;
  box-sizing: border-box;
  background-color: #f1f1f1;
  overflow-y: scroll;
  overflow-x: hidden;
  position: relative;
  padding-bottom: 200rpx;

  .botm-btn {
    width: 100%;
    height: 120rpx;
    background-color: #fff;
    position: fixed;
    left: 0;
    bottom: 0;
    padding-top: 40rpx;
    display: flex;
    align-items: center;
    justify-content: space-around;
  }

  .time-view {
    height: 350rpx;
    background-color: #fff;
    padding: 50rpx 50rpx 0 50rpx;
    box-sizing: border-box;

    .btn-view {
      width: 100%;
      height: 100rpx;
      margin-top: 100rpx;
      display: flex;
      justify-content: space-around;
    }
  }
}
.title-text {
  font-size: 32rpx;
  color: #5ab7a5;
  font-weight: bold;
}
.item-stats {
  margin-top: 80rpx;
}
uni-page-body {
  width: 100%;
  height: 100%;
}
</style>
