pda盘点确认

This commit is contained in:
liuhanqing
2025-06-19 17:47:52 +08:00
parent b9fc02c01b
commit afb022d365
29 changed files with 1022 additions and 100 deletions

View File

@@ -392,6 +392,7 @@ export default {
quantityExceedError: 'Quantity cannot exceed stock quantity',
saveSuccess: 'Document {msg} saved successfully',
lotNo:'lotNo',
cargoSpaceName: 'cargoSpaceName',
},
//***************盘点单据管理***************
checkStockCheck: {

View File

@@ -360,6 +360,7 @@ export default {
quantityExceedError: '数量不能大于库存数量',
saveSuccess: '单据{msg}保存成功',
lotNo:'批次号',
cargoSpaceName: 'cargoSpaceName',
},
//***************盘点单据管理***************
checkStockCheck: {

View File

@@ -362,6 +362,13 @@ export default {
quantityExceedError: '数量不能大于库存数量',
saveSuccess: '单据{msg}保存成功',
lotNo:'批次号',
cargoSpaceName: '货位名称',
trayCode: '托盘码',
inputTrayCode: '请输入托盘码',
inputCargoSpaceName: '请输入货位名称',
selectTrayCode:"选择托盘",
trayDetail:"物资详情",
close: '关闭',
},
//***************盘点单据管理***************
checkStockCheck: {
@@ -407,7 +414,9 @@ export default {
reviewSuccess: '审核成功',
onlyUnreviewedCanReview: '只有未审核的单据可以审核',
confirmSuccess: '确认成功',
onlyReviewedCanConfirm: '只有已审核的单据可以确认'
onlyReviewedCanConfirm: '只有已审核的单据可以确认',
cargoSpaceName: '货位名称',
autoAllocation:'自动分配'
},
// ***************盘点入库作业*************
checkJobIn: {

View File

@@ -20,7 +20,7 @@
/>
</el-form-item>-->
<el-form-item :label="$t('checkCreate.documentType')" prop="checkType" required> <!-- 单据类型 -->
<el-select v-model="formData.checkType" :placeholder="$t('checkCreate.selectDocumentType')" clearable>
<el-select v-model="formData.checkType" :placeholder="$t('checkCreate.selectDocumentType')" clearable @change="handleCheckTypeChange">
<el-option
v-for="dict in dict.type.check_stock_type"
:key="dict.value"
@@ -44,17 +44,10 @@
<el-table v-loading="loading" :data="materialList">
<el-table-column :label="$t('checkCreate.materialCode')" align="center" prop="productId" /> <!-- 物资编号 -->
<el-table-column :label="$t('checkCreate.materialName')" align="center" prop="productName" /> <!-- 物资名称 -->
<el-table-column :label="$t('checkCreate.batchNo')" align="center" prop="lotNo"> <!-- 批号 -->
<template slot-scope="scope">
<el-input v-model="scope.row.lotNo" size="mini" :placeholder="$t('checkCreate.inputBatchNo')" />
</template>
</el-table-column>
<el-table-column :label="$t('checkCreate.quantity')" align="center" prop="quantity"> <!-- 数量 -->
<template slot-scope="scope">
<el-input-number v-model="scope.row.quantity" :min="1" size="mini" @change="handleQuantityChange(scope.row)" />
</template>
</el-table-column>
<el-table-column :label="$t('checkCreate.warehouse')" align="center" prop="warehouseName" /> <!-- 物资名称 -->
<el-table-column :label="$t('checkCreate.batchNo')" align="center" prop="lotNo"/> <!-- 批号 -->
<el-table-column :label="$t('checkCreate.quantity')" align="center" prop="quantity" /> <!-- 数量 -->
<el-table-column :label="$t('checkCreate.warehouse')" align="center" prop="warehouseName" /> <!-- 仓库名称 -->
<el-table-column :label="$t('checkCreate.cargoSpaceName')" align="center" prop="cargoSpaceName" /> <!-- 货位名称 -->
<el-table-column :label="$t('checkCreate.operation')" align="center" class-name="small-padding fixed-width"> <!-- 操作 -->
<template slot-scope="scope">
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.$index)">{{ $t('checkCreate.delete') }}</el-button> <!-- 删除 -->
@@ -62,8 +55,8 @@
</el-table-column>
</el-table>
<!-- 选择物资弹窗 -->
<el-dialog :title="$t('checkCreate.selectMaterial')" :visible.sync="materialDialog" width="800px" append-to-body> <!-- 选择物资 -->
<!-- 选择物料物资弹窗 -->
<el-dialog :title="$t('checkCreate.selectMaterial')" :visible.sync="materialDialogByProduct" width="800px" append-to-body> <!-- 选择物资 -->
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" label-width="68px">
<el-form-item :label="$t('checkCreate.materialCode')" prop="productId"> <!-- 物资编码 -->
<el-input
@@ -89,16 +82,6 @@
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="仓库" prop="warehouseId">
<el-select v-model="queryParams.warehouseId" :placeholder="$t('checkCreate.selectWarehouse')" clearable>
<el-option
v-for="dict in warehouseOptions"
:key="dict.warehouseId"
:label="dict.warehouseName"
:value="dict.warehouseId"
/>
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">{{ $t('checkCreate.search') }}</el-button> <!-- 搜索 -->
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">{{ $t('checkCreate.reset') }}</el-button> <!-- 重置 -->
@@ -110,8 +93,8 @@
<el-table-column :label="$t('checkCreate.materialCode')" align="center" prop="productId" /> <!-- 物资编码 -->
<el-table-column :label="$t('checkCreate.materialName')" align="center" prop="productName" /> <!-- 物资名称 -->
<el-table-column :label="$t('checkCreate.quantity')" align="center" prop="quantity" /> <!-- 数量 -->
<el-table-column :label="$t('checkCreate.lotNo')" align="center" prop="lotNo" /> <!-- 物资名称 -->
<el-table-column :label="$t('checkCreate.warehouse')" align="center" prop="warehouseName" /> <!-- 物资名称 -->
<el-table-column :label="$t('checkCreate.lotNo')" align="center" prop="lotNo" /> <!-- 批次 -->
<el-table-column :label="$t('checkCreate.warehouse')" align="center" prop="warehouseName" /> <!-- 仓库 -->
</el-table>
@@ -120,30 +103,97 @@
<el-button @click="cancelSelectMaterials">{{ $t('checkCreate.cancel') }}</el-button> <!-- 取消 -->
</div>
</el-dialog>
<!-- 选择托盘弹窗 -->
<el-dialog :title="$t('checkCreate.selectTrayCode')" :visible.sync="materialDialogByTrayCode" width="800px" append-to-body>
<el-form :model="trayQueryParams" ref="trayQueryForm" size="small" :inline="true" label-width="68px">
<el-form-item :label="$t('checkCreate.cargoSpaceName')" prop="cargoSpaceName">
<el-input
v-model="trayQueryParams.cargoSpaceName"
:placeholder="$t('checkCreate.inputCargoSpaceName')"
clearable
@keyup.enter.native="handleTrayQuery"
/>
</el-form-item>
<el-form-item :label="$t('checkCreate.trayCode')" prop="trayCode">
<el-input
v-model="trayQueryParams.trayCode"
:placeholder="$t('checkCreate.inputTrayCode')"
clearable
@keyup.enter.native="handleTrayQuery"
/>
</el-form-item>
<el-form-item :label="$t('checkCreate.materialName')" prop="productName">
<el-input
v-model="trayQueryParams.productName"
:placeholder="$t('checkCreate.inputMaterialName')"
clearable
@keyup.enter.native="handleTrayQuery"
/>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleTrayQuery">{{ $t('checkCreate.search') }}</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetTrayQuery">{{ $t('checkCreate.reset') }}</el-button>
</el-form-item>
</el-form>
<el-table v-loading="trayLoading" :data="trayOptions" @selection-change="handleTraySelectionChange" @row-click="handleRowClick">
<el-table-column type="selection" width="55" />
<el-table-column :label="$t('checkCreate.trayCode')" align="center" prop="trayCode" />
<el-table-column :label="$t('checkCreate.cargoSpaceName')" align="center" prop="cargoSpaceName" />
<el-table-column :label="$t('checkCreate.warehouse')" align="center" prop="warehouseName" />
</el-table>
<!-- 托盘详情弹窗 -->
<el-dialog
:title="$t('checkCreate.trayDetail')"
:visible.sync="trayDetailVisible"
width="600px"
append-to-body
>
<el-table :data="trayDetailList">
<el-table-column :label="$t('checkCreate.materialCode')" align="center" prop="extraField.productId" />
<el-table-column :label="$t('checkCreate.materialName')" align="center" prop="extraField.materialDesc" />
<el-table-column :label="$t('checkCreate.quantity')" align="center" prop="quantity" />
</el-table>
<div slot="footer" class="dialog-footer">
<el-button @click="trayDetailVisible = false">{{ $t('checkCreate.close') }}</el-button>
</div>
</el-dialog>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="confirmSelectMaterials">{{ $t('checkCreate.confirm') }}</el-button>
<el-button @click="cancelSelectMaterials">{{ $t('checkCreate.cancel') }}</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { listProductAndStock } from "@/api/out/outStockout";
import {listWarehouse} from "@/api/bas/warehouse";
import {saveCheckStock} from "@/api/check/stockCheck";
import { listWarehouse } from "@/api/bas/warehouse";
import { saveCheckStock } from "@/api/check/stockCheck";
import { listManagement} from "@/api/stock/management"
import { listCargoSpace} from "@/api/bas/cargoSpace"
export default {
name: "AddOutStock",
dicts: ['check_stock_type', 'bill_status'],
data() {
return {
// 上一次选择的单据类型
oldCheckType: null,
// 遮罩层
loading: false,
materialLoading: false,
trayLoading: false,
// 表单验证规则
rules: {
warehouseId: [
{ required: true, message: this.$t('checkCreate.warehouseRequired'), trigger: "change" }
],
customerNo: [
{ required: true, message: this.$t('checkCreate.customerRequired'), trigger: "blur" }
],
billType: [
{ required: true, message: this.$t('checkCreate.documentTypeRequired'), trigger: "change" }
]
@@ -159,12 +209,17 @@
// 物资明细列表
materialList: [],
// 选择物资弹窗
materialDialog: false,
// 物资选项数据
materialDialogByProduct: false,
materialDialogByTrayCode: false,
// 物资选择列表
materialOptions: [],
// 托盘选择列表
trayOptions: [],
// 已选择的物资
selectedMaterials: [],
// 查询参数
// 已选择的托盘
selectedTrays: [],
// 物资查询参数
queryParams: {
pageNum: 1,
pageSize: 10,
@@ -174,8 +229,22 @@
productName: null,
quantity: null,
warehouseId: null
},
// 托盘查询参数
trayQueryParams: {
pageNum: 1,
pageSize: 10,
trayCode: null,
productName: null,
cargoSpaceName: null,
warehouseId: null,
status: null
},
// 托盘详情弹窗显示状态
trayDetailVisible: false,
// 托盘详情列表
trayDetailList: []
}
};
},
created() {
this.getWarehouseOptions();
@@ -183,30 +252,92 @@
methods: {
/** 获取仓库选项 */
getWarehouseOptions() {
listWarehouse().then(response => {
var param = {
pageNum:1,
pageSize:99,
typeData:['1','2']
}
listWarehouse(param).then(response => {
this.warehouseOptions = response.rows;
});
},
/** 打开选择物资弹窗 */
handleSelectMaterials() {
this.materialDialog = true;
this.getMaterialList();
if (!this.formData.warehouseId) {
this.$modal.msgError(this.$t('checkCreate.warehouseRequired'));
return;
}
if (!this.formData.checkType){
this.$modal.msgError(this.$t('checkCreate.documentTypeRequired'));
return;
}
if (this.formData.checkType==='1'){
this.materialDialogByProduct = true;
// 设置查询参数中的仓库ID为主表选择的仓库
this.queryParams.warehouseId = this.formData.warehouseId;
this.getMaterialList();
}else if (this.formData.checkType==='2'){
this.materialDialogByTrayCode = true;
// 设置查询参数中的仓库ID为主表选择的仓库
this.queryParams.warehouseId = this.formData.warehouseId;
this.getMaterialByTrayCodeList();
}
},
/** 获取物资列表 */
getMaterialList() {
this.materialLoading = true;
listProductAndStock(this.queryParams).then(response => {
this.materialOptions = response.rows;
this.materialLoading = false;
});
if (this.formData.checkType==='1'){
listProductAndStock(this.queryParams).then(response => {
this.materialOptions = response.rows;
this.materialLoading = false;
});
}
},
/* 获取托盘物资列表*/
getMaterialByTrayCodeList(){
this.trayLoading = true;
if (this.formData.checkType==='2'){
this.trayQueryParams.warehouseId = this.formData.warehouseId;
this.trayQueryParams.status = 2;
listCargoSpace(this.trayQueryParams).then(response => {
this.trayOptions = response.rows;
this.trayLoading = false;
});
}
},
/** 物资选择变更 */
handleSelectionChange(selection) {
this.selectedMaterials = selection;
},
/** 托盘选择变更 */
handleTraySelectionChange(selection) {
this.selectedTrays = selection;
},
/** 托盘行点击事件 */
handleRowClick(row) {
if (this.formData.checkType === '2' && row.trayCode) {
const params = {
pageNum: 1,
pageSize: 10,
trayCode: row.trayCode,
warehouseId: this.formData.warehouseId
};
listManagement(params).then(response => {
this.trayDetailList = response.rows;
this.trayDetailVisible = true;
});
}
},
/** 确认选择物资 */
confirmSelectMaterials() {
if (this.formData.checkType === '1') {
this.confirmSelectMaterialsByProduct();
} else if (this.formData.checkType === '2') {
this.confirmSelectMaterialsByTray();
}
},
/** 确认选择物料物资 */
confirmSelectMaterialsByProduct() {
if (this.selectedMaterials.length === 0) {
this.$modal.msgError(this.$t('checkCreate.selectMaterialRequired'));
return;
@@ -227,45 +358,87 @@
productGuId: item.productGuid,
productName: item.productName,
quantity: item.quantity,
quantityOrignal: item.quantity,
lotNo: item.lotNo,
onlyIdentity: item.onlyIdentity,
warehouseId: item.warehouseId,
warehouseName: item.warehouseName
warehouseName: item.warehouseName,
cargoSpaceId: item.cargoSpaceId,
cargoSpaceName: item.cargoSpaceName
}))
);
this.materialDialog = false;
this.materialDialogByProduct = false;
this.selectedMaterials = [];
},
/** 确认选择托盘物资 */
confirmSelectMaterialsByTray() {
if (this.selectedTrays.length === 0) {
this.$modal.msgError(this.$t('checkCreate.selectTrayRequired'));
return;
}
// 过滤掉已经存在的托盘
const newTrays = this.selectedTrays.filter(item => {
return !this.materialList.some(existing => existing.trayCode === item.trayCode);
});
if (newTrays.length === 0) {
this.$modal.msgWarning(this.$t('checkCreate.trayExistWarning'));
return;
}
this.materialList = this.materialList.concat(
newTrays.map(item => ({
trayCode: item.trayCode,
warehouseId: item.warehouseId,
warehouseName: item.warehouseName,
spare1: item.cargoSpaceId,
cargoSpaceName: item.cargoSpaceName
}))
);
this.materialDialogByTrayCode = false;
this.selectedTrays = [];
},
/** 取消选择物资 */
cancelSelectMaterials() {
this.selectedMaterials = [];
this.materialDialog = false;
if (this.formData.checkType === '1') {
this.cancelSelectMaterialsByProduct();
} else if (this.formData.checkType === '2') {
this.cancelSelectMaterialsByTray();
}
},
/** 搜索按钮操作 */
/** 取消选择物料物资 */
cancelSelectMaterialsByProduct() {
this.selectedMaterials = [];
this.materialDialogByProduct = false;
},
/** 取消选择托盘物资 */
cancelSelectMaterialsByTray() {
this.selectedTrays = [];
this.materialDialogByTrayCode = false;
},
/** 物资搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getMaterialList();
},
/** 重置按钮操作 */
/** 物资重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
/** 托盘搜索按钮操作 */
handleTrayQuery() {
this.trayQueryParams.pageNum = 1;
this.getMaterialByTrayCodeList();
},
/** 托盘重置按钮操作 */
resetTrayQuery() {
this.resetForm("trayQueryForm");
this.handleTrayQuery();
},
/** 删除物资 */
handleDelete(index) {
this.materialList.splice(index, 1);
},
/** 数量变更 */
handleQuantityChange(row) {
// 如果没有初始数量,则设置初始数量
// 如果修改后的数量大于初始数量,给出提示并重置为当前值
if (row.quantity > row.quantityOrignal) {
this.$modal.msgError(this.$t('checkCreate.quantityExceedError'));
row.quantity = row.quantityOrignal;
}
},
/** 保存单据 */
handleSave() {
this.$refs.formRef.validate(valid => {
@@ -288,6 +461,17 @@
}
});
},
/** 单据类型变更处理 */
handleCheckTypeChange(value) {
if (this.materialList.length > 0) {
this.$modal.msgWarning(this.$t('checkCreate.cannotChangeTypeWithMaterials'));
this.$nextTick(() => {
this.formData.checkType = this.oldCheckType;
});
return;
}
this.oldCheckType = value;
},
/** 重置数据 */
reset() {
this.formData = {
@@ -300,7 +484,7 @@
/** 重新建单 */
handleReload() {
this.$tab.refreshPage(this.$route);
}
},
}
};
</script>

View File

@@ -172,6 +172,17 @@
v-hasPermi="['check:stockCheck:edit']"
>{{$t('checkStockCheck.review')}}</el-button> <!-- 单据审核 -->
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-edit"
size="mini"
:disabled="single"
@click="handleAutoAllocation"
v-hasPermi="['check:stockCheck:autoAllocation']"
>{{$t('checkStockCheck.autoAllocation')}}</el-button> <!-- 自动分配 -->
</el-col>
<el-col :span="1.5">
<el-button
type="success"
@@ -184,6 +195,8 @@
>{{$t('checkStockCheck.confirm')}}</el-button> <!-- 单据确认 -->
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
@@ -223,6 +236,7 @@
<el-table-column :label="$t('checkStockCheck.detailId')" align="center" prop="stockCheckDetailId" /> <!-- 子单ID -->
<!-- <el-table-column label="主单GUID" align="center" prop="stockCheckGuid" /> -->
<el-table-column :label="$t('checkStockCheck.mainId')" align="center" prop="stockCheckId" /> <!-- 主单ID -->
<el-table-column :label="$t('checkStockCheck.cargoSpaceName')" align="center" prop="cargoSpaceName" /> <!-- 货位名称 -->
<el-table-column :label="$t('checkStockCheck.lotNo')" align="center" prop="lotNo"/> <!-- 批次号 -->
<!-- <el-table-column label="物料ID" align="center" prop="productGuid"/>-->
<el-table-column :label="$t('checkStockCheck.productId')" align="center" prop="productId"/> <!-- 物料编码 -->
@@ -504,6 +518,9 @@ export default {
this.$modal.msgError(this.$t('checkStockCheck.onlyReviewedCanConfirm'))
}
},
handleAutoAllocation(row){
}
}
}
</script>