<template>
  <view class="page-raw-ingoods">
    <view class="header">
      <view class="left">
        <u-icon class="icon" name="arrow-left" @click="goback()" />
      </view>
      <view class="title">wms菜单</view>
      <view class="right"></view>
    </view>
    <view v-if="wmsRImenuList.length" class="container">
      <view class="toptitle">
        <view class="shuxian"></view>
        <view class="title"> 原材料入库 </view>
      </view>
      <view class="tubiao">
        <u-icon
          v-for="item in wmsRImenuList"
          :key="item.path"
          @click="
            uni.navigateTo({
              url: item.path,
            })
          "
          :label="item.menuName"
          label-pos="bottom"
          size="80"
          name="../../static/icons/icon-54.png"
        ></u-icon>
      </view>
    </view>
    <view v-if="wmsROmenuList.length" class="container">
      <view class="toptitle">
        <view class="shuxian"></view>
        <view class="title"> 原材料出库 </view>
      </view>
      <view class="tubiao">
        <u-icon
          v-for="item in wmsROmenuList"
          :key="item.path"
          @click="
            uni.navigateTo({
              url: item.path,
            })
          "
          :label="item.menuName"
          label-pos="bottom"
          size="80"
          name="../../static/icons/icon-55.png"
        ></u-icon>
      </view>
    </view>
    <view v-if="wmsRNmenuList.length" class="container">
      <view class="toptitle">
        <view class="shuxian"></view>
        <view class="title"> 原材料库存管理 </view>
      </view>
      <view class="tubiao">
        <u-icon
          v-for="item in wmsRNmenuList"
          :key="item.path"
          @click="
            uni.navigateTo({
              url: item.path,
            })
          "
          :label="item.menuName"
          label-pos="bottom"
          size="80"
          :name="item.menuName == '盘点' ? '../../static/icons/icon-53.png' : '../../static/icons/icon-56.png'"
        ></u-icon>
      </view>
    </view>
    <view v-if="wmsPImenuList.length" class="container">
      <view class="toptitle">
        <view class="shuxian"></view>
        <view class="title"> 成品入库 </view>
      </view>
      <view class="tubiao">
        <u-icon
          v-for="item in wmsPImenuList"
          :key="item.path"
          @click="
            uni.navigateTo({
              url: item.path,
            })
          "
          :label="item.menuName"
          label-pos="bottom"
          size="80"
          name="../../static/icons/icon-54.png"
        ></u-icon>
      </view>
    </view>
    <view v-if="wmsPOmenuList.length" class="container">
      <view class="toptitle">
        <view class="shuxian"></view>
        <view class="title"> 成品出库 </view>
      </view>
      <view class="tubiao">
        <u-icon
          v-for="item in wmsPOmenuList"
          :key="item.path"
          @click="
            uni.navigateTo({
              url: item.path,
            })
          "
          :label="item.menuName"
          label-pos="bottom"
          size="80"
          name="../../static/icons/icon-55.png"
        ></u-icon>
      </view>
    </view>
    <view v-if="wmsPNmenuList.length" class="container">
      <view class="toptitle">
        <view class="shuxian"></view>
        <view class="title"> 成品库存管理 </view>
      </view>
      <view class="tubiao">
        <u-icon
          v-for="item in wmsPNmenuList"
          :key="item.path"
          @click="
            uni.navigateTo({
              url: item.path,
            })
          "
          :label="item.menuName"
          label-pos="bottom"
          size="80"
          :name="item.menuName.includes('盘点') ? '../../static/icons/icon-53.png' : '../../static/icons/icon-56.png'"
        ></u-icon>
      </view>
    </view>
    <view v-if="wmsWGmenuList.length" class="container">
      <view class="toptitle">
        <view class="shuxian"></view>
        <view class="title"> 白胚管理 </view>
      </view>
      <view class="tubiao">
        <u-icon
          v-for="item in wmsWGmenuList"
          :key="item.path"
          @click="
            uni.navigateTo({
              url: item.path,
            })
          "
          :label="item.menuName"
          label-pos="bottom"
          size="80"
          :name="item.menuName.includes('入库') ? '../../static/icons/icon-54.png' : item.menuName.includes('出库') ? '../../static/icons/icon-55.png' : '../../static/icons/icon-56.png'"
        ></u-icon>
        <!-- 写死菜单 -->
        <!-- <u-icon
          @click="
            uni.navigateTo({
              url: page.wms.WhiteReturn,
            })
          "
          label="退货入库"
          label-pos="bottom"
          size="80"
          name="../../static/icons/icon-54.png"
        ></u-icon> -->
      </view>
    </view>
    <!-- 以下为写死的菜单 -->
    <!-- <view class="container">
      <view class="toptitle">
        <view class="shuxian"></view>
        <view class="title"> 原材料入库 </view>
      </view>
      <view class="tubiao">
        <u-icon
          @click="
            uni.navigateTo({
              url: page.wms.ReceiveSRM,
            })
          "
          label="采购收货(SRM)"
          label-pos="bottom"
          size="80"
          name="../../static/icons/icon-54.png"
        ></u-icon>
        <u-icon
          @click="
            uni.navigateTo({
              url: page.wms.PurchaseWHSRM,
            })
          "
          label="采购入库(SRM)"
          label-pos="bottom"
          size="80"
          name="../../static/icons/icon-54.png"
        ></u-icon>
        <u-icon
          @click="
            uni.navigateTo({
              url: page.wms.ReceivePO,
            })
          "
          label="采购收货(PO)"
          label-pos="bottom"
          size="80"
          name="../../static/icons/icon-54.png"
        ></u-icon>
        <u-icon
          @click="
            uni.navigateTo({
              url: page.wms.PurchaseWHPO,
            })
          "
          label="采购入库(PO)"
          label-pos="bottom"
          size="80"
          name="../../static/icons/icon-54.png"
        ></u-icon>
        <u-icon
          @click="
            uni.navigateTo({
              url: page.wms.ReceiveSRM,
            })
          "
          label="调拨收货"
          label-pos="bottom"
          size="80"
          name="../../static/icons/icon-54.png"
        ></u-icon>
        <u-icon
          @click="
            uni.navigateTo({
              url: page.wms.ReceiveSRM,
            })
          "
          label="调拨入库"
          label-pos="bottom"
          size="80"
          name="../../static/icons/icon-54.png"
        ></u-icon>
        <u-icon
          @click="
            uni.navigateTo({
              url: page.wms.ReceiveSRM,
            })
          "
          label="OEM收货"
          label-pos="bottom"
          size="80"
          name="../../static/icons/icon-54.png"
        ></u-icon>
        <u-icon
          @click="
            uni.navigateTo({
              url: page.wms.ReceiveSRM,
            })
          "
          label="OEM入库"
          label-pos="bottom"
          size="80"
          name="../../static/icons/icon-54.png"
        ></u-icon>
      </view>
    </view> -->
    <!-- <view class="container">
      <view class="toptitle">
        <view class="shuxian"></view>
        <view class="title"> 原材料出库 </view>
      </view>
      <view class="tubiao">
        <u-icon
          @click="
            uni.navigateTo({
              url: page.wms.Requisition,
            })
          "
          label="生产领料"
          label-pos="bottom"
          size="80"
          name="../../static/icons/icon-55.png"
        ></u-icon>
        <u-icon
          @click="
            uni.navigateTo({
              url: page.wms.Requisition,
            })
          "
          label="生产退料"
          label-pos="bottom"
          size="80"
          name="../../static/icons/icon-55.png"
        ></u-icon>
        <u-icon
          @click="
            uni.navigateTo({
              url: page.wms.ReceiveSRM,
            })
          "
          label="补料出库"
          label-pos="bottom"
          size="80"
          name="../../static/icons/icon-55.png"
        ></u-icon>
        <u-icon
          @click="
            uni.navigateTo({
              url: page.wms.ReceiveSRM,
            })
          "
          label="委外出库"
          label-pos="bottom"
          size="80"
          name="../../static/icons/icon-55.png"
        ></u-icon>
        <u-icon
          @click="
            uni.navigateTo({
              url: page.wms.ReceiveSRM,
            })
          "
          label="领用出库"
          label-pos="bottom"
          size="80"
          name="../../static/icons/icon-55.png"
        ></u-icon>
        <u-icon
          @click="
            uni.navigateTo({
              url: page.wms.ReceiveSRM,
            })
          "
          label="采购退货"
          label-pos="bottom"
          size="80"
          name="../../static/icons/icon-55.png"
        ></u-icon>
        <u-icon
          @click="
            uni.navigateTo({
              url: page.wms.ReceiveSRM,
            })
          "
          label="退料返修"
          label-pos="bottom"
          size="80"
          name="../../static/icons/icon-55.png"
        ></u-icon>
        <u-icon
          @click="
            uni.navigateTo({
              url: page.wms.ReceiveSRM,
            })
          "
          label="空托出库"
          label-pos="bottom"
          size="80"
          name="../../static/icons/icon-55.png"
        ></u-icon>
      </view>
    </view> -->
    <!-- <view class="container">
      <view class="toptitle">
        <view class="shuxian"></view>
        <view class="title"> 原材料库内 </view>
      </view>
      <view class="tubiao">
        <u-icon
          @click="
            uni.navigateTo({
              url: page.wms.ReceiveSRM,
            })
          "
          label="盘点"
          label-pos="bottom"
          size="80"
          name="../../static/icons/icon-53.png"
        ></u-icon>
        <u-icon
          @click="
            uni.navigateTo({
              url: page.wms.ReceiveSRM,
            })
          "
          label="物料移位"
          label-pos="bottom"
          size="80"
          name="../../static/icons/icon-56.png"
        ></u-icon>
        <u-icon
          @click="
            uni.navigateTo({
              url: page.wms.ReceiveSRM,
            })
          "
          label="托盘移位"
          label-pos="bottom"
          size="80"
          name="../../static/icons/icon-56.png"
        ></u-icon>
      </view>
    </view> -->
    <!-- <view class="container">
      <view class="toptitle">
        <view class="shuxian"></view>
        <view class="title"> 成品入库 </view>
      </view>
      <view class="tubiao">
        <u-icon
          @click="
            uni.navigateTo({
              url: page.wms.OfflineStorage,
            })
          "
          label="下线入库"
          label-pos="bottom"
          size="80"
          name="../../static/icons/icon-54.png"
        ></u-icon>
        <u-icon
          @click="
            uni.navigateTo({
              url: page.wms.ReceiveSRM,
            })
          "
          label="调拨入库"
          label-pos="bottom"
          size="80"
          name="../../static/icons/icon-54.png"
        ></u-icon>
        <u-icon
          @click="
            uni.navigateTo({
              url: page.wms.ReceiveSRM,
            })
          "
          label="销售退货入库"
          label-pos="bottom"
          size="80"
          name="../../static/icons/icon-54.png"
        ></u-icon>
        <u-icon
          @click="
            uni.navigateTo({
              url: page.wms.ReceiveSRM,
            })
          "
          label="OEM入库"
          label-pos="bottom"
          size="80"
          name="../../static/icons/icon-54.png"
        ></u-icon>
      </view>
    </view> -->
    <!-- <view class="container">
      <view class="toptitle">
        <view class="shuxian"></view>
        <view class="title"> 成品出库 </view>
      </view>
      <view class="tubiao">
        <u-icon
          @click="
            uni.navigateTo({
              url: page.wms.SaleOutWH,
            })
          "
          label="销售出库"
          label-pos="bottom"
          size="80"
          name="../../static/icons/icon-55.png"
        ></u-icon>
        <u-icon
          @click="
            uni.navigateTo({
              url: page.wms.ReceiveSRM,
            })
          "
          label="调拨出库"
          label-pos="bottom"
          size="80"
          name="../../static/icons/icon-55.png"
        ></u-icon>
        <u-icon
          @click="
            uni.navigateTo({
              url: page.wms.ReceiveSRM,
            })
          "
          label="领用出库"
          label-pos="bottom"
          size="80"
          name="../../static/icons/icon-55.png"
        ></u-icon>
      </view>
    </view> -->
    <!-- <view class="container">
      <view class="toptitle">
        <view class="shuxian"></view>
        <view class="title"> 成品库内 </view>
      </view>
      <view class="tubiao">
        <u-icon
          @click="
            uni.navigateTo({
              url: page.wms.ReceiveSRM,
            })
          "
          label="盘点"
          label-pos="bottom"
          size="80"
          name="../../static/icons/icon-53.png"
        ></u-icon>
        <u-icon
          @click="
            uni.navigateTo({
              url: page.wms.ReceiveSRM,
            })
          "
          label="物料移位"
          label-pos="bottom"
          size="80"
          name="../../static/icons/icon-56.png"
        ></u-icon>
        <u-icon
          @click="
            uni.navigateTo({
              url: page.wms.ReceiveSRM,
            })
          "
          label="托盘移位"
          label-pos="bottom"
          size="80"
          name="../../static/icons/icon-56.png"
        ></u-icon>
      </view>
    </view> -->
  </view>
</template>

<script lang="ts">
import { Component } from 'vue-property-decorator';
import { BasePage } from '@/components/base/page';
import { session } from '@/store/modules/session';
@Component
export default class RawAppointment extends BasePage {
  childData: any;
  menuList = session.getMenus;
  wmsRImenuList: any = [];
  wmsROmenuList: any = [];
  wmsRNmenuList: any = [];
  wmsPImenuList: any = [];
  wmsPOmenuList: any = [];
  wmsPNmenuList: any = [];
  wmsWGmenuList: any = [];

  onReady() {
    this.wmsRImenuList = this.menuList.filter((item) => item.perms == 'wmsRI');
    this.wmsROmenuList = this.menuList.filter((item) => item.perms == 'wmsRO');
    this.wmsRNmenuList = this.menuList.filter((item) => item.perms == 'wmsRN');
    this.wmsPImenuList = this.menuList.filter((item) => item.perms == 'wmsPI');
    this.wmsPOmenuList = this.menuList.filter((item) => item.perms == 'wmsPO');
    this.wmsPNmenuList = this.menuList.filter((item) => item.perms == 'wmsPN');
    this.wmsWGmenuList = this.menuList.filter((item) => item.perms == 'wmsWG');

    console.log('1234', this.menuList);
  }
  goback() {
    uni.navigateTo({
      url: `/pages/shouye/index`,
    });
  }
  // onLoad(option: { childData: any }) {
  //   //this.childData = JSON.parse(option.childData);
  // }
}
</script>

<style lang="scss" scoped>
.page-raw-ingoods {
  background-color: #f4f7fc;
  padding-top: 150rpx;
  min-height: 100%;

  .header {
    position: fixed;
    top: 0;
    // padding-top: 18px;
    left: 0;
    right: 0;
    z-index: 99;
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    background-color: #d9001b;
    /* height: 46px; */
    line-height: 46px;
    color: #fff;
    font-size: 34rpx;
    font-weight: 500;
    text-align: center;
    box-shadow: 0 1px 2px #e87675;
    padding: 60rpx 0rpx 0rpx;
    .title {
      flex: 3;
    }
    .left,
    .right {
      flex: 1;
    }
    .icon {
      display: flex;
      justify-content: center;
      align-items: center;
      width: 88rpx;
      height: 88rpx;
    }
  }

  .container {
    background-color: #ffffff;
    padding: 20rpx;
    border: 2rpx solid #9093992e;
    margin-top: 12rpx;
    border-radius: 4rpx;
    // padding: 30rpx 15rpx 0;
    .toptitle {
      display: flex;
      flex-direction: row;
      padding: 6rpx;
      .shuxian {
        border: 2rpx solid red;
        margin-right: 24rpx;
      }
      .title {
        // margin-bottom: 10rpx;
      }
    }
    .tubiao {
      margin-left: 40rpx;
      margin-right: 40rpx;
    }
  }
}
::v-deep .u-icon {
  padding: 17rpx;
}
::v-deep .u-icon__label {
  width: 124rpx;
  text-align: center;
}
</style>
