热量(千卡)
- {{baseForm.dishesNutrition.calories||0}}
+ {{baseForm.calories||0}}
蛋白质(g)
- {{baseForm.dishesNutrition.protein||0}}
+ {{baseForm.protein||0}}
脂肪(g)
- {{baseForm.dishesNutrition.fat||0}}
+ {{baseForm.fat||0}}
碳水化合物(g)
- {{baseForm.dishesNutrition.carbohydrate||0}}
+ {{baseForm.carbohydrate||0}}
膳食纤维(g)
- {{baseForm.dishesNutrition.dietaryFiber||0}}
+ {{baseForm.dietaryFiber||0}}
胆固醇(mg)
- {{baseForm.dishesNutrition.cholesterol||0}}
+ {{baseForm.cholesterol||0}}
钙(mg)
- {{baseForm.dishesNutrition.calcium||0}}
+ {{baseForm.calcium||0}}
钠(mg)
- {{baseForm.dishesNutrition.sodium||0}}
+ {{baseForm.sodium||0}}
总嘌呤含量(mg)
- {{baseForm.dishesNutrition.purine||0}}
+ {{baseForm.purine||0}}
铁(mg)
- {{baseForm.dishesNutrition.iron||0}}
+ {{baseForm.iron||0}}
碘(μg)
- {{baseForm.dishesNutrition.iodine||0}}
+ {{baseForm.iodine||0}}
钾(mg)
- {{baseForm.dishesNutrition.kalium||0}}
+ {{baseForm.kalium||0}}
维生素a(μg)
- {{baseForm.dishesNutrition.vitaminA||0}}
+ {{baseForm.vitaminA||0}}
维生素c(mg)
- {{baseForm.dishesNutrition.vitaminC||0}}
+ {{baseForm.vitaminC||0}}
维生素e(mg)
- {{baseForm.dishesNutrition.vitaminE||0}}
+ {{baseForm.vitaminE||0}}
镁(mg)
- {{baseForm.dishesNutrition.magnesium||0}}
+ {{baseForm.magnesium||0}}
锌(mg)
- {{baseForm.dishesNutrition.zinc||0}}
+ {{baseForm.zinc||0}}
血糖生成指数(GI)
- {{baseForm.dishesNutrition.glycemicIndex||0}}
+ {{baseForm.glycemicIndex||0}}
@@ -785,84 +785,84 @@
热量(千卡)
- {{baseForm.dishesNutrition.calories||0}}
+ {{baseForm.calories||0}}
蛋白质(g)
- {{baseForm.dishesNutrition.protein||0}}
+ {{baseForm.protein||0}}
脂肪(g)
- {{baseForm.dishesNutrition.fat||0}}
+ {{baseForm.fat||0}}
碳水化合物(g)
- {{baseForm.dishesNutrition.carbohydrate||0}}
+ {{baseForm.carbohydrate||0}}
膳食纤维(g)
- {{baseForm.dishesNutrition.dietaryFiber||0}}
+ {{baseForm.dietaryFiber||0}}
胆固醇(mg)
- {{baseForm.dishesNutrition.cholesterol||0}}
+ {{baseForm.cholesterol||0}}
钙(mg)
- {{baseForm.dishesNutrition.calcium||0}}
+ {{baseForm.calcium||0}}
钠(mg)
- {{baseForm.dishesNutrition.sodium||0}}
+ {{baseForm.sodium||0}}
总嘌呤含量(mg)
- {{baseForm.dishesNutrition.purine||0}}
+ {{baseForm.purine||0}}
铁(mg)
- {{baseForm.dishesNutrition.iron||0}}
+ {{baseForm.iron||0}}
碘(μg)
- {{baseForm.dishesNutrition.iodine||0}}
+ {{baseForm.iodine||0}}
钾(mg)
- {{baseForm.dishesNutrition.kalium||0}}
+ {{baseForm.kalium||0}}
维生素a(μg)
- {{baseForm.dishesNutrition.vitaminA||0}}
+ {{baseForm.vitaminA||0}}
维生素c(mg)
- {{baseForm.dishesNutrition.vitaminC||0}}
+ {{baseForm.vitaminC||0}}
维生素e(mg)
- {{baseForm.dishesNutrition.vitaminE||0}}
+ {{baseForm.vitaminE||0}}
镁(mg)
- {{baseForm.dishesNutrition.magnesium||0}}
+ {{baseForm.magnesium||0}}
锌(mg)
- {{baseForm.dishesNutrition.zinc||0}}
+ {{baseForm.zinc||0}}
血糖生成指数(GI)
- {{baseForm.dishesNutrition.glycemicIndex||0}}
+ {{baseForm.glycemicIndex||0}}
小份{{ baseForm.littleWeight }}g 含营养信息
@@ -1429,37 +1429,42 @@
menuDishesDetailApi({"dishesId":row.dishesId}).then(response => {
this.getAllSelectList()
this.resetDishDialog()
- this.baseForm = response
+ this.baseForm = response.data
getCanteenByAreaApi({areaId:this.baseForm.areaId,canteenType: 1}).then((response) => {
this.canteenOptions2=response.rows||[]
});
getStallByCanteenApi({canteenId:this.baseForm.canteenId}).then((response) => {
this.stallOptions2=response.rows||[]
});
- 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,"salesMode",response.data.salesMode)
+ this.$set(this.baseForm,"sizeType",response.data.sizeType+'')
+ this.$set(this.baseForm,"mealType",response.data.mealType)
if(this.baseForm.sizeType==1){
- this.$set(this.baseForm,"price",Number(response.price)/100)
- this.$set(this.baseForm,"materialCost",Number(response.materialCost)/100)
- this.$set(this,"materialList",response.materialList)
+ this.$set(this.baseForm,"price",Number(response.data.price)/100)
+ this.$set(this.baseForm,"materialCost",Number(response.data.materialCost)/100)
+ this.$set(this,"materialList",response.data.materialList)
}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)
- let arr = []
- this.baseForm.materialList.forEach((item,index)=>{
- let obj = {
- materialId: item.materialId,
- materialName: item.materialName,
- materialType: item.materialType,
- littleWeight: this.baseForm.littleMaterialList[index].weight,
- largeWeight: item.weight
- }
- arr.push(obj)
- })
- this.$set(this,"materialList",arr)
+ this.$set(this.baseForm,"littlePrice",Number(response.data.littlePrice)/100)
+ this.$set(this.baseForm,"largePrice",Number(response.data.largePrice)/100)
+ this.$set(this.baseForm,"littleMaterialCost",Number(response.data.littleMaterialCost)/100)
+ this.$set(this.baseForm,"materialCost",Number(response.data.materialCost)/100)
+
+ if(this.baseForm.materialList.length>0){
+ let arr = []
+ this.baseForm.materialList.forEach((item,index)=>{
+ let obj = {
+ materialId: item.materialId,
+ materialName: item.materialName,
+ materialType: item.materialType,
+ littleWeight: this.baseForm.littleMaterialList[index].weight,
+ largeWeight: item.weight
+ }
+ arr.push(obj)
+ })
+ this.$set(this,"materialList",arr)
+ }else{
+ this.$set(this,"materialList",[])
+ }
}
if(this.baseForm.imageUrl){
this.fileList=[{url:this.baseForm.imageUrl}]
@@ -1468,7 +1473,7 @@
this.fileList=[]
this.checkUrlList=[]
}
- this.$set(this,"materialOptions",response.materialList)
+ this.$set(this,"materialOptions",response.data.materialList)
this.activeName="1"
this.title = "修改";
this.openDish = true;
@@ -1591,7 +1596,7 @@
},
handleSelectionChange(selection){
this.batchIds = []
- this.batchIds = selection.map((item) => item.materialId)
+ this.batchIds = selection.map((item) => item.dishesId)
this.single = selection.length !== 1
this.multiple = !selection.length
},
diff --git a/src/views/system/user/index.vue b/src/views/system/user/index.vue
index f8f9344d..7d12c9bf 100644
--- a/src/views/system/user/index.vue
+++ b/src/views/system/user/index.vue
@@ -316,6 +316,11 @@
>更多
+ 人脸上传
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
0
+ },
},
watch: {
// 根据名称筛选部门树
@@ -971,6 +1041,9 @@ export default {
case 'approvalStatus':
this.handleApprovalStatus(row)
break
+ case 'handleUpFace':
+ this.handleUpFace(row)
+ break
default:
break
}
@@ -1172,8 +1245,7 @@ export default {
// 提交上传文件
submitFileForm() {
this.$refs.upload.submit()
- },
-
+ },
hasSystemOrAuditrRole(roles) {
if (!roles || !Array.isArray(roles)) {
return false // 如果 roles 为空或不是数组,返回 false
@@ -1182,8 +1254,7 @@ export default {
(role) =>
role.roleKey === 'systemAdmin' || role.roleKey === 'audit',
) // 检查是否存在 roleKey 为 admin 的角色
- },
-
+ },
// 检查行是否可选
checkSelectable(row) {
return !(
@@ -1191,16 +1262,86 @@ export default {
row.isBuiltIn === '0' ||
this.hasSystemOrAuditrRole(row.roles)
)
- },
-
+ },
getRowClassName(row) {
return !this.checkSelectable(row) ? 'disabled-row' : ''
},
+
+
+ //-----人脸上传------
+ handleUpFace(row){
+ console.log(row)
+ const userId = row.userId || this.ids
+ getUser(userId).then((response) => {
+ this.baseForm = response.data
+ this.openFace = true
+ })
+ },
+ submitFace(){
+ // console.log(this.baseForm)
+ console.log(this.checkUrlList)
+ if(this.checkUrlList.length==0){
+ this.$message.warning('请先上传人脸图片')
+ }else{
+ this.baseForm.photoUrl = this.checkUrlList[0]
+ updateUser(this.baseForm).then((response) => {
+ this.$modal.msgSuccess('上传成功')
+ store.commit('SET_FACE', this.checkUrlList[0]);
+ this.openFace = false;
+ this.getList()
+ })
+ }
+ },
+ // 图片上传
+ imgUpLoad(param, name, index) {
+ // console.log(param,'image')
+ param.type = 'face'
+ console.log(param.file)
+ imgUpLoadTwo(param).then((res) => {
+ if (res.code == 200) {
+ this.checkUrlList.push(res.data.url)
+ this.checkUrlNameList.push(res.data.name)
+ } else {
+ this.$modal.msgError(res.msg)
+ }
+ })
+ .catch((error) => {
+ this.$modal.msgError(error)
+ })
+ },
+ handleAvatarSuccess(res, file) {
+ console.log('success')
+ },
+ handleExceed(files, fileList) {
+ this.$message.warning('最多只可以上传一张图片')
+ },
+ handleRemove(file, fileList) {
+ let sum = 0
+ this.checkUrlNameList.forEach((item, index) => {
+ if (item == file.name) {
+ sum = index
+ }
+ })
+ this.checkUrlNameList.splice(sum, 1)
+ this.checkUrlList.splice(sum, 1)
+ },
+ //图片点击查看
+ handlePictureCardPreview(file) {
+ console.log(file)
+ this.dialogImageUrl = file.url
+ this.dialogVisible = true
+ }
},
}
-