From b1207d7cba21fc9f81fff64842c9040c8cf1473c Mon Sep 17 00:00:00 2001
From: 陶杰 <1378534974@qq.com>
Date: 星期一, 30 十二月 2024 10:00:33 +0800
Subject: [PATCH] 1.批量任务-用户列表传入userId
---
pages/order/evaluation/index.vue | 122 +++++++++++++++++++++++++---------------
1 files changed, 77 insertions(+), 45 deletions(-)
diff --git a/pages/order/evaluation/index.vue b/pages/order/evaluation/index.vue
index 1eb163b..a67c40b 100644
--- a/pages/order/evaluation/index.vue
+++ b/pages/order/evaluation/index.vue
@@ -2,7 +2,14 @@
<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"/>
+ <evaluation-table
+ :list="list"
+ @detail="onDetail"
+ @handle="onHandle"
+ @delete="onDelete"
+ @show="onShow"
+ @hide="onHide"
+ />
</template>
<el-bus-empty v-else />
</template>
@@ -32,7 +39,7 @@
{
type: 'row',
items: [
- { label: '订单编号', id: 'orderId', type: 'input' },
+ { label: '订单编号', id: 'orderNo', type: 'input' },
{ label: '商品名称', id: 'flowerName', type: 'input' },
{
label: '评价星级',
@@ -45,11 +52,11 @@
},
},
{
- label: '申请日期',
+ label: '评价时间',
component: 'el-bus-date-range',
- id: 'createDateBeginStr',
+ id: 'commentStartDate',
commonFormat: true,
- commonFormatProps: ['createDateBeginStr', 'createDateEndStr'],
+ commonFormatProps: ['commentStartDate', 'commentEndDate'],
customClass: 'in-bus-form',
},
],
@@ -62,13 +69,16 @@
{
title: '评价详情',
readonly: true,
+ showButton: false,
dialogAttrs: {
width: '70%',
+ closeOnClickModal: true,
+ customClass: 'evaluation-drawer-wrapper',
},
form: [
{
label: '订单编号:',
- id: 'orderId',
+ id: 'orderNo',
type: 'input',
readonly: true,
},
@@ -86,7 +96,9 @@
el: {
listType: 'picture-card',
limitSize: 2,
+ valueType: 'string',
},
+ forceDisabled: true,
},
{
label: '商品等级:',
@@ -115,14 +127,23 @@
{
label: '评价星级:',
id: 'commentGrade',
- type: 'input',
+ component: 'simple-text',
readonly: true,
+ el: {
+ type: 'primary',
+ },
+ forceDisabled: true,
},
{
label: '评论显示状态:',
id: 'showFlag',
- type: 'input',
+ component: 'simple-text',
readonly: true,
+ el: (row) => ({
+ type: 'primary',
+ text: row.showFlag === 0 ? '显示' : '隐藏',
+ }),
+ forceDisabled: true,
},
{
label: '评价内容:',
@@ -151,10 +172,18 @@
listType: 'picture-card',
limit: 1,
limitSize: 2,
- valueType: 'string',
},
+ inputFormat: (row) => {
+ if ('commentImages' in row) {
+ return row.commentImages
+ ? JSON.parse(row.commentImages).map((i) => ({ url: i }))
+ : []
+ }
+ },
+ commonFormat: true,
+ forceDisabled: true,
},
- ]
+ ],
},
{
title: '回复评价',
@@ -202,30 +231,30 @@
title: '评价列表',
}
},
- methods:{
- onHandle(item) {
- this.evaluationId = item.id
- this.$refs.crud.$refs.extraDialog[1].show({
- comment: item.comment,
- })
+ 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) {
- const row = data[0];
- this.$refs.crud.$refs.extraDialog[0].show(row)
-
- }
- },
+ async onDetail(item) {
+ const { code, data } = await this.$elBusHttp.request(
+ 'flower/api/v2/flower-comment/list',
+ { params: { id: item.id } }
+ )
+ if (code === 0) {
+ const row = data[0]
+ row.supplierName = row.supplierName+'[ID:'+ row.supplierId +'], 电话:'+row.supplierContactTel
+ row.customerName = row.customerName+'[UID:'+ row.customerId +']'
+ row.commentGrade = row.commentGrade+'星'
+ this.$refs.crud.$refs.extraDialog[0].show(row)
+ }
+ },
async onDelete(item) {
try {
- await this.$elBusUtil.confirm(
- `确定要删除这个商品吗?`
- )
- const {code} = await this.$elBusHttp.request(
+ await this.$elBusUtil.confirm(`确定要删除这个商品吗?`)
+ const { code } = await this.$elBusHttp.request(
'flower/api/v2/flower-comment/' + item.id + '',
{
method: 'delete',
@@ -243,14 +272,12 @@
},
async onShow(item) {
try {
- await this.$elBusUtil.confirm(
- `确定要显示这个评价吗?`
- )
- const {code} = await this.$elBusHttp.request(
+ await this.$elBusUtil.confirm(`确定要显示这个评价吗?`)
+ const { code } = await this.$elBusHttp.request(
'flower/api/v2/flower-comment/show/' + item.id + '',
{
method: 'put',
- data: {showFalg: 0},
+ data: { showFalg: 0 },
}
)
if (code === 0) {
@@ -264,14 +291,12 @@
async onHide(item) {
try {
- await this.$elBusUtil.confirm(
- `确定要隐藏这个评价吗?`
- )
- const {code} = await this.$elBusHttp.request(
+ await this.$elBusUtil.confirm(`确定要隐藏这个评价吗?`)
+ const { code } = await this.$elBusHttp.request(
'flower/api/v2/flower-comment/show/' + item.id + '',
{
method: 'put',
- data: {showFalg: 1},
+ data: { showFalg: 1 },
}
)
if (code === 0) {
@@ -281,11 +306,18 @@
} catch (e) {
return false
}
- }
- }
+ },
+ },
}
</script>
-<style scoped>
-
+<style lang="scss">
+.evaluation-drawer-wrapper {
+ position: absolute;
+ right: 0;
+ top: 0;
+ width: 35% !important;
+ margin-top: 0 !important;
+ min-height: 100vh;
+}
</style>
--
Gitblit v1.9.3