From a908a9f650392c233ffb675cc97126a3763fce31 Mon Sep 17 00:00:00 2001 From: yechenhao Date: Sun, 10 May 2020 15:14:52 +0800 Subject: [PATCH] =?UTF-8?q?=E6=89=B9=E9=87=8F=E4=B8=8A=E4=BC=A0=E9=97=A8?= =?UTF-8?q?=E5=BA=97=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/iview.js | 2 + src/pages/AddCustomerTable.vue | 432 ++++++++++++++++++++++++ src/pages/ApplyCustomerTable.vue | 389 +++++++++++++++++++++ src/pages/CustomerView.vue | 2 +- src/pages/TableAnalysis.vue | 46 +++ src/router/index.js | 24 ++ src/services/CommonHttp.js | 44 ++- src/services/datacenter/customerView.js | 12 + vue.config.js | 2 +- 9 files changed, 950 insertions(+), 3 deletions(-) create mode 100644 src/pages/AddCustomerTable.vue create mode 100644 src/pages/ApplyCustomerTable.vue create mode 100644 src/pages/TableAnalysis.vue diff --git a/src/iview.js b/src/iview.js index a1d0cbc..f0b9d65 100644 --- a/src/iview.js +++ b/src/iview.js @@ -8,6 +8,7 @@ import { FormItem, Icon, Input, + InputNumber, Layout, Menu, MenuItem, @@ -41,6 +42,7 @@ Vue.component('Table', Table); Vue.component('Card', Card); Vue.component('Form', Form); Vue.component('FormItem', FormItem); +Vue.component('InputNumber', InputNumber); Vue.component('Icon', Icon); Vue.component('i-input', Input); Vue.component('Layout', Layout); diff --git a/src/pages/AddCustomerTable.vue b/src/pages/AddCustomerTable.vue new file mode 100644 index 0000000..4154db0 --- /dev/null +++ b/src/pages/AddCustomerTable.vue @@ -0,0 +1,432 @@ + + + diff --git a/src/pages/ApplyCustomerTable.vue b/src/pages/ApplyCustomerTable.vue new file mode 100644 index 0000000..3399c7b --- /dev/null +++ b/src/pages/ApplyCustomerTable.vue @@ -0,0 +1,389 @@ + + + diff --git a/src/pages/CustomerView.vue b/src/pages/CustomerView.vue index 3fb5bc5..55dd184 100644 --- a/src/pages/CustomerView.vue +++ b/src/pages/CustomerView.vue @@ -71,7 +71,7 @@ {{customerViewVO.validDeleteCustomer}} - 拉黑数(累计去重) + 拉黑数(累计) diff --git a/src/pages/TableAnalysis.vue b/src/pages/TableAnalysis.vue new file mode 100644 index 0000000..7b22866 --- /dev/null +++ b/src/pages/TableAnalysis.vue @@ -0,0 +1,46 @@ + + + + + diff --git a/src/router/index.js b/src/router/index.js index 942c345..ea5a444 100755 --- a/src/router/index.js +++ b/src/router/index.js @@ -10,6 +10,9 @@ import AccountManagerUpload from '@/pages/user/AccountManagerUpload'; import RoleManager from '@/pages/user/RoleManager'; import IncreaseManager from '@/pages/shop/IncreaseManager'; import CustomerView from "@/pages/CustomerView"; +import TableAnalysis from "@/pages/TableAnalysis"; +import AddCustomerTable from "@/pages/AddCustomerTable"; +import ApplyCustomerTable from "@/pages/ApplyCustomerTable"; import ZeroExtendDetail from "@/pages/ZeroExtendDetail"; import CustomerDetail from "@/pages/CustomerDetail"; import IncreaseData from '@/pages/shop/IncreaseData'; @@ -102,6 +105,27 @@ const router = new Router({ } ] }, + { + path: '/table/analysis', + name: 'TableAnalysis', + component: TableAnalysis, + children: [ + { + path: '/', + redirect: '/table/analysis/customer/add' + }, + { + path: '/table/analysis/customer/add', + name: 'AddCustomerTable', + component: AddCustomerTable + }, + { + path: '/table/analysis/customer/apply', + name: 'ApplyCustomerTable', + component: ApplyCustomerTable + } + ] + }, { path: '/shop/increase/configure', name: 'IncreaseConfigure', diff --git a/src/services/CommonHttp.js b/src/services/CommonHttp.js index 2b49053..9e2c2cd 100755 --- a/src/services/CommonHttp.js +++ b/src/services/CommonHttp.js @@ -7,7 +7,7 @@ import commonUtils from '../utils/Common' // http://mf.kiisoo.com:58080/ // axios.defaults.baseURL = 'http://mf.kiisoo.com:58080/gds/api'; -axios.defaults.baseURL = 'https://wxtk.bsdits.com/kiisoo-ic/'; +axios.defaults.baseURL = '/ic'; // axios.defaults.baseURL = '/kiisoo-ic'; //响应时间 @@ -230,6 +230,47 @@ export function downloadZip(url,filename, options = {}) { ) }) } +export function downloadExcel(url,filename, options = {}) { + let split = filename.split(","); + if (split.length != 1){ + filename = "店铺发起申请数报表"; + }else{ + filename = "零售公司拓客报表"; + } + return new Promise((resolve, reject) => { + axios.defaults.headers['content-type'] = 'application/x-www-form-urlencoded;charset=UTF-8' + axios({ + method: 'post', + url: url, // 请求地址 + data: options, // 参数 + responseType: 'blob' // 表明返回服务器返回的数据类型 + }).then( + response => { + resolve(response.data) + let blob = new Blob([response.data], { + type: 'application/vnd.ms-excel' + }) + console.log(blob) + let fileName = filename + '.xls' + if (window.navigator.msSaveOrOpenBlob) { + // console.log(2) + navigator.msSaveBlob(blob, fileName) + } else { + // console.log(3) + var link = document.createElement('a') + link.href = window.URL.createObjectURL(blob) + link.download = fileName + link.click() + //释放内存 + window.URL.revokeObjectURL(link.href) + } + }, + err => { + reject(err) + } + ) + }) +} export function downloadImg(url,filename, options = {}) { return new Promise((resolve, reject) => { axios.defaults.headers['content-type'] = 'application/x-www-form-urlencoded;charset=UTF-8' @@ -274,6 +315,7 @@ export default { get, post, downloadZip, + downloadExcel, downloadImg, put, fetchDelete, diff --git a/src/services/datacenter/customerView.js b/src/services/datacenter/customerView.js index 99fdc1a..af6f809 100644 --- a/src/services/datacenter/customerView.js +++ b/src/services/datacenter/customerView.js @@ -10,10 +10,22 @@ import http from '../CommonHttp' export function getMainRequest(params, call) { return http.get('/customer/view/main', params).then(call) } +export function getAnalysisRequest(params, call) { + return http.post('/analysis/add/customer', params).then(call) +} +export function getAnalysisApplyRequest(params, call) { + return http.post('/analysis/apply/customer', params).then(call) +} +export function downLoadExcel(params,filename, call) { + return http.downloadExcel('/analysis/download/excel',filename, params).then(call) +} export default { //mainList getMainRequest, + getAnalysisRequest, + downLoadExcel, + getAnalysisApplyRequest, } diff --git a/vue.config.js b/vue.config.js index 1128b98..d397ebc 100644 --- a/vue.config.js +++ b/vue.config.js @@ -28,7 +28,7 @@ module.exports = { hotOnly: false, disableHostCheck: true, /* 使用代理 后台接口路径 */ - proxy: 'http://192.168.31.177:8312/' + proxy: 'http://192.168.1.163:8048/' // proxy: 'http://jdxdev.vipgz4.idcfengye.com/' }, chainWebpack: config => {