<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>
|