dcc
2024-06-13 3616db170333df7d668c97323344335b52c4153c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
<template>
  <!-- 新股库存 -->
  <div class="newSharesInventory">
    <sharesHeader
      :value1="headerList.availableLimit"
      :value2="headerList.inventoryGainsLosses"
      :value3="headerList.marketValue"
    />
    <div class="newSharesInventory-table newShares-table">
      <el-table :data="tableData" style="width: 100%">
        <template #empty>
          <table-empty />
        </template>
        <el-table-column :label="t(`message.user.mingchengdaima10`)">
          <template #default="scope">
            <p>{{ scope.row.symbolName }}</p>
            <p class="draw-title-color">{{ scope.row.symbolCode }}</p>
          </template>
        </el-table-column>
        <el-table-column :label="t(`message.user.jiageshengqingliang`)">
          <template #default="scope">
            <p>{{ scope.row.subPrice }}</p>
            <p>{{ scope.row.subNumber }}</p>
          </template>
        </el-table-column>
        <el-table-column :label="t(`message.user.zhongqianrenjiaoer`)">
          <template #default="scope">
            <p>{{ scope.row.winningNumber }}</p>
            <p>{{ scope.row.requiredNumber }}</p>
          </template>
        </el-table-column>
        <el-table-column :label="t(`message.user.zhuangtai10`)">
          <template #default="scope">
            <p :class="scope.row.status === 2 ? 'isRed' : ''">
              {{ t(`message.user.${getStatus(scope.row.status)}`) }}
            </p>
          </template>
        </el-table-column>
      </el-table>
    </div>
    <pagination
      :total="total"
      v-model:page="pagination.current"
      v-model:limit="pagination.size"
      @pagination="getList"
    />
  </div>
</template>
 
<script setup>
import sharesHeader from "./components/sharesHeader.vue";
import Pagination from "@/components/Pagination/index.vue";
import Axios from "@/api/newShares";
import { useI18n } from "vue-i18n";
import tableEmpty from "./components/tableEmpty.vue";
 
const { t } = useI18n();
const headerList = ref({});
 
onMounted(() => {
  getDataList();
 
  Axios.getNewSharesHeaderMessage({ type: 2 }).then((res) => {
    if (res.code === 0) {
      headerList.value = res.data;
    }
  });
});
 
const tableData = ref([]);
const total = ref(0);
const pagination = ref({
  current: 1,
  size: 10,
});
const getDataList = () => {
  Axios.getNewSharesOrderList({ type: 2, ...pagination.value }).then((res) => {
    if (res.code === 0) {
      tableData.value = res.data;
      total.value = res.total;
    }
  });
};
 
// 状态
const getStatus = computed(() => {
  return function (value) {
    let result = "";
    switch (value) {
      case 1:
        result = "shengouzhong";
        break;
      case 2:
        result = "yizhongqian";
        break;
      case 3:
        result = "weizhongqian";
        break;
      default:
        break;
    }
    return result;
  };
});
 
const getList = (val) => {
  getDataList();
};
</script>
 
<style lang="scss" scoped>
@import "../../assets/css/newShares/table.scss";
.newSharesInventory {
  :deep(.newSharesInventory-table) {
    min-height: 500px;
    .el-table__cell {
      border: 0;
    }
  }
}
.isRed {
  color: #f33368;
}
</style>