Browse Source

Merge branch 'master_hella' of http://dev.ccwin-in.com:3000/sfms3.0/sfms3.0-ui into master_hella

master_hella_20240701
ljlong_2630 8 months ago
parent
commit
f7c760f450
  1. 56
      src/api/mes/abilityInfo/index.ts
  2. 58
      src/api/mes/hrPersonAbility/index.ts
  3. 61
      src/api/mes/item/index.ts
  4. 55
      src/api/mes/opersteps/index.ts
  5. 57
      src/api/mes/operstepsType/index.ts
  6. 102
      src/api/mes/orderDay/index.ts
  7. 55
      src/api/mes/qualityclass/index.ts
  8. 55
      src/api/mes/qualityform/index.ts
  9. 61
      src/api/mes/qualityformdetail/index.ts
  10. 58
      src/api/mes/qualityformlog/index.ts
  11. 55
      src/api/mes/qualitygroup/index.ts
  12. 60
      src/api/mes/reworkSingle/index.ts
  13. 103
      src/api/qms/aql/index.ts
  14. 65
      src/api/qms/inspectionJob/inspectionJobDetail/index.ts
  15. 65
      src/api/qms/inspectionJob/inspectionJobMain/index.ts
  16. 53
      src/api/qms/inspectionMethod/index.ts
  17. 65
      src/api/qms/inspectionRequest/index.ts
  18. 8
      src/api/qms/inspectionTemplate/index.ts
  19. 57
      src/api/qms/sampleCode/index.ts
  20. 50
      src/api/qms/samplingScheme/index.ts
  21. 56
      src/components/Detail/src/Detail.vue
  22. 19
      src/utils/dict.ts
  23. 172
      src/views/mes/abilityInfo/abilityInfo.data.ts
  24. 244
      src/views/mes/abilityInfo/index.vue
  25. 210
      src/views/mes/hrPersonAbility/hrPersonAbility.data.ts
  26. 257
      src/views/mes/hrPersonAbility/index.vue
  27. 353
      src/views/mes/item/index.vue
  28. 203
      src/views/mes/item/item.data.ts
  29. 244
      src/views/mes/opersteps/index.vue
  30. 165
      src/views/mes/opersteps/opersteps.data.ts
  31. 244
      src/views/mes/operstepsType/index.vue
  32. 167
      src/views/mes/operstepsType/operstepsType.data.ts
  33. 459
      src/views/mes/orderDay/components/BasicFormV2.vue
  34. 237
      src/views/mes/orderDay/components/orderDetail.vue
  35. 332
      src/views/mes/orderDay/components/schedule.vue
  36. 331
      src/views/mes/orderDay/index.vue
  37. 327
      src/views/mes/orderDay/orderDay.data.ts
  38. 102
      src/views/mes/processroute/components/configDialog.vue
  39. 8
      src/views/mes/processroute/components/graphbase.data.ts
  40. 245
      src/views/mes/qualityclass/index.vue
  41. 152
      src/views/mes/qualityclass/qualityclass.data.ts
  42. 297
      src/views/mes/qualityform/index.vue
  43. 316
      src/views/mes/qualityform/qualityform.data.ts
  44. 244
      src/views/mes/qualityformlog/index.vue
  45. 197
      src/views/mes/qualityformlog/qualityformlog.data.ts
  46. 244
      src/views/mes/qualitygroup/index.vue
  47. 151
      src/views/mes/qualitygroup/qualitygroup.data.ts
  48. 258
      src/views/mes/reworkSingle/index.vue
  49. 219
      src/views/mes/reworkSingle/reworkSingle.data.ts
  50. 18
      src/views/mes/workstation/components/Detail.vue
  51. 44
      src/views/mes/workstation/index.vue
  52. 17
      src/views/mes/workstation/workstation.data.ts
  53. 332
      src/views/qms/aql/aql.data.ts
  54. 244
      src/views/qms/aql/index.vue
  55. 304
      src/views/qms/basicDataManage/inspectionTemplate/addForm.vue
  56. 330
      src/views/qms/basicDataManage/inspectionTemplate/agvLocationrelation.data.ts
  57. 32
      src/views/qms/basicDataManage/inspectionTemplate/index.vue
  58. 289
      src/views/qms/inspection/inspectionJob/index.vue
  59. 329
      src/views/qms/inspection/inspectionJob/inspectionJobMain.data.ts
  60. 244
      src/views/qms/inspection/inspectionRequest/index.vue
  61. 239
      src/views/qms/inspection/inspectionRequest/inspectionMain.data.ts
  62. 244
      src/views/qms/inspectionMethod/index.vue
  63. 75
      src/views/qms/inspectionMethod/inspectionMethod.data.ts
  64. 244
      src/views/qms/sampleCode/index.vue
  65. 101
      src/views/qms/sampleCode/sampleCode.data.ts
  66. 3
      src/views/qms/samplingProcess/index.vue
  67. 244
      src/views/qms/samplingScheme/index.vue
  68. 61
      src/views/qms/samplingScheme/samplingScheme.data.ts
  69. 36
      src/views/wms/basicDataManage/itemManage/itemwarehouse/itemwarehouse.data.ts
  70. 2
      src/views/wms/buttMesManage/mesBarCode/mesBarCode.data.ts
  71. 10
      src/views/wms/deliversettlementManage/deliver/deliverJobMain/deliverJobMain.data.ts
  72. 5
      src/views/wms/productionManage/productredress/productredressJobMain/index.vue
  73. 4
      src/views/wms/productionManage/productredress/productredressJobMain/productredressJobMain.data.ts
  74. 133
      src/views/wms/productionManage/productredress/productredressRecordMain/index.vue
  75. 555
      src/views/wms/productionManage/productredress/productredressRecordMain/productredressRecordMain.data.ts
  76. 5
      src/views/wms/productionManage/productredress/productredressRequestMain/productredressRequestMain.data.ts

56
src/api/mes/abilityInfo/index.ts

@ -0,0 +1,56 @@
import request from '@/config/axios'
export interface AbilityInfoVO {
deleteTime: Date
id: number
status: string
concurrencyStamp: number
remark: string
deleter: string
siteId: number
ablityCode: string
ablityName: string
trainMinHours: number
operMinHours: number
}
// 查询能力矩阵信息列表
export const getAbilityInfoPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/mes/ability-info/senior', data })
} else {
return await request.get({ url: `/mes/ability-info/page`, params })
}
}
// 查询能力矩阵信息详情
export const getAbilityInfo = async (id: number) => {
return await request.get({ url: `/mes/ability-info/get?id=` + id })
}
// 新增能力矩阵信息
export const createAbilityInfo = async (data: AbilityInfoVO) => {
return await request.post({ url: `/mes/ability-info/create`, data })
}
// 修改能力矩阵信息
export const updateAbilityInfo = async (data: AbilityInfoVO) => {
return await request.put({ url: `/mes/ability-info/update`, data })
}
// 删除能力矩阵信息
export const deleteAbilityInfo = async (id: number) => {
return await request.delete({ url: `/mes/ability-info/delete?id=` + id })
}
// 导出能力矩阵信息 Excel
export const exportAbilityInfo = async (params) => {
return await request.download({ url: `/mes/ability-info/export-excel`, params })
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/mes/ability-info/get-import-template' })
}

58
src/api/mes/hrPersonAbility/index.ts

@ -0,0 +1,58 @@
import request from '@/config/axios'
export interface HrPersonAbilityVO {
deleteTime: Date
id: number
status: string
concurrencyStamp: number
remark: string
deleter: string
siteId: number
personId: number
personCode: string
ablityCode: string
ablityLevel: number
studyDuration: number
workDuration: number
}
// 查询人员能力矩阵配置列表
export const getHrPersonAbilityPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/mes/hr-person-ability/senior', data })
} else {
return await request.get({ url: `/mes/hr-person-ability/page`, params })
}
}
// 查询人员能力矩阵配置详情
export const getHrPersonAbility = async (id: number) => {
return await request.get({ url: `/mes/hr-person-ability/get?id=` + id })
}
// 新增人员能力矩阵配置
export const createHrPersonAbility = async (data: HrPersonAbilityVO) => {
return await request.post({ url: `/mes/hr-person-ability/create`, data })
}
// 修改人员能力矩阵配置
export const updateHrPersonAbility = async (data: HrPersonAbilityVO) => {
return await request.put({ url: `/mes/hr-person-ability/update`, data })
}
// 删除人员能力矩阵配置
export const deleteHrPersonAbility = async (id: number) => {
return await request.delete({ url: `/mes/hr-person-ability/delete?id=` + id })
}
// 导出人员能力矩阵配置 Excel
export const exportHrPersonAbility = async (params) => {
return await request.download({ url: `/mes/hr-person-ability/export-excel`, params })
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/mes/hr-person-ability/get-import-template' })
}

61
src/api/mes/item/index.ts

@ -0,0 +1,61 @@
import request from '@/config/axios'
export interface ItemVO {
deleteTime: Date
id: number
status: string
concurrencyStamp: number
remark: string
deleter: string
siteId: number
itemCode: string
itemName: string
itemType: string
qmsClass: string
dataType: string
dataVerify: string
dataStandvalue: string
dataDescripe: string
}
// 查询质检项目定义列表
export const getItemPage = async (params) => {
console.log(params);
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/mes/item/senior', data })
} else {
return await request.get({ url: `/mes/item/page`, params })
}
}
// 查询质检项目定义详情
export const getItem = async (id: number) => {
return await request.get({ url: `/mes/item/get?id=` + id })
}
// 新增质检项目定义
export const createItem = async (data: ItemVO) => {
return await request.post({ url: `/mes/item/create`, data })
}
// 修改质检项目定义
export const updateItem = async (data: ItemVO) => {
return await request.put({ url: `/mes/item/update`, data })
}
// 删除质检项目定义
export const deleteItem = async (id: number) => {
return await request.delete({ url: `/mes/item/delete?id=` + id })
}
// 导出质检项目定义 Excel
export const exportItem = async (params) => {
return await request.download({ url: `/mes/item/export-excel`, params })
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/mes/item/get-import-template' })
}

55
src/api/mes/opersteps/index.ts

@ -0,0 +1,55 @@
import request from '@/config/axios'
export interface OperstepsVO {
deleteTime: Date
id: number
status: string
concurrencyStamp: number
remark: string
deleter: string
siteId: number
stepsCode: string
stepsName: string
collectCode: string
}
// 查询MES操作步骤信息列表
export const getOperstepsPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/mes/opersteps/senior', data })
} else {
return await request.get({ url: `/mes/opersteps/page`, params })
}
}
// 查询MES操作步骤信息详情
export const getOpersteps = async (id: number) => {
return await request.get({ url: `/mes/opersteps/get?id=` + id })
}
// 新增MES操作步骤信息
export const createOpersteps = async (data: OperstepsVO) => {
return await request.post({ url: `/mes/opersteps/create`, data })
}
// 修改MES操作步骤信息
export const updateOpersteps = async (data: OperstepsVO) => {
return await request.put({ url: `/mes/opersteps/update`, data })
}
// 删除MES操作步骤信息
export const deleteOpersteps = async (id: number) => {
return await request.delete({ url: `/mes/opersteps/delete?id=` + id })
}
// 导出MES操作步骤信息 Excel
export const exportOpersteps = async (params) => {
return await request.download({ url: `/mes/opersteps/export-excel`, params })
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/mes/opersteps/get-import-template' })
}

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

@ -0,0 +1,57 @@
import request from '@/config/axios'
export interface OperstepsTypeVO {
collectCode: string
collectName: string
collectType: string
adpaterClass: string
argLsit: string
deleteTime: Date
id: number
status: string
concurrencyStamp: number
remark: string
deleter: string
siteId: number
}
// 查询操作步骤类型配置列表
export const getOperstepsTypePage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/mes/opersteps-type/senior', data })
} else {
return await request.get({ url: `/mes/opersteps-type/page`, params })
}
}
// 查询操作步骤类型配置详情
export const getOperstepsType = async (id: number) => {
return await request.get({ url: `/mes/opersteps-type/get?id=` + id })
}
// 新增操作步骤类型配置
export const createOperstepsType = async (data: OperstepsTypeVO) => {
return await request.post({ url: `/mes/opersteps-type/create`, data })
}
// 修改操作步骤类型配置
export const updateOperstepsType = async (data: OperstepsTypeVO) => {
return await request.put({ url: `/mes/opersteps-type/update`, data })
}
// 删除操作步骤类型配置
export const deleteOperstepsType = async (id: number) => {
return await request.delete({ url: `/mes/opersteps-type/delete?id=` + id })
}
// 导出操作步骤类型配置 Excel
export const exportOperstepsType = async (params) => {
return await request.download({ url: `/mes/opersteps-type/export-excel`, params })
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/mes/opersteps-type/get-import-template' })
}

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

@ -0,0 +1,102 @@
import request from '@/config/axios'
export interface OrderDayVO {
status: string
remark: string
planNoMonth: string
planNoDay: string
productCode: string
workroomCode: string
lineCode: string
planCount: number
processrouteCode: string
tempProcessroute: string
standardBom: string
tempBom: string
workMode: string
planDate: Date
startTime: Date
endTime: Date
taskMode: string
}
// 查询生产日计划列表
export const getOrderDayPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/mes/orderday/senior', data })
} else {
return await request.get({ url: `/mes/orderday/page`, params })
}
}
// 查询生产日计划详情
export const getOrderDay = async (id: number) => {
return await request.get({ url: `/mes/orderday/get?id=` + id })
}
// 新增生产日计划
export const createOrderDay = async (data: OrderDayVO) => {
return await request.post({ url: `/mes/orderday/create`, data })
}
// 修改生产日计划
export const updateOrderDay = async (data: OrderDayVO) => {
return await request.put({ url: `/mes/orderday/update`, data })
}
// 删除生产日计划
export const deleteOrderDay = async (id: number) => {
return await request.delete({ url: `/mes/orderday/delete?id=` + id })
}
// 导出生产日计划 Excel
export const exportOrderDay = async (params) => {
return await request.download({ url: `/mes/orderday/export-excel`, params })
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/mes/orderday/get-import-template' })
}
// 根据产品编码获取Bom
export const getBoms = async (code: String) => {
return request.get({ url: '/mes/common/geBomByProductCode?code='+code })
}
// 根据产品编码获取工艺路线
export const getProcessroutes = async (code: String) => {
return request.get({ url: '/mes/common/getProcessRouteByProductCode?code='+code })
}
// 根据车间编码获取产线列表
export const getProductlines = async (code: String) => {
return request.get({ url: '/mes/common/getLinesByWorkRoomCode?code='+code })
}
// 获取产线信息
export const getProductlineInfo = async (code: String) => {
return request.get({ url: '/mes/common/getLinesByWorkRoomCode?code='+code })
}
// 根据工艺路线的工序信息
export const getProcessroutesDetail = async (code) => {
return await request.get({ url: `/mes/orderday/getProcessInfo?code=`+ code })
}
// 根据获取计划BOM信息
export const getPlanBom = async (params) => {
return await request.get({ url: `/mes/orderday/getBomInfo`,params })
}
// 根据计划的车间、产线、计划时间 查询已经配置的人员
export const getPlanWorks = async (params) => {
return await request.get({ url: `/mes/orderday/getWorkGroup`,params })
}
// 根据车间、产线 查询已配置的设备
export const getPlanDevices = async (params) => {
return await request.get({ url: `/mes/orderday/getDeviceInfo`,params })
}
///发布计划
export const publishPlan = async (params) => {
return await request.post({ url: `/mes/orderday/publishPlan`,params })
}
//终止计划
export const stopPlan = async (params) => {
return await request.post({ url: `/mes/orderday/stopPlan`,params })
}

55
src/api/mes/qualityclass/index.ts

@ -0,0 +1,55 @@
import request from '@/config/axios'
export interface QualityclassVO {
deleteTime: Date
id: number
status: string
concurrencyStamp: number
remark: string
deleter: string
siteId: number
code: string
name: string
groupCode: string
}
// 查询质检类别列表
export const getQualityclassPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/mes/qualityclass/senior', data })
} else {
return await request.get({ url: `/mes/qualityclass/page`, params })
}
}
// 查询质检类别详情
export const getQualityclass = async (id: number) => {
return await request.get({ url: `/mes/qualityclass/get?id=` + id })
}
// 新增质检类别
export const createQualityclass = async (data: QualityclassVO) => {
return await request.post({ url: `/mes/qualityclass/create`, data })
}
// 修改质检类别
export const updateQualityclass = async (data: QualityclassVO) => {
return await request.put({ url: `/mes/qualityclass/update`, data })
}
// 删除质检类别
export const deleteQualityclass = async (id: number) => {
return await request.delete({ url: `/mes/qualityclass/delete?id=` + id })
}
// 导出质检类别 Excel
export const exportQualityclass = async (params) => {
return await request.download({ url: `/mes/qualityclass/export-excel`, params })
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/mes/qualityclass/get-import-template' })
}

55
src/api/mes/qualityform/index.ts

@ -0,0 +1,55 @@
import request from '@/config/axios'
export interface QualityformVO {
deleteTime: Date
id: number
status: string
concurrencyStamp: number
remark: string
deleter: string
siteId: number
formNo: string
formName: string
formType: string
}
// 查询质检表单列表
export const getQualityformPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/mes/qualityform/senior', data })
} else {
return await request.get({ url: `/mes/qualityform/page`, params })
}
}
// 查询质检表单详情
export const getQualityform = async (id: number) => {
return await request.get({ url: `/mes/qualityform/get?id=` + id })
}
// 新增质检表单
export const createQualityform = async (data: QualityformVO) => {
return await request.post({ url: `/mes/qualityform/create`, data })
}
// 修改质检表单
export const updateQualityform = async (data: QualityformVO) => {
return await request.put({ url: `/mes/qualityform/update`, data })
}
// 删除质检表单
export const deleteQualityform = async (id: number) => {
return await request.delete({ url: `/mes/qualityform/delete?id=` + id })
}
// 导出质检表单 Excel
export const exportQualityform = async (params) => {
return await request.download({ url: `/mes/qualityform/export-excel`, params })
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/mes/qualityform/get-import-template' })
}

61
src/api/mes/qualityformdetail/index.ts

@ -0,0 +1,61 @@
import request from '@/config/axios'
export interface QualityformdetailVO {
deleteTime: Date
id: number
status: string
concurrencyStamp: number
remark: string
deleter: string
siteId: number
formNo: string
itemCode: string
itemName: string
itemType: string
qmsClass: string
dataType: string
dataVerify: string
dataStandvalue: string
dataDescripe: string
}
// 查询质检表单子表列表
export const getQualityformdetailPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/mes/qualityformdetail/senior', data })
} else {
return await request.get({ url: `/mes/qualityformdetail/page`, params })
}
}
// 查询质检表单子表详情
export const getQualityformdetail = async (id: number) => {
return await request.get({ url: `/mes/qualityformdetail/get?id=` + id })
}
// 新增质检表单子表
export const createQualityformdetail = async (data: QualityformdetailVO) => {
return await request.post({ url: `/mes/qualityformdetail/create`, data })
}
// 修改质检表单子表
export const updateQualityformdetail = async (data: QualityformdetailVO) => {
return await request.put({ url: `/mes/qualityformdetail/update`, data })
}
// 删除质检表单子表
export const deleteQualityformdetail = async (id: number) => {
return await request.delete({ url: `/mes/qualityformdetail/delete?id=` + id })
}
// 导出质检表单子表 Excel
export const exportQualityformdetail = async (params) => {
return await request.download({ url: `/mes/qualityformdetail/export-excel`, params })
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/mes/qualityformdetail/get-import-template' })
}

58
src/api/mes/qualityformlog/index.ts

@ -0,0 +1,58 @@
import request from '@/config/axios'
export interface QualityformlogVO {
deleteTime: Date
id: number
status: string
concurrencyStamp: number
remark: string
deleter: string
siteId: number
masterId: number
formNo: string
operation: string
operator: string
operateContent: string
operateTime: Date
}
// 查询质检表单日志列表
export const getQualityformlogPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/mes/qualityformlog/senior', data })
} else {
return await request.get({ url: `/mes/qualityformlog/page`, params })
}
}
// 查询质检表单日志详情
export const getQualityformlog = async (id: number) => {
return await request.get({ url: `/mes/qualityformlog/get?id=` + id })
}
// 新增质检表单日志
export const createQualityformlog = async (data: QualityformlogVO) => {
return await request.post({ url: `/mes/qualityformlog/create`, data })
}
// 修改质检表单日志
export const updateQualityformlog = async (data: QualityformlogVO) => {
return await request.put({ url: `/mes/qualityformlog/update`, data })
}
// 删除质检表单日志
export const deleteQualityformlog = async (id: number) => {
return await request.delete({ url: `/mes/qualityformlog/delete?id=` + id })
}
// 导出质检表单日志 Excel
export const exportQualityformlog = async (params) => {
return await request.download({ url: `/mes/qualityformlog/export-excel`, params })
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/mes/qualityformlog/get-import-template' })
}

55
src/api/mes/qualitygroup/index.ts

@ -0,0 +1,55 @@
import request from '@/config/axios'
export interface QualitygroupVO {
deleteTime: Date
id: number
status: string
concurrencyStamp: number
remark: string
deleter: string
siteId: number
code: string
name: string
groupCode: string
}
// 查询质检分组列表
export const getQualitygroupPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/mes/qualitygroup/senior', data })
} else {
return await request.get({ url: `/mes/qualitygroup/page`, params })
}
}
// 查询质检分组详情
export const getQualitygroup = async (id: number) => {
return await request.get({ url: `/mes/qualitygroup/get?id=` + id })
}
// 新增质检分组
export const createQualitygroup = async (data: QualitygroupVO) => {
return await request.post({ url: `/mes/qualitygroup/create`, data })
}
// 修改质检分组
export const updateQualitygroup = async (data: QualitygroupVO) => {
return await request.put({ url: `/mes/qualitygroup/update`, data })
}
// 删除质检分组
export const deleteQualitygroup = async (id: number) => {
return await request.delete({ url: `/mes/qualitygroup/delete?id=` + id })
}
// 导出质检分组 Excel
export const exportQualitygroup = async (params) => {
return await request.download({ url: `/mes/qualitygroup/export-excel`, params })
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/mes/qualitygroup/get-import-template' })
}

60
src/api/mes/reworkSingle/index.ts

@ -0,0 +1,60 @@
import request from '@/config/axios'
export interface ReworkSingleVO {
deleteTime: Date
id: number
status: string
concurrencyStamp: number
remark: string
deleter: string
siteId: number
reworkType: string
productionCode: string
reworkAction: string
replaceFlag: string
reworkPersoncode: string
reworkTime: Date
reworkResult: string
reworkbillNo: string
}
// 查询返工登记单件列表
export const getReworkSinglePage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/mes/rework-single/senior', data })
} else {
return await request.get({ url: `/mes/rework-single/page`, params })
}
}
// 查询返工登记单件详情
export const getReworkSingle = async (id: number) => {
return await request.get({ url: `/mes/rework-single/get?id=` + id })
}
// 新增返工登记单件
export const createReworkSingle = async (data: ReworkSingleVO) => {
return await request.post({ url: `/mes/rework-single/create`, data })
}
// 修改返工登记单件
export const updateReworkSingle = async (data: ReworkSingleVO) => {
return await request.put({ url: `/mes/rework-single/update`, data })
}
// 删除返工登记单件
export const deleteReworkSingle = async (id: number) => {
return await request.delete({ url: `/mes/rework-single/delete?id=` + id })
}
// 导出返工登记单件 Excel
export const exportReworkSingle = async (params) => {
return await request.download({ url: `/mes/rework-single/export-excel`, params })
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/mes/rework-single/get-import-template' })
}

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

@ -0,0 +1,103 @@
import request from '@/config/axios'
export interface AqlVO {
id: number
sampleProgCode: string
inspectionQualification: string
sampleCharacterCode: string
sampleSize: number
a0010: number
r0010: number
a0015: number
r0015: number
a0025: number
r0025: number
a0040: number
r0040: number
a0065: number
r0065: number
a010: number
r010: number
a015: number
r015: number
a025: number
r025: number
a040: number
r040: number
a065: number
r065: number
a10: number
r10: number
a15: number
r15: number
a25: number
r25: number
a40: number
r40: number
a65: number
r65: number
a10: number
r10: number
a15: number
r15: number
a25: number
r25: number
a40: number
r40: number
a65: number
r65: number
a100: number
r100: number
a150: number
r150: number
a250: number
r250: number
a400: number
r400: number
a650: number
r650: number
a1000: number
r1000: number
available: string
}
// 查询aql列表
export const getAqlPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/qms/aql/senior', data })
} else {
return await request.get({ url: `/qms/aql/page`, params })
}
}
// 查询aql详情
export const getAql = async (id: number) => {
return await request.get({ url: `/qms/aql/get?id=` + id })
}
// 新增aql
export const createAql = async (data: AqlVO) => {
return await request.post({ url: `/qms/aql/create`, data })
}
// 修改aql
export const updateAql = async (data: AqlVO) => {
return await request.put({ url: `/qms/aql/update`, data })
}
// 删除aql
export const deleteAql = async (id: number) => {
return await request.delete({ url: `/qms/aql/delete?id=` + id })
}
// 导出aql Excel
export const exportAql = async (params) => {
return await request.download({ url: `/qms/aql/export-excel`, params })
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/qms/aql/get-import-template' })
}

65
src/api/qms/inspectionJob/inspectionJobDetail/index.ts

@ -0,0 +1,65 @@
import request from '@/config/axios'
export interface InspectionJobDetailVO {
number: string
applicationDate: localdate
applicationTime: Date
requestStartTime: Date
requestEndTime: Date
finishTime: Date
supplierCode: string
materialCode: 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
}
// 查询检验申请列表
export const getInspectionJobDetailPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/inspection/inspection-job-detail/senior', data })
} else {
return await request.get({ url: `/inspection/inspection-job-detail/page`, params })
}
}
// 查询检验申请详情
export const getInspectionJobDetail = async (id: number) => {
return await request.get({ url: `/inspection/inspection-job-detail/get?id=` + id })
}
// 新增检验申请
export const createInspectionJobDetail = async (data: InspectionJobDetailVO) => {
return await request.post({ url: `/inspection/inspection-job-detail/create`, data })
}
// 修改检验申请
export const updateInspectionJobDetail = async (data: InspectionJobDetailVO) => {
return await request.put({ url: `/inspection/inspection-job-detail/update`, data })
}
// 删除检验申请
export const deleteInspectionJobDetail = async (id: number) => {
return await request.delete({ url: `/inspection/inspection-job-detail/delete?id=` + id })
}
// 导出检验申请 Excel
export const exportInspectionJobDetail = async (params) => {
return await request.download({ url: `/inspection/inspection-job-detail/export-excel`, params })
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/inspection/inspection-job-detail/get-import-template' })
}

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

@ -0,0 +1,65 @@
import request from '@/config/axios'
export interface InspectionJobMainVO {
number: string
applicationDate: localdate
applicationTime: Date
requestStartTime: Date
requestEndTime: Date
finishTime: Date
supplierCode: string
materialCode: 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
}
// 查询检验申请列表
export const getInspectionJobMainPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/inspection/inspection-job-main/senior', data })
} else {
return await request.get({ url: `/inspection/inspection-job-main/page`, params })
}
}
// 查询检验申请详情
export const getInspectionJobMain = async (id: number) => {
return await request.get({ url: `/inspection/inspection-job-main/get?id=` + id })
}
// 新增检验申请
export const createInspectionJobMain = async (data: InspectionJobMainVO) => {
return await request.post({ url: `/inspection/inspection-job-main/create`, data })
}
// 修改检验申请
export const updateInspectionJobMain = async (data: InspectionJobMainVO) => {
return await request.put({ url: `/inspection/inspection-job-main/update`, data })
}
// 删除检验申请
export const deleteInspectionJobMain = async (id: number) => {
return await request.delete({ url: `/inspection/inspection-job-main/delete?id=` + id })
}
// 导出检验申请 Excel
export const exportInspectionJobMain = async (params) => {
return await request.download({ url: `/inspection/inspection-job-main/export-excel`, params })
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/inspection/inspection-job-main/get-import-template' })
}

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

@ -0,0 +1,53 @@
import request from '@/config/axios'
export interface InspectionMethodVO {
id: number
code: string
describe: string
version: string
status: string
operationGuidance: string
videoAddress: string
available: string
}
// 查询检验方法列表
export const getInspectionMethodPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/qms/inspection-method/senior', data })
} else {
return await request.get({ url: `/qms/inspection-method/page`, params })
}
}
// 查询检验方法详情
export const getInspectionMethod = async (id: number) => {
return await request.get({ url: `/qms/inspection-method/get?id=` + id })
}
// 新增检验方法
export const createInspectionMethod = async (data: InspectionMethodVO) => {
return await request.post({ url: `/qms/inspection-method/create`, data })
}
// 修改检验方法
export const updateInspectionMethod = async (data: InspectionMethodVO) => {
return await request.put({ url: `/qms/inspection-method/update`, data })
}
// 删除检验方法
export const deleteInspectionMethod = async (id: number) => {
return await request.delete({ url: `/qms/inspection-method/delete?id=` + id })
}
// 导出检验方法 Excel
export const exportInspectionMethod = async (params) => {
return await request.download({ url: `/qms/inspection-method/export-excel`, params })
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/qms/inspection-method/get-import-template' })
}

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

@ -0,0 +1,65 @@
import request from '@/config/axios'
export interface InspectionMainVO {
number: string
applicationDate: localdate
applicationTime: Date
requestStartTime: Date
requestEndTime: Date
finishTime: Date
supplierCode: string
materialCode: 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
}
// 查询检验申请列表
export const getInspectionMainPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/inspection/inspection-main/senior', data })
} else {
return await request.get({ url: `/inspection/inspection-main/page`, params })
}
}
// 查询检验申请详情
export const getInspectionMain = async (id: number) => {
return await request.get({ url: `/inspection/inspection-main/get?id=` + id })
}
// 新增检验申请
export const createInspectionMain = async (data: InspectionMainVO) => {
return await request.post({ url: `/inspection/inspection-main/create`, data })
}
// 修改检验申请
export const updateInspectionMain = async (data: InspectionMainVO) => {
return await request.put({ url: `/inspection/inspection-main/update`, data })
}
// 删除检验申请
export const deleteInspectionMain = async (id: number) => {
return await request.delete({ url: `/inspection/inspection-main/delete?id=` + id })
}
// 导出检验申请 Excel
export const exportInspectionMain = async (params) => {
return await request.download({ url: `/inspection/inspection-main/export-excel`, params })
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/inspection/inspection-main/get-import-template' })
}

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

@ -0,0 +1,8 @@
import request from '@/config/axios'
// 查询采样过程列表
export const getInspectionProcessPage = async (params) => {
return await request.get({ url: `/qms/inspection-process/page`})
}

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

@ -0,0 +1,57 @@
import request from '@/config/axios'
export interface SampleCodeVO {
id: number
code: string
batchLow limiting: number
batchUpperLimiting: number
s1: number
s2: number
s3: number
s4: number
g1: number
g2: number
g3: number
available: string
}
// 查询样本字码列表
export const getSampleCodePage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/qms/sample-code/senior', data })
} else {
return await request.get({ url: `/qms/sample-code/page`, params })
}
}
// 查询样本字码详情
export const getSampleCode = async (id: number) => {
return await request.get({ url: `/qms/sample-code/get?id=` + id })
}
// 新增样本字码
export const createSampleCode = async (data: SampleCodeVO) => {
return await request.post({ url: `/qms/sample-code/create`, data })
}
// 修改样本字码
export const updateSampleCode = async (data: SampleCodeVO) => {
return await request.put({ url: `/qms/sample-code/update`, data })
}
// 删除样本字码
export const deleteSampleCode = async (id: number) => {
return await request.delete({ url: `/qms/sample-code/delete?id=` + id })
}
// 导出样本字码 Excel
export const exportSampleCode = async (params) => {
return await request.download({ url: `/qms/sample-code/export-excel`, params })
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/qms/sample-code/get-import-template' })
}

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

@ -0,0 +1,50 @@
import request from '@/config/axios'
export interface SamplingSchemeVO {
id: number
code: string
describe: string
status: string
available: string
}
// 查询采样方案列表
export const getSamplingSchemePage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/qms/sampling-scheme/senior', data })
} else {
return await request.get({ url: `/qms/sampling-scheme/page`, params })
}
}
// 查询采样方案详情
export const getSamplingScheme = async (id: number) => {
return await request.get({ url: `/qms/sampling-scheme/get?id=` + id })
}
// 新增采样方案
export const createSamplingScheme = async (data: SamplingSchemeVO) => {
return await request.post({ url: `/qms/sampling-scheme/create`, data })
}
// 修改采样方案
export const updateSamplingScheme = async (data: SamplingSchemeVO) => {
return await request.put({ url: `/qms/sampling-scheme/update`, data })
}
// 删除采样方案
export const deleteSamplingScheme = async (id: number) => {
return await request.delete({ url: `/qms/sampling-scheme/delete?id=` + id })
}
// 导出采样方案 Excel
export const exportSamplingScheme = async (params) => {
return await request.download({ url: `/qms/sampling-scheme/export-excel`, params })
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/qms/sampling-scheme/get-import-template' })
}

56
src/components/Detail/src/Detail.vue

@ -25,7 +25,7 @@
/>
</ContentWrap>
<Tabs :tabsList="tabsList" :current="current" @change="change" />
<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!='变更记录'"> <!-- 列表头部 -->
@ -97,22 +97,25 @@
</DetailTable>
</ContentWrap>
<!-- 附件/备注/变更记录 -->
<ContentWrap class="w-[100%]" v-show="tabsList[current].label=='附件'||tabsList[current].label=='备注'||tabsList[current].label=='变更记录'">
<ContentWrap class="w-[100%]" v-show="tabsList[current].label=='附件'||tabsList[current].label=='备注'||tabsList[current].label=='变更记录'" :style="{height:remarkHeight+'px'}">
<!-- 附件组件 -->
<Annex v-show="tabsList[current].label=='附件'"
:annexData="annexData"
@handleAnnexSuccess="handleAnnexSuccess"
@deleteAnnexSuccess="deleteAnnexSuccess"
:upData="remarksData.data"
/>
<!-- 备注组件 -->
<Remarks v-show="tabsList[current].label=='备注'"
:remarksData="remarksData"
class="mt-20px"
@remarksSubmitScuess="remarksSubmitScuess"
/>
<!-- 变更记录组件 -->
<ChangeRecord v-show="tabsList[current].label=='变更记录'" :changeRecordData="changeRecordData" class="mt-20px" /> </ContentWrap>
<ElScrollbar ref="scrollbar" :style="{height:(remarkHeight-40)+'px'}">
<Annex v-show="tabsList[current].label=='附件'"
:annexData="annexData"
@handleAnnexSuccess="handleAnnexSuccess"
@deleteAnnexSuccess="deleteAnnexSuccess"
:upData="remarksData.data"
/>
<!-- 备注组件 -->
<Remarks v-show="tabsList[current].label=='备注'"
:remarksData="remarksData"
class="mt-20px"
@remarksSubmitScuess="remarksSubmitScuess"
/>
<!-- 变更记录组件 -->
<ChangeRecord v-show="tabsList[current].label=='变更记录'" :changeRecordData="changeRecordData" class="mt-20px" />
</ElScrollbar>
</ContentWrap>
</div>
</el-drawer>
<!-- 表格弹窗 -->
@ -142,6 +145,7 @@
</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'
@ -350,6 +354,21 @@ if (!tabsList.value || tabsList.value && tabsList.value.length == otherList.leng
})
}
// 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: []
@ -391,6 +410,11 @@ 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});
}
}
//

19
src/utils/dict.ts

@ -280,7 +280,26 @@ export enum DICT_TYPE {
DELIVER_TYPE="deliver_type",//发货类型
BILL_TYPE="bill_type", // 发票类型
// ========== 业务 - mes ==========
MESDO_STATUS= 'mes_do_status', // 工单执行状态
MES_WORKBILL_MODEL='mes_workbill_model',// 工单模式 单工单(根据产品数量生成多个工单)、批量工单(一个产品一个工单)
MES_TASK_MODE='mes_task_mode', //生产模式 派工方式、领工方式
MES_PLANDO_STATUS='mes_plando_status', //计划执行状
//========== QMS ==========
SAMPLING_TYPE = "sampling_type", // 取样类型
EVALUATION_MODE = "evaluation_mode", // 评估模式
// ========== 业务 - mes -gaojs ==========
QUALIFY_STATUS = 'qualify_status',//质检状态
QUALIFY_ITEM_DATA_TYPE='qualify_item_data_type',//质检项目数据类型
QUALIFY_ITEM_VERIFY_MODE='qualify_item_verify_mode',//质检项目校验方式
QUALIFY_FORM_OPERATION='qualify_form_operation',//质检表单操作
OPERSTEP_COLLECT_TYPE='operstep_collect_type',//操作步骤采集方式
REWORK_TYPE='rework_type',//工作类型:返工登记、返修登记
REWORK_STATUS='rework_status',//返工返修状态:待返修,返修中,返修完成
REWORK_REPLACE_FLAG='rework_replace_flag',//是否有替换件
}

172
src/views/mes/abilityInfo/abilityInfo.data.ts

@ -0,0 +1,172 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime'
// 表单校验
export const AbilityInfoRules = reactive({
ablityCode: [required],
ablityName: [required],
trainMinHours: [required],
operMinHours: [required],
})
export const AbilityInfo = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '删除时间',
field: 'deleteTime',
sort: 'custom',
formatter: dateFormatter,
isSearch: false,
isTable: false,
isForm:false,
isDetail:false,
search: {
component: 'DatePicker',
componentProps: {
valueFormat: 'YYYY-MM-DD HH:mm:ss',
type: 'daterange',
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')]
}
},
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
valueFormat: 'x'
}
},
},
{
label: '主键',
field: 'id',
sort: 'custom',
isForm: false,
isTable: false,
isDetail:false,
},
{
label: '并发乐观锁',
field: 'concurrencyStamp',
sort: 'custom',
isSearch: false,
isTable: false,
isForm:false,
isDetail:false,
form: {
component: 'InputNumber',
value: 0
},
},
{
label: '创建时间',
field: 'createTime',
sort: 'custom',
formatter: dateFormatter,
isSearch: false,
isTable: false,
isDetail:false,
search: {
component: 'DatePicker',
componentProps: {
valueFormat: 'YYYY-MM-DD HH:mm:ss',
type: 'daterange',
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')]
}
},
isForm: false,
},
{
label: '删除用户名',
field: 'deleter',
sort: 'custom',
isSearch: false,
isTable: false,
isForm: false,
isDetail:false
},
{
label: '位置ID',
field: 'siteId',
sort: 'custom',
isSearch: false,
isTable: false,
isForm: false,
isDetail:false,
form: {
component: 'InputNumber',
value: 0
},
},
{
label: '技能编号',
field: 'ablityCode',
sort: 'custom',
isSearch: true,
},
{
label: '技能名称',
field: 'ablityName',
sort: 'custom',
isSearch: true,
},
{
label: '要求培训时长',
field: 'trainMinHours',
sort: 'custom',
isSearch: true,
form: {
component: 'InputNumber',
componentProps: {
min: 0,
precision: 1
}
}
},
{
label: '操作时长',
field: 'operMinHours',
sort: 'custom',
isSearch: true,
form: {
component: 'InputNumber',
componentProps: {
min: 0,
precision: 1
}
}
},
{
label: '备注',
field: 'remark',
sort: 'custom',
isSearch: false,
isTable: false
},
{
label: '状态',
field: 'status',
sort: 'custom',
dictType: DICT_TYPE.QUALIFY_STATUS,
dictClass: 'string',
isForm: true,
isSearch: true,
isTable: true,
form: {
component: 'Switch',
value: '2',
componentProps: {
inactiveValue: '2',
activeValue: '1'
}
},
},
{
label: '操作',
field: 'action',
isForm: false,
table: {
width: 150,
fixed: 'right'
}
}
]))

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

@ -0,0 +1,244 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="AbilityInfo.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
</ContentWrap>
<!-- 列表头部 -->
<TableHead
:HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick"
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="AbilityInfo.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 #ablityCode="{row}">
<el-button type="primary" link @click="openDetail(row, '代码', row.ablityCode)">
<span>{{ row.ablityCode }}</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="AbilityInfoRules"
:formAllSchemas="AbilityInfo.allSchemas"
:apiUpdate="AbilityInfoApi.updateAbilityInfo"
:apiCreate="AbilityInfoApi.createAbilityInfo"
@searchTableSuccess="searchTableSuccess"
:isBusiness="false"
/>
<!-- 详情 -->
<Detail ref="detailRef" :isBasic="true" :allSchemas="AbilityInfo.allSchemas" />
<!-- 导入 -->
<ImportForm ref="importFormRef" url="/mes/ability-info/import" :importTemplateData="importTemplateData" @success="importSuccess" />
</template>
<script setup lang="ts">
import download from '@/utils/download'
import { AbilityInfo,AbilityInfoRules } from './abilityInfo.data'
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'
defineOptions({ name: 'AbilityInfo' })
const message = useMessage() //
const { t } = useI18n() //
const route = useRoute() //
const routeName = ref()
routeName.value = route.name
const tableColumns = ref(AbilityInfo.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: AbilityInfoApi.getAbilityInfoPage //
})
//
const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultAddBtn({hasPermi:'mes:abilityInfo:create'}), //
defaultButtons.defaultImportBtn({hasPermi:'mes:abilityInfo:import'}), //
defaultButtons.defaultExportBtn({hasPermi:'mes:abilityInfo:export'}), //
defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), //
// {
// label: '',
// name: 'zdy',
// hide: false,
// type: 'primary',
// icon: 'Select',
// color: ''
// },
]
//
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:abilityInfo:update'}), //
defaultButtons.mainListDeleteBtn({hasPermi:'mes:abilityInfo: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) => {
var isHave =AbilityInfo.allSchemas.formSchema.some(function (item) {
return item.field === 'activeTime' || item.field === 'expireTime';
});
if(isHave){
if(data.activeTime && data.expireTime && data.activeTime >=data.expireTime){
message.error('失效时间要大于生效时间')
return;
}
}
if(data.activeTime==0)data.activeTime = null;
if(data.expireTime==0)data.expireTime = null;
if (formType === 'create') {
await AbilityInfoApi.createAbilityInfo(data)
message.success(t('common.createSuccess'))
} else {
await AbilityInfoApi.updateAbilityInfo(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, 'basicAbilityInfo')
}
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
try {
//
await message.delConfirm()
//
await AbilityInfoApi.deleteAbilityInfo(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 AbilityInfoApi.exportAbilityInfo(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 AbilityInfoApi.importTemplate()
})
</script>

210
src/views/mes/hrPersonAbility/hrPersonAbility.data.ts

@ -0,0 +1,210 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime'
import * as AbilityInfoApi from '@/api/mes/abilityInfo'
import { AbilityInfo } from '../abilityInfo/abilityInfo.data'
// 表单校验
export const HrPersonAbilityRules = reactive({
ablityCode: [required],
personCode: [required],
})
export const HrPersonAbility = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '删除时间',
field: 'deleteTime',
sort: 'custom',
formatter: dateFormatter,
isSearch: false,
isTable: false,
isForm:false,
isDetail:false,
search: {
component: 'DatePicker',
componentProps: {
valueFormat: 'YYYY-MM-DD HH:mm:ss',
type: 'daterange',
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')]
}
},
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
valueFormat: 'x'
}
},
},
{
label: '主键',
field: 'id',
sort: 'custom',
isForm: false,
isTable: false,
isDetail:false
},
{
label: '并发乐观锁',
field: 'concurrencyStamp',
sort: 'custom',
isSearch: false,
isTable: false,
isForm:false,
isDetail:false,
form: {
component: 'InputNumber',
value: 0
},
},
{
label: '创建时间',
field: 'createTime',
sort: 'custom',
formatter: dateFormatter,
isSearch: false,
isTable: false,
isDetail:false,
search: {
component: 'DatePicker',
componentProps: {
valueFormat: 'YYYY-MM-DD HH:mm:ss',
type: 'daterange',
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')]
}
},
isForm: false,
},
{
label: '删除用户名',
field: 'deleter',
sort: 'custom',
isSearch: false,
isTable: false,
isForm: false,
isDetail:false,
},
{
label: '位置ID',
field: 'siteId',
sort: 'custom',
isSearch: false,
isTable: false,
isForm: false,
isDetail:false,
form: {
component: 'InputNumber',
value: 0
},
},
{
label: '人员ID',
field: 'personId',
sort: 'custom',
isSearch: false,
isTable: false,
isForm: false,
isDetail:false,
form: {
component: 'InputNumber',
value: 0
},
},
{
label: '人员工号',
field: 'personCode',
sort: 'custom',
isSearch: true,
},
{
label: '能力编号',
field: 'ablityCode',
sort: 'custom',
isSearch: true,
form: {
componentProps: {
isSearchList: true, // 开启查询弹窗
searchTitle: '能力矩阵信息', // 查询弹窗标题
searchAllSchemas: AbilityInfo.allSchemas, // 查询弹窗所需类
searchField: 'ablityCode', // 查询弹窗赋值字段
searchPage: AbilityInfoApi.getAbilityInfoPage, // 查询弹窗所需分页方法
searchCondition: [{
key: 'status',
value: '1',
action: '=='
}]
}
}
},
{
label: '能力等级',
field: 'ablityLevel',
sort: 'custom',
isSearch: true,
form: {
component: 'InputNumber',
value: 0
},
},
{
label: '学习累计时长',
field: 'studyDuration',
sort: 'custom',
isSearch: true,
form: {
component: 'InputNumber',
componentProps: {
min: 0,
precision: 1
}
},
},
{
label: '工作累计时长',
field: 'workDuration',
sort: 'custom',
isSearch: true,
form: {
component: 'InputNumber',
componentProps: {
min: 0,
precision: 1
}
},
},
{
label: '备注',
field: 'remark',
sort: 'custom',
isSearch: false,
isTable: false
},
{
label: '状态',
field: 'status',
sort: 'custom',
dictType: DICT_TYPE.QUALIFY_STATUS,
dictClass: 'string',
isForm: true,
isSearch: true,
isTable: true,
form: {
component: 'Switch',
value: '2',
componentProps: {
inactiveValue: '2',
activeValue: '1'
}
},
},
{
label: '操作',
field: 'action',
isForm: false,
table: {
width: 150,
fixed: 'right'
}
}
]))

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

@ -0,0 +1,257 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="HrPersonAbility.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
</ContentWrap>
<!-- 列表头部 -->
<TableHead
:HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick"
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="HrPersonAbility.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 #personCode="{row}">
<el-button type="primary" link @click="openDetail(row, '代码', row.personCode)">
<span>{{ row.personCode }}</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="HrPersonAbilityRules"
:formAllSchemas="HrPersonAbility.allSchemas"
:apiUpdate="HrPersonAbilityApi.updateHrPersonAbility"
:apiCreate="HrPersonAbilityApi.createHrPersonAbility"
@searchTableSuccess="searchTableSuccess"
:isBusiness="false"
/>
<!-- 详情 -->
<Detail ref="detailRef" :isBasic="true" :allSchemas="HrPersonAbility.allSchemas" />
<!-- 导入 -->
<ImportForm ref="importFormRef" url="/mes/hr-person-ability/import" :importTemplateData="importTemplateData" @success="importSuccess" />
</template>
<script setup lang="ts">
import download from '@/utils/download'
import { HrPersonAbility,HrPersonAbilityRules } from './hrPersonAbility.data'
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'
defineOptions({ name: 'HrPersonAbility' })
const message = useMessage() //
const { t } = useI18n() //
const route = useRoute() //
const routeName = ref()
routeName.value = route.name
const tableColumns = ref(HrPersonAbility.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: HrPersonAbilityApi.getHrPersonAbilityPage //
})
//
const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultAddBtn({hasPermi:'mes:hrPersonAbility:create'}), //
defaultButtons.defaultImportBtn({hasPermi:'mes:hrPersonAbility:import'}), //
defaultButtons.defaultExportBtn({hasPermi:'mes:hrPersonAbility:export'}), //
defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), //
// {
// label: '',
// name: 'zdy',
// hide: false,
// type: 'primary',
// icon: 'Select',
// color: ''
// },
]
//
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:hrPersonAbility:update'}), //
defaultButtons.mainListDeleteBtn({hasPermi:'mes:hrPersonAbility: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) => {
if(type == "update"){
HrPersonAbility.allSchemas.formSchema.forEach((item) => {
if (item.field == 'personCode') {
item.componentProps.disabled = true
}
})
}else{
HrPersonAbility.allSchemas.formSchema.forEach((item) => {
if (item.field == 'personCode') {
item.componentProps.disabled = false
}
})
}
basicFormRef.value.open(type, row)
}
// form
const formsSuccess = async (formType,data) => {
var isHave =HrPersonAbility.allSchemas.formSchema.some(function (item) {
return item.field === 'activeTime' || item.field === 'expireTime';
});
if(isHave){
if(data.activeTime && data.expireTime && data.activeTime >=data.expireTime){
message.error('失效时间要大于生效时间')
return;
}
}
if(data.activeTime==0)data.activeTime = null;
if(data.expireTime==0)data.expireTime = null;
if (formType === 'create') {
await HrPersonAbilityApi.createHrPersonAbility(data)
message.success(t('common.createSuccess'))
} else {
await HrPersonAbilityApi.updateHrPersonAbility(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, 'basicHrPersonAbility')
}
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
try {
//
await message.delConfirm()
//
await HrPersonAbilityApi.deleteHrPersonAbility(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 HrPersonAbilityApi.exportHrPersonAbility(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 HrPersonAbilityApi.importTemplate()
})
</script>

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

@ -0,0 +1,353 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="Item.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
</ContentWrap>
<!-- 列表头部 -->
<TableHead
:HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick"
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="Item.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 #itemCode="{row}">
<el-button type="primary" link @click="openDetail(row, '代码', row.itemCode)">
<span>{{ row.itemCode }}</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="ItemRules"
:formAllSchemas="Item.allSchemas"
:apiUpdate="ItemApi.updateItem"
:apiCreate="ItemApi.createItem"
@searchTableSuccess="searchTableSuccess"
:isBusiness="false"
@onChange="onChangeQG"
/>
<!-- 详情 -->
<Detail ref="detailRef" :isBasic="true" :allSchemas="Item.allSchemas" />
<!-- 导入 -->
<ImportForm ref="importFormRef" url="/mes/item/import" :importTemplateData="importTemplateData" @success="importSuccess" />
</template>
<script setup lang="ts">
import download from '@/utils/download'
import { Item,ItemRules } from './item.data'
import * as ItemApi from '@/api/mes/item'
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'
defineOptions({ name: 'QmsItem' })
const message = useMessage() //
const { t } = useI18n() //
const route = useRoute() //
const routeName = ref()
routeName.value = route.name
const tableColumns = ref(Item.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: ItemApi.getItemPage //
})
//
const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultAddBtn({hasPermi:'mes:item:create'}), //
defaultButtons.defaultImportBtn({hasPermi:'mes:item:import'}), //
defaultButtons.defaultExportBtn({hasPermi:'mes:item:export'}), //
defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), //
// {
// label: '',
// name: 'zdy',
// hide: false,
// type: 'primary',
// icon: 'Select',
// color: ''
// },
]
//
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:item:update'}), //
defaultButtons.mainListDeleteBtn({hasPermi:'mes:item: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) => {
if(type == "update"){
Item.allSchemas.formSchema.forEach((item) => {
if (item.field == 'itemCode') {
item.componentProps.disabled = true
}
if (item.field == 'itemType') {
item.componentProps.disabled = true
}
if(row.dataType == 'NUMBER'){
if (item.field == 'dataVerify') {
item.componentProps.disabled = false
}
if (item.field == 'dataStandvalue') {
item.componentProps.disabled = false
}
if (item.field == 'status') {
item.componentProps.disabled = true
}
}
if(row.dataType == 'SWITCH'){
if (item.field == 'dataVerify') {
item.componentProps.disabled = true
}
if (item.field == 'dataStandvalue') {
item.componentProps.disabled = true
}
if (item.field == 'status') {
item.componentProps.disabled = false
}
}
if(row.dataType == 'TEXT'){
if (item.field == 'dataVerify') {
item.componentProps.disabled = true
}
if (item.field == 'dataStandvalue') {
item.componentProps.disabled = true
}
if (item.field == 'status') {
item.componentProps.disabled = true
}
}
})
}else{
Item.allSchemas.formSchema.forEach((item) => {
if (item.field == 'itemCode') {
item.componentProps.disabled = false
}
if (item.field == 'itemType') {
item.componentProps.disabled = false
}
if (item.field == 'dataVerify') {
item.componentProps.disabled = false
}
if (item.field == 'dataStandvalue') {
item.componentProps.disabled = false
}
if (item.field == 'status') {
item.componentProps.disabled = false
}
})
}
basicFormRef.value.open(type, row)
}
// form
const formsSuccess = async (formType,data) => {
var isHave =Item.allSchemas.formSchema.some(function (item) {
return item.field === 'activeTime' || item.field === 'expireTime';
});
if(isHave){
if(data.activeTime && data.expireTime && data.activeTime >=data.expireTime){
message.error('失效时间要大于生效时间')
return;
}
}
if(data.activeTime==0)data.activeTime = null;
if(data.expireTime==0)data.expireTime = null;
if (formType === 'create') {
await ItemApi.createItem(data)
message.success(t('common.createSuccess'))
} else {
await ItemApi.updateItem(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, 'basicItem')
}
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
try {
//
await message.delConfirm()
//
await ItemApi.deleteItem(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 ItemApi.exportItem(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() //
}
//
const onChangeQG = (field, cur, item) => {
console.log('cur'+cur)
Item.allSchemas.formSchema.forEach((item) => {
if(cur == 'SWITCH'){
if (item.field == 'dataVerify') {
item.componentProps.disabled = true
}
if (item.field == 'dataStandvalue') {
item.componentProps.disabled = true
}
if (item.field == 'status') {
item.componentProps.disabled = false
}
}
if(cur == 'TEXT'){
if (item.field == 'dataVerify') {
item.componentProps.disabled = true
}
if (item.field == 'dataStandvalue') {
item.componentProps.disabled = true
}
if (item.field == 'status') {
item.componentProps.disabled = true
}
}
if(cur == 'NUMBER'){
if (item.field == 'dataVerify') {
item.componentProps.disabled = false
}
if (item.field == 'dataStandvalue') {
item.componentProps.disabled = false
}
if (item.field == 'status') {
item.componentProps.disabled = true
}
}
})
}
/** 初始化 **/
onMounted(async () => {
getList()
importTemplateData.templateUrl = await ItemApi.importTemplate()
})
</script>

203
src/views/mes/item/item.data.ts

@ -0,0 +1,203 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime'
import * as QualitygroupApi from '@/api/mes/qualitygroup'
import { Qualitygroup } from '../qualitygroup/qualitygroup.data'
// 表单校验
export const ItemRules = reactive({
concurrencyStamp: [required],
itemCode: [{ required: true, message: '请输入编码', trigger: 'blur' }],
itemType: [required],
dataType: [required]
})
export const Item = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '删除时间',
field: 'deleteTime',
sort: 'custom',
formatter: dateFormatter,
isSearch: false,
isTable: false,
isForm:false,
isDetail:false,
search: {
component: 'DatePicker',
componentProps: {
valueFormat: 'YYYY-MM-DD HH:mm:ss',
type: 'daterange',
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')]
}
},
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
valueFormat: 'x'
}
},
},
{
label: '主键',
field: 'id',
sort: 'custom',
isForm: false,
isTable: false,
isDetail:false
},
{
label: '并发乐观锁',
field: 'concurrencyStamp',
sort: 'custom',
isSearch: false,
isTable: false,
isForm:false,
isDetail:false,
form: {
component: 'InputNumber',
value: 0
},
},
{
label: '创建时间',
field: 'createTime',
sort: 'custom',
formatter: dateFormatter,
isSearch: false,
isTable: false,
isDetail:false,
search: {
component: 'DatePicker',
componentProps: {
valueFormat: 'YYYY-MM-DD HH:mm:ss',
type: 'daterange',
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')]
}
},
isForm: false,
},
{
label: '删除用户名',
field: 'deleter',
sort: 'custom',
isSearch: false,
isTable: false,
isForm: false,
isDetail:false
},
{
label: '位置ID',
field: 'siteId',
sort: 'custom',
isSearch: false,
isTable: false,
isForm: false,
isDetail:false,
form: {
component: 'InputNumber',
value: 0
},
},
{
label: '项目编码',
field: 'itemCode',
sort: 'custom',
isSearch: true,
},
{
label: '项目名称',
field: 'itemName',
sort: 'custom',
isSearch: true,
},
{
label: '类别编码',
field: 'itemType',
sort: 'custom',
isSearch: true,
form: {
componentProps: {
isSearchList: true, // 开启查询弹窗
searchTitle: '质检科目信息', // 查询弹窗标题
searchAllSchemas: Qualitygroup.allSchemas, // 查询弹窗所需类
searchField: 'code', // 查询弹窗赋值字段
searchPage: QualitygroupApi.getQualitygroupPage, // 查询弹窗所需分页方法
searchCondition: [{
key: 'status',
value: '1',
action: '=='
}]
}
}
},
{
label: '质检科目编码',
field: 'qmsClass',
sort: 'custom',
isSearch: true,
},
{
label: '数据类型',
field: 'dataType',
sort: 'custom',
dictType: DICT_TYPE.QUALIFY_ITEM_DATA_TYPE,
dictClass: 'string',
isSearch: true,
},
{
label: '校验方式',
field: 'dataVerify',
sort: 'custom',
dictType: DICT_TYPE.QUALIFY_ITEM_VERIFY_MODE,
dictClass: 'string',
isSearch: true,
},
{
label: '数据参考值',
field: 'dataStandvalue',
sort: 'custom',
isSearch: false,
},
{
label: '数据录入说明',
field: 'dataDescripe',
sort: 'custom',
isSearch: false,
},
{
label: '操作',
field: 'action',
isForm: false,
table: {
width: 150,
fixed: 'right'
}
},
{
label: '是否可用',
field: 'status',
sort: 'custom',
dictType: DICT_TYPE.QUALIFY_STATUS,
dictClass: 'string',
isSearch: true,
isTable: true,
isForm: true,
form: {
component: 'Switch',
value: '2',
componentProps: {
inactiveValue: '2',
activeValue: '1'
}
},
},
{
label: '备注',
field: 'remark',
sort: 'custom',
isSearch: false,
isTable: false
}
]))

244
src/views/mes/opersteps/index.vue

@ -0,0 +1,244 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="Opersteps.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
</ContentWrap>
<!-- 列表头部 -->
<TableHead
:HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick"
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="Opersteps.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 #stepsCode="{row}">
<el-button type="primary" link @click="openDetail(row, '代码', row.stepsCode)">
<span>{{ row.stepsCode }}</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="OperstepsRules"
:formAllSchemas="Opersteps.allSchemas"
:apiUpdate="OperstepsApi.updateOpersteps"
:apiCreate="OperstepsApi.createOpersteps"
@searchTableSuccess="searchTableSuccess"
:isBusiness="false"
/>
<!-- 详情 -->
<Detail ref="detailRef" :isBasic="true" :allSchemas="Opersteps.allSchemas" />
<!-- 导入 -->
<ImportForm ref="importFormRef" url="/mes/opersteps/import" :importTemplateData="importTemplateData" @success="importSuccess" />
</template>
<script setup lang="ts">
import download from '@/utils/download'
import { Opersteps,OperstepsRules } from './opersteps.data'
import * as OperstepsApi from '@/api/mes/opersteps'
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'
defineOptions({ name: 'Opersteps' })
const message = useMessage() //
const { t } = useI18n() //
const route = useRoute() //
const routeName = ref()
routeName.value = route.name
const tableColumns = ref(Opersteps.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: OperstepsApi.getOperstepsPage //
})
//
const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultAddBtn({hasPermi:'mes:opersteps:create'}), //
defaultButtons.defaultImportBtn({hasPermi:'mes:opersteps:import'}), //
defaultButtons.defaultExportBtn({hasPermi:'mes:opersteps:export'}), //
defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), //
// {
// label: '',
// name: 'zdy',
// hide: false,
// type: 'primary',
// icon: 'Select',
// color: ''
// },
]
//
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:opersteps:update'}), //
defaultButtons.mainListDeleteBtn({hasPermi:'mes:opersteps: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) => {
var isHave =Opersteps.allSchemas.formSchema.some(function (item) {
return item.field === 'activeTime' || item.field === 'expireTime';
});
if(isHave){
if(data.activeTime && data.expireTime && data.activeTime >=data.expireTime){
message.error('失效时间要大于生效时间')
return;
}
}
if(data.activeTime==0)data.activeTime = null;
if(data.expireTime==0)data.expireTime = null;
if (formType === 'create') {
await OperstepsApi.createOpersteps(data)
message.success(t('common.createSuccess'))
} else {
await OperstepsApi.updateOpersteps(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, 'basicOpersteps')
}
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
try {
//
await message.delConfirm()
//
await OperstepsApi.deleteOpersteps(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 OperstepsApi.exportOpersteps(tableObject.params)
download.excel(data, 'MES操作步骤信息.xlsx')
} catch {
} finally {
exportLoading.value = false
}
}
/** 导入 */
const importFormRef = ref()
const handleImport = () => {
importFormRef.value.open()
}
//
const importTemplateData = reactive({
templateUrl: '',
templateTitle: 'MES操作步骤信息导入模版.xlsx'
})
//
const importSuccess = () => {
getList()
}
//
const searchFormClick = (searchData) => {
tableObject.params = {
isSearch: true,
filters: searchData.filters
}
getList() //
}
/** 初始化 **/
onMounted(async () => {
getList()
importTemplateData.templateUrl = await OperstepsApi.importTemplate()
})
</script>

165
src/views/mes/opersteps/opersteps.data.ts

@ -0,0 +1,165 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime'
import * as OperstepsTypeApi from '@/api/mes/operstepsType'
import { OperstepsType } from '../operstepsType/operstepsType.data'
// 表单校验
export const OperstepsRules = reactive({
concurrencyStamp: [required],
})
export const Opersteps = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '删除时间',
field: 'deleteTime',
sort: 'custom',
formatter: dateFormatter,
isSearch: false,
isTable: false,
isForm:false,
isDetail:false,
search: {
component: 'DatePicker',
componentProps: {
valueFormat: 'YYYY-MM-DD HH:mm:ss',
type: 'daterange',
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')]
}
},
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
valueFormat: 'x'
}
},
},
{
label: '主键',
field: 'id',
sort: 'custom',
isSearch: false,
isTable: false,
isForm:false,
isDetail:false,
},
{
label: '并发乐观锁',
field: 'concurrencyStamp',
sort: 'custom',
isSearch: false,
isTable: false,
isForm:false,
isDetail:false,
form: {
component: 'InputNumber',
value: 0
},
},
{
label: '创建时间',
field: 'createTime',
sort: 'custom',
formatter: dateFormatter,
isSearch: false,
isTable: false,
isForm:false,
isDetail:false,
search: {
component: 'DatePicker',
componentProps: {
valueFormat: 'YYYY-MM-DD HH:mm:ss',
type: 'daterange',
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')]
}
},
},
{
label: '删除用户名',
field: 'deleter',
sort: 'custom',
isSearch: false,
isTable: false,
isForm:false,
isDetail:false,
},
{
label: '位置ID',
field: 'siteId',
sort: 'custom',
isSearch: false,
isTable: false,
isForm:false,
isDetail:false,
form: {
component: 'InputNumber',
value: 0
},
},
{
label: '步骤编码',
field: 'stepsCode',
sort: 'custom',
isSearch: true,
},
{
label: '步骤名称',
field: 'stepsName',
sort: 'custom',
isSearch: true,
},
{
label: '采集类型编码',
field: 'collectCode',
sort: 'custom',
isSearch: true,
form: {
componentProps: {
isSearchList: true, // 开启查询弹窗
searchTitle: '操作步骤类型配置信息', // 查询弹窗标题
searchAllSchemas: OperstepsType.allSchemas, // 查询弹窗所需类
searchField: 'collectCode', // 查询弹窗赋值字段
searchPage: OperstepsTypeApi.getOperstepsTypePage, // 查询弹窗所需分页方法
searchCondition: [{
key: 'status',
value: '1',
action: '=='
}]
}
}
},
{
label: '状态',
field: 'status',
sort: 'custom',
dictType: DICT_TYPE.QUALIFY_STATUS,
dictClass: 'string',
isForm: true,
isSearch: true,
isTable: true,
form: {
component: 'Switch',
value: '2',
componentProps: {
inactiveValue: '2',
activeValue: '1'
}
},
},
{
label: '备注',
field: 'remark',
sort: 'custom',
isSearch: true,
},
{
label: '操作',
field: 'action',
isForm: false,
table: {
width: 150,
fixed: 'right'
}
}
]))

244
src/views/mes/operstepsType/index.vue

@ -0,0 +1,244 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="OperstepsType.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
</ContentWrap>
<!-- 列表头部 -->
<TableHead
:HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick"
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="OperstepsType.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 #collectCode="{row}">
<el-button type="primary" link @click="openDetail(row, '代码', row.collectCode)">
<span>{{ row.collectCode }}</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="OperstepsTypeRules"
:formAllSchemas="OperstepsType.allSchemas"
:apiUpdate="OperstepsTypeApi.updateOperstepsType"
:apiCreate="OperstepsTypeApi.createOperstepsType"
@searchTableSuccess="searchTableSuccess"
:isBusiness="false"
/>
<!-- 详情 -->
<Detail ref="detailRef" :isBasic="true" :allSchemas="OperstepsType.allSchemas" />
<!-- 导入 -->
<ImportForm ref="importFormRef" url="/mes/opersteps-type/import" :importTemplateData="importTemplateData" @success="importSuccess" />
</template>
<script setup lang="ts">
import download from '@/utils/download'
import { OperstepsType,OperstepsTypeRules } from './operstepsType.data'
import * as OperstepsTypeApi from '@/api/mes/operstepsType'
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'
defineOptions({ name: 'OperstepsType' })
const message = useMessage() //
const { t } = useI18n() //
const route = useRoute() //
const routeName = ref()
routeName.value = route.name
const tableColumns = ref(OperstepsType.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: OperstepsTypeApi.getOperstepsTypePage //
})
//
const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultAddBtn({hasPermi:'mes:operstepsType:create'}), //
defaultButtons.defaultImportBtn({hasPermi:'mes:operstepsType:import'}), //
defaultButtons.defaultExportBtn({hasPermi:'mes:operstepsType:export'}), //
defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), //
// {
// label: '',
// name: 'zdy',
// hide: false,
// type: 'primary',
// icon: 'Select',
// color: ''
// },
]
//
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:operstepsType:update'}), //
defaultButtons.mainListDeleteBtn({hasPermi:'mes:operstepsType: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) => {
var isHave =OperstepsType.allSchemas.formSchema.some(function (item) {
return item.field === 'activeTime' || item.field === 'expireTime';
});
if(isHave){
if(data.activeTime && data.expireTime && data.activeTime >=data.expireTime){
message.error('失效时间要大于生效时间')
return;
}
}
if(data.activeTime==0)data.activeTime = null;
if(data.expireTime==0)data.expireTime = null;
if (formType === 'create') {
await OperstepsTypeApi.createOperstepsType(data)
message.success(t('common.createSuccess'))
} else {
await OperstepsTypeApi.updateOperstepsType(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, 'basicOperstepsType')
}
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
try {
//
await message.delConfirm()
//
await OperstepsTypeApi.deleteOperstepsType(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 OperstepsTypeApi.exportOperstepsType(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 OperstepsTypeApi.importTemplate()
})
</script>

167
src/views/mes/operstepsType/operstepsType.data.ts

@ -0,0 +1,167 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime'
// 表单校验
export const OperstepsTypeRules = reactive({
collectCode: [required],
collectName: [required],
collectType: [required],
adpaterClass: [required],
argLsit: [required],
})
export const OperstepsType = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '类型编码',
field: 'collectCode',
sort: 'custom',
isSearch: true,
},
{
label: '类型名称',
field: 'collectName',
sort: 'custom',
isSearch: true,
},
{
label: '采集方式',
field: 'collectType',
sort: 'custom',
dictType: DICT_TYPE.OPERSTEP_COLLECT_TYPE,
dictClass: 'string',
isSearch: true,
},
{
label: '适配器类名称',
field: 'adpaterClass',
sort: 'custom',
isSearch: true,
},
{
label: '参数列表',
field: 'argLsit',
sort: 'custom',
isSearch: true,
},
{
label: '删除时间',
field: 'deleteTime',
sort: 'custom',
formatter: dateFormatter,
isSearch: false,
isTable: false,
isForm:false,
isDetail:false,
search: {
component: 'DatePicker',
componentProps: {
valueFormat: 'YYYY-MM-DD HH:mm:ss',
type: 'daterange',
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')]
}
},
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
valueFormat: 'x'
}
},
},
{
label: '主键',
field: 'id',
sort: 'custom',
isForm: false,
isTable: false,
isDetail:false
},
{
label: '并发乐观锁',
field: 'concurrencyStamp',
sort: 'custom',
isSearch: false,
isTable: false,
isForm:false,
isDetail:false,
form: {
component: 'InputNumber',
value: 0
},
},
{
label: '创建时间',
field: 'createTime',
sort: 'custom',
formatter: dateFormatter,
isSearch: false,
isTable: false,
isDetail:false,
search: {
component: 'DatePicker',
componentProps: {
valueFormat: 'YYYY-MM-DD HH:mm:ss',
type: 'daterange',
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')]
}
},
isForm: false,
},
{
label: '删除用户名',
field: 'deleter',
sort: 'custom',
isSearch: false,
isTable: false,
isForm: false,
isDetail:false,
},
{
label: '位置ID',
field: 'siteId',
sort: 'custom',
isSearch: false,
isTable: false,
isForm: false,
isDetail:false,
form: {
component: 'InputNumber',
value: 0
},
},
{
label: '状态',
field: 'status',
sort: 'custom',
dictType: DICT_TYPE.QUALIFY_STATUS,
dictClass: 'string',
isForm: true,
isSearch: true,
isTable: true,
form: {
component: 'Switch',
value: '2',
componentProps: {
inactiveValue: '2',
activeValue: '1'
}
},
},
{
label: '备注',
field: 'remark',
sort: 'custom',
isSearch: false,
isTable: false
},
{
label: '操作',
field: 'action',
isForm: false,
table: {
width: 150,
fixed: 'right'
}
}
]))

459
src/views/mes/orderDay/components/BasicFormV2.vue

@ -0,0 +1,459 @@
<template>
<Dialog
:title="dialogTitle"
v-model="dialogVisible"
:width="dialogWidth"
:close-on-click-modal="false"
>
<div style="max-height: 60vh;overflow-y: auto;">
<Form
ref="formRef"
v-loading="formLoading"
:rules="rules"
:schema="formSchema"
:is-col="true"
@opensearchTable="opensearchTable"
@onChange="onChange"
@onBlur="onBlur" />
</div>
<template #footer>
<ButtonBase :Butttondata="Butttondata" @button-base-click="buttonBaseClick" />
</template>
</Dialog>
<SearchTable ref="searchTableRef" @searchTableSuccess="searchTableSuccess" />
</template>
<script setup lang="ts">
import { SearchTable } from '@/components/SearchTable'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import ButtonBase from '@/components/XButton/src/ButtonBase.vue'
const props = defineProps({
//
isSearchFilterButtonHide: {
type: Boolean,
default: false
},
//
basicFormWidth: {
type: String,
default: ''
},
// TableForm /
isShowButton: {
type: Boolean,
default: true
},
// tableForm
isShowReduceButton: {
type: Boolean,
default: true
},
// rules
rules: {
type: Object,
required: true,
default: null
},
//
formAllSchemas: {
type: Object,
required: true,
default: null
},
//
tableAllSchemas: {
type: Array,
required: true,
default: null
},
//
tableData: {
type: Array,
required: true,
default: null
},
tableFormRules: {
type: Array,
required: true,
default: null
},
//
// searchTableParams: {
// type: Array,
// required: false,
// default: null
// },
// APIVo
apiVo: {
type: Object,
required: true,
default: null
},
// API
apiCreate: {
type: Function,
required: true,
default: null
},
// API
apiUpdate: {
type: Function,
required: true,
default: null
},
// tableForm
isBusiness: {
type: Boolean,
required: true,
default: true
},
// form
form: {
type: Object,
required: true,
default: null
},
//
detailData: {
type: Object,
required: true,
default: null
},
// //
// masterParmas: {
// type: Object,
// required: false,
// default: null
// },
// countPlan
fromeWhere: {
type: String,
required: false,
default: ''
},
//
countScopeType: {
type: Array,
required: false,
default: null
},
//
isDetail: {
type: Boolean,
required: false,
default: false
},
//
isShowFooterButtton: {
type: Boolean,
required: false,
default: true
},
//
tableFormDataLength: {
type: Boolean,
required: false,
default: true
}
})
const { t } = useI18n() //
const message = useMessage() //
const dialogWidth = ref()
if (props.basicFormWidth) {
dialogWidth.value = props.basicFormWidth + '%'
} else {
dialogWidth.value = props.isBusiness ? '60%' : '40%'
}
const dialogVisible = ref(false) //
const dialogTitle = ref('') //
const formLoading = ref(false) // 12
const formType = ref('') // create - update -
const formRef = ref() // Ref
const formSchema = ref(props.formAllSchemas?.formSchema)
const searchFilterButtonHide=ref(props.isSearchFilterButtonHide)
/** 弹层操作 */
// formField form
// searchField
// type type=tableForm
// searchCondition
const searchTableRef = ref()
const opensearchTable = (
formField,
searchField,
searchTitle,
searchAllSchemas,
searchPage,
searchCondition,
multiple,
type,
row
) => {
const _searchCondition = {}
//
if (searchCondition && searchCondition.length > 0) {
//
let filters: any[] = []
for (var i=0; i< searchCondition.length; i++ ) {
// searchCondition.forEach((item) => {
// row
if (searchCondition[i].isMainValue) {
_searchCondition[searchCondition[i].key] = formRef.value.formModel[searchCondition[i].value]
? formRef.value.formModel[searchCondition[i].value]
: props.detailData
? props.detailData[searchCondition[i].value]
: row
? row[searchCondition[i].value]
: ''
//
let isNull = false
if (_searchCondition[searchCondition[i].key] == '' || _searchCondition[searchCondition[i].key] == undefined) {
isNull = true
}
if (isNull) {
message.warning(searchCondition[i].message?searchCondition[i].message:'前置条件未选择!')
return
}
} else {
//
if (searchCondition[i].isSearch) {
filters.push({
action: searchCondition[i].action,
column: searchCondition[i].key,
value: searchCondition[i].value
})
} else {
_searchCondition[searchCondition[i].key] = searchCondition[i].value
}
}
}
if (filters.length > 0) {
_searchCondition.isSearch = true
_searchCondition.filters = filters
}
}
const _searchTableTitle = searchTitle
const _searchTableAllSchemas = searchAllSchemas
const _searchTablePage = searchPage
searchTableRef.value.open(
_searchTableTitle,
_searchTableAllSchemas,
_searchTablePage,
formField,
searchField,
multiple,
type,
row,
_searchCondition,
false,
searchFilterButtonHide.value
)
}
//
// val row
const searchTableSuccess = (formField, searchField, val, type, row) => {
emit('searchTableSuccess', formField, searchField, val, formRef.value, type, row)
}
/** 打开弹窗 */
const open = async (type: string, row?: any, masterParmas?: any, titleName?: any) => {
dialogVisible.value = true
if (titleName) {
dialogTitle.value = t('action.' + titleName)
} else {
dialogTitle.value = t('action.' + type)
}
formType.value = type
resetForm()
//
// masterIdnumber
if (masterParmas) {
if (!row) {
row = {
masterId: masterParmas.masterId,
number: masterParmas.number
}
}
}
if (row?.id || row?.masterId) {
formLoading.value = true
try {
nextTick(() => {
formRef.value.setValues(row)
})
} finally {
formLoading.value = false
}
}
}
defineExpose({ open, formRef, opensearchTable, dialogVisible, formLoading }) // open
/** 弹窗按钮 */
let Butttondata:any = []
if (props.isShowFooterButtton) {
Butttondata = [
defaultButtons.formSaveBtn(null), //
defaultButtons.formCloseBtn(null) //
]
}
/** 按钮事件 */
const buttonBaseClick = (val) => {
//
if (val == 'save') {
submitForm()
}
//
else if (val == 'close') {
dialogVisible.value = false
}
}
/** 提交表单 */
// const emit = defineEmits(['success']) // success
const tableFormRef = ref()
const submitForm = async () => {
const elForm = unref(formRef)?.getElFormRef()
//
if (!elForm) return
const valid = await elForm.validate()
if (!valid) return
//
if (props.isBusiness) {
formLoading.value = true
if (formType.value == 'create') {
const validateForm = await tableFormRef.value.validateForm()
formRef.value.setValues({status:'1'})
if (!validateForm && props.tableFormDataLength) {
if (props.tableData.length == 0) {
message.warning('请填写明细信息!')
formLoading.value = false
return
}
formLoading.value = false
return
}
//
try {
const data = unref(formRef)?.formModel
emit('submitForm', formType.value, data)
} finally {
}
} else {
//
try {
const data = unref(formRef)?.formModel
emit('submitForm', formType.value, data)
} finally {
}
}
} else {
//
formLoading.value = true
try {
const data = unref(formRef)?.formModel
emit('success', formType.value, data)
} finally {
formLoading.value = false
}
}
}
/** 重置表单 */
const resetForm = () => {
unref(formRef)?.resetFields()
}
//
const emit = defineEmits([
'success',
'tableSelectionChange',
'tableFormSelectOnBlur',
'extendedButtonsClick',
'formSelectChange',
'formSelectvVisibleChange',
'tableSortChange',
'selectCallback',
'handleTableSelect',
'handleDeleteTable',
'handleAddTable',
'inpuFocus',
'searchTableSuccess',
'opensearchTable',
'submitForm',
'selectChange',
'selectChangeDetail',
'tableFormChange',
'buttonOperationClick',
'inputStringBlur',
'onChange',
'onBlur',
'inputNumberChange',
'formFormDateChange'
])
/**
* 监听改变事件
* @param field 当前操作字段
* @param cur 改变后值
*/
const onChange = (field, cur) => {
emit('onChange', field, cur)
}
/**
* 监听失焦事件
* @param field 当前操作字段
* @param e
*/
const onBlur = (field, e) => {
emit('onBlur', field, e)
}
</script>
<style lang="scss" scoped>
.table {
border: 1px solid #dedede;
border-radius: 8px;
padding: 10px;
width: calc(100% - 32px);
display: flex;
}
::v-deep(.el-table__body) {
padding: 10px 0px;
}
::v-deep(.el-table--default .el-table__cell) {
padding: 2px 0px;
border: none;
}
::v-deep(.el-table td.el-table__cell .el-form-item__content) {
display: flex !important;
align-items: center !important;
justify-content: center !important;
}
::v-deep(.el-table td.el-table__cell div) {
overflow: visible;
}
::v-deep(.el-icon) {
display: block;
}button
.button {
> div {
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
> div {
margin-left: 6px;
text-decoration: underline;
color: #409eff;
}
}
}
</style>

237
src/views/mes/orderDay/components/orderDetail.vue

@ -0,0 +1,237 @@
<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>
<ContentWrap>
<Descriptions
:data="detailData"
labelClassName="label-class-name"
label-align="left"
direction="vertical"
:column="8"
:schema="allSchemas.detailSchema"
:columns="2"
width="200px"
/>
</ContentWrap>
<el-tabs v-model="activeName" type="card" @tab-click="handleClick">
<el-tab-pane label="工艺路线信息" name="processRouteInfo">
<div class="mt-20px">
<el-space :size="10" spacer="|">
<span>名称<el-tag v-if="processRouteInfoSchema.processrouteInfo!=null">{{ processRouteInfoSchema.processrouteInfo.processName}} </el-tag></span>
<span>编码<el-tag v-if="processRouteInfoSchema.processrouteInfo!=null">{{ processRouteInfoSchema.processrouteInfo.processrouteCode}} </el-tag> </span>
<span>版本<el-tag v-if="processRouteInfoSchema.processrouteInfo!=null">{{ processRouteInfoSchema.processrouteInfo.routeVersion}} </el-tag> </span>
</el-space>
<el-divider />
<el-table
ref="tableRoute"
:data="nodeData"
:columns="nodeColumns"
border
stripe="true"
style="width: 100%"
>
<el-table-column prop="nodeSort" label="序号" align="center"/>
<el-table-column prop="preCode" label="前置工序" align="center">
<template #default="scope">
<div style="display: flex; align-items: center">
<el-tag
>{{ scope.row.preNodeName }}</el-tag
>
</div>
</template>
</el-table-column>
<el-table-column prop="processCode" label="当前工序" align="center" >
<template #default="scope">
<div style="display: flex; align-items: center">
<el-tag
>{{ scope.row.nodeName }}</el-tag
>
</div>
</template>
</el-table-column>
<el-table-column prop="nextCode" label="后置工序" align="center">
<template #default="scope">
<div style="display: flex; align-items: center">
<el-tag
>{{ scope.row.nextNodeName }}</el-tag
>
</div>
</template>
</el-table-column>
</el-table>
</div>
</el-tab-pane>
<el-tab-pane label="BOM信息" name="bomInfo"
><div class="mt-20px">
<el-table
ref="tableRoute"
:data="bomInfoSchemaData"
style="width: 100%"
>
<el-table-column prop="productItemCode" label="父物料代码" align="center" />
<el-table-column prop="componentItemCode" label="子物料代码" align="center" />
<el-table-column prop="componentUom" label="子物料计量单位" align="center" />
<el-table-column prop="componentQty" label="子物料数量" align="center"/>
<el-table-column prop="version" label="版本" align="center" />
</el-table> </div
></el-tab-pane>
<el-tab-pane label="班组人员信息" name="workTeamInfo"
><div class="mt-20px">
<el-table
ref="tableRoute"
:data="workTeamInfoSchema"
style="width: 100%"
>
<el-table-column prop="id" label="ID" align="center" />
<el-table-column prop="userName" label="人员工号" align="center" />
<el-table-column prop="nickeName" label="显示名称" align="center" />
<el-table-column prop="workGroup" label="所属班组" align="center" />
<el-table-column prop="lineCode" label="所属产线" align="center" />
<el-table-column prop="abliity" label="技能岗位" align="center" />
</el-table> </div
></el-tab-pane>
<el-tab-pane label="设备信息" name="deviceInfo"
><div class="mt-20px">
<el-table
ref="tableRoute"
:data="deviceInfoSchema"
style="width: 100%"
>
<el-table-column prop="productItemCode" label="设备编码" align="center" />
<el-table-column prop="componentItemCode" label="设备名称" align="center" />
<el-table-column prop="componentUom" label="所属车间" align="center" />
<el-table-column prop="componentQty" label="所属产线" align="center"/>
<el-table-column prop="status" label="设备状态" align="center" />
</el-table> </div
></el-tab-pane>
</el-tabs>
</el-drawer>
</div>
</template>
<script lang="ts" setup>
import * as OrderDayApi from '@/api/mes/orderDay'
defineOptions({ name: 'orderDetail' })
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 activeName = ref('processRouteInfo')
const props = defineProps({
allSchemas: {
type: Object,
required: true,
default: null
}
})
const detailData = ref(props.allSchemas)
const bomInfoSchemaData = ref( [{productItemCode:'----',
componentItemCode:'----',
componentUom:'----',
componentQty:'----',
version:'----'}])
const workTeamInfoSchema = ref( [] )
const deviceInfoSchema = ref([])
const processRouteInfoSchema = ref({
processrouteInfo: { processrouteCode: '', processName: '', routeVersion: '' },
processrouteNodeDetailList: []
})
const isShowDrawer = ref(false)
const detailLoading = ref(false)
const nodeColumns = ref([
{
label: '序号',
field: 'nodeSort'
},
{
label: '当前工序',
field: 'processCode'
},
{
label: '前置工序',
field: 'preCode'
},
{
label: '后置工序',
field: 'nextCode'
}
])
const nodeData = ref([{}])
// Tabs
const current = ref(0)
const handleClick = (item, index) => {
current.value = index
emit('changeTabs', item)
}
/** 打开弹窗 */
const formRef = ref()
const titleNameRef = ref()
const titleValueRef = ref()
const openDetail = async (row: any, titleName: any, titleValue: any, tableName: any) => {
titleNameRef.value = titleName
titleValueRef.value = titleValue
isShowDrawer.value = true
if (row) {
detailLoading.value = true
try {
detailData.value = row
getDetailData(row)
} finally {
detailLoading.value = false
}
}
}
defineExpose({ openDetail, formRef }) // open
const getDetailData = async (row: any) => {
processRouteInfoSchema.value = await OrderDayApi.getProcessroutesDetail(row.processrouteCode)
let pam={code:row.standardBom.slice(0,row.standardBom.lastIndexOf('-')),version:row.standardBom.slice(row.standardBom.lastIndexOf('-')+1)}
//console.log(pam)
bomInfoSchemaData.value = await OrderDayApi.getPlanBom(pam)
nodeData.value = processRouteInfoSchema.value.processrouteNodeDetailList
}
//
const emit = defineEmits([
'searchTableSuccessDetail',
'changeTabs',
'selectChangeDetail',
'detailOpenForm',
'tableFormButton',
'openImage',
'onBlur',
'detailBasicFormOnChange',
'formFormDateChange'
])
//
watch()
</script>
<style lang="scss">
.el-drawer__body {
background: #f5f5f5 !important;
}
::v-deep(.label-class-name) {
color: #dedede;
}
</style>
<style scoped lang="scss"></style>

332
src/views/mes/orderDay/components/schedule.vue

@ -0,0 +1,332 @@
<template>
<Dialog
:title="dialogTitle"
v-model="dialogVisible"
:width="dialogWidth"
:close-on-click-modal="false"
>
<ContentWrap>
<Descriptions
:data="detailData"
labelClassName="label-class-name"
label-align="left"
direction="vertical"
:column="8"
:schema="allSchemas.detailSchema"
:columns="2"
width="200px"
/>
</ContentWrap>
<div style="height: 480px; overflow-y: auto">
<el-tabs type="border-card" :active-name="activeName">
<el-tab-pane label="调整工艺路线" name="process">
<el-container>
<el-aside>
<el-card style="max-width: 480px">
<template #header>
<div class="card-header">
<span>原有工序</span>
</div>
</template>
<el-table :data="processData" ref="tableProcess" style="width: 100%; height: 80%">
<el-table-column prop="name" label="工序名称">
<template #default="scope">
<el-button size="mini" text @click="userAddNode(scope.row)" style="width: 100%"
>{{ scope.row.name }}[{{ scope.row.code }}]</el-button
>
</template>
</el-table-column>
<el-table-column prop="code" label="工序编码" width="180" v-if="false" />
</el-table>
</el-card>
</el-aside>
<el-main><div ref="graphContainer"></div></el-main>
<!-- <el-aside
><el-card style="max-width: 480px">
<template #header>
<div class="card-header">
<span>可选工序</span>
</div>
</template>
<p v-for="o in 4" :key="o" class="text item">{{ 'List item ' + o }}</p>
<template #footer>Footer content</template>
</el-card></el-aside
> -->
</el-container>
</el-tab-pane>
<el-tab-pane label="调整临时BOM" name="boms">
<TableForm
ref="tableProcess"
:table-data="tableDataProcess"
:table-fields="tableColumnsProcess"
:loading="loading"
@handleAddTable="handleAddTable(tableDataProcess)"
@handle-delete-table="handleDeleteTable(item, index,tableDataProcess)"
/>
</el-tab-pane>
<el-tab-pane label="调整可用设备" name="device"
><TableForm
ref="tableProcess"
:table-data="tableDataProcess"
:table-fields="tableColumnsProcess"
:loading="loading"
@handleAddTable="handleAddTable(tableDataProcess)"
@handle-delete-table="handleDeleteTable(item, index,tableDataProcess)"
/></el-tab-pane>
<el-tab-pane label="调整班组人员" name="worker"
><TableForm
ref="tableProcess"
:table-data="tableDataProcess"
:table-fields="tableColumnsProcess"
:loading="loading"
@handleAddTable="handleAddTable(tableDataProcess)"
@handle-delete-table="handleDeleteTable(item, index,tableDataProcess)"
/></el-tab-pane>
</el-tabs>
</div>
<template #footer>
<el-button @click="dialogVisible = false">发布计划</el-button>
</template>
</Dialog>
<!-- <SearchTable ref="searchTableRef" @searchTableSuccess="searchTableSuccess" /> -->
</template>
<script lang="ts" setup>
defineOptions({ name: 'sechledDetail' })
//import { dateFormatter } from '@/utils/formatTime'
import {
start_node,
end_node,
createGraph,
getNewNode
} from '@/views/mes/processroute/components/graphbase.data'
import * as ProcessrouteApi from '@/api/mes/processroute'
import { Graph } from '@antv/x6'
const graphContainer = ref<HTMLElement | null>(null)
const graph = ref<Graph>()
const message = useMessage() //
const { t } = useI18n() //
const activeName = ref('process')
const loading = ref(true)
const processData=ref()
const props = defineProps({
//
isSearchFilterButtonHide: {
type: Boolean,
default: false
},
//
basicFormWidth: {
type: String,
default: ''
},
allSchemas: {
type: Object,
required: true,
default: null
}
})
const detailData = ref(props.allSchemas)
const route = useRoute() //
const routeName = ref()
const tableDataProcess = ref([
{
type: '',
value: ''
}
])
const tableColumnsProcess = ref([
{
label: '结束时间',
field: 'endTime',
sort: 'custom',
isReadonly: true,
form: {
component: 'TimePicker',
componentProps: {
type: 'time',
dateFormat: 'HH:mm'
}
}
},
{
label: '生产模式',
field: 'taskMode',
width: '80px',
sort: 'custom',
dictType: 'mes_task_mode',
dictClass: 'string',
form: {
component: 'Select',
value: 'ASSIGN'
}
}
])
//
const handleAddTable = (name:any) => {
message.success('添加成功')
let tableFormKeys = {
type: '',
value: ''
}
name.push(JSON.parse(JSON.stringify(tableFormKeys)))
}
//
const handleDeleteTable = (item, index,name) => {
console.log(name)
name.splice(index, 1)
}
routeName.value = route.name
routeName.value = routeName.value.substring(0, routeName.value.length - 4) + 'Detail'
//const updateKey = ref(0)
const dialogWidth = ref()
// if (props.basicFormWidth) {
// dialogWidth.value = props.basicFormWidth + '%'
// } else {
// dialogWidth.value = props.isBusiness ? '60%' : '40%'
// }
const dialogVisible = ref(false) //
const dialogTitle = ref('') //
let graphJson = {
cells: [
{
position: {
x: 40,
y: 40
},
size: {
width: 100,
height: 40
},
attrs: {
text: {
text: 'Hello'
},
body: {
stroke: '#8f8f8f',
strokeWidth: 1,
fill: '#fff',
rx: 6,
ry: 6
}
},
visible: true,
shape: 'rect',
id: 'adbc20c6-96e4-4792-9e5b-42df6066cff0',
zIndex: 1
},
{
position: {
x: 240,
y: 180
},
size: {
width: 100,
height: 40
},
attrs: {
text: {
text: 'World'
},
body: {
stroke: '#8f8f8f',
strokeWidth: 1,
fill: '#fff',
rx: 6,
ry: 6
}
},
visible: true,
shape: 'ellipse',
id: '9b1f1e94-a01f-4902-bfae-4e6e81029261',
zIndex: 2
},
{
shape: 'edge',
attrs: {
line: {
stroke: '#8f8f8f',
strokeWidth: 1
}
},
id: '8fd50f13-22ba-41ff-b54a-eb6d8553c3d7',
source: {
cell: 'adbc20c6-96e4-4792-9e5b-42df6066cff0'
},
target: {
cell: '9b1f1e94-a01f-4902-bfae-4e6e81029261'
},
labels: [
{
attrs: {
label: {
text: 'X6'
}
}
}
],
zIndex: 3
}
]
}
/** 打开弹窗 */
const open = async (type: string, row?: any, titleName?: any) => {
dialogVisible.value = true
detailData.value = row
dialogWidth.value = props.basicFormWidth + '%'
//console.log(props.allSchemas)
//console.log(row)
if (titleName) {
dialogTitle.value = t('action.' + titleName)
} else {
dialogTitle.value = t('action.' + type)
}
nextTick(() => {
graph.value = createGraph(graphContainer.value as HTMLElement, false, dialogWidth.value-200, 320)
// graph.value.on('node:click', ({ e, x, y, node, view }) => {
// nodeClick(e, x, y, node, view)
// })
graph.value?.fromJSON(graphJson.cells)
})
}
//
const userAddNode = (row) => {
if (graph && graph.value != undefined) {
let node_template = getNewNode(row.code, row.name, row.code)
node_template.x = end_node.value.x - 100
node_template.y = end_node.value.y + 100
let noden = graph.value.addNode(node_template)
if (graph.value.getNodes().length == 1) {
let start = graph.value.addNode(start_node.value)
let end = graph.value.addNode(end_node.value)
graph.value.addEdge({
id: 'startEdge',
source: start.id, // ID
target: noden.id
})
graph.value.addEdge({
id: 'endEdge',
source: noden.id, // ID
target: end.id
})
}
}
}
defineExpose({ open }) // open
</script>
<style lang="scss">
.el-drawer__body {
background: #f5f5f5 !important;
}
::v-deep(.label-class-name) {
color: #dedede;
}
</style>
<style scoped lang="scss"></style>

331
src/views/mes/orderDay/index.vue

@ -0,0 +1,331 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search
:schema="OrderDay.allSchemas.searchSchema"
@search="setSearchParams"
@reset="setSearchParams"
/>
</ContentWrap>
<!-- 列表头部 -->
<TableHead
:HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick"
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="OrderDay.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 #planNoDay="{ row }">
<el-button type="primary" link @click="openDetail(row, '计划编码', row.planNoDay)">
<span>{{ row.planNoDay }}</span>
</el-button>
</template>
<template #action="{ row }">
<ButtonBase
:Butttondata="butttondata(row)"
@button-base-click="buttonTableClick($event, row)"
/>
</template>
</Table>
</ContentWrap>
<!-- 表单弹窗添加/修改 -->
<BasicFormV2
ref="basicFormRef"
@success="formsSuccess"
:rules="OrderDayRules"
:formAllSchemas="OrderDay.allSchemas"
:apiUpdate="OrderDayApi.updateOrderDay"
:apiCreate="OrderDayApi.createOrderDay"
@searchTableSuccess="searchTableSuccess"
:isBusiness="false"
:isSearchFilterButtonHide="true"
/>
<!-- 详情 -->
<orderDetail ref="detailRef" :all-schemas="OrderDay.allSchemas" />
<scheduleDetail ref="scheduleDetailRef" :all-schemas="OrderDay.allSchemas" :basicFormWidth="75"/>
<!-- 导入 -->
<ImportForm
ref="importFormRef"
url="/mes/orderday/import"
:importTemplateData="importTemplateData"
@success="importSuccess"
/>
</template>
<script setup lang="ts">
import download from '@/utils/download'
import { OrderDay,OrderDayRules } from './orderDay.data'
import * as OrderDayApi from '@/api/mes/orderDay'
import BasicFormV2 from './components/BasicFormV2.vue'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import TableHead from '@/components/TableHead/src/TableHead.vue'
import ImportForm from '@/components/ImportForm/src/ImportForm.vue'
import orderDetail from './components/orderDetail.vue'
import scheduleDetail from './components/schedule.vue'
defineOptions({ name: 'MesOrderDay' })
const message = useMessage() //
const { t } = useI18n() //
const route = useRoute() //
const routeName = ref()
routeName.value = route.name
const tableColumns = ref(OrderDay.allSchemas.tableColumns)
const lineOptions=ref([])
const processRouteOptions=ref([])
const bomOptions=ref([])
//** */
const getProcessroutes = async (code: String) => {
processRouteOptions.value = await OrderDayApi.getProcessroutes(code)
OrderDay.allSchemas.formSchema.forEach(item => {
if (item.field == 'processrouteCode') {
console.log('processrouteCode',item.field)
item.componentProps.options = processRouteOptions.value
}
})
}
//** 线 */
const getProductlines = async (code: String) => {
lineOptions.value = await OrderDayApi.getProductlines(code)
OrderDay.allSchemas.formSchema.forEach(item => {
if (item.field == 'lineCode') {
item.componentProps.options = lineOptions.value
}
})
}
const getBoms = async (code: String) => {
bomOptions.value = await OrderDayApi.getBoms(code)
OrderDay.allSchemas.formSchema.forEach(item => {
if (item.field == 'standardBom') {
item.componentProps.options = bomOptions.value
}
})
}
//
const searchTableSuccess = (formField, searchField, val, formRef) => {
nextTick(() => {
const setV = {}
setV[formField] = val[0][searchField]
formRef.setValues(setV)
if(formField=='productCode'){
//formRef.setValues({standardBom:'bomddd'})
getProcessroutes(val[0][searchField])
getBoms(val[0][searchField])
}
if(formField=='workroomCode'){
getProductlines(val[0][searchField])
}
})
}
//
const updataTableColumns = (val) => {
tableColumns.value = val
}
const { tableObject, tableMethods } = useTable({
getListApi: OrderDayApi.getOrderDayPage //
})
//
const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultAddBtn({hasPermi:'mes:orderDay:create'}), //
defaultButtons.defaultImportBtn({hasPermi:'mes:orderDay:import'}), //
defaultButtons.defaultExportBtn({hasPermi:'mes:orderDay: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 isShowMainButton = (row,val) => {
//console.log('row',row)
if (val.indexOf(row.status) > -1) {
return false
} else {
return true
}
}
// -
// -
const butttondata = (row) => {
//console.log('row2',row)
return [
defaultButtons.mainListEditBtn({ hide: isShowMainButton(row,['1']),hasPermi:'mes:orderDay:update'}), //
defaultButtons.mainListDeleteBtn({ hide: isShowMainButton(row,['1']),hasPermi:'mes:orderDay:delete'}), //
defaultButtons.mainListHandleBtn({label: '发布',
name: 'publish',
hide: isShowMainButton(row,['1']),
type: 'warning',
icon: '',
color: '',
hasPermi: ''}), //
// defaultButtons.mainListHandleBtn({label: '',
// name: 'publish',
// hide: isShowMainButton(row,['2']),
// type: 'warning',
// icon: '',
// color: '',
// hasPermi: ''}), //
defaultButtons.mainListHandleBtn({label: '终止',
name: 'stopPlan',
hide: isShowMainButton(row,['1','2','3']),
type: 'warning',
icon: '',
color: '',
hasPermi: ''}), //
]
}
// -
const buttonTableClick = async (val, row) => {
if (val == 'edit') { //
openForm('update', row)
} else if (val == 'delete') { //
handleDelete(row.id)
} else if(val=='schedule'){ //
openScheduledDetail( '发布计划', row,row.planNoDay)
}
}
/** 添加/修改操作 */
const basicFormRef = ref()
const openForm = (type: string, row?: any) => {
basicFormRef.value.open(type, row)
}
// form
const formsSuccess = async (formType,data) => {
var isHave =OrderDay.allSchemas.formSchema.some(function (item) {
return item.field === 'activeTime' || item.field === 'expireTime';
});
if(isHave){
if(data.activeTime && data.expireTime && data.activeTime >=data.expireTime){
message.error('失效时间要大于生效时间')
return;
}
}
if(data.activeTime==0)data.activeTime = null;
if(data.expireTime==0)data.expireTime = null;
if (formType === 'create') {
await OrderDayApi.createOrderDay(data)
message.success(t('common.createSuccess'))
} else {
await OrderDayApi.updateOrderDay(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, 'basicOrderDay')
}
/** 发布操作 */
const scheduleDetailRef = ref()
const openScheduledDetail = (row: any, titleName: any, titleValue: any) => {
scheduleDetailRef.value.open(row, titleName, titleValue)
}
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
try {
//
await message.delConfirm()
//
await OrderDayApi.deleteOrderDay(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 OrderDayApi.exportOrderDay(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 OrderDayApi.importTemplate()
})
</script>

327
src/views/mes/orderDay/orderDay.data.ts

@ -0,0 +1,327 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime'
import * as ItembasicApi from '@/api/wms/itembasic'
import { Itembasic } from '@/views/wms/basicDataManage/itemManage/itembasic/itembasic.data'
import * as WorkshopApi from '@/api/wms/workshop'
import { Workshop } from '@/views/wms/basicDataManage/factoryModeling/workshop/workshop.data'
import { on } from '@/utils/domUtils'
// 表单校验
export const OrderDayRules = reactive({
planNoDay: [
{ required: true, message: '请输入一个日计划编号', trigger: 'blur' }
],
planNoMonth: [
{ required: true, message: '请输入一个月计划编号', trigger: 'blur' }
],
productCode: [
{ required: true, message: '请选择一个产品', trigger: 'blur' }
],
workroomCode: [
{ required: true, message: '请选择一个车间', trigger: 'blur' }
],
lineCode: [
{ required: true, message: '请选择一个产线', trigger: 'blur' }
],
workMode: [
{ required: true, message: '请选择工单生成方式', trigger: 'blur' }
],
startTime: [
{ required: true, message: '请输入计划生产开始时间', trigger: 'blur' }
],
endTime: [
{ required: true, message: '请输入计划生产完成时间', trigger: 'blur' }
],
planDate: [
{ required: true, message: '请输入计划日期', trigger: 'blur' }
],
taskMode: [
{ required: true, message: '请选择一个生产方式', trigger: 'blur' }
],
})
export const OrderDay = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '主键',
field: 'id',
sort: 'custom',
isForm: false,
width: '60px',
},
{
label: '日计划单号',
field: 'planNoDay',
sort: 'custom',
isSearch: true,
required: true,
},
{
label: '月计划单号',
field: 'planNoMonth',
sort: 'custom',
isSearch: true,
required: false,
},
{
label: '状态',
field: 'status',
sort: 'custom',
isForm: false,
isTable: true,
isDetail:true,
isSearch: false,
width: '80px',
dictType: DICT_TYPE.MES_PLANDO_STATUS,
dictClass: 'string',
form: {
component: 'Select',
},
},
{
label: '产品编号',
field: 'productCode',
sort: 'custom',
isSearch: true,
required: true,
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '产品编码', // 输入框占位文本
searchField: 'code', // 查询弹窗赋值字段
searchTitle: '产品信息', // 查询弹窗标题
searchAllSchemas: Itembasic.allSchemas, // 查询弹窗所需类
searchPage: ItembasicApi.getItembasicPage, // 查询弹窗所需分页方法
isHideFilterButton:true,
searchCondition: [{
key: 'available',
value: 'TRUE',
isMainValue: false
},
{
key: 'type',
action: 'in', // 查询拼接条件
isSearch: true, // 使用自定义拼接条件
value: 'FG,SEMI',//,SEMI]
isMainValue: false
},
]
}
}
},
{
label: '车间编码',
field: 'workroomCode',
sort: 'custom',
isSearch: true,
required: true,
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '车间', // 输入框占位文本
searchField: 'code', // 查询弹窗赋值字段
searchTitle: '车间信息', // 查询弹窗标题
searchAllSchemas: Workshop.allSchemas, // 查询弹窗所需类
searchPage: WorkshopApi.getWorkshopPage, // 查询弹窗所需分页方法
searchCondition: [{
key: 'available',
value: 'TRUE',
isMainValue: false
}]
}
},
},
{
label: '产线编码',
field: 'lineCode',
sort: 'custom',
isSearch: true,
required: true,
form:{
component:'Select',
componentProps:{
options:[{lablel:'1',value:'1'}]
}
}
},
{
label: '计划数量',
field: 'planCount',
sort: 'custom',
required: true,
form: {
component: 'InputNumber',
value: 1
},
},
{
label: '工艺路线编码',
field: 'processrouteCode',
sort: 'custom',
form: {
component:'Select',
componentProps: {
options: []
}
}
},
{
label: '临时工艺',
field: 'tempProcessroute',
sort: 'custom',
width: '80px',
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string',
form: {
component: 'Switch',
value: 'TRUE',
componentProps: {
inactiveValue: 'FALSE',
activeValue: 'TRUE'
}
},
},
{
label: 'BOM编码',
field: 'standardBom',
sort: 'custom',
form: {
component:'Select',
componentProps: {
options: [{lablel:'bom',value:'bom'}]
}
}
},
{
label: '替代BOM',
field: 'tempBom',
sort: 'custom',
width: '80px',
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string',
form: {
component: 'Switch',
value: 'TRUE',
componentProps: {
inactiveValue: 'FALSE',
activeValue: 'TRUE',
}
}
},
{
label: '工单模式',
field: 'workMode',
width: '80px',
sort: 'custom',
dictType: DICT_TYPE.MES_WORKBILL_MODEL,
dictClass: 'string',
form: {
component: 'Select',
value: 'BATCH',
},
},
{
label: '计划日期',
field: 'planDate',
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: 'startTime',
sort: 'custom',
formatter: dateFormatter,
required: true,
form: {
component: 'TimePicker',
componentProps: {
type: 'time',
dateFormat: 'HH:mm',
//valueFormat: 'x',
}
},
},
{
label: '结束时间',
field: 'endTime',
sort: 'custom',
formatter: dateFormatter,
isReadonly:true,
form: {
component: 'TimePicker',
componentProps: {
type: 'time',
dateFormat: 'HH:mm',
}
},
},
{
label: '生产模式',
field: 'taskMode',
width : '80px',
sort: 'custom',
dictType: DICT_TYPE.MES_TASK_MODE,
dictClass: 'string',
form: {
component: 'Select',
value:'ASSIGN'
},
},
{
label: '创建时间',
field: 'createTime',
sort: 'custom',
formatter: dateFormatter,
isSearch: true,
search: {
component: 'DatePicker',
componentProps: {
valueFormat: 'YYYY-MM-DD HH:mm:ss',
type: 'datetime',
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')]
}
},
isForm: false,
},
{
label: '创建者',
field: 'creator',
sort: 'custom',
isSearch: false,
isForm: false,
},
{
label: '备注',
field: 'remark',
sort: 'custom',
isSearch: false,
isTable:false,
},
{
label: '操作',
field: 'action',
isForm: false,
table: {
width: 200,
fixed: 'right'
}
}
]))

102
src/views/mes/processroute/components/configDialog.vue

@ -43,7 +43,28 @@
<el-table-column prop="code" label="工序编码" width="180" v-if="false" />
</el-table>
</el-col>
<el-col :span="18"><div ref="graphContainer"></div></el-col>
<el-col :span="12"><div ref="graphContainer"></div>
</el-col>
<el-col :span="6">
<ContentWrap class="w-[100%] ml-16px">
<!-- 附件组件 -->
<Annex
:annexData="annexData"
@handleAnnexSuccess="handleAnnexSuccess"
@deleteAnnexSuccess="deleteAnnexSuccess"
:upData="remarksData.data"
/>
<!-- 备注组件 -->
<Remarks
:remarksData="remarksData"
class="mt-20px"
@remarksSubmitScuess="remarksSubmitScuess"
/>
<!-- 变更记录组件 -->
<ChangeRecord :changeRecordData="changeRecordData" class="mt-20px" />
</ContentWrap>
</el-col>
</el-row>
<el-row style="height: 150px" :gutter="5">
<el-col :span="6">
@ -53,9 +74,9 @@
<span>产品信息</span>
</div>
</template>
<p>产品名称{{ productData.name }}</p>
<p>产品编码{{ productData.code }}</p>
<p>产品描述{{ productData.desc1 }}</p>
<p >产品名称<span v-if="productData!=null">{{ productData.name }}</span></p>
<p>产品编码<span v-if="productData!=null">{{ productData.code }}</span></p>
<p>产品描述<span v-if="productData!=null">{{ productData.desc1 }}</span></p>
</el-card>
</el-col>
<el-col :span="6"
@ -94,12 +115,14 @@
</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 * as RemarkApi from '@/api/wms/remark'
import * as FileApi from '@/api/wms/file'
import { start_node, end_node, createGraph, registerNodes, getNewNode } from './graphbase.data'
import * as ProcessrouteApi from '@/api/mes/processroute'
import { Search } from '@/components/Search'
import { Graph } from '@antv/x6'
//import { async } from '@antv/x6/lib/registry/marker/async'
//import { object } from 'vue-types'
const graphContainer = ref<HTMLElement | null>(null)
defineOptions({ name: 'ProcessRouteConfig' })
const isShowDrawer = ref(false)
@ -123,8 +146,18 @@ const deviceList = ref([
{ name: '设备', code: '0000' },
{ name: '设备', code: '0000' }
]) //
const workerList = ref([{ name: '--' }, { name: '--' }]) //
const workStationData = ref({ name: '工位', code: '' }) //
//
const annexData = reactive({
annexList: []
})
//
const remarksData = reactive({
remarksList: [],
data: {}
})
//
const graph = ref<Graph>()
const openDetail = async (rowData: any) => {
@ -132,16 +165,24 @@ const openDetail = async (rowData: any) => {
titleNameRef.value = rowData.value.processrouteCode
titleValueRef.value = rowData.value.processName
processRouteId.value = rowData.value.id
remarksData.data = {
tableId: rowData.value.id,
tableName: rowData.value.processrouteCode
}
if(rowData){
let graphJson = JSON.parse(rowData.value.graphJson)
isShowDrawer.value = true
nextTick(() => {
graph.value = createGraph(graphContainer.value as HTMLElement)
graph.value = createGraph(graphContainer.value as HTMLElement,true,800,600)
graph.value.on('node:click', ({ e, x, y, node, view }) => {
nodeClick(e, x, y, node, view)
})
graph.value.fromJSON(graphJson.cells)
})
getItembasicInfo(rowData.value.productCode)
getRemarkList()
getFileList()
getChangeRecordList()}
}
//
const handleDrawerClose = () => {
@ -243,7 +284,7 @@ const userAddNode = (row) => {
//-------
defineExpose({ openDetail, createGraph }) // open
onMounted(() => {
registerNodes()
//registerNodes()
getProcessList()
})
@ -274,6 +315,49 @@ const saveResult = async () => {
emit('close')
//return res
}
//
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 changeRecordData = reactive({
changeRecordList: []
})
//
const getFileList = async () => {
detailLoading.value = true
try {
annexData.annexList = await FileApi.getFileList(remarksData.data)
} finally {
detailLoading.value = false
}
}
/** 添加附件 */
const handleAnnexSuccess = () => {
getFileList()
getChangeRecordList()
}
//
const deleteAnnexSuccess = async () => {
getFileList()
getChangeRecordList()
}
//
onUnmounted(() => {})
const emit = defineEmits(['close'])

8
src/views/mes/processroute/components/graphbase.data.ts

@ -163,11 +163,13 @@ export const end_node = ref({
shape: 'base-node',
ports: [{ id: 'in', group: 'in' }]
})
export const createGraph = (graphContainer: any) => {
export const createGraph = (graphContainer: any,autoResizer:boolean,width:number,height:number) => {
const ret = ref<Graph>()
ret.value= new Graph({
container: graphContainer,
autoResize: true,
autoResize: autoResizer,
width:width,
height:height,
background: { color: '#F2F7FA' }, // 创建画布时初始化背景相关配置对象
grid: { size: 10, visible: true, type: 'mesh' }, //创建画布时,通过配置对象来设置背景网格
mousewheel: {
@ -255,6 +257,8 @@ export const createGraph = (graphContainer: any) => {
ret.value.on('edge:mouseleave', ({ cell }) => {
cell.removeTools()
})
Graph.registerNode('process-node', process_node.value, true)
Graph.registerNode('base-node', base_node.value, true)
return ret.value
}
//注册节点

245
src/views/mes/qualityclass/index.vue

@ -0,0 +1,245 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="Qualityclass.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
</ContentWrap>
<!-- 列表头部 -->
<TableHead
:HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick"
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="Qualityclass.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 #code="{row}">
<el-button type="primary" link @click="openDetail(row, '代码', row.code)">
<span>{{ row.code }}</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="QualityclassRules"
:formAllSchemas="Qualityclass.allSchemas"
:apiUpdate="QualityclassApi.updateQualityclass"
:apiCreate="QualityclassApi.createQualityclass"
@searchTableSuccess="searchTableSuccess"
:isBusiness="false"
/>
<!-- 详情 -->
<Detail ref="detailRef" :isBasic="true" :allSchemas="Qualityclass.allSchemas" />
<!-- 导入 -->
<ImportForm ref="importFormRef" url="/mes/qualityclass/import" :importTemplateData="importTemplateData" @success="importSuccess" />
</template>
<script setup lang="ts">
import download from '@/utils/download'
import { Qualityclass,QualityclassRules } from './qualityclass.data'
import * as QualityclassApi from '@/api/mes/qualityclass'
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'
defineOptions({ name: 'QmsQualityclass' })
const message = useMessage() //
const { t } = useI18n() //
const route = useRoute() //
const routeName = ref()
routeName.value = route.name
const tableColumns = ref(Qualityclass.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: QualityclassApi.getQualityclassPage //
})
//
const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultAddBtn({hasPermi:'mes:qualityclass:create'}), //
defaultButtons.defaultImportBtn({hasPermi:'mes:qualityclass:import'}), //
defaultButtons.defaultExportBtn({hasPermi:'mes:qualityclass:export'}), //
defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), //
// {
// label: '',
// name: 'zdy',
// hide: false,
// type: 'primary',
// icon: 'Select',
// color: ''
// },
]
//
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:qualityclass:update'}), //
defaultButtons.mainListDeleteBtn({hasPermi:'mes:qualityclass: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) => {
console.log(row)
basicFormRef.value.open(type, row)
}
// form
const formsSuccess = async (formType,data) => {
var isHave =Qualityclass.allSchemas.formSchema.some(function (item) {
return item.field === 'activeTime' || item.field === 'expireTime';
});
if(isHave){
if(data.activeTime && data.expireTime && data.activeTime >=data.expireTime){
message.error('失效时间要大于生效时间')
return;
}
}
if(data.activeTime==0)data.activeTime = null;
if(data.expireTime==0)data.expireTime = null;
if (formType === 'create') {
await QualityclassApi.createQualityclass(data)
message.success(t('common.createSuccess'))
} else {
await QualityclassApi.updateQualityclass(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, 'basicQualityclass')
}
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
try {
//
await message.delConfirm()
//
await QualityclassApi.deleteQualityclass(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 QualityclassApi.exportQualityclass(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 QualityclassApi.importTemplate()
})
</script>

152
src/views/mes/qualityclass/qualityclass.data.ts

@ -0,0 +1,152 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime'
// 表单校验
export const QualityclassRules = reactive({
concurrencyStamp: [required],
code: [{ required: true, message: '请输入代码', trigger: 'blur' }],
name: [required],
})
export const Qualityclass = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '删除时间',
field: 'deleteTime',
sort: 'custom',
formatter: dateFormatter,
isSearch: false,
isTable: false,
isForm:false,
isDetail:false,
search: {
component: 'DatePicker',
componentProps: {
valueFormat: 'YYYY-MM-DD HH:mm:ss',
type: 'daterange',
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')]
}
},
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
valueFormat: 'x'
}
},
},
{
label: '主键',
field: 'id',
sort: 'custom',
isForm: false,
isTable: false,
isDetail:false
},
{
label: '并发乐观锁',
field: 'concurrencyStamp',
sort: 'custom',
isSearch: false,
isTable: false,
isForm:false,
isDetail:false,
form: {
component: 'InputNumber',
value: 0
},
},
{
label: '创建时间',
field: 'createTime',
sort: 'custom',
formatter: dateFormatter,
isSearch: false,
isTable: false,
isDetail:false,
search: {
component: 'DatePicker',
componentProps: {
valueFormat: 'YYYY-MM-DD HH:mm:ss',
type: 'daterange',
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')]
}
},
isForm: false,
},
{
label: '删除用户名',
field: 'deleter',
sort: 'custom',
isSearch: false,
isTable: false,
isForm: false,
isDetail:false
},
{
label: '位置ID',
field: 'siteId',
sort: 'custom',
isSearch: false,
isTable: false,
isForm: false,
isDetail:false,
form: {
component: 'InputNumber',
value: 0
},
},
{
label: '编码',
field: 'code',
sort: 'custom',
isSearch: true,
},
{
label: '编码名称',
field: 'name',
sort: 'custom',
isSearch: true,
},
{
label: '分组类别',
field: 'groupCode',
sort: 'custom',
isSearch: true,
},
{
label: '状态',
field: 'status',
sort: 'custom',
dictType: DICT_TYPE.QUALIFY_STATUS,
dictClass: 'string',
isForm: true,
isSearch: true,
isTable: true,
form: {
component: 'Switch',
value: '2',
componentProps: {
inactiveValue: '2',
activeValue: '1'
}
},
},
{
label: '操作',
field: 'action',
isForm: false,
isDetail:false,
table: {
width: 150,
fixed: 'right'
}
},
{
label: '备注',
field: 'remark',
sort: 'custom',
isSearch: false,
isTable: false
}
]))

297
src/views/mes/qualityform/index.vue

@ -0,0 +1,297 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="Qualityform.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
</ContentWrap>
<!-- 列表头部 -->
<TableHead
:HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick"
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="Qualityform.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 #formNo="{row}">
<el-button type="primary" link @click="openDetail(row, '表单编号', row.formNo)">
<span>{{ row.formNo }}</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="QualityformRules"
:formAllSchemas="Qualityform.allSchemas"
:apiUpdate="QualityformApi.updateQualityform"
:apiCreate="QualityformApi.createQualityform"
@searchTableSuccess="searchTableSuccess"
:isBusiness="false"
/>
<!-- 详情 -->
<Detail ref="detailRef"
:isBasic="false"
:allSchemas="Qualityform.allSchemas"
:detailAllSchemas="QualityformDetail.allSchemas"
:detailAllSchemasRules="QualityformDetailRules"
:apiPage="QualityformDetailApi.getQualityformdetailPage"
:apiCreate="QualityformDetailApi.createQualityformdetail"
:apiUpdate="QualityformDetailApi.updateQualityformdetail"
:apiDelete="QualityformDetailApi.deleteQualityformdetail"
:detailButtonIsShowAdd="true"
:detailButtonIsShowEdit="true"
:detailButtonIsShowDelete="true"
@handleDeleteDetail="handleDeleteDetail"
@handleCreateDetail="handleCreateDetail"
@searchTableSuccessDetail="searchTableSuccessDetail"
:key="count"
/>
<!-- 导入 -->
<ImportForm ref="importFormRef" url="/mes/qualityform/import" :importTemplateData="importTemplateData" @success="importSuccess" />
</template>
<script setup lang="ts">
import download from '@/utils/download'
import { Qualityform,QualityformRules,QualityformDetail,QualityformDetailRules } from './qualityform.data'
import * as QualityformApi from '@/api/mes/qualityform'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import * as QualityformDetailApi from '@/api/mes/qualityformdetail'
import TableHead from '@/components/TableHead/src/TableHead.vue'
import ImportForm from '@/components/ImportForm/src/ImportForm.vue'
import Detail from '@/components/Detail/src/Detail.vue'
defineOptions({ name: 'QmsQualityform' })
const message = useMessage() //
const { t } = useI18n() //
const route = useRoute() //
const routeName = ref()
routeName.value = route.name
const tableColumns = ref(Qualityform.allSchemas.tableColumns)
//
const searchTableSuccess = (formField, searchField, val, formRef) => {
nextTick(() => {
const setV = {}
let result = '';
//setV[formField] = val[0][searchField]
for (var i = 0; i < val.length; i++) {
//console.log(val[i].itemCode); //
result += val[i].itemCode + ',';
}
if(result.endsWith(',')){
result = result.substring(0,result.length -1)
}
setV[formField] = result;
formRef.setValues(setV)
})
}
//
const searchTableSuccessDetail = (formField, searchField, val, formRef ) => {
nextTick(() => {
const setV = {}
let result = '';
for (var i = 0; i < val.length; i++) {
result += val[i].itemCode + ',';
}
if(result.endsWith(',')){
result = result.substring(0,result.length -1)
}
setV[formField] = result;
formRef.setValues(setV)
})
}
// wms
const updataTableColumns = (val) => {
tableColumns.value = val
}
const { tableObject, tableMethods } = useTable({
getListApi: QualityformApi.getQualityformPage //
})
//
const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultAddBtn({hasPermi:'mes:qualityform:create'}), //
defaultButtons.defaultImportBtn({hasPermi:'mes:qualityform:import'}), //
defaultButtons.defaultExportBtn({hasPermi:'mes:qualityform:export'}), //
defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), //
// {
// label: '',
// name: 'zdy',
// hide: false,
// type: 'primary',
// icon: 'Select',
// color: ''
// },
]
//
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:qualityform:update'}), //
defaultButtons.mainListDeleteBtn({hasPermi:'mes:qualityform:delete'}), //
]
// -
const buttonTableClick = async (val, row) => {
if (val == 'edit') { //
openForm('update', row)
} else if (val == 'delete') { //
handleDelete(row.id)
}
}
const handleDeleteDetail = async()=>{
getList()
}
let count = ref(0)
const handleCreateDetail = async()=>{
count.value++
getList()
}
/** 添加/修改操作 */
const basicFormRef = ref()
const openForm = (type: string, row?: any) => {
basicFormRef.value.open(type, row)
}
// form
const formsSuccess = async (formType,data) => {
var isHave =Qualityform.allSchemas.formSchema.some(function (item) {
return item.field === 'activeTime' || item.field === 'expireTime';
});
if(isHave){
if(data.activeTime && data.expireTime && data.activeTime >=data.expireTime){
message.error('失效时间要大于生效时间')
return;
}
}
if(data.activeTime==0)data.activeTime = null;
if(data.expireTime==0)data.expireTime = null;
if (formType === 'create') {
await QualityformApi.createQualityform(data)
message.success(t('common.createSuccess'))
} else {
await QualityformApi.updateQualityform(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, 'basicQualityform')
}
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
try {
//
await message.delConfirm()
//
await QualityformApi.deleteQualityform(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 QualityformApi.exportQualityform(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 QualityformApi.importTemplate()
})
</script>

316
src/views/mes/qualityform/qualityform.data.ts

@ -0,0 +1,316 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime'
import * as ItemApi from '@/api/mes/item'
import { Item } from '../item/item.data'
import * as QualitygroupApi from '@/api/mes/qualitygroup'
import { Qualitygroup } from '../qualitygroup/qualitygroup.data'
import { Detail } from '@/components/Detail'
// 表单校验
export const QualityformRules = reactive({
formName: [required],
})
export const Qualityform = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '删除时间',
field: 'deleteTime',
sort: 'custom',
formatter: dateFormatter,
isSearch: false,
isTable: false,
isForm:false,
isDetail:false,
search: {
component: 'DatePicker',
componentProps: {
valueFormat: 'YYYY-MM-DD HH:mm:ss',
type: 'daterange',
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')]
}
},
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
valueFormat: 'x'
}
},
},
{
label: '主键',
field: 'id',
sort: 'custom',
isForm: false,
isTable: false,
isDetail:false
},
{
label: '并发乐观锁',
field: 'concurrencyStamp',
sort: 'custom',
isSearch: false,
isTable: false,
isForm:false,
isDetail:false,
form: {
component: 'InputNumber',
value: 0
},
},
{
label: '创建时间',
field: 'createTime',
sort: 'custom',
formatter: dateFormatter,
isSearch: false,
isTable: false,
isDetail:false,
search: {
component: 'DatePicker',
componentProps: {
valueFormat: 'YYYY-MM-DD HH:mm:ss',
type: 'daterange',
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')]
}
},
isForm: false,
},
{
label: '删除用户名',
field: 'deleter',
sort: 'custom',
isSearch: false,
isTable: false,
isForm: false,
isDetail:false
},
{
label: '位置ID',
field: 'siteId',
sort: 'custom',
isSearch: false,
isTable: false,
isForm: false,
isDetail:false,
form: {
component: 'InputNumber',
value: 0
},
},
{
label: '表单编号',
field: 'formNo',
sort: 'custom',
isSearch: true,
isForm: false,
isDetail: true
},
{
label: '表单名称',
field: 'formName',
sort: 'custom',
isSearch: true,
},
{
label: '表单类别',
field: 'formType',
sort: 'custom',
isSearch: true,
},
{
label: '质检项目编码',
field: 'itemCode',
sort: 'custom',
isDetail: true,
form: {
componentProps: {
isSearchList: true, // 开启查询弹窗
searchTitle: '质检项目信息', // 查询弹窗标题
searchAllSchemas: Item.allSchemas, // 查询弹窗所需类
searchField: 'itemCode', // 查询弹窗赋值字段
searchPage: ItemApi.getItemPage, // 查询弹窗所需分页方法
multiple:true,
searchCondition: [{
key: 'status',
value: '1',
action: '==',
isSearch: true,
isMainValue: false
}]
}
}
},
{
label: '是否可用',
field: 'status',
sort: 'custom',
dictType: DICT_TYPE.QUALIFY_STATUS,
dictClass: 'string',
isSearch: true,
isTable: true,
isForm: true,
form: {
component: 'Switch',
value: '2',
componentProps: {
inactiveValue: '2',
activeValue: '1'
}
},
},
{
label: '备注',
field: 'remark',
sort: 'custom',
isSearch: false,
isTable: false,
},
{
label: '操作',
field: 'action',
isForm: false,
table: {
width: 150,
fixed: 'right'
}
}
]))
export const QualityformDetail = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '表单编号',
field: 'formNo',
sort: 'custom',
isSearch: false,
isForm: false,
isDetail: false,
form: {
componentProps:{
disabled:true
}
}
},
{
label: '项目编码',
field: 'itemCode',
sort: 'custom',
isSearch: true,
isForm: true,
isDetail: true,
form: {
componentProps: {
isSearchList: true, // 开启查询弹窗
searchTitle: '质检项目信息', // 查询弹窗标题
searchAllSchemas: Item.allSchemas, // 查询弹窗所需类
searchField: 'itemCode', // 查询弹窗赋值字段
searchPage: ItemApi.getItemPage, // 查询弹窗所需分页方法
multiple:true,
searchCondition: [{
key: 'status',
value: '1',
action: '=='
}]
// searchCondition: [{
// key:'formNo', // 查询列表中字段
// value:'formNo', // 指主表某字段
// //message: '请选择生产线信息!', // 当前置条件为空时 弹出信息提示
// isMainValue: true // 表示查询条件是主表的字段的值
// },
// {
// key:'status', // 查询列表中字段
// value:'1', // 指查询具体值
// isMainValue: false // 表示查询条件不是主表的字段的值
// }
// ]
}
}
},
{
label: '项目名称',
field: 'itemName',
sort: 'custom',
isSearch: true,
isForm: false,
},
{
label: '类别编码',
field: 'itemType',
sort: 'custom',
isSearch: true,
isForm: false,
},
{
label: '质检科目编码',
field: 'qmsClass',
sort: 'custom',
isSearch: true,
isForm: false,
},
{
label: '数据类型',
field: 'dataType',
sort: 'custom',
dictType: DICT_TYPE.QUALIFY_ITEM_DATA_TYPE,
dictClass: 'string',
isSearch: true,
isForm: false,
},
{
label: '校验方式',
field: 'dataVerify',
sort: 'custom',
dictType: DICT_TYPE.QUALIFY_ITEM_VERIFY_MODE,
dictClass: 'string',
isSearch: true,
isForm: false,
},
{
label: '数据参考值',
field: 'dataStandvalue',
sort: 'custom',
isSearch: false,
isForm: false,
},
{
label: '数据录入说明',
field: 'dataDescripe',
sort: 'custom',
isSearch: false,
isForm: false,
},
{
label: '操作',
field: 'action',
isForm: false,
table: {
width: 150,
fixed: 'right'
}
},
{
label: '是否可用',
field: 'status',
sort: 'custom',
dictType: DICT_TYPE.QUALIFY_STATUS,
dictClass: 'string',
isSearch: true,
isTable: true,
isForm: false,
},
{
label: '备注',
field: 'remark',
sort: 'custom',
isSearch: false,
isTable: true,
isForm: false,
}
]))
export const QualityformDetailRules = reactive({
itemCode: [required]
})

244
src/views/mes/qualityformlog/index.vue

@ -0,0 +1,244 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="Qualityformlog.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
</ContentWrap>
<!-- 列表头部 -->
<TableHead
:HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick"
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="Qualityformlog.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 #code="{row}">
<el-button type="primary" link @click="openDetail(row, '代码', row.code)">
<span>{{ row.code }}</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="QualityformlogRules"
:formAllSchemas="Qualityformlog.allSchemas"
:apiUpdate="QualityformlogApi.updateQualityformlog"
:apiCreate="QualityformlogApi.createQualityformlog"
@searchTableSuccess="searchTableSuccess"
:isBusiness="false"
/>
<!-- 详情 -->
<Detail ref="detailRef" :isBasic="true" :allSchemas="Qualityformlog.allSchemas" />
<!-- 导入 -->
<ImportForm ref="importFormRef" url="/mes/qualityformlog/import" :importTemplateData="importTemplateData" @success="importSuccess" />
</template>
<script setup lang="ts">
import download from '@/utils/download'
import { Qualityformlog,QualityformlogRules } from './qualityformlog.data'
import * as QualityformlogApi from '@/api/mes/qualityformlog'
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'
defineOptions({ name: 'QmsQualityformlog' })
const message = useMessage() //
const { t } = useI18n() //
const route = useRoute() //
const routeName = ref()
routeName.value = route.name
const tableColumns = ref(Qualityformlog.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: QualityformlogApi.getQualityformlogPage //
})
//
const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
//defaultButtons.defaultAddBtn({hasPermi:'mes:qualityformlog:create'}), //
//defaultButtons.defaultImportBtn({hasPermi:'mes:qualityformlog:import'}), //
defaultButtons.defaultExportBtn({hasPermi:'mes:qualityformlog:export'}), //
defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), //
// {
// label: '',
// name: 'zdy',
// hide: false,
// type: 'primary',
// icon: 'Select',
// color: ''
// },
]
//
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:qualityformlog:update'}), //
defaultButtons.mainListDeleteBtn({hasPermi:'mes:qualityformlog: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) => {
var isHave =Qualityformlog.allSchemas.formSchema.some(function (item) {
return item.field === 'activeTime' || item.field === 'expireTime';
});
if(isHave){
if(data.activeTime && data.expireTime && data.activeTime >=data.expireTime){
message.error('失效时间要大于生效时间')
return;
}
}
if(data.activeTime==0)data.activeTime = null;
if(data.expireTime==0)data.expireTime = null;
if (formType === 'create') {
await QualityformlogApi.createQualityformlog(data)
message.success(t('common.createSuccess'))
} else {
await QualityformlogApi.updateQualityformlog(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, 'basicQualityformlog')
}
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
try {
//
await message.delConfirm()
//
await QualityformlogApi.deleteQualityformlog(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 QualityformlogApi.exportQualityformlog(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 QualityformlogApi.importTemplate()
})
</script>

197
src/views/mes/qualityformlog/qualityformlog.data.ts

@ -0,0 +1,197 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime'
// 表单校验
export const QualityformlogRules = reactive({
concurrencyStamp: [required],
masterId: [required],
})
export const Qualityformlog = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '删除时间',
field: 'deleteTime',
sort: 'custom',
formatter: dateFormatter,
isSearch: false,
isTable: false,
isForm:false,
isDetail:false,
search: {
component: 'DatePicker',
componentProps: {
valueFormat: 'YYYY-MM-DD HH:mm:ss',
type: 'daterange',
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')]
}
},
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
valueFormat: 'x'
}
},
},
{
label: '主键',
field: 'id',
sort: 'custom',
isForm: false,
isTable: false,
isDetail:false
},
{
label: '状态',
field: 'status',
sort: 'custom',
isSearch: false,
isTable: false,
isForm:false,
isDetail:false,
form: {
component: 'Radio'
},
},
{
label: '并发乐观锁',
field: 'concurrencyStamp',
sort: 'custom',
isSearch: false,
isTable: false,
isForm:false,
isDetail:false,
form: {
component: 'InputNumber',
value: 0
},
},
{
label: '备注',
field: 'remark',
sort: 'custom',
isSearch: false,
isTable: false,
isDetail:false,
},
{
label: '创建时间',
field: 'createTime',
sort: 'custom',
formatter: dateFormatter,
isSearch: false,
isTable: false,
isDetail:false,
search: {
component: 'DatePicker',
componentProps: {
valueFormat: 'YYYY-MM-DD HH:mm:ss',
type: 'daterange',
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')]
}
},
isForm: false,
},
{
label: '删除用户名',
field: 'deleter',
sort: 'custom',
isSearch: false,
isTable: false,
isForm: false,
isDetail:false
},
{
label: '位置ID',
field: 'siteId',
sort: 'custom',
isSearch: false,
isTable: false,
isForm: false,
isDetail:false,
form: {
component: 'InputNumber',
value: 0
},
},
{
label: '主表编号',
field: 'masterId',
sort: 'custom',
isSearch: false,
isTable: false,
isForm: false,
isDetail:false,
form: {
component: 'InputNumber',
value: 0
},
},
{
label: '表单编号',
field: 'formNo',
sort: 'custom',
isSearch: true,
},
{
label: '操作类型',
field: 'operation',
sort: 'custom',
dictType: DICT_TYPE.QUALIFY_FORM_OPERATION,
dictClass: 'string',
isSearch: true,
},
{
label: '操作人员',
field: 'operator',
sort: 'custom',
isSearch: true,
},
{
label: '操作内容',
field: 'operateContent',
sort: 'custom',
isSearch: true,
form: {
component: 'Editor',
componentProps: {
valueHtml: '',
height: 200
}
},
},
{
label: '操作时间',
field: 'operateTime',
sort: 'custom',
formatter: dateFormatter,
isSearch: true,
search: {
component: 'DatePicker',
componentProps: {
valueFormat: 'YYYY-MM-DD HH:mm:ss',
type: 'daterange',
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')]
}
},
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
valueFormat: 'x'
}
},
},
{
label: '操作',
field: 'action',
isSearch: false,
isTable: false,
isForm: false,
isDetail:false,
table: {
width: 150,
fixed: 'right'
}
}
]))

244
src/views/mes/qualitygroup/index.vue

@ -0,0 +1,244 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="Qualitygroup.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
</ContentWrap>
<!-- 列表头部 -->
<TableHead
:HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick"
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="Qualitygroup.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 #code="{row}">
<el-button type="primary" link @click="openDetail(row, '代码', row.code)">
<span>{{ row.code }}</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="QualitygroupRules"
:formAllSchemas="Qualitygroup.allSchemas"
:apiUpdate="QualitygroupApi.updateQualitygroup"
:apiCreate="QualitygroupApi.createQualitygroup"
@searchTableSuccess="searchTableSuccess"
:isBusiness="false"
/>
<!-- 详情 -->
<Detail ref="detailRef" :isBasic="true" :allSchemas="Qualitygroup.allSchemas" />
<!-- 导入 -->
<ImportForm ref="importFormRef" url="/mes/qualitygroup/import" :importTemplateData="importTemplateData" @success="importSuccess" />
</template>
<script setup lang="ts">
import download from '@/utils/download'
import { Qualitygroup,QualitygroupRules } from './qualitygroup.data'
import * as QualitygroupApi from '@/api/mes/qualitygroup'
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'
defineOptions({ name: 'QmsQualitygroup' })
const message = useMessage() //
const { t } = useI18n() //
const route = useRoute() //
const routeName = ref()
routeName.value = route.name
const tableColumns = ref(Qualitygroup.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: QualitygroupApi.getQualitygroupPage //
})
//
const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultAddBtn({hasPermi:'mes:qualitygroup:create'}), //
defaultButtons.defaultImportBtn({hasPermi:'mes:qualitygroup:import'}), //
defaultButtons.defaultExportBtn({hasPermi:'mes:qualitygroup:export'}), //
defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), //
// {
// label: '',
// name: 'zdy',
// hide: false,
// type: 'primary',
// icon: 'Select',
// color: ''
// },
]
//
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:qualitygroup:update'}), //
defaultButtons.mainListDeleteBtn({hasPermi:'mes:qualitygroup: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) => {
var isHave =Qualitygroup.allSchemas.formSchema.some(function (item) {
return item.field === 'activeTime' || item.field === 'expireTime';
});
if(isHave){
if(data.activeTime && data.expireTime && data.activeTime >=data.expireTime){
message.error('失效时间要大于生效时间')
return;
}
}
if(data.activeTime==0)data.activeTime = null;
if(data.expireTime==0)data.expireTime = null;
if (formType === 'create') {
await QualitygroupApi.createQualitygroup(data)
message.success(t('common.createSuccess'))
} else {
await QualitygroupApi.updateQualitygroup(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, 'basicQualitygroup')
}
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
try {
//
await message.delConfirm()
//
await QualitygroupApi.deleteQualitygroup(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 QualitygroupApi.exportQualitygroup(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 QualitygroupApi.importTemplate()
})
</script>

151
src/views/mes/qualitygroup/qualitygroup.data.ts

@ -0,0 +1,151 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime'
// 表单校验
export const QualitygroupRules = reactive({
concurrencyStamp: [required],
code: [required],
name: [required],
})
export const Qualitygroup = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '删除时间',
field: 'deleteTime',
sort: 'custom',
formatter: dateFormatter,
isSearch: false,
isTable: false,
isForm:false,
isDetail:false,
search: {
component: 'DatePicker',
componentProps: {
valueFormat: 'YYYY-MM-DD HH:mm:ss',
type: 'daterange',
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')]
}
},
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
valueFormat: 'x'
}
},
},
{
label: '主键',
field: 'id',
sort: 'custom',
isForm: false,
isTable: false,
isDetail:false
},
{
label: '并发乐观锁',
field: 'concurrencyStamp',
sort: 'custom',
isSearch: false,
isTable: false,
isForm:false,
isDetail:false,
form: {
component: 'InputNumber',
value: 0
},
},
{
label: '创建时间',
field: 'createTime',
sort: 'custom',
formatter: dateFormatter,
isSearch: false,
isTable: false,
isDetail:false,
search: {
component: 'DatePicker',
componentProps: {
valueFormat: 'YYYY-MM-DD HH:mm:ss',
type: 'daterange',
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')]
}
},
isForm: false,
},
{
label: '删除用户名',
field: 'deleter',
sort: 'custom',
isSearch: false,
isTable: false,
isForm: false,
isDetail:false
},
{
label: '位置ID',
field: 'siteId',
sort: 'custom',
isSearch: false,
isTable: false,
isForm: false,
isDetail:false,
form: {
component: 'InputNumber',
value: 0
},
},
{
label: '编码',
field: 'code',
sort: 'custom',
isSearch: true,
},
{
label: '编码名称',
field: 'name',
sort: 'custom',
isSearch: true,
},
{
label: '分组类别',
field: 'groupCode',
sort: 'custom',
isSearch: true,
},
{
label: '状态',
field: 'status',
sort: 'custom',
dictType: DICT_TYPE.QUALIFY_STATUS,
dictClass: 'string',
isForm: true,
isSearch: true,
isTable: true,
form: {
component: 'Switch',
value: '2',
componentProps: {
inactiveValue: '2',
activeValue: '1'
}
},
},
{
label: '操作',
field: 'action',
isForm: false,
isDetail:false,
table: {
width: 150,
fixed: 'right'
}
},
{
label: '备注',
field: 'remark',
sort: 'custom',
isSearch: false,
isTable: false
}
]))

258
src/views/mes/reworkSingle/index.vue

@ -0,0 +1,258 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="ReworkSingle.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
</ContentWrap>
<!-- 列表头部 -->
<TableHead
:HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick"
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="ReworkSingle.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 #reworkbillNo="{row}">
<el-button type="primary" link @click="openDetail(row, '单据号', row.reworkbillNo)">
<span>{{ row.reworkbillNo }}</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="ReworkSingleRules"
:formAllSchemas="ReworkSingle.allSchemas"
:apiUpdate="ReworkSingleApi.updateReworkSingle"
:apiCreate="ReworkSingleApi.createReworkSingle"
@searchTableSuccess="searchTableSuccess"
:isBusiness="false"
/>
<!-- 详情 -->
<Detail ref="detailRef" :isBasic="true" :allSchemas="ReworkSingle.allSchemas" />
<!-- 导入 -->
<ImportForm ref="importFormRef" url="/mes/rework-single/import" :importTemplateData="importTemplateData" @success="importSuccess" />
</template>
<script setup lang="ts">
import download from '@/utils/download'
import { ReworkSingle,ReworkSingleRules } from './reworkSingle.data'
import * as ReworkSingleApi from '@/api/mes/reworkSingle'
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'
defineOptions({ name: 'MesReworkSingle' })
const message = useMessage() //
const { t } = useI18n() //
const route = useRoute() //
const routeName = ref()
routeName.value = route.name
const tableColumns = ref(ReworkSingle.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: ReworkSingleApi.getReworkSinglePage //
})
//
const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultAddBtn({hasPermi:'mes:reworkSingle:create'}), //
//defaultButtons.defaultImportBtn({hasPermi:'mes:reworkSingle:import'}), //
defaultButtons.defaultExportBtn({hasPermi:'mes:reworkSingle:export'}), //
defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), //
// {
// label: '',
// name: 'zdy',
// hide: false,
// type: 'primary',
// icon: 'Select',
// color: ''
// },
]
//
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:reworkSingle:update'}), //
defaultButtons.mainListDeleteBtn({hasPermi:'mes:reworkSingle: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) => {
if(type == "create"){
ReworkSingle.allSchemas.formSchema.forEach((item) => {
if(item.field == 'status'){
item.value = '1';
item.componentProps.disabled = true
}
})
}else{
ReworkSingle.allSchemas.formSchema.forEach((item) => {
if(item.field == 'status'){
item.componentProps.disabled = false
}
})
}
basicFormRef.value.open(type, row)
}
// form
const formsSuccess = async (formType,data) => {
var isHave =ReworkSingle.allSchemas.formSchema.some(function (item) {
return item.field === 'activeTime' || item.field === 'expireTime';
});
if(isHave){
if(data.activeTime && data.expireTime && data.activeTime >=data.expireTime){
message.error('失效时间要大于生效时间')
return;
}
}
if(data.activeTime==0)data.activeTime = null;
if(data.expireTime==0)data.expireTime = null;
if (formType === 'create') {
await ReworkSingleApi.createReworkSingle(data)
message.success(t('common.createSuccess'))
} else {
await ReworkSingleApi.updateReworkSingle(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, 'basicReworkSingle')
}
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
try {
//
await message.delConfirm()
//
await ReworkSingleApi.deleteReworkSingle(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 ReworkSingleApi.exportReworkSingle(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 ReworkSingleApi.importTemplate()
})
</script>

219
src/views/mes/reworkSingle/reworkSingle.data.ts

@ -0,0 +1,219 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime'
import * as ItembasicApi from '@/api/wms/itembasic'
import { Itembasic } from '@/views/wms/basicDataManage/itemManage/itembasic/itembasic.data'
// 表单校验
export const ReworkSingleRules = reactive({
reworkType: [required],
productionCode:[required],
replaceFlag:[required],
status:[required],
})
export const ReworkSingle = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '删除时间',
field: 'deleteTime',
sort: 'custom',
formatter: dateFormatter,
isSearch: false,
isTable: false,
isForm:false,
isDetail:false,
search: {
component: 'DatePicker',
componentProps: {
valueFormat: 'YYYY-MM-DD HH:mm:ss',
type: 'daterange',
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')]
}
},
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
valueFormat: 'x'
}
},
},
{
label: '主键',
field: 'id',
sort: 'custom',
isSearch: false,
isTable: false,
isForm:false,
isDetail:false,
},
{
label: '并发乐观锁',
field: 'concurrencyStamp',
sort: 'custom',
isSearch: false,
isTable: false,
isForm:false,
isDetail:false,
form: {
component: 'InputNumber',
value: 0
},
},
{
label: '创建时间',
field: 'createTime',
sort: 'custom',
formatter: dateFormatter,
isSearch: false,
isTable: false,
isForm:false,
isDetail:false,
search: {
component: 'DatePicker',
componentProps: {
valueFormat: 'YYYY-MM-DD HH:mm:ss',
type: 'daterange',
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')]
}
},
},
{
label: '删除用户名',
field: 'deleter',
sort: 'custom',
isSearch: false,
isTable: false,
isForm:false,
isDetail:false,
},
{
label: '位置ID',
field: 'siteId',
sort: 'custom',
isSearch: false,
isTable: false,
isForm:false,
isDetail:false,
form: {
component: 'InputNumber',
value: 0
},
},
{
label: '单据号',
field: 'reworkbillNo',
sort: 'custom',
isSearch: true,
isForm: false,
isDetail: true
},
{
label: '工作类型',
field: 'reworkType',
sort: 'custom',
isSearch: true,
dictType: DICT_TYPE.REWORK_TYPE,
dictClass: 'string',
},
{
label: '产品编码',
field: 'productionCode',
sort: 'custom',
isSearch: true,
form: {
componentProps: {
isSearchList: true, // 开启查询弹窗
searchTitle: '产品编码', // 查询弹窗标题
searchAllSchemas: Itembasic.allSchemas, // 查询弹窗所需类
searchField: 'code', // 查询弹窗赋值字段
searchPage: ItembasicApi.getItembasicPage, // 查询弹窗所需分页方法
searchCondition: [{
key: 'available',
value: 'TRUE',
isMainValue: false
},
{
key: 'type',
action: 'in', // 查询拼接条件
isSearch: true, // 使用自定义拼接条件
value: 'BCP,CCP',//,SEMI]
isMainValue: false
}]
}
}
},
{
label: '返修动作',
field: 'reworkAction',
sort: 'custom',
isSearch: true,
},
{
label: '是否有替换件',
field: 'replaceFlag',
sort: 'custom',
isSearch: true,
dictType: DICT_TYPE.REWORK_REPLACE_FLAG,
dictClass: 'string',
},
{
label: '返修人员',
field: 'reworkPersoncode',
sort: 'custom',
isSearch: true,
},
{
label: '返修时间',
field: 'reworkTime',
sort: 'custom',
formatter: dateFormatter,
isSearch: true,
search: {
component: 'DatePicker',
componentProps: {
valueFormat: 'YYYY-MM-DD HH:mm:ss',
type: 'daterange',
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')]
}
},
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
valueFormat: 'x'
}
},
},
{
label: '返修结果',
field: 'reworkResult',
sort: 'custom',
isSearch: true,
},
{
label: '状态',
field: 'status',
sort: 'custom',
isSearch: true,
dictType: DICT_TYPE.REWORK_STATUS,
dictClass: 'string',
},
{
label: '备注',
field: 'remark',
sort: 'custom',
isSearch: false,
isTable: false,
},
{
label: '操作',
field: 'action',
isForm: false,
table: {
width: 150,
fixed: 'right'
}
}
]))

18
src/views/mes/workstation/components/Detail.vue

@ -33,7 +33,7 @@
<TableHead
v-if="!isBasic"
:HeadButttondata="HeadButttondata"
:masterId="masterParmas.masterId"
:code="masterParmas.code"
@button-base-click="buttonBaseClick"
:routeName="routeName"
@searchFormClick="searchFormClick"
@ -371,9 +371,9 @@ const change = (item, index) => {
//
const masterParmas = ref({
masterId: '', //id
code: '', //id
number: '', //
status: '' //
status: '', //
})
//
@ -395,11 +395,11 @@ const openDetail = async (row: any, titleName: any, titleValue: any, tableName:
//
if (!props.isBasic) {
// id
masterParmas.value.masterId = row.id
masterParmas.value.code = row.id
masterParmas.value.number = row.number
masterParmas.value.status = row.status
tableObjectRef.value.params = {
masterId: row.id
code: row.code
}
await getList()
}
@ -549,8 +549,8 @@ const buttonTableClick = async (val, row) => {
}
/** 添加/修改操作 */
const openForm = async (type: string, row?: number) => {
formRef.value.open(type, row, masterParmas.value)
emit('detailOpenForm', type, row)
// formRef.value.open(type, row, masterParmas.value)
emit('detailOpenForm', type, masterParmas.value)
}
// form
const submitForm = async (formType, data) => {
@ -614,7 +614,7 @@ const searchFormClick = async (searchData) => {
isSearch: true,
filters: searchData.filters
? searchData.filters
: [{ column: 'masterId', action: '==', value: masterParmas.value.masterId }]
: [{ column: 'code', action: '==', value: masterParmas.value.code }]
}
detailAllSchemasRef.value = props.detailAllSchemas
tableObjectRef.value = tableObject
@ -668,7 +668,7 @@ watch(
const { tableObject, tableMethods } = useTable({
getListApi: props.apiPage //
})
tableObject.params.masterId = masterParmas.value.masterId
tableObject.params.code = masterParmas.value.code
detailAllSchemasRef.value = props.detailAllSchemas
if (props.tableObjectExtend) {
props.tableObjectExtend.forEach(item => {

44
src/views/mes/workstation/index.vue

@ -60,18 +60,19 @@
:tabs="TabsList"
:apiDelete=tabsDeleteApi
@changeTabs="changeTabs"
@tableFormButton="tableFormButton"
:detailButtonIsShowAdd="true"
:detailButtonIsShowDelete="true"
:detailButtonIsShowEdit="false"
@detailOpenForm="detailOpenForm"
/>
<!-- 记录子包装弹窗 -->
<BasicForm
ref="teamListRef"
@success="getList"
:tableAllSchemas="Team.allSchemas"
:tableData="selectTeamListTableData.tableList"
:tableData="WorkstationApi.checkTeamPageList"
:isBusiness="true"
:isOpenSearchTable="true"
:isShowButton="false"
:isShowReduceButton="false"
:isShowFooterButtton="false"
@ -305,7 +306,7 @@ const openDetail = (row: any, titleName: any, titleValue: any) => {
//
const detailAllSchemas = ref(Team.allSchemas)
const apiPage = ref(WorkstationApi.getTeamPage)
const tableKey = ref("workstationDetail");
const tableKey = ref("Team");
// tabs
const changeTabs = (data) =>{
tableKey.value = data.prop
@ -327,16 +328,6 @@ const changeTabs = (data) =>{
tabsDeleteApi = WorkstationApi.deleteOperstepsRelation
}
}
// const buttondataTable = ref([{
// label: '',
// name: 'viewParentPickingNumber',
// hide: false,
// type: 'primary',
// icon: '',
// color: '',
// hasPermi: '',
// link: true, //
// }])
const teamListRef = ref()
const { tableObject: selectTeamListTableData, tableMethods: selectTeamListTableMethods } = useTable({
getListApi: WorkstationApi.checkTeamPageList
@ -360,32 +351,31 @@ const { tableObject: selectOperstepsListTableData, tableMethods: OperstepsListTa
getListApi: WorkstationApi.checkOperstepsPageList
})
const { getList:selectOperstepsList } = OperstepsListTableMethods
const tableFormButton = async (val , row) => {
if(val == 'Team'){
const detailOpenForm = async (type, params) => {
if (tableKey.value == 'Team') {
selectTeamListTableData.params = {
workstationCode:row.workstationCode
workstationCode: params.code
}
await selectTeamList()
teamListRef.value.open('create', row, null,'viewDetail')//
}else if(val == 'Equipment'){
teamListRef.value.open('viewDetail', params, null, 'viewDetail')//
} else if (tableKey.value == 'Equipment') {
selectEquipmentListTableData.params = {
workstationCode:row.workstationCode
workstationCode: params.code
}
await selectEquipmentList()
equipmentListRef.value.open('create', row, null,'viewDetail')//
}else if(val == 'Process'){
equipmentListRef.value.open('viewDetail', params.code, null, 'viewDetail')//
} else if (tableKey.value == 'Process') {
selectProcessListTableData.params = {
workstationCode:row.workstationCode
workstationCode: params.code
}
await selectProcessListList()
processListRef.value.open('create', row, null,'viewDetail')//
}else if(val == 'Production'){
processListRef.value.open('viewDetail', params.code, null, 'viewDetail')//
} else if (tableKey.value == 'Production') {
selectOperstepsListTableData.params = {
workstationCode:row.workstationCode
workstationCode: params.code
}
await selectOperstepsList()
operstepsListRef.value.open('create', row, null,'viewDetail')//
operstepsListRef.value.open('viewDetail', params.code, null, 'viewDetail')//
}
}
</script>

17
src/views/mes/workstation/workstation.data.ts

@ -131,22 +131,7 @@ export const Team = useCrudSchemas(reactive<CrudSchema[]>([
isTableForm:true,
}
]))
export const TeamSelect = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '代码',
field: 'code',
sort: 'custom',
isSearch: true,
isForm: false
},
{
label: '名称',
field: 'name',
sort: 'custom',
isSearch: true,
isForm: false
}
]))
export const Equipment = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '代码',

332
src/views/qms/aql/aql.data.ts

@ -0,0 +1,332 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime'
// 表单校验
export const AqlRules = reactive({
sampleProgCode: [required],
inspectionQualification: [required],
sampleCharacterCode: [required],
sampleSize: [required],
available: [required],
})
export const Aql = useCrudSchemas(reactive<CrudSchema[]>([
{
label: 'id',
field: 'id',
sort: 'custom',
isTable: false,
isForm: false,
},
{
label: '编码',
field: 'sampleProgCode',
sort: 'custom',
isSearch: true,
},
{
label: '检验严格性',
field: 'inspectionQualification',
sort: 'custom',
dictType: DICT_TYPE.INSPECTION_SEVERITY,
dictClass: 'string', // 默认都是字符串类型其他暂不考虑
isSearch: true,
form: {
component: 'SelectV2'
},
},
{
label: '样本字码',
field: 'sampleCharacterCode',
sort: 'custom',
isSearch: true,
},
{
label: '样本量',
field: 'sampleSize',
sort: 'custom',
},
{
label: 'A0_010',
field: 'a0010',
sort: 'custom',
},
{
label: 'R0_010',
field: 'r0010',
sort: 'custom',
},
{
label: 'A0_015',
field: 'a0015',
sort: 'custom',
},
{
label: 'R0_015',
field: 'r0015',
sort: 'custom',
},
{
label: 'A0_025',
field: 'a0025',
sort: 'custom',
isSearch: true,
},
{
label: 'R0_025',
field: 'r0025',
sort: 'custom',
},
{
label: 'A0_040',
field: 'a0040',
sort: 'custom',
},
{
label: 'R0_040',
field: 'r0040',
sort: 'custom',
},
{
label: 'A0_065',
field: 'a0065',
sort: 'custom',
isSearch: true,
},
{
label: 'R0_065',
field: 'r0065',
sort: 'custom',
},
{
label: 'A0_10',
field: 'a010',
sort: 'custom',
},
{
label: 'R0_10',
field: 'r010',
sort: 'custom',
},
{
label: 'A0_15',
field: 'a015',
sort: 'custom',
},
{
label: 'R0_15',
field: 'r015',
sort: 'custom',
},
{
label: 'A0_25',
field: 'a025',
sort: 'custom',
},
{
label: 'R0_25',
field: 'r025',
sort: 'custom',
},
{
label: 'A0_40',
field: 'a040',
sort: 'custom',
},
{
label: 'R0_40',
field: 'r040',
sort: 'custom',
},
{
label: 'A0_65',
field: 'a065',
sort: 'custom',
},
{
label: 'R0_65',
field: 'r065',
sort: 'custom',
},
{
label: 'A1_0',
field: 'a10',
sort: 'custom',
},
{
label: 'R1_0',
field: 'r10',
sort: 'custom',
},
{
label: 'A1_5',
field: 'a15',
sort: 'custom',
},
{
label: 'R1_5',
field: 'r15',
sort: 'custom',
},
{
label: 'A2_5',
field: 'a25',
sort: 'custom',
},
{
label: 'R2_5',
field: 'r25',
sort: 'custom',
},
{
label: 'A4_0',
field: 'a40',
sort: 'custom',
},
{
label: 'R4_0',
field: 'r40',
sort: 'custom',
},
{
label: 'A6_5',
field: 'a65',
sort: 'custom',
},
{
label: 'R6_5',
field: 'r65',
sort: 'custom',
},
{
label: 'A10',
field: 'a10',
sort: 'custom',
},
{
label: 'R10',
field: 'r10',
sort: 'custom',
},
{
label: 'A15',
field: 'a15',
sort: 'custom',
},
{
label: 'R15',
field: 'r15',
sort: 'custom',
},
{
label: 'A25',
field: 'a25',
sort: 'custom',
},
{
label: 'R25',
field: 'r25',
sort: 'custom',
},
{
label: 'A40',
field: 'a40',
sort: 'custom',
},
{
label: 'R40',
field: 'r40',
sort: 'custom',
},
{
label: 'A65',
field: 'a65',
sort: 'custom',
},
{
label: 'R65',
field: 'r65',
sort: 'custom',
},
{
label: 'A100',
field: 'a100',
sort: 'custom',
},
{
label: 'R100',
field: 'r100',
sort: 'custom',
},
{
label: 'A150',
field: 'a150',
sort: 'custom',
},
{
label: 'R150',
field: 'r150',
sort: 'custom',
},
{
label: 'A250',
field: 'a250',
sort: 'custom',
},
{
label: 'R250',
field: 'r250',
sort: 'custom',
},
{
label: 'A400',
field: 'a400',
sort: 'custom',
},
{
label: 'R400',
field: 'r400',
sort: 'custom',
},
{
label: 'A650',
field: 'a650',
sort: 'custom',
},
{
label: 'R650',
field: 'r650',
sort: 'custom',
},
{
label: 'A1000',
field: 'a1000',
sort: 'custom',
},
{
label: 'R1000',
field: 'r1000',
sort: 'custom',
},
{
label: '是否可用',
field: 'available',
sort: 'custom',
},
{
label: '创建时间',
field: 'createTime',
sort: 'custom',
formatter: dateFormatter,
isForm: false,
},
{
label: '操作',
field: 'action',
isForm: false,
table: {
width: 150,
fixed: 'right'
}
}
]))

244
src/views/qms/aql/index.vue

@ -0,0 +1,244 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="Aql.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
</ContentWrap>
<!-- 列表头部 -->
<TableHead
:HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick"
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="Aql.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 #code="{row}">
<el-button type="primary" link @click="openDetail(row, '代码', row.code)">
<span>{{ row.code }}</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="AqlRules"
:formAllSchemas="Aql.allSchemas"
:apiUpdate="AqlApi.updateAql"
:apiCreate="AqlApi.createAql"
@searchTableSuccess="searchTableSuccess"
:isBusiness="false"
/>
<!-- 详情 -->
<Detail ref="detailRef" :isBasic="true" :allSchemas="Aql.allSchemas" />
<!-- 导入 -->
<ImportForm ref="importFormRef" url="/qms/aql/import" :importTemplateData="importTemplateData" @success="importSuccess" />
</template>
<script setup lang="ts">
import download from '@/utils/download'
import { Aql,AqlRules } from './aql.data'
import * as AqlApi from '@/api/qms/aql'
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'
defineOptions({ name: 'Aql' })
const message = useMessage() //
const { t } = useI18n() //
const route = useRoute() //
const routeName = ref()
routeName.value = route.name
const tableColumns = ref(Aql.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: AqlApi.getAqlPage //
})
//
const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultAddBtn({hasPermi:'wms:aql:create'}), //
defaultButtons.defaultImportBtn({hasPermi:'wms:aql:import'}), //
defaultButtons.defaultExportBtn({hasPermi:'wms:aql:export'}), //
defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), //
// {
// label: '',
// name: 'zdy',
// hide: false,
// type: 'primary',
// icon: 'Select',
// color: ''
// },
]
//
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:'wms:aql:update'}), //
defaultButtons.mainListDeleteBtn({hasPermi:'wms:aql: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) => {
var isHave =Aql.allSchemas.formSchema.some(function (item) {
return item.field === 'activeTime' || item.field === 'expireTime';
});
if(isHave){
if(data.activeTime && data.expireTime && data.activeTime >=data.expireTime){
message.error('失效时间要大于生效时间')
return;
}
}
if(data.activeTime==0)data.activeTime = null;
if(data.expireTime==0)data.expireTime = null;
if (formType === 'create') {
await AqlApi.createAql(data)
message.success(t('common.createSuccess'))
} else {
await AqlApi.updateAql(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, 'basicAql')
}
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
try {
//
await message.delConfirm()
//
await AqlApi.deleteAql(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 AqlApi.exportAql(tableObject.params)
download.excel(data, 'aql.xlsx')
} catch {
} finally {
exportLoading.value = false
}
}
/** 导入 */
const importFormRef = ref()
const handleImport = () => {
importFormRef.value.open()
}
//
const importTemplateData = reactive({
templateUrl: '',
templateTitle: 'aql导入模版.xlsx'
})
//
const importSuccess = () => {
getList()
}
//
const searchFormClick = (searchData) => {
tableObject.params = {
isSearch: true,
filters: searchData.filters
}
getList() //
}
/** 初始化 **/
onMounted(async () => {
getList()
importTemplateData.templateUrl = await AqlApi.importTemplate()
})
</script>

304
src/views/qms/basicDataManage/inspectionTemplate/addForm.vue

@ -0,0 +1,304 @@
<template>
<Dialog
:title="dialogTitle"
v-model="dialogVisible"
:width="dialogWidth"
:close-on-click-modal="false"
:vLoading="formLoading"
>
<div style="max-height: 60vh; overflow-y: auto; padding: 0px 20px">
<Form ref="formRefMain" :schema="formAllSchemasMain" :is-col="true" />
<div class="tab-pane">
<div class="left">
<div class="plus">
<Icon icon="ep:plus" size="14" color="black" @click="addProcess"
/></div>
<div class="left-list" v-for="(item, index) in data.list" :key="index">
<div class="left-item" :class="chooseIndex == index ? 'active' : ''">
<el-input
v-model="item.description"
style="width: 120px; margin: 0px 10px"
v-if="item.isEdit"
placeholder="请输入工序名称"
/>
<div class="name" v-else @click="chooseItem(item, index)">{{ item.description }}</div>
<Icon
icon="ep:select"
class="mr-5px ml-5px"
v-if="item.isEdit"
@click="editName(item)"
/>
<Icon icon="ep:edit" class="mr-5px ml-5px" v-else @click="editName(item)" />
<Icon icon="ep:close" class="mr-5px" @click="delProcess(index)" />
</div>
</div>
</div>
<div class="right">
<div class="small-title">检验工序</div>
<Form
ref="formRefProcess"
:schema="formAllSchemasProcess"
:is-col="true"
labelWidth="150px"
/>
<div class="small-title">检验特性</div>
<Form
ref="formRefFeatures"
:schema="formAllSchemasFeatures"
:is-col="true"
labelWidth="150px"
/>
</div>
</div>
<!-- <el-tabs
v-model="editableTabsValue"
editable
class="demo-tabs"
@edit="handleTabsEdit"
type="border-card"
tab-position="left"
>
<el-tab-pane
v-for="item in editableTabs"
:key="item.name"
:label="item.title"
:name="item.name"
>
<template #label>
<span class="custom-tabs-label">
<el-icon><calendar /></el-icon>
<span>Route</span>
</span>
</template>
<div class="small-title">检验工序</div>
<Form
ref="formRefProcess"
:schema="formAllSchemasProcess"
:is-col="true"
labelWidth="150px"
/>
<div class="small-title">检验特性</div>
<Form
ref="formRefFeatures"
:schema="formAllSchemasFeatures"
:is-col="true"
labelWidth="150px"
/>
</el-tab-pane>
</el-tabs> -->
</div>
<template #footer>
<ButtonBase :Butttondata="Butttondata" @button-base-click="buttonBaseClick" />
</template>
</Dialog>
</template>
<script setup lang="ts">
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import { json } from 'stream/consumers'
const props = defineProps({
//
basicFormWidth: {
type: String,
default: ''
},
//
formAllSchemasFeatures: {
type: Object,
required: true,
default: null
},
//
formAllSchemasProcess: {
type: Object,
required: true,
default: null
},
//
formAllSchemasMain: {
type: Object,
required: true,
default: null
},
//
footButttondata: {
type: Array,
required: false,
default: null
}
})
const { t } = useI18n() //
const dialogVisible = ref(true) //
const dialogTitle = ref('') //
const formLoading = ref(false) // 12
const formType = ref('') // create - update -
const dialogWidth = ref()
const form = reactive({
name: '',
region: '',
date1: '',
date2: '',
delivery: false,
type: [],
resource: '',
desc: ''
})
const chooseIndex = ref(0)
const formAllSchemasFeatures = ref(props.formAllSchemasFeatures?.formSchema)
const formAllSchemasProcess = ref(props.formAllSchemasProcess?.formSchema)
const formAllSchemasMain = ref(props.formAllSchemasMain?.formSchema)
const formRefMain = ref('')
const formRefProcess = ref('')
const formRefFeatures = ref('')
const onSubmit = () => {
console.log('submit!')
}
if (props.basicFormWidth) {
dialogWidth.value = props.basicFormWidth + '%'
} else {
dialogWidth.value = props.isBusiness ? '60%' : '40%'
}
/** 打开弹窗 */
const open = async (type: string, row?: any, masterParmas?: any, titleName?: any) => {
dialogVisible.value = true
if (titleName) {
dialogTitle.value = t('action.' + titleName)
} else {
dialogTitle.value = t('action.' + type)
}
try {
nextTick(() => {
formRefMain.value.setValues(data.value)
formRefProcess.value.setValues(data.value.list[0])
})
} finally {
formLoading.value = false
}
}
defineExpose({ open, dialogVisible, formLoading }) // open
const data = ref({
code: '',
description: '',
version: '',
list: [
{
description: '哈哈哈',
code: '',
sequenceCode: ''
},
{
description: '呵呵呵',
isEdit: false,
code: '555',
sequenceCode: '6666'
},
{
description: '哈呵呵',
isEdit: false
}
]
})
/** 弹窗按钮 */
let Butttondata: any = []
if (props.footButttondata) {
Butttondata = props.footButttondata
} else {
Butttondata = [
defaultButtons.formSaveBtn(null), //
defaultButtons.formCloseBtn(null) //
]
}
//
const editName = (item) => {
if(!item.description){
p
return;
}
item.isEdit = !item.isEdit
}
//
const addProcess = () => {
data.value.list.push({
name: '哈哈哈',
isEdit: true
})
}
//
const delProcess = (index) => {
data.value.list.splice(index, 1)
}
const chooseItem = (item, index) => {
const data1 = JSON.parse(JSON.stringify(unref(formRefProcess)?.formModel))
data.value.list.forEach((element,index) => {
if (element.code == data1.code) {
data.value.list[index] =JSON.parse(JSON.stringify( data1))
}
})
chooseIndex.value = index
formRefProcess.value.setValues(item)
}
</script>
<style lang="scss" scoped>
.small-title {
font-weight: bold;
padding: 0px 10px 10px;
color: #1a8bfc;
font-size: 16px;
}
.el-tabs--left .el-tabs__header.is-left {
min-height: 700px !important;
}
.tab-pane {
border: 1px solid #dcdfe6;
display: flex;
.left {
background: #f5f7fa;
width: 200px;
border-right: 1px solid #dcdfe6;
position: relative;
.plus {
position: absolute;
right: 0px;
border: 1px solid #dcdfe6;
display: flex;
align-items: center;
justify-content: center;
padding: 2px;
top: 8px;
border-radius: 4px;
cursor: pointer;
}
.left-item {
display: flex;
align-items: center;
height: 36px;
margin-bottom: 10px;
cursor: pointer;
.name {
width: 120px;
overflow: hidden;
padding: 0px 10px;
height: 36px;
text-overflow: ellipsis;
white-space: nowrap;
line-height: 36px;
}
}
.active {
background: white;
}
}
.right {
flex: 1;
padding: 20px;
}
}
</style>

330
src/views/qms/basicDataManage/inspectionTemplate/agvLocationrelation.data.ts

@ -0,0 +1,330 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime'
import * as AreaApi from '@/api/wms/areabasic'
import { Area } from '@/views/wms/basicDataManage/factoryModeling/areabasic/areabasic.data'
import * as LocationApi from '@/api/wms/location'
import { Location } from '@/views/wms/basicDataManage/factoryModeling/location/location.data'
import * as InspectionProcessPageApi from '@/api/qms/inspectionTemplate'
// const inspectionProcessPage = await InspectionProcessPageApi.getInspectionProcessPage()
// 表单校验
export const AgvLocationrelationRules = reactive({
positionCode: [
{ required: true, message: '请填写AGV点位', trigger: 'change' }
],
positionArea: [
{ required: true, message: '请填写AGV库区', trigger: 'change' }
],
wmsArea: [
{ required: true, message: '请填写WMS库区', trigger: 'change' }
],
wmsPosition: [
{ required: true, message: '请填写WMS库位', trigger: 'change' }
]
})
export const AgvLocationrelation = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '单据号',
field: 'reqCode',
sort: 'custom',
isSearch: true,
isForm: false,
},
{
label: 'AGV点位',
field: 'positionCode',
sort: 'custom',
isSearch: false,
},
{
label: 'AGV库区',
field: 'positionArea',
sort: 'custom',
isSearch: false,
},
{
label: 'WMS库区',
field: 'wmsArea',
sort: 'custom',
isSearch: false,
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择库区代码', // 输入框占位文本
searchField: 'code', // 查询弹窗赋值字段
searchTitle: '库区信息', // 查询弹窗标题
searchAllSchemas: Area.allSchemas, // 查询弹窗所需类
searchPage: AreaApi.getAreaPage, // 查询弹窗所需分页方法
searchCondition: [{
key: 'available',
value: 'TRUE',
isMainValue: false
}]
}
}
},
{
label: 'WMS库位',
field: 'wmsPosition',
sort: 'custom',
table: {
width: 150
},
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择库位代码', // 输入框占位文本
searchField: 'code', // 查询弹窗赋值字段
searchTitle: '库位信息', // 查询弹窗标题
searchAllSchemas: Location.allSchemas, // 查询弹窗所需类
searchPage: LocationApi.getLocationPage, // 查询弹窗所需分页方法
searchCondition: [{
key: 'available',
value: 'TRUE',
isMainValue: false
},
{
key: 'areaCode',
value: "wmsArea",
message: '请选择库区代码!',
isMainValue: true
}]
}
}
},
{
label: '是否可用',
field: 'available',
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string',
isTable: true,
isSearch: false,
sort: 'custom',
table: {
width: 150
},
form: {
component: 'Switch',
value: 'TRUE',
componentProps: {
inactiveValue: 'FALSE',
activeValue: 'TRUE'
}
}
},
{
label: '创建时间',
field: 'createTime',
sort: 'custom',
formatter: dateFormatter,
isSearch: true,
search: {
component: 'DatePicker',
componentProps: {
valueFormat: 'YYYY-MM-DD HH:mm:ss',
type: 'daterange',
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')]
}
},
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
isForm: false,
},
{
label: '备注',
field: 'remark',
sort: 'custom',
isSearch: false,
},
{
label: '操作',
field: 'action',
isForm: false,
isDetail: false,
table: {
width: 150,
fixed: 'right'
}
}
]))
export const InspectionTemplateMain = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '编码',
field: 'code',
sort: 'custom',
form:{
componentProps:{
disabled:true,
placeholder:'系统自动获取'
}
}
},
{
label: '描述',
field: 'description',
sort: 'custom',
},{
label: '版本',
field: 'version',
sort: 'custom',
}
]))
export const InspectionTemplateProcess = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '编码',
field: 'code',
sort: 'custom',
form:{
componentProps:{
disabled:true,
placeholder:'系统自动获取'
}
}
},
{
label: '描述',
field: 'description',
sort: 'custom',
isForm:false
},{
label: '检验方案模板编码',
field: 'inspectionCode',
sort: 'custom',
},{
label: '顺序号',
field: 'sequenceCode',
},{
label: '检验特性编码',
field: 'inspectionCharCode',
sort: 'custom',
form:{
component:'Select',
// api: () => inspectionProcessPage,
// componentProps:{
// optionsAlias: {
// labelField: 'name',
// valueField: 'id'
// }
// }
}
// form: {
// value: userDept.id,
// component: 'Select',
// api: () => userDeptArray,
// componentProps: {
// disabled: true,
// optionsAlias: {
// labelField: 'name',
// valueField: 'id'
// }
// }
// }
}
]))
export const InspectionTemplateFeatures= useCrudSchemas(reactive<CrudSchema[]>([
{
label: '编码',
field: 'code',
sort: 'custom',
form:{
componentProps:{
disabled:true,
placeholder:'系统自动获取'
}
}
},
{
label: '描述',
field: 'describe',
sort: 'custom',
},{
label: '检验方法编码',
field: 'inspectionMethodCode',
sort: 'custom',
form:{
component:'Select'
}
},{
label: '采样过程编码',
field: 'dynamicUpdateCode',
sort: 'custom',
form:{
component:'Select'
}
},{
label: '动态修改规则编码',
field: 'inspectionMethod',
sort: 'custom',
form:{
component:'Select'
}
},{
label: '是否允许修改特征值',
field: 'isCanUpdate',
sort: 'custom',
form:{
component:'Select'
}
},{
label: '是否破坏性检验',
field: 'isDestructionInspection',
sort: 'custom',
form:{
component:'Select'
}
},{
label: '结果录入方式',
field: 'resultEntryMethod',
sort: 'custom',
form:{
component:'Select'
}
},{
label: '特征类型',
field: 'featureType',
sort: 'custom',
form:{
component:'Select'
}
},{
label: '是否设定上限',
field: 'quantifyIsCapping',
sort: 'custom',
},{
label: '是否设定下限',
field: 'quantifyIsLowlimit',
sort: 'custom',
},{
label: '目标值',
field: 'quantifyTarget',
sort: 'custom',
},{
label: '上限值',
field: 'quantifyCapping',
sort: 'custom',
},{
label: '下限值',
field: 'quantifyLowlimit',
sort: 'custom',
},{
label: '计量单位',
field: 'quantifyUom',
sort: 'custom',
},{
label: '小数位',
field: 'quantifyDecimal',
sort: 'custom',
},{
label: '选择集编码',
field: 'quantifyQuantifyCode',
sort: 'custom',
form:{
component:'Select'
}
}
]))

32
src/views/qms/basicDataManage/inspectionTemplate/index.vue

@ -39,7 +39,7 @@
</ContentWrap>
<!-- 表单弹窗添加/修改 -->
<BasicForm
<!-- <BasicForm
ref="basicFormRef"
@success="formsSuccess"
:rules="AgvLocationrelationRules"
@ -48,8 +48,14 @@
:apiCreate="AgvLocationrelationApi.createAgvLocationrelation"
@searchTableSuccess="searchTableSuccess"
:isBusiness="false"
/> -->
<AddForm
ref="basicFormRef"
basicFormWidth="80"
:formAllSchemasFeatures="InspectionTemplateFeatures.allSchemas"
:formAllSchemasProcess="InspectionTemplateProcess.allSchemas"
:formAllSchemasMain="InspectionTemplateMain.allSchemas"
/>
<!-- 详情 -->
<Detail
ref="detailRef"
@ -63,12 +69,13 @@
<script setup lang="ts">
import download from '@/utils/download'
import { AgvLocationrelation,AgvLocationrelationRules } from './agvLocationrelation.data'
import { AgvLocationrelation,AgvLocationrelationRules,InspectionTemplateMain,InspectionTemplateProcess,InspectionTemplateFeatures } from './agvLocationrelation.data'
import * as AgvLocationrelationApi from '@/api/wms/agvLocationrelation'
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 AddForm from './addForm.vue'
defineOptions({ name: 'AgvLocationrelation' })
@ -153,25 +160,6 @@ const buttonTableClick = async (val, row) => {
/** 添加/修改操作 */
const basicFormRef = ref()
const openForm = (type: string, row?: any) => {
if(type == "update"){
AgvLocationrelation.allSchemas.formSchema.forEach((item) => {
if (item.field == 'positionCode') {
item.componentProps.disabled = true
}
if (item.field == 'positionArea') {
item.componentProps.disabled = true
}
})
}else {
AgvLocationrelation.allSchemas.formSchema.forEach((item) => {
if (item.field == 'positionCode') {
item.componentProps.disabled = false
}
if (item.field == 'positionArea') {
item.componentProps.disabled = false
}
})
}
basicFormRef.value.open(type, row)
}

289
src/views/qms/inspection/inspectionJob/index.vue

@ -0,0 +1,289 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="InspectionJobMain.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
</ContentWrap>
<!-- 列表头部 -->
<TableHead :HeadButttondata="HeadButttondata" @button-base-click="buttonBaseClick" :routeName="routeName"
@updataTableColumns="updataTableColumns" @searchFormClick="searchFormClick"
:allSchemas="InspectionJobMain.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 #number="{row}">
<el-button type="primary" link @click="openDetail(row, '单据号', row.number)">
<span>{{ row.number }}</span>
</el-button>
</template>
<template #action="{ row }">
<ButtonBase :Butttondata="butttondata(row)" @button-base-click="buttonTableClick($event,row)" />
</template>
</Table>
</ContentWrap>
<!-- 表单弹窗添加/修改 -->
<BasicForm ref="formRef" @success="getList" :rules="InspectionJobMainRules"
:formAllSchemas="InspectionJobMain.allSchemas" :tableAllSchemas="InspectionJobDetail.allSchemas"
:tableFormRules="InspectionJobDetailRules" :tableData="tableData"
:apiUpdate="InspectionJobMainApi.updateInspectionJobMain" :apiCreate="InspectionJobMainApi.createInspectionJobMain"
:isBusiness="true" @handleAddTable="handleAddTable" @handleDeleteTable="handleDeleteTable"
@searchTableSuccess="searchTableSuccess" @submitForm="submitForm" />
<!-- 详情 -->
<Detail ref="detailRef" :isBasic="false" :allSchemas="InspectionJobMain.allSchemas"
:detailAllSchemas="InspectionJobDetail.allSchemas" :detailAllSchemasRules="InspectionJobDetailRules"
:apiCreate="InspectionJobDetailApi.createInspectionJobDetail"
:apiUpdate="InspectionJobDetailApi.updateInspectionJobDetail"
:apiPage="InspectionJobDetailApi.getInspectionJobDetailPage"
:apiDelete="InspectionJobDetailApi.deleteInspectionJobDetail" @searchTableSuccessDetail="searchTableSuccessDetail"
:isShowAddBtn="false" :detailButtonIsShow="true" />
<!-- 导入 -->
<ImportForm ref="importFormRef" url="/wms/purchase-main/import" :importTemplateData="importTemplateData"
@success="importSuccess" :isShowOut="true" :updateIsDisable="true" :coverIsDisable="true" :mode="2" />
</template>
<script setup lang="ts">
import download from '@/utils/download'
import { InspectionJobMain, InspectionJobMainRules, InspectionJobDetail, InspectionJobDetailRules } from './inspectionJobMain.data'
import * as InspectionJobMainApi from '@/api/qms/inspectionJob/inspectionJobMain'
import * as InspectionJobDetailApi from '@/api/qms/inspectionJob/inspectionJobDetail'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import TableHead from '@/components/TableHead/src/TableHead.vue'
import ImportForm from '@/components/ImportForm/src/ImportForm.vue'
//
defineOptions({ name: 'InspectionJobMain' })
const message = useMessage() //
const { t } = useI18n() //
const route = useRoute() //
const routeName = ref()
routeName.value = route.name
const tableColumns = ref(InspectionJobMain.allSchemas.tableColumns)
//
const updataTableColumns = (val) => {
tableColumns.value = val
}
//
const searchTableSuccess = (formField, searchField, val, formRef, type, row) => {
nextTick(async () => {
if (type == 'tableForm') {
//
row[formField] = val[0][searchField]
row['itemNumber'] = val[0]['number']
row['itemName'] = val[0]['name']
row['uom'] = val[0]['uom']
row['isRadeIn'] = val[0]['isRadeIn']
row['available'] = val[0]['available']
} else {
const setV = {}
setV[formField] = val[0][searchField]
formRef.setValues(setV)
}
})
}
//
const searchTableSuccessDetail = (formField, searchField, val, formRef) => {
nextTick(async () => {
const setV = {}
// if(formField == 'itemCode'){
// await ItembasicApi.getItembasicPage({
// code: setV['itemCode']
// }).then(res => {
// setV['uom'] = res.list[0].uom
// setV[formField] = val[0][searchField]
// })
// }
formRef.setValues(setV)
})
}
//
const Echo = []
const { tableObject, tableMethods } = useTable({
getListApi: InspectionJobMainApi.getInspectionJobMainPage //
})
//
const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultAddBtn(null), //
// defaultButtons.defaultExportBtn(null), //
defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), //
// {
// label: '',
// name: 'zdy',
// hide: false,
// type: 'primary',
// icon: 'Select',
// color: ''
// },
]
//
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 isShowMainButton = (row, val) => {
if (val.indexOf(row.status) > -1) {
return false
} else {
return true
}
}
// -
const butttondata = (row) => {
return [
// defaultButtons.mainListOrderCOMPLETEBtn({ hide: isShowMainButton(row, ['INCOMPLETE']) }), //
// defaultButtons.mainListEditBtn(null), //
// defaultButtons.mainListDeleteBtn(null), //
]
}
// -
const buttonTableClick = async (val, row) => {
if (val == 'edit') { //
openForm('update', row)
}
else if (val == 'delete') { //
handleDelete(row.id)
}
}
/** 添加/修改操作 */
const formRef = ref()
const openForm = async (type : string, row ?: number) => {
tableData.value = [] //
formRef.value.open(type, row)
}
/** 详情操作 */
const detailRef = ref()
const openDetail = (row : any, titleName : any, titleValue : any) => {
detailRef.value.openDetail(row, titleName, titleValue, 'basicInspectionJobMain')
}
/** 删除按钮操作 */
const handleDelete = async (id : number) => {
try {
//
await message.delConfirm()
//
await InspectionJobMainApi.deleteInspectionJobMain(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 InspectionJobMainApi.exportInspectionJobMain(tableObject.params)
download.excel(data, '备件申领记录主.xlsx')
} catch {
} finally {
exportLoading.value = false
}
}
/**
* tableForm方法
*/
const tableFormKeys = {}
InspectionJobDetail.allSchemas.tableFormColumns.forEach(item => {
tableFormKeys[item.field] = item.default ? item.default : ''
})
const tableData = ref([])
//
const handleAddTable = () => {
tableData.value.push(JSON.parse(JSON.stringify(tableFormKeys)))
}
//
const handleDeleteTable = (item, index) => {
tableData.value.splice(index, 1)
}
//
const submitForm = async (formType, data) => {
data.subList = tableData.value //
try {
if (formType === 'create') {
await InspectionJobMainApi.createInspectionJobMain(data)
message.success(t('common.createSuccess'))
} else {
await InspectionJobMainApi.updateInspectionJobMain(data)
message.success(t('common.updateSuccess'))
}
formRef.value.dialogVisible = false
//
getList()
} finally {
formRef.value.formLoading = 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 InspectionJobMainApi.importTemplate()
})
</script>

329
src/views/qms/inspection/inspectionJob/inspectionJobMain.data.ts

@ -0,0 +1,329 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter2 } from '@/utils/formatTime'
import { validateHanset, validateEmail } from '@/utils/validator'
import { dateFormatter } from '@/utils/formatTime'
const { t } = useI18n() // 国际化
/**
* @returns {Array}
*/
export const InspectionJobMain = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '编码',
field: 'number',
sort: 'custom',
isSearch: true,
},
{
label: '申请编码',
field: 'inspectionCode',
sort: 'custom',
isSearch: true,
},
{
label: '供应商编码',
field: 'supplierCode',
sort: 'custom',
isSearch: true,
},
{
label: '物料编码',
field: 'materialCode',
sort: 'custom',
isSearch: true,
},
{
label: '物料批次',
field: 'materialBatch',
sort: 'custom',
isSearch: true,
},
{
label: '订单号',
field: 'orderCode',
sort: 'custom',
isSearch: true,
},
{
label: '订单行',
field: 'orderRow',
sort: 'custom',
isSearch: true,
form: {
component: 'InputNumber',
value: 0
},
},
{
label: '凭证号',
field: 'certificateCode',
sort: 'custom',
isSearch: true,
},
{
label: '凭证行',
field: 'certificateRow',
sort: 'custom',
isSearch: true,
form: {
component: 'InputNumber',
value: 0
},
},
{
label: '检验方案编码',
field: 'inspectionSchemeCode',
sort: 'custom',
isSearch: true,
},
{
label: '检验方案Json',
field: 'inspectionSchemeJson',
sort: 'custom',
isSearch: true,
},
{
label: '检验批次',
field: 'inspectionBatch',
sort: 'custom',
isSearch: true,
},
{
label: '检验批数量',
field: 'inspectionBatchAmount',
sort: 'custom',
isSearch: true,
},
{
label: '采样总数量',
field: 'sampleTatalAmount',
sort: 'custom',
isSearch: true,
},
{
label: '检验类型',
field: 'inspectionType',
sort: 'custom',
isSearch: true,
form: {
component: 'SelectV2'
},
},
{
label: '检验批来源',
field: 'inspectionBatchSource',
sort: 'custom',
isSearch: true,
},
{
label: '检验阶段',
field: 'inspectionStage',
sort: 'custom',
isSearch: true,
form: {
component: 'InputNumber',
value: 0
},
},
{
label: '检验严格性',
field: 'inspectionStringency',
sort: 'custom',
isSearch: true,
},
{
label: '检验任务包装列表',
field: 'inspectionTaskPackageCode',
sort: 'custom',
isSearch: true,
},
{
label: '检验任务工序列表',
field: 'inspectionTaskProcessCode',
sort: 'custom',
isSearch: true,
},
{
label: '计划开始时间',
field: 'planStartTime',
sort: 'custom',
formatter: dateFormatter,
isSearch: true,
search: {
component: 'DatePicker',
componentProps: {
valueFormat: 'YYYY-MM-DD HH:mm:ss',
type: 'daterange',
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')]
}
},
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
valueFormat: 'x'
}
},
},
{
label: '计划结束时间',
field: 'planEndTime',
sort: 'custom',
formatter: dateFormatter,
isSearch: true,
search: {
component: 'DatePicker',
componentProps: {
valueFormat: 'YYYY-MM-DD HH:mm:ss',
type: 'daterange',
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')]
}
},
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
valueFormat: 'x'
}
},
},
{
label: '检验水平',
field: 'inspectionLevel',
sort: 'custom',
isSearch: true,
},
{
label: 'AQL值',
field: 'aqlValue',
sort: 'custom',
isSearch: true,
},
{
label: '是否可用',
field: 'available',
sort: 'custom',
isSearch: true,
},
{
label: '操作',
field: 'action',
isDetail: false,
isForm: false,
table: {
width: 200,
fixed: 'right'
}
}
]))
//表单校验
export const InspectionJobMainRules = reactive({
number: [required],
inspectionCode: [required],
supplierCode: [required],
materialCode: [required],
materialBatch: [required],
orderCode: [required],
certificateRow: [required],
inspectionSchemeCode: [required],
inspectionSchemeJson: [required],
inspectionBatch: [required],
inspectionBatchAmount: [required],
sampleTatalAmount: [required],
inspectionType: [required],
inspectionBatchSource: [required],
inspectionStage: [required],
inspectionStringency: [required],
inspectionLevel: [required],
available: [required],
})
/**
* @returns {Array}
*/
export const InspectionJobDetail = useCrudSchemas(reactive<CrudSchema[]>([
{
label: 'id',
field: 'id',
sort: 'custom',
isTable: false,
isSearch: true,
isForm: false,
},
{
label: '单据号',
field: 'number',
sort: 'custom',
isSearch: true,
},
{
label: '主表ID',
field: 'masterId',
sort: 'custom',
isSearch: true,
form: {
component: 'InputNumber',
value: 0
},
},
{
label: '任务编码',
field: 'taskCode',
sort: 'custom',
isSearch: true,
},
{
label: '工序编码',
field: 'processCode',
sort: 'custom',
isSearch: true,
},
{
label: '工序描述',
field: 'processDescribe',
sort: 'custom',
isSearch: true,
},
{
label: '顺序号',
field: 'sequenceCode',
sort: 'custom',
isSearch: true,
form: {
component: 'InputNumber',
value: 0
},
},
{
label: '检验特性编号',
field: 'inspectionFeatureCode',
sort: 'custom',
isSearch: true,
},
{
label: '是否可用',
field: 'available',
sort: 'custom',
isSearch: true,
},
{
label: '操作',
field: 'action',
isDetail: false,
isForm: false,
table: {
width: 150,
fixed: 'right'
},
isTableForm: false,
}
]))
//表单校验
export const InspectionJobDetailRules = reactive({
taskCode: [required],
processCode: [required],
sequenceCode: [required],
available: [required],
})

244
src/views/qms/inspection/inspectionRequest/index.vue

@ -0,0 +1,244 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="InspectionMain.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
</ContentWrap>
<!-- 列表头部 -->
<TableHead
:HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick"
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="InspectionMain.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 #code="{row}">
<el-button type="primary" link @click="openDetail(row, '代码', row.code)">
<span>{{ row.code }}</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="InspectionMainRules"
:formAllSchemas="InspectionMain.allSchemas"
:apiUpdate="InspectionMainApi.updateInspectionMain"
:apiCreate="InspectionMainApi.createInspectionMain"
@searchTableSuccess="searchTableSuccess"
:isBusiness="false"
/>
<!-- 详情 -->
<Detail ref="detailRef" :isBasic="true" :allSchemas="InspectionMain.allSchemas" />
<!-- 导入 -->
<ImportForm ref="importFormRef" url="/request/inspection-main/import" :importTemplateData="importTemplateData" @success="importSuccess" />
</template>
<script setup lang="ts">
import download from '@/utils/download'
import { InspectionMain,InspectionMainRules } from './inspectionMain.data'
import * as InspectionMainApi from '@/api/qms/inspectionRequest'
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'
defineOptions({ name: 'InspectionMain' })
const message = useMessage() //
const { t } = useI18n() //
const route = useRoute() //
const routeName = ref()
routeName.value = route.name
const tableColumns = ref(InspectionMain.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: InspectionMainApi.getInspectionMainPage //
})
//
const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultAddBtn({hasPermi:'wms:inspectionMain:create'}), //
defaultButtons.defaultImportBtn({hasPermi:'wms:inspectionMain:import'}), //
defaultButtons.defaultExportBtn({hasPermi:'wms:inspectionMain:export'}), //
defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), //
// {
// label: '',
// name: 'zdy',
// hide: false,
// type: 'primary',
// icon: 'Select',
// color: ''
// },
]
//
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:'wms:inspectionMain:update'}), //
defaultButtons.mainListDeleteBtn({hasPermi:'wms:inspectionMain: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) => {
var isHave =InspectionMain.allSchemas.formSchema.some(function (item) {
return item.field === 'activeTime' || item.field === 'expireTime';
});
if(isHave){
if(data.activeTime && data.expireTime && data.activeTime >=data.expireTime){
message.error('失效时间要大于生效时间')
return;
}
}
if(data.activeTime==0)data.activeTime = null;
if(data.expireTime==0)data.expireTime = null;
if (formType === 'create') {
await InspectionMainApi.createInspectionMain(data)
message.success(t('common.createSuccess'))
} else {
await InspectionMainApi.updateInspectionMain(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, 'basicInspectionMain')
}
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
try {
//
await message.delConfirm()
//
await InspectionMainApi.deleteInspectionMain(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 InspectionMainApi.exportInspectionMain(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 InspectionMainApi.importTemplate()
})
</script>

239
src/views/qms/inspection/inspectionRequest/inspectionMain.data.ts

@ -0,0 +1,239 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime'
// 表单校验
export const InspectionMainRules = reactive({
number: [required],
applicationDate: [required],
applicationTime: [required],
supplierCode: [required],
materialCode: [required],
batch: [required],
referenceOrderCode: [required],
referenceOrderRow: [required],
inspectionSchemeCode: [required],
inspectionStageCode: [required],
inspectionLevel: [required],
available: [required],
})
export const InspectionMain = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '编码',
field: 'number',
sort: 'custom',
isSearch: true,
},
{
label: '申请日期',
field: 'applicationDate',
sort: 'custom',
formatter: dateFormatter,
isSearch: true,
search: {
component: 'DatePicker',
componentProps: {
valueFormat: 'YYYY-MM-DD HH:mm:ss',
type: 'daterange',
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')]
}
},
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
valueFormat: 'x'
}
},
},
{
label: '申请时间',
field: 'applicationTime',
sort: 'custom',
formatter: dateFormatter,
isSearch: true,
search: {
component: 'DatePicker',
componentProps: {
valueFormat: 'YYYY-MM-DD HH:mm:ss',
type: 'daterange',
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')]
}
},
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
valueFormat: 'x'
}
},
},
{
label: '要求开始时间',
field: 'requestStartTime',
sort: 'custom',
formatter: dateFormatter,
isSearch: true,
search: {
component: 'DatePicker',
componentProps: {
valueFormat: 'YYYY-MM-DD HH:mm:ss',
type: 'daterange',
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')]
}
},
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
valueFormat: 'x'
}
},
},
{
label: '要求结束时间',
field: 'requestEndTime',
sort: 'custom',
formatter: dateFormatter,
isSearch: true,
search: {
component: 'DatePicker',
componentProps: {
valueFormat: 'YYYY-MM-DD HH:mm:ss',
type: 'daterange',
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')]
}
},
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
valueFormat: 'x'
}
},
},
{
label: '完成时间',
field: 'finishTime',
sort: 'custom',
formatter: dateFormatter,
isSearch: true,
search: {
component: 'DatePicker',
componentProps: {
valueFormat: 'YYYY-MM-DD HH:mm:ss',
type: 'daterange',
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')]
}
},
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
valueFormat: 'x'
}
},
},
{
label: '供应商编码',
field: 'supplierCode',
sort: 'custom',
isSearch: true,
},
{
label: '物料编码',
field: 'materialCode',
sort: 'custom',
isSearch: true,
},
{
label: '批次',
field: 'batch',
sort: 'custom',
isSearch: true,
},
{
label: '待检数量',
field: 'requestInspectionNum',
sort: 'custom',
isSearch: true,
},
{
label: '参考订单号',
field: 'referenceOrderCode',
sort: 'custom',
isSearch: true,
},
{
label: '参考订单行',
field: 'referenceOrderRow',
sort: 'custom',
isSearch: true,
form: {
component: 'InputNumber',
value: 0
},
},
{
label: '参考凭证号',
field: 'referenceCertificateCode',
sort: 'custom',
isSearch: true,
},
{
label: '参考凭证行',
field: 'referenceCertificateRow',
sort: 'custom',
isSearch: true,
form: {
component: 'InputNumber',
value: 0
},
},
{
label: '检验方案编码',
field: 'inspectionSchemeCode',
sort: 'custom',
isSearch: true,
},
{
label: '检验阶段',
field: 'inspectionStageCode',
sort: 'custom',
isSearch: true,
},
{
label: '检验申请包装列表',
field: 'applicationPackageCode',
sort: 'custom',
isSearch: true,
},
{
label: '检验水平',
field: 'inspectionLevel',
sort: 'custom',
isSearch: true,
},
{
label: 'AQL值',
field: 'aqlValue',
sort: 'custom',
isSearch: true,
},
{
label: '是否可用',
field: 'available',
sort: 'custom',
isSearch: true,
},
{
label: '操作',
field: 'action',
isForm: false,
table: {
width: 150,
fixed: 'right'
}
}
]))

244
src/views/qms/inspectionMethod/index.vue

@ -0,0 +1,244 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="InspectionMethod.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
</ContentWrap>
<!-- 列表头部 -->
<TableHead
:HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick"
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="InspectionMethod.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 #code="{row}">
<el-button type="primary" link @click="openDetail(row, '代码', row.code)">
<span>{{ row.code }}</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="InspectionMethodRules"
:formAllSchemas="InspectionMethod.allSchemas"
:apiUpdate="InspectionMethodApi.updateInspectionMethod"
:apiCreate="InspectionMethodApi.createInspectionMethod"
@searchTableSuccess="searchTableSuccess"
:isBusiness="false"
/>
<!-- 详情 -->
<Detail ref="detailRef" :isBasic="true" :allSchemas="InspectionMethod.allSchemas" />
<!-- 导入 -->
<ImportForm ref="importFormRef" url="/qms/inspection-method/import" :importTemplateData="importTemplateData" @success="importSuccess" />
</template>
<script setup lang="ts">
import download from '@/utils/download'
import { InspectionMethod,InspectionMethodRules } from './inspectionMethod.data'
import * as InspectionMethodApi from '@/api/qms/inspectionMethod'
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'
defineOptions({ name: 'InspectionMethod' })
const message = useMessage() //
const { t } = useI18n() //
const route = useRoute() //
const routeName = ref()
routeName.value = route.name
const tableColumns = ref(InspectionMethod.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: InspectionMethodApi.getInspectionMethodPage //
})
//
const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultAddBtn({hasPermi:'wms:inspectionMethod:create'}), //
defaultButtons.defaultImportBtn({hasPermi:'wms:inspectionMethod:import'}), //
defaultButtons.defaultExportBtn({hasPermi:'wms:inspectionMethod:export'}), //
defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), //
// {
// label: '',
// name: 'zdy',
// hide: false,
// type: 'primary',
// icon: 'Select',
// color: ''
// },
]
//
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:'wms:inspectionMethod:update'}), //
defaultButtons.mainListDeleteBtn({hasPermi:'wms:inspectionMethod: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) => {
var isHave =InspectionMethod.allSchemas.formSchema.some(function (item) {
return item.field === 'activeTime' || item.field === 'expireTime';
});
if(isHave){
if(data.activeTime && data.expireTime && data.activeTime >=data.expireTime){
message.error('失效时间要大于生效时间')
return;
}
}
if(data.activeTime==0)data.activeTime = null;
if(data.expireTime==0)data.expireTime = null;
if (formType === 'create') {
await InspectionMethodApi.createInspectionMethod(data)
message.success(t('common.createSuccess'))
} else {
await InspectionMethodApi.updateInspectionMethod(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, 'basicInspectionMethod')
}
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
try {
//
await message.delConfirm()
//
await InspectionMethodApi.deleteInspectionMethod(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 InspectionMethodApi.exportInspectionMethod(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 InspectionMethodApi.importTemplate()
})
</script>

75
src/views/qms/inspectionMethod/inspectionMethod.data.ts

@ -0,0 +1,75 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime'
// 表单校验
export const InspectionMethodRules = reactive({
code: [required],
status: [required],
available: [required],
})
export const InspectionMethod = useCrudSchemas(reactive<CrudSchema[]>([
{
label: 'id',
field: 'id',
sort: 'custom',
isTable: false,
isForm: false,
},
{
label: '编码',
field: 'code',
sort: 'custom',
isSearch: true,
},
{
label: '描述',
field: 'describe',
sort: 'custom',
},
{
label: '版本',
field: 'version',
sort: 'custom',
},
{
label: '状态',
field: 'status',
sort: 'custom',
isSearch: true,
form: {
component: 'Radio'
},
},
{
label: '操作指导',
field: 'operationGuidance',
sort: 'custom',
},
{
label: '视频地址',
field: 'videoAddress',
sort: 'custom',
},
{
label: '是否可用',
field: 'available',
sort: 'custom',
},
{
label: '创建时间',
field: 'createTime',
sort: 'custom',
formatter: dateFormatter,
isForm: false,
},
{
label: '操作',
field: 'action',
isForm: false,
table: {
width: 150,
fixed: 'right'
}
}
]))

244
src/views/qms/sampleCode/index.vue

@ -0,0 +1,244 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="SampleCode.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
</ContentWrap>
<!-- 列表头部 -->
<TableHead
:HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick"
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="SampleCode.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 #code="{row}">
<el-button type="primary" link @click="openDetail(row, '代码', row.code)">
<span>{{ row.code }}</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="SampleCodeRules"
:formAllSchemas="SampleCode.allSchemas"
:apiUpdate="SampleCodeApi.updateSampleCode"
:apiCreate="SampleCodeApi.createSampleCode"
@searchTableSuccess="searchTableSuccess"
:isBusiness="false"
/>
<!-- 详情 -->
<Detail ref="detailRef" :isBasic="true" :allSchemas="SampleCode.allSchemas" />
<!-- 导入 -->
<ImportForm ref="importFormRef" url="/qms/sample-code/import" :importTemplateData="importTemplateData" @success="importSuccess" />
</template>
<script setup lang="ts">
import download from '@/utils/download'
import { SampleCode,SampleCodeRules } from './sampleCode.data'
import * as SampleCodeApi from '@/api/qms/sampleCode'
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'
defineOptions({ name: 'SampleCode' })
const message = useMessage() //
const { t } = useI18n() //
const route = useRoute() //
const routeName = ref()
routeName.value = route.name
const tableColumns = ref(SampleCode.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: SampleCodeApi.getSampleCodePage //
})
//
const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultAddBtn({hasPermi:'wms:sampleCode:create'}), //
defaultButtons.defaultImportBtn({hasPermi:'wms:sampleCode:import'}), //
defaultButtons.defaultExportBtn({hasPermi:'wms:sampleCode:export'}), //
defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), //
// {
// label: '',
// name: 'zdy',
// hide: false,
// type: 'primary',
// icon: 'Select',
// color: ''
// },
]
//
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:'wms:sampleCode:update'}), //
defaultButtons.mainListDeleteBtn({hasPermi:'wms:sampleCode: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) => {
var isHave =SampleCode.allSchemas.formSchema.some(function (item) {
return item.field === 'activeTime' || item.field === 'expireTime';
});
if(isHave){
if(data.activeTime && data.expireTime && data.activeTime >=data.expireTime){
message.error('失效时间要大于生效时间')
return;
}
}
if(data.activeTime==0)data.activeTime = null;
if(data.expireTime==0)data.expireTime = null;
if (formType === 'create') {
await SampleCodeApi.createSampleCode(data)
message.success(t('common.createSuccess'))
} else {
await SampleCodeApi.updateSampleCode(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, 'basicSampleCode')
}
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
try {
//
await message.delConfirm()
//
await SampleCodeApi.deleteSampleCode(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 SampleCodeApi.exportSampleCode(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 SampleCodeApi.importTemplate()
})
</script>

101
src/views/qms/sampleCode/sampleCode.data.ts

@ -0,0 +1,101 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime'
// 表单校验
export const SampleCodeRules = reactive({
code: [required],
batchUpperLimiting: [required],
available: [required],
})
export const SampleCode = useCrudSchemas(reactive<CrudSchema[]>([
{
label: 'id',
field: 'id',
sort: 'custom',
isTable: false,
isForm: false,
},
{
label: '采样方案编码',
field: 'code',
sort: 'custom',
isSearch: true,
},
{
label: '批量下限',
field: 'batchLow limiting',
sort: 'custom',
isSearch: true,
form: {
component: 'InputNumber',
value: 0
},
},
{
label: '批量上限',
field: 'batchUpperLimiting',
sort: 'custom',
isSearch: true,
form: {
component: 'InputNumber',
value: 0
},
},
{
label: 's1',
field: 's1',
sort: 'custom',
},
{
label: 's2',
field: 's2',
sort: 'custom',
},
{
label: 's3',
field: 's3',
sort: 'custom',
},
{
label: 's4',
field: 's4',
sort: 'custom',
},
{
label: 'g1',
field: 'g1',
sort: 'custom',
},
{
label: 'g2',
field: 'g2',
sort: 'custom',
},
{
label: 'g3',
field: 'g3',
sort: 'custom',
},
{
label: '是否可用',
field: 'available',
sort: 'custom',
},
{
label: '创建时间',
field: 'createTime',
sort: 'custom',
formatter: dateFormatter,
isForm: false,
},
{
label: '操作',
field: 'action',
isForm: false,
table: {
width: 150,
fixed: 'right'
}
}
]))

3
src/views/qms/samplingProcess/index.vue

@ -99,7 +99,8 @@ const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultAddBtn({hasPermi:'wms:samplingProcess:create'}), //
// defaultButtons.defaultAddBtn({hasPermi:'wms:samplingProcess:create'}), //
defaultButtons.defaultAddBtn(null), //
defaultButtons.defaultImportBtn({hasPermi:'wms:samplingProcess:import'}), //
defaultButtons.defaultExportBtn({hasPermi:'wms:samplingProcess:export'}), //
defaultButtons.defaultFreshBtn(null), //

244
src/views/qms/samplingScheme/index.vue

@ -0,0 +1,244 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="SamplingScheme.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
</ContentWrap>
<!-- 列表头部 -->
<TableHead
:HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick"
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="SamplingScheme.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 #code="{row}">
<el-button type="primary" link @click="openDetail(row, '代码', row.code)">
<span>{{ row.code }}</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="SamplingSchemeRules"
:formAllSchemas="SamplingScheme.allSchemas"
:apiUpdate="SamplingSchemeApi.updateSamplingScheme"
:apiCreate="SamplingSchemeApi.createSamplingScheme"
@searchTableSuccess="searchTableSuccess"
:isBusiness="false"
/>
<!-- 详情 -->
<Detail ref="detailRef" :isBasic="true" :allSchemas="SamplingScheme.allSchemas" />
<!-- 导入 -->
<ImportForm ref="importFormRef" url="/qms/sampling-scheme/import" :importTemplateData="importTemplateData" @success="importSuccess" />
</template>
<script setup lang="ts">
import download from '@/utils/download'
import { SamplingScheme,SamplingSchemeRules } from './samplingScheme.data'
import * as SamplingSchemeApi from '@/api/qms/samplingScheme'
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'
defineOptions({ name: 'SamplingScheme' })
const message = useMessage() //
const { t } = useI18n() //
const route = useRoute() //
const routeName = ref()
routeName.value = route.name
const tableColumns = ref(SamplingScheme.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: SamplingSchemeApi.getSamplingSchemePage //
})
//
const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultAddBtn({hasPermi:'wms:samplingScheme:create'}), //
defaultButtons.defaultImportBtn({hasPermi:'wms:samplingScheme:import'}), //
defaultButtons.defaultExportBtn({hasPermi:'wms:samplingScheme:export'}), //
defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), //
// {
// label: '',
// name: 'zdy',
// hide: false,
// type: 'primary',
// icon: 'Select',
// color: ''
// },
]
//
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:'wms:samplingScheme:update'}), //
defaultButtons.mainListDeleteBtn({hasPermi:'wms:samplingScheme: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) => {
var isHave =SamplingScheme.allSchemas.formSchema.some(function (item) {
return item.field === 'activeTime' || item.field === 'expireTime';
});
if(isHave){
if(data.activeTime && data.expireTime && data.activeTime >=data.expireTime){
message.error('失效时间要大于生效时间')
return;
}
}
if(data.activeTime==0)data.activeTime = null;
if(data.expireTime==0)data.expireTime = null;
if (formType === 'create') {
await SamplingSchemeApi.createSamplingScheme(data)
message.success(t('common.createSuccess'))
} else {
await SamplingSchemeApi.updateSamplingScheme(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, 'basicSamplingScheme')
}
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
try {
//
await message.delConfirm()
//
await SamplingSchemeApi.deleteSamplingScheme(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 SamplingSchemeApi.exportSamplingScheme(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 SamplingSchemeApi.importTemplate()
})
</script>

61
src/views/qms/samplingScheme/samplingScheme.data.ts

@ -0,0 +1,61 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime'
// 表单校验
export const SamplingSchemeRules = reactive({
code: [required],
status: [required],
available: [required],
})
export const SamplingScheme = useCrudSchemas(reactive<CrudSchema[]>([
{
label: 'id',
field: 'id',
sort: 'custom',
isTable: false,
isForm: false,
},
{
label: '编码',
field: 'code',
sort: 'custom',
isSearch: true,
},
{
label: '描述',
field: 'describe',
sort: 'custom',
isSearch: true,
},
{
label: '状态',
field: 'status',
sort: 'custom',
isSearch: true,
form: {
component: 'Radio'
},
},
{
label: '是否可用',
field: 'available',
sort: 'custom',
},
{
label: '创建时间',
field: 'createTime',
sort: 'custom',
formatter: dateFormatter,
isForm: false,
},
{
label: '操作',
field: 'action',
isForm: false,
table: {
width: 150,
fixed: 'right'
}
}
]))

36
src/views/wms/basicDataManage/itemManage/itemwarehouse/itemwarehouse.data.ts

@ -2,10 +2,10 @@ import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime'
import * as ItembasicApi from '@/api/wms/itembasic'
import { Itembasic } from '../itembasic/itembasic.data'
import * as AreaApi from '@/api/wms/areabasic'
import { Area } from '../../factoryModeling/areabasic/areabasic.data'
import * as PackageunitApi from '@/api/wms/packageunit'
import { Packageunit } from '../packageunit/packageunit.data'
import * as WarehouseApi from '@/api/wms/warehouse'
import { Warehouse } from '../../factoryModeling/warehouse/warehouse.data'
import * as ItempackageApi from '@/api/wms/itempackage'
import { Itempackaging } from '../itempackage/itempackage.data'
export const Itemwarehouse = useCrudSchemas(reactive<CrudSchema[]>([
{
@ -36,7 +36,7 @@ export const Itemwarehouse = useCrudSchemas(reactive<CrudSchema[]>([
}
},
{
label: '区域代码',
label: '仓库代码',
field: 'warehouseCode',
sort: 'custom',
isSearch: true,
@ -47,11 +47,11 @@ export const Itemwarehouse = useCrudSchemas(reactive<CrudSchema[]>([
// labelMessage: '信息提示说明!!!',
componentProps: {
isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择库代码', // 输入框占位文本
searchListPlaceholder: '请选择库代码', // 输入框占位文本
searchField: 'code', // 查询弹窗赋值字段
searchTitle: '库基础信息', // 查询弹窗标题
searchAllSchemas: Area.allSchemas, // 查询弹窗所需类
searchPage: AreaApi.getAreaPage, // 查询弹窗所需分页方法
searchTitle: '库基础信息', // 查询弹窗标题
searchAllSchemas: Warehouse.allSchemas, // 查询弹窗所需类
searchPage: WarehouseApi.getWarehousePage, // 查询弹窗所需分页方法
searchCondition: [{
key: 'available',
value: 'TRUE',
@ -85,17 +85,19 @@ export const Itemwarehouse = useCrudSchemas(reactive<CrudSchema[]>([
// labelMessage: '信息提示说明!!!',
componentProps: {
isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择包装规格代码', // 输入框占位文本
searchField: 'code', // 查询弹窗赋值字段
searchTitle: '包装规格基础信息', // 查询弹窗标题
searchAllSchemas: Packageunit.allSchemas, // 查询弹窗所需类
searchPage: PackageunitApi.getPackageunitPage, // 查询弹窗所需分页方法
searchListPlaceholder: '请选择物料包装代码', // 输入框占位文本
searchField: 'packUnit', // 查询弹窗赋值字段
searchTitle: '物料包装信息', // 查询弹窗标题
searchAllSchemas: Itempackaging.allSchemas, // 查询弹窗所需类
searchPage: ItempackageApi.getItempackagingPage, // 查询弹窗所需分页方法
searchCondition: [{
key: 'available',
value: 'TRUE',
action: '==',
isSearch: true,
isMainValue: false
},{
key: 'itemCode',
value: 'itemCode',
message: "请选择物料代码",
isMainValue: true
}]
}
}

2
src/views/wms/buttMesManage/mesBarCode/mesBarCode.data.ts

@ -170,7 +170,7 @@ export const MesBarCode = useCrudSchemas(reactive<CrudSchema[]>([
},
{
label: '创建时间',
field: 'createTime',
field: 'createTime',
sort: 'custom',
formatter: dateFormatter,
table: {

10
src/views/wms/deliversettlementManage/deliver/deliverJobMain/deliverJobMain.data.ts

@ -76,6 +76,16 @@ export const DeliverJobMain = useCrudSchemas(reactive<CrudSchema[]>([
width: 150
},
},
{
label: '发货类型',
field: 'deliverType',
sort: 'custom',
dictType: DICT_TYPE.DELIVER_TYPE,
dictClass: 'string',
table: {
width: 150
},
},
{
label: '承运商',
field: 'carrierCode',

5
src/views/wms/productionManage/productredress/productredressJobMain/index.vue

@ -54,6 +54,7 @@
<script setup lang="ts">
import download from '@/utils/download'
import { CACHE_KEY, useCache } from '@/hooks/web/useCache'
import { ProductredressJobMain,ProductredressJobMainRules,ProductredressJobDetail, ProductredressJobDetailRules } from './productredressJobMain.data'
import * as ProductredressJobMainApi from '@/api/wms/productredressJobMain'
import * as ProductredressJobDetailApi from '@/api/wms/productredressJobDetail'
@ -130,9 +131,13 @@ ProductredressJobDetail.allSchemas.tableFormColumns.forEach(item => {
tableFormKeys[item.field] = item.default ? item.default : ''
})
//
const { wsCache } = useCache()
/** 详情操作 */
const detailRef = ref()
const openDetail = (row: any, titleName: any, titleValue: any) => {
const departmentCode = wsCache.get(CACHE_KEY.DEPT).find((account) => account.id == row.departmentCode)?.name
if (departmentCode) row.departmentCode = JSON.parse(JSON.stringify(departmentCode))
detailRef.value.openDetail(row, titleName, titleValue, 'basicProductredressJobMain')
}

4
src/views/wms/productionManage/productredress/productredressJobMain/productredressJobMain.data.ts

@ -540,6 +540,8 @@ export const ProductredressJobDetail = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '计量单位',
field: 'uom',
dictType: DICT_TYPE.UOM,
dictClass: 'string',
sort: 'custom',
table: {
width: 150
@ -572,6 +574,8 @@ export const ProductredressJobDetail = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '库存状态',
field: 'inventoryStatus',
dictType: DICT_TYPE.INVENTORY_STATUS,
dictClass: 'string',
sort: 'custom',
table: {
width: 150

133
src/views/wms/productionManage/productredress/productredressRecordMain/index.vue

@ -27,9 +27,9 @@
v-model:currentPage="tableObject.currentPage"
v-model:sort="tableObject.sort"
>
<template #code="{row}">
<el-button type="primary" link @click="openDetail(row, '代码', row.code)">
<span>{{ row.code }}</span>
<template #number="{row}">
<el-button type="primary" link @click="openDetail(row, '代码', row.number)">
<span>{{ row.number }}</span>
</el-button>
</template>
<template #action="{ row }">
@ -38,33 +38,25 @@
</Table>
</ContentWrap>
<!-- 表单弹窗添加/修改 -->
<BasicForm
ref="basicFormRef"
@success="formsSuccess"
:rules="ProductredressRecordMainRules"
:formAllSchemas="ProductredressRecordMain.allSchemas"
:apiUpdate="ProductredressRecordMainApi.updateProductredressRecordMain"
:apiCreate="ProductredressRecordMainApi.createProductredressRecordMain"
@searchTableSuccess="searchTableSuccess"
:isBusiness="false"
/>
<!-- 详情 -->
<Detail ref="detailRef" :isBasic="true" :allSchemas="ProductredressRecordMain.allSchemas" />
<Detail
ref="detailRef"
:isBasic="false"
:allSchemas="ProductredressRecordMain.allSchemas"
:detailAllSchemas="ProductredressRecordDetail.allSchemas"
:detailAllSchemasRules="ProductredressRecordDetailRules"
:apiPage="ProductredressRecordDetailApi.getProductredressRecordDetailPage"
/>
<!-- 导入 -->
<ImportForm ref="importFormRef" url="/wms/productredress-record-main/import" :importTemplateData="importTemplateData" @success="importSuccess" />
</template>
<script setup lang="ts">
import download from '@/utils/download'
import { ProductredressRecordMain,ProductredressRecordMainRules } from './productredressRecordMain.data'
import { CACHE_KEY, useCache } from '@/hooks/web/useCache'
import { ProductredressRecordMain,ProductredressRecordMainRules,ProductredressRecordDetail,ProductredressRecordDetailRules } from './productredressRecordMain.data'
import * as ProductredressRecordMainApi from '@/api/wms/productredressRecordMain'
import * as ProductredressRecordDetailApi from '@/api/wms/productredressRecordDetail'
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'
defineOptions({ name: 'ProductredressRecordMain' })
@ -76,15 +68,6 @@ const routeName = ref()
routeName.value = route.name
const tableColumns = ref(ProductredressRecordMain.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
@ -99,29 +82,15 @@ const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultAddBtn({hasPermi:'wms:productredressRecordMain:create'}), //
defaultButtons.defaultImportBtn({hasPermi:'wms:productredressRecordMain:import'}), //
defaultButtons.defaultExportBtn({hasPermi:'wms:productredressRecordMain:export'}), //
defaultButtons.defaultExportBtn({hasPermi:'wms:productredress-record-main:export'}), //
defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), //
// {
// label: '',
// name: 'zdy',
// hide: false,
// type: 'primary',
// icon: 'Select',
// color: ''
// },
]
//
const buttonBaseClick = (val, item) => {
if (val == 'add') { //
openForm('create')
} else if (val == 'import') { //
handleImport()
} else if (val == 'export') { //
if (val == 'export') { //
handleExport()
} else if (val == 'refresh') { //
getList()
@ -133,68 +102,22 @@ const buttonBaseClick = (val, item) => {
// -
const butttondata = [
defaultButtons.mainListEditBtn({hasPermi:'wms:productredressRecordMain:update'}), //
defaultButtons.mainListDeleteBtn({hasPermi:'wms:productredressRecordMain: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) => {
var isHave =ProductredressRecordMain.allSchemas.formSchema.some(function (item) {
return item.field === 'activeTime' || item.field === 'expireTime';
});
if(isHave){
if(data.activeTime && data.expireTime && data.activeTime >=data.expireTime){
message.error('失效时间要大于生效时间')
return;
}
}
if(data.activeTime==0)data.activeTime = null;
if(data.expireTime==0)data.expireTime = null;
if (formType === 'create') {
await ProductredressRecordMainApi.createProductredressRecordMain(data)
message.success(t('common.createSuccess'))
} else {
await ProductredressRecordMainApi.updateProductredressRecordMain(data)
message.success(t('common.updateSuccess'))
}
basicFormRef.value.dialogVisible = false
getList()
}
//
const { wsCache } = useCache()
/** 详情操作 */
const detailRef = ref()
const openDetail = (row: any, titleName: any, titleValue: any) => {
const departmentCode = wsCache.get(CACHE_KEY.DEPT).find((account) => account.id == row.departmentCode)?.name
if (departmentCode) row.departmentCode = JSON.parse(JSON.stringify(departmentCode))
detailRef.value.openDetail(row, titleName, titleValue, 'basicProductredressRecordMain')
}
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
try {
//
await message.delConfirm()
//
await ProductredressRecordMainApi.deleteProductredressRecordMain(id)
message.success(t('common.delSuccess'))
//
await getList()
} catch {}
}
/** 导出按钮操作 */
const exportLoading = ref(false) //
const handleExport = async () => {
@ -211,21 +134,6 @@ const handleExport = async () => {
}
}
/** 导入 */
const importFormRef = ref()
const handleImport = () => {
importFormRef.value.open()
}
//
const importTemplateData = reactive({
templateUrl: '',
templateTitle: '制品回收记录主导入模版.xlsx'
})
//
const importSuccess = () => {
getList()
}
//
const searchFormClick = (searchData) => {
tableObject.params = {
@ -238,7 +146,6 @@ const searchFormClick = (searchData) => {
/** 初始化 **/
onMounted(async () => {
getList()
importTemplateData.templateUrl = await ProductredressRecordMainApi.importTemplate()
})
</script>

555
src/views/wms/productionManage/productredress/productredressRecordMain/productredressRecordMain.data.ts

@ -1,213 +1,316 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime'
// 获取当前操作人的部门
import { TableColumn } from '@/types/table'
import { useUserStore } from '@/store/modules/user'
const userStore = useUserStore()
const userDept = userStore.userSelfInfo.dept
// id 转str 否则form回显匹配不到
userDept.id = userDept.id.toString()
const userDeptArray:any = [userDept]
// 表单校验
export const ProductredressRecordMainRules = reactive({
})
export const ProductredressRecordMain = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '单据号',
field: 'number',
sort: 'custom',
table: {
width: 180,
fixed: 'left'
},
isForm: false,
isSearch: true,
},
{
label: '申请单号',
field: 'requestNumber',
sort: 'custom',
isSearch: true,
table: {
width: 180,
},
},
{
label: '任务单号',
field: 'jobNumber',
sort: 'custom',
table: {
width: 180,
},
},
{
label: '生产计划单号',
field: 'productionPlanNumber',
sort: 'custom',
},
{
label: '车间代码',
field: 'workshopCode',
sort: 'custom',
},
{
label: '班组',
field: 'team',
sort: 'custom',
},
{
label: '班次',
field: 'shift',
sort: 'custom',
},
{
label: '明细',
field: 'details',
sort: 'custom',
},
// {
// label: '生产计划单号',
// field: 'productionPlanNumber',
// sort: 'custom',
// },
// {
// label: '车间代码',
// field: 'workshopCode',
// sort: 'custom',
// },
// {
// label: '班组',
// field: 'team',
// sort: 'custom',
// },
// {
// label: '班次',
// field: 'shift',
// sort: 'custom',
// },
// {
// label: '明细',
// field: 'details',
// sort: 'custom',
// },
{
label: '出库事务类型',
field: 'outTransactionType',
sort: 'custom',
form: {
component: 'SelectV2'
},
isForm:false,
isTable:false
},
{
label: '入库事务类型',
field: 'inTransactionType',
sort: 'custom',
form: {
component: 'SelectV2'
},
isForm:false,
isTable:false
},
{
label: '执行时间',
field: 'executeTime',
sort: 'custom',
formatter: dateFormatter,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
table: {
width: 180
},
form: {
component: 'DatePicker',
componentProps: {
style: {width: '100%'},
type: 'datetime',
valueFormat: 'x'
dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x',
}
},
isForm: false
},
{
label: '生效日期',
field: 'activeDate',
sort: 'custom',
formatter: dateFormatter,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
table: {
width: 180
},
form: {
component: 'DatePicker',
componentProps: {
style: {width: '100%'},
type: 'datetime',
valueFormat: 'x'
dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x',
}
},
isForm: false
},
{
label: '是否可用',
field: 'available',
sort: 'custom',
isForm:false,
isTable:false
},
{
label: '申请时间',
field: 'requestTime',
sort: 'custom',
formatter: dateFormatter,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
table: {
width: 180
},
form: {
component: 'DatePicker',
componentProps: {
style: {width: '100%'},
type: 'datetime',
valueFormat: 'x'
dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x',
}
},
isForm: false
},
{
label: '截止时间',
field: 'dueTime',
sort: 'custom',
formatter: dateFormatter,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
table: {
width: 180
},
form: {
component: 'DatePicker',
componentProps: {
style: {width: '100%'},
type: 'datetime',
valueFormat: 'x'
dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x',
}
},
isForm: false
},
{
label: '部门',
field: 'departmentCode',
sort: 'custom',
formatter: (_: Recordable, __: TableColumn, cellValue: number) => {
return userDeptArray.find((account) => account.id == cellValue)?.name
},
table: {
width: 150
},
isForm:false,
isTable:false,
},
{
label: '接口类型',
field: 'interfaceType',
sort: 'custom',
form: {
component: 'SelectV2'
},
},
{
label: '单据号',
field: 'number',
sort: 'custom',
},
{
label: '收货类型',
field: 'type',
sort: 'custom',
form: {
component: 'SelectV2'
},
table: {
width: 150
},
isForm:false,
isTable:false,
},
{
label: '业务类型',
field: 'businessType',
sort: 'custom',
form: {
component: 'SelectV2'
},
table: {
width: 150
},
isForm:false,
isTable:false,
},
{
label: '备注',
field: 'remark',
sort: 'custom',
},
{
label: '创建时间',
field: 'createTime',
sort: 'custom',
formatter: dateFormatter,
isForm: false,
},
{
label: '创建者Id',
field: 'creator',
sort: 'custom',
isForm: false,
},
{
label: '代码',
field: 'code',
sort: 'custom',
table: {
width: 150
},
isForm:false,
isTable:false,
},
{
label: '到仓库代码',
field: 'toWarehouseCode',
sort: 'custom',
table: {
width: 150
},
isForm:false,
isTable:false,
},
{
label: '到库区类型范围',
field: 'toAreaTypes',
sort: 'custom',
table: {
width: 150
},
isForm:false,
isTable:false,
},
{
label: '到库区代码范围',
field: 'toAreaCodes',
sort: 'custom',
table: {
width: 150
},
isForm:false,
isTable:false,
},
{
label: '最后更新时间',
field: 'updateTime',
label: '创建者',
field: 'creator',
sort: 'custom',
formatter: dateFormatter,
isForm: false,
table: {
width: 150
},
},
{
label: '最后更新者用户名',
label: '创建时间',
field: 'createTime',
sort: 'custom',
formatter: dateFormatter,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
table: {
width: 180
},
form: {
component: 'DatePicker',
componentProps: {
style: {width: '100%'},
type: 'datetime',
dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x',
}
},
isForm: false
},
{
label: '最后更新者',
field: 'updater',
sort: 'custom',
isForm: false,
table: {
width: 150
},
},
{
label: '操作',
field: 'action',
isForm: false,
label: '最后更新时间',
field: 'updateTime',
sort: 'custom',
formatter: dateFormatter,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
table: {
width: 150,
fixed: 'right'
}
width: 180
},
form: {
component: 'DatePicker',
componentProps: {
style: {width: '100%'},
type: 'datetime',
dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x',
}
},
isForm: false
}
]))
@ -220,227 +323,259 @@ export const ProductredressRecordDetailRules = reactive({
export const ProductredressRecordDetail = useCrudSchemas(reactive<CrudSchema[]>([
{
label: 'id',
field: 'id',
label: '包装号',
field: 'packingNumber',
sort: 'custom',
table: {
width: 180
},
isForm: false,
},
{
label: '生产线代码',
field: 'productionlineCode',
label: '批次',
field: 'batch',
sort: 'custom',
isSearch: true,
table: {
width: 150
},
isForm: false,
},
{
label: '工位代码',
field: 'workStationCode',
label: '物品代码',
field: 'itemCode',
sort: 'custom',
table: {
width: 150
}
},
{
label: '工序代码',
field: 'processCode',
label: '物品名称',
field: 'itemName',
sort: 'custom',
table: {
width: 150
},
},
{
label: '包装号',
field: 'packingNumber',
label: '物品描述1',
field: 'itemDesc1',
sort: 'custom',
table: {
width: 150
},
},
{
label: '器具号',
field: 'containerNumber',
label: '物品描述2',
field: 'itemDesc2',
sort: 'custom',
table: {
width: 150
},
},
{
label: '批次',
field: 'batch',
label: '项目代码',
field: 'projectCode',
sort: 'custom',
isSearch: true,
table: {
width: 150
},
},
{
label: '数量',
field: 'qty',
sort: 'custom',
table: {
width: 150
},
},
{
label: '计量单位',
field: 'uom',
dictType: DICT_TYPE.UOM,
dictClass: 'string',
sort: 'custom',
table: {
width: 150
},
},
{
label: '生产日期',
field: 'produceDate',
sort: 'custom',
formatter: dateFormatter,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
table: {
width: 180
},
form: {
component: 'DatePicker',
componentProps: {
style: {width: '100%'},
type: 'datetime',
valueFormat: 'x'
dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x',
}
},
isForm: false
},
{
label: '过期日期',
field: 'expireDate',
sort: 'custom',
formatter: dateFormatter,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
table: {
width: 180
},
form: {
component: 'DatePicker',
componentProps: {
style: {width: '100%'},
type: 'datetime',
valueFormat: 'x'
dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x',
}
},
},
{
label: '库存状态',
field: 'inventoryStatus',
sort: 'custom',
form: {
component: 'Radio'
},
},
{
label: '到库位代码',
field: 'toLocationCode',
sort: 'custom',
},
{
label: '到库位组代码',
field: 'toLocationGroupCode',
sort: 'custom',
},
{
label: '到库区代码',
field: 'toAreaCode',
sort: 'custom',
},
{
label: '到货主代码',
field: 'toOwnerCode',
sort: 'custom',
},
{
label: '订单号',
field: 'woNumber',
sort: 'custom',
},
{
label: '订单行',
field: 'woLine',
sort: 'custom',
isForm: false
},
{
label: '包装数量',
field: 'packQty',
sort: 'custom',
table: {
width: 150
}
},
{
label: '包装规格',
field: 'packUnit',
sort: 'custom',
table: {
width: 150
}
},
{
label: 'BOM版本',
field: 'bomVersion',
sort: 'custom',
table: {
width: 150
}
},
{
label: '明细',
field: 'backFlushDetails',
label: '库存状态',
field: 'inventoryStatus',
sort: 'custom',
dictType: DICT_TYPE.INVENTORY_STATUS,
dictClass: 'string',
table: {
width: 150
}
},
{
label: '主表ID',
field: 'masterId',
label: '到库位代码',
field: 'toLocationCode',
sort: 'custom',
form: {
component: 'InputNumber',
value: 0
},
table: {
width: 150
}
},
{
label: '单据号',
field: 'number',
label: '到库位组代码',
field: 'toLocationGroupCode',
sort: 'custom',
table: {
width: 150
}
},
{
label: '物品代码',
field: 'itemCode',
label: '到库区代码',
field: 'toAreaCode',
sort: 'custom',
table: {
width: 150
}
},
// {
// label: '到货主代码',
// field: 'toOwnerCode',
// sort: 'custom',
// table: {
// width: 150
// }
// },
{
label: '备注',
field: 'remark',
sort: 'custom',
table: {
width: 150
}
},
{
label: '创建时间',
field: 'createTime',
sort: 'custom',
formatter: dateFormatter,
isForm: false,
},
{
label: '创建者Id',
label: '创建者',
field: 'creator',
sort: 'custom',
isForm: false,
table: {
width: 150
},
},
{
label: '地点ID',
field: 'siteId',
sort: 'custom',
},
{
label: '物品名称',
field: 'itemName',
sort: 'custom',
},
{
label: '物品描述1',
field: 'itemDesc1',
sort: 'custom',
},
{
label: '物品描述2',
field: 'itemDesc2',
sort: 'custom',
},
{
label: '项目代码',
field: 'projectCode',
sort: 'custom',
},
{
label: '数量',
field: 'qty',
sort: 'custom',
},
{
label: '计量单位',
field: 'uom',
label: '创建时间',
field: 'createTime',
sort: 'custom',
formatter: dateFormatter,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
table: {
width: 180
},
form: {
component: 'DatePicker',
componentProps: {
style: {width: '100%'},
type: 'datetime',
dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x',
}
},
isForm: false
},
{
label: '接口类型',
field: 'interfaceType',
label: '最后更新者',
field: 'updater',
sort: 'custom',
form: {
component: 'SelectV2'
},
isForm: false,
table: {
width: 150
},
},
{
label: '最后更新时间',
field: 'updateTime',
sort: 'custom',
formatter: dateFormatter,
isForm: false,
},
{
label: '最后更新者用户名',
field: 'updater',
sort: 'custom',
isForm: false,
},
{
label: '操作',
field: 'action',
isForm: false,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
table: {
width: 150,
fixed: 'right'
}
width: 180
},
form: {
component: 'DatePicker',
componentProps: {
style: {width: '100%'},
type: 'datetime',
dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x',
}
},
isForm: false
}
]))

5
src/views/wms/productionManage/productredress/productredressRequestMain/productredressRequestMain.data.ts

@ -112,6 +112,7 @@ export const ProductredressRequestMain = useCrudSchemas(reactive<CrudSchema[]>([
field: 'toWarehouseCode',
sort: 'custom',
isForm:false,
isTable:false,
table: {
width: 150
},
@ -121,6 +122,7 @@ export const ProductredressRequestMain = useCrudSchemas(reactive<CrudSchema[]>([
field: 'departmentCode',
sort: 'custom',
isForm:false,
isTable:false,
table: {
width: 150
},
@ -172,6 +174,7 @@ export const ProductredressRequestMain = useCrudSchemas(reactive<CrudSchema[]>([
label: '备注',
field: 'remark',
sort: 'custom',
isTable:false,
},
{
label: '到库区类型范围',
@ -410,6 +413,8 @@ export const ProductredressRequestDetail = useCrudSchemas(reactive<CrudSchema[]>
{
label: '计量单位',
field: 'uom',
dictType: DICT_TYPE.UOM,
dictClass: 'string',
sort: 'custom',
table: {
width: 150

Loading…
Cancel
Save