Blame view

HHECS.Web/src/views/basicData/container.vue 6.88 KB
1
<template>
王硕 authored
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
  <el-container style="padding: 20px">
    <el-aside>
      <el-card :style="{ height: asideHeight }">
        <el-form label-width="80px">
          <el-form-item label="容器编码">
            <el-input
              v-model="containerCode"
              placeholder="请输入容器编码"
            ></el-input>
          </el-form-item>
          <el-form-item label="库存状态">
            <el-select v-model="warehouseStatus" placeholder="请选择库存状态">
              <el-option label="全部" value="all"></el-option>
              <el-option label="在库" value="normal"></el-option>
              <el-option label="不在库" value="disabled"></el-option>
            </el-select>
          </el-form-item>
          <el-form-item label="打印状态">
            <el-select v-model="printStatus" placeholder="请选择打印状态">
              <el-option label="全部" value="all"></el-option>
              <el-option label="已打印" value="printed"></el-option>
              <el-option label="未打印" value="unprinted"></el-option>
            </el-select>
          </el-form-item>

          <el-form-item label="数量">
            <div style="display: flex; align-items: center; margin-left: -80px">
              <el-input-number
                v-model="stepNumber"
                :min="1"
                :max="1000"
                label="数量"
              ></el-input-number>
              <span style="flex: 1 1 20%; max-width: 20%">份</span>
              <el-button
                type="primary"
                size="small"
                @click="handlePrint"
                style="flex: 1 1 20%; max-width: 20%"
              >
                打印
              </el-button>
            </div>
          </el-form-item>
          <el-form-item>
            <el-row>
              <el-col :span="8">
                <el-button type="primary" size="small" @click="handleQuery"
                  >查询</el-button
                >
              </el-col>
              <el-col :span="8">
                <el-button type="success" size="small" @click="handleAdd"
                  >新增</el-button
                >
              </el-col>
            </el-row>
            <el-row style="margin-top: 5px">
              <el-col :span="8">
                <el-button type="warning" size="small" @click="handleEdit"
                  >编辑</el-button
                >
              </el-col>
              <el-col :span="8">
                <el-button type="danger" size="small" @click="handleDelete"
                  >删除</el-button
                >
              </el-col>
            </el-row>
            <el-row>
              <el-col :span="8" :offset="4">
                <el-button type="success" size="small" @click="handleQuery"
                  >导出</el-button
                >
              </el-col>
            </el-row>
          </el-form-item>
        </el-form>
      </el-card>
    </el-aside>
    <el-main>
      <el-card>
        <el-table
          :data="tableData"
          style="width: 100%"
          :height="TableHeight"
          border
          stripe
          @selection-change="handleSelectionChange"
        >
          <el-table-column type="selection" width="55"></el-table-column>
          <el-table-column prop="id" label="id"></el-table-column>
          <el-table-column
            prop="containerCode"
            label="容器编码"
          ></el-table-column>
          <el-table-column prop="status" label="状态"></el-table-column>
          <el-table-column prop="printCount" label="打印次数"></el-table-column>
          <el-table-column
            prop="containerType"
            label="容器类型"
          ></el-table-column>
          <el-table-column
            prop="warehouseCode"
            label="仓库编码"
          ></el-table-column>
        </el-table>
        <el-pagination
          style="margin-top: 15px"
          align="center"
          @size-change="handleSizeChange"
          @current-change="handleCurrentChange"
          :current-page="currentPage"
          :page-sizes="[10, 20, 50, 100]"
          :page-size="pageSize"
          layout="total, sizes, prev, pager, next, jumper"
          :total="this.tableData.length"
        />
      </el-card>
    </el-main>
  </el-container>
123
124
125
126
</template>

<script>
export default {
王硕 authored
127
  name: "container",
128
129
  data() {
    return {
王硕 authored
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
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
      containerCode: "",
      currentPage: 1,
      total: 0,
      pageSize: 10,
      selectedItems: [],

      printStatus: "all",
      warehouseStatus: "all",
      stepNumber: 1,
      tableData: [
        {
          id: 1,
          containerCode: "CT001",
          status: "正常",
          printCount: 3,
          containerType: "类型A",
          warehouseCode: "WH001",
          warehouseName: "主仓库",
          remark: "主要存储货物的仓库",
          created: "2023-01-01 10:00:00",
          createdBy: "admin",
          updated: "2023-01-02 14:30:00",
          updatedBy: "admin",
        },
        {
          id: 2,
          containerCode: "CT002",
          status: "异常",
          printCount: 1,
          containerType: "类型B",
          warehouseCode: "WH002",
          warehouseName: "分仓库",
          remark: "辅助存储货物的仓库",
          created: "2023-01-01 10:00:00",
          createdBy: "admin",
          updated: "2023-01-03 09:15:00",
          updatedBy: "admin",
        },
        {
          id: 3,
          containerCode: "CT003",
          status: "待处理",
          printCount: 0,
          containerType: "类型C",
          warehouseCode: "WH003",
          warehouseName: "临时仓库",
          remark: "临时存储货物的仓库",
          created: "2023-01-01 10:00:00",
          createdBy: "admin",
          updated: "2023-01-04 16:45:00",
          updatedBy: "admin",
        },
      ],
王硕 authored
183
    };
184
  },
王硕 authored
185
186
187
188
189
190
191
192
  computed: {
    TableHeight() {
      return `calc(100vh - 220px )`;
    },
    asideHeight() {
      return `calc(100vh - 150px)`;
    },
  },
193
  methods: {
王硕 authored
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
    handleSelectionChange(val) {
      this.selectedItems = val;
      // console.log("选中的行数据:", this.selectedItems);
    },
    handleSizeChange(val) {
      this.pageSize = val;
      this.currentPage = 1;
      this.handleQuery();
    },

    handleCurrentChange(val) {
      this.currentPage = val;
      this.handleQuery();
    },
    handleQuery() {
      // 查询逻辑
    },
    handleAdd() {
      // 新增逻辑
    },
    handleEdit() {
      // 编辑逻辑
    },
    handleDelete() {
      // 删除逻辑
    },
    // 新增打印方法
    handlePrint() {
      console.log(`打印 ${this.stepNumber} 份`);
      // 这里可以添加实际的打印逻辑
    },
王硕 authored
225
226
  },
};
227
228
229
</script>

<style scoped>
王硕 authored
230
231
232
233
234
235
236
237
238
239
240
.el-card__body,
.el-main {
  padding: 0 10px 0 10px;
}
::v-deep.el-table thead {
  color: #101010;
  font-weight: 600;
}
.el-form-item {
  margin-bottom: 18px;
}
241
/* 样式定义 */
王硕 authored
242
</style>