Compare commits

...

16 Commits

10 changed files with 352 additions and 89 deletions

View File

@@ -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) {

View File

@@ -25,7 +25,7 @@
</tr> </tr>
<tr v-if="!isRuKu"> <tr v-if="!isRuKu">
<td class="label-td">项目编号</td> <td class="label-td">项目编号</td>
<td class="value-td" colspan="3">{{ billAllObj[0]?.xmNo }}</td> <td class="value-td" colspan="3">{{ billAllObj[0]?.bizType == 1 ? xmNo :billAllObj[0]?.xmNo }}</td>
</tr> </tr>
<tr v-if="!isRuKu"> <tr v-if="!isRuKu">
<td class="label-td">项目描述</td> <td class="label-td">项目描述</td>
@@ -80,7 +80,7 @@
<th>数量</th> <th>数量</th>
<th>库位码</th> <th>库位码</th>
<th>订单编号</th> <th>订单编号</th>
<th v-if="isRuKu">项目编号</th> <th>项目编号</th>
<th v-if="isRuKu">项目描述</th> <th v-if="isRuKu">项目描述</th>
<th>备注</th> <th>备注</th>
<th>身份码</th> <th>身份码</th>
@@ -96,7 +96,7 @@
<td style="text-align: center;">{{ item.realQty }}</td> <td style="text-align: center;">{{ item.realQty }}</td>
<td style="text-align: center;">{{ item.pcode }}</td> <td style="text-align: center;">{{ item.pcode }}</td>
<td style="text-align: center;">{{ item.sapNo }}</td> <td style="text-align: center;">{{ item.sapNo }}</td>
<td v-if="isRuKu" style="text-align: center;">{{ item.xmNo }}</td> <td style="text-align: center;">{{ item.xmNo }}</td>
<td v-if="isRuKu" style="text-align: center;">{{ item.xmMs }}</td> <td v-if="isRuKu" style="text-align: center;">{{ item.xmMs }}</td>
<td style="text-align: center;">{{ item.remark }}</td> <td style="text-align: center;">{{ item.remark }}</td>
<td style="text-align: center;">{{ item.entityId }}</td> <td style="text-align: center;">{{ item.entityId }}</td>
@@ -134,6 +134,17 @@ const isRuKu = computed(() => {
return props.billAllObj[0]?.bizType == 0; return props.billAllObj[0]?.bizType == 0;
}); });
// 获取不同的项目编号
const xmNo = computed(() => {
const validXmMsValues = props.billAllObj
.map(item => item.xmNo) // 提取所有 xmMs 属性值
.filter(value => !!value); // 过滤掉 null/undefined/空字符串等假值
// 3. 去重:得到所有不同的 xmMs 值
const uniqueXmMs = [...new Set(validXmMsValues)];
// 4. 核心逻辑:多个值用 + 拼接,单个值直接返回,无值返回空字符串
return uniqueXmMs.length > 1 ? uniqueXmMs.join('、') : uniqueXmMs[0] || '';
});
// 获取不同的项目描述 // 获取不同的项目描述
const xmMs = computed(() => { const xmMs = computed(() => {
const validXmMsValues = props.billAllObj const validXmMsValues = props.billAllObj
@@ -153,7 +164,7 @@ const summaryList = computed(() => {
props.billAllObj.forEach(item => { props.billAllObj.forEach(item => {
if (map.has(item.wlNo)) { if (map.has(item.wlNo)) {
const existing = map.get(item.wlNo); const existing = map.get(item.wlNo);
const total = (parseFloat(existing.totalQty) + parseFloat(item.realQty)) * 100*10000 const total = (parseFloat(existing.totalQty)*100 *10000 + parseFloat(item.realQty)*100 *10000)
existing.totalQty = total / ( 100 * 10000); existing.totalQty = total / ( 100 * 10000);
} else { } else {
map.set(item.wlNo, { map.set(item.wlNo, {

View File

@@ -145,7 +145,7 @@ const summaryList = computed(() => {
props.billAllObj.forEach(item => { props.billAllObj.forEach(item => {
if (map.has(item.wlNo)) { if (map.has(item.wlNo)) {
const existing = map.get(item.wlNo); const existing = map.get(item.wlNo);
const total = (parseFloat(existing.totalQty) + parseFloat(item.realQty)) * 100*10000 const total = (parseFloat(existing.totalQty) * 100*10000+ parseFloat(item.realQty)* 100*10000)
existing.totalQty = total / ( 100 * 10000); existing.totalQty = total / ( 100 * 10000);
} else { } else {
map.set(item.wlNo, { map.set(item.wlNo, {

View File

@@ -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 = {

View File

@@ -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} })
} }
/** 导出按钮操作 */ /** 导出按钮操作 */

View File

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

View File

@@ -321,10 +321,10 @@
<span>删除</span> <span>删除</span>
</div> </div>
</div> </div>
<el-table :data="planList" height="400" style="width: 100%" show-overflow-tooltip <el-table :data="planList" height="400" style="width: 100%" show-overflow-tooltip border
:row-class-name="tableRowClassName" @selection-change="handleSelectionChange"> :row-class-name="tableRowClassName" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="30" align="center" /> <el-table-column type="selection" width="30" align="center" />
<el-table-column label="序号" align="center" type="index" width="50" /> <el-table-column label="序号" align="center" type="index" width="70" />
<el-table-column label="状态" align="center" prop="status" width="100" v-if="idEdit == 0"> <el-table-column label="状态" align="center" prop="status" width="100" v-if="idEdit == 0">
<template #default="scoped"> <template #default="scoped">
<el-tag :type="scoped.row.status == 1 <el-tag :type="scoped.row.status == 1
@@ -896,7 +896,7 @@ const statusList = ref([
]); ]);
const checkPlanList = ref([]); //已选中的要入库的数据 const checkPlanList = ref([]); //已选中的要入库的数据
// 点击添加至 // 点击添加至
const outTempData = ref([]); const outTempData = ref([]);
function addData() { function addData() {
if (checkPlanList.value.length == 0) { if (checkPlanList.value.length == 0) {
@@ -904,27 +904,74 @@ function addData() {
return; return;
} }
let data = outTempData.value.concat(checkPlanList.value); let data = outTempData.value.concat(checkPlanList.value);
let arr = [] // let arr = []; // 去重后的最终数组
let spaNoTotal = '' // let duplicateSapNos = ''; // 存储重复数据的sapNo
const idList = []; // 用于统计每个id出现的次数 // let invalidQtySapNos = ''; // 存储入库数量有误的sapNo
// 第一步遍历数组统计id出现次数 // const uniqueKeys = new Set(); // 用于存储唯一的组合键 (id+pcode+realQty)
data.forEach(item => {
if (idList.includes(item.id)) { // // 遍历数组,先校验数量合法性,再判断唯一性
spaNoTotal += item.sapNo + ',' // data.forEach(item => {
} else { // // 1. 校验realQty是否大于0处理空值/非数字情况)
arr.push(item) // const realQty = Number(item.realQty);
idList.push(item.id); // if (isNaN(realQty) || realQty <= 0) {
} // // 避免同一个sapNo重复添加到提示中
}); // if (!invalidQtySapNos.includes(item.sapNo)) {
if (spaNoTotal) { // invalidQtySapNos += item.sapNo + ',';
proxy.$modal.msgError("存在重复数据:" + spaNoTotal); // }
// return; // 数量不合法,直接跳过后续唯一性判断
// }
// // 2. 生成唯一标识组合键
// const uniqueKey = `${item.id}_${item.pcode}_${realQty}`;
// // 3. 检查组合键是否已存在
// if (uniqueKeys.has(uniqueKey)) {
// // 存在重复拼接sapNo去重避免重复拼接
// if (!duplicateSapNos.includes(item.sapNo)) {
// duplicateSapNos += item.sapNo + ',';
// }
// } else {
// // 不存在重复,加入结果数组并记录组合键
// arr.push(item);
// uniqueKeys.add(uniqueKey);
// }
// console.log(uniqueKeys)
// });
// // 处理入库数量有误的提示
// if (invalidQtySapNos) {
// invalidQtySapNos = invalidQtySapNos.slice(0, -1); // 去掉最后一个逗号
// proxy.$modal.msgError(`入库数量有误:${invalidQtySapNos}入库数量需大于0`);
// return
// }
// // 处理重复数据的提示
// if (duplicateSapNos) {
// duplicateSapNos = duplicateSapNos.slice(0, -1); // 去掉最后一个逗号
// proxy.$modal.msgError(`存在重复数据:${duplicateSapNos}`);
// }
outTempData.value = data
}
const generateSimpleUniqueStr = () => {
if (typeof crypto !== 'undefined' && crypto.randomUUID) {
return crypto.randomUUID();
} }
outTempData.value = arr
// 兼容旧版浏览器/Node.jscrypto API 降级)
return ([1e7] + -1e3 + -4e3 + -8e3 + -1e11).replace(/[018]/g, c =>
(c ^ (crypto.getRandomValues(new Uint8Array(1))[0] & (15 >> (c / 4)))).toString(16)
);
} }
// 查看所有的出库数据 // 查看所有的出库数据
const viewData = () => { const viewData = () => {
planList.value = JSON.parse(JSON.stringify(outTempData.value)); let arr = JSON.parse(JSON.stringify(outTempData.value));
planList.value = arr.map(item => ({
...item,
uniqueId: generateSimpleUniqueStr() // 新增随机唯一值
}));
} }
// 删除选中的出库数据 // 删除选中的出库数据
@@ -934,11 +981,11 @@ const deleteData = () => {
return; return;
} }
proxy.$modal.confirm("确认删除选中的出库数据吗?").then(() => { proxy.$modal.confirm("确认删除选中的出库数据吗?").then(() => {
const ids = checkPlanList.value.map(item => item.id); const uniqueIds = checkPlanList.value.map(item => item.uniqueId);
console.log(ids) console.log(uniqueIds)
planList.value = planList.value.filter(item => { planList.value = planList.value.filter(item => {
// 无id的元素默认保留如果想删除无id的可改为 item?.id && !arr2Ids.has(item.id) // 无id的元素默认保留如果想删除无id的可改为 item?.id && !arr2Ids.has(item.id)
return !ids.includes(item?.id); return !uniqueIds.includes(item?.uniqueId);
}); });
outTempData.value = planList.value outTempData.value = planList.value
}); });
@@ -946,7 +993,7 @@ const deleteData = () => {
//新增入库 多选框选中数据 //新增入库 多选框选中数据
function handleSelectionChange(selection) { function handleSelectionChange(selection, $event) {
checkPlanList.value = selection; checkPlanList.value = selection;
} }
@@ -963,6 +1010,7 @@ function searchPlan() {
for (let i = 0; i < planData.length; i++) { for (let i = 0; i < planData.length; i++) {
planData[i].realQty = planData[i].waitQty; planData[i].realQty = planData[i].waitQty;
planData[i].gysJhId = planData[i].id; planData[i].gysJhId = planData[i].id;
planData[i].pcode = "";
if (autoFill.value && kzms.value != "") { if (autoFill.value && kzms.value != "") {
planData[i].remark = kzms.value; planData[i].remark = kzms.value;
} }
@@ -975,7 +1023,7 @@ function searchPlan() {
proxy.$modal.msgWarning("暂无数据"); proxy.$modal.msgWarning("暂无数据");
return; return;
} }
planList.value = planData; planList.value = planList.value.concat(planData);
}); });
} }
@@ -1383,6 +1431,7 @@ function handleUpdate(row) {
]; ];
pcodeList(storeData.value.warehouseCode); pcodeList(storeData.value.warehouseCode);
open.value = true; open.value = true;
outTempData.value = []
title.value = "修改库存单据"; title.value = "修改库存单据";
} }
// 取消按钮 // 取消按钮
@@ -1530,6 +1579,11 @@ function handleDispatch() {
proxy.$modal.msgError("请勾选数据"); proxy.$modal.msgError("请勾选数据");
return; return;
} }
let isDiaodu = checkStockList.value.some((item) => item.execStatus == 0);
if(isDiaodu){
proxy.$modal.msgWarning("预入库数据不能生成调度任务");
return;
}
dispatchOpen.value = true; dispatchOpen.value = true;
} }
// 提交调度任务 // 提交调度任务
@@ -1540,7 +1594,7 @@ function submitDispatch() {
return; return;
} }
let data; let data;
if (billStatus.value == "rk") {
data = checkStockList.value.map((item) => ({ data = checkStockList.value.map((item) => ({
sourceName: "V01-010101", sourceName: "V01-010101",
targetName: item.pcode, targetName: item.pcode,
@@ -1550,17 +1604,28 @@ function submitDispatch() {
num: 1, num: 1,
dispatchMode: resource.value, dispatchMode: resource.value,
})); }));
} else if (billStatus.value == "ck") {
data = checkStockList.value.map((item) => ({ // if (billStatus.value == "rk") {
sourceName: item.pcode, // data = checkStockList.value.map((item) => ({
targetName: "V01-010101", // sourceName: "V01-010101",
taskTypeName: "下架", // targetName: item.pcode,
taskType: 1, // taskTypeName: "上架",
mid: item.wlNo, // taskType: 0,
num: 1, // mid: item.wlNo,
dispatchMode: resource.value, // num: 1,
})); // dispatchMode: resource.value,
} // }));
// } else if (billStatus.value == "ck") {
// data = checkStockList.value.map((item) => ({
// sourceName: item.pcode,
// targetName: "V01-010101",
// taskTypeName: "下架",
// taskType: 1,
// mid: item.wlNo,
// num: 1,
// dispatchMode: resource.value,
// }));
// }
//调用生成调度任务接口 //调用生成调度任务接口
generateDispatch(data).then((response) => { generateDispatch(data).then((response) => {
// console.log(11111) // console.log(11111)

View File

@@ -1654,6 +1654,12 @@ function handleDispatch() {
proxy.$modal.msgError("请勾选数据"); proxy.$modal.msgError("请勾选数据");
return; return;
} }
let isDiaodu = checkStockList.value.some((item) => item.execStatus == 0);
if(isDiaodu){
proxy.$modal.msgWarning("预出库数据不能生成调度任务");
return;
}
dispatchOpen.value = true; dispatchOpen.value = true;
} }
// 提交调度任务 // 提交调度任务
@@ -1665,7 +1671,8 @@ function submitDispatch() {
//调用生成调度任务接口 //调用生成调度任务接口
const data = checkStockList.value.map((item) => ({ const data = checkStockList.value.map((item) => ({
sourceName: item.pcode, sourceName: item.pcode,
targetName: "V01-230101", // targetName: "V01-230101",
targetName: "V01-010101",
taskTypeName: "下架", taskTypeName: "下架",
taskType: 1, taskType: 1,
mid: item.wlNo, mid: item.wlNo,

View File

@@ -18,8 +18,8 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="6"> <el-col :span="6">
<el-form-item label="库存状态" prop="isChuku"> <el-form-item label="库存状态" prop="bizType">
<el-select v-model="queryParams.isChuku" placeholder="请选择" clearable> <el-select v-model="queryParams.bizType" placeholder="请选择" clearable>
<el-option v-for="dict in storeStatusList" :key="dict.id" :label="dict.statusName" :value="dict.id" /> <el-option v-for="dict in storeStatusList" :key="dict.id" :label="dict.statusName" :value="dict.id" />
</el-select> </el-select>
</el-form-item> </el-form-item>
@@ -71,7 +71,7 @@
<el-col :span="6"> <el-col :span="6">
<el-form-item label="出库类型" prop="operationTypeCK"> <el-form-item label="出库类型" prop="operationTypeCK">
<el-select v-model="operationTypeCK" placeholder="请选择出库类型" <el-select v-model="operationTypeCK" placeholder="请选择出库类型"
@change="changeOperationType($event, 'operationTypeCK')" clearable> @change="changeOperationType($event, 'operationTypeCK')" clearable >
<el-option v-for="dict in ckTypeList" :key="dict.id" :label="dict.typeName" :value="dict.typeCode" /> <el-option v-for="dict in ckTypeList" :key="dict.id" :label="dict.typeName" :value="dict.typeCode" />
</el-select> </el-select>
</el-form-item> </el-form-item>
@@ -183,7 +183,7 @@ const data = reactive({
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
billNo: null, billNo: null,
isChuku: null, bizType: null,
startTime: null, startTime: null,
endTime: null, endTime: null,
xmNo: null, xmNo: null,
@@ -276,13 +276,15 @@ function handleExport() {
//搜索按钮操作 //搜索按钮操作
function handleQuery() { function handleQuery() {
//所属仓库 //所属仓库
console.log(warehouseCode.value, optionTime, '===='); console.log(operationTypeCK.value,operationTypeRK.value, '====');
if (warehouseCode.value) { if (warehouseCode.value) {
queryParams.value.cangku = warehouseCode.value[1] queryParams.value.cangku = warehouseCode.value[1]
} }
//详细类型 //详细类型
if (operationTypeCK.value?.length > 0 || operationTypeRK.value?.length > 0) { if (operationTypeCK.value?.length > 0 || operationTypeRK.value?.length > 0) {
queryParams.value.operationType = operationTypeRK.value || operationTypeCK.value queryParams.value.operationType = operationTypeRK.value || operationTypeCK.value
}else{
queryParams.value.operationType =''
} }
//操作时间 //操作时间
if (optionTime.value && optionTime.value.length > 0) { if (optionTime.value && optionTime.value.length > 0) {

View File

@@ -60,29 +60,34 @@
:props="{ children: 'children', label: 'warehouseName', value: 'warehouseCode' }" clearable /> :props="{ children: 'children', label: 'warehouseName', value: 'warehouseCode' }" clearable />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="6">
<el-form-item label="场景" prop="scene">
<el-select v-model="queryParams.scene" placeholder="请选择场景" clearable>
<el-option v-for="dict in sceneTypeList" :key="dict.sceneCode" :label="dict.sceneName" :value="dict.sceneCode" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="6"> <el-col :span="6">
<el-form-item label="供应商名称" prop="gysMc"> <el-form-item label="供应商名称" prop="gysMc">
<el-input v-model="queryParams.gysMc" placeholder="请输入供应商名称" clearable @keyup.enter="handleQuery" /> <el-input v-model="queryParams.gysMc" placeholder="请输入供应商名称" clearable @keyup.enter="handleQuery" />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="16"> <el-col :span="6">
<el-form-item label="物料描述" prop="wlMs"> <el-form-item label="物料描述" prop="wlMs">
<el-input v-model="queryParams.wlMs" placeholder="请输入物料描述" clearable @keyup.enter="handleQuery" /> <el-input v-model="queryParams.wlMs" placeholder="请输入物料描述" clearable @keyup.enter="handleQuery" />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="16"> <el-col :span="6">
<el-form-item label="备注" prop="remark">
<el-input v-model="queryParams.remark" placeholder="请输入备注" clearable @keyup.enter="handleQuery" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="入库时间" prop="optionTime"> <el-form-item label="入库时间" prop="optionTime">
<el-date-picker v-model="optionTime" type="datetimerange" start-placeholder="开始时间" end-placeholder="结束时间" <el-date-picker v-model="optionTime" type="datetimerange" start-placeholder="开始时间" end-placeholder="结束时间"
format="YYYY/MM/DD HH:mm:ss" value-format="YYYY-MM-DD HH:mm:ss" /> format="YYYY/MM/DD HH:mm:ss" value-format="YYYY-MM-DD HH:mm:ss" />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="6">
<el-form-item label="备注" prop="remark">
<el-input v-model="queryParams.remark" placeholder="请输入备注" clearable @keyup.enter="handleQuery" />
</el-form-item>
</el-col>
<el-col :span="12" class="searchBtn"> <el-col :span="12" class="searchBtn">
<el-form-item> <el-form-item>
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button> <el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
@@ -90,6 +95,7 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
</el-form> </el-form>
<el-row :gutter="10" class="mb8"> <el-row :gutter="10" class="mb8">
@@ -134,6 +140,7 @@
<el-table-column label="托盘码" align="center" prop="trayCode" /> <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="entityId" width="150" />
<el-table-column label="物资类型" align="center" prop="wlTypeName" /> <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="parentWarehouseName" width="150" />
<el-table-column label="所属小库" align="center" prop="warehouseName" 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="operationTypeName" width="150" />
@@ -334,6 +341,7 @@ import { listStock, getTotal, editStock, printTag } from "@/api/wisdom/
import { warehousingDict } from "@/api/information/warehousingtype"; //入库类型 import { warehousingDict } from "@/api/information/warehousingtype"; //入库类型
import { materialtypeDict } from "@/api/information/materialtype"; //物资类型 import { materialtypeDict } from "@/api/information/materialtype"; //物资类型
import { warehouseAll } from "@/api/information/warehouseinfo"; //所属仓库 import { warehouseAll } from "@/api/information/warehouseinfo"; //所属仓库
import { listScene } from "@/api/information/scene"; //所属仓库
import { personListDict } from "@/api/system/user"; //理货员 import { personListDict } from "@/api/system/user"; //理货员
import { getKwAllList } from "@/api/information/pcdedetail"; //库位下拉数据 import { getKwAllList } from "@/api/information/pcdedetail"; //库位下拉数据
import { parseTime } from '@/utils/manage' import { parseTime } from '@/utils/manage'
@@ -456,6 +464,14 @@ function materialFun() {
}) })
} }
materialFun() materialFun()
//场景下拉
const sceneTypeList = ref([]);
function listSceneFun() {
listScene().then(response => {
sceneTypeList.value = response.rows
})
}
listSceneFun()
//理货员 //理货员
const personList = ref([]); const personList = ref([]);