index.vue 2.93 KB
<template>
  <PageWrapper contentBackground>
    <div className="config-page">
      <Tabs
        v-model:selectedKey="currentKey"
        className="ml-2 mb-0"
        :style="{ marginLeft: '30px', marginRight: '5px' }"
      >
        <Tabs.TabPane key="1" tab="利润率配置" v-if="role !== ROLE.FINANCE">
          <TablePanel :searchInfo="{ relationCode: 'profitRate' }" :column="1" />
        </Tabs.TabPane>
        <Tabs.TabPane key="2" tab="包装费用配置" v-if="role !== ROLE.FINANCE">
          <TablePanel :searchInfo="{ relationCode: 'packetPrice' }" :column="2" />
        </Tabs.TabPane>
        <Tabs.TabPane key="3" tab="汇率配置" v-if="role !== ROLE.FINANCE">
          <TablePanel :searchInfo="{ settingCode: 'exchangeRate' }" :column="3"
        /></Tabs.TabPane>
        <Tabs.TabPane key="4" tab="邮件发送配置" v-if="role !== ROLE.FINANCE"
          ><EmailPanel
        /></Tabs.TabPane>
        <Tabs.TabPane key="5" tab="最后汇款日期">
          <TablePanel :searchInfo="{ relationCode: 'orderHodTime' }" :column="5" />
        </Tabs.TabPane>
        <Tabs.TabPane key="6" tab="提成成本配置">
          <TablePanel :searchInfo="{ relationCode: 'costSettingItem' }" :column="6" />
        </Tabs.TabPane>
        <Tabs.TabPane key="7" tab="销售额配置" v-if="role !== ROLE.FINANCE">
          <TablePanel :searchInfo="{ relationCode: 'salesAmount' }" :column="7" />
        </Tabs.TabPane>
        <Tabs.TabPane key="8" tab="生产科应付日期">
          <TablePanel :searchInfo="{ relationCode: 'produHodTime' }" :column="8" />
        </Tabs.TabPane>
        <Tabs.TabPane key="9" tab="生产科固定成本">
          <TablePanel :searchInfo="{ relationCode: 'ProduceSettingItem' }" :column="9" />
        </Tabs.TabPane>
      </Tabs>
    </div>
  </PageWrapper>
</template>

<script setup lang="ts">
  import { Tabs } from 'ant-design-vue';
  import { PageWrapper } from '/@/components/Page';
  import TablePanel from './TablePanel.vue';
  import { computed, onMounted, ref, watchEffect } from 'vue';
  import { useOrderStoreWithOut } from '/@/store/modules/order';
  import EmailPanel from './EmailPanel.vue';
  import ProductPanel from './ProductPanel.vue';
  import { ROLE } from '../order/type.d';
  import { useUserStoreWithOut } from '/@/store/modules/user';

  const currentKey = ref('1');
  const orderStore = useOrderStoreWithOut();
  const userStore = useUserStoreWithOut();
  const user = userStore.getUserInfo;
  const role = computed(() => {
    return user?.roleSmallVO?.code;
  });
  onMounted(async () => {
    if (role.value == ROLE.FINANCE) {
      currentKey.value = '5';
    }
    await orderStore.getDict();
  });
  // watchEffect(() => {
  //   if (role.value == ROLE.FINANCE) {
  //     currentKey.value = '5';
  //   }
  // });
</script>

<style>
  .config-page .ant-tabs-nav-operations ant-tabs-nav-operations-hidden {
    display: none;
  }

  .config-page .ant-tabs-nav {
    margin-bottom: 0;
  }
</style>