diff --git a/public/template/批量新增原料模板.xlsx b/public/template/批量新增原料模板.xlsx new file mode 100644 index 00000000..2fb67d84 Binary files /dev/null and b/public/template/批量新增原料模板.xlsx differ diff --git a/public/template/批量新增商品模板.xlsx b/public/template/批量新增商品模板.xlsx new file mode 100644 index 00000000..79d4b53d Binary files /dev/null and b/public/template/批量新增商品模板.xlsx differ diff --git a/src/api/dish/material.js b/src/api/dish/material.js index 76e96370..8dd13bd9 100644 --- a/src/api/dish/material.js +++ b/src/api/dish/material.js @@ -136,4 +136,41 @@ export function getDrpUnitListApi(data) { }, data: data }) -} \ No newline at end of file +} + +// 下载模板 +export function downLoadExportTemplate(data) { + return request({ + url: '/smart-canteen/api/v4/export/downLoad', + method: 'post', + headers: { + "merchant-id":"378915229716713472", + }, + data: data + }) +} +// export function downLoadExportTemplate(data) { +// return request({ +// url: '/smart-canteen/api/v4/export/downLoad', +// method: 'post', +// data: data, +// responseType: 'blob' +// }) +// } + + + + + + + + + + + + + + + + + diff --git a/src/views/accountCenter/account/accountManager/index.vue b/src/views/accountCenter/account/accountManager/index.vue index c1ac81c4..19801a7f 100644 --- a/src/views/accountCenter/account/accountManager/index.vue +++ b/src/views/accountCenter/account/accountManager/index.vue @@ -33,14 +33,14 @@ + placeholder="请输入最小金额" style="width: 240px" clearable @input="(v)=>(queryParams.walletMinAmount=v.replace(/[^\d.]/g,''))"> + placeholder="请输入最大金额" style="width: 240px" clearable @input="(v)=>(queryParams.walletMaxAmount=v.replace(/[^\d.]/g,''))"> diff --git a/src/views/accountCenter/butie/butieRecordsTab/index.vue b/src/views/accountCenter/butie/butieRecordsTab/index.vue index a6e42e37..33edf895 100644 --- a/src/views/accountCenter/butie/butieRecordsTab/index.vue +++ b/src/views/accountCenter/butie/butieRecordsTab/index.vue @@ -20,7 +20,7 @@ - + @@ -183,7 +183,7 @@ @@ -205,7 +205,7 @@ @@ -217,7 +217,7 @@ v-model="form.contactTel" type="text" @input="(v)=>(form.contactTel=v.replace(/[^\d]/g,''))" placeholder="请输入联系方式" - maxlength="11" + maxlength="11" clearable /> diff --git a/src/views/base/canteen/index.vue b/src/views/base/canteen/index.vue index 2c551cca..5e57c428 100644 --- a/src/views/base/canteen/index.vue +++ b/src/views/base/canteen/index.vue @@ -4,7 +4,7 @@ diff --git a/src/views/base/stall/index.vue b/src/views/base/stall/index.vue index 0ff6b614..2d92dcc4 100644 --- a/src/views/base/stall/index.vue +++ b/src/views/base/stall/index.vue @@ -4,11 +4,11 @@ - + - + - + > --> diff --git a/src/views/device/doubleScreen/index.vue b/src/views/device/doubleScreen/index.vue index 1d83d931..3bf8cead 100644 --- a/src/views/device/doubleScreen/index.vue +++ b/src/views/device/doubleScreen/index.vue @@ -539,8 +539,7 @@ ], stallId: [ { required: true, message: "所属档口不能为空", trigger: "blur" } - ], - + ] }, metadata:{ "voiceRemindSuccess": "1", @@ -573,7 +572,7 @@ openMenu:false, dialogMenuParams:{ keyWord:"早餐", - applyDate:new Date().toISOString().substr(0, 10) + applyDate:this.formatDate(new Date()) }, recipeId:"", menuData:[], @@ -820,6 +819,13 @@ }); }); }, + formatDate(date) { + // 格式化为 YYYY-MM-DD + const year = date.getFullYear(); + const month = String(date.getMonth() + 1).padStart(2, '0'); // 月份从0开始 + const day = String(date.getDate()).padStart(2, '0'); + return `${year}-${month}-${day}`; + } } diff --git a/src/views/dish/material/index.vue b/src/views/dish/material/index.vue index 3424d80e..31eb9ed4 100644 --- a/src/views/dish/material/index.vue +++ b/src/views/dish/material/index.vue @@ -144,7 +144,6 @@ 批量修改类别 - + - + + 模板下载 + + @@ -366,9 +365,10 @@ import Treeselect from "@riophae/vue-treeselect"; import "@riophae/vue-treeselect/dist/vue-treeselect.css"; import { systemMaterialTreeApi,addMaterialTypeApi,updateMaterialTypeApi,removeMaterialTypeApi,systemAreaTreeApi} from "@/api/dish/material"; -import { getMaterialListApi,addMaterialApi, updateMaterialApi, removeMaterialApi,batchRemoveMaterialApi,batchUpdateMaterialApi} from "@/api/dish/material"; +import { getMaterialListApi,addMaterialApi, updateMaterialApi, removeMaterialApi,batchRemoveMaterialApi,batchUpdateMaterialApi,downLoadExportTemplate} from "@/api/dish/material"; import MaterialDialog from './components/MaterialDialog.vue'; -import { getToken } from '@/utils/auth' +import { getToken } from '@/utils/auth'; +import { downloadFileByUrl } from '@/utils/download' export default { name: "Material", components: { @@ -728,6 +728,13 @@ export default { this.getList() }, + /** 下载模板操作 */ + importTemplate() { + let url = window.location.origin + '/glweb/template/批量新增原料模板.xlsx'; + console.log(url) + downloadFileByUrl(url) + }, + // getParentName(list, id) { // try { diff --git a/src/views/dish/menu/detail.vue b/src/views/dish/menu/detail.vue index bb9ee24f..8c8dd74f 100644 --- a/src/views/dish/menu/detail.vue +++ b/src/views/dish/menu/detail.vue @@ -542,8 +542,8 @@ export default { var days = ['星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六']; var dayOfWeek = start.getDay(); let obj = { - applyDate:start.toISOString().split('T')[0], - applyDateStr:start.toISOString().split('T')[0]+" "+days[dayOfWeek], + applyDate:this.formatDate(start), + applyDateStr:this.formatDate(start)+" "+days[dayOfWeek], detailList:[ { mealtimeType:"1", @@ -700,6 +700,11 @@ export default { item.isChecked = true; } }) + //判断是否为新菜品类型 + let typeIndex = this.dishesTypeList.findIndex(v=>v.typeId==obj.typeId) + if(typeIndex==-1){ + this.dishesTypeList.push({typeId:obj.typeId,typeName:obj.typeName}) + } }else{ this.dishesList.splice(index,1) //反显选中样式 @@ -708,11 +713,6 @@ export default { item.isChecked = null; } }) - } - //判断是否为新菜品类型 - let index2 = this.dishesTypeList.findIndex(v=>v.typeId==obj.typeId) - if(index2==-1){ - this.dishesTypeList.push({typeId:obj.typeId,typeName:obj.typeName}) } //选中类型 this.choseDishesType(obj) @@ -726,6 +726,12 @@ export default { this.dishesTableList.push(dish) } }) + if(this.dishesTableList.length==0){//单个菜品分类中无菜品时,删除该分类 + let typeIndex = this.dishesTypeList.findIndex(v=>v.typeId==item.typeId) + if(typeIndex>-1){ + this.dishesTypeList.splice(typeIndex,1) + } + } }, //弹窗右侧表格删除菜谱 handleDelDishes(item){ @@ -740,6 +746,12 @@ export default { dish.isChecked = null; } }) + if(this.dishesTableList.length==0){//单个菜品分类中无菜品时,删除该分类 + let typeIndex = this.dishesTypeList.findIndex(v=>v.typeId==item.typeId) + if(typeIndex>-1){ + this.dishesTypeList.splice(typeIndex,1) + } + } } }).catch(() => {}); }, diff --git a/src/views/dish/menu/edit.vue b/src/views/dish/menu/edit.vue index 9979b6a9..f43a776b 100644 --- a/src/views/dish/menu/edit.vue +++ b/src/views/dish/menu/edit.vue @@ -436,12 +436,10 @@ export default { //菜谱编辑 initEditDetail(){ console.log(this.baseInfo) - if(this.baseInfo.recipeType==1){//指定日期 - console.log(this.baseInfo.applyDateList) + if(this.baseInfo.recipeType==1){//指定日期 let length = this.baseInfo.applyDateList.length this.dateRange[0] = this.baseInfo.applyDateList[0] this.dateRange[1] = this.baseInfo.applyDateList[length-1] - console.log(this.dateRange) this.dateRangeList = this.getDateRange(this.dateRange[0],this.dateRange[1]) this.dateRangeRadio = this.dateRange[0]; this.detailList = this.dateRangeList[0].detailList; @@ -615,11 +613,14 @@ export default { this.effOptions = response.data.records; }); }, - //切换菜谱类型 + + //-------切换菜谱类型--------- changeRecipeType(e){ console.log(this.baseInfo.recipeType) - if(this.baseInfo.recipeType==1){//日期范围 + if(this.baseInfo.recipeType==1){//日期范围 + console.log(this.dateRange) this.dateRangeList = this.getDateRange(this.dateRange[0],this.dateRange[1]) + console.log(this.dateRangeList) this.dateRangeRadio = this.formatDate(this.dateRange[0]) this.detailList = this.dateRangeList[0].detailList } @@ -673,15 +674,15 @@ export default { //获取两日期间所有日期-构建每日菜谱数据 getDateRange(startDate, endDate) { let start = new Date(startDate); - let end = new Date(endDate); + let end = new Date(endDate) let dateArray = []; - while (start <= end) { + while (start <= end) { //周几 var days = ['星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六']; var dayOfWeek = start.getDay(); let obj = { - applyDate:start.toISOString().split('T')[0], - applyDateStr:start.toISOString().split('T')[0]+" "+days[dayOfWeek], + applyDate:this.formatDate(start), + applyDateStr:this.formatDate(start)+" "+days[dayOfWeek], detailList:[ { mealtimeType:"1", @@ -827,7 +828,7 @@ export default { chosenDishes(obj){ //判断是否为新菜品类型 let index = this.dishesList.findIndex(v=>v.dishesId==obj.dishesId) - if(index==-1){ + if(index==-1){//新-加入 let dish = Object.assign({}, obj) this.$set(dish,'price',Number(dish.price/100)) this.$set(dish,'salePrice',Number(dish.salePrice/100)||0) @@ -840,6 +841,11 @@ export default { item.isChecked = true; } }) + //判断是否为新菜品类型 + let typeIndex = this.dishesTypeList.findIndex(v=>v.typeId==obj.typeId) + if(typeIndex==-1){ + this.dishesTypeList.push({typeId:obj.typeId,typeName:obj.typeName}) + } }else{ this.dishesList.splice(index,1) //反显选中样式 @@ -848,18 +854,12 @@ export default { item.isChecked = null; } }) - } - //判断是否为新菜品类型 - let index2 = this.dishesTypeList.findIndex(v=>v.typeId==obj.typeId) - if(index2==-1){ - this.dishesTypeList.push({typeId:obj.typeId,typeName:obj.typeName}) } //选中类型 this.choseDishesType(obj) }, //选中菜品类型-更新右侧表格数据 - choseDishesType(item){ - console.log(item) + choseDishesType(item){ this.dishesType = item.typeId; this.dishesTableList = [] this.dishesList.forEach(dish=>{ @@ -867,7 +867,12 @@ export default { this.dishesTableList.push(dish) } }) - console.log(this.dishesTableList) + if(this.dishesTableList.length==0){//单个菜品分类中无菜品时,删除该分类 + let typeIndex = this.dishesTypeList.findIndex(v=>v.typeId==item.typeId) + if(typeIndex>-1){ + this.dishesTypeList.splice(typeIndex,1) + } + } }, //弹窗右侧表格删除菜谱 handleDelDishes(item){ @@ -882,6 +887,12 @@ export default { dish.isChecked = null; } }) + if(this.dishesTableList.length==0){//单个菜品分类中无菜品时,删除该分类 + let typeIndex = this.dishesTypeList.findIndex(v=>v.typeId==item.typeId) + if(typeIndex>-1){ + this.dishesTypeList.splice(typeIndex,1) + } + } } }).catch(() => {}); }, diff --git a/src/views/dish/menu/index.vue b/src/views/dish/menu/index.vue index 0851d475..4ecb2930 100644 --- a/src/views/dish/menu/index.vue +++ b/src/views/dish/menu/index.vue @@ -27,7 +27,7 @@ - + - + diff --git a/src/views/order/offlineManagement/index.vue b/src/views/order/offlineManagement/index.vue index aa17b64e..945e5eb8 100644 --- a/src/views/order/offlineManagement/index.vue +++ b/src/views/order/offlineManagement/index.vue @@ -25,7 +25,7 @@ - + @@ -48,11 +48,11 @@ emitPath: false,// 若设置 false,则只返回该节点的值,只返回最后选择的id checkStrictly: true,//来设置父子节点取消选中关联,从而达到选择任意一级选项的目的 value:'id',label:'treeName' - }" clearable @change="handleAreaChange"> + }" clearable collapse-tags @change="handleAreaChange"> - + - + - + - + - + - + - + - + - + - + - + 批量修改类别 @@ -182,6 +178,13 @@ + + 模板下载 + + @@ -348,7 +351,8 @@ import "@riophae/vue-treeselect/dist/vue-treeselect.css"; import { systemMaterialTreeApi,addMaterialTypeApi,updateMaterialTypeApi,removeMaterialTypeApi,systemAreaTreeApi} from "@/api/superStore/shopMaterial"; import { getMaterialListApi,addMaterialApi, updateMaterialApi, removeMaterialApi,batchRemoveMaterialApi,batchUpdateMaterialApi} from "@/api/superStore/shopMaterial"; import MaterialDialog from './components/MaterialDialog.vue'; -import { getToken } from '@/utils/auth' +import { getToken } from '@/utils/auth'; +import { downloadFileByUrl } from '@/utils/download' export default { name: "Material", components: { @@ -438,7 +442,7 @@ export default { // 设置上传的请求头部 headers: { Authorization: 'Bearer ' + getToken() }, // 上传的地址 - url: process.env.VUE_APP_BASE_API + '/smart-canteen/api/v1/menumaterial/batch/import/material', + url: process.env.VUE_APP_BASE_API + '/smart-canteen/api/v1/menumaterial/batch/import/material-product', }, }; }, @@ -707,6 +711,12 @@ export default { this.$modal.msgSuccess("后台导入中..."); this.getList() }, + /** 下载模板操作 */ + importTemplate() { + let url = window.location.origin + '/glweb/template/批量新增商品模板.xlsx'; + console.log(url) + downloadFileByUrl(url) + }, // getParentName(list, id) { diff --git a/src/views/superstore/super/index.vue b/src/views/superstore/super/index.vue index 27f94b3f..1b59f6f8 100644 --- a/src/views/superstore/super/index.vue +++ b/src/views/superstore/super/index.vue @@ -4,11 +4,11 @@ - + - + + }" clearable collapse-tags>