入库逻辑修改
This commit is contained in:
@@ -67,4 +67,13 @@ export function confirmationStockIn(data) {
|
||||
})
|
||||
}
|
||||
|
||||
// 退料入库
|
||||
export function productBack(data) {
|
||||
return request({
|
||||
url: '/in/stockIn/productBack',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -50,3 +50,12 @@ export function barcodePrinting(data) {
|
||||
data:data
|
||||
})
|
||||
}
|
||||
|
||||
// 批量修改入库单据子表
|
||||
export function updateStockInDetailBatch(data) {
|
||||
return request({
|
||||
url: '/in/stockInDetail/updateBatch',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
@@ -54,3 +54,12 @@ export function updateOutJobPriority(data) {
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 货位出库生成任务
|
||||
export function cargoSpaceOut(params) {
|
||||
return request({
|
||||
url: '/job/outmydoJob/cargoSpaceOut',
|
||||
method: 'get',
|
||||
params: params
|
||||
})
|
||||
}
|
||||
|
||||
@@ -435,7 +435,9 @@ export default {
|
||||
/** 获取子单据列表 */
|
||||
getDetailList(stockinId) {
|
||||
this.detailLoading = true;
|
||||
this.queryDetailParams.stockinId = stockinId;
|
||||
if (typeof stockinId === 'string' || typeof stockinId === 'number') {
|
||||
this.queryDetailParams.stockinId = stockinId;
|
||||
}
|
||||
this.queryDetailParams.status = this.queryParams.status;
|
||||
listStockInDetail(this.queryDetailParams).then(response => {
|
||||
this.stockInDetailList = response.rows;
|
||||
@@ -445,13 +447,7 @@ export default {
|
||||
},
|
||||
//主单点击触发事件
|
||||
handleRowClick(selection) {
|
||||
this.detailLoading = true;
|
||||
this.queryDetailParams.stockinId = selection.stockinId;
|
||||
listStockInDetail(this.queryDetailParams).then(response => {
|
||||
this.stockInDetailList = response.rows;
|
||||
this.detailTotal = response.total;
|
||||
this.detailLoading = false;
|
||||
});
|
||||
this.getDetailList(selection.stockinId);
|
||||
},
|
||||
// 删除子单据按钮操作
|
||||
handleStockinDetailDelete(row) {
|
||||
|
||||
@@ -1,196 +1,176 @@
|
||||
<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="入库单据" prop="stockinGuid"><!--入库订单ID-->
|
||||
<el-input
|
||||
v-model="queryParams.stockinGuid"
|
||||
placeholder="请输入入库单据编码"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="物料名称" prop="materialDesc"><!--物料描述-->
|
||||
<el-input
|
||||
v-model="queryParams.materialDesc"
|
||||
placeholder="请输入物料名称"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<div class="app-container" style="background-color: #f0f2f5; padding: 20px; min-height: calc(100vh - 84px);">
|
||||
<!-- 查询区域卡片 -->
|
||||
<el-card shadow="never" style="margin-bottom: 15px; border: none;">
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px" style="margin-bottom: -15px;">
|
||||
<el-form-item label="入库单据" prop="stockinGuid">
|
||||
<el-input v-model="queryParams.stockinGuid" placeholder="请输入入库单据编码" clearable @keyup.enter.native="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="物料名称" prop="materialDesc">
|
||||
<el-input v-model="queryParams.materialDesc" placeholder="请输入物料名称" clearable @keyup.enter.native="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="入库类型" prop="inType">
|
||||
<el-select v-model="queryParams.inType" placeholder="请选择入库类型" clearable>
|
||||
<el-option v-for="dict in dict.type.in_bill_type" :key="dict.value" :label="dict.label" :value="dict.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="单据状态" prop="status">
|
||||
<el-select v-model="queryParams.status" placeholder="请选择单据状态">
|
||||
<el-option v-for="dict in dict.type.in_bill_status" :key="dict.value" :label="dict.label" :value="dict.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
|
||||
<el-form-item label="入库类型" prop="inType"><!--入库类型-->
|
||||
<el-select v-model="queryParams.inType" placeholder="请选择入库类型" clearable>
|
||||
<el-option
|
||||
v-for="dict in dict.type.in_bill_type"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="单据状态" prop="status"><!--单据状态-->
|
||||
<el-select v-model="queryParams.status" placeholder="请选择单据状态" >
|
||||
<el-option
|
||||
v-for="dict in dict.type.in_bill_status"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button><!--搜索-->
|
||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button><!--重置-->
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<!-- 主表区域卡片 -->
|
||||
<el-card shadow="never" style="margin-bottom: 15px; border: none;">
|
||||
<div slot="header" class="clearfix">
|
||||
<span style="font-weight: bold; color: #333;">主单列表</span>
|
||||
<div style="float: right;">
|
||||
<el-button type="danger" plain icon="el-icon-delete" size="mini" :disabled="single" @click="handleInvalidated" v-hasPermi="['in:stockIn:edit']">单据作废</el-button>
|
||||
<el-button type="primary" plain icon="el-icon-plus" size="mini" :disabled="single" @click="handleReview" v-hasPermi="['in:stockIn:edit']">单据审核</el-button>
|
||||
<el-button type="success" plain icon="el-icon-edit" size="mini" :disabled="single" @click="handleConfirmation" v-hasPermi="['in:stockIn:edit']">单据确认</el-button>
|
||||
<el-button type="info" plain icon="el-icon-download" size="mini" :disabled="detailMultiple" @click="handleBarcodePrinting" v-hasPermi="['in:stockIn:barcodePrinting']">打印条码</el-button>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList" style="margin-left: 10px;"></right-toolbar>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="danger"
|
||||
plain
|
||||
icon="el-icon-delete"
|
||||
size="mini"
|
||||
:disabled="single"
|
||||
@click="handleInvalidated"
|
||||
v-hasPermi="['in:stockIn:edit']"
|
||||
>单据作废<!--单据作废-->
|
||||
</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="['in:stockIn:edit']"
|
||||
>单据审核<!--单据审核-->
|
||||
</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="['in:stockIn:edit']"
|
||||
>单据确认<!--单据确认-->
|
||||
</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="info"
|
||||
plain
|
||||
icon="el-icon-download"
|
||||
size="mini"
|
||||
:disabled="detailMultiple"
|
||||
@click="handleBarcodePrinting"
|
||||
v-hasPermi="['in:stockIn:barcodePrinting']"
|
||||
>打印条码<!--打印条码-->
|
||||
</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
<el-table v-loading="loading" :data="stockInList" @selection-change="handleSelectionChange"
|
||||
@row-click="handleRowClick" max-height="300" border highlight-current-row :row-class-name="tableRowClassName">
|
||||
<el-table-column type="selection" width="55" align="center"/>
|
||||
<el-table-column label="入库订单" align="left" prop="stockinId" width="150"/>
|
||||
<el-table-column label="入库类型" align="left" prop="inType">
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="dict.type.in_bill_type" :value="scope.row.inType"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="单据状态" align="left" prop="status">
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="dict.type.in_bill_status" :value="scope.row.status"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="上位单号" align="left" prop="erpBill" width="150"/>
|
||||
<el-table-column label="仓库" align="left" prop="warehouseName"/>
|
||||
<el-table-column label="部门" align="left" prop="departmentName"/>
|
||||
<el-table-column label="建立时间" align="left" prop="createDate" width="160"/>
|
||||
<el-table-column label="备注" align="left" prop="spare5" show-overflow-tooltip/>
|
||||
</el-table>
|
||||
|
||||
<el-table v-loading="loading" :data="stockInList" @selection-change="handleSelectionChange"
|
||||
@row-click="handleRowClick" max-height="400">
|
||||
<el-table-column type="selection" width="55" align="center"/>
|
||||
<el-table-column label="GUID" align="center" prop="stockinGuid" v-if="false"/>
|
||||
<el-table-column label="入库订单" align="left" prop="stockinId" width="150"/><!--入库订单-->
|
||||
<el-table-column label="入库类型" align="left" prop="inType"><!--入库类型-->
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="dict.type.in_bill_type" :value="scope.row.inType"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="单据状态" align="left" prop="status"><!--单据状态-->
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="dict.type.in_bill_status" :value="scope.row.status"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="单据来源" align="left" prop="stockSource"><!--单据来源-->
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="dict.type.bill_resource" :value="scope.row.stockSource"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="上位单号" align="left" prop="erpBill" width="150"/><!--入库订单-->
|
||||
<el-table-column label="仓库" align="left" prop="warehouseName"/><!--仓库-->
|
||||
<el-table-column label="创建人" align="left" prop="createManName"/><!--创建人-->
|
||||
<el-table-column label="部门" align="left" prop="departmentName"/><!--部门-->
|
||||
<el-table-column label="建立时间" align="left" prop="createDate" width="160"/><!--建立时间-->
|
||||
<el-table-column label="完成日期" align="left" prop="finishDate" width="160"/><!--完成日期-->
|
||||
<el-table-column label="备注" align="left" prop="spare5"/><!--备注-->
|
||||
</el-table>
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
style="padding: 10px 0 0 0;"
|
||||
/>
|
||||
</el-card>
|
||||
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
<!-- 子表区域卡片 -->
|
||||
<el-card shadow="never" style="border: none;" v-if="queryDetailParams.stockinId">
|
||||
<div slot="header" class="clearfix">
|
||||
<span style="font-weight: bold; color: #333;">
|
||||
子单明细 <span style="font-weight: normal; color: #999; font-size: 13px; margin-left: 10px;">(当前主单: {{ queryDetailParams.stockinId }})</span>
|
||||
</span>
|
||||
<div style="float: right; display: flex; align-items: center;">
|
||||
<el-button type="primary" size="mini" icon="el-icon-check" @click="handleBatchSave" v-hasPermi="['in:stockIn:edit']">暂存子单明细</el-button>
|
||||
<div style="width: 1px; height: 20px; background: #eee; margin: 0 15px;"></div>
|
||||
<el-input v-model="batchTrayCode" placeholder="批量条码" size="mini" style="width: 120px; margin-right: 5px;" clearable />
|
||||
<el-button type="warning" size="mini" icon="el-icon-copy-document" @click="handleBatchFillTrayCode">批量填充</el-button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<el-table v-loading="detailLoading" :data="stockInDetailList" @selection-change="handleDetailSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="子单ID" align="left" prop="stockinDetailId" width="160"/><!--子单ID-->
|
||||
<el-table-column label="主单ID" align="left" prop="stockinId" width="160"/><!--主单ID-->
|
||||
<el-table-column label="合同号" align="left" prop="spare6"/>
|
||||
<el-table-column label="产品号" align="left" prop="spare7"/>
|
||||
<el-table-column label="代号" align="left" prop="spare9"/>
|
||||
<el-table-column label="台次" align="left" prop="spare5"/>
|
||||
<el-table-column label="物料编码" align="left" prop="productId"/><!--物料编码-->
|
||||
<el-table-column label="物料名称" align="left" prop="productName" width="160"/><!--物料编码-->
|
||||
<el-table-column label="供应商" align="left" prop="supplierName" width="160"/><!--供应商-->
|
||||
<el-table-column label="规格型号" align="left" prop="spec" width="160"/>
|
||||
<el-table-column label="计划数量" align="right" prop="quantity"/><!--计划数量-->
|
||||
<el-table-column label="扫码数量" align="right" prop="scanNum"/><!--扫码数量-->
|
||||
<el-table-column label="实际数量" align="right" prop="assignNum"/><!--实际数量-->
|
||||
<el-table
|
||||
v-loading="detailLoading"
|
||||
:data="stockInDetailList"
|
||||
@selection-change="handleDetailSelectionChange"
|
||||
row-key="stockinDetailId"
|
||||
max-height="500"
|
||||
class="detail-table"
|
||||
border
|
||||
:row-class-name="detailTableRowClassName"
|
||||
>
|
||||
<el-table-column type="expand">
|
||||
<template slot-scope="props">
|
||||
<div class="tray-manage-box">
|
||||
<div class="tray-header">
|
||||
<i class="el-icon-info"></i> 托盘分配管理
|
||||
<el-button type="text" icon="el-icon-plus" @click="addTray(props.row)" style="margin-left: 20px;">添加托盘</el-button>
|
||||
</div>
|
||||
<el-table :data="props.row.trayList" size="mini" border stripe style="width: 100%; margin-top: 10px;">
|
||||
<el-table-column label="托盘条码" prop="trayCode">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="scope.row.trayCode" placeholder="请输入托盘码" size="mini" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="分盘数量" prop="quantity" width="180">
|
||||
<template slot-scope="scope">
|
||||
<el-input-number v-model="scope.row.quantity" :min="1" size="mini" @change="calculateAssignNum(props.row)" style="width: 130px;" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="存放位置" prop="location">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="scope.row.location" placeholder="请输入存放位置" size="mini" clearable />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="80" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="text" icon="el-icon-delete" @click="removeTray(props.row, scope.$index)" style="color: #F56C6C">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="合同号" align="left" prop="spare6" width="120"/>
|
||||
<el-table-column label="代号" align="left" prop="spare9" width="100"/>
|
||||
<el-table-column label="台次" align="left" prop="spare5" width="80"/>
|
||||
<el-table-column label="物料编码" align="left" prop="productId" width="120"/>
|
||||
<el-table-column label="物料名称" align="left" prop="productName" show-overflow-tooltip/>
|
||||
<el-table-column label="计划数量" align="center" prop="quantity" width="100"/>
|
||||
<el-table-column label="实际数量" align="center" width="120">
|
||||
<template slot-scope="scope">
|
||||
<b :style="{color: scope.row.assignNum > scope.row.quantity ? '#F56C6C' : '#409EFF'}">{{ scope.row.assignNum }}</b>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="托盘明细 (条码/数量/位置)" align="left" min-width="250">
|
||||
<template slot-scope="scope">
|
||||
<div v-if="scope.row.trayList && scope.row.trayList.length > 0" class="tray-summary-list">
|
||||
<el-tag
|
||||
v-for="(tray, index) in scope.row.trayList"
|
||||
:key="index"
|
||||
size="mini"
|
||||
type="success"
|
||||
effect="light"
|
||||
class="tray-summary-tag"
|
||||
>
|
||||
<i class="el-icon-receiving"></i>
|
||||
<b>{{ tray.trayCode || '无条码' }}</b>
|
||||
<span class="qty-split">|</span>
|
||||
<span style="color: #67C23A">{{ tray.quantity }}</span>
|
||||
<span v-if="tray.location" class="loc-split">-</span>
|
||||
<span v-if="tray.location" class="loc-text">{{ tray.location }}</span>
|
||||
</el-tag>
|
||||
</div>
|
||||
<el-tag v-else size="mini" type="info" effect="plain">未分配托盘</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<!-- <el-table-column label="生产图号" align="left" prop="cargoNo" />-->
|
||||
<!-- <el-table-column label="单位" align="left" prop="unit" />-->
|
||||
<!-- <el-table-column label="来源" align="left" prop="spare1"><!–来源–>
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="dict.type.origin_type" :value="scope.row.spare1"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="状态" align="left" prop="spare2">
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="dict.type.turnover_type" :value="scope.row.spare2"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="套账" align="left" prop="spare3"><!–套账–>
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="dict.type.account_type" :value="scope.row.spare3"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="用途" align="left" prop="spare4"><!–用途–>
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="dict.type.purpose_type" :value="scope.row.spare4"/>
|
||||
</template>
|
||||
</el-table-column>-->
|
||||
|
||||
|
||||
<!-- <el-table-column label="批次" align="left" prop="lotNo"/>-->
|
||||
<!-- <el-table-column label="单价" align="left" prop="price"/>-->
|
||||
|
||||
<!-- <el-table-column label="质量" align="left" prop="spare8"><!–用途–>
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="dict.type.quality_type" :value="scope.row.spare8"/>
|
||||
</template>
|
||||
</el-table-column>-->
|
||||
|
||||
|
||||
</el-table>
|
||||
<pagination
|
||||
v-show="detailTotal>0"
|
||||
:total="detailTotal"
|
||||
:page.sync="queryDetailParams.pageNum"
|
||||
:limit.sync="queryDetailParams.pageSize"
|
||||
@pagination="getDetailList"
|
||||
/>
|
||||
<pagination
|
||||
v-show="detailTotal>0"
|
||||
:total="detailTotal"
|
||||
:page.sync="queryDetailParams.pageNum"
|
||||
:limit.sync="queryDetailParams.pageSize"
|
||||
@pagination="getDetailList"
|
||||
style="padding: 10px 0 0 0;"
|
||||
/>
|
||||
</el-card>
|
||||
|
||||
<!-- 绑定托盘对话框 -->
|
||||
<el-dialog :title="'绑定托盘'" :visible.sync="bindOpen" width="600px" append-to-body>
|
||||
@@ -239,7 +219,7 @@
|
||||
|
||||
<script>
|
||||
import {confirmationStockIn, invalidatedStockIn, listStockIn, reviewStockIn} from "@/api/in/stockIn"
|
||||
import {listStockInDetail} from "@/api/in/stockInDetail"
|
||||
import {listStockInDetail, updateStockInDetailBatch} from "@/api/in/stockInDetail"
|
||||
import {listWarehouse} from "@/api/bas/warehouse";
|
||||
import vueEasyPrint from 'vue-easy-print'
|
||||
import VueQr from 'vue-qr'
|
||||
@@ -308,6 +288,8 @@ export default {
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 批量填充托盘条码
|
||||
batchTrayCode: '',
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
@@ -541,34 +523,190 @@ export default {
|
||||
}, 100)
|
||||
})
|
||||
},
|
||||
/** 批量填充托盘条码 */
|
||||
handleBatchFillTrayCode() {
|
||||
if (!this.batchTrayCode) {
|
||||
this.$modal.msgWarning("请输入批量托盘条码");
|
||||
return;
|
||||
}
|
||||
if (this.stockInDetailListSelected.length === 0) {
|
||||
this.$modal.msgWarning("请选择要填充的子单据");
|
||||
return;
|
||||
}
|
||||
// 批量填充逻辑:为每个选中行添加或设置一个托盘,数量默认为计划数量或剩余数量
|
||||
this.stockInDetailList.forEach((item, index) => {
|
||||
if (this.stockInDetailListSelected.some(selected => selected.stockinDetailId === item.stockinDetailId)) {
|
||||
// 如果没有 trayList,初始化
|
||||
if (!item.trayList) {
|
||||
this.$set(this.stockInDetailList[index], 'trayList', []);
|
||||
}
|
||||
const remain = Math.max(0, (item.quantity || 0) - (item.assignNum || 0));
|
||||
// 查找是否已有该托盘,没有则添加,有则更新数量
|
||||
const existingTray = item.trayList.find(t => t.trayCode === this.batchTrayCode);
|
||||
if (!existingTray) {
|
||||
item.trayList.push({
|
||||
trayCode: this.batchTrayCode,
|
||||
quantity: remain, // 默认填入剩余计划数量
|
||||
location: ''
|
||||
});
|
||||
} else {
|
||||
existingTray.quantity = (existingTray.quantity || 0) + remain;
|
||||
}
|
||||
this.calculateAssignNum(item);
|
||||
}
|
||||
});
|
||||
this.$modal.msgSuccess("填充成功");
|
||||
},
|
||||
/** 添加托盘行 */
|
||||
addTray(row) {
|
||||
if (!row.trayList) {
|
||||
this.$set(row, 'trayList', []);
|
||||
}
|
||||
const remain = Math.max(0, (row.quantity || 0) - (row.assignNum || 0));
|
||||
row.trayList.push({
|
||||
trayCode: '',
|
||||
quantity: remain,
|
||||
location: ''
|
||||
});
|
||||
this.calculateAssignNum(row);
|
||||
},
|
||||
/** 删除托盘行 */
|
||||
removeTray(row, index) {
|
||||
row.trayList.splice(index, 1);
|
||||
this.calculateAssignNum(row);
|
||||
},
|
||||
/** 计算合计实际数量 */
|
||||
calculateAssignNum(row) {
|
||||
if (!row.trayList) return;
|
||||
const total = row.trayList.reduce((sum, tray) => sum + (tray.quantity || 0), 0);
|
||||
this.$set(row, 'assignNum', total);
|
||||
},
|
||||
/** 批量保存子单修改 */
|
||||
handleBatchSave() {
|
||||
if (this.stockInDetailList.length === 0) {
|
||||
this.$modal.msgWarning('没有子单数据可以保存')
|
||||
return
|
||||
}
|
||||
this.$modal.confirm('是否确认保存当前所有子单的修改?').then(() => {
|
||||
return updateStockInDetailBatch(this.stockInDetailList)
|
||||
}).then(() => {
|
||||
this.$modal.msgSuccess('保存成功')
|
||||
this.getDetailList(this.queryDetailParams.stockinId)
|
||||
}).catch(() => {
|
||||
})
|
||||
},
|
||||
getDetailList(stockinId) {
|
||||
this.detailLoading = true;
|
||||
this.queryDetailParams.stockinId = stockinId;
|
||||
if (typeof stockinId === 'string' || typeof stockinId === 'number') {
|
||||
this.queryDetailParams.stockinId = stockinId;
|
||||
}
|
||||
this.queryDetailParams.status = this.queryParams.status;
|
||||
listStockInDetail(this.queryDetailParams).then(response => {
|
||||
this.stockInDetailList = response.rows;
|
||||
this.stockInDetailList = response.rows.map(item => {
|
||||
const trayList = item.trayList || [];
|
||||
const assignNum = trayList.reduce((sum, tray) => sum + (tray.quantity || 0), 0);
|
||||
return {
|
||||
...item,
|
||||
trayList: trayList,
|
||||
assignNum: assignNum // 初始化合计数量
|
||||
};
|
||||
});
|
||||
this.detailTotal = response.total;
|
||||
this.detailLoading = false;
|
||||
});
|
||||
},
|
||||
handleRowClick(selection) {
|
||||
this.detailLoading = true;
|
||||
this.queryDetailParams.stockinId = selection.stockinId;
|
||||
listStockInDetail(this.queryDetailParams).then(response => {
|
||||
this.stockInDetailList = response.rows;
|
||||
this.detailTotal = response.total;
|
||||
this.detailLoading = false;
|
||||
});
|
||||
this.getDetailList(selection.stockinId);
|
||||
},
|
||||
/** 主单列表行高亮 */
|
||||
tableRowClassName({row, rowIndex}) {
|
||||
if (this.queryDetailParams.stockinId === row.stockinId) {
|
||||
return 'current-row';
|
||||
}
|
||||
return '';
|
||||
},
|
||||
/** 子单列表行颜色 */
|
||||
detailTableRowClassName({row, rowIndex}) {
|
||||
if (rowIndex % 2 === 0) {
|
||||
return 'detail-row-even';
|
||||
} else {
|
||||
return 'detail-row-odd';
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.detail-table >>> .detail-row-even {
|
||||
background-color: #f0f9ff !important;
|
||||
}
|
||||
.detail-table >>> .detail-row-odd {
|
||||
background-color: #ffffff !important;
|
||||
}
|
||||
/* 每一行底部增加分割线,增强组的感觉 */
|
||||
.detail-table >>> .el-table__row > td {
|
||||
border-bottom: 2px solid #e6ebf5 !important;
|
||||
}
|
||||
/* 展开行底部及左侧增加粗边框,强化组的感觉 */
|
||||
.detail-table >>> .el-table__expanded-cell {
|
||||
border-bottom: 3px solid #409EFF !important;
|
||||
border-left: 5px solid #409EFF !important;
|
||||
padding: 10px 50px !important;
|
||||
}
|
||||
/* 确保展开行背景色同步父行 */
|
||||
.detail-table >>> .detail-row-even + tr > .el-table__expanded-cell {
|
||||
background-color: #f0f9ff !important;
|
||||
}
|
||||
.detail-table >>> .detail-row-odd + tr > .el-table__expanded-cell {
|
||||
background-color: #ffffff !important;
|
||||
}
|
||||
.tray-manage-box {
|
||||
padding: 15px 20px;
|
||||
background-color: #ffffff;
|
||||
border: 1px solid #409EFF;
|
||||
border-radius: 4px;
|
||||
margin: 10px 0;
|
||||
box-shadow: 0 4px 12px 0 rgba(64, 158, 255, 0.2);
|
||||
}
|
||||
.tray-header {
|
||||
font-size: 14px;
|
||||
font-weight: bold;
|
||||
color: #606266;
|
||||
margin-bottom: 10px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
.tray-header i {
|
||||
margin-right: 5px;
|
||||
color: #409EFF;
|
||||
}
|
||||
/* 托盘明细摘要样式 */
|
||||
.tray-summary-list {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 4px;
|
||||
}
|
||||
.tray-summary-tag {
|
||||
border-radius: 4px;
|
||||
padding: 0 8px;
|
||||
height: 24px;
|
||||
line-height: 22px;
|
||||
}
|
||||
.qty-split {
|
||||
margin: 0 5px;
|
||||
color: #dcdfe6;
|
||||
}
|
||||
.loc-split {
|
||||
margin: 0 4px;
|
||||
color: #909399;
|
||||
}
|
||||
.loc-text {
|
||||
font-weight: normal;
|
||||
color: #909399;
|
||||
}
|
||||
.el-form-item >>> .el-form-item__label {
|
||||
white-space: nowrap;
|
||||
width: auto;
|
||||
min-width: fit-content;
|
||||
font-weight: bold;
|
||||
}
|
||||
/* 打印样式 */
|
||||
.vue-easy-print {
|
||||
|
||||
408
ruoyi-ui/src/views/out/cargoSpaceOut.vue
Normal file
408
ruoyi-ui/src/views/out/cargoSpaceOut.vue
Normal file
@@ -0,0 +1,408 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" :label-width="labelWidthForSearch">
|
||||
|
||||
|
||||
<el-form-item label="巷道" prop="roadwayId">
|
||||
<el-input
|
||||
v-model="queryParams.roadwayId"
|
||||
placeholder="请输入巷道"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<!-- 排 -->
|
||||
<el-form-item label="排" prop="thePlatoon">
|
||||
<el-input
|
||||
v-model="queryParams.thePlatoon"
|
||||
placeholder="请输入排"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<!-- 列 -->
|
||||
<el-form-item label="列" prop="theColumn">
|
||||
<el-input
|
||||
v-model="queryParams.theColumn"
|
||||
placeholder="请输入列"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<!-- 层 -->
|
||||
<el-form-item label="层" prop="theFloor">
|
||||
<el-input
|
||||
v-model="queryParams.theFloor"
|
||||
placeholder="请输入层"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item>
|
||||
<!-- 【查询】按钮 -->
|
||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
icon="el-icon-download"
|
||||
size="mini"
|
||||
:disabled="multiple"
|
||||
@click="handleCargoSpaceOut(1)"
|
||||
v-hasPermi="['job:outmydoJob:cargoSpaceOut']"
|
||||
>指定出库</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
icon="el-icon-download"
|
||||
size="mini"
|
||||
:disabled="multiple"
|
||||
@click="handleCargoSpaceOut(1)"
|
||||
v-hasPermi="['job:outmydoJob:cargoSpaceOut1']"
|
||||
>入库端出库</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="warning"
|
||||
plain
|
||||
icon="el-icon-download"
|
||||
size="mini"
|
||||
:disabled="multiple"
|
||||
@click="handleCargoSpaceOut(2)"
|
||||
v-hasPermi="['job:outmydoJob:cargoSpaceOut2']"
|
||||
>出库端出库</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="cargoSpaceList" @selection-change="handleSelectionChange" max-height="650">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<!-- 货位ID -->
|
||||
<el-table-column label="货位编号" align="left" prop="cargoSpaceId" />
|
||||
<!-- 仓库名称 -->
|
||||
<!-- <el-table-column label="仓库名称" align="left" prop="warehouseName" />-->
|
||||
<el-table-column label="巷道ID" align="left" prop="roadwayId" />
|
||||
<!-- 货位名称 -->
|
||||
<el-table-column label="货位名称" align="center" prop="cargoSpaceName" />
|
||||
<!-- 排 -->
|
||||
<el-table-column label="排" align="left" prop="thePlatoon" />
|
||||
<!-- 列 -->
|
||||
<el-table-column label="列" align="left" prop="theColumn" />
|
||||
<!-- 层 -->
|
||||
<el-table-column label="层" align="left" prop="theFloor" />
|
||||
<!-- 货位编码 -->
|
||||
<el-table-column label="货位状态" align="left" prop="status" >
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="dict.type.cargo_space_status" :value="scope.row.status"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- 是否锁定 -->
|
||||
<el-table-column label="锁定状态" align="left" prop="locked" >
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="dict.type.cargo_space_lock_status" :value="scope.row.locked"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- 托盘编码 -->
|
||||
<el-table-column label="托盘编号" align="left" prop="trayCode" />
|
||||
<!-- 货物高度 -->
|
||||
<el-table-column label="货物高度(MM)" align="left" prop="cargoHight" />
|
||||
<!-- 货物重量 -->
|
||||
<el-table-column label="货位重量(KG)" align="left" prop="theType" />
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listCargoSpace, getCargoSpace, delCargoSpace, addCargoSpace, updateCargoSpace } from "@/api/bas/cargoSpace"
|
||||
import { listWarehouse } from "@/api/bas/warehouse"
|
||||
import { cargoSpaceOut } from "@/api/job/OutmydoJob"
|
||||
|
||||
export default {
|
||||
name: "CargoSpace",
|
||||
dicts:['cargo_space_status','cargo_space_lock_status'],
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 选中行数据
|
||||
selection: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 库存信息表格数据
|
||||
cargoSpaceList: [],
|
||||
warehouseOptions:[],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
warehouseId: null,
|
||||
roadwayId: null,
|
||||
cargoAreaId: null,
|
||||
theType: null,
|
||||
theTypeName: null,
|
||||
cargoSpaceName: null,
|
||||
cargoSpaceId: null,
|
||||
thePlatoon: null,
|
||||
theColumn: null,
|
||||
theFloor: null,
|
||||
status: null,
|
||||
locked: null,
|
||||
trayCode: null,
|
||||
cargoHight: null,
|
||||
issDouble: null,
|
||||
groupCodingNo: null,
|
||||
groupCoding: null,
|
||||
cargoSpaceLogo: null,
|
||||
thisCargoArea: null
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {
|
||||
cargoSpaceId: [
|
||||
// 校验---货位ID是否为空
|
||||
{ required: true, message: "请输入货位编号", trigger: "blur" }
|
||||
],
|
||||
warehouseId: [
|
||||
// 校验---仓库是否为空
|
||||
{ required: true, message: "请选择仓库", trigger: "change" }
|
||||
],
|
||||
cargoSpaceName: [
|
||||
// 校验---货位名称是否为空
|
||||
{ required: true, message: "请输入货位名称", trigger: "blur" }
|
||||
],
|
||||
thePlatoon: [
|
||||
// 校验---排是否为空
|
||||
{ required: true, message: "请输入排号", trigger: "blur" }
|
||||
],
|
||||
theColumn: [
|
||||
// 校验---列是否为空
|
||||
{ required: true, message: "请输入列号", trigger: "blur" }
|
||||
],
|
||||
theFloor: [
|
||||
// 校验---层是否为空
|
||||
{ required: true, message: "请输入层号", trigger: "blur" }
|
||||
],
|
||||
status: [
|
||||
// 校验---货位状态是否为空
|
||||
{ required: true, message: "请选择货位状态", trigger: "change" }
|
||||
],
|
||||
locked: [
|
||||
// 校验---锁定状态是否为空
|
||||
{ required: true, message: "请选择锁定状态", trigger: "change" }
|
||||
],
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.loading = false
|
||||
},
|
||||
methods: {
|
||||
/** 获取仓库列表 */
|
||||
getWarehouseList() {
|
||||
listWarehouse().then(response => {
|
||||
this.warehouseOptions = response.rows;
|
||||
});
|
||||
},
|
||||
/** 查询库存信息列表 */
|
||||
getList() {
|
||||
this.loading = true
|
||||
listCargoSpace(this.queryParams).then(response => {
|
||||
this.cargoSpaceList = response.rows
|
||||
this.total = response.total
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false
|
||||
this.reset()
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {
|
||||
cargoSpaceId: null,
|
||||
warehouseId: null,
|
||||
roadwayId: null,
|
||||
cargoAreaId: null,
|
||||
theType: null,
|
||||
theTypeName: null,
|
||||
cargoSpaceName: null,
|
||||
thePlatoon: null,
|
||||
theColumn: null,
|
||||
theFloor: null,
|
||||
status: null,
|
||||
locked: null,
|
||||
trayCode: null,
|
||||
cargoHight: null,
|
||||
issDouble: null,
|
||||
groupCodingNo: null,
|
||||
groupCoding: null,
|
||||
cargoSpaceLogo: null,
|
||||
thisCargoArea: null
|
||||
}
|
||||
this.resetForm("form")
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1
|
||||
this.getList()
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.resetForm("queryForm")
|
||||
//this.handleQuery()
|
||||
this.cargoSpaceList = []
|
||||
this.total = 0
|
||||
this.loading = false
|
||||
|
||||
},
|
||||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map(item => item.cargoSpaceId)
|
||||
this.selection = selection
|
||||
this.single = selection.length!==1
|
||||
this.multiple = !selection.length
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.reset()
|
||||
this.open = true
|
||||
this.title = "新增货位"
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.reset()
|
||||
const cargoSpaceId = row.cargoSpaceId || this.ids
|
||||
getCargoSpace(cargoSpaceId).then(response => {
|
||||
this.form = response.data
|
||||
this.open = true
|
||||
this.title = "修改货位"
|
||||
})
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
// 检查cargoSpaceId是否存在且不为空
|
||||
if (this.form.cargoSpaceId && this.form.cargoSpaceId.trim() !== '') {
|
||||
// 检查数据库中是否存在该ID的记录
|
||||
getCargoSpace(this.form.cargoSpaceId).then(response => {
|
||||
// 检查返回的数据是否为null或空对象
|
||||
if (response.data && response.data.cargoSpaceId) {
|
||||
// 如果能获取到有效数据,说明记录存在,调用修改方法
|
||||
updateCargoSpace(this.form).then(response => {
|
||||
this.$modal.msgSuccess("修改成功")
|
||||
this.open = false
|
||||
this.getList()
|
||||
})
|
||||
} else {
|
||||
// 如果返回数据为空,说明记录不存在,调用新增方法
|
||||
addCargoSpace(this.form).then(response => {
|
||||
this.$modal.msgSuccess("新增成功")
|
||||
this.open = false
|
||||
this.getList()
|
||||
})
|
||||
}
|
||||
}).catch(() => {
|
||||
// 如果请求失败,调用新增方法
|
||||
addCargoSpace(this.form).then(response => {
|
||||
this.$modal.msgSuccess("新增成功")
|
||||
this.open = false
|
||||
this.getList()
|
||||
})
|
||||
})
|
||||
} else {
|
||||
// 如果cargoSpaceId为空,直接调用新增方法
|
||||
addCargoSpace(this.form).then(response => {
|
||||
this.$modal.msgSuccess("新增成功")
|
||||
this.open = false
|
||||
this.getList()
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const cargoSpaceIds = row.cargoSpaceId || this.ids
|
||||
this.$modal.confirm('确认要删除货位编号为 "' + cargoSpaceIds + '" 的货位吗?').then(function() {
|
||||
return delCargoSpace(cargoSpaceIds)
|
||||
}).then(() => {
|
||||
this.getList()
|
||||
this.$modal.msgSuccess("删除成功")
|
||||
}).catch(() => {})
|
||||
},
|
||||
/** 生成任务接口 */
|
||||
handleCargoSpaceOut(exitId) {
|
||||
if (!this.selection || this.selection.length === 0) {
|
||||
this.$modal.msgError("请至少选择一个货位");
|
||||
return;
|
||||
}
|
||||
|
||||
const promises = this.selection.map(row => {
|
||||
const params = {
|
||||
warehouseId: row.warehouseId,
|
||||
exitId: exitId,
|
||||
cargoSpaceId: row.cargoSpaceId
|
||||
};
|
||||
return cargoSpaceOut(params);
|
||||
});
|
||||
|
||||
Promise.all(promises).then(() => {
|
||||
this.$modal.msgSuccess("出库任务生成成功");
|
||||
this.getList();
|
||||
}).catch(err => {
|
||||
// 错误处理通常由拦截器完成,这里可以根据需要补充
|
||||
});
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
labelWidthForSearch() {
|
||||
const lang = this.$i18n.locale;
|
||||
return lang.startsWith('en') ? '84px' : '68px';
|
||||
},
|
||||
labelWidthForFunction() {
|
||||
const lang = this.$i18n.locale;
|
||||
return lang.startsWith('en') ? '150px' : '120px';
|
||||
}
|
||||
},
|
||||
}
|
||||
</script>
|
||||
<style scoped>
|
||||
/* 统一表单控件宽度 */
|
||||
.el-select,
|
||||
.el-input {
|
||||
width: 100%;
|
||||
}
|
||||
</style>
|
||||
409
ruoyi-ui/src/views/out/outJobFlow.vue
Normal file
409
ruoyi-ui/src/views/out/outJobFlow.vue
Normal file
@@ -0,0 +1,409 @@
|
||||
<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="合同号" prop="contract">
|
||||
<el-input
|
||||
v-model="queryParams.contract"
|
||||
placeholder="请输入合同号"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="产品号" prop="cases">
|
||||
<el-input
|
||||
v-model="queryParams.cases"
|
||||
placeholder="请输入产品号"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="代号" prop="managementNo">
|
||||
<el-input
|
||||
v-model="queryParams.managementNo"
|
||||
placeholder="请输入代号"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="台次" prop="units">
|
||||
<el-input
|
||||
v-model="queryParams.units"
|
||||
placeholder="请输入台次"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="托盘条码" prop="trayCode">
|
||||
<el-input
|
||||
v-model="queryParams.trayCode"
|
||||
placeholder="请输入托盘条码"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="物料名称" prop="productName">
|
||||
<el-input
|
||||
v-model="queryParams.productName"
|
||||
placeholder="请输入物料名称"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="起始时间" prop="dateStart">
|
||||
<el-date-picker clearable
|
||||
v-model="queryParams.dateStart"
|
||||
type="datetime"
|
||||
value-format="yyyy-MM-dd HH:mm:ss"
|
||||
placeholder="请选择起始时间">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="结束日期" prop="dateEnd">
|
||||
<el-date-picker clearable
|
||||
v-model="queryParams.dateEnd"
|
||||
type="datetime"
|
||||
value-format="yyyy-MM-dd HH:mm:ss"
|
||||
placeholder="请选择结束日期">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
icon="el-icon-plus"
|
||||
size="mini"
|
||||
:disabled="multiple"
|
||||
@click="handleCreateReturnStockIn"
|
||||
>生成退料入库单</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="ViewOutJobFlowList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<!-- <el-table-column label="仓库编码" align="center" prop="warehouseId" />-->
|
||||
<el-table-column label="子任务" align="center" prop="jobDetailId" width="160"/>
|
||||
<el-table-column label="任务编码" align="center" prop="jobId" width="160"/>
|
||||
<el-table-column label="单据编码" align="center" prop="inOrOutId" width="160"/>
|
||||
<el-table-column label="子单据编码" align="center" prop="inOrOutDId" width="160" />
|
||||
<el-table-column label="任务号" align="center" prop="taskNo" />
|
||||
<el-table-column label="状态" align="center" prop="status">
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="dict.type.sys_job_status" :value="scope.row.status"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="任务类型" align="center" prop="inOrOut" width="160">
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="dict.type.out_job_type" :value="scope.row.inOrOut"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="托盘码" align="center" prop="trayCode" width="160"/>
|
||||
<el-table-column label="出口" align="center" prop="exitId">
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="dict.type.exit_type" :value="scope.row.exitId"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="合同号" align="center" prop="contract" />
|
||||
<el-table-column label="产品号" align="center" prop="cases" />
|
||||
<el-table-column label="代号" align="center" prop="managementNo" />
|
||||
<el-table-column label="台次" align="center" prop="units" />
|
||||
<el-table-column label="物料编码" align="center" prop="productId" />
|
||||
<el-table-column label="物料名称" align="center" prop="productName" width="160"/>
|
||||
<el-table-column label="规格" align="center" prop="spec" width="160"/>
|
||||
<el-table-column label="出库数量" align="center" prop="outQuantity" />
|
||||
<el-table-column label="创建时间" align="center" prop="createTime" width="160"/>
|
||||
<el-table-column label="开始时间" align="center" prop="startTime" width="160"/>
|
||||
<el-table-column label="结束时间" align="center" prop="finishTime" width="160"/>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
<!-- 退料入库单生成弹窗 -->
|
||||
<el-dialog title="生成退料入库单" :visible.sync="returnStockInOpen" width="1000px" append-to-body>
|
||||
<el-table :data="returnStockInList">
|
||||
<el-table-column label="合同号" align="center" prop="contract" />
|
||||
<el-table-column label="产品号" align="center" prop="cases" />
|
||||
<el-table-column label="代号" align="center" prop="managementNo" />
|
||||
<el-table-column label="台次" align="center" prop="units" />
|
||||
<el-table-column label="物料编码" align="center" prop="productId" />
|
||||
<el-table-column label="物料名称" align="center" prop="productName" />
|
||||
<el-table-column label="数量" align="center" prop="outQuantity">
|
||||
<template slot-scope="scope">
|
||||
<el-input-number v-model="scope.row.outQuantity" :min="1" size="small" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitReturnStockIn">提 交</el-button>
|
||||
<el-button @click="returnStockInOpen = false">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
addViewOutJobFlow,
|
||||
delViewOutJobFlow,
|
||||
getViewOutJobFlow,
|
||||
listViewOutJobFlow,
|
||||
updateViewOutJobFlow
|
||||
} from "@/api/search/ViewOutJobFlow"
|
||||
import { productBack } from "@/api/in/stockIn"
|
||||
|
||||
export default {
|
||||
name: "ViewOutJobFlow",
|
||||
dicts: ['product_type', 'turnover_type', 'exit_type', 'quality_type', 'purpose_type', 'sys_job_status', 'product_status', 'sys_yes_no', 'account_type', 'out_job_type'],
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 出库作业流水Controller表格数据
|
||||
ViewOutJobFlowList: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 退料入库单弹窗控制
|
||||
returnStockInOpen: false,
|
||||
// 退料入库单表格数据
|
||||
returnStockInList: [],
|
||||
// 选中行原始数据
|
||||
selectedRows: [],
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
jobDetailId: null,
|
||||
jobId: null,
|
||||
taskNo: null,
|
||||
status: null,
|
||||
inOrOut: null,
|
||||
trayCode: null,
|
||||
startTime: null,
|
||||
finishTime: null,
|
||||
exitId: null,
|
||||
warehouseId: null,
|
||||
productId: null,
|
||||
productName: null,
|
||||
parentId: null,
|
||||
price: null,
|
||||
cargoNo: null,
|
||||
unit: null,
|
||||
spec: null,
|
||||
productType: null,
|
||||
systemItem: null,
|
||||
productCtm: null,
|
||||
productCtu: null,
|
||||
upperNum: null,
|
||||
limitNum: null,
|
||||
enableFlag: null,
|
||||
outQuantity: null,
|
||||
lotNo: null,
|
||||
inOrOutId: null,
|
||||
inOrOutDId: null,
|
||||
priceTotal: null,
|
||||
origin: null,
|
||||
turnovertype: null,
|
||||
account: null,
|
||||
purpose: null,
|
||||
units: null,
|
||||
contract: null,
|
||||
cases: null,
|
||||
quality: null,
|
||||
managementNo: null,
|
||||
dateStart: null,
|
||||
dateEnd: null,
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {
|
||||
taskNo: [
|
||||
{ required: true, message: "任务号不能为空", trigger: "blur" }
|
||||
],
|
||||
status: [
|
||||
{ required: true, message: "状态不能为空", trigger: "change" }
|
||||
],
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getList()
|
||||
},
|
||||
methods: {
|
||||
/** 查询出库作业流水Controller列表 */
|
||||
getList() {
|
||||
this.loading = true
|
||||
listViewOutJobFlow(this.queryParams).then(response => {
|
||||
this.ViewOutJobFlowList = response.rows
|
||||
this.total = response.total
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false
|
||||
this.reset()
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {
|
||||
jobDetailId: null,
|
||||
jobId: null,
|
||||
taskNo: null,
|
||||
status: null,
|
||||
inOrOut: null,
|
||||
trayCode: null,
|
||||
createTime: null,
|
||||
startTime: null,
|
||||
finishTime: null,
|
||||
exitId: null,
|
||||
warehouseId: null,
|
||||
productId: null,
|
||||
productName: null,
|
||||
parentId: null,
|
||||
price: null,
|
||||
cargoNo: null,
|
||||
unit: null,
|
||||
spec: null,
|
||||
remark: null,
|
||||
productType: null,
|
||||
systemItem: null,
|
||||
productCtm: null,
|
||||
productCtu: null,
|
||||
upperNum: null,
|
||||
limitNum: null,
|
||||
enableFlag: null,
|
||||
outQuantity: null,
|
||||
lotNo: null,
|
||||
inOrOutId: null,
|
||||
inOrOutDId: null,
|
||||
priceTotal: null,
|
||||
origin: null,
|
||||
turnovertype: null,
|
||||
account: null,
|
||||
purpose: null,
|
||||
units: null,
|
||||
contract: null,
|
||||
cases: null,
|
||||
quality: null,
|
||||
managementNo: 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.jobDetailId)
|
||||
this.selectedRows = selection
|
||||
this.single = selection.length!==1
|
||||
this.multiple = !selection.length
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.reset()
|
||||
this.open = true
|
||||
this.title = "添加出库作业流水Controller"
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.reset()
|
||||
const jobDetailId = row.jobDetailId || this.ids
|
||||
getViewOutJobFlow(jobDetailId).then(response => {
|
||||
this.form = response.data
|
||||
this.open = true
|
||||
this.title = "修改出库作业流水Controller"
|
||||
})
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
if (this.form.jobDetailId != null) {
|
||||
updateViewOutJobFlow(this.form).then(response => {
|
||||
this.$modal.msgSuccess("修改成功")
|
||||
this.open = false
|
||||
this.getList()
|
||||
})
|
||||
} else {
|
||||
addViewOutJobFlow(this.form).then(response => {
|
||||
this.$modal.msgSuccess("新增成功")
|
||||
this.open = false
|
||||
this.getList()
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const jobDetailIds = row.jobDetailId || this.ids
|
||||
this.$modal.confirm('是否确认删除出库作业流水Controller编号为"' + jobDetailIds + '"的数据项?').then(function() {
|
||||
return delViewOutJobFlow(jobDetailIds)
|
||||
}).then(() => {
|
||||
this.getList()
|
||||
this.$modal.msgSuccess("删除成功")
|
||||
}).catch(() => {})
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
this.download('search/ViewOutJobFlow/export', {
|
||||
...this.queryParams
|
||||
}, `ViewOutJobFlow_${new Date().getTime()}.xlsx`)
|
||||
},
|
||||
/** 生成退料入库单按钮操作 */
|
||||
handleCreateReturnStockIn() {
|
||||
if (this.selectedRows.length === 0) {
|
||||
this.$modal.msgWarning("请选择要生成退料入库单的数据");
|
||||
return;
|
||||
}
|
||||
// 深拷贝选中的数据到弹窗列表
|
||||
this.returnStockInList = JSON.parse(JSON.stringify(this.selectedRows));
|
||||
this.returnStockInOpen = true;
|
||||
},
|
||||
/** 提交退料入库单 */
|
||||
submitReturnStockIn() {
|
||||
if (this.returnStockInList.length === 0) {
|
||||
return;
|
||||
}
|
||||
productBack(this.returnStockInList).then(response => {
|
||||
this.$modal.msgSuccess("生成成功");
|
||||
this.returnStockInOpen = false;
|
||||
this.getList();
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -1,64 +1,40 @@
|
||||
<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="库存编码" prop="stockId"><!-- 库存id -->
|
||||
<el-input
|
||||
v-model="queryParams.stockId"
|
||||
placeholder="请输入库存编码"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="巷道" prop="roadwayId">
|
||||
<el-input
|
||||
v-model="queryParams.roadwayId"
|
||||
placeholder="请输入巷道"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="排" prop="thePlatoon">
|
||||
<el-input
|
||||
v-model="queryParams.thePlatoon"
|
||||
placeholder="请输入排"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="列" prop="theColumn">
|
||||
<el-input
|
||||
v-model="queryParams.theColumn"
|
||||
placeholder="请输入列"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="层" prop="theFloor">
|
||||
<el-input
|
||||
v-model="queryParams.theFloor"
|
||||
placeholder="请输入层"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="货位名称" prop="cargoSpaceName"><!-- 货位id -->
|
||||
<el-input
|
||||
v-model="queryParams.cargoSpaceName"
|
||||
placeholder="请输入货位名称"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="订单号" prop="orderId"><!-- 货位id -->
|
||||
|
||||
<el-form-item label="合同号" prop="orderId">
|
||||
<el-input
|
||||
v-model="queryParams.orderId"
|
||||
placeholder="请输入订单号"
|
||||
placeholder="请输入合同号"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="托盘条码" prop="trayCode"><!-- 物料描述 -->
|
||||
<el-form-item label="产品号" prop="power">
|
||||
<el-input
|
||||
v-model="queryParams.power"
|
||||
placeholder="请输入产品号"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="代号" prop="distribution">
|
||||
<el-input
|
||||
v-model="queryParams.distribution"
|
||||
placeholder="请输入代号"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="台次" prop="spare5">
|
||||
<el-input
|
||||
v-model="queryParams.spare5"
|
||||
placeholder="请输入台次"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="托盘条码" prop="trayCode">
|
||||
<el-input
|
||||
v-model="queryParams.trayCode"
|
||||
placeholder="请输入托盘条码"
|
||||
@@ -163,37 +139,6 @@
|
||||
<el-table-column label="重量" align="center" prop="theType" />
|
||||
<el-table-column label="容量" align="center" prop="theTypeName" />
|
||||
<el-table-column label="库存数量" align="center" prop="quantity" width="80" />
|
||||
<!-- <el-table-column label="来源" align="center" prop="spare1" >
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="dict.type.origin_type" :value="scope.row.spare1"/>
|
||||
</template>
|
||||
|
||||
</el-table-column>
|
||||
<el-table-column label="套账" align="center" prop="spare3" >
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="dict.type.account_type" :value="scope.row.spare3"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="用途" align="center" prop="spare4" >
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="dict.type.purpose_type" :value="scope.row.model"/>
|
||||
</template>
|
||||
</el-table-column>-->
|
||||
|
||||
<!-- <el-table-column label="入库单价" align="center" prop="spare6" />-->
|
||||
<!-- <el-table-column label="状态" align="center" prop="voltage" >
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="dict.type.turnover_type" :value="scope.row.voltage"/>
|
||||
</template>
|
||||
</el-table-column>-->
|
||||
|
||||
<!-- <el-table-column label="供应商" align="center" prop="inClassId" />-->
|
||||
<!-- <el-table-column label="产品质量" align="center" prop="spare8" >
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="dict.type.quality_type" :value="scope.row.spare8"/>
|
||||
</template>
|
||||
</el-table-column>-->
|
||||
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
|
||||
Reference in New Issue
Block a user