作者 lixiang

仓库bug修正

1 import { UserLayout, TabLayout, RouteView, BlankLayout, PageView } from '@/components/layouts' 1 import { UserLayout, TabLayout, RouteView, BlankLayout, PageView } from '@/components/layouts'
  2 +import Vue from 'vue'
  3 +import { USER_INFO } from '@/store/mutation-types'
2 4
3 /** 5 /**
4 * 走菜单,走权限控制 6 * 走菜单,走权限控制
5 * @type {[null,null]} 7 * @type {[null,null]}
6 */ 8 */
7 export const asyncRouterMap = [ 9 export const asyncRouterMap = [
8 -  
9 { 10 {
10 path: '/', 11 path: '/',
11 name: 'dashboard', 12 name: 'dashboard',
12 component: TabLayout, 13 component: TabLayout,
13 meta: { title: '首页' }, 14 meta: { title: '首页' },
14 redirect: '/dashboard/analysis', 15 redirect: '/dashboard/analysis',
15 - children: [  
16 -  
17 - // // dashboard  
18 - // {  
19 - // path: '/dashboard',  
20 - // name: 'dashboard',  
21 - // redirect: '/dashboard/workplace',  
22 - // component: RouteView,  
23 - // meta: { title: '仪表盘', icon: 'dashboard', permission: [ 'dashboard' ] },  
24 - // children: [  
25 - // {  
26 - // path: '/dashboard/analysis',  
27 - // name: 'Analysis',  
28 - // component: () => import('@/views/dashboard/Analysis'),  
29 - // meta: { title: '分析页', permission: [ 'dashboard' ] }  
30 - // },  
31 - // {  
32 - // path: '/dashboard/monitor',  
33 - // name: 'Monitor',  
34 - // hidden: true,  
35 - // component: () => import('@/views/dashboard/Monitor'),  
36 - // meta: { title: '监控页', permission: [ 'dashboard' ] }  
37 - // },  
38 - // {  
39 - // path: '/dashboard/workplace',  
40 - // name: 'Workplace',  
41 - // component: () => import('@/views/dashboard/Workplace'),  
42 - // meta: { title: '工作台', permission: [ 'dashboard' ] }  
43 - // }  
44 - // ]  
45 - // },  
46 - //  
47 - // // forms  
48 - // {  
49 - // path: '/form',  
50 - // redirect: '/form/basic-form',  
51 - // component: PageView,  
52 - // meta: { title: '表单页', icon: 'form', permission: [ 'form' ] },  
53 - // children: [  
54 - // {  
55 - // path: '/form/base-form',  
56 - // name: 'BaseForm',  
57 - // component: () => import('@/views/form/BasicForm'),  
58 - // meta: { title: '基础表单', permission: [ 'form' ] }  
59 - // },  
60 - // {  
61 - // path: '/form/step-form',  
62 - // name: 'StepForm',  
63 - // component: () => import('@/views/form/stepForm/StepForm'),  
64 - // meta: { title: '分步表单', permission: [ 'form' ] }  
65 - // },  
66 - // {  
67 - // path: '/form/advanced-form',  
68 - // name: 'AdvanceForm',  
69 - // component: () => import('@/views/form/advancedForm/AdvancedForm'),  
70 - // meta: { title: '高级表单', permission: [ 'form' ] }  
71 - // }  
72 - // ]  
73 - // },  
74 - //  
75 - // // list  
76 - // {  
77 - // path: '/list',  
78 - // name: 'list',  
79 - // component: PageView,  
80 - // redirect: '/list/query-list',  
81 - // meta: { title: '列表页', icon: 'table', permission: [ 'table' ] },  
82 - // children: [  
83 - // {  
84 - // path: '/list/query-list',  
85 - // name: 'QueryList',  
86 - // component: () => import('@/views/list/TableList'),  
87 - // meta: { title: '查询表格', permission: [ 'table' ] }  
88 - // },  
89 - // {  
90 - // path: '/list/edit-table',  
91 - // name: 'EditList',  
92 - // component: () => import('@/views/list/TableInnerEditList'),  
93 - // meta: { title: '内联编辑表格', permission: [ 'table' ] }  
94 - // },  
95 - // {  
96 - // path: '/list/user-list',  
97 - // name: 'UserList',  
98 - // component: () => import('@/views/list/UserList'),  
99 - // meta: { title: '用户列表', permission: [ 'table' ] }  
100 - // },  
101 - // {  
102 - // path: '/list/role-list',  
103 - // name: 'RoleList',  
104 - // component: () => import('@/views/list/RoleList'),  
105 - // meta: { title: '角色列表', permission: [ 'table' ] }  
106 - // },  
107 - // {  
108 - // path: '/list/permission-list',  
109 - // name: 'PermissionList',  
110 - // component: () => import('@/views/list/PermissionList'),  
111 - // meta: { title: '权限列表', permission: [ 'table' ] }  
112 - // },  
113 - // {  
114 - // path: '/list/basic-list',  
115 - // name: 'BasicList',  
116 - // component: () => import('@/views/list/StandardList'),  
117 - // meta: { title: '标准列表', permission: [ 'table' ] }  
118 - // },  
119 - // {  
120 - // path: '/list/card',  
121 - // name: 'CardList',  
122 - // component: () => import('@/views/list/CardList'),  
123 - // meta: { title: '卡片列表', permission: [ 'table' ] }  
124 - // },  
125 - // {  
126 - // path: '/list/search',  
127 - // name: 'SearchList',  
128 - // component: () => import('@/views/list/search/SearchLayout'),  
129 - // redirect: '/list/search/article',  
130 - // meta: { title: '搜索列表', permission: [ 'table' ] },  
131 - // children: [  
132 - // {  
133 - // path: '/list/search/article',  
134 - // name: 'SearchArticles',  
135 - // component: () => import('../views/list/TableList'),  
136 - // meta: { title: '搜索列表(文章)', permission: [ 'table' ] }  
137 - // },  
138 - // {  
139 - // path: '/list/search/project',  
140 - // name: 'SearchProjects',  
141 - // component: () => import('../views/list/TableList'),  
142 - // meta: { title: '搜索列表(项目)', permission: [ 'table' ] }  
143 - // },  
144 - // {  
145 - // path: '/list/search/application',  
146 - // name: 'SearchApplications',  
147 - // component: () => import('../views/list/TableList'),  
148 - // meta: { title: '搜索列表(应用)', permission: [ 'table' ] }  
149 - // },  
150 - // ]  
151 - // },  
152 - // ]  
153 - // },  
154 - //  
155 - // // profile  
156 - // {  
157 - // path: '/profile',  
158 - // name: 'profile',  
159 - // component: RouteView,  
160 - // redirect: '/profile/basic',  
161 - // meta: { title: '详情页', icon: 'profile', permission: [ 'profile' ] },  
162 - // children: [  
163 - // {  
164 - // path: '/profile/basic',  
165 - // name: 'ProfileBasic',  
166 - // component: () => import('@/views/profile/basic/Index'),  
167 - // meta: { title: '基础详情页', permission: [ 'profile' ] }  
168 - // },  
169 - // {  
170 - // path: '/profile/advanced',  
171 - // name: 'ProfileAdvanced',  
172 - // component: () => import('@/views/profile/advanced/Advanced'),  
173 - // meta: { title: '高级详情页', permission: [ 'profile' ] }  
174 - // }  
175 - // ]  
176 - // },  
177 - //  
178 - // // result  
179 - // {  
180 - // path: '/result',  
181 - // name: 'result',  
182 - // component: PageView,  
183 - // redirect: '/result/success',  
184 - // meta: { title: '结果页', icon: 'check-circle-o', permission: [ 'result' ] },  
185 - // children: [  
186 - // {  
187 - // path: '/result/success',  
188 - // name: 'ResultSuccess',  
189 - // component: () => import(/* webpackChunkName: "result" */ '@/views/result/Success'),  
190 - // meta: { title: '成功', hiddenHeaderContent: true, permission: [ 'result' ] }  
191 - // },  
192 - // {  
193 - // path: '/result/fail',  
194 - // name: 'ResultFail',  
195 - // component: () => import(/* webpackChunkName: "result" */ '@/views/result/Error'),  
196 - // meta: { title: '失败', hiddenHeaderContent: true, permission: [ 'result' ] }  
197 - // }  
198 - // ]  
199 - // },  
200 - //  
201 - // // Exception  
202 - // {  
203 - // path: '/exception',  
204 - // name: 'exception',  
205 - // component: RouteView,  
206 - // redirect: '/exception/403',  
207 - // meta: { title: '异常页', icon: 'warning', permission: [ 'exception' ] },  
208 - // children: [  
209 - // {  
210 - // path: '/exception/403',  
211 - // name: 'Exception403',  
212 - // component: () => import(/* webpackChunkName: "fail" */ '@/views/exception/403'),  
213 - // meta: { title: '403', permission: [ 'exception' ] }  
214 - // },  
215 - // {  
216 - // path: '/exception/404',  
217 - // name: 'Exception404',  
218 - // component: () => import(/* webpackChunkName: "fail" */ '@/views/exception/404'),  
219 - // meta: { title: '404', permission: [ 'exception' ] }  
220 - // },  
221 - // {  
222 - // path: '/exception/500',  
223 - // name: 'Exception500',  
224 - // component: () => import(/* webpackChunkName: "fail" */ '@/views/exception/500'),  
225 - // meta: { title: '500', permission: [ 'exception' ] }  
226 - // }  
227 - // ]  
228 - // },  
229 - //  
230 - // // account  
231 - // {  
232 - // path: '/account',  
233 - // component: RouteView,  
234 - // name: 'account',  
235 - // meta: { title: '个人页', icon: 'user', keepAlive: true, permission: [ 'user' ] },  
236 - // children: [  
237 - // {  
238 - // path: '/account/center',  
239 - // name: 'center',  
240 - // component: () => import('@/views/account/center/Index'),  
241 - // meta: { title: '个人中心', keepAlive: true, permission: [ 'user' ] }  
242 - // },  
243 - // {  
244 - // path: '/account/settings',  
245 - // name: 'settings',  
246 - // component: () => import('@/views/account/settings/Index'),  
247 - // meta: { title: '个人设置', hideHeader: true, keepAlive: true, permission: [ 'user' ] },  
248 - // redirect: '/account/settings/base',  
249 - // alwaysShow: true,  
250 - // children: [  
251 - // {  
252 - // path: '/account/settings/base',  
253 - // name: 'BaseSettings',  
254 - // component: () => import('@/views/account/settings/BaseSetting'),  
255 - // meta: { title: '基本设置', hidden: true, keepAlive: true, permission: [ 'user' ] }  
256 - // },  
257 - // {  
258 - // path: '/account/settings/security',  
259 - // name: 'SecuritySettings',  
260 - // component: () => import('@/views/account/settings/Security'),  
261 - // meta: { title: '安全设置', hidden: true, keepAlive: true, permission: [ 'user' ] }  
262 - // },  
263 - // {  
264 - // path: '/account/settings/custom',  
265 - // name: 'CustomSettings',  
266 - // component: () => import('@/views/account/settings/Custom'),  
267 - // meta: { title: '个性化设置', hidden: true, keepAlive: true, permission: [ 'user' ] }  
268 - // },  
269 - // {  
270 - // path: '/account/settings/binding',  
271 - // name: 'BindingSettings',  
272 - // component: () => import('@/views/account/settings/Binding'),  
273 - // meta: { title: '账户绑定', hidden: true, keepAlive: true, permission: [ 'user' ] }  
274 - // },  
275 - // {  
276 - // path: '/account/settings/notification',  
277 - // name: 'NotificationSettings',  
278 - // component: () => import('@/views/account/settings/Notification'),  
279 - // meta: { title: '新消息通知', hidden: true, keepAlive: true, permission: [ 'user' ] }  
280 - // },  
281 - // ]  
282 - // },  
283 - // ]  
284 - // }  
285 - ] 16 + children: []
286 }, 17 },
287 { 18 {
288 - path: '*', redirect: '/404', hidden: true 19 + path: '*',
  20 + redirect: (to) => {
  21 + const userInfo = Vue.ls.get(USER_INFO)
  22 + if (userInfo && userInfo.id) {
  23 + return { name: 'dashboard' }
  24 + } else {
  25 + return '/404'
  26 + }
  27 + },
  28 + hidden: true
289 } 29 }
290 ] 30 ]
291 31
@@ -322,31 +62,6 @@ export const constantRouterMap = [ @@ -322,31 +62,6 @@ export const constantRouterMap = [
322 }, 62 },
323 ] 63 ]
324 }, 64 },
325 -  
326 - // {  
327 - // path: '/',  
328 - // name: 'index',  
329 - // component: TabLayout,  
330 - // meta: {title: '首页'},  
331 - // redirect: '/dashboard/workplace',  
332 - // children: [  
333 - // {  
334 - // path: '/online',  
335 - // name: 'online',  
336 - // redirect: '/online',  
337 - // component: RouteView,  
338 - // meta: {title: '在线开发', icon: 'dashboard', permission: ['dashboard']},  
339 - // children: [  
340 - // {  
341 - // path: '/online/auto/:code',  
342 - // name: 'report',  
343 - // component: () => import('@/views/modules/online/cgreport/OnlCgreportAutoList')  
344 - // },  
345 - // ]  
346 - // },  
347 - // ]  
348 - // },  
349 -  
350 { 65 {
351 // OAuth2 APP页面路由 66 // OAuth2 APP页面路由
352 path: '/oauth2-app', 67 path: '/oauth2-app',
@@ -361,7 +76,6 @@ export const constantRouterMap = [ @@ -361,7 +76,6 @@ export const constantRouterMap = [
361 }, 76 },
362 ] 77 ]
363 }, 78 },
364 -  
365 { 79 {
366 path: '/test', 80 path: '/test',
367 component: BlankLayout, 81 component: BlankLayout,
@@ -376,7 +90,14 @@ export const constantRouterMap = [ @@ -376,7 +90,14 @@ export const constantRouterMap = [
376 }, 90 },
377 { 91 {
378 path: '/404', 92 path: '/404',
379 - component: () => import(/* webpackChunkName: "fail" */ '@/views/exception/404')  
380 - },  
381 - 93 + component: () => import(/* webpackChunkName: "fail" */ '@/views/exception/404'),
  94 + beforeEnter: (to, from, next) => {
  95 + const userInfo = Vue.ls.get(USER_INFO)
  96 + if (userInfo && userInfo.id) {
  97 + next({ name: 'dashboard' })
  98 + } else {
  99 + next()
  100 + }
  101 + }
  102 + }
382 ] 103 ]
@@ -207,6 +207,7 @@ export default { @@ -207,6 +207,7 @@ export default {
207 }, 207 },
208 loadData(rows) { 208 loadData(rows) {
209 this.loading = true 209 this.loading = true
  210 + this.clearData();
210 if (rows) { 211 if (rows) {
211 const row = rows[0] 212 const row = rows[0]
212 console.log("row",row) 213 console.log("row",row)
@@ -170,61 +170,26 @@ @@ -170,61 +170,26 @@
170 align: 'center', 170 align: 'center',
171 dataIndex: 'xydj' 171 dataIndex: 'xydj'
172 }, 172 },
173 - // {  
174 - // title:'在途单价(含税运)(元)',  
175 - // align:"center",  
176 - // dataIndex: 'ztdj'  
177 - // },  
178 - // {  
179 - // title:'历史投标价(元)',  
180 - // align:"center",  
181 - // dataIndex: 'lstbj'  
182 - // },  
183 - // {  
184 - // title:'历史中标价(元)',  
185 - // align:"center",  
186 - // dataIndex: 'lszbj'  
187 - // },  
188 - // {  
189 - // title:'投标价格(元)',  
190 - // align:"center",  
191 - // dataIndex: 'tbjg'  
192 - // },  
193 - // {  
194 - // title:'中标价',  
195 - // align:"center",  
196 - // dataIndex: 'zbj'  
197 - // },  
198 - // {  
199 - // title:'单价差异',  
200 - // align:"center",  
201 - // dataIndex: 'djchay'  
202 - // },  
203 - // {  
204 - // title:'数量',  
205 - // align:"center",  
206 - // dataIndex: 'sl'  
207 - // },  
208 - // {  
209 - // title:'时间',  
210 - // align:"center",  
211 - // dataIndex: 'sj'  
212 - // },  
213 - // {  
214 - // title:'是否中标',  
215 - // align:"center",  
216 - // dataIndex: 'sfzb'  
217 - // },  
218 - // {  
219 - // title:'是否已采购完成',  
220 - // align:"center",  
221 - // dataIndex: 'sfcgwc'  
222 - // },  
223 - // {  
224 - // title:'交货时间',  
225 - // align:"center",  
226 - // dataIndex: 'jhsj'  
227 - // }, 173 + {
  174 + title: '状态',
  175 + align: 'center',
  176 + dataIndex: 'status',
  177 + width: 100,
  178 + customRender: function (param) {
  179 + console.log("param", param)
  180 + //'投标审核状态:0-询价中、1-询价完成、2-投标待审核、3-投标审核完成
  181 + if (param === '0'){
  182 + return '询价中'
  183 + } else if (param === '1') {
  184 + return '询价完成'
  185 + } else if (param === '2') {
  186 + return '投标待审核'
  187 + } else if (param === '3') {
  188 + return '投标审核完成'
  189 + }
  190 + return ""
  191 + }
  192 + },
228 { 193 {
229 title: '操作', 194 title: '操作',
230 dataIndex: 'action', 195 dataIndex: 'action',
@@ -78,7 +78,7 @@ @@ -78,7 +78,7 @@
78 78
79 </span> 79 </span>
80 <span slot="action2" slot-scope="text, record"> 80 <span slot="action2" slot-scope="text, record">
81 - <a @click="wjInfo(record)">{{ record.htfj }}</a> &nbsp 81 + <a @click="wjDownload(record)">{{ record.htfj }}</a> &nbsp
82 </span> 82 </span>
83 <span slot="action3" slot-scope="text, record"> 83 <span slot="action3" slot-scope="text, record">
84 <a @click="fpInfo(record)">发票管理</a> &nbsp 84 <a @click="fpInfo(record)">发票管理</a> &nbsp
@@ -1377,22 +1377,52 @@ export default { @@ -1377,22 +1377,52 @@ export default {
1377 } 1377 }
1378 ) 1378 )
1379 }, 1379 },
1380 - wjInfo(record) {  
1381 - var htfjPath = ''  
1382 - if (record.htfj.indexOf(',') > 0) {  
1383 - htfjPath = record.htfj.substring(0, record.htfj.indexOf(','))  
1384 - } else {  
1385 - htfjPath = record.htfj 1380 + // 修改wjDownload方法,使用Base64数据下载
  1381 + wjDownload(record) {
  1382 + if (!record.htfj) {
  1383 + this.$message.warning('无附件可下载');
  1384 + return;
1386 } 1385 }
1387 - getAction(this.url.file, { filePath: htfjPath }).then(  
1388 - res => {  
1389 - const base64Pdf = res.result  
1390 - this.pdfSrc = `data:application/pdf;base64,${base64Pdf}` 1386 +
  1387 + // 获取第一个附件路径(如果有多附件,只下载第一个)
  1388 + let htfjPath = record.htfj.split(',')[0].trim();
  1389 +
  1390 + if (!htfjPath) {
  1391 + this.$message.warning('附件路径无效');
  1392 + return;
1391 } 1393 }
1392 - )  
1393 1394
1394 - this.visibleWjck = true 1395 + // 调用后端接口获取Base64数据
  1396 + this.confirmLoading = true;
  1397 + getAction(this.url.file, { filePath: htfjPath }).then(res => {
  1398 + if (res.success && res.result) {
  1399 + const base64Data = res.result;
  1400 +
  1401 + // 从路径中提取文件名
  1402 + const fileName = htfjPath.substring(htfjPath.lastIndexOf('/') + 1) || 'download';
  1403 +
  1404 + // 创建下载链接
  1405 + const link = document.createElement('a');
  1406 + link.href = `data:application/octet-stream;base64,${base64Data}`;
  1407 + link.download = fileName;
  1408 + document.body.appendChild(link);
  1409 + link.click();
  1410 + document.body.removeChild(link);
  1411 +
  1412 + this.$message.success('开始下载文件');
  1413 + } else {
  1414 + this.$message.error('获取文件失败');
  1415 + }
  1416 + }).catch(error => {
  1417 + this.$message.error('下载文件出错');
  1418 + console.error('下载错误:', error);
  1419 + }).finally(() => {
  1420 + this.confirmLoading = false;
  1421 + });
1395 }, 1422 },
  1423 +
  1424 +
  1425 +
1396 handleCancelWjck() { 1426 handleCancelWjck() {
1397 this.visibleWjck = false 1427 this.visibleWjck = false
1398 }, 1428 },
@@ -366,19 +366,11 @@ export default { @@ -366,19 +366,11 @@ export default {
366 }, 366 },
367 // 行点击事件 367 // 行点击事件
368 handleRowClick(selectedRowKeys, selectionRows) { 368 handleRowClick(selectedRowKeys, selectionRows) {
369 - console.log("handleRowClick.......................................")  
370 - console.log("selectionRows",selectionRows)  
371 - console.log("selectedRowKeys",selectedRowKeys)  
372 let row = [selectedRowKeys]; 369 let row = [selectedRowKeys];
373 - console.log("row",row)  
374 this.loadChildData(row) 370 this.loadChildData(row)
375 - console.log("handleRowClick.......................................")  
376 371
377 }, 372 },
378 handleRadioClick(selectedRowKeys, selectionRows) { 373 handleRadioClick(selectedRowKeys, selectionRows) {
379 - console.log("selectionRows",selectionRows)  
380 - console.log("selectedRowKeys",selectedRowKeys)  
381 - // this.$refs.tabSskcList.loading = true;  
382 this.selectedRowKeys = selectedRowKeys 374 this.selectedRowKeys = selectedRowKeys
383 this.selectionRows = selectionRows 375 this.selectionRows = selectionRows
384 376
@@ -179,8 +179,7 @@ @@ -179,8 +179,7 @@
179 }, 179 },
180 methods: { 180 methods: {
181 add () { 181 add () {
182 - // 默认当前tab页为历史页  
183 - this.activeKey = this.refKeys['0'] 182 + this.activeKey = this.refKeys['1']
184 this.visible = true 183 this.visible = true
185 this.$nextTick(() => { 184 this.$nextTick(() => {
186 this.loadData() 185 this.loadData()