chunk-0b4e6b21.ebb07e3c.js 5.4 KB

1
  1. (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-0b4e6b21"],{"0c69":function(t,e,a){"use strict";a.r(e);var n=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"content"},[a("div",{staticClass:"search_box"},[a("el-input",{attrs:{placeholder:"店铺名称/手机号",clearable:""},on:{clear:function(e){return t.toSearch()}},nativeOn:{keyup:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.toSearch()}},model:{value:t.params.agent_phone,callback:function(e){t.$set(t.params,"agent_phone",e)},expression:"params.agent_phone"}}),a("el-input",{attrs:{placeholder:"客户名称/手机号",clearable:""},on:{clear:function(e){return t.toSearch()}},nativeOn:{keyup:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.toSearch()}},model:{value:t.params.user_phone,callback:function(e){t.$set(t.params,"user_phone",e)},expression:"params.user_phone"}}),a("el-button",{attrs:{type:"primary"},on:{click:function(e){return t.toSearch()}}},[t._v("搜索")])],1),a("div",{staticClass:"table_box"},[a("el-table",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}],ref:"listTable",staticStyle:{width:"100%"},attrs:{"header-cell-style":{background:"#f8fbfc"},border:"",stripe:"",data:t.list,height:t.tableHeight+"px","cell-style":{padding:"10px 0"}}},[a("el-table-column",{attrs:{label:"序号",type:"index",width:"50",align:"center",index:function(e){return t.params.page_size*(t.params.page_index-1)+e+1}}}),a("el-table-column",{attrs:{label:"评论人",prop:"status",align:"center",width:"220","show-overflow-tooltip":""},scopedSlots:t._u([{key:"default",fn:function(e){var a=e.row;return[t._v(" "+t._s(a.user&&a.user.nickname||a.user&&a.user.phone)+" ")]}}])}),a("el-table-column",{attrs:{label:"店铺",prop:"store",align:"center",width:"220","show-overflow-tooltip":""},scopedSlots:t._u([{key:"default",fn:function(e){var a=e.row;return[t._v(" "+t._s(a.store&&a.store.name)+" ")]}}])}),a("el-table-column",{attrs:{label:"星级",prop:"star",align:"center",width:"80"}}),a("el-table-column",{attrs:{label:"评论内容",prop:"content",align:"center","show-overflow-tooltip":""}}),a("el-table-column",{attrs:{label:"时间",prop:"updated_at",align:"center"}}),a("el-table-column",{attrs:{label:"操作",prop:"status",width:"150",align:"center"},scopedSlots:t._u([{key:"default",fn:function(e){var n=e.row;return[a("el-button",{attrs:{type:"text"},on:{click:function(e){return t.handleDetail(n)}}},[t._v("详情")]),a("el-button",{attrs:{type:"text"},on:{click:function(e){return t.handleDel(n.id)}}},[t._v("删除")])]}}])})],1)],1),a("el-dialog",{attrs:{title:"评论详情",visible:t.showDetail,width:"40%"},on:{"update:visible":function(e){t.showDetail=e}}},[a("el-form",{attrs:{model:t.detail}},[a("el-form-item",{attrs:{label:"评论时间:","label-width":"90px"}},[t._v(" "+t._s(t.detail.updated_at)+" ")]),a("el-form-item",{attrs:{label:"评论星级:","label-width":"90px"}},[t._v(" "+t._s(t.detail.star)+" ")]),t.detail.content?a("el-form-item",{attrs:{label:"评论内容:","label-width":"90px"}},[t._v(" "+t._s(t.detail.content)+" ")]):t._e()],1),a("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{attrs:{type:"primary"},on:{click:function(e){return t.handleDisable(t.detail.id)}}},[t._v("删 除")])],1)],1),a("div",{staticClass:"batch-container"},[a("pagination",{attrs:{total:t.totalPage,limit:t.params.page_size,page:t.params.page_index},on:{pagination:t.changePagination,"update:limit":t.changePagination}})],1)],1)},i=[],l=(a("d3b7"),a("b775")),o=function(t){return Object(l["a"])({url:"/comment/list",method:"get",params:t})},r=function(t){return Object(l["a"])({url:"/comment/detail",method:"get",params:t})},s=function(t){return Object(l["a"])({url:"/comment/destroy",method:"post",data:t})},c={name:"CommntList",filters:{getStatus:function(t){return 1===t}},data:function(){return{total:0,loading:!1,dialogFormVisible:!1,form:{},params:{page_index:1,page_size:20,agent_phone:"",user_phone:""},list:[],totalPage:0,tableHeight:0,detail:"",showDetail:!1}},created:function(){this.getList()},mounted:function(){var t=this;this.$nextTick((function(){t.tableHeight=document.getElementsByClassName("table_box")[0].offsetHeight}))},methods:{toSearch:function(){this.params.page_index=1,this.getList()},handleDel:function(t){var e=this;this.$confirm("确认要删除该评论内容吗?",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then((function(a){s({id:t}).then((function(t){200===t.code?(e.getList(),e.$message.success("删除成功"),e.showDetail=!1):e.$message.error("删除失败")}))}))},handleDetail:function(t){r({id:t.id}).then((function(t){200===t.code&&console.log(t.data)})),this.detail=t,this.showDetail=!0},getList:function(){var t=this;this.loading=!0,o(this.params).then((function(e){200===e.code?(t.list=e.data.list,t.totalPage=e.data.total):t.$message.error(e.msg||"获取评论列表失败")})).catch((function(){t.loading=!1})).finally((function(e){t.loading=!1}))},handleSearch:function(t){this.params.search_name?(this.loading=!0,!t&&(this.page=1),this.getList()):(this.page=1,this.created())},changePagination:function(t){var e=t.page,a=t.limit;this.params.page_size=a,this.params.page_index=e,this.getList()}}},u=c,d=(a("ad8c"),a("2877")),p=Object(d["a"])(u,n,i,!1,null,"3755b356",null);e["default"]=p.exports},3560:function(t,e,a){},ad8c:function(t,e,a){"use strict";a("3560")}}]);