From f143d2a63e00e43b461914a0660e4a91dd50a1db Mon Sep 17 00:00:00 2001
From: cloudroam <cloudroam>
Date: 星期三, 09 十月 2024 19:56:17 +0800
Subject: [PATCH] Merge branch 'master' of http://47.96.225.205:8888/r/operation_pc-v2

---
 pages/order/evaluation/index.vue |  286 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 286 insertions(+), 0 deletions(-)

diff --git a/pages/order/evaluation/index.vue b/pages/order/evaluation/index.vue
new file mode 100644
index 0000000..e03d133
--- /dev/null
+++ b/pages/order/evaluation/index.vue
@@ -0,0 +1,286 @@
+<template>
+  <el-bus-crud ref="crud" v-bind="tableConfig">
+    <template #table="{ list }">
+      <template v-if="list && list.length > 0">
+        <evaluation-table :list="list" @detail="onDetail" @handle="onHandle" @delete="onDelete" @show="onShow" @hide="onHide"/>
+      </template>
+      <el-bus-empty v-else />
+    </template>
+  </el-bus-crud>
+</template>
+
+<script>
+import EvaluationTable from '@/components/order/evaluation-table'
+export default {
+  components: {
+    EvaluationTable,
+  },
+  data() {
+    return {
+      tableConfig: {
+        evaluationId: null,
+        url: 'flower/api/v2/flower-comment/page',
+        hasNew: false,
+        hasEdit: false,
+        hasDelete: true,
+        operationAttrs: {
+          width: 150,
+          fixed: 'right',
+        },
+
+        searchForm: [
+          {
+            type: 'row',
+            items: [
+              { label: '订单编号', id: 'orderId', type: 'input' },
+              { label: '商品名称', id: 'flowerName', type: 'input' },
+              {
+                label: '评价星级',
+                id: 'commentGrade',
+                type: 'bus-select-dict',
+                el: {
+                  code: 'comment_grade',
+                  clearable: true,
+                  style: 'width:100%',
+                },
+              },
+              {
+                label: '申请日期',
+                component: 'el-bus-date-range',
+                id: 'createDateBeginStr',
+                commonFormat: true,
+                commonFormatProps: ['createDateBeginStr', 'createDateEndStr'],
+                customClass: 'in-bus-form',
+              },
+            ],
+          },
+        ],
+        form: [
+          // { label: '评价内容1', id: 'comment', type: 'input' },
+        ],
+        extraDialogs: [
+          {
+            title: '评价详情',
+            readonly: true,
+            dialogAttrs: {
+              width: '70%',
+            },
+            form: [
+              {
+                label: '订单编号:',
+                id: 'orderId',
+                type: 'input',
+                readonly: true,
+              },
+              {
+                label: '商品名称:',
+                id: 'flowerName',
+                type: 'input',
+                readonly: true,
+              },
+              {
+                label: '商品封面图:',
+                id: 'flowerCover',
+                type: 'bus-upload',
+                readonly: true,
+                el: {
+                  listType: 'picture-card',
+                  limitSize: 2,
+                },
+              },
+              {
+                label: '商品等级:',
+                id: 'flowerLevel',
+                type: 'input',
+                readonly: true,
+              },
+              {
+                label: '商品规格:',
+                id: 'flowerUnit',
+                type: 'input',
+                readonly: true,
+              },
+              {
+                label: '供应商信息:',
+                id: 'supplierName',
+                type: 'input',
+                readonly: true,
+              },
+              {
+                label: '用户信息:',
+                id: 'customerName',
+                type: 'input',
+                readonly: true,
+              },
+              {
+                label: '评价星级:',
+                id: 'commentGrade',
+                type: 'input',
+                readonly: true,
+              },
+              {
+                label: '评论显示状态:',
+                id: 'showFlag',
+                type: 'input',
+                readonly: true,
+              },
+              {
+                label: '评价内容:',
+                id: 'comment',
+                type: 'input',
+                readonly: true,
+              },
+              {
+                label: '回复内容:',
+                id: 'replayContent',
+                type: 'input',
+                readonly: true,
+              },
+              {
+                label: '评价时间:',
+                id: 'createTime',
+                type: 'input',
+                readonly: true,
+              },
+              {
+                label: '评价图片:',
+                id: 'commentImages',
+                type: 'image',
+                readonly: true,
+              },
+              ]
+          },
+          {
+            title: '回复评价',
+            form: [
+              {
+                label: '评价内容:',
+                id: 'comment',
+                type: 'input',
+                readonly: true,
+              },
+              {
+                label: '回复内容:',
+                id: 'replayContent',
+                type: 'input',
+                el: {
+                  rows: 6,
+                  type: 'textarea',
+                },
+                rules: {
+                  required: true,
+                  message: '请输入回复内容',
+                  trigger: 'blur',
+                },
+              },
+            ],
+            atConfirm: async (val) => {
+              const { code } = await this.$elBusHttp.request(
+                'flower/api/v2/flower-comment/replay/' + this.evaluationId + '',
+                {
+                  method: 'put',
+                  data: val,
+                }
+              )
+              if (code === 0) {
+                this.$message.success('回复成功')
+              }
+            },
+          },
+        ],
+      },
+    }
+  },
+  head() {
+    return {
+      title: '评价列表',
+    }
+  },
+  methods:{
+     onHandle(item) {
+        this.evaluationId = item.id
+        this.$refs.crud.$refs.extraDialog[1].show({
+          comment: item.comment,
+        })
+    },
+     async onDetail(item) {
+       const {code, data} = await this.$elBusHttp.request(
+         'flower/api/v2/flower-comment/list',
+         {params: {id: item.id}}
+       )
+       if (code === 0) {
+         console.log(data);
+         console.log(data[0].orderId);
+         this.$refs.crud.$refs.extraDialog[0].show(data[0])
+
+       }
+     },
+    async onDelete(item) {
+      try {
+        await this.$elBusUtil.confirm(
+          `确定要删除这个商品吗?`
+        )
+        const {code, data} = await this.$elBusHttp.request(
+          'flower/api/v2/flower-comment/' + item.id + '',
+          {
+            method: 'delete',
+          }
+        )
+        if (code === 0) {
+          this.$message.success(`删除成功`)
+          this.$refs.crud.getList()
+        } else {
+          return false
+        }
+      } catch (error) {
+        return false
+      }
+    },
+    async onShow(item) {
+      try {
+        await this.$elBusUtil.confirm(
+          `确定要显示这个评价吗?`
+        )
+        const {code} = await this.$elBusHttp.request(
+          'flower/api/v2/flower-comment/show/' + item.id + '',
+          {
+            method: 'put',
+            data: {showFalg: 0},
+          }
+        )
+        if (code === 0) {
+          this.$message.success(`显示成功`)
+          this.$refs.crud.getList()
+        }
+      } catch (e) {
+        return false
+      }
+    },
+
+    async onHide(item) {
+      try {
+        await this.$elBusUtil.confirm(
+          `确定要隐藏这个评价吗?`
+        )
+        const {code} = await this.$elBusHttp.request(
+          'flower/api/v2/flower-comment/show/' + item.id + '',
+          {
+            method: 'put',
+            data: {showFalg: 1},
+          }
+        )
+        if (code === 0) {
+          this.$message.success(`隐藏成功`)
+          this.$refs.crud.getList()
+        }
+      } catch (e) {
+        return false
+      }
+    }
+  }
+}
+</script>
+
+<style scoped>
+
+</style>

--
Gitblit v1.9.3