货品调拨接口对接

This commit is contained in:
zzyuan 2025-07-17 13:51:37 +08:00
parent 413985bb58
commit 3e2942ece5
5 changed files with 152 additions and 113 deletions

View File

@ -260,7 +260,7 @@ export function delWarehouseOutApi(data) {
//查询库存盘点列表
export function checkInventoryPageApi(data) {
return request({
url: '/smart-canteen/ims_check_inventory/list',
url: '/smart-canteen/ims_check_inventory/page',
method: 'get',
headers: {
//"merchant-id":"378915229716713472",
@ -347,6 +347,62 @@ export function delCheckInventoryApi(data) {
// -------------货品调拨---------------
//查询货品调拨列表
export function goodsTransferPageApi(data) {
return request({
url: '/smart-canteen/ims_goods_transfer/page',
method: 'get',
headers: {
//"merchant-id":"378915229716713472",
},
params:data
})
}
//获取货品调拨详细信息
export function getGoodsTransferInfoApi(data) {
return request({
url: '/smart-canteen/ims_goods_transfer/info',
method: 'get',
headers: {
//"merchant-id":"378915229716713472",
},
params:data
})
}
// 新增货品调拨-保存
export function addGoodsTransferSaveApi(data) {
return request({
url: '/smart-canteen/ims_goods_transfer/add/save',
method: 'post',
headers: {
//"merchant-id":"378915229716713472",
},
data: data
})
}
// 新增货品调拨-提交
export function addGoodsTransferCommitApi(data) {
return request({
url: '/smart-canteen/ims_goods_transfer/add/commit',
method: 'post',
headers: {
//"merchant-id":"378915229716713472",
},
data: data
})
}
// 删除货品调拨
export function delGoodsTransferApi(data) {
return request({
url: '/smart-canteen/ims_goods_transfer/delete',
method: 'post',
headers: {
//"merchant-id":"378915229716713472",
}
})
}

View File

@ -4,16 +4,18 @@
<el-descriptions style="margin-bottom: 20px;" title="基本信息" :column="4" size="medium" border>
<el-descriptions-item>
<template slot="label">调拨单号</template>
{{baseInfo.transferCode}}
{{baseInfo.goodsTransferCode}}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">调拨时间</template>
{{ baseInfo.outDate }}
{{ }}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">调拨状态</template>
<span v-if="baseInfo.status==1">待调拨</span>
<span v-if="baseInfo.status==2">已调拨</span>
<span v-if="baseInfo.transferStatus==0">草稿</span>
<span v-if="baseInfo.transferStatus==2">待调拨</span>
<span v-if="baseInfo.transferStatus==4">已调拨</span>
<span v-if="baseInfo.transferStatus==5">调拨失败</span>
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">所属区域</template>
@ -21,11 +23,11 @@
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">调出仓库</template>
{{ baseInfo.warehouseName }}
{{ baseInfo.outWarehouseName }}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">调入仓库</template>
{{ baseInfo.warehouseName }}
{{ baseInfo.intoWarehouseName }}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">备注</template>
@ -55,8 +57,8 @@
<span v-if="scope.row.salesMode==2">称重</span>
</template> -->
</el-table-column>
<el-table-column label="当前可调库存" align="center" prop="inventoryNum" :show-overflow-tooltip="true"></el-table-column>
<el-table-column label="调货数量" align="center" prop="fetchNum" :show-overflow-tooltip="true"></el-table-column>
<el-table-column label="当前可调库存" align="center" prop="fetchNum" :show-overflow-tooltip="true"></el-table-column>
<el-table-column label="调货数量" align="center" prop="orderNum" :show-overflow-tooltip="true"></el-table-column>
</el-table>
</div>
</div>
@ -68,7 +70,7 @@
</template>
<script>
import { getWarehouseOutInfoApi } from "@/api/foodManage/stockManage";
import { getGoodsTransferInfoApi } from "@/api/foodManage/stockManage";
export default {
name: "warehouseOutDetail",
dicts: [],
@ -156,14 +158,13 @@ export default {
this.$router.replace({ path: "/foodManage/stockManage/goodsTransfer" }); //
},
getContractInfo(){
console.log(this.transferRowData)
let param = {
outId:this.transferRowData.outId
let param = {
goodsTransferId:this.transferRowData.goodsTransferId
}
//
getWarehouseOutInfoApi(param).then((response) => {
getGoodsTransferInfoApi(param).then((response) => {
this.baseInfo = response.data;
this.materialLis = this.baseInfo.imsOutInventoryDetailVOList;
this.materialList = this.baseInfo.goodsAllocationDetailDTOList;
});
},
//

View File

@ -2,8 +2,8 @@
<div style="padding: 10px;background: #E5EBF6;min-height: 830px;">
<div style="background: #FFF;padding: 10px;border-radius: 10px;margin-bottom: 20px;">
<el-form :model="baseInfo" ref="baseInfo" :rules="baseRules" size="medium" :inline="true" label-width="110px">
<el-form-item label="调拨单号" prop="transferCode">
<el-input v-model="baseInfo.transferCode" placeholder="调拨单号自动生成" disabled maxlength="20" clearable style="width: 240px"/>
<el-form-item label="调拨单号" prop="goodsTransferCode">
<el-input v-model="baseInfo.goodsTransferCode" placeholder="调拨单号自动生成" disabled maxlength="20" clearable style="width: 240px"/>
</el-form-item>
<el-form-item label="所属区域" prop="areaId">
<el-cascader v-model="baseInfo.areaId"
@ -15,8 +15,8 @@
}" @change="handleAreaChange">
</el-cascader>
</el-form-item>
<el-form-item label="调出仓库" prop="warehouseId">
<el-select v-model="baseInfo.warehouseId" clearable placeholder="请选择货品仓库" style="width: 100%;">
<el-form-item label="调出仓库" prop="outWarehouseId">
<el-select v-model="baseInfo.outWarehouseId" clearable placeholder="请选择货品仓库" style="width: 100%;">
<el-option v-for="item in wareHouseOptions"
:key="item.warehouseId"
:label="item.warehouseName"
@ -24,8 +24,8 @@
></el-option>
</el-select>
</el-form-item>
<el-form-item label="调入仓库" prop="warehouseId">
<el-select v-model="baseInfo.warehouseId" clearable placeholder="请选择货品仓库" style="width: 100%;">
<el-form-item label="调入仓库" prop="intoWarehouseId">
<el-select v-model="baseInfo.intoWarehouseId" clearable placeholder="请选择货品仓库" style="width: 100%;">
<el-option v-for="item in wareHouseOptions"
:key="item.warehouseId"
:label="item.warehouseName"
@ -59,10 +59,10 @@
<el-table-column label="计量单位" align="center" prop="unitName" :show-overflow-tooltip="true" />
<el-table-column label="货品规格" align="center" prop="size" :show-overflow-tooltip="true">
</el-table-column>
<el-table-column label="当前可调库存" align="center" prop="materialNum" :show-overflow-tooltip="true"/>
<el-table-column label="调货数量" align="center" prop="fetchNum" :show-overflow-tooltip="true">
<el-table-column label="当前可调库存" align="center" prop="fetchNum" :show-overflow-tooltip="true"/>
<el-table-column label="调货数量" align="center" prop="orderNum" :show-overflow-tooltip="true">
<template slot-scope="scope">
<el-input v-model.number="scope.row.fetchNum" placeholder="请输入" maxlength="10" clearable @input="(v)=>(scope.row.fetchNum=v.replace(/[^\d]/g,''))"/>
<el-input v-model.number="scope.row.orderNum" placeholder="请输入" maxlength="10" clearable @input="(v)=>(scope.row.orderNum=v.replace(/[^\d]/g,''))"/>
</template>
</el-table-column>
</el-table>
@ -185,8 +185,8 @@
import { imgUpLoadTwo } from '@/api/system/upload'
import { systemAreaTreeApi } from "@/api/base/stall";
import { systemMaterialTreeApi,getStockMaterialListApi,drpWareHousePageApi } from "@/api/foodManage/stockManage";
import { getWarehouseOutInfoApi,addWarehouseOutApi,editWarehouseOutApi } from "@/api/foodManage/stockManage";
//warehouseOutPageApi getWarehouseOutInfoApi addWarehouseOutApi editWarehouseOutApi delWarehouseOutApi
import { getGoodsTransferInfoApi,addGoodsTransferSaveApi,addGoodsTransferCommitApi } from "@/api/foodManage/stockManage";
//addGoodsTransferSaveApi addGoodsTransferCommitApi editGoodsTransferSaveApi editGoodsTransferCommitApi
import { fetchMaterialPageApi } from "@/api/foodManage/pickManage";
export default {
name: "WarehouseOutEdit",
@ -215,10 +215,7 @@ export default {
supplierId: [
{ required: true, message: "供应商不能为空", trigger: "change" }
],
outDate: [
{ required: true, message: "出库时间不能为空", trigger: "change" }
],
warehouseId: [
outWarehouseId: [
{ required: true, message: "货品仓库不能为空", trigger: "change" }
],
outType: [
@ -286,18 +283,19 @@ export default {
getContractInfo(){
console.log(this.transferRowData)
let param = {
outId:this.transferRowData.outId
goodsTransferId:this.transferRowData.goodsTransferId
}
//
getWarehouseOutInfoApi(param).then((response) => {
getGoodsTransferInfoApi(param).then((response) => {
this.baseInfo = response.data;
this.materialList = this.baseInfo.imsOutInventoryDetailVOList;
this.materialList = this.baseInfo.goodsAllocationDetailDTOList;
// this.materialList.forEach(item=>{
// this.$set(item,"unitPrice",Number(item.unitPrice)/100)
// })
drpWareHousePageApi({ areaId:this.baseInfo.areaId }).then((response) => {
this.wareHouseOptions = response.rows||[];
this.$set(this.baseInfo,'warehouseId',this.baseInfo.warehouseId)
this.$set(this.baseInfo,'outWarehouseId',this.baseInfo.outWarehouseId)
this.$set(this.baseInfo,'intoWarehouseId',this.baseInfo.intoWarehouseId)
});
});
},
@ -322,7 +320,8 @@ export default {
getWareHouseData() {
drpWareHousePageApi({ areaId:this.baseInfo.areaId }).then((response) => {
this.wareHouseOptions = response.rows||[];
this.$set(this.baseInfo,'warehouseId',null)
this.$set(this.baseInfo,'outWarehouseId',null)
this.$set(this.baseInfo,'intoWarehouseId',null)
});
},
/** 查询货品类别下拉树结构 */
@ -353,7 +352,7 @@ export default {
},
//
addMaterial(){
if(this.baseInfo.areaId!=undefined||this.baseInfo.warehouseId!=undefined){
if(this.baseInfo.areaId!=undefined||this.baseInfo.outWarehouseId!=undefined){
this.openDialog=true
this.resetQuery()
setTimeout(()=>{
@ -379,8 +378,7 @@ export default {
let param = {
"pageSize": this.queryParams.pageSize,
"pageNum": this.queryParams.pageNum,
"areaId": this.baseInfo.areaId,
"warehouseId": this.baseInfo.warehouseId,
"warehouseId": this.baseInfo.outWarehouseId,
"materialName": this.queryParams.materialName,
"materialCode": this.queryParams.materialCode,
"materialTypeIds": this.queryParams.materialTypeIds,
@ -394,7 +392,8 @@ export default {
handleSelectionChange2(selection) {
this.batchChosenMaterial = selection;
this.batchChosenMaterial.forEach(item=>{
this.$set(item,"fetchNum",0)
this.$set(item,"fetchNum",item.materialNum)
this.$set(item,"orderNum",0)
})
},
confirmChosen(){
@ -412,25 +411,22 @@ export default {
this.$refs["baseInfo"].validate(valid => {
if (valid) {
let param = Object.assign({},this.baseInfo);
param.outDate = this.formatDateTime(this.baseInfo.outDate)
param.totalAmount=0
param.totalNum=0
param.status=1
param.imsOutInventoryDetailAddList = []
param.goodsAllocationDetailDTOList = []
this.noMaterial = false;
if(this.materialList.length>0){
this.materialList.forEach(item=>{
if(item.fetchNum==0){
if(item.orderNum==0){
this.noMaterial = true
}else{
let obj = Object.assign({}, item)
param.totalNum = param.totalNum+Number(obj.fetchNum)
param.imsOutInventoryDetailAddList.push(obj)
param.totalNum = param.totalNum+Number(obj.orderNum)
param.goodsAllocationDetailDTOList.push(obj)
}
})
}
if(this.noMaterial){
this.$modal.msgError("请输入单价和数量!");
this.$modal.msgError("请输入数量!");
}else{
this.noMaterial = true;
if(this.materialList.length>0){
@ -441,8 +437,8 @@ export default {
this.$modal.msgError("请添加货品!");
}else{
this.loadingBtn=true;
if (this.baseInfo.outId != undefined) {
editWarehouseOutApi(param).then((response) => {
if (this.baseInfo.goodsTransferId != undefined) {
addGoodsTransferSaveApi(param).then((response) => {
this.$modal.msgSuccess("修改成功");
this.loadingBtn=false
this.jumpList()
@ -450,7 +446,7 @@ export default {
this.loadingBtn=false
});
} else {
addWarehouseOutApi(param).then((response) => {
addGoodsTransferSaveApi(param).then((response) => {
this.$modal.msgSuccess("保存成功");
this.loadingBtn=false
this.jumpList()
@ -468,21 +464,18 @@ export default {
confirmSubmit(){
this.$refs["baseInfo"].validate(valid => {
if (valid) {
let param = Object.assign({},this.baseInfo);
param.outDate = this.formatDateTime(this.baseInfo.outDate)
param.totalAmount=0
let param = Object.assign({},this.baseInfo);
param.totalNum=0
param.status=2
param.imsOutInventoryDetailAddList = []
param.goodsAllocationDetailDTOList = []
this.noMaterial = false;
if(this.materialList.length>0){
this.materialList.forEach(item=>{
if(item.fetchNum==0){
if(item.orderNum==0){
this.noMaterial = true
}else{
let obj = Object.assign({}, item)
param.totalNum = param.totalNum+Number(obj.fetchNum)
param.imsOutInventoryDetailAddList.push(obj)
param.totalNum = param.totalNum+Number(obj.orderNum)
param.goodsAllocationDetailDTOList.push(obj)
}
})
}
@ -498,8 +491,8 @@ export default {
this.$modal.msgError("请添加货品!");
}else{
this.loadingBtn=true;
if (this.baseInfo.outId != undefined) {
editWarehouseOutApi(param).then((response) => {
if (this.baseInfo.goodsTransferId != undefined) {
addGoodsTransferCommitApi(param).then((response) => {
this.$modal.msgSuccess("修改成功");
this.loadingBtn=false
this.jumpList()
@ -507,7 +500,7 @@ export default {
this.loadingBtn=false
});
} else {
addWarehouseOutApi(param).then((response) => {
addGoodsTransferCommitApi(param).then((response) => {
this.$modal.msgSuccess("保存成功");
this.loadingBtn=false
this.jumpList()
@ -524,7 +517,7 @@ export default {
importMaterial(){
if(this.baseInfo.areaId!=undefined||this.baseInfo.warehouseId!=undefined){
if(this.baseInfo.areaId!=undefined||this.baseInfo.outWarehouseId!=undefined){
this.openImportDialog=true
this.resetQuery2()
setTimeout(()=>{
@ -551,7 +544,7 @@ export default {
"pageSize": this.queryParams2.pageSize,
"pageNum": this.queryParams2.pageNum,
"areaId": this.baseInfo.areaId,
"warehouseId": this.baseInfo.warehouseId
"outWarehouseId": this.baseInfo.outWarehouseId
}
fetchMaterialPageApi(param).then(response => {
this.tableListData2 = response.rows;

View File

@ -15,8 +15,8 @@
:picker-options="pickerOptions" >
</el-date-picker>
</el-form-item>
<el-form-item label="调拨单号" prop="transferCode">
<el-input v-model="queryParams.transferCode" placeholder="请输入调拨单号" maxlength="20" clearable style="width: 240px"/>
<el-form-item label="调拨单号" prop="goodsTransferCode">
<el-input v-model="queryParams.goodsTransferCode" placeholder="请输入调拨单号" maxlength="20" clearable style="width: 240px"/>
</el-form-item>
<el-form-item label="所属区域" prop="areaId">
<el-cascader v-model="queryParams.areaId"
@ -28,15 +28,6 @@
}" clearable @change="handleAreaChange">
</el-cascader>
</el-form-item>
<!-- <el-form-item label="货品仓库" prop="warehouseId">
<el-select v-model="queryParams.warehouseId" clearable placeholder="请选择货品仓库" style="width: 100%;">
<el-option v-for="item in wareHouseOptions"
:key="item.warehouseId"
:label="item.warehouseName"
:value="item.warehouseId"
></el-option>
</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>
@ -62,37 +53,37 @@
<span>{{(queryParams.pageNum - 1) * queryParams.pageSize + scope.$index + 1}}</span>
</template>
</el-table-column>
<el-table-column label="调拨单号" align="center" prop="transferCode" :show-overflow-tooltip="true" />
<el-table-column label="调拨单号" align="center" prop="goodsTransferCode" :show-overflow-tooltip="true" />
<el-table-column label="调拨人" align="center" prop="createBy" :show-overflow-tooltip="true" width="120"/>
<el-table-column label="调拨日期" align="center" prop="outDate" :show-overflow-tooltip="true" width="150"/>
<el-table-column label="调拨日期" align="center" prop="" :show-overflow-tooltip="true" width="150"/>
<el-table-column label="调拨区域" align="center" prop="areaName" :show-overflow-tooltip="true" width="120"/>
<el-table-column label="调出仓库" align="center" prop="warehouseName" :show-overflow-tooltip="true" width="120"/>
<el-table-column label="调入仓库" align="center" prop="warehouseName" :show-overflow-tooltip="true" width="120"/>
<el-table-column label="调拨商品种类数量" align="center" prop="totalNum" :show-overflow-tooltip="true" width="150"/>
<el-table-column label="调拨商品总数" align="center" prop="totalNum" :show-overflow-tooltip="true" width="150"/>
<el-table-column label="总金额(元)" align="center" prop="totalAmount" :show-overflow-tooltip="true" width="150">
<el-table-column label="调出仓库" align="center" prop="outWarehouseName" :show-overflow-tooltip="true" width="120"/>
<el-table-column label="调入仓库" align="center" prop="intoWarehouseName" :show-overflow-tooltip="true" width="120"/>
<el-table-column label="调拨商品种类数量" align="center" prop="" :show-overflow-tooltip="true" width="150"/>
<el-table-column label="调拨商品总数" align="center" prop="" :show-overflow-tooltip="true" width="150"/>
<!-- <el-table-column label="总金额(元)" align="center" prop="" :show-overflow-tooltip="true" width="150">
<template slot-scope="scope">
<span>{{ (scope.row.totalAmount/100).toFixed(2) }}</span>
</template>
</el-table-column>
</el-table-column> -->
<el-table-column label="操作" align="center" width="180" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit" v-if="scope.row.status==1"
icon="el-icon-edit" v-if="scope.row.transferStatus==0"
@click="handleUpdate(scope.row)"
>编辑</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-edit" v-if="scope.row.status==2"
icon="el-icon-edit"
@click="handleView(scope.row)"
>详情</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete" v-if="scope.row.status==1"
icon="el-icon-delete" v-if="scope.row.transferStatus==0"
@click="handleDelete(scope.row)"
>删除</el-button>
</template>
@ -127,8 +118,7 @@
<script>
import { systemAreaTreeApi } from "@/api/base/stall";
import { drpWareHousePageApi,systemMaterialTreeApi } from "@/api/foodManage/stockManage";
import { warehouseOutPageApi,delWarehouseOutApi } from "@/api/foodManage/stockManage";
//warehouseOutPageApi getWarehouseOutInfoApi addWarehouseOutApi editWarehouseOutApi delWarehouseOutApi
import { goodsTransferPageApi,delGoodsTransferApi } from "@/api/foodManage/stockManage";
export default {
name: "",
@ -240,20 +230,19 @@ export default {
let param = {
"pageNum": this.queryParams.pageNum,
"pageSize": this.queryParams.pageSize,
"transferCode": this.queryParams.transferCode,
"goodsTransferCode": this.queryParams.goodsTransferCode,
"areaId": this.queryParams.areaId,
"warehouseId": this.queryParams.warehouseId,
"status": this.queryParams.status,
"outType": this.queryParams.outType
// "warehouseId": this.queryParams.warehouseId,
// "outType": this.queryParams.outType
}
if(this.dateRange&&this.dateRange.length>0){
param.startDateTime=this.formatDateTime(this.dateRange[0])
param.endDateTime=this.formatDateTime(this.dateRange[1])
param.startTime=this.formatDateTime(this.dateRange[0])
param.endTime=this.formatDateTime(this.dateRange[1])
}else{
param.startDateTime=undefined;
param.endDateTime=undefined;
param.startTime=undefined;
param.endTime=undefined;
}
warehouseOutPageApi(param).then(response => {
goodsTransferPageApi(param).then(response => {
this.tableListData = response.rows;
this.total = Number(response.total);
this.loading = false;
@ -304,7 +293,7 @@ export default {
/** 删除按钮操作 */
handleDelete(row) {
this.$modal.confirm('是否确认删除数据项?').then(function() {
return delWarehouseOutApi({outIds:[row.outId]});
return delGoodsTransferApi({outIds:[row.outId]});
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");

View File

@ -243,16 +243,16 @@ export default {
"pageSize": this.queryParams.pageSize,
"checkCode": this.queryParams.checkCode,
"areaId": this.queryParams.areaId,
"warehouseId": this.queryParams.warehouseId,
"status": this.queryParams.status,
"intoType": this.queryParams.intoType
// "warehouseId": this.queryParams.warehouseId,
// "status": this.queryParams.status,
// "intoType": this.queryParams.intoType
}
if(this.dateRange&&this.dateRange.length>0){
param.startDateTime=this.formatDateTime(this.dateRange[0])
param.endDateTime=this.formatDateTime(this.dateRange[1])
param.startTime=this.formatDateTime(this.dateRange[0])
param.endTime=this.formatDateTime(this.dateRange[1])
}else{
param.startDateTime=undefined;
param.endDateTime=undefined;
param.startTime=undefined;
param.endTime=undefined;
}
checkInventoryPageApi(param).then(response => {
this.tableListData = response.rows;