webpackJsonp([31],{EO0D:function(e,t){},NrkQ:function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=o("kmJW"),s=o("sf/l"),r=o("CCn6"),i={name:"index",components:{page:a.a},data:function(){return{total:0,nowPage:1,limit:10,searchFrom:{source:""},tableData:[],commentForm:{},showCommentDialog:!1}},created:function(){this.initPage()},methods:{initPage:function(){var e=this,t={limit:this.limit,page:this.nowPage};this.searchFrom.time&&(t.time=this.searchFrom.time),this.searchFrom.source&&(t.source=this.searchFrom.source),this.searchFrom.time&&this.searchFrom.time.length>0&&(t.date_start=s.a.dateFmt(this.searchFrom.time[0],"yyyy-MM-dd hh:mm:ss"),t.date_end=s.a.dateFmt(this.searchFrom.time[1],"yyyy-MM-dd hh:mm:ss")),Object(r._3)(t).then(function(t){e.tableData=t.list,e.total=t.total})},onPageChange:function(e){this.nowPage=e,this.initPage()},onSizeChange:function(e){this.nowPage=1,this.limit=e,this.initPage()},doExport:function(){var e="?type=export";this.searchFrom.source&&(e=e+"&source="+this.searchFrom.source),this.searchFrom.time&&this.searchFrom.time.length>0&&(e=(e=e+"&date_start="+s.a.dateFmt(this.searchFrom.time[0],"yyyy-MM-dd hh:mm:ss"))+"&date_end="+s.a.dateFmt(this.searchFrom.time[1],"yyyy-MM-dd hh:mm:ss")),window.open("/api/public/ads/export/all"+e)},saveComment:function(){var e=this,t=this.commentForm.id,o=this.commentForm.desc?this.commentForm.desc:"";o&&Object(r._63)(t,{desc:o}).then(function(t){e.$message({type:"success",message:"编辑备注成功"}),e.showCommentDialog=!1,e.initPage()})},editComment:function(e,t){this.showCommentDialog=!0,this.commentForm={id:e,desc:t}}}},m={render:function(){var e=this,t=e.$createElement,o=e._self._c||t;return o("div",{staticClass:"index"},[o("el-form",{ref:"searchFrom",attrs:{model:e.searchFrom,"label-width":"80px"}},[o("el-row",[o("el-col",{attrs:{lg:10,sm:24,md:24}},[o("el-form-item",{attrs:{label:"购买时间"}},[o("el-date-picker",{attrs:{type:"datetimerange","range-separator":"至","start-placeholder":"开始日期","end-placeholder":"结束日期","default-time":["00:00:00","23:59:59"]},model:{value:e.searchFrom.time,callback:function(t){e.$set(e.searchFrom,"time",t)},expression:"searchFrom.time"}})],1)],1),e._v(" "),o("el-col",{attrs:{lg:4,sm:24,md:12}},[o("el-form-item",{attrs:{label:"来源"}},[o("el-input",{attrs:{placeholder:"名称",size:"small"},model:{value:e.searchFrom.source,callback:function(t){e.$set(e.searchFrom,"source",t)},expression:"searchFrom.source"}})],1)],1),e._v(" "),o("el-col",{attrs:{lg:4,sm:24,md:12}},[o("el-form-item",[o("el-button",{attrs:{type:"primary",plain:"",size:"small"},on:{click:e.initPage}},[e._v("\n            搜索\n          ")])],1)],1),e._v(" "),o("el-col",{attrs:{lg:4,sm:24,md:12}},[o("el-form-item",[o("el-button",{attrs:{type:"primary",plain:"",size:"small"},on:{click:e.doExport}},[e._v("\n            导出\n          ")])],1)],1)],1)],1),e._v(" "),o("el-table",{staticStyle:{width:"100%"},attrs:{data:e.tableData}},[o("el-table-column",{attrs:{prop:"name",label:"宝贝名称"}}),e._v(" "),o("el-table-column",{attrs:{prop:"telephone",label:"手机号"}}),e._v(" "),o("el-table-column",{attrs:{prop:"desc",label:"备注"}}),e._v(" "),o("el-table-column",{attrs:{prop:"create_at",label:"添加时间"}}),e._v(" "),o("el-table-column",{attrs:{prop:"source",label:"来源"}}),e._v(" "),e.$store.state.readonly?e._e():o("el-table-column",{attrs:{label:"操作","min-width":"150"},scopedSlots:e._u([{key:"default",fn:function(t){return[o("el-button",{attrs:{type:"text",plain:"",size:"mini"},on:{click:function(o){e.editComment(t.row.id,t.row.desc)}}},[e._v("\n          编辑备注\n        ")])]}}])})],1),e._v(" "),o("page",{attrs:{total:e.total,limit:e.limit},on:{pageChange:e.onPageChange,sizeChange:e.onSizeChange}}),e._v(" "),o("el-dialog",{attrs:{title:"编辑备注",center:"","append-to-body":"",visible:e.showCommentDialog,"close-on-click-modal":!1,"close-on-press-escape":!1,"show-close":!1,width:"600px"},on:{"update:visible":function(t){e.showCommentDialog=t}}},[o("div",[o("el-form",{ref:"commentFrom",attrs:{model:e.commentForm}},[o("el-form-item",{attrs:{prop:"desc"}},[o("el-input",{attrs:{type:"textarea"},model:{value:e.commentForm.desc,callback:function(t){e.$set(e.commentForm,"desc",t)},expression:"commentForm.desc"}})],1)],1)],1),e._v(" "),o("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[o("el-button",{on:{click:function(t){e.showCommentDialog=!1,e.commentForm={}}}},[e._v("取 消")]),e._v(" "),o("el-button",{attrs:{type:"primary"},on:{click:e.saveComment}},[e._v("确 定")])],1)])],1)},staticRenderFns:[]};var l=o("VU/8")(i,m,!1,function(e){o("EO0D")},"data-v-4e41c733",null);t.default=l.exports}});