diff --git a/src/views/foodManage/purchaseManage/contractList/edit.vue b/src/views/foodManage/purchaseManage/contractList/edit.vue index 4d9b8493..0068cdf2 100644 --- a/src/views/foodManage/purchaseManage/contractList/edit.vue +++ b/src/views/foodManage/purchaseManage/contractList/edit.vue @@ -99,7 +99,7 @@
添加货品 - 删除 + 删除
@@ -141,8 +141,9 @@
- 保存草稿 - 提交 + 保存草稿 + 提交 + 返回
@@ -255,26 +256,23 @@ export default { canteenOptions:[], supplierOptions:[], stallOptions:[], - pickerOptions: { disabledDate(v) { return v.getTime() < (new Date().getTime() - 86400000);// - 86400000是否包括当天 } }, - contractMaterialList:[], + contractMaterialList:[],//货品信息-表格数据 + batchIds:[],//货品信息-表格数据-多选 openDialog:false, - materialTreeOptions:[], - // 查询参数 - queryParams: { + materialTreeOptions:[], + queryParams: { // 货品弹窗-货品表格-查询参数 pageNum: 1, pageSize: 10, - }, - // 总条数 - total: 0, - //表格数据 - tableListData: [], - batchChosenMaterial:[], - noMaterial:false, + }, + total: 0, // 总条数 + tableListData: [],//货品弹窗-货品表格数据 + batchChosenMaterial:[],//货品弹窗-货品表格-选中的货品数组 + noMaterial:false, }; }, created() { @@ -365,6 +363,20 @@ export default { changeDateRange(e){ //this.formatDate(e[0]) }, + // 多选框选中数据 + handleSelectionChange(selection) { + this.batchIds = selection.map(item => item.materialId) + }, + //删除货品 + delMaterial(){ + this.batchIds.forEach(ID=>{ + let index = this.contractMaterialList.findIndex(v=>v.materialId==ID) + if(index>-1){ + this.contractMaterialList.splice(index,1) + } + }) + }, + //添加货品 addMaterial(){ if(this.baseInfo.areaId!=undefined){ this.openDialog=true @@ -376,7 +388,7 @@ export default { this.$modal.msgError("请先选择区域"); } - }, + }, /** 搜索按钮操作 */ handleQuery() { this.queryParams.pageNum = 1; @@ -538,14 +550,7 @@ export default { } } }); - }, - // 多选框选中数据 - handleSelectionChange(selection) { - // this.batchIds1 = selection.map(item => item.tradeId) - // this.single = selection.length !== 1 - // this.multiple = !selection.length - }, - + }, //日期 formatDate(date) { // 格式化为 YYYY-MM-DD