diff --git a/public/development_address_config.js b/public/development_address_config.js index 84dbe31..e706057 100644 --- a/public/development_address_config.js +++ b/public/development_address_config.js @@ -29,4 +29,7 @@ window._CONFIG["sendAddress"] = "天津市东丽区先锋东路68号" window._CONFIG["sendPostCode"] = "300300" // 查看物流信息-- 在企业端 -window._CONFIG["lookExpressDomainURL"] = "http://localhost:21826/lookExpressInfo"; \ No newline at end of file +window._CONFIG["lookExpressDomainURL"] = "http://localhost:21826/lookExpressInfo"; + +// 来款内部部署的ip +window._CONFIG["intranetUrl"] = "http://localhost:21825/"; \ No newline at end of file diff --git a/public/local_production_address_config.js b/public/local_production_address_config.js index 57eddf6..5ba28db 100644 --- a/public/local_production_address_config.js +++ b/public/local_production_address_config.js @@ -31,4 +31,7 @@ window._CONFIG["sendPostCode"] = "300300" // 查看物流信息 // window._CONFIG["lookExpressDomainURL"] = "http://bxxt.hzwlsoft.com/lookExpressInfo"; -window._CONFIG["lookExpressDomainURL"] = "http://10.10.10.46:8066/lookExpressInfo"; \ No newline at end of file +window._CONFIG["lookExpressDomainURL"] = "http://10.10.10.46:8066/lookExpressInfo"; + +// 来款内部部署的ip +window._CONFIG["intranetUrl"] = "http://10.10.10.46:8055/"; \ No newline at end of file diff --git a/public/production_address_config.js b/public/production_address_config.js index 8301bf6..3b6e726 100644 --- a/public/production_address_config.js +++ b/public/production_address_config.js @@ -26,4 +26,7 @@ window._CONFIG["sendAddress"] = "天津市东丽区先锋东路68号" window._CONFIG["sendPostCode"] = "300300" // 查看物流信息 -window._CONFIG["lookExpressDomainURL"] = "http://cwp.catarc.org.cn/lookExpressInfo" \ No newline at end of file +window._CONFIG["lookExpressDomainURL"] = "http://cwp.catarc.org.cn/lookExpressInfo" + +// 来款内部部署的ip +window._CONFIG["intranetUrl"] = "http://10.12.8.1/"; \ No newline at end of file diff --git a/src/api/api.js b/src/api/api.js index fb3868d..499317d 100644 --- a/src/api/api.js +++ b/src/api/api.js @@ -4,6 +4,8 @@ import {UI_CACHE_DB_DICT_DATA } from '@/store/mutation-types' // idm 系统单点登录 获取用户信息 const loginIdmPlatform = (params) => postAction(`/sys/singleSignOn?code=${params.code}`) +// idm 系统单点登录 通过token获取userInfo +const getUserInfo = (params) => getAction(`/sys/user/getUserInfoByToken`, params) //角色管理 const addRole = (params)=>postAction('/sys/role/add',params) const editRole = (params)=>postAction('/sys/role/edit',params) @@ -195,6 +197,7 @@ export { getKeyIv, getContactsByCompanyNoLimit, loginIdmPlatform, + getUserInfo, companyAdminResetPassword, companyAdminEnable, queryCompanyInfoById diff --git a/src/permission.js b/src/permission.js index a8f1633..84f7501 100644 --- a/src/permission.js +++ b/src/permission.js @@ -7,7 +7,7 @@ import 'nprogress/nprogress.css' // progress bar style import { ACCESS_TOKEN, INDEX_MAIN_PAGE_PATH,USER_INFO } from '@/store/mutation-types' import { generateIndexRouter } from '@/utils/util' import { menuPermission } from './utils/hasPermission' -import {loginIdmPlatform} from '@api/api' +import {loginIdmPlatform, getUserInfo} from '@api/api' import {notification} from 'ant-design-vue' import { filterTreeData, isExternalTerminal } from './utils/util' @@ -21,17 +21,31 @@ router.beforeEach(async (to, from, next) => { if (to.query.token) { Vue.ls.set(ACCESS_TOKEN, to.query.token, 7 * 24 * 60 * 60 * 1000) store.commit('SET_TOKEN', to.query.token) + // 通过token获取登录的用户信息 + let userInfoFromUrlResult = await getUserInfo() + if(userInfoFromUrlResult.success) { + Vue.ls.set(USER_INFO, userInfoFromUrlResult.result , 7 * 24 * 60 * 60 * 1000) + store.commit('SET_INFO', userInfoFromUrlResult.result) + } // 判断是否是会员系统iframe嵌入的,如果是 不先做左侧菜单和 头部标签 if(to.query.system === 'member') { store.commit('SET_SYSTEM', to.query.system) } } // idm系统单点登录 - if(to.path === '/user/login' && to.query.code){ + if(to.path === '/user/login' && to.query.code){ let result = await loginIdmPlatform({code:to.query.code}) if(result.success){ - Vue.ls.set(USER_INFO, result.result.userInfo, 7 * 24 * 60 * 60 * 1000) - Vue.ls.set(ACCESS_TOKEN, result.result.token, 7 * 24 * 60 * 60 * 1000) + // TODO 判断当前用户是否是领导角色,如果是的话跳转到内网的网址的首页 并用token 登录 + let userInfo = result.result.userInfo + const token = result.result.token + // 领导角色需要跳转到内网, + if(userInfo.roleCode.includes('bmfzr') || userInfo.roleCode.includes('sld') || userInfo.roleCode.includes('admin')) { + window.open(`${window._CONFIG.intranetUrl}dashboard/analysis?token=${token}`, '_self') + } else { + Vue.ls.set(USER_INFO, userInfo, 7 * 24 * 60 * 60 * 1000) + Vue.ls.set(ACCESS_TOKEN, token, 7 * 24 * 60 * 60 * 1000) + } }else { notification['error']({ message: '登录失败', diff --git a/src/views/packManagement/PackProjectMaintenance.vue b/src/views/packManagement/PackProjectMaintenance.vue index fe32e57..1aad75d 100644 --- a/src/views/packManagement/PackProjectMaintenance.vue +++ b/src/views/packManagement/PackProjectMaintenance.vue @@ -92,7 +92,8 @@ :loading="loading" :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}" @change="handleTableChange" - class="j-table-force-nowrap"> + :class="dataSource.length === 0 ? 'show-scroll' : ''" + class="j-table-force-nowrap main-table"> @@ -107,6 +108,13 @@ + + + {{ formatMoney(text+'') }} + {{ formatMoney(text+'') }} + + + @@ -139,6 +147,29 @@ 开票类型 + + + + + + + + {{ formatMoney(text+'') }} + {{ formatMoney(text+'') }} + + + + + @@ -222,6 +253,122 @@ import ConfirmStageModule from '../financialManagement/arriveAndInvoicing/module import {getPayConfirmList} from '@/api/incomePaymentsApi' import InvoiceInfoChangeModule from './modules/InvoiceInfoChangeModule' import { ProjectTypeEnums } from '../../enums/commonEnums' +import { getAction } from '../../api/manage' +import { formatMoney } from '../../utils/formatMoney' + +const firstColumnTop = { + title: '序号', + dataIndex: '', + key: 'rowIndex', + width: 60, + align: 'center', + customRender: function (t, r, index) { + return parseInt(index) + 1 + } +} +const defaultTableColumns = [ + { + title: '打包项目名称', + align: 'center', + width: 280, + dataIndex: 'chargeProject', + scopedSlots: { customRender: 'projectName' } + }, { + title: '项目负责人', + align: 'center', + width: 140, + dataIndex: 'principalName', + scopedSlots: { customRender: 'text' } + }, { + title: '待确收金额', + align: 'center', + width: 120, + dataIndex: 'receivableAmount', + scopedSlots: { customRender: 'allMoney' } + }, { + title: '实收金额', + align: 'center', + width: 120, + dataIndex: 'paidAmount', + scopedSlots: { customRender: 'allMoney' } + }, { + title: '打包', + align: 'center', + width: 80, + dataIndex: 'pack', + scopedSlots: { customRender: 'status-pack' } + }, { + title: '需要发票', + align: 'center', + width: 80, + dataIndex: 'needInvoice', + scopedSlots: { customRender: 'status-pack' } + }, { + title: '到账', + align: 'center', + width: 80, + dataIndex: 'inAccount', + scopedSlots: { customRender: 'status' } + }, { + title: '收入', + align: 'center', + width: 80, + dataIndex: 'affirmIncome', + scopedSlots: {customRender: 'status-confirm'} + }, { + title: '开票', + align: 'center', + width: 80, + dataIndex: 'makeInvoice', + scopedSlots: { customRender: 'status-bill' } + }, { + title: '邮寄', + align: 'center', + width: 80, + dataIndex: 'mail', + scopedSlots: { customRender: 'status-mail' } + }, { + title: '企业联系人', + align: 'center', + width: 100, + dataIndex: 'contactsTemporaryName', + scopedSlots: { customRender: 'text' } + }, { + title: '联系人电话', + align: 'center', + width: 100, + dataIndex: 'phone', + scopedSlots: { customRender: 'text' } + }, { + title: '联系人邮箱', + align: 'center', + width: 200, + dataIndex: 'email', + scopedSlots: { customRender: 'text' } + }, { + title: '操作', + dataIndex: 'action', + align: 'center', + fixed: 'right', + width: 330, + scopedSlots: { customRender: 'action' } + } +] + +const firstColumnFooter = [ + { + title: '多选', + dataIndex: 'selection', + align: 'center', + width: 60 + }, + { + title: '序号', + dataIndex: 'title', + align: 'center', + width: 60 + } +] export default { name: 'PackProjectMaintenance', @@ -284,101 +431,8 @@ export default { xs: { span: 24 }, sm: { span: 10 } }, - columns: [ - { - title: '序号', - dataIndex: '', - key: 'rowIndex', - width: 60, - align: 'center', - customRender: function (t, r, index) { - return parseInt(index) + 1 - } - }, { - title: '打包项目名称', - align: 'center', - width: 280, - dataIndex: 'chargeProject', - scopedSlots: { customRender: 'projectName' } - }, { - title: '项目负责人', - align: 'center', - width: 140, - dataIndex: 'principalName', - scopedSlots: { customRender: 'text' } - }, { - title: '待确收金额', - align: 'center', - width: 120, - dataIndex: 'receivableAmount' - }, { - title: '实收金额', - align: 'center', - width: 120, - dataIndex: 'paidAmount' - }, { - title: '打包', - align: 'center', - width: 80, - dataIndex: 'pack', - scopedSlots: { customRender: 'status-pack' } - }, { - title: '需要发票', - align: 'center', - width: 80, - dataIndex: 'needInvoice', - scopedSlots: { customRender: 'status-pack' } - }, { - title: '到账', - align: 'center', - width: 80, - dataIndex: 'inAccount', - scopedSlots: { customRender: 'status' } - }, { - title: '收入', - align: 'center', - width: 80, - dataIndex: 'affirmIncome', - scopedSlots: {customRender: 'status-confirm'} - }, { - title: '开票', - align: 'center', - width: 80, - dataIndex: 'makeInvoice', - scopedSlots: { customRender: 'status-bill' } - }, { - title: '邮寄', - align: 'center', - width: 80, - dataIndex: 'mail', - scopedSlots: { customRender: 'status-mail' } - }, { - title: '企业联系人', - align: 'center', - width: 100, - dataIndex: 'contactsTemporaryName', - scopedSlots: { customRender: 'text' } - }, { - title: '联系人电话', - align: 'center', - width: 100, - dataIndex: 'phone', - scopedSlots: { customRender: 'text' } - }, { - title: '联系人邮箱', - align: 'center', - width: 200, - dataIndex: 'email', - scopedSlots: { customRender: 'text' } - }, { - title: '操作', - dataIndex: 'action', - align: 'center', - fixed: 'right', - width: 330, - scopedSlots: { customRender: 'action' } - } - ], + columns: [firstColumnTop, ...defaultTableColumns], + columnsFooter: [...firstColumnFooter, ...defaultTableColumns], disableMixinCreated: true, selectPackProjectVisible: false, selectedProject: [], // 选中的项目 @@ -395,7 +449,8 @@ export default { url: { list: '/pack/payPackCompanyProject/listAll', exportXlsUrl: '/pack/payPackCompanyProject/exportXls' - } + }, + footerDataSource: [] } }, created() { @@ -405,6 +460,7 @@ export default { }) }, methods: { + formatMoney, getPayConfirmList, /** * 获取企业信息 @@ -624,8 +680,77 @@ export default { // this.confirmStageVisible = true this.$refs.changeInvoiceInfo.open(record) + }, + /** + * 同步表与footer滚动,保留底部滚动条 + */ + setScroll() { + if (this.dataSource.length === 0) { + return + } + let dom = this.$refs.footTable.$el.querySelectorAll('.ant-table-body')[0] + dom.addEventListener( + 'scroll', + () => { + this.$refs.table.$el.querySelectorAll( + '.ant-table-body' + )[0].scrollLeft = dom.scrollLeft + }, + true + ) + this.$forceUpdate() + }, + // 重写加载的方法 + loadData(arg) { + if (!this.url.list) { + this.$message.error('请设置url.list属性!') + return + } + //加载数据 若传入参数1则加载第一页的内容 + if (arg === 1) { + this.ipagination.current = 1 + } + let params = this.getQueryParams()//查询条件 + this.loading = true + getAction(this.url.list, params).then((res) => { + if (res.success) { + let pageListObj = res.result || {} + //update-begin---author:zhangyafei Date:20201118 for:适配不分页的数据列表------------ + this.dataSource = pageListObj.list + + let obj = { + id: '1', + title: '总计', + receivableAmount: pageListObj.sumOfReceivableAmount || '0.00' + '', + paidAmount: pageListObj.sumOfPaidAmount || '0.00' + '' + } + this.footerDataSource = [obj] + if (pageListObj.total) { + this.ipagination.total = pageListObj.total + //清空列表选中 + this.onClearSelected() + } else { + this.ipagination.total = 0 + } + //update-end---author:zhangyafei Date:20201118 for:适配不分页的数据列表------------ + } + if (this.dataSource.length > 0) { + this.$nextTick(() => { + this.setScroll() + }) + } + if (res.code === 510) { + this.$message.warning(res.message) + } + this.loading = false + }).finally(() => { + this.loading = false + }) } + }, + mounted() { + this.setScroll() } } @@ -676,4 +801,47 @@ export default { overflow: hidden; text-overflow: ellipsis; } - \ No newline at end of file + +// 隐藏主列表的横向滚动条 +.main-table { + /deep/ .ant-table-body { + overflow-x: hidden !important; + } + + /deep/ .ant-table-footer { + padding: 0 0; + } + + /deep/ .ant-table.ant-table-bordered .ant-table-footer { + border-left: none; + margin-top: -2px; + } +} + +.show-scroll { + /deep/ .ant-table-body { + overflow-x: auto !important; + } +} + +// 去除底部表格边框 +.footer-table { + /deep/ .ant-table-tbody > tr > td { + border: none; + background-color: #F5F5F5; + } + + /deep/ .ant-table-fixed-right table { + border-left: none !important; + background: none; + } + + /deep/ .ant-table-body { + overflow-x: auto !important; + } + + /deep/ .ant-table-bordered .ant-table-header > table { + border-left: none; + } +} +