ERP/static/js/chunk-a76f.8afb3ec1.js

2 lines
36 KiB
JavaScript
Raw Normal View History

(window.webpackJsonp=window.webpackJsonp||[]).push([["chunk-a76f"],{"6CFD":function(e,t,n){"use strict";n.r(t);var a=n("P2sY"),r=n.n(a),o=n("6HaC"),i=n("BJvg"),l=n("ZySA"),s=n("Mz3J"),d={name:"CustomerList",directives:{waves:l.a},components:{Pagination:s.a},filters:{genderFilter:function(e){return{1:"男",2:"女"}[e]}},data:function(){return{moreaction:[],editVisible:!1,nations:[],provinces:[],cities:[],countryid:"",provinceid:"",cityid:"",repositoryid:"",customerForm:{firstName:"",middleName:"",lastName:"",customerName:"",email:"",phoneNumber:"",gender:"",countryName:"",provinceName:"",cityName:"",level:"",address:"",repositoryName:"",birthday:"",source:"",newOrOld:"",customerType:""},customerFormrules:{phone:[{required:!0,message:"请输入电话",trigger:"blur"}],lastName:[{required:!0,message:"请输入姓氏",trigger:"blur"}],firstName:[{required:!0,message:"请输入名",trigger:"blur"}]},customertypes:[],customertyp:1,levels:[],levelstype:2,sources:[],sourcestype:3,downloadLoading:!1,list:[],total:0,tableKey:0,listLoading:!0,getemplist:{customername:"",customerphone:"",level:"",createtime:"",type:"",pagenum:1,pagesize:10,repositoryid:"",source:""},depts:[],props:{value:"id",label:"regionName",children:"regionListVos"},regions:[],getemplistregions:[],repositories:[]}},mounted:function(){this.getlist(),this.getCategory()},methods:{getCategory:function(){var e=this;Object(i.j)(this.customertyp).then(function(t){200===t.data.ret?e.customertypes=t.data.data.content.list:e.$notify.error({title:"错误",message:"出错了",offset:100})}),Object(i.j)(this.levelstype).then(function(t){200===t.data.ret?e.levels=t.data.data.content.list:e.$notify.error({title:"错误",message:"出错了",offset:100})}),Object(i.j)(this.sourcestype).then(function(t){200===t.data.ret?e.sources=t.data.data.content.list:e.$notify.error({title:"错误",message:"出错了",offset:100})}),Object(o.e)().then(function(t){200===t.data.ret?e.repositories=t.data.data.content.list:e.$notify.error({title:"错误",message:"出错了",offset:100})})},getlist:function(){var e=this;this.listLoading=!0,Object(i.e)(this.getemplist).then(function(t){200===t.data.ret?(e.list=t.data.data.content.list,e.total=t.data.data.content.totalCount):e.$notify.error({title:"错误",message:"出错了",offset:100}),setTimeout(function(){e.listLoading=!1},50)})},handleFilter:function(){var e=this;this.getemplist.pagenum=1,Object(i.e)(this.getemplist).then(function(t){200===t.data.ret?(e.list=t.data.data.content.list,e.total=t.data.data.content.totalCount):e.$notify.error({title:"错误",message:"出错了",offset:100})})},handleAdd:function(){this.$router.push("/Customer/NewCustomer")},handleContract:function(){console.log(123)},handleExport:function(){var e=this;this.downloadLoading=!0,Promise.all([n.e("chunk-ef4a"),n.e("chunk-6b3a")]).then(n.bind(null,"S/jZ")).then(function(t){var n=e.formatJson(["id","customerName","customerTypeWZ","customerLevel","birthday","source","newOrOld","phoneNumber","gender","address","point"],e.list);t.export_json_to_excel({header:["编号","客户姓名","客户类型","客户优质级别","生日","客户来源","新老客户","客户电话","性别","详细地址","积分"],data:n,filename:"客户资料表"}),e.downloadLoading=!1})},formatJson:function(e,t){return t.map(function(t){return e.map(function(e){return t[e]})})},handlePrint:function(){console.log(456)},tranKTree:function(e){var t=this;if(e&&e.length)return e.map(function(e){return{id:e.id,regionName:e.regionName,regionListVos:t.tranKTree(e.regionListVos)}})},handlechange4:function(e){var t=this,n=e[e.length-1];Object(o.e)(n).then(function(e){200===e.data.ret?t.repositories=e.data.data.content:t.$message.error("出错了")})},handleSelectionChange:function(e){this.moreaction=e},handleCommand:function(e){var t=this,n=this.moreaction.map(function(e){return e.id}).join();"delete"===e&&this.$confirm("此操作将永久删除该文件, 是否继续?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(function(){Object(i.h)(n).then(function(e){200===e.data