boxu.zheng 1 year ago
parent
commit
4484413040
  1. 2
      Code/Fe/README.md
  2. 31
      Code/Fe/public/config.js
  3. 10
      Code/Fe/src/App.vue
  4. 366
      Code/Fe/src/api/wms-api.js
  5. 58
      Code/Fe/src/api/wms-auth.js
  6. 56
      Code/Fe/src/api/wms-core.js
  7. 28
      Code/Fe/src/api/wms-interface.js
  8. 190
      Code/Fe/src/api/wms-job.js
  9. 2
      Code/Fe/src/components/News/dialogIndex.vue
  10. 2
      Code/Fe/src/components/News/index.vue
  11. 142
      Code/Fe/src/components/PanThumb/index.vue
  12. 654
      Code/Fe/src/components/StepsCountPlanForm/_index.vue
  13. 723
      Code/Fe/src/components/StepsCountPlanForm/index.vue
  14. 86
      Code/Fe/src/components/StepsCountPlanForm/style/index.scss
  15. 459
      Code/Fe/src/components/StepsForm/_index.vue
  16. 551
      Code/Fe/src/components/StepsForm/index.vue
  17. 134
      Code/Fe/src/components/StepsForm/style/index.scss
  18. 57
      Code/Fe/src/components/UploadExcel/index.vue
  19. 559
      Code/Fe/src/components/commonTabel-drawer copy/index.vue
  20. 122
      Code/Fe/src/components/commonTabel-drawer copy/style/index.scss
  21. 482
      Code/Fe/src/components/commonTabel-drawer/index.vue
  22. 15
      Code/Fe/src/components/commonTabel-drawer/style/index.scss
  23. 16
      Code/Fe/src/components/currenDescriptions/index.vue
  24. 2
      Code/Fe/src/components/currenForm/index.vue
  25. 71
      Code/Fe/src/components/filterForDetailPage/index.vue
  26. 206
      Code/Fe/src/components/handelFrom/index.vue
  27. 4
      Code/Fe/src/components/rowDrop/index.vue
  28. 11
      Code/Fe/src/components/searchOverall/index.vue
  29. 4
      Code/Fe/src/components/searchOverall/style/index.scss
  30. 52
      Code/Fe/src/components/tablePagination/index.vue
  31. 993
      Code/Fe/src/components/umyTable/index copy.vue
  32. 420
      Code/Fe/src/components/umyTable/index.vue
  33. 53
      Code/Fe/src/filters/excelOrReportsOption.js
  34. 267
      Code/Fe/src/filters/options.js
  35. 15
      Code/Fe/src/filters/status.js
  36. 4
      Code/Fe/src/filters/statusType.js
  37. 12
      Code/Fe/src/layout/components/Navbar.vue
  38. 1
      Code/Fe/src/mixins/LoadingMixins.js
  39. 29
      Code/Fe/src/mixins/TableHeaderMixins.js
  40. 281
      Code/Fe/src/mixins/TableMixins.js
  41. 2
      Code/Fe/src/mixins/drawerMixins.js
  42. 4
      Code/Fe/src/mixins/mixins.js
  43. 2
      Code/Fe/src/mixins/newAndEdiDialogMixins.js
  44. 90
      Code/Fe/src/permission - 副本.js
  45. 178
      Code/Fe/src/permission-0725.js
  46. 194
      Code/Fe/src/permission.js
  47. 193
      Code/Fe/src/router/index-0718.js
  48. 72
      Code/Fe/src/router/index.js
  49. 25
      Code/Fe/src/router/modules/baseConfig.js
  50. 25
      Code/Fe/src/router/modules/interfaceBoard.js
  51. 44
      Code/Fe/src/router/modules/systemManage.js
  52. 10
      Code/Fe/src/store/getters.js
  53. 124
      Code/Fe/src/store/modules/definition.js
  54. 163
      Code/Fe/src/store/modules/permission-0718.js
  55. 268
      Code/Fe/src/store/modules/permission.js
  56. 48
      Code/Fe/src/store/modules/user.js
  57. 1
      Code/Fe/src/utils/baseData/urlOption.js
  58. 4
      Code/Fe/src/utils/defaultButtons.js
  59. 9
      Code/Fe/src/utils/detailsPageColumns_api/index.js
  60. 11
      Code/Fe/src/utils/detailsTableColumns_api/index.js
  61. 29
      Code/Fe/src/utils/index.js
  62. 10
      Code/Fe/src/utils/tableColumns_api/index.js
  63. 10
      Code/Fe/src/utils/tabsDesTions_api/index.js
  64. 4
      Code/Fe/src/utils/utils.js
  65. 16
      Code/Fe/src/views/basicConfig/ExportCustomUserSetting.vue
  66. 221
      Code/Fe/src/views/dashboard/index copy.vue
  67. 207
      Code/Fe/src/views/dashboard/index.vue
  68. 196
      Code/Fe/src/views/demo/demo_base_handle.vue
  69. 46
      Code/Fe/src/views/demo/demo_mst_det.vue
  70. 79
      Code/Fe/src/views/demo/demo_read.vue
  71. 466
      Code/Fe/src/views/interfaceBoard/TestSchool_all.vue
  72. 33
      Code/Fe/src/views/login/index.vue
  73. 25
      Code/Fe/src/views/menuList/TestSchool.vue
  74. 2
      Code/Fe/src/views/profileuser/index.vue
  75. 2
      Code/Fe/src/views/profileuser/resetPwd.vue

2
Code/Fe/README.md

@ -46,7 +46,7 @@ alertoldSkipCount 主列表-分页-当前页条数
alterResultCount 主列表-分页-每页最大页数
handleSelectionChange 主列表-选择-行数据方法 tablePagination ==> currenTable
<----20230207添加 begin---->
buttonOperationClick 主列表-操作列按钮点击事件
buttonOperationClick_left 主列表-操作列按钮点击事件
currentPageProps 主列表-当前页码值
使用的是@/mixins/TableMixins的oldSkipCount值
quicklySearchOption 主表查询-快速搜索数据配置 ==> 通用配置在@/utils/quicklySearchOption/index

31
Code/Fe/public/config.js

@ -1,35 +1,8 @@
// dev_win
window.SITE_CONFIG['base'] = 'http://dev.ccwin-in.com:60069'
window.SITE_CONFIG['columnsApiNames'] = '/api/abp/application-localization'
// window.SITE_CONFIG['columnsApiNames'] = '/api/abp/application-configuration'
window.SITE_CONFIG['columnsApiNamesZh'] = 'Winin'
window.SITE_CONFIG['isAutoLogin'] = false
window.SITE_CONFIG['isAutoLogin'] = true
window.SITE_CONFIG['isSinglePage'] = false
window.SITE_CONFIG['userNameOrEmailAddress'] = 'admin'
window.SITE_CONFIG['client_secret'] = '1q2w3E*'
// window.SITE_CONFIG['user'] = 'http://dev.ccwin-in.com:60069/api'
// // window.SITE_CONFIG['print'] = 'print'21384
// window.SITE_CONFIG['print'] = 'http://dev.ccwin-in.com:60074'
// window.SITE_CONFIG['largeScreen'] = 'http://dev.ccwin-in.com:60073'
// window.SITE_CONFIG['warehouseCode'] = 'T8'
// window.SITE_CONFIG['company'] = 'DongYang'
// window.SITE_CONFIG['client_secret'] = '1q2w3E*'
// window.SITE_CONFIG['reportsUrl'] = 'http://dev.ccwin-in.com:60074/#/reports/'
// window.SITE_CONFIG['versionUrl'] = 'http://dev.ccwin-in.com:60070'
// window.SITE_CONFIG['companyName'] = '长春一汽富维东阳汽车塑料零部件(安徽)有限公司'
// 接口看板地址
// window.SITE_CONFIG['interfaceBoardUrl'] = 'http://dev.ccwin-in.com:60090/'
// window.SITE_CONFIG['interfaceBoardUrl'] = 'http://dev.ccwin-in.com:60069/'
// 接口看板表头获取地址
// window.SITE_CONFIG['interfaceBoardColumnsApi'] = 'api/abp/application-configuration'
// mock
// window.SITE_CONFIG['apifoxToken'] = 'NXHNi5mp0dnUHGt0wkCrjvfcidsFKV33'
// window.SITE_CONFIG['base'] = 'https://mock.apifox.cn/m1/1773588-0-default'
// window.SITE_CONFIG['user'] = 'http://dev.ccwin-in.com:60099/api/auth'
// window.SITE_CONFIG['print'] = 'print'
// window.SITE_CONFIG['largeScreen'] = 'http://dev.ccwin-in.com:60073'
// window.SITE_CONFIG['warehouseCode'] = 'T8'
// window.SITE_CONFIG['company'] = 'DongYang'
// window.SITE_CONFIG['client_secret'] = '1q2w3E*'
// window.SITE_CONFIG['reportsUrl'] = 'http://10.164.0.227:59091/#/reports/'
window.SITE_CONFIG['menuHiddenConfig'] = ['AsnDet','PoDet','ReceiptDet','ReturnDet','SodDet']

10
Code/Fe/src/App.vue

@ -9,12 +9,20 @@ export default {
name: 'App'
}
localStorage.setItem('base',window.SITE_CONFIG['base'])
localStorage.setItem('columnsApiNames',window.SITE_CONFIG['columnsApiNames'])
localStorage.setItem('columnsApiNamesZh',window.SITE_CONFIG['columnsApiNamesZh'])
localStorage.setItem('isAutoLogin',window.SITE_CONFIG['isAutoLogin'])
localStorage.setItem('isSinglePage',window.SITE_CONFIG['isSinglePage'])
localStorage.setItem('userNameOrEmailAddress',window.SITE_CONFIG['userNameOrEmailAddress'])
localStorage.setItem('client_secret',window.SITE_CONFIG['client_secret'])
localStorage.setItem('menuHiddenConfig',window.SITE_CONFIG['menuHiddenConfig'])
//
const language_brow = (navigator.language || navigator.browserLanguage)
console.log(21,language_brow)
if(language_brow.indexOf('zh') >= 0){
localStorage.setItem('browserLanguage','zh-Hans')
}else{
localStorage.setItem('browserLanguage','en')
}
// localStorage.setItem('user',window.SITE_CONFIG['user'])
// localStorage.setItem('print',window.SITE_CONFIG['print'])
// localStorage.setItem('warehouseCode',window.SITE_CONFIG['warehouseCode'])

366
Code/Fe/src/api/wms-api.js

@ -12,7 +12,7 @@ export function postCreate(data, url) {
data.warehouseCode = localStorage.getItem('warehouseCode')
}
if(Object.keys(data).includes('worker')) {
data.worker = store.getters.name.userName
data.worker = store.getters.currentUserInfo.userName
}
return request({
url: baseURL + url,
@ -162,81 +162,6 @@ export function postImportDown(url) {
})
}
//开始计划 | 盘点计划
export function planHandle(id, url, data) {
return request({
url: baseURL + url + '/handle/' + id,
method: 'post',
params: data
})
}
// 取消计划(生产计划为关闭) | 盘点计划
export function postCancel(id, url) {
return request({
url: baseURL + url + '/cancel/' + id,
method: 'post'
})
}
// 中止 | 盘点计划
export function postAbort(id, url) {
return request({
url: baseURL + url + '/abort/' + id,
method: 'post'
})
}
//完成 | 盘点计划
export function postComplete(id,data,url) {
return request({
url: baseURL + url + '/complete-by-type/' + id,
method: 'post',
params:data
})
}
//阶段 - 校正库存 | 盘点计划
export function ChangeStage(data, url) {
return request({
url: baseURL + url + '/change-stage',
method: 'post',
params:data
})
}
//拆分 | 盘点计划
export function postCreateWithCondition(data, url) {
if (Object.keys(data).includes('company')) {
data.company = localStorage.getItem('company')
}
if (Object.keys(data).includes('warehouseCode')) {
data.warehouseCode =localStorage.getItem('warehouseCode')
}
return request({
url: baseURL + url + '/create-with-condition',
method: 'post',
data
})
}
//更新可用容量
export function postUpdateAvailableCapacity(data, url) {
return request({
url: baseURL + url + '/recalculate',
method: 'post',
params: data
})
}
// 执行调整 | 盘点调整申请
// export function ExecuteAdjusted(id) {
// return request({
// url: baseURL + 'wms/store/count-adjust-note/ExecuteAdjusted/' + id,
// method: 'post',
// })
// }
// 生成盘点调整申请 | 盘点记录
export function StartAdjust(id) {
return request({
// url: baseURL + 'wms/store/count-note/StartAdjust/' + id,
url: baseURL + 'wms/store/count-note/'+ id +'/generate-adjust-request',
method: 'post'
})
}
//---------------------------通用---------------------------
//获取详情
@ -246,14 +171,6 @@ export function getDetailed(id, url) {
method: 'get',
})
}
//获取子表详情
export function getDetailedSon(id, UrlData, url) {
return request({
url: baseURL + url + '/detail/' + id,
method: 'get',
params: UrlData
})
}
//---------------------------只查询-------------------------
//获取分页+筛选
export function getPage(data, url) {
@ -284,112 +201,6 @@ export function PrintServices(data) {
data
})
}
// 修改库存余额过期日期 | 库存余额
export function updateExpireDate(data, url) {
return request({
url: baseURL + url + '/update/expire-date',
method: 'post',
params: data
})
}
// 详情tabs页 通过code 获取列表
export function getListByItemcode(data, url ){
return request({
url: baseURL + url + '/get-list-by-itemcode',
method: 'get',
params: data
})
}
// 详情tabs页 通过code 获取列表
export function byItem(itemCode, url ){
return request({
url: baseURL + url + '/list/by-item/' + itemCode,
method: 'get'
})
}
// 详情tabs页 通过父物品号 获取列表
export function byProduct(product, url ){
return request({
url: baseURL + url + '/get-list-by-product',
method: 'get',
params: product
})
}
// 详情tabs页 通过子物品号 获取列表
export function byComponent(component, url ){
return request({
url: baseURL + url + '/get-list-by-component',
method: 'get',
params: component
})
}
// 详情tabs页 通过供应商 获取列表
export function bySupplierCode(supplierCode, url ){
return request({
url: baseURL + url + '/get-list-by-supplier-code',
method: 'get',
params: supplierCode
})
}
// 详情tabs页 通过库位 获取列表
export function byLocation(locationCode, url ){
return request({
url: baseURL + url + '/list/by-location/' + locationCode,
method: 'get',
})
}
// 详情tabs页 通过库位 获取列表
export function byLocationCode(locationCode, url ){
return request({
url: baseURL + url + '/get-by-location-code',
method: 'get',
params: locationCode
})
}
// 详情tabs页 通过库位-零件关系 获取列表
export function relationByLocationCode(locationCode, url ){
return request({
url: baseURL + url + '/by-location',
method: 'get',
params: locationCode
})
}
// 详情tabs页 通过子物品号 获取子层级列表
export function byComponentCJ(component, url ){
return request({
url: baseURL + url + '/get-list-by-component-with-tree',
method: 'get',
params: component
})
}
//消息管理——用户消息类型关系——获取用户已有消息类型
export function messageTypeSubscribe(id) {
return request({
url: baseURL + 'message/message-type-subscribe/list/' + id,
method: 'get',
// params:id
})
}
//消息管理——用户消息类型关系——保存用户与消息类型关系
export function messageTypeSubscribeCreateMany(data,id) {
return request({
url: baseURL + 'message/message-type-subscribe/create-many',
method: 'post',
params:id,
data
})
}
//首页——获取当前用户未读消息
export function userNotifyNotReadList(userId) {
@ -424,164 +235,6 @@ export function notifyMessage(params, id) {
})
}
// 库存-启用 | 库存余额
// export function inventoryBalanceActive(id) {
// return request({
// url: baseURL + 'wms/inventory/inventory-balance/active?id=' + id,
// method: 'post',
// })
// }
// 库存列表
export function inventoryBalanceList(data) {
return request({
url: baseURL + 'wms/inventory/Inventory-Balance/list',
method: 'post',
data
})
}
// 库存-启用 | 库存余额 改
export function inventoryBalanceActive(params) {
return request({
url: baseURL + 'wms/inventory/inventory-balance/' + params.id + '/active',
method: 'post',
params: params,
})
}
//库移——查询 | 库存转移日志
export function byBalancesRequestManyParameter(data) {
return request({
url: baseURL + 'wms/inventory/inventory-balance/by-balances-request-many-parameter',
method: 'post',
data
})
}
//库移——提交 | 库存转移日志
export function inventoryTransferNote(data) {
return request({
url: baseURL + 'wms/store/inventory-transfer-note',
method: 'post',
data
})
}
//库存管理——已占用库存——删除
//库存管理——预填充库存——删除
export function remove(id, url) {
return request({
url: baseURL + url + '/remove/' + id,
method: 'post',
params: id
})
}
//发料任务——新增 | 自动发料任务 | 人工发料任务
export function createAndHandle(data) {
return request({
url: baseURL + 'wms/store/material-request/create-and-handle',
method: 'post',
data
})
}
// 人工叫料申请 | 人工发料任务 | 人工发料记录 | 自动叫料申请 | 自动发料任务 | 自动发料记录 | 直接发料记录
// 完工收货缴库申请 | 线边仓缴库申请 | 线边仓缴库记录 | 线边仓报废申请 | 线边仓报废记录 | 原料报废记录
export function materialRequestByType(data, url, params) {
let _type = params.type?params.type:params.requestType
return request({
url: baseURL + url + '/' + _type,
method: 'post',
params: params,
data
})
}
// 采购收货——供应商发货通知——导入——确定(【批量创建】供应商发货通知)
export function supplierAsnCreateMany(data) {
return request({
url: baseURL + 'wms/store/supplier-asn/create-many',
method: 'post',
data
})
}
// 调拨作废
// export function transferRequestCancel(url, data ) {
// return request({
// url: baseURL + url + '/cancel/' + data.id,
// method: 'post',
// params: data
// })
// }
// 打印之后调用 记录打印次数 | 原料直发客户记录
export function sumPrint(number, url ) {
return request({
url: baseURL + url + '/sum-print/' + number,
method: 'post'
})
}
// 线边仓调拨列表 | 上架前退货记录 | 采购上架记录 | 半成品上架记录 | 原料直发
export function getPageListWip(data, url) {
return request({
url: baseURL + url,
method: 'post',
data
})
}
// 线边仓调拨确认按钮 | 客户调拨确认按钮 | 自动发料记录
export function confirm(id, url) {
return request({
url: baseURL + url + '/confirm/' + id,
method: 'post',
})
}
// 采购收货记录-详情页TAB-不合格品收货明细/合格品收货明细/收货缺料明细
export function purRecNoteCustomInfo( url,id ){
return request({
url: baseURL + 'wms/store/purchase-receipt-note/' + url + id,
method: 'get',
})
}
// 质检-不合格转合格
export function convertOk(data) {
return request({
url: baseURL + 'wms/store/no-ok-convert-ok-notes',
method: 'post',
data
})
}
// 获取全部供应商(codes)| 上架前退货记录 | 上架后退货记录 | 采购上架记录
export function allSupplierByCodes(data) {
return request({
url: baseURL + 'basedata/supplier/by-codes',
method: 'post',
data
})
}
// 根据code获取当前供应商信息 打印需要获取供应商信息(供应商简称等)相关位置
export function getOneSupplierInfoByCode(code) {
return request({
url: baseURL + 'basedata/supplier/by-code/' + code,
method: 'get'
})
}
// 根据code获取当前客户信息 打印需要获取供应商信息(客户地址等)相关位置
export function getOneCustomerInfoByCode(code) {
return request({
url: baseURL + 'basedata/customer/by-code/' + code,
method: 'get'
})
}
// 获取版本编号
export function getVsersion() {
return request({
@ -589,20 +242,3 @@ export function getVsersion() {
method: 'get'
})
}
// 安全库存预警
export function getListPageSafety(data, url) {
return request({
url: baseURL + url,
method: 'post',
data
})
}
// 根据编号获取字典信息
// export function getDictByCode(code) {
// return request({
// url: baseURL + 'basedata/dict/by-code/' + code,
// method: 'get',
// })
// }

58
Code/Fe/src/api/wms-auth.js

@ -1,6 +1,5 @@
import request from '@/utils/request'
let baseURL = localStorage.getItem('base') + '/api'
import axios from 'axios'
export function login(data) {
return request({
@ -10,13 +9,6 @@ export function login(data) {
})
}
export function getUsersByUserName(name) {
return request({
url: baseURL + '/identity/users/by-username/'+name,
method: 'get',
})
}
export function token(data) {
return request({
// url: baseURL + '/token',
@ -39,15 +31,6 @@ export function logout() {
})
}
//获取PC菜单
export function getWebMenu(params) {
return request({
url: baseURL + '/auth/user-menu/web-menu/' + params.userId,
method: 'get',
params: params
})
}
//新建
export function postCreate(data) {
return request({
@ -228,39 +211,6 @@ export function getDetailed(id, url) {
})
}
//新建 | 部门信息维护
export function authCreate(data, url) {
if (Object.keys(data).includes('company')) {
data.company = localStorage.getItem('company')
}
if (Object.keys(data).includes('warehouseCode')) {
data.warehouseCode = localStorage.getItem('warehouseCode')
}
if(Object.keys(data).includes('worker')) {
data.worker = store.getters.name.userName
}
return request({
url: baseURL + '/' + url,
method: 'post',
data
})
}
//编辑 | 部门信息维护
export function authUpdate(data, id, url) {
return request({
url: baseURL + '/' + url + '/' + id,
method: 'put',
data
})
}
//删除 | 部门信息维护
export function authDelete(id, url) {
return request({
url: baseURL + '/' + url + '/' + id,
method: 'delete',
})
}
//-------------------------------------
// 创建 | PC角色权限维护
export function postCreateRoles(data) {
@ -318,3 +268,11 @@ export function putpermissionsRoles(url, data) {
data
})
}
// faster-new
export function getUsersByUserName(name) {
return request({
url: baseURL + '/identity/users/by-username/'+name,
method: 'get',
})
}

56
Code/Fe/src/api/wms-core.js

@ -1,56 +0,0 @@
import request from '@/utils/request'
// let baseURL = localStorage.getItem('print') + '/api/'
let baseURL = localStorage.getItem('base') + '/api/'
// 根据箱码获取标签相关信息 | 补打标签
export function getOneInventoryLabelByCode(code) {
return request({
url: baseURL + 'label/inventory-label/by-code/' + code,
method: 'get'
})
}
// 批量获取箱标签信息 | 到货请求
export function getInventoryLabelByCodes(data) {
return request({
url: baseURL + 'label/inventory-label/by-codes',
method: 'post',
data
})
}
//生产、采购生成标签(批量)| 标签管理模块
export function postInventoryLabelCode(data) {
return request({
url: baseURL + 'label/Inventory-label/generate-and-create/many',
method: 'post',
data
})
}
//生产、采购生成标签(一次多个)| 标签管理模块
export function postInventoryLabelCode_count(params,data) {
return request({
url: baseURL + 'label/inventory-label/generate-and-create/many/'+params.count,
method: 'post',
data
})
}
// 拆箱 | 标签管理-拆分箱标签
export function postSplitPacking(data) {
return request({
url: baseURL + 'wms/store/transfer-note/split-packing',
method: 'post',
data
})
}
// 拆箱记录列表
export function splitPackingList(data) {
return request({
url: baseURL + 'wms/store/transfer-note/get-split-packing-list',
method: 'post',
data
})
}

28
Code/Fe/src/api/wms-interface.js

@ -1,18 +1,38 @@
// 接口监控看板相关api
import request from '@/utils/request'
let base_api = localStorage.getItem('base')
let colum_url = localStorage.getItem('columnsApiNames')
// 获取表头数据
// 获取表头zh转义数据
export function getInterfaceBoard() {
return request({
method:'get',
url: base_api + colum_url,
params:{CultureName:'zh-Hans'}
url: base_api + '/api/abp/application-localization',
params:{
CultureName:localStorage.getItem('browserLanguage'),
OnlyDynamics:false
}
// params:{IncludeLocalizationResources:true}
})
}
// 获取菜单数据
export function getDefinitionMenu(IncludeTypes) {
return request({
method:'get',
url: base_api + '/api/abp/application-configuration',
params:{IncludeLocalizationResources:true}
})
}
// 获取枚举数据/dto列类型等所有配置
export async function getApiDefinition() {
return request({
method:'get',
url: base_api + '/api/abp/api-definition',
params:{IncludeTypes:true}
})
}
// // 测试数据-明细-删除
// export function TestSchoolDetailList_delete(id) {
// return request({

190
Code/Fe/src/api/wms-job.js

@ -1,24 +1,8 @@
import request from '@/utils/request'
// let baseURL = process.env.VUE_APP_BASE_API + '/'
let baseURL = localStorage.getItem('base') + '/api/'
//分页+筛选
export function getPageList(data, url) {
return request({
url: baseURL + url + '/list',
method: 'post',
data
})
}
//分页+筛选
export function getPage(data, url) {
return request({
url: baseURL + url + '/count',
method: 'post',
data
})
}
//---------------------------通用---------------------------
//---------------------------通用---------------------------
//任务流程——承接
export function accept(url, data) {
return request({
@ -55,16 +39,6 @@ export function cancelAccept(url, data) {
})
}
//任务流程——执行
export function handle(data, params, url) {
return request({
url: baseURL + url + '/handle/'+params.id,
method: 'post',
// params: params,
data
})
}
//任务流程——打开
export function open(url, data) {
return request({
@ -73,165 +47,3 @@ export function open(url, data) {
// params: data
})
}
//获取详情
export function getDetailed(id, url) {
return request({
url: baseURL + url + '/' + id,
method: 'get',
})
}
//获取子表详情
export function getDetailedSon(id, UrlData, url) {
return request({
url: baseURL + url + '/detail/' + id,
method: 'get',
params: UrlData
})
}
//收货任务-执行 - 目检
export function visualInspection( params,data) {
return request({
url: baseURL + 'wms/job/purchase-receipt-job/save-detail-inspect/' + params.id,
method: 'post',
data
})
}
// 收货任务-执行-待处理全部转合格
export function AllPendingToQualified( id,params) {
return request({
// url: baseURL + 'wms/job/purchase-receipt-job/set-inspect-status-with-not-inspect/' + id,
url: baseURL + 'wms/job/purchase-receipt-job/set-inspect-status-ok-by-inspect/' + id,
method: 'post',
params: params,
})
}
// 收货任务-执行-重置目检状态
export function resetSelectToInspect( id,data) {
return request({
url: baseURL + 'wms/job/purchase-receipt-job/reset-many-detail-inspect/' + id,
method: 'post',
data: data,
})
}
//作废任务
export function Invalid(url, id) {
return request({
url: baseURL + url + '/invalid',
method: 'post',
params: id,
})
}
//检查任务
export function Check(url, id, data) {
return request({
url: baseURL + url + '/check',
method: 'post',
params: id,
data
})
}
//上架任务——执行
export function HandleJob(data, id, url) {
return request({
url: baseURL + url + '/handle-job',
method: 'post',
params: id,
data
})
}
//质检执行任务
export function InspectJobHandle(data, params, url) {
return request({
url: baseURL + url + '/handle',
method: 'post',
params: params,
data
})
}
// //发料任务——执行
// export function issueJobHandle(data, params, url) {
// return request({
// url: baseURL + url + '/handle',
// method: 'post',
// params: params,
// data
// })
// }
//人工发料任务 | 自动发料任务
export function materialRequestByType(data, url, params,includeDetails) {
let _type = params.type?params.type:params.requestType
return request({
url: baseURL + url + '/' + _type + '?includeDetails=' + (includeDetails || false),
method: 'post',
params: params,
data
})
}
//生产计划——更新备料计划
export function productionPlanUpdate(data, detailId, id) {
return request({
url: baseURL + 'wms/store/preparation-plan/details/' + id,
method: 'put',
params: detailId,
data
})
}
//生产计划——生产备料计划后查询乐观锁
export function preparationPlanByNumber(params) {
return request({
url: baseURL + 'wms/store/preparation-plan/by-number',
method: 'get',
params: params,
})
}
//质检——完成质检
export function completeSummaryDetailStatus(params, data) {
return request({
url: baseURL + 'wms/store/inspect-job/complete-summary-detail-status/' + params.id,
method: 'post',
params: params,
data
})
}
//质检——设置默认状态(清除质检)
export function setDetailDefaultOkStatus(params, id, data) {
return request({
url: baseURL + 'wms/store/inspect-job/set-detail-default-ok-status/' + id,
method: 'post',
params: params,
data
})
}
//质检——设置详情为合格
export function setDetailOkStatus(params, id, data) {
return request({
url: baseURL + 'wms/store/inspect-job/set-detail-ok-status/' + id,
method: 'post',
params: params,
data
})
}
//质检——设置详情为不合格
export function setDetailNookStatus(params, id, data) {
return request({
url: baseURL + 'wms/store/inspect-job/set-detail-nook-status/' + id,
method: 'post',
params: params,
data
})
}

2
Code/Fe/src/components/News/dialogIndex.vue

@ -172,7 +172,7 @@ export default {
}
},
mounted () {
this.userId = this.$store.getters.name.id
this.userId = this.$store.getters.currentUserInfo.id
// todo-new:
// this.getList()
},

2
Code/Fe/src/components/News/index.vue

@ -25,7 +25,7 @@ export default {
dialogIndex
},
mounted () {
this.userId = this.$store.getters.name.id
this.userId = this.$store.getters.currentUserInfo.id
this.getNoReadCount(this.userId)
this.getSetInterval()
//

142
Code/Fe/src/components/PanThumb/index.vue

@ -1,142 +0,0 @@
<template>
<div :style="{zIndex:zIndex,height:height,width:width}" class="pan-item">
<div class="pan-info">
<div class="pan-info-roles-container">
<slot />
</div>
</div>
<!-- eslint-disable-next-line -->
<div :style="{backgroundImage: `url(${image})`}" class="pan-thumb"></div>
</div>
</template>
<script>
export default {
name: 'PanThumb',
props: {
image: {
type: String,
required: true
},
zIndex: {
type: Number,
default: 1
},
width: {
type: String,
default: '150px'
},
height: {
type: String,
default: '150px'
}
}
}
</script>
<style scoped>
.pan-item {
width: 200px;
height: 200px;
border-radius: 50%;
display: inline-block;
position: relative;
cursor: default;
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}
.pan-info-roles-container {
padding: 20px;
text-align: center;
}
.pan-thumb {
width: 100%;
height: 100%;
background-position: center center;
background-size: cover;
border-radius: 50%;
overflow: hidden;
position: absolute;
transform-origin: 95% 40%;
transition: all 0.3s ease-in-out;
}
/* .pan-thumb:after {
content: '';
width: 8px;
height: 8px;
position: absolute;
border-radius: 50%;
top: 40%;
left: 95%;
margin: -4px 0 0 -4px;
background: radial-gradient(ellipse at center, rgba(14, 14, 14, 1) 0%, rgba(125, 126, 125, 1) 100%);
box-shadow: 0 0 1px rgba(255, 255, 255, 0.9);
} */
.pan-info {
position: absolute;
width: inherit;
height: inherit;
border-radius: 50%;
overflow: hidden;
box-shadow: inset 0 0 0 5px rgba(0, 0, 0, 0.05);
}
.pan-info h3 {
color: #fff;
text-transform: uppercase;
position: relative;
letter-spacing: 2px;
font-size: 18px;
margin: 0 60px;
padding: 22px 0 0 0;
height: 85px;
font-family: 'Open Sans', Arial, sans-serif;
text-shadow: 0 0 1px #fff, 0 1px 2px rgba(0, 0, 0, 0.3);
}
.pan-info p {
color: #fff;
padding: 10px 5px;
font-style: italic;
margin: 0 30px;
font-size: 12px;
border-top: 1px solid rgba(255, 255, 255, 0.5);
}
.pan-info p a {
display: block;
color: #333;
width: 80px;
height: 80px;
background: rgba(255, 255, 255, 0.3);
border-radius: 50%;
color: #fff;
font-style: normal;
font-weight: 700;
text-transform: uppercase;
font-size: 9px;
letter-spacing: 1px;
padding-top: 24px;
margin: 7px auto 0;
font-family: 'Open Sans', Arial, sans-serif;
opacity: 0;
transition: transform 0.3s ease-in-out 0.2s, opacity 0.3s ease-in-out 0.2s, background 0.2s linear 0s;
transform: translateX(60px) rotate(90deg);
}
.pan-info p a:hover {
background: rgba(255, 255, 255, 0.5);
}
.pan-item:hover .pan-thumb {
transform: rotate(-110deg);
}
.pan-item:hover .pan-info p a {
opacity: 1;
transform: translateX(0px) rotate(0deg);
}
</style>

654
Code/Fe/src/components/StepsCountPlanForm/_index.vue

@ -1,654 +0,0 @@
<template>
<el-dialog
:title="formTitle"
v-if="displayDialog.newDialog"
:visible="true"
:fullscreen="true"
:append-to-body="false"
:modal="false"
:modal-append-to-body="false"
:show-close="false"
>
<div id="stepsForm">
<el-steps
:active="active"
process-status="finish"
finish-status="success"
:align-center="true"
>
<el-step
v-for="(item, index) in stepFilters"
:key="index"
:title="item"
></el-step>
</el-steps>
<!-- "总体信息" -->
<curren-Form
v-if="active == 0"
class="page1"
size="medium"
ref="page1"
:searchData="CreateFormData"
:searchForm="CreateForm"
:searchOptions="Options"
:searchHandle="editHandle"
:rules="Rules"
:loading="loading"
@push="DataPush(arguments)"
@submitForm="editFormClick(arguments)"
>
</curren-Form>
<!-- "物品参数" -->
<searchPage
ref="searchTable"
:tableLoading="tableLoading"
:advancedFilter="advancedFilter(
'basedata/item-basic',
pageListItemBasic,
'totalCountItemBasic',
'itemBasicData',
oldSkipCountItemBasic
)"
:filterPageListParams="[]"
:formTitle="''"
:displayDialog="active == 1"
:selectionTable="false"
:editHandle="editHandle"
:searchTableData="locationData"
:searchTableColumns="$isTableColumns.Location"
:searchTotalCount="totalCountLocation"
:supplierItemPage="pageListLocation"
@SizeChange="AddNewAlterResultCount(
$event,
'basedata/item-basic',
pageListItemBasic,
'totalCountItemBasic',
'itemBasicData',
oldSkipCountItemBasic
)"
@CurrentChange="AddNewAlertoldSkipCount(
$event,
'basedata/item-basic',
pageListItemBasic,
'totalCountItemBasic',
'itemBasicData',
oldSkipCountItemBasic
)"
@tableButtonClick="addFormData(arguments)"
></searchPage>
<!-- "库位参数" -->
<searchPage
ref="searchTable"
:tableLoading="tableLoading"
:advancedFilter="advancedFilter(
'basedata/location',
pageListLocation,
'totalCountLocation',
'locationData',
oldSkipCountLocation
)"
:filterPageListParams="[]"
:formTitle="''"
:displayDialog="active == 2"
:selectionTable="false"
:editHandle="editHandle"
:searchTableData="locationData"
:searchTableColumns="$isTableColumns.Location"
:searchTotalCount="totalCountLocation"
:supplierItemPage="pageListLocation"
@SizeChange="AddNewAlterResultCount(
$event,
'basedata/location',
pageListLocation,
'totalCountLocation',
'locationData',
oldSkipCountLocation
)"
@CurrentChange="AddNewAlertoldSkipCount(
$event,
'basedata/location',
pageListLocation,
'totalCountLocation',
'locationData',
oldSkipCountLocation
)"
@tableButtonClick="addFormData(arguments)"
></searchPage>
<!-- "其他参数" -->
<curren-Form
v-loading="loading"
v-if="active == 3"
class="page1"
size="medium"
ref="page1"
:searchData="other"
:searchForm="otherForm"
:searchOptions="Options"
:searchHandle="editHandle"
:rules="Rules"
:loading="loading"
@push="DataPush(arguments)"
@submitForm="editFormClick(arguments)"
>
</curren-Form>
<!-- <curren-Form
v-if="active === 4"
size="medium"
class="page3"
:searchData="previewFormData"
:searchForm="CreateForm | formData"
:searchHandle="editHandle"
:rules="Rules"
:loading="loading"
@submitForm="editFormClick(arguments)"
>
<template>
<el-form-item class="formTable-box" prop="details">
<currenTable
:tableData="previewFormData.details"
:tableColumns="detailsTableColumns | formDataDetails"
:selectionTable="false"
>
</currenTable>
</el-form-item>
</template>
</curren-Form> -->
<!-- "结果" -->
<div
v-if="active === step.length - 1 && pageStatus === 'success'"
class="page4"
>
<el-result icon="success" title="成功提示" subTitle="新增成功">
<template slot="extra">
<!-- <el-button type="primary" size="medium" @click="tuoFormPrint"
>打印托标签</el-button
>
<el-button type="primary" size="medium" @click="xbqFormPrint"
>打印箱标签</el-button
> -->
<el-button
v-for="item in successHandle"
:key="item.label"
:type="item.type"
size="medium"
@click="item.click()"
>{{ item.label }}</el-button
>
<el-button type="primary" size="medium" @click="close(1)"
>退出</el-button
>
</template>
</el-result>
</div>
<div
v-if="active === step.length - 1 && pageStatus === 'error'"
class="page4"
>
<el-result icon="error" title="错误提示" subTitle="新增失败">
<template slot="extra">
<el-button type="primary" size="medium" @click="close(1)"
>退出</el-button
>
</template>
</el-result>
</div>
</div>
</el-dialog>
</template>
<script>
import currenForm from "@/components/currenForm";
import currenTable from "@/components/currenTable";
import {
getPageList,
postCreateWithCondition,
postCreate,
} from "@/api/wms-api";
export default {
name: "stepsForm",
components: {
currenForm,
currenTable,
},
watch: {
active(val) {
if (val != 0) {
this.editHandle[0].label = "上一步";
} else {
this.editHandle[0].label = "取消";
}
},
},
filters: {
formData(val) {
let data = JSON.parse(JSON.stringify(val));
val.forEach((key, index) => {
data[index].disabled = "true";
delete data[index].focus;
if (key.type == "autocomplete" || key.type == "import") {
data[index].type = "input";
}
});
return data;
},
formDataDetails(val) {
let data = JSON.parse(JSON.stringify(val));
val.forEach((key, index) => {
data[index].disabled = "true";
delete data[index].focus;
delete data[index].rules;
if (key.type == "autocomplete" || key.type == "import") {
data[index].type = "input";
} else if (key.type == "objectAutocomplete") {
data[index].type = "objectInput";
} else if (key.prop == "containerCode") data[index].disabled = "false";
});
return data;
},
},
props: {
//
formTitle: {
type: String,
default: "",
},
//
displayDialog: {
type: Object,
default: () => {
return {
newDialog: false,
};
},
},
//
CreateFormData: {
type: Object,
default: () => {
return {};
},
},
//form
CreateForm: {
type: Array,
default: () => {
return [];
},
},
//
// previewFormData: {
// type: Object,
// default: () => {
// return {}
// }
// },
//
Rules: {
type: Object,
default: () => {
return {};
},
},
//
Options: {
type: Object,
default: () => {
return {};
},
},
//table
detailsTableColumns: {
type: Array,
default: () => {
return [];
},
},
//
childTableData: {
type: Array,
default: () => {
return [];
},
},
//
successHandle: {
type: Array,
default: () => {
return [];
},
},
},
computed: {
stepFilters() {
let stepFilters = [];
const routeName = this.$route.meta.title;
this.step.forEach((key) => {
stepFilters.push(routeName.concat(key));
});
return stepFilters;
},
// autoAdvanced () {
// if (this.active == 1) {
// return this.advancedFilter(
// 'item-basic',
// this.pageListItemBasic,
// 'totalCountItemBasic',
// 'itemBasicData',
// this.oldSkipCountItemBasic
// )
// } else if (this.active == 2) {
// return this.advancedFilter(
// 'location',
// this.pageListLocation,
// 'totalCountLocation',
// 'locationData',
// this.oldSkipCountLocation
// )
// }
// },
},
data() {
return {
active: 0,
formReveal: 1,
pageStatus: "",
filterListParams: [],
itemBasicData: [],
isItemBasicData: [],
previewFormData: [],
totalCountItemBasic: 0,
oldSkipCountItemBasic: 1,
pageListItemBasic: {
condition: {
filters: [],
},
Sorting: "",
SkipCount: 0,
MaxResultCount: 100,
},
locationData: [],
isLocationData: [],
totalCountLocation: 0,
oldSkipCountLocation: 1,
pageListLocation: {
condition: {
filters: [],
},
Sorting: "",
SkipCount: 0,
MaxResultCount: 100,
},
other: {
otherParam: [],
},
otherForm: [
{
label: "状态",
prop: "otherParam",
type: "checkbox",
indeterminate:"true",
checkboxs: "radios",
},
],
otherFormData: {
countMethod: 0,
// type: 0,//
company: null,
description: null,
// beginTime: null,
// endTime: null,
planTime: null,
partCondition: {},
locCondition: {},
statusList: [],
worker: null,
warehouseCode: null,
remark: null,
},
loading: false,
tableLoading: false,
session: null,
step: ["总体信息", "物品参数", "库位参数", "其他参数", "结果"],
editHandle: [
{ label: "取消", name: "cancel" },
{ label: "下一步", type: "primary", name: "determine" },
],
};
},
mounted() {
this.session = JSON.parse(JSON.stringify(this.CreateFormData));
},
methods: {
//退
close(val) {
this.active = 0;
const filter ={
condition: {
filters: [],
},
Sorting: "",
SkipCount: 0,
MaxResultCount: 100,
}
this.pageListItemBasic = JSON.parse(JSON.stringify(filter))
this.pageListLocation = JSON.parse(JSON.stringify(filter))
const data = JSON.parse(JSON.stringify(this.session));
this.itemBasicData = []
this.locationData = []
this.$emit("close", data, val);
},
//autoComplete
DataPush(val) {
this.$emit("DataPush", val);
},
//autoComplete
detailsDataPush(val) {
this.$emit("detailsDataPush", val);
},
//
advancedFilter(url, list, TotalCount, data, oldSkipCount) {
return () => {
list.SkipCount = (oldSkipCount - 1) * list.MaxResultCount;
this.tableLoading = true;
getPageList(list, url)
.then((res) => {
this[data] = res.items;
this[TotalCount] = res.totalCount;
this.tableLoading = false;
})
.catch(() => {
this.tableLoading = false;
});
};
},
//(emit)
AddNewAlterResultCount(val, url, list, TotalCount, data, oldSkipCount) {
list.MaxResultCount = val;
const Function = this.advancedFilter(
url,
list,
TotalCount,
data,
oldSkipCount
);
Function();
},
//(emit)
AddNewAlertoldSkipCount(val, url, list, TotalCount, data, oldSkipCount) {
oldSkipCount = val;
const Function = this.advancedFilter(
url,
list,
TotalCount,
data,
oldSkipCount
);
Function();
},
//
tuoFormPrint() {
this.$emit("tuoFormPrint");
},
//
xbqFormPrint() {
this.$emit("xbqFormPrint");
},
// //
// addNew (url, list, TotalCount, data, MaxResultItem) {
// list.SkipCount = 0
// list.MaxResultCount = JSON.parse(TotalCount)
// getPageList(list, url).then((res) => {
// this[data] = res.items
// list.MaxResultCount = MaxResultItem
// })
// },
//
addFormData(val) {
if (val[0] == "cancel") {
this.active--;
} else {
if (this.active == 1) {
const MaxResultItem = JSON.parse(
this.pageListItemBasic.MaxResultCount
);
// this.addNew('item-basic', this.pageListItemBasic, this.totalCountItemBasic, 'isItemBasicData', MaxResultItem)
// this.pageListItemBasic.MaxResultCount = MaxResultItem
const Function = this.advancedFilter(
"basedata/location",
this.pageListLocation,
"totalCountLocation",
"locationData",
this.oldSkipCountLocation
);
Function();
this.$nextTick(()=>{
this.active++;
})
} else if (this.active == 2) {
const MaxResultLocation = JSON.parse(
this.pageListLocation.MaxResultCount
);
// this.addNew('location', this.pageListLocation, this.totalCountLocation, 'isLocationData', MaxResultLocation)
// this.pageListLocation.MaxResultCount = MaxResultLocation
this.active++;
}
}
},
//
splitFormData(val) {
return new Promise((resolve, reject) => {
postCreateWithCondition(val, "wms/store/count-plan")
.then((res) => {
this.previewFormData = JSON.parse(
JSON.stringify(this.CreateFormData)
);
// delete this.previewFormData.details
this.$listAssign(this.previewFormData, res);
this.previewFormData.details = [];
res.details.forEach((item) => {
const details = JSON.parse(
JSON.stringify(...this.childTableData)
);
this.$listAssign(details, item);
this.previewFormData.details.push(details);
});
resolve();
})
.catch((err) => {
reject();
});
});
},
editFormClick(val) {
// Moment(this.CreateFormData.arriveTime).format()
if (val[0] == 0) {
if (this.active == 0) {
this.close(0);
} else {
this.active--;
}
} else {
val[1].validate((valid) => {
if (valid) {
if (this.active == 0) {
const Function = this.advancedFilter(
"basedata/item-basic",
this.pageListItemBasic,
"totalCountItemBasic",
"itemBasicData",
this.oldSkipCountItemBasic
);
Function();
this.active++;
} else if (this.active == 3) {
this.$listAssign(this.otherFormData, this.CreateFormData);
this.otherFormData.partCondition =
this.pageListItemBasic.condition;
this.otherFormData.locCondition = this.pageListLocation.condition;
this.otherFormData.statusList = [];
let checkboxArray = []
this.other.otherParam.forEach(item => {
if (item == '待检') {
checkboxArray.push(1)
} else if (item == '合格') {
checkboxArray.push(2)
} else if (item == '不合格') {
checkboxArray.push(3)
} else if (item == '隔离') {
checkboxArray.push(4)
} else if (item == '破坏') {
checkboxArray.push(5)
} else if (item == '冻结') {
checkboxArray.push(6)
}
})
// ', '', '', '', '', ''
this.otherFormData.statusList = checkboxArray;
this.otherFormData.vendCondition = {
filters:[]
}
this.loading = true;
this.otherFormData.requestType = 2
this.splitFormData(this.otherFormData).then(
(resolve) => {
this.pageStatus = "success";
this.active++;
this.loading = false;
},
(reject) => {
this.pageStatus = "error";
this.active++;
this.loading = false;
}
);
}
// else if (this.active == 4) {
// postCreate(this.previewFormData, 'count-plan').then(res => {
// this.pageStatus = 'success'
// this.active++
// this.loading = false
// }).catch(err => {
// this.pageStatus = 'error'
// this.active++
// this.loading = false
// })
// }
else {
this.$errorMsg("请检查表单");
}
}
});
}
},
},
};
</script>
<style lang="scss" scoped>
@import "./style/index.scss";
</style>
<style lang="scss">
#stepsForm{
.formButton{
text-align: right;
}
}
</style>

723
Code/Fe/src/components/StepsCountPlanForm/index.vue

@ -1,723 +0,0 @@
<template>
<el-dialog
:title="formTitle"
v-if="displayDialog.newDialog"
:visible="true"
:fullscreen="true"
:append-to-body="false"
:modal="false"
:modal-append-to-body="false"
:show-close="false"
>
<div id="stepsForm">
<el-steps
:active="active"
process-status="finish"
finish-status="success"
:align-center="true"
>
<el-step
v-for="(item, index) in stepFilters"
:key="index"
:title="item"
></el-step>
</el-steps>
<!-- 总体信息 -->
<curren-Form
v-if="active == 0"
class="page1"
size="medium"
ref="page1"
:searchData="CreateFormData"
:searchForm="CreateForm"
:searchOptions="Options"
:searchHandle="editHandle"
:rules="Rules"
:loading="loading"
@push="DataPush(arguments)"
@submitForm="editFormClick(arguments)"
>
</curren-Form>
<!-- 库位参数 -->
<!-- 搜索按钮窗体组件LocationForPADPlan -->
<searchPage
v-if="active == 1"
@sxBtnClickHandle="sxBtnClickHandle"
ref="searchTable"
:tableLoading="tableLoading"
:filterActionOptions="filterActionOptions"
:advancedFilter="advancedFilter(
'basedata/location',
pageListLocation,
'totalCountLocation',
'locationData',
oldSkipCountLocation
)"
:setUTableHeight="355"
:filterPageListParams="[]"
:formTitle="''"
:displayDialog="active == 1"
:selectionTable="false"
:editHandle="editHandle"
:buttonsAllIsRight="true"
:searchTableData="locationData"
:searchTableColumns="initSearchPageTableColums()"
:searchTotalCount="totalCountLocation"
:supplierItemPage="pageListLocation"
@SizeChange="AddNewAlterResultCount(
$event,
'basedata/location',
pageListLocation,
'totalCountLocation',
'locationData',
oldSkipCountLocation
)"
@CurrentChange="AddNewAlertoldSkipCount(
$event,
'basedata/location',
pageListLocation,
'totalCountLocation',
'locationData',
oldSkipCountLocation
)"
@tableButtonClick="addFormData(arguments)"
></searchPage>
<!-- @filterBtnClickHandle="filterBtnClickHandle" -->
<!-- 其他参数 -->
<curren-Form
v-loading="loading"
v-if="active == 2"
class="page1"
size="medium"
ref="page1"
:searchData="other"
:searchForm="otherForm"
:searchOptions="Options"
:searchHandle="editHandle"
:rules="Rules"
:loading="loading"
@push="DataPush(arguments)"
@submitForm="editFormClick(arguments)"
>
</curren-Form>
<!-- <curren-Form
v-if="active === 4"
size="medium"
class="page3"
:searchData="previewFormData"
:searchForm="CreateForm | formData"
:searchHandle="editHandle"
:rules="Rules"
:loading="loading"
@submitForm="editFormClick(arguments)"
>
<template>
<el-form-item class="formTable-box" prop="details">
<currenTable
:tableData="previewFormData.details"
:tableColumns="detailsTableColumns | formDataDetails"
:selectionTable="false"
>
</currenTable>
</el-form-item>
</template>
</curren-Form> -->
<div
v-if="active === step.length - 1 && pageStatus === 'success'"
class="page4"
>
<el-result icon="success" title="成功提示" subTitle="新增成功">
<template slot="extra">
<!-- <el-button type="primary" size="medium" @click="tuoFormPrint"
>打印托标签</el-button
>
<el-button type="primary" size="medium" @click="xbqFormPrint"
>打印箱标签</el-button
> -->
<el-button
v-for="item in successHandle"
:key="item.label"
:type="item.type"
size="medium"
@click="item.click()"
>{{ item.label }}</el-button
>
<el-button type="primary" size="medium" @click="close(1)"
>退出</el-button
>
</template>
</el-result>
</div>
<div
v-if="active === step.length - 1 && pageStatus === 'error'"
class="page4"
>
<el-result icon="error" title="错误提示" subTitle="新增失败">
<template slot="extra">
<el-button type="primary" size="medium" @click="close(1)"
>退出</el-button
>
</template>
</el-result>
</div>
</div>
</el-dialog>
</template>
<script>
import currenForm from "@/components/currenForm";
import currenTable from "@/components/currenTable";
import {
getPageList,
postCreateWithCondition,
postCreate,
} from "@/api/wms-api";
export default {
name: "stepsForm",
components: {
currenForm,
currenTable,
},
watch: {
active(val) {
if (val != 0) {
this.editHandle[0].label = "上一步";
} else {
this.editHandle[0].label = "取消";
}
},
},
filters: {
formData(val) {
let data = JSON.parse(JSON.stringify(val));
val.forEach((key, index) => {
data[index].disabled = "true";
delete data[index].focus;
if (key.type == "autocomplete" || key.type == "import") {
data[index].type = "input";
}
});
return data;
},
formDataDetails(val) {
let data = JSON.parse(JSON.stringify(val));
val.forEach((key, index) => {
data[index].disabled = "true";
delete data[index].focus;
delete data[index].rules;
if (key.type == "autocomplete" || key.type == "import") {
data[index].type = "input";
} else if (key.type == "objectAutocomplete") {
data[index].type = "objectInput";
} else if (key.prop == "containerCode") data[index].disabled = "false";
});
return data;
},
},
props: {
//
formTitle: {
type: String,
default: "",
},
//
displayDialog: {
type: Object,
default: () => {
return {
newDialog: false,
};
},
},
//
CreateFormData: {
type: Object,
default: () => {
return {};
},
},
//form
CreateForm: {
type: Array,
default: () => {
return [];
},
},
//
// previewFormData: {
// type: Object,
// default: () => {
// return {}
// }
// },
//
Rules: {
type: Object,
default: () => {
return {};
},
},
//
Options: {
type: Object,
default: () => {
return {};
},
},
//table
detailsTableColumns: {
type: Array,
default: () => {
return [];
},
},
//
childTableData: {
type: Array,
default: () => {
return [];
},
},
//
successHandle: {
type: Array,
default: () => {
return [];
},
},
},
computed: {
stepFilters() {
let stepFilters = [];
const routeName = this.$route.meta.title;
this.step.forEach((key) => {
stepFilters.push(routeName.concat(key));
});
return stepFilters;
},
// autoAdvanced () {
// if (this.active == 1) {
// return this.advancedFilter(
// 'item-basic',
// this.pageListItemBasic,
// 'totalCountItemBasic',
// 'itemBasicData',
// this.oldSkipCountItemBasic
// )
// } else if (this.active == 2) {
// return this.advancedFilter(
// 'location',
// this.pageListLocation,
// 'totalCountLocation',
// 'locationData',
// this.oldSkipCountLocation
// )
// }
// },
},
data() {
return {
active: 0,
formReveal: 1,
pageStatus: "",
filterListParams: [],
itemBasicData: [],
isItemBasicData: [],
previewFormData: [],
totalCountItemBasic: 0,
oldSkipCountItemBasic: 1,
pageListItemBasic: {
condition: {
filters: [],
},
Sorting: "",
SkipCount: 0,
MaxResultCount: 100,
},
locationData: [],
isLocationData: [],
totalCountLocation: 0,
oldSkipCountLocation: 1,
pageListLocation: {
condition: {
filters: [],
},
Sorting: "",
SkipCount: 0,
MaxResultCount: 100,
},
other: {
otherParam: [],
},
otherForm: [
{
label: "状态",
prop: "otherParam",
type: "checkbox",
indeterminate:"true",
checkboxs: "radios",
},
],
otherFormData: {
countMethod: 0,
// type: 0,//
company: null,
description: null,
// beginTime: null,
// endTime: null,
planTime: null,
partCondition: {},
locCondition: {},
statusList: [],
worker: null,
warehouseCode: null,
remark: null,
requestType: null,
},
loading: false,
tableLoading: false,
session: null,
// step: ["", "", "", "", ""],
step: ["总体信息", "库位参数", "其他参数", "结果"],
editHandle: [
{ label: "取消", name: "cancel" },
{ label: "下一步", type: "primary", name: "determine" },
],
filterActionOptions:[{
value: '==',
label: '等于'
}, {
value: '!=',
label: '不等于'
}],
// (codevalue)
filterOptionCopyForMutiple:[],
//
filterCodeExclude:'INSPECT,HOLD,TRANSFERONTHEWAY',
};
},
mounted() {
this.session = JSON.parse(JSON.stringify(this.CreateFormData));
},
methods: {
// pda线
initSearchPageTableColums(){
// let _list = JSON.parse(JSON.stringify(this.$isTableColumns.Location));
let _list = JSON.parse(JSON.stringify(this.$isTableColumns.CountPlanByAddLocation));
_list.forEach(item => {
// pda 使 locationTypeForPADPlan 线
// Excel 使 locationTypeForExcelPlan
if(item.prop == 'type'){
item.filters = this.CreateFormData.requestType == 2 ? 'locationTypeForPADPlan' : 'locationTypeForExcelPlan'
}
});
return _list
},
//退
close(val) {
this.active = 0;
const filter ={
condition: {
filters: [],
},
Sorting: "",
SkipCount: 0,
MaxResultCount: 100,
}
this.pageListItemBasic = JSON.parse(JSON.stringify(filter))
this.pageListLocation = JSON.parse(JSON.stringify(filter))
const data = JSON.parse(JSON.stringify(this.session));
this.itemBasicData = []
this.locationData = []
this.$emit("close", data, val);
},
//autoComplete
DataPush(val) {
this.$emit("DataPush", val);
},
//autoComplete
detailsDataPush(val) {
this.$emit("detailsDataPush", val);
},
// 20230704
sxBtnClickHandle(data){
// code 20230705
this.$refs.searchTable.setScreenDataFilters(this.filterOptionCopyForMutiple)
},
//
advancedFilter(url, list, TotalCount, data, oldSkipCount) {
return () => {
list.SkipCount = (oldSkipCount - 1) * list.MaxResultCount;
this.tableLoading = true;
// 线 20230703
// Excel(this.CreateFormData.requestType == 1)2
// Excel(this.CreateFormData.requestType != 1)线5
let type_value = this.CreateFormData.requestType == 1 ? '2' : '5'
let _filter = {
action: "!=",
column: "type",
logic: "And",
value: type_value,
hide:true
}
//
let _filter_code = {
action: "!=",
column: "code",
logic: "And",
value: this.filterCodeExclude,
hide: true
}
if(this.pageListLocation.condition.filters.length <= 0){
this.pageListLocation.condition.filters.push(_filter)
this.pageListLocation.condition.filters.push(_filter_code)
}
// code 20230705
this.filterOptionCopyForMutiple = JSON.parse(JSON.stringify(list.condition.filters))
let _filters = []
// code
this.filterOptionCopyForMutiple.forEach((option)=>{
if(option.column == 'code'){
option.value.split(',').forEach((val,val_index)=>{
// != (And) == Or
let _logic = val_index == 0 ? option.logic : (option.action == '!=' ? 'And' : 'Or')
if((val || val == 0) && val.length > 0){
let _item = {
action: option.action,
column: option.column,
logic: _logic,
value: val,
}
_filters.push(_item)
}
})
}else{
_filters.push(option)
}
})
list.condition.filters = _filters
getPageList(list, url)
.then((res) => {
this[data] = res.items;
this[TotalCount] = res.totalCount;
this.tableLoading = false;
})
.catch(() => {
this.tableLoading = false;
});
};
},
//(emit)
AddNewAlterResultCount(val, url, list, TotalCount, data, oldSkipCount) {
list.MaxResultCount = val;
const Function = this.advancedFilter(
url,
list,
TotalCount,
data,
oldSkipCount
);
Function();
},
//(emit)
AddNewAlertoldSkipCount(val, url, list, TotalCount, data, oldSkipCount) {
oldSkipCount = val;
const Function = this.advancedFilter(
url,
list,
TotalCount,
data,
oldSkipCount
);
Function();
},
//
tuoFormPrint() {
this.$emit("tuoFormPrint");
},
//
xbqFormPrint() {
this.$emit("xbqFormPrint");
},
// //
// addNew (url, list, TotalCount, data, MaxResultItem) {
// list.SkipCount = 0
// list.MaxResultCount = JSON.parse(TotalCount)
// getPageList(list, url).then((res) => {
// this[data] = res.items
// list.MaxResultCount = MaxResultItem
// })
// },
//
addFormData(val) {
if (val[0] == "cancel") {
this.active--;
} else {
//
// if (this.active == 1) {
// const MaxResultItem = JSON.parse(
// this.pageListItemBasic.MaxResultCount
// );
// // this.addNew('item-basic', this.pageListItemBasic, this.totalCountItemBasic, 'isItemBasicData', MaxResultItem)
// // this.pageListItemBasic.MaxResultCount = MaxResultItem
// const Function = this.advancedFilter(
// "basedata/location",
// this.pageListLocation,
// "totalCountLocation",
// "locationData",
// this.oldSkipCountLocation
// );
// Function();
// this.$nextTick(()=>{
// this.active++;
// })
// }
//
if (this.active == 1) {
const MaxResultLocation = JSON.parse(
this.pageListLocation.MaxResultCount
);
// this.addNew('location', this.pageListLocation, this.totalCountLocation, 'isLocationData', MaxResultLocation)
// this.pageListLocation.MaxResultCount = MaxResultLocation
this.active++;
}
}
},
//
splitFormData(val) {
return new Promise((resolve, reject) => {
postCreateWithCondition(val, "wms/store/count-plan")
.then((res) => {
this.previewFormData = JSON.parse(
JSON.stringify(this.CreateFormData)
);
// delete this.previewFormData.details
this.$listAssign(this.previewFormData, res);
this.previewFormData.details = [];
res.details.forEach((item) => {
const details = JSON.parse(
JSON.stringify(...this.childTableData)
);
this.$listAssign(details, item);
this.previewFormData.details.push(details);
});
resolve();
})
.catch((err) => {
reject();
});
});
},
//
editFormClick(val) {
// Moment(this.CreateFormData.arriveTime).format()
if (val[0] == 0) {
if (this.active == 0) {
this.close(0);
} else {
this.active--;
}
} else {
val[1].validate((valid) => {
if (valid) {
//
if (this.active == 0) {
this.pageListLocation.condition.filters = []
const Function = this.advancedFilter(
// "basedata/item-basic",
// this.pageListItemBasic,
// "totalCountItemBasic",
// "itemBasicData",
// this.oldSkipCountItemBasic
'basedata/location',
this.pageListLocation,
'totalCountLocation',
'locationData',
this.oldSkipCountLocation
);
Function();
this.active++;
}
//
else if (this.active == 2) {
this.$listAssign(this.otherFormData, this.CreateFormData);
this.otherFormData.partCondition =
this.pageListItemBasic.condition;
this.otherFormData.locCondition = this.pageListLocation.condition;
this.otherFormData.statusList = [];
let checkboxArray = []
this.other.otherParam.forEach(item => {
if (item == '待检') {
checkboxArray.push(1)
} else if (item == '合格') {
checkboxArray.push(2)
} else if (item == '不合格') {
checkboxArray.push(3)
} else if (item == '隔离') {
checkboxArray.push(4)
} else if (item == '破坏') {
checkboxArray.push(5)
} else if (item == '冻结') {
checkboxArray.push(6)
}
})
// ', '', '', '', '', ''
this.otherFormData.statusList = checkboxArray;
this.otherFormData.vendCondition = {
filters:[]
}
if(this.otherFormData.statusList.length <= 0){
this.$warningMsg("请选择状态");
return
}
this.loading = true;
// this.otherFormData.requestType = 2
this.splitFormData(this.otherFormData).then(
(resolve) => {
this.pageStatus = "success";
this.active++;
this.loading = false;
},
(reject) => {
this.pageStatus = "error";
this.active++;
this.loading = false;
}
);
}
// else if (this.active == 4) {
// postCreate(this.previewFormData, 'count-plan').then(res => {
// this.pageStatus = 'success'
// this.active++
// this.loading = false
// }).catch(err => {
// this.pageStatus = 'error'
// this.active++
// this.loading = false
// })
// }
else {
this.$errorMsg("请检查表单");
}
}
});
}
},
},
};
</script>
<style lang="scss" scoped>
@import "./style/index.scss";
</style>
<style lang="scss">
#stepsForm{
.formButton{
text-align: right;
}
.searchPageComponents{
top: 130px !important;
}
.el-dialog__wrapper{
height: unset;
}
}
</style>

86
Code/Fe/src/components/StepsCountPlanForm/style/index.scss

@ -1,86 +0,0 @@
#stepsForm {
width: 100%;
height: 100%;
display: flex;
flex-direction: column;
::v-deep .el-steps {
padding-bottom: 15px;
.el-step__main {
.el-step__title {
line-height: 24px;
font-size: 14px;
}
}
}
.page1 {
flex: 1;
display: flex;
flex-direction: column;
justify-content: space-between;
}
.page2 {
flex: 1;
overflow: hidden;
position: relative;
::v-deep & >.el-dialog {
width: 100%;
height: 100%;
& >.el-dialog__header {
padding: 0 !important;
}
& > .el-dialog__body {
padding-top: 0;
}
}
}
.page3 {
flex: 1;
display: flex;
flex-direction: column;
justify-content: space-between;
padding-bottom: 54px;
overflow: hidden;
overflow-y: auto;
::v-deep .el-form {
flex: 1;
display: flex;
flex-direction: column;
.el-row {
flex: 1;
flex-wrap: wrap;
overflow: hidden;
overflow-y: auto;
}
.formTable-box {
flex: 1;
overflow: hidden;
overflow-y: auto;
.el-form-item__content {
width: 100%;
height: 100%;
display: flex;
flex-direction: column;
margin: 0 !important;
}
}
}
::v-deep .formButton {
position: absolute;
bottom: 0;
right: 0;
z-index: 3;
}
}
}

459
Code/Fe/src/components/StepsForm/_index.vue

@ -1,459 +0,0 @@
<template>
<el-dialog
:title="formTitle"
v-loading="loading"
v-if="displayDialog.newDialog"
:visible="true"
:fullscreen="true"
:append-to-body="false"
:modal="false"
:modal-append-to-body="false"
:show-close="false"
>
<div id="stepsForm">
<el-steps
:active="active"
process-status="finish"
finish-status="success"
:align-center="true"
>
<el-step
v-for="(item, index) in stepFilters"
:key="index"
:title="item"
></el-step>
</el-steps>
<curren-Form
v-if="active == 0"
class="page1"
size="medium"
ref="page1"
:searchData="CreateFormData"
:searchForm="CreateForm"
:searchOptions="Options"
:searchHandle="editHandle"
:rules="Rules"
@changeInput="changeInput"
@changeSelect="changeSelect"
@push="DataPush(arguments)"
@submitForm="editFormClick(arguments)"
>
</curren-Form>
<curren-Form
v-if="active === 1"
class="page2"
size="medium"
:searchData="CreateFormData"
:searchHandle="editHandle"
:rules="Rules"
@submitForm="editFormClick(arguments)"
>
<template>
<el-form-item class="formTable-box" prop="details" v-if="active == 1">
<div class="heder" v-if="addClick">
<span @click="openAddNew">添加一行</span>
</div>
<currenTable
:tableData="CreateFormData.details"
:searchOptions="Options"
:tableColumns="detailsTableColumns"
:selectionTable="false"
@push="detailsDataPush(arguments)"
>
<template v-if="showDeleteButton">
<el-table-column
label="操作"
align="center"
fixed="right"
width="100px"
>
<template slot-scope="scope">
<div class="childTable" @click="childTable($event, scope)">
<span>删除</span>
</div>
</template>
</el-table-column>
</template>
</currenTable>
</el-form-item>
</template>
</curren-Form>
<curren-Form
v-if="active === 2"
size="medium"
class="page3"
:searchData="previewFormData"
:searchForm="CreateForm | formData"
:searchHandle="editHandle"
:rules="Rules"
@submitForm="editFormClick(arguments)"
>
<template>
<el-form-item class="formTable-box" prop="details">
<currenTable
:tableData="previewFormData.details"
:tableColumns="detailsTableColumns | formDataDetails"
:selectionTable="false"
>
</currenTable>
</el-form-item>
</template>
</curren-Form>
<div
v-if="active === step.length - 1 && pageStatus === 'success'"
class="page4"
>
<el-result
icon="success"
title="成功提示"
:subTitle="formTitle + '成功'"
>
<template slot="extra">
<!-- <el-button type="primary" size="medium" @click="tuoFormPrint"
>打印托标签</el-button
>
<el-button type="primary" size="medium" @click="xbqFormPrint"
>打印箱标签</el-button
> -->
<el-button
v-for="item in successHandle"
:key="item.label"
:type="item.type"
size="medium"
@click="successClick(item.click())"
>{{ item.label }}</el-button
>
<el-button type="primary" size="medium" @click="close(1)"
>退出</el-button
>
</template>
</el-result>
</div>
<div
v-if="active === step.length - 1 && pageStatus === 'error'"
class="page4"
>
<el-result icon="error" title="错误提示" :subTitle="formTitle + '失败'">
<template slot="extra">
<el-button type="primary" size="medium" @click="close(1)"
>退出</el-button
>
</template>
</el-result>
</div>
</div>
</el-dialog>
</template>
<script>
import currenForm from "@/components/currenForm"
import currenTable from "@/components/currenTable"
export default {
name: 'stepsForm',
components: {
currenForm,
currenTable
},
watch: {
active (val) {
if (val != 0) {
this.editHandle[0].label = '上一步'
} else {
this.editHandle[0].label = '取消'
}
},
stepArray(newVal, oldVal){
this.step = newVal
}
},
filters: {
formData (val) {
let data = JSON.parse(JSON.stringify(val))
val.forEach((key, index) => {
data[index].disabled = "true"
delete data[index].focus
if (key.type == "autocomplete" || key.type == "import") {
data[index].type = "input"
}
});
return data
},
formDataDetails (val) {
let data = JSON.parse(JSON.stringify(val))
val.forEach((key, index) => {
data[index].disabled = true
delete data[index].focus
delete data[index].rules
if (key.type == "autocomplete" || key.type == "import") {
delete data[index].type
} else if (key.type == "objectAutocomplete") {
data[index].type = "object"
} else if (key.prop == "containerCode" && key.type == "input") {
data[index].disabled = false
} else if (key.isChange) {
//
data[index].disabled = false
}
});
return data
}
},
props: {
//
formTitle: {
type: String,
default: ''
},
//
displayDialog: {
type: Object,
default: () => {
return {
newDialog: false
}
}
},
//
CreateFormData: {
type: Object,
default: () => {
return {}
}
},
//form
CreateForm: {
type: Array,
default: () => {
return []
}
},
//
previewFormData: {
type: Object,
default: () => {
return {}
}
},
//
Rules: {
type: Object,
default: () => {
return {}
}
},
//
Options: {
type: Object,
default: () => {
return {}
}
},
//table
detailsTableColumns: {
type: Array,
default: () => {
return []
}
},
//
childTableData: {
type: Array,
default: () => {
return []
}
},
//
successHandle: {
type: Array,
default: () => {
return []
}
},
//
stepArray: {
type: Array,
default: () => {
return ["总体信息", "明细", "预览", "结果"]
}
},
//
addClickButton: {
type: Boolean,
default: () => {
return true
}
},
//
isShowDeleteButton: {
type: Boolean,
default: () => {
return true
}
}
},
computed: {
stepFilters () {
let stepFilters = []
const routeName = this.$route.meta.title
this.step.forEach(key => {
stepFilters.push(routeName.concat(key))
})
return stepFilters
},
},
data () {
return {
active: 0,
formReveal: 1,
activeStep: 1,
pageStatus: '',
addClick: this.addClickButton,
showDeleteButton: this.isShowDeleteButton,
loading: false,
session: null,
step: this.stepArray,
editHandle: [
{ label: "取消", name: "cancel" },
{ label: "下一步", type: "primary", name: "determine" },
],
}
},
mounted () {
this.session = JSON.parse(JSON.stringify(this.CreateFormData))
},
methods: {
//退
close (val) {
this.active = 0
// const pageRef = this.Refs[1]
const data = JSON.parse(JSON.stringify(this.session))
this.$emit('close', data, val)
},
//autoComplete
DataPush (val) {
this.$emit("DataPush", val)
},
//autoComplete
detailsDataPush (val) {
this.$emit("detailsDataPush", val)
},
// //
// tuoFormPrint () {
// this.$emit('tuoFormPrint')
// },
// //
// xbqFormPrint () {
// this.$emit('xbqFormPrint')
// },
successClick (val) {
this.loading = true
val.then(res => {
this.loading = false
}, reason => {
this.loading = false
})
},
editFormClick (val) {
// Moment(this.CreateFormData.arriveTime).format()
if (val[0] == 0) {
if (this.active == 0) {
// debugger
// this.active = ''
this.close(0)
} else {
if (this.active == 2) {
this.active = this.active - this.activeStep
} else {
this.active--
}
}
} else {
val[1].validate((valid) => {
if (valid) {
const parent = this.$parent
if (this.active < this.step.length - 1) {
this.loading = true
if (this.active == this.step.length - 2) {
parent.stepsSubmit().then(res => {
if (res == '质检校验返回') {
this.loading = false
} else {
this.pageStatus = 'success'
this.active++
this.loading = false
}
}, reason => {
this.pageStatus = 'error'
this.active++
this.loading = false
}).catch(err=>{
this.loading = false
})
} else if (this.active == this.step.length - 3) {
parent.PalletlFunction().then(res => {
//
if (res == '质检任务跳过详情') {
parent.stepsSubmit().then(res => {
this.pageStatus = 'success'
this.active = this.active + 2
this.loading = false
}, reason => {
this.pageStatus = 'error'
this.active = this.active + 2
this.loading = false
}).catch(err=>{
this.loading = false
})
} else {
this.active++
}
this.loading = false
}, reason => {
this.loading = false
}).catch(err=>{
this.loading = false
})
} else {
parent.stepsHandelOne().then(res => {
if (res) {
this.addClick = res.open
this.active = this.active + res.index
this.activeStep = res.index
} else {
this.activeStep = 1
this.active++
}
this.loading = false
}, reason => {
this.loading = false
}).catch(err=>{
this.loading = false
})
}
}
} else {
this.$errorMsg('请检查表单')
}
})
}
},
//
openAddNew () {
const parent = this.$parent
parent.openAddNew()
},
childTable (e, val) {
const parent = this.$parent
parent.childTable(e, val)
},
changeInput(prop,val){
this.$emit("changeInput", prop, val)
},
changeSelect(prop,val){
this.$emit("changeSelect", prop, val)
},
}
}
</script>
<style lang="scss" scoped>
@import "./style/index.scss";
</style>

551
Code/Fe/src/components/StepsForm/index.vue

@ -1,551 +0,0 @@
<template>
<el-dialog
:title="formTitle"
v-loading="loading"
v-if="displayDialog.newDialog"
:visible="true"
:fullscreen="true"
:append-to-body="false"
:modal="false"
:modal-append-to-body="false"
:show-close="false"
>
<div id="stepsForm">
<el-steps
:active="active"
process-status="finish"
finish-status="success"
:align-center="true"
>
<el-step
v-for="(item, index) in stepFilters"
:key="index"
:title="item"
></el-step>
</el-steps>
<curren-Form
v-if="active == 0"
class="page1"
size="medium"
ref="page1"
:searchData="CreateFormData"
:searchForm="CreateForm"
:searchOptions="Options"
:searchHandle="editHandle"
:rules="Rules"
@changeInput="changeInput"
@changeSelect="changeSelect"
@push="DataPush(arguments)"
@submitForm="editFormClick(arguments)"
>
</curren-Form>
<curren-Form
v-if="active === 1"
class="page2"
size="medium"
:searchData="CreateFormData"
:searchHandle="editHandle"
:rules="Rules"
@submitForm="editFormClick(arguments)"
>
<template>
<el-form-item class="formTable-box" prop="details" v-if="active == 1">
<div class="heder">
<el-button
v-if="addClick"
type="primary"
@click="openAddNew"
icon="el-icon-plus"
size="mini"
>添加一行</el-button>
<el-button
v-if="importFormButton"
type="success"
icon="el-icon-download"
@click="openImportForm"
size="mini"
>导入</el-button>
</div>
<currenTable
:tableData="CreateFormData.details"
:searchOptions="Options"
:tableColumns="detailsTableColumns"
:selectionTable="false"
@push="detailsDataPush(arguments)"
>
<template v-if="showDeleteButton">
<el-table-column
label="操作"
align="center"
fixed="right"
width="100px"
>
<template slot-scope="scope">
<div class="childTable" @click="childTable($event, scope)">
<span>删除</span>
</div>
</template>
</el-table-column>
</template>
</currenTable>
</el-form-item>
</template>
</curren-Form>
<curren-Form
v-if="active === 2"
size="medium"
class="page3"
:searchData="previewFormData"
:searchForm="CreateForm | formData"
:searchHandle="editHandle"
:rules="Rules"
@submitForm="editFormClick(arguments)"
>
<template>
<el-form-item class="formTable-box" prop="details">
<currenTable
:tableData="previewFormData.details"
:tableColumns="detailsTableColumns | formDataDetails"
:selectionTable="false"
>
<template v-if="showPreviewFormDeleteButton">
<el-table-column
label="操作"
align="center"
fixed="right"
width="100px"
>
<template slot-scope="scope">
<div @click="previewChildRemove($event, scope)">
<span style="color:red">删除</span>
</div>
</template>
</el-table-column>
</template>
</currenTable>
</el-form-item>
</template>
</curren-Form>
<div
v-if="active === step.length - 1 && pageStatus === 'success'"
class="page4"
>
<el-result
icon="success"
title="成功提示"
:subTitle="formTitle + '成功'"
>
<template slot="extra">
<!-- <el-button type="primary" size="medium" @click="tuoFormPrint"
>打印托标签</el-button
>
<el-button type="primary" size="medium" @click="xbqFormPrint"
>打印箱标签</el-button
> -->
<el-button
v-for="item in successHandle"
:key="item.label"
:type="item.type"
size="medium"
@click="successClick(item.click())"
>{{ item.label }}</el-button
>
<el-button type="primary" size="medium" @click="close(1)"
>退出</el-button
>
</template>
</el-result>
</div>
<div
v-if="active === step.length - 1 && pageStatus === 'error'"
class="page4"
>
<el-result icon="error" title="错误提示" :subTitle="formTitle + '失败'">
<template slot="extra">
<el-button type="primary" size="medium" @click="close(1)"
>退出</el-button
>
</template>
</el-result>
</div>
</div>
</el-dialog>
</template>
<script>
import currenForm from "@/components/currenForm"
import currenTable from "@/components/currenTable"
export default {
name: 'stepsForm',
components: {
currenForm,
currenTable
},
watch: {
active (val) {
if (val != 0) {
this.editHandle=[
{ label: "上一步", name: "cancel" },
{ label: "下一步", type: "primary", name: "determine" },
];
} else {
if(this.hideFirstActiveCancel){
this.editHandle=[
{ label: "下一步", type: "primary", name: "determine" },
];
}else{
this.editHandle=[
{ label: "取消", name: "cancel" },
{ label: "下一步", type: "primary", name: "determine" },
];
}
}
},
stepArray(newVal, oldVal){
this.step = newVal
}
},
filters: {
formData (val) {
let data = JSON.parse(JSON.stringify(val))
val.forEach((key, index) => {
data[index].disabled = "true"
delete data[index].focus
if (key.type == "autocomplete" || key.type == "import") {
data[index].type = "input"
}
});
return data
},
formDataDetails (val) {
let data = JSON.parse(JSON.stringify(val))
val.forEach((key, index) => {
data[index].disabled = true
delete data[index].focus
delete data[index].rules
if (key.type == "autocomplete" || key.type == "import") {
delete data[index].type
} else if (key.type == "objectAutocomplete") {
data[index].type = "object"
} else if (key.prop == "containerCode" && key.type == "input") {
data[index].disabled = false
} else if (key.isChange) {
//
data[index].disabled = false
}
});
return data
}
},
props: {
//
formTitle: {
type: String,
default: ''
},
//
displayDialog: {
type: Object,
default: () => {
return {
newDialog: false
}
}
},
//
CreateFormData: {
type: Object,
default: () => {
return {}
}
},
//form
CreateForm: {
type: Array,
default: () => {
return []
}
},
//
previewFormData: {
type: Object,
default: () => {
return {}
}
},
//
Rules: {
type: Object,
default: () => {
return {}
}
},
//
Options: {
type: Object,
default: () => {
return {}
}
},
//table
detailsTableColumns: {
type: Array,
default: () => {
return []
}
},
//
childTableData: {
type: Array,
default: () => {
return []
}
},
//
successHandle: {
type: Array,
default: () => {
return []
}
},
//
stepArray: {
type: Array,
default: () => {
return ["总体信息", "明细", "预览", "结果"]
}
},
//
addClickButton: {
type: Boolean,
default: () => {
return true
}
},
//
importFormButton: {
type: Boolean,
default: () => {
return false
}
},
//
isShowDeleteButton: {
type: Boolean,
default: () => {
return true
}
},
//
isHideFirstActiveCancel:{
type: Boolean,
default: () => {
return false
}
},
//
showPreviewFormDeleteButton:{
type: Boolean,
default: () => {
return false
}
}
},
computed: {
stepFilters () {
let stepFilters = []
const routeName = this.$route.meta.title
this.step.forEach(key => {
stepFilters.push(routeName.concat(key))
})
return stepFilters
},
},
data () {
return {
active: 0,
formReveal: 1,
activeStep: 1,
pageStatus: '',
addClick: this.addClickButton,//
importForm:this.importFormButton,//
showDeleteButton: this.isShowDeleteButton,//-
hideFirstActiveCancel:this.isHideFirstActiveCancel,//
loading: false,
session: null,
step: this.stepArray,
editHandle: [
{ label: "取消", name: "cancel" },
{ label: "下一步", type: "primary", name: "determine" },
],
}
},
mounted () {
this.session = JSON.parse(JSON.stringify(this.CreateFormData))
if(this.hideFirstActiveCancel){
this.editHandle=[
{ label: "下一步", type: "primary", name: "determine" },
];
}
},
methods: {
//退
close (val) {
this.active = 0
// const pageRef = this.Refs[1]
const data = JSON.parse(JSON.stringify(this.session))
this.$emit('close', data, val)
},
//autoComplete
DataPush (val) {
this.$emit("DataPush", val)
},
//autoComplete
detailsDataPush (val) {
this.$emit("detailsDataPush", val)
},
// //
// tuoFormPrint () {
// this.$emit('tuoFormPrint')
// },
// //
// xbqFormPrint () {
// this.$emit('xbqFormPrint')
// },
successClick (val) {
this.loading = true
val.then(res => {
this.loading = false
}, reason => {
this.loading = false
}).catch(err=>{
this.loading = false
})
},
editFormClick (val) {
// Moment(this.CreateFormData.arriveTime).format()
// if (val[0] == 0) {
if (val[2].name == "cancel") {
if (this.active == 0) {
// debugger
// this.active = ''
this.close(0)
} else {
if (this.active == 2) {
this.active = this.active - this.activeStep
} else {
this.active--
}
}
} else {
val[1].validate((valid) => {
if (valid) {
const parent = this.$parent
if (this.active < this.step.length - 1) {
this.loading = true
if (this.active == this.step.length - 2) {
parent.stepsSubmit().then(res => {
if (res == '质检校验返回') {
this.loading = false
} else {
this.pageStatus = 'success'
this.active++
this.loading = false
}
}, reason => {
this.loading = false
if(reason=="return")return
this.pageStatus = 'error'
this.active++
this.loading = false
}).catch(err=>{
this.loading = false
})
} else if (this.active == this.step.length - 3) {
parent.PalletlFunction().then(res => {
//
if (res == '质检任务跳过详情') {
parent.stepsSubmit().then(res => {
this.pageStatus = 'success'
this.active = this.active + 2
this.loading = false
}, reason => {
this.pageStatus = 'error'
this.active = this.active + 2
this.loading = false
}).catch(err=>{
this.loading = false
})
} else {
this.active++
}
this.loading = false
}, reason => {
this.loading = false
}).catch(err=>{
this.loading = false
})
} else {
parent.stepsHandelOne().then(res => {
if (res) {
this.addClick = res.open
this.active = this.active + res.index
this.activeStep = res.index
} else {
this.activeStep = 1
this.active++
}
this.loading = false
}, reason => {
this.loading = false
}).catch(err=>{
this.loading = false
})
}
}
} else {
this.$errorMsg('请检查表单')
}
})
}
},
//
openAddNew () {
const parent = this.$parent
parent.openAddNew()
},
//
openImportForm(){
const parent = this.$parent
parent.openImportFormHandle()
// this.displayDialog.importDialog = true
},
childTable (e, val) {
const parent = this.$parent
parent.childTable(e, val)
},
changeInput(prop,val){
this.$emit("changeInput", prop, val)
},
changeSelect(prop,val){
this.$emit("changeSelect", prop, val)
},
//
previewChildRemove(e, val) {
this.$confirm('您确定删除吗, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.previewFormData.details.splice(val.$index, 1)
// this.$emit("removePreviewFormRow",this.previewFormData)
}).catch(() => {
});
},
}
}
</script>
<style lang="scss" scoped>
@import "./style/index.scss";
</style>

134
Code/Fe/src/components/StepsForm/style/index.scss

@ -1,134 +0,0 @@
#stepsForm {
width: 100%;
height: 100%;
display: flex;
flex-direction: column;
::v-deep .el-steps {
padding-bottom: 15px;
.el-step__main {
.el-step__title {
line-height: 24px;
font-size: 14px;
}
}
}
.page1 {
flex: 1;
display: flex;
flex-direction: column;
justify-content: space-between;
overflow: hidden;
overflow-y: auto;
}
.page2 {
flex: 1;
display: flex;
flex-direction: column;
justify-content: space-between;
padding-bottom: 54px;
overflow: hidden;
overflow-y: auto;
::v-deep .el-form {
flex: 1;
display: flex;
.el-row {
display: none;
}
.formTable-box {
flex: 1;
overflow: hidden;
overflow-y: auto;
.el-form-item__content {
width: 100%;
height: 100%;
display: flex;
flex-direction: column;
margin: 0 !important;
.heder {
padding: 5px 0;
text-align: center;
font-size: 18px;
button{
margin: 0 10px;
}
}
.el-table {
flex: 1;
.childTable {
display: flex;
justify-content: space-around;
span {
cursor: pointer;
&:nth-child(1) {
color: red;
}
&:nth-child(2) {
color: green;
}
}
}
}
}
}
}
::v-deep .formButton {
position: absolute;
bottom: 0;
right: 0;
z-index: 3;
}
}
.page3 {
flex: 1;
display: flex;
flex-direction: column;
padding-bottom: 54px;
overflow: hidden;
overflow-y: auto;
::v-deep .el-form {
flex: 1;
display: flex;
flex-direction: column;
.el-row {
flex: 1;
flex-wrap: wrap;
}
.formTable-box {
flex: 1;
.el-form-item__content {
width: 100%;
height: 100%;
display: flex;
flex-direction: column;
margin: 0 !important;
}
}
}
::v-deep .formButton {
position: absolute;
bottom: 0;
right: 0;
z-index: 3;
}
}
}

57
Code/Fe/src/components/UploadExcel/index.vue

@ -97,8 +97,6 @@
<script>
import XLSX from 'xlsx'
import { mixins } from "@/mixins/mixins"
import { postInventoryLabelCode } from "@/api/wms-core"
import { supplierAsnExcel } from "@/filters/excelOrReportsOption";
import {SupplierAsnCtypeStaBack} from "@/filters/status"
export default {
@ -114,7 +112,7 @@ export default {
fixedArr:{
type:Array,
default: () => {
return [ {name:supplierAsnExcel.details.packingCode,value:"right"} ]
return []
}
},
fixedLeftArr:{
@ -187,59 +185,7 @@ export default {
// });
// return
// }
//
// this.getPackingCode(arr)
// },
//
getPackingCode(header, results){
let createManyParams = [];
results.forEach(item => {
let _item = {
itemCode: item[supplierAsnExcel.details.itemCode] || "",
lot: item[supplierAsnExcel.details.lot] || "",
labelType:1,
qty: Number(item[supplierAsnExcel.details.qty]),
uom: item[supplierAsnExcel.details.uom],
stdPackQty:0,
company:localStorage.getItem("company"),
// poNumber:item[supplierAsnExcel.poNumber],
// number:item[supplierAsnExcel.number],
supplierCode:item[supplierAsnExcel.supplierCode],
planUserCode:item[supplierAsnExcel.planUserCode],
contactUserName:item[supplierAsnExcel.planUserCode],
planArriveDate:item[supplierAsnExcel.planArriveDate],
shipDate:item[supplierAsnExcel.shipDate],
remark:item[supplierAsnExcel.remark],
ctype:SupplierAsnCtypeStaBack(item[supplierAsnExcel.details.ctype]),
projectCode:item[supplierAsnExcel.details.projectCode],
itemCode:item[supplierAsnExcel.details.itemCode],
recommendErpCode:item[supplierAsnExcel.details.recommendErpCode],
qty:item[supplierAsnExcel.details.qty],
uom:item[supplierAsnExcel.details.uom],
lot:item[supplierAsnExcel.details.lot],
produceDate:item[supplierAsnExcel.details.produceDate],
expireDate:item[supplierAsnExcel.details.expireDate],
};
createManyParams.push(_item)
});
postInventoryLabelCode(createManyParams)
.then((res,a) => {
let _header = JSON.parse(JSON.stringify(header))
_header.push(supplierAsnExcel.details.packingCode)
res.forEach((v,k)=>{
this.$set(results[k],supplierAsnExcel.details.packingCode, res[k].code)
})
this.successShowExcel(_header, results)
}).catch(err => {
console.log(err)
this.loading = false
this.$message.error('导入失败,请重新导入');
// this.reset()
})
},
postImportDown () {
this.$emit('postImportDown')
},
@ -264,7 +210,6 @@ export default {
})
}else{
this.successShowExcel(header, results)
// this.getPackingCode(header, results)
}
},
handleDrop(e) {

559
Code/Fe/src/components/commonTabel-drawer copy/index.vue

@ -1,559 +0,0 @@
<template>
<el-drawer
v-loading="DrawerLoading"
v-if="drawer"
:visible="true"
:close-on-press-escape="false"
:wrapperClosable="false"
:with-header="false"
:modal="false"
size="100%"
>
<div class="drawer-heder">
<div class="heder-left">
<!-- <div class="heder-img">
<img
src="@/assets/img/drawerHeader.png"
alt=""
style="width: 100%; height: 100%"
/>
</div> -->
<div class="header-text">
<span>{{ propsData[title[0].prop] }}</span>
<span>{{ title[0].label }}</span>
</div>
</div>
<div class="heder-right">
<curren-Button
:Butttondata="Butttondata"
@tableButtonClick="tableButtonClick"
>
<template>
<el-dropdown
trigger="click"
@command="handleCommand"
v-if="JSON.stringify(dropdownData) != '{}'"
>
<el-button size="mini" icon="el-icon-more"></el-button>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item
v-for="(item, index) in dropdownData"
:key="index"
:command="item.command"
>{{ item.label }}</el-dropdown-item
>
</el-dropdown-menu>
</el-dropdown>
</template>
</curren-Button>
</div>
</div>
<div class="drawer-main">
<curren-tabs
:tabsData="dropdownTabs"
:activeName="firstTabs"
type="border-card"
@handleClick="handleClick"
>
<template slot-scope="scope">
<curren-descriptions
border
v-if="scope.value == 'xq'"
:column="column"
:direction="direction"
:colon="false"
:tabsDesTions="tabsDesTions"
:propsData="propsData"
>
</curren-descriptions>
<!-- currenTableDetails 组件 明细中带分页功能 -->
<umyTable
v-if="scope.value == 'mx'"
:tableBorder="true"
:tableData="propsData.details"
:propsData="propsData"
:tableColumns="tableColumns"
:selectionTable="selectionTable"
:requiredRules="false"
:setUTableHeight="260"
@sortChange="sortChange"
@handleSelectionChange="handleSelectionChange"
@inlineDialog="inlineDialog"
@buttonClick="buttonClick"
>
<template>
<slot></slot>
</template>
</umyTable>
<!-- 明细页码 -->
<pagination
v-if="scope.value == 'mx'"
:totalCount="totalCount"
:pagesizeProps="MaxResultCount"
@SizeChange="alterResultCountDetails"
@CurrentChange="alertoldSkipCountDetails"
:currentPageProps="currentPage"
></pagination>
<!-- 新增汇总 表头 区分明细表头使用 summaryTableColumns -->
<umyTable
v-if="scope.value == 'hz'"
:tableBorder="true"
:tableData="propsData.summaryDetails"
:tableColumns="summaryTableColumns.length == 0 ? tableColumns : summaryTableColumns"
:selectionTable="selectionTable"
:requiredRules="false"
@sortChange="sortChange"
@handleSelectionChange="handleSelectionChange"
@inlineDialog="inlineDialog"
@buttonClick="buttonClick"
:setUTableHeight="210"
>
<template>
<slot></slot>
</template>
</umyTable>
<!-- 自定义扩展 -->
<umyTable
v-if="
scope.value == zdyValue &&
scope.value != 'xq' &&
scope.value != 'mx' &&
scope.value != 'hz' &&
scope.value != 'zwlcj'
"
:tableBorder="true"
:tableLoading="tableLoading"
:tableData="otherData"
:tableColumns="zdyTableColumns"
:selectionTable="selectionTable"
:requiredRules="false"
@sortChange="sortChange"
@handleSelectionChange="handleSelectionChange"
@inlineDialog="inlineDialog"
@buttonClick="buttonClick"
:setUTableHeight="210"
>
<template>
<slot></slot>
</template>
</umyTable>
<!-- 自定义扩展tree的形式 目前使用位置物品清单信息-子物品层级 todo:待优化-->
<currenTable
v-if="
scope.value == zdyValue &&
scope.value == 'zwlcj'
"
:tableLoading="tableLoading"
:tableData="otherData"
:tableColumns="zdyTableColumns"
:selectionTable="selectionTable"
:requiredRules="false"
@sortChange="sortChange"
@handleSelectionChange="handleSelectionChange"
@inlineDialog="inlineDialog"
:treeProps="{children: 'children', hasChildren: 'hasChildren'}"
@buttonClick="buttonClick"
>
<template>
<slot></slot>
</template>
</currenTable>
</template>
</curren-tabs>
</div>
<div class="drawer-Shut" @click="drawerShut">
<el-button type="danger" size="mini">关闭</el-button>
</div>
</el-drawer>
</template>
<script>
import { getListByItemcode,byItem,byProduct,byComponent,bySupplierCode,byLocation,byLocationCode,
relationByLocationCode,byComponentCJ,purRecNoteCustomInfo,EnumPurchaseReceiptInspect
} from "@/api/wms-api"
import currenButton from "@/components/currenButton"
import currenDescriptions from "@/components/currenDescriptions"
import currenTabs from "@/components/currenTabs"
import currenTable from "@/components/currenTable"
import pagination from "@/components/Pagination"
export default {
name: 'currenTabel-drawer',
components: {
pagination,
currenButton,
currenDescriptions,
currenTabs,
currenTable,
},
props: {
title: {
type: Array,
default: () => {
return []
}
},
DrawerLoading: {
type: Boolean,
default: true
},
drawer: {
type: Boolean,
default: false
},
dropdownData: {
type: Object,
default: () => {
return {}
}
},
propsData: {
type: Object,
default: () => {
return {}
}
},
tabsDesTions: {
type: Array,
default: () => {
return []
}
},
dropdownTabsData: {
type: Array,
default: () => {
return []
}
},
tableLoading: {
type: Boolean,
default: false
},
tableColumns: {
type: Array,
default: () => {
return []
}
},
summaryTableColumns: {
type: Array,
default: () => {
return []
}
},
Butttondata: {
type: Array,
default: () => {
return [{
type: 'warning',
icon: 'el-icon-edit',
label: '编辑',
name: 'edit',
size: 'mini'
}]
}
},
selectionTable: {
type: Boolean,
default: false
},
MaxResultCount: {
type: Number,
default: 0
},
totalCount: {
type: Number,
default: 0
},
currentPage: {
type: Number,
default: 0
},
// 2
column: {
type: Number,
default: 2
},
//
direction: {
type: String,
default: 'horizontal'
},
// tabs
firstTabs: {
type: String,
default: 'xq'
}
},
computed: {
dropdownTabs () {
// tabs
if (this.dropdownTabsData.length !== 0) {
return this.dropdownTabsData
} else {
//
if (Object.keys(this.propsData).length != 0) {
this.initDropdownTabsData = [{
label: "详情",
name: 'xq'
},
{
label: "明细",
name: 'mx'
},
{
label: "汇总",
name: 'hz'
}]
if (this.propsData.details == undefined || !this.propsData.details.length) {
this.initDropdownTabsData = [{
label: "详情",
name: 'xq'
}]
return this.initDropdownTabsData
}
if (this.propsData.summaryDetails == undefined || !this.propsData.summaryDetails.length ) {
this.initDropdownTabsData = [{
label: "详情",
name: 'xq'
},
{
label: "明细",
name: 'mx'
}]
return this.initDropdownTabsData
}
}
return this.initDropdownTabsData
}
},
},
mounted () {
},
data () {
return {
otherData:[], // tabs
zdyTableColumns:[], //
zdyValue:'', //
// firstTabs:'xq',
initDropdownTabsData:[
{
label: "详情",
name: 'xq'
},
{
label: "明细",
name: 'mx'
},
{
label: "汇总",
name: 'hz'
}
]
}
},
methods: {
handleCommand (command) {
this.$emit('handleCommand', command)
},
drawerShut () {
this.$emit('drawerShut', false)
},
tableButtonClick (val) {
this.$emit('drawerbutton', val)
},
//
sortChange (data) {
this.$emit('sortChange', data)
},
//selection
handleSelectionChange (val) {
this.$emit("handleSelectionChange", val)
},
//nameemit
inlineDialog (row) {
this.$emit("inlineDialog", row)
},
//emit
alterResultCountDetails (val) {
this.$emit('alterResultCountDetails', val)
},
//emit
alertoldSkipCountDetails (val) {
this.$emit('alertoldSkipCountDetails', val)
},
buttonClick(row) {
this.$emit("buttonClick", row);
},
// tabs
handleClick (val) {
this.$emit("currenTabsChange", val);//tab
this.zdyValue = val.name
this.dropdownTabsData.forEach( item => {
if (item.name == val.name) {
let parent = this.$parent
parent.tableLoading = true
//
parent.firstTabs = val.name
if (val.name == 'xq' || val.name == 'mx' || val.name == 'hz') {
this.zdyTableColumns = []
this.otherData = []
parent.tableLoading = false
} else {
this.zdyTableColumns = []
this.otherData = []
// this.firstTabs = val.name
// tab
if (item.functionName == 'getListByItemcode') {
let params = {
itemCode: this.propsData.code
}
getListByItemcode(params, item.url).then(res => {
let zdyTableColumnsJSON = JSON.parse(JSON.stringify(this.$isTableColumns[item.tableColumns]));
delete zdyTableColumnsJSON[0].type
this.zdyTableColumns = zdyTableColumnsJSON
this.otherData = res
parent.tableLoading = false
}).catch(err => {
console.log(err)
parent.tableLoading = false
})
} else if (item.functionName == 'byItem') {
byItem(this.propsData.code, item.url).then(res => {
let zdyTableColumnsJSON = JSON.parse(JSON.stringify(this.$isTableColumns[item.tableColumns]));
delete zdyTableColumnsJSON[0].type
this.zdyTableColumns = zdyTableColumnsJSON
this.otherData = res
parent.tableLoading = false
}).catch(err => {
console.log(err)
parent.tableLoading = false
})
} else if (item.functionName == 'byProduct') {
byProduct({product:this.propsData.product}, item.url).then(res => {
let zdyTableColumnsJSON = JSON.parse(JSON.stringify(this.$isTableColumns[item.tableColumns]));
delete zdyTableColumnsJSON[0].type
this.zdyTableColumns = zdyTableColumnsJSON
this.otherData = res
parent.tableLoading = false
}).catch(err => {
console.log(err)
parent.tableLoading = false
})
} else if (item.functionName == 'byComponent') {
byComponent({component:this.propsData.component}, item.url).then(res => {
let zdyTableColumnsJSON = JSON.parse(JSON.stringify(this.$isTableColumns[item.tableColumns]));
delete zdyTableColumnsJSON[0].type
this.zdyTableColumns = zdyTableColumnsJSON
this.otherData = res
parent.tableLoading = false
}).catch(err => {
console.log(err)
parent.tableLoading = false
})
}
// ----
else if (item.functionName == 'byComponentCJ') {
this.otherData = []
byComponentCJ({component:this.propsData.component}, item.url).then(res => {
let zdyTableColumnsJSON = JSON.parse(JSON.stringify(this.$isTableColumns[item.tableColumns]));
delete zdyTableColumnsJSON[0].type
this.zdyTableColumns = zdyTableColumnsJSON
this.otherData = res
this.recursion(this.otherData)
parent.tableLoading = false
}).catch(err => {
console.log(err)
parent.tableLoading = false
})
} else if (item.functionName == 'bySupplierCode') {
bySupplierCode({supplierCode:this.propsData.code}, item.url).then(res => {
let zdyTableColumnsJSON = JSON.parse(JSON.stringify(this.$isTableColumns[item.tableColumns]));
delete zdyTableColumnsJSON[0].type
this.zdyTableColumns = zdyTableColumnsJSON
this.otherData = res
parent.tableLoading = false
}).catch(err => {
console.log(err)
parent.tableLoading = false
})
} else if (item.functionName == 'byLocation') {
byLocation(this.propsData.code==null?this.propsData.locationCode:this.propsData.code, item.url).then(res => {
let zdyTableColumnsJSON = JSON.parse(JSON.stringify(this.$isTableColumns[item.tableColumns]));
delete zdyTableColumnsJSON[0].type
this.zdyTableColumns = zdyTableColumnsJSON
this.otherData = res
this.o
parent.tableLoading = false
}).catch(err => {
console.log(err)
parent.tableLoading = false
})
} else if (item.functionName == 'byLocationCode') {
byLocationCode({locationCode: this.propsData.code}, item.url).then(res => {
let itemData = []
itemData.push(res)
let zdyTableColumnsJSON = JSON.parse(JSON.stringify(this.$isTableColumns[item.tableColumns]));
delete zdyTableColumnsJSON[0].type
this.zdyTableColumns = zdyTableColumnsJSON
this.otherData = itemData
parent.tableLoading = false
}).catch(err => {
console.log(err)
parent.tableLoading = false
})
}
// ---
else if (item.functionName == 'relationByLocationCode') {
relationByLocationCode({locationCode: this.propsData.code}, item.url).then(res => {
let zdyTableColumnsJSON = JSON.parse(JSON.stringify(this.$isTableColumns[item.tableColumns]));
delete zdyTableColumnsJSON[0].type
this.zdyTableColumns = zdyTableColumnsJSON
this.otherData = res
parent.tableLoading = false
}).catch(err => {
console.log(err)
parent.tableLoading = false
})
}
// -, ,
else if(item.functionName == "purRecNoteCustomInfo"){
parent.Loading.DrawerLoading = true
purRecNoteCustomInfo( item.url,this.propsData.id).then(res => {
let zdyTableColumnsJSON = JSON.parse(JSON.stringify(this.$isTableColumns[item.tableColumns]));
delete zdyTableColumnsJSON[0].type
this.zdyTableColumns = zdyTableColumnsJSON
this.otherData = res
parent.Loading.DrawerLoading = false
}).catch(err => {
console.log(err)
parent.Loading.DrawerLoading = false
})
}
// 退-TAB-
else if(item.functionName == "customerDismantleBackFlushNote"){
let zdyTableColumnsJSON = JSON.parse(JSON.stringify(this.$isTableColumns[item.tableColumns]));
delete zdyTableColumnsJSON[0].type
this.zdyTableColumns = zdyTableColumnsJSON
this.otherData = this.propsData.noteAndBackFlushDetails
}
}
}
})
},
//
recursion(val){
val.forEach(item => {
if(item.componentDTOs) {
item.children = item.componentDTOs
this.recursion(item.componentDTOs)
}
})
}
}
}
</script>
<style lang="scss" scoped>
// el-drawer
@import "./style/index.scss";
</style>

122
Code/Fe/src/components/commonTabel-drawer copy/style/index.scss

@ -1,122 +0,0 @@
.el-drawer__wrapper {
z-index: 10 !important;
position: absolute;
left: 32%;
overflow: visible;
// height:calc(100% - 28px);
// top: 14px;
// right:14px
::v-deep .el-drawer {
height: 100%;
overflow: visible;
box-shadow: 0 8px 10px -5px rgb(0 0 0 / 15%), 0 16px 24px 2px rgb(0 0 0 / 9%), 0 6px 30px 5px rgb(0 0 0 / 7%);
.el-drawer__body {
width: 100%;
height: 100%;
display: flex;
flex-direction: column;
.drawer-heder {
display: flex;
padding: 15px 10px;
justify-content: space-between;
align-items: center;
.heder-left {
display: flex;
justify-content: space-between;
.heder-img {
width: 40px;
height: 40px;
margin-right: 10px;
}
.header-text {
padding:0 20px;
display: flex;
flex-direction: column;
justify-content: space-between;
span:nth-child(1) {
color: #333;
font-size: 22px;
}
span:nth-child(2) {
color: #999;
font-size: 16px;
}
}
}
}
.Descriptions {
padding: 0 10px;
}
.drawer-main {
// padding-top: 20px;
flex: 1;
overflow: hidden;
// background-color: #efefef;
padding: 10px 20px 20px 30px;
border-top: solid 5px #f6f6f6;
.el-tabs {
height: 100%;
display: flex;
flex-direction: column;
.el-tabs__header{
// padding-bottom: 5px ;
.el-tabs__nav{
z-index: auto !important;
}
}
.el-tabs__content {
flex: 1;
.el-tab-pane {
width: 100%;
height: 100%;
overflow-y: auto;
}
.el-descriptions-item__label {
padding-right: 40px;
}
}
}
}
.drawer-Shut {
width: 35px;
height: 100px;
position: absolute;
top: 200px;
left: -35px;
.el-button {
width: 100%;
height: 100%;
display: flex;
justify-content: center;
align-items: center;
::v-deep span {
font-size: 12px;
letter-spacing: 10px;
writing-mode: tb-rl;
}
}
}
}
}
}
::v-deep .el-tabs__nav-wrap::after{
content: unset !important;
}

482
Code/Fe/src/components/commonTabel-drawer/index.vue

@ -11,13 +11,6 @@
>
<div class="drawer-heder">
<div class="heder-left">
<!-- <div class="heder-img">
<img
src="@/assets/img/drawerHeader.png"
alt=""
style="width: 100%; height: 100%"
/>
</div> -->
<div class="header-text">
<span>{{ propsData[title[0].prop] }}</span>
<span>{{ title[0].label }}</span>
@ -66,79 +59,30 @@
:propsData="propsData"
>
</curren-descriptions>
<!-- todo-new 代码整理-->
<div
class="currenTabel-drawer-mx-header"
v-if="scope.value == 'mx' && (showDetailColumnsSet || showDetailFilters)"
>
<el-button
v-if="showDetailColumnsSet"
class="rowDropNotHideItem"
@click="columnsSettingHandle()"
size="mini"
>字段设置</el-button>
<el-button
type="primary"
v-if="showDetailFilters"
@click="detailFiltersHandle()"
size="mini"
>筛选</el-button>
</div>
<!-- 字段设置弹窗 -->
<rowDrop
@radio="rowDrop"
:tableColumns="tableColumns"
:visible="rowDropVisible"
@closeRowDrop="closeRowDrop"
:source="'detail_api'"
:innerMaxHeight="'calc(90vh - 400px)'"
></rowDrop>
<!-- 全面搜索普通+高级整合 -->
<searchOverall
ref="searchOverallRef"
class="detailFiltersPopPage"
:showSearchOverall="detailFiltersVisible"
@getShowSearchOverall="getShowSearchOverall"
:showMoreSearch="true"
:tableColumns="tableColumns"
@overallSearchFormClick="detailFiltersSearch"
:filterActionOptions="filterActionOptions"
:httpOverallSearchData="detailSearchDataFE"
:disabledAction="true"
:disabledLogic="true"
>
<!-- 插槽预留 -->
<slot name="searchPrimarySlot"></slot>
</searchOverall>
<!-- currenTableDetails 组件 明细中带分页功能 -->
<umyTable
<!-- 明细 包含分页 头部按钮等 -->
<tablePagination
v-if="scope.value == 'mx'"
:isUpdate="isUpdate"
:tableBorder="true"
:currenButtonData="detailHeaderButton"
:tableData="propsData.details"
:propsData="propsData"
:tableColumns="tableColumns"
:selectionTable="selectionTable"
:requiredRules="false"
:setUTableHeight="showDetailColumnsSet ? 300 : 260"
@sortChange="sortChange"
:setUTableHeight="showDetailColumnsSet && showDetailFilters ? 300 : 260"
@rowDrop="rowDrop"
:searchOverallCoverHeight="'calc(100vh - 345px)'"
:rowSource="'detail_api'"
:rowMaxHeight="rowMaxHeight"
:totalCount="totalCountForDetail"
:MaxResultCount="MaxResultCount"
@sortChange="sortChangeForDetail"
@alertoldSkipCount="alertoldSkipCountForDetail"
@alterResultCount="alterResultCountForDetail"
@handleSelectionChange="handleSelectionChange"
@inlineDialog="inlineDialog"
@buttonClick="buttonClick"
>
<template>
<slot></slot>
</template>
</umyTable>
<!-- 明细页码 -->
<pagination
v-if="scope.value == 'mx'"
:totalCount="totalCount"
:pagesizeProps="MaxResultCount"
@SizeChange="alterResultCountDetails"
@CurrentChange="alertoldSkipCountDetails"
:currentPageProps="currentPage"
></pagination>
:currentPageProps="oldSkipCount"
@overallSearchFormClick="overallSearchClickForDetail"
:httpOverallSearchData="httpOverallSearchData"
@buttonOperationClick_left="buttonOperationClick_left"
:buttonOperationList_left="buttonOperationList_left"
:tableLoading="Loading.tableLoading"
></tablePagination>
<!-- 新增汇总 表头 区分明细表头使用 summaryTableColumns -->
<umyTable
v-if="scope.value == 'hz'"
@ -182,47 +126,49 @@
<slot></slot>
</template>
</umyTable>
<!-- 自定义扩展tree的形式 目前使用位置物品清单信息-子物品层级 todo:待优化-->
<currenTable
v-if="
scope.value == zdyValue &&
scope.value == 'zwlcj'
"
:tableLoading="tableLoading"
:tableData="otherData"
:tableColumns="zdyTableColumns"
:selectionTable="selectionTable"
:requiredRules="false"
@sortChange="sortChange"
@handleSelectionChange="handleSelectionChange"
@inlineDialog="inlineDialog"
:treeProps="{children: 'children', hasChildren: 'hasChildren'}"
@buttonClick="buttonClick"
>
<template>
<slot></slot>
</template>
</currenTable>
</template>
</curren-tabs>
</div>
<div class="drawer-Shut" @click="drawerShut">
<el-button type="danger" size="mini">关闭</el-button>
</div>
<!-- 明细-查看详情 -->
<el-dialog
width="90%"
:modal-append-to-body="false"
:append-to-body="false"
:title="detailInfoTitle"
:visible.sync="displayDialog.detailInfoDialog"
:show-close="true"
>
<div>
<curren-descriptions
v-if="detailInfoTableData"
border
:column="column"
:direction="direction"
:colon="false"
:tabsDesTions="tableColumns"
:propsData="detailInfoTableData"
style="padding-bottom: 20px;"
></curren-descriptions>
</div>
</el-dialog>
</el-drawer>
</template>
<script>
import searchOverall from "@/components/searchOverall"
import { getListByItemcode,byItem,byProduct,byComponent,bySupplierCode,byLocation,byLocationCode,
relationByLocationCode,byComponentCJ,purRecNoteCustomInfo,EnumPurchaseReceiptInspect
relationByLocationCode,byComponentCJ,purRecNoteCustomInfo,getPageListForDetail
} from "@/api/wms-api"
import searchOverall from "@/components/searchOverall"
import currenButton from "@/components/currenButton"
import currenDescriptions from "@/components/currenDescriptions"
import currenTabs from "@/components/currenTabs"
import currenTable from "@/components/currenTable"
import pagination from "@/components/Pagination"
import rowDrop from "@/components/rowDrop/index.vue"
import { getParentNode } from '@/utils'
import * as allUrlOption from '@/utils/baseData/urlOption'
import { LoadingMixins } from "@/mixins/LoadingMixins";
export default {
name: 'currenTabel-drawer',
components: {
@ -234,7 +180,19 @@ export default {
searchOverall,
rowDrop
},
mixins: [
LoadingMixins,
],
props: {
rowMaxHeight:{
type:String,
default:'calc(90vh - 450px)'
},
//
buttonOperationList_left:{
type: Array,
default: null,
},
// -
showDetailColumnsSet:{
type: Boolean,
@ -245,11 +203,6 @@ export default {
type: Boolean,
default: true
},
// --
detailSearchDataFE:{
type: Object,
default: null
},
title: {
type: Array,
default: () => {
@ -381,24 +334,13 @@ export default {
},
},
mounted () {
//
document.addEventListener('click',(e)=>{
if(!this.rowDropVisible)return
let _class = "rowDropNotHideItem"
let _hasParent = getParentNode(e.target,_class)
let _current_class = e.target._prevClass || e.target.className
let _hasCurrent = _current_class ? String(_current_class).includes(_class) : false
if(!_hasParent && !_hasCurrent){
this.closeRowDrop()
}
})
this.initDetailHeaderButton()
},
data () {
return {
// table key
isUpdate: false,
// -
rowDropVisible: false,
detailHeaderButton:null,//-
detailInfoTableData:null,//-
detailInfoTitle:null,//-title
otherData:[], // tabs
zdyTableColumns:[], //
zdyValue:'', //
@ -417,45 +359,180 @@ export default {
name: 'hz'
}
],
detailFiltersVisible:false,//
filterActionOptions:[{
value: '==',
label: '等于'
}, {
value: '!=',
label: '不等于'
}],
//-
oldSkipCount: 1,
// -
httpOverallSearchData:null,
//-
PageListParams: {
condition: {
filters: []
},
Sorting: "",
SkipCount: 0,
MaxResultCount: 20,
},
totalCountForDetail:0,
//-id
URLOption_masterId:allUrlOption[this.$route.name].masterId || 'masterId',
//-
URLOption_detailList:allUrlOption[this.$route.name].detailListURL,
}
},
methods: {
rowDrop(data,type) {
this.$emit('rowDrop',data,type)
this.isUpdate = !this.isUpdate
},
// -
columnsSettingHandle(){
this.rowDropVisible = !this.rowDropVisible
// -
getDetailList(data,successFn,errorFn){
if(data)this.PageListParams.condition.filters = []
//
let _hasId = false
this.PageListParams.condition.filters.forEach(item=>{
if(item.column == this.URLOption_masterId){
_hasId = true
}
})
if(!_hasId || data){
this.PageListParams.condition.filters.push({
logic: "And",
column: this.URLOption_masterId,
action: "==",
value: data ? data.id : this.propsData.id
})
}
this.PageListParams.SkipCount = (this.oldSkipCount - 1) * this.PageListParams.MaxResultCount
this.Loading.tableLoading = true
getPageListForDetail(this.PageListParams,this.URLOption_detailList)
.then(result => {
this.propsData.details = result.items
this.totalCountForDetail = result.totalCount
this.Loading.tableLoading = false
if(successFn)successFn()
})
.catch(err => {
this.Loading.tableLoading = false
if(errorFn)errorFn()
this.$message.error("数据获取失败")
})
},
// -
detailFiltersHandle(){
this.detailFiltersVisible = !this.detailFiltersVisible
// -
overallSearchForDetailHandle(options){
let _data_primary = options.data_primary,
_data_moreList = options.data_moreList,
_option_primary = options.option_primary,
_vm_quickly = options.vm_quickly,
_vm_moreList = options.vm_moreList
//
let _primary_filters = []
_option_primary.forEach(item=>{
if(_data_primary[item.prop] && String(_data_primary[item.prop]).length > 0){
let _item = {
action:item.action || '==',
column:item.prop,
logic:'And',
value:String(_data_primary[item.prop])
}
_primary_filters.push(_item)
}
})
//
let _moreList_filters = []
_data_moreList.filters.forEach(item=>{
if(String(item.column).length > 0 && String(item.value).length > 0){
_moreList_filters.push(item)
}
})
//
let _all_filters = []
_all_filters = _primary_filters.concat(_moreList_filters)
//
this.oldSkipCount = 1
this.Loading.tableLoading = true;
this.PageListParams.SkipCount = (this.oldSkipCount - 1) * this.PageListParams.MaxResultCount;
this.PageListParams.condition = {filters:_all_filters}
this.getDetailList(null,()=>{
//
if(_vm_quickly){_vm_quickly.searchNormalClear(true)}
//
if(_vm_moreList){_vm_moreList.changeMoreListShow(false)}
//
this.httpOverallSearchData = {}
this.httpOverallSearchData.params = JSON.parse(JSON.stringify(_data_primary))
this.httpOverallSearchData.moreList = JSON.parse(JSON.stringify(_data_moreList))
},()=>{
//
if(_vm_quickly){_vm_quickly.searchNormalClear(true)}
//
if(_vm_moreList){_vm_moreList.changeMoreListShow(false)}
})
},
// -/showSearchOverall
getShowSearchOverall(val){
this.detailFiltersVisible = val || false
// -
overallSearchClickForDetail(options){
let _item = options.item;
// + + +
if(
_item.name == 'search' || _item.name == 'moreList-search' ||
_item.name == 'reset' || _item.name == 'moreList-reset'
){
this.overallSearchForDetailHandle(options)
}
},
// -
detailFiltersSearch(options){
this.$emit('detailFiltersSearch', options)
// -emit
alertoldSkipCountForDetail(val) {
this.oldSkipCount = val;
this.getDetailList();
},
// -emit
alterResultCountForDetail(val) {
this.PageListParams.MaxResultCount = val;
this.getDetailList();
},
// -
sortChangeForDetail(val) {
const {
prop,
order
} = val;
if (!prop || !order) {
this.PageListParams.Sorting = "";
this.oldSkipCount = 1;
this.getDetailList();
return;
}
let orderdata = order.substr(0, order.indexOf("c") + 1);
const props = prop.charAt(0).toUpperCase() + prop.slice(1)
this.PageListParams.Sorting = props + " " + orderdata.toUpperCase();
this.oldSkipCount = 1;
this.getDetailList();
},
// -
initDetailHeaderButton(){
this.detailHeaderButton = []
if(this.showDetailColumnsSet){this.detailHeaderButton.push(this.defaultFieldSettingBtn())}
if(this.showDetailFilters){this.detailHeaderButton.push(this.defaultFilterBtn())}
},
// -
closeDetailInfo(val){
this.displayDialog.detailInfoDialog = val || false
},
// -
buttonOperationClick_left(row, item, index){
//
if(item.name == "info"){
this.displayDialog.detailInfoDialog = true
this.detailInfoTableData = row
let _name = allUrlOption[this.$route.name].detailInfoName
this.detailInfoTitle = _name ? row[_name] + ' 详情' : '详情'
}
this.$emit('buttonOperationClick_left',row, item, index)
},
// -
closeRowDrop() {
this.rowDropVisible = false
rowDrop(data,type) {
this.$emit('rowDrop',data,type)
},
handleCommand (command) {
this.$emit('handleCommand', command)
},
drawerShut () {
this.closeDetailInfo(false)
this.$emit('drawerShut', false)
},
tableButtonClick (val) {
@ -517,117 +594,6 @@ export default {
console.log(err)
parent.tableLoading = false
})
} else if (item.functionName == 'byItem') {
byItem(this.propsData.code, item.url).then(res => {
let zdyTableColumnsJSON = JSON.parse(JSON.stringify(this.$isTableColumns[item.tableColumns]));
delete zdyTableColumnsJSON[0].type
this.zdyTableColumns = zdyTableColumnsJSON
this.otherData = res
parent.tableLoading = false
}).catch(err => {
console.log(err)
parent.tableLoading = false
})
} else if (item.functionName == 'byProduct') {
byProduct({product:this.propsData.product}, item.url).then(res => {
let zdyTableColumnsJSON = JSON.parse(JSON.stringify(this.$isTableColumns[item.tableColumns]));
delete zdyTableColumnsJSON[0].type
this.zdyTableColumns = zdyTableColumnsJSON
this.otherData = res
parent.tableLoading = false
}).catch(err => {
console.log(err)
parent.tableLoading = false
})
} else if (item.functionName == 'byComponent') {
byComponent({component:this.propsData.component}, item.url).then(res => {
let zdyTableColumnsJSON = JSON.parse(JSON.stringify(this.$isTableColumns[item.tableColumns]));
delete zdyTableColumnsJSON[0].type
this.zdyTableColumns = zdyTableColumnsJSON
this.otherData = res
parent.tableLoading = false
}).catch(err => {
console.log(err)
parent.tableLoading = false
})
}
// ----
else if (item.functionName == 'byComponentCJ') {
this.otherData = []
byComponentCJ({component:this.propsData.component}, item.url).then(res => {
let zdyTableColumnsJSON = JSON.parse(JSON.stringify(this.$isTableColumns[item.tableColumns]));
delete zdyTableColumnsJSON[0].type
this.zdyTableColumns = zdyTableColumnsJSON
this.otherData = res
this.recursion(this.otherData)
parent.tableLoading = false
}).catch(err => {
console.log(err)
parent.tableLoading = false
})
} else if (item.functionName == 'bySupplierCode') {
bySupplierCode({supplierCode:this.propsData.code}, item.url).then(res => {
let zdyTableColumnsJSON = JSON.parse(JSON.stringify(this.$isTableColumns[item.tableColumns]));
delete zdyTableColumnsJSON[0].type
this.zdyTableColumns = zdyTableColumnsJSON
this.otherData = res
parent.tableLoading = false
}).catch(err => {
console.log(err)
parent.tableLoading = false
})
} else if (item.functionName == 'byLocation') {
byLocation(this.propsData.code==null?this.propsData.locationCode:this.propsData.code, item.url).then(res => {
let zdyTableColumnsJSON = JSON.parse(JSON.stringify(this.$isTableColumns[item.tableColumns]));
delete zdyTableColumnsJSON[0].type
this.zdyTableColumns = zdyTableColumnsJSON
this.otherData = res
this.o
parent.tableLoading = false
}).catch(err => {
console.log(err)
parent.tableLoading = false
})
} else if (item.functionName == 'byLocationCode') {
byLocationCode({locationCode: this.propsData.code}, item.url).then(res => {
let itemData = []
itemData.push(res)
let zdyTableColumnsJSON = JSON.parse(JSON.stringify(this.$isTableColumns[item.tableColumns]));
delete zdyTableColumnsJSON[0].type
this.zdyTableColumns = zdyTableColumnsJSON
this.otherData = itemData
parent.tableLoading = false
}).catch(err => {
console.log(err)
parent.tableLoading = false
})
}
// ---
else if (item.functionName == 'relationByLocationCode') {
relationByLocationCode({locationCode: this.propsData.code}, item.url).then(res => {
let zdyTableColumnsJSON = JSON.parse(JSON.stringify(this.$isTableColumns[item.tableColumns]));
delete zdyTableColumnsJSON[0].type
this.zdyTableColumns = zdyTableColumnsJSON
this.otherData = res
parent.tableLoading = false
}).catch(err => {
console.log(err)
parent.tableLoading = false
})
}
// -, ,
else if(item.functionName == "purRecNoteCustomInfo"){
parent.Loading.DrawerLoading = true
purRecNoteCustomInfo( item.url,this.propsData.id).then(res => {
let zdyTableColumnsJSON = JSON.parse(JSON.stringify(this.$isTableColumns[item.tableColumns]));
delete zdyTableColumnsJSON[0].type
this.zdyTableColumns = zdyTableColumnsJSON
this.otherData = res
parent.Loading.DrawerLoading = false
}).catch(err => {
console.log(err)
parent.Loading.DrawerLoading = false
})
}
// 退-TAB-
else if(item.functionName == "customerDismantleBackFlushNote"){

15
Code/Fe/src/components/commonTabel-drawer/style/index.scss

@ -120,18 +120,3 @@
::v-deep .el-tabs__nav-wrap::after{
content: unset !important;
}
.currenTabel-drawer-mx-header{
text-align: right;
padding: 0 10px 10px 0;
}
.detailFiltersPopPage{
position: absolute;
right: 0;
left: 0;
height: 240px;
.fullPageCover{
height: calc(100vh - 300px) !important;
}
}

16
Code/Fe/src/components/currenDescriptions/index.vue

@ -1,5 +1,6 @@
<template>
<el-descriptions
class="currenDescriptionsPage"
:title="title"
:column="column"
:direction="direction"
@ -163,3 +164,18 @@ export default {
}
}
</script>
<style lang="scss">
.currenDescriptionsPage{
th{
min-width: 200px !important;
width: auto;
}
td{
span{
display: inline-block;
max-height: 150px;
overflow: auto;
}
}
}
</style>

2
Code/Fe/src/components/currenForm/index.vue

@ -171,7 +171,7 @@
>
<el-option
v-for="(op, index) in selectOptions(item.options) ||
searchOptions['options']"
item.userOptions"
:label="op[item.optionsLabel] || op.label"
:value="op[item.optionsValue] || op.value"
:key="index"

71
Code/Fe/src/components/filterForDetailPage/index.vue

@ -1,5 +1,5 @@
<template>
<div class="filterForDetailPage">
<div class="filterForDetailPage" v-if="dialogShow">
<el-dialog
title="明细查询"
:visible.sync="dialogShow"
@ -9,6 +9,7 @@
:append-to-body="false"
:show-close="true"
@close="closeDialog(false)"
class="mainTable-dialog"
>
<div
class="filterForDetailPage-list"
@ -16,10 +17,13 @@
>
<!-- 列表 -->
<tablePagination
v-if="dialogShow"
v-if="dialogShow && listColumns && listColumns.length > 0"
:currenButtonData="currenButtonData"
:tableData="tableData"
:tableLoading="Loading.tableLoading"
@rowDrop="rowDropForDetail"
:rowSource="'detailPage_api'"
:rowMaxHeight="rowMaxHeight"
:tableColumns="listColumns"
:totalCount="totalCount"
:multipleSelection="multipleSelection"
@ -46,7 +50,7 @@
label="操作"
:align="'center'"
width="150"
fixed="right"
fixed="left"
>
<template slot-scope="scope">
<span v-for="item in operaButtons" style="margin: 0 10px;">
@ -90,7 +94,10 @@
:append-to-body="false"
:title="showParentTitle"
:visible.sync="showParentDialog"
:close-on-click-modal="true"
:close-on-press-escape="true"
:show-close="true"
width="70%"
>
<div v-loading="showParentLoading">
<curren-descriptions
@ -160,19 +167,13 @@ props: {
//
showOverflowTooltip:{
type: Boolean,
default: true,
default: false,
},
// api
DeleteApi: {
type: String,
default: null
},
// -
listColumns:{
type: Array,
default: null
},
// -
parentColumns:{
type: Array,
@ -181,7 +182,9 @@ props: {
showHandleButtons:{
type:Array,
default:() => {
return ['showParent','fresh','filter'];//'add','edit' 'delete'
//'add','edit' 'delete'
// showParentfreshfilterfield
return ['showParent','fresh','filter','field'];
}
},
// 2
@ -194,6 +197,10 @@ props: {
type: String,
default: 'horizontal'
},
rowMaxHeight:{
type:String,
default:'calc(90vh - 450px)'
},
},
data () {
return {
@ -208,18 +215,31 @@ data () {
showParentTitle:null,//-title
showParentTableData:null,//-
showParentLoading:false,//-
listColumns:[],//
}
},
activated(){
//
this.dialogShow = false
this.$nextTick(() => {
this.dialogShow = true
});
},
mounted(){
this.paging()
this.initHandleButtons()
},
methods: {
rowDropForDetail(data,type){
this.listColumns = data
this.$emit("rowDropForDetail", data,type)
},
//
initHandleButtons(){
//
let _arr_header = []
if(this.showHandleButtons.indexOf('add') >= 0){_arr_header.push(this.defaultAddBtn())}
if(this.showHandleButtons.indexOf('field') >= 0){_arr_header.push(this.defaultFieldSettingBtn())}
if(this.showHandleButtons.indexOf('fresh') >= 0){_arr_header.push(this.defaultFreshBtn())}
if(this.showHandleButtons.indexOf('filter') >= 0){_arr_header.push(this.defaultFilterBtn())}
this.currenButtonData = _arr_header
@ -238,18 +258,24 @@ methods: {
},
//
paging(callback){
this.Loading.tableLoading = true
this.Loading.tableLoading = true;
this.PageListParams.SkipCount = (this.oldSkipCount - 1) * this.PageListParams.MaxResultCount
getPageListForDetail(this.PageListParams,this.URLOption_detailList)
// interfaceApi[this.URLOption_detailList](this.PageListParams)
.then(result => {
.then(res=>{
//
let _parentName = this.URLOption_detailList.substr(0,this.URLOption_detailList.indexOf('/'))
let _Columns = this.initApiColumnsForDto(res.items[0],_parentName)
this.listColumns = this.initTableColumns(_Columns,'detailPage_api')
//
if(res){
this.Loading.tableLoading = false
this.tableData = []
result.items.forEach(item=>{
res.items.forEach(item=>{
item.deleteTipVisible = false
this.tableData.push(item)
})
this.totalCount = result.totalCount
this.totalCount = res.totalCount
}
this.pagingCallback(callback)
})
.catch(err=>{
@ -259,7 +285,7 @@ methods: {
},
//
showParentHandleForDetail(data){
this.showParentTitle = `${data[this.URLOption_masterName]} 主表信息`
this.showParentTitle = `${data[this.URLOption_masterName] || ''} 主表信息`
this.showParentDialog = true
this.showParentLoading = true
getListDesById(this.URLOption_parent,data[this.URLOption_masterId])
@ -295,15 +321,18 @@ methods: {
</script>
<style lang="scss">
.filterForDetailPage {
.mainTable-dialog{
.el-dialog{
height: calc(100% - 100px);
}
}
.el-dialog__body{
padding-bottom: 20px !important;
}
.fullPageCover{
height: calc(100% - 380px) !important;
}
}
.filterForDetailPage-list{
height: calc(100% - 320px);
height: calc(100%);
overflow: auto;
}
</style>

206
Code/Fe/src/components/handelFrom/index.vue

@ -1,206 +0,0 @@
<template>
<el-dialog
:title="formTitle"
v-loading="loading"
v-if="displayDialog"
:visible="true"
:fullscreen="true"
:modal="false"
:modal-append-to-body="false"
:show-close="false"
style="z-index:11111"
>
<curren-Form
class="handleForm"
size="medium"
:searchData="CreateFormData"
:searchForm="CreateForm"
:searchHandle="editHandle"
:searchOptions="Options"
:rules="Rules"
@submitForm="editFormClick(arguments)"
>
<template>
<el-form-item
class="formTable-box"
prop="details"
v-if="CreateFormData.details"
>
<currenTable
:tableData="CreateFormData.details"
:searchOptions="Options"
:tableColumns="detailsTableColumns"
:selectionTable="selectionTable"
:isShowIndex="isShowIndex"
@handleSelectionChange="handleSelectionChange"
@buttonClick="buttonClick"
>
<template>
<slot></slot>
</template>
</currenTable>
</el-form-item>
</template>
</curren-Form>
</el-dialog>
</template>
<script>
export default {
props: {
//
formTitle: {
type: String,
default: ''
},
//
displayDialog: {
type: Boolean,
default: () => {
return false
}
},
//
CreateFormData: {
type: Object,
default: () => {
return {}
}
},
//form
CreateForm: {
type: Array,
default: () => {
return []
}
},
//
Rules: {
type: Object,
default: () => {
return {}
}
},
//
Options: {
type: Object,
default: () => {
return {}
}
},
//table
detailsTableColumns: {
type: Array,
default: () => {
return []
}
},
selectionTable:{
type: Boolean,
default: () => {
return false
}
},
//
isShowIndex: {
type: Boolean,
default: false,
},
editHandle: {
type: Array,
default: () => {
return [
{ label: "取消", name: "cancel" },
{ label: "确定", type: "primary", name: "determine" },
];
},
},
// loading: {
// type: Boolean,
// default: false
// },
},
data () {
return {
loading: false,
// editHandle: [
// { label: "", name: "cancel" },
// { label: "", type: "primary", name: "determine" },
// ],
}
},
methods: {
//
editFormClick (val) {
if (val[0] == 0) {
//
this.$emit('update:displayDialog', false)
if(val[2].handleEvent)val[2].handleEvent()
} else if(val[0] == 1){
//
val[1].validate((valid) => {
if (valid) {
const parent = this.$parent
this.loading = true
parent.handleFormSubmit().then(res => {
this.loading = false
}, err => {
this.loading = false
})
} else {
this.$errorMsg('请检查表单')
return false;
}
});
} else {
//
if(val[2].handleEvent)val[2].handleEvent()
}
},
handleSelectionChange(val){
this.$emit("handleSelectionChange", val);
},
//
buttonClick(row,index) {
this.$emit("buttonClick", row,index);
},
}
}
</script>
<style lang="scss" scoped>
.handleForm {
display: flex;
flex-direction: column;
width: 100%;
height: 100%;
::v-deep .el-form {
flex: 1;
display: flex;
flex-direction: column;
overflow: hidden;
.el-row {
flex: 2;
flex-wrap: wrap;
overflow: hidden;
overflow-y: auto;
}
.formTable-box {
flex: 2;
overflow: hidden;
.el-form-item__content {
width: 100%;
height: 100%;
display: flex;
flex-direction: column;
overflow: hidden;
margin: 0 !important;
}
}
}
.el-table {
height: 500px !important;
}
}
</style>

4
Code/Fe/src/components/rowDrop/index.vue

@ -61,7 +61,7 @@ export default {
dataList: [],
// allSelect hasSelect NoSelect
allSeletType:'NoSelect',
userName:JSON.parse(localStorage.getItem('currentUserInfo')).userName
userName:this.$store.getters.currentUserInfo.userName
}
},
props: {
@ -100,7 +100,7 @@ export default {
type: 'warning',
cancelButtonClass:'rowDropNotHideItem'
}).then(() => {
// set this.$store.getters.name.userName
// set this.$store.getters.currentUserInfo.userName
localStorage.setItem('file_Columns_' + this.source + '_' + this.userName + '_' + this.$route.name, JSON.stringify([]))
localStorage.removeItem('file_Columns_' + this.source + '_' +this.userName + '_' + this.$route.name)
// let _resetCol = this.$isTableColumns[this.$route.name]

11
Code/Fe/src/components/searchOverall/index.vue

@ -10,7 +10,11 @@
class="border-outer"
>
<!-- 整体背景遮罩 -->
<div v-if="isShow && isShowMoreList" class="fullPageCover"></div>
<div
v-if="isShow && isShowMoreList"
class="fullPageCover"
:style="{height:searchOverallCoverHeight}"
></div>
<div class="title" v-if="isShowMoreList">高级筛选</div>
<!-- 普通筛选界面 -->
<searchPrimary
@ -233,6 +237,11 @@ export default {
}
},
props: {
//
searchOverallCoverHeight:{
type: String,
default: 'calc(100vh - 200px)'
},
//
disabledAction:{
type: Boolean,

4
Code/Fe/src/components/searchOverall/style/index.scss

@ -17,7 +17,7 @@
background: rgba(255, 255, 255, 0.2);
left: 0;
right: 0;
height: calc(100vh - 200px);
// height: calc(100vh - 200px);
cursor: no-drop;
}
@ -31,7 +31,7 @@
// flex-direction: column;
// width: 100%;
// height: 100%;
max-height: 50vh;
max-height: 30vh;
overflow: auto;
.el-form {

52
Code/Fe/src/components/tablePagination/index.vue

@ -16,6 +16,7 @@
<!-- 全面搜索普通+高级整合 -->
<searchOverall
ref="searchOverallRef"
:searchOverallCoverHeight="searchOverallCoverHeight"
:showSearchOverall="showSearchOverall"
@getShowSearchOverall="getShowSearchOverall"
:primarySearchOption="primarySearchOption"
@ -34,6 +35,8 @@
:tableColumns="tableColumns"
:visible="rowDropVisible"
@closeRowDrop="closeRowDrop"
:source="rowSource"
:innerMaxHeight="rowMaxHeight"
></rowDrop>
<!-- 列表 -->
<div class="uTableOuter" ref="uTableOuterRef" :style="{height:uTableOuterHeight + 'px',overflow:'hidden'}">
@ -49,8 +52,10 @@
@sortChange="sortChange"
@handleSelectionChange="handleSelectionChange"
@inlineDialog="inlineDialog"
:buttonOperationList="buttonOperationList"
@buttonOperationClick="buttonOperationClick"
:buttonOperationList_left="buttonOperationList_left"
@buttonOperationClick_left="buttonOperationClick_left"
:buttonOperationList_right="buttonOperationList_right"
@buttonOperationClick_right="buttonOperationClick_right"
:tableBorder="true"
:firstFixed="true"
:cellStyle = "cellStyle"
@ -86,6 +91,15 @@ export default {
rowDrop
},
props: {
rowMaxHeight:{
type:String,
default:'calc(90vh - 280px)'
},
//
searchOverallCoverHeight:{
type: String,
default: 'calc(100vh - 200px)'
},
// app-main100%
setUTableHeight: {
type: Number,
@ -94,7 +108,7 @@ export default {
//
showOverflowTooltip:{
type: Boolean,
default: true,
default: false,
},
//
quicklySearchOption:{
@ -108,11 +122,16 @@ export default {
return []
}
},
//
buttonOperationList:{
// ()
buttonOperationList_left:{
type: Array,
default: null,
},
// ()
buttonOperationList_right:{
type: Function,
default: null,
},
//
tableData: {
type: Array,
@ -194,6 +213,11 @@ export default {
default: () => {
return Function;
}
},
// -
rowSource:{
type:String,
default:'list_api'
}
},
data () {
@ -257,9 +281,11 @@ export default {
})
},
methods: {
rowDrop(data) {
this.$emit('rowDrop',data)
rowDrop(data,type) {
this.$emit('rowDrop',data,type)
this.$nextTick(()=>{
this.isUpdate = !this.isUpdate
})
},
//
topbutton (val,item) {
@ -327,13 +353,13 @@ export default {
sortChange (data) {
this.$emit('sortChange', data)
},
//table
buttonOperationClick(row, index, label) {
this.$emit("buttonOperationClick", row, index, label);
//table()
buttonOperationClick_left(row, index, label) {
this.$emit("buttonOperationClick_left", row, index, label);
},
//table
buttonOperationClick(row, item, index) {
this.$emit("buttonOperationClick", row, item, index);
//table()
buttonOperationClick_right(row, item, index) {
this.$emit("buttonOperationClick_right", row, item, index);
},
//
// /showSearchOverall

993
Code/Fe/src/components/umyTable/index copy.vue

@ -0,0 +1,993 @@
<template>
<!-- 解决el-table 数据量过大导致卡顿现象 -->
<u-table
:id="_uid"
:key="isUpdate"
v-loading="tableLoading"
element-loading-text="拼命加载中..."
@sort-change="sortChange"
@selection-change="handleSelectionChange"
ref="multipleTable"
:data="tableData"
:row-key="rowKey"
:border="tableBorder"
style="width: 100%"
:cell-style="cellStyle"
use-virtual
:row-height="50"
:height="uTableHeight"
header-row-class-name="uTableHeader"
>
<!-- :tree-props="treeProps" height 不能共存 此组件暂不支持tree的格式-->
<!-- 操作列 左侧-->
<u-table-column
v-if="buttonOperationList_left"
:fixed="'left'"
width="auto"
min-width="120px"
:align="'center'"
:header-align="'center'"
>
<template #header>
<span>操作</span>
</template>
<template slot-scope="scope">
<el-button
v-for="(itemButton, indexButton) in buttonOperationList_left"
:key="indexButton"
type="text"
size="mini"
@click="buttonOperationClick_left(scope.row, itemButton, indexButton)"
>{{itemButton.label}}</el-button>
</template>
</u-table-column>
<!-- 操作列 右侧-->
<u-table-column
v-if="buttonOperationList_right"
:fixed="'right'"
width="auto"
min-width="120px"
:align="'center'"
:header-align="'center'"
>
<template #header>
<span>操作</span>
</template>
<template slot-scope="scope">
<el-button
v-for="(itemButton, indexButton) in buttonOperationList_right(scope.row)"
v-show="!itemButton.hide"
:key="indexButton"
type="text"
size="mini"
@click="buttonOperationClick_right(scope.row, itemButton, indexButton)"
>{{itemButton.label}}</el-button>
</template>
</u-table-column>
<u-table-column v-if="selectionTable" fixed="left" type="selection" :reserve-selection="true" />
<u-table-column v-if="isShowIndex" type="index" fixed="left" label="序号" width="50" />
<template v-for="(item, index) in TableSize">
<u-table-column
min-width="150"
:key="index"
:prop="item.showProp ? item.prop + '.' + item.showProp : item.prop"
:sortable="item.sortable"
:fixed="setItemFixed(item,index)"
:show-overflow-tooltip="showOverflowTooltip"
:width="item.width"
:align="item.tableAlign"
:header-align="item.tableHeaderAlign"
v-if="item.istrue==null?true:item.istrue"
>
<template #header>
<span>{{ item.label }}</span>
<i style="color: #f56c6c" v-if="item.rules && requiredRules">*</i>
</template>
<template slot-scope="scope">
<el-form>
<el-form-item
v-if="item.type == 'input'"
:onkeyup="itemOnKeyUp(item,searchData[item.prop])"
:prop="'details.' + scope.$index + '.' + item.prop"
:rules="item.rules"
>
<el-input
:placeholder="'请输入' + item.label"
:disabled="Boolean(item.disabled) || Boolean(scope.row['disabled'])"
v-model="scope.row[item.prop]"
@blur="
inputPlaceholder($event, item, 'blur',scope.row)
"
@focus="inputPlaceholder($event, item, 'focus')"
clearable
>
</el-input>
</el-form-item>
<!-- 输入框(数字) onkeyup: 正则表达式用于前端输入校验工作-->
<el-form-item
v-if="item.type == 'inputNumber'"
:prop="'details.' + scope.$index + '.' + item.prop"
:rules="item.rules"
>
<el-input
v-model="searchData[item.prop]"
:maxlength="item.maxlength"
:onkeyup="typeNumberOnkeyup(item,searchData[item.prop])"
clearable
:disabled="Boolean(item.disabled)"
:placeholder="'请输入' + item.label"
:prefix-icon="item.icon"
:show-password="item.showPassword"
@change="changeInput(item.prop,$event)"
@clear="clearInput(item.prop,$event)"
@blur="
inputPlaceholder($event, item, 'blur',searchData)
"
@focus="inputPlaceholder($event, item, 'focus')"
></el-input>
</el-form-item>
<el-form-item
v-if="item.type == 'objectInput'"
:prop="
'details.' + scope.$index + '.' + item.prop + '.' + item.showProp
"
:rules="item.rules"
>
<el-input
:placeholder="'请输入' + item.label"
v-model="scope.row[item.prop][item.showProp]"
:disabled="Boolean(item.disabled) || Boolean(scope.row['disabled'])"
@blur="
inputPlaceholder($event, item, 'blur', scope.row)
"
@focus="inputPlaceholder($event, item, 'focus')"
clearable
>
</el-input>
</el-form-item>
<!-- 下拉框 -->
<el-select
v-if="item.type === 'select'"
v-model="scope.row[item.prop]"
:loading="selectLoading"
:clearable="item.clearable"
:multiple="item.multiple"
:disabled="Boolean(item.disabled) || Boolean(scope.row['disabled'])"
:filterable="item.filterable"
:allow-create="item.allowCreate"
style="width: 100%"
:placeholder="'请输入' + item.label"
>
<el-option
v-for="(op, index) in selectOptions(item.options) ||
searchOptions['options']"
:label="op[item.optionsLabel] || op.label"
:value="op[item.optionsValue] || op.value"
:key="index"
></el-option>
</el-select>
<!--对象下拉框 -->
<el-select
v-if="item.type === 'objectSelect'"
v-model="scope.row[item.prop][item.showProp]"
:loading="selectLoading"
:clearable="item.clearable"
:multiple="item.multiple"
:disabled="Boolean(item.disabled) || Boolean(scope.row['disabled'])"
:filterable="item.filterable"
:allow-create="item.allowCreate"
style="width: 100%"
:placeholder="'请输入' + item.label"
>
<el-option
v-for="(op, index) in selectOptions(item.options) ||
searchOptions['options']"
:label="op[item.optionsLabel] || op.label"
:value="op[item.optionsValue] || op.value"
:key="index"
></el-option>
</el-select>
<!--查询下拉-->
<el-form-item
v-if="item.type === 'autocomplete'"
:prop="'details.' + scope.$index + '.' + item.prop"
:rules="item.rules"
>
<el-autocomplete
class="inline-input"
style="width: 100%"
:disabled="Boolean(item.disabled) || Boolean(scope.row['disabled'])"
v-model="scope.row[item.prop]"
:fetch-suggestions="
(queryString, cb) => {
querySearch(queryString, cb, item, scope);
}
"
:placeholder="'请输入' + item.label"
@select="handleSelect($event, item, scope)"
>
<!-- <template slot-scope="{item}">
<div class="name" style="color:green">{{item.value = item.name}}</div>
<div class="name" >{{item.address = item.code}}</div>
</template> -->
<el-button
v-if="item.click"
slot="append"
icon="el-icon-search"
@click="item.click({ scope, item })"
style="color: #1890ff; background-color: #ffffff"
></el-button>
</el-autocomplete>
</el-form-item>
<!-- 对象查询下拉 -->
<el-form-item
v-if="item.type === 'objectAutocomplete'"
:prop="
'details.' + scope.$index + '.' + item.prop + '.' + item.showProp
"
:rules="item.rules"
>
<el-autocomplete
class="inline-input"
style="width: 100%"
:disabled="Boolean(item.disabled) || Boolean(scope.row['disabled'])"
v-model="scope.row[item.prop][item.showProp]"
:fetch-suggestions="
(queryString, cb) => {
querySearch(queryString, cb, item, scope);
}
"
:placeholder="'请输入' + item.label"
@select="handleSelect($event, item, scope)"
>
<!-- <template slot-scope="{item}">
<div class="name" style="color:green">{{item.value = item.name}}</div>
<div class="name" >{{item.address = item.code}}</div>
</template> -->
<el-button
v-if="item.click"
slot="append"
icon="el-icon-search"
@click="item.click({ scope, item })"
style="color: #1890ff; background-color: #ffffff"
></el-button>
</el-autocomplete>
</el-form-item>
<!-- <el-form-item v-if="item.type == 'inputEnum'" :prop="item.prop">
<el-input
placeholder="请输入内容"
v-model="scope.row[item.prop]"
clearable
>
</el-input>
</el-form-item> -->
<el-form-item
v-if="item.type == 'dateTimeInput'"
:prop="'details.' + scope.$index + '.' + item.prop"
:rules="item.rules"
>
<el-date-picker
type="datetime"
v-model="scope.row[item.prop]"
placeholder="选择日期"
style="width: 100%"
:disabled="Boolean(item.disabled) || Boolean(scope.row['disabled'])"
value-format="yyyy-MM-ddTHH:mm:ss.sssZ"
format="yyyy-MM-dd"
></el-date-picker>
</el-form-item>
<el-form-item
v-if="item.type == 'objectDateTimeInput'"
:prop="'details.' + scope.$index + '.' + item.prop + '.' + item.showProp"
:rules="item.rules"
>
<el-date-picker
type="datetime"
v-model="scope.row[item.prop][item.showProp]"
placeholder="选择日期"
style="width: 100%"
:disabled="Boolean(item.disabled) || Boolean(scope.row['disabled'])"
value-format="yyyy-MM-ddTHH:mm:ss.sssZ"
format="yyyy-MM-dd"
></el-date-picker>
</el-form-item>
<!-- table表添加按钮事件 v-show="scope.row.number == 'PRJ202210060001'" -->
<!-- <el-form-item v-if="item.type == 'button'" > -->
<div v-if="item.type == 'button'">
<el-button
v-show="scope.row[item.prop]==undefined?true:false"
type="primary"
size="mini"
@click="buttonClick(scope.row, scope.$index, item.label)"
>{{item.label}}</el-button>
</div>
<!-- </el-form-item> -->
<span v-if="item.type == 'object'">
{{ scope.row[item.prop] ? scope.row[item.prop][item.showProp] : "" }}
</span>
<span v-if="item.type == 'objectDateTime'">
{{ scope.row[item.prop]? scope.row[item.prop][item.showProp]: "" | formatDate }}
</span>
<span v-if="item.type == 'dateTime'">
{{ scope.row[item.prop] | formatDate }}
</span>
<!-- 调用主表信息 -->
<span v-else-if="item.type && item.type == 'outerMainFilter'">
{{ propsData[item.showProp] }}
</span>
<el-tag
v-if="item.type == 'tagFilter'"
:effect="'dark'"
size="medium"
class="tagFilterTypeDarkItem"
:color="scope.row[item.prop] | trigger(item.filters, 'background')"
>
{{ scope.row[item.prop] | trigger(item.filters, "label") }}
</el-tag>
<span
v-if="item.type == 'filter'"
:style="scope.row[item.prop]"
>
{{ scope.row[item.prop] | trigger(item.filters, "label", item.dictType) }}
</span>
<span
v-if="item.type == 'objectFilter'"
:style="scope.row[item.prop][item.showProp]"
>
{{ scope.row[item.prop][item.showProp] | trigger(item.filters, "label") }}
</span>
<span v-else-if="item.type == 'filterList'" >
{{ scope.row[item.prop] | triggerList(item.filters, "label") }}
</span>
<!-- 可点出详情 -->
<span
v-if="item.type == 'showDetail'"
@click="showDetailInfo(scope.row[item.prop])"
style="cursor: pointer;"
:title="'点击查看详情'"
:class="{ showDetailHover: item.type == 'showDetail' }"
>{{ scope.row[item.prop] ? scope.row[item.prop] + "" : scope.row[item.prop] }}</span>
<!-- 可点出json转换的table弹窗 -->
<span
v-if="item.type == 'showJsonTable'"
@click="showJsonTable(scope.row[item.prop])"
style="cursor: pointer;"
:title="'点击查看详情'"
:class="{ showDetailHover: item.type == 'showJsonTable' }"
>{{ scope.row[item.prop] ? scope.row[item.prop] + "" : scope.row[item.prop] }}</span>
<span
v-if="item.type == 'name' || !item.type"
@click="item.type == 'name' && inlineDialog(scope.row)"
:class="{ spamHover: item.type == 'name' }"
>{{ scope.row[item.prop] ? scope.row[item.prop] + "" : scope.row[item.prop] }}</span>
</el-form>
</template>
</u-table-column>
</template>
<slot></slot>
<!-- 点开查看全部弹窗 -->
<el-dialog
:visible.sync="showDetailDialog"
width="35%"
:modal-append-to-body="false"
:append-to-body="true"
:show-close="true"
:title="'内容详情'"
>
{{ showDetailData ? showDetailData + "" : showDetailData }}
</el-dialog>
<!-- json弹窗复制的json内容 -->
<el-dialog
id="copyJsonTextarea_dialog_ref"
:visible.sync="showJsonCopy"
:modal-append-to-body="false"
:append-to-body="true"
:show-close="true"
:close-on-click-modal="true"
:close-on-press-escape="true"
:title="'JSON详情'"
>
<el-input
ref="copyJsonTextarea_ref"
type="textarea"
readonly
autosize
placeholder="请输入内容"
v-model="showJsonData_str">
</el-input>
</el-dialog>
<!-- 点开查看Json转换后table弹窗 -->
<el-dialog
:visible.sync="showJsonDialog"
:modal-append-to-body="false"
:append-to-body="true"
:show-close="true"
:close-on-click-modal="true"
:close-on-press-escape="true"
:title="'内容详情'"
>
<el-button
@click="copyJsonHandle()"
type="primary"
style="margin-bottom: 10px;float: right;"
>复制JSON</el-button>
<el-table
:data="showJsonData"
:border="true"
style="width: 100%">
<el-table-column
prop="name"
width="220"
label="属性">
</el-table-column>
<el-table-column
label="值"
>
<template slot-scope="scope">
<!-- DETAILS todo:DETAILS判断条件需要优化使用传参的方式 -->
<span v-if="(scope.row.name).toUpperCase() != 'DETAILS'">{{scope.row.value}}</span>
<el-table
v-else
height="300"
:data="scope.row.value"
:border="true"
style="width: 100%">
<el-table-column
prop="name"
label="子属性"
></el-table-column>
<el-table-column
label="子值"
prop="value"
></el-table-column>
</el-table>
</template>
</el-table-column>
</el-table>
</el-dialog>
</u-table>
</template>
<script>
import { formatTimeStrToStr } from "@/utils/formatTime";
import _ from "lodash";
import { getMatchRegConformValue } from "@/utils/index"
export default {
name: "currenTable",
filters: {
formatDate(time) {
if (time == null) {
return '-'
}
return formatTimeStrToStr(time)
},
},
props: {
//
buttonOperationList_left:{
type: Array,
default: null,
},
// ()
buttonOperationList_right:{
type: Function,
default: null,
},
//
showOverflowTooltip:{
type: Boolean,
default: false,
},
// tableborder
tableBorder: {
type: Boolean,
default: false,
},
// itemfixed
firstFixed: {
type: Boolean,
default: false,
},
propsData: {
type: Object,
default: () => {
return {};
},
},
tableData: {
type: Array,
default: () => {
return [];
},
},
tableLoading: {
type: Boolean,
default: false,
},
tableColumns: {
type: Array,
default: () => {
return [];
},
},
selectionTable: {
type: Boolean,
default: true,
},
requiredRules: {
type: Boolean,
default: true,
},
searchOptions: {
type: Object,
default: () => {
return {};
},
},
treeProps: {
type: Object,
default: () => {
return {};
}
},
// table key
isUpdate: {
type: Boolean,
default: () => {
return false
}
},
rowKey:{
type: String,
default: 'id',
},
isShowIndex: {
type: Boolean,
default: false,
},
cellStyle: {
type: Function,
default: () => {
return Function;
}
},
// app-main100%
setUTableHeight: {
type: Number,
default: () => {
return 280;
}
}
},
data() {
return {
dropCol: null,
selectLoading: false,
random: '',
uTableHeight:null,//
showDetailDialog:false,//
showDetailData:null,//
showJsonDialog:false,//Jsontable
showJsonData:null,//Json
showJsonData_str:null,//Json
showJsonCopy:false,//jsonDialog
};
},
computed: {
selectOptions() {
return (val) => {
if (val) {
let options = this.$staticOptions[val];
if (options) {
return options();
} else {
return [];
}
} else {
return false;
}
};
},
TableSize(){
return this.tableColumnsFilter()
}
},
watch: {
tableData: {
handler(val, oldVal) {
this.$nextTick(() => {
if (this.$refs.multipleTable && this.$refs.multipleTable.doLayout) {
this.$refs.multipleTable.doLayout()
}
});
},
immediate: false,
},
tableColumns: {
handler(val, oldVal) {
this.$nextTick(() => {
if (this.$refs.multipleTable && this.$refs.multipleTable.doLayout) {
this.$refs.multipleTable.doLayout()
}
});
},
immediate: false,
},
setUTableHeight(n,o){
this.setTableHeightHandle(n)
}
},
activated() {
this.$refs.multipleTable.doLayout();
},
mounted() {
this.random = this._uid
this.setTableHeightHandle()
},
methods: {
//
setTableHeightHandle(height){
let _height = height || this.setUTableHeight
let _app_height = document.getElementsByClassName('app-main')[0].clientHeight
this.uTableHeight = Number(_app_height) - Number(_height)
},
//
getTableHeight(){
return this.uTableHeight
},
setItemFixed(item,index){
let _re = false
if(this.firstFixed && item.fixed == 'left'){
if(index == 0)_re = true
}else{
_re = item.fixed
}
return _re
},
// type=input
itemOnKeyUp(item,value){
if(item.onkeyup){
return item.onkeyup()
}else{
if(value && item.validType){
this.searchData[item.prop]=getMatchRegConformValue(item.validType,value,item.pointNumberFixed)
}
}
},
// inputonkeyup
typeNumberOnkeyup(item,value){
if(value){
let _match = String(value).match(/\d+/)//
this.searchData[item.prop] = _match?_match[0]:_match
}
if(this.searchData[item.prop] > item.max){
this.searchData[item.prop] = item.max
}
if(this.searchData[item.prop] && this.searchData[item.prop] < item.min){
this.searchData[item.prop] = item.min
}
if(item.onkeyup)item.onkeyup()
},
tableColumnsFilter() {
let widthSize = _.cloneDeep(this.tableColumns);
for(let i = 0;i<widthSize.length;i++){
let item = widthSize[i]
if (item.type == "autocomplete" || item.type == "objectAutocomplete") {
item.width = item.width ? item.width: "300px";
} else if (item.type == "input" || item.type == "objectInput") {
if (item.width == '100%') {
item.width = ''
} else {
item.width = item.width ? item.width: "200px";
}
} else if (
item.type == "dateTimeInput" ||
item.type == "objectDateTimeInput"
) {
item.width =item.width ? item.width: "200px";
} else if (item.type == "objectDateTime" || item.type == "dateTime") {
item.width =item.width ? item.width: "200px";
} else if (item.width == '100%') {
item.width = ''
} else {
item.width =item.width ? item.width: "auto";
}
}
return widthSize
},
inputPlaceholder(val, item, type, func) {
if (item.valueType) {
if (type == "focus") {
val.target.placeholder = "请输入" + item.label;
if (val.target.value != "") {
val.target.placeholder = val.target.value;
val.target.value = "";
}
} else if (type == "blur") {
// val.target.value = "0"
val.target.value = val.target.value.toString().replace(/[^\d.]/g,'')
if (val.target.value == "") {
// if (val.target.placeholder.indexOf('') == -1) {
val.target.value = val.target.placeholder;
// }
}
if(item.showProp){
func[item.prop][item.showProp]= Number(val.target.value)
}else{
func[item.prop]= Number(val.target.value)
}
}
}
},
//autocomplete
querySearch(queryString, cb, val, row) {
const { options, optionsValue, optionsLabel } = val;
let func = val.focus;
let data = {
scope: row,
};
if (queryString) {
data.filter = [
{
logic: "And",
column: optionsValue,
action: "Like",
value: queryString,
},
];
}
func(data).then((res) => {
var restaurants = this.searchOptions["options"];
let results = queryString
? restaurants.filter(
this.createFilter(queryString, optionsValue, optionsLabel)
)
: restaurants;
results.forEach((key) => {
if (typeof optionsValue === "string") {
key.value = key[optionsValue] + "----" + key[optionsLabel];
} else {
key.value =
key[optionsValue[0]][optionsValue[1]] +
"----" +
key[optionsLabel];
}
});
// callback
cb(results);
});
},
createFilter(queryString, optionsValue, optionsLabel) {
return (restaurant) => {
if (typeof optionsValue === "string") {
restaurant.value =
restaurant[optionsValue] + "----" + restaurant[optionsLabel];
} else {
restaurant.value =
restaurant[optionsValue[0]][optionsValue[1]] +
"----" +
restaurant[optionsLabel];
}
return (
restaurant.value.toLowerCase().indexOf(queryString.toLowerCase()) !=
-1
);
};
},
handleSelect(item, val, scope) {
let data = this.tableData[scope.$index];
if (!val.showProp) {
if (typeof val.optionsValue === "string") {
data[val.prop] = item[val.optionsValue];
} else {
data[val.prop] = item[val.optionsValue[0]][val.optionsValue[1]];
}
} else {
if (typeof val.optionsValue === "string") {
data[val.prop][val.showProp] = item[val.optionsValue];
} else {
data[val.prop][val.showProp] =
item[val.optionsValue[0]][val.optionsValue[1]];
}
}
this.$emit("push", item, scope, val);
},
getMaxLength(arr) {
return arr.reduce((acc, item) => {
if (item) {
const calcLen = this.getTexWidth(item);
if (acc < calcLen) {
acc = calcLen;
}
}
return acc;
}, 0);
},
getTexWidth(str) {
let width = 0;
const html = document.createElement("span");
html.innerText = str;
html.className = "getTextWidth";
document.querySelector("body").appendChild(html);
width = document.querySelector(".getTextWidth").offsetWidth;
document.querySelector(".getTextWidth").remove();
return width;
},
flexColumnWidth(label, prop) {
const arr = this.tableData.map((x) => {
if (typeof prop !== "string") {
return x[prop[0]][prop[1]];
} else {
return x[prop];
}
});
arr.push(label);
return this.getMaxLength(arr) + 60 + "px";
},
//
sortChange(data) {
this.$emit("sortChange", data);
},
//selection
handleSelectionChange(val) {
this.$emit("handleSelectionChange", val);
},
//nameemit
inlineDialog(row) {
this.$emit("inlineDialog", row);
},
//
showDetailInfo(row) {
this.showDetailDialog = true
this.showDetailData = row
this.$emit("showDetailInfo", row);
},
// jsontable
showJsonTable(row){
this.showJsonDialog = true
let _json = eval('(' + row + ')')
let _arr = []
let __initJson = (data) => {
let _init = []
for(let item in data){
_init.push({name:item,value:data[item]})
}
return _init
}
for(let item in _json){
//
if(!_json[item]){
_arr.push({name:item,value:_json[item]})
}else if(_json[item] && typeof _json[item] != 'object'){
_arr.push({name:item,value:_json[item] + ""})
}else{
//
if(Array.isArray(_json[item])){
// DETAILS todo:DETAILS使
let _value = (item).toUpperCase() == 'DETAILS' ? __initJson(_json[item][0]) : (_json[item]).join(",")
_arr.push({name:item,value:_value})
}
//
else{
let _obj_arr = __initJson(_json[item])
//
if(_obj_arr.length > 0){
_arr = [..._obj_arr]
}else{
//
_arr.push({name:item,value:""})
}
}
}
}
this.showJsonData = _arr
this.showJsonData_str = JSON.stringify(JSON.parse(JSON.stringify(this.showJsonData)), null, '\t')
this.$emit("showJsonTable", row);
},
// Json
copyJsonHandle(){
this.showJsonCopy = true
navigator.clipboard.writeText(this.showJsonData_str)
.then(() => {
this.$message.success('复制成功');
})
.catch(err => {
this.$message.error('复制失败');
});
this.$nextTick(()=>{
if(this.$refs.copyJsonTextarea_ref){
this.$refs.copyJsonTextarea_ref.focus()
this.$nextTick(()=>{
document.getElementById('copyJsonTextarea_dialog_ref').scrollTop = 0
})
}
})
},
//
buttonClick(row, index, label) {
this.$emit("buttonClick", row, index, label);
},
//table()
buttonOperationClick_left(row, item, index) {
this.$emit("buttonOperationClick_left", row, item, index);
},
//table()
buttonOperationClick_right(row, item, index) {
this.$emit("buttonOperationClick_right", row, item, index);
},
},
};
</script>
<style lang="scss" scoped>
::v-deep .uTableHeader th{
background: #f6f7fb !important;
border: none !important;
// &:last-child{
// background: unset !important;
// }
}
::v-deep .el-form-item__error{
position: relative;
}
::v-deep .el-table__fixed {
display: block-inline !important;
height: auto !important;
bottom: 13px !important;
.el-table__fixed-header-wrapper {
z-index: auto !important;
}
.el-table__fixed-body-wrapper {
z-index: auto !important;
}
}
::v-deep .el-table__fixed-right {
display: block-inline !important;
height: auto !important;
bottom: 13px !important;
.el-table__fixed-header-wrapper {
z-index: auto !important;
}
.el-table__fixed-body-wrapper {
z-index: auto !important;
}
}
::v-deep .el-table__fixed::before,
.el-table__fixed-right::before {
z-index: auto !important;
}
.spamHover {
color: #409eff;
cursor: pointer;
}
.spamHover:hover {
border-bottom: 1px solid #409eff;
color: blue;
}
.showDetailHover:hover{
color: #409eff;
}
span {
white-space: pre;
}
::v-deep .el-select {
.el-input__inner {
padding: 0 30px 0 15px;
}
.el-input__prefix {
width: 100% !important;
left: 0;
.el-button {
position: absolute;
top: 0;
right: 0;
}
}
}
.u-table::before {
height: 0px;
}
</style>

420
Code/Fe/src/components/umyTable/index.vue

@ -19,11 +19,12 @@
header-row-class-name="uTableHeader"
>
<!-- :tree-props="treeProps" height 不能共存 此组件暂不支持tree的格式-->
<!-- 操作列 -->
<!-- 操作列 左侧-->
<u-table-column
v-if="buttonOperationList"
v-if="buttonOperationList_left"
:fixed="'left'"
:width="120"
width="auto"
min-width="120px"
:align="'center'"
:header-align="'center'"
>
@ -32,11 +33,35 @@
</template>
<template slot-scope="scope">
<el-button
v-for="(itemButton, indexButton) in buttonOperationList"
v-for="(itemButton, indexButton) in buttonOperationList_left"
:key="indexButton"
type="text"
size="mini"
@click="buttonOperationClick(scope.row, itemButton, indexButton)"
@click="buttonOperationClick_left(scope.row, itemButton, indexButton)"
>{{itemButton.label}}</el-button>
</template>
</u-table-column>
<!-- 操作列 右侧-->
<u-table-column
v-if="buttonOperationList_right"
:fixed="'right'"
width="auto"
min-width="120px"
:align="'center'"
:header-align="'center'"
>
<template #header>
<span>操作</span>
</template>
<template slot-scope="scope">
<el-button
v-for="(itemButton, indexButton) in buttonOperationList_right(scope.row)"
v-show="!itemButton.hide"
:key="indexButton"
type="text"
size="mini"
:style="{color:itemButton.color || '#409EFF'}"
@click="buttonOperationClick_right(scope.row, itemButton, indexButton)"
>{{itemButton.label}}</el-button>
</template>
</u-table-column>
@ -44,6 +69,7 @@
<u-table-column v-if="isShowIndex" type="index" fixed="left" label="序号" width="50" />
<template v-for="(item, index) in TableSize">
<u-table-column
min-width="150"
:key="index"
:prop="item.showProp ? item.prop + '.' + item.showProp : item.prop"
:sortable="item.sortable"
@ -59,284 +85,36 @@
<i style="color: #f56c6c" v-if="item.rules && requiredRules">*</i>
</template>
<template slot-scope="scope">
<el-form>
<el-form-item
v-if="item.type == 'input'"
:onkeyup="itemOnKeyUp(item,searchData[item.prop])"
:prop="'details.' + scope.$index + '.' + item.prop"
:rules="item.rules"
>
<el-input
:placeholder="'请输入' + item.label"
:disabled="Boolean(item.disabled) || Boolean(scope.row['disabled'])"
v-model="scope.row[item.prop]"
@blur="
inputPlaceholder($event, item, 'blur',scope.row)
"
@focus="inputPlaceholder($event, item, 'focus')"
clearable
>
</el-input>
</el-form-item>
<!-- 输入框(数字) onkeyup: 正则表达式用于前端输入校验工作-->
<el-form-item
v-if="item.type == 'inputNumber'"
:prop="'details.' + scope.$index + '.' + item.prop"
:rules="item.rules"
>
<el-input
v-model="searchData[item.prop]"
:maxlength="item.maxlength"
:onkeyup="typeNumberOnkeyup(item,searchData[item.prop])"
clearable
:disabled="Boolean(item.disabled)"
:placeholder="'请输入' + item.label"
:prefix-icon="item.icon"
:show-password="item.showPassword"
@change="changeInput(item.prop,$event)"
@clear="clearInput(item.prop,$event)"
@blur="
inputPlaceholder($event, item, 'blur',searchData)
"
@focus="inputPlaceholder($event, item, 'focus')"
></el-input>
</el-form-item>
<el-form-item
v-if="item.type == 'objectInput'"
:prop="
'details.' + scope.$index + '.' + item.prop + '.' + item.showProp
"
:rules="item.rules"
>
<el-input
:placeholder="'请输入' + item.label"
v-model="scope.row[item.prop][item.showProp]"
:disabled="Boolean(item.disabled) || Boolean(scope.row['disabled'])"
@blur="
inputPlaceholder($event, item, 'blur', scope.row)
"
@focus="inputPlaceholder($event, item, 'focus')"
clearable
>
</el-input>
</el-form-item>
<!-- 下拉框 -->
<el-select
v-if="item.type === 'select'"
v-model="scope.row[item.prop]"
:loading="selectLoading"
:clearable="item.clearable"
:multiple="item.multiple"
:disabled="Boolean(item.disabled) || Boolean(scope.row['disabled'])"
:filterable="item.filterable"
:allow-create="item.allowCreate"
style="width: 100%"
:placeholder="'请输入' + item.label"
>
<el-option
v-for="(op, index) in selectOptions(item.options) ||
searchOptions['options']"
:label="op[item.optionsLabel] || op.label"
:value="op[item.optionsValue] || op.value"
:key="index"
></el-option>
</el-select>
<!--对象下拉框 -->
<el-select
v-if="item.type === 'objectSelect'"
v-model="scope.row[item.prop][item.showProp]"
:loading="selectLoading"
:clearable="item.clearable"
:multiple="item.multiple"
:disabled="Boolean(item.disabled) || Boolean(scope.row['disabled'])"
:filterable="item.filterable"
:allow-create="item.allowCreate"
style="width: 100%"
:placeholder="'请输入' + item.label"
>
<el-option
v-for="(op, index) in selectOptions(item.options) ||
searchOptions['options']"
:label="op[item.optionsLabel] || op.label"
:value="op[item.optionsValue] || op.value"
:key="index"
></el-option>
</el-select>
<!--查询下拉-->
<el-form-item
v-if="item.type === 'autocomplete'"
:prop="'details.' + scope.$index + '.' + item.prop"
:rules="item.rules"
>
<el-autocomplete
class="inline-input"
style="width: 100%"
:disabled="Boolean(item.disabled) || Boolean(scope.row['disabled'])"
v-model="scope.row[item.prop]"
:fetch-suggestions="
(queryString, cb) => {
querySearch(queryString, cb, item, scope);
}
"
:placeholder="'请输入' + item.label"
@select="handleSelect($event, item, scope)"
>
<!-- <template slot-scope="{item}">
<div class="name" style="color:green">{{item.value = item.name}}</div>
<div class="name" >{{item.address = item.code}}</div>
</template> -->
<el-button
v-if="item.click"
slot="append"
icon="el-icon-search"
@click="item.click({ scope, item })"
style="color: #1890ff; background-color: #ffffff"
></el-button>
</el-autocomplete>
</el-form-item>
<!-- 对象查询下拉 -->
<el-form-item
v-if="item.type === 'objectAutocomplete'"
:prop="
'details.' + scope.$index + '.' + item.prop + '.' + item.showProp
"
:rules="item.rules"
>
<el-autocomplete
class="inline-input"
style="width: 100%"
:disabled="Boolean(item.disabled) || Boolean(scope.row['disabled'])"
v-model="scope.row[item.prop][item.showProp]"
:fetch-suggestions="
(queryString, cb) => {
querySearch(queryString, cb, item, scope);
}
"
:placeholder="'请输入' + item.label"
@select="handleSelect($event, item, scope)"
>
<!-- <template slot-scope="{item}">
<div class="name" style="color:green">{{item.value = item.name}}</div>
<div class="name" >{{item.address = item.code}}</div>
</template> -->
<el-button
v-if="item.click"
slot="append"
icon="el-icon-search"
@click="item.click({ scope, item })"
style="color: #1890ff; background-color: #ffffff"
></el-button>
</el-autocomplete>
</el-form-item>
<!-- <el-form-item v-if="item.type == 'inputEnum'" :prop="item.prop">
<el-input
placeholder="请输入内容"
v-model="scope.row[item.prop]"
clearable
>
</el-input>
</el-form-item> -->
<el-form-item
v-if="item.type == 'dateTimeInput'"
:prop="'details.' + scope.$index + '.' + item.prop"
:rules="item.rules"
>
<el-date-picker
type="datetime"
v-model="scope.row[item.prop]"
placeholder="选择日期"
style="width: 100%"
:disabled="Boolean(item.disabled) || Boolean(scope.row['disabled'])"
value-format="yyyy-MM-ddTHH:mm:ss.sssZ"
format="yyyy-MM-dd"
></el-date-picker>
</el-form-item>
<el-form-item
v-if="item.type == 'objectDateTimeInput'"
:prop="'details.' + scope.$index + '.' + item.prop + '.' + item.showProp"
:rules="item.rules"
<!-- 时间转换 -->
<span v-if="item.apiBaseType == 'datetime'"
@click="showDetailInfo(scope.row[item.prop],'time')"
style="cursor: pointer;"
:title="'点击查看详情'"
class="showDetailHover"
>
<el-date-picker
type="datetime"
v-model="scope.row[item.prop][item.showProp]"
placeholder="选择日期"
style="width: 100%"
:disabled="Boolean(item.disabled) || Boolean(scope.row['disabled'])"
value-format="yyyy-MM-ddTHH:mm:ss.sssZ"
format="yyyy-MM-dd"
></el-date-picker>
</el-form-item>
<!-- table表添加按钮事件 v-show="scope.row.number == 'PRJ202210060001'" -->
<!-- <el-form-item v-if="item.type == 'button'" > -->
<div v-if="item.type == 'button'">
<el-button
v-show="scope.row[item.prop]==undefined?true:false"
type="primary"
size="mini"
@click="buttonClick(scope.row, scope.$index, item.label)"
>{{item.label}}</el-button>
</div>
<!-- </el-form-item> -->
<span v-if="item.type == 'object'">
{{ scope.row[item.prop] ? scope.row[item.prop][item.showProp] : "" }}
</span>
<span v-if="item.type == 'objectDateTime'">
{{ scope.row[item.prop]? scope.row[item.prop][item.showProp]: "" | formatDate }}
</span>
<span v-if="item.type == 'dateTime'">
{{ scope.row[item.prop] | formatDate }}
</span>
<!-- 调用主表信息 -->
<span v-else-if="item.type && item.type == 'outerMainFilter'">
{{ propsData[item.showProp] }}
</span>
<el-tag
v-if="item.type == 'tagFilter'"
:effect="'dark'"
size="medium"
class="tagFilterTypeDarkItem"
:color="scope.row[item.prop] | trigger(item.filters, 'background')"
>
{{ scope.row[item.prop] | trigger(item.filters, "label") }}
</el-tag>
<span
v-if="item.type == 'filter'"
:style="scope.row[item.prop]"
>
{{ scope.row[item.prop] | trigger(item.filters, "label", item.dictType) }}
<!-- 枚举 -->
<span v-else-if="item.isEnums">
{{ initApiEnumList(item,scope.row[item.prop]) }}
</span>
<span
v-if="item.type == 'objectFilter'"
:style="scope.row[item.prop][item.showProp]"
>
{{ scope.row[item.prop][item.showProp] | trigger(item.filters, "label") }}
<!-- 布尔 -->
<span v-else-if="item.apiBaseType == 'boolean'">
{{ scope.row[item.prop] ? '是' : '否' }}
</span>
<span v-else-if="item.type == 'filterList'" >
{{ scope.row[item.prop] | triggerList(item.filters, "label") }}
<!-- 数值 -->
<span v-else-if="item.apiBaseType == 'number'">
{{ scope.row[item.prop] }}
</span>
<!-- 可点出详情 -->
<span
v-if="item.type == 'showDetail'"
@click="showDetailInfo(scope.row[item.prop])"
style="cursor: pointer;"
:title="'点击查看详情'"
:class="{ showDetailHover: item.type == 'showDetail' }"
>{{ scope.row[item.prop] ? scope.row[item.prop] + "" : scope.row[item.prop] }}</span>
<!-- 可点出json转换的table弹窗 -->
<span
v-if="item.type == 'showJsonTable'"
@click="showJsonTable(scope.row[item.prop])"
style="cursor: pointer;"
<!-- 点击可出详情 | 点击可点出json 目前已知String|Guid-->
<span v-else
@click="showTypeHandle(initApiOtherType(scope.row[item.prop])[1],scope.row[item.prop])"
:style="initApiOtherType(scope.row[item.prop])[1] != 'show' ? 'cursor: pointer' : ''"
:title="'点击查看详情'"
:class="{ showDetailHover: item.type == 'showJsonTable' }"
>{{ scope.row[item.prop] ? scope.row[item.prop] + "" : scope.row[item.prop] }}</span>
<span
v-if="item.type == 'name' || !item.type"
@click="item.type == 'name' && inlineDialog(scope.row)"
:class="{ spamHover: item.type == 'name' }"
>{{ scope.row[item.prop] ? scope.row[item.prop] + "" : scope.row[item.prop] }}</span>
</el-form>
:class="{ showDetailHover: initApiOtherType(scope.row[item.prop])[1] != 'show' }"
>
{{ initApiOtherType(scope.row[item.prop])[0] }}
</span>
</template>
</u-table-column>
</template>
@ -350,11 +128,13 @@
:append-to-body="true"
:show-close="true"
:title="'内容详情'"
:close-on-click-modal="true"
:close-on-press-escape="true"
>
{{ showDetailData ? showDetailData + "" : showDetailData }}
</el-dialog>
<!-- json弹窗复制的json内容 -->
<!-- json弹窗 -->
<el-dialog
id="copyJsonTextarea_dialog_ref"
:visible.sync="showJsonCopy"
@ -441,15 +221,20 @@ export default {
},
},
props: {
//
buttonOperationList:{
//
buttonOperationList_left:{
type: Array,
default: null,
},
// ()
buttonOperationList_right:{
type: Function,
default: null,
},
//
showOverflowTooltip:{
type: Boolean,
default: true,
default: false,
},
// tableborder
tableBorder: {
@ -663,7 +448,7 @@ export default {
} else if (item.width == '100%') {
item.width = ''
} else {
item.width =item.width ? item.width: "150px";
item.width =item.width ? item.width: 'auto';
}
}
return widthSize
@ -810,10 +595,10 @@ export default {
this.$emit("inlineDialog", row);
},
//
showDetailInfo(row) {
showDetailInfo(row,type) {
this.showDetailDialog = true
this.showDetailData = row
this.$emit("showDetailInfo", row);
this.showDetailData = type == 'time' ? formatTimeStrToStr(row) : row
this.$emit("showDetailInfo", this.showDetailData);
},
// jsontable
showJsonTable(row){
@ -860,29 +645,86 @@ export default {
// Json
copyJsonHandle(){
this.showJsonCopy = true
if (navigator.clipboard && window.isSecureContext) {
navigator.clipboard.writeText(this.showJsonData_str)
.then(() => {
this.$message.success('复制成功');
this.$refs.copyJsonTextarea_ref.focus()
document.getElementById('copyJsonTextarea_dialog_ref').scrollTop = 0
})
.catch(err => {
this.$message.error('复制失败');
this.$refs.copyJsonTextarea_ref.focus()
document.getElementById('copyJsonTextarea_dialog_ref').scrollTop = 0
});
}else {
// text area
const textArea = document.createElement('textarea')
textArea.value = this.showJsonData_str
// 使text areaviewport
document.body.appendChild(textArea)
textArea.focus()
textArea.select()
return new Promise((resolve, reject) => {
//
document.execCommand('copy') ? resolve() : reject(new Error('出错了'))
textArea.remove()
}).then(() => {
this.$nextTick(()=>{
if(this.$refs.copyJsonTextarea_ref){
this.$message.success('复制成功');
this.$refs.copyJsonTextarea_ref.focus()
this.$nextTick(()=>{
document.getElementById('copyJsonTextarea_dialog_ref').scrollTop = 0
})
}
})
},() => {
this.$message.error('复制失败');
this.$refs.copyJsonTextarea_ref.focus()
document.getElementById('copyJsonTextarea_dialog_ref').scrollTop = 0
})
}
},
//
buttonClick(row, index, label) {
this.$emit("buttonClick", row, index, label);
},
//table
buttonOperationClick(row, item, index) {
this.$emit("buttonOperationClick", row, item, index);
//table()
buttonOperationClick_left(row, item, index) {
this.$emit("buttonOperationClick_left", row, item, index);
},
//table()
buttonOperationClick_right(row, item, index) {
this.$emit("buttonOperationClick_right", row, item, index);
},
//
initApiEnumList(item,data){
let _item_enumList = {}
item.enums_list.forEach((item,key)=>{
_item_enumList[item.value] = item.label
})
return _item_enumList[data] || '未定义'
},
// | | json
initApiOtherType(data){
try {
let _json = JSON.parse(data)
//
if(typeof _json == 'number' && _json){
return [data,'show']
}else{
return [data,'json']
}
}
//
catch(err){
return [data,'detail']
}
},
//
showTypeHandle(type,row){
if(type == 'detail')this.showDetailInfo(row)
if(type == 'json')this.showJsonTable(row)
},
},
};

53
Code/Fe/src/filters/excelOrReportsOption.js

@ -1,53 +0,0 @@
/**
*
* @returns {Array} '导入表格模板字段'
*/
// 供货商导入表格
export const supplierAsnExcel = {
// poNumber:"订单号",
// number:"发货单号",
supplierCode:"供应商代码",
planUserCode:"筹措员代码",
planArriveDate:"要求到货时间",
shipDate:"发货日期",
details:{
projectCode:"明细-项目编号",
itemCode:"明细-物品代码",
ctype:"明细-类型",
recommendErpCode:"明细-指定ERP储位",
qty:"明细-发货数量",
uom:"明细-物品单位",
lot:"明细-生产批次",
produceDate:"明细-生产时间",
expireDate:"明细-过期时间",
packingCode:"明细-箱标签",
},
remark:"订单备注",
}
// 报表地址
// const reportsUrl = "http://10.164.1.39:59088/#/reports/";
const reportsUrl = localStorage.getItem('reportsUrl')
// 报表文件地址
export const reportsAddress = {
PurchaseReceiptSummary:reportsUrl + '202211300914188516.rdlx',//采购收货汇总表
Inventory_Detail:reportsUrl + '202211291142233052.rdlx',//库存账龄明细
InventoryAccountingPeriodDetails:reportsUrl + '202211300913580741.rdlx',//库存单据明细报表
FinishedProductDeliverySummary:reportsUrl + '202211300920074461.rdlx',//成品发货汇总表
CompletionReceiptSummary:reportsUrl + '202211300919413598.rdlx',//完工收货汇总表
UnPlannedReceiptSummary:reportsUrl + '202211300921294414.rdlx',//非生产退料汇总(原计划外入库汇总)
UnplannedDeliverSummary:reportsUrl + '202211300921505958.rdlx',//非生产领料汇总(原计划外出库汇总)
Scrap_Detail:reportsUrl + '202211300912414755.rdlx',//报废明细表
PurchaseSum:reportsUrl + '202211300913268367.rdlx',//订单汇总查询
PurchaseReturnSummary:reportsUrl + '202211300925599696.rdlx',//采购退货汇总
ProductionReturnSummary:reportsUrl + '202211300918259711.rdlx',//生产退料汇总表
ProductionIssueSummary_dy:reportsUrl + '202211300917169689.rdlx',//生产发料汇总表
InventoryBlanace:reportsUrl + '202211300922434081.rdlx',//库存余额报表
InventorySummary:reportsUrl + '202211300921065163.rdlx',//盘点记录汇总表
InventoryAgingSegmentSummary:reportsUrl + '202211300912101560.rdlx',//库存账龄分段汇总表
InventoryBookDetail:reportsUrl + '202212162111466911.rdlx',//库存流水帐明细
InventoryBookSummary:reportsUrl + '202212162112124488.rdlx',//库存流水帐汇总
inventoryBalanceReportLocationCode:reportsUrl + '202211300922434082.rdlx',//库存余额报表按库位
inventoryBalanceReportLocationErpCode:reportsUrl + '202211300922434083.rdlx',//库存余额报表按ERP库位
InventoryBookSummaryLocation:reportsUrl + '202212162112124489.rdlx',//库存流水帐汇总(库位)
}

267
Code/Fe/src/filters/options.js

@ -1,267 +0,0 @@
/**
*
* @returns {Array} '权限'
*/
export function Roles(val){
const role={
// 通用
"Create": "创建",
// "Edit": "修改",
"Update": "修改",
"Delete": "删除",
// 身份标识管理(AbpIdentity)
"AbpIdentity": "身份标识管理",
// 特性管理(FeatureManagement)
"FeatureManagement": "特性管理",
// 设置管理(SettingManagement)
"SettingManagement": "设置管理",
// 租户管理(AbpTenantManagement)
"AbpTenantManagement": "租户管理",
// 认证(Auth)
"Auth": "认证",
//Auth-子集
"Department": "部门",
/**/
// 基础数据(Basedata)
"Basedata": "基础数据",
//Basedata-子集
"Currency": "货币",
"CurrencyExchange": "货币兑换",
"CustomerBom": "用户清单",
"InventoryRoute": "库存路径",
"TransactionType": "交易类型",
"ProductionLineItem": "产品类项目",
"Machine": "生产线",
"Param": "参数",
"PurchasePriceSheet": "采购价格表",
"Rule": "规则",
"Strategy": "战略",
"StrategyRule": "战略规则",
"Route": "路线",
"SalePriceSheet": "销售价格表",
"StdCostPriceSheet": "标准价格表",
"WorkShop": "车间",
"WorkGroup": "工作组",
"ItemGuideBook": "指导书",
/**/
// 库存(Inventory)
"Inventory": "库存",
//Inventory-子集
"Container": "库存容量",
"LocationCapacity": "库存可用容量",
/**/
// 任务(Job)
"Job": "任务",
//Job-子集
"CheckJob": "校验任务",
"UnplannedIssueJob":"计划外出库任务",
"UnplannedReceiptJob":"计划外入库任务",
"ProductionReturnJob":"生产退库任务",
/**/
// 仓库(Store)
"Store": "仓库",
//Store-子集
"WorkOrder": "工作订单",
"ProductionReturnNote":"生产退库记录",
"InventoryTransferNote": "调拨发货",
"Print":"打印",
"Shipments": "发货任务(天津)",
"Instruments": "器具查询(天津)",
"ReceivingRecords": "收货记录(天津)",
"DeliveryRecord": "发货记录(天津)",
"CountAdjust": "库存调整",
"UnplannedIssueRequest":"非生产退料申请",
"UnplannedReceiptRequest":"非生产领料申请",
"ProductionReturnRequest":"生产退库申请",
"PurchaseReturnRequest": "采购退货申请",
"ProductRecycleRequest": "成品回收申请",
"NoOkConvertOkNote":"不合格转合格",
"PutawayRequest": "上架申请",
/**/
// 标签(Label)
"labelsList":"标签查询",
"Label": "标签",
//Label-子集
"PalletLabel":"托盘标签",
"ProductionLabel":"生产标签",
"PurchaseLabel":"采购标签",
"SaleLabel":"销售标签",
"PalletCode":"托盘编码",
"SerialCode":"序列代码",
"CountLabel":"盘点标签",
/**/
// 消息通知(Message)
"Message": "消息通知",
//Message-子集
"Announcement":"公告",
"NotifyMessage":"通知",
"PrivateMessage":"私人消息",
"MessageType":"消息类型",
"MessageTypeSubscribe":"消息订阅类型",
"UserNotifyMessage":"用户通知消息",
/**/
// 文件存储(FileStorage)
"FileStorage":"文件存储",
//FileStorage-子集
"DataImportTask":"数据导入任务",
"DataExportTask":"数据导出任务",
/**/
// 以下数据为接口已翻译20221103
/**/
//Basedata基础数据-子集
// "Warehouse": "仓库",
// "Area": "区域",
// "AreaItem": "区域零件",
// "Bom": "物品清单",
// "InterfaceCalendar": "日历接口",
// "Calendar": "日历",
// "Company": "公司",
// "Customer": "客户",
// "CustomerItem": "客户物品",
// "WorkStation": "工作中心",
// "Team": "班组",
// "Supplier": "供应商",
// "SupplierItem": "供应商物品",
// "Project": "项目",
// "Shift": "班次",
// "Uom": "计量单位",
// "ItemBasic": "物品基础信息",
// "ItemCategory": "物品分类信息",
// "ItemPack": "物品包装信息",
// "Category": "分类",
// "Dock": "收货口",
// "LocationGroup": "库位组",
// "Location": "库位",
// "ProductionLine": "生产线",
// "Configuration": "配置",
// "ItemQuality": "物品质量信息",
// "AQL": "物品质检标准",
// "SupplierTimeWindow": "供应商时间窗口",
// "ItemStoreRelation": "库位零件关系维护",
// "CustomerAddress": "客户地址",
/**/
//Inventory库存-子集
// "Balance": "库存余额",
// "Snapshot": "库存快照",
// "Transaction": "库存事务",
// "TransferLog": "库存转移日志",
/**/
//Job任务-子集
// "PurchaseReceiptJob": "采购收货任务",
// "InspectJob": "检验任务",
// "PutawayJob": "上架任务",
// "IssueJob": "发料任务",
// "DeliverJob": "发货任务",
// "PurchaseReturnJob": "采购退货任务",
// "ProductReceiveJob": "完工收货任务",
// "CountJob": "盘点任务",
/**/
//Store仓库-子集
// "PurchaseOrder": "采购订单",
// "SaleOrder": "销售订单",
// "SupplierAsn": "供应商ASN",
// "CustomerAsn": "客户发货通知",
// "ProductionPlan": "生产计划",
// "PreparationPlan": "备料计划",
// "ProductReceiptNote": "完工收货记录",
// "OfflineSettlementNote": "下线结算记录",
// "PurchaseReceiptRequest": "到货请求",
// "PurchaseReceiptNote": "采购收货记录",
// "ReceiptAbnormalNote": "收货异常记录",
// "PurchaseReturnNote": "采购退货记录",
// "PutawayNote": "上架记录",
// "MaterialRequest": "要料申请",
// "IssueNote": "发料记录",
// "UnplannedReceiptNote": "计划外入库记录",
// "UnplannedIssueNote": "计划外出库记录",
// "IsolationNote": "隔离记录",
// "ScrapNote": "报废记录",
// "DeliverPlan": "发货计划",
// "DeliverRequest": "发货申请",
// "DeliverNote": "发货记录",
// "CountPlan": "盘点计划",
// "CountNote": "盘点记录",
// "CountAdjustNote": "盘点差异调整记录",
// "InspectRequest": "报检单",
// "InspectNote": "检验记录",
// "InspectAbnormalNote": "质量异常记录",
// "ProductRecycleNote": "成品回收记录",
// "CustomerReturnNote": "客户退库记录",
/**/
// 以下数据接口数据不存在20221103
/**/
// "InventoryLocationCapacity": "库位可用容量",
// "Workshop": "车间",
// "FISDeliverRequest":"FIS发货申请",
// "FISDeliverNote":"FIS发货记录",
// "Occupied": "已占用库存",
// "Predictable": "预填充库存",
// "TracebackNote": "追溯记录",
// "StockReturnNote": "退库记录",
// "UserManage": "用户",
// "RoleManage": "权限控制",
// "Identity": "身份",
// "management": "管理",
// "Role management": "角色",
// // "Change": "修改",
// "Change permissions": "修改权限",
// "User management": "用户",
// "Manage Host features": "管理主机功能",
// "Tenant management": "租户",
// "Manage features": "管理功能",
// "Manage connection strings": "管理连接",
// "Permission": "权限",
// "PdaUserManage": "PDA控制",
// "Param": "参数",
// "Rule ": "规则",
// "DocumentSetting": "文档设置",
// "ItemSafetyStock": "物品安全库存",
// // "UserDepartment": "用户部门对应关系",
// "accountPeriodNote": "账期信息",
// "UserNotifyMessage":"用户消息类型关系",
// //调拨-线边仓
// "lineSideWarehouseAllocationRequest":"线边仓调拨申请",
// "lineSideWarehouseAllocationConfirm":"线边仓调拨确认",
// "lineSideWarehouseAllocationNote":"线边仓调拨记录",
// //调拨-储位间
// "interStorageAllocationApply":"储位间调拨申请",
// "interStorageAllocationConfirm":"储位间调拨确认",
// "interStorageAllocationNote":"储位间调拨记录",
// //调拨-客户储位
// "customerStorageAllocationRequest":"客户储位调拨申请",
// "customerStorageAllocationConfirm":"客户储位调拨确认",
// "customerStorageAllocationNote":"客户储位调拨记录",
// //东阳-追溯记录
// "backFlushNote":"追溯记录",
// //东阳-退拆
// "customerDismantle":"退拆申请",
// "customerDismantleNote":"退拆记录",
// //回收料
// "materialsAdjustment":"回收料调整记录",
// "recycledMaterialsAdjustmentApply":"回收料调整申请",
// "recycledMaterialsReceipt":"回收料收货记录",
// // 自定义
// "beforeGroundingReturnNote": "上架前退货记录",
// // 非生产领料
// "pickingRequest":"非生产领料申请",
// // 非生产退料
// "materialReturnRequest":"非生产退料申请"
}
return role[val]
}

15
Code/Fe/src/filters/status.js

@ -1445,6 +1445,21 @@ export function whetherOrNot(index, prop) {
}
return Enum(filter, index, prop)
}
export function whetherOrNotForNum(index, prop) {
let filter = {
1: {
label: "是",
value: 1,
background:"#31BB99",
},
0: {
label: "否",
value: 0,
background:"#EC5B28",
},
}
return Enum(filter, index, prop)
}
/**
* @returns {object} '基本状态'
*/

4
Code/Fe/src/filters/statusType.js

@ -1,7 +1,5 @@
import * as status from "./status"
import * as options from "./options"
const filters = {
...status,
...options
...status
}
export default filters

12
Code/Fe/src/layout/components/Navbar.vue

@ -38,10 +38,10 @@
<router-link to="/">
<el-dropdown-item>系统首页</el-dropdown-item>
</router-link>
<el-dropdown-item divided @click.native="handleClick">
<!-- <el-dropdown-item divided @click.native="handleClick">
<span style="display: block">个人中心</span>
</el-dropdown-item>
<el-dropdown-item @click.native="logout">
</el-dropdown-item> -->
<el-dropdown-item divided @click.native="logout">
<span style="display: block">退出登录</span>
</el-dropdown-item>
</el-dropdown-menu>
@ -78,8 +78,10 @@ export default {
this.$store.dispatch("app/toggleSideBar");
},
async logout() {
await this.$store.dispatch("user/logout");
this.$router.push(`/login?redirect=${this.$route.fullPath}`);
await this.$store.dispatch("user/logout")
// this.$router.push(`/login?redirect=${this.$route.fullPath}`);
// this.$router.push(`/login?redirect=${this.$route.fullPath}&isAutoLogin=false`)
this.$router.push(`/login?isAutoLogin=false`)
},
handleClick() {

1
Code/Fe/src/mixins/LoadingMixins.js

@ -21,6 +21,7 @@ export const LoadingMixins = {
importDialog: false, //导入
exportDialog: false, //导出
handleFromDialog: false, //执行生成
detailInfoDialog:false,//明细-查看详情弹窗
},
}
}

29
Code/Fe/src/mixins/TableHeaderMixins.js

@ -1,8 +1,6 @@
import {
getPageList,
postExport,
postUpdateAvailableCapacity,
fileStorage
}
from "@/api/wms-api"
import * as allUrlOption from '@/utils/baseData/urlOption'
@ -40,7 +38,7 @@ export const TableHeaderMixins = {
let _params = {
isRedundance:Boolean(form.isRedundance),
isDetailExport:Boolean(form.isDetail),
userId:JSON.parse(localStorage.getItem("currentUserInfo")).id
userId:this.$store.getters.currentUserInfo.id
}
let _exportUrl = this.URLOption_export ? this.URLOption_export : this.URLOption_base;
let _special = this.URLOption_export ? true : false
@ -99,28 +97,6 @@ export const TableHeaderMixins = {
else if (val == 'filterForDetail'){
this.changeFilterForDetailShow(true)
}
//更新可用容量
else if (val == 'refresh-capacity') {
this.Loading.appMainLoading = true
let count = 0
this.tableData.forEach(element => {
postUpdateAvailableCapacity({
locationCode: element.locationCode
}, this.URLOption_base).then(res => {
count += 1
if (count == this.tableData.length) {
this.Loading.appMainLoading = false
this.paging()
}
}).catch(err => {
count += 1
if (count == this.tableData.length) {
this.Loading.appMainLoading = false
this.paging()
}
})
})
}
// 自定义按钮 // 批量打印 ; 不合格转合格
else if(val == 'custom'){
item.customHandle()
@ -301,12 +277,13 @@ export const TableHeaderMixins = {
* 表头字段设置
* @param {*} data 数据
* @param {*} type 设置来源
* list_api: 表头来自api的列表 detail_api: 表头来自api列表的明细
* list_api: 表头来自api的列表 detail_api: 表头来自api列表的明细 detailPage_api表头来自api的明细页面列表
* list: 表头固定的列表 detail: 表头固定列表的明细
*/
rowDrop(data,type) {
if(!type || type == 'list_api'){ this.apiColumns_Table = data }
if(type && type == 'detail_api'){ this.apiColumns_DetailsTable = data }
// if(type && type == 'detailPage_api'){ this.apiColumns_DetailsPage = data }
if(type && type == 'list'){ this.tableColumns = data }
if(type && type == 'detail'){ this.detailsTableColumns = data }
}

281
Code/Fe/src/mixins/TableMixins.js

@ -1,9 +1,9 @@
import {
getPageList,
getDetailed,
allSupplierByCodes,
postDelete
} from '@/api/wms-api'
import { zhApiColumnsLable,firstWordSizeChange } from '@/utils/index'
import * as allUrlOption from '@/utils/baseData/urlOption'
export const tableMixins = {
data() {
@ -42,34 +42,116 @@ export const tableMixins = {
apiColumns_Table:null,
apiColumns_DesTions:null,
apiColumns_DetailsTable:null,
// apiColumns_DetailsPage:null,
//主表-列表
URLOption_base:allUrlOption[this.$route.name].baseURL,
//主表-明细
URLOption_detail:allUrlOption[this.$route.name].detailURL,
//明细列表(主表明细找枚举转义使用)
URLOption_detailList:allUrlOption[this.$route.name].detailListURL,
// 主表-明细-筛选数据同步回显
detailSearchDataFE:null,
// 主表-操作列
operationButtonsTable:[{label:'查看详情',name:'info'}]
buttonOperationClick_leftBase:[{label:'查看详情',name:'info'}]
}
},
methods: {
// 主表-右侧操作列基础按钮
buttonOperationList_rightBase(data){
return [{
label:'编辑',
name:'edit',
},{
label:'删除',
name:'delete',
color:'red'
}]
},
// 主表-右侧操作列基础按钮操作
buttonOperationClick_right(row,item){
// 编辑
if (item.name == "edit") {
this.formTitle = this.$route.meta.title + "编辑";
this.formReveal = false
this.theEvent = "edit"
const listAssign = (arr1, arr2) => {
Object.keys(arr1).forEach(item => {
arr1[item] = arr2[item]
})
}
listAssign(this.editFormData, row)
this.displayDialog.editDialog = true
}
// 删除
else if (item.name == "delete"){
this.$confirm('此操作将永久删除该消息, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.Loading.tableLoading = true
let _url = this.URLOption_delete ? this.URLOption_delete : this.URLOption_base + '/delete-by-id'
postDelete(row.id, _url).then(res => {
this.$successMsg('删除成功!')
this.Loading.tableLoading = false
this.paging()
}).catch(err => {
this.Loading.tableLoading = false
})
}).catch(() => {
this.Loading.tableLoading = false
});
}
},
// 获取通过api的表头数据,不可以在初始化处理,因为接口返回问题
initApiColumns(tableColumns_api,tabsDesTions_api,detailsTableColumns_api){
// 赋值表头数据
this.apiColumns_Table = this.initTableColumns(tableColumns_api[this.$route.name])
this.apiColumns_DesTions = tabsDesTions_api[this.$route.name]
this.apiColumns_DetailsTable = this.initTableColumns(detailsTableColumns_api[this.$route.name],'detail_api')
// initApiColumns(table,des,detailsTable,detailsPage){
// // 赋值表头数据
// // if(table && table[this.$route.name])this.apiColumns_Table = this.initTableColumns(table[this.$route.name])
// if(des && des[this.$route.name])this.apiColumns_DesTions = des[this.$route.name]
// if(detailsTable && detailsTable[this.$route.name])this.apiColumns_DetailsTable = this.initTableColumns(detailsTable[this.$route.name],'detail_api')
// if(detailsPage && detailsPage[this.$route.name])this.apiColumns_DetailsPage = this.initTableColumns(detailsPage[this.$route.name],'detailPage_api')
// },
// get-dto-column-type接口表头类型初始化
initApiColumnsForDto(list,titleName){
let data = this.$store.getters.dtoColumnTypes
let _coloums = data[titleName].S
let _Columns_Table = []
if(_coloums){
let _data = _coloums.dtoList
_data.forEach(item=>{
let _item = item
_item.label = zhApiColumnsLable(titleName + item.name) || item.name
_item.prop = firstWordSizeChange(item.name)
// 如果list接口存在数据 ,与list接口返回字段比较处理,list接口存在的话则追加
let _if = firstWordSizeChange(item.name) != 'details'
if(list && list.length > 0){
_if = firstWordSizeChange(item.name) in list && firstWordSizeChange(item.name) != 'details'
}
if(_if){
_Columns_Table.push(_item)
}
})
}
return _Columns_Table
},
//渲染数据
paging(callback) {
this.Loading.tableLoading = true;
this.PageListParams.SkipCount = (this.oldSkipCount - 1) * this.PageListParams.MaxResultCount
getPageList(this.PageListParams, this.URLOption_base).then(res => {
getPageList(this.PageListParams, this.URLOption_base)
.then(res=>{
// 表头处理
let _Columns = this.initApiColumnsForDto(res,this.$route.name)
this.apiColumns_Table = this.initTableColumns(_Columns)
this.apiColumns_DesTions = _Columns
// 页面数据处理
if(res){
this.tableData = res.items
this.totalCount = res.totalCount
}
this.pagingCallback(callback)
}).catch(err => {
})
.catch(err=>{
this.Loading.tableLoading = false
})
},
@ -103,6 +185,7 @@ export const tableMixins = {
},
//点击Table行内名称
inlineDialog(val) {
if(this.$refs.currenDrawer_Ref)this.$refs.currenDrawer_Ref.closeDetailInfo()
// 打开抽屉后,点击其他信息,默认回到详情位置上,避免特殊需要重新点击获取接口的tag页面数据不更新
this.firstTabs = 'xq'
//打开抽屉
@ -110,27 +193,38 @@ export const tableMixins = {
this.Loading.DrawerLoading = true
this.displayDialog.detailsDialog = true;
let _url = this.URLOption_detail ? this.URLOption_detail : this.URLOption_base
getDetailed(val.id, _url).then(res => {
if (res.details) {
getDetailed(val.id, _url)
.then(res=>{
// 表头处理
let _parentName = this.URLOption_detailList.substr(0,this.URLOption_detailList.indexOf('/'))
this.apiColumns_DetailsTable = this.initTableColumns(this.initApiColumnsForDto(res.details[0],_parentName),'detail_api')
// 打印使用的全部数据存储
this.tableDataDetails = JSON.parse(JSON.stringify(res))
// 前端分页处理
this.propsData = this.detailListPageFromFE(res)
} else {
this.propsData = res
}
if (res.details) {
if(this.$refs.currenDrawer_Ref){
this.$refs.currenDrawer_Ref.getDetailList(res,()=>{
this.inlineDialogCallback()
}).catch(err => {
},()=>{
this.Loading.DrawerLoading = false
})
}
}else{
this.Loading.DrawerLoading = false
}
})
.catch(err=>{
this.Loading.DrawerLoading = false
})
},
// 前端分页处理
detailListPageFromFE(data){
let linshiTableDataDetails = JSON.parse(JSON.stringify(data))
this.totalCountDetails = data.details.length
// 删除除当前页面最大数以外数据
linshiTableDataDetails.details.splice(this.MaxResultCountDetails,this.totalCountDetails);
return linshiTableDataDetails
},
// detailListPageFromFE(data){
// let linshiTableDataDetails = JSON.parse(JSON.stringify(data))
// this.totalCountDetails = data.details.length
// // 删除除当前页面最大数以外数据
// linshiTableDataDetails.details.splice(this.MaxResultCountDetails,this.totalCountDetails);
// return linshiTableDataDetails
// },
// 明细 分页 接收分页组件emit改变每页最大页数
alterResultCountDetails(val) {
this.Loading.DrawerLoading = true
@ -159,70 +253,6 @@ export const tableMixins = {
handleSelectionChange(val) {
this.multipleSelection = val;
},
// 获取供应商信息过滤tableData
getSupplierByCodesHandle_table() {
for(let i=0;i<this.tableColumns.length;i++){
if(this.tableColumns[i].prop == 'supplierName' || this.tableColumns[i].prop == "supplierAddress"){
let _allSuCode = []
this.tableData.forEach((item)=>{
if(item.supplierCode && item.supplierCode.length > 0 && _allSuCode.indexOf(item.supplierCode) < 0){
_allSuCode.push(item.supplierCode)
}
})
if(_allSuCode.length <= 0){
this.Loading.tableLoading = false
return
}
allSupplierByCodes(_allSuCode).then(res => {
let _all = []
res.forEach(item=>{
_all[item.code] = item
})
this.tableData.forEach(item=>{
if(_all[item.supplierCode]){
this.$set(item,"supplierName", _all[item.supplierCode].name)
this.$set(item,"supplierAddress", _all[item.supplierCode].address)
this.$set(item,"supplierShortName", _all[item.supplierCode].shortName)
}
})
this.Loading.tableLoading = false
}).catch(err => {
console.log(err)
this.Loading.tableLoading = false
})
return
}else{
this.Loading.tableLoading = false
}
}
},
// 获取供应商信息过滤propsData
getSupplierByCodesHandle_props() {
for(let i=0;i<this.tabsDesTions.length;i++){
if(!this.propsData.supplierCode){
this.Loading.DrawerLoading = false
return
}
if(this.tabsDesTions[i].prop == 'supplierName' || this.tabsDesTions[i].prop == "supplierAddress"){
let _allSuCode = [this.propsData.supplierCode]
this.Loading.DrawerLoading = true
allSupplierByCodes(_allSuCode).then(res => {
this.Loading.DrawerLoading = false
if(res.length > 0){
this.$set(this.propsData,"supplierName", res[0].name)
this.$set(this.propsData,"supplierAddress", res[0].address)
this.$set(this.propsData,"supplierShortName", res[0].shortName)
}
}).catch(err => {
console.log(err)
this.Loading.DrawerLoading = false
})
return
}else{
this.Loading.DrawerLoading = false
}
}
},
// 主列表操作列按钮执行方法
/**
*
@ -230,7 +260,7 @@ export const tableMixins = {
* @param {*} item 按钮信息
* @param {*} index 按钮索引
*/
buttonOperationClick(row, item, index) {
buttonOperationClick_left(row, item, index) {
// 获取当前行数据,赋值给 propsData
this.propsData = row
// 查看详情
@ -279,49 +309,46 @@ export const tableMixins = {
pagingCallback(callback){
this.Loading.tableLoading = false
if(callback)callback()
// this.getSupplierByCodesHandle_table()
},
// 筛选前端查询
detailFiltersSearch(options){
let _item = options.item;
// 重置
if(_item.name == 'reset' || _item.name == 'moreList-reset'){
this.propsData = this.detailListPageFromFE(this.tableDataDetails)
//关闭高级筛选
if(options.vm_moreList){options.vm_moreList.changeMoreListShow(false)}
// 同步当前列表数据请求接口的筛选条件
this.detailSearchDataFE = {}
this.detailSearchDataFE.moreList = {filters:JSON.parse(JSON.stringify([]))}
}
// 查询
if( _item.name == 'search' || _item.name == 'moreList-search'){
let _searchObj = {}
let searchData = options.data_moreList.filters;
console.log(299,searchData)
searchData.forEach(item=>{
_searchObj[item.column] = item.value
})
const productFilter = (data, params) => data.filter(function(item){
return Object.keys(params).every(function(key){
return item[key]!=undefined && item[key]==params[key] //可以相应修改条件
})
})
let _allData = JSON.parse(JSON.stringify(this.tableDataDetails))
let _filterList = productFilter(_allData.details,_searchObj)
_allData.details = _filterList
this.propsData = this.detailListPageFromFE(_allData)
//关闭高级筛选
if(options.vm_moreList){options.vm_moreList.changeMoreListShow(false)}
// 同步当前列表数据请求接口的筛选条件
this.detailSearchDataFE = {}
this.detailSearchDataFE.moreList = {filters:JSON.parse(JSON.stringify(searchData))}
}
// return res
},
// detailFiltersSearch(options){
// let _item = options.item;
// // 重置
// if(_item.name == 'reset' || _item.name == 'moreList-reset'){
// this.propsData = this.detailListPageFromFE(this.tableDataDetails)
// //关闭高级筛选
// if(options.vm_moreList){options.vm_moreList.changeMoreListShow(false)}
// // 同步当前列表数据请求接口的筛选条件
// this.detailSearchDataFE = {}
// this.detailSearchDataFE.moreList = {filters:JSON.parse(JSON.stringify([]))}
// }
// // 查询
// if( _item.name == 'search' || _item.name == 'moreList-search'){
// let _searchObj = {}
// let searchData = options.data_moreList.filters;
// searchData.forEach(item=>{
// _searchObj[item.column] = item.value
// })
// const productFilter = (data, params) => data.filter(function(item){
// return Object.keys(params).every(function(key){
// return item[key]!=undefined && item[key]==params[key] //可以相应修改条件
// })
// })
// let _allData = JSON.parse(JSON.stringify(this.tableDataDetails))
// let _filterList = productFilter(_allData.details,_searchObj)
// _allData.details = _filterList
// this.propsData = this.detailListPageFromFE(_allData)
// //关闭高级筛选
// if(options.vm_moreList){options.vm_moreList.changeMoreListShow(false)}
// // 同步当前列表数据请求接口的筛选条件
// this.detailSearchDataFE = {}
// this.detailSearchDataFE.moreList = {filters:JSON.parse(JSON.stringify(searchData))}
// }
// // return res
// },
// 点击抽屉,获取明细后全局通用操作
inlineDialogCallback(){
this.Loading.DrawerLoading = false
// this.getSupplierByCodesHandle_props()
}
}
}

2
Code/Fe/src/mixins/drawerMixins.js

@ -28,6 +28,8 @@ export const drawerMixins = {
propsData: {},
URLOption_base:allUrlOption[this.$route.name].baseURL,
URLOption_delete:allUrlOption[this.$route.name].deleteURL,
// 主表-明细-操作列
operationButtonsDetail:[{label:'查看详情',name:'info'}],
}
},
methods: {

4
Code/Fe/src/mixins/mixins.js

@ -58,8 +58,8 @@ export const mixins = {
let _list_defalut = columnsData ? columnsData : this.$isTableColumns[this.$route.name]
let _type = type ? type : 'list_api'
if(!_list_defalut)return
let _local = localStorage.getItem('file_Columns_' + _type + '_' + JSON.parse(localStorage.getItem('currentUserInfo')).userName + '_' + this.$route.name)
let _list_local = JSON.parse(localStorage.getItem('file_Columns_' + _type + '_' + JSON.parse(localStorage.getItem('currentUserInfo')).userName + '_' + this.$route.name))
let _local = localStorage.getItem('file_Columns_' + _type + '_' + this.$store.getters.currentUserInfo.userName + '_' + this.$route.name)
let _list_local = JSON.parse(localStorage.getItem('file_Columns_' + _type + '_' + this.$store.getters.currentUserInfo.userName + '_' + this.$route.name))
let _new_list = [] //格式化后的数据
// 如果没有缓存则直接为默认值
if(!_local){

2
Code/Fe/src/mixins/newAndEdiDialogMixins.js

@ -71,7 +71,7 @@ export const newAndEdiDialogMixins = {
break;
case false:
if(!_updata && !this.URLOption_updata){_url = _url + '/update-by-id'}
postUpdate(this.editFormData, this.propsData.id, _url).then(res => {
postUpdate(this.editFormData, this.editFormData.id, _url).then(res => {
this.propsData = res
this.Loading.newAndEdiLoading = false
this.FormResult("success")

90
Code/Fe/src/permission - 副本.js

@ -1,90 +0,0 @@
import router from './router'
import store from './store'
import {
Message
} from 'element-ui'
import NProgress from 'nprogress' // progress bar
import 'nprogress/nprogress.css' // progress bar style
import {
getToken
} from '@/utils/auth' // get token from cookie
import getPageTitle from '@/utils/get-page-title'
import {
asyncRoutes
} from '@/router'
NProgress.configure({
showSpinner: false
}) // NProgress Configuration
const whiteList = ['/login', '/auth-redirect', '/testForm'] // no redirect whitelist
router.beforeEach(async (to, from, next) => {
// 添加路由信息,方便代码修改定位
// console.log('----------------' + to.meta.title + '-----------------------'+ to.fullPath.substring(to.fullPath.lastIndexOf('-')+1,to.fullPath.length) + '.vue' );
// start progress bar
NProgress.start()
// set page title
document.title = getPageTitle()
next()
// determine whether the user has logged in
// todo-new:等获取token接口恢复后做处理
const hasRoles =await store.getters.roles && await store.getters.roles.length > 0
if (hasRoles) {
next()
} else {
try {
// get user info
// note: roles must be a object array! such as: ['admin'] or ,['developer','editor']
// 如果缓存中没有 interfaceBoardColumnsNames(接口监控看板表头信息) 的缓存数据 则退出登录
let _interfaceBoardColumnsNames = localStorage.getItem("interfaceBoardColumnsNames")
if(!_interfaceBoardColumnsNames || _interfaceBoardColumnsNames == 'undefined' || _interfaceBoardColumnsNames == 'null'){
await store.dispatch('user/logout')
next(`/login?redirect=${to.path}`)
NProgress.done()
}
const {
roles
} = await store.dispatch('user/getInfo')
// generate accessible routes map based on roles
// const accessRoutes = await store.dispatch('permission/generateRoutes', localStorage.getItem('userId'))
// router.addRoutes(accessRoutes)
// 原码 防止刷新出现空白页(系统暂无出现所以注释)
// const accessRoutes = await store.dispatch('permission/generateRoutes', roles)
// router.addRoutes(accessRoutes)
// hack method to ensure that addRoutes is complete
// set the replace: true, so the navigation will not leave a history record
next({
...to,
replace: true
})
} catch (error) {
// remove token and go to login page to re-login
await store.dispatch('user/resetToken')
Message.error(error || 'Has Error')
next(`/login?redirect=${to.path}`)
NProgress.done()
}
}
})
router.afterEach(() => {
// element-ui 使用 Tooltip 提示时候,更换页面,提示依旧存在偶现bug处理。
const mytooltipList = document.querySelectorAll('.el-tooltip__popper') // 获取页面所有tooltip的dom集合
setTimeout(() => {
mytooltipList.forEach((value) => {
value.style.display = 'none'
if(value.parentElement){
value.parentElement.removeChild(value)
}
})
}, 1000)
// finish progress bar
NProgress.done()
})

178
Code/Fe/src/permission-0725.js

@ -0,0 +1,178 @@
import router from './router'
import store from './store'
import { Message } from 'element-ui'
import NProgress from 'nprogress' // progress bar
import 'nprogress/nprogress.css' // progress bar style
import { getToken } from '@/utils/auth' // get token from cookie
import getPageTitle from '@/utils/get-page-title'
import { asyncRoutes } from '@/router'
import { login,getUsersByUserName } from "@/api/wms-auth"
NProgress.configure({
showSpinner: false
}) // NProgress Configuration
router.beforeEach(async (to, from, next) => {
// start progress bar
NProgress.start()
// set page title
document.title = getPageTitle()
// 获取枚举数据
if(!store.getters.enumList || store.getters.enumList.length <= 0){
await store.dispatch('definition/getDefinitionConfig')
}
// // 获取表头转义
// if(!store.getters.columZHList || store.getters.columZHList.length <= 0){
// await store.dispatch('definition/getColumZHList')
// }
// 判断是否自动登录
let isAutoLogin = JSON.parse(localStorage.getItem('isAutoLogin'))
const interfaceBoardColumnsNames = localStorage.getItem("interfaceBoardColumnsNames")
// 如果路径中有isAutoLogin参数则优先,否则读取配置文件中的isAutoLogin参数
let _url_isAutoLogin = to.query.isAutoLogin
if( _url_isAutoLogin== 'false' || _url_isAutoLogin == 'true'){
isAutoLogin = JSON.parse(_url_isAutoLogin)
}
// 是否有用户信息:
const userInfo = store.getters.currentUserInfo
// 1、如果没有判断是否为自动登录(是自动登录则自动执行登录,账号密码为配置信息中的值,不是自动登录则跳到登录页)
// 2、有/没有:则检查是否有api接口的表头数据,没有的话重新获取
if(userInfo){
console.log('有store.getters.currentUserInfo',store.getters.currentUserInfo)
if(store.getters.permission_routes && store.getters.permission_routes.length > 0){
console.log('有store.getters.permission_routes',store.getters.permission_routes)
next()
}
else{
console.log('没有store.getters.permission_routes',store.getters.permission_routes)
const accessRoutes = await store.dispatch('permission/getApiColumnsNames')
router.addRoutes(accessRoutes)
next({
...to,
query:{
loginName:to.query.loginName,
isAutoLogin:to.query.isAutoLogin,
isSinglePage:to.query.isSinglePage
},
replace: true
})
}
}else{
// console.log('没有store.getters.currentUserInfo',store.getters.currentUserInfo)
if(!interfaceBoardColumnsNames){
console.log('没有interfaceBoardColumnsNames',interfaceBoardColumnsNames)
await store.dispatch('definition/getColumZHList')
// const accessRoutes = await store.dispatch('permission/getApiColumnsNames')
// router.addRoutes(accessRoutes)
next({
...to,
query:{
loginName:to.query.loginName,
isAutoLogin:to.query.isAutoLogin,
isSinglePage:to.query.isSinglePage
},
replace: true
})
}
if(isAutoLogin || to.query.loginName){
console.log('有自动登录',isAutoLogin,to.query.loginName)
// let loginForm= {
// userNameOrEmailAddress:localStorage.getItem("userNameOrEmailAddress"),
// password:localStorage.getItem("client_secret"),
// // rememberMe:true,
// // grant_type: 'password',
// // client_id: 'Auth_App',
// }
// // store.dispatch('user/login', loginForm).then(() => {
// login(loginForm).then(()=>{
let _username = to.query.loginName || localStorage.getItem("isLoginName") || localStorage.getItem("userNameOrEmailAddress")
if(to.path != '/login'){
await store.dispatch('user/getUserInfo',_username).then(()=>{
next({
...to,
query:{
loginName:to.query.loginName,
isAutoLogin:to.query.isAutoLogin,
isSinglePage:to.query.isSinglePage
},
replace: true
})
}).catch(()=>{
next()
// next({
// path:'/login',
// query:{
// isAutoLogin:to.query.isAutoLogin,
// isSinglePage:to.query.isSinglePage
// },
// replace: true
// })
// next(`/login?loginName=${to.query.loginName}&isAutoLogin=${to.query.isAutoLogin}`)
// next(`/login`)
Message.error('获取用户信息失败,请重试!')
})
}else{
next()
// next({
// ...to,
// query:{
// loginName:to.query.loginName,
// isAutoLogin:to.query.isAutoLogin,
// isSinglePage:to.query.isSinglePage
// },
// replace: true
// })
}
// })
// .catch((error) => {
// console.log('登录失败')
// })
}
else{
console.log('不自动登录',isAutoLogin,to.query.loginName)
if (to.path != '/login') {
Message.error('获取用户信息失败,请重新登录')
next({
path:'/login',
query:{
isAutoLogin:to.query.isAutoLogin,
loginName:to.query.loginName,
isSinglePage:to.query.isSinglePage
},
replace: true
})
// next(`/login?loginName=${to.query.loginName}&isAutoLogin=${to.query.isAutoLogin}`)
// next(`/login`)
}else{
// next({
// ...to,
// query:{
// isAutoLogin:to.query.isAutoLogin,
// loginName:to.query.loginName,
// },
// replace: true
// })
next()
}
}
NProgress.done()
}
})
router.afterEach(() => {
// element-ui 使用 Tooltip 提示时候,更换页面,提示依旧存在偶现bug处理。
const mytooltipList = document.querySelectorAll('.el-tooltip__popper') // 获取页面所有tooltip的dom集合
setTimeout(() => {
mytooltipList.forEach((value) => {
value.style.display = 'none'
if(value.parentElement){
value.parentElement.removeChild(value)
}
})
}, 1000)
// finish progress bar
NProgress.done()
})

194
Code/Fe/src/permission.js

@ -1,36 +1,41 @@
import router from './router'
import store from './store'
import {
Message
} from 'element-ui'
import { Message } from 'element-ui'
import NProgress from 'nprogress' // progress bar
import 'nprogress/nprogress.css' // progress bar style
import {
getToken
} from '@/utils/auth' // get token from cookie
import { getToken } from '@/utils/auth' // get token from cookie
import getPageTitle from '@/utils/get-page-title'
import {
asyncRoutes
} from '@/router'
import { getInterfaceBoard } from "@/api/wms-interface"
import { asyncRoutes } from '@/router'
import { login,getUsersByUserName } from "@/api/wms-auth"
NProgress.configure({
showSpinner: false
}) // NProgress Configuration
const whiteList = ['/login', '/auth-redirect', '/testForm'] // no redirect whitelist
router.beforeEach(async (to, from, next) => {
// 添加路由信息,方便代码修改定位
// console.log('----------------' + to.meta.title + '-----------------------'+ to.fullPath.substring(to.fullPath.lastIndexOf('-')+1,to.fullPath.length) + '.vue' );
// start progress bar
NProgress.start()
// set page title
document.title = getPageTitle()
// 获取表头转义
if(!store.getters.columZHList || store.getters.columZHList.length <= 0){
await store.dispatch('definition/getColumZHList')
}
// 获取菜单数据
if(!store.getters.permission_routes || store.getters.permission_routes.length <= 0){
const accessRoutes = await store.dispatch('permission/getApiColumnsNames')
router.addRoutes(accessRoutes)
}
// 获取枚举数据
if(!store.getters.enumList || store.getters.enumList.length <= 0){
await store.dispatch('definition/getDefinitionConfig')
}
// 是否有用户信息:
const userInfo = store.getters.currentUserInfo
// 判断是否自动登录
let isAutoLogin = JSON.parse(localStorage.getItem('isAutoLogin'))
// 如果路径中有isAutoLogin参数则优先,否则读取配置文件中的isAutoLogin参数
@ -38,13 +43,19 @@ router.beforeEach(async (to, from, next) => {
if( _url_isAutoLogin== 'false' || _url_isAutoLogin == 'true'){
isAutoLogin = JSON.parse(_url_isAutoLogin)
}
let userInfo = localStorage.getItem('currentUserInfo')
let _zh = localStorage.getItem('columnsApiNamesZh')
// 是否有用户信息:
// 1、如果没有判断是否为自动登录(是自动登录则自动执行登录,账号密码为配置信息中的值,不是自动登录则跳到登录页)
// 2、如果有用户信息:则检查是否有api接口的表头数据,没有的话重新获取
if(!userInfo){
if(to.path == '/login'){
console.log('-------当前路由为登录页-------')
next()
}else{
console.log('-------当前路由不是登录页-------')
if(userInfo){
console.log('-------当前有用户信息-------',userInfo)
next()
}else{
console.log('-------当前没有用户信息-------',userInfo)
if(isAutoLogin || to.query.loginName){
let _username = to.query.loginName || localStorage.getItem("isLoginName") || localStorage.getItem("userNameOrEmailAddress")
console.log('-------要求自动登录-------',isAutoLogin,to.query.loginName,_username)
// let loginForm= {
// userNameOrEmailAddress:localStorage.getItem("userNameOrEmailAddress"),
// password:localStorage.getItem("client_secret"),
@ -52,121 +63,52 @@ router.beforeEach(async (to, from, next) => {
// // grant_type: 'password',
// // client_id: 'Auth_App',
// }
// store.dispatch('user/login', loginForm).then(() => {
// // store.dispatch('user/login', loginForm).then(() => {
// login(loginForm).then(()=>{
getUsersByUserName(localStorage.getItem("userNameOrEmailAddress")).then(res=>{
// todo:currentUserInfo全程需要优化
localStorage.setItem("currentUserInfo", JSON.stringify(res));
})
.catch(err => {
console.log('获取用户信息失败,请重试')
await store.dispatch('user/getUserInfo',_username).then(()=>{
console.log("-------用户信息获取成功-------")
next({
...to,
query:{
loginName:to.query.loginName,
isAutoLogin:to.query.isAutoLogin,
isSinglePage:to.query.isSinglePage
},
replace: true
})
// 提前获取接口监控看板表头数据并存储
getInterfaceBoard().then(result => {
localStorage.setItem("interfaceBoardColumnsNames", JSON.stringify(result.resources[_zh].texts));
next('/')
})
.catch(err => {
console.log('获取表头失败,请重试')
}).catch(()=>{
next()
// next({
// path:'/login',
// query:{
// isAutoLogin:to.query.isAutoLogin,
// isSinglePage:to.query.isSinglePage
// },
// replace: true
// })
// next(`/login?loginName=${to.query.loginName}&isAutoLogin=${to.query.isAutoLogin}`)
// next(`/login`)
localStorage.removeItem("isLoginName")
Message.error('获取用户信息失败,请重试!')
})
// })
// .catch((error) => {
// console.log('登录失败')
// })
}else{
if (to.path != '/login') {
next('/login')
}else{
next()
}
NProgress.done()
}
}else{
// 重新获取api接口表头
const _interfaceBoardColumnsNames = localStorage.getItem("interfaceBoardColumnsNames")
if( !_interfaceBoardColumnsNames || _interfaceBoardColumnsNames == 'undefined' || _interfaceBoardColumnsNames == 'null'){
getInterfaceBoard().then(result => {
// todo-new:columnsApiNamesZh配置的地址补全(evel)
localStorage.setItem("interfaceBoardColumnsNames", JSON.stringify(result.resources[_zh].texts));
setTimeout(()=>{
next()
},0)
console.log('-------不需要自动登录-------',isAutoLogin,to.query.loginName)
next({
path:'/login',
query:{
loginName:to.query.loginName,
isAutoLogin:to.query.isAutoLogin,
isSinglePage:to.query.isSinglePage
},
replace: true
})
}else{
next()
}
}
// determine whether the user has logged in
// todo-new:如果token接口恢复做处理
const hasToken = getToken()
// else if (hasToken) {
// // if(from.path != '/login'){
// // let _interfaceBoardColumnsNames = localStorage.getItem("interfaceBoardColumnsNames")
// // if(!_interfaceBoardColumnsNames){
// // // next({
// // // path: '/'
// // // })
// // // NProgress.done()
// // }
// // }
// if (to.path === '/login') {
// // if is logged in, redirect to the home page
// next({
// path: '/'
// })
// NProgress.done() // hack: https://github.com/PanJiaChen/vue-element-admin/pull/2939
// } else {
// // determine whether the user has obtained his permission roles through getInfo
// const hasRoles =await store.getters.roles && await store.getters.roles.length > 0
// if (hasRoles) {
// next()
// } else {
// try {
// // get user info
// // note: roles must be a object array! such as: ['admin'] or ,['developer','editor']
// const {
// roles
// } = await store.dispatch('user/getInfo')
// // generate accessible routes map based on roles
// // const accessRoutes = await store.dispatch('permission/generateRoutes', localStorage.getItem('userId'))
// // router.addRoutes(accessRoutes)
// // 原码 防止刷新出现空白页(系统暂无出现所以注释)
// // const accessRoutes = await store.dispatch('permission/generateRoutes', roles)
// // router.addRoutes(accessRoutes)
// // hack method to ensure that addRoutes is complete
// // set the replace: true, so the navigation will not leave a history record
// next({
// ...to,
// replace: true
// })
// } catch (error) {
// // remove token and go to login page to re-login
// await store.dispatch('user/resetToken')
// Message.error(error || 'Has Error')
// next(`/login?redirect=${to.path}`)
// NProgress.done()
// }
// }
// }
// } else {
// /* has no token*/
// if (whiteList.indexOf(to.path) !== -1) {
// // in the free login whitelist, go directly
// next()
// } else {
// // other pages that do not have permission to access are redirected to the login page.
// next(`/login?redirect=${to.path}`)
// NProgress.done()
// }
// }
}
})
router.afterEach(() => {

193
Code/Fe/src/router/index-0718.js

@ -0,0 +1,193 @@
import Vue from 'vue'
import Router from 'vue-router'
Vue.use(Router)
/* Layout */
import Layout from '@/layout'
/* Router Modules */
import baseConfig from './modules/baseConfig'
import interfaceBoardRouter from './modules/interfaceBoard'
import systemManage from './modules/systemManage'
/**
* Note: sub-menu only appear when route children.length >= 1
* Detail see: https://panjiachen.github.io/vue-element-admin-site/guide/essentials/router-and-nav.html
*
* hidden: true if set true, item will not show in the sidebar(default is false)
* alwaysShow: true if set true, will always show the root menu
* if not set alwaysShow, when item has more than one children route,
* it will becomes nested mode, otherwise not show the root menu
* redirect: noRedirect if set noRedirect will no redirect in the breadcrumb
* name:'router-name' the name is used by <keep-alive> (must set!!!)
* meta : {
roles: ['admin','editor'] control the page roles (you can set multiple roles)
title: 'title' the name show in sidebar and breadcrumb (recommend set)
icon: 'svg-name'/'el-icon-x' the icon show in the sidebar
noCache: true if set true, the page will no be cached(default is false)
affix: true if set true, the tag will affix in the tags-view
breadcrumb: false if set false, the item will hidden in breadcrumb(default is true)
activeMenu: '/example/list' if set path, the sidebar will highlight the path you set
}
*/
/**
* constantRoutes
* a base page that does not have permission requirements
* all roles can be accessed
*/
export let constantRoutes = [
{
path: '/redirect',
component: Layout,
hidden: true,
children: [{
path: '/redirect/:path(.*)',
component: () => import('@/views/redirect/index')
}]
},
{
path: '/login',
component: () => import('@/views/login/index'),
hidden: true
},
{
path: '/404',
component: () => import('@/views/error-page/404'),
hidden: true
},
{
path: '/401',
component: () => import('@/views/error-page/401'),
hidden: true
},
{
path: '/profileuser',
component: Layout,
redirect: '/profileuser/index',
hidden: true,
children: [{
path: 'index',
component: () => import('@/views/profileuser/index'),
name: 'Profileuser',
meta: {
title: '个人中心',
icon: 'user',
noCache: true
}
}]
},
{
path: '/',
component: Layout,
redirect: '/dashboard',
// hidden: true,
children: [{
path: 'dashboard',
component: () => import('@/views/dashboard/index'),
name: 'Dashboard',
meta: {
keepAlive : true,
title: '系统首页',
icon: '系统首页',
outerFirst:true
// affix: true
}
}]
},
// 系统
// {
// path: '/systemManage',
// component: Layout,
// redirect: 'noRedirect',
// meta: {
// title: '系统权限管理11111',
// icon: '系统权限控制',
// roles:'skip'
// },
// children: [{
// path: 'UserManage',
// name: 'userManage',
// component: () => import('@/views/systemManage/userManage'),
// meta: {
// title: '用户信息维护',
// icon: '用户',
// roles: 'AbpIdentity.Users'
// }
// },
// {
// path: 'RoleManage',
// name: 'roleManage',
// component: () => import('@/views/systemManage/roleManage'),
// meta: {
// title: 'PC权限信息维护',
// icon: '权限控制',
// roles: 'AbpIdentity.Roles'
// }
// },
// {
// path: 'pcMenu',
// name: 'pcMenu',
// // hidden: true,
// component: () => import('@/views/systemManage/pcMenu'),
// meta: {
// title: 'PC权限菜单',
// icon: 'PDA权限菜单',
// roles: 'Auth.Menu'
// }
// },
// {
// path: 'UserWorkGroup',
// name: 'UserWorkGroup',
// // hidden: true,
// component: () => import('@/views/systemManage/userWorkGroup'),
// meta: {
// title: '用户工作组对应关系',
// icon: '用户工作组对应关系',
// roles: 'Auth.UserWorkGroup'
// }
// },
// ]
// }
]
/**
* asyncRoutes
* the routes that need to be dynamically loaded based on user roles
*/
// 动态获取菜单信息
export let asyncRoutes = [
/** when your routing map is too long, you can split it into small modules **/
// 404 page must be placed at the end !!!
baseConfig,
interfaceBoardRouter,
systemManage,
{
path: '*',
redirect: '/404',
hidden: true
}
]
const createRouter = () => new Router({
// mode: 'history', // require service support
scrollBehavior: () => ({
y: 0
}),
// todo-new:有token后使用去掉下一行代码
routes: constantRoutes.concat(asyncRoutes)
// todo-new:有token后使打开下方代码,并检查是否有效
// routes: constantRoutes
})
const router = createRouter()
// Detail see: https://github.com/vuejs/vue-router/issues/1234#issuecomment-357941465
export function resetRouter() {
const newRouter = createRouter()
router.matcher = newRouter.matcher // reset router
}
export default router

72
Code/Fe/src/router/index.js

@ -8,9 +8,6 @@ Vue.use(Router)
import Layout from '@/layout'
/* Router Modules */
import baseConfig from './modules/baseConfig'
import interfaceBoardRouter from './modules/interfaceBoard'
import systemManage from './modules/systemManage'
/**
* Note: sub-menu only appear when route children.length >= 1
@ -90,67 +87,13 @@ export let constantRoutes = [
name: 'Dashboard',
meta: {
keepAlive : true,
title: '系统首页',
title: localStorage.getItem('browserLanguage') == 'zh-Hans' ? '系统首页' : 'Dashboard',
icon: '系统首页',
outerFirst:true
// affix: true
}
}]
},
// 系统
// {
// path: '/systemManage',
// component: Layout,
// redirect: 'noRedirect',
// meta: {
// title: '系统权限管理11111',
// icon: '系统权限控制',
// roles:'skip'
// },
// children: [{
// path: 'UserManage',
// name: 'userManage',
// component: () => import('@/views/systemManage/userManage'),
// meta: {
// title: '用户信息维护',
// icon: '用户',
// roles: 'AbpIdentity.Users'
// }
// },
// {
// path: 'RoleManage',
// name: 'roleManage',
// component: () => import('@/views/systemManage/roleManage'),
// meta: {
// title: 'PC权限信息维护',
// icon: '权限控制',
// roles: 'AbpIdentity.Roles'
// }
// },
// {
// path: 'pcMenu',
// name: 'pcMenu',
// // hidden: true,
// component: () => import('@/views/systemManage/pcMenu'),
// meta: {
// title: 'PC权限菜单',
// icon: 'PDA权限菜单',
// roles: 'Auth.Menu'
// }
// },
// {
// path: 'UserWorkGroup',
// name: 'UserWorkGroup',
// // hidden: true,
// component: () => import('@/views/systemManage/userWorkGroup'),
// meta: {
// title: '用户工作组对应关系',
// icon: '用户工作组对应关系',
// roles: 'Auth.UserWorkGroup'
// }
// },
// ]
// }
]
/**
@ -161,14 +104,11 @@ export let constantRoutes = [
export let asyncRoutes = [
/** when your routing map is too long, you can split it into small modules **/
// 404 page must be placed at the end !!!
baseConfig,
interfaceBoardRouter,
systemManage,
{
path: '*',
redirect: '/404',
hidden: true
}
// {
// path: '*',
// redirect: '/404',
// hidden: true
// }
]
const createRouter = () => new Router({

25
Code/Fe/src/router/modules/baseConfig.js

@ -1,25 +0,0 @@
import Layout from '@/layout'
import { initFromApiColumnsLable } from '@/utils/index'
const interfaceBoardRouter = {
path: '/basicConfig',
alwaysShow:true,
component: Layout,
redirect: 'noRedirect',
meta: {
title: '基础数据管理',
icon: '基础数据管理',
roles:'skip'
},
children: [{
path: 'ExportCustomUserSetting',
name: 'ExportCustomUserSetting',
component: () => import('@/views/basicConfig/ExportCustomUserSetting'),
meta: {
title: initFromApiColumnsLable('ExportCustomUserSetting'),//导出配置
icon: '用户',
roles: 'skip'
}
},
]
}
export default interfaceBoardRouter

25
Code/Fe/src/router/modules/interfaceBoard.js

@ -1,25 +0,0 @@
import Layout from '@/layout'
import { initFromApiColumnsLable } from '@/utils/index'
const interfaceBoardRouter = {
path: '/interfaceBoard',
alwaysShow:true,
component: Layout,
redirect: 'noRedirect',
meta: {
title: '接口看板管理',
icon: '报表查看',
roles:'skip'
},
children: [{
path: 'TestSchool',
name: 'TestSchool',
component: () => import('@/views/interfaceBoard/TestSchool'),
meta: {
title: initFromApiColumnsLable('TestSchool'),
icon: '用户',
roles: 'skip'
}
},
]
}
export default interfaceBoardRouter

44
Code/Fe/src/router/modules/systemManage.js

@ -1,44 +0,0 @@
import Layout from '@/layout'
const systemManageRouter = {
path: '/systemManage',
component: Layout,
redirect: 'noRedirect',
meta: {
title: '系统权限管理',
icon: '系统权限控制',
roles:'skip'
},
children: [{
path: 'UserManage',
name: 'userManage',
component: () => import('@/views/systemManage/userManage'),
meta: {
title: '用户信息维护',
icon: '用户',
roles: 'AbpIdentity.Users'
}
},
{
path: 'RoleManage',
name: 'roleManage',
component: () => import('@/views/systemManage/roleManage'),
meta: {
title: '权限信息维护',
icon: '权限控制',
roles: 'AbpIdentity.Roles'
}
},
// {
// path: 'pcMenu',
// name: 'pcMenu',
// // hidden: true,
// component: () => import('@/views/systemManage/pcMenu'),
// meta: {
// title: 'PC权限菜单',
// icon: 'PDA权限菜单',
// roles: 'Auth.Menu'
// }
// },
]
}
export default systemManageRouter

10
Code/Fe/src/store/getters.js

@ -7,11 +7,15 @@ const getters = {
cachedViews: state => state.tagsView.cachedViews,
token: state => state.user.token,
avatar: state => state.user.avatar,
name: state => state.user.name,
introduction: state => state.user.introduction,
roles: state => state.user.roles,
permission_routes: state => state.permission.routes,
currentUserInfo: state => state.user.userInfo,//当前用户信息
permission_routes: state => state.permission.routes,//接口获取的菜单
tablesName:state => state.permission.tablesName,//接口获取所有的表名
errorLogs: state => state.errorLog.logs,
dictionaries: state => state.dictionaries.dict
dictionaries: state => state.dictionaries.dict,
enumList: state => state.definition.enumList,//接口获取的枚举
columZHList: state => state.definition.columZHList,//接口转义的表头
dtoColumnTypes: state => state.definition.dtoColumnTypes,//所有页面的dto类型
}
export default getters

124
Code/Fe/src/store/modules/definition.js

@ -0,0 +1,124 @@
import { getInterfaceBoard,getApiDefinition } from "@/api/wms-interface"
const state = {
enumList: [],//枚举
columZHList:null,//表头转义
dtoColumnTypes:[],//所有页面的dto类型
}
const mutations = {
// 设置枚举
SET_ENUM_LIST: (state, data) => {
state.enumList=data
},
// 设置表头转义
SET_COLUMZH_LIST: (state, data) => {
state.columZHList=data
},
// 所有页面的dto类型
SET_DTOCOLUMN_TYPES: (state, data) => {
state.dtoColumnTypes=data
},
}
// 通过url做方法处理转换(S/C/U/G等)目前只做了S查询。如果有需要在丰富
export function initDtoTypeByUrl(url){
if(url.indexOf('get-list-page-by-filter') >= 0){
return "S"
}else{
return url
}
}
// DTO类型转义
export function initDtoColumnTypes(res) {
// modules>app>controller>这里是所有的接口
let _controller = res.modules.app.controllers
let _allData = {}
for(let item in _controller){
let _com = 'AppService'
// 获取简单的api(路由,如:IncomingData)
let _api = item.substring(item.lastIndexOf('.') + 1,item.length - _com.length)
let _item = {
S:{
dtoList:[],
dtoType: 'S',
dtoName:item.substring(0,item.length - _com.length),
columnsType:null
}
}
for(let ac in _controller[item].actions){
let _actions = _controller[item].actions[ac]
// actions下通过URL匹配 做特殊处理
// 查询处理
if(initDtoTypeByUrl(_actions.url) == 'S'){
let _type = _actions.returnValue.type
let _type_value = _type.substring(_type.indexOf('<') + 1,_type.indexOf('>'))
_item.S.columnsType=_type_value
// 通过returnValue.type 在 res.types 中获取全部的dto
let _dtos = res.types[_type_value].properties
_dtos.forEach(d=>{
// 如果是枚举做处理(目前枚举只根据Enums做处理,todo:是否需要其他处理)
if(d.type.indexOf('Enums') >= 0){
d.apiBaseType = 'enums'
d.isEnums = true
// -1 是去掉最后的'?'(todo:是否每个Enums类型都有?)
let enums_type = d.type.substring(0,d.type.length - 1)
// 通过type包含Enums的全字段-'?'匹配res.types中的值
let enums_list = res.types[enums_type]
if(enums_list){
d.enums_list = []
enums_list.enumValues.forEach((e,key)=>{
d.enums_list.push({value:e,label:enums_list.enumNames[key]})
})
}
}else{
if(d.typeSimple == 'number' || d.typeSimple == 'number?'){
d.apiBaseType='number'
}else{
let _end_index = d.type.lastIndexOf('?') >= 0 ? d.type.lastIndexOf('?') : d.type.length
d.apiBaseType = d.type.substring(d.type.lastIndexOf('.') + 1, _end_index).toLowerCase()
}
if(d.type.indexOf('Guid') >= 0){
d.apiBaseType='string'
}
}
})
_item.S.dtoList=_dtos
}
}
_allData[_api] = _item
}
return _allData
}
const actions = {
// 获取枚举
getDefinitionConfig({ commit }) {
return new Promise(resolve => {
getApiDefinition().then(res=>{
commit('SET_DTOCOLUMN_TYPES', initDtoColumnTypes(res))
commit('SET_ENUM_LIST', res.types)
resolve(res)
})
})
},
// 获取表头转义
getColumZHList({ commit }) {
return new Promise(resolve => {
getInterfaceBoard().then(res=>{
let _zh = res.resources[localStorage.getItem('columnsApiNamesZh')].texts;
commit('SET_COLUMZH_LIST', _zh)
resolve(res)
})
})
}
}
export default {
namespaced: true,
state,
mutations,
actions
}

163
Code/Fe/src/store/modules/permission-0718.js

@ -0,0 +1,163 @@
import {
asyncRoutes,
constantRoutes
} from '@/router'
import Layout from '@/layout'
import { getWebMenu } from '@/api/wms-auth'
/**
* 静态路由懒加载
* @param view 格式必须为 xxx/xxx 开头不要加斜杠
* @returns
*/
export const loadView = (view) => {
return (resolve) => require([`@/views/${view}`], resolve)
}
/**
* 把从后端查询的菜单数据拼装成路由格式的数据
* @param routes
* @param data 后端返回的菜单数据
*/
export function generaMenu(routes, data) {
data.forEach(item => {
const menu = {
path: item.code,
component: item.component === '@/layout' ? Layout : loadView(item.component),
// hidden: item.status === 0, // 状态为0的隐藏
children: [],
name: item.code,
// meta: item.meta
meta: {
title: item.name,
icon: item.icon || '',
roles: item.permission
},
}
// 一级菜单 二级菜单 特定属性
if (item.component == '@/layout' || item.component == 'index') {
menu.alwaysShow = true
menu.redirect = 'noRedirect'
}
if (item.sort < 99) {
menu.level = 1
} else if (item.sort > 99 && item.sort < 9999) {
menu.level = 2
} else {
menu.level = 3
}
// iframe页面处理
// if (item.permission.indexOf('Report') > -1) {
// // delete menu.component
// menu.iframeComponent = item.component === '@/layout' ? Layout : loadView(item.component)
// menu.hasOpen = false // 是否打开过,默认false
// }
if (item.children && item.children.length > 0) {
generaMenu(menu.children, item.children)
}
// if (item.permission == 'skip' && item.children.length == 0) {
// }
routes.push(menu)
})
return routes
}
/**
* Use meta.role to determine if the current user has permission
* @param roles
* @param route
*/
function hasPermission(roles, route) {
if (route.meta && route.meta.roles) {
if (route.meta.roles == "skip") {
return true
} else {
return roles.some(role => route.meta.roles.includes(role))
}
} else {
return false
}
}
const filterAccessedRoutes = (items,indexVal,childrenIndex) => {
const route = JSON.parse(JSON.stringify(items))
route.forEach((val, index) => {
// debugger;
if(val.meta && val.meta.roles == "skip"){
if (val.children && val.children.length != 0) {
filterAccessedRoutes(items[index-indexVal].children,childrenIndex)
}
if(items[index-indexVal].children && items[index-indexVal].children.length == 0){
items.splice(index-indexVal, 1)
indexVal++
}
}
})
indexVal = 0
}
/**
* Filter asynchronous routing tables by recursion
* @param routes asyncRoutes
* @param roles
*/
export function filterAsyncRoutes(routes, roles) {
const res = []
routes.forEach(route => {
const tmp = {
...route
}
if (hasPermission(roles, tmp)) {
if (tmp.children) {
tmp.children = filterAsyncRoutes(tmp.children, roles)
}
res.push(tmp)
}
})
return res
}
const state = {
routes: [],
addRoutes: []
}
const mutations = {
SET_ROUTES: (state, routes) => {
state.addRoutes = routes
state.routes = constantRoutes.concat(routes)
}
}
// todo-new:有token后使用generateRoutes,去掉下方一行代码
state.routes = constantRoutes.concat(asyncRoutes)
const actions = {
generateRoutes({
commit
}, userId) {
return new Promise(resolve => {
// let accessedRoutes = asyncRoutes
// // accessedRoutes = filterAsyncRoutes(asyncRoutes, roles)
// let indexVal = 0
// let childrenIndex = 0
// filterAccessedRoutes(accessedRoutes,indexVal,childrenIndex)
// commit('SET_ROUTES', accessedRoutes)
// resolve(accessedRoutes)
// todo-new:动态路由(等token接口恢复后处理)
getWebMenu({userId: userId}).then(res => {
let accessedRoutes = generaMenu(asyncRoutes, res)
let indexVal = 0
let childrenIndex = 0
filterAccessedRoutes(accessedRoutes,indexVal,childrenIndex)
commit('SET_ROUTES', accessedRoutes)
resolve(accessedRoutes)
}).catch(err => {
console.log(err)
})
})
}
}
export default {
namespaced: true,
state,
mutations,
actions
}

268
Code/Fe/src/store/modules/permission.js

@ -4,62 +4,8 @@ import {
} from '@/router'
import Layout from '@/layout'
import { getWebMenu } from '@/api/wms-auth'
/**
* 静态路由懒加载
* @param view 格式必须为 xxx/xxx 开头不要加斜杠
* @returns
*/
export const loadView = (view) => {
return (resolve) => require([`@/views/${view}`], resolve)
}
/**
* 把从后端查询的菜单数据拼装成路由格式的数据
* @param routes
* @param data 后端返回的菜单数据
*/
export function generaMenu(routes, data) {
data.forEach(item => {
const menu = {
path: item.code,
component: item.component === '@/layout' ? Layout : loadView(item.component),
// hidden: item.status === 0, // 状态为0的隐藏
children: [],
name: item.code,
// meta: item.meta
meta: {
title: item.name,
icon: item.icon || '',
roles: item.permission
},
}
// 一级菜单 二级菜单 特定属性
if (item.component == '@/layout' || item.component == 'index') {
menu.alwaysShow = true
menu.redirect = 'noRedirect'
}
if (item.sort < 99) {
menu.level = 1
} else if (item.sort > 99 && item.sort < 9999) {
menu.level = 2
} else {
menu.level = 3
}
// iframe页面处理
// if (item.permission.indexOf('Report') > -1) {
// // delete menu.component
// menu.iframeComponent = item.component === '@/layout' ? Layout : loadView(item.component)
// menu.hasOpen = false // 是否打开过,默认false
// }
if (item.children && item.children.length > 0) {
generaMenu(menu.children, item.children)
}
// if (item.permission == 'skip' && item.children.length == 0) {
// }
routes.push(menu)
})
return routes
}
import { getDefinitionMenu } from '@/api/wms-interface'
import store from '@/store'
/**
* Use meta.role to determine if the current user has permission
@ -116,43 +62,229 @@ export function filterAsyncRoutes(routes, roles) {
const state = {
routes: [],
addRoutes: []
addRoutes: [],
tablesName:null,//所有的表名
}
const mutations = {
SET_ROUTES: (state, routes) => {
state.addRoutes = routes
state.routes = constantRoutes.concat(routes)
},
SET_TABLESNAME: (state, data) => {
state.tablesName = data
}
}
// todo-new:有token后使用generateRoutes,去掉下方一行代码
state.routes = constantRoutes.concat(asyncRoutes)
// state.routes = constantRoutes.concat(asyncRoutes)
/**
* 静态路由懒加载
* @param view 格式必须为 xxx/xxx 开头不要加斜杠
* @returns
*/
export const loadView = (view) => {
return (resolve) => require([`@/views/menuList/${view}`], resolve)
}
/**
* 把从后端查询的菜单数据拼装成路由格式的数据
* @param routes
* @param data 后端返回的菜单数据
*/
export function generaMenu(routes, data, first) {
data.forEach(item => {
let _item = {
path: '/'+item.name,
component: loadView(item.name),
// hidden: item.status === 0, // 状态为0的隐藏
name: item.name,
// meta: item.meta
meta: {
title: item.title,
icon: item.icon || '基础数据管理',
roles: item.permission,
outerFirst:first
},
}
let menu = _item
if(first && item.component == '@/layout'){
menu = {
path: '/',
component: Layout,
redirect: '/' + item.name,
children: [],
}
menu.children = []
menu.children.push(_item)
}
// 一级菜单 二级菜单 特定属性
// if (item.component == '@/layout' || item.component == 'index') {
// menu.alwaysShow = true
// menu.redirect = 'noRedirect'
// }
// if (item.sort < 99) {
// menu.level = 1
// } else if (item.sort > 99 && item.sort < 9999) {
// menu.level = 2
// } else {
// menu.level = 3
// }
// iframe页面处理
// if (item.permission.indexOf('Report') > -1) {
// // delete menu.component
// menu.iframeComponent = item.component === '@/layout' ? Layout : loadView(item.component)
// menu.hasOpen = false // 是否打开过,默认false
// }
if (item.children && item.children.length > 0) {
generaMenu(menu.children, item.children)
}
// if (item.permission == 'skip' && item.children.length == 0) {
// }
routes.push(menu)
})
return routes
}
// todo:接口返回的层级菜单,与查重后最终显示的菜单数组做查重及组合处理
export function initTreeMenusHandle(tree, list,first) {
let _res = []
tree.forEach(item=>{
if(list.indexOf(item.name) >= 0){
item.title = store.getters.columZHList[item.name] || item.name
if(first)item.component = '@/layout'
if (item.children && item.children.length > 0) {
item.children = initTreeMenusHandle(item.children,list)
}
_res.push(item)
}
})
return _res
}
const actions = {
generateRoutes({
getApiColumnsNames({
commit
}, userId) {
return new Promise(resolve => {
// let accessedRoutes = asyncRoutes
// // accessedRoutes = filterAsyncRoutes(asyncRoutes, roles)
let accessedRoutes = asyncRoutes
// accessedRoutes = filterAsyncRoutes(asyncRoutes, roles)
// let indexVal = 0
// let childrenIndex = 0
// filterAccessedRoutes(accessedRoutes,indexVal,childrenIndex)
// commit('SET_ROUTES', accessedRoutes)
// resolve(accessedRoutes)
// todo-new:动态路由(等token接口恢复后处理)
getWebMenu({userId: userId}).then(res => {
let accessedRoutes = generaMenu(asyncRoutes, res)
let indexVal = 0
let childrenIndex = 0
filterAccessedRoutes(accessedRoutes,indexVal,childrenIndex)
getDefinitionMenu(true).then(res => {
let _allConfig = res.auth.grantedPolicies;//所有配置
let _menuList = []//接口获取所有的菜单
for(let item in _allConfig){
let point_number = item.split('.').length - 1
// 只选择配置项中的数据
if(point_number == 1 && item.substring(0,item.indexOf('.')) == localStorage.getItem('columnsApiNamesZh')){
_menuList.push(item.substring(item.indexOf('.') + 1,item.length))
}
}
// 存储所有的表名
commit('SET_TABLESNAME', _menuList)
// todo-new:接口获取 接口没有走配置文件
let _noShowMenus = null//不显示的菜单
_noShowMenus = localStorage.getItem('menuHiddenConfig').split(',')
// 去掉不显示的菜单后全部显示的菜单
let _showMenus = _noShowMenus && _noShowMenus.length > 0 ? _menuList.filter(item1 => !_noShowMenus.some(item2 => item2 === item1)) : _menuList
// 数据模拟,todo-new:接口获取
let _treeMenusAll = null//树形菜单
// _treeMenusAll = [
// {name:"aaaaaaa"},
// {name:"ExportCustomUserSetting"
// // ,children:[
// // {name:'OutgoingDataHistory',children:[
// // {name:'IncomingData',children:[
// // {name:'OutgoingDataHistory'},
// // {name:'IncomingData'},
// // {name:'333333'},
// // ]},
// // {name:'eee1111-bbb',children:[
// // {name:'ExportCustomUserSetting'},
// // {name:'MessageReceive'},
// // ]},
// // ]},
// // {name:'eee222'},
// // {name:'eee333'},
// // {name:'eee444'},
// // {name:'eee555'},
// // ]
// },
// {name:"OutgoingDataHistory"},
// {name:"IncomingData"},
// {name:"IncomingDataHistory"},
// {name:"MesProductL7PartsNote"},
// {name:"MessageReceive"},
// {name:"OutgoingData"},
// {name:"AsnDet"},
// {name:"AsnMstr"},
// {name:"Bom"},
// {name:"CustPart"},
// {name:"Cust"},
// {name:"Inventory"},
// {name:"Loc"},
// {name:"Part"},
// {name:"PoDet"},
// {name:"PoMstr"},
// {name:"PrhHist"},
// {name:"ProdLine"},
// {name:"ReceiptDet"},
// {name:"ReceiptMstr"},
// {name:"ReturnDet"},
// {name:"ReturnMstr"},
// {name:"SodDet"},
// {name:"VendPart"},
// {name:"Vend"},
// ]
let _initTreeMenus = []
if(_treeMenusAll && _treeMenusAll.length > 0){
_initTreeMenus = initTreeMenusHandle(_treeMenusAll,_showMenus,true)
}else{
let _data = []
for(let i in _showMenus){
_data.push({name:_showMenus[i]})
}
_initTreeMenus = initTreeMenusHandle(_data,_showMenus,true)
}
// 最后查重+层级查重后的菜单
let _initEndMenus = generaMenu(asyncRoutes, _initTreeMenus,true)
let accessedRoutes = _initEndMenus
// let indexVal = 0
// let childrenIndex = 0
// filterAccessedRoutes(accessedRoutes,indexVal,childrenIndex)
commit('SET_ROUTES', accessedRoutes)
resolve(accessedRoutes)
}).catch(err => {
console.log(err)
})
})
}
},
// generateRoutes({
// commit
// }, userId) {
// return new Promise(resolve => {
// // let accessedRoutes = asyncRoutes
// // // accessedRoutes = filterAsyncRoutes(asyncRoutes, roles)
// // let indexVal = 0
// // let childrenIndex = 0
// // filterAccessedRoutes(accessedRoutes,indexVal,childrenIndex)
// // commit('SET_ROUTES', accessedRoutes)
// // resolve(accessedRoutes)
// // todo-new:动态路由(等token接口恢复后处理)
// getWebMenu({userId: userId}).then(res => {
// let accessedRoutes = generaMenu(asyncRoutes, res)
// let indexVal = 0
// let childrenIndex = 0
// filterAccessedRoutes(accessedRoutes,indexVal,childrenIndex)
// commit('SET_ROUTES', accessedRoutes)
// resolve(accessedRoutes)
// }).catch(err => {
// console.log(err)
// })
// })
// }
}
export default {

48
Code/Fe/src/store/modules/user.js

@ -1,7 +1,8 @@
import {
token,
logout,
getInfo
getInfo,
getUsersByUserName
} from '@/api/wms-auth'
import {
getToken,
@ -20,8 +21,10 @@ const state = {
name: '',
avatar: '',
introduction: '',
roles: []
roles: [],
userInfo:null
}
import { Message } from 'element-ui'
const mutations = {
SET_TOKEN: (state, token) => {
@ -38,6 +41,9 @@ const mutations = {
},
SET_ROLES: (state, roles) => {
state.roles = roles
},
SET_USERINFO: (state, data) => {
state.userInfo = data
}
}
@ -141,13 +147,14 @@ const actions = {
dispatch
}) {
return new Promise((resolve, reject) => {
logout().then(() => {
// logout().then(() => {
commit('SET_TOKEN', '')
commit('SET_ROLES', [])
removeToken()
resetRouter()
removeCompany()
removeWarehouseCode()
// commit('SET_USERINFO', null)
// removeToken()
// resetRouter()
// removeCompany()
// removeWarehouseCode()
// reset visited views and cached views
// to fixed https://github.com/PanJiaChen/vue-element-admin/issues/2485
dispatch('tagsView/delAllViews', null, {
@ -155,10 +162,10 @@ const actions = {
})
resolve()
// 防止路由叠加
location.reload()
}).catch(error => {
reject(error)
})
// location.reload()
// }).catch(error => {
// reject(error)
// })
})
},
@ -202,7 +209,26 @@ const actions = {
dispatch('tagsView/delAllViews', null, {
root: true
})
},
getUserInfo({
commit
},username) {
return new Promise((resolve, reject) => {
getUsersByUserName(username).then(res=>{
if(res && JSON.stringify(res).length > 0){
localStorage.setItem('isLoginName',username)
commit('SET_USERINFO', res)
resolve(res)
}else{
reject('获取用户信息失败,请重试')
}
})
.catch(err => {
reject(error)
console.log('获取用户信息失败,请重试')
})
})
},
}
export default {

1
Code/Fe/src/utils/baseData/urlOption.js

@ -2,6 +2,7 @@
export const TestSchool = {
baseURL:'TestSchool/base',//主表-列表
detailURL:'app/test-school',//主表-明细 + 明细-查看主表
// detailInfoName:'asnNbr',//主表-明细查看详情的title名称
detailListURL:'TestStudentDetail/base',//明细-列表,
masterId:'masterId',//明细获取主表信息的masterId(默认)
masterName:'studentName'//明细获取主表信息的title名称

4
Code/Fe/src/utils/defaultButtons.js

@ -43,7 +43,7 @@ export function defaultExportBtn(option) {
export function defaultFieldSettingBtn(option,source) {
let _source = source ? source : 'list_api'
// todo:监听已经配置过的字段按钮更改状态特殊显示
let _local = localStorage.getItem('file_Columns_' + _source + '_' + JSON.parse(localStorage.getItem('currentUserInfo')).userName + '_' + this.$route.name)
let _local = localStorage.getItem('file_Columns_' + _source + '_' + this.$store.getters.currentUserInfo.userName + '_' + this.$route.name)
let _type = ''
let _num = 0
if(_local){
@ -59,7 +59,7 @@ export function defaultFieldSettingBtn(option,source) {
}
}
return __defaultBtnOption(option,{
type: _type,
// type: _type,//暂不处理颜色
plain: true,
icon: "el-icon-setting",
label: "字段设置",

9
Code/Fe/src/utils/detailsPageColumns_api/index.js

@ -0,0 +1,9 @@
// 此文件为【明细 - 列表】表头从接口缓存的表头
import { zhApiColumnsLable } from '@/utils/index'
// 测试数据
// export const TestSchool = [
// { label: zhApiColumnsLable('TestStudentDetailStudentName'), prop: "studentName" },
// { label: zhApiColumnsLable('TestStudentDetailOrderType'), prop: "orderType" },
// ]

11
Code/Fe/src/utils/detailsTableColumns_api/index.js

@ -1,9 +1,10 @@
// 此文件为【明细 - 列表】表头从接口缓存的表头
// 如果有父级id字段,请设置showProp,避免明细列表内可查询其他主表的明细
import { initFromApiColumnsLable } from '@/utils/index'
import { zhApiColumnsLable } from '@/utils/index'
// 测试数据
export const TestSchool = [
{ label: initFromApiColumnsLable('TestStudentDetailStudentName'), prop: "studentName" },
{ label: initFromApiColumnsLable('TestStudentDetailOrderType'), prop: "orderType" },
]
// export const TestSchool = [
// { label: zhApiColumnsLable('TestStudentDetailStudentName'), prop: "studentName" },
// { label: zhApiColumnsLable('TestStudentDetailOrderType'), prop: "orderType" },
// ]

29
Code/Fe/src/utils/index.js

@ -2,6 +2,7 @@
* Created by PanJiaChen on 16/11/18.
*/
import {fileStorage, getPageList, getDictByCode} from '@/api/wms-api'
import store from '@/store'
/**
* Parse the time to string
* @param {(Object|string|number)} time
@ -557,23 +558,21 @@ export function createNewTabs (url) {
window.open(url, "_blank")
}
// faster-new
// 转义及读取api接口返回的表头信息
export function initFromApiColumnsLable (data) {
//todo:待定:重新获取全局从接口缓存的表头(如:接口监控看板)
// import { getInterfaceBoard } from "@/api/wms-interface"
export function zhApiColumnsLable (data) {
let _list = store.getters.columZHList
return _list ? _list[data] : data
}
// getList = () => {
// getInterfaceBoard().then(result => {
// 首字母转换 type='Lower'(小写,默认) Upper(大写)
export function firstWordSizeChange (str,type='Lower') {
switch(type){
case 'Lower':
return str.substring(0,1).toLowerCase() + str.substring(1,str.length);
case 'Upper':
return str.substring(0,1).toUpperCase() + str.substring(1,str.length);
// localStorage.setItem("interfaceBoardColumnsNames", JSON.stringify(result.data.localization.values.Dashboard));
// })
// .catch(err => {
// })
// }
let _Dashboard = null
let _names = localStorage.getItem("interfaceBoardColumnsNames")
if(_names && _names != 'undefined' && _names != 'null') {
_Dashboard = JSON.parse(localStorage.getItem("interfaceBoardColumnsNames"))
}
return _Dashboard ? _Dashboard[data] : null
}

10
Code/Fe/src/utils/tableColumns_api/index.js

@ -1,9 +1,9 @@
// 此文件为【主表-列表】表头从接口缓存的表头
import { initFromApiColumnsLable } from '@/utils/index'
import { zhApiColumnsLable } from '@/utils/index'
// 测试数据
export const TestSchool = [
{ label: initFromApiColumnsLable('TestSchoolSchoolName'), prop: "schoolName", fixed: "left" },
{ label: initFromApiColumnsLable('TestStudentDetailOrderType'), prop: "orderType" },
]
// export const TestSchool = [
// { label: zhApiColumnsLable('TestSchoolSchoolName'), prop: "schoolName", fixed: "left" },
// { label: zhApiColumnsLable('TestStudentDetailOrderType'), prop: "orderType" },
// ]

10
Code/Fe/src/utils/tabsDesTions_api/index.js

@ -1,9 +1,9 @@
// 此文件为【主表-明细】表头从接口缓存的表头
import { initFromApiColumnsLable } from '@/utils/index'
import { zhApiColumnsLable } from '@/utils/index'
// 测试数据
export const TestSchool = [
{ label: initFromApiColumnsLable('TestSchoolSchoolName'), prop: "schoolName", fixed: "left", type: "name" },
{ label: initFromApiColumnsLable('TestStudentDetailOrderType'), prop: "orderType" },
]
// export const TestSchool = [
// { label: zhApiColumnsLable('TestSchoolSchoolName'), prop: "schoolName", fixed: "left", type: "name" },
// { label: zhApiColumnsLable('TestStudentDetailOrderType'), prop: "orderType" },
// ]

4
Code/Fe/src/utils/utils.js

@ -60,8 +60,6 @@ import pagination from "@/components/Pagination" //分页器
import conditionFilters from "@/components/conditionFilters" //高级筛选
import searchPage from '@/components/searchPage' //autocomplete拉取数据探弹窗
import newAndEdiDialog from '@/components/newAndEdiDialog' //普通新增与编辑
import stepsForm from '@/components/StepsForm' //步骤新增
import handelFrom from '@/components/handelFrom' //执行表单
import umyTable from '@/components/umyTable' // 用于数据量过大table
import filterForDetailPage from '@/components/filterForDetailPage' //明细查询
import newAndEdiDialogForDetail from '@/components/newAndEdiDialogForDetail' //普通新增与编辑(带明细)
@ -115,8 +113,6 @@ Vue.component('conditionFilters', conditionFilters)
Vue.component('searchPage', searchPage)
Vue.component('newAndEdiDialog', newAndEdiDialog)
Vue.component('newAndEdiDialogForDetail', newAndEdiDialogForDetail)
Vue.component('stepsForm', stepsForm)
Vue.component('handelFrom', handelFrom)
Vue.component('umyTable', umyTable)
Vue.component('filterForDetailPage', filterForDetailPage)
Vue.prototype.$echarts = eCharts

16
Code/Fe/src/views/basicConfig/ExportCustomUserSetting.vue

@ -17,7 +17,7 @@
@alertoldSkipCount="alertoldSkipCount"
@alterResultCount="alterResultCount"
@handleSelectionChange="handleSelectionChange"
@buttonOperationClick="buttonOperationClick"
@buttonOperationClick_left="buttonOperationClick_left"
:currentPageProps="oldSkipCount"
:quicklySearchOption="quicklySearchOption"
@quicklySearchClick="quicklySearchClick"
@ -108,7 +108,7 @@ import { filterSelectMixins } from '@/mixins/filter-Select'
import * as tableColumns_api from "@/utils/tableColumns_api/index" //
import * as tabsDesTions_api from "@/utils/tabsDesTions_api/index" //
import * as detailsTableColumns_api from "@/utils/detailsTableColumns_api/index" //
import { initFromApiColumnsLable } from '@/utils/index'
import { zhApiColumnsLable } from '@/utils/index'
// import { getExportConfigList } from '@/api/wms-interface'
export default {
@ -157,14 +157,14 @@ export default {
},
editOptions: {},
CreateForm: [
{ type: "input", label: initFromApiColumnsLable('ExportCustomUserSettingCustomUserSetting'), prop: "customUserSetting", colSpan: 12 },
{ type: "input", label: initFromApiColumnsLable('ExportCustomUserSettingExportColumnName'), prop: "exportColumnName", colSpan: 12 },
{ type: "input", label: initFromApiColumnsLable('ExportCustomUserSettingExportTableName'), prop: "exportTableName", colSpan: 12 },
{ type: "input", label: zhApiColumnsLable('ExportCustomUserSettingCustomUserSetting'), prop: "customUserSetting", colSpan: 12 },
{ type: "input", label: zhApiColumnsLable('ExportCustomUserSettingExportColumnName'), prop: "exportColumnName", colSpan: 12 },
{ type: "input", label: zhApiColumnsLable('ExportCustomUserSettingExportTableName'), prop: "exportTableName", colSpan: 12 },
],
editForm: [
{ type: "input", label: initFromApiColumnsLable('ExportCustomUserSettingCustomUserSetting'), prop: "customUserSetting", colSpan: 12 },
{ type: "input", label:initFromApiColumnsLable('ExportCustomUserSettingExportColumnName'), prop: "exportColumnName", colSpan: 12 },
{ type: "input", label: initFromApiColumnsLable('ExportCustomUserSettingExportTableName'), prop: "exportTableName", colSpan: 12 },
{ type: "input", label: zhApiColumnsLable('ExportCustomUserSettingCustomUserSetting'), prop: "customUserSetting", colSpan: 12 },
{ type: "input", label:zhApiColumnsLable('ExportCustomUserSettingExportColumnName'), prop: "exportColumnName", colSpan: 12 },
{ type: "input", label: zhApiColumnsLable('ExportCustomUserSettingExportTableName'), prop: "exportTableName", colSpan: 12 },
],
editRules: {
cerateRule: {

221
Code/Fe/src/views/dashboard/index copy.vue

@ -0,0 +1,221 @@
<template>
<!-- 瀑布流版本布局 + 高度随宽度调整变化 -->
<el-card class="homeMenuPage" v-resize="setMaxHeight" v-loading="loading">
<div class="firstMenuContain homeMenuPage-List">
<div
class="firstMenuItem menuItem"
v-for="(item,index) in navList"
:key="index"
>
<div class="firstTitle" v-if="item.meta">
<div class="icon"><svg-icon :icon-class="item.meta.icon" style="fill:currentColor; color:#fff;"/></div>
<div>{{item.meta.title}}</div>
</div>
<ul class="menuInfo" v-if="item.children && item.children.length > 0">
<li
v-for="(item2,index2) in item.children"
:key="index2"
>
<div class="title">
{{item2.meta.title}}
<i class="el-icon-arrow-right"></i>
</div>
<!-- 有下级菜单 -->
<div class="lastList" v-if="item2.children && item2.children.length > 0">
<div
v-for="(item3,index3) in item2.children"
:key="index3"
class="item"
>
<span @click="goPage(item3)">{{item3.meta.title}}</span>
</div>
</div>
<!-- 如果二级为最后一级统一格式补充到children中 -->
<div class="lastList" v-else>
<div class="item">
<span @click="goPage(item2)">{{item2.meta.title}}</span>
</div>
</div>
</li>
</ul>
</div>
<span class="firstMenuItem break"></span>
<span class="firstMenuItem break"></span>
<span class="firstMenuItem break"></span>
</div>
</el-card>
</template>
<script>
import { mapGetters } from 'vuex'
export default {
directives: {
//
resize: { //
bind(el, binding) { // elbinding
let width = '', height = '';
function isReize() {
const style = document.defaultView.getComputedStyle(el);
if (width !== style.width || height !== style.height) {
binding.value(); //
}
width = style.width;
height = style.height;
}
el.__vueSetInterval__ = setInterval(isReize, 300);
},
unbind(el) {
clearInterval(el.__vueSetInterval__);
}
}
},
name: 'Dashboard',
data() {
return {
loading:true,
navList:[],
}
},
watch: {
permission_routes(val, oldVal) {
this.initData(val)
}
},
computed: {
...mapGetters([
'permission_routes'
])
},
mounted(){
this.initData(this.permission_routes)
},
methods:{
initData(data){
data.forEach(item => {
if(!item.hidden && item.path !== '/') {
this.navList.push(item)
}
})
this.$nextTick(()=>{
this.setMaxHeight()
})
},
goPage(item){
this.$router.push({name: item.name})
},
setMaxHeight(){
// todothis.$route.path != /dashboard
console.log("setMaxHeight",this.$route.path)
if(document.getElementsByClassName("homeMenuPage-List").length <= 0){
return
}
let _items = document.getElementsByClassName("menuItem")
let _left = [];
let _right = [];
let _left_num = 0;
let _right_num = 0;
_items.forEach((item,key)=>{
//
if(key % 2 == 0){
_left.push(item.offsetHeight)
_left_num += Number(item.offsetHeight)
}
//
else{
_right.push(item.offsetHeight)
_right_num += Number(item.offsetHeight)
}
})
let _max = _left_num > _right_num ? _left_num : _right_num
_max += 20 * _items.length
document.getElementsByClassName("homeMenuPage-List")[0].style.height = _max + 'px'
this.loading = false
}
}
}
</script>
<style lang="scss" scoped>
$iconSize:26px;
.homeMenuPage{
height: 100%;
overflow: auto;
// padding: 20px 0;
}
.firstMenuContain {
display: flex;
flex-flow: column wrap;
align-content: space-between;
/*
* 且高度大于最高的列高 */
// height: 2500px;
.firstMenuItem {
width: calc(50% - 20px);
margin-bottom: 20px;
.firstTitle{
display: flex;
font-weight: bold;
font-size: 18px;
.icon{
background: #409eff;
color: #fff;
border-radius: 4px;
width: $iconSize;
height: $iconSize;
line-height: $iconSize;
overflow: hidden;
text-align: center;
margin-right: 10px;
}
}
.menuInfo{
background: #f9fafb;
margin: 20px 0;
padding: 5px 0;
li{
list-style: none;
display: flex;
padding-top: 10px;
.title{
width: 240px;
text-align: right;
font-weight: bold;
flex-shrink: 0;
.el-icon-arrow-right{
font-weight: bold;
font-size: 14px;
}
}
.lastList{
display: flex;
flex-wrap: wrap;
margin-left: 15px;
.item{
margin-right: 25px;
margin-bottom: 10px;
cursor: pointer;
&:hover{
color: #409eff;
}
}
}
}
}
/* 将内容块重排为4列 */
&:nth-of-type(2n+1) { order: 1; }
&:nth-of-type(2n) { order: 2; }
/* 强制换列 */
&.break {
flex-basis: 100%;
width: 0;
margin: 0;
content: "";
padding: 0;
}
}
}
</style>

207
Code/Fe/src/views/dashboard/index.vue

@ -1,84 +1,24 @@
<template>
<!-- 瀑布流版本布局 + 高度随宽度调整变化 -->
<el-card class="homeMenuPage" v-resize="setMaxHeight" v-loading="loading">
<div class="firstMenuContain homeMenuPage-List">
<div
class="firstMenuItem menuItem"
v-for="(item,index) in navList"
:key="index"
>
<div class="firstTitle">
<div class="icon"><svg-icon :icon-class="item.meta.icon" style="fill:currentColor; color:#fff;"/></div>
<div>{{item.meta.title}}</div>
<div class="dashboardPage">
<el-tree
:data="navList"
:props="defaultProps"
@node-click="goPage"
></el-tree>
</div>
<ul class="menuInfo" v-if="item.children && item.children.length > 0">
<li
v-for="(item2,index2) in item.children"
:key="index2"
>
<div class="title">
{{item2.meta.title}}
<i class="el-icon-arrow-right"></i>
</div>
<!-- 有下级菜单 -->
<div class="lastList" v-if="item2.children && item2.children.length > 0">
<div
v-for="(item3,index3) in item2.children"
:key="index3"
class="item"
>
<span @click="goPage(item3)">{{item3.meta.title}}</span>
</div>
</div>
<!-- 如果二级为最后一级统一格式补充到children中 -->
<div class="lastList" v-else>
<div class="item">
<span @click="goPage(item2)">{{item2.meta.title}}</span>
</div>
</div>
</li>
</ul>
</div>
<span class="firstMenuItem break"></span>
<span class="firstMenuItem break"></span>
<span class="firstMenuItem break"></span>
</div>
</el-card>
</template>
<script>
import { mapGetters } from 'vuex'
export default {
directives: {
//
resize: { //
bind(el, binding) { // elbinding
let width = '', height = '';
function isReize() {
const style = document.defaultView.getComputedStyle(el);
if (width !== style.width || height !== style.height) {
binding.value(); //
}
width = style.width;
height = style.height;
}
el.__vueSetInterval__ = setInterval(isReize, 300);
},
unbind(el) {
clearInterval(el.__vueSetInterval__);
}
}
},
name: 'Dashboard',
data() {
return {
loading:true,
navList:[],
defaultProps: {
children: 'children',
label: 'title'
}
},
watch: {
permission_routes(val, oldVal) {
this.initData(val)
}
},
computed: {
@ -92,130 +32,29 @@
methods:{
initData(data){
data.forEach(item => {
if(!item.hidden && item.path !== '/') {
this.navList.push(item)
if(!item.hidden && item.path !== '/' && item.meta) {
let _item = {
title:item.meta.title,
name:item.name,
path:item.path,
children:item.children
}
this.navList.push(_item)
}
if(!item.hidden && item.children){
this.initData(item.children)
}
})
this.$nextTick(()=>{
this.setMaxHeight()
})
},
goPage(item){
this.$router.push({name: item.name})
},
setMaxHeight(){
// todothis.$route.path != /dashboard
console.log("setMaxHeight",this.$route.path)
if(document.getElementsByClassName("homeMenuPage-List").length <= 0){
return
}
let _items = document.getElementsByClassName("menuItem")
let _left = [];
let _right = [];
let _left_num = 0;
let _right_num = 0;
_items.forEach((item,key)=>{
//
if(key % 2 == 0){
_left.push(item.offsetHeight)
_left_num += Number(item.offsetHeight)
}
//
else{
_right.push(item.offsetHeight)
_right_num += Number(item.offsetHeight)
}
})
let _max = _left_num > _right_num ? _left_num : _right_num
_max += 20 * _items.length
document.getElementsByClassName("homeMenuPage-List")[0].style.height = _max + 'px'
this.loading = false
}
}
}
</script>
<style lang="scss" scoped>
$iconSize:26px;
.homeMenuPage{
height: 100%;
overflow: auto;
// padding: 20px 0;
}
.firstMenuContain {
display: flex;
flex-flow: column wrap;
align-content: space-between;
/*
* 且高度大于最高的列高 */
// height: 2500px;
.firstMenuItem {
width: calc(50% - 20px);
margin-bottom: 20px;
.firstTitle{
display: flex;
font-weight: bold;
font-size: 18px;
.icon{
background: #409eff;
color: #fff;
border-radius: 4px;
width: $iconSize;
height: $iconSize;
line-height: $iconSize;
overflow: hidden;
text-align: center;
margin-right: 10px;
}
}
.menuInfo{
background: #f9fafb;
margin: 20px 0;
padding: 5px 0;
li{
list-style: none;
display: flex;
padding-top: 10px;
.title{
width: 240px;
text-align: right;
font-weight: bold;
flex-shrink: 0;
.el-icon-arrow-right{
font-weight: bold;
font-size: 14px;
}
}
.lastList{
display: flex;
flex-wrap: wrap;
margin-left: 15px;
.item{
margin-right: 25px;
margin-bottom: 10px;
cursor: pointer;
&:hover{
color: #409eff;
}
}
}
}
}
/* 将内容块重排为4列 */
&:nth-of-type(2n+1) { order: 1; }
&:nth-of-type(2n) { order: 2; }
/* 强制换列 */
&.break {
flex-basis: 100%;
width: 0;
margin: 0;
content: "";
padding: 0;
}
}
.dashboardPage{
padding:30px 10px;
background: #fff;
}
</style>

196
Code/Fe/src/views/demo/demo_base_handle.vue

@ -0,0 +1,196 @@
<template>
<div class="page-box" v-loading="Loading.tableLoading">
<!-- DEMO:只有主表 基础的主表增删改查 -->
<tablePagination
v-if="apiColumns_Table"
:currenButtonData="currenButtonData"
:tableData="tableData"
:tableLoading="Loading.tableLoading"
:tableColumns="apiColumns_Table"
@rowDrop="rowDrop"
:totalCount="totalCount"
:multipleSelection="multipleSelection"
:MaxResultCount="PageListParams.MaxResultCount"
@topbutton="topbutton"
@inlineDialog="inlineDialog"
@sortChange="sortChange"
@alertoldSkipCount="alertoldSkipCount"
@alterResultCount="alterResultCount"
@handleSelectionChange="handleSelectionChange"
:currentPageProps="oldSkipCount"
:quicklySearchOption="quicklySearchOption"
@quicklySearchClick="quicklySearchClick"
@quicklySearchClear="quicklySearchClear"
:primarySearchOption="primarySearchOption"
@overallSearchFormClick="overallSearchFormClick"
:httpOverallSearchData="httpOverallSearchData"
:buttonOperationList_left="buttonOperationClick_leftBase"
@buttonOperationClick_left="buttonOperationClick_left"
>
<!-- <div slot="tableTopSlot">
上方按钮插槽位置预留
</div>
<div slot="searchPrimarySlot">
普通初级搜索插槽位置预留
</div> -->
<!-- <template>表格内容插槽位置预留</template> -->
</tablePagination>
<!-- 新增与编辑 -->
<newAndEdiDialog
:loading="Loading.newAndEdiLoading"
:active="active"
:pageStatus="pageStatus"
:formReveal="formReveal"
:formTitle="formTitle"
:displayDialog="editDialog"
:FormData="formReveal ? CreateFormData : editFormData"
:Form="formReveal ? CreateForm : editForm"
:Options="editOptions"
:Handle="editHandle"
:Rules="formReveal ? editRules.cerateRule : editRules.editRule"
@FormSubmit="FormSubmit"
@close="FormClose"
@goBack="goBack"
></newAndEdiDialog>
<!-- 搜索按钮窗体组件 -->
<searchPage
ref="searchTable"
:tableLoading="Loading.autoTableLoading"
:advancedFilter="advancedFilter()"
:filterPageListParams="filterPageListParams"
:formTitle="searchTitle"
:displayDialog="displayDialog.AddNewDialog"
:searchTableData="searchData"
:searchTableColumns="searchColumns"
:searchTotalCount="searchTotalCount"
:supplierItemPage="searchPageListParams"
@handleSelectionChange="prepareFormData"
@SizeChange="searchAlterResultCount($event, searchPageListParams)"
@CurrentChange="searchAlertoldSkipCount($event, searchPageListParams)"
@tableButtonClick="searchSubmit(arguments)"
></searchPage>
<!-- 新导入 disabledMethod 导入方式禁用 disabledIsAllowPartImport 是否局部导入禁用-->
<!-- methodValue 导入方式默认选项 是否局部导入 默认选项 -->
<importFile
:loading="Loading.importLoading"
:show="displayDialog.importDialog"
:disabledMethod = {method1:false,method2:false,method3:false}
:disabledIsAllowPartImport = {isAllowPartImport1:false,isAllowPartImport2:false}
isAllowPartImportValue="1"
@importClick="postImportMergeClick(arguments)"
@postImportDown="importDown"
></importFile>
<!--抽屉-->
<curren-Drawer
ref="currenDrawer_Ref"
:title="apiColumns_DesTions"
@rowDrop="rowDrop"
:tableColumns="apiColumns_DetailsTable"
:tabsDesTions="apiColumns_DesTions"
:DrawerLoading="Loading.DrawerLoading"
:drawer="displayDialog.detailsDialog"
:propsData="propsData"
:dropdownData="dropdownData"
@drawerShut="(val) => (displayDialog.detailsDialog = val)"
@drawerbutton="drawerbutton"
@handleCommand="drawerHandle"
@close-value="closeValue"
:firstTabs="firstTabs"
:totalCount="totalCountDetails"
:currentPage="oldSkipCountDetails"
:MaxResultCount="MaxResultCountDetails"
@alterResultCountDetails="alterResultCountDetails"
@alertoldSkipCountDetails="alertoldSkipCountDetails"
:buttonOperationList_left="operationButtonsDetail"
></curren-Drawer>
</div>
</template>
<script>
import { tableMixins } from "@/mixins/TableMixins"
import { LoadingMixins } from "@/mixins/LoadingMixins"
import { drawerMixins } from "@/mixins/drawerMixins"
import { TableHeaderMixins } from "@/mixins/TableHeaderMixins"
import { newAndEdiDialogMixins } from "@/mixins/newAndEdiDialogMixins"
import { mixins } from "@/mixins/mixins"
import { filterSelectMixins } from '@/mixins/filter-Select'
import { zhApiColumnsLable } from '@/utils/index'
export default {
name: "ExportCustomUserSetting",
mixins: [
tableMixins,
LoadingMixins,
drawerMixins,
TableHeaderMixins,
mixins,
filterSelectMixins,
newAndEdiDialogMixins
],
computed: {
editDialog: {
get: function () {
return this.displayDialog.newDialog || this.displayDialog.editDialog;
},
},
},
data () {
const userInfo=this.$store.getters.currentUserInfo
return {
tableLoading:false,
//
currenButtonData: [
this.defaultAddBtn(),//
this.defaultFieldSettingBtn(),//
this.defaultFreshBtn(),//
this.defaultFilterBtn(),//
],
//
CreateFormData: {
customUserSetting: null,
exportUserName: userInfo.name,
exportUserId: userInfo.id,
exportColumnName: null,
exportTableName: null,
},
//
editFormData: {
customUserSetting: null,
exportUserName: userInfo.name,
exportUserId: userInfo.id,
exportColumnName: null,
exportTableName: null,
},
editOptions: {},
CreateForm: [
{ type: "input", label: zhApiColumnsLable('ExportCustomUserSettingCustomUserSetting'), prop: "customUserSetting", colSpan: 12 },
{ type: "input", label: zhApiColumnsLable('ExportCustomUserSettingExportColumnName'), prop: "exportColumnName", colSpan: 12 },
{ type: "input", label: zhApiColumnsLable('ExportCustomUserSettingExportTableName'), prop: "exportTableName", colSpan: 12 },
],
editForm: [
{ type: "input", label: zhApiColumnsLable('ExportCustomUserSettingCustomUserSetting'), prop: "customUserSetting", colSpan: 12 },
{ type: "input", label:zhApiColumnsLable('ExportCustomUserSettingExportColumnName'), prop: "exportColumnName", colSpan: 12 },
{ type: "input", label: zhApiColumnsLable('ExportCustomUserSettingExportTableName'), prop: "exportTableName", colSpan: 12 },
],
editRules: {
cerateRule: {
customUserSetting: [{ required: true, trigger: "blur", message: "不可为空" }],
exportColumnName: [{ required: true, trigger: "blur", message: "不可为空" }],
exportTableName: [{ required: true, trigger: "blur", message: "不可为空" }],
},
editRule: {
customUserSetting: [{ required: true, trigger: "blur", message: "不可为空" }],
exportColumnName: [{ required: true, trigger: "blur", message: "不可为空" }],
exportTableName: [{ required: true, trigger: "blur", message: "不可为空" }],
}
},
};
},
mounted () {
this.paging();
},
};
</script>
<style lang="scss" scoped>
@import "@/styles/basicData.scss";
</style>

46
Code/Fe/src/views/interfaceBoard/TestSchool_read.vue → Code/Fe/src/views/demo/demo_mst_det.vue

@ -1,6 +1,6 @@
<template>
<div class="page-box" v-loading="Loading.appMainLoading">
<!-- 只读样本 -->
<div class="page-box" v-loading="Loading.tableLoading">
<!-- DEMO:带主子表查询 没有新增编辑删除 -->
<tablePagination
v-if="apiColumns_Table"
:currenButtonData="currenButtonData"
@ -24,15 +24,19 @@
:primarySearchOption="primarySearchOption"
@overallSearchFormClick="overallSearchFormClick"
:httpOverallSearchData="httpOverallSearchData"
:buttonOperationList_left="buttonOperationClick_leftBase"
@buttonOperationClick_left="buttonOperationClick_left"
></tablePagination>
<curren-Drawer
ref="currenDrawer_Ref"
:title="apiColumns_DesTions"
@rowDrop="rowDrop"
:tableColumns="apiColumns_DetailsTable"
:tabsDesTions="apiColumns_DesTions"
:DrawerLoading="Loading.DrawerLoading"
:drawer="displayDialog.detailsDialog"
:Butttondata="[]"
:propsData="propsData"
:Butttondata="[]"
@drawerShut="(val) => (displayDialog.detailsDialog = val)"
@drawerbutton="drawerbutton"
@handleCommand="drawerHandle"
@ -42,15 +46,20 @@
:MaxResultCount="MaxResultCountDetails"
@alterResultCountDetails="alterResultCountDetails"
@alertoldSkipCountDetails="alertoldSkipCountDetails"
:buttonOperationList_left="operationButtonsDetail"
></curren-Drawer>
<!-- 明细查询页面 -->
<filterForDetailPage
v-if="filterForDetailShow"
:listColumns="apiColumns_DetailsTable"
:parentColumns="apiColumns_Table"
@closeDialog="changeFilterForDetailShow"
></filterForDetailPage>
<!-- DeleteApi="TestSchoolDetailList_delete" -->
<!-- todo: 明细查询中的parentColumns 是否需要独立表头现与列表页面一致-->
<!-- 导出弹窗 -->
<exportDrop
v-if="displayDialog.exportDialog"
@closeDialog="closeExportDrop"
@exportDropSubmit="exportDropSubmit"
></exportDrop>
</div>
</template>
<script>
@ -58,17 +67,17 @@ import { tableMixins } from "@/mixins/TableMixins";
import { LoadingMixins } from "@/mixins/LoadingMixins";
import { drawerMixins } from "@/mixins/drawerMixins"
import { TableHeaderMixins } from "@/mixins/TableHeaderMixins";
import { newAndEdiDialogMixins } from "@/mixins/newAndEdiDialogMixins"
import { mixins } from "@/mixins/mixins";
import { filterSelectMixins } from '@/mixins/filter-Select'
import { getToken } from '@/utils/auth'
import * as tableColumns_api from "@/utils/tableColumns_api/index" //
import * as tabsDesTions_api from "@/utils/tabsDesTions_api/index" //
import * as detailsTableColumns_api from "@/utils/detailsTableColumns_api/index" //
// import * as tableColumns_api from "@/utils/tableColumns_api/index" //
// import * as tabsDesTions_api from "@/utils/tabsDesTions_api/index" //
// import * as detailsTableColumns_api from "@/utils/detailsTableColumns_api/index" //-
// import * as detailsPageColumns_api from "@/utils/detailsPageColumns_api/index" //
export default {
name: "TestSchool",
name: "AsnMstr",
mixins: [
tableMixins,
LoadingMixins,
@ -76,7 +85,6 @@ export default {
TableHeaderMixins,
mixins,
filterSelectMixins,
newAndEdiDialogMixins
],
data() {
return {
@ -86,26 +94,18 @@ export default {
isRedundance:true,
isDetailExport:true
}),//
this.defaultFieldSettingBtn(),//
this.defaultFreshBtn(),//
this.defaultFilterBtn(),//
this.defaultFilterForDetailBtn()//
],
//
filterForDetailShow:false,
};
},
mounted() {
this.initApiColumns()
// 使api()
// this.initApiColumns(tableColumns_api,tabsDesTions_api,detailsTableColumns_api,detailsPageColumns_api)
this.paging();
},
methods: {
// api
initApiColumns(){
this.apiColumns_Table = tableColumns_api[this.$route.name]
this.apiColumns_DesTions = tabsDesTions_api[this.$route.name]
this.apiColumns_DetailsTable = detailsTableColumns_api[this.$route.name]
},
}
}
</script>
<style lang="scss" scoped>

79
Code/Fe/src/views/demo/demo_read.vue

@ -0,0 +1,79 @@
<template>
<div class="page-box" v-loading="Loading.tableLoading">
<!-- DEMO:只有主表查询 没有新增编辑删除 -->
<tablePagination
v-if="apiColumns_Table"
:currenButtonData="currenButtonData"
:tableData="tableData"
:tableLoading="Loading.tableLoading"
:tableColumns="apiColumns_Table"
@rowDrop="rowDrop"
:totalCount="totalCount"
:multipleSelection="multipleSelection"
:MaxResultCount="PageListParams.MaxResultCount"
@topbutton="topbutton"
@inlineDialog="inlineDialog"
@sortChange="sortChange"
@alertoldSkipCount="alertoldSkipCount"
@alterResultCount="alterResultCount"
@handleSelectionChange="handleSelectionChange"
:currentPageProps="oldSkipCount"
:quicklySearchOption="quicklySearchOption"
@quicklySearchClick="quicklySearchClick"
@quicklySearchClear="quicklySearchClear"
:primarySearchOption="primarySearchOption"
@overallSearchFormClick="overallSearchFormClick"
:httpOverallSearchData="httpOverallSearchData"
></tablePagination>
<!-- 导出弹窗 -->
<exportDrop
v-if="displayDialog.exportDialog"
@closeDialog="closeExportDrop"
@exportDropSubmit="exportDropSubmit"
></exportDrop>
</div>
</template>
<script>
import { tableMixins } from "@/mixins/TableMixins";
import { LoadingMixins } from "@/mixins/LoadingMixins";
import { drawerMixins } from "@/mixins/drawerMixins"
import { TableHeaderMixins } from "@/mixins/TableHeaderMixins";
import { newAndEdiDialogMixins } from "@/mixins/newAndEdiDialogMixins"
import { mixins } from "@/mixins/mixins";
import { filterSelectMixins } from '@/mixins/filter-Select'
import { getToken } from '@/utils/auth'
export default {
name: "IncomingData",
mixins: [
tableMixins,
LoadingMixins,
drawerMixins,
TableHeaderMixins,
mixins,
filterSelectMixins,
newAndEdiDialogMixins
],
data() {
return {
//
currenButtonData: [
this.defaultExportBtn({
isRedundance:true,
isDetailExport:true
}),//
this.defaultFieldSettingBtn(),//
this.defaultFreshBtn(),//
this.defaultFilterBtn(),//
],
};
},
mounted() {
this.paging();
},
}
</script>
<style lang="scss" scoped>
@import "@/styles/basicData.scss";
</style>

466
Code/Fe/src/views/interfaceBoard/TestSchool_all.vue

@ -1,466 +0,0 @@
<template>
<div class="page-box" v-loading="Loading.appMainLoading">
<tablePagination
:currenButtonData="currenButtonData"
:tableData="tableData"
:tableLoading="Loading.tableLoading"
:tableColumns="apiColumns_Table"
@rowDrop="rowDrop"
:totalCount="totalCount"
:multipleSelection="multipleSelection"
:MaxResultCount="PageListParams.MaxResultCount"
@topbutton="customTopbutton"
@inlineDialog="inlineDialog"
@sortChange="sortChange"
@alertoldSkipCount="alertoldSkipCount"
@alterResultCount="alterResultCount"
@handleSelectionChange="handleSelectionChange"
:currentPageProps="oldSkipCount"
:quicklySearchOption="quicklySearchOption"
@quicklySearchClick="quicklySearchClick"
@quicklySearchClear="quicklySearchClear"
:primarySearchOption="primarySearchOption"
@overallSearchFormClick="overallSearchFormClick"
:httpOverallSearchData="httpOverallSearchData"
></tablePagination>
<!-- 新增与编辑 -->
<newAndEdiDialogForDetail
v-if="apiColumns_DetailsTable"
ref="newAndEdiDialogForDetail"
:loading="Loading.newAndEdiLoading"
:active="active"
:pageStatus="pageStatus"
:formReveal="formReveal"
:formTitle="formTitle"
:displayDialog="editDialog"
:FormData="formReveal ? CreateFormData : editFormData"
:Form="formReveal ? CreateForm : editForm"
:Options="editOptions"
:Handle="editHandle"
:Rules="formReveal ? editRules.cerateRule : editRules.editRule"
@FormSubmit="FormSubmit"
@close="FormClose"
@goBack="goBack"
:flexTableColumns="flexTableColumns"
></newAndEdiDialogForDetail>
<curren-Drawer
:title="apiColumns_DesTions"
:tableColumns="apiColumns_DetailsTable"
:tabsDesTions="apiColumns_DesTions"
:DrawerLoading="Loading.DrawerLoading"
:drawer="displayDialog.detailsDialog"
:dropdownData="dropdownData"
:propsData="propsData"
@drawerShut="(val) => (displayDialog.detailsDialog = val)"
@drawerbutton="drawerbutton"
@handleCommand="drawerHandle"
@close-value="closeValue"
:totalCount="totalCountDetails"
:currentPage="oldSkipCountDetails"
:MaxResultCount="MaxResultCountDetails"
@alterResultCountDetails="alterResultCountDetails"
@alertoldSkipCountDetails="alertoldSkipCountDetails"
>
<!-- 明细中的删除示例 但是明细应该只读删除及新增编辑在明细查询中处理所以暂隐藏 -->
<!-- <template v-if="currentTagName == 'mx' ">
<el-table-column
label="操作"
:align="'center'"
width="100"
>
<template slot-scope="scope">
<el-popover
placement="left"
width="260"
v-model="scope.row.deleteTipVisible"
>
<p>此操作将永久删除该消息, 是否继续?</p>
<div style="text-align: right; margin: 0">
<el-button size="mini" type="text" style="margin-right: 20px;" @click="scope.row.deleteTipVisible = false">取消</el-button>
<el-button type="primary" size="mini" @click="deleteHandleForDetail(scope.row)">确定</el-button>
</div>
<el-button type="text" slot="reference" style="color: red;">删除</el-button>
</el-popover>
</template>
</el-table-column>
</template> -->
</curren-Drawer>
<filterForDetailPage
v-if="filterForDetailShow"
ref="filterForDetailPage"
listApi="TestSchoolDetailList"
DeleteApi="TestSchoolDetailList_delete"
:listColumns="apiColumns_DetailsTable"
@closeDialog="changeFilterForDetailShow"
></filterForDetailPage>
</div>
</template>
<script>
import { tableMixins } from "@/mixins/TableMixins";
import { LoadingMixins } from "@/mixins/LoadingMixins";
import { drawerMixins } from "@/mixins/drawerMixins"
import { TableHeaderMixins } from "@/mixins/TableHeaderMixins";
import { newAndEdiDialogMixins } from "@/mixins/newAndEdiDialogMixins"
import { mixins } from "@/mixins/mixins";
import { filterSelectMixins } from '@/mixins/filter-Select'
// import { TestSchool,TestSchool_save,TestSchoolItemById,TestSchool_delete,TestSchoolDetailList_delete } from "@/api/wms-interface"
import { getToken } from '@/utils/auth'
export default {
name: "TestSchool",
mixins: [
tableMixins,
LoadingMixins,
drawerMixins,
TableHeaderMixins,
mixins,
filterSelectMixins,
newAndEdiDialogMixins
],
computed: {
editDialog: {
get: function () {
return this.displayDialog.newDialog || this.displayDialog.editDialog;
},
},
},
data() {
// let _Dashboard = JSON.parse(localStorage.getItem("interfaceBoardColumnsNames")) //
return {
currentTagName:'mx',
//
currenButtonData: [
this.defaultAddBtn(),//
this.defaultExportBtn(),//
this.defaultFieldSettingBtn(),//
this.defaultFreshBtn(),//
this.defaultFilterBtn(),//
this.defaultFilterForDetailBtn()//
],
flexTableColumns:[
{ label: "学生33", prop: "studentName", width:"auto", type:"input" },
{ label: "orderType33", prop: "orderType", width:"auto" },
{ label: "创建时间33", prop: "creationTime", type: "dateTime", width:"auto" },
],
//
CreateFormData: {
schoolName:null,
orderType:null,
details:null,
// details: [
// {
// "lastModifierId": "ad731144-d789-f322-fede-327cac55dd36",
// "creationTime": "1978-07-18T22:00:37.5Z",
// "creatorId": "19e78d1b-6203-8d6d-b6e7-ae5b503c0824",
// "id": "5926ec25-2132-ba25-6b93-e453c17f00e2",
// "studentName": "",
// "orderType": 2,
// "masterId": "a044e2c6-3bc6-7cdd-55a6-f1a2a9682ccb",
// "lastModificationTime": "1946-12-30T14:22:31.982Z"
// },
// ],
// number: null,//+*
// remark: null,
// dataType: null,
// tableType: null,//+*
// dataAction: null,//+*
// effectiveDate: null,//*
// status: null,//+*
// sourceSystem: null,
// sourceDataId: null,
// sourceDataGroupCode: null,
// sourceDataDetailCode: null,
// sourceDataContent: null,
// writeTime: null,//*
// writer: null,
// destinationSystem: null,
// destinationDataId: null,
// destinationDataContent: null,
// readTime: null,//*
// reader: null,
// errorCode: null,//+*
// errorMessage: null,
// retryTimes: null,//+*
},
//
editFormData: {
id:null,
schoolName:null,
orderType:null,
details:null,
// number: null,//+*
// remark: null,
// dataType: null,
// tableType: null,//+*
// dataAction: null,//+*
// effectiveDate: null,//*
// status: null,//+*
// sourceSystem: null,
// sourceDataId: null,
// sourceDataGroupCode: null,
// sourceDataDetailCode: null,
// sourceDataContent: null,
// writeTime: null,//*
// writer: null,
// destinationSystem: null,
// destinationDataId: null,
// destinationDataContent: null,
// readTime: null,//*
// reader: null,
// errorCode: null,//+*
// errorMessage: null,
// retryTimes: null,//+*
},
CreateForm: [
{ type: "input", label: '名称', prop: 'schoolName', colSpan: 12 },
{ type: "input", label: 'orderType', prop: 'orderType', colSpan: 12 },
// { type: "input", label: _Dashboard.OutgoingToExternalDataType, prop: 'dataType', colSpan: 12, },
// { type: "input", label: _Dashboard.OutgoingToExternalTableType, prop: 'tableType', colSpan: 12, validType:'pointNumber' },
// { type: "input", label: _Dashboard.OutgoingToExternalDataAction, prop: 'dataAction', colSpan: 12, validType:'pointNumber' },
// { type: "dateTime", label: _Dashboard.OutgoingToExternalEffectiveDate, prop: 'effectiveDate', colSpan: 12, },
// { type: "input", label: _Dashboard.OutgoingToExternalStatus, prop: 'status', colSpan: 12, validType:'pointNumber' },
// { type: "input", label: _Dashboard.OutgoingToExternalSourceSystem, prop: 'sourceSystem', colSpan: 12, },
// { type: "input", label: _Dashboard.OutgoingToExternalSourceDataId, prop: 'sourceDataId', colSpan: 12, },
// { type: "input", label: _Dashboard.OutgoingToExternalSourceDataGroupCode, prop: 'sourceDataGroupCode', colSpan: 12, },
// { type: "input", label: _Dashboard.OutgoingToExternalSourceDataDetailCode, prop: 'sourceDataDetailCode', colSpan: 12, },
// { type: "input", label: _Dashboard.OutgoingToExternalSourceDataContent, prop: 'sourceDataContent', colSpan: 12, },
// { type: "dateTime", label: _Dashboard.OutgoingToExternalWriteTime, prop: 'writeTime', colSpan: 12, },
// { type: "input", label: _Dashboard.OutgoingToExternalWriter, prop: 'writer', colSpan: 12, },
// { type: "input", label: _Dashboard.OutgoingToExternalDestinationSystem, prop: 'destinationSystem', colSpan: 12, },
// { type: "input", label: _Dashboard.OutgoingToExternalDestinationDataId, prop: 'destinationDataId', colSpan: 12, },
// { type: "input", label: _Dashboard.OutgoingToExternalDestinationDataContent, prop: 'destinationDataContent', colSpan: 12, },
// { type: "dateTime", label: _Dashboard.OutgoingToExternalReadTime, prop: 'readTime', colSpan: 12, },
// { type: "input", label: _Dashboard.OutgoingToExternalReader, prop: 'reader', colSpan: 12, },
// { type: "input", label: _Dashboard.OutgoingToExternalErrorCode, prop: 'errorCode', colSpan: 12, validType:'pointNumber' },
// { type: "input", label: _Dashboard.OutgoingToExternalErrorMessage, prop: 'errorMessage', colSpan: 12, },
// { type: "input", label: _Dashboard.OutgoingToExternalRetryTimes, prop: 'retryTimes', colSpan: 12, validType:'pointNumber'},
],
editForm: [
{ type: "input", label: '名称', prop: 'schoolName', colSpan: 12 },
{ type: "input", label: 'orderType', prop: 'orderType', colSpan: 12 },
// { type: "input", label: _Dashboard.OutgoingToExternalNumber, prop: 'number', colSpan: 12, validType:'pointNumber' },
// { type: "input", label: _Dashboard.OutgoingToExternalRemark, prop: 'remark', colSpan: 12, },
// { type: "input", label: _Dashboard.OutgoingToExternalDataType, prop: 'dataType', colSpan: 12, },
// { type: "input", label: _Dashboard.OutgoingToExternalTableType, prop: 'tableType', colSpan: 12, validType:'pointNumber' },
// { type: "input", label: _Dashboard.OutgoingToExternalDataAction, prop: 'dataAction', colSpan: 12, validType:'pointNumber' },
// { type: "dateTime", label: _Dashboard.OutgoingToExternalEffectiveDate, prop: 'effectiveDate', colSpan: 12, },
// { type: "input", label: _Dashboard.OutgoingToExternalStatus, prop: 'status', colSpan: 12, validType:'pointNumber' },
// { type: "input", label: _Dashboard.OutgoingToExternalSourceSystem, prop: 'sourceSystem', colSpan: 12, },
// { type: "input", label: _Dashboard.OutgoingToExternalSourceDataId, prop: 'sourceDataId', colSpan: 12, },
// { type: "input", label: _Dashboard.OutgoingToExternalSourceDataGroupCode, prop: 'sourceDataGroupCode', colSpan: 12, },
// { type: "input", label: _Dashboard.OutgoingToExternalSourceDataDetailCode, prop: 'sourceDataDetailCode', colSpan: 12, },
// { type: "input", label: _Dashboard.OutgoingToExternalSourceDataContent, prop: 'sourceDataContent', colSpan: 12, },
// { type: "dateTime", label: _Dashboard.OutgoingToExternalWriteTime, prop: 'writeTime', colSpan: 12, },
// { type: "input", label: _Dashboard.OutgoingToExternalWriter, prop: 'writer', colSpan: 12, },
// { type: "input", label: _Dashboard.OutgoingToExternalDestinationSystem, prop: 'destinationSystem', colSpan: 12, },
// { type: "input", label: _Dashboard.OutgoingToExternalDestinationDataId, prop: 'destinationDataId', colSpan: 12, },
// { type: "input", label: _Dashboard.OutgoingToExternalDestinationDataContent, prop: 'destinationDataContent', colSpan: 12, },
// { type: "dateTime", label: _Dashboard.OutgoingToExternalReadTime, prop: 'readTime', colSpan: 12, },
// { type: "input", label: _Dashboard.OutgoingToExternalReader, prop: 'reader', colSpan: 12, },
// { type: "input", label: _Dashboard.OutgoingToExternalErrorCode, prop: 'errorCode', colSpan: 12, validType:'pointNumber' },
// { type: "input", label: _Dashboard.OutgoingToExternalErrorMessage, prop: 'errorMessage', colSpan: 12, },
// { type: "input", label: _Dashboard.OutgoingToExternalRetryTimes, prop: 'retryTimes', colSpan: 12, validType:'pointNumber'},
],
editOptions: {},
editRules: {
cerateRule: {
schoolName: [{ required: true, trigger: "blur", message: "不可为空" }],
// number: [{ required: true, trigger: "blur", message: "" }],
// tableType: [{ required: true, trigger: "blur", message: "" }],
// dataAction: [{ required: true, trigger: "blur", message: "" }],
// effectiveDate: [{ required: true, trigger: "blur", message: "" }],
// status: [{ required: true, trigger: "blur", message: "" }],
// writeTime: [{ required: true, trigger: "blur", message: "" }],
// readTime: [{ required: true, trigger: "blur", message: "" }],
// errorCode: [{ required: true, trigger: "blur", message: "" }],
// retryTimes: [{ required: true, trigger: "blur", message: "" }],
},
editRule: {
schoolName: [{ required: true, trigger: "blur", message: "不可为空" }],
// number: [{ required: true, trigger: "blur", message: "" }],
// tableType: [{ required: true, trigger: "blur", message: "" }],
// dataAction: [{ required: true, trigger: "blur", message: "" }],
// effectiveDate: [{ required: true, trigger: "blur", message: "" }],
// status: [{ required: true, trigger: "blur", message: "" }],
// writeTime: [{ required: true, trigger: "blur", message: "" }],
// readTime: [{ required: true, trigger: "blur", message: "" }],
// errorCode: [{ required: true, trigger: "blur", message: "" }],
// retryTimes: [{ required: true, trigger: "blur", message: "" }],
}
},
//
filterForDetailShow:false,
currentDetailId:null,//id,
};
},
mounted() {
this.initApiColumns()
this.paging();
},
methods: {
//
// paging(callback) {
// this.Loading.tableLoading = true;
// // this.apiColumns_Table = tableColumns_api[this.$route.name]
// // this.apiColumns_DesTions = tabsDesTions_api[this.$route.name]
// // this.apiColumns_DetailsTable = detailsTableColumns_api[this.$route.name]
// this.PageListParams.SkipCount = (this.oldSkipCount - 1) * this.PageListParams.MaxResultCount
// TestSchool(this.PageListParams,true)
// .then(result => {
// this.tableData = result.items
// this.totalCount = result.totalCount
// this.pagingCallback(callback)
// })
// .catch(err => {
// this.Loading.tableLoading = false
// this.$message.error("")
// })
// },
//
inlineDialog(val) {
this.Loading.DrawerLoading = true
this.displayDialog.detailsDialog = true;
this.currentDetailId = val.id
// TestSchoolItemById(val.id)
// .then(res => {
// if (res.details) {
// //
// this.tableDataDetails = JSON.parse(JSON.stringify(res))
// let linshiTableDataDetails = JSON.parse(JSON.stringify(this.tableDataDetails))
// this.totalCountDetails = res.details.length
// this.propsData = linshiTableDataDetails
// //
// linshiTableDataDetails.details.splice(this.MaxResultCountDetails,this.totalCountDetails);
// } else {
// this.propsData = res
// }
// this.inlineDialogCallback()
// })
// .catch(err => {
// this.Loading.DrawerLoading = false
// this.$message.error("")
// })
},
// / todo:
FormSubmit(val){
this.Loading.tableLoading = true
let _data = this.formReveal ? this.CreateFormData : this.editFormData
// if(!this.formReveal){
// _data.details= [
// {
// "lastModifierId": "ad731144-d789-f322-fede-327cac55dd36",
// "creationTime": "1978-07-18T22:00:37.5Z",
// "creatorId": "19e78d1b-6203-8d6d-b6e7-ae5b503c0824",
// "id": "5926ec25-2132-ba25-6b93-e453c17f00e2",
// "studentName": "2",
// "orderType": 32,
// "masterId": "a044e2c6-3bc6-7cdd-55a6-f1a2a9682ccb",
// "lastModificationTime": "1946-12-30T14:22:31.982Z"
// },
// {
// "orderType": 4,
// "id": "b1d829d2-f3c2-9584-5b91-5ce64eea194a",
// "masterId": "f789a9ef-ffbe-f690-fc49-b87d57093b5c",
// "lastModificationTime": null,
// "creationTime": "2010-07-21T09:46:13.372Z",
// "creatorId": null,
// "studentName": "",
// "lastModifierId": null
// },
// ]
// }
// TestSchool_save(_data,this.formReveal)
// .then(result => {
// this.FormResult("success")
// this.Loading.tableLoading = false
// })
// .catch(err => {
// this.FormResult("error")
// this.Loading.tableLoading = false
// })
// const _data = new URLSearchParams();
// for(let item in this.CreateFormData){
// _data.append('ViewModel.'+item.slice(0,1).toUpperCase() +item.slice(1).toLowerCase(), this.CreateFormData[item])
// }
// // todo:1302 2token
// _data.append('__RequestVerificationToken',getToken())
// // this.formReveal
// TestSchool_save(_data,this.formReveal)
// .then(result => {
// this.Loading.tableLoading = false
// })
// .catch(err => {
// this.Loading.tableLoading = false
// })
},
// FormSubmit(val){
// this.Loading.tableLoading = true
// const _data = new URLSearchParams();
// for(let item in this.CreateFormData){
// _data.append('ViewModel.'+item.slice(0,1).toUpperCase() +item.slice(1).toLowerCase(), this.CreateFormData[item])
// }
// // todo:1302 2token
// _data.append('__RequestVerificationToken',getToken())
// // this.formReveal
// TestSchool_save(_data,this.formReveal)
// .then(result => {
// this.Loading.tableLoading = false
// })
// .catch(err => {
// this.Loading.tableLoading = false
// })
// },
//
drawerHandle(val) {
if (val == 'delete') {
this.$confirm('此操作将永久删除该消息, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.Loading.appMainLoading = true
this.displayDialog.detailsDialog = false
// todo:1302
// TestSchool_delete(this.propsData.id).then(res => {
// this.$successMsg('!')
// this.Loading.appMainLoading = false
// this.paging()
// }).catch(err => {
// this.Loading.appMainLoading = false
// this.$message.error("!")
// })
}).catch(() => {
//
});
}
},
changeFilterForDetailShow(data){
this.filterForDetailShow = data
},
customTopbutton(val,item){
//
if(val == 'filterForDetail'){
this.changeFilterForDetailShow(true)
}else{
this.topbutton(val,item)
}
},
deleteHandleForDetail(data){
this.Loading.appMainLoading = true
data.deleteTipVisible = false
// TestSchoolDetailList_delete(data.id).then(res => {
// this.$successMsg('!')
// this.Loading.appMainLoading = false
// this.oldSkipCountDetails = 1
// this.inlineDialog({id:this.currentDetailId})
// }).catch(err => {
// this.Loading.appMainLoading = false
// this.$message.error("!")
// })
},
}
}
</script>
<style lang="scss" scoped>
@import "@/styles/basicData.scss";
</style>

33
Code/Fe/src/views/login/index.vue

@ -70,7 +70,6 @@
</div>
</template>
<script>
import { getInterfaceBoard } from "@/api/wms-interface"
import { login,getUsersByUserName } from "@/api/wms-auth"
export default {
name: 'Login',
@ -165,25 +164,31 @@ export default {
handleLogin () {
this.$refs.loginForm.validate(valid => {
if (valid) {
// todo-new:
this.$store.dispatch('user/getUserInfo',this.loginForm.username).then(()=>{
localStorage.setItem('isLoginName',this.loginForm.username)
this.$router.push({
path:'/',
query:{
isSinglePage:this.$route.query.isSinglePage
},
replace: true
})
}).catch(()=>{
this.$message.error('获取用户信息失败,请重试!')
})
return
this.loading = true
this.loginForm.userNameOrEmailAddress = this.loginForm.username
// todo-new:permission
let _zh = localStorage.getItem('columnsApiNamesZh')
login(this.loginForm).then(()=>{
// this.$store.dispatch('user/login', this.loginForm).then(() => {
//
getUsersByUserName(localStorage.getItem("userNameOrEmailAddress")).then(res=>{
// store.dispatch('user/setName',res)
localStorage.setItem("currentUserInfo", JSON.stringify(res));
})
getInterfaceBoard().then(result => {
localStorage.setItem("interfaceBoardColumnsNames", JSON.stringify(result.localization.values.Winin));
this.$router.push({ path: '/'})
this.loading = false
})
.catch(err => {
this.$message.error('获取表头失败,请重试')
this.loading = false
})
// getUsersByUserName(localStorage.getItem("userNameOrEmailAddress")).then(res=>{
// // store.dispatch('user/setName',res)
// localStorage.setItem("currentUserInfo", JSON.stringify(res));
// })
// this.$router.push({ path: '/'})
// this.loading = false
})

25
Code/Fe/src/views/interfaceBoard/TestSchool.vue → Code/Fe/src/views/menuList/TestSchool.vue

@ -1,5 +1,5 @@
<template>
<div class="page-box" v-loading="Loading.appMainLoading">
<div class="page-box" v-loading="Loading.tableLoading">
<tablePagination
v-if="apiColumns_Table"
:currenButtonData="currenButtonData"
@ -23,10 +23,13 @@
:primarySearchOption="primarySearchOption"
@overallSearchFormClick="overallSearchFormClick"
:httpOverallSearchData="httpOverallSearchData"
@buttonOperationClick="buttonOperationClick"
:buttonOperationList="operationButtonsTable"
@buttonOperationClick_left="buttonOperationClick_left"
:buttonOperationList_left="buttonOperationClick_leftBase"
:buttonOperationList_right="buttonOperationList_rightBase"
@buttonOperationClick_right="buttonOperationClick_right"
></tablePagination>
<curren-Drawer
ref="currenDrawer_Ref"
:title="apiColumns_DesTions"
@rowDrop="rowDrop"
:tableColumns="apiColumns_DetailsTable"
@ -35,7 +38,6 @@
:drawer="displayDialog.detailsDialog"
:dropdownData="dropdownData"
:propsData="propsData"
@detailFiltersSearch="detailFiltersSearch"
:detailSearchDataFE="detailSearchDataFE"
@drawerShut="(val) => (displayDialog.detailsDialog = val)"
@drawerbutton="drawerbutton"
@ -46,6 +48,7 @@
:MaxResultCount="MaxResultCountDetails"
@alterResultCountDetails="alterResultCountDetails"
@alertoldSkipCountDetails="alertoldSkipCountDetails"
:buttonOperationList_left="operationButtonsDetail"
></curren-Drawer>
<!-- 新增与编辑 -->
<newAndEdiDialog
@ -67,7 +70,6 @@
<!-- 明细查询页面 -->
<filterForDetailPage
v-if="filterForDetailShow"
:listColumns="apiColumns_DetailsTable"
:parentColumns="apiColumns_Table"
@closeDialog="changeFilterForDetailShow"
></filterForDetailPage>
@ -90,10 +92,10 @@ import { newAndEdiDialogMixins } from "@/mixins/newAndEdiDialogMixins"
import { mixins } from "@/mixins/mixins";
import { filterSelectMixins } from '@/mixins/filter-Select'
import { getToken } from '@/utils/auth'
import * as tableColumns_api from "@/utils/tableColumns_api/index" //
import * as tabsDesTions_api from "@/utils/tabsDesTions_api/index" //
import * as detailsTableColumns_api from "@/utils/detailsTableColumns_api/index" //
// import * as tableColumns_api from "@/utils/tableColumns_api/index" //
// import * as tabsDesTions_api from "@/utils/tabsDesTions_api/index" //
// import * as detailsTableColumns_api from "@/utils/detailsTableColumns_api/index" //-
// import * as detailsPageColumns_api from "@/utils/detailsPageColumns_api/index" //
export default {
name: "TestSchool",
@ -127,8 +129,6 @@ export default {
this.defaultFilterBtn(),//
this.defaultFilterForDetailBtn()//
],
//
filterForDetailShow:false,
//
CreateFormData: {
schoolName:null,
@ -176,7 +176,8 @@ export default {
};
},
mounted() {
this.initApiColumns(tableColumns_api,tabsDesTions_api,detailsTableColumns_api)
// 使api()
// this.initApiColumns(tableColumns_api,tabsDesTions_api,detailsTableColumns_api,detailsPageColumns_api)
this.paging();
},
}

2
Code/Fe/src/views/profileuser/index.vue

@ -96,7 +96,7 @@ export default {
},
methods: {
getUser() {
loadLoginUserInfo(this.$store.getters.name.id).then((response) => {
loadLoginUserInfo(this.$store.getters.currentUserInfo.id).then((response) => {
this.user = response;
});
},

2
Code/Fe/src/views/profileuser/resetPwd.vue

@ -74,7 +74,7 @@ export default {
postLoginUserInfo({
currentPassword: this.user.oldPassword,
newPassword: this.user.newPassword,
}, this.$store.getters.name.id)
}, this.$store.getters.currentUserInfo.id)
.then((response) => {
this.$notify({
title: "成功",

Loading…
Cancel
Save