Blame view

src/views/inventory/inventoryHeader/dialog/emptyContainerDialog.vue 7.34 KB
yuanshuhui authored
1
2
3
4
5
6
7
8
9
<template>
  <el-dialog
    title="空托盘选取"
    :visible.sync="visible"
    :showcontainer="showcontainer"
    width="800px"
    append-to-body
    @close="$emit('update:showcontainer', false)"
  >
yuanshuhui authored
10
11
12
13
14
15
16
    <el-form
      :model="queryParams"
      ref="queryForm"
      :inline="true"
      v-show="showSearch"
      label-width="68px"
    >
yuanshuhui authored
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
      <el-form-item label="容器编码" prop="containerCode">
        <el-input
          v-model="queryParams.containerCode"
          placeholder="请输入容器编码"
          clearable
          size="small"
          style="width: 240px"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="库位编码" prop="locationCode">
        <el-input
          v-model="queryParams.locationCode"
          placeholder="请输入库位编码"
          clearable
          size="small"
          style="width: 240px"
          @keyup.enter.native="handleQuery"
        />
yuanshuhui authored
36
      </el-form-item>
yuanshuhui authored
37
      <el-form-item>
yuanshuhui authored
38
39
40
41
42
43
44
45
46
47
        <el-button
          type="cyan"
          icon="el-icon-search"
          size="mini"
          @click="handleQuery"
          >搜索</el-button
        >
        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
          >重置</el-button
        >
yuanshuhui authored
48
49
50
51
      </el-form-item>
    </el-form>

    <el-row :gutter="10" class="mb8">
yuanshuhui authored
52
53
54
      <right-toolbar
        :showSearch.sync="showSearch"
        @queryTable="getList"
yuanshuhui authored
55
56
         :col-data="colData"
            @selectData="selectData"
yuanshuhui authored
57
      ></right-toolbar>
yuanshuhui authored
58
59
    </el-row>
yuanshuhui authored
60
    <el-table v-loading="loading" :data="containerList" ref="table">
yuanshuhui authored
61
62
63
64
65
      <el-table-column
        label="操作"
        align="center"
        class-name="small-padding fixed-width"
        width="120"
yuanshuhui authored
66
        v-if="colData[0].istrue"
yuanshuhui authored
67
      >
yuanshuhui authored
68
69
70
71
        <template slot-scope="scope">
          <el-button
            size="mini"
            type="text"
yuanshuhui authored
72
            icon="el-icon-edit-outline"
yuanshuhui authored
73
            @click="handleSelect(scope.row)"
yuanshuhui authored
74
75
            >选取</el-button
          >
yuanshuhui authored
76
77
        </template>
      </el-table-column>
yuanshuhui authored
78
      <el-table-column
yuanshuhui authored
79
80
81
82
83
84
85
        label="id"
        align="center"
        prop="id"
        width="55"
        v-if="colData[1].istrue"
      />
      <el-table-column
yuanshuhui authored
86
87
88
        label="库位编码"
        align="center"
        prop="code"
yuanshuhui authored
89
        v-if="colData[2].istrue"
yuanshuhui authored
90
91
92
93
94
      />
      <el-table-column
        label="容器编码"
        align="center"
        prop="containerCode"
yuanshuhui authored
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
        v-if="colData[3].istrue"
      />
      <el-table-column
        label="仓库编码"
        align="center"
        prop="warehouseCode"
        v-if="colData[4].istrue"
      />
      <el-table-column
        label="行"
        align="center"
        prop="iRow"
        width="55"
        v-if="colData[5].istrue"
      />
      <el-table-column
        label="列"
        align="center"
        prop="iColumn"
        width="55"
        v-if="colData[6].istrue"
      />
      <el-table-column
        label="层"
        align="center"
        prop="iLayer"
        width="55"
        v-if="colData[7].istrue"
      />
      <el-table-column
        label="格"
        align="center"
        prop="iGrid"
        width="55"
        v-if="colData[8].istrue"
yuanshuhui authored
130
131
132
133
134
135
      />
      <el-table-column
        label="库位类型"
        align="center"
        prop="locationType"
        width="80"
yuanshuhui authored
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
        v-if="colData[9].istrue"
      />
      <el-table-column
        label="库区"
        align="center"
        prop="zoneCode"
        width="60"
        v-if="colData[10].istrue"
      />
      <el-table-column
        label="状态"
        align="center"
        prop="status"
        width="60"
        v-if="colData[11].istrue"
      />
      <el-table-column
        label="上次盘点日期"
        align="center"
        prop="lastCycleCountDate"
        width="160"
        v-if="colData[12].istrue"
yuanshuhui authored
158
159
160
161
162
163
      />
      <el-table-column
        label="创建时间"
        align="center"
        prop="created"
        width="160"
yuanshuhui authored
164
        v-if="colData[13].istrue"
yuanshuhui authored
165
      >
yuanshuhui authored
166
167
168
169
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.created) }}</span>
        </template>
      </el-table-column>
yuanshuhui authored
170
171
172
173
174
      <el-table-column
        label="创建用户"
        align="center"
        prop="createdBy"
        :show-overflow-tooltip="true"
yuanshuhui authored
175
        v-if="colData[14].istrue"
yuanshuhui authored
176
177
178
179
180
181
      />
      <el-table-column
        label="更新时间"
        align="center"
        prop="lastUpdated"
        width="160"
yuanshuhui authored
182
        v-if="colData[15].istrue"
yuanshuhui authored
183
      >
yuanshuhui authored
184
185
186
187
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.lastUpdated) }}</span>
        </template>
      </el-table-column>
yuanshuhui authored
188
189
190
191
192
      <el-table-column
        label="更新用户"
        align="center"
        prop="lastUpdatedBy"
        :show-overflow-tooltip="true"
yuanshuhui authored
193
        v-if="colData[16].istrue"
yuanshuhui authored
194
      />
yuanshuhui authored
195
196
197
    </el-table>

    <pagination
yuanshuhui authored
198
      v-show="total > 0"
yuanshuhui authored
199
200
201
202
203
      :total="total"
      :page.sync="queryParams.pageNum"
      :limit.sync="queryParams.pageSize"
      @pagination="getList"
    />
yuanshuhui authored
204
  </el-dialog>
yuanshuhui authored
205
206
207
</template>

<script>
yuanshuhui authored
208
import { listEmptyContainer } from "@/api/inventory/inventoryHeader/header";
yuanshuhui authored
209
210
211
212
export default {
  props: {
    showcontainer: {
      type: Boolean,
yuanshuhui authored
213
214
      default: false,
    },
yuanshuhui authored
215
216
217
  },
  data() {
    return {
yuanshuhui authored
218
      visible: this.showcontainer,
yuanshuhui authored
219
      loading: true,
yuanshuhui authored
220
      showSearch: true,
yuanshuhui authored
221
      total: 0,
yuanshuhui authored
222
223
224
225
226
227
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        containerCode: undefined,
        locationCode: undefined,
      },
yuanshuhui authored
228
      containerList: [],
yuanshuhui authored
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
      // istrue属性存放列的状态
      colData: [
        { title: "操作", istrue: true, disabled: true },
        { title: "id", istrue: false },
        { title: "库位编码", istrue: true },
        { title: "容器编码", istrue: true },
        { title: "仓库编码", istrue: true },
        { title: "行", istrue: true },
        { title: "列", istrue: true },
        { title: "层", istrue: true },
        { title: "格", istrue: true },
        { title: "库位类型", istrue: true },
        { title: "库区", istrue: true },
        { title: "状态", istrue: true },
        { title: "上次盘点日期", istrue: false },
        { title: "创建时间", istrue: true },
        { title: "创建用户", istrue: true },
        { title: "更新时间", istrue: true },
        { title: "更新用户", istrue: true },
      ],
yuanshuhui authored
249
    };
yuanshuhui authored
250
251
252
  },
  watch: {
    showcontainer() {
yuanshuhui authored
253
254
      this.visible = this.showcontainer;
    },
yuanshuhui authored
255
256
257
258
  },
  created() {
    this.getList();
  },
yuanshuhui authored
259
260
261
262
263
  beforeUpdate() {
    this.$nextTick(() => {
      this.$refs["table"].doLayout();
    });
  },
yuanshuhui authored
264
265
  methods: {
    getList() {
yuanshuhui authored
266
267
268
269
270
271
      this.loading = true;
      listEmptyContainer(this.queryParams).then((response) => {
        this.containerList = response.rows;
        this.total = response.total;
        this.loading = false;
      });
yuanshuhui authored
272
    },
yuanshuhui authored
273
yuanshuhui authored
274
275
276
277
278
279
280
281
282
    handleQuery() {
      this.queryParams.pageNum = 1;
      this.getList();
    },
    resetQuery() {
      this.resetForm("queryForm");
      this.handleQuery();
    },
    handleSelect(row) {
yuanshuhui authored
283
284
285
      this.visible = false;
      this.$emit("passValue", row.code, row.containerCode);
    },
yuanshuhui authored
286
287
288
289
290
291
292
293
294
295
296
297
     /** 表格列显示隐藏切换操作 */
    selectData(val) {
      if (val) {
        this.colData.filter((i) => {
          if (val.indexOf(i.title) !== -1) {
            i.istrue = true;
          } else {
            i.istrue = false;
          }
        });
      }
    },
yuanshuhui authored
298
299
  },
};
yuanshuhui authored
300
301
</script>
yuanshuhui authored
302