Commit 7d97a651 authored by yinxiaoling's avatar yinxiaoling

Merge branch 'master' of gitlab.ciopaas.com:yinxiaoling/aic_duty_strategy

parents 829dd352 99b712d5
<!DOCTYPE html><html><head><meta charset=utf-8><meta http-equiv=X-UA-Compatible content="IE=edge,chrome=1"><meta name=renderer content=webkit><meta name=viewport content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no"><link rel=icon href=/favicon.ico><title>浙江铁路局外呼策略</title><link href=/static/css/chunk-libs.3dfb7769.css rel=stylesheet><link href=/static/css/app.fe8af685.css rel=stylesheet></head><body><div id=app></div><script src=/static/js/chunk-elementUI.268e3bcf.js></script><script src=/static/js/chunk-libs.9f0007e6.js></script><script>(function(e){function t(t){for(var r,c,o=t[0],f=t[1],i=t[2],d=0,l=[];d<o.length;d++)c=o[d],u[c]&&l.push(u[c][0]),u[c]=0;for(r in f)Object.prototype.hasOwnProperty.call(f,r)&&(e[r]=f[r]);h&&h(t);while(l.length)l.shift()();return a.push.apply(a,i||[]),n()}function n(){for(var e,t=0;t<a.length;t++){for(var n=a[t],r=!0,c=1;c<n.length;c++){var o=n[c];0!==u[o]&&(r=!1)}r&&(a.splice(t--,1),e=f(f.s=n[0]))}return e}var r={},c={runtime:0},u={runtime:0},a=[];function o(e){return f.p+"static/js/"+({}[e]||e)+"."+{"chunk-0a78ac7a":"015be33e","chunk-2d0c8d8c":"24beb334","chunk-29ca1b6e":"dbc5e86a","chunk-2d2105d3":"c38e1553","chunk-2d230fe7":"8023f254","chunk-521ff149":"1a8e56c7","chunk-663f5536":"d09013f7","chunk-edda6906":"f13325ba","chunk-f46ba1c8":"31519b4a"}[e]+".js"}function f(t){if(r[t])return r[t].exports;var n=r[t]={i:t,l:!1,exports:{}};return e[t].call(n.exports,n,n.exports,f),n.l=!0,n.exports}f.e=function(e){var t=[],n={"chunk-0a78ac7a":1,"chunk-29ca1b6e":1,"chunk-521ff149":1,"chunk-663f5536":1,"chunk-edda6906":1,"chunk-f46ba1c8":1};c[e]?t.push(c[e]):0!==c[e]&&n[e]&&t.push(c[e]=new Promise((function(t,n){for(var r="static/css/"+({}[e]||e)+"."+{"chunk-0a78ac7a":"59590d9e","chunk-2d0c8d8c":"31d6cfe0","chunk-29ca1b6e":"d953179f","chunk-2d2105d3":"31d6cfe0","chunk-2d230fe7":"31d6cfe0","chunk-521ff149":"aa79ebe7","chunk-663f5536":"22860205","chunk-edda6906":"c7c8f565","chunk-f46ba1c8":"34d3c0e3"}[e]+".css",u=f.p+r,a=document.getElementsByTagName("link"),o=0;o<a.length;o++){var i=a[o],d=i.getAttribute("data-href")||i.getAttribute("href");if("stylesheet"===i.rel&&(d===r||d===u))return t()}var l=document.getElementsByTagName("style");for(o=0;o<l.length;o++){i=l[o],d=i.getAttribute("data-href");if(d===r||d===u)return t()}var h=document.createElement("link");h.rel="stylesheet",h.type="text/css",h.onload=t,h.onerror=function(t){var r=t&&t.target&&t.target.src||u,a=new Error("Loading CSS chunk "+e+" failed.\n("+r+")");a.request=r,delete c[e],h.parentNode.removeChild(h),n(a)},h.href=u;var s=document.getElementsByTagName("head")[0];s.appendChild(h)})).then((function(){c[e]=0})));var r=u[e];if(0!==r)if(r)t.push(r[2]);else{var a=new Promise((function(t,n){r=u[e]=[t,n]}));t.push(r[2]=a);var i,d=document.createElement("script");d.charset="utf-8",d.timeout=120,f.nc&&d.setAttribute("nonce",f.nc),d.src=o(e),i=function(t){d.onerror=d.onload=null,clearTimeout(l);var n=u[e];if(0!==n){if(n){var r=t&&("load"===t.type?"missing":t.type),c=t&&t.target&&t.target.src,a=new Error("Loading chunk "+e+" failed.\n("+r+": "+c+")");a.type=r,a.request=c,n[1](a)}u[e]=void 0}};var l=setTimeout((function(){i({type:"timeout",target:d})}),12e4);d.onerror=d.onload=i,document.head.appendChild(d)}return Promise.all(t)},f.m=e,f.c=r,f.d=function(e,t,n){f.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},f.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},f.t=function(e,t){if(1&t&&(e=f(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(f.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)f.d(n,r,function(t){return e[t]}.bind(null,r));return n},f.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return f.d(t,"a",t),t},f.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},f.p="/",f.oe=function(e){throw console.error(e),e};var i=window["webpackJsonp"]=window["webpackJsonp"]||[],d=i.push.bind(i);i.push=t,i=i.slice();for(var l=0;l<i.length;l++)t(i[l]);var h=d;n()})([]);</script><script src=/static/js/app.68d58a06.js></script></body></html> <!DOCTYPE html><html><head><meta charset=utf-8><meta http-equiv=X-UA-Compatible content="IE=edge,chrome=1"><meta name=renderer content=webkit><meta name=viewport content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no"><link rel=icon href=/favicon.ico><title>浙江铁路局外呼策略</title><link href=/static/css/chunk-libs.3dfb7769.css rel=stylesheet><link href=/static/css/app.19b964fd.css rel=stylesheet></head><body><div id=app></div><script src=/static/js/chunk-elementUI.268e3bcf.js></script><script src=/static/js/chunk-libs.9f0007e6.js></script><script>(function(e){function t(t){for(var r,c,a=t[0],f=t[1],i=t[2],d=0,l=[];d<a.length;d++)c=a[d],u[c]&&l.push(u[c][0]),u[c]=0;for(r in f)Object.prototype.hasOwnProperty.call(f,r)&&(e[r]=f[r]);h&&h(t);while(l.length)l.shift()();return o.push.apply(o,i||[]),n()}function n(){for(var e,t=0;t<o.length;t++){for(var n=o[t],r=!0,c=1;c<n.length;c++){var a=n[c];0!==u[a]&&(r=!1)}r&&(o.splice(t--,1),e=f(f.s=n[0]))}return e}var r={},c={runtime:0},u={runtime:0},o=[];function a(e){return f.p+"static/js/"+({}[e]||e)+"."+{"chunk-2599f1dc":"f7518194","chunk-2d0c8d8c":"24beb334","chunk-29ca1b6e":"dbc5e86a","chunk-2d2105d3":"c38e1553","chunk-2d230fe7":"8023f254","chunk-521ff149":"1a8e56c7","chunk-c26e295c":"a34ed4d9","chunk-edda6906":"f13325ba","chunk-f46ba1c8":"31519b4a"}[e]+".js"}function f(t){if(r[t])return r[t].exports;var n=r[t]={i:t,l:!1,exports:{}};return e[t].call(n.exports,n,n.exports,f),n.l=!0,n.exports}f.e=function(e){var t=[],n={"chunk-2599f1dc":1,"chunk-29ca1b6e":1,"chunk-521ff149":1,"chunk-c26e295c":1,"chunk-edda6906":1,"chunk-f46ba1c8":1};c[e]?t.push(c[e]):0!==c[e]&&n[e]&&t.push(c[e]=new Promise((function(t,n){for(var r="static/css/"+({}[e]||e)+"."+{"chunk-2599f1dc":"2edbddca","chunk-2d0c8d8c":"31d6cfe0","chunk-29ca1b6e":"d953179f","chunk-2d2105d3":"31d6cfe0","chunk-2d230fe7":"31d6cfe0","chunk-521ff149":"aa79ebe7","chunk-c26e295c":"0ec9fe32","chunk-edda6906":"c7c8f565","chunk-f46ba1c8":"34d3c0e3"}[e]+".css",u=f.p+r,o=document.getElementsByTagName("link"),a=0;a<o.length;a++){var i=o[a],d=i.getAttribute("data-href")||i.getAttribute("href");if("stylesheet"===i.rel&&(d===r||d===u))return t()}var l=document.getElementsByTagName("style");for(a=0;a<l.length;a++){i=l[a],d=i.getAttribute("data-href");if(d===r||d===u)return t()}var h=document.createElement("link");h.rel="stylesheet",h.type="text/css",h.onload=t,h.onerror=function(t){var r=t&&t.target&&t.target.src||u,o=new Error("Loading CSS chunk "+e+" failed.\n("+r+")");o.request=r,delete c[e],h.parentNode.removeChild(h),n(o)},h.href=u;var s=document.getElementsByTagName("head")[0];s.appendChild(h)})).then((function(){c[e]=0})));var r=u[e];if(0!==r)if(r)t.push(r[2]);else{var o=new Promise((function(t,n){r=u[e]=[t,n]}));t.push(r[2]=o);var i,d=document.createElement("script");d.charset="utf-8",d.timeout=120,f.nc&&d.setAttribute("nonce",f.nc),d.src=a(e),i=function(t){d.onerror=d.onload=null,clearTimeout(l);var n=u[e];if(0!==n){if(n){var r=t&&("load"===t.type?"missing":t.type),c=t&&t.target&&t.target.src,o=new Error("Loading chunk "+e+" failed.\n("+r+": "+c+")");o.type=r,o.request=c,n[1](o)}u[e]=void 0}};var l=setTimeout((function(){i({type:"timeout",target:d})}),12e4);d.onerror=d.onload=i,document.head.appendChild(d)}return Promise.all(t)},f.m=e,f.c=r,f.d=function(e,t,n){f.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},f.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},f.t=function(e,t){if(1&t&&(e=f(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(f.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)f.d(n,r,function(t){return e[t]}.bind(null,r));return n},f.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return f.d(t,"a",t),t},f.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},f.p="/",f.oe=function(e){throw console.error(e),e};var i=window["webpackJsonp"]=window["webpackJsonp"]||[],d=i.push.bind(i);i.push=t,i=i.slice();for(var l=0;l<i.length;l++)t(i[l]);var h=d;n()})([]);</script><script src=/static/js/app.d27db683.js></script></body></html>
\ No newline at end of file \ No newline at end of file
.waves-ripple{position:absolute;border-radius:100%;background-color:rgba(0,0,0,.15);background-clip:padding-box;pointer-events:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-transform:scale(0);transform:scale(0);opacity:1}.waves-ripple.z-active{opacity:0;-webkit-transform:scale(2);transform:scale(2);-webkit-transition:opacity 1.2s ease-out,-webkit-transform .6s ease-out;transition:opacity 1.2s ease-out,-webkit-transform .6s ease-out;transition:opacity 1.2s ease-out,transform .6s ease-out;transition:opacity 1.2s ease-out,transform .6s ease-out,-webkit-transform .6s ease-out}.el-icon-upload[data-v-1c1ccb70]{color:#0000cd;font-size:24px;vertical-align:middle}.result-box[data-v-1c1ccb70]{line-height:30px;text-align:center}.result-box .down-txt[data-v-1c1ccb70]{color:#4dc1f4}.result-box .el-icon-success[data-v-1c1ccb70]{color:#03b615;font-size:33px}.result-box .el-icon-warning[data-v-1c1ccb70]{font-size:33px}.result-box .fail-all-bgc[data-v-1c1ccb70]{color:#d9001b}.result-box .fail-bgc[data-v-1c1ccb70]{color:#f59a23}.down-btn[data-v-1c1ccb70],.upload-btn[data-v-1c1ccb70]{color:#3691ff}label[data-v-1c1ccb70]{font-weight:400}.import-box[data-v-1c1ccb70]:before{content:"*";color:#ff4949;margin-right:4px;display:inline-block}.el-icon-upload[data-v-20ed2b68]{color:#c3c6ca;font-size:24px;vertical-align:middle;position:absolute;top:0;right:100px;line-height:36px}.el-date-editor.el-input[data-v-20ed2b68]{width:100%}.upload-box[data-v-20ed2b68]{margin-right:69px}.upload-box input[data-v-20ed2b68]{height:36px;line-height:36px;border-top-right-radius:0;border-bottom-right-radius:0;border-right:none}.upload-box .el-input:hover+.el-icon-circle-close[data-v-20ed2b68]{display:inline-block}.upload-box .el-icon-circle-close[data-v-20ed2b68]{color:#c3c6ca;font-size:16px;vertical-align:middle;position:absolute;top:0;right:75px;line-height:36px;z-index:1;display:none}.upload-box .el-icon-circle-close[data-v-20ed2b68]:hover{display:inline-block}.download-btn[data-v-20ed2b68]{position:absolute;top:0;right:0;height:36px;line-height:36px;width:70px;text-align:center;padding:0;text-decoration:underline}#strategy-add-form .hide-label label,#strategy-add-form .hide-label label:before{display:none}#strategy-add-form .fl-label label{float:left;margin-right:10px}table button[data-v-d68a4180]{border:none;background:transparent}
\ No newline at end of file
.waves-ripple{position:absolute;border-radius:100%;background-color:rgba(0,0,0,.15);background-clip:padding-box;pointer-events:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-transform:scale(0);transform:scale(0);opacity:1}.waves-ripple.z-active{opacity:0;-webkit-transform:scale(2);transform:scale(2);-webkit-transition:opacity 1.2s ease-out,-webkit-transform .6s ease-out;transition:opacity 1.2s ease-out,-webkit-transform .6s ease-out;transition:opacity 1.2s ease-out,transform .6s ease-out;transition:opacity 1.2s ease-out,transform .6s ease-out,-webkit-transform .6s ease-out}.el-icon-upload[data-v-21de61dc]{color:#0000cd;font-size:24px;vertical-align:middle}.result-box[data-v-21de61dc]{line-height:30px;text-align:center}.result-box .down-txt[data-v-21de61dc]{color:#4dc1f4}.result-box .el-icon-success[data-v-21de61dc]{color:#03b615;font-size:33px}.result-box .el-icon-warning[data-v-21de61dc]{font-size:33px}.result-box .fail-all-bgc[data-v-21de61dc]{color:#d9001b}.result-box .fail-bgc[data-v-21de61dc]{color:#f59a23}.down-btn[data-v-21de61dc],.upload-btn[data-v-21de61dc]{color:#3691ff}label[data-v-21de61dc]{font-weight:400}.import-box[data-v-21de61dc]:before{content:"*";color:#ff4949;margin-right:4px;display:inline-block}.el-icon-upload[data-v-1cf757ed]{color:#0000cd;font-size:24px;vertical-align:middle}.el-date-editor.el-input[data-v-1cf757ed]{width:100%}.upload-box[data-v-1cf757ed]{margin-right:69px}.upload-box input[data-v-1cf757ed]{height:36px;line-height:36px;border-top-right-radius:0;border-bottom-right-radius:0;border-right:none}.download-btn[data-v-1cf757ed]{position:absolute;top:0;right:0;height:36px;line-height:36px;width:70px;text-align:center;padding:0;text-decoration:underline}#strategy-add-form .hide-label label,#strategy-add-form .hide-label label:before{display:none}#strategy-add-form .fl-label label{float:left;margin-right:10px}table button[data-v-9f9f3be8]{border:none;background:transparent}
\ No newline at end of file
.waves-ripple{position:absolute;border-radius:100%;background-color:rgba(0,0,0,.15);background-clip:padding-box;pointer-events:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-transform:scale(0);transform:scale(0);opacity:1}.waves-ripple.z-active{opacity:0;-webkit-transform:scale(2);transform:scale(2);-webkit-transition:opacity 1.2s ease-out,-webkit-transform .6s ease-out;transition:opacity 1.2s ease-out,-webkit-transform .6s ease-out;transition:opacity 1.2s ease-out,transform .6s ease-out;transition:opacity 1.2s ease-out,transform .6s ease-out,-webkit-transform .6s ease-out}.pagination-container[data-v-5d204799]{position:absolute;bottom:10px;right:20px;left:20px;background-color:#fff;z-index:1;padding:10px}.pagination-container.hidden[data-v-5d204799]{display:none}.dis-ib[data-v-d3cddc52]{display:inline-block}.txt-rt[data-v-d3cddc52]{text-align:right} .waves-ripple{position:absolute;border-radius:100%;background-color:rgba(0,0,0,.15);background-clip:padding-box;pointer-events:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-transform:scale(0);transform:scale(0);opacity:1}.waves-ripple.z-active{opacity:0;-webkit-transform:scale(2);transform:scale(2);-webkit-transition:opacity 1.2s ease-out,-webkit-transform .6s ease-out;transition:opacity 1.2s ease-out,-webkit-transform .6s ease-out;transition:opacity 1.2s ease-out,transform .6s ease-out;transition:opacity 1.2s ease-out,transform .6s ease-out,-webkit-transform .6s ease-out}.pagination-container[data-v-5d204799]{position:absolute;bottom:10px;right:20px;left:20px;background-color:#fff;z-index:1;padding:10px}.pagination-container.hidden[data-v-5d204799]{display:none}.dis-ib[data-v-3b535f99]{display:inline-block}.txt-rt[data-v-3b535f99]{text-align:right}
\ No newline at end of file \ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -41,7 +41,13 @@ export function getUsersList(data) { ...@@ -41,7 +41,13 @@ export function getUsersList(data) {
} }
// 导出模板 // 导出模板
export function downloadModel(query) { export function downloadModel(query) {
window.open(process.env.VUE_APP_BASE_API + '/api/strategy/downloadModel?user_sn=' + query.user_sn) let str = process.env.VUE_APP_BASE_API || ''
window.open(str + (str.slice(str.length - 1) === '/' ? '' : '/') + 'api/strategy/downloadModel?user_sn=' + query.user_sn)
}
// 下载失败导出excel数据
export function downloadFailExcel(query) {
let str = process.env.VUE_APP_BASE_API || ''
window.open(str + (str.slice(str.length - 1) === '/' ? '' : '/') + 'api/strategy/downloadFailExcel?user_sn=' + query.user_sn + '&filename=' + query.filename)
} }
// 导入数据excel文件 // 导入数据excel文件
export function importExcelData(data) { export function importExcelData(data) {
......
...@@ -15,10 +15,11 @@ export function getInfo() { ...@@ -15,10 +15,11 @@ export function getInfo() {
}) })
} }
export function logout() { export function logout(user_sn) {
return request({ return request({
url: '/api/loginOut', url: '/api/loginOut',
method: 'post' method: 'post',
data: { user_sn: user_sn }
}) })
} }
export function uploadAvatar(data) { export function uploadAvatar(data) {
......
...@@ -42,13 +42,13 @@ export default { ...@@ -42,13 +42,13 @@ export default {
/* 84 = navbar + tags-view = 50 + 34 */ /* 84 = navbar + tags-view = 50 + 34 */
// 84 + pagination // 84 + pagination
// min-height: calc(100vh - 84px); // min-height: calc(100vh - 84px);
height: calc(100vh - 34px); height: calc(100vh - 84px);
} }
.fixed-header + .app-main { .fixed-header + .app-main {
// padding-top: 84px; // padding-top: 84px;
padding-top: 0; padding-top: 0;
margin-top: 94px; margin-top: 84px;
} }
} }
</style> </style>
......
...@@ -83,12 +83,11 @@ export default { ...@@ -83,12 +83,11 @@ export default {
this.$store.dispatch('app/toggleSideBar') this.$store.dispatch('app/toggleSideBar')
}, },
async logout() { async logout() {
// await this.$store.dispatch('user/logout') await this.$store.dispatch(
// console.log(this.$route.fullPath) 'user/logout',
// this.$router.push(`/login?redirect=${this.$route.fullPath}`) this.$publicTools.decrypt(localStorage.getItem('user_sn'))
this.$store.dispatch('user/resetToken').then(() => { )
location.reload() // 为了重新实例化vue-router对象 避免bug this.$router.push(`/login?redirect=${this.$route.fullPath}`)
})
} }
} }
} }
......
...@@ -162,15 +162,13 @@ const actions = { ...@@ -162,15 +162,13 @@ const actions = {
state, state,
dispatch dispatch
}) { }) {
let arg = arguments
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
logout(state.token).then(() => { logout(arg[1]).then(() => {
commit('SET_TOKEN', '') commit('SET_TOKEN', '')
commit('SET_ROLES', []) commit('SET_ROLES', [])
removeToken() removeToken()
resetRouter() resetRouter()
// reset visited views and cached views
// to fixed https://github.com/PanJiaChen/vue-element-admin/issues/2485
dispatch('tagsView/delAllViews', null, { dispatch('tagsView/delAllViews', null, {
root: true root: true
}) })
......
...@@ -37,6 +37,17 @@ service.interceptors.request.use( ...@@ -37,6 +37,17 @@ service.interceptors.request.use(
} }
) )
// response interceptor // response interceptor
function loginout() {
MessageBox.confirm('你已被登出,可以取消继续留在该页面,或者重新登录', '确定登出', {
confirmButtonText: '重新登录',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
store.dispatch('user/resetToken').then(() => {
location.reload() // 为了重新实例化vue-router对象 避免bug
})
})
}
service.interceptors.response.use( service.interceptors.response.use(
response => { response => {
const res = Object.prototype.toString.call(response.data) === '[object Object]' ? response.data : {} const res = Object.prototype.toString.call(response.data) === '[object Object]' ? response.data : {}
...@@ -50,25 +61,22 @@ service.interceptors.response.use( ...@@ -50,25 +61,22 @@ service.interceptors.response.use(
}) })
// 50008:非法的token; 50012:其他客户端登录了; 50014:Token 过期了; // 50008:非法的token; 50012:其他客户端登录了; 50014:Token 过期了;
if (res.status_code === 50008 || res.status_code === 50012 || res.status_code === 50014 || (res.status_code === 401 && res.info === '登录失效')) { if (res.status_code === 50008 || res.status_code === 50012 || res.status_code === 50014 || (res.status_code === 401 && res.info === '登录失效')) {
MessageBox.confirm('你已被登出,可以取消继续留在该页面,或者重新登录', '确定登出', { loginout()
confirmButtonText: '重新登录',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
store.dispatch('user/resetToken').then(() => {
location.reload() // 为了重新实例化vue-router对象 避免bug
})
})
} }
return Promise.reject(new Error(res.message || res.info || res.status || 'Error')) return Promise.reject(new Error(res.message || res.info || res.status || 'Error'))
} }
}, },
error => { error => {
// 接口登陆失效status_code401 账号异地登录msg_code1002
if (Object.prototype.toString.call(error.response) === '[object Object]' && Object.prototype.toString.call(error.response.data) === '[object Object]' && (error.response.data.status_code === 401 && error.response.data.info === '登陆失效') || error.response.data.msg_code === 1002) {
loginout()
} else {
Message({ Message({
message: Object.prototype.toString.call(error.response) === '[object Object]' && Object.prototype.toString.call(error.response.data) === '[object Object]' && error.response.data.info ? error.response.data.info : error, message: Object.prototype.toString.call(error.response) === '[object Object]' && Object.prototype.toString.call(error.response.data) === '[object Object]' && error.response.data.info ? error.response.data.info : error,
type: 'error', type: 'error',
duration: 5000 duration: 5000
}) })
}
return Promise.reject(error) return Promise.reject(error)
} }
) )
......
...@@ -13,15 +13,18 @@ ...@@ -13,15 +13,18 @@
<el-input v-model="temp.strategy_name" clearable placeholder="请输入策略名称" /> <el-input v-model="temp.strategy_name" clearable placeholder="请输入策略名称" />
</el-form-item> </el-form-item>
<el-form-item label="客户数据" prop="upload"> <el-form-item label="客户数据" prop="upload">
<div @click="importData" class="upload-box"> <div class="upload-box">
<el-input <!-- <el-input
placeholder="请按照模板格式填写数据(文件大小不可超过8MB)" placeholder="请按照模板格式填写数据(文件大小不可超过8MB)"
readonly readonly
clearable clearable
v-model="temp.uploadname" v-model="temp.uploadname"
> >
<i slot="suffix" class="el-input__icon el-icon-upload"></i> <i slot="suffix" class="el-input__icon el-icon-upload"></i>
</el-input> </el-input>-->
<el-input placeholder="请按照模板格式填写数据(文件大小不可超过8MB)" readonly v-model="temp.uploadname" />
<i @click="delFile" class="el-icon-circle-close"></i>
<i @click="importData" class="el-icon-upload"></i>
</div> </div>
<el-button size="small" @click="downloadTemplate" class="download-btn">下载模板</el-button> <el-button size="small" @click="downloadTemplate" class="download-btn">下载模板</el-button>
</el-form-item> </el-form-item>
...@@ -211,7 +214,6 @@ export default { ...@@ -211,7 +214,6 @@ export default {
}, },
watch: { watch: {
'temp.day_type': function(nv) { 'temp.day_type': function(nv) {
console.log(nv)
this.change_day_type(nv) this.change_day_type(nv)
} }
}, },
...@@ -261,12 +263,15 @@ export default { ...@@ -261,12 +263,15 @@ export default {
this.onlyOneProcess = false this.onlyOneProcess = false
} }
}, },
delFile() {
this.temp.upload = {}
this.temp.uploadname = ''
},
importData(row) { importData(row) {
this.temp.isAddGo = true this.temp.isAddGo = true
this.importVisible = true this.importVisible = true
}, },
importCallback(file) { importCallback(file) {
// debugger
this.importVisible = false this.importVisible = false
if (file && file.name) { if (file && file.name) {
this.temp.upload = file || {} this.temp.upload = file || {}
...@@ -283,7 +288,7 @@ export default { ...@@ -283,7 +288,7 @@ export default {
this.temp.disabled === true || this.temp.disabled === false this.temp.disabled === true || this.temp.disabled === false
? this.temp.disabled ? this.temp.disabled
: true : true
console.log(this.temp) let disabled = this.temp.disabled ? 1 : 0
// 0 cancel/close 1 save dialogStatus/create/update // 0 cancel/close 1 save dialogStatus/create/update
if (status) { if (status) {
this.$refs['dataForm'].validate(valid => { this.$refs['dataForm'].validate(valid => {
...@@ -304,46 +309,45 @@ export default { ...@@ -304,46 +309,45 @@ export default {
strategy_name, strategy_name,
call_number, call_number,
day_type, day_type,
frequency_type, frequency_type
disabled
} = this.temp } = this.temp
let tempData = { // let tempData = {
user_sn: this.$publicTools.decrypt( // user_sn: this.$publicTools.decrypt(
localStorage.getItem('user_sn') // localStorage.getItem('user_sn')
), // ),
strategy_name, // strategy_name,
call_number, // call_number,
day_type, // day_type,
frequency_type, // frequency_type,
call_time_set: // call_time_set:
this.$moment(this.temp.setdate1).format('HH:mm:ss') +
(this.temp.setdate2
? '#' + this.$moment(this.temp.setdate2).format('HH:mm:ss')
: ''),
project_sn: this.temp.project_sn.join('#'),
disabled,
upload: this.temp.upload
}
// let form = new FormData()
// form.append(
// 'user_sn',
// this.$publicTools.decrypt(localStorage.getItem('user_sn'))
// )
// form.append('strategy_name', strategy_name)
// form.append('call_number', call_number)
// form.append('day_type', day_type)
// form.append('frequency_type', frequency_type)
// form.append(
// 'call_time_set',
// this.$moment(this.temp.setdate1).format('HH:mm:ss') + // this.$moment(this.temp.setdate1).format('HH:mm:ss') +
// (this.temp.setdate2 // (this.temp.setdate2
// ? '#' + this.$moment(this.temp.setdate2).format('HH:mm:ss') // ? '#' + this.$moment(this.temp.setdate2).format('HH:mm:ss')
// : '') // : ''),
// ) // project_sn: this.temp.project_sn.join('#'),
// form.append('project_sn', this.temp.project_sn.join('#')) // disabled,
// form.append('disabled', disabled) // upload: this.temp.upload
// form.append('upload', this.temp.upload) // }
let form = new FormData()
form.append(
'user_sn',
this.$publicTools.decrypt(localStorage.getItem('user_sn'))
)
form.append('strategy_name', strategy_name)
form.append('call_number', call_number)
form.append('day_type', day_type)
form.append('frequency_type', frequency_type)
form.append(
'call_time_set',
this.$moment(this.temp.setdate1).format('HH:mm:ss') +
(this.temp.setdate2
? '#' + this.$moment(this.temp.setdate2).format('HH:mm:ss')
: '')
)
form.append('project_sn', this.temp.project_sn.join('#'))
form.append('disabled', disabled)
form.append('upload', this.temp.upload)
const loading = this.$loading({ const loading = this.$loading({
lock: true, lock: true,
...@@ -352,10 +356,9 @@ export default { ...@@ -352,10 +356,9 @@ export default {
background: 'rgba(0, 0, 0, 0.7)' background: 'rgba(0, 0, 0, 0.7)'
}) })
if (this.dialogStatus === 'create') { if (this.dialogStatus === 'create') {
addStrategySet(tempData) addStrategySet(form)
.then(res => { .then(res => {
loading.close() loading.close()
// debugger
this.$emit('save') this.$emit('save')
this.$message({ this.$message({
message: message:
...@@ -380,9 +383,13 @@ export default { ...@@ -380,9 +383,13 @@ export default {
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.el-icon-upload { .el-icon-upload {
color: mediumblue; color: #c3c6ca;
font-size: 24px; font-size: 24px;
vertical-align: middle; vertical-align: middle;
position: absolute;
top: 0;
right: 100px;
line-height: 36px;
} }
.el-date-editor.el-input { .el-date-editor.el-input {
width: 100%; width: 100%;
...@@ -396,6 +403,25 @@ export default { ...@@ -396,6 +403,25 @@ export default {
border-bottom-right-radius: 0; border-bottom-right-radius: 0;
border-right: none; border-right: none;
} }
.el-input:hover {
& + .el-icon-circle-close {
display: inline-block;
}
}
.el-icon-circle-close {
color: #c3c6ca;
font-size: 16px;
vertical-align: middle;
position: absolute;
top: 0;
right: 75px;
line-height: 36px;
z-index: 1;
display: none;
&:hover {
display: inline-block;
}
}
} }
.download-btn { .download-btn {
position: absolute; position: absolute;
......
...@@ -16,7 +16,6 @@ ...@@ -16,7 +16,6 @@
action="#" action="#"
class="upload-demo" class="upload-demo"
ref="upload" ref="upload"
:on-preview="handlePreview"
:on-change="handleChange" :on-change="handleChange"
:on-remove="handleRemove" :on-remove="handleRemove"
:file-list="fileList" :file-list="fileList"
...@@ -27,7 +26,6 @@ ...@@ -27,7 +26,6 @@
<el-button slot="trigger" icon="el-icon-upload" class="upload-btn" size="small">点击导入文件</el-button> <el-button slot="trigger" icon="el-icon-upload" class="upload-btn" size="small">点击导入文件</el-button>
<el-button <el-button
v-show="0" v-show="0"
style="margin-left: 10px;"
size="small" size="small"
type="success" type="success"
@click="submitUpload" @click="submitUpload"
...@@ -46,7 +44,7 @@ ...@@ -46,7 +44,7 @@
:append-to-body="true" :append-to-body="true"
:destroy-on-close="true" :destroy-on-close="true"
:close-on-click-modal="false" :close-on-click-modal="false"
width="30%" width="400px"
> >
<div class="result-box"> <div class="result-box">
<div> <div>
...@@ -59,8 +57,7 @@ ...@@ -59,8 +57,7 @@
</div> </div>
<div>成功导入{{successTotal}}个号码,{{failTotal}}个号码导入失败</div> <div>成功导入{{successTotal}}个号码,{{failTotal}}个号码导入失败</div>
<div v-if="failTotal>0"> <div v-if="failTotal>0">
<span>失败数据文件:</span> <a class="down-txt" @click="downloadFail">点击下载失败数据文件</a>
<a class="down-txt" @click="downloadFail">点击下载</a>
</div> </div>
</div> </div>
<div slot="footer" class="dialog-footer text-center"> <div slot="footer" class="dialog-footer text-center">
...@@ -71,7 +68,11 @@ ...@@ -71,7 +68,11 @@
</template> </template>
<script> <script>
import { importExcelData, downloadModel } from '@/api/article' import {
importExcelData,
downloadModel,
downloadFailExcel
} from '@/api/article'
export default { export default {
name: 'ImprtData', name: 'ImprtData',
...@@ -106,11 +107,12 @@ export default { ...@@ -106,11 +107,12 @@ export default {
} }
}, },
downloadFail() { downloadFail() {
// failDataFile downloadFailExcel({
console.log(this) user_sn: this.$publicTools.decrypt(localStorage.getItem('user_sn')),
filename: this.failDataFile
})
}, },
handleResultClose() { handleResultClose() {
// debugger
this.dialogResultVisible = false this.dialogResultVisible = false
if (this.temp.isAddGo) { if (this.temp.isAddGo) {
this.$emit('addSave', this.fileList[0].raw) this.$emit('addSave', this.fileList[0].raw)
...@@ -124,20 +126,14 @@ export default { ...@@ -124,20 +126,14 @@ export default {
}) })
}, },
handleRemove(file, fileList) { handleRemove(file, fileList) {
console.log(file, fileList)
this.fileList = [] this.fileList = []
}, },
handlePreview(file) {
console.log(file)
},
handleChange(file, fileList) { handleChange(file, fileList) {
// 替换为最新的 // 替换为最新的
console.log(arguments)
this.fileList = [file] this.fileList = [file]
this.validateFiles() this.validateFiles()
}, },
submitUpload() { submitUpload() {
// debugger
if (this.temp.isAddGo) { if (this.temp.isAddGo) {
this.$emit('addSave', this.fileList[0].raw) this.$emit('addSave', this.fileList[0].raw)
} else { } else {
...@@ -146,7 +142,10 @@ export default { ...@@ -146,7 +142,10 @@ export default {
'user_sn', 'user_sn',
this.$publicTools.decrypt(localStorage.getItem('user_sn')) this.$publicTools.decrypt(localStorage.getItem('user_sn'))
) )
form.append('strategy_sn', this.temp.strategy_sn) form.append(
'strategy_sn',
this.temp.isAddGo ? '' : this.temp.strategy_sn
)
form.append('upload', this.fileList[0].raw) form.append('upload', this.fileList[0].raw)
const loading = this.$loading({ const loading = this.$loading({
lock: true, lock: true,
...@@ -168,7 +167,6 @@ export default { ...@@ -168,7 +167,6 @@ export default {
}) })
} }
}, },
handleDownload() {},
saveData(status) { saveData(status) {
// 0 cancel/close 1 addSave dialogStatus/create/update // 0 cancel/close 1 addSave dialogStatus/create/update
if (status) { if (status) {
......
...@@ -79,7 +79,7 @@ ...@@ -79,7 +79,7 @@
:title="textMap[dialogStatus]+'外呼策略'" :title="textMap[dialogStatus]+'外呼策略'"
:visible.sync="dialogFormVisible" :visible.sync="dialogFormVisible"
:append-to-body="true" :append-to-body="true"
width="30%" width="720px"
:destroy-on-close="true" :destroy-on-close="true"
:close-on-click-modal="false" :close-on-click-modal="false"
> >
...@@ -92,7 +92,7 @@ ...@@ -92,7 +92,7 @@
</el-dialog> </el-dialog>
<el-dialog <el-dialog
title="导入数据" title="导入数据"
width="30%" width="400px"
:visible.sync="importVisible" :visible.sync="importVisible"
:append-to-body="true" :append-to-body="true"
:destroy-on-close="true" :destroy-on-close="true"
...@@ -142,7 +142,8 @@ export default { ...@@ -142,7 +142,8 @@ export default {
setdate2: '', setdate2: '',
project_sn: '', project_sn: '',
disabled: '', disabled: '',
upload: '' upload: '',
uploadname: ''
}, },
dialogFormVisible: false, dialogFormVisible: false,
importVisible: false, importVisible: false,
...@@ -158,7 +159,6 @@ export default { ...@@ -158,7 +159,6 @@ export default {
this.getList() this.getList()
}, },
importCallbackIndex(v) { importCallbackIndex(v) {
// debugger
this.importVisible = false this.importVisible = false
if (v === 1) { if (v === 1) {
this.getList() this.getList()
...@@ -192,11 +192,12 @@ export default { ...@@ -192,11 +192,12 @@ export default {
setdate2: '', setdate2: '',
project_sn: '', project_sn: '',
disabled: '', disabled: '',
upload: '' upload: '',
uploadname: ''
} }
}, },
handleCreate() { handleCreate() {
if (this.list.length >= 20) { if (this.list.length >= 201111110) {
this.$message({ this.$message({
message: '最多2个外呼策略', message: '最多2个外呼策略',
type: 'warning' type: 'warning'
......
...@@ -53,6 +53,13 @@ export default { ...@@ -53,6 +53,13 @@ export default {
name: 'AddOrEdit', name: 'AddOrEdit',
props: ['dialogStatus', 'temp'], props: ['dialogStatus', 'temp'],
data() { data() {
const validatePhone = (rule, value, callback) => {
if (/^[1][0-9]{10}$/.test(String(value || ''))) {
callback()
} else {
callback(new Error('请输入11位手机号'))
}
}
return { return {
typeOptions: [ typeOptions: [
{ value: 1, key: 'Web端' }, { value: 1, key: 'Web端' },
...@@ -63,6 +70,7 @@ export default { ...@@ -63,6 +70,7 @@ export default {
{ {
required: true, required: true,
message: '手机号码必填且不能超过11位字符', message: '手机号码必填且不能超过11位字符',
validator: validatePhone,
trigger: 'blur' trigger: 'blur'
} }
], ],
......
...@@ -105,11 +105,10 @@ ...@@ -105,11 +105,10 @@
:limit.sync="listQuery.pageSize" :limit.sync="listQuery.pageSize"
@pagination="getList" @pagination="getList"
/> />
<el-dialog <el-dialog
:title="textMap[dialogStatus]" :title="textMap[dialogStatus]"
:append-to-body="true" :append-to-body="true"
width="30%" width="600px"
:visible.sync="dialogFormVisible" :visible.sync="dialogFormVisible"
:destroy-on-close="true" :destroy-on-close="true"
:close-on-click-modal="false" :close-on-click-modal="false"
...@@ -129,6 +128,7 @@ import { getStrategyTask } from '@/api/article' ...@@ -129,6 +128,7 @@ import { getStrategyTask } from '@/api/article'
import waves from '@/directive/waves' import waves from '@/directive/waves'
import Pagination from '@/components/Pagination' import Pagination from '@/components/Pagination'
import AddOrEdit from './add' import AddOrEdit from './add'
import { arraybuffer } from 'jszip/lib/support'
export default { export default {
name: 'TaskData', name: 'TaskData',
...@@ -198,11 +198,19 @@ export default { ...@@ -198,11 +198,19 @@ export default {
getStrategyTask(this.listQuery) getStrategyTask(this.listQuery)
.then(response => { .then(response => {
this.listLoading = false this.listLoading = false
this.list = Array.from(response.info) if (
this.total = Object.prototype.toString.call(response.info) === '[object Object]'
Object.prototype.toString.call(response.meta) === '[object Object]' ) {
? response.meta.total this.total = response.info.total || 0
: this.list.length if (Array.isArray(response.info.data)) {
this.list = response.info.data
} else {
this.list = []
}
} else {
this.total = 0
this.list = []
}
}) })
.catch(() => { .catch(() => {
this.listLoading = false this.listLoading = false
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment