询价导入采购计划,出库导入领料单单

This commit is contained in:
zzyuan 2025-08-11 17:46:05 +08:00
parent ce50baff7f
commit 9ed322f9d5
3 changed files with 218 additions and 16 deletions

View File

@ -71,6 +71,7 @@
</div>
<div style="display: flex;align-items: center;">
<el-button type="primary" plain @click="addMaterial">添加货品</el-button>
<el-button type="primary" plain @click="importPurchasePlan">导入采购计划</el-button>
<el-button type="danger" plain @click="delMaterial">删除</el-button>
</div>
</div>
@ -179,6 +180,71 @@
<el-button @click="openDialog=false"> </el-button>
</div>
</el-dialog>
<!-- 导入 -->
<el-dialog title="导入采购计划" :visible.sync="openImportDialog" width="60%" append-to-body >
<div style="width: 100%;height:650px;">
<el-form :model="queryParams2" ref="queryForm2" size="small" :inline="true" label-width="100px">
<el-form-item label="计划日期">
<el-date-picker
v-model="dateRange"
type="datetimerange"
align="right"
unlink-panels
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
format="yyyy-MM-dd HH:mm:ss" style="width: 400px"
:default-time="['00:00:00', '23:59:59']"
:picker-options="pickerOptions2" >
</el-date-picker>
</el-form-item>
<el-form-item label="采购计划单号" prop="planCode">
<el-input v-model="queryParams2.planCode" placeholder="请输入采购单号" maxlength="20" clearable style="width: 240px"/>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery2">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery2">重置</el-button>
</el-form-item>
</el-form>
<!-- :row-key="(row)=>{return row.fetchMaterialId}" @selection-change="handleSelectionChange3" -->
<el-table v-loading="loading2" :data="tableListData2" ref="multipleTable2" highlight-current-row @current-change="handleCurrentChange" height="300">
<!-- <el-table-column type="selection" width="50" align="center" :reserve-selection="true" /> -->
<el-table-column label="序号" align="center" width="80" type="index">
<template slot-scope="scope">
<span>{{(queryParams2.pageNum - 1) * queryParams2.pageSize + scope.$index + 1}}</span>
</template>
</el-table-column>
<el-table-column label="采购计划单号" align="center" prop="planCode" :show-overflow-tooltip="true" />
<el-table-column label="采购计划时间" align="center" prop="purchaseDate" :show-overflow-tooltip="true" />
<el-table-column label="所属食堂" align="center" prop="canteenName" :show-overflow-tooltip="true" />
<el-table-column label="所属档口" align="center" prop="stallName" :show-overflow-tooltip="true" />
<el-table-column label="创建人" align="center" prop="createBy" :show-overflow-tooltip="true" />
</el-table>
<pagination
v-show="total2>0"
:total="total2"
:page.sync="queryParams2.pageNum"
:limit.sync="queryParams2.pageSize"
@pagination="getList2"
/>
<div>
<div>采购计划明细</div>
<el-table :data="materialDetailsData" height="250">
<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="purchaseNum" :show-overflow-tooltip="true" />
</el-table>
</div>
</div>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="confirmImport"> </el-button>
<el-button @click="openImportDialog=false"> </el-button>
</div>
</el-dialog>
</div>
</template>
@ -187,6 +253,7 @@ import { imgUpLoadTwo } from '@/api/system/upload'
import { systemAreaTreeApi } from "@/api/base/stall";
import { systemMaterialTreeApi,getMaterialListApi,supplierPageApi } from "@/api/foodManage/stockManage";
import { getGoodsInquiryInfoApi,addGoodsInquiryApi,editGoodsInquiryApi } from "@/api/foodManage/purchaseManage";
import { purchasePlanPageApi,getPurchasePlanInfoApi } from "@/api/foodManage/purchaseManage";
export default {
name: "GoodsInquiryEdit",
dicts: [],
@ -257,6 +324,46 @@ export default {
tableListData: [],//-
batchChosenMaterial:[],//--
noMaterial:false,
//
openImportDialog:false,
queryParams2: { // --
pageNum: 1,
pageSize: 10,
planCode:null
},
loading2:false,
total2: 0, //
tableListData2: [],//-
importRow:{},//--
materialDetailsData: [],//-
dateRange:this.defaultDateRange(),//
pickerOptions2: {
shortcuts: [{
text: '最近一周',
onClick(picker) {
const start = new Date();
const end = new Date();
start.setTime(start.getTime() - 3600 * 1000 * 24 * 6);
picker.$emit('pick', [start, end]);
}
},{
text: '最近一个月',
onClick(picker) {
const start = new Date();
const end = new Date();
start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
picker.$emit('pick', [start, end]);
}
},{
text: '最近三个月',
onClick(picker) {
const start = new Date();
const end = new Date();
start.setTime(start.getTime() - 3600 * 1000 * 24 * 91);
picker.$emit('pick', [start, end]);
}
}]
},
};
},
@ -603,8 +710,94 @@ export default {
}
}
});
},
//
importPurchasePlan(){
if(this.baseInfo.areaId!=undefined){
this.openImportDialog=true
this.resetQuery2()
// setTimeout(()=>{
// this.$refs.multipleTable2.clearSelection()
// },300)
}else{
this.$modal.msgError("请先选择区域!");
}
},
/** 搜索按钮操作 */
handleQuery2() {
this.queryParams2.pageNum = 1;
this.getList2();
},
/** 重置按钮操作 */
resetQuery2() {
this.dateRange = this.defaultDateRange()
this.queryParams2 = {
pageNum: 1,
pageSize: 10,
}
this.resetForm("queryForm2");
this.handleQuery2();
},
/** 查询列表 */
getList2() {
this.loading2 = true;
let param = {
"pageSize": this.queryParams2.pageSize,
"pageNum": this.queryParams2.pageNum,
"planCode": this.queryParams2.planCode,
"status":2,
"areaId": this.baseInfo.areaId,
}
if(this.dateRange&&this.dateRange.length>0){
param.startDateTime=this.formatDateTime(this.dateRange[0])
param.endDateTime=this.formatDateTime(this.dateRange[1])
}else{
param.startDateTime=undefined;
param.endDateTime=undefined;
}
purchasePlanPageApi(param).then(response => {
this.tableListData2 = response.rows;
this.total2 = Number(response.total);
this.loading2 = false;
});
},
//
handleCurrentChange(row){
console.log(row)
this.importRow = row;
let param = {
planId:this.importRow.planId
}
getPurchasePlanInfoApi(param).then((response) => {
this.materialDetailsData = response.data.purchasePlanDetailList||[];
});
},
confirmImport(){
if(this.materialDetailsData.length>0){
this.$modal.confirm('是否确认覆盖货品明细?').then(() => {
this.materialList = this.materialDetailsData;
this.materialList.forEach(item=>{
this.$set(item,"purNum",item.purchaseNum)
})
this.baseInfo.purchasePlanCode = this.importRow.planCode;
this.$set(this.baseInfo,"remark","导入采购计划")
setTimeout(()=>{
this.openImportDialog=false
},500)
}).catch(() => {});
}else{
this.$modal.msgError("采购计划明细无货品");
}
},
defaultDateRange() {
const end = new Date(new Date().toLocaleDateString());
end.setTime(end.getTime() + 24 * 60 * 60 * 1000 -1);
const start = new Date((new Date().toLocaleDateString()));
start.setTime(start.getTime() - 30 * 24 * 60 * 60 * 1000);
this.start = parseInt(start.getTime() / 1000)
this.end = parseInt(end.getTime() / 1000)
return [start, end]
},
//
formatDate(date) {
// YYYY-MM-DD

View File

@ -75,7 +75,7 @@
<el-table-column label="库存数量" align="center" prop="materialNum" :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.fetchNum" placeholder="请输入" maxlength="8" clearable @change="patternValue(scope.row)"/>
<el-input v-model="scope.row.fetchNum" placeholder="请输入" maxlength="8" clearable @change="patternValue(scope.row)"/>
</template>
</el-table-column>
</el-table>
@ -426,16 +426,25 @@ export default {
},
confirmChosen(){
if(this.batchChosenMaterial.length>0){
this.loading = true
let items = [...this.materialList,...this.batchChosenMaterial]
let uniqueItems = items.filter((item, index, array) => {
return array.findIndex((t) => (t.materialId === item.materialId)) === index;
});
this.materialList = uniqueItems;
setTimeout(()=>{
this.loading = false
this.openDialog=false
},500)
this.loading = true
if(this.baseInfo.fetchMaterialId&&this.baseInfo.fetchMaterialId!=""){
this.$modal.confirm('是否确认覆盖货品明细?').then(() => {
this.baseInfo.fetchMaterialId = null
this.materialList = this.batchChosenMaterial
this.loading = false
this.openDialog=false
}).catch(() => {});
}else{
let items = [...this.materialList,...this.batchChosenMaterial]
let uniqueItems = items.filter((item, index, array) => {
return array.findIndex((t) => (t.materialId === item.materialId)) === index;
});
this.materialList = uniqueItems;
setTimeout(()=>{
this.loading = false
this.openDialog=false
},500)
}
}
},
//稿
@ -608,11 +617,11 @@ export default {
confirmImport(){
if(this.materialDetailsData.length>0){
this.$modal.confirm('是否确认覆盖货品明细?').then(() => {
this.materialList = this.materialDetailsData;
this.materialList=this.materialDetailsData;
// this.materialList.forEach(item=>{
// this.$set(item,"orderNum",item.purchaseNum)
// })
// this.baseInfo.purchasePlanCode = this.importRow.planCode;
this.baseInfo.fetchMaterialId = this.importRow.fetchMaterialId;
this.$set(this.baseInfo,"remark","导入领料单")
setTimeout(()=>{
this.openImportDialog=false

View File

@ -36,8 +36,8 @@ module.exports = {
// detail: https://cli.vuejs.org/config/#devserver-proxy
[process.env.VUE_APP_BASE_API]: {
// target: `http://192.168.2.75:48380`,//旭
target: `http://192.168.0.244:48380`,//测试
// target: `http://192.168.0.176:48380`,//刘鑫
// target: `http://192.168.0.244:48380`,//测试
target: `http://192.168.0.176:48380`,//刘鑫
// target: `http://192.168.0.44:48380`,//测试
// target: `http://192.168.0.176:48380`,//
changeOrigin: true,