Ver código fonte

评论前端

zwq 2 anos atrás
pai
commit
3b34fc0ac9

+ 2 - 2
nngkxxdp/src/main/resources/mapper/SEvaluationDao.xml

@@ -38,7 +38,7 @@
                 and sc.canteen_name like  CONCAT('%', #{sEvaluation.canteenName}, '%')
             </if>
             <if test="sEvaluation.dishesName != null and sEvaluation.dishesName != ''">
-                and sf.dishes_name LIKE CONCAT('%',+#{sEvaluation.dishesName}+,'%')
+                and sf.dishes_name LIKE CONCAT('%', #{sEvaluation.dishesName}, '%')
             </if>
             <if test="sEvaluation.score != null and sEvaluation.score != ''">
                 and se.score = #{sEvaluation.score}
@@ -68,7 +68,7 @@
                 and sc.canteen_name like  CONCAT('%', #{canteenName}, '%')
             </if>
             <if test="dishesName != null and dishesName != ''">
-                and sf.dishes_name LIKE CONCAT('%',+#{dishesName}+,'%')
+                and sf.dishes_name LIKE CONCAT('%', #{dishesName}, '%')
             </if>
             <if test="score != null and score != ''">
                 and se.score = #{score}

+ 7 - 9
nngkxxdp/src/main/resources/static/naqwzsjtj/naqwzsjtj/src/api/index.js

@@ -130,7 +130,6 @@ export default {
     return request.post('postManagement/updatePostById', data)
   },
 
-
   // 分页查询所有部门信息
   getDeptPage(data) {
     return request.get('tj/getDeptPage', data)
@@ -301,6 +300,10 @@ export default {
   deleteSupplyTimeById(data) {
     return request.post('supplyTime/delete', data)
   },
+  // 供应时间列表
+  supplyTimeList(data) {
+    return request.get('supplyTime/list', data)
+  },
 
   // 评论单个查询
   queryEvaluationById(data) {
@@ -314,17 +317,12 @@ export default {
 
   // 删除
   removeEvaluation(data) {
-    return request.post('evaluation/del', data)
+    return request.get('evaluation/del', data)
   },
   // 标记违规
   markEvaluation(data) {
-    return request.post('evaluation/mark', data)
-  },
-  // 供应时间列表
-  supplyTimeList(data) {
-    return request.get('supplyTime/list', data)
-  },
-
+    return request.get('evaluation/mark', data)
+  }
 }
 
 // export const addInfo = (problemInfo)=>{

+ 68 - 118
nngkxxdp/src/main/resources/static/naqwzsjtj/naqwzsjtj/src/views/canteen/EvaluationManage.vue

@@ -24,18 +24,18 @@
           {{ (sorts.page - 1) * sorts.limit + scope.$index + 1 }}
         </template>
       </el-table-column>
-      <el-table-column prop="dishesName" label="食堂名称" />
-      <el-table-column prop="typeName" label="菜品名称" />
-      <el-table-column prop="typeName" label="用户名" />
-      <el-table-column prop="typeName" label="评分" />
-      <el-table-column prop="typeName" label="评论" />
+      <el-table-column prop="canteenName" label="食堂名称" />
+      <el-table-column prop="dishesName" label="菜品名称" />
+      <!-- <el-table-column prop="userid" label="用户名" /> -->
+      <el-table-column prop="score" label="评分" />
+      <el-table-column prop="evaluation" label="评论" />
       <el-table-column prop="createTime" label="创建时间" />
       <el-table-column prop="updateTime" label="更新时间" />
       <el-table-column label="操作" width="230">
         <template slot-scope="scope">
-          <el-button class="btn" type="primary" @click="info(scope.row)">详情</el-button>
+          <el-button class="but" type="primary" @click="info(scope.row)">详情</el-button>
           <el-button class="but" type="warning" @click="markEvaluation(scope.row.id)">
-            违规禁用</el-button>
+            标记</el-button>
           <el-button class="but" type="danger" @click="handleDelete(scope.row.id, scope.$index)">删除
           </el-button>
         </template>
@@ -47,6 +47,48 @@
                      layout="prev, pager,next,jumper,total,sizes" :total="total">
       </el-pagination>
     </div>
+    <!-- 详情页面 -->
+    <el-dialog
+      :visible.sync="workDialog"
+      width="50%"
+      class="detailDialog"
+      :close-on-click-modal="false"
+      top="40px"
+    >
+      <div slot="title">
+        <div class="addTitle">{{ workTitle }}</div>
+      </div>
+      <div style="height: 65vh; overflow: auto; padding-right: 20px">
+        <el-form :model="postManagement" label-width="140px">
+          <el-row>
+            <el-col :span="14">
+              <el-form-item label="食堂名称" prop="canteenName">
+                <el-input v-model="postManagement.canteenName" :readonly="true"></el-input>
+              </el-form-item>
+              <el-form-item label="菜品名称" prop="dishesName">
+                <el-input v-model="postManagement.dishesName" :readonly="true"></el-input>
+              </el-form-item>
+              <el-form-item label="评分" prop="score">
+                <el-input v-model="postManagement.score" :readonly="true"></el-input>
+              </el-form-item>
+              <el-form-item label="评论" prop="evaluation">
+                <el-input v-model="postManagement.evaluation" :readonly="true"></el-input>
+              </el-form-item>
+              <el-form-item label="创建时间" prop="createTime">
+                <el-input v-model="postManagement.createTime" :readonly="true"></el-input>
+              </el-form-item>
+              <el-form-item label="更新时间" prop="updateTime">
+                <el-input v-model="postManagement.updateTime" :readonly="true"></el-input>
+              </el-form-item>
+            </el-col>
+          </el-row>
+        </el-form>
+      </div>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" size="mini" @click="saveWork">提交</el-button>
+        <el-button @click="workDialog = false" size="mini">返回</el-button>
+      </div>
+    </el-dialog>
 
   </div>
 </template>
@@ -71,45 +113,21 @@ export default {
       },
       // 列表数据
       tableData: [],
-      // 菜品类型数据
-      typeData: [],
       // 总数
       total: 0,
-      // 菜品类型总数
-      typeTotal: 0,
-      // 上传相关
-      upload: {
-        open: false,
-        isUploading: false,
-        file: null,
-        fileList: []
-      },
-      // 图片
-      picList: [],
       //新增/编辑界面
       workDialog: false,
-      // 菜品类型界面
-      typeVisible: false,
       //新增/编辑标题
-      workTitle: '新增菜品',
+      workTitle: '详情',
       // 新增/编辑表单
       postManagement: {
-        dishesName: '',
-        typeId: '',
-        typeName: '',
-        pic: []
+        dishesName: ''
       },
       // 分页
       sorts: {
         page: 1,
         limit: 10,
       },
-      // 菜品类型分页
-      typeSorts: {
-        page: 1,
-        limit: 10,
-        typeName: ''
-      },
     }
   },
   methods: {
@@ -132,10 +150,10 @@ export default {
         cancelButtonText: "取消",
         type: "warning"
       }).then(() => {
-        let param= {
-          id: id
-        }
-        api.markEvaluation(param).then(res => {
+        let params = {
+        "id": id
+      };
+        api.markEvaluation({params}).then(res => {
           if (res.data.result) {
             this.$message({
               type: 'success',
@@ -155,8 +173,12 @@ export default {
           message: '已取消标记'
         });
       })
-    }
-    ,
+    },
+    info(data) {
+      this.workTitle = "详情";
+      this.postManagement = JSON.parse(JSON.stringify(data));
+      this.workDialog = true;
+    },
     //删除
     handleDelete(id, index) {
       this.$confirm("您确定要删除该数据吗?", "提示", {
@@ -165,9 +187,10 @@ export default {
         cancelButtonText: "取消",
         type: "warning"
       }).then(() => {
-        let fd = new FormData();
-        fd.append('id', id);
-        api.deleteArticleById(fd).then(res => {
+        let params = {
+          "id": id
+        }
+        api.removeEvaluation({params}).then(res => {
           if (res.data.result) {
             this.$message({
               type: 'success',
@@ -196,8 +219,8 @@ export default {
         size: this.sorts.limit,
         dishesName: this.query.dishesName
       }).then(r => {
-        this.total = r.data.count
-        this.tableData = r.data.content
+        this.total = r.data.data.totalElements
+        this.tableData = r.data.data.content
       })
     },
     // 搜索
@@ -210,80 +233,7 @@ export default {
       this.query.dishesName = '';
       this.sorts.page = 1;
       this.getData()
-    },
-    // 更改文件
-    onChange(file, fileList) {
-      if (file.raw.type === 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' ||
-          file.raw
-              .type === 'application/vnd.ms-excel') {
-        this.upload.file = file;
-        // 覆盖上次上传的文件
-        if (fileList.length > 0) {
-          this.upload.fileList = [fileList[fileList.length - 1]];
-        }
-      } else {
-        this.$message.error('只能上传xls、xlsx文件!');
-      }
-    },
-    // 查看菜品类型信息
-    typeInfo() {
-      this.typeVisible = true;
-      this.typeSorts.page = 1;
-      this.typeSorts.limit = 10;
-      this.typeSorts.typeName = '';
-      this.getTypeData();
-    },
-    // 获取菜品类型信息数据
-    getTypeData() {
-      let params = {
-        page: this.typeSorts.page,
-        limit: this.typeSorts.limit,
-        typeName: this.typeSorts.typeName
-      }
-      api.getFoodTypePage({
-        params
-      }).then(r => {
-        this.typeTotal = r.data.count;
-        this.typeData = r.data.data;
-      })
-    },
-    //切换菜品类型条数
-    typeSizeChange(pageSize) {
-      this.typeSorts.limit = pageSize
-      this.typeSorts.page = 1;
-      this.getTypeData();
-    },
-    //切换菜品类型页码
-    typeCurrentChange(currentPage) {
-      this.$refs.typeTable.bodyWrapper.scrollTop = 0;
-      this.typeSorts.page = currentPage;
-      this.getTypeData();
-    },
-    // 选择菜品类型
-    chooseType(data) {
-      this.postManagement.typeId = data.id;
-      this.postManagement.typeName = data.typeName;
-      this.typeVisible = false;
-    },
-    // 搜索菜品类型信息
-    searchType() {
-      this.typeSorts.page = 1;
-      this.getTypeData();
-    },
-    // 清空菜品类型输入框
-    resetType() {
-      this.typeSorts.typeName = '';
-      this.typeSorts.page = 1;
-      this.getTypeData()
-    },
-
-    //删除文件
-    picRemove(file, fileList) {
-      console.log(file);
-      console.log(fileList);
-      console.log(this.postManagement.pic);
-      console.log(this.picList);
-    },
+    }
   },
 }
 </script>

+ 1 - 1
nngkxxdp/src/main/resources/static/naqwzsjtj/naqwzsjtj/src/views/canteen/SupplyTimeManage.vue

@@ -348,7 +348,7 @@ export default {
       };
       api
         .supplyTimePage({
-          params,
+          params
         })
         .then((r) => {
           this.total = r.data.count;