Browse Source

no message

linwenxin 1 year ago
parent
commit
cd7e0bd46c
1 changed files with 30 additions and 30 deletions
  1. 30 30
      src/views/secondHandMall/commodityManagement/form.vue

+ 30 - 30
src/views/secondHandMall/commodityManagement/form.vue

@@ -317,40 +317,12 @@ export default {
                   },
                   render: (h, { row, column, index }) => {
                     return <div style="padding-left:10px">
-                      <el-button type="text" onClick={() => {
-                        this.$prompt('留言回复', '回复', {
-                          confirmButtonText: '确定',
-                          cancelButtonText: '取消',
-                          inputType: "textarea"
-                        }).then(({ value }) => {
-                          if(value){
-                            esGoodsReply({
-                              id:this.detailId,
-                              messageId:row.id,
-                              content:value
-                            }).then(res => {
-                              this.$message({ type: 'success', message: `设置成功!` })
-                              esGoodsDetail({ id: this.detailId }).then(res2 => {
-                                this.formData = {
-                                  ...res2.data,
-                                  imgList: res2.data.imgList.map(item => {
-                                    return {
-                                      ...item,
-                                      imgUrl: item.imgUrl
-                                    }
-                                  })
-                                }
-                              })
-                            })
-                          }
-                        })
-                      }}>回复</el-button>
+                      <el-button type="text" onClick={() => {this.msgSend(row)}}>回复</el-button>
                     </div>
                   }
                 }
               ]}
-              tableData={this.formData.messageList}
-            >
+              tableData={this.formData.messageList}>
             </zj-table>
           </div>
         }
@@ -381,6 +353,34 @@ export default {
     }
   },
   methods: {
+    msgSend(row){
+      this.$prompt('留言回复', '回复', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        inputType: "textarea"
+      }).then(({ value }) => {
+        if(value){
+          esGoodsReply({
+            id:this.detailId,
+            messageId:row.id,
+            content:value
+          }).then(res => {
+            this.$message({ type: 'success', message: `设置成功!` })
+            esGoodsDetail({ id: this.detailId }).then(res2 => {
+              this.formData = {
+                ...res2.data,
+                imgList: res2.data.imgList.map(item => {
+                  return {
+                    ...item,
+                    imgUrl: item.imgUrl
+                  }
+                })
+              }
+            })
+          })
+        }
+      })
+    },
     copyGoods() {
       esGoodsCopy({ id: this.detailId.id }).then(res => {
         this.$message({ type: 'success', message: `克隆成功!` })