货品入库

This commit is contained in:
zzyuan 2025-07-08 17:27:57 +08:00
parent 6d1c1ea20e
commit 895742c594
3 changed files with 136 additions and 72 deletions

View File

@ -55,10 +55,7 @@ export function delWareHouseApi(data) {
method: 'post'
})
}
// 原料类别树
export function systemMaterialTreeApi(data) {
@ -68,6 +65,29 @@ export function systemMaterialTreeApi(data) {
data: data
})
}
// 查询原料列表
export function getMaterialListApi(data) {
return request({
url: '/smart-canteen/cook_material/list',
method: 'get',
headers: {
//"merchant-id":"378915229716713472",
},
params: data
})
}
//查询供应商列表 isPaging 0不分页 2分页
export function supplierPageApi(data) {
return request({
url: '/smart-canteen/ims_supplier/list',
method: 'get',
headers: {
//"merchant-id":"378915229716713472",
},
params:data
})
}
// -------------货品库存---------------
// 查询货品库存列表
@ -92,7 +112,7 @@ export function getStockMaterialListApi(data) {
//查询入库管理主列表
export function warehouseInPageApi(data) {
return request({
url: '/smart-canteen/ims_warehouse_in/list',
url: '/smart-canteen/ims/into-inventory/list',
method: 'post',
headers: {
//"merchant-id":"378915229716713472",
@ -107,7 +127,7 @@ export function warehouseInPageApi(data) {
//获取入库管理详细信息
export function getWarehouseInInfoApi(data) {
return request({
url: '/smart-canteen/ims_warehouse_in/'+data.orderGoodsId,
url: '/smart-canteen/ims/into-inventory/'+data.intoId,
method: 'get',
headers: {
//"merchant-id":"378915229716713472",
@ -117,7 +137,7 @@ export function getWarehouseInInfoApi(data) {
// 新增入库管理
export function addWarehouseInApi(data) {
return request({
url: '/smart-canteen/ims_warehouse_in',
url: '/smart-canteen/ims/into-inventory',
method: 'post',
headers: {
//"merchant-id":"378915229716713472",
@ -128,7 +148,7 @@ export function addWarehouseInApi(data) {
// 修改入库管理
export function editWarehouseInApi(data) {
return request({
url: '/smart-canteen/ims_warehouse_in/edit',
url: '/smart-canteen/ims/into-inventory/edit',
method: 'post',
headers: {
//"merchant-id":"378915229716713472",
@ -139,7 +159,7 @@ export function editWarehouseInApi(data) {
// 删除入库管理
export function delWarehouseInApi(data) {
return request({
url: '/smart-canteen/ims_warehouse_in/del/'+data.orderGoodsIds,
url: '/smart-canteen/ims/into-inventory/del/'+data.intoIds,
method: 'post',
headers: {
//"merchant-id":"378915229716713472",
@ -152,7 +172,7 @@ export function delWarehouseInApi(data) {
//查询出库管理主列表
export function warehouseOutPageApi(data) {
return request({
url: '/smart-canteen/ims_warehouse_out/list',
url: '/smart-canteen/ims/out-inventory/list',
method: 'post',
headers: {
//"merchant-id":"378915229716713472",
@ -167,7 +187,7 @@ export function warehouseOutPageApi(data) {
//获取出库管理详细信息
export function getWarehouseOutInfoApi(data) {
return request({
url: '/smart-canteen/ims_warehouse_out/'+data.orderGoodsId,
url: '/smart-canteen/ims/out-inventory/'+data.outId,
method: 'get',
headers: {
//"merchant-id":"378915229716713472",
@ -177,7 +197,7 @@ export function getWarehouseOutInfoApi(data) {
// 新增出库管理
export function addWarehouseOutApi(data) {
return request({
url: '/smart-canteen/ims_warehouse_out',
url: '/smart-canteen/ims/out-inventory',
method: 'post',
headers: {
//"merchant-id":"378915229716713472",
@ -188,7 +208,7 @@ export function addWarehouseOutApi(data) {
// 修改出库管理
export function editWarehouseOutApi(data) {
return request({
url: '/smart-canteen/ims_warehouse_out/edit',
url: '/smart-canteen/ims/out-inventory/edit',
method: 'post',
headers: {
//"merchant-id":"378915229716713472",
@ -199,7 +219,7 @@ export function editWarehouseOutApi(data) {
// 删除出库管理
export function delWarehouseOutApi(data) {
return request({
url: '/smart-canteen/ims_warehouse_out/del/'+data.orderGoodsIds,
url: '/smart-canteen/ims/out-inventory/del/'+data.outIds,
method: 'post',
headers: {
//"merchant-id":"378915229716713472",

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="inToWareHouseCode">
<el-input v-model="baseInfo.inToWareHouseCode" placeholder="入库单号自动生成" disabled maxlength="20" clearable style="width: 240px"/>
<el-form-item label="入库单号" prop="intoId">
<el-input v-model="baseInfo.intoId" placeholder="入库单号自动生成" disabled maxlength="20" clearable style="width: 240px"/>
</el-form-item>
<el-form-item label="所属区域" prop="areaId">
<el-cascader v-model="baseInfo.areaId"
@ -25,18 +25,18 @@
</el-select>
</el-form-item>
<el-form-item label="入库类型" prop="intoType">
<el-select v-model="queryParams.intoType" placeholder="请选择入库类型" style="width: 240px;">
<el-select v-model="baseInfo.intoType" placeholder="请选择入库类型" style="width: 240px;">
<el-option label="采购入库" :value="1"></el-option>
<el-option label="退料入库" :value="2"></el-option>
<el-option label="即入即出" :value="4"></el-option>
</el-select>
</el-form-item>
<el-form-item label="入库时间" prop="inToWareHouseTime">
<el-form-item label="入库时间" prop="intoDate">
<el-date-picker
v-model="baseInfo.inToWareHouseTime"
v-model="baseInfo.intoDate"
type="datetime" align="right"
format="yyyy-MM-dd HH:mm:ss" style="width: 240px;"
:picker-options="pickerOptions" @change="baseInfo.inToWareHouseTime=formatDateTime(baseInfo.inToWareHouseTime)">
:picker-options="pickerOptions" @change="baseInfo.intoDate=formatDateTime(baseInfo.intoDate)">
</el-date-picker>
</el-form-item>
<el-form-item label="备注" prop="remark">
@ -65,26 +65,49 @@
<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="singlePrice" :show-overflow-tooltip="true">
<el-table-column label="供应商" align="center" prop="supplierId" :show-overflow-tooltip="true" width="150">
<template slot-scope="scope">
<el-input v-model="scope.row.singlePrice" placeholder="请输入" maxlength="10" clearable @input="(v)=>(scope.row.singlePrice=v.replace(/[^\d.]/g,''))"/>
<el-select v-model="scope.row.supplierId" placeholder="请选择供应商" style="width: 100%;">
<el-option v-for="item in supplierOptions"
:key="item.supplierId"
:label="item.supplierName"
:value="item.supplierId"
></el-option>
</el-select>
</template>
</el-table-column>
<el-table-column label="数量" align="center" prop="orderNum" :show-overflow-tooltip="true">
<el-table-column label="生产日期" align="center" prop="productDate" :show-overflow-tooltip="true" width="160">
<template slot-scope="scope">
<el-input v-model.number="scope.row.orderNum" placeholder="请输入" maxlength="10" clearable @input="(v)=>(scope.row.orderNum=v.replace(/[^\d]/g,''))"/>
<el-date-picker
v-model="scope.row.productDate"
type="date" style="width: 100%;"
align="right" value-format="yyyy-MM-dd"
format="yyyy-MM-dd" @change="scope.row.productDate=formatDate(scope.row.productDate)"
:picker-options="pickerOptions3" >
</el-date-picker>
</template>
</el-table-column>
<el-table-column label="总金额(元)" align="center" prop="" :show-overflow-tooltip="true">
<el-table-column label="保质期截止日期" align="center" prop="expireTime" :show-overflow-tooltip="true" width="180">
<template slot-scope="scope">
<span>{{ scope.row.orderNum*scope.row.singlePrice }}</span>
<el-date-picker
v-model="scope.row.expireTime"
type="date" style="width: 100%;"
align="right" value-format="yyyy-MM-dd"
format="yyyy-MM-dd" @change="scope.row.expireTime=formatDate(scope.row.expireTime)"
:picker-options="pickerOptions2" >
</el-date-picker>
</template>
</el-table-column>
<el-table-column label="备注" align="center" prop="remark" :show-overflow-tooltip="true">
<el-table-column label="单价(元)" align="center" prop="unitPrice" :show-overflow-tooltip="true">
<template slot-scope="scope">
<el-input v-model="scope.row.remark" placeholder="请输入" maxlength="20" clearable/>
<el-input v-model="scope.row.unitPrice" placeholder="请输入" maxlength="10" clearable @input="(v)=>(scope.row.unitPrice=v.replace(/[^\d.]/g,''))"/>
</template>
</el-table-column>
<el-table-column label="入库数量" align="center" prop="purNum" :show-overflow-tooltip="true">
<template slot-scope="scope">
<el-input v-model.number="scope.row.purNum" placeholder="请输入" maxlength="10" clearable @input="(v)=>(scope.row.purNum=v.replace(/[^\d]/g,''))"/>
</template>
</el-table-column>
</el-table>
</div>
</div>
@ -163,7 +186,7 @@
<script>
import { imgUpLoadTwo } from '@/api/system/upload'
import { systemAreaTreeApi } from "@/api/base/stall";
import { systemMaterialTreeApi,getMaterialListApi,drpWareHousePageApi } from "@/api/foodManage/stockManage";
import { systemMaterialTreeApi,getMaterialListApi,drpWareHousePageApi,supplierPageApi } from "@/api/foodManage/stockManage";
import { getWarehouseInInfoApi,addWarehouseInApi,editWarehouseInApi } from "@/api/foodManage/stockManage";
export default {
name: "WarehouseInEdit",
@ -192,14 +215,14 @@ export default {
supplierId: [
{ required: true, message: "供应商不能为空", trigger: "change" }
],
inToWareHouseTime: [
intoDate: [
{ required: true, message: "入库时间不能为空", trigger: "change" }
],
warehouseId: [
{ required: true, message: "货品仓库不能为空", trigger: "change" }
],
supplyAddress: [
{ required: true, message: "详细地址不能为空", trigger: "change" }
],
intoType: [
{ required: true, message: "入库类型不能为空", trigger: "change" }
]
},
treeAreaOptions:[],
@ -220,6 +243,17 @@ export default {
pageNum: 1,
pageSize: 10,
},
pickerOptions2: {
disabledDate(v) {
return v.getTime() < (new Date().getTime() - 86400000) ||v.getTime() > (new Date().getTime() + 3600 * 1000 * 24 * 60);// - 86400000
}
},
pickerOptions3: {
disabledDate(v) {
return v.getTime() > (new Date().getTime() - 86400000) ||v.getTime() > (new Date().getTime() + 3600 * 1000 * 24 * 60);// - 86400000
}
},
total: 0, //
tableListData: [],//-
batchChosenMaterial:[],//--
@ -250,9 +284,9 @@ export default {
//
getWarehouseInInfoApi(param).then((response) => {
this.baseInfo = response.data;
this.materialList = this.baseInfo.orderGoodsDetailList;
this.materialList = this.baseInfo.imsIntoInventoryDetailAddList;
this.materialList.forEach(item=>{
this.$set(item,"singlePrice",Number(item.singlePrice)/100)
this.$set(item,"unitPrice",Number(item.unitPrice)/100)
})
drpWareHousePageApi({ areaId:this.baseInfo.areaId }).then((response) => {
this.wareHouseOptions = response.rows||[];
@ -276,6 +310,7 @@ export default {
//-
handleAreaChange(e){
this.getWareHouseData()
this.getSupplierData()
},
/** 查询供应商下拉结构 */
getWareHouseData() {
@ -284,6 +319,12 @@ export default {
this.$set(this.baseInfo,'warehouseId',null)
});
},
/** 查询供应商下拉结构 */
getSupplierData() {
supplierPageApi({ isPaging:1,areaIdList:[] }).then((response) => {
this.supplierOptions = response.rows||[];
});
},
/** 查询货品类别下拉树结构 */
getMaterialTree() {
let param = {
@ -353,8 +394,9 @@ export default {
handleSelectionChange2(selection) {
this.batchChosenMaterial = selection;
this.batchChosenMaterial.forEach(item=>{
this.$set(item,"orderNum",0)
this.$set(item,"singlePrice",item.unitPrice/100)
this.$set(item,"purNum",0)
this.$set(item,"supplierId",null)
this.$set(item,"unitPrice",item.unitPrice)
})
},
confirmChosen(){
@ -372,28 +414,28 @@ export default {
this.$refs["baseInfo"].validate(valid => {
if (valid) {
let param = Object.assign({},this.baseInfo);
param.inToWareHouseTime = this.formatDateTime(this.baseInfo.inToWareHouseTime)
param.intoDate = this.formatDateTime(this.baseInfo.intoDate)
param.orderAmount=0
param.totalNum=0
param.status=1
param.orderGoodsDetailList = []
param.imsIntoInventoryDetailAddList = []
this.noMaterial = false;
if(this.materialList.length>0){
this.materialList.forEach(item=>{
if(item.singlePrice==0 || item.orderNum==0){
if(item.unitPrice==0 || item.purNum==0 || item.supplierId==null || !item.productDate|| !item.expireTime){
this.noMaterial = true
}else{
let obj = Object.assign({}, item)
obj.singlePrice = Number(obj.singlePrice)*100
obj.totalPrice = (Number(obj.singlePrice)*Number(obj.orderNum))
param.orderAmount = param.orderAmount+obj.totalPrice;
param.totalNum = param.totalNum+Number(obj.orderNum)
param.orderGoodsDetailList.push(obj)
obj.unitPrice = Number(obj.unitPrice)*100
obj.totalPrice = (Number(obj.unitPrice)*Number(obj.purNum))
param.totalAmount = param.orderAmount+obj.totalPrice;
param.totalNum = param.totalNum+Number(obj.purNum)
param.imsIntoInventoryDetailAddList.push(obj)
}
})
}
if(this.noMaterial){
this.$modal.msgError("请输入单价和数量");
this.$modal.msgError("表格数据请填写完整");
}else{
this.noMaterial = true;
if(this.materialList.length>0){
@ -432,28 +474,28 @@ export default {
this.$refs["baseInfo"].validate(valid => {
if (valid) {
let param = Object.assign({},this.baseInfo);
param.inToWareHouseTime = this.formatDateTime(this.baseInfo.inToWareHouseTime)
param.intoDate = this.formatDateTime(this.baseInfo.intoDate)
param.orderAmount=0
param.totalNum=0
param.status=2
param.orderGoodsDetailList = []
param.imsIntoInventoryDetailAddList = []
this.noMaterial = false;
if(this.materialList.length>0){
this.materialList.forEach(item=>{
if(item.singlePrice==0 || item.orderNum==0){
if(item.unitPrice==0 || item.purNum==0 || item.supplierId==null || !item.productDate|| !item.expireTime){
this.noMaterial = true
}else{
let obj = Object.assign({}, item)
obj.singlePrice = Number(obj.singlePrice)*100
obj.totalPrice = (Number(obj.singlePrice)*Number(obj.orderNum))
param.orderAmount = param.orderAmount+obj.totalPrice;
param.totalNum = param.totalNum+Number(obj.orderNum)
param.orderGoodsDetailList.push(obj)
obj.unitPrice = Number(obj.unitPrice)*100
obj.totalPrice = (Number(obj.unitPrice)*Number(obj.purNum))
param.totalAmount = param.orderAmount+obj.totalPrice;
param.totalNum = param.totalNum+Number(obj.purNum)
param.imsIntoInventoryDetailAddList.push(obj)
}
})
}
if(this.noMaterial){
this.$modal.msgError("请输入单价和数量");
this.$modal.msgError("表格数据请填写完整");
}else{
this.noMaterial = true;
if(this.materialList.length>0){

View File

@ -15,8 +15,8 @@
:picker-options="pickerOptions" >
</el-date-picker>
</el-form-item>
<el-form-item label="入库单号" prop="inToWareHouseCode">
<el-input v-model="queryParams.inToWareHouseCode" placeholder="请输入入库单号" maxlength="20" clearable style="width: 240px"/>
<el-form-item label="入库单号" prop="intoId">
<el-input v-model="queryParams.intoId" placeholder="请输入入库单号" maxlength="20" clearable style="width: 240px"/>
</el-form-item>
<el-form-item label="入库状态" prop="status">
<el-select v-model="queryParams.status" placeholder="请选择入库状态" style="width: 240px;">
@ -79,37 +79,39 @@
<span>{{(queryParams.pageNum - 1) * queryParams.pageSize + scope.$index + 1}}</span>
</template>
</el-table-column>
<el-table-column label="入库单号" align="center" prop="inToWareHouseCode" :show-overflow-tooltip="true" />
<el-table-column label="入库单号" align="center" prop="intoId" :show-overflow-tooltip="true" />
<el-table-column label="入库状态" align="center" prop="status" :show-overflow-tooltip="true" width="100">
<template slot-scope="scope">
<span v-if="scope.row.status==1">提交</span>
<span v-if="scope.row.status==2">提交</span>
<span v-if="scope.row.status==1">入库</span>
<span v-if="scope.row.status==2">入库</span>
</template>
</el-table-column>
<el-table-column label="所属区域" align="center" prop="areaName" :show-overflow-tooltip="true" width="120"/>
<el-table-column label="货品仓库" align="center" prop="canteenName" :show-overflow-tooltip="true" width="120"/>
<el-table-column label="入库类型" align="center" prop="supplierConfirmStatus" :show-overflow-tooltip="true" width="100">
<el-table-column label="入库类型" align="center" prop="intoType" :show-overflow-tooltip="true" width="100">
<template slot-scope="scope">
<span v-if="scope.row.supplierConfirmStatus==1">待确认</span>
<span v-if="scope.row.supplierConfirmStatus==2">确认通过</span>
<span v-if="scope.row.supplierConfirmStatus==3">已拒绝</span>
<span v-if="scope.row.intoType==1">采购入库</span>
<span v-if="scope.row.intoType==2">退料入库</span>
<span v-if="scope.row.intoType==3">调拨入库</span>
<span v-if="scope.row.intoType==4">即入即出</span>
<span v-if="scope.row.intoType==5">超市退单入库</span>
<span v-if="scope.row.intoType==6">盘点入库</span>
<span v-if="scope.row.intoType==7">期初入库</span>
</template>
</el-table-column>
<el-table-column label="质检报告" align="center" prop="status" :show-overflow-tooltip="true" width="100">
<template slot-scope="scope">
<el-table-column label="质检报告" align="center" prop="" :show-overflow-tooltip="true" width="100">
<!-- <template slot-scope="scope">
<span v-if="scope.row.status==1">待提交</span>
<span v-if="scope.row.status==2">已提交</span>
</template>
</el-table-column>
</template> -->
</el-table-column>
<el-table-column label="总金额(元)" align="center" prop="orderAmount" :show-overflow-tooltip="true" width="120">
<template slot-scope="scope">
<span>{{ (scope.row.orderAmount/100).toFixed(2) }}</span>
</template>
</el-table-column>
<el-table-column label="总数量" align="center" prop="totalNum" :show-overflow-tooltip="true" width="100"/>
<el-table-column label="入库时间" align="center" prop="requestArrivalTime" :show-overflow-tooltip="true" width="150"/>
<el-table-column label="入库时间" align="center" prop="requestArrivalTime" :show-overflow-tooltip="true" width="150"/>
<el-table-column label="关联单号" align="center" prop="" :show-overflow-tooltip="true" width="120"/>
<el-table-column label="操作人" align="center" prop="" :show-overflow-tooltip="true" width="120"/>
<el-table-column label="操作时间" align="center" prop="" :show-overflow-tooltip="true" width="150"/>
@ -283,7 +285,7 @@ export default {
let param = {
"pageNum": this.queryParams.pageNum,
"pageSize": this.queryParams.pageSize,
"inToWareHouseCode": this.queryParams.inToWareHouseCode,
"intoId": this.queryParams.intoId,
"areaId": this.queryParams.areaId,
"canteenId": this.queryParams.canteenId,
"stallId": this.queryParams.stallId,