领料单

This commit is contained in:
zzyuan 2025-07-09 13:08:48 +08:00
parent 7312804b10
commit ca41d8aab9
4 changed files with 297 additions and 222 deletions

View File

@ -0,0 +1,151 @@
import request from '@/utils/request'
// 原料类别树
export function systemMaterialTreeApi(data) {
return request({
url: '/smart-canteen/cook_material_type/getTree',
method: 'post',
data: data
})
}
// 查询原料列表
export function getMaterialListApi(data) {
return request({
url: '/smart-canteen/cook_material/list',
method: 'get',
headers: {
//"merchant-id":"378915229716713472",
},
params: data
})
}
// 查询货品库存列表
export function getStockMaterialListApi(data) {
return request({
url: '/smart-canteen/ims/inventory/list',
method: 'post',
headers: {
//"merchant-id":"378915229716713472",
},
data: data,
params:{
pageNum:data.pageNum,
pageSize:data.pageSize
}
})
}
//查询供应商列表 isPaging 0不分页 2分页
export function supplierPageApi(data) {
return request({
url: '/smart-canteen/ims_supplier/list',
method: 'get',
headers: {
//"merchant-id":"378915229716713472",
},
params:data
})
}
// 仓库
export function drpWareHousePageApi(data) {
return request({
url: '/smart-canteen/ims_warehouse_info/listAll',
method: 'get',
headers: {
//"merchant-id":"378915229716713472",
},
params: data
})
}
// -------------领料单---------------
//获取领料单分页列表
export function fetchMaterialPageApi(data) {
return request({
url: '/smart-canteen/ims_fetch_material/list',
method: 'get',
headers: {
//"merchant-id":"378915229716713472",
},
params:data
})
}
//获取领料单详情
export function getFetchMaterialInfoApi(data) {
return request({
url: '/smart-canteen/ims_fetch_material/page-detail',
method: 'get',
headers: {
//"merchant-id":"378915229716713472",
},
params:data
})
}
// 新增领料单-保存
export function addFetchMaterialApi(data) {
return request({
url: '/smart-canteen/ims_fetch_material/save',
method: 'post',
headers: {
//"merchant-id":"378915229716713472",
},
data: data
})
}
// 编辑领料单-提交
export function editFetchMaterialApi(data) {
return request({
url: '/smart-canteen/ims_fetch_material/commit',
method: 'post',
headers: {
//"merchant-id":"378915229716713472",
},
data: data
})
}
// 删除领料单
export function delFetchMaterialApi(data) {
return request({
url: '/smart-canteen/ims_fetch_material/remove/'+data.fetchMaterialId,
method: 'post',
headers: {
//"merchant-id":"378915229716713472",
}
})
}

View File

@ -4,19 +4,19 @@
<el-descriptions style="margin-bottom: 20px;" title="基本信息" :column="4" size="medium" border>
<el-descriptions-item>
<template slot="label">领料单号</template>
{{baseInfo.orderGoodsCode}}
{{baseInfo.fetchMaterialCode}}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">领料单标题</template>
{{ baseInfo.orderTitle }}
{{ baseInfo.title }}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">领料日期</template>
{{ baseInfo.requestArrivalTime }}
{{ baseInfo.fetchMaterialTime }}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">领料人</template>
{{ baseInfo.pickMan }}
{{ baseInfo.fetchUser }}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">所属区域</template>
@ -51,31 +51,18 @@
</div>
</div>
<div style="width: 100%;height: 400px;overflow-y: auto;">
<el-table v-loading="loading" :data="materialLis" ref="multipleTable" height="380" :row-key="(row)=>{return row.materialId}" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="50" align="center" :reserve-selection="true" />
<el-table v-loading="loading" :data="materialList" ref="multipleTable" height="380" :row-key="(row)=>{return row.materialId}" @selection-change="handleSelectionChange">
<!-- <el-table-column type="selection" width="50" align="center" :reserve-selection="true" /> -->
<el-table-column label="序号" align="center" width="80" type="index" />
<!-- <el-table-column label="图片" align="center" prop="" :show-overflow-tooltip="true" /> -->
<el-table-column label="货品编码" align="center" prop="materialCode" :show-overflow-tooltip="true" />
<el-table-column label="货品名称" align="center" prop="materialName" :show-overflow-tooltip="true" />
<el-table-column label="货品类别" align="center" prop="materialTypeName" :show-overflow-tooltip="true" />
<el-table-column label="计量单位" align="center" prop="unitName" :show-overflow-tooltip="true" />
<el-table-column label="货品规格" align="center" prop="size" :show-overflow-tooltip="true">
<!-- <template slot-scope="scope">
<span v-if="scope.row.salesMode==1">按份</span>
<span v-if="scope.row.salesMode==2">称重</span>
</template> -->
</el-table-column>
<el-table-column label="单价(元)" align="center" prop="singlePrice" :show-overflow-tooltip="true">
<template slot-scope="scope">
<span>{{ (scope.row.singlePrice/100).toFixed(2) }}</span>
</template>
</el-table-column>
<el-table-column label="数量" align="center" prop="orderNum" :show-overflow-tooltip="true"></el-table-column>
<el-table-column label="总金额(元)" align="center" prop="" :show-overflow-tooltip="true">
<template slot-scope="scope">
<span>{{ scope.row.orderNum*scope.row.singlePrice }}</span>
</template>
</el-table-column>
<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="stallName" :show-overflow-tooltip="true"/>
<el-table-column label="货品数量" align="center" prop="fetchNum" :show-overflow-tooltip="true"></el-table-column>
<el-table-column label="备注" align="center" prop="remark" :show-overflow-tooltip="true"></el-table-column>
</el-table>
</div>
@ -87,10 +74,8 @@
</div>
</template>
<script>
import { getCanteenByAreaApi, } from "@/api/base/stall";
import { supplierPageApi } from "@/api/foodManage/purchaseManage";
import { getPurchaseOrderInfoApi } from "@/api/foodManage/purchaseManage";
<script>
import { getFetchMaterialInfoApi } from "@/api/foodManage/pickManage";
export default {
name: "orderDetail",
dicts: [],
@ -100,7 +85,7 @@ export default {
loading:false,
loadingBtn:false,
baseInfo: {
orderTitle:undefined,
title:undefined,
contractType:undefined,
areaId:undefined,
canteenId:undefined,
@ -108,7 +93,7 @@ export default {
},
//
baseRules: {
orderTitle: [
title: [
{ required: true, message: "菜谱名称不能为空", trigger: "blur" }
],
areaId: [
@ -137,7 +122,7 @@ export default {
return v.getTime() < (new Date().getTime() - 86400000);// - 86400000
}
},
materialLis:[],
materialList:[],
openDialog:false,
materialTreeOptions:[],
//
@ -169,12 +154,12 @@ export default {
getContractInfo(){
console.log(this.pageJson)
let param = {
orderGoodsId:this.pageJson.orderGoodsId
fetchMaterialId:this.pageJson.fetchMaterialId
}
//
getPurchaseOrderInfoApi(param).then((response) => {
this.baseInfo = response.data;
this.materialLis = this.baseInfo.orderGoodsDetailList;
getFetchMaterialInfoApi(param).then((response) => {
this.baseInfo = this.pageJson;
this.materialList = response.rows;
});
},
//

View File

@ -2,22 +2,22 @@
<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="orderGoodsCode">
<el-input v-model="baseInfo.orderGoodsCode" placeholder="领料单号自动生成" disabled maxlength="20" clearable style="width: 240px"/>
<el-form-item label="领料单号" prop="fetchMaterialCode">
<el-input v-model="baseInfo.fetchMaterialCode" placeholder="领料单号自动生成" disabled maxlength="20" clearable style="width: 240px"/>
</el-form-item>
<el-form-item label="领料单标题" prop="orderTitle">
<el-input v-model="baseInfo.orderTitle" placeholder="请输入领料单标题" maxlength="20" clearable style="width: 240px"/>
<el-form-item label="领料单标题" prop="title">
<el-input v-model="baseInfo.title" placeholder="请输入领料单标题" maxlength="20" clearable style="width: 240px"/>
</el-form-item>
<el-form-item label="领料日期" prop="pickingTime">
<el-form-item label="领料日期" prop="fetchMaterialTime">
<el-date-picker
v-model="baseInfo.pickingTime"
v-model="baseInfo.fetchMaterialTime"
type="datetime" align="right"
format="yyyy-MM-dd HH:mm:ss" style="width: 240px;"
:picker-options="pickerOptions" @change="baseInfo.pickingTime=formatDateTime(baseInfo.pickingTime)">
:picker-options="pickerOptions" @change="baseInfo.fetchMaterialTime=formatDateTime(baseInfo.fetchMaterialTime)">
</el-date-picker>
</el-form-item>
<el-form-item label="领料人" prop="pickMan">
<el-input v-model="baseInfo.pickMan" placeholder="请输入领料人" maxlength="20" clearable style="width: 240px"/>
<el-form-item label="领料人" prop="fetchUser">
<el-input v-model="baseInfo.fetchUser" placeholder="请输入领料人" maxlength="20" clearable style="width: 240px"/>
</el-form-item>
<el-form-item label="所属区域" prop="areaId">
<el-cascader v-model="baseInfo.areaId"
@ -39,7 +39,7 @@
</el-select>
</el-form-item>
<el-form-item label="所属档口" prop="stallId">
<el-select v-model="baseInfo.stallId" placeholder="请选择所属档口" style="width: 240px;">
<el-select v-model="baseInfo.stallId" placeholder="请选择所属档口" style="width: 240px;" @change="handleStallChange">
<el-option v-for="item in stallOptions"
:key="item.stallId"
:label="item.stallName"
@ -77,27 +77,14 @@
<el-table-column label="货品名称" align="center" prop="materialName" :show-overflow-tooltip="true" />
<el-table-column label="货品类别" align="center" prop="materialTypeName" :show-overflow-tooltip="true" />
<el-table-column label="计量单位" align="center" prop="unitName" :show-overflow-tooltip="true" />
<el-table-column label="货品规格" align="center" prop="size" :show-overflow-tooltip="true">
<!-- <template slot-scope="scope">
<span v-if="scope.row.salesMode==1">按份</span>
<span v-if="scope.row.salesMode==2">称重</span>
</template> -->
</el-table-column>
<el-table-column label="单价(元)" align="center" prop="singlePrice" :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="stallName" :show-overflow-tooltip="true"/>
<el-table-column label="货品数量" align="center" prop="fetchNum" :show-overflow-tooltip="true">
<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-input v-model.number="scope.row.fetchNum" placeholder="请输入" maxlength="10" clearable @input="(v)=>(scope.row.fetchNum=v.replace(/[^\d]/g,''))"/>
</template>
</el-table-column>
<el-table-column label="数量" align="center" prop="orderNum" :show-overflow-tooltip="true">
<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,''))"/>
</template>
</el-table-column>
<el-table-column label="总金额(元)" align="center" prop="" :show-overflow-tooltip="true">
<template slot-scope="scope">
<span>{{ scope.row.orderNum*scope.row.singlePrice }}</span>
</template>
</el-table-column>
</el-table-column>
<el-table-column label="备注" align="center" prop="remark" :show-overflow-tooltip="true">
<template slot-scope="scope">
<el-input v-model="scope.row.remark" placeholder="请输入" maxlength="20" clearable/>
@ -156,11 +143,7 @@
<span v-if="scope.row.salesMode==2">称重</span>
</template> -->
</el-table-column>
<el-table-column label="单价(元)" align="center" prop="unitPrice" :show-overflow-tooltip="true">
<template slot-scope="scope">
<span>{{ (scope.row.unitPrice/100).toFixed(2)||"" }}</span>
</template>
</el-table-column>
<el-table-column label="货品库存" align="center" prop="materialNum" :show-overflow-tooltip="true" />
</el-table>
<pagination
v-show="total>0"
@ -181,8 +164,8 @@
<script>
import { imgUpLoadTwo } from '@/api/system/upload'
import { systemAreaTreeApi,getCanteenByAreaApi,getStallByCanteenApi } from "@/api/base/stall";
import { systemMaterialTreeApi,getMaterialListApi,supplierPageApi,drpWareHousePageApi } from "@/api/foodManage/purchaseManage";
import { getPurchaseOrderInfoApi,addPurchaseOrderApi,editPurchaseOrderApi } from "@/api/foodManage/purchaseManage";
import { systemMaterialTreeApi,getStockMaterialListApi,drpWareHousePageApi } from "@/api/foodManage/pickManage";
import { getFetchMaterialInfoApi,addFetchMaterialApi,editFetchMaterialApi } from "@/api/foodManage/pickManage";
export default {
name: "orderEdit",
dicts: [],
@ -192,14 +175,14 @@ export default {
loading:false,
loadingBtn:false,
baseInfo: {
orderTitle:undefined,
title:undefined,
contractType:undefined,
areaId:undefined,
canteenId:undefined,
},
//
baseRules: {
orderTitle: [
title: [
{ required: true, message: "领料单标题不能为空", trigger: "blur" }
],
areaId: [
@ -214,14 +197,14 @@ export default {
supplierId: [
{ required: true, message: "供应商不能为空", trigger: "change" }
],
pickingTime: [
fetchMaterialTime: [
{ required: true, message: "交货时间不能为空", trigger: "change" }
],
warehouseId: [
{ required: true, message: "领料仓库不能为空", trigger: "change" }
],
supplyAddress: [
{ required: true, message: "详细地址不能为空", trigger: "change" }
fetchUser: [
{ required: true, message: "领料人不能为空", trigger: "change" }
]
},
treeAreaOptions:[],
@ -267,15 +250,15 @@ export default {
getContractInfo(){
console.log(this.pageJson)
let param = {
orderGoodsId:this.pageJson.orderGoodsId
fetchMaterialId:this.pageJson.fetchMaterialId
}
//
getPurchaseOrderInfoApi(param).then((response) => {
this.baseInfo = response.data;
this.materialList = this.baseInfo.orderGoodsDetailList;
this.materialList.forEach(item=>{
this.$set(item,"singlePrice",Number(item.singlePrice)/100)
})
getFetchMaterialInfoApi(param).then((response) => {
this.baseInfo = this.pageJson;
this.materialList = response.rows;
// this.materialList.forEach(item=>{
// this.$set(item,"singlePrice",Number(item.singlePrice)/100)
// })
getCanteenByAreaApi({areaId:this.baseInfo.areaId}).then((response) => {
this.canteenOptions=response.rows||[];
this.$set(this.baseInfo,"canteenId",this.baseInfo.canteenId)
@ -283,11 +266,7 @@ export default {
getStallByCanteenApi({ canteenId:this.baseInfo.canteenId }).then((response) => {
this.stallOptions=response.rows||[]
this.$set(this.baseInfo,"stallId",this.baseInfo.stallId)
});
supplierPageApi({ isPaging:1,areaIdList:[this.baseInfo.areaId] }).then((response) => {
this.supplierOptions = response.rows||[];
this.$set(this.baseInfo,'supplierId',this.baseInfo.supplierId)
});
});
drpWareHousePageApi({ areaId:this.baseInfo.areaId }).then((response) => {
this.wareHouseOptions = response.rows||[];
this.$set(this.baseInfo,'warehouseId',this.baseInfo.warehouseId)
@ -309,8 +288,7 @@ export default {
},
//-
handleAreaChange(e){
this.getCanteenData()
this.getSupplierData()
this.getCanteenData()
this.getWareHouseData()
},
/** 查询查询食堂下拉结构 */
@ -322,15 +300,8 @@ export default {
this.canteenOptions=response.rows||[];
this.$set(this.baseInfo,"canteenId",null)
});
},
/** 查询供应商下拉结构 */
getSupplierData() {
supplierPageApi({ isPaging:1,areaIdList:[this.baseInfo.areaId] }).then((response) => {
this.supplierOptions = response.rows||[];
this.$set(this.baseInfo,"supplierId",null)
});
},
/** 查询供应商下拉结构 */
},
/** 查询仓库下拉结构 */
getWareHouseData() {
drpWareHousePageApi({ areaId:this.baseInfo.areaId }).then((response) => {
this.wareHouseOptions = response.rows||[];
@ -340,7 +311,7 @@ export default {
//-
handleCanteenChange(e){
this.getStallData()
},
},
/** 查询档口下拉结构 */
getStallData() {
let param= {
@ -351,6 +322,14 @@ export default {
this.$set(this.baseInfo,"stallId",null)
});
},
handleStallChange(e){
console.log(e)
this.stallOptions.forEach(item=>{
if(item.stallId==e){
this.$set(this.baseInfo,"stallName",item.stallName)
}
})
},
/** 查询货品类别下拉树结构 */
getMaterialTree() {
let param = {
@ -379,14 +358,14 @@ export default {
},
//
addMaterial(){
if(this.baseInfo.areaId!=undefined){
if(this.baseInfo.areaId!=undefined||this.baseInfo.warehouseId!=undefined){
this.openDialog=true
this.resetQuery()
setTimeout(()=>{
this.$refs.multipleTable1.clearSelection()
},300)
}else{
this.$modal.msgError("请先选择区域");
this.$modal.msgError("请先选择区域,仓库");
}
},
@ -406,12 +385,13 @@ export default {
let param = {
"pageSize": this.queryParams.pageSize,
"pageNum": this.queryParams.pageNum,
"areaId": this.queryParams.areaId,
"areaId": this.baseInfo.areaId,
"warehouseId": this.baseInfo.warehouseId,
"materialName": this.queryParams.materialName,
"materialCode": this.queryParams.materialCode,
"materialTypeIds": this.queryParams.materialTypeIds,
}
getMaterialListApi(param).then(response => {
getStockMaterialListApi(param).then(response => {
this.tableListData = response.rows;
this.total = Number(response.total);
this.loading = false;
@ -420,8 +400,10 @@ 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,"fetchNum",0)
this.$set(item,"stallId",this.baseInfo.stallId)
this.$set(item,"stallName",this.baseInfo.stallName)
// this.$set(item,"singlePrice",item.unitPrice/100)
})
},
confirmChosen(){
@ -439,28 +421,26 @@ export default {
this.$refs["baseInfo"].validate(valid => {
if (valid) {
let param = Object.assign({},this.baseInfo);
param.pickingTime = this.formatDateTime(this.baseInfo.pickingTime)
param.orderAmount=0
param.totalNum=0
param.orderStatus=1
param.orderGoodsDetailList = []
param.fetchMaterialTime = this.formatDateTime(this.baseInfo.fetchMaterialTime)
param.totalNum=0
param.detailList = []
this.noMaterial = false;
if(this.materialList.length>0){
this.materialList.forEach(item=>{
if(item.singlePrice==0 || item.orderNum==0){
if(item.fetchNum==0){
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.singlePrice = Number(obj.singlePrice)*100
// obj.totalPrice = (Number(obj.singlePrice)*Number(obj.fetchNum))
// param.orderAmount = param.orderAmount+obj.totalPrice;
param.totalNum = param.totalNum+Number(obj.fetchNum)
param.detailList.push(obj)
}
})
}
if(this.noMaterial){
this.$modal.msgError("请输入单价和数量!");
this.$modal.msgError("请输入货品数量!");
}else{
this.noMaterial = true;
if(this.materialList.length>0){
@ -470,25 +450,14 @@ export default {
if(this.noMaterial){
this.$modal.msgError("请添加货品!");
}else{
this.loadingBtn=true;
if (this.baseInfo.orderGoodsId != undefined) {
editPurchaseOrderApi(param).then((response) => {
this.$modal.msgSuccess("修改成功");
this.loadingBtn=false
this.jumpList()
}).catch(() => {
this.loadingBtn=false
});
} else {
addPurchaseOrderApi(param).then((response) => {
this.$modal.msgSuccess("保存成功");
this.loadingBtn=false
this.jumpList()
}).catch(() => {
this.loadingBtn=false
});
}
this.loadingBtn=true;
addFetchMaterialApi(param).then((response) => {
this.$modal.msgSuccess("保存成功");
this.loadingBtn=false
this.jumpList()
}).catch(() => {
this.loadingBtn=false
});
}
}
}
@ -499,28 +468,26 @@ export default {
this.$refs["baseInfo"].validate(valid => {
if (valid) {
let param = Object.assign({},this.baseInfo);
param.pickingTime = this.formatDateTime(this.baseInfo.pickingTime)
param.orderAmount=0
param.totalNum=0
param.orderStatus=2
param.orderGoodsDetailList = []
param.fetchMaterialTime = this.formatDateTime(this.baseInfo.fetchMaterialTime)
param.totalNum=0
param.detailList = []
this.noMaterial = false;
if(this.materialList.length>0){
this.materialList.forEach(item=>{
if(item.singlePrice==0 || item.orderNum==0){
if(item.fetchNum==0){
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.singlePrice = Number(obj.singlePrice)*100
// obj.totalPrice = (Number(obj.singlePrice)*Number(obj.fetchNum))
// param.orderAmount = param.orderAmount+obj.totalPrice;
param.totalNum = param.totalNum+Number(obj.fetchNum)
param.detailList.push(obj)
}
})
}
if(this.noMaterial){
this.$modal.msgError("请输入单价和数量!");
this.$modal.msgError("请输入货品数量!");
}else{
this.noMaterial = true;
if(this.materialList.length>0){
@ -530,27 +497,17 @@ export default {
if(this.noMaterial){
this.$modal.msgError("请添加货品!");
}else{
this.loadingBtn=true;
if (this.baseInfo.orderGoodsId != undefined) {
editPurchaseOrderApi(param).then((response) => {
this.$modal.msgSuccess("修改成功");
this.loadingBtn=false
this.jumpList()
}).catch(() => {
this.loadingBtn=false
});
} else {
addPurchaseOrderApi(param).then((response) => {
this.$modal.msgSuccess("保存成功");
this.loadingBtn=false
this.jumpList()
}).catch(() => {
this.loadingBtn=false
});
}
this.loadingBtn=true;
editFetchMaterialApi(param).then((response) => {
this.$modal.msgSuccess("保存成功");
this.loadingBtn=false
this.jumpList()
}).catch(() => {
this.loadingBtn=false
});
}
}
}
});
},

View File

@ -17,12 +17,9 @@
:default-time="['00:00:00', '23:59:59']"
:picker-options="pickerOptions" >
</el-date-picker>
</el-form-item>
<el-form-item label="关键字" prop="searchValue">
<el-input v-model="queryParams.searchValue" placeholder="请输入领料单号,标题" maxlength="20" clearable style="width: 240px"/>
</el-form-item>
<el-form-item label="提交状态" prop="orderStatus">
<el-select v-model="queryParams.orderStatus" placeholder="请选择提交状态" style="width: 240px;">
</el-form-item>
<el-form-item label="提交状态" prop="commitStatus">
<el-select v-model="queryParams.commitStatus" placeholder="请选择提交状态" style="width: 240px;">
<el-option label="待提交" :value="1"></el-option>
<el-option label="已提交" :value="2"></el-option>
</el-select>
@ -90,18 +87,18 @@
<span>{{(queryParams.pageNum - 1) * queryParams.pageSize + scope.$index + 1}}</span>
</template>
</el-table-column>
<el-table-column label="单据编号" align="center" prop="orderGoodsCode" :show-overflow-tooltip="true" />
<el-table-column label="采购领料标题" align="center" prop="orderTitle" :show-overflow-tooltip="true" />
<el-table-column label="领料单状态" align="center" prop="orderStatus" :show-overflow-tooltip="true" width="100">
<el-table-column label="单据编号" align="center" prop="fetchMaterialCode" :show-overflow-tooltip="true" />
<el-table-column label="采购领料标题" align="center" prop="title" :show-overflow-tooltip="true" />
<el-table-column label="领料单状态" align="center" prop="commitStatus" :show-overflow-tooltip="true" width="100">
<template slot-scope="scope">
<span v-if="scope.row.orderStatus==1">待提交</span>
<span v-if="scope.row.orderStatus==2">已提交</span>
<span v-if="scope.row.commitStatus==1">待提交</span>
<span v-if="scope.row.commitStatus==2">已提交</span>
</template>
</el-table-column>
<el-table-column label="领取状态" align="center" prop="orderStatus" :show-overflow-tooltip="true" width="100">
<el-table-column label="领取状态" align="center" prop="fetchStatus" :show-overflow-tooltip="true" width="100">
<template slot-scope="scope">
<span v-if="scope.row.orderStatus==1">未领取</span>
<span v-if="scope.row.orderStatus==2">已领取</span>
<span v-if="scope.row.fetchStatus==1">未领取</span>
<span v-if="scope.row.fetchStatus==2">已领取</span>
</template>
</el-table-column>
<el-table-column label="领料单审核" align="center" prop="approveStatus" :show-overflow-tooltip="true" width="100">
@ -114,16 +111,10 @@
</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="stallName" :show-overflow-tooltip="true" width="120"/>
<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="stallName" :show-overflow-tooltip="true" width="120"/>
<el-table-column label="货品数量" align="center" prop="totalNum" :show-overflow-tooltip="true" width="100"/>
<el-table-column label="货品仓库" align="center" prop="" :show-overflow-tooltip="true" width="100"/>
<el-table-column label="领料日期" align="center" prop="" :show-overflow-tooltip="true" width="150"/>
<el-table-column label="货品仓库" align="center" prop="warehouseName" :show-overflow-tooltip="true" width="100"/>
<el-table-column label="领料日期" align="center" prop="fetchMaterialTime" :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="120"/>
@ -133,17 +124,17 @@
<el-button
size="mini"
type="text"
icon="el-icon-edit" v-if="scope.row.orderStatus==1"
icon="el-icon-edit" v-if="scope.row.commitStatus==1"
@click="handleUpdate(scope.row)"
>编辑</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-edit" v-if="scope.row.orderStatus==2"
icon="el-icon-edit" v-if="scope.row.commitStatus==2"
@click="handleView(scope.row)"
>详情</el-button>
<!-- <el-button
size="mini" v-if="scope.row.orderStatus==1"
size="mini" v-if="scope.row.commitStatus==1"
type="text" :disabled="loadingBtn"
icon="el-icon-top"
@click="confirmSubmit(scope.row)"
@ -184,10 +175,9 @@
</template>
<script>
import { systemAreaTreeApi,getCanteenByAreaApi,getStallByCanteenApi } from "@/api/base/stall";
import { supplierPageApi } from "@/api/foodManage/purchaseManage";
import { purchaseOrderPageApi,editPurchaseOrderApi,delPurchaseOrderApi } from "@/api/foodManage/purchaseManage";
import { systemAreaTreeApi,getCanteenByAreaApi,getStallByCanteenApi } from "@/api/base/stall";
import { fetchMaterialPageApi,delFetchMaterialApi } from "@/api/foodManage/pickManage";
//fetchMaterialPageApi getFetchMaterialInfoApi addFetchMaterialApi editFetchMaterialApi delFetchMaterialApi
export default {
name: "",
dicts: [],
@ -219,8 +209,7 @@ export default {
},
treeAreaOptions:[],//
canteenOptions:[],//
stallOptions:[],//
supplierOptions:[],
stallOptions:[],//
dateRange:this.defaultDateRange(),//
pickerOptions: {
shortcuts: [{
@ -263,8 +252,7 @@ export default {
};
},
created() {
this.getAreaTreeData();
this.getSupplierData();
this.getAreaTreeData();
this.getList();
},
methods: {
@ -294,12 +282,7 @@ export default {
this.$set(this.queryParams,"stallId",null)
});
},
/** 查询供应商下拉结构 */
getSupplierData() {
supplierPageApi({ isPaging:1,areaIdList:[] }).then((response) => {
this.supplierOptions = response.rows||[];
});
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
@ -317,12 +300,11 @@ export default {
let param = {
"pageNum": this.queryParams.pageNum,
"pageSize": this.queryParams.pageSize,
"orderGoodsCode": this.queryParams.orderGoodsCode,
"fetchMaterialCode": this.queryParams.fetchMaterialCode,
"areaId": this.queryParams.areaId,
"canteenId": this.queryParams.canteenId,
"stallId": this.queryParams.stallId,
"orderStatus": this.queryParams.orderStatus,
"supplierConfirmStatus": this.queryParams.supplierConfirmStatus,
"commitStatus": this.queryParams.commitStatus,
// "approveStatus": this.queryParams.approveStatus
}
if(this.dateRange&&this.dateRange.length>0){
@ -332,7 +314,7 @@ export default {
param.startDateTime=undefined;
param.endDateTime=undefined;
}
purchaseOrderPageApi(param).then(response => {
fetchMaterialPageApi(param).then(response => {
this.tableListData = response.rows;
this.total = Number(response.total);
this.loading = false;
@ -383,7 +365,7 @@ export default {
/** 删除按钮操作 */
handleDelete(row) {
this.$modal.confirm('是否确认删除数据项?').then(function() {
return delPurchaseOrderApi({orderGoodsIds:[row.orderGoodsId]});
return delFetchMaterialApi({fetchMaterialId:row.fetchMaterialId});
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
@ -391,16 +373,16 @@ export default {
},
//
confirmSubmit(row){
let param = Object.assign({},row);
this.loadingBtn=true
param.orderStatus=2
editPurchaseOrderApi(param).then((response) => {
this.$modal.msgSuccess("提交成功");
this.getList()
this.loadingBtn=false
}).catch(() => {
this.loadingBtn=false
});
// let param = Object.assign({},row);
// this.loadingBtn=true
// param.commitStatus=2
// editPurchaseOrderApi(param).then((response) => {
// this.$modal.msgSuccess("");
// this.getList()
// this.loadingBtn=false
// }).catch(() => {
// this.loadingBtn=false
// });
},
defaultDateRange() {
const end = new Date(new Date().toLocaleDateString());