webpackJsonp([40],{E1TR:function(t,e){},NrkQ:function(t,e,o){"use strict";Object.defineProperty(e,"__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 t=this,e={limit:this.limit,page:this.nowPage};this.searchFrom.time&&(e.time=this.searchFrom.time),this.searchFrom.source&&(e.source=this.searchFrom.source),this.searchFrom.time&&this.searchFrom.time.length>0&&(e.date_start=s.a.dateFmt(this.searchFrom.time[0],"yyyy-MM-dd hh:mm:ss"),e.date_end=s.a.dateFmt(this.searchFrom.time[1],"yyyy-MM-dd hh:mm:ss")),Object(r._6)(e).then(function(e){t.tableData=e.list,t.total=e.total})},onPageChange:function(t){this.nowPage=t,this.initPage()},onSizeChange:function(t){this.nowPage=1,this.limit=t,this.initPage()},doExport:function(){var t="?type=export";this.searchFrom.source&&(t=t+"&source="+this.searchFrom.source),this.searchFrom.time&&this.searchFrom.time.length>0&&(t=(t=t+"&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"+t)},saveComment:function(){var t=this,e=this.commentForm.id,o=this.commentForm.desc?this.commentForm.desc:"";o&&this.$confirm("确认编辑备注","提示",{confirmButtonText:"继续",cancelButtonText:"取消",type:"warning"}).then(function(){Object(r._72)(e,{desc:o}).then(function(e){t.$message({type:"success",message:"编辑备注成功"}),t.showCommentDialog=!1,t.initPage()})})},editComment:function(t,e){this.showCommentDialog=!0,this.commentForm={id:t,desc:e}}}},n={render:function(){var t=this,e=t.$createElement,o=t._self._c||e;return o("div",{staticClass:"index"},[o("el-form",{ref:"searchFrom",attrs:{model:t.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:t.searchFrom.time,callback:function(e){t.$set(t.searchFrom,"time",e)},expression:"searchFrom.time"}})],1)],1),t._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:t.searchFrom.source,callback:function(e){t.$set(t.searchFrom,"source",e)},expression:"searchFrom.source"}})],1)],1),t._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:t.initPage}},[t._v("\n            搜索\n          ")])],1)],1),t._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:t.doExport}},[t._v("\n            导出\n          ")])],1)],1)],1)],1),t._v(" "),o("el-table",{staticStyle:{width:"100%"},attrs:{data:t.tableData}},[o("el-table-column",{attrs:{prop:"name",label:"宝贝名称"}}),t._v(" "),o("el-table-column",{attrs:{prop:"telephone",label:"手机号"}}),t._v(" "),o("el-table-column",{attrs:{prop:"desc",label:"备注"}}),t._v(" "),o("el-table-column",{attrs:{prop:"create_at",label:"添加时间",sortable:""}}),t._v(" "),o("el-table-column",{attrs:{prop:"source",label:"来源"}}),t._v(" "),t.$store.state.readonly?t._e():o("el-table-column",{attrs:{label:"操作","min-width":"150"},scopedSlots:t._u([{key:"default",fn:function(e){return[o("el-button",{attrs:{type:"text",plain:"",size:"mini"},on:{click:function(o){t.editComment(e.row.id,e.row.desc)}}},[t._v("\n          编辑备注\n        ")])]}}])})],1),t._v(" "),o("page",{attrs:{total:t.total,limit:t.limit},on:{pageChange:t.onPageChange,sizeChange:t.onSizeChange}}),t._v(" "),o("el-dialog",{attrs:{title:"编辑备注",center:"","append-to-body":"",visible:t.showCommentDialog,"close-on-click-modal":!1,"close-on-press-escape":!1,"show-close":!1,width:"600px"},on:{"update:visible":function(e){t.showCommentDialog=e}}},[o("div",[o("el-form",{ref:"commentFrom",attrs:{model:t.commentForm}},[o("el-form-item",{attrs:{prop:"desc"}},[o("el-input",{attrs:{type:"textarea"},model:{value:t.commentForm.desc,callback:function(e){t.$set(t.commentForm,"desc",e)},expression:"commentForm.desc"}})],1)],1)],1),t._v(" "),o("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[o("el-button",{on:{click:function(e){t.showCommentDialog=!1,t.commentForm={}}}},[t._v("取 消")]),t._v(" "),o("el-button",{attrs:{type:"primary"},on:{click:t.saveComment}},[t._v("确 定")])],1)])],1)},staticRenderFns:[]};var m=o("VU/8")(i,n,!1,function(t){o("E1TR")},"data-v-08a20d96",null);e.default=m.exports}});