| 1 |
- !function(){function t(e){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t(e)}function e(t,e){var o="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!o){if(Array.isArray(t)||(o=function(t,e){if(!t)return;if("string"==typeof t)return a(t,e);var o=Object.prototype.toString.call(t).slice(8,-1);"Object"===o&&t.constructor&&(o=t.constructor.name);if("Map"===o||"Set"===o)return Array.from(t);if("Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o))return a(t,e)}(t))||e&&t&&"number"==typeof t.length){o&&(t=o);var n=0,c=function(){};return{s:c,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:c}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,i=!0,l=!1;return{s:function(){o=o.call(t)},n:function(){var t=o.next();return i=t.done,t},e:function(t){l=!0,r=t},f:function(){try{i||null==o.return||o.return()}finally{if(l)throw r}}}}function a(t,e){(null==e||e>t.length)&&(e=t.length);for(var a=0,o=new Array(e);a<e;a++)o[a]=t[a];return o}function o(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),a.push.apply(a,o)}return a}function n(t){for(var e=1;e<arguments.length;e++){var a=null!=arguments[e]?arguments[e]:{};e%2?o(Object(a),!0).forEach((function(e){c(t,e,a[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):o(Object(a)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(a,e))}))}return t}function c(e,a,o){var n;return n=function(e,a){if("object"!=t(e)||!e)return e;var o=e[Symbol.toPrimitive];if(void 0!==o){var n=o.call(e,a||"default");if("object"!=t(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===a?String:Number)(e)}(a,"string"),(a="symbol"==t(n)?n:String(n))in e?Object.defineProperty(e,a,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[a]=o,e}System.register(["./index-legacy.a130dba2.js","./XLSXUtils-legacy.9baaf4e1.js","./on-icon-legacy.40ac8dde.js"],(function(t,a){"use strict";var o,c,r,i,l,s,u,d,p,f=document.createElement("style");return f.textContent=".template-box[data-v-aa02f903]{display:grid;grid-template-columns:1fr 1fr;padding:20px 40px;grid-row-gap:20px;grid-column-gap:20px}.template-list[data-v-aa02f903]{width:100%;height:200px;background:linear-gradient(180deg,rgba(38,92,240,.1) 5%,rgba(38,92,240,.04) 100%);display:flex;color:#1651ee;font-size:14px;flex-direction:column;align-items:center;justify-content:center;cursor:pointer;border-radius:4px}.template-list img[data-v-aa02f903]{width:20px;height:20px;margin-bottom:20px}.steps[data-v-c1c908cc]{width:80%;height:40px;text-align:center;margin:0 auto 0 40px}.steps .el-steps[data-v-c1c908cc]{background-color:rgba(38,92,240,.05)}.drawer_main[data-v-c1c908cc]{width:90%;margin:40px auto 0}.drawer_main p[data-v-c1c908cc]{line-height:36px;font-size:14px}.drawer_main .astrict[data-v-c1c908cc]{text-indent:3em;color:#878787;line-height:24px;font-size:12px}.table[data-v-c1c908cc]{width:90%;margin:40px auto 0}.footer[data-v-c1c908cc]{position:absolute;width:90%;bottom:4%;left:50%;transform:translate(-50%);display:flex;justify-content:space-between}[data-v-c1c908cc] .el-drawer.rtl{width:50%!important;background-color:#fff!important;border-radius:20px 0 0 20px}[data-v-c1c908cc] .el-tabs__nav{display:flex;align-items:flex-end}[data-v-c1c908cc] .el-tabs__item{width:100px;text-align:center;height:40px;background:#fff;border-radius:10px 10px 0 0;margin-right:15px;padding:0}[data-v-c1c908cc] .el-tabs__item.is-active{height:45px;line-height:45px}[data-v-c1c908cc] .el-tabs__active-bar,[data-v-c1c908cc] .el-tabs__nav-wrap:after{height:0}[data-v-c1c908cc] .el-tabs__content{background-color:#fff;padding:20px;margin-bottom:60px}[data-v-c1c908cc] .el-tabs__header{margin:0}[data-v-c1c908cc] .el-step__icon{position:absolute;left:0}[data-v-c1c908cc] .el-step__icon-inner{display:none}[data-v-c1c908cc] .el-step__main{position:absolute;left:0;width:85px;top:25px}[data-v-c1c908cc] .el-step__head.is-success{color:#265cf0;border-color:#265cf0}[data-v-c1c908cc] .el-step__title.is-success{color:#265cf0}[data-v-c1c908cc] .el-step__line{background-color:#b8cbff}[data-v-c1c908cc] .el-step__head.is-process,[data-v-c1c908cc] .el-step__head.is-wait{color:#b8cbff;border-color:#b8cbff}[data-v-c1c908cc] .el-step__title.is-process,[data-v-c1c908cc] .el-step__title.is-process,[data-v-c1c908cc] .el-step__title.is-wait{color:#333;font-weight:400}.el-table .el-table__row:hover td[data-v-c1c908cc],.el-table .el-table__row .is-center:hover td[data-v-c1c908cc],.el-radio-button__inner[data-v-c1c908cc]:hover{color:#1651ee}.el-radio-button__orig-radio:checked+.el-radio-button__inner[data-v-c1c908cc]{background-color:#5f8bff}.el-message.el-message--info[data-v-c1c908cc]{background-color:#e7fafb;border-color:#e7fafb;color:#1651ee}.el-message.el-message--info .el-message__icon.el-icon-info[data-v-c1c908cc],.el-message.el-message--info .el-message__content[data-v-c1c908cc]{color:#1651ee}.excel-upload-input[data-v-c1c908cc]{display:none;z-index:-99999}\n",document.head.appendChild(f),{setters:[function(t){o=t.n,c=t.r,r=t.$,i=t.b,l=t.o,s=t.e},function(t){u=t.I,d=t.E},function(t){p=t.b}],execute:function(){var a={__name:"templateListDialog",setup:function(t,e){var a=e.expose,o=c(!1),n=c([]);function i(){o.value=!0;var t={offset:0,limit:9999,ordering:"-id",del_flag:0,status:1,is_default:0,company:r.getters.company};HTTP.get("used_customer_templates",t).then((function(t){n.value=t.data.results}))}return a({init:i}),{__sfc:!0,drawer:o,templateList:n,init:i,getListClose:function(){o.value=!1},getUploadUrl:function(t){HTTP.post("download_clue_customer_template",{template_id:t.id,type:2}).then((function(t){if(0==t.code){var e=document.createElement("a");e.href="http://45.207.195.140:8520/"+t.data,e.download="",e.style.display="none",document.body.appendChild(e),e.click(),setTimeout((function(){document.body.removeChild(e)}),100)}}))}}}},f=function(){var t=this,e=t._self._c,a=t._self._setupProxy;return e("el-drawer",{attrs:{title:"模板下载",visible:a.drawer,"before-close":a.getListClose,direction:"rtl","append-to-body":!0,"destroy-on-close":!0},on:{"update:visible":function(t){a.drawer=t}}},[e("div",{staticClass:"template-box"},t._l(a.templateList,(function(o){return e("div",{staticClass:"template-list",on:{click:function(t){return a.getUploadUrl(o)}}},[e("img",{attrs:{src:p,alt:""}}),e("div",[t._v("点击下载"+t._s(o.name))])])})),0),e("div",{staticClass:"footer",staticStyle:{display:"flex","justify-content":"flex-end",margin:"40px"}},[e("el-button",{attrs:{type:"primary"},on:{click:a.getListClose}},[t._v("返回")])],1)])},v=[];f._withStripped=!0;var _=o(a,f,v,!1,null,"aa02f903",null,null);_.options.__file="E:/十二科技/项目/九号同事/salary-management-web/src/views/markets/clients/components/templateListDialog.vue";var m=_.exports,g={__name:"importDialog",emits:["getList"],setup:function(t,a){var o=a.expose,p=a.emit,f=c(!1),v=c(),_=function(t){f.value=!0,v.value=t},g=i((function(){return j.value?"历史导入记录":"导入"})),b=i((function(){return 2!=y.value})),h=c(),y=c(1),x=c(),w=c([{name:""}]),k=c(),S=c(0),C=c(0),T=c(0);var j=c(!1),L=c([]),O=function(){HTTP.get("history_import",{is_self:v.value.is_self,type:v.value.import_type,ordering:"-id"}).then((function(t){L.value=t.data.results}))};return l((function(){})),o({init:_}),{__sfc:!0,emits:p,drawer:f,type:v,init:_,title:g,isImport:b,templateListRef:h,isActive:y,excel_upload_input:x,selectFile:function(){x.value.click()},files:w,event:k,inputChange:function(t){console.log("inputChange______",t),t.target.files.length?(w.value=t.target.files,k.value=t,y.value=2):(y.value=1,w.value=[{name:""}],k.value=null)},total_count:S,success_count:C,fail_count:T,handleImport:function(){y.value=2;var t=s.exports.Loading.service({lock:!0,text:"正在导入数据...",spinner:"el-icon-loading",background:"rgba(255, 255, 255, 0.7)"});u(k.value).then((function(e){console.log("resp",e);var a=[];e.data[0].map((function(t){var e={};e.name=t["*客户名称"],e.source=t["*客户来源"],e.video_link=t["视频链接"],e.belong_to_blogger=t["所属博主"]||"",e.contact=t["客户联系人"]||"",e.phone=t["*客户手机"],e.tel=t["客户电话"]||"",e.wechat=t["*客户微信"]||"",e.industry=t["客户行业"]||"",e.remarks=t["备注"]||"",a.push(e)})),console.log("import_datas",a);var o=n({import_datas:a},v.value);HTTP.post("upload_xml",o).then((function(e){console.log("res",e),s.exports.Message({type:"success",message:"文件上传成功!",offset:"20px"}),S.value=e.data.total_count,C.value=e.data.success_count,T.value=e.data.fail_count,t.close(),y.value=3,p("getList")}))})).catch((function(e){s.exports.Message({type:"error",message:"上传失败!".concat(e),offset:"20px"}),t.close()}))},readExcel:function(){y.value=2;var t=s.exports.Loading.service({lock:!0,text:"正在导入数据...",spinner:"el-icon-loading",background:"rgba(255, 255, 255, 0.7)"});u(k.value).then((function(a){var o=[],c=!1;if(a.data[0].map((function(t){var n={};if(!t.phone)return c=!0;t.phone=t.phone.toString();var r,i=e(a.headers[0]);try{for(i.s();!(r=i.n()).done;){var l=r.value;l in t&&(n[l]=t[l])}}catch(s){i.e(s)}finally{i.f()}o.push(n)})),c&&s.exports.Message.error("手机号不能为空"),c)return t.close();o.splice(0,1),console.log("import_datas",o);var r=n({import_datas:o},v.value);HTTP.post("upload_xml",r).then((function(e){console.log("res",e),s.exports.Message({type:"success",message:"文件上传成功!",offset:"20px"}),S.value=e.data.total_count,C.value=e.data.success_count,T.value=e.data.fail_count,t.close(),y.value=3,p("getList")}))}))},close:function(){y.value=1,w.value=[{name:""}],k.value=null,f.value=!1,j.value=!1},isShowTable:j,exportRecord:function(){O(),j.value=!0},tableData:L,get_history_import:O,handleExport:function(t){var e=s.exports.Loading.service({lock:!0,text:"正在导出数据...",spinner:"el-icon-loading",background:"rgba(255, 255, 255, 0.7)"}),a={name:"客户名称",source:"客户来源",video_link:"视频链接",belong_to_blogger:"所属博主",contact:"客户联系人",phone:"客户手机",tel:"客户电话",wechat:"客户微信",industry:"客户行业",remarks:"备注",reason:"失败原因"},o={list:[]};o.fileName="".concat(t.operator,"的导入失败记录 导入失败时间").concat(t.create_date),o.sheetName="导入失败记录",o.headers=a,o.list=t.fail_results,o.cols=[{width:20},{width:20},{width:50},{width:20},{width:20},{width:20},{width:20},{width:20},{width:20},{width:20},{width:20},{width:20}];try{d(o),e.close(),s.exports.Message({type:"success",message:"导出成功!",offset:"20px"})}catch(n){s.exports.Message({type:"error",message:"导出失败!",offset:"20px"})}},downloadTemplate:function(){var t={offset:0,limit:9999,ordering:"-id",del_flag:0,status:1,is_default:0,company:r.getters.company};HTTP.get("used_customer_templates",t).then((function(t){0==t.code&&(0==t.data.results.length?s.exports.Message.error("暂无下载模板"):1==t.data.results.length?HTTP.post("download_clue_customer_template",{template_id:t.data.results[0].id,type:2}).then((function(t){if(0==t.code){var e=document.createElement("a");e.href="http://45.207.195.140:8520/"+t.data,e.download="",e.style.display="none",document.body.appendChild(e),e.click(),setTimeout((function(){document.body.removeChild(e)}),100)}})):h.value.init())}))},getListClose:function(){y.value=1,w.value=[{name:""}],k.value=null,f.value=!1,j.value=!1,p("getList")},templateListDialog:m}}},b=function(){var t,e=this,a=e._self._c,o=e._self._setupProxy;return a("el-drawer",{attrs:{title:o.title,visible:o.drawer,"before-close":o.getListClose,direction:"rtl","append-to-body":!0,"destroy-on-close":!0},on:{"update:visible":function(t){o.drawer=t}}},[o.isShowTable?e._e():a("div",[a("div",{staticClass:"steps"},[a("el-steps",{attrs:{active:o.isActive,"finish-status":"success"}},[a("el-step",{attrs:{title:"1.上传文件"}}),a("el-step",{attrs:{title:"2.确认导入"}}),a("el-step",{attrs:{title:"3.导入成功"}})],1)],1),a("div",{staticClass:"drawer_main"},[3!==o.isActive?a("div",[a("p",[e._v(" 一、请按照数据模板准备要导入的数据。"),a("el-button",{attrs:{type:"text"},on:{click:o.downloadTemplate}},[e._v("点击下载《客户模板》")])],1),a("p",{staticClass:"astrict"},[e._v("导入文件请勿超过2MB(约10000条数据)")]),a("p",[e._v("二、跟现有数据重复时,将无法导入。")]),a("p",[e._v("三、请选择需要导入的文件。")]),a("div",{staticStyle:{display:"flex","align-items":"center"}},[a("el-button",{attrs:{type:"primary"},on:{click:o.selectFile}},[e._v("选择文件")]),a("div",{staticStyle:{"margin-left":"15px"}},[e._v(e._s(null===(t=o.files[0])||void 0===t?void 0:t.name))])],1),a("input",{ref:"excel_upload_input",staticClass:"excel-upload-input",attrs:{type:"file",accept:".xlsx, .xls"},on:{change:o.inputChange}})]):e._e(),3===o.isActive?a("p",{staticClass:"steps"},[e._v(" 本次导入总数据"+e._s(o.total_count)+"条,成功"),a("span",{staticStyle:{color:"#55ca4a"}},[e._v(e._s(o.success_count))]),e._v("条数据,失败"),a("span",{staticStyle:{color:"#e7405c"}},[e._v(e._s(o.fail_count))]),e._v("条 ")]):e._e()]),a("div",{staticClass:"footer"},[a("el-button",{attrs:{type:"text"},on:{click:o.exportRecord}},[e._v("历史导出记录")]),a("div",{staticClass:"btn"},[a("el-button",{attrs:{type:"primary"},on:{click:o.close}},[e._v("取消")]),a("el-button",{attrs:{type:"primary",disabled:o.isImport},on:{click:o.readExcel}},[e._v("确认导入")])],1)],1)]),o.isShowTable?a("div",{staticClass:"table"},[a("el-table",{attrs:{data:o.tableData,border:"","header-cell-style":{background:"#F6FAFF"}}},[a("el-table-column",{attrs:{prop:"create_date",label:"导入时间",width:"200px"}}),a("el-table-column",{attrs:{prop:"operator",label:"操作人",width:"150px"}}),a("el-table-column",{attrs:{label:"导入结果"},scopedSlots:e._u([{key:"default",fn:function(t){var a=t.row;return[e._v(" 导入"+e._s(a.total_count)+"条,成功"+e._s(a.success_count)+"条,失败"+e._s(a.fail_count)+"条 ")]}}],null,!1,2343028739)}),a("el-table-column",{attrs:{label:"操作",width:"150px"},scopedSlots:e._u([{key:"default",fn:function(t){var n=t.row;return[a("el-button",{attrs:{type:"text"},on:{click:function(t){return o.handleExport(n)}}},[e._v("下载导入失败文件")])]}}],null,!1,3798198711)})],1),a("div",{staticClass:"footer",staticStyle:{"justify-content":"flex-end"}},[a("el-button",{attrs:{type:"primary"},on:{click:function(t){o.isShowTable=!o.isShowTable}}},[e._v("返回")])],1)],1):e._e(),a(o.templateListDialog,{ref:"templateListRef"})],1)},h=[];b._withStripped=!0;var y=o(g,b,h,!1,null,"c1c908cc",null,null);y.options.__file="E:/十二科技/项目/九号同事/salary-management-web/src/views/markets/clients/components/importDialog.vue";t("i",y.exports)}}}))}();
|