diff --git a/src/views/foodManage/pickManage/materialPicking/edit.vue b/src/views/foodManage/pickManage/materialPicking/edit.vue index 9bf64470..da91d09a 100644 --- a/src/views/foodManage/pickManage/materialPicking/edit.vue +++ b/src/views/foodManage/pickManage/materialPicking/edit.vue @@ -65,6 +65,7 @@
添加货品 + 导入采购计划 删除
@@ -158,6 +159,71 @@ 取 消 + + + +
+ + + + + + + + + + + 搜索 + 重置 + + + + + + + + + + + + + + + +
+
采购计划明细
+ + + + + + + +
+
+ +
@@ -166,6 +232,7 @@ import { imgUpLoadTwo } from '@/api/system/upload' import { systemAreaTreeApi,getCanteenByAreaApi,getStallByCanteenApi } from "@/api/base/stall"; import { systemMaterialTreeApi,getStockMaterialListApi,drpWareHousePageApi } from "@/api/foodManage/pickManage"; import { getFetchMaterialInfoApi,addFetchMaterialApi,editFetchMaterialApi } from "@/api/foodManage/pickManage"; +import { purchasePlanPageApi,getPurchasePlanInfoApi } from "@/api/foodManage/purchaseManage"; export default { name: "MaterialPickingEdit", dicts: [], @@ -229,6 +296,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]); + } + }] + }, }; }, @@ -521,6 +628,81 @@ export default { } }); }, + //导入 + importPurchasePlan(){ + if(this.baseInfo.areaId!=undefined||this.baseInfo.canteenId!=undefined||this.baseInfo.stallId!=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.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, + "canteenId": this.baseInfo.canteenId, + "stallId": this.baseInfo.stallId + } + 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,"fetchNum",item.purchaseNum) + }) + // this.baseInfo.purchasePlanCode = this.importRow.planCode; + setTimeout(()=>{ + this.openImportDialog=false + },500) + }).catch(() => {}); + }else{ + this.$modal.msgError("采购计划明细无货品"); + } + }, patternValue(row){ row.fetchNum = row.fetchNum.replace(/[^\d.]/g, '').replace(/^(\d*\.\d{2}).*$/, '$1') setTimeout(()=>{ @@ -529,6 +711,15 @@ export default { } },500) }, + 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 diff --git a/src/views/foodManage/purchaseManage/goodsInquiry/index.vue b/src/views/foodManage/purchaseManage/goodsInquiry/index.vue index dd707d61..54ad1c28 100644 --- a/src/views/foodManage/purchaseManage/goodsInquiry/index.vue +++ b/src/views/foodManage/purchaseManage/goodsInquiry/index.vue @@ -199,7 +199,7 @@ export default { }, treeAreaOptions:[],//区域树 wareHouseOptions:[],//仓库下拉选 - dateRange:this.defaultDateRange(), + dateRange:[], pickerOptions: { shortcuts: [{ text: '最近一周', @@ -269,7 +269,7 @@ export default { }, /** 重置按钮操作 */ resetQuery() { - this.dateRange = this.defaultDateRange() + this.dateRange = [] this.resetForm("queryForm"); this.handleQuery(); }, diff --git a/src/views/foodManage/purchaseManage/purchasePlan/index.vue b/src/views/foodManage/purchaseManage/purchasePlan/index.vue index a1e88663..8a746744 100644 --- a/src/views/foodManage/purchaseManage/purchasePlan/index.vue +++ b/src/views/foodManage/purchaseManage/purchasePlan/index.vue @@ -79,20 +79,20 @@ {{(queryParams.pageNum - 1) * queryParams.pageSize + scope.$index + 1}} - + - - - + + + - + - - + + @@ -108,30 +108,36 @@ --> - + @@ -165,7 +171,7 @@