作者 lixiang

仓库bug修正

import { UserLayout, TabLayout, RouteView, BlankLayout, PageView } from '@/components/layouts'
import Vue from 'vue'
import { USER_INFO } from '@/store/mutation-types'
/**
* 走菜单,走权限控制
* @type {[null,null]}
*/
export const asyncRouterMap = [
{
path: '/',
name: 'dashboard',
component: TabLayout,
meta: { title: '首页' },
redirect: '/dashboard/analysis',
children: [
// // dashboard
// {
// path: '/dashboard',
// name: 'dashboard',
// redirect: '/dashboard/workplace',
// component: RouteView,
// meta: { title: '仪表盘', icon: 'dashboard', permission: [ 'dashboard' ] },
// children: [
// {
// path: '/dashboard/analysis',
// name: 'Analysis',
// component: () => import('@/views/dashboard/Analysis'),
// meta: { title: '分析页', permission: [ 'dashboard' ] }
// },
// {
// path: '/dashboard/monitor',
// name: 'Monitor',
// hidden: true,
// component: () => import('@/views/dashboard/Monitor'),
// meta: { title: '监控页', permission: [ 'dashboard' ] }
// },
// {
// path: '/dashboard/workplace',
// name: 'Workplace',
// component: () => import('@/views/dashboard/Workplace'),
// meta: { title: '工作台', permission: [ 'dashboard' ] }
// }
// ]
// },
//
// // forms
// {
// path: '/form',
// redirect: '/form/basic-form',
// component: PageView,
// meta: { title: '表单页', icon: 'form', permission: [ 'form' ] },
// children: [
// {
// path: '/form/base-form',
// name: 'BaseForm',
// component: () => import('@/views/form/BasicForm'),
// meta: { title: '基础表单', permission: [ 'form' ] }
// },
// {
// path: '/form/step-form',
// name: 'StepForm',
// component: () => import('@/views/form/stepForm/StepForm'),
// meta: { title: '分步表单', permission: [ 'form' ] }
// },
// {
// path: '/form/advanced-form',
// name: 'AdvanceForm',
// component: () => import('@/views/form/advancedForm/AdvancedForm'),
// meta: { title: '高级表单', permission: [ 'form' ] }
// }
// ]
// },
//
// // list
// {
// path: '/list',
// name: 'list',
// component: PageView,
// redirect: '/list/query-list',
// meta: { title: '列表页', icon: 'table', permission: [ 'table' ] },
// children: [
// {
// path: '/list/query-list',
// name: 'QueryList',
// component: () => import('@/views/list/TableList'),
// meta: { title: '查询表格', permission: [ 'table' ] }
// },
// {
// path: '/list/edit-table',
// name: 'EditList',
// component: () => import('@/views/list/TableInnerEditList'),
// meta: { title: '内联编辑表格', permission: [ 'table' ] }
// },
// {
// path: '/list/user-list',
// name: 'UserList',
// component: () => import('@/views/list/UserList'),
// meta: { title: '用户列表', permission: [ 'table' ] }
// },
// {
// path: '/list/role-list',
// name: 'RoleList',
// component: () => import('@/views/list/RoleList'),
// meta: { title: '角色列表', permission: [ 'table' ] }
// },
// {
// path: '/list/permission-list',
// name: 'PermissionList',
// component: () => import('@/views/list/PermissionList'),
// meta: { title: '权限列表', permission: [ 'table' ] }
// },
// {
// path: '/list/basic-list',
// name: 'BasicList',
// component: () => import('@/views/list/StandardList'),
// meta: { title: '标准列表', permission: [ 'table' ] }
// },
// {
// path: '/list/card',
// name: 'CardList',
// component: () => import('@/views/list/CardList'),
// meta: { title: '卡片列表', permission: [ 'table' ] }
// },
// {
// path: '/list/search',
// name: 'SearchList',
// component: () => import('@/views/list/search/SearchLayout'),
// redirect: '/list/search/article',
// meta: { title: '搜索列表', permission: [ 'table' ] },
// children: [
// {
// path: '/list/search/article',
// name: 'SearchArticles',
// component: () => import('../views/list/TableList'),
// meta: { title: '搜索列表(文章)', permission: [ 'table' ] }
// },
// {
// path: '/list/search/project',
// name: 'SearchProjects',
// component: () => import('../views/list/TableList'),
// meta: { title: '搜索列表(项目)', permission: [ 'table' ] }
// },
// {
// path: '/list/search/application',
// name: 'SearchApplications',
// component: () => import('../views/list/TableList'),
// meta: { title: '搜索列表(应用)', permission: [ 'table' ] }
// },
// ]
// },
// ]
// },
//
// // profile
// {
// path: '/profile',
// name: 'profile',
// component: RouteView,
// redirect: '/profile/basic',
// meta: { title: '详情页', icon: 'profile', permission: [ 'profile' ] },
// children: [
// {
// path: '/profile/basic',
// name: 'ProfileBasic',
// component: () => import('@/views/profile/basic/Index'),
// meta: { title: '基础详情页', permission: [ 'profile' ] }
// },
// {
// path: '/profile/advanced',
// name: 'ProfileAdvanced',
// component: () => import('@/views/profile/advanced/Advanced'),
// meta: { title: '高级详情页', permission: [ 'profile' ] }
// }
// ]
// },
//
// // result
// {
// path: '/result',
// name: 'result',
// component: PageView,
// redirect: '/result/success',
// meta: { title: '结果页', icon: 'check-circle-o', permission: [ 'result' ] },
// children: [
// {
// path: '/result/success',
// name: 'ResultSuccess',
// component: () => import(/* webpackChunkName: "result" */ '@/views/result/Success'),
// meta: { title: '成功', hiddenHeaderContent: true, permission: [ 'result' ] }
// },
// {
// path: '/result/fail',
// name: 'ResultFail',
// component: () => import(/* webpackChunkName: "result" */ '@/views/result/Error'),
// meta: { title: '失败', hiddenHeaderContent: true, permission: [ 'result' ] }
// }
// ]
// },
//
// // Exception
// {
// path: '/exception',
// name: 'exception',
// component: RouteView,
// redirect: '/exception/403',
// meta: { title: '异常页', icon: 'warning', permission: [ 'exception' ] },
// children: [
// {
// path: '/exception/403',
// name: 'Exception403',
// component: () => import(/* webpackChunkName: "fail" */ '@/views/exception/403'),
// meta: { title: '403', permission: [ 'exception' ] }
// },
// {
// path: '/exception/404',
// name: 'Exception404',
// component: () => import(/* webpackChunkName: "fail" */ '@/views/exception/404'),
// meta: { title: '404', permission: [ 'exception' ] }
// },
// {
// path: '/exception/500',
// name: 'Exception500',
// component: () => import(/* webpackChunkName: "fail" */ '@/views/exception/500'),
// meta: { title: '500', permission: [ 'exception' ] }
// }
// ]
// },
//
// // account
// {
// path: '/account',
// component: RouteView,
// name: 'account',
// meta: { title: '个人页', icon: 'user', keepAlive: true, permission: [ 'user' ] },
// children: [
// {
// path: '/account/center',
// name: 'center',
// component: () => import('@/views/account/center/Index'),
// meta: { title: '个人中心', keepAlive: true, permission: [ 'user' ] }
// },
// {
// path: '/account/settings',
// name: 'settings',
// component: () => import('@/views/account/settings/Index'),
// meta: { title: '个人设置', hideHeader: true, keepAlive: true, permission: [ 'user' ] },
// redirect: '/account/settings/base',
// alwaysShow: true,
// children: [
// {
// path: '/account/settings/base',
// name: 'BaseSettings',
// component: () => import('@/views/account/settings/BaseSetting'),
// meta: { title: '基本设置', hidden: true, keepAlive: true, permission: [ 'user' ] }
// },
// {
// path: '/account/settings/security',
// name: 'SecuritySettings',
// component: () => import('@/views/account/settings/Security'),
// meta: { title: '安全设置', hidden: true, keepAlive: true, permission: [ 'user' ] }
// },
// {
// path: '/account/settings/custom',
// name: 'CustomSettings',
// component: () => import('@/views/account/settings/Custom'),
// meta: { title: '个性化设置', hidden: true, keepAlive: true, permission: [ 'user' ] }
// },
// {
// path: '/account/settings/binding',
// name: 'BindingSettings',
// component: () => import('@/views/account/settings/Binding'),
// meta: { title: '账户绑定', hidden: true, keepAlive: true, permission: [ 'user' ] }
// },
// {
// path: '/account/settings/notification',
// name: 'NotificationSettings',
// component: () => import('@/views/account/settings/Notification'),
// meta: { title: '新消息通知', hidden: true, keepAlive: true, permission: [ 'user' ] }
// },
// ]
// },
// ]
// }
]
children: []
},
{
path: '*', redirect: '/404', hidden: true
path: '*',
redirect: (to) => {
const userInfo = Vue.ls.get(USER_INFO)
if (userInfo && userInfo.id) {
return { name: 'dashboard' }
} else {
return '/404'
}
},
hidden: true
}
]
... ... @@ -322,31 +62,6 @@ export const constantRouterMap = [
},
]
},
// {
// path: '/',
// name: 'index',
// component: TabLayout,
// meta: {title: '首页'},
// redirect: '/dashboard/workplace',
// children: [
// {
// path: '/online',
// name: 'online',
// redirect: '/online',
// component: RouteView,
// meta: {title: '在线开发', icon: 'dashboard', permission: ['dashboard']},
// children: [
// {
// path: '/online/auto/:code',
// name: 'report',
// component: () => import('@/views/modules/online/cgreport/OnlCgreportAutoList')
// },
// ]
// },
// ]
// },
{
// OAuth2 APP页面路由
path: '/oauth2-app',
... ... @@ -361,7 +76,6 @@ export const constantRouterMap = [
},
]
},
{
path: '/test',
component: BlankLayout,
... ... @@ -376,7 +90,14 @@ export const constantRouterMap = [
},
{
path: '/404',
component: () => import(/* webpackChunkName: "fail" */ '@/views/exception/404')
},
component: () => import(/* webpackChunkName: "fail" */ '@/views/exception/404'),
beforeEnter: (to, from, next) => {
const userInfo = Vue.ls.get(USER_INFO)
if (userInfo && userInfo.id) {
next({ name: 'dashboard' })
} else {
next()
}
}
}
]
\ No newline at end of file
... ...
... ... @@ -207,6 +207,7 @@ export default {
},
loadData(rows) {
this.loading = true
this.clearData();
if (rows) {
const row = rows[0]
console.log("row",row)
... ...
... ... @@ -170,61 +170,26 @@
align: 'center',
dataIndex: 'xydj'
},
// {
// title:'在途单价(含税运)(元)',
// align:"center",
// dataIndex: 'ztdj'
// },
// {
// title:'历史投标价(元)',
// align:"center",
// dataIndex: 'lstbj'
// },
// {
// title:'历史中标价(元)',
// align:"center",
// dataIndex: 'lszbj'
// },
// {
// title:'投标价格(元)',
// align:"center",
// dataIndex: 'tbjg'
// },
// {
// title:'中标价',
// align:"center",
// dataIndex: 'zbj'
// },
// {
// title:'单价差异',
// align:"center",
// dataIndex: 'djchay'
// },
// {
// title:'数量',
// align:"center",
// dataIndex: 'sl'
// },
// {
// title:'时间',
// align:"center",
// dataIndex: 'sj'
// },
// {
// title:'是否中标',
// align:"center",
// dataIndex: 'sfzb'
// },
// {
// title:'是否已采购完成',
// align:"center",
// dataIndex: 'sfcgwc'
// },
// {
// title:'交货时间',
// align:"center",
// dataIndex: 'jhsj'
// },
{
title: '状态',
align: 'center',
dataIndex: 'status',
width: 100,
customRender: function (param) {
console.log("param", param)
//'投标审核状态:0-询价中、1-询价完成、2-投标待审核、3-投标审核完成
if (param === '0'){
return '询价中'
} else if (param === '1') {
return '询价完成'
} else if (param === '2') {
return '投标待审核'
} else if (param === '3') {
return '投标审核完成'
}
return ""
}
},
{
title: '操作',
dataIndex: 'action',
... ...
... ... @@ -78,7 +78,7 @@
</span>
<span slot="action2" slot-scope="text, record">
<a @click="wjInfo(record)">{{ record.htfj }}</a> &nbsp
<a @click="wjDownload(record)">{{ record.htfj }}</a> &nbsp
</span>
<span slot="action3" slot-scope="text, record">
<a @click="fpInfo(record)">发票管理</a> &nbsp
... ... @@ -1377,22 +1377,52 @@ export default {
}
)
},
wjInfo(record) {
var htfjPath = ''
if (record.htfj.indexOf(',') > 0) {
htfjPath = record.htfj.substring(0, record.htfj.indexOf(','))
} else {
htfjPath = record.htfj
// 修改wjDownload方法,使用Base64数据下载
wjDownload(record) {
if (!record.htfj) {
this.$message.warning('无附件可下载');
return;
}
getAction(this.url.file, { filePath: htfjPath }).then(
res => {
const base64Pdf = res.result
this.pdfSrc = `data:application/pdf;base64,${base64Pdf}`
// 获取第一个附件路径(如果有多附件,只下载第一个)
let htfjPath = record.htfj.split(',')[0].trim();
if (!htfjPath) {
this.$message.warning('附件路径无效');
return;
}
)
this.visibleWjck = true
// 调用后端接口获取Base64数据
this.confirmLoading = true;
getAction(this.url.file, { filePath: htfjPath }).then(res => {
if (res.success && res.result) {
const base64Data = res.result;
// 从路径中提取文件名
const fileName = htfjPath.substring(htfjPath.lastIndexOf('/') + 1) || 'download';
// 创建下载链接
const link = document.createElement('a');
link.href = `data:application/octet-stream;base64,${base64Data}`;
link.download = fileName;
document.body.appendChild(link);
link.click();
document.body.removeChild(link);
this.$message.success('开始下载文件');
} else {
this.$message.error('获取文件失败');
}
}).catch(error => {
this.$message.error('下载文件出错');
console.error('下载错误:', error);
}).finally(() => {
this.confirmLoading = false;
});
},
handleCancelWjck() {
this.visibleWjck = false
},
... ...
... ... @@ -366,19 +366,11 @@ export default {
},
// 行点击事件
handleRowClick(selectedRowKeys, selectionRows) {
console.log("handleRowClick.......................................")
console.log("selectionRows",selectionRows)
console.log("selectedRowKeys",selectedRowKeys)
let row = [selectedRowKeys];
console.log("row",row)
this.loadChildData(row)
console.log("handleRowClick.......................................")
},
handleRadioClick(selectedRowKeys, selectionRows) {
console.log("selectionRows",selectionRows)
console.log("selectedRowKeys",selectedRowKeys)
// this.$refs.tabSskcList.loading = true;
this.selectedRowKeys = selectedRowKeys
this.selectionRows = selectionRows
... ...
... ... @@ -179,8 +179,7 @@
},
methods: {
add () {
// 默认当前tab页为历史页
this.activeKey = this.refKeys['0']
this.activeKey = this.refKeys['1']
this.visible = true
this.$nextTick(() => {
this.loadData()
... ...