修改盘点正常的列表
This commit is contained in:
@@ -17,7 +17,14 @@ export function getScan(query) {
|
|||||||
params: query
|
params: query
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
// 统计
|
||||||
|
export function getTotalStatistics(data) {
|
||||||
|
return request({
|
||||||
|
url: '/MatchScan/statistics',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
// 开始匹配
|
// 开始匹配
|
||||||
export function getMatch(data) {
|
export function getMatch(data) {
|
||||||
return request({
|
return request({
|
||||||
@@ -44,6 +51,15 @@ export function getScanResult(query) {
|
|||||||
params: query
|
params: query
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
// 获取盘点结果 - 最新再用
|
||||||
|
export function inventoryList(data) {
|
||||||
|
return request({
|
||||||
|
url: '/MatchScan/inventoryList',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// 获取图表
|
// 获取图表
|
||||||
export function getChart(data) {
|
export function getChart(data) {
|
||||||
|
|||||||
@@ -69,14 +69,47 @@
|
|||||||
<el-text v-show="status == 1">当前为未扫描到,但数据库里有的数据</el-text>
|
<el-text v-show="status == 1">当前为未扫描到,但数据库里有的数据</el-text>
|
||||||
<el-text v-show="status == 2">当前为已扫描到,但数据库里没有的数据</el-text>
|
<el-text v-show="status == 2">当前为已扫描到,但数据库里没有的数据</el-text>
|
||||||
</div>
|
</div>
|
||||||
<el-table :data="matchData" border empty-text="暂无数据" v-if="status == 0 || status == 1">
|
<el-table :data="matchData" border empty-text="暂无数据" show-overflow-tooltip show-summary
|
||||||
<el-table-column prop="rkPcode" label="存放位置" />
|
:summary-method="getSummaries" v-if="status == 0 || status == 1">
|
||||||
<el-table-column prop="realQty" label="数量" />
|
<el-table-column label="序号" align="center" type="index" width="70" />
|
||||||
<el-table-column prop="count" label="操作" class-name="small-padding fixed-width">
|
<el-table-column label="单据号" align="center" prop="billNo" width="180" />
|
||||||
|
<el-table-column label="库存类型" align="center" prop="operationTypeName" width="150" />
|
||||||
|
<el-table-column label="订单编号" align="center" prop="sapNo" width="150" />
|
||||||
|
<el-table-column label="项目号" align="center" prop="xmNo" width="150" />
|
||||||
|
<el-table-column label="项目描述" align="center" prop="xmMs" width="150" />
|
||||||
|
<el-table-column label="物料号" align="center" prop="wlNo" width="100" />
|
||||||
|
<el-table-column label="物料描述" align="center" prop="wlMs" width="150" />
|
||||||
|
<el-table-column label="供应商名称" align="center" prop="gysMc" width="150" />
|
||||||
|
<el-table-column label="合同单价" align="center" prop="htDj" />
|
||||||
|
<el-table-column label="总计" align="center" prop="totalAmount" />
|
||||||
|
<el-table-column label="单位" align="center" prop="dw" />
|
||||||
|
<el-table-column label="实际入库数量" align="center" prop="realQty" width="120" />
|
||||||
|
<el-table-column label="库位码" align="center" prop="pcode" width="120" />
|
||||||
|
<el-table-column label="托盘码" align="center" prop="trayCode" />
|
||||||
|
<el-table-column label="身份码" align="center" prop="entityId" width="150" />
|
||||||
|
<el-table-column label="物资类型" align="center" prop="wlTypeName" />
|
||||||
|
<el-table-column label="场景" align="center" prop="sceneName" width="150" />
|
||||||
|
<el-table-column label="所属大库" align="center" prop="parentWarehouseName" width="150" />
|
||||||
|
<el-table-column label="所属小库" align="center" prop="warehouseName" width="150" />
|
||||||
|
<el-table-column label="入库类型" align="center" prop="operationTypeName" width="150" />
|
||||||
|
<el-table-column label="入库时间" align="center" prop="operationTime" width="150" />
|
||||||
|
<el-table-column label="还料时间" align="center" prop="returnTime" width="150">
|
||||||
|
<template #default="scope">
|
||||||
|
<span>{{ parseTime(scope.row.returnTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="库龄" align="center" prop="stockAge" />
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<el-table-column label="备注" align="center" prop="remark" width="150" />
|
||||||
|
<el-table-column label="一次封样号" align="center" prop="fycde1" width="150" />
|
||||||
|
<el-table-column label="二次封样号" align="center" prop="fycde2" width="150" />
|
||||||
|
<!-- <el-table-column prop="count" label="操作" class-name="small-padding fixed-width">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-button link type="primary" icon="View" @click="handleView(scope.row)">查看</el-button>
|
<el-button link type="primary" icon="View" @click="handleView(scope.row)">查看</el-button>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column> -->
|
||||||
</el-table>
|
</el-table>
|
||||||
|
|
||||||
<el-table :data="matchData" border empty-text="暂无数据" v-if="status == 2">
|
<el-table :data="matchData" border empty-text="暂无数据" v-if="status == 2">
|
||||||
@@ -106,7 +139,7 @@
|
|||||||
</el-table>
|
</el-table>
|
||||||
<template #footer>
|
<template #footer>
|
||||||
<span class="dialog-footer">
|
<span class="dialog-footer">
|
||||||
<el-button @click="taskView=false">关闭</el-button>
|
<el-button @click="taskView = false">关闭</el-button>
|
||||||
</span>
|
</span>
|
||||||
</template>
|
</template>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
@@ -115,7 +148,7 @@
|
|||||||
|
|
||||||
<script setup name="AutoInventory">
|
<script setup name="AutoInventory">
|
||||||
import { ElLoading } from 'element-plus';
|
import { ElLoading } from 'element-plus';
|
||||||
import { getTaskCount, getScan, getMatch, getChart, stopScan, getScanResult, getStockList } from "@/api/Inventory/autoInventory"
|
import { getTaskCount, getScan, getMatch, getChart, stopScan, getTotalStatistics, getStockList, inventoryList } from "@/api/Inventory/autoInventory"
|
||||||
import { ref, reactive, onMounted, onBeforeUnmount, markRaw } from "vue";
|
import { ref, reactive, onMounted, onBeforeUnmount, markRaw } from "vue";
|
||||||
import avatar from "@/assets/images/avatar.jpg"
|
import avatar from "@/assets/images/avatar.jpg"
|
||||||
import { useRoute } from 'vue-router';
|
import { useRoute } from 'vue-router';
|
||||||
@@ -290,9 +323,15 @@ const getResultList = () => {
|
|||||||
pageNum: queryParams.value.pageNum,
|
pageNum: queryParams.value.pageNum,
|
||||||
pageSize: queryParams.value.pageSize,
|
pageSize: queryParams.value.pageSize,
|
||||||
status: status.value,
|
status: status.value,
|
||||||
taskId: taskId.value
|
warehouseCode: deviceObj.value.warehouseCode,
|
||||||
|
sceneId: deviceObj.value.sceneId,
|
||||||
}
|
}
|
||||||
getScanResult(obj).then(res => {
|
if (status.value != 0) {
|
||||||
|
matchData.value = null
|
||||||
|
matchTotal.value = 0
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
inventoryList(obj).then(res => {
|
||||||
matchData.value = res.rows
|
matchData.value = res.rows
|
||||||
matchTotal.value = res.total
|
matchTotal.value = res.total
|
||||||
})
|
})
|
||||||
@@ -390,7 +429,41 @@ if (deviceInfo) {
|
|||||||
});
|
});
|
||||||
connectWebSocket(); // 组件加载时连接 WebSocket
|
connectWebSocket(); // 组件加载时连接 WebSocket
|
||||||
}
|
}
|
||||||
|
// 获取总计
|
||||||
|
const totalMoney = ref(null)
|
||||||
|
const pcodeCount = ref(null)
|
||||||
|
const sumQty = ref(null)
|
||||||
|
function getSummaries(param) {
|
||||||
|
const { columns, data } = param;
|
||||||
|
const sums = [];
|
||||||
|
columns.forEach((column, index) => {
|
||||||
|
if (index === 1) { // 第一列不进行合计操作,通常是序列号或选择框等非数值列。
|
||||||
|
sums[index] = '总计'; // 这里可以设置为其他文字或空字符串。
|
||||||
|
return;
|
||||||
|
} else if (index === 2) { // 第二列是金额列,进行求和操作。
|
||||||
|
sums[index] = '总金额:' + totalMoney.value;
|
||||||
|
} else if (index === 3) {
|
||||||
|
sums[index] = '共存于:' + pcodeCount.value + '个库位'
|
||||||
|
} else if (index === 4) {
|
||||||
|
sums[index] = '总数:' + sumQty.value
|
||||||
|
}
|
||||||
|
})
|
||||||
|
return sums
|
||||||
|
}
|
||||||
|
function getSumInfo() {
|
||||||
|
//统计信息
|
||||||
|
console.log(deviceObj.value,'deviceObj');
|
||||||
|
let rkInfo = JSON.parse(JSON.stringify({
|
||||||
|
warehouseCode: deviceObj.value.warehouseCode,
|
||||||
|
sceneId: deviceObj.value.sceneId,
|
||||||
|
}))
|
||||||
|
getTotalStatistics(rkInfo).then(response => {
|
||||||
|
totalMoney.value = response.data.totalAmount
|
||||||
|
pcodeCount.value = response.data.locationCount
|
||||||
|
sumQty.value = response.data.totalQuantity
|
||||||
|
});
|
||||||
|
}
|
||||||
|
getSumInfo()
|
||||||
// 使用 Websocket 发送消息
|
// 使用 Websocket 发送消息
|
||||||
const send = () => {
|
const send = () => {
|
||||||
let obj = {
|
let obj = {
|
||||||
|
|||||||
@@ -408,7 +408,7 @@ function handleInventory(row) {
|
|||||||
|
|
||||||
/** 查看结果操作 */
|
/** 查看结果操作 */
|
||||||
function handleHistory(row) {
|
function handleHistory(row) {
|
||||||
router.push({ path: "/Inventory/task/inventoryResult" , query: {"taskId": row.id} })
|
router.push({ path: "/Inventory/task/inventoryResult" , query: {"taskId": row.id,'warehouseCode':row.warehouseCode,"sceneId":row.sceneId} })
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 导出按钮操作 */
|
/** 导出按钮操作 */
|
||||||
|
|||||||
@@ -18,14 +18,47 @@
|
|||||||
|
|
||||||
<el-tabs v-model="activeTabs" type="border-card" @tab-change="handleQueryInfo">
|
<el-tabs v-model="activeTabs" type="border-card" @tab-change="handleQueryInfo">
|
||||||
<el-tab-pane v-for="item in statusList" :label="item.label" :name="item.value">
|
<el-tab-pane v-for="item in statusList" :label="item.label" :name="item.value">
|
||||||
<el-table :data="dialogData" border empty-text="暂无数据" v-if="dialogParams.status == 0 || dialogParams.status == 1">
|
<el-table :data="dialogData" border empty-text="暂无数据" show-overflow-tooltip show-summary
|
||||||
<el-table-column prop="rkPcode" label="存放位置" />
|
:summary-method="getSummaries" v-if="dialogParams.status == 0 || dialogParams.status == 1">
|
||||||
<el-table-column prop="realQty" label="数量" />
|
<el-table-column label="序号" align="center" type="index" width="70" />
|
||||||
<el-table-column prop="count" label="操作" class-name="small-padding fixed-width">
|
<el-table-column label="单据号" align="center" prop="billNo" width="180" />
|
||||||
|
<el-table-column label="库存类型" align="center" prop="operationTypeName" width="150" />
|
||||||
|
<el-table-column label="订单编号" align="center" prop="sapNo" width="150" />
|
||||||
|
<el-table-column label="项目号" align="center" prop="xmNo" width="150" />
|
||||||
|
<el-table-column label="项目描述" align="center" prop="xmMs" width="150" />
|
||||||
|
<el-table-column label="物料号" align="center" prop="wlNo" width="100" />
|
||||||
|
<el-table-column label="物料描述" align="center" prop="wlMs" width="150" />
|
||||||
|
<el-table-column label="供应商名称" align="center" prop="gysMc" width="150" />
|
||||||
|
<el-table-column label="合同单价" align="center" prop="htDj" />
|
||||||
|
<el-table-column label="总计" align="center" prop="totalAmount" />
|
||||||
|
<el-table-column label="单位" align="center" prop="dw" />
|
||||||
|
<el-table-column label="实际入库数量" align="center" prop="realQty" width="120" />
|
||||||
|
<el-table-column label="库位码" align="center" prop="pcode" width="120" />
|
||||||
|
<el-table-column label="托盘码" align="center" prop="trayCode" />
|
||||||
|
<el-table-column label="身份码" align="center" prop="entityId" width="150" />
|
||||||
|
<el-table-column label="物资类型" align="center" prop="wlTypeName" />
|
||||||
|
<el-table-column label="场景" align="center" prop="sceneName" width="150" />
|
||||||
|
<el-table-column label="所属大库" align="center" prop="parentWarehouseName" width="150" />
|
||||||
|
<el-table-column label="所属小库" align="center" prop="warehouseName" width="150" />
|
||||||
|
<el-table-column label="入库类型" align="center" prop="operationTypeName" width="150" />
|
||||||
|
<el-table-column label="入库时间" align="center" prop="operationTime" width="150" />
|
||||||
|
<el-table-column label="还料时间" align="center" prop="returnTime" width="150">
|
||||||
|
<template #default="scope">
|
||||||
|
<span>{{ parseTime(scope.row.returnTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="库龄" align="center" prop="stockAge" />
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<el-table-column label="备注" align="center" prop="remark" width="150" />
|
||||||
|
<el-table-column label="一次封样号" align="center" prop="fycde1" width="150" />
|
||||||
|
<el-table-column label="二次封样号" align="center" prop="fycde2" width="150" />
|
||||||
|
<!-- <el-table-column prop="count" label="操作" class-name="small-padding fixed-width">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-button link type="primary" icon="View" @click="handleView(scope.row)">查看</el-button>
|
<el-button link type="primary" icon="View" @click="handleView(scope.row)">查看</el-button>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column> -->
|
||||||
</el-table>
|
</el-table>
|
||||||
|
|
||||||
<el-table :data="dialogData" border empty-text="暂无数据" v-if="dialogParams.status == 2">
|
<el-table :data="dialogData" border empty-text="暂无数据" v-if="dialogParams.status == 2">
|
||||||
@@ -64,7 +97,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup name="InventoryResult">
|
<script setup name="InventoryResult">
|
||||||
import { getScanResult, getStockList } from "@/api/Inventory/autoInventory";
|
import { getStockList, getTotalStatistics, inventoryList } from "@/api/Inventory/autoInventory";
|
||||||
import { onMounted, ref } from "vue";
|
import { onMounted, ref } from "vue";
|
||||||
import { useRoute } from 'vue-router';
|
import { useRoute } from 'vue-router';
|
||||||
|
|
||||||
@@ -91,13 +124,19 @@ const dialogParams = ref({
|
|||||||
status: 0,
|
status: 0,
|
||||||
pageNum: 1,
|
pageNum: 1,
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
taskId: ""
|
warehouseCode: '',
|
||||||
|
sceneId: '',
|
||||||
})
|
})
|
||||||
const dialogData = ref([])
|
const dialogData = ref([])
|
||||||
const dialogTotal = ref(0)
|
const dialogTotal = ref(0)
|
||||||
|
|
||||||
const getHistoryInfo = () => {
|
const getHistoryInfo = () => {
|
||||||
getScanResult(dialogParams.value).then(res => {
|
if(dialogParams.value.status!=0){
|
||||||
|
dialogData.value =null
|
||||||
|
dialogTotal.value = 0
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
inventoryList(dialogParams.value).then(res => {
|
||||||
dialogData.value = res.rows
|
dialogData.value = res.rows
|
||||||
dialogTotal.value = res.total
|
dialogTotal.value = res.total
|
||||||
})
|
})
|
||||||
@@ -122,25 +161,59 @@ const chageDialogPage = (e) => {
|
|||||||
const taskView = ref(false)
|
const taskView = ref(false)
|
||||||
const viewData = ref([])
|
const viewData = ref([])
|
||||||
const handleView = (row) => {
|
const handleView = (row) => {
|
||||||
// let obj = {
|
|
||||||
// pageNum: 1,
|
|
||||||
// pageSize: 100,
|
|
||||||
// pcode: row.rkPcode
|
|
||||||
// }
|
|
||||||
getStockList(row.rkPcode).then(res => {
|
getStockList(row.rkPcode).then(res => {
|
||||||
console.log(res)
|
console.log(res)
|
||||||
viewData.value = res.data
|
viewData.value = res.data
|
||||||
taskView.value = true
|
taskView.value = true
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
const totalMoney = ref(null)
|
||||||
|
const pcodeCount = ref(null)
|
||||||
|
const sumQty = ref(null)
|
||||||
|
function getSummaries(param) {
|
||||||
|
const { columns, data } = param;
|
||||||
|
const sums = [];
|
||||||
|
columns.forEach((column, index) => {
|
||||||
|
if (index === 1) { // 第一列不进行合计操作,通常是序列号或选择框等非数值列。
|
||||||
|
sums[index] = '总计'; // 这里可以设置为其他文字或空字符串。
|
||||||
|
return;
|
||||||
|
} else if (index === 2) { // 第二列是金额列,进行求和操作。
|
||||||
|
sums[index] = '总金额:' + totalMoney.value;
|
||||||
|
} else if (index === 3) {
|
||||||
|
sums[index] = '共存于:' + pcodeCount.value + '个库位'
|
||||||
|
} else if (index === 4) {
|
||||||
|
sums[index] = '总数:' + sumQty.value
|
||||||
|
}
|
||||||
|
})
|
||||||
|
return sums
|
||||||
|
}
|
||||||
|
|
||||||
const route = useRoute()
|
const route = useRoute()
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
dialogParams.value.taskId = route.query.taskId
|
// dialogParams.value.taskId = route.query.taskId
|
||||||
|
dialogParams.value.warehouseCode = route.query.warehouseCode
|
||||||
|
dialogParams.value.sceneId = route.query.sceneId
|
||||||
|
dialogParams.value.pageNum = 1
|
||||||
|
dialogParams.value.pageSize = 10
|
||||||
getHistoryInfo()
|
getHistoryInfo()
|
||||||
})
|
})
|
||||||
|
// 获取总计
|
||||||
|
|
||||||
|
function getSumInfo() {
|
||||||
|
//统计信息
|
||||||
|
let rkInfo = JSON.parse(JSON.stringify({
|
||||||
|
warehouseCode:route.query.warehouseCode,
|
||||||
|
sceneId:route.query.sceneId,
|
||||||
|
}))
|
||||||
|
delete rkInfo.pageNum
|
||||||
|
delete rkInfo.pageSize
|
||||||
|
getTotalStatistics(rkInfo).then(response => {
|
||||||
|
totalMoney.value = response.data.totalAmount
|
||||||
|
pcodeCount.value = response.data.locationCount
|
||||||
|
sumQty.value = response.data.totalQuantity
|
||||||
|
});
|
||||||
|
}
|
||||||
|
getSumInfo()
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss"></style>
|
||||||
</style>
|
|
||||||
|
|||||||
Reference in New Issue
Block a user