(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-11e2bd44"],{"104a":function(e,t,a){"use strict";var n=a("1a32"),i=a.n(n);i.a},"1a32":function(e,t,a){},"6c34":function(e,t,a){"use strict";a.r(t);var n=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",[a("div",[a("Upload",{staticStyle:{float:"left","margin-right":"30px"},attrs:{action:"","before-upload":function(t){return e.parseExcl(t,"biz")},accept:".xls, .xlsx"}},[a("Button",{attrs:{size:"large",icon:"ios-cloud-upload-outline",loading:e.parseBizExclLoading}},[e._v("腾讯云商机导入")])],1),a("Upload",{attrs:{action:"","before-upload":function(t){return e.parseExcl(t,"order")},accept:".xls, .xlsx"}},[a("Button",{attrs:{size:"large",icon:"ios-cloud-upload-outline",loading:e.parseOrderExclLoading}},[e._v("腾讯云订单导入")])],1)],1),a("div",{staticClass:"content"},[a("div",{staticClass:"export-excl"},[a("Button",{attrs:{type:"primary",loading:e.importLoading},on:{click:e.importQiFuTong}},[e._v("导入企服通")])],1),a("div",{staticClass:"list-table"},[a("Table",{attrs:{border:"",loading:e.tableLoading,columns:e.columns,data:e.listData,height:"600"},on:{"on-selection-change":e.selectionChange}})],1)]),a("Modal",{attrs:{title:"导入确认"},on:{"on-ok":e.ok},model:{value:e.modal1,callback:function(t){e.modal1=t},expression:"modal1"}},[a("span",[e._v("是否确将\n      "),a("h3",{staticStyle:{display:"inline-block",color:"green"}},[e._v("\n        "+e._s(this.requestData.length)+"\n      ")]),e._v("\n      条\n      "),a("h3",{staticStyle:{display:"inline-block",color:"red"}},[e._v("\n        "+e._s("biz"===this.type?"商机":"订单")+"\n      ")]),e._v("\n      数据导入到企服通")])])],1)},i=[],r=(a("96cf"),a("3b8d")),o=(a("7f7f"),a("28a5"),a("0a21")),l=a("7e1e"),s={name:"flowimport",components:{},computed:{},data:function(){return{columns:[],listData:[],tableLoading:!1,parseBizExclLoading:!1,parseOrderExclLoading:!1,importLoading:!1,type:"",requestData:[],modal1:!1}},methods:{initData:function(){},initColumns:function(){switch(this.type){case"biz":this.columns=[{type:"selection",width:60,align:"center"},{title:"渠道需求号",key:"number",align:"center"},{title:"产品类型",key:"productType",align:"center"},{title:"区域",key:"area",align:"center"},{title:"公司名称",key:"companyName",align:"center"},{title:"联系人",key:"personName",align:"center"},{title:"联系电话",key:"personMobile",align:"center"},{title:"商机状态",key:"status",align:"center"},{title:"创建时间",key:"createdAt",align:"center"}];break;case"order":this.columns=[{type:"selection",width:60,align:"center"},{title:"渠道订单号",key:"number",align:"center"},{title:"产品类型",key:"productType",align:"center"},{title:"区域",key:"area",align:"center"},{title:"公司名称",key:"companyName",align:"center"},{title:"联系人",key:"personName",align:"center"},{title:"联系电话",key:"personMobile",align:"center"},{title:"订单状态",key:"status",align:"center"},{title:"价格",key:"price",align:"center"},{title:"创建时间",key:"createdAt",align:"center"}];break}},parseExcl:function(e,t){this.tableLoading=!0,this.parseBizExclLoading=!0,this.parseOrderExclLoading=!0;var a=e.name.split(".").pop().toLocaleLowerCase();return"xlsx"===a||"xls"===a?this.readFile(e):this.$Notice.warning({title:"文件类型错误",desc:"文件："+e.name+"不是EXCEL文件，请选择后缀为.xlsx或者.xls的EXCEL文件。"}),this.type=t,this.initColumns(),!1},readFile:function(e,t){var a=this,n=new FileReader;n.readAsArrayBuffer(e),n.onloadstart=function(e){a.parseExclLoading=!0},n.onerror=function(e){a.$Message.error("文件读取出错"),a.parseExclLoading=!1},n.onload=function(e){var t=e.target.result,n=o["a"].read(t,"array",(function(e){delete e.A1,delete e.A2,delete e.A3})),i=n.results;a.listData=i.map((function(e){return{number:e["商机编号"]||e["服务单号"],status:e["交付状态"]||e["服务状态"],companyName:e["公司名称"],createdAt:e["创建时间"],area:e["区域"],productType:e["产品类型"]||e["商机类型"],personName:e["联系人"],personMobile:e["联系电话"],price:e["订单金额"]}})),a.listTotal=a.listData.length,a.tableLoading=!1,a.parseBizExclLoading=!1,a.parseOrderExclLoading=!1}},selectionChange:function(e){this.requestData=e},importQiFuTong:function(){this.requestData<=0?this.$Message.warning("请勾选要导入的数据"):this.modal1=!0},ok:function(){var e=Object(r["a"])(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.prev=0,this.importLoading=!0,e.next=4,Object(l["I"])({type:this.type,list:this.requestData});case 4:this.importLoading=!1,this.$Message.success("导入成功"),e.next=12;break;case 8:e.prev=8,e.t0=e["catch"](0),this.$Message.error(e.t0.message),this.importLoading=!1;case 12:case"end":return e.stop()}}),e,this,[[0,8]])})));function t(){return e.apply(this,arguments)}return t}()},created:function(){this.initData()}},c=s,u=(a("104a"),a("2877")),d=Object(u["a"])(c,n,i,!1,null,null,null);t["default"]=d.exports}}]);