Browse Source

2025-12-08

增加"标签变动记录"功能(WMS - 仓库报表管理 - 标签变动记录)
     1、明细表展示所有数据(默认是今天的)
     2、其他页签根据document_type区分
master
fengyuan_yang 1 month ago
parent
commit
7cbf5e202f
  1. 25
      src/api/warehouse/labelTransactionLog.js
  2. 305
      src/views/modules/warehouse/labelTransactionLog.vue

25
src/api/warehouse/labelTransactionLog.js

@ -0,0 +1,25 @@
import http from '@/utils/httpRequest'
/**
* 查询标签变动记录列表
*/
export function labelTransactionLogList(data) {
return http({
url: http.adornUrl('/warehouse/labelTransactionLog/list'),
method: 'post',
data: http.adornData(data)
})
}
/**
* 导出标签变动记录
*/
export function labelTransactionLogExport(data) {
return http({
url: http.adornUrl('/warehouse/labelTransactionLog/export'),
method: 'post',
data: http.adornData(data),
responseType: 'blob'
})
}

305
src/views/modules/warehouse/labelTransactionLog.vue

@ -0,0 +1,305 @@
<template>
<div class="mod-config">
<!-- 条件查询 -->
<el-form :inline="true" label-position="top" :model="searchData" @keyup.enter.native="getDataList">
<el-form-item label="BU">
<el-select v-model="searchData.buNo" placeholder="请选择" clearable style="width: 120px">
<el-option
v-for="i in userBuList"
:key="i.buNo"
:label="i.buDesc"
:value="i.buNo">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="变动类型">
<el-select v-model="searchData.documentType" placeholder="请选择" clearable style="width: 120px">
<el-option
v-for="item in documentTypeList"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="标签条码">
<el-input v-model="searchData.rollNo" clearable placeholder="请输入" style="width: 150px"></el-input>
</el-form-item>
<el-form-item label="物料编码">
<el-input v-model="searchData.partNo" clearable placeholder="请输入" style="width: 150px"></el-input>
</el-form-item>
<el-form-item label="规格型号">
<el-input v-model="searchData.partSpec" clearable placeholder="请输入" style="width: 150px"></el-input>
</el-form-item>
<el-form-item label="变动日期">
<el-date-picker
v-model="searchData.transactionDateRange"
type="daterange"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
value-format="yyyy-MM-dd"
style="width: 240px">
</el-date-picker>
</el-form-item>
<el-form-item label=" ">
<el-button type="primary" @click="getDataList()">查询</el-button>
<el-button type="primary" @click="resetSearch()">重置</el-button>
<el-button type="primary" @click="exportData()">导出</el-button>
</el-form-item>
</el-form>
<!-- 页签列表 -->
<el-tabs v-model="activeTab" @tab-click="handleTabClick">
<el-tab-pane label="变动明细" name="all"></el-tab-pane>
<el-tab-pane label="采购入库" name="采购入库"></el-tab-pane>
<el-tab-pane label="采购退货" name="采购退货"></el-tab-pane>
<el-tab-pane label="生产领料" name="生产领料"></el-tab-pane>
<el-tab-pane label="生产退仓" name="生产退仓"></el-tab-pane>
<el-tab-pane label="生产入库" name="生产入库"></el-tab-pane>
<el-tab-pane label="销售发货" name="销售发货"></el-tab-pane>
<el-tab-pane label="销售退货" name="销售退货"></el-tab-pane>
<el-tab-pane label="其他入库" name="其他入库"></el-tab-pane>
<el-tab-pane label="其他出库" name="其他出库"></el-tab-pane>
<el-tab-pane label="移库调拨" name="移库调拨"></el-tab-pane>
</el-tabs>
<!-- 展示列表 -->
<el-table
:height="height"
:data="dataList"
border
v-loading="dataListLoading"
style="width: 100%;">
<el-table-column prop="buNo" label="BU" header-align="center" align="center" width="80"></el-table-column>
<el-table-column prop="transactionId" label="变动单号" header-align="center" align="left" min-width="150" show-overflow-tooltip></el-table-column>
<el-table-column prop="documentType" label="变动类型" header-align="center" align="center" width="100"></el-table-column>
<el-table-column prop="documentNo" label="通知单号" header-align="center" align="left" min-width="150" show-overflow-tooltip></el-table-column>
<el-table-column prop="orderNo" label="关联单号" header-align="center" align="left" min-width="150" show-overflow-tooltip></el-table-column>
<el-table-column prop="orderLineNo" label="关联单行号" header-align="center" align="center" width="100"></el-table-column>
<el-table-column prop="rollNo" label="标签条码" header-align="center" align="left" min-width="180" show-overflow-tooltip></el-table-column>
<el-table-column prop="rollQty" label="变动数量" header-align="center" align="right" width="100"></el-table-column>
<el-table-column prop="partNo" label="物料编码" header-align="center" align="left" min-width="150" show-overflow-tooltip></el-table-column>
<el-table-column prop="warehouseId" label="仓库编码" header-align="center" align="center" width="100"></el-table-column>
<el-table-column prop="warehouseName" label="仓库名称" header-align="center" align="left" min-width="120" show-overflow-tooltip></el-table-column>
<el-table-column prop="locationId" label="库位编码" header-align="center" align="center" width="100"></el-table-column>
<el-table-column prop="locationName" label="库位名称" header-align="center" align="left" min-width="120" show-overflow-tooltip></el-table-column>
<el-table-column prop="syncedFlag" label="传输状态" header-align="center" align="center" width="90">
<template slot-scope="scope">
<el-tag :type="scope.row.syncedFlag === '已传输' ? 'success' : 'warning'" size="small">
{{ scope.row.syncedFlag }}
</el-tag>
</template>
</el-table-column>
<el-table-column prop="syncedTime" label="传输时间" header-align="center" align="center" width="160"></el-table-column>
<el-table-column prop="syncedErrorMsg" label="传输消息" header-align="center" align="left" min-width="150" show-overflow-tooltip></el-table-column>
<el-table-column v-if="showBomItemNo" prop="bomItemNo" label="Bom行号" header-align="center" align="center" width="100"></el-table-column>
<el-table-column prop="transactionBy" label="操作员" header-align="center" align="center" width="100"></el-table-column>
<el-table-column prop="transactionDate" label="变动日期" header-align="center" align="center" width="160"></el-table-column>
</el-table>
<!-- 分页 -->
<el-pagination
style="margin-top: 10px"
@size-change="sizeChangeHandle"
@current-change="currentChangeHandle"
:current-page="pageIndex"
:page-sizes="[20, 50, 100, 200, 500]"
:page-size="pageSize"
:total="totalPage"
layout="total, sizes, prev, pager, next, jumper">
</el-pagination>
</div>
</template>
<script>
import { labelTransactionLogList } from '@/api/warehouse/labelTransactionLog.js'
export default {
data() {
return {
height: window.innerHeight - 280,
searchData: {
buNo: '',
documentType: '',
rollNo: '',
partNo: '',
partSpec: '',
transactionDateRange: []
},
// ""
documentTypeList: [
{ label: '采购入库', value: '采购入库' },
{ label: '采购退货', value: '采购退货' },
{ label: '生产领料', value: '生产领料' },
{ label: '生产退仓', value: '生产退仓' },
{ label: '生产入库', value: '生产入库' },
{ label: '销售发货', value: '销售发货' },
{ label: '销售退货', value: '销售退货' },
{ label: '其他入库', value: '其他入库' },
{ label: '其他出库', value: '其他出库' },
{ label: '移库调拨', value: '移库调拨' }
],
activeTab: 'all',
dataList: [],
dataListLoading: false,
pageIndex: 1,
pageSize: 20,
totalPage: 0,
userBuList: []
}
},
computed: {
// 退Bom
showBomItemNo() {
return this.activeTab === '生产领料' || this.activeTab === '生产退仓'
}
},
mounted() {
this.initBuList()
this.initDefaultDate()
this.getDataList()
window.addEventListener('resize', this.handleResize)
},
beforeDestroy() {
window.removeEventListener('resize', this.handleResize)
},
methods: {
handleResize() {
this.height = window.innerHeight - 280
},
// BU
initBuList() {
this.userBuList = this.$store.state.common.userBuList || []
if (this.userBuList.length > 0) {
this.searchData.buNo = this.userBuList[0].buNo
}
},
//
initDefaultDate() {
const today = this.formatDate(new Date())
this.searchData.transactionDateRange = [today, today]
},
//
formatDate(date) {
const year = date.getFullYear()
const month = String(date.getMonth() + 1).padStart(2, '0')
const day = String(date.getDate()).padStart(2, '0')
return `${year}-${month}-${day}`
},
//
handleTabClick(tab) {
this.pageIndex = 1
this.getDataList()
},
//
getDataList() {
this.dataListLoading = true
const params = {
buNo: this.searchData.buNo,
documentType: this.activeTab === 'all' ? this.searchData.documentType : this.activeTab,
rollNo: this.searchData.rollNo,
partNo: this.searchData.partNo,
partSpec: this.searchData.partSpec,
startDate: this.searchData.transactionDateRange && this.searchData.transactionDateRange[0] ? this.searchData.transactionDateRange[0] : '',
endDate: this.searchData.transactionDateRange && this.searchData.transactionDateRange[1] ? this.searchData.transactionDateRange[1] : '',
page: this.pageIndex,
limit: this.pageSize
}
labelTransactionLogList(params).then(({ data }) => {
this.dataListLoading = false
if (data && data.code === 0) {
this.dataList = data.page.list || []
this.totalPage = data.page.totalCount || 0
} else {
this.dataList = []
this.totalPage = 0
this.$message.error(data.msg || '查询失败')
}
}).catch(() => {
this.dataListLoading = false
this.dataList = []
this.totalPage = 0
})
},
//
resetSearch() {
this.searchData = {
buNo: this.userBuList.length > 0 ? this.userBuList[0].buNo : '',
documentType: '',
rollNo: '',
partNo: '',
partSpec: '',
transactionDateRange: []
}
this.initDefaultDate()
this.activeTab = 'all'
this.pageIndex = 1
this.getDataList()
},
//
exportData() {
this.$message.info('导出功能开发中...')
},
//
sizeChangeHandle(val) {
this.pageSize = val
this.pageIndex = 1
this.getDataList()
},
//
currentChangeHandle(val) {
this.pageIndex = val
this.getDataList()
}
}
}
</script>
<style scoped>
.mod-config {
padding: 10px;
}
/deep/ .el-tabs__header {
margin-bottom: 10px;
}
/deep/ .el-tabs__nav-wrap::after {
height: 1px;
}
/deep/ .el-tabs__item {
padding: 0 15px;
height: 36px;
line-height: 36px;
}
/deep/ .el-tabs__item.is-active {
color: #17B3A3;
}
/deep/ .el-tabs__active-bar {
background-color: #17B3A3;
}
/deep/ .el-form-item {
margin-bottom: 10px;
}
/deep/ .el-form-item__label {
padding-bottom: 0;
line-height: 28px;
}
</style>
Loading…
Cancel
Save