diff --git a/src/service/bjdService.js b/src/service/bjdService.js index 7a9f824..139d792 100644 --- a/src/service/bjdService.js +++ b/src/service/bjdService.js @@ -1,5 +1,7 @@ import XLSX from 'xlsx' import common from '@/utils/common' +import qs from 'qs' +import preview from '@/utils/preview' export default { /** @@ -101,5 +103,39 @@ export default { } reader.readAsArrayBuffer(file) loading.close() + }, + /** + * 批量打印回执单 + * + * @param bjdIds 报检单主键数组 + * @return {Promise>} + */ + batchPrintHzd(bjdIds) { + return new Promise(resolve => { + preview({ + url: '/print/batchGeneratePdfHzd', + method: 'get', + params: { + bjdIds: bjdIds + }, + paramsSerializer: function(params) { + return qs.stringify(params, { indices: false }) + } + }).then((data) => { + preview({ + url: '/print/createXmlOther', + method: 'post', + params: { + ids: bjdIds, + type: 'HZD' + }, + paramsSerializer: function(params) { + return qs.stringify(params, { indices: false }) + } + }).then((data) => { + resolve(data) + }) + }) + }) } } diff --git a/src/utils/api.js b/src/utils/api.js index dd4e5e2..2df76e3 100644 --- a/src/utils/api.js +++ b/src/utils/api.js @@ -29,16 +29,7 @@ service.interceptors.response.use( hideLoading() const res = response.data if (res.code === 1) { - if (res.data !== null) { - if (res.data.returnData !== undefined && JSON.stringify(res.data.returnData) !== '{}') { - return res.data.returnData - } else { - return res.data - } - } - return null - } else if (res.returnCode === 1) { - return res.returnData + return res.data } else if (res.code === 20001) { Notification({ showClose: true, diff --git a/src/utils/apibjd.js b/src/utils/apibjd.js index e6ae09d..8090249 100644 --- a/src/utils/apibjd.js +++ b/src/utils/apibjd.js @@ -1,6 +1,5 @@ import axios from 'axios' import { Notification } from 'element-ui' -import store from '../store' import { showLoading, hideLoading } from './apiHelper' // 创建axios实例 const service = axios.create({ @@ -27,55 +26,8 @@ service.interceptors.response.use( response => { hideLoading() const res = response.data - if (res.returnCode === '1000') { - return res - } if (res.code === 1) { - if (res.data !== null) { - if (res.data.returnCode) { - if (res.data.returnCode === 1) { - return res.data.returnData - } else if (res.data.returnCode === '20011') { - Notification({ - showClose: true, - message: res.returnMsg, - type: 'error', - duration: 500, - onClose: () => { - store.dispatch('FedLogOut').then(() => { - location.reload()// 为了重新实例化vue-router对象 避免bug - }) - } - }) - return Promise.reject('未登录') - } else { - Notification({ - message: res.data.returnMsg || '请求处理异常,请稍后再试', - type: 'error', - duration: 3 * 1000 - }) - return Promise.reject(res) - } - } else { - return res.data - } - } - return null - } if (res.returnCode === 1) { - return res.returnData - } else if (res.returnCode === '20011') { - Notification({ - showClose: true, - message: res.returnMsg, - type: 'error', - duration: 500, - onClose: () => { - store.dispatch('FedLogOut').then(() => { - location.reload()// 为了重新实例化vue-router对象 避免bug - }) - } - }) - return Promise.reject('未登录') + return res.data } else { let msg = '' if (res.message) { @@ -85,9 +37,6 @@ service.interceptors.response.use( } else { msg = res.returnMsg } - if (res.data && res.data.constructor === String) { - msg = msg ? msg + ':' + res.data : res.data - } Notification({ message: msg, type: 'error', diff --git a/src/views/allot/components/chengya_list.vue b/src/views/allot/components/chengya_list.vue deleted file mode 100644 index 8409d42..0000000 --- a/src/views/allot/components/chengya_list.vue +++ /dev/null @@ -1,1057 +0,0 @@ - - - - - diff --git a/src/views/allot/components/jidian_list.vue b/src/views/allot/components/jidian_list.vue deleted file mode 100644 index c04dada..0000000 --- a/src/views/allot/components/jidian_list.vue +++ /dev/null @@ -1,784 +0,0 @@ - - - - - diff --git a/src/views/allot/list.vue b/src/views/allot/list.vue index e7ce191..d059e18 100644 --- a/src/views/allot/list.vue +++ b/src/views/allot/list.vue @@ -1,65 +1,980 @@ + + diff --git a/src/views/archive/archive_info.vue b/src/views/archive/archive_info.vue index 40dda80..52d85a7 100644 --- a/src/views/archive/archive_info.vue +++ b/src/views/archive/archive_info.vue @@ -1,42 +1,46 @@