测试修改
This commit is contained in:
parent
3416dbf8c2
commit
dfd11a9a39
|
|
@ -18,7 +18,7 @@
|
|||
</div>
|
||||
|
||||
|
||||
<div style="width: 100%;margin:10px auto;display: flex;flex-wrap: wrap;gap: 15px;">
|
||||
<div style="width: 100%;margin:10px auto;display: flex;flex-wrap: wrap;gap: 15px;" v-loading="loading">
|
||||
<div class="item">
|
||||
<div class="type">账户数</div>
|
||||
<div class="title"><span>当前</span><span>{{accTotalData.reportAccountDataNumSumParam.reportAccountDataNumParam.endCount||0}}</span></div>
|
||||
|
|
@ -165,12 +165,7 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
|
@ -182,6 +177,7 @@
|
|||
dicts: [],
|
||||
data() {
|
||||
return {
|
||||
loading:true,
|
||||
pickerOptions: {
|
||||
disabledDate(time) {
|
||||
// 选择今天以及今天之后的日期
|
||||
|
|
@ -226,6 +222,7 @@
|
|||
},
|
||||
/** 查询列表 */
|
||||
getData() {
|
||||
this.loading=true;
|
||||
console.log(this.queryParams)
|
||||
let param = {
|
||||
"startDate": this.queryParams.startDate,
|
||||
|
|
@ -234,6 +231,7 @@
|
|||
accountDataTotalApi(param).then(response => {
|
||||
this.accTotalData = response
|
||||
console.log(this.accTotalData)
|
||||
this.loading=false;
|
||||
});
|
||||
},
|
||||
//日期
|
||||
|
|
|
|||
|
|
@ -230,9 +230,9 @@
|
|||
<!-- <el-select v-model="baseForm.custName" placeholder="请选择负责人" style="width: 100%;" @focus="openChosenCharger"></el-select> -->
|
||||
<el-select v-model="baseForm.custId" placeholder="请选择负责人" style="width: 100%;" clearable @change="chosenUser">
|
||||
<el-option v-for="item in userOptions"
|
||||
:key="item.userId"
|
||||
:key="item.custId"
|
||||
:label="item.nickName"
|
||||
:value="item.userId"
|
||||
:value="item.custId"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
|
@ -477,7 +477,7 @@
|
|||
"canteenNum": "",
|
||||
"capacity": "",
|
||||
"contactTel": "",
|
||||
"custId": "379497835516661760",
|
||||
"custId": "",
|
||||
"endBusinessTime": "",
|
||||
"startBusinessTime": "",
|
||||
"ifBook": 2,
|
||||
|
|
@ -672,7 +672,8 @@
|
|||
}else{
|
||||
this.fileList=[]
|
||||
this.checkUrlList=[]
|
||||
}
|
||||
}
|
||||
this.rangeTime=[response.canteenSaveDTO.startBusinessTime, response.canteenSaveDTO.endBusinessTime]
|
||||
this.deliveryModel = response.deliveryModel;
|
||||
this.orderDTO = response.orderDTO;
|
||||
this.payDTO = response.payDTO;
|
||||
|
|
|
|||
|
|
@ -211,9 +211,9 @@
|
|||
<!-- <el-select v-model="baseForm.custName" placeholder="请选择负责人" style="width: 100%;" @focus="openChosenCharger"></el-select> -->
|
||||
<el-select v-model="baseForm.custId" placeholder="请选择负责人" style="width: 100%;" clearable @change="chosenUser">
|
||||
<el-option v-for="item in userOptions"
|
||||
:key="item.userId"
|
||||
:key="item.custId"
|
||||
:label="item.nickName"
|
||||
:value="item.userId"
|
||||
:value="item.custId"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
|
@ -839,6 +839,7 @@ export default {
|
|||
this.$forceUpdate()
|
||||
});
|
||||
},500)
|
||||
this.rangeTime=[response.stallSaveDTO.startBusinessTime, response.stallSaveDTO.endBusinessTime]
|
||||
this.deliveryModel = response.deliveryModel;
|
||||
this.orderDTO = response.orderDTO;
|
||||
this.mealtimeList = response.mealtimeList;
|
||||
|
|
|
|||
|
|
@ -300,9 +300,6 @@
|
|||
</el-cascader>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="所属食堂" prop="canteenId">
|
||||
<el-select v-model="baseForm.canteenId" placeholder="请选择所属食堂" style="width: 100%;" clearable @change="handleCanteenChange2">
|
||||
|
|
@ -325,9 +322,6 @@
|
|||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="菜品编号" prop="dishesNum">
|
||||
<el-input v-model="baseForm.dishesNum" placeholder="请输入菜品编号" maxlength="30" clearable/>
|
||||
|
|
@ -338,29 +332,34 @@
|
|||
<el-input v-model="baseForm.dishesName" placeholder="请输入菜品名称" maxlength="30" clearable/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
|
||||
<el-col :span="12">
|
||||
<el-form-item label="计价方式" prop="salesMode">
|
||||
<el-select v-model="baseForm.salesMode" style="width: 100%;" >
|
||||
<el-select v-model="baseForm.salesMode" style="width: 100%;" @change="changeSalesMode">
|
||||
<el-option label="按份" :value="1" />
|
||||
<el-option label="称重" :value="2" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="规格" prop="sizeType">
|
||||
<el-select v-model="baseForm.sizeType" style="width: 100%;" >
|
||||
<el-form-item label="规格" prop="sizeType" v-if="baseForm.salesMode==1">
|
||||
<el-select v-model="baseForm.sizeType" style="width: 100%;" @change="changeSizeType">
|
||||
<el-option label="标准" value="1" />
|
||||
<el-option label="大小份" value="2" />
|
||||
<el-option label="大小份" value="2"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="单价" prop="price">
|
||||
<el-form-item label="规格" prop="sizeType" v-if="baseForm.salesMode==2">
|
||||
<el-select v-model="baseForm.weight" style="width: 100%;">
|
||||
<el-option label="50g" :value="50" />
|
||||
<el-option label="100g" :value="100" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12">
|
||||
<el-form-item label="单价" prop="price" v-if="baseForm.sizeType==1">
|
||||
<el-input
|
||||
v-model="baseForm.price"
|
||||
placeholder="请输入单价"
|
||||
|
|
@ -372,7 +371,7 @@
|
|||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="成本价" prop="materialCost">
|
||||
<el-form-item label="成本价" prop="materialCost" v-if="baseForm.sizeType==1">
|
||||
<el-input
|
||||
v-model="baseForm.materialCost"
|
||||
placeholder="请输入成本价" disabled
|
||||
|
|
@ -383,26 +382,109 @@
|
|||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="份量" prop="weight">
|
||||
<el-form-item label="小份单价" prop="littlePrice" v-if="baseForm.sizeType==2&&baseForm.salesMode==1">
|
||||
<el-input
|
||||
v-model="baseForm.littlePrice"
|
||||
placeholder="请输入小份单价"
|
||||
@input="handleNumericInput('littlePrice', $event)"
|
||||
@blur="formatNumericValue('littlePrice')"
|
||||
>
|
||||
<template slot="append">元</template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="小份份量" prop="littleWeight" v-if="baseForm.sizeType==2&&baseForm.salesMode==1">
|
||||
<el-input v-model="baseForm.littleWeight" placeholder="小份份量" maxlength="30" clearable @input="(v)=>(baseForm.littleWeight=v.replace(/[^\d]/g,''))">
|
||||
<template slot="append">g</template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="大份单价" prop="largePrice" v-if="baseForm.sizeType==2&&baseForm.salesMode==1">
|
||||
<el-input
|
||||
v-model="baseForm.largePrice"
|
||||
placeholder="请输入大份单价"
|
||||
@input="handleNumericInput('largePrice', $event)"
|
||||
@blur="formatNumericValue('largePrice')"
|
||||
>
|
||||
<template slot="append">元</template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="大份份量" prop="largeWeight" v-if="baseForm.sizeType==2&&baseForm.salesMode==1">
|
||||
<el-input v-model="baseForm.largeWeight" placeholder="大份份量" maxlength="30" clearable @input="(v)=>(baseForm.largeWeight=v.replace(/[^\d]/g,''))">
|
||||
<template slot="append">g</template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12">
|
||||
<el-form-item label="小份成本价" prop="littleMaterialCost" v-if="baseForm.sizeType==2&&baseForm.salesMode==1">
|
||||
<el-input
|
||||
v-model="baseForm.littleMaterialCost"
|
||||
placeholder="请输入小份成本价" disabled
|
||||
@input="handleNumericInput('littleMaterialCost', $event)"
|
||||
@blur="formatNumericValue('littleMaterialCost')"
|
||||
>
|
||||
<template slot="append">元</template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="大份成本价" prop="materialCost" v-if="baseForm.sizeType==2&&baseForm.salesMode==1">
|
||||
<el-input
|
||||
v-model="baseForm.materialCost"
|
||||
placeholder="请输入大份成本价" disabled
|
||||
@input="handleNumericInput('materialCost', $event)"
|
||||
@blur="formatNumericValue('materialCost')"
|
||||
>
|
||||
<template slot="append">元</template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12">
|
||||
<el-form-item label="份量" prop="weight" v-if="baseForm.sizeType==1&&baseForm.salesMode==1">
|
||||
<el-input v-model="baseForm.weight" placeholder="份量" maxlength="30" clearable @input="(v)=>(baseForm.weight=v.replace(/[^\d]/g,''))">
|
||||
<template slot="append">g</template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="质量偏差" prop="weightDeviation">
|
||||
<el-form-item label="质量偏差" prop="weightDeviation" v-if="baseForm.salesMode==1">
|
||||
<el-input v-model="baseForm.weightDeviation" placeholder="份量" maxlength="30" clearable @input="(v)=>(baseForm.weight=v.replace(/[^\d]/g,''))">
|
||||
<template slot="append">%</template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
|
||||
<el-col :span="12">
|
||||
<el-form-item label="菜品分类" prop="typeId">
|
||||
<el-select v-model="baseForm.typeId" style="width: 100%;" clearable>
|
||||
<el-option v-for="item in treeOptions"
|
||||
:key="item.typeId"
|
||||
:label="item.typeName"
|
||||
:value="item.typeId"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="餐次" prop="mealtimeTypes">
|
||||
<el-select v-model="baseForm.mealtimeTypes" multiple style="width: 100%;" clearable>
|
||||
<el-option label="早餐" value="1"></el-option>
|
||||
<el-option label="午餐" value="2"></el-option>
|
||||
<el-option label="下午茶" value="3"></el-option>
|
||||
<el-option label="晚餐" value="4"></el-option>
|
||||
<el-option label="夜宵" value="5"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12">
|
||||
<el-form-item label="菜品灶类" prop="cookId">
|
||||
<el-select v-model="baseForm.cookId" style="width: 100%;" clearable>
|
||||
|
|
@ -425,34 +507,7 @@
|
|||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="适用季节" prop="season">
|
||||
<el-select v-model="baseForm.season" multiple style="width: 100%;" clearable>
|
||||
<el-option label="春" value="1"></el-option>
|
||||
<el-option label="夏" value="2"></el-option>
|
||||
<el-option label="秋" value="3"></el-option>
|
||||
<el-option label="冬" value="4"></el-option>
|
||||
<el-option label="四季皆宜" value="5"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="餐次" prop="mealtimeTypes">
|
||||
<el-select v-model="baseForm.mealtimeTypes" multiple style="width: 100%;" clearable>
|
||||
<el-option label="早餐" value="1"></el-option>
|
||||
<el-option label="午餐" value="2"></el-option>
|
||||
<el-option label="下午茶" value="3"></el-option>
|
||||
<el-option label="晚餐" value="4"></el-option>
|
||||
<el-option label="夜宵" value="5"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
|
||||
<el-col :span="12">
|
||||
<el-form-item label="菜品口味" prop="tasteIdList">
|
||||
<el-select v-model="baseForm.tasteIdList" multiple style="width: 100%;" clearable>
|
||||
|
|
@ -475,18 +530,16 @@
|
|||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
|
||||
<el-col :span="12">
|
||||
<el-form-item label="菜品分类" prop="typeId">
|
||||
<el-select v-model="baseForm.typeId" style="width: 100%;" clearable>
|
||||
<el-option v-for="item in treeOptions"
|
||||
:key="item.typeId"
|
||||
:label="item.typeName"
|
||||
:value="item.typeId"
|
||||
></el-option>
|
||||
</el-select>
|
||||
<el-form-item label="适用季节" prop="season">
|
||||
<el-select v-model="baseForm.season" multiple style="width: 100%;" clearable>
|
||||
<el-option label="春" value="1"></el-option>
|
||||
<el-option label="夏" value="2"></el-option>
|
||||
<el-option label="秋" value="3"></el-option>
|
||||
<el-option label="冬" value="4"></el-option>
|
||||
<el-option label="四季皆宜" value="5"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
|
|
@ -500,9 +553,7 @@
|
|||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
|
||||
<el-col :span="12">
|
||||
<el-form-item label="适宜人群" prop="suitIdList">
|
||||
<el-select v-model="baseForm.suitIdList" multiple style="width: 100%;" clearable>
|
||||
|
|
@ -521,9 +572,7 @@
|
|||
<el-input v-model="baseForm.intro" type="textarea" :rows="2" maxlength="50" placeholder="请输入内容" ></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
|
||||
<el-col :span="24">
|
||||
<el-form-item label="菜品图片" prop="imageUrl">
|
||||
<el-upload
|
||||
|
|
@ -577,7 +626,7 @@
|
|||
|
||||
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="handleDialogSubmit">确 定</el-button>
|
||||
<el-button type="primary" @click="handleDialogSubmit" :disabled="btnLoading">确 定</el-button>
|
||||
<el-button @click="openDish=false">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
|
@ -604,6 +653,7 @@
|
|||
return {
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
btnLoading: false,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 非单个禁用
|
||||
|
|
@ -675,14 +725,19 @@
|
|||
areaId:null,
|
||||
canteenId:null,
|
||||
stallId:null,
|
||||
dishesNum:"",
|
||||
dishesName:"",
|
||||
dishesNum:null,
|
||||
dishesName:null,
|
||||
salesMode:1,
|
||||
sizeType:"1",
|
||||
price:"",
|
||||
price:null,
|
||||
littlePrice:null,
|
||||
largePrice:null,
|
||||
littleMaterialCost:null,
|
||||
materialCost:0,
|
||||
weight:"",
|
||||
weightDeviation:"",
|
||||
weight:null,
|
||||
littleWeight:null,
|
||||
largeWeight:null,
|
||||
weightDeviation:null,
|
||||
cookId:null,
|
||||
labelIdList:[],
|
||||
season:[],
|
||||
|
|
@ -711,6 +766,18 @@
|
|||
],
|
||||
price: [
|
||||
{ required: true, message: "单价不能为空", trigger: "blur" }
|
||||
],
|
||||
littlePrice: [
|
||||
{ required: true, message: "小份单价不能为空", trigger: "blur" }
|
||||
],
|
||||
littleWeight: [
|
||||
{ required: true, message: "小份份量不能为空", trigger: "blur" }
|
||||
],
|
||||
largePrice: [
|
||||
{ required: true, message: "大份单价不能为空", trigger: "blur" }
|
||||
],
|
||||
largeWeight: [
|
||||
{ required: true, message: "大份份量不能为空", trigger: "blur" }
|
||||
]
|
||||
},
|
||||
fileList: [],//图片
|
||||
|
|
@ -932,14 +999,19 @@
|
|||
areaId:null,
|
||||
canteenId:null,
|
||||
stallId:null,
|
||||
dishesNum:"",
|
||||
dishesName:"",
|
||||
dishesNum:null,
|
||||
dishesName:null,
|
||||
salesMode:1,
|
||||
sizeType:"1",
|
||||
price:"",
|
||||
price:null,
|
||||
littlePrice:null,
|
||||
largePrice:null,
|
||||
littleMaterialCost:null,
|
||||
materialCost:0,
|
||||
weight:"",
|
||||
weightDeviation:"",
|
||||
weight:null,
|
||||
littleWeight:null,
|
||||
largeWeight:null,
|
||||
weightDeviation:null,
|
||||
cookId:null,
|
||||
labelIdList:[],
|
||||
season:[],
|
||||
|
|
@ -963,7 +1035,34 @@
|
|||
this.title = "新增";
|
||||
this.openDish = true;
|
||||
},
|
||||
|
||||
//修改计价方式
|
||||
changeSalesMode(e){
|
||||
console.log(e)
|
||||
this.$set(this.baseForm,"sizeType",'1')
|
||||
this.$set(this.baseForm,"weight",100)
|
||||
this.$set(this.baseForm,"price",null)
|
||||
this.$set(this.baseForm,"littlePrice",null)
|
||||
this.$set(this.baseForm,"largePrice",null)
|
||||
this.$set(this.baseForm,"littleWeight",null)
|
||||
this.$set(this.baseForm,"largeWeight",null)
|
||||
this.$set(this.baseForm,"littleMaterialCost",0)
|
||||
this.$set(this.baseForm,"materialCost",0)
|
||||
this.$set(this.baseForm,"weightDeviation",null)
|
||||
if(e==1){
|
||||
this.$set(this.baseForm,"weight",null)
|
||||
}
|
||||
},
|
||||
changeSizeType(e){
|
||||
console.log(e)
|
||||
this.$set(this.baseForm,"price",null)
|
||||
this.$set(this.baseForm,"weight",null)
|
||||
this.$set(this.baseForm,"littlePrice",null)
|
||||
this.$set(this.baseForm,"largePrice",null)
|
||||
this.$set(this.baseForm,"littleWeight",null)
|
||||
this.$set(this.baseForm,"largeWeight",null)
|
||||
this.$set(this.baseForm,"littleMaterialCost",0)
|
||||
this.$set(this.baseForm,"materialCost",0)
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
console.log(row)
|
||||
|
|
@ -980,8 +1079,15 @@
|
|||
this.$set(this.baseForm,"salesMode",response.salesMode)
|
||||
this.$set(this.baseForm,"sizeType",response.sizeType+'')
|
||||
this.$set(this.baseForm,"mealType",response.mealType)
|
||||
this.$set(this.baseForm,"price",Number(response.price)/100)
|
||||
this.$set(this.baseForm,"materialCost",Number(response.materialCost)/100)
|
||||
if(this.baseForm.sizeType==1){
|
||||
this.$set(this.baseForm,"price",Number(response.price)/100)
|
||||
this.$set(this.baseForm,"materialCost",Number(response.materialCost)/100)
|
||||
}else{
|
||||
this.$set(this.baseForm,"littlePrice",Number(response.littlePrice)/100)
|
||||
this.$set(this.baseForm,"largePrice",Number(response.largePrice)/100)
|
||||
this.$set(this.baseForm,"littleMaterialCost",Number(response.littleMaterialCost)/100)
|
||||
this.$set(this.baseForm,"materialCost",Number(response.materialCost)/100)
|
||||
}
|
||||
if(this.baseForm.imageUrl){
|
||||
this.fileList=[{url:this.baseForm.imageUrl}]
|
||||
this.checkUrlList=[this.baseForm.imageUrl]
|
||||
|
|
@ -999,23 +1105,36 @@
|
|||
handleDialogSubmit() {
|
||||
this.$refs.baseForm.validate(valid => {
|
||||
if (valid) {
|
||||
if(!this.btnLoading){
|
||||
this.btnLoading=true
|
||||
this.baseForm.imageUrl = this.checkUrlList[0];
|
||||
this.baseForm.arr = this.checkUrlList;
|
||||
this.baseForm.price = Number(this.baseForm.price)*100;
|
||||
this.baseForm.materialCost = Number(this.baseForm.materialCost)*100;
|
||||
let param = {...this.baseForm}
|
||||
if(param.sizeType==1){
|
||||
param.price = Number(param.price)*100;
|
||||
param.materialCost = Number(param.materialCost)*100;
|
||||
}else{
|
||||
param.littlePrice = Number(param.littlePrice)*100;
|
||||
param.largePrice = Number(param.largePrice)*100;
|
||||
param.littleMaterialCost = Number(param.littleMaterialCost)*100;
|
||||
param.materialCost = Number(param.materialCost)*100;
|
||||
}
|
||||
if (this.title === "新增") {
|
||||
addMenuDishesApi(this.baseForm).then(response => {
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.openDish = false;
|
||||
this.getList();
|
||||
addMenuDishesApi(param).then(response => {
|
||||
this.openDish = false;
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.getList();
|
||||
this.btnLoading=false;
|
||||
});
|
||||
} else {
|
||||
editMenuDishesApi(this.baseForm).then(response => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.openDish = false;
|
||||
this.getList();
|
||||
editMenuDishesApi(param).then(response => {
|
||||
this.openDish = false;
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.getList();
|
||||
this.btnLoading=false;
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
|
|
|
|||
|
|
@ -483,7 +483,6 @@ export default {
|
|||
},
|
||||
//切换菜谱类型
|
||||
changeRecipeType(e){
|
||||
console.log(this.baseInfo.recipeType)
|
||||
if(this.baseInfo.recipeType==1){//日期范围
|
||||
this.dateRangeList = this.getDateRange(this.dateRange[0],this.dateRange[1])
|
||||
this.dateRangeRadio = this.formatDate(this.dateRange[0])
|
||||
|
|
@ -647,7 +646,7 @@ export default {
|
|||
},
|
||||
//修改
|
||||
editDishes(item){
|
||||
console.log(item)
|
||||
// console.log(item)
|
||||
this.dishesList=item.dishesList;
|
||||
this.dishesTypeList=[]
|
||||
this.dishesList.forEach(dish=>{
|
||||
|
|
@ -673,7 +672,7 @@ export default {
|
|||
"size":100
|
||||
}
|
||||
getDishesByTypePageApi(param).then((response) => {
|
||||
console.log(response)
|
||||
// console.log(response)
|
||||
this.dishesPageList = response.data.records;
|
||||
for(let i =0 ;i < this.dishesList.length ;i++){
|
||||
this.dishesPageList.forEach(item=>{
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
<template>
|
||||
<template id="MenuEdit">
|
||||
<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="80px">
|
||||
|
|
@ -420,23 +420,38 @@ export default {
|
|||
noDishes:true
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
created() {
|
||||
this.getAreaTreeData()
|
||||
this.getmkteffective()
|
||||
this.getMealTimeList()
|
||||
//获取菜品类型
|
||||
this.getTypeData()
|
||||
console.log(this.$route.query)
|
||||
this.getTypeData()
|
||||
if(this.$route.query.pageJson){
|
||||
this.baseInfo = JSON.parse(this.$route.query.pageJson)
|
||||
this.baseInfo.recipeType = this.baseInfo.recipeType+''
|
||||
this.initEditDetail()
|
||||
console.log(JSON.parse(this.$route.query.pageJson))
|
||||
this.$set(this,"baseInfo",JSON.parse(this.$route.query.pageJson))
|
||||
this.$set(this.baseInfo,"recipeType",this.baseInfo.recipeType+'')
|
||||
this.$set(this.baseInfo,"areaId",this.baseInfo.areaId||null)
|
||||
this.$set(this.baseInfo,"canteenId",this.baseInfo.canteenId||null)
|
||||
this.$set(this.baseInfo,"stallId",this.baseInfo.stallId||null)
|
||||
this.initEditDetail()
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
'$route'(newVal) {
|
||||
if(newVal.query.pageJson) {
|
||||
this.$set(this,"baseInfo",JSON.parse(newVal.query.pageJson))
|
||||
console.log(this.baseInfo)
|
||||
this.$set(this.baseInfo,"recipeType",this.baseInfo.recipeType+'')
|
||||
this.$set(this.baseInfo,"areaId",this.baseInfo.areaId||null)
|
||||
this.$set(this.baseInfo,"canteenId",this.baseInfo.canteenId||null)
|
||||
this.$set(this.baseInfo,"stallId",this.baseInfo.stallId||null)
|
||||
this.initEditDetail()
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
//菜谱编辑
|
||||
initEditDetail(){
|
||||
console.log(this.baseInfo)
|
||||
initEditDetail(){
|
||||
if(this.baseInfo.recipeType==1){//指定日期
|
||||
let length = this.baseInfo.applyDateList.length
|
||||
if(length>0){
|
||||
|
|
@ -499,7 +514,7 @@ export default {
|
|||
"recipeId": this.baseInfo.recipeId
|
||||
}
|
||||
getMenuRecipeDetailApi(param).then((response) => {
|
||||
console.log(response)
|
||||
// console.log(response)
|
||||
if(response.length>0){
|
||||
for (let i = 0; i < response.length; i++) {
|
||||
this.detailList.forEach(item=>{
|
||||
|
|
@ -522,7 +537,7 @@ export default {
|
|||
"recipeId": this.baseInfo.recipeId
|
||||
}
|
||||
getMenuRecipeTemplateDetailApi(param).then((response) => {
|
||||
console.log(response)
|
||||
// console.log(response)
|
||||
if(response.length>0){
|
||||
for (let i = 0; i < response.length; i++) {
|
||||
this.detailList.forEach(item=>{
|
||||
|
|
@ -545,7 +560,7 @@ export default {
|
|||
"recipeId": this.baseInfo.recipeId
|
||||
}
|
||||
getMenuRecipeTemplateDetailApi(param).then((response) => {
|
||||
console.log(response)
|
||||
// console.log(response)
|
||||
if(response.length>0){
|
||||
for (let i = 0; i < response.length; i++) {
|
||||
this.detailList.forEach(item=>{
|
||||
|
|
@ -578,7 +593,7 @@ export default {
|
|||
systemAreaTreeApi({}).then((response) => {
|
||||
this.treeAreaOptions = response;
|
||||
if(this.treeAreaOptions.length>0){
|
||||
this.baseInfo.areaId = this.getFirstChild(this.treeAreaOptions[0]).id;
|
||||
// this.baseInfo.areaId = this.getFirstChild(this.treeAreaOptions[0]).id;
|
||||
this.handleAreaChange()
|
||||
}
|
||||
});
|
||||
|
|
@ -598,7 +613,7 @@ export default {
|
|||
getCanteenByAreaApi(param).then((response) => {
|
||||
this.canteenOptions=response||[]
|
||||
if(this.canteenOptions.length>0){
|
||||
this.baseInfo.canteenId = this.canteenOptions[0].canteenId;
|
||||
// this.baseInfo.canteenId = this.canteenOptions[0].canteenId;
|
||||
this.handleCanteenChange()
|
||||
}
|
||||
});
|
||||
|
|
@ -610,9 +625,9 @@ export default {
|
|||
}
|
||||
getStallByCanteenApi(param).then((response) => {
|
||||
this.stallOptions=response||[]
|
||||
if(this.stallOptions.length>0){
|
||||
this.baseInfo.stallId = this.stallOptions[0].stallId;
|
||||
}
|
||||
// if(this.stallOptions.length>0){
|
||||
// this.baseInfo.stallId = this.stallOptions[0].stallId;
|
||||
// }
|
||||
});
|
||||
},
|
||||
//用户范围
|
||||
|
|
@ -624,12 +639,9 @@ export default {
|
|||
},
|
||||
|
||||
//-------切换菜谱类型---------
|
||||
changeRecipeType(e){
|
||||
console.log(this.baseInfo.recipeType)
|
||||
if(this.baseInfo.recipeType==1){//日期范围
|
||||
console.log(this.dateRange)
|
||||
this.dateRangeList = this.getDateRange(this.dateRange[0],this.dateRange[1])
|
||||
console.log(this.dateRangeList)
|
||||
changeRecipeType(e){
|
||||
if(this.baseInfo.recipeType==1){//日期范围
|
||||
this.dateRangeList = this.getDateRange(this.dateRange[0],this.dateRange[1])
|
||||
this.dateRangeRadio = this.formatDate(this.dateRange[0])
|
||||
this.detailList = this.dateRangeList[0].detailList
|
||||
}
|
||||
|
|
@ -689,7 +701,6 @@ export default {
|
|||
//周几
|
||||
var days = ['星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六'];
|
||||
var dayOfWeek = start.getDay();
|
||||
console.log(this.formatDate(start))
|
||||
let obj = {
|
||||
applyDate:this.formatDate(start),
|
||||
applyDateStr:this.formatDate(start)+" "+days[dayOfWeek],
|
||||
|
|
@ -797,7 +808,6 @@ export default {
|
|||
},
|
||||
//修改菜品
|
||||
editDishes(item){
|
||||
console.log(item)
|
||||
this.dishesList=item.dishesList;
|
||||
this.dishesTypeList=[]
|
||||
this.dishesList.forEach(dish=>{
|
||||
|
|
@ -823,7 +833,7 @@ export default {
|
|||
"size":100
|
||||
}
|
||||
getDishesByTypePageApi(param).then((response) => {
|
||||
console.log(response)
|
||||
// console.log(response)
|
||||
this.dishesPageList = response.data.records;
|
||||
for(let i =0 ;i < this.dishesList.length ;i++){
|
||||
this.dishesPageList.forEach(item=>{
|
||||
|
|
@ -932,7 +942,6 @@ export default {
|
|||
}]
|
||||
}
|
||||
if(this.baseInfo.recipeType==3){
|
||||
console.log(this.weekDateList)
|
||||
param.recipeDateList = this.weekDateList
|
||||
}
|
||||
this.noDishes = true;
|
||||
|
|
|
|||
|
|
@ -279,8 +279,8 @@
|
|||
this.getMealTypeList();
|
||||
this.daysList = this.getRecentWeekDates();
|
||||
this.monthDaysList = this.getRecentMonthDates();
|
||||
console.log(this.currentWeekList)
|
||||
console.log(this.monthDaysList)
|
||||
// console.log(this.currentWeekList)
|
||||
// console.log(this.monthDaysList)
|
||||
this.queryParams.applyDate = this.daysList[0].data;
|
||||
this.getAreaTreeData()
|
||||
this.getList()//获取当前菜谱
|
||||
|
|
|
|||
Loading…
Reference in New Issue