Browse Source

提交消息通知改造时解决冲突

master_hella_20240701
ljlong_2630 7 months ago
parent
commit
77fd9e8d03
  1. 2
      .env
  2. 48
      .env.wyf
  3. 1
      .gitignore
  4. 7
      README.md
  5. 10
      build/vite/index.ts
  6. 4
      index.html
  7. 1
      package.json
  8. 53
      src/api/mes/holiday/index.ts
  9. 4
      src/api/mes/orderDay/index.ts
  10. 57
      src/api/mes/orderDayConfig/index.ts
  11. 158
      src/api/mes/process/index.ts
  12. 46
      src/api/mes/processroute/index.ts
  13. 59
      src/api/mes/productBackline/index.ts
  14. 71
      src/api/mes/productOffline/index.ts
  15. 46
      src/api/mes/workScheduling/index.ts
  16. 62
      src/api/mes/workSchedulingDetail/index.ts
  17. 81
      src/api/mes/workcalendar/index.ts
  18. 95
      src/api/mes/workstation/index.ts
  19. 8
      src/api/qms/aql/index.ts
  20. 9
      src/api/qms/dynamicRule/index.ts
  21. 13
      src/api/qms/inspectionJob/InspectionJobPackage/InspectionJobPackage.ts
  22. 5
      src/api/qms/inspectionJob/inspectionJobMain/index.ts
  23. 8
      src/api/qms/inspectionMethod/index.ts
  24. 13
      src/api/qms/inspectionRecord/InspectionRecordPackage/InspectionRecordPackage.ts
  25. 4
      src/api/qms/inspectionRecord/inspectionRecordMain/index.ts
  26. 27
      src/api/qms/inspectionRequest/InspectionRequestPackage.ts
  27. 15
      src/api/qms/inspectionRequest/index.ts
  28. 9
      src/api/qms/inspectionScheme/index.ts
  29. 11
      src/api/qms/inspectionTemplate/index.ts
  30. 9
      src/api/qms/sampleCode/index.ts
  31. 8
      src/api/qms/samplingProcess/index.ts
  32. 9
      src/api/qms/samplingScheme/index.ts
  33. 9
      src/api/qms/selectedSet/index.ts
  34. 71
      src/api/system/user/index.ts
  35. 18
      src/api/wms/demandforecastingMain/index.ts
  36. 57
      src/api/wms/interfaceInfo/index.ts
  37. 5
      src/api/wms/issueRequestMain/index.ts
  38. 16
      src/api/wms/package/index.ts
  39. 13
      src/api/wms/productputawayJobDetail/index.ts
  40. 25
      src/api/wms/productputawayJobMain/index.ts
  41. 12
      src/api/wms/productputawayRecordDetail/index.ts
  42. 26
      src/api/wms/productputawayRecordMain/index.ts
  43. 13
      src/api/wms/productputawayRequestDetail/index.ts
  44. 25
      src/api/wms/productputawayRequestMain/index.ts
  45. 13
      src/api/wms/productreceiptJobDetail/index.ts
  46. 13
      src/api/wms/productreceiptRecordDetail/index.ts
  47. 13
      src/api/wms/productreceiptRequestDetail/index.ts
  48. 11
      src/api/wms/purchasereceiptJobDetail/index.ts
  49. 22
      src/api/wms/purchasereceiptRecordDetail/index.ts
  50. 11
      src/api/wms/purchasereceiptRequestDetail/index.ts
  51. 4
      src/api/wms/purchasereceiptRequestMain/index.ts
  52. 9
      src/api/wms/purchasereturnRecordDetail/index.ts
  53. 20
      src/api/wms/supplierinvoiceRequestMain/index.ts
  54. 16
      src/api/wms/team/index.ts
  55. 25
      src/api/wms/unplannedissueRecordDetail/index.ts
  56. 25
      src/api/wms/unplannedissueRequestDetail/index.ts
  57. 47
      src/api/wms/unplannedissueRequestMain/index.ts
  58. 1
      src/assets/imgs/logo_white.svg
  59. 15
      src/components/Annex/src/Annex.vue
  60. 79
      src/components/BasicForm/src/BasicForm.vue
  61. 8
      src/components/Descriptions/src/Descriptions.vue
  62. 105
      src/components/Detail/src/Detail.vue
  63. 19
      src/components/Form/src/Form.vue
  64. 186
      src/components/ListTable/src/ListTable.vue
  65. 5
      src/components/RouterSearch/index.vue
  66. 15
      src/components/Search/src/Search.vue
  67. 16
      src/components/SearchTable/src/SearchTable.vue
  68. 40
      src/components/Table/src/Table.vue
  69. 2
      src/components/TableForm/src/TableForm.vue
  70. 10
      src/components/TableHead/src/TableHead.vue
  71. 4
      src/components/UploadFile/src/UploadFile.vue
  72. 7
      src/components/XButton/src/ButtonBase.vue
  73. 40
      src/components/rowDrop/index.vue
  74. 8
      src/config/axios/index.ts
  75. 2
      src/directives/index.ts
  76. 21
      src/directives/permission/clientTable.ts
  77. 9
      src/hooks/web/useCrudSchemas.ts
  78. 70
      src/layout/components/CategoryHeader.vue
  79. 44
      src/layout/components/Logo/src/Logo.vue
  80. 17
      src/layout/components/Menu/src/Menu.vue
  81. 6
      src/layout/components/Message/src/Message.vue
  82. 98
      src/layout/components/useRenderLayout.tsx
  83. 2
      src/permission.ts
  84. 19
      src/router/modules/remaining.ts
  85. 17
      src/store/modules/app.ts
  86. 4
      src/styles/var.css
  87. 2
      src/types/form.d.ts
  88. 6
      src/utils/dict.ts
  89. 36
      src/utils/disposition/defaultButtons.ts
  90. 16
      src/utils/validator.ts
  91. 378
      src/views/login/components/LoginForm.vue
  92. 85
      src/views/login/forgetPassword.vue
  93. 105
      src/views/login/updatePassword.vue
  94. 5
      src/views/mes/abilityInfo/index.vue
  95. 969
      src/views/mes/components/Detail.vue
  96. 3
      src/views/mes/dismantlingMain/index.vue
  97. 109
      src/views/mes/holiday/holiday.data.ts
  98. 226
      src/views/mes/holiday/index.vue
  99. 5
      src/views/mes/hrPersonAbility/index.vue
  100. 16
      src/views/mes/item/index.vue

2
.env

@ -1,5 +1,5 @@
# 标题
VITE_APP_TITLE=闻荫管理系统
VITE_APP_TITLE=SFMS管理系统
# 项目本地运行端口号
VITE_PORT=80

48
.env.wyf

@ -0,0 +1,48 @@
# 生产环境
NODE_ENV=test
VITE_DEV=false
# 请求路径
VITE_BASE_URL='http://192.168.0.108:12080'
# 上传路径
VITE_UPLOAD_URL='http://192.168.0.108:12080/admin-api/infra/file/upload'
# # 请求路径
# VITE_BASE_URL='http://dev.ccwin-in.com:25300/api'
# # 上传路径
# VITE_UPLOAD_URL='http://dev.ccwin-in.com:25300/api/admin-api/infra/file/upload'
# 接口前缀
VITE_API_BASEPATH=
# 接口地址
VITE_API_URL=/admin-api
# 是否删除debugger
VITE_DROP_DEBUGGER=true
# 是否删除console.log
VITE_DROP_CONSOLE=true
# 是否sourcemap
VITE_SOURCEMAP=false
# 打包路径
VITE_BASE_PATH=/
# 输出路径
VITE_OUT_DIR=sfms3.0
# 自定义接口路径
VITE_INTERFACE_URL='http://192.168.0.108:12080/magic/web/index.html'
# 积木报表请求路径
VITE_JMREPORT_BASE_URL='http://192.168.0.108:12080'
# # 自定义接口路径
# VITE_INTERFACE_URL='http://dev.ccwin-in.com:25310/magic/web/index.html'
# # 积木报表请求路径
# VITE_JMREPORT_BASE_URL='http://dev.ccwin-in.com:25310'

1
.gitignore

@ -1,4 +1,5 @@
node_modules
.env.development
.DS_Store
dist
dist-ssr

7
README.md

@ -44,3 +44,10 @@ tableForm:{
isMainValue: false // 拼接条件必须要 false 同时不能与 isMainValue: true 同用
}]
},
// 主子合并隐藏子
hiddenInMain:true
// 主子排序 不配置默认999,不要设置0(留给左侧固定列使用)
sortTableDefault:
// 查询条件排序
sortSearchDefault:

10
build/vite/index.ts

@ -2,7 +2,7 @@ import { resolve } from 'path'
import Vue from '@vitejs/plugin-vue'
import VueJsx from '@vitejs/plugin-vue-jsx'
import progress from 'vite-plugin-progress'
import EslintPlugin from 'vite-plugin-eslint'
// import EslintPlugin from 'vite-plugin-eslint'
import PurgeIcons from 'vite-plugin-purge-icons'
import { ViteEjsPlugin } from 'vite-plugin-ejs'
// @ts-ignore
@ -73,10 +73,10 @@ export function createVitePlugins() {
resolvers: [ElementPlusResolver()],
exclude: [/[\\/]node_modules[\\/]/]
}),
EslintPlugin({
cache: false,
include: ['src/**/*.vue', 'src/**/*.ts', 'src/**/*.tsx'] // 检查的文件
}),
// EslintPlugin({
// cache: false,
// include: ['src/**/*.vue', 'src/**/*.ts', 'src/**/*.tsx'] // 检查的文件
// }),
VueI18nPlugin({
runtimeOnly: true,
compositionOnly: true,

4
index.html

@ -8,11 +8,11 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta
name="keywords"
content="闻荫管理系统 基于 vue3 + CompositionAPI + typescript + vite3 + element plus 的后台开源免费管理系统!"
content="SFMS管理系统 基于 vue3 + CompositionAPI + typescript + vite3 + element plus 的后台开源免费管理系统!"
/>
<meta
name="description"
content="闻荫管理系统 基于 vue3 + CompositionAPI + typescript + vite3 + element plus 的后台开源免费管理系统!"
content="SFMS管理系统 基于 vue3 + CompositionAPI + typescript + vite3 + element plus 的后台开源免费管理系统!"
/>
<title>%VITE_APP_TITLE%</title>
</head>

1
package.json

@ -6,6 +6,7 @@
"private": false,
"scripts": {
"dev": "vite",
"wyf": "vite --mode wyf",
"test": "vite build --mode test",
"hella8": "vite build --mode hella8",
"hella9": "vite build --mode hella9",

53
src/api/mes/holiday/index.ts

@ -0,0 +1,53 @@
import request from '@/config/axios'
export interface HolidayVO {
id: number
status: string
remark: string
holidayYear: string
holidayType: string
keyDate: string
holidayName: string
holidayDate: Date
}
// 查询节假日设置列表
export const getHolidayPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/mes/holiday/senior', data })
} else {
return await request.get({ url: `/mes/holiday/page`, params })
}
}
// 查询节假日设置详情
export const getHoliday = async (id: number) => {
return await request.get({ url: `/mes/holiday/get?id=` + id })
}
// 新增节假日设置
export const createHoliday = async (data: HolidayVO) => {
return await request.post({ url: `/mes/holiday/create`, data })
}
// 修改节假日设置
export const updateHoliday = async (data: HolidayVO) => {
return await request.put({ url: `/mes/holiday/update`, data })
}
// 删除节假日设置
export const deleteHoliday = async (id: number) => {
return await request.delete({ url: `/mes/holiday/delete?id=` + id })
}
// 导出节假日设置 Excel
export const exportHoliday = async (params) => {
return await request.download({ url: `/mes/holiday/export-excel`, params })
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/mes/holiday/get-import-template' })
}

4
src/api/mes/orderDay/index.ts

@ -98,8 +98,8 @@ export const getPlanDevices = async (params) => {
}
///发布计划
export const publishPlan = async (params) => {
return await request.post({ url: `/mes/orderday/publishPlan`,params })
export const publishPlan = async (data: OrderDayVO) => {
return await request.post({ url: `/mes/orderday/publishPlan`,data })
}
//终止计划
export const stopPlan = async (params) => {

57
src/api/mes/orderDayConfig/index.ts

@ -0,0 +1,57 @@
import request from '@/config/axios'
export interface OrderDayQueryParamVo {
planNoDay:String
productCode:String
workroomCode:String
lineCode:String
processrouteCode:String
batchCode:String
processCode:String
}
// 查询生产配置工艺路线
export const getConfigProcessRoute = async (params) => {
return await request.get({ url: `/mes/orderDayRoute/getByOrder`, params })
}
// 查询已经配置的工序
export const getConfigProcessRouteNode = async (params) => {
return await request.get({ url: `/mes/orderDayRoutesub/getByOrder`, params })
}
// 查询生产配置工序BOM
export const getOrderDayBomByOrder = async (params) => {
return await request.get({ url: `/mes/orderDayBom/getByOrder`, params })
}
// 查询已经配置工序工位
export const getConfigProcessWorkstation = async (params) => {
return await request.get({ url: `/mes/orderDayWorkstation/getByOrder`, params })
}
// 查询已经配置工序人员
export const getConfigProcessWorker = async (params) => {
return await request.get({ url: `/mes/orderDayWorker/getByOrder`, params })
}
// 查询已经的工序工位设备
export const getConfigProcessEquipment = async (params) => {
return await request.get({ url: `/mes/orderDayequipment/getByOrder`, params })
}
/*批量保存工序人员配置*/
export const saveWorker = async (data: any) => {
return await request.post({ url: `/mes/orderDayWorker/batchCreate`, data })
}
// 查询设备基本信息列表
export const getDeviceInfoPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/mes/device-info/senior', data })
} else {
return await request.get({ url: `/mes/device-info/page`, params })
}
}
/*批量保存工序模具配置*/
export const saveEquipment = async (data: any) => {
return await request.post({ url: `/mes/orderDayequipment/batchCreate`, data })
}

158
src/api/mes/process/index.ts

@ -0,0 +1,158 @@
import request from '@/config/axios'
export interface ProcessVO {
code: string
name: string
description: string
type: string
workshopCode: string
productionLineCode: string
available: number
activeTime: Date
expireTime: Date
remark: string
}
export const goalParams = {
processCode:null
}
// 查询工序列表
export const getProcessPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return request.post({ url: '/mes/process/senior', data })
} else {
return await request.get({ url: `/mes/process/page`, params })
}
}
// 查询工序详情
export const getProcess = async (id: number) => {
return await request.get({ url: `/mes/process/get?id=` + id })
}
// 新增工序
export const createProcess: (data: ProcessVO) => Promise<any> = async (data: ProcessVO) => {
return await request.post({ url: `/mes/process/create`, data })
}
// 修改工序
export const updateProcess = async (data: ProcessVO) => {
return await request.put({ url: `/mes/process/update`, data })
}
// 删除工序
export const deleteProcess: (id: number) => Promise<any> = async (id: number) => {
return await request.delete({ url: `/mes/process/delete?id=` + id })
}
// 导出工序 Excel
export const exportProcess = async (params) => {
if (params.isSearch) {
const data = {...params}
return await request.downloadPost({ url: `/mes/process/export-excel-senior`, data })
} else {
return await request.download({ url: `/mes/process/export-excel`, params })
}
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/mes/process/get-import-template' })
}
// 查询模具基本信息列表
export const getPatternPage = async (params) => {
params.processCode = goalParams.processCode
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return request.post({ url: '/mes/mes-process-pattern/senior', data })
} else {
return await request.get({ url: `/mes/mes-process-pattern/pagePatternByProcessCode`, params })
}
}
//创建工序模具关联
export const createPatternRelation = async (Codes:string[]) => {
const data = {
processCode : goalParams.processCode,
listPatternCode : Codes
}
return await request.post({ url: `/mes/mes-process-pattern/createRelation`, data })
}
//删除工序模具关联
export const deletePatternRelation = async (Codes:string[]) => {
const data = {
processCode : goalParams.processCode,
listPatternCode : Codes
}
return await request.post({ url: `/mes/mes-process-pattern/deleteRelation`, data })
}
// 查询产线列表
export const getProductionlinePage = async (params) => {
params.processCode = goalParams.processCode
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return request.post({ url: '/mes/mes-process-productionline/senior', data })
} else {
return await request.get({ url: `/mes/mes-process-productionline/pageByProcessCode`, params })
}
}
//创建工序产线关联
export const createProductionlineRelation = async (Codes:string[]) => {
const data = {
processCode : goalParams.processCode,
listProductionlineCode : Codes
}
return await request.post({ url: `/mes/mes-process-productionline/createRelation`, data })
}
//删除工序产线关联
export const deleteProductionlineRelation = async (Codes:string[]) => {
const data = {
processCode : goalParams.processCode,
listProductionlineCode : Codes
}
return await request.post({ url: `/mes/mes-process-productionline/deleteRelation`, data })
}
// 查询物料列表
export const getItembasicPage = async (params) => {
params.processCode = goalParams.processCode
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return request.post({ url: '/mes/mes-process-itembasic/senior', data })
} else {
return await request.get({ url: `/mes/mes-process-itembasic/pageByProcessCode`, params })
}
}
//创建工序物料关联
export const createItembasicRelation = async (Codes:string[]) => {
const data = {
processCode : goalParams.processCode,
listItembasicCode : Codes
}
return await request.post({ url: `/mes/mes-process-itembasic/createRelation`, data })
}
//删除工序物料关联
export const deleteItembasicRelation = async (Codes:string[]) => {
const data = {
processCode : goalParams.processCode,
listItembasicCode : Codes
}
return await request.post({ url: `/mes/mes-process-itembasic/deleteRelation`, data })
}

46
src/api/mes/processroute/index.ts

@ -30,6 +30,11 @@ export const getProcessroutePage = async (params) => {
export const getProcessroute = async (id: number) => {
return await request.get({ url: `/mes/processroute/get?id=` + id })
}
// 查询工艺路线定义的工序列表
export const getProcessrouteNodeList = async (code:any) => {
return await request.get({ url: `/mes/processrouteNodeDetail/getRouteNodes?code=`+code })
}
// 新增工艺路线定义
export const createProcessroute = async (data: ProcessrouteVO) => {
@ -61,38 +66,27 @@ export const importTemplate = () => {
}
// 获取工序工序列表-
export const getProcessList =async (params) => {
return await request.get({ url: `/wms/process/page`, params })
return await request.get({ url: `/mes/process/page`, params })
}
// 获取工序工序信息-
export const getProcesInfo = async(code:String) => {
return await request.get({ url: `/wms/process/getByCode?code=`,code })
return await request.get({ url: `/mes/process/getByCode?code=`+code })
}
// 获取产品信息列表-
export const getProductInfo =async (code:String) => {
return await request.get({ url: `/wms/itembasic/getProduct?code=`+code})
}
// 获取设备列表-参数为工序编码
export const getDeviceList =async (code:String) => {
//return request.get({ url: `/wms/itembasic/getProduct?code=`+code})
return request.get({ url: `/wms/itembasic/getProduct?code=`+code})
return {code:0,data:[{name:"冲压设备1",code:"CY0001"},{name:"冲压设备2",code:"CY0002"}]}
}
// 获取工作人员信息--参数为工序编码
export const getWorkerList =async (code:String) => {
// return request.get({ url: `/wms/itembasic/getProduct?code=`+code})
return {code:0,data:[{name:"张三",code:"冲压1班"},{name:"李四",code:"冲压1班"}]}
}
// 获取工位信息
export const getWorkStation =async (code:String) => {
//return request.get({ url: `/wms/itembasic/getProduct?code=`+code})
return {code:0,data:{name:"冲压工位",code:"CYW0001"}}
}
// 获取车间信息列表-
// export const getWorkInfoList = () => {
// return request.get({ url: '/wms/workshop?code=',code })
// }
// 获取产品信息列表-
// export const getProductInfo = (code:String) => {
// return request.get({ url: '/wms/itembasic/getProduct?code=',code })
// }
// 查询模具基本信息列表
export const getPatternPage = async (code:String) => {
return await request.get({ url: `/mes/mes-process-pattern/pagePatternByProcessCode?pageSize=25&processCode=`+code })
}
// 查询物料列表
export const getItembasicPage = async (code:String) => {
return await request.get({ url: `/mes/mes-process-itembasic/pageByProcessCode?pageSize=25&processCode=`+code})
}
export const getWorkstationPage = async (code:String) => {
return await request.get({ url: `/mes/workstation/page?pageSize=25&processCode=`+code})
}

59
src/api/mes/productBackline/index.ts

@ -0,0 +1,59 @@
import request from '@/config/axios'
export interface ProductBacklineVO {
offlineCode: string
productCode: string
workBillno: string
processCode: string
operCode: string
backlineBillno: string
planCode: string
deleteTime: Date
id: number
status: string
remark: string
deleter: string
siteId: number
workstationCode: string
}
// 查询产品返线登记列表
export const getProductBacklinePage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/mes/product-backline/senior', data })
} else {
return await request.get({ url: `/mes/product-backline/page`, params })
}
}
// 查询产品返线登记详情
export const getProductBackline = async (id: number) => {
return await request.get({ url: `/mes/product-backline/get?id=` + id })
}
// 新增产品返线登记
export const createProductBackline = async (data: ProductBacklineVO) => {
return await request.post({ url: `/mes/product-backline/create`, data })
}
// 修改产品返线登记
export const updateProductBackline = async (data: ProductBacklineVO) => {
return await request.put({ url: `/mes/product-backline/update`, data })
}
// 删除产品返线登记
export const deleteProductBackline = async (id: number) => {
return await request.delete({ url: `/mes/product-backline/delete?id=` + id })
}
// 导出产品返线登记 Excel
export const exportProductBackline = async (params) => {
return await request.download({ url: `/mes/product-backline/export-excel`, params })
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/mes/product-backline/get-import-template' })
}

71
src/api/mes/productOffline/index.ts

@ -0,0 +1,71 @@
import request from '@/config/axios'
export interface ProductOfflineVO {
offlineCode: string
workBillno: string
planCode: string
productCode: string
offlineReson: string
productDestination: string
deleteTime: Date
id: number
status: string
concurrencyStamp: number
remark: string
deleter: string
siteId: number
processCode: string
stationCode: string
checkPersonCode: string
}
// 查询产品离线登记记录列表
export const getProductOfflinePage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/mes/product-offline/senior', data })
} else {
return await request.get({ url: `/mes/product-offline/page`, params })
}
}
// 查询产品离线登记记录详情
export const getProductOffline = async (id: number) => {
return await request.get({ url: `/mes/product-offline/get?id=` + id })
}
// 新增产品离线登记记录
export const createProductOffline = async (data: ProductOfflineVO) => {
return await request.post({ url: `/mes/product-offline/create`, data })
}
// 修改产品离线登记记录
export const updateProductOffline = async (data: ProductOfflineVO) => {
return await request.put({ url: `/mes/product-offline/update`, data })
}
// 删除产品离线登记记录
export const deleteProductOffline = async (id: number) => {
return await request.delete({ url: `/mes/product-offline/delete?id=` + id })
}
// 导出产品离线登记记录 Excel
export const exportProductOffline = async (params) => {
return await request.download({ url: `/mes/product-offline/export-excel`, params })
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/mes/product-offline/get-import-template' })
}
export const getworkSchedulingPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/mes/work-scheduling/senior', data })
} else {
return await request.get({ url: `/mes/work-scheduling/page`, params })
}
}

46
src/api/mes/workScheduling/index.ts

@ -0,0 +1,46 @@
import request from '@/config/axios'
export interface WorkSchedulingVO {
flagDo: string
}
// 查询生产任务排产列表
export const getWorkSchedulingPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/mes/work-scheduling/senior', data })
} else {
return await request.get({ url: `/mes/work-scheduling/page`, params })
}
}
// 查询生产任务排产详情
export const getWorkScheduling = async (id: number) => {
return await request.get({ url: `/mes/work-scheduling/get?id=` + id })
}
// 新增生产任务排产
export const createWorkScheduling = async (data: WorkSchedulingVO) => {
return await request.post({ url: `/mes/work-scheduling/create`, data })
}
// 修改生产任务排产
export const updateWorkScheduling = async (data: WorkSchedulingVO) => {
return await request.put({ url: `/mes/work-scheduling/update`, data })
}
// 删除生产任务排产
export const deleteWorkScheduling = async (id: number) => {
return await request.delete({ url: `/mes/work-scheduling/delete?id=` + id })
}
// 导出生产任务排产 Excel
export const exportWorkScheduling = async (params) => {
return await request.download({ url: `/mes/work-scheduling/export-excel`, params })
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/mes/work-scheduling/get-import-template' })
}

62
src/api/mes/workSchedulingDetail/index.ts

@ -0,0 +1,62 @@
import request from '@/config/axios'
export interface WorkSchedulingDetailVO {
schedulingCode: string
schedulingId: number
taskSort: number
nodeCode: string
workstationValidate: string
deviceValidate: string
personValidate: string
reportPerson: string
receivePerson: string
planCount: number
reportCount: number
reportType: number
qualifiedCount: number
unqualifiedCount: number
receiveWorkstation: string
receiveDevice: string
materialValidate: string
}
// 查询工单任务明细列表
export const getWorkSchedulingDetailPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/mes/work-scheduling-detail/senior', data })
} else {
return await request.get({ url: `/mes/work-scheduling-detail/page`, params })
}
}
// 查询工单任务明细详情
export const getWorkSchedulingDetail = async (id: number) => {
return await request.get({ url: `/mes/work-scheduling-detail/get?id=` + id })
}
// 新增工单任务明细
export const createWorkSchedulingDetail = async (data: WorkSchedulingDetailVO) => {
return await request.post({ url: `/mes/work-scheduling-detail/create`, data })
}
// 修改工单任务明细
export const updateWorkSchedulingDetail = async (data: WorkSchedulingDetailVO) => {
return await request.put({ url: `/mes/work-scheduling-detail/update`, data })
}
// 删除工单任务明细
export const deleteWorkSchedulingDetail = async (id: number) => {
return await request.delete({ url: `/mes/work-scheduling-detail/delete?id=` + id })
}
// 导出工单任务明细 Excel
export const exportWorkSchedulingDetail = async (params) => {
return await request.download({ url: `/mes/work-scheduling-detail/export-excel`, params })
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/mes/work-scheduling-detail/get-import-template' })
}

81
src/api/mes/workcalendar/index.ts

@ -0,0 +1,81 @@
import request from '@/config/axios'
// 查询节假日
export const getDismantlingDetailPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/mes/workCalendar/senior', data })
} else {
return await request.get({ url: `/mes/workCalendar/page`, params })
}
}
//班组排班 信息
export interface SchedulingcalendarCreateReqVO{
keyDate:String,
//班组编码
teamCode:String,
//班组名称
teamName:String,
//班组类别"
teamType:String,
//班次名称"
shiftName:String,
//班次编码
shiftCode:String,
//上班时间
startTime:String,
//下班时间"
endTime:String,
//工作日期
workDate:String,
//倒班规则
shiftRule:String,
//倒班类型
shiftRate:String,
sort:number
}
//
// 查询班组列表
export const getTeamList = async (params) => {
return await request.get({ url: `/wms/team/page`, params })
}
// 保存排班信息
export const saveWorkPlan = async (data:SchedulingcalendarCreateReqVO ) => {
return await request.post({ url: `/mes/schedulingcalendar/create`, data })
}
// 删除班组排班信息
export const deleteWorkPlan = async (data) => {
return await request.post({ url: `/mes/schedulingcalendar/deleteTeam`, data})
}
//批量保存排班信息
export const createBatch = async (data:any) => {
return await request.post({ url: `/mes/schedulingcalendar/createBatch`, data })
}
//批量对象方式保存排班信息--保留
export const createObj= async (data:any) => {
return await request.post({ url: `/mes/schedulingcalendar/createObj`, data })
}
// 查询排班信息 code startTime:开始时间" endTime:结束时间")
export const getWorkPlan = async (params ) => {
return await request.get({ url: `/mes/schedulingcalendar/getList`,params })
}
// 查询班次信息
export const getShiftInfos = async (code:any) => {
return await request.get({ url: `/mes/schedulingcalendar/shift?code=`+code})
}
//查询节假日信息
export const getHolidays = async (year:any) => {
return await request.get({ url: `/mes/holiday/listByYear?year=`+year})
}
// 导出排班信息
export const exportWorkPlan = async (params) => {
return await request.download({ url: `/mes/schedulingcalendar/export-excel`, params })
}

95
src/api/mes/workstation/index.ts

@ -20,11 +20,6 @@ export const getWorkstationPage = async (params) => {
}
}
// 查询工位详情
export const getWorkstation = async (id: number) => {
return await request.get({ url: `/mes/workstation/get?id=` + id })
}
// 新增工位
export const createWorkstation = async (data: WorkstationVO) => {
return await request.post({ url: `/mes/workstation/create`, data })
@ -47,7 +42,7 @@ export const getEquipmentPage = async (params) => {
const data = {...params}
return await request.post({ url: '/mes/equipment/senior', data })
} else {
return await request.get({ url: `/mes/equipment/pageListByWorkstationCode`, params })
return await request.get({ url: `/mes/equipment/getEquipmentPage`, params })
}
}
// 查询选择设备列表
@ -58,11 +53,11 @@ export const checkEquipmentPageList = async (params) => {
const data = {...params}
return await request.post({ url: '/mes/equipment/senior', data })
} else {
return await request.get({ url: `/mes/equipment/pageCheckListByWorkstationCode`, params })
return await request.get({ url: `/mes/equipment/pageCheckList`, params })
}
}
// 添加设备关联
export const createEquipmentRelation = async (equipmentCodes:string[]) => {
export const createEquipment = async (equipmentCodes:string[]) => {
const data = {
workstationCode : goalParams.workstationCode,
equipmentCodes : equipmentCodes
@ -71,87 +66,95 @@ export const createEquipmentRelation = async (equipmentCodes:string[]) => {
}
// 删除设备关联
export const deleteEquipmentRelation = async (equipmentCodes:string[]) => {
debugger
export const deleteEquipment = async (equipmentCodes:string[]) => {
const data = {
workstationCode : goalParams.workstationCode,
equipmentCodes : equipmentCodes
}
return await request.post({ url: `/mes/equipment/deleteRelation`, data })
}
export const getProcessPage = async (params) => {
params.workstationCode = goalParams.workstationCode
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/mes/workstation-process/senior', data })
} else {
return await request.get({ url: `/mes/workstation-process/pageListByWorkstationCode`, params })
}
}
export const checkProcessPageList = async (params) => {
export const getOperstepsPage = async (params) => {
params.workstationCode = goalParams.workstationCode
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/mes/workstation-process/senior', data })
return await request.post({ url: '/mes/workstation-opersteps/senior', data })
} else {
return await request.get({ url: `/mes/workstation-process/pageCheckListByWorkstationCode`, params })
return await request.get({ url: `/mes/workstation-opersteps/getWorkstationOperstepsPage`, params })
}
}
// 添加工序关联
export const createProcessRelation = async (processCodes:string[]) => {
// 添加操作步骤关联
export const createOpersteps = async (codes:string[]) => {
const data = {
workstationCode : goalParams.workstationCode,
processCodes : processCodes
operstepsCodes : codes
}
return await request.post({ url: `/mes/workstation-process/createRelation`, data })
return await request.post({ url: `/mes/workstation-opersteps/create`, data })
}
// 删除工序关联
export const deleteProcessRelation = async (processCodes:string[]) => {
// 删除操作步骤关联
export const deleteOpersteps = async (codes:string[]) => {
const data = {
workstationCode : goalParams.workstationCode,
processCodes : processCodes
operstepsCodes : codes
}
return await request.post({ url: `/mes/workstation-process/deleteRelation`, data })
return await request.post({ url: `/mes/workstation-opersteps/delete`, data })
}
export const getOperstepsPage = async (params) => {
export const getAbilityPage = async (params) => {
params.workstationCode = goalParams.workstationCode
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/strategy/workstation-opersteps/senior', data })
return await request.post({ url: '/mes/workstation-ability/senior', data })
} else {
return await request.get({ url: `/strategy/workstation-opersteps/pageListByWorkstationCode`, params })
return await request.get({ url: `/mes/workstation-ability/getWorkstationAbilityPage`, params })
}
}
export const checkOperstepsPageList = async (params) => {
// 添加能力关联
export const createAbility = async (codes:string[]) => {
const data = {
workstationCode : goalParams.workstationCode,
abilityCodes : codes
}
return await request.post({ url: `/mes/workstation-ability/create`, data })
}
// 删除能力关联
export const deleteAbility = async (codes:string[]) => {
const data = {
workstationCode : goalParams.workstationCode,
abilityCodes : codes
}
return await request.post({ url: `/mes/workstation-ability/delete`, data })
}
// 查询工位岗位关联
export const getPostPage = async (params) => {
params.workstationCode = goalParams.workstationCode
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/strategy/workstation-opersteps/senior', data })
return await request.post({ url: '/mes/workstation-post/senior', data })
} else {
return await request.get({ url: `/strategy/workstation-opersteps/pageCheckListByWorkstationCode`, params })
return await request.get({ url: `/mes/workstation-post/getWorkstationPostPage`, params })
}
}
// 添加操作步骤关联
export const createOperstepsRelation = async (processCodes:string[]) => {
// 添加能力关联
export const createAPost = async (codes:string[]) => {
const data = {
workstationCode : goalParams.workstationCode,
processCodes : processCodes
postCodes : codes
}
return await request.post({ url: `/strategy/workstation-opersteps/createRelation`, data })
return await request.post({ url: `/mes/workstation-post/create`, data })
}
// 删除操作步骤关联
export const deleteOperstepsRelation = async (processCodes:string[]) => {
// 删除能力关联
export const deletePost = async (codes:string[]) => {
const data = {
workstationCode : goalParams.workstationCode,
processCodes : processCodes
postCodes : codes
}
return await request.post({ url: `/strategy/workstation-opersteps/deleteRelation`, data })
return await request.post({ url: `/mes/workstation-post/delete`, data })
}

8
src/api/qms/aql/index.ts

@ -105,3 +105,11 @@ export const importTemplate = () => {
export const getSamplingScheme = async () => {
return await request.get({ url: `/qms/sampling-scheme/get-available-list`})
}
// 启用
export const enableAql = async (id: number) => {
return await request.enable({ url: `/qms/aql/enable?id=` + id })
}
// 禁用
export const disableAql = async (id: number) => {
return await request.disable({ url: `/qms/aql/disable?id=` + id })
}

9
src/api/qms/dynamicRule/index.ts

@ -51,3 +51,12 @@ export const exportDynamicRule = async (params) => {
export const importTemplate = () => {
return request.download({ url: '/qms/dynamic-rule/get-import-template' })
}
// 启用
export const enableDynamicRule = async (id: number) => {
return await request.enable({ url: `/qms/dynamic-rule/enable?id=` + id })
}
// 禁用
export const disableDynamicRule = async (id: number) => {
return await request.disable({ url: `/qms/dynamic-rule/disable?id=` + id })
}

13
src/api/qms/inspectionJob/InspectionJobPackage/InspectionJobPackage.ts

@ -0,0 +1,13 @@
import request from '@/config/axios'
export interface InspectionRequestPackageVO {
number: string
packageCode: string
packageSpecificationCode: string
amount: string
measuringUnit: string
}
//查询包装列表
export const getInspectionJobPackageList = async (id: number) => {
return await request.get({ url: `/qms/inspection-job-package/list?masterId=` + id })
}

5
src/api/qms/inspectionJob/inspectionJobMain/index.ts

@ -55,8 +55,5 @@ export const exportInspectionJobMain = async (params) => {
export const importTemplate = () => {
return request.download({ url: '/qms/inspection-job-main/get-import-template' })
}
//查询包装列表
export const getInspectionJobPackageList = async (id: number) => {
  return await request.get({ url: `/qms/inspection-job-package/list?masterId=` + id })
}

8
src/api/qms/inspectionMethod/index.ts

@ -51,3 +51,11 @@ export const exportInspectionMethod = async (params) => {
export const importTemplate = () => {
return request.download({ url: '/qms/inspection-method/get-import-template' })
}
// 启用
export const enableInspectionMethod = async (id: number) => {
return await request.enable({ url: `/qms/inspection-method/enable?id=` + id })
}
// 禁用
export const disableInspectionMethod = async (id: number) => {
return await request.disable({ url: `/qms/inspection-method/disable?id=` + id })
}

13
src/api/qms/inspectionRecord/InspectionRecordPackage/InspectionRecordPackage.ts

@ -0,0 +1,13 @@
import request from '@/config/axios'
export interface InspectionRequestPackageVO {
number: string
packageCode: string
packageSpecificationCode: string
amount: string
measuringUnit: string
}
//查询包装列表
export const getInspectionRecordPackageList = async (id: number) => {
return await request.get({ url: `/qms/inspection-record-package/list?masterId=` + id })
}

4
src/api/qms/inspectionRecord/inspectionRecordMain/index.ts

@ -67,7 +67,3 @@ export const importTemplate = () => {
export const publishInspectionRecordMain = async (id) => {
return await request.put({ url: `/qms/inspection-record-main/publish?id=`+id })
}
//查询包装列表
export const getInspectionRecordPackageList = async (id: number) => {
return await request.get({ url: `/qms/inspection-record-package/list?masterId=` + id })
}

27
src/api/qms/inspectionRequest/InspectionRequestPackage.ts

@ -0,0 +1,27 @@
import request from '@/config/axios'
export interface InspectionRequestPackageVO {
number: string
packageCode: string
packageSpecificationCode: string
amount: string
measuringUnit: string
}
//查询包装列表
export const getInspectionRequestPackageList = async (id: number) => {
return await request.get({ url: `/qms/inspection-request-package/list?masterId=` + id })
}
// 新增检验申请
export const createInspectionRequestPackage = async (data: InspectionRequestPackageVO) => {
return await request.post({ url: `/qms/inspection-request-package/create`, data })
}
// 修改检验申请
export const updateInspectionRequestPackage = async (data: InspectionRequestPackageVO) => {
return await request.put({ url: `/qms/inspection-request-package/update`, data })
}
// 删除检验申请
export const deleteInspectionRequestPackage = async (id: number) => {
return await request.delete({ url: `/qms/inspection-request-package/delete?id=` + id })
}

15
src/api/qms/inspectionRequest/index.ts

@ -2,25 +2,19 @@ import request from '@/config/axios'
export interface InspectionMainVO {
number: string
applicationDate: localdate
applicationDate: Date
applicationTime: Date
requestStartTime: Date
requestEndTime: Date
finishTime: Date
supplierCode: string
materialCode: string
itemCode: string
batch: string
requestInspectionNum: number
referenceOrderCode: string
referenceOrderRow: number
referenceCertificateCode: string
referenceCertificateRow: number
inspectionSchemeCode: string
inspectionStageCode: string
applicationPackageCode: string
inspectionLevel: string
aqlValue: number
available: string
}
// 查询检验申请列表
@ -92,8 +86,3 @@ export const refusedInspectRequestMain = async (id) => {
export const handleInspectRequestMain = async (id) => {
return await request.put({ url: `/qms/inspection-request-main/handle?id=` + id })
}
//查询检验申请列表
export const getInspectionRequestPackageList = async (id: number) => {
return await request.get({ url: `/qms/inspection-request-package/list?masterId=` + id })
}

9
src/api/qms/inspectionScheme/index.ts

@ -21,3 +21,12 @@ export const InspectionSchemePage = async (params) => {
return await request.get({ url: `/qms/inspection-scheme/page`, params })
}
}
// 启用
export const enableInspectionScheme = async (id: number) => {
return await request.enable({ url: `/qms/inspection-scheme/enable?id=` + id })
}
// 禁用
export const disableInspectionScheme = async (id: number) => {
return await request.disable({ url: `/qms/inspection-scheme/disable?id=` + id })
}

11
src/api/qms/inspectionTemplate/index.ts

@ -2,7 +2,7 @@ import request from '@/config/axios'
// 查询采样过程列表
// 列表
export const getListByTempleteCode = async (code) => {
return await request.get({ url: `/qms/inspection-process/getListByTempleteCode?code=`+code})
}
@ -28,3 +28,12 @@ export const inspectionTemplatePage = async (params) => {
return await request.get({ url: `/qms/programme-template/page`, params })
}
}
// 启用
export const enableInspectionTemplate = async (id: number) => {
return await request.enable({ url: `/qms/programme-template/enable?id=` + id })
}
// 禁用
export const disableInspectionTemplate = async (id: number) => {
return await request.disable({ url: `/qms/programme-template/disable?id=` + id })
}

9
src/api/qms/sampleCode/index.ts

@ -59,3 +59,12 @@ export const importTemplate = () => {
export const getSamplingScheme = async () => {
return await request.get({ url: `/qms/sampling-scheme/get-available-list`})
}
// 启用
export const enableSampleCode = async (id: number) => {
return await request.enable({ url: `/qms/sample-code/enable?id=` + id })
}
// 禁用
export const disableSampleCode = async (id: number) => {
return await request.disable({ url: `/qms/sample-code/disable?id=` + id })
}

8
src/api/qms/samplingProcess/index.ts

@ -61,3 +61,11 @@ export const importTemplate = () => {
export const getSamplingScheme = async () => {
return await request.get({ url: `/qms/sampling-scheme/get-available-list`})
}
// 启用
export const enableSamplingProcess = async (id: number) => {
return await request.enable({ url: `/qms/sampling-process/enable?id=` + id })
}
// 禁用
export const disableSamplingProcess = async (id: number) => {
return await request.disable({ url: `/qms/sampling-process/disable?id=` + id })
}

9
src/api/qms/samplingScheme/index.ts

@ -47,3 +47,12 @@ export const exportSamplingScheme = async (params) => {
export const importTemplate = () => {
return request.download({ url: '/qms/sampling-scheme/get-import-template' })
}
// 启用
export const enableSamplingScheme = async (id: number) => {
return await request.enable({ url: `/qms/sampling-scheme/enable?id=` + id })
}
// 禁用
export const disableSamplingScheme = async (id: number) => {
return await request.disable({ url: `/qms/sampling-scheme/disable?id=` + id })
}

9
src/api/qms/selectedSet/index.ts

@ -53,3 +53,12 @@ export const exportSelectedSet = async (params) => {
export const importTemplate = () => {
return request.download({ url: '/qms/selected-set/get-import-template' })
}
// 启用
export const enableSelectedSet = async (id: number) => {
return await request.enable({ url: `/qms/selected-set/enable?id=` + id })
}
// 禁用
export const disableSelectedSet = async (id: number) => {
return await request.disable({ url: `/qms/selected-set/disable?id=` + id })
}

71
src/api/system/user/index.ts

@ -1,44 +1,57 @@
import request from '@/config/axios'
export interface UserVO {
id: number
username: string
nickname: string
deptId: number
postIds: string[]
email: string
mobile: string
sex: number
avatar: string
loginIp: string
status: number
remark: string
loginDate: Date
createTime: Date
id : number
username : string
nickname : string
deptId : number
postIds : string[]
email : string
mobile : string
sex : number
avatar : string
loginIp : string
status : number
remark : string
loginDate : Date
createTime : Date
userType : string
mailKey : string
}
// 查询用户管理列表
export const getUserPage = (params: PageParam) => {
return request.get({ url: '/system/user/page', params })
export const getUserPage = async (params) => {
console.log(params)
if (params.isSearch) {
delete params.isSearch
const data = { ...params }
return await request.post({ url: '/system/user/senior', data })
} else {
return await request.get({ url: '/system/user/page', params })
}
}
// 查询用户管理列表
// export const getUserPage = (params: PageParam) => {
// return request.get({ url: '/system/user/page', params })
// }
// 查询用户详情
export const getUser = (id: number) => {
export const getUser = (id : number) => {
return request.get({ url: '/system/user/get?id=' + id })
}
// 新增用户
export const createUser = (data: UserVO) => {
export const createUser = (data : UserVO) => {
return request.post({ url: '/system/user/create', data })
}
// 修改用户
export const updateUser = (data: UserVO) => {
export const updateUser = (data : UserVO) => {
return request.put({ url: '/system/user/update', data })
}
// 删除用户
export const deleteUser = (id: number) => {
export const deleteUser = (id : number) => {
return request.delete({ url: '/system/user/delete?id=' + id })
}
@ -53,7 +66,7 @@ export const importUserTemplate = () => {
}
// 用户密码重置
export const resetUserPwd = (id: number, password: string) => {
export const resetUserPwd = (id : number, password : string) => {
const data = {
id,
password
@ -62,7 +75,7 @@ export const resetUserPwd = (id: number, password: string) => {
}
// 用户状态修改
export const updateUserStatus = (id: number, status: number) => {
export const updateUserStatus = (id : number, status : number) => {
const data = {
id,
status
@ -71,6 +84,16 @@ export const updateUserStatus = (id: number, status: number) => {
}
// 获取用户精简信息列表
export const getSimpleUserList = (): Promise<UserVO[]> => {
export const getSimpleUserList = () : Promise<UserVO[]> => {
return request.get({ url: '/system/user/list-all-simple' })
}
// 忘记密码
export const forgetPassword = (data : UserVO) => {
return request.put({ url: '/system/user/forgetPassword', data })
}
// 忘记密码->修改密码
export const updatePassword = (data : UserVO) => {
return request.put({ url: '/system/user/updatePassword', data })
}

18
src/api/wms/demandforecastingMain/index.ts

@ -48,6 +48,24 @@ export const deleteDemandforecastingMain = async (id: number) => {
return await request.delete({ url: `/wms/demandforecasting-main/delete?id=` + id })
}
// 关闭要货预测
export const closePurchaseMain = async (id: number) => {
return await request.post({ url: `/wms/demandforecasting-main/close?id=` + id })
}
// 打开要货预测
export const openPurchaseMain = async (id: number) => {
return await request.post({ url: `/wms/demandforecasting-main/open?id=` + id })
}
// 发布要货预测
export const publishPurchaseMain = async (id: number) => {
return await request.post({ url: `/wms/demandforecasting-main/publish?id=` + id })
}
// 下架要货预测
export const witPurchaseMain = async (id: number) => {
return await request.post({ url: `/wms/demandforecasting-main/wit?id=` + id })
}
// 导出要货预测主 Excel
export const exportDemandforecastingMain = async (params) => {
if (params.isSearch) {

57
src/api/wms/interfaceInfo/index.ts

@ -0,0 +1,57 @@
import request from '@/config/axios'
export interface InterfaceInfoVO {
number:string
id: number
interfaceType: string
interfaceName: string
interfaceStatus: string
url: string
reqBody: string
respBody: string
errorMsg: string
remark: string
extraProperties: string
concurrencyStamp: number
}
// 查询接口调用信息列表
export const getInterfaceInfoPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/wms/interface-info/senior', data })
} else {
return await request.get({ url: `/wms/interface-info/page`, params })
}
}
// 查询接口调用信息详情
export const getInterfaceInfo = async (id: number) => {
return await request.get({ url: `/wms/interface-info/get?id=` + id })
}
// 新增接口调用信息
export const createInterfaceInfo = async (data: InterfaceInfoVO) => {
return await request.post({ url: `/wms/interface-info/create`, data })
}
// 修改接口调用信息
export const updateInterfaceInfo = async (data: InterfaceInfoVO) => {
return await request.put({ url: `/wms/interface-info/update`, data })
}
// 删除接口调用信息
export const deleteInterfaceInfo = async (id: number) => {
return await request.delete({ url: `/wms/interface-info/delete?id=` + id })
}
// 导出接口调用信息 Excel
export const exportInterfaceInfo = async (params) => {
return await request.download({ url: `/wms/interface-info/export-excel`, params })
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/wms/interface-info/get-import-template' })
}

5
src/api/wms/issueRequestMain/index.ts

@ -47,6 +47,11 @@ export const createIssueRequestMain = async (data: IssueRequestMainVO) => {
return await request.post({ url: `/wms/issue-request-main/create`, data })
}
// 新增PDA发料申请主
export const createIssueRequestMainSetInterval = async (data: IssueRequestMainVO) => {
return await request.post({ url: `/wms/issue-request-main/createPDA`, data })
}
// 修改发料申请主
export const updateIssueRequestMain = async (data: IssueRequestMainVO) => {
return await request.put({ url: `/wms/issue-request-main/update`, data })

16
src/api/wms/package/index.ts

@ -94,3 +94,19 @@ export const importTemplate = () => {
export const createPackageLabel = async (data: PackageVO) => {
return await request.post({ url: `/wms/package/createLabel`, data })
}
// 批量打印标签
export const batchPrintingLable = async (data: any) => {
return await request.post({ url: `/wms/package/batchPrintingLable`, data })
}
// 打印标签获取包装列表
export const getLabel = async (id: number) => {
return await request.get({ url: `/wms/package/getLabel?id=` + id })
}
// 根据库存余额获取包装信息进行打印标签
export const getBalanceToPackage = async (packingNumber: String) => {
return await request.get({ url: `/wms/package/getBalanceToPackage?packingNumber=` + packingNumber})
}

13
src/api/wms/productputawayJobDetail/index.ts

@ -26,6 +26,19 @@ export interface ProductputawayJobDetailVO {
// 查询制品上架任务子列表
export const getProductputawayJobDetailPage = async (params) => {
params.type = 'predict'
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/wms/productputaway-job-detail/senior', data })
} else {
return await request.get({ url: `/wms/productputaway-job-detail/page`, params })
}
}
// 查询制品上架任务子列表
export const getProductputawayJobDetailPageAssemble = async (params) => {
  params.type = 'assemble'
if (params.isSearch) {
delete params.isSearch
const data = {...params}

25
src/api/wms/productputawayJobMain/index.ts

@ -42,6 +42,7 @@ export interface ProductputawayJobMainVO {
// 查询制品上架任务主列表
export const getProductputawayJobMainPage = async (params) => {
params.type = 'predict'
if (params.isSearch) {
delete params.isSearch
const data = {...params}
@ -51,6 +52,17 @@ export const getProductputawayJobMainPage = async (params) => {
}
}
// 查询制品上架任务主列表
export const getProductputawayJobMainAssemblePage = async (params) => {
params.type = 'assemble'
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/wms/productputaway-job-main/senior', data })
} else {
return await request.get({ url: `/wms/productputaway-job-main/page`, params })
}
}
// 查询制品上架任务主详情
export const getProductputawayJobMain = async (id: number) => {
return await request.get({ url: `/wms/productputaway-job-main/get?id=` + id })
@ -73,6 +85,19 @@ export const deleteProductputawayJobMain = async (id: number) => {
// 导出制品上架任务主 Excel
export const exportProductputawayJobMain = async (params) => {
params.type = 'predict'
if (params.isSearch) {
const data = {...params}
return await request.downloadPost({ url: `/wms/productputaway-job-main/export-excel-senior`, data })
} else {
return await request.download({ url: `/wms/productputaway-job-main/export-excel`, params })
}
}
// 导出制品上架任务主 Excel
export const exportProductputawayJobMainAssemble = async (params) => {
params.type = 'assemble'
if (params.isSearch) {
const data = {...params}
return await request.downloadPost({ url: `/wms/productputaway-job-main/export-excel-senior`, data })

12
src/api/wms/productputawayRecordDetail/index.ts

@ -36,6 +36,7 @@ export interface ProductputawayRecordDetailVO {
// 查询制品上架记录子列表
export const getProductputawayRecordDetailPage = async (params) => {
params.type = 'predict'
if (params.isSearch) {
delete params.isSearch
const data = {...params}
@ -45,6 +46,17 @@ export const getProductputawayRecordDetailPage = async (params) => {
}
}
// 查询制品上架记录子列表
export const getProductputawayRecordDetailPageAssemble = async (params) => {
  params.type = 'assemble'
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/wms/productputaway-record-detail/senior', data })
} else {
return await request.get({ url: `/wms/productputaway-record-detail/page`, params })
}
}
// 查询制品上架记录子详情
export const getProductputawayRecordDetail = async (id: number) => {
return await request.get({ url: `/wms/productputaway-record-detail/get?id=` + id })

26
src/api/wms/productputawayRecordMain/index.ts

@ -30,6 +30,19 @@ export interface ProductputawayRecordMainVO {
// 查询制品上架记录主列表
export const getProductputawayRecordMainPage = async (params) => {
params.type = 'predict'
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/wms/productputaway-record-main/senior', data })
} else {
return await request.get({ url: `/wms/productputaway-record-main/page`, params })
}
}
// 查询制品上架记录主列表
export const getProductputawayRecordMainAssemblePage = async (params) => {
params.type = 'assemble'
if (params.isSearch) {
delete params.isSearch
const data = {...params}
@ -61,6 +74,19 @@ export const deleteProductputawayRecordMain = async (id: number) => {
// 导出制品上架记录主 Excel
export const exportProductputawayRecordMain = async (params) => {
params.type = 'predict'
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/wms/productputaway-record-main/export-excel-senior', data })
} else {
return await request.download({ url: `/wms/productputaway-record-main/export-excel`, params })
}
}
// 导出制品上架记录主 Excel
export const exportProductputawayRecordMainAssemble = async (params) => {
params.type = 'assemble'
if (params.isSearch) {
delete params.isSearch
const data = {...params}

13
src/api/wms/productputawayRequestDetail/index.ts

@ -27,6 +27,19 @@ export interface ProductputawayRequestDetailVO {
// 查询制品上架申请子列表
export const getProductputawayRequestDetailPage = async (params) => {
params.type = 'predict'
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/wms/productputaway-request-detail/senior', data })
} else {
return await request.get({ url: `/wms/productputaway-request-detail/page`, params })
}
}
// 查询制品上架申请子列表
export const getProductputawayRequestDetailPageAssemble = async (params) => {
  params.type = 'assemble'
if (params.isSearch) {
delete params.isSearch
const data = {...params}

25
src/api/wms/productputawayRequestMain/index.ts

@ -28,6 +28,19 @@ export interface ProductputawayRequestMainVO {
// 查询制品上架申请主列表
export const getProductputawayRequestMainPage = async (params) => {
params.type = 'predict'
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/wms/productputaway-request-main/senior', data })
} else {
return await request.get({ url: `/wms/productputaway-request-main/page`, params })
}
}
// 查询制品上架申请主列表
export const getProductputawayRequestMainAssemblePage = async (params) => {
params.type = 'assemble'
if (params.isSearch) {
delete params.isSearch
const data = {...params}
@ -59,6 +72,18 @@ export const deleteProductputawayRequestMain = async (id: number) => {
// 导出制品上架申请主 Excel
export const exportProductputawayRequestMain = async (params) => {
params.type = 'predict'
if (params.isSearch) {
const data = {...params}
return await request.downloadPost({ url: `/wms/productputaway-request-main/export-excel-senior`, data })
} else {
return await request.download({ url: `/wms/productputaway-request-main/export-excel`, params })
}
}
// 导出制品上架申请主 Excel
export const exportProductputawayRequestMainAssemble = async (params) => {
params.type = 'assemble'
if (params.isSearch) {
const data = {...params}
return await request.downloadPost({ url: `/wms/productputaway-request-main/export-excel-senior`, data })

13
src/api/wms/productreceiptJobDetail/index.ts

@ -31,6 +31,19 @@ export interface ProductreceiptJobDetailVO {
// 查询制品收货任务子列表
export const getProductreceiptJobDetailPage = async (params) => {
params.type = 'predict'
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/wms/productreceipt-job-detail/senior', data })
} else {
return await request.get({ url: `/wms/productreceipt-job-detail/page`, params })
}
}
// 查询制品收货任务子列表
export const getProductreceiptJobDetailPageAssemble = async (params) => {
params.type = 'assemble'
if (params.isSearch) {
delete params.isSearch
const data = {...params}

13
src/api/wms/productreceiptRecordDetail/index.ts

@ -36,6 +36,19 @@ export interface ProductreceiptRecordDetailVO {
// 查询制品收货记录子列表
export const getProductreceiptRecordDetailPage = async (params) => {
params.type = 'predict'
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/wms/productreceipt-record-detail/senior', data })
} else {
return await request.get({ url: `/wms/productreceipt-record-detail/page`, params })
}
}
// 查询制品收货记录子列表
export const getProductreceiptRecordDetailPageAssemble = async (params) => {
params.type = 'assemble'
if (params.isSearch) {
delete params.isSearch
const data = {...params}

13
src/api/wms/productreceiptRequestDetail/index.ts

@ -32,6 +32,19 @@ export interface ProductreceiptRequestDetailVO {
// 查询制品收货申请子列表
export const getProductreceiptRequestDetailPage = async (params) => {
params.type = 'predict'
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/wms/productreceipt-request-detail/senior', data })
} else {
return await request.get({ url: `/wms/productreceipt-request-detail/page`, params })
}
}
// 查询制品收货申请子列表
export const getProductreceiptRequestDetailPageAssemble = async (params) => {
params.type = 'assemble'
if (params.isSearch) {
delete params.isSearch
const data = {...params}

11
src/api/wms/purchasereceiptJobDetail/index.ts

@ -44,6 +44,17 @@ export const getPurchasereceiptJobDetailPage = async (params) => {
}
}
// 查询备件收货任务子列表
export const getPurchasereceiptJobDetailPageSapre = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/wms/purchasereceipt-job-detail/seniorSpare', data })
} else {
return await request.get({ url: `/wms/purchasereceipt-job-detail/pageSpare`, params })
}
}
// 查询采购收货任务子详情
export const getPurchasereceiptJobDetail = async (id: number) => {
return await request.get({ url: `/wms/purchasereceipt-job-detail/get?id=` + id })

22
src/api/wms/purchasereceiptRecordDetail/index.ts

@ -61,6 +61,28 @@ export const getPurchasereceiptRecordDetailPage = async (params) => {
}
}
// 查询备件收货记录子列表
export const getPurchasereceiptRecordDetailPageSpare = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/wms/purchasereceipt-record-detail/seniorSpare', data })
} else {
return await request.get({ url: `/wms/purchasereceipt-record-detail/pageSpare`, params })
}
}
export const getPurchasereceiptRecordDetailPageSCP = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/wms/purchasereceipt-record-detail/seniorSCP', data })
} else {
return await request.get({ url: `/wms/purchasereceipt-record-detail/pageSCP`, params })
}
}
// 查询采购收货记录子列表
export const getPurchasereceiptRecordDetailPageBySupplierCode = async (params) => {
if (params.isSearch) {

11
src/api/wms/purchasereceiptRequestDetail/index.ts

@ -46,6 +46,17 @@ export const getPurchasereceiptRequestDetailPage = async (params) => {
}
}
// 查询备件收货申请子列表
export const getPurchasereceiptRequestDetailPageSpare = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/wms/purchasereceipt-request-detail/seniorSpare', data })
} else {
return await request.get({ url: `/wms/purchasereceipt-request-detail/pageSpare`, params })
}
}
// 查询采购收货申请子详情
export const getPurchasereceiptRequestDetail = async (id: number) => {
return await request.get({ url: `/wms/purchasereceipt-request-detail/get?id=` + id })

4
src/api/wms/purchasereceiptRequestMain/index.ts

@ -124,6 +124,6 @@ export const handlePurchasereceiptRequestMain = async (id) => {
}
// 生成标签
export const genLabel = async (id) => {
return await request.post({ url: `/wms/purchasereceipt-request-main/genLabel?id=` + id })
export const genLabel = async (data) => {
return await request.post({ url: `/wms/purchasereceipt-request-main/genLabel`, data })
}

9
src/api/wms/purchasereturnRecordDetail/index.ts

@ -48,6 +48,15 @@ export const getPurchasereturnRecordDetailPage = async (params) => {
return await request.get({ url: `/wms/purchasereturn-record-detail/page`, params })
}
}
export const getPurchasereturnRecordDetailPageSCP = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/wms/purchasereturn-record-detail/seniorSCP', data })
} else {
return await request.get({ url: `/wms/purchasereturn-record-detail/pageSCP`, params })
}
}
// 查询采购退货记录子详情
export const getPurchasereturnRecordDetail = async (id: number) => {

20
src/api/wms/supplierinvoiceRequestMain/index.ts

@ -68,11 +68,11 @@ export const cloSupplierinvoiceRequestMain = async (id: number) => {
export const subSupplierinvoiceRequestMain = async (id: number) => {
return await request.post({ url: `/wms/supplierinvoice-request-main/sub?id=` + id })
}
// 供应商--审批通过供应商发货申请主
// 采购--审批通过供应商发货申请主
export const appSupplierinvoiceRequestMain = async (id: number) => {
return await request.post({ url: `/wms/supplierinvoice-request-main/app?id=` + id })
}
// 供应商--驳回供应商发货申请主
// 采购--驳回供应商发货申请主
export const rejSupplierinvoiceRequestMain = async (id: number) => {
return await request.post({ url: `/wms/supplierinvoice-request-main/rej?id=` + id })
}
@ -95,6 +95,17 @@ export const financerejSupplierinvoiceRequestMain = async (id: number) => {
export const genRecordsSupplierinvoiceRequestMain = async (id) => {
return await request.post({ url: `/wms/supplierinvoice-request-main/genRecords?id=` + id })
}
// 打印单挑供应商发货记录
export const printSupplierRecord = async (asnBillNum:string) => {
return await request.post({ url: `/wms/supplierinvoice-request-main/querySupplierRecord?asnBillNum=`+asnBillNum })
}
// 打印单挑供应商发货记录
export const printSupplierRecordByMasterId = async (masterId:number) => {
return await request.post({ url: `/wms/supplierinvoice-request-main/querySupplierRecordByMasterId?masterId=`+masterId })
}
// 导出供应商发票申请主 Excel
export const exportSupplierinvoiceRequestMain = async (params) => {
if(params.isSearch){
@ -104,6 +115,11 @@ export const exportSupplierinvoiceRequestMain = async (params) => {
}
}
// 导出供应商发票申请明细 Excel
export const exportSupplierinvoiceRequestDetail = async (params) => {
return await request.download({ url: `/wms/supplierinvoice-request-main/export-excel-detail`, params })
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/wms/supplierinvoice-request-main/get-import-template' })

16
src/api/wms/team/index.ts

@ -9,6 +9,11 @@ export interface TeamVO {
expireTime: Date
remark: string
available: string
teamGroup: string
workshopCode: string
productionLineCode: string
teamMonitorCode: string
teamMonitorName: string
}
// 查询班组列表
@ -22,6 +27,17 @@ export const getTeamPage = async (params) => {
}
}
export const geTeamUserByCode = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return request.post({ url: '/wms/team/queryTeamUserByCode', data })
}
// else {
// return await request.get({ url: `/wms/team/queryTeamUserByCode`, params })
// }
}
// 查询班组详情
export const getTeam = async (id: number) => {
return await request.get({ url: `/wms/team/get?id=` + id })

25
src/api/wms/unplannedissueRecordDetail/index.ts

@ -33,8 +33,33 @@ export const getUnplannedissueRecordDetailPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
const dataTypeCondition = {
'column':'detailDataType',
'action':'==',
'value':'1'
}
data.filters.push(dataTypeCondition)
return await request.post({ url: '/wms/unplannedissue-record-detail/senior', data })
} else {
params.detailDataType='1'
return await request.get({ url: `/wms/unplannedissue-record-detail/page`, params })
}
}
// 查询备件领用出库记录子列表
export const getUnplannedissueRecordDetailPageSpare = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
const dataTypeCondition = {
'column':'detailDataType',
'action':'==',
'value':'2'
}
data.filters.push(dataTypeCondition)
return await request.post({ url: '/wms/unplannedissue-record-detail/senior', data })
} else {
params.detailDataType='2'
return await request.get({ url: `/wms/unplannedissue-record-detail/page`, params })
}
}

25
src/api/wms/unplannedissueRequestDetail/index.ts

@ -28,8 +28,33 @@ export const getUnplannedissueRequestDetailPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
const dataTypeCondition = {
'column':'detailDataType',
'action':'==',
'value':'1'
}
data.filters.push(dataTypeCondition)
return await request.post({ url: '/wms/unplannedissue-request-detail/senior', data })
} else {
params.detailDataType='1'
return await request.get({ url: `/wms/unplannedissue-request-detail/page`, params })
}
}
// 查询计划外出库申请子列表
export const getUnplannedissueRequestDetailPageSpare = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
const dataTypeCondition = {
'column':'detailDataType',
'action':'==',
'value':'2'
}
data.filters.push(dataTypeCondition)
return await request.post({ url: '/wms/unplannedissue-request-detail/senior', data })
} else {
params.detailDataType='2'
return await request.get({ url: `/wms/unplannedissue-request-detail/page`, params })
}
}

47
src/api/wms/unplannedissueRequestMain/index.ts

@ -40,26 +40,6 @@ export const getUnplannedissueRequestMainPage = async (params) => {
}
}
// 查询计划外出库申请主列表
export const getUnplannedissueRequestMainPageSpare = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
const dataTypeCondition = {
'column':'dataType',
'action':'==',
'value':'2'
}
data.filters.push(dataTypeCondition)
return await request.post({ url: '/wms/unplannedissue-request-main/senior', data })
} else {
params.dataType='2'
return await request.get({ url: `/wms/unplannedissue-request-main/page`, params })
}
}
// 查询计划外出库申请主详情
export const getUnplannedissueRequestMain = async (id: number) => {
return await request.get({ url: `/wms/unplannedissue-request-main/get?id=` + id })
@ -95,6 +75,8 @@ export const importTemplate = () => {
return request.download({ url: '/wms/unplannedissue-request-main/get-import-template' })
}
// 关闭-计划外出库申请
export const closeUnplannedissueRequestMain = async (id) => {
return await request.put({ url: `/wms/unplannedissue-request-main/close?id=` + id })
@ -124,3 +106,28 @@ export const agreeUnplannedissueRequestMain = async (id) => {
export const handleUnplannedissueRequestMain = async (id) => {
return await request.put({ url: `/wms/unplannedissue-request-main/handle?id=` + id })
}
// 查询备件领用主列表
export const getUnplannedissueRequestMainPageSpare = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
const dataTypeCondition = {
'column':'dataType',
'action':'==',
'value':'2'
}
data.filters.push(dataTypeCondition)
return await request.post({ url: '/wms/unplannedissue-request-main/senior', data })
} else {
params.dataType='2'
return await request.get({ url: `/wms/unplannedissue-request-main/page`, params })
}
}
// 备件领用下载用户导入模板
export const spareImportTemplate = () => {
return request.download({ url: '/wms/unplannedissue-request-main/get-import-template-spare' })
}

1
src/assets/imgs/logo_white.svg

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" fill="none" version="1.1" width="46" height="22" viewBox="0 0 46 22"><g><path d="M0,3.7313L0,18.275C0,20.3271,1.77939,21.9981,3.97019,22L41.8929,22C44.1612,22,46,20.176,46,17.9259L46,4.07407C46,1.82403,44.1612,0,41.8929,0L3.97385,0C1.78138,0,0,1.67812,0,3.7313ZM18.4989,18.4467C20.0716,18.4467,21.3439,17.2071,21.3439,15.6752L21.3374,15.6752L21.3374,3.55967L18.1269,3.55967L18.1269,15.3257L8.51539,15.3257L8.51539,3.55967L5.31803,3.55967L5.31803,15.6752C5.31803,17.2071,6.59045,18.4467,8.16302,18.4467L18.4989,18.4467ZM14.9297,3.55967L11.7258,3.55967L11.7258,12.1919L14.9297,12.1919L14.9297,3.55967ZM24.5477,18.4467L27.7517,18.4467L27.7517,3.55967L24.5477,3.55967L24.5477,18.4467ZM37.3568,18.4467L40.5606,18.4467L40.5606,6.33112C40.5606,4.79918,39.2882,3.55967,37.7156,3.55967L33.794,3.55967C32.2215,3.55967,30.949,4.79918,30.949,6.33112L30.949,18.4467L34.1595,18.4467L34.1595,6.68073L37.3568,6.68073L37.3568,18.4467Z" fill-rule="evenodd" fill="#FFFFFF" fill-opacity="1"/></g></svg>

After

Width:  |  Height:  |  Size: 1.0 KiB

15
src/components/Annex/src/Annex.vue

@ -3,8 +3,8 @@
<div class="annex">
<div class="title flex items-center">
<!-- <div class="title-txt">附件</div> -->
<UploadFile :isShowFile="false" :isShowTip="false" title="添加附件" :upData="upData"
@update:modelValue="handleAnnexSuccess" />
<UploadFile :isShowFile="false" :isShowTip="false" title="添加附件" :upData="upData" :limit="10"
@update:modelValue="handleAnnexSuccess" v-if="annexData.annexList.length<5"/>
</div>
<div class="list">
<div class="item flex items-start" v-for="(item, index) in annexData.annexList" :key="index">
@ -16,7 +16,8 @@
<div>{{ item.size }}KB</div>
<div>来自 {{ item.nickname }}</div>
</div>
<Icon icon="ep:delete" class="cursor-pointer" size="18" @click="deleteAnnex(item.id)" />
<Icon icon="ep:download" v-if="showDownload" class="cursor-pointer mr-2" size="18" @click="downFile(item)" />
<Icon icon="ep:delete" class="cursor-pointer" v-if="!hiddenDelete" size="18" @click="deleteAnnex(item.id)" />
</div>
<div class="time mt-6px ">{{ formatDate(item.createTime) }}</div>
</div>
@ -44,6 +45,14 @@ const props = defineProps({
type: Object,
required: true
},
showDownload: {
type: Boolean,
required: false
},
hiddenDelete: {
type: Boolean,
required: false
},
})
// emit
const emit = defineEmits(['handleAnnexSuccess', 'deleteAnnexSuccess'])

79
src/components/BasicForm/src/BasicForm.vue

@ -15,6 +15,7 @@
:schema="formSchema"
:is-col="true"
@opensearchTable="opensearchTable"
@clearSearchInput="clearSearchInput"
@onChange="onChange"
@onBlur="onBlur"
@onEnter="onEnter"
@ -272,12 +273,17 @@ const props = defineProps({
required: false,
default: false
},
// TableForm
// TableForm fieldTableColumn indexTableColumn
indexTableColumn :{
type: Number,
required: false,
default: 0
},
fieldTableColumn:{
type: String,
required: false,
default: ''
},
//searchTable
/***[{
formField:form中对应的field,
@ -292,6 +298,11 @@ const props = defineProps({
type:Function,
required: false,
default: null
},
sumFormDataByTableCustom:{
type:Function,
required: false,
default: null
}
})
@ -344,7 +355,9 @@ const opensearchTable = (
searchCondition,
multiple,
type,
row
row,
isConcatDetailSchemas=false,
searchDetailSchemas: any
) => {
const _searchCondition = {}
//
@ -371,14 +384,27 @@ const opensearchTable = (
message.warning(searchCondition[i].message?searchCondition[i].message:'前置条件未选择!')
return
}
}else if(searchCondition[i].isTableRowValue){
//table
_searchCondition[searchCondition[i].key] = row[searchCondition[i].value]
} else {
//
if (searchCondition[i].isSearch) {
filters.push({
action: searchCondition[i].action,
column: searchCondition[i].key,
value: searchCondition[i].value
})
if (searchCondition[i].isFormModel) {
//formModel
filters.push({
action: searchCondition[i].action,
column: searchCondition[i].key,
value: formRef.value.formModel[searchCondition[i].value]
})
}else{
filters.push({
action: searchCondition[i].action,
column: searchCondition[i].key,
value: searchCondition[i].value
})
}
} else {
_searchCondition[searchCondition[i].key] = searchCondition[i].value
}
@ -401,11 +427,16 @@ const opensearchTable = (
multiple,
type,
row,
_searchCondition
_searchCondition,
undefined,
isConcatDetailSchemas,
searchDetailSchemas
)
}
const clearSearchInput = (field)=>{
emit('clearSearchInput',field)
}
const sumFormDataByTable = () => {
if(props.sumFormDataField){
const sumObject = {}
@ -419,6 +450,9 @@ const sumFormDataByTable = () => {
}
watch(()=>props.tableData,() => {
sumFormDataByTable()
if(props?.sumFormDataByTableCustom&&unref(formRef)?.formModel&&props.tableData){
props?.sumFormDataByTableCustom(formRef,unref(formRef)?.formModel,props.tableData)
}
},{
deep:true
@ -438,9 +472,11 @@ const searchTableSuccess = (formField, searchField, val, type, row) => {
}
/** 打开弹窗 */
const open = async (type: string, row?: any, masterParmas?: any, titleName?: any) => {
const open = async (type: string, row?: any, masterParmas?: any, titleName?: any, alltitleName?: any) => {
dialogVisible.value = true
if (titleName) {
if(alltitleName){
dialogTitle.value = alltitleName
}else if (titleName) {
dialogTitle.value = t('action.' + titleName)
} else {
dialogTitle.value = t('action.' + type)
@ -475,7 +511,13 @@ const handleAddTable = () => {
tableAllSchemas.value.tableFormColumns.forEach(item => {
tableFormKeys[item.field] = item.default ? item.default : ''
})
inpuFocus(tableAllSchemas.value.tableFormColumns[props.indexTableColumn],tableFormKeys,0)
if(props.fieldTableColumn!=''){
console.log('handleAddTable',tableAllSchemas.value.tableFormColumns.find(item=>item.field==props.fieldTableColumn))
inpuFocus(tableAllSchemas.value.tableFormColumns.find(item=>item.field==props.fieldTableColumn),tableFormKeys,0)
}else{
inpuFocus(tableAllSchemas.value.tableFormColumns[props.indexTableColumn],tableFormKeys,0)
}
}else{
emit('handleAddTable')
}
@ -539,6 +581,7 @@ const submitForm = async () => {
const data = unref(formRef)?.formModel
emit('submitForm', formType.value, data)
} finally {
formLoading.value = false
}
} else {
//
@ -546,6 +589,7 @@ const submitForm = async () => {
const data = unref(formRef)?.formModel
emit('submitForm', formType.value, data)
} finally {
formLoading.value = false
}
}
} else {
@ -592,7 +636,8 @@ const emit = defineEmits([
'onEnter',
'inputNumberChange',
'formFormDateChange',
'footButtonClick'
'footButtonClick',
'clearSearchInput'
])
//
const formSelectChange = (field, val, row) => {
@ -653,7 +698,9 @@ const inpuFocus = (headerItem, row, index) => {
headerItem.tableForm.searchCondition,
headerItem.tableForm.multiple,
'tableForm',
row
row,
headerItem.tableForm?.isConcatDetailSchemas,
headerItem.tableForm?.searchDetailSchemas
)
}
/**
@ -678,8 +725,8 @@ const onBlur = (field, e) => {
* @param field 当前操作字段
* @param e
*/
const onEnter = (field, e) => {
emit('onEnter', field, e)
const onEnter = (field,value, e) => {
emit('onEnter', field,value, e)
}
//

8
src/components/Descriptions/src/Descriptions.vue

@ -15,8 +15,8 @@ const mobile = computed(() => appStore.getMobile)
const attrs = useAttrs()
const slots = useSlots()
const height = ref('200px')
const isShow = ref(false)
const height = ref('auto')
const isShow = ref(true)
const props = defineProps({
@ -155,9 +155,9 @@ const showAll = () =>{
</ElDescriptions>
</div>
</ElCollapseTransition>
<div class="flex align-center justify-center">
<!-- <div class="flex align-center justify-center">
<el-button type="primary" class="mt-20px" @click="showAll">{{!isShow?'展开':'收起'}}</el-button>
</div>
</div> -->
</div>
</template>

105
src/components/Detail/src/Detail.vue

@ -12,7 +12,8 @@
{{ titleValueRef }} <span class="ml-20px font-size-16px">{{ titleNameRef }}</span>
</div>
</template>
<ContentWrap v-if="!isBasic">
<Tabs ref="tabRef" :tabsList="tabsList" :current="current" @change="change" />
<ContentWrap v-if="!isBasic" v-show="tabsList[current].label=='主数据'">
<Descriptions
:data="detailData"
labelClassName="label-class-name"
@ -24,11 +25,9 @@
width="200px"
/>
</ContentWrap>
<Tabs ref="tabRef" :tabsList="tabsList" :current="current" @change="change" />
<div class="flex">
<!-- 详情 -->
<ContentWrap class="w-[100%]" v-show="tabsList[current].label!='附件'&&tabsList[current].label!='备注'&&tabsList[current].label!='变更记录'&&!annexTableData.some(item=>item.label==tabsList[current].label)"> <!-- 列表头部 -->
<ContentWrap class="w-[100%]" v-show="tabsList[current].label!=annexAlias.label&&tabsList[current].label!='备注'&&tabsList[current].label!='变更记录'&&tabsList[current].label!='主数据'&&!annexTableData.some(item=>item.label==tabsList[current].label)"> <!-- 列表头部 -->
<TableHead
v-if="!isBasic"
:HeadButttondata="HeadButttondata"
@ -54,6 +53,7 @@
:pagination="{ total: tableObjectRef.total }"
v-model:pageSize="tableObjectRef.pageSize"
v-model:currentPage="tableObjectRef.currentPage"
v-model:sort="tableObjectRef.sort"
>
<!-- <template #action="{ row }">
<ButtonBase
@ -70,6 +70,7 @@
:pagination="{ total: tableObjectRef.total }"
v-model:pageSize="tableObjectRef.pageSize"
v-model:currentPage="tableObjectRef.currentPage"
v-model:sort="tableObjectRef.sort"
>
<template #photos="{ row }">
<div v-for="(item,index) in row.photos.split(',')" :key="index" style="color:#409eff ; cursor: pointer;" @click="openImage(item)">{{ item }}</div> </template>
@ -96,18 +97,43 @@
</template>
</DetailTable>
</ContentWrap>
<!-- other附件组件:如质检明细 -->
<div v-for="(annexItem ,index) in annexTableData" :key="index" v-show="annexItem.label==tabsList[current].label" class="w-[100%]" :style="{height:annexItem.hasSubDetail?'100%':remarkHeight+'px'}">
<ContentWrap class="w-[100%]">
<ElScrollbar ref="scrollbar" :style="{height:annexItem.hasSubDetail?'100%':(remarkHeight-40)+'px'}">
<Annex v-show="tabsList[current].label==annexItem.label"
:annexData="annexItem"
:showDownload = "annexItem.showDownload"
:hiddenDelete = "annexItem.hiddenDelete"
@handleAnnexSuccess="updateAnnexTableHandle"
@deleteAnnexSuccess="updateAnnexTableHandle"
:upData="{...remarksData.data,tableName:annexItem.tableName}"
/>
</ElScrollbar>
</ContentWrap>
<ContentWrap class="w-[100%]" v-if="annexItem.subDetailTableData">
<Table
v-if="!isBasic && fromeWhere != 'countPlan'"
:align="annexItem.align?annexItem.align:'center'"
:columns="annexItem.subDetailTableData.tableColumns"
:data="annexItem.subDetailTableData.tableList"
:loading="annexItem.subDetailTableData.loading"
:pagination="{ total: annexItem.subDetailTableData.tableList.length }"
v-model:pageSize="tableObjectRef.pageSize"
v-model:currentPage="tableObjectRef.currentPage"
v-model:sort="tableObjectRef.sort"
/>
</ContentWrap>
</div>
<!-- 附件/备注/变更记录 -->
<ContentWrap class="w-[100%]" v-show="annexTableData.some(item=>item.label==tabsList[current].label)||tabsList[current].label=='附件'||tabsList[current].label=='备注'||tabsList[current].label=='变更记录'" :style="{height:remarkHeight+'px'}">
<ContentWrap class="w-[100%]" v-show="tabsList[current].label==annexAlias.label||tabsList[current].label=='备注'||tabsList[current].label=='变更记录'" :style="{height:remarkHeight+'px'}">
<!-- 附件组件 -->
<ElScrollbar ref="scrollbar" :style="{height:(remarkHeight-40)+'px'}">
<Annex v-for="(annexItem ,index) in annexTableData" :key="index" v-show="tabsList[current].label==annexItem.label"
:annexData="annexItem"
@handleAnnexSuccess="updateAnnexTableHandle"
@deleteAnnexSuccess="updateAnnexTableHandle"
:upData="{...remarksData.data,tableName:annexItem.tableName}"
/>
<Annex v-show="tabsList[current].label=='附件'"
<Annex v-show="tabsList[current].label==annexAlias.label"
:annexData="annexData"
:showDownload = "annexAlias.showDownload"
:hiddenDelete = "annexAlias.hiddenDelete"
@handleAnnexSuccess="handleAnnexSuccess"
@deleteAnnexSuccess="deleteAnnexSuccess"
:upData="remarksData.data"
@ -190,6 +216,17 @@ const props = defineProps({
required: false,
default: ()=>[]
},
//tab
annexAlias: {
type: Object,
required: false,
default: ()=>({
label: '附件',
showDownload:false,
hiddenDelete:false
})
},
//
isBasic: {
type: Boolean,
@ -355,7 +392,7 @@ if (props.isBasic == true) {
}
const otherList = [...props.annexTable,{
label:'附件',
label:props.annexAlias.label,
prop:'Annex'
},{
label:'备注',
@ -372,6 +409,13 @@ if (!tabsList.value || tabsList.value && tabsList.value.length == otherList.leng
prop: 'Detail'
})
}
if(!props.isBasic){
tabsList.value.unshift({
label: '主数据',
prop: 'Descriptions'
})
}
// Tabs
const tabRef = ref()
@ -392,7 +436,7 @@ const remarkHeight = computed(() => {
const annexData = reactive({
annexList: []
})
//
// //
const annexTableData = ref<Array<any>>([])
//
@ -416,7 +460,8 @@ const getFileList = async () => {
}
}
//
const getAnnexFileList = async () => {
const getAnnexFileList = async (row:id) => {
console.log('getAnnexFileList')
props.annexTable?.forEach(async (item) => {
let requstData = {...remarksData.data,tableName: item?.tableName}
const annexList = await FileApi.getFileList(requstData)
@ -425,10 +470,28 @@ const getAnnexFileList = async () => {
annexData.annexList = annexList
}else{
annexTableData.value.push({
align:item.align,
label: item.label,
tableName: item?.tableName || '',
annexList
annexList,
hasSubDetail:item.hasSubDetail||false,
subDetailTableData:item.subDetailTableData,
showDownload:item.showDownload||false, //
hiddenDelete:item.hiddenDelete || false, //
})
if(item?.subDetailTableData){
const { tableObject:subTableObject, tableMethods:subTableMethods } = useTable({
getListApi: item.subDetailTableData.getSubList //
})
const {getList:getSubList} = subTableMethods
subTableObject.params= {}
item.subDetailTableData.queryParams.forEach(queryItem => {
subTableObject.params[queryItem.queryField] = row[queryItem.rowField]
});
await getSubList()
item.subDetailTableData.tableList = subTableObject.tableList
console.log('subTableObject',annexTableData.value)
}
}
})
}
@ -444,7 +507,7 @@ const deleteAnnexSuccess = async () => {
}
/** 追加的附件 */
const updateAnnexTableHandle = () => {
getAnnexFileList()
getAnnexFileList(detailData.value)
getChangeRecordList()
}
@ -504,18 +567,18 @@ const openDetail = async (row: any, titleName: any, titleValue: any, tableName:
titleNameRef.value = titleName
titleValueRef.value = titleValue
remarksData.data = {
tableId: row.id,
tableId: row.masterId||row.id,
tableName: tableName
}
count.value++
//
if (!props.isBasic) {
// id
masterParmas.value.masterId = row.id
masterParmas.value.masterId = row.masterId||row.id
masterParmas.value.number = row.number
masterParmas.value.status = row.status
tableObjectRef.value.params = {
masterId: row.id
masterId: row.masterId||row.id
}
await getList()
}
@ -526,7 +589,7 @@ const openDetail = async (row: any, titleName: any, titleValue: any, tableName:
detailData.value = row
getRemarkList()
getFileList()
getAnnexFileList()
getAnnexFileList(row)
getChangeRecordList()
//
let detailButtonFilter: any = []

19
src/components/Form/src/Form.vue

@ -54,7 +54,7 @@ export default defineComponent({
vLoading: propTypes.bool.def(false),
labelPosition: propTypes.string.def('left'),
},
emits: ['register','opensearchTable', 'onChange', 'onBlur','onEnter'],
emits: ['register','opensearchTable','clearSearchInput', 'onChange', 'onBlur','onEnter'],
setup(props, { slots, expose, emit }) {
// element form
const elFormRef = ref<ComponentRef<typeof ElForm>>()
@ -120,10 +120,13 @@ export default defineComponent({
return unref(elFormRef) as ComponentRef<typeof ElForm>
}
const opensearchTable = (field, searchField,searchTitle,searchAllSchemas, searchPage, searchCondition,multiple) => {
emit('opensearchTable',field, searchField, searchTitle, searchAllSchemas, searchPage, searchCondition,multiple)
const opensearchTable = (field, searchField,searchTitle,searchAllSchemas, searchPage, searchCondition,multiple,isConcatDetailSchemas,searchDetailSchemas) => {
emit('opensearchTable',field, searchField, searchTitle, searchAllSchemas, searchPage, searchCondition,multiple,undefined,null,isConcatDetailSchemas,searchDetailSchemas)
}
const clearSearchInput = (field) => {
emit('clearSearchInput')
}
expose({
setValues,
formModel,
@ -248,7 +251,7 @@ export default defineComponent({
<ElInput class={'myInput'} v-model={formModel.value[item.field]} placeholder={item?.componentProps?.searchListPlaceholder} disabled={item?.componentProps?.enterSearch?false:true} onKeyup={(event)=>{
if(event.keyCode === 13){
//
emit('onEnter',item.field,event)
emit('onEnter',item.field,formModel.value[item.field],event)
}
}} v-slots={{
suffix: () => (
@ -258,6 +261,7 @@ export default defineComponent({
}else{
formModel.value[item.field] = ''
}
clearSearchInput(item.field)
}}>
</ElButton>
)
@ -271,6 +275,8 @@ export default defineComponent({
item?.componentProps?.searchPage,
item?.componentProps?.searchCondition,
item?.componentProps?.multiple,
item?.componentProps?.isConcatDetailSchemas,
item?.componentProps?.searchDetailSchemas,
)}}/>
</>
)
@ -282,7 +288,7 @@ export default defineComponent({
<ElInput class={'myInput'} v-model={formModel.value[item.field]} placeholder={item?.componentProps?.searchListPlaceholder} onKeyup={(event)=>{
if(event.keyCode === 13){
//
emit('onEnter',item.field,event)
emit('onEnter',item.field,formModel.value[item.field],event)
}
}} disabled={item?.componentProps?.enterSearch?false:true} v-slots={{
suffix: () => (
@ -292,6 +298,7 @@ export default defineComponent({
}else{
formModel.value[item.field] = ''
}
clearSearchInput(item.field)
}}>
</ElButton>
)
@ -306,6 +313,8 @@ export default defineComponent({
item?.componentProps?.searchPage,
item?.componentProps?.searchCondition,
item?.componentProps?.multiple,
item?.componentProps?.isConcatDetailSchemas,
item?.componentProps?.searchDetailSchemas,
)}}/>
</>
)

186
src/components/ListTable/src/ListTable.vue

@ -1,40 +1,202 @@
<template>
<div>
<Dialog v-model="isPackageShow" :title="dialogTitle" :width="width?width:'900px'" v-loading="packageLoading">
<Dialog
v-model="isPackageShow"
:title="dialogTitle"
:width="width ? width : '900px'"
v-loading="packageLoading"
>
<TableHead
:HeadButttondata="HeadButttondata"
:masterId="masterParmas.masterId"
@button-base-click="buttonBaseClick"
:allSchemas="detailAllSchemas"
/>
<Table
ref="searchTableRef"
:columns="columns"
:data="allList"
:reserveSelection="true"
row-key="id"
/>
>
<template #action="{ row }">
<ButtonBase
:Butttondata="butttondata"
@button-base-click="buttonTableClick($event, row)"
/>
</template>
</Table>
</Dialog>
<!-- 表单弹窗添加/修改 -->
<BasicForm
ref="formRef"
:rules="detailAllSchemasRules"
:formAllSchemas="detailAllSchemas"
:isBusiness="false"
:apiUpdate="apiUpdate"
:apiCreate="apiCreate"
:isDetail="true"
:detailData="detailData"
@success="submitForm"
/>
</div>
</template>
<script lang="ts" setup>
const isPackageShow = ref(false)
const packageLoading = ref(false)
const dialogTitle = ref()
import * as defaultButtons from '@/utils/disposition/defaultButtons'
const message = useMessage() //
const columns = ref()
const allList = ref()
const { t } = useI18n() //
//
const props = defineProps({
width: {
type: String,
required: false
},
//
detailAllSchemas: {
type: Object,
required: true,
default: null
},
//
detailAllSchemasRules: {
type: Object,
required: true,
default: null
},
// API
apiCreate: {
type: Function,
required: false,
default: null
},
// API
apiUpdate: {
type: Function,
required: false,
default: null
},
//
detailValidate: {
type: Function,
required: false,
default: null
},
//
detailButtonIsShowDelete: {
type: Boolean,
required: false,
default: true
},
//
list: {
type: Object,
required: true,
default: null
}
})
const isPackageShow = ref(false)
const packageLoading = ref(false)
const dialogTitle = ref()
const columns = ref()
const allList = ref([])
//
const masterParmas = ref({
masterId: '', //id
number: '' //
})
const openPackage = async (row?: any, titleName?: any,tableColumns?: any,list?: any) => {
//
const HeadButttondata = ref()
// -
const butttondata = ref()
const detailData = ref({})
const openPackage = async (row?: any, titleName?: any, tableColumns?: any, list?: any) => {
isPackageShow.value = true
detailData.value = row
masterParmas.value.masterId = row.masterId || row.id
masterParmas.value.number = row.number
if(detailData.value.status ==1){
HeadButttondata.value = [
defaultButtons.defaultAddBtn(null) //
]
butttondata.value =[
defaultButtons.mainListEditBtn(null), //
defaultButtons.mainListDeleteBtn(null) //
]
columns.value = tableColumns
}else{
columns.value = tableColumns.filter(item=>item.field != 'action')
}
if (titleName) {
dialogTitle.value = titleName
}
columns.value = tableColumns.filter(item => (item.field !== 'action'))
allList.value = list
}
defineExpose({ openPackage }) // open
//
const isShowMainButton = (row, val) => {
if (val.indexOf(row.status) > -1) {
return false
} else {
return true
}
}
//
const buttonBaseClick = (val, item) => {
if (val == 'add') {
//
openForm('create')
}
}
/** 添加/修改操作 */
const formRef = ref()
const openForm = async (type: string, row?: number) => {
formRef.value.open(type, row, masterParmas.value)
}
const submitForm = async (formType, data) => {
try {
// detailValidate
const rs = (await props.detailValidate) ? await props.detailValidate(data) : true
if (!rs) return
emit('ListTableSubmit', formType, data)
//
} finally {
formRef.value.formLoading = false
}
}
// -
const buttonTableClick = async (val, row) => {
if (val == 'edit') {
//
openForm('update', row)
} else if (val == 'delete') {
//
handleDelete(row)
}
}
const handleDelete = async (row: any) => {
try {
//
await message.delConfirm()
//
emit('ListTableSubmit', 'detele', row)
} catch {}
}
const emit = defineEmits(['ListTableSubmit']) // success
defineExpose({ openPackage, formRef }) // open
watch(
() => props.list,
(newValue) => {
allList.value = newValue
formRef.value.dialogVisible = false
},
{
deep: true
}
)
</script>

5
src/components/RouterSearch/index.vue

@ -35,6 +35,7 @@
</template>
<script lang="ts" setup>
import { useAppStore } from '@/store/modules/app'
import { usePermissionStore } from '@/store/modules/permission'
import { filterBreadcrumb } from '@/layout/components/Breadcrumb/src/helper'
import { filter, treeToList } from '@/utils/tree'
@ -46,6 +47,7 @@ defineProps({
default: true
}
})
const appStore = useAppStore()
const permissionStore = usePermissionStore()
const routersa = permissionStore.getRouters
@ -123,6 +125,9 @@ const remoteMethod = (data) => {
}
const handleChange = (path) => {
if(path.split('/').length>1){
appStore.setCategoryRoutePath(`/${path.split('/')[1]}`)
}
console.log(126,path)
router.push({ path })
console.log(128,11111)

15
src/components/Search/src/Search.vue

@ -66,8 +66,23 @@ const newSchema = computed(() => {
}
])
}
updateSort(schema)
return schema
})
const updateSort= (val)=>{
val.forEach(item=>{
if(!item.sortSearchDefault){
if(item.field=="action"){
item.sortSearchDefault = 9999 //
}else{
item.sortSearchDefault = 999 // 999
}
}
})
val.sort((column1,column2)=>{
return column1.sortSearchDefault - column2.sortSearchDefault
})
}
const { register, elFormRef, methods } = useForm({
model: props.model || {}

16
src/components/SearchTable/src/SearchTable.vue

@ -59,7 +59,7 @@ const getListRef = ref()
const setSearchParamsRef = ref()
const tableObjectRef = ref()
const getPage:any = ref()
const searchSchema = ref()
// const searchSchema = ref()
const tableColumns = ref()
const formFieldRef = ref()
const searchFieldRef = ref()
@ -75,16 +75,22 @@ const openData = (titleName: any, tableObject:any ,allSchemas: any,multiple: any
searchDialogVisible.value = true
multipleBol.value = multiple
allSchemasRef.value = allSchemas
searchSchema.value = allSchemas.searchSchema
// searchSchema.value = allSchemas.searchSchema
tableColumns.value = allSchemas.tableColumns
}
const open = (titleName: any, allSchemas: any,getApiPage: any, formField: any, searchField: any,multiple: any, type: any, row: any, searchCondition:any , isCountRequestRe:any ) => {
const open = (titleName: any, allSchemas: any,getApiPage: any, formField: any, searchField: any,multiple: any, type: any, row: any, searchCondition:any , isCountRequestRe:any,isConcatDetailSchemas=false,detailSchemas: any) => {
searchDialogVisible.value = true
formFieldRef.value = formField
searchFieldRef.value = searchField
allSchemasRef.value = allSchemas
searchSchema.value = allSchemas.searchSchema
tableColumns.value = allSchemas.tableColumns.filter(item => (item.field !== 'action'))
// searchSchema.value = allSchemas.searchSchema
if(isConcatDetailSchemas){
//
console.log('detailSchemas',detailSchemas)
tableColumns.value = [...allSchemas?.tableColumns,...detailSchemas?.tableMainColumns].filter(item => (item.field !== 'action'))
}else{
tableColumns.value = allSchemas?.tableColumns.filter(item => (item.field !== 'action'))
}
getPage.value = getApiPage
typeRef.value = type
rowRef.value = row

40
src/components/Table/src/Table.vue

@ -58,7 +58,7 @@ export default defineComponent({
default: () => []
}
},
emits: ['update:pageSize', 'update:currentPage', 'register', 'update:sort'],
emits: ['update:pageSize', 'update:currentPage', 'register', 'update:sort','getSelectionRows'],
setup(props, { attrs, slots, emit, expose }) {
const elTableRef = ref<ComponentRef<typeof ElTable>>()
@ -101,9 +101,19 @@ export default defineComponent({
}
}
const toggleRowSelection = (row: Recordable, selected: boolean) => {
const tableRef = unref(elTableRef)
tableRef?.toggleRowSelection(unref(getProps).data.find(item=>item.id === row.id), selected)
}
const selections = ref<Recordable[]>([])
const sortRef = ref()
const selectRow = ()=>{
emit('getSelectionRows', currentPageRef.value,elTableRef.value?.getSelectionRows())
}
const selectAll = (val)=>{
emit('getSelectionRows', currentPageRef.value,elTableRef.value?.getSelectionRows())
}
const selectionChange = (selection: Recordable[]) => {
selections.value = selection
}
@ -116,7 +126,8 @@ export default defineComponent({
expose({
setProps,
setColumn,
selections
selections,
toggleRowSelection
})
const pagination = computed(() => {
@ -236,6 +247,25 @@ export default defineComponent({
})
}
//
const updateSort= (val)=>{
val.forEach(item=>{
if(!item.sortTableDefault){
if(item.fixed=='left'){
item.sortTableDefault = 0
}else if(item.fixed=='right'){
item.sortTableDefault = 9999
}else{
item.sortTableDefault = 999 // 999
}
}
})
val.sort((column1,column2)=>{
return column1.sortTableDefault - column2.sortTableDefault
})
}
const rnderTableColumn = (columnsChildren?: TableColumn[]) => {
const {
columns,
@ -247,6 +277,8 @@ export default defineComponent({
showOverflowTooltip,
border
} = unref(getProps)
//
updateSort(columns)
return [...[renderTableExpand()], ...[renderTableSelection()]].concat(
(columnsChildren || columns).map((v) => {
//
@ -306,6 +338,8 @@ export default defineComponent({
header-cell-class-name="tableHeader"
row-class-name="tableRow"
cell-class-name="tableRow"
onSelect={selectRow}
onSelect-all={selectAll}
onSelection-change={selectionChange}
onSort-change={sortChange}
{...unref(getBindValue)}

2
src/components/TableForm/src/TableForm.vue

@ -65,7 +65,7 @@
:placeholder="headerItem?.tableForm?.placeholder || '请输入' + headerItem.label"
:disabled="headerItem?.tableForm?.disabled ? true: headerItem?.tableForm?.isInpuFocusShow ? true : false"
style="flex:1"
@blur="inputStringBlur(headerItem.field, $event, row)"
@blur="inputStringBlur(headerItem.field, row[headerItem.field], row)"
/>
<el-button :key="headerItem.field+$index+'button'" v-if="headerItem?.tableForm?.isInpuFocusShow" @click="inpuFocus(headerItem,row,index)"><Icon icon="ep:search" size="14"/></el-button>
</el-form-item>

10
src/components/TableHead/src/TableHead.vue

@ -10,7 +10,7 @@
<div class="tableNavRightBtns">
<!-- 右侧按钮 -->
<ButtonBase :Butttondata="buttonsRight" @button-base-click="buttonBaseClick" @updata-table-columns="updataTableColumns"
:allSchemas="allSchemas" ref="rowDropRef"/>
:allSchemas="allSchemas" :detailAllSchemas="detailAllSchemas" ref="rowDropRef"/>
</div>
</div>
<slot></slot>
@ -32,7 +32,7 @@
:isHighExcludePrimary="false"
:primarySearchCustomButton="[]"
:highSearchCustomButton="[]"
:allSchemas="allSchemas"
:allSchemas="detailAllSchemas||allSchemas"
/>
</template>
<script setup>
@ -60,7 +60,11 @@ import rowDrop from "@/components/rowDrop/index.vue"
allSchemas: {
type: Object,
default: null
}
},
detailAllSchemas: {
type: Object,
default: null
},
})
const buttonsLeft = ref([])
const buttonsRight = ref([])

4
src/components/UploadFile/src/UploadFile.vue

@ -106,12 +106,12 @@ const beforeUpload: UploadProps['beforeUpload'] = (file: UploadRawFile) => {
// uploadRef.value.data.path = uploadFile.name
// }
//
const handleFileSuccess: UploadProps['onSuccess'] = (res: any): void => {
const handleFileSuccess: UploadProps['onSuccess'] = (res: any,uploadFile: any): void => {
message.success('上传成功')
const fileListNew = fileList.value
fileListNew.pop()
fileList.value = fileListNew
uploadList.value.push({ name: res.data, url: res.data })
uploadList.value.push({ name: uploadFile.name, url: res.data })
if (uploadList.value.length == uploadNumber.value) {
fileList.value = fileList.value.concat(uploadList.value)
uploadList.value = []

7
src/components/XButton/src/ButtonBase.vue

@ -25,6 +25,7 @@
ref="rowDropRef"
@updata-table-columns="updataTableColumns"
:allSchemas="allSchemas"
:detailAllSchemas="detailAllSchemas"
@closeRowDrop="closeRowDrop"
@updataTableColumns="updataTableColumns"
/>
@ -60,7 +61,11 @@ const props = defineProps({
allSchemas: {
type: Object,
default: null
}
},
detailAllSchemas: {
type: Object,
default: null
},
})
//

40
src/components/rowDrop/index.vue

@ -30,7 +30,11 @@ const props = defineProps({
allSchemas: {
type: Object,
default: null
}
},
detailAllSchemas: {
type: Object,
default: null
},
})
const popoverVisible = ref(false)
const route = useRoute() //
@ -80,10 +84,12 @@ const save = () => {
saveDate.push(props.allSchemas.tableColumns[0])
allData.value.forEach((item) => {
const _item:any = props.allSchemas.tableColumns.find(itemColumns => (itemColumns.label == item ))
_item.isTable = false
if (checkedDataList.value.indexOf(_item.label) > -1) {
_item.isTable = true
saveDate.push(_item)
if(_item){
_item.isTable = false
if (checkedDataList.value.indexOf(_item.label) > -1) {
_item.isTable = true
saveDate.push(_item)
}
}
})
//
@ -121,7 +127,12 @@ const dragover = (e) => {
//
const initSelectSta = () => {
RedisApi.getRedis(routeName.value).then(res => {
const _myTableColumns = props.allSchemas?.tableColumns
let _myTableColumns = [...props.allSchemas?.tableColumns]
if(props.detailAllSchemas){
_myTableColumns = [...props.allSchemas?.tableColumns,...props.detailAllSchemas?.tableMainColumns]
}
updateSort(_myTableColumns)
//
if (res) {
checkedDataList.value = []
@ -189,7 +200,22 @@ const initSelectSta = () => {
console.log(err)
})
}
const updateSort= (val)=>{
val.forEach(item=>{
if(!item.sortTableDefault){
if(item.fixed=='left'){
item.sortTableDefault = 0
}else if(item.fixed=='right'){
item.sortTableDefault = 9999
}else{
item.sortTableDefault = 999 // 999
}
}
})
val.sort((column1,column2)=>{
return column1.sortTableDefault - column2.sortTableDefault
})
}
//
const updataTableColumns = (val) => {
emit('updataTableColumns', val)

8
src/config/axios/index.ts

@ -39,6 +39,14 @@ export default {
const res = await request({ method: 'DELETE', ...option })
return res.data as unknown as T
},
enable: async <T = any>(option: any) => {
const res = await request({ method: 'POST', ...option })
return res.data as unknown as T
},
disable: async <T = any>(option: any) => {
const res = await request({ method: 'POST', ...option })
return res.data as unknown as T
},
put: async <T = any>(option: any) => {
const res = await request({ method: 'PUT', ...option })
return res.data as unknown as T

2
src/directives/index.ts

@ -1,6 +1,7 @@
import type { App } from 'vue'
import { hasRole } from './permission/hasRole'
import { hasPermi } from './permission/hasPermi'
import { clientTable } from './permission/clientTable'
/**
* v-xxx
@ -10,4 +11,5 @@ import { hasPermi } from './permission/hasPermi'
export const setupAuth = (app: App<Element>) => {
hasRole(app)
hasPermi(app)
clientTable(app)
}

21
src/directives/permission/clientTable.ts

@ -0,0 +1,21 @@
import type { App } from 'vue'
import { CACHE_KEY, useCache } from '@/hooks/web/useCache'
const { t } = useI18n() // 国际化
export function clientTable(app: App<Element>) {
app.directive('clientTable', (el, binding) => {
nextTick(() => {
const top = el.getBoundingClientRect().top
////--top-tool-height:50 --tags-view-height:35
const qustionHeight = 20
let paginationHeight = 0
if(el.children&&el.children.length>1){
paginationHeight = 70
}
const height = window.innerHeight - top - paginationHeight - qustionHeight
el.style.height = height + 'px'
el.firstChild.style.height = '100%'
})
})
}

9
src/hooks/web/useCrudSchemas.ts

@ -67,6 +67,7 @@ interface AllSchemas {
formSchema: FormSchema[]
detailSchema: DescriptionsSchema[]
tableFormColumns: TableFormColumn[]
tableMainColumns:TableColumn[]
}
const { t } = useI18n()
@ -83,14 +84,17 @@ export const useCrudSchemas = (
tableColumns: [],
formSchema: [],
detailSchema: [],
tableFormColumns:[]
tableFormColumns:[],
tableMainColumns:[],
})
const searchSchema = filterSearchSchema(crudSchema, allSchemas)
allSchemas.searchSchema = searchSchema || []
const tableColumns = filterTableSchema(crudSchema)
allSchemas.tableColumns = tableColumns || []
allSchemas.tableMainColumns = tableColumns.filter(item=>!item.hiddenInMain) || []
const formSchema = filterFormSchema(crudSchema, allSchemas)
allSchemas.formSchema = formSchema
@ -136,7 +140,8 @@ const filterSearchSchema = (crudSchema: CrudSchema[], allSchemas: AllSchemas): F
component,
...schemaItem.search,
field: schemaItem.field,
label: schemaItem.search?.label || schemaItem.label
label: schemaItem.search?.label || schemaItem.label,
sortSearchDefault: schemaItem.sortSearchDefault || 999,
},
{ componentProps: comonentProps }
)

70
src/layout/components/CategoryHeader.vue

@ -41,20 +41,36 @@ export default defineComponent({
name: 'CategoryHeader',
setup() {
console.log('useRouter()',useRouter())
const { push } = useRouter()
// backgroundColor="var(--left-menu-bg-color)"
// textColor="var(--left-menu-text-color)"
const categoryRouters = unref(routers).filter(item=>item.meta.hidden!=true&&item.path!='/')
console.log('categoryRouters==',categoryRouters)
//
const currentPath = useRouter().currentRoute.value.matched[0].path
console.log('默认数据',currentPath)
if(currentPath){
if(currentPath=='/'){
appStore.setCategoryRoutePath(categoryRouters[0].path)
}else{
appStore.setCategoryRoutePath(currentPath)
}
}
const activeMenu = computed(() => {
return appStore.getCategoryRoutePath
})
return () => (
<div class="category-container" style="width:100%">
<div class="line"></div>
<ElMenu
defaultActive={unref(activeMenu)}
id={`${variables.namespace}-tool-header`}
popperOffset={16}
class={['categoryheader',
prefixCls,
'h-[var(--top-category-height)] relative px-[var(--top-tool-p-x)] flex items-center ',
'dark:bg-[var(--el-bg-color)]',
{
'width':'200px'
}
]}
mode="horizontal"
backgroundColor="white"
@ -64,22 +80,16 @@ export default defineComponent({
{{
default: () => {
const { renderMenuTitle } = useRenderMenuTitle()
const categoryRouters = unref(routers).filter(item=>item.meta.hidden!=true&&item.path!='/')
console.log('categoryRouters==',categoryRouters)
//
if(categoryRouters.length>0){
appStore.setCategoryRoutePath(categoryRouters[0].path)
}
{/* default: () => renderMenuTitle(onlyOneChild ? onlyOneChild?.meta : meta) */}
return categoryRouters.map((v) => {
const meta = (v.meta ?? {}) as RouteMeta
const { onlyOneChild } = hasOneShowingChild(v.children, v)
const fullPath = isUrl(v.path) ? v.path : pathResolve('/', v.path) // getAllParentPath<AppRouteRecordRaw>(allRouters, v.path).join('/')
const fullPath = isUrl(v.path) ? v.path : pathResolve('/', v.path)
return (
<ElMenuItem index={fullPath} onClick={()=>{
console.log(v)
<ElMenuItem index={fullPath} class={{
}} onClick={()=>{
appStore.setCategoryRoutePath(v.path)
}}>
{{
@ -91,6 +101,7 @@ export default defineComponent({
}
}}
</ElMenu>
</div>
)
}
})
@ -104,8 +115,24 @@ $prefix-cls: #{$namespace}-tool-header;
.#{$prefix-cls} {
transition: left var(--transition-time-02);
}
.category-container{
background-color: transparent;
position: relative;
.line{
position: absolute;
width: 1px;
height:20px;
background: #fff;
top:calc(50% - 10px);
left:0;
z-index: 999;
}
}
.categoryheader{
padding-left: 20px;
background: #0069ef;
border:1px solid #0069ef;
}
@ -114,11 +141,20 @@ $prefix-cls: #{$namespace}-tool-header;
height: 40px;
margin-right: 10px;
margin-bottom: 2px;
background: rgb(242, 245, 248);
border: 1px solid #ccc;
// background: rgb(242, 245, 248);
background-color: hsla(0, 100%, 100%, 0.3);
color:#fff;
&:hover{
background: #fff !important;
color:#0069ef !important;
}
// border: 1px solid #ccc;
}
::v-deep(.el-menu-item.is-active){
background: var(--el-menu-hover-bg-color)
// background: var(--el-menu-hover-bg-color)
// background: #085cf4;
color:#0069ef !important;
background: #fff;
}
</style>

44
src/layout/components/Logo/src/Logo.vue

@ -24,26 +24,26 @@ onMounted(() => {
if (unref(collapse)) show.value = false
})
watch(
() => collapse.value,
(collapse: boolean) => {
if (unref(layout) === 'topLeft' || unref(layout) === 'cutMenu') {
show.value = true
return
}
if (!collapse) {
timer.value = setTimeout(() => {
show.value = !collapse
if(timer.value){
clearTimeout(timer.value)
timer.value = 0
}
}, 400)
} else {
show.value = !collapse
}
}
)
// watch(
// () => collapse.value,
// (collapse: boolean) => {
// if (unref(layout) === 'topLeft' || unref(layout) === 'cutMenu') {
// show.value = true
// return
// }
// if (!collapse) {
// timer.value = setTimeout(() => {
// show.value = !collapse
// if(timer.value){
// clearTimeout(timer.value)
// timer.value = 0
// }
// }, 400)
// } else {
// show.value = !collapse
// }
// }
// )
onBeforeUnmount(() => {
if(timer.value){
clearTimeout(timer.value)
@ -78,8 +78,8 @@ watch(
to="/"
>
<img
class="h-[calc(var(--logo-height)-24px)] w-[calc(var(--logo-height)-10px)]"
src="@/assets/imgs/logo.png"
class="h-24px w-[calc(var(--logo-height)-20px)]"
src="@/assets/imgs/logo_white.svg"
/>
<div
v-if="show"

17
src/layout/components/Menu/src/Menu.vue

@ -107,7 +107,6 @@ export default defineComponent({
unref(layout) === 'top' || unref(layout) === 'cutMenu' ? false : unref(collapse)
}
uniqueOpened={unref(layout) === 'top' ? false : unref(uniqueOpened)}
backgroundColor="var(--left-menu-bg-color)"
textColor="var(--left-menu-text-color)"
activeTextColor="var(--left-menu-text-active-color)"
onSelect={menuSelect}
@ -150,7 +149,7 @@ $prefix-cls: #{$namespace}-menu;
right: 0;
width: 4px;
height: 100%;
background-color: var(--el-color-primary);
// background-color: var(--el-color-primary);
content: '';
}
@ -307,4 +306,18 @@ $prefix-cls: #{$namespace}-menu-popper;
}
}
}
.v-menu .el-menu .el-menu .el-menu-item:not(.is-active):hover{
background-color: rgb(241,243,244) !important;
}
.v-menu .el-menu .el-menu-item:not(.is-active):hover{
background-color: rgb(241,243,244) !important;
}
.v-menu .el-menu .el-sub-menu.is-active>.el-sub-menu__title:hover{
background-color: rgb(241,243,244) !important;
}
.v-menu .el-menu .el-sub-menu.is-active>.el-sub-menu__title{
background-color: #fff !important;
color:#666 !important;
}
</style>

6
src/layout/components/Message/src/Message.vue

@ -1,6 +1,10 @@
<script lang="ts" setup>
import { formatDate } from '@/utils/formatTime'
import * as NotifyMessageApi from '@/api/system/notify/message'
import avatarImg from '@/assets/imgs/avatar.gif'
import { useUserStore } from '@/store/modules/user'
const userStore = useUserStore()
const avatar = userStore.getUser.avatar ? userStore.getUser.avatar : avatarImg
defineOptions({ name: 'Message' })
@ -66,7 +70,7 @@ onBeforeUnmount(() => {
<div class="message-list">
<template v-for="item in list" :key="item.id">
<div class="message-item">
<img alt="" class="message-icon" src="@/assets/imgs/avatar.gif" />
<img alt="" class="message-icon" :src="avatar" />
<div class="message-content">
<span class="message-title">
{{ item.templateNickname }}{{ item.templateContent }}

98
src/layout/components/useRenderLayout.tsx

@ -38,30 +38,41 @@ const mobile = computed(() => appStore.getMobile)
const fixedMenu = computed(() => appStore.getFixedMenu)
// 搜索图片
const search = computed(() => appStore.search)
const scrollBarHeight = computed(() => {
return (window.innerHeight - appStore.getCategoryMenuHeight - 85)+'px'
})
export const useRenderLayout = () => {
const renderClassic = () => {
return (
<>
<div
class={[
'absolute top-0 left-0 h-full layout-border__right',
{ '!fixed z-3000': mobile.value }
]}
>
{logo.value ? (
<div style="display:flex;flex-direction:row;width:100%;background:#0069ef;" class={['h-[var(--top-category-height)]']}>
{logo.value ? (
<Logo
class={[
'bg-[var(--left-menu-bg-color)] relative',
'h-[var(--top-category-height)]',
'bg-[var(--el-color-primary)] relative',
'w-[var(--left-menu-max-width)]',
{
'!pl-0': mobile.value && collapse.value,
'w-[var(--left-menu-min-width)]': appStore.getCollapse,
'w-[var(--left-menu-max-width)]': !appStore.getCollapse
}
]}
style="transition: all var(--transition-time-02);"
style="transition: all var(--transition-time-02);background:#0069ef;"
></Logo>
) : undefined}
{appStore.getShowCategoryMenu?(<CategoryHeader class={[
'bg-[var(--top-header-bg-color)]',
{
'layout-border__bottom': !tagsView.value
}
]}></CategoryHeader>):undefined}
</div>
<div
class={[
'absolute top-[var(--top-category-height)] left-0 h-full layout-border__right1',
{ '!fixed z-3000': mobile.value }
]}
>
{/* {search.value && !appStore.getCollapse? (<div class={[
prefixCls,
'h-[var(--top-tool-height)] relative px-[var(--top-tool-p-x)] flex items-center justify-between'
@ -73,12 +84,12 @@ export const useRenderLayout = () => {
'w-[var(--left-menu-max-width)]': !appStore.getCollapse
}
]} isModal={false} /> </div>) : undefined} */}
<Menu class={[{ '!h-[calc(100%-var(--logo-height))]': logo.value }]}></Menu>
<Menu class={['top-0',{ '!h-[calc(100%-var(--logo-height))]': logo.value }]}></Menu>
</div>
<div
class={[
`${prefixCls}-content`,
'absolute top-[var(--top-category-height)] h-[calc(100%-var(--top-category-height))]',
'absolute top-[var(--top-category-height)]',
{
'w-[calc(100%-var(--left-menu-min-width))] left-[var(--left-menu-min-width)]':
collapse.value && !mobile.value && !mobile.value,
@ -89,49 +100,44 @@ export const useRenderLayout = () => {
]}
style="transition: all var(--transition-time-02);"
>
<ElScrollbar
v-loading={pageLoading.value}
<div
class={[
`${prefixCls}-content-scrollbar`,
{
'!h-[calc(100%-var(--top-tool-height)-var(--top-category-height)-var(--tags-view-height))] mt-[calc(var(--top-tool-height)+var(--tags-view-height))]':
fixedHeader.value
'top-[var(--top-category-height) left-0 z-10': fixedHeader.value,
'w-[calc(100%-var(--left-menu-min-width))] !left-[var(--left-menu-min-width)]':
collapse.value && fixedHeader.value && !mobile.value,
'w-[calc(100%-var(--left-menu-max-width))] !left-[var(--left-menu-max-width)]':
!collapse.value && fixedHeader.value && !mobile.value,
'!w-full !left-0': mobile.value
}
]}
style="transition: all var(--transition-time-02);width:100%;"
>
<div
<ToolHeader
class={[
'bg-[var(--top-header-bg-color)]',
{
'fixed top-0 left-0 z-10': fixedHeader.value,
'w-[calc(100%-var(--left-menu-min-width))] !left-[var(--left-menu-min-width)]':
collapse.value && fixedHeader.value && !mobile.value,
'w-[calc(100%-var(--left-menu-max-width))] !left-[var(--left-menu-max-width)]':
!collapse.value && fixedHeader.value && !mobile.value,
'!w-full !left-0': mobile.value
'layout-border__bottom': !tagsView.value
}
]}
style="transition: all var(--transition-time-02);"
>
{appStore.getShowCategoryMenu?(<CategoryHeader class={[
'bg-[var(--top-header-bg-color)]',
{
'layout-border__bottom': !tagsView.value
}
]}></CategoryHeader>):undefined}
<ToolHeader
class={[
'bg-[var(--top-header-bg-color)]',
{
'layout-border__bottom': !tagsView.value
}
]}
></ToolHeader>
{tagsView.value ? (
<TagsView class="layout-border__bottom layout-border__top"></TagsView>
) : undefined}
</div>
></ToolHeader>
{tagsView.value ? (
<TagsView class="layout-border__bottom layout-border__top"></TagsView>
) : undefined}
</div>
<ElScrollbar
v-loading={pageLoading.value}
height={scrollBarHeight.value}
class={[
`${prefixCls}-content-scrollbar`,
{
'!h-[calc(100%-var(--app-content-padding)-var(--top-tool-height)-var(--top-category-height)-var(--tags-view-height))] ':
fixedHeader.value
}
]}
>
<AppView></AppView>
</ElScrollbar>
</div>

2
src/permission.ts

@ -15,6 +15,8 @@ const { loadStart, loadDone } = usePageLoading()
// 路由不重定向白名单
const whiteList = [
'/login',
'/forgetPassword',
'/updatePassword',
'/social-login',
'/auth-redirect',
'/bind',

19
src/router/modules/remaining.ts

@ -184,6 +184,25 @@ const remainingRouter: AppRouteRecordRaw[] = [
title: t('router.login'),
noTagsView: true
}
},{
path: '/forgetPassword',
component: () => import('@/views/login/forgetPassword.vue'),
name: 'ForgetPassword',
meta: {
hidden: true,
title: t('router.login'),
noTagsView: true
}
},
{
path: '/updatePassword',
component: () => import('@/views/login/updatePassword.vue'),
name: 'UpdatePassword',
meta: {
hidden: true,
title: t('router.login'),
noTagsView: true
}
},
{
path: '/sso',

17
src/store/modules/app.ts

@ -38,6 +38,7 @@ interface AppState {
fixedMenu: boolean
categoryRoutePath:string
showCategoryMenu: boolean
categoryMenuHeight:number
}
export const useAppStore = defineStore('app', {
@ -76,17 +77,17 @@ export const useAppStore = defineStore('app', {
// 左侧菜单边框颜色
leftMenuBorderColor: 'inherit',
// 左侧菜单背景颜色
leftMenuBgColor: '#001529',
leftMenuBgColor: '#fff',
// 左侧菜单浅色背景颜色
leftMenuBgLightColor: '#0f2438',
leftMenuBgLightColor: '#fff',
// 左侧菜单选中背景颜色
leftMenuBgActiveColor: 'var(--el-color-primary)',
leftMenuBgActiveColor: 'rgb(241,243,244)',
// 左侧菜单收起选中背景颜色
leftMenuCollapseBgActiveColor: 'var(--el-color-primary)',
// 左侧菜单字体颜色
leftMenuTextColor: '#bfcbd9',
leftMenuTextColor: '#666',
// 左侧菜单选中字体颜色
leftMenuTextActiveColor: '#fff',
leftMenuTextActiveColor: '#0069ef',
// logo字体颜色
logoTitleTextColor: '#fff',
// logo边框颜色
@ -101,7 +102,8 @@ export const useAppStore = defineStore('app', {
topToolBorderColor: '#eee'
},
categoryRoutePath:'',
showCategoryMenu:true // true:顶部展示一级菜单栏 false:只有左侧菜单栏
showCategoryMenu:true, // true:顶部展示一级菜单栏 false:只有左侧菜单栏
categoryMenuHeight:60 // true:顶部展示一级菜单栏 false:只有左侧菜单栏
}
},
getters: {
@ -186,6 +188,9 @@ export const useAppStore = defineStore('app', {
getShowCategoryMenu():boolean {
return this.showCategoryMenu
},
getCategoryMenuHeight():number {
return this.categoryMenuHeight
}
},
actions: {
setBreadcrumb(breadcrumb: boolean) {

4
src/styles/var.css

@ -1,5 +1,5 @@
:root {
--login-bg-color: #293146;
--login-bg-color: #0069ef;
--left-menu-max-width: 200px;
@ -19,7 +19,7 @@
/* left menu end */
/* logo start */
--logo-height: 50px;
--logo-height: 60px;
--logo-title-text-color: #fff;
/* logo end */

2
src/types/form.d.ts

@ -39,6 +39,8 @@ export type FormSchema = {
value?: FormValueType
// 是否隐藏
hidden?: boolean
//主表中展示子表数据
hiddenInMain?: boolean
// 远程加载下拉项
api?: <T = any>() => AxiosPromise<T>
}

6
src/utils/dict.ts

@ -188,6 +188,7 @@ export enum DICT_TYPE {
UOM = 'uom', // 计量单位
ABC_CLASS = 'abc_class', // ABC类
TRUE_FALSE = 'true_false', // 是否
FALSE_OR_TRUE = 'false_or_true', // 是否2
ITEM_GROUP = 'item_group', // 物料分组
ITEM_CATEGORY = 'Item_category', // 物料种类
ITEM_COLOR = 'item_color', // 物料颜色
@ -287,6 +288,7 @@ export enum DICT_TYPE {
MES_TASK_MODE='mes_task_mode', //生产模式 派工方式、领工方式
MES_PLANDO_STATUS='mes_plando_status', //计划执行状
PLAN_TYPE_MES='plan_type_mes',
HOLIDAY_TYPE='holiday_type', //节假日类型
//========== QMS ==========
SAMPLING_TYPE = "sampling_type", // 取样类型
@ -326,7 +328,9 @@ export enum DICT_TYPE {
// ========== system - 消息通知优化 - ==========
MESSAGE_NOTICE_TABLE = 'message_notice_table',//消息通知表
NOTICE_ACTION_TYPE = 'notice_action_type',//消息通知动作类型
FALSE_OR_TRUE = 'false_or_true',//是或否
RECEIVER_TYPE = 'receiver_type',//接收人类型
BASIC_TEAM_TYPE='basic_team_type',//班组类型
TAX_RATE_DICT='tax_rate_dict', //税率
INTERFACE_STATUS = 'interfaceStatus', // 接口调用信息 接口状态
}

36
src/utils/disposition/defaultButtons.ts

@ -250,7 +250,28 @@ export function mainListDeleteBtn(option:any) {
hasPermi: ''
})
}
export function mainListEnableBtn(option:any) {
return __defaultBtnOption(option,{
label: '启用',
name: 'enable',
hide: false,
type: 'danger',
color: '',
link: true, // 文本展现按钮
hasPermi: ''
})
}
export function mainListDisableBtn(option:any) {
return __defaultBtnOption(option,{
label: '禁用',
name: 'disable',
hide: false,
type: 'danger',
color: '',
link: true, // 文本展现按钮
hasPermi: ''
})
}
// 主列表-中止按钮1
export function mainListSuspend1Btn(option:any) {
return __defaultBtnOption(option,{
@ -741,6 +762,19 @@ export function mainListPointBtn(option:any) {
hasPermi: ''
})
}
// 主列表-批量打印
export function mainLisSelectiontPointBtn(option:any) {
return __defaultBtnOption(option,{
label: '批量打印',
name: 'selection_point',
hide: false,
type: 'primary',
icon: 'ep:download',
color: '',
float:'left',
hasPermi: ''
})
}
// 主列表-生成采购收货申请
export function mainListGenerateApplicationBtn(option:any) {
return __defaultBtnOption(option,{

16
src/utils/validator.ts

@ -21,7 +21,7 @@ export function validateCode(rule, value, callback) {
//校验邮箱
export function validateEmail(rule, value, callback) {
if (value) {
const mailReg = /^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+(.[a-zA-Z0-9_-])+/
const mailReg = /^([a-zA-Z0-9_-]+.)+@([a-zA-Z0-9_-])+(.[a-zA-Z0-9_-]+.)+/
if (mailReg.test(value)) {
callback()
} else {
@ -315,7 +315,18 @@ export function validateTwoNum(rule, value, callback) {
}
callback()
}
// 小数点前位数不得大于6位
export function validateNumSix(rule, value, callback) {
if (value) {
if (value.split('.')[0].length > 6) {// 校验value值不能大于10000
callback(new Error('版本号小数点前位数不得大于6'))
}else{
callback()
}
}
callback()
}
// 数字格式 小数点后两位 小数点前保留五位
export function validateTwoNumThree(rule, value, callback) {
@ -792,5 +803,6 @@ export default {
validateChargeperson,
validateYS,
validateMaxNumber5,
validatePercent
validatePercent,
validateNumSix
}

378
src/views/login/components/LoginForm.vue

@ -38,11 +38,8 @@
<img :src="codeUrl" @click="getCode" class="login-code-img" />
</div>
</div>
</el-form-item>
</el-col>
<el-col :span="24" style="padding-right: 10px; padding-left: 10px; margin-top: -20px; margin-bottom: -20px">
<el-form-item>
<el-row justify="space-between" style="width: 100%">
@ -52,12 +49,13 @@
</el-checkbox>
</el-col>
<el-col :offset="6" :span="12">
<el-link style="float: right" type="primary">{{ t('login.forgetPassword') }}</el-link>
<el-link style="float: right" type="primary"
@click="handleUpdate()">{{ t('login.forgetPassword') }}</el-link>
<!-- <el-button type="text" icon="Edit">忘记密码按钮</el-button> -->
</el-col>
</el-row>
</el-form-item>
</el-col>
<el-col :span="24" style="padding-right: 10px; padding-left: 10px">
<el-form-item>
<XButton :loading="loginLoading" :title="t('login.login')" class="w-[100%]" type="primary"
@ -75,213 +73,221 @@
</el-form>
</template>
<script lang="ts" setup>
import { ElLoading } from 'element-plus'
import LoginFormTitle from './LoginFormTitle.vue'
import type { RouteLocationNormalizedLoaded } from 'vue-router'
import { ElLoading } from 'element-plus'
import LoginFormTitle from './LoginFormTitle.vue'
import type { RouteLocationNormalizedLoaded } from 'vue-router'
import { useIcon } from '@/hooks/web/useIcon'
import { useIcon } from '@/hooks/web/useIcon'
import * as authUtil from '@/utils/auth'
import { usePermissionStore } from '@/store/modules/permission'
import * as LoginApi from '@/api/login'
import { LoginStateEnum, useFormValid, useLoginState } from './useLogin'
import { getCodeImg } from "@/api/login";
import * as authUtil from '@/utils/auth'
import { usePermissionStore } from '@/store/modules/permission'
import * as LoginApi from '@/api/login'
import { LoginStateEnum, useFormValid, useLoginState } from './useLogin'
import { getCodeImg } from "@/api/login";
import router from "@/router";
import { CACHE_KEY, useCache } from '@/hooks/web/useCache'
import * as DeptApi from '@/api/system/dept'
import { CACHE_KEY, useCache } from '@/hooks/web/useCache'
import * as DeptApi from '@/api/system/dept'
defineOptions({ name: 'LoginForm' })
defineOptions({ name: 'LoginForm' })
const { t } = useI18n()
const message = useMessage()
const iconHouse = useIcon({ icon: 'ep:house' })
const iconAvatar = useIcon({ icon: 'ep:avatar' })
const iconLock = useIcon({ icon: 'ep:lock' })
const formLogin = ref()
const { validForm } = useFormValid(formLogin)
const { setLoginState, getLoginState } = useLoginState()
const { currentRoute, push, replace } = useRouter()
const permissionStore = usePermissionStore()
const redirect = ref<string>('')
const loginLoading = ref(false)
const verify = ref()
const captchaType = ref('blockPuzzle') // blockPuzzle clickWord
const { t } = useI18n()
const message = useMessage()
const iconHouse = useIcon({ icon: 'ep:house' })
const iconAvatar = useIcon({ icon: 'ep:avatar' })
const iconLock = useIcon({ icon: 'ep:lock' })
const formLogin = ref()
const { validForm } = useFormValid(formLogin)
const { setLoginState, getLoginState } = useLoginState()
const { currentRoute, push , replace} = useRouter()
const permissionStore = usePermissionStore()
const redirect = ref<string>('')
const loginLoading = ref(false)
const verify = ref()
const captchaType = ref('blockPuzzle') // blockPuzzle clickWord
const getShow = computed(() => unref(getLoginState) === LoginStateEnum.LOGIN)
//
const captchaEnabled = ref(true);
const codeUrl = ref("");
const getShow = computed(() => unref(getLoginState) === LoginStateEnum.LOGIN)
//
const captchaEnabled = ref(true);
const codeUrl = ref("");
const LoginRules = {
tenantName: [required],
username: [required],
password: [required]
}
const loginData = reactive({
isShowPassword: false,
captchaEnable: import.meta.env.VITE_APP_CAPTCHA_ENABLE,
tenantEnable: import.meta.env.VITE_APP_TENANT_ENABLE,
loginForm: {
tenantName: '闻荫源码',
username: 'admin',
password: '123456',
captchaVerification: '',
rememberMe: false,
code: '',
uuid: ''
const LoginRules = {
tenantName: [required],
username: [required],
password: [required]
}
})
const loginData = reactive({
isShowPassword: false,
captchaEnable: import.meta.env.VITE_APP_CAPTCHA_ENABLE,
tenantEnable: import.meta.env.VITE_APP_TENANT_ENABLE,
loginForm: {
tenantName: '闻荫源码',
username: 'admin',
password: '123456',
captchaVerification: '',
rememberMe: false,
code: '',
uuid: ''
}
})
const socialList = [
{ icon: 'ant-design:github-filled', type: 0 },
{ icon: 'ant-design:wechat-filled', type: 30 },
{ icon: 'ant-design:alipay-circle-filled', type: 0 },
{ icon: 'ant-design:dingtalk-circle-filled', type: 20 }
]
const socialList = [
{ icon: 'ant-design:github-filled', type: 0 },
{ icon: 'ant-design:wechat-filled', type: 30 },
{ icon: 'ant-design:alipay-circle-filled', type: 0 },
{ icon: 'ant-design:dingtalk-circle-filled', type: 20 }
]
//
// const getCode = async () => {
// //
// if (loginData.captchaEnable === 'false') {
// await handleLogin({})
// } else {
// //
// //
// verify.value.show()
// }
// }
function getCode() {
getCodeImg().then(res => {
captchaEnabled.value = res.captchaEnabled === undefined ? true : res.captchaEnabled;
if (captchaEnabled.value) {
codeUrl.value = "data:image/gif;base64," + res.img;
loginData.loginForm.uuid = res.uuid;
}
});
}
//ID
const getTenantId = async () => {
if (loginData.tenantEnable === 'true') {
const res = await LoginApi.getTenantIdByName(loginData.loginForm.tenantName)
authUtil.setTenantId(res)
//
// const getCode = async () => {
// //
// if (loginData.captchaEnable === 'false') {
// await handleLogin({})
// } else {
// //
// //
// verify.value.show()
// }
// }
function getCode() {
getCodeImg().then(res => {
captchaEnabled.value = res.captchaEnabled === undefined ? true : res.captchaEnabled;
if (captchaEnabled.value) {
codeUrl.value = "data:image/gif;base64," + res.img;
loginData.loginForm.uuid = res.uuid;
}
});
}
}
//
const getCookie = () => {
const loginForm = authUtil.getLoginForm()
if (loginForm) {
loginData.loginForm = {
...loginData.loginForm,
username: loginForm.username ? loginForm.username : loginData.loginForm.username,
password: loginForm.password ? loginForm.password : loginData.loginForm.password,
rememberMe: loginForm.rememberMe ? true : false,
tenantName: loginForm.tenantName ? loginForm.tenantName : loginData.loginForm.tenantName
//ID
const getTenantId = async () => {
if (loginData.tenantEnable === 'true') {
const res = await LoginApi.getTenantIdByName(loginData.loginForm.tenantName)
authUtil.setTenantId(res)
}
}
}
const loading = ref() // ElLoading.service
//
const handleLogin = async (params) => {
console.log('登录-185')
loginLoading.value = true
try {
await getTenantId()
const data = await validForm()
if (!data) {
return
//
const getCookie = () => {
const loginForm = authUtil.getLoginForm()
if (loginForm) {
loginData.loginForm = {
...loginData.loginForm,
username: loginForm.username ? loginForm.username : loginData.loginForm.username,
password: loginForm.password ? loginForm.password : loginData.loginForm.password,
rememberMe: loginForm.rememberMe ? true : false,
tenantName: loginForm.tenantName ? loginForm.tenantName : loginData.loginForm.tenantName
}
}
const res = await LoginApi.login(loginData.loginForm)
if (!res) {
console.log('登录-195')
getCode()
return
}
loading.value = ElLoading.service({
lock: true,
text: '正在加载系统中...',
background: 'rgba(0, 0, 0, 0.7)'
})
if (loginData.loginForm.rememberMe) {
authUtil.setLoginForm(loginData.loginForm)
} else {
authUtil.removeLoginForm()
}
authUtil.setToken(res)
if (!redirect.value) {
redirect.value = '/'
}
// SSO
if (redirect.value.indexOf('sso') !== -1) {
window.location.href = window.location.href.replace('/login?redirect=', '')
} else {
console.log(redirect.value)
replace({ path: redirect.value || permissionStore.addRouters[0].path })
}
//
const { wsCache } = useCache()
wsCache.set(CACHE_KEY.DEPT, await DeptApi.getSimpleDeptList())
} finally {
console.log('登录-224')
getCode()
loginLoading.value = false
loading?.value?.close()
}
}
//
const doSocialLogin = async (type: number) => {
if (type === 0) {
message.error('此方式未配置')
} else {
const handleUpdate = () => {
router.push({
name: 'ForgetPassword',
})
};
const loading = ref() // ElLoading.service
//
const handleLogin = async (params) => {
console.log('登录-185')
loginLoading.value = true
if (loginData.tenantEnable === 'true') {
await message.prompt('请输入租户名称', t('common.reminder')).then(async ({ value }) => {
const res = await LoginApi.getTenantIdByName(value)
authUtil.setTenantId(res)
try {
await getTenantId()
const data = await validForm()
if (!data) {
return
}
const res = await LoginApi.login(loginData.loginForm)
if (!res) {
console.log('登录-195')
getCode()
return
}
loading.value = ElLoading.service({
lock: true,
text: '正在加载系统中...',
background: 'rgba(0, 0, 0, 0.7)'
})
if (loginData.loginForm.rememberMe) {
authUtil.setLoginForm(loginData.loginForm)
} else {
authUtil.removeLoginForm()
}
authUtil.setToken(res)
if (!redirect.value) {
redirect.value = '/'
}
// SSO
if (redirect.value.indexOf('sso') !== -1) {
window.location.href = window.location.href.replace('/login?redirect=', '')
} else {
console.log(redirect.value)
replace({ path: redirect.value || permissionStore.addRouters[0].path })
}
//
const { wsCache } = useCache()
wsCache.set(CACHE_KEY.DEPT, await DeptApi.getSimpleDeptList())
} finally {
console.log('登录-224')
getCode()
loginLoading.value = false
loading?.value?.close()
}
// redirectUri
const redirectUri =
location.origin + '/social-login?type=' + type + '&redirect=' + (redirect.value || '/')
//
const res = await LoginApi.socialAuthRedirect(type, encodeURIComponent(redirectUri))
console.log(33)
window.location.href = res
}
}
watch(
() => currentRoute.value,
(route: RouteLocationNormalizedLoaded) => {
redirect.value = route?.query?.redirect as string
},
{
immediate: true
//
const doSocialLogin = async (type : number) => {
if (type === 0) {
message.error('此方式未配置')
} else {
loginLoading.value = true
if (loginData.tenantEnable === 'true') {
await message.prompt('请输入租户名称', t('common.reminder')).then(async ({ value }) => {
const res = await LoginApi.getTenantIdByName(value)
authUtil.setTenantId(res)
})
}
// redirectUri
const redirectUri =
location.origin + '/social-login?type=' + type + '&redirect=' + (redirect.value || '/')
//
const res = await LoginApi.socialAuthRedirect(type, encodeURIComponent(redirectUri))
console.log(33)
window.location.href = res
}
}
)
onMounted(() => {
getCode();
getCookie()
})
watch(
() => currentRoute.value,
(route : RouteLocationNormalizedLoaded) => {
redirect.value = route?.query?.redirect as string
},
{
immediate: true
}
)
onMounted(() => {
getCode();
getCookie()
})
</script>
<style lang="scss" scoped>
:deep(.anticon) {
&:hover {
color: var(--el-color-primary) !important;
:deep(.anticon) {
&:hover {
color: var(--el-color-primary) !important;
}
}
}
.login-code {
float: right;
width: 100%;
height: 38px;
img {
.login-code {
float: right;
width: 100%;
height: auto;
max-width: 100px;
vertical-align: middle;
cursor: pointer;
height: 38px;
img {
width: 100%;
height: auto;
max-width: 100px;
vertical-align: middle;
cursor: pointer;
}
}
}
</style>

85
src/views/login/forgetPassword.vue

@ -0,0 +1,85 @@
<template>
<div v-loading="loading" class="box">
<el-form ref="formSmsLogin" :model="loginData" :rules="rules" label-width="130px" label-position="top" size="large">
<div class="title">忘记密码</div>
<el-row type="flex" justify="center" align="middle">
<el-col>
<el-form-item label="用户名" prop="username" align="center">
<el-input v-model="loginData.username" placeholder="请输入用户名" />
</el-form-item>
</el-col>
<el-col>
<el-form-item label="邮箱" prop="email">
<el-input v-model="loginData.email" placeholder="请输入邮箱" />
</el-form-item>
</el-col>
</el-row>
</el-form>
<div class="dialog-footer">
<el-button type="primary" @click="submitForm" style="width: 100%;height: 40px;line-height: 40px;"> </el-button>
</div>
</div>
</template>
<script lang="ts" setup name="forgetPassword">
import type { RouteLocationNormalizedLoaded } from 'vue-router'
import { useIcon } from '@/hooks/web/useIcon'
import { setTenantId, setToken } from '@/utils/auth'
import { usePermissionStore } from '@/store/modules/permission'
import { getTenantIdByName, sendSmsCode, smsLogin } from '@/api/login'
import * as UserApi from '@/api/system/user'
const { t } = useI18n()
const message = useMessage()
const permissionStore = usePermissionStore()
const formSmsLogin = ref()
const loginLoading = ref(false)
const iconHouse = useIcon({ icon: 'ep:house' })
const iconCellphone = useIcon({ icon: 'ep:cellphone' })
const iconCircleCheck = useIcon({ icon: 'ep:circle-check' })
const rules = {
username: [required],
email: [required]
}
const loginData = reactive({
username: '',
email: '',
})
const loading = ref(false);
const submitForm = async () => {
try {
const data = loginData as unknown as UserApi.UserVO
await UserApi.forgetPassword(data)
message.success(t('common.updateSuccess'))
//
router.go(-1)
} finally {
// formLoading.value = false
}
}
</script>
<style lang="scss" scoped>
:deep(.anticon) {
&:hover {
color: var(--el-color-primary) !important;
}
}
.smsbtn {
margin-top: 33px;
}
.box{
border: 1px solid #dedede;
width: 500px;
margin: 100px auto 0px;
padding: 20px;
box-shadow: 0px 0px 20px rgba($color: #000000, $alpha: 0.1);
}
.title{
text-align: center;
font-size: 20px;
font-weight: bold;
padding-bottom: 20px;
}
</style>

105
src/views/login/updatePassword.vue

@ -0,0 +1,105 @@
<template>
<div v-loading="loading" class="box">
<el-form ref="formSmsLogin" :model="loginData" :rules="rules" label-width="130px" label-position="top" size="large">
<div class="title" style="font-size:25px" margin-left="0px">重置密码</div>
<el-row type="flex" justify="center" align="middle">
<el-col>
<el-form-item label="新密码" prop="password" align="center">
<el-input v-model="loginData.password" placeholder="请输入新密码" :type="isShowPassword?'text':'password'"/>
<el-icon style="position: absolute; right: 10px;cursor: pointer;" color="#a5a5a5" size="18" @click="isShowPassword = !isShowPassword">
<View v-if="!isShowPassword"/>
<Hide v-if="isShowPassword"/>
</el-icon>
</el-form-item>
</el-col>
<el-col>
<el-form-item label="确认新密码" prop="againPassword">
<el-input v-model="loginData.againPassword" placeholder="请再次新密码" :type="isShowAgainPassword?'text':'password'"/>
<el-icon style="position: absolute; right: 10px;cursor: pointer;" color="#a5a5a5" size="18" @click="isShowAgainPassword = !isShowAgainPassword">
<View v-if="!isShowAgainPassword"/>
<Hide v-if="isShowAgainPassword"/>
</el-icon>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div class="dialog-footer">
<el-button type="primary" @click="submitForm" style="width: 100%;height: 40px;line-height: 40px;"> </el-button>
</div>
</div>
</template>
<script lang="ts" setup name="bb">
import type { RouteLocationNormalizedLoaded } from 'vue-router'
import { useIcon } from '@/hooks/web/useIcon'
import { setTenantId, setToken } from '@/utils/auth'
import { usePermissionStore } from '@/store/modules/permission'
import { getTenantIdByName, sendSmsCode, smsLogin } from '@/api/login'
import * as UserApi from '@/api/system/user'
import { View,Hide } from '@element-plus/icons-vue'
const { t } = useI18n()
const message = useMessage()
const permissionStore = usePermissionStore()
const formSmsLogin = ref()
const loginLoading = ref(false)
const iconHouse = useIcon({ icon: 'ep:house' })
const iconCellphone = useIcon({ icon: 'ep:cellphone' })
const iconCircleCheck = useIcon({ icon: 'ep:circle-check' })
const route = useRoute() //
const rules = {
password: [required],
againPassword: [required]
}
const loginData = reactive({
password: '',
againPassword: '',
mailKey: '',
})
const isShowPassword = ref(false)
const isShowAgainPassword = ref(false)
const loading = ref(false);
const submitForm = async () => {
try {
loginData.mailKey = route.query.mailKey;
if (loginData.password != loginData.againPassword) {
message.error('两次输入的密码不一致,请重新输入!')
} else {
const data = loginData as unknown as UserApi.UserVO
await UserApi.updatePassword(data)
//
message.success(t('common.updateSuccess'))
 router.go(-1)
}
} finally {
// formLoading.value = false
}
}
</script>
<style lang="scss" scoped>
:deep(.anticon) {
&:hover {
color: var(--el-color-primary) !important;
}
}
.smsbtn {
margin-top: 33px;
}
.box{
border: 1px solid #dedede;
width: 500px;
margin: 100px auto 0px;
padding: 20px;
box-shadow: 0px 0px 20px rgba($color: #000000, $alpha: 0.1);
}
.title{
text-align: center;
font-size: 20px;
font-weight: bold;
padding-bottom: 20px;
}
::v-deep(.el-input--large .el-input__inner){
padding-right: 30px;
}
</style>

5
src/views/mes/abilityInfo/index.vue

@ -51,7 +51,8 @@
/>
<!-- 详情 -->
<Detail ref="detailRef" :isBasic="true" :allSchemas="AbilityInfo.allSchemas" />
<Detail ref="detailRef" :isBasic="true" :isBasicMes="false" :allSchemas="AbilityInfo.allSchemas" :detailAllSchemas="AbilityInfo.allSchemas"
:apiPage="AbilityInfoApi.getAbilityInfoPage" />
<!-- 导入 -->
<ImportForm ref="importFormRef" url="/mes/ability-info/import" :importTemplateData="importTemplateData" @success="importSuccess" />
@ -64,7 +65,7 @@ import * as AbilityInfoApi from '@/api/mes/abilityInfo'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import TableHead from '@/components/TableHead/src/TableHead.vue'
import ImportForm from '@/components/ImportForm/src/ImportForm.vue'
import Detail from '@/components/Detail/src/Detail.vue'
import Detail from '../components/Detail.vue'
defineOptions({ name: 'AbilityInfo' })

969
src/views/mes/components/Detail.vue

@ -0,0 +1,969 @@
<template>
<div>
<el-drawer
v-model="isShowDrawer"
title="详情"
direction="rtl"
size="80%"
v-loading="detailLoading"
>
<template #header>
<div class="font-size-18px">
{{ titleValueRef }} <span class="ml-20px font-size-16px">{{ titleNameRef }}</span>
</div>
</template>
<Tabs ref="tabRef" :tabsList="tabsList" :current="current" @change="change" />
<ContentWrap v-if="!isBasic" v-show="tabsList[current].label=='主数据'">
<Descriptions
:data="detailData"
labelClassName="label-class-name"
label-align="left"
direction="vertical"
:column="8"
:schema="allSchemas.detailSchema"
:columns="2"
width="200px"
/>
</ContentWrap>
<ContentWrap v-else-if="!isBasicMes" v-show="tabsList[current].label=='主数据'">
<Descriptions
:data="detailData"
labelClassName="label-class-name"
label-align="left"
direction="vertical"
:column="8"
:schema="allSchemas.detailSchema"
:columns="2"
width="200px"
/>
</ContentWrap>
<div class="flex">
<!-- 详情 -->
<ContentWrap class="w-[100%]" v-show="tabsList[current].label!=annexAliasLabel&&tabsList[current].label!='备注'&&tabsList[current].label!='变更记录'&&tabsList[current].label!='主数据'&&!annexTableData.some(item=>item.label==tabsList[current].label)"> <!-- 列表头部 -->
<TableHead
v-if="!isBasic"
:HeadButttondata="HeadButttondata"
:masterId="masterParmas.masterId"
@button-base-click="buttonBaseClick"
:routeName="routeName"
@searchFormClick="searchFormClick"
:allSchemas="detailAllSchemas"
/>
<!-- 默认单表展现 -->
<Descriptions
v-if="isBasic && !tabsExtend"
:data="detailData"
:schema="allSchemas.detailSchema"
:columns="2"
/>
<!-- 单表切换tabs 展现table -->
<Table
v-if="isBasic && tabsExtend"
:columns="detailAllSchemasRef.tableColumns"
:data="tableObjectRef.tableList"
:loading="tableObjectRef.loading"
:pagination="{ total: tableObjectRef.total }"
v-model:pageSize="tableObjectRef.pageSize"
v-model:currentPage="tableObjectRef.currentPage"
v-model:sort="tableObjectRef.sort"
>
<!-- <template #action="{ row }">
<ButtonBase
:Butttondata="buttondata"
@button-base-click="buttonTableClick($event, row)"
/>
</template> -->
</Table>
<Table
v-if="!isBasic && fromeWhere != 'countPlan'"
:columns="detailAllSchemasRef.tableColumns"
:data="tableObjectRef.tableList"
:loading="tableObjectRef.loading"
:pagination="{ total: tableObjectRef.total }"
v-model:pageSize="tableObjectRef.pageSize"
v-model:currentPage="tableObjectRef.currentPage"
v-model:sort="tableObjectRef.sort"
>
<template #photos="{ row }">
<div v-for="(item,index) in row.photos.split(',')" :key="index" style="color:#409eff ; cursor: pointer;" @click="openImage(item)">{{ item }}</div> </template>
<template #action="{ row }">
<ButtonBase
:Butttondata="buttondata"
@button-base-click="buttonTableClick($event, row)"
/>
</template>
</Table>
<DetailTable
v-if="!isBasic && fromeWhere == 'countPlan' && isShowDrawer"
:columns="detailAllSchemasRef.tableColumns"
:data="tableObjectRef.tableList"
:allList="allList"
:countScopeType="countScopeType"
:key="updateKey"
>
<template #action="{ row }">
<ButtonBase
:Butttondata="buttondata"
@button-base-click="buttonTableClick($event, row)"
/>
</template>
</DetailTable>
</ContentWrap>
<!-- other附件组件:如质检明细 -->
<div v-for="(annexItem ,index) in annexTableData" :key="index" v-show="annexItem.label==tabsList[current].label" class="w-[100%]" :style="{height:annexItem.hasSubDetail?'100%':remarkHeight+'px'}">
<ContentWrap class="w-[100%]">
<ElScrollbar ref="scrollbar" :style="{height:annexItem.hasSubDetail?'100%':(remarkHeight-40)+'px'}">
<Annex v-show="tabsList[current].label==annexItem.label"
:annexData="annexItem"
@handleAnnexSuccess="updateAnnexTableHandle"
@deleteAnnexSuccess="updateAnnexTableHandle"
:upData="{...remarksData.data,tableName:annexItem.tableName}"
/>
</ElScrollbar>
</ContentWrap>
<ContentWrap class="w-[100%]" v-if="annexItem.subDetailTableData">
<Table
v-if="!isBasic && fromeWhere != 'countPlan'"
:align="annexItem.align?annexItem.align:'center'"
:columns="annexItem.subDetailTableData.tableColumns"
:data="annexItem.subDetailTableData.tableList"
:loading="annexItem.subDetailTableData.loading"
:pagination="{ total: annexItem.subDetailTableData.tableList.length }"
v-model:pageSize="tableObjectRef.pageSize"
v-model:currentPage="tableObjectRef.currentPage"
v-model:sort="tableObjectRef.sort"
/>
</ContentWrap>
</div>
<!-- 附件/备注/变更记录 -->
<ContentWrap class="w-[100%]" v-show="tabsList[current].label==annexAliasLabel||tabsList[current].label=='备注'||tabsList[current].label=='变更记录'" :style="{height:remarkHeight+'px'}">
<!-- 附件组件 -->
<ElScrollbar ref="scrollbar" :style="{height:(remarkHeight-40)+'px'}">
<Annex v-show="tabsList[current].label==annexAliasLabel"
:annexData="annexData"
@handleAnnexSuccess="handleAnnexSuccess"
@deleteAnnexSuccess="deleteAnnexSuccess"
:upData="remarksData.data"
:key="count"
/>
<!-- 备注组件 -->
<Remarks v-show="tabsList[current].label=='备注'"
:remarksData="remarksData"
class="mt-20px"
@remarksSubmitScuess="remarksSubmitScuess"
:key="count"
/>
<!-- 变更记录组件 -->
<ChangeRecord v-show="tabsList[current].label=='变更记录'" :changeRecordData="changeRecordData" class="mt-20px" :key="count"/>
</ElScrollbar>
</ContentWrap>
</div>
</el-drawer>
<!-- 表格弹窗 -->
<SearchTable ref="searchTableRef" @search-table-success="searchTableSuccess1" />
<!-- 表单弹窗添加/修改 -->
<BasicForm
ref="formRef"
@success="submitForm"
:rules="detailAllSchemasRules"
:formAllSchemas="detailAllSchemas"
:isBusiness="false"
:apiUpdate="apiUpdate"
:apiCreate="apiCreate"
:fromeWhere="fromeWhere"
:isDetail="true"
@searchTableSuccess="searchTableSuccess"
:detailData="detailData"
@submitForm="submitForm"
@selectChangeDetail="selectChangeDetail"
:formTypeDetail="formTypeDetail"
:countPlanAllList="countPlanAllList"
@onChange="detailBasicFormOnChange"
@onBlur="onBlur"
@formFormDateChange="formFormDateChange"
/>
</div>
</template>
<script lang="ts" setup>
import Annex from '@/components/Annex/src/Annex.vue'
import Remarks from '@/components/Remarks/src/Remarks.vue'
import ChangeRecord from '@/components/ChangeRecord/src/ChangeRecord.vue'
import Tabs from '@/components/Tabs/src/Tabs.vue'
import * as RemarkApi from '@/api/wms/remark'
import * as FileApi from '@/api/wms/file'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import BasicForm from '@/components/BasicForm/src/BasicForm.vue'
import TableHead from '@/components/TableHead/src/TableHead.vue'
import DetailTable from '@/components/DetailTable/src/DetailTable.vue'
import { SearchTable } from '@/components/SearchTable'
defineOptions({ name: 'Detail' })
const message = useMessage() //
const { t } = useI18n() //
const route = useRoute() //
const routeName = ref()
routeName.value = route.name
routeName.value = routeName.value.substring(0, routeName.value.length - 4) + 'Detail'
const updateKey = ref(0)
const props = defineProps({
//
tabs: {
type: Object,
required: true,
default: null
},
//tab
annexTable: {
type: Array,
required: false,
default: ()=>[]
},
//tab
annexAliasLabel: {
type: String,
required: false,
default: '附件'
},
//
isBasic: {
type: Boolean,
required: false,
default: false
},
// mes
isBasicMes: {
type: Boolean,
required: false,
default: false
},
//
allSchemas: {
type: Object,
required: true,
default: null
},
//
detailAllSchemas: {
type: Object,
required: true,
default: null
},
//
detailAllSchemasRules: {
type: Object,
required: true,
default: null
},
// API
apiCreate: {
type: Function,
required: false,
default: null
},
// API
apiUpdate: {
type: Function,
required: false,
default: null
},
// API
apiPage: {
type: Function,
required: false,
default: null
},
// API
apiDelete: {
type: Function,
required: false,
default: null
},
//
detailValidate: {
type: Function,
required: false,
default: null
},
// countPlan
fromeWhere: {
type: String,
required: false,
default: ''
},
//
allList: {
type: Object,
required: true,
default: null
},
//
countScopeType: {
type: Array,
required: false,
default: null
},
//
formTypeDetail: {
type: String,
required: false,
default: 'InputString'
},
//
countPlanAllList: {
type: Array,
required: false,
default: null
},
//
buttondataTable: {
type: Array,
required: false,
default: ()=>{
return []
}
},
// tabs table false
tabsExtend: {
type: Boolean,
required: false,
default: false
},
// tableObject
tableObjectExtend: {
type: Array,
required: false,
default: null
},
//
detailButtonIsShowFilter:{
type: Boolean,
required: false,
default: true
},
//
detailButtonIsShowAdd:{
type: Boolean,
required: false,
default: true
},
//
detailButtonIsShowEdit:{
type: Boolean,
required: false,
default: true
},
//
detailButtonIsShowDelete:{
type: Boolean,
required: false,
default: true
},
//
isOpenSearchTable:{
type: Boolean,
required: false,
default: false
},
//
otherHeadButttonData:{
type:Array,
required: false,
default: () => []
}
})
const isShowDrawer = ref(false)
const detailLoading = ref(false)
const tabsList = ref(JSON.parse(JSON.stringify(props.tabs ? props.tabs : '')))
// if (props.isBasic == true || props.isBasicMes == true) {
// if (tabsList.value && tabsList.value.length > 0) {
// tabsList.value.unshift({
// label: '',
// prop: 'Detail'
// })
// }
// } else {
// if (tabsList.value && tabsList.value.length > 0) {
// } else {
// tabsList.value = [
// {
// label: '',
// prop: 'Detail'
// }
// ]
// }
// }
const otherList = [...props.annexTable,{
label:props.annexAliasLabel,
prop:'Annex'
},{
label:'备注',
prop:'Remarks'
},{
label:'变更记录',
prop:'ChangeRecord'
}]
tabsList.value = [...tabsList?.value,...otherList]
if (!tabsList.value || tabsList.value && tabsList.value.length == otherList.length) {
if (props.isBasic == false && props.isBasicMes == false) {
tabsList.value.unshift({
label: '明细',
prop: 'Detail'
})}
}
tabsList.value.unshift({
label: '主数据',
prop: 'Descriptions'
})
// Tabs
const tabRef = ref()
//
const scrollbar = ref()
//
const remarkHeight = computed(() => {
const tab = unref(tabRef)
const tabTop = tab?.$el.getBoundingClientRect().top
const tabHeight = tab?.$el.getBoundingClientRect().height
console.log('tabTop',tabTop)
const height = window.innerHeight - (tabTop) - (tabHeight) - 60
return height
})
//
const annexData = reactive({
annexList: []
})
// //
const annexTableData = ref<Array<any>>([])
//
const remarksData = reactive({
remarksList: [],
data: {}
})
//
const changeRecordData = reactive({
changeRecordList: []
})
const detailData = ref({}) //
//
const getFileList = async () => {
detailLoading.value = true
try {
annexData.annexList = await FileApi.getFileList(remarksData.data)
} finally {
detailLoading.value = false
}
}
//
const getAnnexFileList = async (row:id) => {
console.log('getAnnexFileList')
props.annexTable?.forEach(async (item) => {
let requstData = {...remarksData.data,tableName: item?.tableName}
const annexList = await FileApi.getFileList(requstData)
const annexData = annexTableData.value.find(annex=>annex.label === item.label)
if(annexData){
annexData.annexList = annexList
}else{
annexTableData.value.push({
align:item.align,
label: item.label,
tableName: item?.tableName || '',
annexList,
hasSubDetail:item.hasSubDetail||false,
subDetailTableData:item.subDetailTableData
})
if(item?.subDetailTableData){
const { tableObject:subTableObject, tableMethods:subTableMethods } = useTable({
getListApi: item.subDetailTableData.getSubList //
})
const {getList:getSubList} = subTableMethods
subTableObject.params= {}
item.subDetailTableData.queryParams.forEach(queryItem => {
subTableObject.params[queryItem.queryField] = row[queryItem.rowField]
});
await getSubList()
item.subDetailTableData.tableList = subTableObject.tableList
console.log('subTableObject',annexTableData.value)
}
}
})
}
/** 添加附件 */
const handleAnnexSuccess = () => {
getFileList()
getChangeRecordList()
}
//
const deleteAnnexSuccess = async () => {
getFileList()
getChangeRecordList()
}
/** 追加的附件 */
const updateAnnexTableHandle = () => {
getAnnexFileList(detailData.value)
getChangeRecordList()
}
// Tabs
const current = ref(0)
const change = (item, index) => {
current.value = index
emit('changeTabs', item)
if(otherList.find(other=>other.label==item.label)){
// // --
scrollbar.value.scrollTo({ top: 0});
}
}
//
const masterParmas = ref({
masterId: '', //id
number: '', //
status: '' //
})
//
const HeadButttondata = ref()
// -
const buttondata = ref()
/** 表格弹窗 */
const initModel = (schema: FormSchema[], formModel: Recordable) => {
const model: Recordable = { ...formModel }
schema.map((v) => {
// hidden
if (v.hidden) {
delete model[v.field]
} else if (v.component && v.component !== 'Divider') {
const hasField = Reflect.has(model, v.field)
//
model[v.field] = hasField ? model[v.field] : v.value !== void 0 ? v.value : ''
}
})
return model
}
const searchTableRef = ref()
//
const searchTableFormModel = ref<Recordable>({})
if(props.isOpenSearchTable){
searchTableFormModel.value = initModel(props.detailAllSchemas.formSchema, unref(searchTableFormModel))
}
const searchTableFormType = ref('') // create - update -
/** 打开弹窗 */
const formRef = ref()
const titleNameRef = ref()
const titleValueRef = ref()
const count =ref(0)
const openDetail = async (row: any, titleName: any, titleValue: any, tableName: any) => {
titleNameRef.value = titleName
titleValueRef.value = titleValue
remarksData.data = {
tableId: row.masterId||row.id,
tableName: tableName
}
count.value++
//
if (!props.isBasic) {
// id
masterParmas.value.masterId = row.masterId||row.id
masterParmas.value.number = row.number
masterParmas.value.status = row.status
tableObjectRef.value.params = {
masterId: row.masterId||row.id
}
await getList()
}
isShowDrawer.value = true
if (row) {
detailLoading.value = true
try {
detailData.value = row
getRemarkList()
getFileList()
getAnnexFileList(row)
getChangeRecordList()
//
let detailButtonFilter: any = []
let detailButtonAdd: any = []
if (props.detailButtonIsShowFilter) {
//
detailButtonFilter = [
defaultButtons.defaultFilterBtn(null)
]
}
if (props.detailButtonIsShowAdd) {
//
detailButtonAdd = [
defaultButtons.defaultAddBtn({
hide: isShowMainButton(row, ['1'])
})
]
}
HeadButttondata.value = [...detailButtonFilter,...detailButtonAdd]
//
if (routeName.value.indexOf('Job') > -1) {
HeadButttondata.value = [
defaultButtons.defaultFilterBtn(null) //
]
}
HeadButttondata.value = [...HeadButttondata.value,...props.otherHeadButttonData]
let detailButtonEdit: any = []
let detailButtonDelete: any = []
if (props.detailButtonIsShowEdit) {
//
detailButtonEdit = [
defaultButtons.mainListEditBtn({
hide: isShowMainButton(row, ['1'])
})
]
}
if (props.detailButtonIsShowDelete) {
//
detailButtonDelete = [
defaultButtons.mainListDeleteBtn({
hide: isShowMainButton(row, ['1'])
})
]
}
buttondata.value = [...detailButtonEdit,...detailButtonDelete,...props.buttondataTable]
} finally {
detailLoading.value = false
}
}
}
defineExpose({ openDetail, formRef }) // open
//
const getRemarkList = async () => {
detailLoading.value = true
try {
remarksData.remarksList = await RemarkApi.getRemarkPage(remarksData.data)
} finally {
detailLoading.value = false
}
}
//
const remarksSubmitScuess = async (remark) => {
detailLoading.value = false
getRemarkList()
getChangeRecordList()
}
//
const getChangeRecordList = async () => {
changeRecordData.changeRecordList = await RemarkApi.getChangeRecordPage(remarksData.data)
}
const tableObjectRef = ref()
const tableMethodsRef = ref()
const detailAllSchemasRef = ref()
const { tableObject, tableMethods } = useTable({
getListApi: props.apiPage //
})
tableObjectRef.value = tableObject
tableMethodsRef.value = tableMethods
detailAllSchemasRef.value = props.detailAllSchemas
//
const isShowMainButton = (row, val) => {
if (val.indexOf(row.status) > -1) {
return false
} else {
return true
}
}
//
const { getList } = tableMethodsRef.value
//
const buttonBaseClick = (val, item) => {
if (val == 'add') {
//
if(props.isOpenSearchTable){
searchTableFormType.value = 'create'
//
searchTableFormModel.value = Object.assign(unref(searchTableFormModel), {
masterId: masterParmas.value.masterId,
number: masterParmas.value.number
})
const item = props.detailAllSchemas.formSchema[0]
opensearchTable(
item.field, item?.componentProps?.searchField,
item?.componentProps?.searchTitle,
item?.componentProps?.searchAllSchemas,
item?.componentProps?.searchPage,
item?.componentProps?.searchCondition,
item?.componentProps?.multiple,
undefined,undefined
)
}else{
openForm('create')
}
} else if (val == 'import') {
//
handleImport()
} else if (val == 'export') {
//
handleExport()
} else if (val == 'refresh') {
//
getList()
} else if (val == 'filtrate') {
//
} else {
//
console.log('其他按钮', item)
emit('buttonBaseClick',val, item)
}
}
// --> isOpenSearchTable === true
const opensearchTable = (
formField,
searchField,
searchTitle,
searchAllSchemas,
searchPage,
searchCondition,
multiple,
type,
row
) => {
const _searchCondition = {}
//
if (searchCondition && searchCondition.length > 0) {
//
for (var i=0; i< searchCondition.length; i++ ) {
// row
if (searchCondition[i].isMainValue) {
_searchCondition[searchCondition[i].key] = detailData
? detailData.value[searchCondition[i].value]
: ''
}else{
_searchCondition[searchCondition[i].key] = searchCondition[i].value
}
}
}
console.log(searchCondition)
console.log(_searchCondition)
searchTableRef.value.open(
searchTitle,
searchAllSchemas,
searchPage,
formField,
searchField,
multiple,
type,
row,
_searchCondition
)
}
//
// const updataTableColumns = (val) => {
// detailAllSchemas.tableColumns.value = val
// }
// -
const buttonTableClick = async (val, row) => {
if (val == 'edit') {
//
if(props.isOpenSearchTable){
searchTableFormType.value = 'update'
if (row?.id || row?.masterId) {
searchTableFormModel.value = Object.assign(unref(searchTableFormModel), row)
}
const item = props.detailAllSchemas.formSchema[0]
opensearchTable(
item.field, item?.componentProps?.searchField,
item?.componentProps?.searchTitle,
item?.componentProps?.searchAllSchemas,
item?.componentProps?.searchPage,
item?.componentProps?.searchCondition,
item?.componentProps?.multiple,
undefined,undefined
)
}else{
openForm('update', row)
}
} else if (val == 'delete') {
//
handleDelete(row.id)
} else {
emit('tableFormButton',val, row)
}
}
/** 添加/修改操作 */
const openForm = async (type: string, row?: number) => {
formRef.value.open(type, row, masterParmas.value)
emit('detailOpenForm', type, row)
}
// form
const submitForm = async (formType, data) => {
try {
// detailValidate
const rs = (await props.detailValidate) ? await props.detailValidate(data) : true
if (!rs) return
if (formType === 'create') {
await props.apiCreate(data)
message.success(t('common.createSuccess'))
} else {
await props.apiUpdate(data)
message.success(t('common.updateSuccess'))
}
emit('handleMainFefresh')
formRef.value.dialogVisible = false
//
await getList()
updateKey.value += 1
} finally {
formRef.value.formLoading = false
}
}
const searchTableSuccess1 = (formField, searchField, val, formRef) => {
searchTableFormModel.value[formField] = val.map(item=>item[searchField]).join(',')
console.log('searchTableSuccess1',searchTableFormModel)
submitForm(searchTableFormType.value,searchTableFormModel.value)
emit('searchTableSuccessDetail', formField, searchField, val, formRef)
}
//
const searchTableSuccess = (formField, searchField, val, formRef) => {
emit('searchTableSuccessDetail', formField, searchField, val, formRef)
}
//
const emit = defineEmits([
'searchTableSuccessDetail',
'changeTabs',
'selectChangeDetail',
'detailOpenForm',
'tableFormButton',
'openImage',
'onBlur',
'detailBasicFormOnChange',
'formFormDateChange',
'buttonBaseClick'
])
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
try {
//
await message.delConfirm()
tableObject.loading = true
//
await props.apiDelete(id)
tableObject.loading = false
message.success(t('common.delSuccess'))
emit('handleMainFefresh')
//
await getList()
updateKey.value += 1
} catch {}
}
//
const searchFormClick = async (searchData) => {
const { tableObject, tableMethods } = useTable({
getListApi: props.apiPage //
})
tableObject.params = {
isSearch: true,
filters: searchData.filters
? searchData.filters
: [{ column: 'masterId', action: '==', value: masterParmas.value.masterId }]
}
detailAllSchemasRef.value = props.detailAllSchemas
tableObjectRef.value = tableObject
tableMethodsRef.value = tableMethods
tableObjectRef.value.tableList = []
const { getList } = tableMethods
await getList()
updateKey.value += 1
// tableObjectRef.value.params = {
// isSearch: true,
// filters: searchData.filters
// ? searchData.filters
// : [{ column: 'masterId', action: '==', value: masterParmas.value.masterId }]
// }
// getList() //
}
//
const selectChangeDetail = (field, val) => {
emit('selectChangeDetail', field, val)
}
//
const openImage=(item)=>{
emit('openImage', item)
}
/**
* 监听改变事件
* @param field 当前操作字段
* @param cur 改变后值
*/
const detailBasicFormOnChange = (field, cur) => {
emit('detailBasicFormOnChange', field, cur)
}
/**
* 监听失焦事件
* @param field 当前操作字段
* @param e
*/
const onBlur = (field, e) => {
emit('onBlur', field, e)
}
//
const formFormDateChange = (field, val,row, index) => {
emit('formFormDateChange', field, val,row, index)
}
//
watch(
() => props.apiPage,
() => {
const { tableObject, tableMethods } = useTable({
getListApi: props.apiPage //
})
tableObject.params.masterId = masterParmas.value.masterId
detailAllSchemasRef.value = props.detailAllSchemas
if (props.tableObjectExtend) {
props.tableObjectExtend.forEach(item => {
tableObject.params[item.key] = item.value
})
}
tableObjectRef.value = tableObject
tableMethodsRef.value = tableMethods
const { getList } = tableMethods
getList()
}
)
</script>
<style lang="scss">
.el-drawer__body {
background: #f5f5f5 !important;
}
::v-deep(.label-class-name) {
color: #dedede;
}
</style>
<style scoped lang="scss"></style>

3
src/views/mes/dismantlingMain/index.vue

@ -53,6 +53,7 @@
<!-- 详情 -->
<Detail ref="detailRef"
:isBasic="false"
:isBasicMes="true"
:allSchemas="DismantlingMain.allSchemas"
:detailAllSchemas="DismantlingDetail.allSchemas"
:detailAllSchemasRules="DismantlingDetailRules"
@ -80,7 +81,7 @@ import * as DismantlingDetailApi from '@/api/mes/dismantlingDetail'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import TableHead from '@/components/TableHead/src/TableHead.vue'
import ImportForm from '@/components/ImportForm/src/ImportForm.vue'
import Detail from '@/components/Detail/src/Detail.vue'
import Detail from '../components/Detail.vue'
defineOptions({ name: 'MesDismantlingMain' })

109
src/views/mes/holiday/holiday.data.ts

@ -0,0 +1,109 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime'
// 表单校验
export const HolidayRules = reactive({
})
export const Holiday = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '主键',
field: 'id',
sort: 'custom',
isForm: false,
},
{
label: 'KEY',
field: 'keyDate',
sort: 'custom',
isSearch: false,
isTable:false,
isForm:false
},
{
label: '节日名称',
field: 'holidayName',
sort: 'custom',
isSearch: true,
},
{
label: '节日类型;',
field: 'holidayType',
sort: 'custom',
isSearch: true,
dictType: DICT_TYPE.HOLIDAY_TYPE,
dictClass: 'string',
form: {
component: 'Select',
value: '1',
},
},
{
label: '节日年份',
field: 'holidayYear',
sort: 'custom',
isSearch: true,
isForm:false,
isTable:true,
form: {
component: 'InputNumber',
value: '2023',
},
},
{
label: '节日日期',
field: 'holidayDate',
sort: 'custom',
formatter: dateFormatter,
isSearch: true,
search: {
component: 'DatePicker',
componentProps: {
type: 'date',
valueFormat: 'YYYY-MM-DD',
}
},
form: {
component: 'DatePicker',
componentProps: {
type: 'date',
valueFormat: 'x'
}
},
},
{
label: '状态',
field: 'status',
sort: 'custom',
dictType: DICT_TYPE.QUALIFY_STATUS,
dictClass: 'string',
isForm: true,
isSearch: false,
isTable: true,
form: {
component: 'Switch',
value: '1',
componentProps: {
inactiveValue: '2',
activeValue: '1'
}
},
},
{
label: '备注',
field: 'remark',
sort: 'custom',
isSearch: false,
},
{
label: '操作',
field: 'action',
isForm: false,
table: {
width: 150,
fixed: 'right'
}
}
]))

226
src/views/mes/holiday/index.vue

@ -0,0 +1,226 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="Holiday.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
</ContentWrap>
<!-- 列表头部 -->
<TableHead
:HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick"
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="Holiday.allSchemas"
/>
<!-- 列表 -->
<ContentWrap>
<Table
:columns="tableColumns"
:data="tableObject.tableList"
:loading="tableObject.loading"
:pagination="{
total: tableObject.total
}"
v-model:pageSize="tableObject.pageSize"
v-model:currentPage="tableObject.currentPage"
v-model:sort="tableObject.sort"
>
<template #holidayName="{row}">
<el-button type="primary" link @click="openDetail(row, row.holidayName, row.holidayName)">
<span>{{ row.holidayName }}</span>
</el-button>
</template>
<template #action="{ row }">
<ButtonBase :Butttondata="butttondata" @button-base-click="buttonTableClick($event,row)" />
</template>
</Table>
</ContentWrap>
<!-- 表单弹窗添加/修改 -->
<BasicForm
ref="basicFormRef"
@success="formsSuccess"
:rules="HolidayRules"
:formAllSchemas="Holiday.allSchemas"
:apiUpdate="HolidayApi.updateHoliday"
:apiCreate="HolidayApi.createHoliday"
@searchTableSuccess="searchTableSuccess"
:isBusiness="false"
/>
<!-- 详情 -->
<Detail ref="detailRef" :isBasic="false" :is-basic-mes="true" :allSchemas="Holiday.allSchemas" :api-page="HolidayApi.getHolidayPage" :detailAllSchemas="Holiday.allSchemas"/>
<!-- 导入 -->
<ImportForm ref="importFormRef" url="/mes/holiday/import" :importTemplateData="importTemplateData" @success="importSuccess" />
</template>
<script setup lang="ts">
import download from '@/utils/download'
import { Holiday,HolidayRules } from './holiday.data'
import * as HolidayApi from '@/api/mes/holiday'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
// import TableHead from '@/components/TableHead/src/TableHead.vue'
// import ImportForm from '@/components/ImportForm/src/ImportForm.vue'
import Detail from '../../mes/components/Detail.vue'
defineOptions({ name: 'Holiday' })
const message = useMessage() //
const { t } = useI18n() //
const route = useRoute() //
const routeName = ref()
routeName.value = route.name
const tableColumns = ref(Holiday.allSchemas.tableColumns)
//
const searchTableSuccess = (formField, searchField, val, formRef) => {
nextTick(() => {
const setV = {}
setV[formField] = val[0][searchField]
formRef.setValues(setV)
})
}
//
const updataTableColumns = (val) => {
tableColumns.value = val
}
const { tableObject, tableMethods } = useTable({
getListApi: HolidayApi.getHolidayPage //
})
//
const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultAddBtn({hasPermi:'mes:holiday:create'}), //
defaultButtons.defaultImportBtn({hasPermi:'mes:holiday:import'}), //
defaultButtons.defaultExportBtn({hasPermi:'mes:holiday:export'}), //
defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), //
]
//
const buttonBaseClick = (val, item) => {
if (val == 'add') { //
openForm('create')
} else if (val == 'import') { //
handleImport()
} else if (val == 'export') { //
handleExport()
} else if (val == 'refresh') { //
getList()
} else if (val == 'filtrate') { //
} else { //
console.log('其他按钮', item)
}
}
// -
const butttondata = [
defaultButtons.mainListEditBtn({hasPermi:'mes:holiday:update'}), //
defaultButtons.mainListDeleteBtn({hasPermi:'mes:holiday:delete'}), //
]
// -
const buttonTableClick = async (val, row) => {
if (val == 'edit') { //
openForm('update', row)
} else if (val == 'delete') { //
handleDelete(row.id)
}
}
/** 添加/修改操作 */
const basicFormRef = ref()
const openForm = (type: string, row?: any) => {
basicFormRef.value.open(type, row)
}
// form
const formsSuccess = async (formType,data) => {
if (formType === 'create') {
await HolidayApi.createHoliday(data)
message.success(t('common.createSuccess'))
} else {
await HolidayApi.updateHoliday(data)
message.success(t('common.updateSuccess'))
}
basicFormRef.value.dialogVisible = false
getList()
}
/** 详情操作 */
const detailRef = ref()
const openDetail = (row: any, titleName: any, titleValue: any) => {
detailRef.value.openDetail(row, titleName, titleValue, 'basicHoliday')
}
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
try {
//
await message.delConfirm()
//
await HolidayApi.deleteHoliday(id)
message.success(t('common.delSuccess'))
//
await getList()
} catch {}
}
/** 导出按钮操作 */
const exportLoading = ref(false) //
const handleExport = async () => {
try {
//
await message.exportConfirm()
//
exportLoading.value = true
const data = await HolidayApi.exportHoliday(tableObject.params)
download.excel(data, '节假日设置.xlsx')
} catch {
} finally {
exportLoading.value = false
}
}
/** 导入 */
const importFormRef = ref()
const handleImport = () => {
importFormRef.value.open()
}
//
const importTemplateData = reactive({
templateUrl: '',
templateTitle: '节假日设置导入模版.xlsx'
})
//
const importSuccess = () => {
getList()
}
//
const searchFormClick = (searchData) => {
tableObject.params = {
isSearch: true,
filters: searchData.filters
}
getList() //
}
/** 初始化 **/
onMounted(async () => {
getList()
importTemplateData.templateUrl = await HolidayApi.importTemplate()
})
</script>

5
src/views/mes/hrPersonAbility/index.vue

@ -51,7 +51,8 @@
/>
<!-- 详情 -->
<Detail ref="detailRef" :isBasic="true" :allSchemas="HrPersonAbility.allSchemas" />
<Detail ref="detailRef" :isBasic="false" :isBasicMes="true" :allSchemas="HrPersonAbility.allSchemas" :detailAllSchemas="HrPersonAbility.allSchemas"
:apiPage="HrPersonAbilityApi.getHrPersonAbilityPage"/>
<!-- 导入 -->
<ImportForm ref="importFormRef" url="/mes/hr-person-ability/import" :importTemplateData="importTemplateData" @success="importSuccess" />
@ -64,7 +65,7 @@ import * as HrPersonAbilityApi from '@/api/mes/hrPersonAbility'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import TableHead from '@/components/TableHead/src/TableHead.vue'
import ImportForm from '@/components/ImportForm/src/ImportForm.vue'
import Detail from '@/components/Detail/src/Detail.vue'
import Detail from '../components/Detail.vue'
defineOptions({ name: 'HrPersonAbility' })

16
src/views/mes/item/index.vue

@ -167,9 +167,7 @@ const openForm = (type: string, row?: any) => {
if (item.field == 'dataStandvalue') {
item.componentProps.disabled = false
}
if (item.field == 'status') {
item.componentProps.disabled = true
}
}
if(row.dataType == 'SWITCH'){
if (item.field == 'dataVerify') {
@ -178,9 +176,7 @@ const openForm = (type: string, row?: any) => {
if (item.field == 'dataStandvalue') {
item.componentProps.disabled = true
}
if (item.field == 'status') {
item.componentProps.disabled = false
}
}
if(row.dataType == 'TEXT'){
if (item.field == 'dataVerify') {
@ -189,9 +185,7 @@ const openForm = (type: string, row?: any) => {
if (item.field == 'dataStandvalue') {
item.componentProps.disabled = true
}
if (item.field == 'status') {
item.componentProps.disabled = true
}
}
})
}else{
@ -208,9 +202,7 @@ const openForm = (type: string, row?: any) => {
if (item.field == 'dataStandvalue') {
item.componentProps.disabled = false
}
if (item.field == 'status') {
item.componentProps.disabled = false
}
})
}
basicFormRef.value.open(type, row)

Some files were not shown because too many files changed in this diff

Loading…
Cancel
Save