<!-- @desc:库存冻结  @auth:宋扬  @time:2024/2/19 12:59 -->
<template>
  <div class="main-div">
    <loading :loading="loading" v-if="!modalVisible"></loading>
    <!--按钮区-->
    <BaseIndexButtonGroup ref="BaseIndexButtonGroup" id="BaseIndexButtonGroup">
      <template #left>
        <!--    查询    -->
        <BaseIndexButton ref="search" name="search"></BaseIndexButton>
        <!--    清空条件    -->
        <BaseIndexButton ref="clear" name="clear"></BaseIndexButton>
        <!--    冲正    -->
        <BaseIndexButton ref="revert" name="revert"></BaseIndexButton>
        <!--关闭-->
        <BaseIndexButton ref="close" name="close"></BaseIndexButton>
      </template>
      <template #right>
        <!--   新建     -->
        <BaseIndexButton ref="add" name="add"></BaseIndexButton>
      </template>
    </BaseIndexButtonGroup>

    <!--  查询条件区域  -->
    <div id="search-cond-div" ref="search-cond-div" class="search-cond-class">
      <SearchCond ref="searchCond" v-model="searchCond"
                  @collapse-change="collapseChange" :setFlag="false"
                  :searchContent="searchContent"
      ></SearchCond>
    </div>
    <card ref="tableCard"
          :style="{position:allScreenFlag?'absolute':'',height:allScreenFlag?'100%':'',width:allScreenFlag?'calc(100% - 200px)':'',top:0,zIndex:888}">
      <div style="width: 100%;height: 100%;top: 0;">
        <!--批号调整Tbale-->
        <DkTable slot="left" :id="'table-'+$options.name" ref="table-select" :data="tableData"  :page-total="pageInfo.total"
                 :current-page="pageInfo.currentPage"multiple
                 :height="this.tableHeight * split - 35" primaryKey="userId" @pageChange="pageSizeChange"
                 :pageFlag="true"
                 @current-change="currentChangeEvent($event)">
          <DkTableColumn field="freezeNo" type="link" @on-link="handleLink(Object.assign($event,{button:'edit'}))"></DkTableColumn>
          <DkTableColumn field="AccountDate"></DkTableColumn>
          <DkTableColumn field="orgLevelName" width="300px" :title="$t('organizationLevel')"></DkTableColumn>
          <DkTableColumn field="调整人"></DkTableColumn>
          <DkTableColumn field="flgValid" type="switch" @on-switch-change="onSwitchChange"
                         :switch-disabled="false"></DkTableColumn>
          <DkTableColumn field="remarks" width="auto"></DkTableColumn>
        </DkTable>
      </div>
    </card>
    <card>
      <!-- 货物明细-->
      <div>
        <DkTable ref="standardGoodsFlag"
                 primaryKey="itemId"
                 :id="'table-'+$options.name"
                 name="table2" :data="goodsDetailData"
                 :height="this.tableHeight-340"
                 :select-flag="false"
                 :pageFlag="false"
                 :pageTotalFlag="false"
                 show-footer>
          <!-- 商品型号-->
          <DkTableColumn field="skuModel" width="150" :filter="false"></DkTableColumn>
          <!-- 商品名称-->
          <DkTableColumn field="skuName" width="150" :filter="false"></DkTableColumn>
          <!-- 唯一编码-->
          <DkTableColumn field="skuCode" width="200" :filter="false"></DkTableColumn>
          <!-- 品牌-->
          <DkTableColumn field="brandName" width="auto" :filter="false" :title="$t('skuBrand')"></DkTableColumn>
         <!-- 冻结数量-->
          <DkTableColumn field="entryGoingQuantity" :title="'冻结数量'" width="auto" min-width="110" :filter=false
                         :sum="true" :digits="0"></DkTableColumn>
          <!-- 仓库-->
          <DkTableColumn field="whName" width="auto" :filter="false"></DkTableColumn>
          <!--型号分类-->
          <DkTableColumn field="skuTypeName" width="auto" :filter="false"></DkTableColumn>
          <!--非标号-->
          <DkTableColumn field="nonStandardCode" width="auto" :filter="false"></DkTableColumn>
          <DkTableColumn field="remarks" min-width="200" width="auto" :filter=false></DkTableColumn>
        </DkTable>
      </div>
    </card>
  </div>
</template>

<script>
import {indexMixin} from "@/mixins";
export default {
  name: 'warehoues-change',
  mixins: [indexMixin],
  data() {
    let self = this
    return {
      tableData: [],
      goodsDetailData: [],
      searchContent:
        [
          {
            itemCode: '冻结单号',
          },
          {
            itemCode: '冻结人',
          },
          {
            itemCode: '账务日期',
            itemName: '账务日期',
            valueFormat: {
              code: '账务日期',
              default: [new Date().addMonths(-1).format('yyyy-MM-dd'), new Date().format('yyyy-MM-dd')]
            },
            valueKind: 'DATE_RANGE'
          },
          {
            itemCode: '查看冲正单据',
            itemName: '查看冲正单据',
            valueFormat: {code: 'showItem', default: false},
            valueKind: 'SWITCH'
          },
        ],
    }
  },
  methods: {
    /**
     * @desc   : 新建
     * @author : 宋扬
     * @date   : 2024/2/19 9:21
     */
    add() {
      this.$router.push('/inventoryManage/inventoryfreeze/add');
    },
  },
  created() {
    this.primaryKey = 'freezeId'  // 设置主键Id
    this.routeObjName = 'freeze'  // 设置路由名称
  }
}
</script>


