库存页面 入库页面手动完成和手动作废
This commit is contained in:
44
ruoyi-ui/src/api/stock/management.js
Normal file
44
ruoyi-ui/src/api/stock/management.js
Normal file
@@ -0,0 +1,44 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询库存信息列表
|
||||
export function listManagement(query) {
|
||||
return request({
|
||||
url: '/stock/management/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询库存信息详细
|
||||
export function getManagement(stockId) {
|
||||
return request({
|
||||
url: '/stock/management/' + stockId,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增库存信息
|
||||
export function addManagement(data) {
|
||||
return request({
|
||||
url: '/stock/management',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改库存信息
|
||||
export function updateManagement(data) {
|
||||
return request({
|
||||
url: '/stock/management',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除库存信息
|
||||
export function delManagement(stockId) {
|
||||
return request({
|
||||
url: '/stock/management/' + stockId,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
@@ -208,17 +208,27 @@
|
||||
</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:CompletedManually']"
|
||||
>手动作废</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="success"
|
||||
plain
|
||||
icon="el-icon-edit"
|
||||
size="mini"
|
||||
@click="handleCompletedManually"
|
||||
@click="handleCompletedManually({type: 'completed'})"
|
||||
v-hasPermi="['job:mydoJob:CompletedManually']"
|
||||
>手动完成</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<!-- <el-col :span="1.5">
|
||||
<el-button
|
||||
type="warning"
|
||||
plain
|
||||
@@ -227,13 +237,14 @@
|
||||
@click="handleExport"
|
||||
v-hasPermi="['job:mydoJob:export']"
|
||||
>导出</el-button>
|
||||
</el-col>
|
||||
</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">
|
||||
<el-table v-loading="loading" :data="mydoJobList" @selection-change="handleSelectionChange" @row-click="handleRowClick" highlight-current-row :current-row="currentRow"
|
||||
max-height="300">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="任务ID" align="center" prop="jobId" />
|
||||
<el-table-column label="任务ID" align="center" prop="jobId" fixed />
|
||||
<el-table-column label="任务状态" align="center" prop="status">
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="dict.type.mydo_job_status" :value="scope.row.status"/>
|
||||
@@ -292,7 +303,9 @@
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
<el-table v-loading="detailLoading" :data="mydoJobDetailList" @selection-change="handleSelectionChange">
|
||||
<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="center" prop="jobDetailId" />
|
||||
<el-table-column label="任务ID" align="center" prop="jobId" />
|
||||
@@ -482,14 +495,39 @@ export default {
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.resetForm("queryForm")
|
||||
this.handleQuery()
|
||||
this.resetForm("queryForm");
|
||||
// 清空子表数据
|
||||
this.mydoJobDetailList = [];
|
||||
this.detailTotal = 0;
|
||||
this.currentRow = null;
|
||||
this.queryDetailParams.jobId = null;
|
||||
// 重新查询主表数据
|
||||
this.handleQuery();
|
||||
},
|
||||
|
||||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map(item => item.jobId)
|
||||
this.single = selection.length!==1
|
||||
this.multiple = !selection.length
|
||||
// 只处理主表的多选
|
||||
if (selection.length > 0 && selection[0].hasOwnProperty('jobDetailId')) {
|
||||
return;
|
||||
}
|
||||
this.ids = selection.map(item => item.jobId);
|
||||
this.single = selection.length!==1;
|
||||
this.multiple = !selection.length;
|
||||
},
|
||||
|
||||
// 手动完成/作废
|
||||
handleCompletedManually(row) {
|
||||
const jobIds = this.ids;
|
||||
if (jobIds.length === 0) {
|
||||
this.$modal.msgError("请选择要操作的数据");
|
||||
return;
|
||||
}
|
||||
if (row.type === 'invalid'){
|
||||
//手动作废
|
||||
}else if (row.type === 'completed'){
|
||||
//手动完成
|
||||
}
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
@@ -522,10 +560,6 @@ export default {
|
||||
this.detailLoading = false;
|
||||
});
|
||||
},
|
||||
//手动完成
|
||||
handleCompletedManually(row){
|
||||
const stockinDetailIds = row.stockinDetailId || this.detailIds
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -173,7 +173,7 @@
|
||||
>删除
|
||||
</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<!-- <el-col :span="1.5">
|
||||
<el-button
|
||||
type="warning"
|
||||
plain
|
||||
@@ -183,7 +183,7 @@
|
||||
v-hasPermi="['receive:stockin:export']"
|
||||
>导出
|
||||
</el-button>
|
||||
</el-col>
|
||||
</el-col>-->
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
|
||||
@@ -186,7 +186,7 @@
|
||||
>单据确认
|
||||
</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<!-- <el-col :span="1.5">
|
||||
<el-button
|
||||
type="warning"
|
||||
plain
|
||||
@@ -196,7 +196,7 @@
|
||||
v-hasPermi="['in:stockIn:export']"
|
||||
>单据导出
|
||||
</el-button>
|
||||
</el-col>
|
||||
</el-col>-->
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="info"
|
||||
|
||||
584
ruoyi-ui/src/views/stock/management/index.vue
Normal file
584
ruoyi-ui/src/views/stock/management/index.vue
Normal file
@@ -0,0 +1,584 @@
|
||||
<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="stockId">
|
||||
<el-input
|
||||
v-model="queryParams.stockId"
|
||||
placeholder="请输入库存id"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="货位id" prop="cargoSpaceId">
|
||||
<el-input
|
||||
v-model="queryParams.cargoSpaceId"
|
||||
placeholder="请输入货位id"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="库存状态" prop="stockStatus">
|
||||
<el-select v-model="queryParams.stockStatus" placeholder="请选择库存状态" clearable>
|
||||
<el-option
|
||||
v-for="dict in dict.type.stock_status"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="物料状态" prop="productStatus">
|
||||
<el-select v-model="queryParams.productStatus" placeholder="请选择物料状态" clearable>
|
||||
<el-option
|
||||
v-for="dict in dict.type.product_status"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="批次号" prop="lotNo">
|
||||
<el-input
|
||||
v-model="queryParams.lotNo"
|
||||
placeholder="请输入批次号"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="入库时间" prop="inDate">
|
||||
<el-input
|
||||
v-model="queryParams.inDate"
|
||||
placeholder="请输入入库时间"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="回流时间" prop="backDate">
|
||||
<el-input
|
||||
v-model="queryParams.backDate"
|
||||
placeholder="请输入回流时间"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="物料GUID" prop="productGuid">
|
||||
<el-input
|
||||
v-model="queryParams.productGuid"
|
||||
placeholder="请输入物料GUID"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="库存数量" prop="quantity">
|
||||
<el-input
|
||||
v-model="queryParams.quantity"
|
||||
placeholder="请输入库存数量"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="作业ID" prop="jobId">
|
||||
<el-input
|
||||
v-model="queryParams.jobId"
|
||||
placeholder="请输入作业ID"
|
||||
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="outQuantity">
|
||||
<el-input
|
||||
v-model="queryParams.outQuantity"
|
||||
placeholder="请输入出库数量"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<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="入库主单" prop="stockinId">
|
||||
<el-input
|
||||
v-model="queryParams.stockinId"
|
||||
placeholder="请输入入库主单"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="入库班组ID" prop="inClassId">
|
||||
<el-input
|
||||
v-model="queryParams.inClassId"
|
||||
placeholder="请输入入库班组ID"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>-->
|
||||
<el-form-item label="仓库" prop="warehouseId">
|
||||
<el-input
|
||||
v-model="queryParams.warehouseId"
|
||||
placeholder="请输入仓库"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="垛型ID" prop="stackingId">
|
||||
<el-input
|
||||
v-model="queryParams.stackingId"
|
||||
placeholder="请输入垛型ID"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="备用字段1" prop="spare1">
|
||||
<el-input
|
||||
v-model="queryParams.spare1"
|
||||
placeholder="请输入备用字段1"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="备用字段2" prop="spare2">
|
||||
<el-input
|
||||
v-model="queryParams.spare2"
|
||||
placeholder="请输入备用字段2"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="备用字段3" prop="spare3">
|
||||
<el-input
|
||||
v-model="queryParams.spare3"
|
||||
placeholder="请输入备用字段3"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="备用字段4" prop="spare4">
|
||||
<el-input
|
||||
v-model="queryParams.spare4"
|
||||
placeholder="请输入备用字段4"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="备用字段5" prop="spare5">
|
||||
<el-input
|
||||
v-model="queryParams.spare5"
|
||||
placeholder="请输入备用字段5"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="备用字段6" prop="spare6">
|
||||
<el-input
|
||||
v-model="queryParams.spare6"
|
||||
placeholder="请输入备用字段6"
|
||||
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-plus"
|
||||
size="mini"
|
||||
@click="handleAdd"
|
||||
v-hasPermi="['stock:management:add']"
|
||||
>新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="success"
|
||||
plain
|
||||
icon="el-icon-edit"
|
||||
size="mini"
|
||||
:disabled="single"
|
||||
@click="handleUpdate"
|
||||
v-hasPermi="['stock:management:edit']"
|
||||
>修改</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="danger"
|
||||
plain
|
||||
icon="el-icon-delete"
|
||||
size="mini"
|
||||
:disabled="multiple"
|
||||
@click="handleDelete"
|
||||
v-hasPermi="['stock:management:remove']"
|
||||
>删除</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="warning"
|
||||
plain
|
||||
icon="el-icon-download"
|
||||
size="mini"
|
||||
@click="handleExport"
|
||||
v-hasPermi="['stock:management:export']"
|
||||
>导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="managementList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="库存id" align="center" prop="stockId" />
|
||||
<el-table-column label="货位id" align="center" prop="cargoSpaceId" />
|
||||
<el-table-column label="库存状态" align="center" prop="stockStatus">
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="dict.type.stock_status" :value="scope.row.stockStatus"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="物料状态" align="center" prop="productStatus">
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="dict.type.product_status" :value="scope.row.productStatus"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="批次号" align="center" prop="lotNo" />
|
||||
<el-table-column label="入库时间" align="center" prop="inDate" />
|
||||
<el-table-column label="回流时间" align="center" prop="backDate" />
|
||||
<el-table-column label="物料GUID" align="center" prop="productGuid" />
|
||||
<el-table-column label="库存数量" align="center" prop="quantity" />
|
||||
<el-table-column label="作业ID" align="center" prop="jobId" />
|
||||
<el-table-column label="托盘条码" align="center" prop="trayCode" />
|
||||
<el-table-column label="出库数量" align="center" prop="outQuantity" />
|
||||
<el-table-column label="入库子单id" align="center" prop="stockinDetailId" />
|
||||
<el-table-column label="入库主单" align="center" prop="stockinId" />
|
||||
<el-table-column label="入库类型" align="center" prop="inType" />
|
||||
<el-table-column label="入库班组ID" align="center" prop="inClassId" />
|
||||
<el-table-column label="仓库" align="center" prop="warehouseId" />
|
||||
<el-table-column label="垛型ID" align="center" prop="stackingId" />
|
||||
<!-- <el-table-column label="备用字段1" align="center" prop="spare1" />
|
||||
<el-table-column label="备用字段2" align="center" prop="spare2" />
|
||||
<el-table-column label="备用字段3" align="center" prop="spare3" />
|
||||
<el-table-column label="备用字段4" align="center" prop="spare4" />
|
||||
<el-table-column label="备用字段5" align="center" prop="spare5" />
|
||||
<el-table-column label="备用字段6" align="center" prop="spare6" />-->
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-edit"
|
||||
@click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['stock:management:edit']"
|
||||
>修改</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-hasPermi="['stock:management:remove']"
|
||||
>删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
<!-- 添加或修改库存信息对话框 -->
|
||||
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||
<el-form-item label="库存id" prop="stockId">
|
||||
<el-input v-model="form.stockId" placeholder="请输入库存id" />
|
||||
</el-form-item>
|
||||
<el-form-item label="货位id" prop="cargoSpaceId">
|
||||
<el-input v-model="form.cargoSpaceId" placeholder="请输入货位id" />
|
||||
</el-form-item>
|
||||
<el-form-item label="库存状态" prop="stockStatus">
|
||||
<el-select v-model="form.stockStatus" placeholder="请选择库存状态">
|
||||
<el-option
|
||||
v-for="dict in dict.type.stock_status"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="物料状态" prop="productStatus">
|
||||
<el-select v-model="form.productStatus" placeholder="请选择物料状态">
|
||||
<el-option
|
||||
v-for="dict in dict.type.product_status"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="批次号" prop="lotNo">
|
||||
<el-input v-model="form.lotNo" placeholder="请输入批次号" />
|
||||
</el-form-item>
|
||||
<el-form-item label="入库时间" prop="inDate">
|
||||
<el-input v-model="form.inDate" placeholder="请输入入库时间" />
|
||||
</el-form-item>
|
||||
<el-form-item label="回流时间" prop="backDate">
|
||||
<el-input v-model="form.backDate" placeholder="请输入回流时间" />
|
||||
</el-form-item>
|
||||
<el-form-item label="物料GUID" prop="productGuid">
|
||||
<el-input v-model="form.productGuid" placeholder="请输入物料GUID" />
|
||||
</el-form-item>
|
||||
<el-form-item label="库存数量" prop="quantity">
|
||||
<el-input v-model="form.quantity" placeholder="请输入库存数量" />
|
||||
</el-form-item>
|
||||
<el-form-item label="作业ID" prop="jobId">
|
||||
<el-input v-model="form.jobId" placeholder="请输入作业ID" />
|
||||
</el-form-item>
|
||||
<el-form-item label="托盘条码" prop="trayCode">
|
||||
<el-input v-model="form.trayCode" placeholder="请输入托盘条码" />
|
||||
</el-form-item>
|
||||
<el-form-item label="出库数量" prop="outQuantity">
|
||||
<el-input v-model="form.outQuantity" placeholder="请输入出库数量" />
|
||||
</el-form-item>
|
||||
<el-form-item label="入库子单id" prop="stockinDetailId">
|
||||
<el-input v-model="form.stockinDetailId" placeholder="请输入入库子单id" />
|
||||
</el-form-item>
|
||||
<el-form-item label="入库主单" prop="stockinId">
|
||||
<el-input v-model="form.stockinId" placeholder="请输入入库主单" />
|
||||
</el-form-item>
|
||||
<el-form-item label="入库班组ID" prop="inClassId">
|
||||
<el-input v-model="form.inClassId" placeholder="请输入入库班组ID" />
|
||||
</el-form-item>
|
||||
<el-form-item label="仓库" prop="warehouseId">
|
||||
<el-input v-model="form.warehouseId" placeholder="请输入仓库" />
|
||||
</el-form-item>
|
||||
<el-form-item label="垛型ID" prop="stackingId">
|
||||
<el-input v-model="form.stackingId" placeholder="请输入垛型ID" />
|
||||
</el-form-item>
|
||||
<el-form-item label="备用字段1" prop="spare1">
|
||||
<el-input v-model="form.spare1" placeholder="请输入备用字段1" />
|
||||
</el-form-item>
|
||||
<el-form-item label="备用字段2" prop="spare2">
|
||||
<el-input v-model="form.spare2" placeholder="请输入备用字段2" />
|
||||
</el-form-item>
|
||||
<el-form-item label="备用字段3" prop="spare3">
|
||||
<el-input v-model="form.spare3" placeholder="请输入备用字段3" />
|
||||
</el-form-item>
|
||||
<el-form-item label="备用字段4" prop="spare4">
|
||||
<el-input v-model="form.spare4" placeholder="请输入备用字段4" />
|
||||
</el-form-item>
|
||||
<el-form-item label="备用字段5" prop="spare5">
|
||||
<el-input v-model="form.spare5" placeholder="请输入备用字段5" />
|
||||
</el-form-item>
|
||||
<el-form-item label="备用字段6" prop="spare6">
|
||||
<el-input v-model="form.spare6" placeholder="请输入备用字段6" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listManagement, getManagement, delManagement, addManagement, updateManagement } from "@/api/stock/management"
|
||||
|
||||
export default {
|
||||
name: "Management",
|
||||
dicts: ['product_status', 'stock_status'],
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 库存信息表格数据
|
||||
managementList: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
stockId: null,
|
||||
cargoSpaceId: null,
|
||||
stockStatus: null,
|
||||
productStatus: null,
|
||||
lotNo: null,
|
||||
inDate: null,
|
||||
backDate: null,
|
||||
productGuid: null,
|
||||
quantity: null,
|
||||
jobId: null,
|
||||
trayCode: null,
|
||||
outQuantity: null,
|
||||
stockinDetailId: null,
|
||||
stockinId: null,
|
||||
inType: null,
|
||||
inClassId: null,
|
||||
warehouseId: null,
|
||||
stackingId: null,
|
||||
spare1: null,
|
||||
spare2: null,
|
||||
spare3: null,
|
||||
spare4: null,
|
||||
spare5: null,
|
||||
spare6: null
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {
|
||||
stockId: [
|
||||
{ required: true, message: "库存id不能为空", trigger: "blur" }
|
||||
],
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getList()
|
||||
},
|
||||
methods: {
|
||||
/** 查询库存信息列表 */
|
||||
getList() {
|
||||
this.loading = true
|
||||
listManagement(this.queryParams).then(response => {
|
||||
this.managementList = response.rows
|
||||
this.total = response.total
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false
|
||||
this.reset()
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {
|
||||
stockId: null,
|
||||
cargoSpaceId: null,
|
||||
stockStatus: null,
|
||||
productStatus: null,
|
||||
lotNo: null,
|
||||
inDate: null,
|
||||
backDate: null,
|
||||
productGuid: null,
|
||||
quantity: null,
|
||||
jobId: null,
|
||||
trayCode: null,
|
||||
outQuantity: null,
|
||||
stockinDetailId: null,
|
||||
stockinId: null,
|
||||
inType: null,
|
||||
inClassId: null,
|
||||
warehouseId: null,
|
||||
stackingId: null,
|
||||
spare1: null,
|
||||
spare2: null,
|
||||
spare3: null,
|
||||
spare4: null,
|
||||
spare5: null,
|
||||
spare6: 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.stockId)
|
||||
this.single = selection.length!==1
|
||||
this.multiple = !selection.length
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.reset()
|
||||
this.open = true
|
||||
this.title = "添加库存信息"
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.reset()
|
||||
const stockId = row.stockId || this.ids
|
||||
getManagement(stockId).then(response => {
|
||||
this.form = response.data
|
||||
this.open = true
|
||||
this.title = "修改库存信息"
|
||||
})
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
if (this.form.stockId != null) {
|
||||
updateManagement(this.form).then(response => {
|
||||
this.$modal.msgSuccess("修改成功")
|
||||
this.open = false
|
||||
this.getList()
|
||||
})
|
||||
} else {
|
||||
addManagement(this.form).then(response => {
|
||||
this.$modal.msgSuccess("新增成功")
|
||||
this.open = false
|
||||
this.getList()
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const stockIds = row.stockId || this.ids
|
||||
this.$modal.confirm('是否确认删除库存信息编号为"' + stockIds + '"的数据项?').then(function() {
|
||||
return delManagement(stockIds)
|
||||
}).then(() => {
|
||||
this.getList()
|
||||
this.$modal.msgSuccess("删除成功")
|
||||
}).catch(() => {})
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
this.download('stock/management/export', {
|
||||
...this.queryParams
|
||||
}, `management_${new Date().getTime()}.xlsx`)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
Reference in New Issue
Block a user