优化页面,修正入库逻辑
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
<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="任务ID" prop="jobId">
|
||||
<!-- <el-form-item label="任务ID" prop="jobId">
|
||||
<el-input
|
||||
v-model="queryParams.jobId"
|
||||
placeholder="请输入任务ID"
|
||||
@@ -10,33 +10,19 @@
|
||||
/>
|
||||
</el-form-item>-->
|
||||
<el-form-item label="任务状态" prop="status">
|
||||
<el-select v-model="queryParams.status" placeholder="请选择任务状态" >
|
||||
<el-option
|
||||
v-for="dict in dict.type.mydo_job_status"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
<el-select v-model="queryParams.status" placeholder="请选择任务状态">
|
||||
<el-option v-for="dict in dict.type.mydo_job_status" :key="dict.value" :label="dict.label"
|
||||
:value="dict.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="任务号" prop="taskNo">
|
||||
<el-input
|
||||
v-model="queryParams.taskNo"
|
||||
placeholder="请输入任务号"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
<el-input v-model="queryParams.taskNo" 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="trayCode">
|
||||
<el-input
|
||||
v-model="queryParams.trayCode"
|
||||
placeholder="请输入托盘码"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>-->
|
||||
|
||||
<!-- <el-form-item label="执行阶段" prop="executionPhase">
|
||||
<!-- <el-form-item label="执行阶段" prop="executionPhase">
|
||||
<el-select v-model="queryParams.executionPhase" placeholder="请选择执行阶段" clearable>
|
||||
<el-option
|
||||
v-for="dict in dict.type.execution_phase_type"
|
||||
@@ -46,7 +32,7 @@
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>-->
|
||||
<!-- <el-form-item label="任务类型" prop="inOrOut">
|
||||
<!-- <el-form-item label="任务类型" prop="inOrOut">
|
||||
<el-select v-model="queryParams.inOrOut" placeholder="请选择任务类型" clearable>
|
||||
<el-option
|
||||
v-for="dict in dict.type.in_job_type"
|
||||
@@ -57,22 +43,16 @@
|
||||
</el-select>
|
||||
</el-form-item>-->
|
||||
<el-form-item label="开始时间" prop="startTime">
|
||||
<el-date-picker clearable
|
||||
v-model="queryParams.startTime"
|
||||
type="date"
|
||||
value-format="yyyy-MM-dd"
|
||||
placeholder="请选择开始时间">
|
||||
<el-date-picker clearable v-model="queryParams.startTime" type="date" value-format="yyyy-MM-dd"
|
||||
placeholder="请选择开始时间">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="结束时间" prop="finishTime">
|
||||
<el-date-picker clearable
|
||||
v-model="queryParams.finishTime"
|
||||
type="date"
|
||||
value-format="yyyy-MM-dd"
|
||||
placeholder="请选择结束时间">
|
||||
<el-date-picker clearable v-model="queryParams.finishTime" type="date" value-format="yyyy-MM-dd"
|
||||
placeholder="请选择结束时间">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="入口" prop="entranceId">
|
||||
<!-- <el-form-item label="入口" prop="entranceId">
|
||||
<el-input
|
||||
v-model="queryParams.entranceId"
|
||||
placeholder="请输入入口"
|
||||
@@ -80,7 +60,8 @@
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>-->
|
||||
<el-form-item label="仓库" prop="warehouseId"><!--仓库-->
|
||||
<!--仓库-->
|
||||
<!-- <el-form-item label="仓库" prop="warehouseId">
|
||||
<el-select
|
||||
v-model="queryParams.warehouseId"
|
||||
placeholder="请选择仓库"
|
||||
@@ -94,156 +75,96 @@
|
||||
:value="item.warehouseId"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</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="danger"
|
||||
plain
|
||||
icon="el-icon-edit"
|
||||
size="mini"
|
||||
@click="handleCompletedManually({type: 'invalid'})"
|
||||
v-hasPermi="['job:mydoJob:manualInvalidation']"
|
||||
>手动作废</el-button><!--手动作废-->
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="success"
|
||||
plain
|
||||
icon="el-icon-edit"
|
||||
size="mini"
|
||||
@click="handleCompletedManually({type: 'completed'})"
|
||||
v-hasPermi="['job:mydoJob:manualCompleted']"
|
||||
>手动完成</el-button><!--手动完成-->
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
<el-card class="box-card">
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="danger" plain icon="el-icon-edit" size="mini"
|
||||
@click="handleCompletedManually({ type: 'invalid' })"
|
||||
v-hasPermi="['job:mydoJob:manualInvalidation']">手动作废</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="success" plain icon="el-icon-edit" size="mini"
|
||||
@click="handleCompletedManually({ type: 'completed' })"
|
||||
v-hasPermi="['job:mydoJob:manualCompleted']">手动完成</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="mydoJobList" @selection-change="handleSelectionChange" @row-click="handleRowClick" highlight-current-row :current-row="currentRow"
|
||||
max-height="400">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="任务ID" align="left" prop="jobId" fixed width="140" />
|
||||
<el-table-column label="任务状态" align="left" prop="status">
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="dict.type.mydo_job_status" :value="scope.row.status"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- <el-table-column label="上线类型" align="left" prop="onLineType">-->
|
||||
<!-- <template slot-scope="scope">-->
|
||||
<!-- <dict-tag :options="dict.type.on_line_type" :value="scope.row.onLineType"/>-->
|
||||
<!-- </template>-->
|
||||
<!-- </el-table-column>-->
|
||||
<el-table-column label="任务类型" align="left" prop="inOrOut">
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="dict.type.in_job_type" :value="scope.row.inOrOut"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="任务号" align="left" prop="taskNo" />
|
||||
<el-table-column label="托盘码" align="left" prop="trayCode" width="140" />
|
||||
<el-table-column label="货位" align="left" prop="cargoSpaceName" width="140" />
|
||||
<!-- <el-table-column label="优先级" align="left" prop="priority" />-->
|
||||
<!-- <el-table-column label="执行阶段" align="left" prop="executionPhase">-->
|
||||
<!-- <template slot-scope="scope">-->
|
||||
<!-- <dict-tag :options="dict.type.execution_phase_type" :value="scope.row.executionPhase"/>-->
|
||||
<!-- </template>-->
|
||||
<!-- </el-table-column>-->
|
||||
<!-- <el-table-column label="订单号" align="left" prop="lineId" />-->
|
||||
<!-- <el-table-column label="入口" align="left" prop="entranceId" />-->
|
||||
<el-table-column label="仓库" align="left" prop="warehouseName" />
|
||||
<el-table-column label="创建时间" align="left" prop="createTime" width="180"/>
|
||||
<el-table-column label="开始时间" align="left" prop="startTime" width="180"/>
|
||||
<el-table-column label="结束时间" align="left" prop="finishTime" width="180"/>
|
||||
</el-table>
|
||||
<el-table v-loading="loading" :data="mydoJobList" @selection-change="handleSelectionChange"
|
||||
@row-click="handleRowClick" highlight-current-row :current-row="currentRow" max-height="405">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="任务ID" align="center" prop="jobId" width="125" />
|
||||
<el-table-column label="任务状态" align="center" prop="status">
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="dict.type.mydo_job_status" :value="scope.row.status" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="任务类型" align="center" prop="inOrOut">
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="dict.type.in_job_type" :value="scope.row.inOrOut" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="任务号" align="center" prop="taskNo" />
|
||||
<el-table-column label="托盘码" align="center" prop="trayCode" width="100" />
|
||||
<el-table-column label="货位" align="center" prop="cargoSpaceName" width="80" />
|
||||
<!-- <el-table-column label="仓库" align="center" prop="warehouseName" /> -->
|
||||
<el-table-column label="创建时间" align="center" prop="createTime" width="135" />
|
||||
<!-- <el-table-column label="开始时间" align="center" prop="startTime" width="135"/> -->
|
||||
<el-table-column label="结束时间" align="center" prop="finishTime" width="135" />
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
|
||||
@pagination="getList" />
|
||||
</el-card>
|
||||
|
||||
<el-table v-loading="detailLoading" :data="mydoJobDetailList" @selection-change="handleSelectionChange"
|
||||
max-height="300"
|
||||
>
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="子任务ID" align="left" prop="jobDetailId" width="160" />
|
||||
<el-table-column label="任务ID" align="left" prop="jobId" width="160" />
|
||||
<el-table-column label="单据ID" align="left" prop="inOrOutId" width="160" />
|
||||
<el-table-column label="子单据ID" align="left" prop="inOrOutDId" width="160" />
|
||||
<el-table-column label="物料编码" align="left" prop="productId" width="160" />
|
||||
<el-table-column label="物料名称" align="left" prop="productName" width="160" />
|
||||
<el-table-column label="批号" align="left" prop="lotNo" />
|
||||
<el-table-column label="入库数量" align="right" prop="inQuantity" />
|
||||
<el-table-column label="生产图号" align="left" prop="cargoNo" width="160"/>
|
||||
<el-table-column label="单价" align="left" prop="printDate" />
|
||||
<el-table-column label="供应商" align="left" prop="supplierName" width="160"/>
|
||||
<!-- <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="spare5" />
|
||||
<el-table-column label="合同号" align="left" prop="spare6" />
|
||||
<el-table-column label="件次" align="left" prop="spare7" />
|
||||
<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-column label="管理号" align="left" prop="spare9" />
|
||||
<el-table-column label="规格" align="left" prop="spec" width="160"/>
|
||||
<el-table-column label="单位" align="left" prop="unit" /> -->
|
||||
<el-card class="box-card" style="margin-top: 20px;">
|
||||
<div slot="header" class="clearfix">
|
||||
<span>任务明细列表</span>
|
||||
</div>
|
||||
<el-table v-loading="detailLoading" :data="mydoJobDetailList" @selection-change="handleSelectionChange"
|
||||
max-height="300">
|
||||
<el-table-column label="子任务ID" align="center" prop="jobDetailId" width="135" />
|
||||
<!-- <el-table-column label="任务ID" align="left" prop="jobId" width="160" /> -->
|
||||
<el-table-column label="单据ID" align="center" prop="inOrOutId" width="160" />
|
||||
<el-table-column label="子单据ID" align="center" prop="inOrOutDId" width="160" />
|
||||
<el-table-column label="物料编码" align="center" prop="productId" width="160" />
|
||||
<el-table-column label="物料名称" align="center" prop="productName" width="160" />
|
||||
<!-- <el-table-column label="批号" align="center" prop="lotNo" /> -->
|
||||
<el-table-column label="入库数量" align="center" prop="inQuantity" />
|
||||
<!-- <el-table-column label="生产图号" align="center" prop="cargoNo" width="160"/> -->
|
||||
<!-- <el-table-column label="单价" align="center" prop="printDate" /> -->
|
||||
<!-- <el-table-column label="供应商" align="center" prop="supplierName" width="160"/> -->
|
||||
</el-table>
|
||||
|
||||
</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" />
|
||||
</el-card>
|
||||
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listMydoJob,manualInvalidation,manualCompleted, getMydoJob, delMydoJob, addMydoJob, updateMydoJob } from "@/api/job/inmydoJob"
|
||||
import { listMydoJob, manualInvalidation, manualCompleted, getMydoJob, delMydoJob, addMydoJob, updateMydoJob } from "@/api/job/inmydoJob"
|
||||
import { listMydoJobDetail } from "@/api/job/mydoJobDetail"
|
||||
import {listWarehouse} from "@/api/bas/warehouse";
|
||||
import { listWarehouse } from "@/api/bas/warehouse";
|
||||
|
||||
export default {
|
||||
name: "MydoJob",
|
||||
dicts: ['execution_phase_type', 'in_job_type', 'on_line_type', 'mydo_job_status','product_type','origin_type','account_type','turnover_type','purpose_type','quality_type'],
|
||||
dicts: ['execution_phase_type', 'in_job_type', 'on_line_type', 'mydo_job_status', 'product_type', 'origin_type', 'account_type', 'turnover_type', 'purpose_type', 'quality_type'],
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
detailLoading:false,
|
||||
warehouseOptions:[],
|
||||
detailLoading: false,
|
||||
warehouseOptions: [],
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 非单个禁用
|
||||
@@ -258,9 +179,9 @@ export default {
|
||||
// 任务表表格数据
|
||||
mydoJobList: [],
|
||||
// 子任务表表格数据
|
||||
mydoJobDetailList:[],
|
||||
mydoJobDetailList: [],
|
||||
// 当前选中行
|
||||
currentRow:null,
|
||||
currentRow: null,
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
@@ -294,15 +215,15 @@ export default {
|
||||
classId: null,
|
||||
warehouseId: null,
|
||||
faultFlag: null,
|
||||
inOut:"1"
|
||||
inOut: "1"
|
||||
},
|
||||
queryDetailParams:{
|
||||
queryDetailParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
jobId: null,
|
||||
status: null,
|
||||
},
|
||||
queryWarehouseParams:{
|
||||
queryWarehouseParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 99,
|
||||
},
|
||||
@@ -406,7 +327,7 @@ export default {
|
||||
return;
|
||||
}
|
||||
this.ids = selection.map(item => item.jobId);
|
||||
this.single = selection.length!==1;
|
||||
this.single = selection.length !== 1;
|
||||
this.multiple = !selection.length;
|
||||
},
|
||||
|
||||
@@ -422,9 +343,9 @@ export default {
|
||||
return;
|
||||
}
|
||||
var data = {
|
||||
"jobId": jobIds[0],
|
||||
"jobId": jobIds[0],
|
||||
}
|
||||
if (row.type === 'invalid'){
|
||||
if (row.type === 'invalid') {
|
||||
//手动作废
|
||||
manualInvalidation(data).then(response => {
|
||||
this.$modal.msgSuccess('操作成功');
|
||||
@@ -432,7 +353,7 @@ export default {
|
||||
})
|
||||
|
||||
|
||||
}else if (row.type === 'completed'){
|
||||
} else if (row.type === 'completed') {
|
||||
//手动完成
|
||||
manualCompleted(data).then(response => {
|
||||
this.$modal.msgSuccess('操作成功');
|
||||
@@ -479,10 +400,11 @@ export default {
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.el-table >>> .current-row {
|
||||
.el-table>>>.current-row {
|
||||
background-color: #f0f9eb;
|
||||
}
|
||||
.el-form-item >>> .el-form-item__label {
|
||||
|
||||
.el-form-item>>>.el-form-item__label {
|
||||
white-space: nowrap;
|
||||
width: auto;
|
||||
min-width: fit-content;
|
||||
|
||||
@@ -1,78 +1,65 @@
|
||||
<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="status"> <!-- 状态 -->
|
||||
<el-select v-model="queryParams.status" placeholder="请选择状态" >
|
||||
<el-option
|
||||
v-for="dict in dict.type.mydo_job_status"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
|
||||
<el-form-item label="作业状态" prop="status"> <!-- 状态 -->
|
||||
<el-select v-model="queryParams.status" placeholder="请选择状态">
|
||||
<el-option v-for="dict in dict.type.mydo_job_status" :key="dict.value" :label="dict.label"
|
||||
:value="dict.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="任务号" prop="taskNo"> <!-- 任务号 -->
|
||||
<el-input
|
||||
v-model="queryParams.taskNo"
|
||||
placeholder="请输入任务号"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
<el-input v-model="queryParams.taskNo" 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="inOrOut"> <!– 作业类型 –>-->
|
||||
<!-- <el-select v-model="queryParams.inOrOut" placeholder="请选择作业类型" clearable>-->
|
||||
<!-- <el-option-->
|
||||
<!-- v-for="dict in dict.type.out_job_type"-->
|
||||
<!-- :key="dict.value"-->
|
||||
<!-- :label="dict.label"-->
|
||||
<!-- :value="dict.value"-->
|
||||
<!-- />-->
|
||||
<!-- </el-select>-->
|
||||
<!-- </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="inOrOut"> <!– 作业类型 –>-->
|
||||
<!-- <el-select v-model="queryParams.inOrOut" placeholder="请选择作业类型" clearable>-->
|
||||
<!-- <el-option-->
|
||||
<!-- v-for="dict in dict.type.out_job_type"-->
|
||||
<!-- :key="dict.value"-->
|
||||
<!-- :label="dict.label"-->
|
||||
<!-- :value="dict.value"-->
|
||||
<!-- />-->
|
||||
<!-- </el-select>-->
|
||||
<!-- </el-form-item>-->
|
||||
|
||||
<el-form-item label="开始时间" prop="startTime"> <!-- 开始时间 -->
|
||||
<el-date-picker clearable
|
||||
v-model="queryParams.startTime"
|
||||
type="date"
|
||||
value-format="yyyy-MM-dd"
|
||||
<el-date-picker clearable v-model="queryParams.startTime" type="date" value-format="yyyy-MM-dd"
|
||||
placeholder="请选择开始时间">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="结束时间" prop="finishTime"> <!-- 结束时间 -->
|
||||
<el-date-picker clearable
|
||||
v-model="queryParams.finishTime"
|
||||
type="date"
|
||||
value-format="yyyy-MM-dd"
|
||||
<el-date-picker clearable v-model="queryParams.finishTime" type="date" value-format="yyyy-MM-dd"
|
||||
placeholder="请选择结束时间">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
|
||||
<!-- <el-form-item label="仓库" prop="warehouseId"> <!– 仓库 –>-->
|
||||
<!-- <el-select-->
|
||||
<!-- v-model="queryParams.warehouseId"-->
|
||||
<!-- placeholder="请选择仓库"-->
|
||||
<!-- 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 label="仓库" prop="warehouseId"> <!– 仓库 –>-->
|
||||
<!-- <el-select-->
|
||||
<!-- v-model="queryParams.warehouseId"-->
|
||||
<!-- placeholder="请选择仓库"-->
|
||||
<!-- 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">搜索</el-button> <!-- 搜索 -->
|
||||
@@ -80,112 +67,98 @@
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="success"
|
||||
plain
|
||||
icon="el-icon-edit"
|
||||
size="mini"
|
||||
@click="OuthandFinish"
|
||||
v-hasPermi="['job:outmydoJob:OuthandFinish']"
|
||||
>手动完成</el-button> <!-- 手动完成 -->
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="danger"
|
||||
plain
|
||||
icon="el-icon-download"
|
||||
size="mini"
|
||||
@click="OuthandInvalidation"
|
||||
v-hasPermi="['job:outmydoJob:OuthandInvalidation']"
|
||||
>手动作废</el-button> <!-- 手动作废 -->
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
<el-card class="box-card">
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="success" plain icon="el-icon-edit" size="mini" @click="OuthandFinish"
|
||||
v-hasPermi="['job:outmydoJob:OuthandFinish']">手动完成</el-button> <!-- 手动完成 -->
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="danger" plain icon="el-icon-download" size="mini" @click="OuthandInvalidation"
|
||||
v-hasPermi="['job:outmydoJob:OuthandInvalidation']">手动作废</el-button> <!-- 手动作废 -->
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="mydoJobList" @selection-change="handleSelectionChange" @row-click="handleRowClick" highlight-current-row :current-row="currentRow" max-height="400">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="任务ID" align="left" prop="jobId" /> <!-- 任务ID -->
|
||||
<el-table-column label="任务状态" align="left" prop="status"> <!-- 任务状态 -->
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="dict.type.mydo_job_status" :value="scope.row.status"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- <el-table-column :label="$t('outJobManagement.onLineType')" align="left" prop="onLineType"> <!– 上线类型 –>
|
||||
<el-table v-loading="loading" :data="mydoJobList" @selection-change="handleSelectionChange"
|
||||
@row-click="handleRowClick" highlight-current-row :current-row="currentRow" max-height="400">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="任务ID" align="center" prop="jobId" width="120" /> <!-- 任务ID -->
|
||||
<el-table-column label="任务状态" align="center" prop="status"> <!-- 任务状态 -->
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="dict.type.mydo_job_status" :value="scope.row.status" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- <el-table-column :label="$t('outJobManagement.onLineType')" align="left" prop="onLineType"> <!– 上线类型 –>
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="dict.type.on_line_type" :value="scope.row.onLineType"/>
|
||||
</template>
|
||||
</el-table-column>-->
|
||||
<el-table-column label="任务类型" align="left" prop="inOrOut"> <!-- 任务类型 -->
|
||||
<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="left" prop="taskNo" /> <!-- 任务号 -->
|
||||
<!-- <el-table-column :label="$t('outJobManagement.customerId')" align="left" prop="customerId" /> <!– 客户ID –>-->
|
||||
<el-table-column label="托盘码" align="left" prop="trayCode" /> <!-- 托盘码 -->
|
||||
<!-- <el-table-column :label="$t('outJobManagement.roadwayId')" align="left" prop="roadwayId" /> <!– 巷道ID –>-->
|
||||
<el-table-column label="货位" align="left" prop="cargoSpaceName" /> <!-- 货位ID -->
|
||||
<!-- <el-table-column label="订单号" align="left" prop="lineId" /> <!– 结束时间 –>-->
|
||||
<!-- <el-table-column label="优先级" align="left" prop="priority" /> <!– 优先级 –>-->
|
||||
<!-- <el-table-column label="执行阶段" align="left" prop="executionPhase"> <!– 执行阶段 –>-->
|
||||
<!-- <template slot-scope="scope">-->
|
||||
<!-- <dict-tag :options="dict.type.execution_phase_type" :value="scope.row.executionPhase"/>-->
|
||||
<!-- </template>-->
|
||||
<!-- </el-table-column>-->
|
||||
<el-table-column label="任务类型" align="center" prop="inOrOut"> <!-- 任务类型 -->
|
||||
<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="taskNo" /> <!-- 任务号 -->
|
||||
<!-- <el-table-column :label="$t('outJobManagement.customerId')" align="left" prop="customerId" /> <!– 客户ID –>-->
|
||||
<el-table-column label="托盘码" align="center" prop="trayCode" /> <!-- 托盘码 -->
|
||||
<!-- <el-table-column :label="$t('outJobManagement.roadwayId')" align="left" prop="roadwayId" /> <!– 巷道ID –>-->
|
||||
<el-table-column label="货位" align="center" prop="cargoSpaceName" /> <!-- 货位ID -->
|
||||
<!-- <el-table-column label="订单号" align="left" prop="lineId" /> <!– 结束时间 –>-->
|
||||
<!-- <el-table-column label="优先级" align="left" prop="priority" /> <!– 优先级 –>-->
|
||||
<!-- <el-table-column label="执行阶段" align="left" prop="executionPhase"> <!– 执行阶段 –>-->
|
||||
<!-- <template slot-scope="scope">-->
|
||||
<!-- <dict-tag :options="dict.type.execution_phase_type" :value="scope.row.executionPhase"/>-->
|
||||
<!-- </template>-->
|
||||
<!-- </el-table-column>-->
|
||||
|
||||
<!-- <el-table-column label="仓库" align="left" prop="warehouseName" /> -->
|
||||
<!-- <el-table-column label="出口" align="left" prop="exitId"/> 出口ID -->
|
||||
<el-table-column label="创建时间" align="left" prop="createTime" width="180"/> <!-- 创建时间 -->
|
||||
<el-table-column label="开始时间" align="left" prop="startTime" width="180"/> <!-- 开始时间 -->
|
||||
<el-table-column label="结束时间" align="left" prop="finishTime" width="180"/> <!-- 结束时间 -->
|
||||
<!-- <el-table-column :label="$t('outJobManagement.warehouseId')" align="left" prop="warehouseId" /> <!– 仓库ID –>-->
|
||||
<!-- <el-table-column label="仓库ID" align="left" prop="warehouseName" /> <!– 仓库ID –>-->
|
||||
</el-table>
|
||||
<!-- <el-table-column label="仓库" align="left" prop="warehouseName" /> -->
|
||||
<!-- <el-table-column label="出口" align="left" prop="exitId"/> 出口ID -->
|
||||
<el-table-column label="创建时间" align="center" prop="createTime" width="135" /> <!-- 创建时间 -->
|
||||
<!-- <el-table-column label="开始时间" align="center" prop="startTime" width="180" /> -->
|
||||
<el-table-column label="结束时间" align="center" prop="finishTime" width="135" /> <!-- 结束时间 -->
|
||||
<!-- <el-table-column :label="$t('outJobManagement.warehouseId')" align="left" prop="warehouseId" /> <!– 仓库ID –>-->
|
||||
<!-- <el-table-column label="仓库ID" align="left" prop="warehouseName" /> <!– 仓库ID –>-->
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
|
||||
@pagination="getList" />
|
||||
</el-card>
|
||||
|
||||
<el-table v-loading="detailLoading" :data="mydoJobDetailList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="子任务ID" align="left" prop="jobDetailId" /> <!-- 子任务ID -->
|
||||
<el-table-column label="库存ID" align="left" prop="stockId" /> <!-- 库存ID -->
|
||||
<el-table-column label="子单据ID" align="left" prop="inOrOutDId" /> <!-- 子单据ID -->
|
||||
<el-table-column label="物料编码" align="left" prop="productId" />
|
||||
<el-table-column label="物料名称" align="left" prop="productName" />
|
||||
<el-table-column label="出库数量" align="right" prop="outQuantity" /> <!-- 出库数量 -->
|
||||
<el-card class="box-card" style="margin-top: 20px;">
|
||||
<div slot="header" class="clearfix">
|
||||
<span>任务明细列表</span>
|
||||
</div>
|
||||
<el-table v-loading="detailLoading" :data="mydoJobDetailList" @selection-change="handleSelectionChange">
|
||||
<!-- <el-table-column type="selection" width="55" align="center" /> -->
|
||||
<el-table-column label="子任务ID" align="left" prop="jobDetailId" /> <!-- 子任务ID -->
|
||||
<el-table-column label="库存ID" align="left" prop="stockId" /> <!-- 库存ID -->
|
||||
<el-table-column label="子单据ID" align="left" prop="inOrOutDId" /> <!-- 子单据ID -->
|
||||
<el-table-column label="物料编码" align="left" prop="productId" />
|
||||
<el-table-column label="物料名称" align="left" prop="productName" />
|
||||
<el-table-column label="出库数量" align="right" prop="outQuantity" /> <!-- 出库数量 -->
|
||||
|
||||
</el-table>
|
||||
</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" />
|
||||
</el-card>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listMydoJobOut,handFinish,hangInvalidJob } from "@/api/job/OutmydoJob"
|
||||
import { listMydoJobOut, handFinish, hangInvalidJob } from "@/api/job/OutmydoJob"
|
||||
import { listMydoJobDetail } from "@/api/job/mydoJobDetail"
|
||||
import {listWarehouse} from "@/api/bas/warehouse";
|
||||
import { listWarehouse } from "@/api/bas/warehouse";
|
||||
|
||||
export default {
|
||||
name: "MydoJob",
|
||||
dicts: ['execution_phase_type', 'in_job_type', 'on_line_type', 'mydo_job_status','out_job_type','product_type','origin_type','account_type','turnover_type','purpose_type','quality_type'],
|
||||
dicts: ['execution_phase_type', 'in_job_type', 'on_line_type', 'mydo_job_status', 'out_job_type', 'product_type', 'origin_type', 'account_type', 'turnover_type', 'purpose_type', 'quality_type'],
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
detailLoading:false,
|
||||
detailLoading: false,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 非单个禁用
|
||||
@@ -202,9 +175,9 @@ export default {
|
||||
// 任务表表格数据
|
||||
mydoJobList: [],
|
||||
// 子任务表表格数据
|
||||
mydoJobDetailList:[],
|
||||
mydoJobDetailList: [],
|
||||
// 当前选中行
|
||||
currentRow:null,
|
||||
currentRow: null,
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
@@ -238,9 +211,9 @@ export default {
|
||||
classId: null,
|
||||
warehouseId: null,
|
||||
faultFlag: null,
|
||||
inOut:'2'
|
||||
inOut: '2'
|
||||
},
|
||||
queryDetailParams:{
|
||||
queryDetailParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
jobId: null,
|
||||
@@ -283,7 +256,7 @@ export default {
|
||||
// 如果有数据,自动选中第一行
|
||||
if (this.mydoJobList.length > 0) {
|
||||
this.handleRowClick(this.mydoJobList[0]);
|
||||
}else {
|
||||
} else {
|
||||
this.mydoJobDetailList = []
|
||||
this.detailLoading = false
|
||||
}
|
||||
@@ -344,7 +317,7 @@ export default {
|
||||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map(item => item.jobId)
|
||||
this.single = selection.length!==1
|
||||
this.single = selection.length !== 1
|
||||
this.multiple = !selection.length
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
@@ -359,7 +332,7 @@ export default {
|
||||
this.currentRow = row;
|
||||
// 更新子表格查询参数
|
||||
this.queryDetailParams.jobId = row.jobId;
|
||||
this.queryDetailParams.status=row.status // 查询子表格数据
|
||||
this.queryDetailParams.status = row.status // 查询子表格数据
|
||||
this.getDetailList();
|
||||
},
|
||||
/** 查询子任务表列表 */
|
||||
@@ -398,7 +371,7 @@ export default {
|
||||
}).then(() => {
|
||||
this.$modal.msgSuccess("手动完成成功");
|
||||
this.getList();
|
||||
}).catch(() => {});
|
||||
}).catch(() => { });
|
||||
},
|
||||
//手动作废
|
||||
OuthandInvalidation() {
|
||||
@@ -419,7 +392,7 @@ export default {
|
||||
}).then(() => {
|
||||
this.$modal.msgSuccess("手动作废成功");
|
||||
this.getList();
|
||||
}).catch(() => {});
|
||||
}).catch(() => { });
|
||||
}
|
||||
|
||||
}
|
||||
@@ -427,7 +400,7 @@ export default {
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.el-table >>> .current-row {
|
||||
.el-table>>>.current-row {
|
||||
background-color: #f0f9eb;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -329,9 +329,24 @@ export default {
|
||||
};
|
||||
},
|
||||
created() {
|
||||
// 页面初始化时生成符合规范的主单号(RKyyyyMMddHHmmssSS)
|
||||
this.formData.stockoutId = this.generateRKId()
|
||||
this.getWarehouseOptions();
|
||||
},
|
||||
methods: {
|
||||
// 生成 RK 单号(两位毫秒,统一入出库格式)
|
||||
generateRKId() {
|
||||
const d = new Date()
|
||||
const pad2 = (n) => String(n).padStart(2, '0')
|
||||
const yyyy = d.getFullYear()
|
||||
const MM = pad2(d.getMonth() + 1)
|
||||
const dd = pad2(d.getDate())
|
||||
const HH = pad2(d.getHours())
|
||||
const mm = pad2(d.getMinutes())
|
||||
const ss = pad2(d.getSeconds())
|
||||
const cs = pad2(Math.floor(d.getMilliseconds() / 10))
|
||||
return `RK${yyyy}${MM}${dd}${HH}${mm}${ss}${cs}`
|
||||
},
|
||||
/** 获取仓库选项 */
|
||||
getWarehouseOptions() {
|
||||
|
||||
@@ -564,6 +579,10 @@ export default {
|
||||
this.$modal.msgError('请选择物资');
|
||||
return;
|
||||
}
|
||||
// 若用户重新建单或清空过主单号,保存前保证再次生成
|
||||
if (!this.formData.stockoutId) {
|
||||
this.formData.stockoutId = this.generateRKId()
|
||||
}
|
||||
const data = {
|
||||
outStockout: this.formData,
|
||||
detailList: this.materialList
|
||||
|
||||
@@ -10,18 +10,9 @@
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item :label="'出库类型'" prop="outType"> <!-- 出库类型 -->
|
||||
<el-select v-model="queryParams.outType" :placeholder="'请选择出库类型'" clearable>
|
||||
<el-option
|
||||
v-for="dict in dict.type.out_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-select v-model="queryParams.status" :placeholder="'请选择单据状态'" @change="handleQuery">
|
||||
<el-option
|
||||
v-for="dict in dict.type.out_bill_status"
|
||||
:key="dict.value"
|
||||
@@ -30,15 +21,25 @@
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item :label="'物料名称'" prop="productName">
|
||||
<!-- 出库类型 -->
|
||||
<!-- <el-form-item :label="'出库类型'" prop="outType">
|
||||
<el-select v-model="queryParams.outType" :placeholder="'请选择出库类型'" clearable>
|
||||
<el-option
|
||||
v-for="dict in dict.type.out_bill_type"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</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> -->
|
||||
|
||||
|
||||
<el-form-item :label="'创建时间'" prop="dateRange">
|
||||
@@ -60,6 +61,16 @@
|
||||
|
||||
<!-- 操作按钮 -->
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
icon="el-icon-plus"
|
||||
size="mini"
|
||||
@click="handleAdd"
|
||||
v-hasPermi="['out:outStockout:add']"
|
||||
>单据新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
@@ -90,39 +101,19 @@
|
||||
v-hasPermi="['out:outStockout:changeStatus']"
|
||||
>{{'单据作废'}}</el-button> <!-- 单据作废 -->
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="warning"
|
||||
plain
|
||||
icon="el-icon-s-promotion"
|
||||
size="mini"
|
||||
@click="handleAutoAllot"
|
||||
v-hasPermi="['out:outStockout:autoAllot']"
|
||||
>{{'自动分配'}}</el-button> <!-- 自动分配 -->
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="info"
|
||||
plain
|
||||
icon="el-icon-s-tools"
|
||||
size="mini"
|
||||
@click="handleManualAllot"
|
||||
v-hasPermi="['out:outStockout:manualAllot']"
|
||||
>{{'手动分配'}}</el-button> <!-- 手动分配 -->
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<!-- 主表数据 -->
|
||||
<el-table v-loading="loading" :data="outStockoutList" @selection-change="handleSelectionChange" @row-click="handleRowClick" max-height="400">
|
||||
<el-table v-loading="loading" :data="outStockoutList" @selection-change="handleSelectionChange" max-height="400">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column :label="'出库单编号'" align="left" prop="stockoutId" /> <!-- 出库单编号 -->
|
||||
<el-table-column :label="'出库单主题'" align="left" prop="fid" width="260" /> <!-- 出库单主题 -->
|
||||
<el-table-column :label="'出库类型'" align="left" prop="outType"> <!-- 出库类型 -->
|
||||
<el-table-column :label="'出库单编号'" align="center" prop="stockoutId" width="150" /> <!-- 出库单编号 -->
|
||||
<el-table-column :label="'出库单主题'" align="center" prop="fid" width="200" /> <!-- 出库单主题 -->
|
||||
<el-table-column :label="'出库类型'" align="center" prop="outType"> <!-- 出库类型 -->
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="dict.type.out_bill_type" :value="scope.row.outType"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="'单据状态'" align="left" prop="status"> <!-- 单据状态 -->
|
||||
<el-table-column :label="'单据状态'" align="center" prop="status"> <!-- 单据状态 -->
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="dict.type.out_bill_status" :value="scope.row.status"/>
|
||||
</template>
|
||||
@@ -133,11 +124,22 @@
|
||||
<dict-tag :options="dict.type.bill_resource" :value="scope.row.stockoutSource"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="'ERP出库单编号'" align="center" prop="erpStockoutId" /> <!-- ERP出库单编号 -->
|
||||
<!-- <el-table-column :label="'ERP出库单编号'" align="center" prop="erpStockoutId" /> -->
|
||||
<!-- ERP出库单编号 -->
|
||||
<el-table-column :label="'客户名称'" align="center" prop="customerNo" /> <!-- 客户名称 -->
|
||||
<el-table-column :label="'创建时间'" align="left" prop="createDate" /><!-- 创建时间 -->
|
||||
<el-table-column :label="'开始时间'" align="left" prop="startDate" /><!-- 开始时间 -->
|
||||
<el-table-column :label="'确认时间'" align="left" prop="finishDate" /> <!-- 确认时间 -->
|
||||
<el-table-column :label="'创建时间'" align="center" prop="createDate" width="135" /><!-- 创建时间 -->
|
||||
<el-table-column :label="'开始时间'" align="center" prop="startDate" width="135"/><!-- 开始时间 -->
|
||||
<el-table-column :label="'确认时间'" align="center" prop="finishDate" width="135"/> <!-- 确认时间 -->
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="50">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-thumb"
|
||||
@click="handleView(scope.row)"
|
||||
>详情</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
@@ -148,30 +150,125 @@
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
<!-- 子表数据 -->
|
||||
<el-table v-loading="detailLoading" :data="outStockDetailList" style="margin-top: 20px;" @selection-change="handleDetailSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column :label="'出库子单编号'" align="center" prop="stockoutDetailId" width="160" /> <!-- 出库子单编号 -->
|
||||
<el-table-column :label="'物料编码'" align="center" prop="productId" /> <!-- 物资编码 -->
|
||||
<el-table-column :label="'物料名称'" align="center" prop="productName" />
|
||||
<el-table-column :label="'计划数量'" align="center" prop="quantity" /> <!-- 计划数量 -->
|
||||
<el-table-column :label="'分配数量'" align="center" prop="allotQuantity" /> <!-- 分配数量 -->
|
||||
<el-table-column :label="'实际数量'" align="center" prop="assignNum" /> <!-- 实际数量 -->
|
||||
<!-- <el-table-column :label="'来源'" align="center" prop="unit">
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="dict.type.origin_type" :value="scope.row.unit"/>
|
||||
</template>
|
||||
</el-table-column> -->
|
||||
<el-dialog :title="title" :visible.sync="open" width="1050px" append-to-body>
|
||||
<el-form ref="viewForm" :model="form" :rules="rules" label-width="80px">
|
||||
<el-card class="box-card" shadow="never">
|
||||
<div slot="header">主单信息</div>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="出库单号" prop="stockoutId">
|
||||
<el-input v-model="form.stockoutId" :disabled="isView"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="出库主题" prop="fid">
|
||||
<el-input v-model="form.fid" :disabled="isView"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<!-- <el-col :span="8">
|
||||
<el-form-item label="出库类型" prop="outType">
|
||||
<el-input v-model="form.outType" :disabled="isView"/>
|
||||
</el-form-item>
|
||||
</el-col> -->
|
||||
<el-col :span="8">
|
||||
<el-form-item label="单据来源" prop="stockoutSource">
|
||||
<el-input v-model="form.stockoutSource" :disabled="isView"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="客户名称" prop="customerNo">
|
||||
<el-input v-model="form.customerNo" :disabled="isView"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<!-- <el-row :gutter="20"> -->
|
||||
<!-- <el-col :span="8">
|
||||
<el-form-item label="单据状态" prop="status">
|
||||
<el-input v-model="form.status" :disabled="true"/>
|
||||
</el-form-item>
|
||||
</el-col> -->
|
||||
|
||||
<!-- </el-row> -->
|
||||
<!-- <el-row :gutter="20">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="创建时间" prop="createDate">
|
||||
<el-input v-model="form.createDate" :disabled="true"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="开始时间" prop="startDate">
|
||||
<el-input v-model="form.startDate" :disabled="true"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="确认时间" prop="finishDate">
|
||||
<el-input v-model="form.finishDate" :disabled="true"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row> -->
|
||||
</el-card>
|
||||
<el-card class="box-card" shadow="never" style="margin-top: 12px;">
|
||||
<div slot="header" style="display:flex;justify-content:space-between;align-items:center;">
|
||||
<span>子单信息</span>
|
||||
<div v-if="isAddMode && !isView">
|
||||
<el-button type="danger" plain size="mini" @click="handleDeleteDetails">删除物资</el-button>
|
||||
<el-button type="primary" plain size="mini" @click="openProductSelector">选择物资</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<el-table
|
||||
v-loading="detailLoading"
|
||||
:data="outStockDetailList"
|
||||
@selection-change="handleDetailSelectionChange"
|
||||
size="mini"
|
||||
border
|
||||
style="width: 100%">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<!-- <el-table-column label="出库子单编号" align="center" prop="stockoutDetailId" width="160" /> -->
|
||||
<el-table-column label="物料编码" align="center" prop="productId" />
|
||||
<el-table-column label="物料名称" align="center" prop="productName" />
|
||||
<el-table-column label="计划数量" align="center" prop="quantity" />
|
||||
<el-table-column label="分配数量" align="center" prop="allotQuantity" />
|
||||
<el-table-column label="实际数量" align="center" prop="assignNum" />
|
||||
</el-table>
|
||||
</el-card>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" plain @click="handleAutoAllot" v-if="!isAddMode" v-hasPermi="['out:outStockout:autoAllot']">自动分配</el-button>
|
||||
<el-button type="primary" @click="submitForm" v-if="!isView">确 定</el-button>
|
||||
<el-button @click="open = false">关 闭</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
<el-dialog title="选择物资" :visible.sync="productSelectVisible" width="900px" append-to-body>
|
||||
<el-form ref="productForm" :model="queryProductParams" size="small" :inline="true">
|
||||
<el-form-item label="物料名称" prop="productName">
|
||||
<el-input v-model="queryProductParams.productName" placeholder="请输入物料名称" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="getProductList">搜索</el-button>
|
||||
<el-button icon="el-icon-refresh" size="mini" @click="resetProductQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-table :data="productOptions" border @selection-change="handleProductSelectionChange">
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column label="物料编码" align="center" prop="productId" />
|
||||
<el-table-column label="物料名称" align="center" prop="productName" show-overflow-tooltip />
|
||||
<el-table-column label="物料数量" align="center" prop="quantity" show-overflow-tooltip />
|
||||
</el-table>
|
||||
<pagination
|
||||
v-show="productTotal>0"
|
||||
:total="productTotal"
|
||||
:page.sync="queryProductParams.pageNum"
|
||||
:limit.sync="queryProductParams.pageSize"
|
||||
@pagination="getProductList"
|
||||
/>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="confirmSelectProduct">确定</el-button>
|
||||
<el-button @click="productSelectVisible = false">取消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
</el-table>
|
||||
|
||||
<!-- <pagination-->
|
||||
<!-- v-show="detailTotal>0"-->
|
||||
<!-- :total="detailTotal"-->
|
||||
<!-- :page.sync="detailQueryParams.pageNum"-->
|
||||
<!-- :limit.sync="detailQueryParams.pageSize"-->
|
||||
<!-- @pagination="getDetailList"-->
|
||||
<!-- />-->
|
||||
|
||||
<!-- 审核弹窗 -->
|
||||
<el-dialog :title="'审核'" :visible.sync="auditDialogVisible" width="400px" append-to-body>
|
||||
@@ -313,7 +410,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listOutStockout,autoAllot,listOut,manualAllot} from "@/api/out/outStockout"
|
||||
import { listOutStockout,autoAllot,listOut,manualAllot, saveOutStock, listProductAndStock} from "@/api/out/outStockout"
|
||||
import { getOutStockoutDetail,updateOutStockStatus } from "@/api/out/outStockout"
|
||||
import {listWarehouse} from "@/api/bas/warehouse";
|
||||
|
||||
@@ -334,6 +431,21 @@ export default {
|
||||
outStockoutList: [],
|
||||
// 子表数据
|
||||
outStockDetailList: [],
|
||||
isAddMode: false,
|
||||
// 详情弹窗
|
||||
open: false,
|
||||
title: "",
|
||||
isView: false,
|
||||
// 详情表单数据
|
||||
form: {},
|
||||
rules: {
|
||||
stockoutId: [
|
||||
{ required: true, message: "出库单据编号不能为空", trigger: "blur" }
|
||||
],
|
||||
fid: [
|
||||
{ required: true, message: "出库主题不能为空", trigger: "blur" }
|
||||
]
|
||||
},
|
||||
// 选中数据
|
||||
selectedRows: [],
|
||||
// 选中的子表数据
|
||||
@@ -376,7 +488,7 @@ export default {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
stockoutId: null,
|
||||
outType: null,
|
||||
outType: 1,
|
||||
customerNo: null,
|
||||
customerName: null,
|
||||
supplierName: null,
|
||||
@@ -410,6 +522,15 @@ export default {
|
||||
lotNo: null,
|
||||
productId: null,
|
||||
productName: null
|
||||
},
|
||||
productSelectVisible: false,
|
||||
productOptions: [],
|
||||
selectedProducts: [],
|
||||
productTotal: 0,
|
||||
queryProductParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
productName: null
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -432,6 +553,97 @@ export default {
|
||||
this.getWarehouseList()
|
||||
},
|
||||
methods: {
|
||||
handleAdd() {
|
||||
this.form = {
|
||||
stockoutId: this.generateRKId(),
|
||||
fid: null,
|
||||
outType: 1,
|
||||
stockoutSource: '自建单',
|
||||
customerNo: null,
|
||||
status: 1
|
||||
}
|
||||
this.outStockDetailList = []
|
||||
this.selectedDetailRows = []
|
||||
this.isView = false
|
||||
this.isAddMode = true
|
||||
this.title = "添加出库单据"
|
||||
this.open = true
|
||||
},
|
||||
generateRKId() {
|
||||
const d = new Date()
|
||||
const pad2 = (n) => String(n).padStart(2, '0')
|
||||
const yyyy = d.getFullYear()
|
||||
const MM = pad2(d.getMonth() + 1)
|
||||
const dd = pad2(d.getDate())
|
||||
const HH = pad2(d.getHours())
|
||||
const mm = pad2(d.getMinutes())
|
||||
const ss = pad2(d.getSeconds())
|
||||
const cs = pad2(Math.floor(d.getMilliseconds() / 10))
|
||||
return `RK${yyyy}${MM}${dd}${HH}${mm}${ss}${cs}`
|
||||
},
|
||||
openProductSelector() {
|
||||
this.getProductList()
|
||||
this.productSelectVisible = true
|
||||
},
|
||||
getProductList() {
|
||||
listProductAndStock(this.queryProductParams).then(response => {
|
||||
this.productOptions = response.rows || []
|
||||
this.productTotal = response.total || 0
|
||||
})
|
||||
},
|
||||
resetProductQuery() {
|
||||
this.resetForm("productForm")
|
||||
this.getProductList()
|
||||
},
|
||||
handleProductSelectionChange(selection) {
|
||||
this.selectedProducts = selection
|
||||
},
|
||||
confirmSelectProduct() {
|
||||
const duplicate = this.selectedProducts.filter(sel =>
|
||||
this.outStockDetailList.some(ex => ex.productId === sel.productId)
|
||||
)
|
||||
if (duplicate.length > 0) {
|
||||
this.$modal.msgError("选择的物料已存在")
|
||||
return
|
||||
}
|
||||
const items = this.selectedProducts.map(item => ({
|
||||
productId: item.productId,
|
||||
productName: item.productName,
|
||||
quantity: item.quantity || item.stockQuantity || 1,
|
||||
allotQuantity: 0,
|
||||
assignNum: 0
|
||||
}))
|
||||
this.outStockDetailList.push(...items)
|
||||
this.productSelectVisible = false
|
||||
},
|
||||
handleDeleteDetails() {
|
||||
if (this.selectedDetailRows.length === 0) {
|
||||
this.$modal.msgWarning("请选择要删除的物料")
|
||||
return
|
||||
}
|
||||
this.outStockDetailList = this.outStockDetailList.filter(item => !this.selectedDetailRows.includes(item))
|
||||
this.selectedDetailRows = []
|
||||
},
|
||||
submitForm() {
|
||||
this.$refs["viewForm"].validate(valid => {
|
||||
if (valid) {
|
||||
const payload = {
|
||||
outStockout: { ...this.form },
|
||||
detailList: this.outStockDetailList
|
||||
}
|
||||
saveOutStock(payload).then(response => {
|
||||
if (response.code !== 200) {
|
||||
this.$modal.msgError(response.msg || "保存失败")
|
||||
return
|
||||
}
|
||||
this.$modal.msgSuccess(response.msg || "新增成功")
|
||||
this.open = false
|
||||
this.isAddMode = false
|
||||
this.getList()
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
/** 获取仓库列表 */
|
||||
getWarehouseList() {
|
||||
listWarehouse(this.warehouseQueryParams).then(response => {
|
||||
@@ -444,18 +656,12 @@ export default {
|
||||
/** 查询主表数据 */
|
||||
getList() {
|
||||
this.loading = true
|
||||
listOutStockout(this.queryParams).then(response => {
|
||||
return listOutStockout(this.queryParams).then(response => {
|
||||
this.outStockoutList = response.rows
|
||||
this.total = response.total
|
||||
this.loading = false
|
||||
// 如果有数据,自动选中第一行
|
||||
if (this.outStockoutList.length > 0) {
|
||||
this.handleRowClick(this.outStockoutList[0]);
|
||||
}else {
|
||||
this.outStockDetailList = []
|
||||
this.detailLoading = false
|
||||
}
|
||||
|
||||
this.outStockDetailList = []
|
||||
this.detailLoading = false
|
||||
})
|
||||
},
|
||||
/** 查询子表数据 */
|
||||
@@ -497,6 +703,17 @@ export default {
|
||||
handleRowClick(row) {
|
||||
this.getDetailList(row.stockoutGuid,row.status)
|
||||
},
|
||||
/** 详情按钮操作:按需加载明细 */
|
||||
handleView(row) {
|
||||
this.selectedRows = [row]
|
||||
this.outStockDetailList = []
|
||||
this.detailTotal = 0
|
||||
this.form = { ...row }
|
||||
this.title = "出库单据详情"
|
||||
this.isView = true
|
||||
this.open = true
|
||||
this.getDetailList(row.stockoutGuid, row.status)
|
||||
},
|
||||
/** 多选框选中数据 */
|
||||
handleSelectionChange(selection) {
|
||||
this.selectedRows = selection
|
||||
@@ -578,7 +795,9 @@ export default {
|
||||
}else {
|
||||
this.$modal.msgSuccess(response.msg)
|
||||
}
|
||||
this.getList()
|
||||
this.getList().then(() => {
|
||||
this.getDetailList(this.selectedRows[0].stockoutGuid, this.selectedRows[0].status)
|
||||
})
|
||||
})
|
||||
},
|
||||
/** 手动分配按钮操作 */
|
||||
|
||||
@@ -9,22 +9,22 @@
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="入库子单ID" prop="stockinDetailId">
|
||||
<!-- <el-form-item label="入库子单ID" prop="stockinDetailId">
|
||||
<el-input
|
||||
v-model="queryParams.stockinDetailId"
|
||||
placeholder="请输入入库子单ID"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="仓库ID" prop="warehouseId">
|
||||
</el-form-item> -->
|
||||
<!-- <el-form-item label="仓库ID" prop="warehouseId">
|
||||
<el-input
|
||||
v-model="queryParams.warehouseId"
|
||||
placeholder="请输入仓库ID"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
</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>
|
||||
@@ -103,7 +103,7 @@
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
|
||||
Reference in New Issue
Block a user