schangxiang@126.com
2024-11-21 60735779c303c2dd10feea45d7fd761103b225e0
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
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
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
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
<template>
    <div class="wmsConfigKbcard-container">
        <el-card shadow="hover" :body-style="{ paddingBottom: '0' }">
            <el-form :model="queryParamsWmsConfigKbcard" ref="queryForm" labelWidth="90">
                <el-row>
                    <el-col :xs="24" :sm="12" :md="12" :lg="8" :xl="4" class="mb10">
                        <el-form-item label="关键字">
                            <el-input v-model="queryParamsWmsConfigKbcard.searchKey" clearable="" placeholder="看板卡号,物料编号,物料名称,客户编号,源库区编号,目标库区编号,目标库位编号" />
                        </el-form-item>
                    </el-col>
                    <el-col :xs="24" :sm="12" :md="12" :lg="8" :xl="4" class="mb10" v-if="showAdvanceQueryUIWmsConfigKbcard">
                        <el-form-item label="看板卡号">
                            <el-input v-model="queryParamsWmsConfigKbcard.kanBanCardNo" clearable="" placeholder="请输入看板卡号" />
                        </el-form-item>
                    </el-col>
                    <el-col :xs="24" :sm="12" :md="12" :lg="8" :xl="4" class="mb10" v-if="showAdvanceQueryUIWmsConfigKbcard">
                        <el-form-item label="物料编号">
                            <el-input v-model="queryParamsWmsConfigKbcard.materialCode" clearable="" placeholder="请输入物料编号" />
                        </el-form-item>
                    </el-col>
                    <el-col :xs="24" :sm="12" :md="12" :lg="8" :xl="4" class="mb10" v-if="showAdvanceQueryUIWmsConfigKbcard">
                        <el-form-item label="物料名称">
                            <el-input v-model="queryParamsWmsConfigKbcard.materialName" clearable="" placeholder="请输入物料名称" />
                        </el-form-item>
                    </el-col>
 
                    <el-col :xs="24" :sm="12" :md="12" :lg="8" :xl="4" class="mb10" v-if="showAdvanceQueryUIWmsConfigKbcard">
                        <el-form-item label="客户名称">
                            <el-select clearable="" v-model="queryParamsWmsConfigKbcard.supplierCode" placeholder="请选择客户名称">
                                <el-option v-for="(item, index) in arrSupper" :key="index" :value="item.custCode" :label="`${item.value}`"></el-option>
                            </el-select>
                        </el-form-item>
                    </el-col>
 
                    <el-col :xs="24" :sm="12" :md="12" :lg="8" :xl="4" class="mb10" v-if="showAdvanceQueryUIWmsConfigKbcard">
                        <el-form-item label="源库区">
              <el-select clearable="" v-model="queryParamsWmsConfigKbcard.sourceAreaCode" placeholder="请选择源库区">
                                <el-option v-for="(item, index) in arrW" :key="index" :value="item.areaCode" :label="`[${item.areaCode}]${item.areaName}`"></el-option>
                            </el-select>
                        </el-form-item>
                    </el-col>
 
                    <el-col :xs="24" :sm="12" :md="12" :lg="8" :xl="4" class="mb10" v-if="showAdvanceQueryUIWmsConfigKbcard">
                        <el-form-item label="目标库区">
              <el-select clearable="" v-model="queryParamsWmsConfigKbcard.toAreaCode" placeholder="请选择目标库区">
                                <el-option v-for="(item, index) in arrW" :key="index" :value="item.areaCode" :label="`[${item.areaCode}]${item.areaName}`"></el-option>
                            </el-select>
 
 
                        </el-form-item>
                    </el-col>
 
                    <el-col :xs="24" :sm="12" :md="12" :lg="8" :xl="4" class="mb10" v-if="showAdvanceQueryUIWmsConfigKbcard">
                        <el-form-item label="目标库位">
 
              <el-select
                                v-model="queryParamsWmsConfigKbcard.toPlaceCode"
                                filterable
                                remote
                                reserve-keyword
                                remote-show-suffix
                                :remote-method="remoteMethodPlace"
                                :loading="loading"
                                placeholder="请选择目标库位"
                                clearable
                                style="width: 100%"
                                @change="changeXmbhPlace(showAdvanceQueryUIWmsConfigKbcard.toPlaceCode)"
                                >
                                <el-option
                                    v-for="(item, index) in arrTdpPlace"
                                    :key="index"
                                    :value="item.placeCode"
                                    :label="`[${item.placeCode}]${item.placeName}`"
                                ></el-option>
                                </el-select>
 
                        </el-form-item>
                    </el-col>
 
                    <!-- <el-col :xs="24" :sm="12" :md="12" :lg="8" :xl="4" class="mb10" v-if="showAdvanceQueryUIWmsConfigKbcard">
            <el-form-item label="操作备注">
              <el-input v-model="queryParamsWmsConfigKbcard.actionRemark" clearable="" placeholder="请输入操作备注"/>              
            </el-form-item>
          </el-col> -->
                    <!-- <el-col :xs="24" :sm="12" :md="12" :lg="8" :xl="4" class="mb10" v-if="showAdvanceQueryUIWmsConfigKbcard">
            <el-form-item label="操作时间">
              <el-date-picker placeholder="请选择操作时间" value-format="YYYY/MM/DD" type="daterange" v-model="queryParamsWmsConfigKbcard.actionTimeRange" />              
            </el-form-item>
          </el-col> -->
                    <!-- <el-col :xs="24" :sm="12" :md="12" :lg="8" :xl="4" class="mb10" v-if="showAdvanceQueryUIWmsConfigKbcard">
            <el-form-item label="创建时间">
              <el-date-picker placeholder="请选择创建时间" value-format="YYYY/MM/DD  HH:mm:ss" type="datetimerange" :default-time="defaultTimeRange" v-model="queryParamsWmsConfigKbcard.createTimeRange" />              
            </el-form-item>
          </el-col> -->
                    <el-col :xs="24" :sm="12" :md="12" :lg="6" :xl="6" class="mb10">
                        <el-form-item>
                            <el-button-group style="display: flex; align-items: center">
                                <el-button type="primary" icon="ele-Search" @click="handleQueryWmsConfigKbcard" v-auth="'wmsConfigKbcard:page'" :disabled="disabled_btnWmsConfigKbcard"> 查询 </el-button>
                                <el-button icon="ele-Refresh" @click="resetWmsConfigKbcard"> 重置 </el-button>
                                <el-button icon="ele-ZoomIn" @click="changeAdvanceQueryUIWmsConfigKbcard" v-if="!showAdvanceQueryUIWmsConfigKbcard" style="margin-left: 5px"> 高级查询 </el-button>
                                <el-button icon="ele-ZoomOut" @click="changeAdvanceQueryUIWmsConfigKbcard" v-if="showAdvanceQueryUIWmsConfigKbcard" style="margin-left: 5px"> 隐藏 </el-button>
                                <el-button type="primary" style="margin-left: 5px" icon="ele-Plus" @click="openAddWmsConfigKbcard" v-auth="'wmsConfigKbcard:add'"> 新增 </el-button>
                                <el-button type="primary" style="margin-left: 5px" icon="ele-Download" @click="handleExportExcelWmsConfigKbcard" v-auth="'wmsConfigKbcard:exportExcel'"> 导出 </el-button>
                            </el-button-group>
                        </el-form-item>
                    </el-col>
                </el-row>
            </el-form>
        </el-card>
        <el-card class="full-table" shadow="hover" style="margin-top: 5px">
            <el-table
                ref="tableRefWmsConfigKbcard"
                :data="tableDataWmsConfigKbcard"
                style="width: 100%"
                v-loading="loadingWmsConfigKbcard"
                tooltip-effect="light"
                row-key="id"
                @sort-change="sortChangeWmsConfigKbcard"
                border=""
            >
                <el-table-column type="index" fixed="left" label="序号" width="55" align="center" />
                <el-table-column prop="kanBanCardNo" fixed="left" label="看板卡号" width="120" show-overflow-tooltip="" />
                <el-table-column prop="materialCode" label="物料编号" width="120" show-overflow-tooltip="" />
                <el-table-column prop="materialName" label="物料名称" width="120" show-overflow-tooltip="" />
                <el-table-column prop="quantity" label="数量" width="120" show-overflow-tooltip="" />
                <el-table-column prop="supplierCode" label="客户编号" width="120" show-overflow-tooltip="" />
                <el-table-column prop="supplierName" label="客户名称" width="120" show-overflow-tooltip="" />
                <el-table-column prop="sourceAreaCode" label="源库区编号" width="120" show-overflow-tooltip="" />
                <el-table-column prop="sourceAreaName" label="源库区名称" width="120" show-overflow-tooltip="" />
                <el-table-column prop="toAreaCode" label="目标库区编号" width="120" show-overflow-tooltip="" />
                <el-table-column prop="toAreaName" label="目标库区名称" width="120" show-overflow-tooltip="" />
                <el-table-column prop="toPlaceCode" label="目标库位编号" width="120" show-overflow-tooltip="" />
                <el-table-column prop="toPlaceName" label="目标库位名称" width="120" show-overflow-tooltip="" />
                <!-- <el-table-column prop="actionRemark" label="操作备注" width="120" show-overflow-tooltip="" /> -->
                <el-table-column prop="createUserName" label="创建人" width="120" show-overflow-tooltip="" />
                <el-table-column prop="createTime" label="创建时间" width="130" :formatter="formatDate_T_Time" show-overflow-tooltip="" />
                <el-table-column prop="updateUserName" label="修改人" width="120" show-overflow-tooltip="" />
                <el-table-column prop="updateTime" label="修改时间" width="170" :formatter="formatDate_T_Time" show-overflow-tooltip="" />
                <el-table-column label="操作" width="240" align="center" fixed="right" show-overflow-tooltip="">
                    <template #default="scope">
                        <el-button icon="ele-Edit" size="small" text="" type="primary" @click="openEditWmsConfigKbcard(scope.row)" v-auth="'wmsConfigKbcard:update'"> 编辑 </el-button>
                        <el-button icon="ele-Delete" size="small" text="" type="primary" @click="delWmsConfigKbcard(scope.row)" v-auth="'wmsConfigKbcard:delete'"> 删除 </el-button>
                        <el-button icon="ele-Printer" size="small" text="" type="primary" @click="openPrintWmsStockQuan(scope.row)"> 打印 </el-button>
                    </template>
                </el-table-column>
            </el-table>
            <el-pagination
                v-model:currentPage="tableParamsWmsConfigKbcard.page"
                v-model:page-size="tableParamsWmsConfigKbcard.pageSize"
                :total="tableParamsWmsConfigKbcard.total"
                :page-sizes="[10, 20, 50, 100, 200, 500]"
                small=""
                background=""
                @size-change="handleSizeChangeWmsConfigKbcard"
                @current-change="handleCurrentChangeWmsConfigKbcard"
                layout="total, sizes, prev, pager, next, jumper"
            />
            <printDialogWmsConfigKbcard ref="printDialogRefWmsConfigKbcard" :title="printWmsConfigKbcardTitle" @reloadTable="handleQueryWmsConfigKbcard" />
            <editDialogWmsConfigKbcard ref="editDialogRefWmsConfigKbcard" :title="editWmsConfigKbcardTitle" @reloadTable="handleQueryWmsConfigKbcard" />
        </el-card>
    </div>
</template>
 
<script lang="ts" setup="" name="wmsConfigKbcard">
import { ref, onMounted } from 'vue';
import { ElMessageBox, ElMessage } from 'element-plus';
import { auth } from '/@/utils/authFunction';
import { getDictDataItem as di, getDictDataList as dl } from '/@/utils/dict-utils';
import { formatDate, formatDate_T_Date, formatDate_T_Time, defaultTimeRange } from '/@/utils/formatTime';
import { exportPageExcel } from '/@/utils/exportPageExcel'; //引入导出方法
 
import printDialogWmsConfigKbcard from '/@/views/system/print/component/hiprint/preview.vue';
import editDialogWmsConfigKbcard from '/@/views/main/WmsSystemConfig/wmsConfigKbcard/component/editDialog.vue';
import { pageWmsConfigKbcard, deleteWmsConfigKbcard, importExcelWmsConfigKbcard, downloadExcelTemplateWmsConfigKbcard, getPlaceByAreaCode } from '/@/api/main/WmsSystemConfig/wmsConfigKbcard';
import { addWmsRecordSncodePrint } from '/@/api/main/PrintCenter/wmsRecordSncodePrint';
import { handleSlectDataSupplier, handleSlectDataWmsArea } from '/@/utils/selectData';
import { pageWmsPlace } from '/@/api/main/WmsBase/wmsPlace';
 
/***************************************************[看板卡配置操作]开始***************************************************/
const showAdvanceQueryUIWmsConfigKbcard = ref(false);
const tableRefWmsConfigKbcard = ref(null);
const printDialogRefWmsConfigKbcard = ref();
const editDialogRefWmsConfigKbcard = ref();
const loadingWmsConfigKbcard = ref(false);
const disabled_btnWmsConfigKbcard = ref(false);
const tableDataWmsConfigKbcard = ref<any>([]);
const queryParamsWmsConfigKbcard = ref<any>({});
const tableParamsWmsConfigKbcard = ref({
    page: 1,
    pageSize: 10,
    total: 0,
});
 
const printWmsConfigKbcardTitle = ref('');
const editWmsConfigKbcardTitle = ref('');
 
// 改变高级查询的控件显示状态
const changeAdvanceQueryUIWmsConfigKbcard = () => {
    showAdvanceQueryUIWmsConfigKbcard.value = !showAdvanceQueryUIWmsConfigKbcard.value;
};
 
// 查询看板卡配置
const handleQueryWmsConfigKbcard = async () => {
    loadingWmsConfigKbcard.value = true;
    disabled_btnWmsConfigKbcard.value = true;
    var res = await pageWmsConfigKbcard(Object.assign(queryParamsWmsConfigKbcard.value, tableParamsWmsConfigKbcard.value));
    if (res.data.type == 'success') {
        tableDataWmsConfigKbcard.value = res.data.result?.items ?? [];
        tableParamsWmsConfigKbcard.value.total = res.data.result?.total;
    }
    loadingWmsConfigKbcard.value = false;
    disabled_btnWmsConfigKbcard.value = false;
};
 
// 重置看板卡配置查询
const resetWmsConfigKbcard = async () => {
    queryParamsWmsConfigKbcard.value = {};
};
 
// 看板卡配置列排序
const sortChangeWmsConfigKbcard = async (column: any) => {
    queryParamsWmsConfigKbcard.value.field = column.prop;
    queryParamsWmsConfigKbcard.value.order = column.order;
    await handleQueryWmsConfigKbcard();
};
 
// 打开新增看板卡配置页面
const openAddWmsConfigKbcard = () => {
    editWmsConfigKbcardTitle.value = '添加看板卡配置';
    editDialogRefWmsConfigKbcard.value.openDialog(1, {});
};
 
// 打开打印看板卡配置页面
const openPrintWmsConfigKbcard = async (row: any) => {
    printWmsConfigKbcardTitle.value = '打印看板卡配置';
};
 
// 打开编辑看板卡配置页面
const openEditWmsConfigKbcard = (row: any) => {
    editWmsConfigKbcardTitle.value = '编辑看板卡配置';
    editDialogRefWmsConfigKbcard.value.openDialog(2, row);
};
 
// 删除看板卡配置
const delWmsConfigKbcard = (row: any) => {
    ElMessageBox.confirm(`确定要删除吗?`, '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning',
    })
        .then(async () => {
            loadingWmsConfigKbcard.value = true;
            var ret = await deleteWmsConfigKbcard(row);
            if (ret.data.type == 'success') {
                ElMessage.success('删除成功');
            }
            loadingWmsConfigKbcard.value = false;
            handleQueryWmsConfigKbcard();
        })
        .catch(() => {});
};
 
// 改变看板卡配置页面容量
const handleSizeChangeWmsConfigKbcard = (val: number) => {
    tableParamsWmsConfigKbcard.value.pageSize = val;
    handleQueryWmsConfigKbcard();
};
 
// 改变看板卡配置页码序号
const handleCurrentChangeWmsConfigKbcard = (val: number) => {
    tableParamsWmsConfigKbcard.value.page = val;
    handleQueryWmsConfigKbcard();
};
 
// 打开打印实时库存页面
const openPrintWmsStockQuan = async (row: any) => {
    ElMessageBox.confirm('是否确认打印?', '提示', {
        confirmButtonText: '确认',
        cancelButtonText: '取消',
        type: 'warning',
    })
        .then(async () => {
            row.PrintType = 2; // 看板卡
            row.PrintSource = 6; //看板卡打印
            var res = await addWmsRecordSncodePrint([row]);
            if (res.data && res.data.code == 200) {
                ElMessage.success('添加成功');
            }
        })
        .catch(() => {
            ElMessage.info('已取消删除');
        });
};
 
/***************************************************[看板卡配置操作]结束***************************************************/
/***************************************************[看板卡配置导出]开始***************************************************/
//定义当前页面的方法组
const functionMapWmsConfigKbcard = {
    formatDate_T_Date,
    formatDate_T_Time,
};
//点击导出按钮
const handleExportExcelWmsConfigKbcard = async (formData: Blob) => {
    loadingWmsConfigKbcard.value = true;
    disabled_btnWmsConfigKbcard.value = true;
    var new_tableParamsWmsConfigKbcard = JSON.parse(JSON.stringify(tableParamsWmsConfigKbcard.value));
    new_tableParamsWmsConfigKbcard.page = 1;
    new_tableParamsWmsConfigKbcard.pageSize = 100000;
    var res = await pageWmsConfigKbcard(Object.assign(queryParamsWmsConfigKbcard.value, new_tableParamsWmsConfigKbcard));
    if (res.data.type == 'success') {
        exportExcelWmsConfigKbcard(res.data.result?.items ?? []);
    }
    loadingWmsConfigKbcard.value = false;
    disabled_btnWmsConfigKbcard.value = false;
};
//导出
const exportExcelWmsConfigKbcard = async (exportDataList: Array) => {
    exportPageExcel(exportDataList, tableRefWmsConfigKbcard, '看板卡配置', functionMapWmsConfigKbcard);
};
/***************************************************[看板卡配置导出]结束***************************************************/
 
const arrW: any = ref([]); //库区下拉读取接口
const arrSupper: any = ref([]); //客户下拉读取接口
const arrPlace: any = ref([]); //下拉读取接口
// 看板卡配置页面加载时
onMounted(async () => {
    arrW.value = await handleSlectDataWmsArea(); //下拉读取接口
    arrSupper.value = await handleSlectDataSupplier({
        custType: '货主',
    }); //下拉读取接口
 
 
  
});
 
 
//-----------------远程搜索 库位编号----------------
const arrTdpPlace = ref<any[]>([]);
const queryParamsWPlace = ref<any>({});
const tableParamsWPlace = ref({
    page: 1,
    pageSize: 200,
    total: 0,
    PlaceCode: '',
});
const loading = ref(false);
const handleQueryTdpPlace = async () => {
    var res = await pageWmsPlace(Object.assign(queryParamsWPlace.value, tableParamsWPlace.value));
    arrTdpPlace.value =res.data.result?.items ?? [];
};
const changeXmbhPlace = async (query?: any) => {
        loading.value = true;
        var res = await pageWmsPlace({
            page: 1,
            pageSize: 200,
            PlaceCode: query,
        });
        loading.value = false;
        arrTdpPlace.value = res.data.result?.items ?? [];
};
// 远程搜索  输入关键字以从远程服务器中查找数据。
const remoteMethodPlace = async (query: string) => {
        loading.value = true;
        var res = await pageWmsPlace({
            page: 1,
            pageSize: 200,
            PlaceCode: query,
        });
        loading.value = false;
        arrTdpPlace.value = res.data.result?.items ?? [];
};
//-----------------远程搜索----------------
 
 
 
handleQueryWmsConfigKbcard();
</script>
<style scoped>
:deep(.el-input),
:deep(.el-select),
:deep(.el-input-number) {
    width: 100%;
}
</style>