clll
2023-12-15 68e28b5e14ba2de103921aa1ab10f6df7b445ae9
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
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
<template>
  <el-container>
    <el-header class="m-header" style="height: auto">
      <el-row :gutter="10">
        <el-col :span="6">
          <el-date-picker
              v-model="datevalue"
              type="daterange"
              unlink-panels
              range-separator="到"
              start-placeholder="开始日期"
              end-placeholder="结束日期"
              :shortcuts="shortcuts"
              :size="size"
              format="YYYY/MM/DD"
              value-format="YYYY-MM-DD"
          />
 
 
 
        </el-col>
        <el-col :span="2">
          <el-button
              id="select"
              type="primary"
              :icon="Search"
              @click="autoAddRow">查询
          </el-button>
 
        </el-col>
 
      </el-row>
    </el-header>
    <el-main style="padding-top: 5px">
      <el-table :data="tableData" style="width: 100%" height="620" border show-summary sum-text=" "
                empty-text="暂无数据">
        <el-table-column fixed="left" prop="rIndex" label="" width="50" align="center"></el-table-column>
 
        <el-table-column fixed="left" label="操作" width="120">
          <template #default="scope">
            <el-button
                link
                type="primary"
                size="small"
                @click.prevent="deleteRow(scope.$index)"
            >
              删除
            </el-button>
            <el-button
                link
                type="primary"
                size="small"
                @click.prevent="deleteRow(scope.$index)"
            >
              标记
            </el-button>
          </template>
        </el-table-column>
 
 
        <el-table-column prop="name" label="库存组织" width="150"/>
        <el-table-column prop="wlNumber" label="物料编码" width="150"/>
        <el-table-column prop="state" label="物料名称" width="120"/>
        <el-table-column prop="city" label="产地" width="120"/>
        <el-table-column prop="kcNumber" label="库存编号" width="150"/>
        <el-table-column prop="width" sortable label="宽度" width="120"/>
        <el-table-column prop="height" sortable label="高度" width="120"/>
        <el-table-column prop="thick" sortable label="厚度" width="120"/>
        <el-table-column prop="zip" label="主单位" width="120"/>
        <el-table-column prop="number" label="安全库存" width="120"/>
        <el-table-column prop="number" sortable label="库存数" width="120"/>
        <el-table-column prop="number" label="可用库存" width="120" show-summary="ture"/>
        <el-table-column prop="number" label="未领数量" width="120"/>
        <el-table-column prop="zip" sortable label="总面积" width="120"/>
        <el-table-column prop="zip" label="单片面积" width="120"/>
        <el-table-column prop="date" label="生产日期" width="120"/>
        <el-table-column prop="date" label="保质期" width="120"/>
        <el-table-column prop="zip" label="库存编号" width="120"/>
        <el-table-column prop="zip" label="库区" width="120"/>
        <el-table-column prop="zip" label="库位" width="120"/>
        <el-table-column prop="zip" label="积压库存" width="120"/>
        <el-table-column prop="zip" label="备注" width="120"/>
 
 
      </el-table>
    </el-main>
  </el-container>
</template>
 
 
<script setup>
 
import {ref} from 'vue'
import dayjs from 'dayjs'
 
const now = new Date()
 
const tableData = ref([
 
])
 
const autoAddRow = () => {
  for (let i = 0; i < 10; i++) {
    const randomKCInt = Math.floor(Math.random() * 9999) + 10000;
    const randomInt = Math.floor(Math.random() * 999) + 1000;
    const randomZZInt = Math.floor(Math.random() * 99) + 100;
    const randomSumInt = Math.floor(Math.random() * 99) + 10;
    const kcThick = i % 3 === 0 ? 5 : i % 4 === 0 ? 6 : i % 5 === 0 ? 8 : 10;
    now.setDate(now.getDate() + 1)
    tableData.value.push({
      date: dayjs(now).format('YYYY-MM-DD'),
      name: '物料组织' + randomZZInt,
      state: '物料' + randomSumInt,
      city: '产地' + (randomSumInt * 6),
      address: 'No. 189, Grove St, Los Angeles',
      zip: 'CA 90036',
      number: 666 + 66 * i,
      width: '3660',
      height: '2440',
      rIndex: tableData.value.length + 1,
      wlNumber: 'NGWL1000' + randomInt,
      kcNumber: 'NGKC100' + randomKCInt,
      thick: kcThick
    })
  }
}
 
</script>
 
 
<style scoped>
.el-row {
  margin-bottom: 20px;
}
 
.el-row:last-child {
  margin-bottom: 0;
}
 
.el-col {
  border-radius: 4px;
}
 
.m-header {
  height: 32px;
}
 
#main {
  width: 100%;
  height: 100%;
}
 
#div-title {
  height: 5%;
  width: 100%;
  padding-left: 20px;
}
 
#main-body {
  width: 100%;
  height: 64%;
  margin-top: 1%;
}
</style>