655 lines
22 KiB
Vue
655 lines
22 KiB
Vue
<template>
|
||
<div class="app-container">
|
||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
||
<el-form-item :label="$t('checkStockCheck.stockCheckId')" prop="stockCheckId"> <!-- 盘点单据ID -->
|
||
<el-input
|
||
v-model="queryParams.stockCheckId"
|
||
:placeholder="$t('checkStockCheck.inputStockCheckId')"
|
||
clearable
|
||
@keyup.enter.native="handleQuery"
|
||
/>
|
||
</el-form-item>
|
||
<el-form-item :label="$t('checkStockCheck.checkType')" prop="checkType"> <!-- 盘库类型 -->
|
||
<el-select v-model="queryParams.checkType" :placeholder="$t('checkStockCheck.selectCheckType')" clearable>
|
||
<el-option
|
||
v-for="dict in dict.type.check_stock_type"
|
||
:key="dict.value"
|
||
:label="dict.label"
|
||
:value="dict.value"
|
||
/>
|
||
</el-select>
|
||
</el-form-item>
|
||
<el-form-item :label="$t('checkStockCheck.status')" prop="status"> <!-- 状态 -->
|
||
<el-select v-model="queryParams.status" :placeholder="$t('checkStockCheck.selectStatus')" clearable>
|
||
<el-option
|
||
v-for="dict in dict.type.check_bill_status"
|
||
:key="dict.value"
|
||
:label="dict.label"
|
||
:value="dict.value"
|
||
/>
|
||
</el-select>
|
||
</el-form-item>
|
||
<!-- <el-form-item label="建立时间" prop="createDate">
|
||
<el-input
|
||
v-model="queryParams.createDate"
|
||
placeholder="请输入建立时间"
|
||
clearable
|
||
@keyup.enter.native="handleQuery"
|
||
/>
|
||
</el-form-item>
|
||
<el-form-item label="创建人" prop="createManId">
|
||
<el-input
|
||
v-model="queryParams.createManId"
|
||
placeholder="请输入创建人"
|
||
clearable
|
||
@keyup.enter.native="handleQuery"
|
||
/>
|
||
</el-form-item>-->
|
||
<el-form-item :label="$t('checkStockCheck.warehouse')" prop="warehouseId"> <!-- 仓库 -->
|
||
<el-select v-model="queryParams.warehouseId" :placeholder="$t('checkStockCheck.selectWarehouse')" clearable>
|
||
<el-option
|
||
v-for="item in warehouseOptions"
|
||
:key="item.warehouseId"
|
||
:label="item.warehouseName"
|
||
:value="item.warehouseId"
|
||
/>
|
||
</el-select>
|
||
</el-form-item>
|
||
<!-- <el-form-item label=" 完成日期" prop="finishDate">
|
||
<el-input
|
||
v-model="queryParams.finishDate"
|
||
placeholder="请输入 完成日期"
|
||
clearable
|
||
@keyup.enter.native="handleQuery"
|
||
/>
|
||
</el-form-item>
|
||
<el-form-item label="erp单号" prop="erpBill">
|
||
<el-input
|
||
v-model="queryParams.erpBill"
|
||
placeholder="请输入erp单号"
|
||
clearable
|
||
@keyup.enter.native="handleQuery"
|
||
/>
|
||
</el-form-item>
|
||
<el-form-item label="单据来源" prop="stockSource">
|
||
<el-input
|
||
v-model="queryParams.stockSource"
|
||
placeholder="请输入单据来源"
|
||
clearable
|
||
@keyup.enter.native="handleQuery"
|
||
/>
|
||
</el-form-item>
|
||
<el-form-item label="客户编码" prop="customerNo">
|
||
<el-input
|
||
v-model="queryParams.customerNo"
|
||
placeholder="请输入客户编码"
|
||
clearable
|
||
@keyup.enter.native="handleQuery"
|
||
/>
|
||
</el-form-item>
|
||
<el-form-item label="班组编码" prop="classNo">
|
||
<el-input
|
||
v-model="queryParams.classNo"
|
||
placeholder="请输入班组编码"
|
||
clearable
|
||
@keyup.enter.native="handleQuery"
|
||
/>
|
||
</el-form-item>
|
||
<el-form-item label="供应商编码" prop="supplierNo">
|
||
<el-input
|
||
v-model="queryParams.supplierNo"
|
||
placeholder="请输入供应商编码"
|
||
clearable
|
||
@keyup.enter.native="handleQuery"
|
||
/>
|
||
</el-form-item>
|
||
<el-form-item label="备用字段1" prop="spare1">
|
||
<el-input
|
||
v-model="queryParams.spare1"
|
||
placeholder="请输入备用字段1"
|
||
clearable
|
||
@keyup.enter.native="handleQuery"
|
||
/>
|
||
</el-form-item>
|
||
<el-form-item label="备用字段2" prop="spare2">
|
||
<el-input
|
||
v-model="queryParams.spare2"
|
||
placeholder="请输入备用字段2"
|
||
clearable
|
||
@keyup.enter.native="handleQuery"
|
||
/>
|
||
</el-form-item>
|
||
<el-form-item label="备用字段3" prop="spare3">
|
||
<el-input
|
||
v-model="queryParams.spare3"
|
||
placeholder="请输入备用字段3"
|
||
clearable
|
||
@keyup.enter.native="handleQuery"
|
||
/>
|
||
</el-form-item>
|
||
<el-form-item label="备用字段4" prop="spare4">
|
||
<el-input
|
||
v-model="queryParams.spare4"
|
||
placeholder="请输入备用字段4"
|
||
clearable
|
||
@keyup.enter.native="handleQuery"
|
||
/>
|
||
</el-form-item>
|
||
<el-form-item label="备用字段5" prop="spare5">
|
||
<el-input
|
||
v-model="queryParams.spare5"
|
||
placeholder="请输入备用字段5"
|
||
clearable
|
||
@keyup.enter.native="handleQuery"
|
||
/>
|
||
</el-form-item>-->
|
||
<el-form-item>
|
||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">{{$t('checkStockCheck.search')}}</el-button> <!-- 搜索 -->
|
||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">{{$t('checkStockCheck.reset')}}</el-button> <!-- 重置 -->
|
||
</el-form-item>
|
||
</el-form>
|
||
|
||
<el-row :gutter="10" class="mb8">
|
||
<el-col :span="1.5">
|
||
<el-button
|
||
type="danger"
|
||
plain
|
||
icon="el-icon-delete"
|
||
size="mini"
|
||
:disabled="multiple"
|
||
@click="handleInvalidated"
|
||
v-hasPermi="['check:stockCheck:edit']"
|
||
>{{$t('checkStockCheck.invalidate')}}</el-button> <!-- 单据作废 -->
|
||
</el-col>
|
||
<el-col :span="1.5">
|
||
<el-button
|
||
type="primary"
|
||
plain
|
||
icon="el-icon-plus"
|
||
size="mini"
|
||
:disabled="single"
|
||
@click="handleReview"
|
||
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"
|
||
plain
|
||
icon="el-icon-edit"
|
||
size="mini"
|
||
:disabled="single"
|
||
@click="handleConfirmation"
|
||
v-hasPermi="['check:stockCheck:edit']"
|
||
>{{$t('checkStockCheck.confirm')}}</el-button> <!-- 单据确认 -->
|
||
</el-col>
|
||
|
||
|
||
|
||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||
</el-row>
|
||
|
||
<el-table v-loading="loading" :data="stockCheckList" @selection-change="handleSelectionChange" @row-click="handleRowClick">
|
||
<el-table-column type="selection" width="55" align="center" />
|
||
<el-table-column :label="$t('checkStockCheck.stockCheckId')" align="left" prop="stockCheckId" /> <!-- 盘点单据ID -->
|
||
<el-table-column :label="$t('checkStockCheck.checkType')" align="left" prop="checkType"> <!-- 盘库类型 -->
|
||
<template slot-scope="scope">
|
||
<dict-tag :options="dict.type.check_stock_type" :value="scope.row.checkType"/>
|
||
</template>
|
||
</el-table-column>
|
||
|
||
<el-table-column :label="$t('checkStockCheck.status')" align="left" prop="status" > <!-- 单据状态 -->
|
||
<template slot-scope="scope">
|
||
<dict-tag :options="dict.type.check_bill_status" :value="scope.row.status"/>
|
||
</template>
|
||
</el-table-column>
|
||
<el-table-column :label="$t('checkStockCheck.warehouseId')" align="left" prop="warehouseName" /> <!-- 仓库ID -->
|
||
<el-table-column :label="$t('checkStockCheck.departmentName')" align="left" prop="departmentName" /> <!-- 部门编码 -->
|
||
<el-table-column :label="$t('checkStockCheck.createManId')" align="left" prop="createManId" /> <!-- 创建人 -->
|
||
<el-table-column :label="$t('checkStockCheck.checkPort')" align="left" prop="spare1" /> <!-- 盘点位置 -->
|
||
<el-table-column :label="$t('checkStockCheck.createDate')" align="left" prop="createDate" /> <!-- 建立时间 -->
|
||
<el-table-column :label="$t('checkStockCheck.finishDate')" align="left" prop="finishDate" /> <!-- 完成日期 -->
|
||
</el-table>
|
||
|
||
<pagination
|
||
v-show="total>0"
|
||
:total="total"
|
||
:page.sync="queryParams.pageNum"
|
||
:limit.sync="queryParams.pageSize"
|
||
@pagination="getList"
|
||
/>
|
||
|
||
<el-table v-loading="detailLoading" :data="stockCheckDetailList" @selection-change="handleDetailSelectionChange">
|
||
<el-table-column :label="$t('checkStockCheck.detailId')" align="left" prop="stockCheckDetailId" /> <!-- 子单ID -->
|
||
<el-table-column :label="$t('checkStockCheck.mainId')" align="left" prop="stockCheckId" /> <!-- 主单ID -->
|
||
<el-table-column :label="$t('checkStockCheck.cargoSpaceName')" align="left" prop="cargoSpaceName" /> <!-- 货位名称 -->
|
||
<el-table-column :label="$t('checkStockCheck.productId')" align="left" prop="productId"/> <!-- 物料编码 -->
|
||
<el-table-column :label="$t('checkStockCheck.materialDesc')" align="left" prop="extraField.materialDesc"/> <!-- 物料描述 -->
|
||
<el-table-column :label="$t('checkStockCheck.englishDesc')" align="left" prop="extraField.englishDesc"/> <!-- 英文描述 -->
|
||
<el-table-column :label="$t('checkStockCheck.quantity')" align="right" prop="quantity"/> <!-- 计划数量 -->
|
||
<el-table-column :label="$t('checkStockCheck.scanNum')" align="right" prop="scanNum"/> <!-- 扫码数量 -->
|
||
<el-table-column :label="$t('checkStockCheck.assignNum')" align="right" prop="assignNum"/> <!-- 实际数量 -->
|
||
</el-table>
|
||
|
||
<pagination
|
||
v-show="detailTotal>0"
|
||
:total="detailTotal"
|
||
:page.sync="queryDetailParams.pageNum"
|
||
:limit.sync="queryDetailParams.pageSize"
|
||
@pagination="getDetailList"
|
||
/>
|
||
|
||
<!-- 审核弹窗 -->
|
||
<el-dialog title="$t('outStockoutManage.auditTitle')" :visible.sync="auditDialogVisible" width="500px" append-to-body>
|
||
<el-form ref="auditForm" :model="auditForm" :rules="auditRules" label-width="100px">
|
||
<el-form-item label="$t('outStockoutManage.selectExit')" prop="exitId">
|
||
<el-select v-model="auditForm.exitId" placeholder="$t('outStockoutManage.pleaseSelectExit')" clearable style="width: 100%">
|
||
<el-option
|
||
v-for="item in exitOptions"
|
||
:key="item.exitId"
|
||
:label="item.exitName"
|
||
:value="item.exitId">
|
||
</el-option>
|
||
</el-select>
|
||
</el-form-item>
|
||
</el-form>
|
||
<div slot="footer" class="dialog-footer">
|
||
<el-button @click="cancelAudit">{{$t('outStockoutManage.cancelExit')}}</el-button>
|
||
<el-button type="primary" @click="submitAudit">{{$t('outStockoutManage.confirmExit')}}</el-button>
|
||
</div>
|
||
</el-dialog>
|
||
</div>
|
||
</template>
|
||
|
||
<script>
|
||
import { listStockCheck, getStockCheck, delStockCheck, addStockCheck, updateStockCheck,autoAllocation } from "@/api/check/stockCheck"
|
||
import { listStockCheckDetail } from "@/api/check/stockCheckDetail"
|
||
import { listWarehouse } from "@/api/bas/warehouse"
|
||
|
||
export default {
|
||
name: "StockCheck",
|
||
dicts: ['check_stock_type', 'check_bill_status'],
|
||
data() {
|
||
return {
|
||
// 遮罩层
|
||
loading: true,
|
||
// 选中数组
|
||
ids: [],
|
||
// 非单个禁用
|
||
single: true,
|
||
// 非多个禁用
|
||
multiple: true,
|
||
// 显示搜索条件
|
||
showSearch: true,
|
||
// 总条数
|
||
total: 0,
|
||
// 仓库选项列表
|
||
warehouseOptions: [],
|
||
// 盘库单据主信息表格数据
|
||
stockCheckList: [],
|
||
// 弹出层标题
|
||
title: "",
|
||
// 是否显示弹出层
|
||
open: false,
|
||
// 明细遮罩层
|
||
detailLoading: false,
|
||
// 明细选中数组
|
||
detailIds: [],
|
||
// 明细总条数
|
||
detailTotal: 0,
|
||
// 明细表格数据
|
||
stockCheckDetailList: [],
|
||
// 选中数据
|
||
selectedRows: [],
|
||
// 审核弹窗显示状态
|
||
auditDialogVisible: false,
|
||
// 审核表单数据
|
||
auditForm: {
|
||
exitId: null
|
||
},
|
||
// 审核表单验证规则
|
||
auditRules: {
|
||
exitId: [
|
||
{ required: true, message: '请选择出口', trigger: 'change' }
|
||
]
|
||
},
|
||
// 出口选项(动态设置)
|
||
exitOptions: [],
|
||
// 所有出口数据(按仓库ID分组)
|
||
allExitOptions: {
|
||
'02': [
|
||
{ exitId: "G1004", exitName: 'G1004' },
|
||
{ exitId: 'G1010', exitName: 'G1010' },
|
||
{ exitId: 'fluent1', exitName: 'fluent1' },
|
||
{ exitId: 'fluent2', exitName: 'fluent2' },
|
||
],
|
||
'13': [
|
||
{ exitId: 'G2001', exitName: 'G2001' },
|
||
{ exitId: 'G3001', exitName: 'G3001' },
|
||
{ exitId: 'G3010', exitName: 'G3010' },
|
||
{ exitId: 'G4001', exitName: 'G4001' },
|
||
{ exitId: 'G4010', exitName: 'G4010' },
|
||
{ exitId: 'G5001', exitName: 'G5001' },
|
||
{ exitId: 'G5010', exitName: 'G5010' },
|
||
]
|
||
},
|
||
// 当前审核的单据
|
||
currentAuditStock: null,
|
||
// 明细查询参数
|
||
queryDetailParams: {
|
||
pageNum: 1,
|
||
pageSize: 10,
|
||
stockCheckGuid: null,
|
||
status: null
|
||
},
|
||
// 查询参数
|
||
queryParams: {
|
||
pageNum: 1,
|
||
pageSize: 10,
|
||
stockCheckId: null,
|
||
checkType: null,
|
||
createDate: null,
|
||
createManId: null,
|
||
status: '1',
|
||
warehouseId: null,
|
||
finishDate: null,
|
||
erpBill: null,
|
||
stockSource: null,
|
||
departmentNo: null,
|
||
customerNo: null,
|
||
classNo: null,
|
||
supplierNo: null,
|
||
spare1: null,
|
||
spare2: null,
|
||
spare3: null,
|
||
spare4: null,
|
||
spare5: null
|
||
},
|
||
// 表单参数
|
||
form: {},
|
||
// 表单校验
|
||
rules: {
|
||
stockCheckId: [
|
||
{ required: true, message: this.$t('checkStockCheck.stockCheckIdRequired'), trigger: "blur" }
|
||
],
|
||
checkType: [
|
||
{ required: true, message: this.$t('checkStockCheck.checkTypeRequired'), trigger: "change" }
|
||
],
|
||
createDate: [
|
||
{ required: true, message: this.$t('checkStockCheck.createDateRequired'), trigger: "blur" }
|
||
],
|
||
status: [
|
||
{ required: true, message: this.$t('checkStockCheck.statusRequired'), trigger: "change" }
|
||
],
|
||
}
|
||
}
|
||
},
|
||
created() {
|
||
this.getList();
|
||
this.getWarehouseList();
|
||
},
|
||
methods: {
|
||
/** 行点击事件处理 */
|
||
handleRowClick(row) {
|
||
this.queryDetailParams.stockCheckGuid = row.stockGuid
|
||
this.queryDetailParams.status = row.status
|
||
this.getDetailList()
|
||
},
|
||
/** 查询盘库单据主信息列表 */
|
||
getList() {
|
||
this.loading = true
|
||
listStockCheck(this.queryParams).then(response => {
|
||
this.stockCheckList = response.rows
|
||
this.total = response.total
|
||
this.loading = false
|
||
// 获取列表后,自动点击第一行数据
|
||
if (this.stockCheckList.length > 0) {
|
||
this.handleRowClick(this.stockCheckList[0])
|
||
}
|
||
})
|
||
},
|
||
/** 查询仓库列表 */
|
||
getWarehouseList() {
|
||
listWarehouse().then(response => {
|
||
this.warehouseOptions = response.rows;
|
||
});
|
||
},
|
||
/** 查询明细列表 */
|
||
getDetailList() {
|
||
this.detailLoading = true
|
||
listStockCheckDetail(this.queryDetailParams).then(response => {
|
||
this.stockCheckDetailList = response.rows
|
||
this.detailTotal = response.total
|
||
this.detailLoading = false
|
||
})
|
||
},
|
||
/** 明细多选框选中数据 */
|
||
handleDetailSelectionChange(selection) {
|
||
this.detailIds = selection.map(item => item.stockCheckDetailId)
|
||
},
|
||
// 取消按钮
|
||
cancel() {
|
||
this.open = false
|
||
this.reset()
|
||
},
|
||
// 表单重置
|
||
reset() {
|
||
this.form = {
|
||
stockGuid: null,
|
||
stockCheckId: null,
|
||
checkType: null,
|
||
createDate: null,
|
||
createManId: null,
|
||
status: null,
|
||
warehouseId: null,
|
||
finishDate: null,
|
||
erpBill: null,
|
||
stockSource: null,
|
||
departmentNo: null,
|
||
customerNo: null,
|
||
classNo: null,
|
||
supplierNo: null,
|
||
spare1: null,
|
||
spare2: null,
|
||
spare3: null,
|
||
spare4: null,
|
||
spare5: null
|
||
}
|
||
this.resetForm("form")
|
||
},
|
||
/** 搜索按钮操作 */
|
||
handleQuery() {
|
||
this.queryParams.pageNum = 1
|
||
this.getList()
|
||
},
|
||
/** 重置按钮操作 */
|
||
resetQuery() {
|
||
this.resetForm("queryForm")
|
||
this.handleQuery()
|
||
},
|
||
// 多选框选中数据
|
||
handleSelectionChange(selection) {
|
||
this.ids = selection.map(item => item.stockGuid)
|
||
this.single = selection.length!==1
|
||
this.multiple = !selection.length
|
||
if (selection.length === 1) {
|
||
this.queryDetailParams.stockCheckGuid = selection[0].stockGuid
|
||
this.queryDetailParams.status = selection[0].status
|
||
this.getDetailList()
|
||
} else {
|
||
this.queryDetailParams.stockCheckGuid = null
|
||
this.stockCheckDetailList = []
|
||
this.detailTotal = 0
|
||
}
|
||
},
|
||
|
||
|
||
/** 提交按钮 */
|
||
submitForm() {
|
||
this.$refs["form"].validate(valid => {
|
||
if (valid) {
|
||
if (this.form.stockGuid != null) {
|
||
updateStockCheck(this.form).then(response => {
|
||
this.$modal.msgSuccess(this.$t('checkStockCheck.editSuccess'))
|
||
this.open = false
|
||
this.getList()
|
||
})
|
||
} else {
|
||
addStockCheck(this.form).then(response => {
|
||
this.$modal.msgSuccess(this.$t('checkStockCheck.addSuccess'))
|
||
this.open = false
|
||
this.getList()
|
||
})
|
||
}
|
||
}
|
||
})
|
||
},
|
||
/** 作废按钮操作 */
|
||
handleInvalidated(row) {
|
||
let stockCheck = this.stockCheckList.find(item => item.stockGuid === (row.stockGuid || this.ids[0]));
|
||
if (stockCheck.status === "1") {
|
||
let data = {
|
||
"stockGuid": stockCheck.stockGuid,
|
||
"status": "5"
|
||
}
|
||
updateStockCheck(data).then(response => {
|
||
this.$modal.msgSuccess(this.$t('checkStockCheck.invalidateSuccess'))
|
||
this.getList()
|
||
})
|
||
} else {
|
||
this.$modal.msgError(this.$t('checkStockCheck.onlyUnreviewedCanInvalidate'))
|
||
}
|
||
},
|
||
/** 审核按钮操作 */
|
||
handleReview(row) {
|
||
let stockCheck = this.stockCheckList.find(item => item.stockGuid === (row?.stockGuid || this.ids[0]));
|
||
if (stockCheck.status === "2") {
|
||
this.$modal.msgError(this.$t('checkStockCheck.alreadyReviewed'))
|
||
return
|
||
}
|
||
if (stockCheck.status === "1") {
|
||
// 保存当前审核的单据
|
||
this.currentAuditStock = stockCheck
|
||
// 根据单据的仓库ID设置出口选项
|
||
this.setExitOptionsByWarehouse(stockCheck.warehouseId)
|
||
// 显示审核弹窗
|
||
this.auditDialogVisible = true
|
||
this.auditForm.exitId = null
|
||
} else {
|
||
this.$modal.msgError(this.$t('checkStockCheck.onlyUnreviewedCanReview'))
|
||
}
|
||
},
|
||
/** 确认按钮操作 */
|
||
handleConfirmation(row) {
|
||
let stockCheck = this.stockCheckList.find(item => item.stockGuid === (row?.stockGuid || this.ids[0]));
|
||
if (stockCheck.status === "3") {
|
||
let data = {
|
||
"stockGuid": stockCheck.stockGuid,
|
||
"status": "4"
|
||
}
|
||
updateStockCheck(data).then(response => {
|
||
this.$modal.msgSuccess(this.$t('checkStockCheck.confirmSuccess'))
|
||
this.getList()
|
||
})
|
||
} else {
|
||
this.$modal.msgError(this.$t('checkStockCheck.onlyReviewedCanConfirm'))
|
||
}
|
||
},
|
||
handleAutoAllocation(row){
|
||
|
||
if (this.ids.length !== 1){
|
||
this.$modal.msgError(this.$t('checkStockCheck.onlyOneCanAutoAllocation'))
|
||
}
|
||
|
||
const stockCheckData = {
|
||
"stockGuid": this.ids[0]
|
||
}
|
||
autoAllocation(stockCheckData).then(response => {
|
||
this.$modal.msgSuccess(this.$t('checkStockCheck.autoAllocationSuccess'))
|
||
this.getList()
|
||
})
|
||
},
|
||
|
||
/** 根据仓库ID设置出口选项 */
|
||
setExitOptionsByWarehouse(warehouseId) {
|
||
try {
|
||
console.log('设置出口选项,仓库ID:', warehouseId)
|
||
|
||
// 如果没有有效的仓库ID,清空出口选项
|
||
if (!warehouseId) {
|
||
this.exitOptions = []
|
||
console.warn('没有找到有效的仓库ID,已清空出口选项')
|
||
return
|
||
}
|
||
|
||
// 根据仓库ID获取对应的出口选项
|
||
this.exitOptions = this.allExitOptions[warehouseId] || []
|
||
|
||
// 如果没有对应key的默认为空数组,并给出提示
|
||
if (!this.allExitOptions[warehouseId]) {
|
||
console.warn(`仓库ID ${warehouseId} 没有配置出口选项,已设置为空数组`)
|
||
}
|
||
|
||
console.log('可用出口:', this.exitOptions)
|
||
|
||
// 如果最终没有可用的出口选项,给出提示
|
||
if (this.exitOptions.length === 0) {
|
||
//console.warn('当前仓库没有可用的出口选项')
|
||
this.exitOptions=[{exitId: '0', exitName: '人工出口'}]
|
||
}
|
||
|
||
} catch (error) {
|
||
console.error('设置出口选项时发生错误:', error)
|
||
// 发生错误时,设置为空数组,确保不会影响用户操作
|
||
this.exitOptions = []
|
||
}
|
||
},
|
||
|
||
/** 提交审核 */
|
||
submitAudit() {
|
||
this.$refs["auditForm"].validate(valid => {
|
||
if (valid) {
|
||
const data = {
|
||
"stockGuid": this.currentAuditStock.stockGuid,
|
||
"status": "2",
|
||
"spare1": this.auditForm.exitId // 将选择的出口数据放入spare1字段
|
||
}
|
||
console.log('审核数据(含出口信息):', data)
|
||
|
||
updateStockCheck(data).then(response => {
|
||
this.$modal.msgSuccess(this.$t('checkStockCheck.reviewSuccess'))
|
||
this.auditDialogVisible = false
|
||
this.getList()
|
||
})
|
||
}
|
||
})
|
||
},
|
||
|
||
/** 取消审核 */
|
||
cancelAudit() {
|
||
this.auditDialogVisible = false
|
||
this.auditForm.exitId = null
|
||
this.currentAuditStock = null
|
||
}
|
||
}
|
||
}
|
||
</script>
|
||
<style scoped>
|
||
.el-form-item >>> .el-form-item__label {
|
||
white-space: nowrap;
|
||
width: auto;
|
||
min-width: fit-content;
|
||
}
|
||
</style>
|