Browse Source

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

master_hella_20240701
songguoqiang 7 months ago
parent
commit
bd3dfcf6be
  1. 1
      package.json
  2. 2
      src/api/mes/ordermonthplan/index.ts
  3. 54
      src/api/mes/partternType/index.ts
  4. 66
      src/api/mes/pattern/index.ts
  5. 54
      src/api/mes/patternType/index.ts
  6. 60
      src/api/qms/aql/index.ts
  7. 1
      src/api/qms/counter/index.ts
  8. 26
      src/api/qms/inspectionJob/inspectionJobDetail/index.ts
  9. 31
      src/api/qms/inspectionJob/inspectionJobMain/index.ts
  10. 1
      src/api/qms/inspectionMethod/index.ts
  11. 48
      src/api/qms/inspectionRecord/inspectionRecordDetail/index.ts
  12. 16
      src/api/qms/inspectionRecord/inspectionRecordMain/index.ts
  13. 1
      src/api/qms/inspectionStage/index.ts
  14. 75
      src/api/wms/supplierinvoiceInvoiced/index.ts
  15. 5
      src/api/wms/supplierinvoiceRequestMain/index.ts
  16. 1
      src/components/BasicForm/src/BasicForm.vue
  17. 696
      src/components/BasicForm/src/BasicFormQmsCode.vue
  18. 0
      src/components/BasicForm/src/BasicFormQmsNumber.vue
  19. 846
      src/components/Detail/src/DetailQmsCode.vue
  20. 6
      src/components/Detail/src/DetailQmsNumber.vue
  21. 2
      src/components/TableForm/src/TableForm.vue
  22. 12
      src/components/UploadFile/src/UploadFile.vue
  23. 28
      src/components/Verifition/src/Verify/VerifyPoints.vue
  24. 35
      src/components/Verifition/src/Verify/VerifySlide.vue
  25. 33
      src/components/bpmnProcessDesigner/package/penal/base/ElementBaseInfo.vue
  26. 8
      src/components/bpmnProcessDesigner/src/utils/directive/clickOutSide.js
  27. 25
      src/components/iFrame/src/IFrame.vue
  28. 13
      src/layout/components/Logo/src/Logo.vue
  29. 14
      src/layout/components/Message/src/Message.vue
  30. 13
      src/layout/components/TabMenu/src/TabMenu.vue
  31. 10
      src/utils/dict.ts
  32. 14
      src/views/bpm/model/editor/index.vue
  33. 2
      src/views/login/components/LoginForm.vue
  34. 23
      src/views/login/components/MobileForm.vue
  35. 52
      src/views/mes/ordermonthplan/index.vue
  36. 61
      src/views/mes/ordermonthplan/mesOrderMonthSub.data.ts
  37. 244
      src/views/mes/pattern/index.vue
  38. 312
      src/views/mes/pattern/pattern.data.ts
  39. 50
      src/views/mes/patternType/index.vue
  40. 5
      src/views/mes/patternType/patternType.data.ts
  41. 60
      src/views/qms/aql/aql.data.ts
  42. 24
      src/views/qms/basicDataManage/counter/counter.data.ts
  43. 109
      src/views/qms/basicDataManage/dynamicRule/dynamicRule.data.ts
  44. 6
      src/views/qms/basicDataManage/dynamicRule/index.vue
  45. 152
      src/views/qms/basicDataManage/inspectionStage/inspectionStage.data.ts
  46. 135
      src/views/qms/basicDataManage/selectedProject/selectedProject.data.ts
  47. 125
      src/views/qms/basicDataManage/selectedSet/index.vue
  48. 87
      src/views/qms/basicDataManage/selectedSet/selectedSet.data.ts
  49. 645
      src/views/qms/inspection/inspectionJob/addForm.vue
  50. 310
      src/views/qms/inspection/inspectionJob/detail.vue
  51. 29
      src/views/qms/inspection/inspectionJob/index.vue
  52. 243
      src/views/qms/inspection/inspectionJob/inspectionJobMain.data.ts
  53. 310
      src/views/qms/inspection/inspectionRecord/detail.vue
  54. 18
      src/views/qms/inspection/inspectionRecord/index.vue
  55. 51
      src/views/qms/inspectionMethod/index.vue
  56. 28
      src/views/qms/inspectionMethod/inspectionMethod.data.ts
  57. 1
      src/views/qms/samplingProcess/samplingProcess.data.ts
  58. 2
      src/views/qms/samplingScheme/samplingScheme.data.ts
  59. 20
      src/views/system/systemInstallPackage/index.vue
  60. 43
      src/views/system/systemInstallPackage/systemInstallPackage.data.ts
  61. 6
      src/views/wms/inventoryjobManage/sparepartsrequisition/sparepartsrequisitionRequestMain/sparepartsrequisitionRequestMain.data.ts
  62. 6
      src/views/wms/inventoryjobManage/unplannedissue/unplannedissueRequestMain/unplannedissueRequestMain.data.ts
  63. 32
      src/views/wms/inventoryjobManage/unplannedreceipt/unplannedreceiptRequestMain/index.vue
  64. 84
      src/views/wms/inventoryjobManage/unplannedreceipt/unplannedreceiptRequestMain/unplannedreceiptRequestMain.data.ts
  65. 8
      src/views/wms/purchasereceiptManage/purchasereceipt/purchasereceiptRecordMain/purchasereceiptRecordMain.data.ts
  66. 3
      src/views/wms/purchasereceiptManage/supplierdeliver/demandforecastingMain/demandforecastingMain.data.ts
  67. 5
      src/views/wms/purchasereceiptManage/supplierdeliver/purchaseMain/purchaseMain.data.ts
  68. 3
      src/views/wms/purchasereceiptManage/supplierdeliver/purchasePlanMain/purchasePlanMain.data.ts
  69. 49
      src/views/wms/supplierManage/supplierinvoice/supplierinvoiceRequestMain/index.vue
  70. 19
      src/views/wms/supplierManage/supplierinvoice/supplierinvoiceRequestMain/supplierinvoiceRequestMain.data.ts
  71. 310
      src/views/wms/supplierManage/supplierinvoiceInvoiced/index.vue
  72. 168
      src/views/wms/supplierManage/supplierinvoiceInvoiced/supplierinvoiceInvoiced.data.ts

1
package.json

@ -60,6 +60,7 @@
"xml-js": "^1.6.11"
},
"devDependencies": {
"@babel/plugin-proposal-optional-chaining": "^7.21.0",
"@commitlint/cli": "^17.7.1",
"@commitlint/config-conventional": "^17.7.0",
"@iconify/json": "^2.2.119",

2
src/api/mes/ordermonthplan/index.ts

@ -63,7 +63,9 @@ export interface MesOrderMonthSubVO {
status: string
remark: string
productCode: string
productName: string
bomCode: string
bomVersion: string
inStoreCode: string
planBegin: Date
planEnd: Date

54
src/api/mes/partternType/index.ts

@ -1,54 +0,0 @@
import request from '@/config/axios'
export interface PartternTypeVO {
deleteTime: Date
id: number
status: string
concurrencyStamp: number
remark: string
deleter: string
siteId: number
code: string
name: string
}
// 查询模具类型列表
export const getPartternTypePage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/mes/parttern-type/senior', data })
} else {
return await request.get({ url: `/mes/parttern-type/page`, params })
}
}
// 查询模具类型详情
export const getPartternType = async (id: number) => {
return await request.get({ url: `/mes/parttern-type/get?id=` + id })
}
// 新增模具类型
export const createPartternType = async (data: PartternTypeVO) => {
return await request.post({ url: `/mes/parttern-type/create`, data })
}
// 修改模具类型
export const updatePartternType = async (data: PartternTypeVO) => {
return await request.put({ url: `/mes/parttern-type/update`, data })
}
// 删除模具类型
export const deletePartternType = async (id: number) => {
return await request.delete({ url: `/mes/parttern-type/delete?id=` + id })
}
// 导出模具类型 Excel
export const exportPartternType = async (params) => {
return await request.download({ url: `/mes/parttern-type/export-excel`, params })
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/mes/parttern-type/get-import-template' })
}

66
src/api/mes/pattern/index.ts

@ -0,0 +1,66 @@
import request from '@/config/axios'
export interface PatternVO {
deleteTime: Date
id: number
status: string
concurrencyStamp: number
remark: string
deleter: string
siteId: number
code: string
name: string
partternName: string
productCode: string
dateUseStart: Date
dateUseStop: Date
partternFrom: string
partternGo: string
initCout: number
effectStart: Date
effectEnd: Date
factoryCode: string
factoryName: string
factoryType: string
}
// 查询模具基本信息列表
export const getPatternPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/mes/pattern/senior', data })
} else {
return await request.get({ url: `/mes/pattern/page`, params })
}
}
// 查询模具基本信息详情
export const getPattern = async (id: number) => {
return await request.get({ url: `/mes/pattern/get?id=` + id })
}
// 新增模具基本信息
export const createPattern = async (data: PatternVO) => {
return await request.post({ url: `/mes/pattern/create`, data })
}
// 修改模具基本信息
export const updatePattern = async (data: PatternVO) => {
return await request.put({ url: `/mes/pattern/update`, data })
}
// 删除模具基本信息
export const deletePattern = async (id: number) => {
return await request.delete({ url: `/mes/pattern/delete?id=` + id })
}
// 导出模具基本信息 Excel
export const exportPattern = async (params) => {
return await request.download({ url: `/mes/pattern/export-excel`, params })
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/mes/pattern/get-import-template' })
}

54
src/api/mes/patternType/index.ts

@ -0,0 +1,54 @@
import request from '@/config/axios'
export interface PatternTypeVO {
deleteTime: Date
id: number
status: string
concurrencyStamp: number
remark: string
deleter: string
siteId: number
code: string
name: string
}
// 查询模具类型列表
export const getPatternTypePage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/mes/pattern-type/senior', data })
} else {
return await request.get({ url: `/mes/pattern-type/page`, params })
}
}
// 查询模具类型详情
export const getPatternType = async (id: number) => {
return await request.get({ url: `/mes/pattern-type/get?id=` + id })
}
// 新增模具类型
export const createPatternType = async (data: PatternTypeVO) => {
return await request.post({ url: `/mes/pattern-type/create`, data })
}
// 修改模具类型
export const updatePatternType = async (data: PatternTypeVO) => {
return await request.put({ url: `/mes/pattern-type/update`, data })
}
// 删除模具类型
export const deletePatternType = async (id: number) => {
return await request.delete({ url: `/mes/pattern-type/delete?id=` + id })
}
// 导出模具类型 Excel
export const exportPatternType = async (params) => {
return await request.download({ url: `/mes/pattern-type/export-excel`, params })
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/mes/pattern-type/get-import-template' })
}

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

@ -6,36 +6,36 @@ export interface AqlVO {
inspectionQualification: string
sampleCharacterCode: string
sampleSize: number
a0Separator010: number
r0Separator010: number
a0Separator015: number
r0Separator015: number
a0Separator025: number
r0Separator025: number
a0Separator040: number
r0Separator040: number
a0Separator065: number
r0Separator065: number
a0Separator10: number
r0Separator10: number
a0Separator15: number
r0Separator15: number
a0Separator25: number
r0Separator25: number
a0Separator40: number
r0Separator40: number
a0Separator65: number
r0Separator65: number
a1Separator0: number
r1Separator0: number
a1Separator5: number
r1Separator5: number
a2Separator5: number
r2Separator5: number
a4Separator0: number
r4Separator0: number
a6Separator5: number
r6Separator5: number
a0separator010: number
r0separator010: number
a0separator015: number
r0separator015: number
a0separator025: number
r0separator025: number
a0separator040: number
r0separator040: number
a0separator065: number
r0separator065: number
a0separator10: number
r0separator10: number
a0separator15: number
r0separator15: number
a0separator25: number
r0separator25: number
a0separator40: number
r0separator40: number
a0separator65: number
r0separator65: number
a1separator0: number
r1separator0: number
a1separator5: number
r1separator5: number
a2separator5: number
r2separator5: number
a4separator0: number
r4separator0: number
a6separator5: number
r6separator5: number
a10: number
r10: number
a15: number

1
src/api/qms/counter/index.ts

@ -4,7 +4,6 @@ export interface CounterVO {
id: number
itemCode: string
testTypeCode: string
workingCode: boolean
supplierCode: string
qualifiedTimes: number
lastQualifiedBatch: string

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

@ -1,27 +1,5 @@
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) => {
@ -44,12 +22,12 @@ export const getInspectionJobDetail = async (id: number) => {
}
// 新增检验申请
export const createInspectionJobDetail = async (data: InspectionJobDetailVO) => {
export const createInspectionJobDetail = async (data) => {
return await request.post({ url: `/qms/inspection-job-detail/create`, data })
}
// 修改检验申请
export const updateInspectionJobDetail = async (data: InspectionJobDetailVO) => {
export const updateInspectionJobDetail = async (data) => {
return await request.put({ url: `/qms/inspection-job-detail/update`, data })
}

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

@ -1,27 +1,5 @@
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) => {
@ -40,15 +18,18 @@ export const getInspectionJobMain = async (id: number) => {
}
// 新增检验申请
export const createInspectionJobMain = async (data: InspectionJobMainVO) => {
export const createInspectionJobMain = async (data) => {
return await request.post({ url: `/qms/inspection-job-main/create`, data })
}
// 修改检验申请
export const updateInspectionJobMain = async (data: InspectionJobMainVO) => {
export const updateInspectionJobMain = async (data) => {
return await request.put({ url: `/qms/inspection-job-main/update`, data })
}
// 执行检验申请
export const executeInspectionJobMain = async (data) => {
return await request.put({ url: `/qms/inspection-job-main/execute`, data })
}
// 删除检验申请
export const deleteInspectionJobMain = async (id: number) => {
return await request.delete({ url: `/qms/inspection-job-main/delete?id=` + id })

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

@ -33,6 +33,7 @@ export const createInspectionMethod = async (data: InspectionMethodVO) => {
// 修改检验方法
export const updateInspectionMethod = async (data: InspectionMethodVO) => {
// debugger
return await request.put({ url: `/qms/inspection-method/update`, data })
}

48
src/api/qms/inspectionRecord/inspectionRecordDetail/index.ts

@ -1,65 +1,47 @@
import request from '@/config/axios'
export interface InspectionRecordDetailVO {
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 getInspectionRecordDetailPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/inspection/inspection-recordord-detail/senior', data })
return await request.post({ url: '/qms/inspection-record-detail/senior', data })
} else {
return await request.get({ url: `/inspection/inspectirecordrecord-detail/page`, params })
return await request.get({ url: `/qms/inspection-record-detail/page`, params })
}
}
// 查询检验申请列表
export const getInspectionRecordDetailList = async (id: number) => {
return await request.get({ url: `/qms/inspection-record-detail/list?masterId=` + id })
}
// 查询检验申请详情
export const getInspectionRecordDetail = async (id: number) => {
return await request.get({ url: `/inspection/insperecordon-record-detail/get?id=` + id })
return await request.get({ url: `/qms/inspection-record-detail/get?id=` + id })
}
// 新增检验申请
export const createInspectionRecordDetail = async (data: InspectionRecordDetailVO) => {
return await request.post({ url: `/inspection/inrecordction-record-detail/create`, data })
export const createInspectionRecordDetail = async (data) => {
return await request.post({ url: `/qms/inspection-record-detail/create`, data })
}
// 修改检验申请
export const updateInspectionRecordDetail = async (data: InspectionRecordDetailVO) => {
return await request.put({ url: `/inspectionrecordspection-record-detail/update`, data })
export const updateInspectionRecordDetail = async (data) => {
return await request.put({ url: `/qms/inspection-record-detail/update`, data })
}
// 删除检验申请
export const deleteInspectionRecordDetail = async (id: number) => {
return await request.delete({ url: `/inspectrecord/inspection-record-detail/delete?id=` + id })
return await request.delete({ url: `/qms/inspection-record-detail/delete?id=` + id })
}
// 导出检验申请 Excel
export const exportInspectionRecordDetail = async (params) => {
return await request.download({ url: `/insprecordion/inspection-record-detail/export-excel`, params })
return await request.download({ url: `/qms/inspection-record-detail/export-excel`, params })
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/irecordection/inspection-record-detail/get-import-template' })
return request.download({ url: '/qms/inspection-record-detail/get-import-template' })
}

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

@ -28,38 +28,38 @@ export const getInspectionRecordMainPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/inspection/inspection-record-main/senior', data })
return await request.post({ url: '/qms/inspection-record-main/senior', data })
} else {
return await request.get({ url: `/inspection/inspection-record-main/page`, params })
return await request.get({ url: `/qms/inspection-record-main/page`, params })
}
}
// 查询检验申请详情
export const getInspectionRecordMain = async (id: number) => {
return await request.get({ url: `/inspection/inspection-record-main/get?id=` + id })
return await request.get({ url: `/qms/inspection-record-main/get?id=` + id })
}
// 新增检验申请
export const createInspectionRecordMain = async (data: InspectionRecordMainVO) => {
return await request.post({ url: `/inspection/inspection-record-main/create`, data })
return await request.post({ url: `/qms/inspection-record-main/create`, data })
}
// 修改检验申请
export const updateInspectionRecordMain = async (data: InspectionRecordMainVO) => {
return await request.put({ url: `/inspection/inspection-record-main/update`, data })
return await request.put({ url: `/qms/inspection-record-main/update`, data })
}
// 删除检验申请
export const deleteInspectionRecordMain = async (id: number) => {
return await request.delete({ url: `/inspection/inspection-record-main/delete?id=` + id })
return await request.delete({ url: `/qms/inspection-record-main/delete?id=` + id })
}
// 导出检验申请 Excel
export const exportInspectionRecordMain = async (params) => {
return await request.download({ url: `/inspection/inspection-record-main/export-excel`, params })
return await request.download({ url: `/qms/inspection-record-main/export-excel`, params })
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/inspection/inspection-record-main/get-import-template' })
return request.download({ url: '/qms/inspection-record-main/get-import-template' })
}

1
src/api/qms/inspectionStage/index.ts

@ -3,6 +3,7 @@ import request from '@/config/axios'
export interface InspectionStageVO {
code: string
masterId: number
stage: number
dynamicModifyCode: string
description: string
okTimes: number

75
src/api/wms/supplierinvoiceInvoiced/index.ts

@ -0,0 +1,75 @@
import request from '@/config/axios'
export interface SupplierinvoiceInvoicedVO {
id: number
tax: number
projectCode: string
billType: string
recvBillNum: string
asnBillNum: string
supplierCode: string
poNumber: string
poLine: string
purchasePrice: number
invoicableQuantity: number
itemCode: string
uom: string
currency: string
remark: string
deletionTime: Date
deleterId: string
extraProperties: string
concurrencyStamp: number
siteId: string
}
// 查询待开票列表
export const getSupplierinvoiceInvoicedPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/wms/supplierinvoice-invoiced/senior', data })
} else {
return await request.get({ url: `/wms/supplierinvoice-invoiced/page`, params })
}
}
// 查询待开票详情
export const getSupplierinvoiceInvoiced = async (id: number) => {
return await request.get({ url: `/wms/supplierinvoice-invoiced/get?id=` + id })
}
// 新增待开票
export const createSupplierinvoiceInvoiced = async (data: SupplierinvoiceInvoicedVO) => {
return await request.post({ url: `/wms/supplierinvoice-invoiced/create`, data })
}
// 修改待开票
export const updateSupplierinvoiceInvoiced = async (data: SupplierinvoiceInvoicedVO) => {
return await request.put({ url: `/wms/supplierinvoice-invoiced/update`, data })
}
// 删除待开票
export const deleteSupplierinvoiceInvoiced = async (id: number) => {
return await request.delete({ url: `/wms/supplierinvoice-invoiced/delete?id=` + id })
}
// 导出待开票 Excel
export const exportSupplierinvoiceInvoiced = async (params) => {
return await request.download({ url: `/wms/supplierinvoice-invoiced/export-excel`, params })
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/wms/supplierinvoice-invoiced/get-import-template' })
}
// 审批通过待开票
export const agreeSupplierinvoiceInvoiced = async (id: number) => {
return await request.post({ url: `/wms/supplierinvoice-invoiced/agree?id=` + id })
}
// 审批拒绝待开票
export const refuseSupplierinvoiceInvoiced = async (id: number) => {
return await request.post({ url: `/wms/supplierinvoice-invoiced/refuse?id=` + id })
}

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

@ -77,6 +77,11 @@ export const rejSupplierinvoiceRequestMain = async (id: number) => {
return await request.post({ url: `/wms/supplierinvoice-request-main/rej?id=` + id })
}
// 供应商--发票寄出
export const invoiceSentOutSupplierinvoiceRequestMain = async (id: number) => {
return await request.post({ url: `/wms/supplierinvoice-request-main/invoiceSentOut?id=` + id })
}
// 财务--审批通过供应商发货申请主
export const financeappSupplierinvoiceRequestMain = async (id: number) => {
return await request.post({ url: `/wms/supplierinvoice-request-main/financeApp?id=` + id })

1
src/components/BasicForm/src/BasicForm.vue

@ -69,6 +69,7 @@
<TableForm
ref="tableFormRef"
class="w-[100%]"
:maxHeight = "490"
:tableFields="tableAllSchemas.tableFormColumns"
:tableData="tableData"
:tableFormRules="tableFormRules"

696
src/components/BasicForm/src/BasicFormQmsCode.vue

@ -0,0 +1,696 @@
<template>
<Dialog
:title="dialogTitle"
v-model="dialogVisible"
:width="dialogWidth"
:close-on-click-modal="false"
:vLoading="formLoading"
>
<div
style="max-height: 60vh;overflow-y: auto;">
<Form
ref="formRef"
:rules="rules"
:schema="formSchema"
:is-col="true"
@opensearchTable="opensearchTable"
@onChange="onChange"
@onBlur="onBlur"
>
<template #crontab="formSchema" v-if="fromeWhere == 'countPlan'">
<crontab v-model="formSchema.crontab" />
</template>
<template #type="formSchema" v-if="fromeWhere == 'countPlan'">
<el-select
v-model="formSchema.type"
placeholder="选择盘点类型"
@change="selectChange('type', $event)"
v-if="!isDetail"
>
<el-option
v-for="dict in getStrDictOptions(DICT_TYPE.COUNT_TYPE)"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
<el-select
v-model="formSchema.type"
placeholder="选择盘点范围类型"
@change="selectChangeDetail('type', $event,formSchema)"
v-if="isDetail"
>
<el-option
v-for="dict in getStrDictOptions(DICT_TYPE.COUNT_SCOPE_TYPE)"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</template>
<template #value="formSchema" v-if="fromeWhere == 'countPlan'">
<el-select
v-model="formSchema.value"
placeholder="选择盘点范围值"
v-if="isDetail&& formTypeDetail =='Select'"
>
<el-option
v-for="dict in countPlanAllList"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
<el-input v-model="formSchema.value" v-if="isDetail && formTypeDetail =='InputString'"/>
</template>
</Form>
<div class="table" v-if="isBusiness && formType == 'create' && fromeWhere != 'countPlan'">
<TableForm
ref="tableFormRef"
class="w-[100%]"
:tableFields="tableAllSchemas.tableFormColumns"
:tableData="tableData"
:tableFormRules="tableFormRules"
:isShowButton="isShowButton"
:isShowReduceButton="isShowReduceButton"
@handleAddTable="handleAddTable"
@handleDeleteTable="handleDeleteTable"
@tableSelectionChange="tableSelectionChange"
@extendedButtonsClick="extendedButtonsClick"
@formSelectChange="formSelectChange"
@formSelectvVisibleChange="formSelectvVisibleChange"
@tableSortChange="tableSortChange"
@selectCallback="selectCallback"
@handleTableSelect="handleTableSelect"
@inpuFocus="inpuFocus"
@buttonOperationClick="buttonOperationClick"
@inputStringBlur="inputStringBlur"
@inputNumberChange="inputNumberChange"
@tableFormSelectOnBlur="tableFormSelectOnBlur"
@formFormDateChange="formFormDateChange"
/>
</div>
<div v-if="isBusiness && formType == 'create' && fromeWhere == 'countPlan'">
<TableFormCountPlan
:tableFields="tableAllSchemas.tableFormColumns"
:tableData="tableData"
:countScopeType="countScopeType"
:tableFormRules="tableFormRules"
ref="tableFormRef"
@tableFormChange="tableFormChange"
@handleAddTable="handleAddTable"
@handleDeleteTable="handleDeleteTable"
/>
</div>
</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'
import TableForm from '@/components/TableForm/src/TableForm.vue'
import TableFormCountPlan from '@/components/TableFormCountPlan/src/TableFormCountPlan.vue'
import { DICT_TYPE, getStrDictOptions } from '@/utils/dict'
const props = defineProps({
//
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
},
//
formTypeDetail: {
type: String,
required: false,
default: 'InputString'
},
//
countPlanAllList: {
type: Array,
required: false,
default: null
},
// or
isShowFooterButtton: {
type: Boolean,
required: false,
default: true
},
//
tableFormDataLength: {
type: Boolean,
required: false,
default: true
},
//
footButttondata: {
type: Array,
required: false,
default: null
},
//
isOpenSearchTable:{
type: Boolean,
required: false,
default: false
},
myFuncTypeSign:{
type: String,
required: false,
default: null
},
})
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 tableAllSchemas = ref(props.tableAllSchemas)
const tableFormRules = ref(props.tableFormRules)
// -
// const buttondata = [
// defaultButtons.mainListEditBtn(null), //
// defaultButtons.mainListDeleteBtn(null)
// ]
// // -
// const buttonTableClick = async (val, row) => {
// if (val == 'edit') {
// } else if (val == 'delete') {
// } else {
// }
// }
/** 弹层操作 */
// 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
)
}
//
// 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()
//
// masterIdcode
if (masterParmas) {
if (!row) {
if(props.myFuncTypeSign=='InspectionStage'){
row = {
masterId: masterParmas.masterId,
code: masterParmas.code,
dynamicModifyCode: masterParmas.code,
}
}else{
row = {
masterId: masterParmas.masterId,
code: masterParmas.code,
}
}
}
}
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) //
]
}
if (props.footButttondata) {
Butttondata = props.footButttondata
}
/** 按钮事件 */
const buttonBaseClick = (val) => {
//
if (props.footButttondata) {
emit('footButtonClick',val)
}
//
else 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()
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',
'footButtonClick'
])
//
const formSelectChange = (field, val, row) => {
emit('formSelectChange', field, val, row)
}
//
const formFormDateChange = (field, val,row, index) => {
emit('formFormDateChange', field, val,row, index)
}
const formSelectvVisibleChange = (field, val, row) => {
emit('formSelectvVisibleChange', field, val, row)
}
// selection
const tableSelectionChange = (val) => {
emit('tableSelectionChange', val)
}
// tableform select bulr
const tableFormSelectOnBlur = (field, val, row, index) => {
emit('tableFormSelectOnBlur', field, val, row, index)
}
//
const tableSortChange = (column, prop, order) => {
emit('tableSortChange', column, prop, order)
}
// -
const inputNumberChange = (field, index, row, val) => {
emit('inputNumberChange', field, index, row, val)
}
//
// const showSelect = (val, statusID) => {
// return getDictForStatusID(val, statusID)
// }
//
const handleTableSelect = (row, column, event) => {
emit('handleTableSelect', row, column, event)
}
//
const handleDeleteTable = (row, index) => {
emit('handleDeleteTable', row, index,formRef.value)
}
//
const handleAddTable = () => {
if(props.isOpenSearchTable){
const tableFormKeys = {}
tableAllSchemas.value.tableFormColumns.forEach(item => {
tableFormKeys[item.field] = item.default ? item.default : ''
})
inpuFocus(tableAllSchemas.value.tableFormColumns[0],tableFormKeys,0)
}else{
emit('handleAddTable')
}
}
//
const inpuFocus = (headerItem, row, index) => {
opensearchTable(
headerItem.field,
headerItem.tableForm.searchField,
headerItem.tableForm.searchTitle,
headerItem.tableForm.searchAllSchemas,
headerItem.tableForm.searchPage,
headerItem.tableForm.searchCondition,
headerItem.tableForm.multiple,
'tableForm',
row
)
}
/**
* 监听改变事件
* @param field 当前操作字段
* @param cur 改变后值
*/
const onChange = (field, cur) => {
emit('onChange', field, cur)
}
/**
* 监听失焦事件
* @param field 当前操作字段
* @param e
*/
const onBlur = (field, e) => {
emit('onBlur', field, e)
}
//
const selectChange = (field, val) => {
emit('selectChange', field, val)
}
//
const selectChangeDetail = (field, val,formSchema) => {
formSchema.value = ''
emit('selectChangeDetail', field, val)
}
const tableFormChange = (field, val, row) => {
emit('tableFormChange', field, val, row)
}
const buttonOperationClick = (row, label, index)=> {
emit("buttonOperationClick", row, label, index);
}
const inputStringBlur = (headerItem, row, index)=> {
emit("inputStringBlur", headerItem, row, index);
}
</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>

0
src/components/BasicForm/src/BasicFormQms.vue → src/components/BasicForm/src/BasicFormQmsNumber.vue

846
src/components/Detail/src/DetailQmsCode.vue

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

6
src/components/Detail/src/DetailQms.vue → src/components/Detail/src/DetailQmsNumber.vue

@ -121,7 +121,7 @@
<!-- 表格弹窗 -->
<SearchTable ref="searchTableRef" @search-table-success="searchTableSuccess1" />
<!-- 表单弹窗添加/修改 -->
<BasicForm
<BasicFormQmsNumber
ref="formRef"
@success="submitForm"
:rules="detailAllSchemasRules"
@ -154,12 +154,12 @@ import Tabs from '@/components/Tabs/src/Tabs.vue'
import * as RemarkApi from '@/api/wms/remark'
import * as FileApi from '@/api/wms/file'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import BasicForm from '@/components/BasicForm/src/BasicFormQms.vue'
import BasicFormQmsNumber from '@/components/BasicForm/src/BasicFormQmsNumber.vue'
import TableHead from '@/components/TableHead/src/TableHead.vue'
import DetailTable from '@/components/DetailTable/src/DetailTable.vue'
import { SearchTable } from '@/components/SearchTable'
defineOptions({ name: 'DetailQms' })
defineOptions({ name: 'DetailQmsNumber' })
const message = useMessage() //
const { t } = useI18n() //

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

@ -5,7 +5,7 @@
ref="TableBaseComponents_Ref"
v-loading="tableLoading"
:data="tableData"
max-height="maxHeight"
:max-height="maxHeight"
row-key="id"
:border="border"
@selection-change="tableSelectionChange"

12
src/components/UploadFile/src/UploadFile.vue

@ -56,7 +56,7 @@ const props = defineProps({
title: propTypes.string.def('文件上传'),
updateUrl: propTypes.string.def(import.meta.env.VITE_UPLOAD_URL),
upData: propTypes.object.def(),
fileType: propTypes.array.def(['doc', 'xls', 'ppt', 'txt', 'pdf', 'pdf','png', 'jpg', 'jpeg']), // , ['png', 'jpg', 'jpeg']
fileType: propTypes.array.def(['apk','doc', 'xls', 'ppt', 'txt', 'pdf', 'pdf','png', 'jpg', 'jpeg']), // , ['png', 'jpg', 'jpeg']
fileSize: propTypes.number.def(5), // (MB)
limit: propTypes.number.def(5), //
autoUpload: propTypes.bool.def(true), //
@ -129,14 +129,15 @@ const excelUploadError: UploadProps['onError'] = (): void => {
}
//
const handleRemove = (file) => {
const findex = fileList.value.map((f) => f.name).indexOf(file.name)
if (findex > -1) {
fileList.value.splice(findex, 1)
// const findex = fileList.value.map((f) => f.name).indexOf(file.name)
// if (findex > -1) {
// fileList.value.splice(findex, 1)
emit('update:modelValue', listToString(fileList.value))
}
// }
}
const handlePreview: UploadProps['onPreview'] = (uploadFile) => {
console.log(uploadFile)
window.open(uploadFile.url)
}
//
const listToString = (list: UploadUserFile[], separator?: string) => {
@ -147,6 +148,7 @@ const listToString = (list: UploadUserFile[], separator?: string) => {
}
return strs != '' ? strs.substr(0, strs.length - 1) : ''
}
</script>
<style scoped lang="scss">
.upload-file-uploader {

28
src/components/Verifition/src/Verify/VerifyPoints.vue

@ -148,6 +148,8 @@ onMounted(() => {
}
})
const canvas = ref(null)
const timer1 = ref<NodeJS.Timeout | number>(0)
const timer2 = ref<NodeJS.Timeout | number>(0)
const canvasClick = (e) => {
checkPosArr.push(getMousePos(canvas, e))
if (num.value == checkNum.value) {
@ -157,7 +159,7 @@ const canvasClick = (e) => {
checkPosArr.length = 0
checkPosArr.push(...arr)
//
setTimeout(() => {
timer1.value = setTimeout(() => {
// var flag = this.comparePos(this.fontPos, this.checkPosArr);
//
var captchaVerification = secretKey.value
@ -177,9 +179,13 @@ const canvasClick = (e) => {
text.value = t('captcha.success')
bindingClick.value = false
if (mode.value == 'pop') {
setTimeout(() => {
timer2.value = setTimeout(() => {
proxy.$parent.clickShow = false
refresh()
if(timer2.value){
clearTimeout(timer2.value)
timer2.value = 0
}
}, 1500)
}
proxy.$parent.$emit('success', { captchaVerification })
@ -188,17 +194,33 @@ const canvasClick = (e) => {
barAreaColor.value = '#d9534f'
barAreaBorderColor.value = '#d9534f'
text.value = t('captcha.fail')
setTimeout(() => {
timer2.value = setTimeout(() => {
refresh()
if(timer2.value){
clearTimeout(timer2.value)
timer2.value = 0
}
}, 700)
}
})
if(timer1.value){
clearTimeout(timer1.value)
timer1.value = 0
}
}, 400)
}
if (num.value < checkNum.value) {
num.value = createPoint(getMousePos(canvas, e))
}
}
onBeforeUnmount(() => {
if(timer1.value){
clearTimeout(timer1.value)
}
if(timer2.value){
clearTimeout(timer2.value)
}
})
//
const getMousePos = function (obj, e) {
var x = e.offsetX

35
src/components/Verifition/src/Verify/VerifySlide.vue

@ -295,9 +295,14 @@ const end = () => {
showRefresh.value = false
isEnd.value = true
if (mode.value == 'pop') {
setTimeout(() => {
let timer
timer = setTimeout(() => {
proxy.$parent.clickShow = false
refresh()
if(timer){
clearTimeout(timer)
timer = null
}
}, 1500)
}
passFlag.value = true
@ -309,10 +314,15 @@ const end = () => {
secretKey.value
)
: backToken.value + '---' + JSON.stringify({ x: moveLeftDistance, y: 5.0 })
setTimeout(() => {
let timer
timer = setTimeout(() => {
tipWords.value = ''
proxy.$parent.closeBox()
proxy.$parent.$emit('success', { captchaVerification })
if(timer){
clearTimeout(timer)
timer = null
}
}, 1000)
} else {
moveBlockBackgroundColor.value = '#d9534f'
@ -320,13 +330,23 @@ const end = () => {
iconColor.value = '#fff'
iconClass.value = 'icon-close'
passFlag.value = false
setTimeout(function () {
let timer
timer = setTimeout(()=>{
refresh()
if(timer){
clearTimeout(timer)
timer = null
}
}, 1000)
proxy.$parent.$emit('error', proxy)
tipWords.value = t('captcha.fail')
setTimeout(() => {
let timer1
timer1 = setTimeout(() => {
tipWords.value = ''
if(timer1){
clearTimeout(timer1)
timer1 = null
}
}, 1000)
}
})
@ -351,10 +371,15 @@ const refresh = async () => {
isEnd.value = false
await getPictrue()
setTimeout(() => {
let timer
timer = setTimeout(() => {
transitionWidth.value = ''
transitionLeft.value = ''
text.value = explain.value
if(timer){
clearTimeout(timer)
timer = null
}
}, 300)
}

33
src/components/bpmnProcessDesigner/package/penal/base/ElementBaseInfo.vue

@ -76,6 +76,9 @@ const resetBaseInfo = () => {
// elementBaseInfo.value = JSON.parse(JSON.stringify(bpmnElement.value.businessObject))
console.log(elementBaseInfo.value, 'elementBaseInfo22222222222')
}
const timer1 = ref<NodeJS.Timeout | number>()
const timer2 = ref<NodeJS.Timeout | number>()
const timer3 = ref<NodeJS.Timeout | number>()
const handleKeyUpdate = (value) => {
// value XML NCName
if (!value) {
@ -90,8 +93,12 @@ const handleKeyUpdate = (value) => {
// BPMN XML key id
elementBaseInfo.value['id'] = value
setTimeout(() => {
timer1.value = setTimeout(() => {
updateBaseInfo('id')
if(timer1.value){
clearTimeout(timer1.value)
timer1.value = 0
}
}, 100)
}
const handleNameUpdate = (value) => {
@ -101,8 +108,12 @@ const handleNameUpdate = (value) => {
}
elementBaseInfo.value['name'] = value
setTimeout(() => {
timer2.value = setTimeout(() => {
updateBaseInfo('name')
if(timer2.value){
clearTimeout(timer2.value)
timer2.value = 0
}
}, 100)
}
// const handleDescriptionUpdate=(value)=> {
@ -140,10 +151,14 @@ const updateBaseInfo = (key) => {
}
onMounted(() => {
// bpmn 1 key name
setTimeout(() => {
timer3.value = setTimeout(() => {
console.log(props.model, 'props.model')
handleKeyUpdate(props.model.key)
handleNameUpdate(props.model.name)
if(timer3.value){
clearTimeout(timer3.value)
timer3.value = 0
}
console.log(props, 'propsssssssssssssssssssss')
}, 1000)
})
@ -180,5 +195,17 @@ watch(
// }
onBeforeUnmount(() => {
bpmnElement.value = null
if(timer1.value){
clearTimeout(timer1.value)
timer1.value = 0
}
if(timer2.value){
clearTimeout(timer2.value)
timer2.value = 0
}
if(timer3.value){
clearTimeout(timer3.value)
timer3.value = 0
}
})
</script>

8
src/components/bpmnProcessDesigner/src/utils/directive/clickOutSide.js

@ -22,9 +22,13 @@ export default {
methodName: binding.expression,
bindingFn: binding.value
}
setTimeout(() => {
let timer
timer = setTimeout(() => {
document.addEventListener('touchstart', documentHandler) // 为document绑定事件
if(timer){
clearTimeout(timer)
timer = null
}
})
},
update(el, binding) {

25
src/components/iFrame/src/IFrame.vue

@ -14,6 +14,8 @@ const init = () => {
height.value = document.documentElement.clientHeight - 94.5 + 'px'
loading.value = false
}
const timer1 = ref<NodeJS.Timeout | number>()
const timer2 = ref<NodeJS.Timeout | number>()
console.log(props.src);
function populateIframe(iframe, headers) {
@ -37,14 +39,33 @@ function populateIframe(iframe, headers) {
onMounted(() => {
setTimeout(() => {
timer1.value = setTimeout(() => {
var iframe = document.querySelector("#iframe");
populateIframe(iframe, [["Authorization", 'Bearer ' + getAccessToken()], ["tenant-id", getTenantId()]]);
if(timer1.value){
clearTimeout(timer1.value)
timer1.value = 0
}
}, 300);
setTimeout(() => {
timer2.value = setTimeout(() => {
init()
if(timer2.value){
clearTimeout(timer2.value)
timer2.value = 0
}
}, 300)
})
onBeforeUnmount(() => {
if(timer1.value){
clearTimeout(timer1.value)
timer1.value = 0
}
if(timer2.value){
clearTimeout(timer2.value)
timer2.value = 0
}
})
</script>
<template>
<div v-loading="loading" :style="'height:' + height">

13
src/layout/components/Logo/src/Logo.vue

@ -18,6 +18,7 @@ const title = computed(() => appStore.getTitle)
const layout = computed(() => appStore.getLayout)
const collapse = computed(() => appStore.getCollapse)
const timer = ref<NodeJS.Timeout | number>()
onMounted(() => {
if (unref(collapse)) show.value = false
@ -31,14 +32,24 @@ watch(
return
}
if (!collapse) {
setTimeout(() => {
timer.value = setTimeout(() => {
show.value = !collapse
if(timer.value){
clearTimeout(timer.value)
timer.value = 0
}
}, 400)
} else {
show.value = !collapse
}
}
)
onBeforeUnmount(() => {
if(timer.value){
clearTimeout(timer.value)
timer.value = 0
}
})
watch(
() => layout.value,

14
src/layout/components/Message/src/Message.vue

@ -8,7 +8,7 @@ const { push } = useRouter()
const activeName = ref('notice')
const unreadCount = ref(0) //
const list = ref<any[]>([]) //
const interval = ref<NodeJS.Timeout | number>()
//
const getList = async () => {
list.value = await NotifyMessageApi.getUnreadNotifyMessageList()
@ -35,13 +35,23 @@ onMounted(() => {
//
getUnreadCount()
//
setInterval(
interval.value = setInterval(
() => {
getUnreadCount()
if(interval.value){
clearInterval(interval.value)
interval.value = 0
}
},
1000 * 60 * 2
)
})
onBeforeUnmount(() => {
if(interval.value){
clearInterval(interval.value)
interval.value = 0
}
})
</script>
<template>
<div class="message">

13
src/layout/components/TabMenu/src/TabMenu.vue

@ -37,6 +37,7 @@ export default defineComponent({
const setCollapse = () => {
appStore.setCollapse(!unref(collapse))
}
const timer = ref<NodeJS.Timeout | number>()
onMounted(() => {
if (unref(fixedMenu)) {
@ -77,14 +78,24 @@ export default defineComponent({
() => collapse.value,
(collapse: boolean) => {
if (!collapse) {
setTimeout(() => {
timer.value = setTimeout(() => {
showTitle.value = !collapse
if(timer.value){
clearTimeout(timer.value)
timer.value = 0
}
}, 200)
} else {
showTitle.value = !collapse
}
}
)
onBeforeUnmount(() => {
if(timer.value){
clearTimeout(timer.value)
timer.value = 0
}
})
//
const showMenu = ref(unref(fixedMenu) ? true : false)

10
src/utils/dict.ts

@ -296,7 +296,13 @@ export enum DICT_TYPE {
INSPECTION_SEVERITY = 'inspection_severity',//检验严重性
SPLIT_RULES = "split_rules", // 拆分规则
INSPECTION_LEVEL = "inspection_level", // 检验水平字典
BASIC_AQL = "basic_aql", // aql
BASIC_AQL = "basic_aql", // aql
EVALUATION_CODE = "evaluation_code", // 评估代码
DEFECT_LEVEL = "defect_level", // 缺陷级别
DICTIONARY_CLASS = "dictionary_class", // 字典分类
USAGE_DECISION = "usage_decision", // 使用决策
INSPECTION_BATCH_SOURCE = "inspection_batch_source", // 检验批来源
INSPECTION_TYPE = "inspection_type", // 检验类型
// ========== 业务 - mes -gaojs ==========
QUALIFY_STATUS = 'qualify_status',//质检状态
@ -308,5 +314,5 @@ export enum DICT_TYPE {
REWORK_STATUS='rework_status',//返工返修状态:待返修,返修中,返修完成
REWORK_REPLACE_FLAG = 'rework_replace_flag',//是否有替换件
SUPPLIERINVOICE_REQUEST_STATUS = 'supplierinvoice_request_status', //发票申请状态
SUPPLIERINVOICE_STATUS = 'supplierinvoice_status', //待开票审核状态
}

14
src/views/bpm/model/editor/index.vue

@ -49,14 +49,26 @@ const controlForm = ref({
additionalModel: [CustomContentPadProvider, CustomPaletteProvider]
})
const model = ref<ModelApi.ModelVO>() //
const timer = ref<NodeJS.Timeout | number>()
/** 初始化 modeler */
const initModeler = (item) => {
setTimeout(() => {
timer.value = setTimeout(() => {
modeler.value = item
if(timer.value){
clearTimeout(timer.value)
timer.value = 0
}
}, 10)
}
onBeforeUnmount(() => {
if(timer.value){
clearTimeout(timer.value)
timer.value = 0
}
})
/** 添加/修改模型 */
const save = async (bpmnXml) => {
const data = {

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

@ -224,7 +224,7 @@ const handleLogin = async (params) => {
console.log('登录-224')
getCode()
loginLoading.value = false
loading.value.close()
loading?.value?.close()
}
}

23
src/views/login/components/MobileForm.vue

@ -148,6 +148,8 @@ const smsVO = reactive({
}
})
const mobileCodeTimer = ref(0)
const msgTimer = ref<NodeJS.Timeout | number>()
const timer = ref<NodeJS.Timeout | number>()
const redirect = ref<string>('')
const getSmsCode = async () => {
await getTenantId()
@ -156,14 +158,25 @@ const getSmsCode = async () => {
message.success(t('login.SmsSendMsg'))
//
mobileCodeTimer.value = 60
let msgTimer = setInterval(() => {
msgTimer.value = setInterval(() => {
mobileCodeTimer.value = mobileCodeTimer.value - 1
if (mobileCodeTimer.value <= 0) {
clearInterval(msgTimer)
clearInterval(msgTimer.value)
msgTimer.value = 0
}
}, 1000)
})
}
onBeforeUnmount(() => {
if(msgTimer.value){
clearInterval(msgTimer.value)
msgTimer.value = 0
}
if(timer.value){
clearTimeout(timer.value)
timer.value = 0
}
})
watch(
() => currentRoute.value,
(route: RouteLocationNormalizedLoaded) => {
@ -204,9 +217,13 @@ const signIn = async () => {
.catch(() => {})
.finally(() => {
loginLoading.value = false
setTimeout(() => {
timer.value = setTimeout(() => {
const loadingInstance = ElLoading.service()
loadingInstance.close()
if(timer.value){
clearTimeout(timer.value)
timer.value = 0
}
}, 400)
})
}

52
src/views/mes/ordermonthplan/index.vue

@ -57,13 +57,14 @@
:detailAllSchemas="detailAllSchemas"
:detailAllSchemasRules="MesOrderMonthSubRules"
:apiPage="MesOrderMonthApi.getMesOrderMonthSubPage"
:apiCreate="MesOrderMonthApi.createMesOrderMonthSub"
:apiUpdate="MesOrderMonthApi.updateMesOrderMonthSub"
:apiCreate="createMesOrderMonthSub"
:apiUpdate="updateMesOrderMonthSub"
:apiDelete="MesOrderMonthApi.deleteMesOrderMonthSub"
:tabs="TabsList"
:detailButtonIsShowDelete="true"
:detailButtonIsShowEdit="true"
:detailButtonIsShowAdd="true"
@searchTableSuccessDetail="searchTableSuccess"
/>
<!-- 导入 -->
<ImportForm ref="importFormRef" url="/plan/mes-order-month-main/import"
@ -81,6 +82,8 @@ import {
MesOrderMonthSub,
MesOrderMonthSubRules
} from "@/views/mes/ordermonthplan/mesOrderMonthSub.data";
import * as OrderDayApi from "@/api/mes/orderDay";
import {MesOrderMonthSubVO} from "@/api/mes/ordermonthplan";
defineOptions({ name: 'MesOrderMonthMain' })
@ -91,14 +94,6 @@ const routeName = ref()
routeName.value = route.name
const tableColumns = ref(MesOrderMonthMain.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
@ -111,6 +106,7 @@ const { tableObject, tableMethods } = useTable({
//
const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultAddBtn({hasPermi: 'mes:ordermonthplan:create'}), //
@ -255,4 +251,40 @@ onMounted(async () => {
importTemplateData.templateUrl = await MesOrderMonthApi.importTemplate()
})
const detailAllSchemas = ref(MesOrderMonthSub.allSchemas)
//
let productName
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])
productName = val[0].name
getBoms(val[0][searchField])
}
// if(formField=='workroomCode'){
// getProductlines(val[0][searchField])
// }
})
}
const bomOptions=ref([])
const getBoms = async (code: String) => {
bomOptions.value = await OrderDayApi.getBoms(code)
MesOrderMonthSub.allSchemas.formSchema.forEach(item => {
if (item.field == 'bomCode') {
item.componentProps.options = bomOptions.value
}
})
}
const createMesOrderMonthSub = async (data: MesOrderMonthSubVO) => {
data.productName = productName
return await MesOrderMonthApi.createMesOrderMonthSub(data)
}
const updateMesOrderMonthSub = async (data: MesOrderMonthSubVO) => {
data.productName = productName
return await MesOrderMonthApi.updateMesOrderMonthSub(data)
}
</script>

61
src/views/mes/ordermonthplan/mesOrderMonthSub.data.ts

@ -1,6 +1,9 @@
import type {CrudSchema} from '@/hooks/web/useCrudSchemas'
import {dateFormatter} from '@/utils/formatTime'
import {Itembasic} from "@/views/wms/basicDataManage/itemManage/itembasic/itembasic.data";
import * as ItembasicApi from "@/api/wms/itembasic";
import {Warehouse} from "@/views/wms/basicDataManage/factoryModeling/warehouse/warehouse.data";
import * as WorehouseApi from "@/api/wms/warehouse";
// 表单校验
export const MesOrderMonthSubRules = reactive({
productCode: [required],
@ -19,7 +22,33 @@ export const MesOrderMonthSub = useCrudSchemas(reactive<CrudSchema[]>([
field: 'productCode',
sort: 'custom',
isTable: false,
isSearch: true
isSearch: 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: 'CCP,BCP',//,SEMI]
isMainValue: false
},
]
}
}
},
{
label: '产品名称',
@ -33,13 +62,37 @@ export const MesOrderMonthSub = useCrudSchemas(reactive<CrudSchema[]>([
field: 'bomCode',
sort: 'custom',
isTable: false,
isSearch: true
isSearch: true,
form: {
component:'Select',
componentProps: {
options: [{lablel:'bom',value:'bom'}]
}
}
},
{
label: '入库仓库编码',
field: 'inStoreCode',
sort: 'custom',
isSearch: true
isSearch: true,
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择', // 输入框占位文本
searchField: 'code', // 查询弹窗赋值字段
searchTitle: '仓库编码', // 查询弹窗标题
searchAllSchemas: Warehouse.allSchemas, // 查询弹窗所需类
searchPage: WorehouseApi.getWarehousePage, // 查询弹窗所需分页方法
isHideFilterButton:true,
searchCondition: [{
key: 'available',
value: 'TRUE',
isMainValue: false
}
]
}
}
},
{
label: '计划数量',

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

@ -0,0 +1,244 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="Pattern.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
</ContentWrap>
<!-- 列表头部 -->
<TableHead
:HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick"
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="Pattern.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="PatternRules"
:formAllSchemas="Pattern.allSchemas"
:apiUpdate="PatternApi.updatePattern"
:apiCreate="PatternApi.createPattern"
@searchTableSuccess="searchTableSuccess"
:isBusiness="false"
/>
<!-- 详情 -->
<Detail ref="detailRef" :isBasic="true" :allSchemas="Pattern.allSchemas" />
<!-- 导入 -->
<ImportForm ref="importFormRef" url="/mes/pattern/import" :importTemplateData="importTemplateData" @success="importSuccess" />
</template>
<script setup lang="ts">
import download from '@/utils/download'
import { Pattern,PatternRules } from './pattern.data'
import * as PatternApi from '@/api/mes/pattern'
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: 'Pattern' })
const message = useMessage() //
const { t } = useI18n() //
const route = useRoute() //
const routeName = ref()
routeName.value = route.name
const tableColumns = ref(Pattern.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: PatternApi.getPatternPage //
})
//
const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultAddBtn({hasPermi:'mes:pattern:create'}), //
defaultButtons.defaultImportBtn({hasPermi:'mes:pattern:import'}), //
defaultButtons.defaultExportBtn({hasPermi:'mes:pattern: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:pattern:update'}), //
defaultButtons.mainListDeleteBtn({hasPermi:'mes:pattern: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 =Pattern.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 PatternApi.createPattern(data)
message.success(t('common.createSuccess'))
} else {
await PatternApi.updatePattern(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, 'basicPattern')
}
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
try {
//
await message.delConfirm()
//
await PatternApi.deletePattern(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 PatternApi.exportPattern(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 PatternApi.importTemplate()
})
</script>

312
src/views/mes/pattern/pattern.data.ts

@ -0,0 +1,312 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime'
import {PatternType} from "@/views/mes/patternType/patternType.data";
import * as PatternTypeApi from "@/api/mes/patternType";
import {validateInteger} from '@/utils/validator'
// 表单校验
export const PatternRules = reactive({
code: [required],
name: [required],
partternName: [required],
})
export const Pattern = 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')]
}
},
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: 'partternName',
sort: 'custom',
isSearch: true,
form: {
componentProps: {
isSearchList: true, // 开启查询弹窗
searchTitle: '模具类型', // 查询弹窗标题
searchAllSchemas: PatternType.allSchemas, // 查询弹窗所需类
searchField: 'name', // 查询弹窗赋值字段
searchPage: PatternTypeApi.getPatternTypePage, // 查询弹窗所需分页方法
multiple:true,
searchCondition: [{
key: 'status',
value: '1',
action: '==',
isSearch: true,
isMainValue: false
}]
}
}
},
{
label: '产品编码',
field: 'productCode',
sort: 'custom',
isSearch: true,
},
{
label: '启用时间',
field: 'dateUseStart',
sort: 'custom',
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')]
}
},
formatter: dateFormatter,
isForm: true,
form: {
component: 'DatePicker',
componentProps: {
valueFormat: 'YYYY-MM-DD HH:mm:ss',
type: 'datetime',
valueFormat: 'x'
}
},
},
{
label: '停用时间',
field: 'dateUseStop',
sort: 'custom',
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')]
}
},
formatter: dateFormatter,
isForm: true,
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
valueFormat: 'x'
}
},
},
{
label: '模具来源',
field: 'partternFrom',
sort: 'custom',
isSearch: true,
},
{
label: '模具去向',
field: 'partternGo',
sort: 'custom',
isSearch: true,
},
{
label: '模具初始数量',
field: 'initCout',
sort: 'custom',
isSearch: true,
form: {
component: 'InputNumber',
componentProps: {
min: 1
}
},
},
{
label: '有效期开始时间',
field: 'effectStart',
sort: 'custom',
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')]
}
},
formatter: dateFormatter,
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
valueFormat: 'x'
}
},
},
{
label: '有效期结束时间',
field: 'effectEnd',
sort: 'custom',
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')]
}
},
formatter: dateFormatter,
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
valueFormat: 'x'
}
},
},
{
label: '所属单位编码',
field: 'factoryCode',
sort: 'custom',
isSearch: true,
},
{
label: '所属单位名称',
field: 'factoryName',
sort: 'custom',
isSearch: true,
},
{
label: '所属单位类别',
field: 'factoryType',
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
}
]))

50
src/views/mes/partternType/index.vue → src/views/mes/patternType/index.vue

@ -1,7 +1,7 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="PartternType.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
<Search :schema="PatternType.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
</ContentWrap>
<!-- 列表头部 -->
@ -11,7 +11,7 @@
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="PartternType.allSchemas"
:allSchemas="PatternType.allSchemas"
/>
<!-- 列表 -->
@ -42,31 +42,31 @@
<BasicForm
ref="basicFormRef"
@success="formsSuccess"
:rules="PartternTypeRules"
:formAllSchemas="PartternType.allSchemas"
:apiUpdate="PartternTypeApi.updatePartternType"
:apiCreate="PartternTypeApi.createPartternType"
:rules="PatternTypeRules"
:formAllSchemas="PatternType.allSchemas"
:apiUpdate="PatternTypeApi.updatePatternType"
:apiCreate="PatternTypeApi.createPatternType"
@searchTableSuccess="searchTableSuccess"
:isBusiness="false"
/>
<!-- 详情 -->
<Detail ref="detailRef" :isBasic="true" :allSchemas="PartternType.allSchemas" />
<Detail ref="detailRef" :isBasic="true" :allSchemas="PatternType.allSchemas" />
<!-- 导入 -->
<ImportForm ref="importFormRef" url="/mes/parttern-type/import" :importTemplateData="importTemplateData" @success="importSuccess" />
<ImportForm ref="importFormRef" url="/mes/pattern-type/import" :importTemplateData="importTemplateData" @success="importSuccess" />
</template>
<script setup lang="ts">
import download from '@/utils/download'
import { PartternType,PartternTypeRules } from './partternType.data'
import * as PartternTypeApi from '@/api/mes/partternType'
import { PatternType,PatternTypeRules } from './patternType.data'
import * as PatternTypeApi from '@/api/mes/patternType'
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: 'PartternType' })
defineOptions({ name: 'PatternType' })
const message = useMessage() //
const { t } = useI18n() //
@ -74,7 +74,7 @@ const { t } = useI18n() // 国际化
const route = useRoute() //
const routeName = ref()
routeName.value = route.name
const tableColumns = ref(PartternType.allSchemas.tableColumns)
const tableColumns = ref(PatternType.allSchemas.tableColumns)
//
const searchTableSuccess = (formField, searchField, val, formRef) => {
@ -91,7 +91,7 @@ const updataTableColumns = (val) => {
}
const { tableObject, tableMethods } = useTable({
getListApi: PartternTypeApi.getPartternTypePage //
getListApi: PatternTypeApi.getPatternTypePage //
})
//
@ -99,9 +99,9 @@ const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultAddBtn({hasPermi:'mes:partternType:create'}), //
defaultButtons.defaultImportBtn({hasPermi:'mes:partternType:import'}), //
defaultButtons.defaultExportBtn({hasPermi:'mes:partternType:export'}), //
defaultButtons.defaultAddBtn({hasPermi:'mes:patternType:create'}), //
defaultButtons.defaultImportBtn({hasPermi:'mes:patternType:import'}), //
defaultButtons.defaultExportBtn({hasPermi:'mes:patternType:export'}), //
defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), //
@ -133,8 +133,8 @@ const buttonBaseClick = (val, item) => {
// -
const butttondata = [
defaultButtons.mainListEditBtn({hasPermi:'mes:partternType:update'}), //
defaultButtons.mainListDeleteBtn({hasPermi:'mes:partternType:delete'}), //
defaultButtons.mainListEditBtn({hasPermi:'mes:patternType:update'}), //
defaultButtons.mainListDeleteBtn({hasPermi:'mes:patternType:delete'}), //
]
// -
@ -154,7 +154,7 @@ const openForm = (type: string, row?: any) => {
// form
const formsSuccess = async (formType,data) => {
var isHave =PartternType.allSchemas.formSchema.some(function (item) {
var isHave =PatternType.allSchemas.formSchema.some(function (item) {
return item.field === 'activeTime' || item.field === 'expireTime';
});
if(isHave){
@ -166,10 +166,10 @@ const formsSuccess = async (formType,data) => {
if(data.activeTime==0)data.activeTime = null;
if(data.expireTime==0)data.expireTime = null;
if (formType === 'create') {
await PartternTypeApi.createPartternType(data)
await PatternTypeApi.createPatternType(data)
message.success(t('common.createSuccess'))
} else {
await PartternTypeApi.updatePartternType(data)
await PatternTypeApi.updatePatternType(data)
message.success(t('common.updateSuccess'))
}
basicFormRef.value.dialogVisible = false
@ -179,7 +179,7 @@ const formsSuccess = async (formType,data) => {
/** 详情操作 */
const detailRef = ref()
const openDetail = (row: any, titleName: any, titleValue: any) => {
detailRef.value.openDetail(row, titleName, titleValue, 'basicPartternType')
detailRef.value.openDetail(row, titleName, titleValue, 'basicPatternType')
}
/** 删除按钮操作 */
@ -188,7 +188,7 @@ const handleDelete = async (id: number) => {
//
await message.delConfirm()
//
await PartternTypeApi.deletePartternType(id)
await PatternTypeApi.deletePatternType(id)
message.success(t('common.delSuccess'))
//
await getList()
@ -203,7 +203,7 @@ const handleExport = async () => {
await message.exportConfirm()
//
exportLoading.value = true
const data = await PartternTypeApi.exportPartternType(tableObject.params)
const data = await PatternTypeApi.exportPatternType(tableObject.params)
download.excel(data, '模具类型.xlsx')
} catch {
} finally {
@ -238,7 +238,7 @@ const searchFormClick = (searchData) => {
/** 初始化 **/
onMounted(async () => {
getList()
importTemplateData.templateUrl = await PartternTypeApi.importTemplate()
importTemplateData.templateUrl = await PatternTypeApi.importTemplate()
})
</script>

5
src/views/mes/partternType/partternType.data.ts → src/views/mes/patternType/patternType.data.ts

@ -2,11 +2,12 @@ import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime'
// 表单校验
export const PartternTypeRules = reactive({
export const PatternTypeRules = reactive({
code: [required],
name: [required]
})
export const PartternType = useCrudSchemas(reactive<CrudSchema[]>([
export const PatternType = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '删除时间',
field: 'deleteTime',

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

@ -48,152 +48,152 @@ export const Aql = useCrudSchemas(reactive<CrudSchema[]>([
},
{
label: 'A0_010',
field: 'a0Separator010',
field: 'a0separator010',
sort: 'custom',
},
{
label: 'R0_010',
field: 'r0Separator010',
field: 'r0separator010',
sort: 'custom',
},
{
label: 'A0_015',
field: 'a0Separator015',
field: 'a0separator015',
sort: 'custom',
},
{
label: 'R0_015',
field: 'r0Separator015',
field: 'r0separator015',
sort: 'custom',
},
{
label: 'A0_025',
field: 'a0Separator025',
field: 'a0separator025',
sort: 'custom',
},
{
label: 'R0_025',
field: 'r0Separator025',
field: 'r0separator025',
sort: 'custom',
},
{
label: 'A0_040',
field: 'a0Separator040',
field: 'a0separator040',
sort: 'custom',
},
{
label: 'R0_040',
field: 'r0Separator040',
field: 'r0separator040',
sort: 'custom',
},
{
label: 'A0_065',
field: 'a0Separator065',
field: 'a0separator065',
sort: 'custom',
},
{
label: 'R0_065',
field: 'r0Separator065',
field: 'r0separator065',
sort: 'custom',
},
{
label: 'A0_10',
field: 'a0Separator10',
field: 'a0separator10',
sort: 'custom',
},
{
label: 'R0_10',
field: 'r0Separator10',
field: 'r0separator10',
sort: 'custom',
},
{
label: 'A0_15',
field: 'a0Separator15',
field: 'a0separator15',
sort: 'custom',
},
{
label: 'R0_15',
field: 'r0Separator15',
field: 'r0separator15',
sort: 'custom',
},
{
label: 'A0_25',
field: 'a0Separator25',
field: 'a0separator25',
sort: 'custom',
},
{
label: 'R0_25',
field: 'r0Separator25',
field: 'r0separator25',
sort: 'custom',
},
{
label: 'A0_40',
field: 'a0Separator40',
field: 'a0separator40',
sort: 'custom',
},
{
label: 'R0_40',
field: 'r0Separator40',
field: 'r0separator40',
sort: 'custom',
},
{
label: 'A0_65',
field: 'a0Separator65',
field: 'a0separator65',
sort: 'custom',
},
{
label: 'R0_65',
field: 'r0Separator65',
field: 'r0separator65',
sort: 'custom',
},
{
label: 'A1_0',
field: 'a1Separator0',
field: 'a1separator0',
sort: 'custom',
},
{
label: 'R1_0',
field: 'r1Separator0',
field: 'r1separator0',
sort: 'custom',
},
{
label: 'A1_5',
field: 'a1Separator5',
field: 'a1separator5',
sort: 'custom',
},
{
label: 'R1_5',
field: 'r1Separator5',
field: 'r1separator5',
sort: 'custom',
},
{
label: 'A2_5',
field: 'a2Separator5',
field: 'a2separator5',
sort: 'custom',
},
{
label: 'R2_5',
field: 'r2Separator5',
field: 'r2separator5',
sort: 'custom',
},
{
label: 'A4_0',
field: 'a4Separator0',
field: 'a4separator0',
sort: 'custom',
},
{
label: 'R4_0',
field: 'r4Separator0',
field: 'r4separator0',
sort: 'custom',
},
{
label: 'A6_5',
field: 'a6Separator5',
field: 'a6separator5',
sort: 'custom',
},
{
label: 'R6_5',
field: 'r6Separator5',
field: 'r6separator5',
sort: 'custom',
},
{

24
src/views/qms/basicDataManage/counter/counter.data.ts

@ -26,12 +26,6 @@ export const Counter = useCrudSchemas(reactive<CrudSchema[]>([
sort: 'custom',
isSearch: true
},
{
label: '工序编码',
field: 'workingCode',
sort: 'custom',
isSearch: true,
},
{
label: '供应商编码',
field: 'supplierCode',
@ -120,13 +114,13 @@ export const Counter = useCrudSchemas(reactive<CrudSchema[]>([
sort: 'custom',
isSearch: false,
},
{
label: '操作',
field: 'action',
isForm: false,
table: {
width: 150,
fixed: 'right'
}
}
// {
// label: '操作',
// field: 'action',
// isForm: false,
// table: {
// width: 150,
// fixed: 'right'
// }
// }
]))

109
src/views/qms/basicDataManage/dynamicRule/dynamicRule.data.ts

@ -40,112 +40,3 @@ export const DynamicRule = useCrudSchemas(reactive<CrudSchema[]>([
}
}
]))
// 表单校验
export const InspectionStageRules = reactive({
dynamicModifyCode: [required],
okTimes: [required],
okTimeStage: [required],
noOkTimes: [required],
noOkTimeStage: [required],
isStartStage: [required],
skipInspection: [required],
inspectionStringency: [required],
})
export const InspectionStage = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '描述',
field: 'description',
sort: 'custom',
isSearch: true
},
{
label: 'OK次数',
field: 'okTimes',
sort: 'custom',
isSearch: true,
form: {
component: 'InputNumber',
value: 0
}
},
{
label: 'OK次数后的阶段',
field: 'okTimeStage',
sort: 'custom',
isSearch: true,
form: {
component: 'InputNumber',
value: 0
}
},
{
label: 'NOK次数',
field: 'noOkTimes',
sort: 'custom',
isSearch: true,
form: {
component: 'InputNumber',
value: 0
}
},
{
label: 'NOK次数后的阶段',
field: 'noOkTimeStage',
sort: 'custom',
isSearch: true,
form: {
component: 'InputNumber',
value: 0
}
},
{
label: '是否是起始阶段',
field: 'isStartStage',
sort: 'custom',
isSearch: true,
formatter: (_: Recordable, __: TableColumn, cellValue: boolean) => {
return trueFalse.find((account) => account.value == cellValue)?.label
},
form: {
component: 'Switch',
value:true
}
},
{
label: '是否略过检验',
field: 'skipInspection',
sort: 'custom',
isSearch: true,
formatter: (_: Recordable, __: TableColumn, cellValue: boolean) => {
return trueFalse.find((account) => account.value == cellValue)?.label
},
form: {
component: 'Switch',
value:true
}
},
{
label: '检验严格性',
field: 'inspectionStringency',
sort: 'custom',
isSearch: true,
dictType: DICT_TYPE.INSPECTION_SEVERITY,
dictClass: 'string', // 默认都是字符串类型其他暂不考虑
form: {
component: 'Select'
},
},
{
label: '操作',
field: 'action',
isForm: false,
table: {
width: 300,
fixed: 'right'
},
isTableForm: false,
}
]))

6
src/views/qms/basicDataManage/dynamicRule/index.vue

@ -59,7 +59,7 @@
/>
<!-- 详情 -->
<DetailQms
<DetailQmsCode
ref="detailRef"
:isBasic="false"
:allSchemas="DynamicRule.allSchemas"
@ -84,11 +84,13 @@
<script setup lang="ts">
import download from '@/utils/download'
import { DynamicRule,DynamicRuleRules,InspectionStage,InspectionStageRules } from './dynamicRule.data'
import { DynamicRule,DynamicRuleRules } from './dynamicRule.data'
import { InspectionStage,InspectionStageRules } from '../inspectionStage/inspectionStage.data'
import * as DynamicRuleApi from '@/api/qms/dynamicRule'
import * as InspectionStageApi from '@/api/qms/inspectionStage'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import UploadFile from '@/components/UploadFile/src/UploadFile.vue'
// import TableHead from '@/components/TableHead/src/TableHead.vue'
// import ImportForm from '@/components/ImportForm/src/ImportForm.vue'
// import Detail from '@/components/Detail/src/Detail.vue'

152
src/views/qms/basicDataManage/inspectionStage/inspectionStage.data.ts

@ -1,9 +1,17 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime'
const trueFalse = [{
label: '是',
value: true
}, {
label: '否',
value: false
}]
// 表单校验
export const InspectionStageRules = reactive({
code: [required],
description: [required],
dynamicModifyCode: [required],
okTimes: [required],
okTimeStage: [required],
@ -12,28 +20,28 @@ export const InspectionStageRules = reactive({
isStartStage: [required],
skipInspection: [required],
inspectionStringency: [required],
available: [required],
concurrencyStamp: [required]
})
export const InspectionStage = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '编码',
field: 'code',
sort: 'custom',
isSearch: true
},
{
label: '动态修改规则编码',
field: 'dynamicModifyCode',
label: '描述',
field: 'description',
sort: 'custom',
isSearch: true
},
{
label: '描述',
field: 'description',
label: '阶段',
field: 'stage',
sort: 'custom',
isSearch: true
isSearch: true,
form: {
component: 'InputNumber',
value: 0
},
tableForm: {
type: 'InputNumber',
}
},
{
label: 'OK次数',
@ -43,6 +51,9 @@ export const InspectionStage = useCrudSchemas(reactive<CrudSchema[]>([
form: {
component: 'InputNumber',
value: 0
},
tableForm: {
type: 'InputNumber',
}
},
{
@ -53,6 +64,9 @@ export const InspectionStage = useCrudSchemas(reactive<CrudSchema[]>([
form: {
component: 'InputNumber',
value: 0
},
tableForm: {
type: 'InputNumber',
}
},
{
@ -63,6 +77,9 @@ export const InspectionStage = useCrudSchemas(reactive<CrudSchema[]>([
form: {
component: 'InputNumber',
value: 0
},
tableForm: {
type: 'InputNumber',
}
},
{
@ -73,6 +90,9 @@ export const InspectionStage = useCrudSchemas(reactive<CrudSchema[]>([
form: {
component: 'InputNumber',
value: 0
},
tableForm: {
type: 'InputNumber',
}
},
{
@ -80,104 +100,58 @@ export const InspectionStage = useCrudSchemas(reactive<CrudSchema[]>([
field: 'isStartStage',
sort: 'custom',
isSearch: true,
formatter: (_: Recordable, __: TableColumn, cellValue: boolean) => {
return trueFalse.find((account) => account.value == cellValue)?.label
},
form: {
component: 'Radio'
}
component: 'Switch',
value:true
},
tableForm: {
type: 'Switch',
default: true
},
},
{
label: '是否略过检验',
field: 'skipInspection',
sort: 'custom',
isSearch: true,
formatter: (_: Recordable, __: TableColumn, cellValue: boolean) => {
return trueFalse.find((account) => account.value == cellValue)?.label
},
form: {
component: 'Radio'
component: 'Switch',
value:true
},
tableForm: {
type: 'Switch',
default: true
}
},
{
label: '检验严格性',
field: 'inspectionStringency',
sort: 'custom',
isSearch: true
},
{
label: '是否可用',
field: 'available',
sort: 'custom',
isSearch: 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')]
}
dictType: DICT_TYPE.INSPECTION_SEVERITY,
dictClass: 'string', // 默认都是字符串类型其他暂不考虑
form: {
component: 'Select'
},
isForm: false
},
{
label: '删除时间',
field: 'deletionTime',
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')]
}
tableForm: {
type: 'Select'
},
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
valueFormat: 'x'
}
}
},
{
label: '删除者ID',
field: 'deleterId',
sort: 'custom',
isSearch: true
},
{
label: '扩展属性',
field: 'extraProperties',
sort: 'custom',
isSearch: true
},
{
label: '并发乐观锁',
field: 'concurrencyStamp',
sort: 'custom',
isSearch: true,
form: {
component: 'InputNumber',
value: 0
}
},
{
label: '地点id',
field: 'siteId',
sort: 'custom',
isSearch: true
},
{
label: '操作',
field: 'action',
isForm: false,
table: {
width: 150,
width: 300,
fixed: 'right'
}
},
isTableForm: false,
}
]))

135
src/views/qms/basicDataManage/selectedProject/selectedProject.data.ts

@ -1,5 +1,13 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime'
import * as DictTypeApi from '@/api/system/dict/dict.type'
const dictTypeList = await DictTypeApi.getSimpleDictTypeList()
const dictTypeListData = dictTypeList.map(item => {
return {
label: item.name,
value: item.type
}
})
// 表单校验
export const SelectedProjectRules = reactive({
@ -11,113 +19,81 @@ export const SelectedProjectRules = reactive({
})
export const SelectedProject = useCrudSchemas(reactive<CrudSchema[]>([
{
label: 'id',
field: 'id',
sort: 'custom',
isForm: false
},
{
label: '编码',
field: 'code',
sort: 'custom',
isTableForm: false,
isSearch: true
},
{
label: '字典编码',
label: '字典',
field: 'dictionaryCode',
sort: 'custom',
isSearch: true
},
{
label: '字典项值',
field: 'dictionaryValue',
sort: 'custom',
isSearch: true
},
{
label: '评估代码',
field: 'estimateCode',
sort: 'custom',
isSearch: true
},
{
label: '缺陷级别',
field: 'defectLevel',
sort: 'custom',
isSearch: true
},
{
label: '是否可用',
field: 'available',
sort: 'custom',
isSearch: true
},
{
label: '创建时间',
field: 'createTime',
sort: 'custom',
formatter: dateFormatter,
isSearch: true,
search: {
component: 'DatePicker',
tableForm: {
type: 'Select',
initOptions: dictTypeListData,
},
form: {
component: 'Select',
api: dictTypeListData,
componentProps: {
valueFormat: 'YYYY-MM-DD HH:mm:ss',
type: 'daterange',
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')]
options: dictTypeListData,
optionsAlias: {
labelField: 'label',
valueField: 'value'
}
}
},
isForm: false
}
},
{
label: '删除时间',
field: 'deletionTime',
label: '字典项值',
field: 'dictionaryValue',
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')]
}
tableForm: {
type: 'Select',
},
form: {
component: 'DatePicker',
component: 'Select',
componentProps: {
type: 'datetime',
valueFormat: 'x'
options: dictTypeListData,
optionsAlias: {
labelField: 'label',
valueField: 'value'
}
}
}
},
{
label: '删除者ID',
field: 'deleterId',
sort: 'custom',
isSearch: true
},
{
label: '扩展属性',
field: 'extraProperties',
sort: 'custom',
isSearch: true
},
{
label: '并发乐观锁',
field: 'concurrencyStamp',
label: '评估代码',
field: 'estimateCode',
sort: 'custom',
isSearch: true,
dictType: DICT_TYPE.DICTIONARY_CLASS,
dictClass: 'string',
tableForm: {
type: 'Select',
},
form: {
component: 'InputNumber',
value: 0
component: 'Select',
}
},
{
label: '地点ID',
field: 'siteId',
label: '缺陷级别',
field: 'defectLevel',
sort: 'custom',
isSearch: true
isSearch: true,
dictType: DICT_TYPE.DEFECT_LEVEL,
dictClass: 'string',
tableForm: {
type: 'Select',
},
form: {
component: 'Select',
}
},
{
label: '操作',
@ -126,6 +102,9 @@ export const SelectedProject = useCrudSchemas(reactive<CrudSchema[]>([
table: {
width: 150,
fixed: 'right'
}
},
isTableForm: false,
}
]))

125
src/views/qms/basicDataManage/selectedSet/index.vue

@ -44,14 +44,40 @@
@success="formsSuccess"
:rules="SelectedSetRules"
:formAllSchemas="SelectedSet.allSchemas"
:tableAllSchemas="SelectedProject.allSchemas"
:tableFormRules="SelectedProjectRules"
:tableData="tableData"
:apiUpdate="SelectedSetApi.updateSelectedSet"
:apiCreate="SelectedSetApi.createSelectedSet"
@searchTableSuccess="searchTableSuccess"
:isBusiness="false"
@onChange="onChange"
@handleAddTable="handleAddTable"
@handleDeleteTable="handleDeleteTable"
@submitForm="submitForm"
:isSearchTableItem="true"
@formSelectChange="formSelectChange"
/>
<!-- 详情 -->
<Detail ref="detailRef" :isBasic="true" :allSchemas="SelectedSet.allSchemas" />
<DetailQmsCode
ref="detailRef"
:isBasic="false"
:allSchemas="SelectedSet.allSchemas"
:detailAllSchemas="SelectedProject.allSchemas"
:detailAllSchemasRules="SelectedProjectRules"
:apiCreate="SelectedProjectApi.createSelectedProject"
:apiUpdate="SelectedProjectApi.updateSelectedProject"
:apiPage="SelectedProjectApi.getSelectedProjectPage"
:apiDelete="SelectedProjectApi.deleteSelectedProject"
:detailValidate="detailValidate"
@searchTableSuccessDetail="searchTableSuccessDetail"
:detailButtonIsShowEdit=true
:detailButtonIsShowAdd=true
:detailButtonIsShowDelete=true
@detailOpenForm="detailOpenForm"
@detailBasicFormOnChange="detailBasiFormOnChange"
/>
<!-- 导入 -->
<ImportForm ref="importFormRef" url="/qms/selected-set/import" :importTemplateData="importTemplateData" @success="importSuccess" />
@ -62,9 +88,13 @@ import download from '@/utils/download'
import { SelectedSet,SelectedSetRules } from './selectedSet.data'
import * as SelectedSetApi from '@/api/qms/selectedSet'
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 { SelectedProject,SelectedProjectRules } from '../selectedProject/selectedProject.data'
import * as SelectedProjectApi from '@/api/qms/selectedProject'
import * as DictDataApi from '@/api/system/dict/dict.data'
import component from 'virtual:svg-icons-register'
// 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: 'SelectedSet' })
@ -72,7 +102,9 @@ const message = useMessage() // 消息弹窗
const { t } = useI18n() //
const route = useRoute() //
const tableData = ref([])
const routeName = ref()
const selectDictType = ref()
routeName.value = route.name
const tableColumns = ref(SelectedSet.allSchemas.tableColumns)
@ -99,9 +131,9 @@ const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultAddBtn({hasPermi:'wms:selectedSet:create'}), //
defaultButtons.defaultImportBtn({hasPermi:'wms:selectedSet:import'}), //
defaultButtons.defaultExportBtn({hasPermi:'wms:selectedSet:export'}), //
defaultButtons.defaultAddBtn({hasPermi:'qms:selected-set:query'}), //
// defaultButtons.defaultImportBtn({hasPermi:'qms:selected-set:import'}), //
// defaultButtons.defaultExportBtn({hasPermi:'qms:selected-set:export'}), //
defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), //
@ -133,8 +165,8 @@ const buttonBaseClick = (val, item) => {
// -
const butttondata = [
defaultButtons.mainListEditBtn({hasPermi:'wms:selectedSet:update'}), //
defaultButtons.mainListDeleteBtn({hasPermi:'wms:selectedSet:delete'}), //
defaultButtons.mainListEditBtn({hasPermi:'qms:selected-set:update'}), //
defaultButtons.mainListDeleteBtn({hasPermi:'qms:selected-set:delete'}), //
]
// -
@ -149,6 +181,7 @@ const buttonTableClick = async (val, row) => {
/** 添加/修改操作 */
const basicFormRef = ref()
const openForm = (type: string, row?: any) => {
tableData.value = []
basicFormRef.value.open(type, row)
}
@ -179,6 +212,7 @@ const formsSuccess = async (formType,data) => {
/** 详情操作 */
const detailRef = ref()
const openDetail = (row: any, titleName: any, titleValue: any) => {
selectDictType.value = row.classification
detailRef.value.openDetail(row, titleName, titleValue, 'basicSelectedSet')
}
@ -235,6 +269,79 @@ const searchFormClick = (searchData) => {
getList() //
}
const tableFormKeys = {}
SelectedProject.allSchemas.tableFormColumns.forEach((item) => {
tableFormKeys[item.field] = item.default ? item.default : ''
})
//
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.selectedProjectDOList = tableData.value//
console.log(data.subList)
try {
if (formType === 'create') {
await SelectedSetApi.createSelectedSet(data)
message.success(t('common.createSuccess'))
} else {
await SelectedSetApi.updateSelectedSet(data)
message.success(t('common.updateSuccess'))
}
basicFormRef.value.dialogVisible = false
//
getList()
} finally {
basicFormRef.value.formLoading = false
}
}
const detailValidate = (data) => {
let tag = true;
return tag
}
const detailOpenForm = (type, row, masterParmas) => {
// if(selectDictType.value){
// }
if(type='create'){
}
}
const detailBasiFormOnChange = (field,val) => {
console.log(field)
console.log(val)
if(field == 'dictionaryCode'){
DictDataApi.queryByDictType(val).then(res => {
SelectedProject.allSchemas.formSchema.find(item => {
return item.field == 'dictionaryValue'
}).componentProps.options = res.map(item=>{
return {
value: item.value,
label: item.label
}
})
})
}
}
const formSelectChange = (a,b,c,d) => {
console.log(111)
}
/** 初始化 **/
onMounted(async () => {
getList()

87
src/views/qms/basicDataManage/selectedSet/selectedSet.data.ts

@ -1,24 +1,22 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime'
import * as DictTypeApi from '@/api/system/dict/dict.type'
// 表单校验
export const SelectedSetRules = reactive({
description: [required],
code: [required],
available: [required],
concurrencyStamp: [required]
})
export const SelectedSet = useCrudSchemas(reactive<CrudSchema[]>([
{
label: 'id',
field: 'id',
sort: 'custom',
isForm: false
},
{
label: '编码',
field: 'code',
sort: 'custom',
isForm: false,
isSearch: true
},
{
@ -31,80 +29,13 @@ export const SelectedSet = useCrudSchemas(reactive<CrudSchema[]>([
label: '分类',
field: 'classification',
sort: 'custom',
isSearch: true
},
{
label: '是否可用',
field: 'available',
sort: 'custom',
isSearch: 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')]
}
},
isForm: false
},
{
label: '删除时间',
field: 'deletionTime',
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'
}
dictType: DICT_TYPE.EVALUATION_CODE,
dictClass: 'string',
tableForm: {
type: 'Select',
}
},
{
label: '删除者ID',
field: 'deleterId',
sort: 'custom',
isSearch: true
},
{
label: '扩展属性',
field: 'extraProperties',
sort: 'custom',
isSearch: true
},
{
label: '并发乐观锁',
field: 'concurrencyStamp',
sort: 'custom',
isSearch: true,
form: {
component: 'InputNumber',
value: 0
}
},
{
label: '地点ID',
field: 'siteId',
sort: 'custom',
isSearch: true
},
{
label: '操作',
field: 'action',

645
src/views/qms/inspection/inspectionJob/addForm.vue

@ -16,12 +16,10 @@
:rules="rules"
:schema="formSchema"
:is-col="true"
:disabled="true"
@opensearchTable="opensearchTable"
/>
<el-tabs
v-model="editableTabsValue"
editable
class="demo-tabs"
@edit="handleTabsEdit"
type="border-card"
@ -29,7 +27,7 @@
:stretch="false"
>
<el-tab-pane
v-for="item in data.process"
v-for="(item,index) in data.subList"
:key="item.name"
:label="item.processCode"
:name="item.name"
@ -78,141 +76,66 @@
<el-col :span="12">
<el-form-item label="编码">
<el-input
v-model="item.inspectionCharacteristicsBaseVO.number"
v-model="item.inspectionJobCharacteristicsUpdateReqVO.number"
placeholder="根据系统生成"
:disabled="true"
/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="描述" prop="inspectionCharacteristicsBaseVO.description">
<el-input v-model="item.inspectionCharacteristicsBaseVO.description" :disabled="true" />
<el-form-item label="描述" prop="inspectionJobCharacteristicsUpdateReqVO.description">
<el-input v-model="item.inspectionJobCharacteristicsUpdateReqVO.description" :disabled="true" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item
label="检验方法"
prop="inspectionCharacteristicsBaseVO.inspectionMethodCode"
prop="inspectionJobCharacteristicsUpdateReqVO.inspectionMethodCode"
>
<div style="display: flex; width: 100%">
<el-input
v-model="item.inspectionCharacteristicsBaseVO.inspectionMethodName"
v-model="item.inspectionJobCharacteristicsUpdateReqVO.inspectionMethodName"
disabled
placeholder="请选择检验方法"
/>
<el-button
type="info"
plain
style="width: 40px"
@click="
opensearchTable(
'inspectionMethodCode',
null,
'检验方法',
InspectionMethod.allSchemas,
InspectionMethodApi.getInspectionMethodPage,
[
{
key: 'available',
value: 'TRUE',
isMainValue: false
}
],
false,
'features',
item
)
"
><Icon icon="ep:search"
/></el-button>
</div>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item
label="采样过程编码"
prop="inspectionCharacteristicsBaseVO.inspectionMethod"
prop="inspectionJobCharacteristicsUpdateReqVO.inspectionMethod"
>
<div style="display: flex; width: 100%">
<el-input
v-model="item.inspectionCharacteristicsBaseVO.inspectionName"
v-model="item.inspectionJobCharacteristicsUpdateReqVO.inspectionName"
disabled
placeholder="请选择采样过程编码"
/>
<el-button
type="info"
plain
style="width: 40px"
@click="
opensearchTable(
'inspectionMethod',
null,
'采样过程编码',
SamplingProcess.allSchemas,
SamplingProcessApi.getSamplingProcessPage,
[
{
key: 'available',
value: 'TRUE',
isMainValue: false
}
],
false,
'features',
item
)
"
><Icon icon="ep:search"
/></el-button>
</div>
</el-form-item>
</el-col>
<el-col :span="12">
<!-- <el-col :span="12">
<el-form-item
label="动态修改规则编码"
prop="inspectionCharacteristicsBaseVO.dynamicUpdateCode"
prop="inspectionJobCharacteristicsUpdateReqVO.dynamicUpdateCode"
>
<div style="display: flex; width: 100%">
<el-input
v-model="item.inspectionCharacteristicsBaseVO.dynamicUpdateName"
v-model="item.inspectionJobCharacteristicsUpdateReqVO.dynamicUpdateName"
disabled
placeholder="请选择动态修改规则编码"
/>
<el-button
type="info"
plain
style="width: 40px"
@click="
opensearchTable(
'dynamicUpdateCode',
null,
'动态修改规则编码',
DynamicRule.allSchemas,
DynamicRuleApi.getDynamicRulePage,
[
{
key: 'available',
value: 'TRUE',
isMainValue: false
}
],
false,
'features',
item
)
"
><Icon icon="ep:search"
/></el-button>
</div>
</el-form-item>
</el-col>
</el-col> -->
<el-col :span="12">
<el-form-item
label="是否允许修改特征值"
prop="inspectionCharacteristicsBaseVO.isCanUpdate"
prop="inspectionJobCharacteristicsUpdateReqVO.isCanUpdate"
>
<el-switch
v-model="item.inspectionCharacteristicsBaseVO.isCanUpdate"
v-model="item.inspectionJobCharacteristicsUpdateReqVO.isCanUpdate"
disabled
/>
</el-form-item>
@ -220,11 +143,13 @@
<el-col :span="12">
<el-form-item
label="结果录入方式"
prop="inspectionCharacteristicsBaseVO.resultEntryMethod"
prop="inspectionJobCharacteristicsUpdateReqVO.resultEntryMethod"
>
<el-select
v-model="item.inspectionCharacteristicsBaseVO.resultEntryMethod"
v-model="item.inspectionJobCharacteristicsUpdateReqVO.resultEntryMethod"
placeholder="请选择结果录入方式"
@change="resultEntryMethodChange($event,item)"
disabled
>
<el-option
v-for="dict in getStrDictOptions(
@ -238,165 +163,103 @@
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="特征类型" prop="inspectionCharacteristicsBaseVO.featureType">
<!-- <el-input v-model="item.featureType" /> -->
<el-form-item label="特征类型" prop="inspectionJobCharacteristicsUpdateReqVO.featureType">
<el-select
v-model="item.inspectionCharacteristicsBaseVO.featureType"
v-model="item.inspectionJobCharacteristicsUpdateReqVO.featureType"
placeholder="请选择特征类型"
@change="changeFeatureType"
:disabled="!item.inspectionCharacteristicsBaseVO.isCanUpdate"
disabled
>
<el-option
v-for="dict in getStrDictOptions(
DICT_TYPE.INSPECTION_CHARACTERISTICS_FEATURE_TYPE
)"
<el-option v-for="dict in getStrDictOptions( DICT_TYPE.INSPECTION_CHARACTERISTICS_FEATURE_TYPE )"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12" v-if="item.inspectionCharacteristicsBaseVO.featureType == 0">
<el-form-item
label="是否设定上限"
prop="inspectionCharacteristicsBaseVO.quantifyIsCapping"
>
<el-switch
v-model="item.inspectionCharacteristicsBaseVO.quantifyIsCapping"
@change="changeIsCapping"
:disabled="!item.inspectionCharacteristicsBaseVO.isCanUpdate"
/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item
label="上限值"
prop="inspectionCharacteristicsBaseVO.quantifyCapping"
v-if="item.inspectionCharacteristicsBaseVO.featureType == 0"
>
<el-input
v-model="item.inspectionCharacteristicsBaseVO.quantifyCapping"
:disabled="!item.inspectionCharacteristicsBaseVO.isCanUpdate"
/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item
prop="inspectionCharacteristicsBaseVO.quantifyIsLowlimit"
label="是否设定下限"
v-if="item.inspectionCharacteristicsBaseVO.featureType == 0"
>
<el-switch
v-model="item.inspectionCharacteristicsBaseVO.quantifyIsLowlimit"
@change="changeLowlimit"
:disabled="!item.inspectionCharacteristicsBaseVO.isCanUpdate"
/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item
label="下限值"
prop="inspectionCharacteristicsBaseVO.quantifyLowlimit"
v-if="item.inspectionCharacteristicsBaseVO.featureType == 0"
>
<el-input
v-model="item.inspectionCharacteristicsBaseVO.quantifyLowlimit"
:disabled="!item.inspectionCharacteristicsBaseVO.isCanUpdate"
/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item
prop="inspectionCharacteristicsBaseVO.quantifyIsTarget"
label="是否设定目标值"
v-if="item.inspectionCharacteristicsBaseVO.featureType == 0"
>
<el-switch
v-model="item.inspectionCharacteristicsBaseVO.quantifyIsTarget"
@change="changeIsTarget"
:disabled="!item.inspectionCharacteristicsBaseVO.isCanUpdate"
/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item
label="目标值"
prop="inspectionCharacteristicsBaseVO.quantifyTarget"
v-if="item.inspectionCharacteristicsBaseVO.featureType == 0"
>
<el-input
v-model="item.inspectionCharacteristicsBaseVO.quantifyTarget"
:disabled="!item.inspectionCharacteristicsBaseVO.isCanUpdate"
/>
</el-form-item>
</el-col>
</el-col>
<el-col :span="12">
<el-form-item
label="计量单位"
prop="inspectionCharacteristicsBaseVO.quantifyUom"
v-if="item.inspectionCharacteristicsBaseVO.featureType == 0"
>
<el-input
v-model="item.inspectionCharacteristicsBaseVO.quantifyUom"
:disabled="!item.inspectionCharacteristicsBaseVO.isCanUpdate"
<el-form-item label="开始时间" prop="inspectionJobCharacteristicsUpdateReqVO.inspectionStartTime">
<el-date-picker
v-model="item.inspectionJobCharacteristicsUpdateReqVO.inspectionStartTime"
type="datetime"
placeholder="请选择开始时间"
style="width: 100%"
value-format="x"
/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item
label="小数位"
prop="inspectionCharacteristicsBaseVO.quantifyDecimal"
v-if="item.inspectionCharacteristicsBaseVO.featureType == 0"
>
<el-input
v-model="item.inspectionCharacteristicsBaseVO.quantifyDecimal"
:disabled="!item.inspectionCharacteristicsBaseVO.isCanUpdate"
<el-form-item label="结束时间" prop="inspectionJobCharacteristicsUpdateReqVO.inspectionEndTime">
<el-date-picker
v-model="item.inspectionJobCharacteristicsUpdateReqVO.inspectionEndTime"
type="datetime"
placeholder="请选择结束时间"
style="width: 100%"
value-format="x"
/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item
label="选择集编码"
prop="inspectionCharacteristicsBaseVO.quantifyQuantifyCode"
v-if="item.inspectionCharacteristicsBaseVO.featureType == 1"
>
<div style="display: flex; width: 100%">
<el-input
v-model="item.inspectionCharacteristicsBaseVO.quantifyQuantifyCode"
disabled
placeholder="请选择选择集编码"
/>
<el-button
type="info"
plain
style="width: 40px"
@click="
opensearchTable(
'quantifyQuantifyCode',
null,
'选择集编码',
SelectedSet.allSchemas,
SelectedSetApi.getSelectedSetPage,
[
{
key: 'available',
value: 'TRUE',
isMainValue: false
}
],
false,
null,
item
)
"
v-if="item.inspectionCharacteristicsBaseVO.isCanUpdate"
><Icon icon="ep:search"
/></el-button>
</div>
</el-form-item>
<el-col :span="24" style="border: 1px solid #dedede ;border-radius: 4px ;padding-top: 16px;margin-bottom: 10px" v-for="(cur,i) in data.subList[index].inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList" :key="i">
<el-row>
<!-- 汇总录入的时候显示 -->
<el-col :span="12" v-if="item.inspectionJobCharacteristicsUpdateReqVO.resultEntryMethod == 1">
<el-form-item label="合格数量">
<el-input v-model="cur.qualifiedQuantity" placeholder="请输入合格数量"/>
</el-form-item>
</el-col>
<el-col :span="12" v-if="item.inspectionJobCharacteristicsUpdateReqVO.resultEntryMethod == 1">
<el-form-item label="不合格数量">
<el-input v-model="cur.unqualifiedQuantity" placeholder="请输入不合格数量"/>
</el-form-item>
</el-col>
<!-- 手动评估的时候显示 -->
<el-col :span="12" v-if="item.samplingProcessRespVO.evaluationMode == 1">
<el-form-item label="评估代码">
<el-select
v-model="cur.estimateCode"
placeholder="请选择评估代码"
@change="changeFeatureType">
<el-option v-for="dict in getStrDictOptions( DICT_TYPE.EVALUATION_CODE  )"
:key="dict.value"
:label="dict.label"
:value="dict.value"/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12" v-if="item.inspectionJobCharacteristicsUpdateReqVO.featureType == 0">
<el-form-item label="检验值" prop="inspectionValue">
<el-input v-model="cur.inspectionValue" placeholder="请输入检验值"/>
</el-form-item>
</el-col>
<el-col :span="12" v-if="item.inspectionJobCharacteristicsUpdateReqVO.featureType == 1">
<el-form-item label="选定集" prop="qualitativeCode">
<el-select
v-model="cur.qualitativeCode"
placeholder="请选择选定集"
@change="changeQualitativeCode($event,item,cur)">
<el-option v-for="dict in item.selectedProjectRespVOList"
:key="dict.dictionaryValue"
:label="dict.dictionaryLabel"
:value="dict.dictionaryValue"/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12" v-if="item.samplingProcessRespVO.evaluationMode == 1">
<el-form-item label="缺陷级别">
<el-select
v-model="cur.defectLevel"
placeholder="请选择缺陷级别"
disabled>
<el-option v-for="dict in getStrDictOptions(DICT_TYPE.DEFECT_LEVEL)"
:key="dict.value"
:label="dict.label"
:value="dict.value"/>
</el-select>
</el-form-item>
</el-col>
</el-row>
</el-col>
</el-row>
</el-form>
@ -450,6 +313,9 @@ import { DynamicRule } from '@/views/qms/basicDataManage/dynamicRule/dynamicRule
import * as SelectedSetApi from '@/api/qms/selectedSet' //
import { SelectedSet } from '@/views/qms/basicDataManage/selectedSet/selectedSet.data' //
const { proxy } = getCurrentInstance()
const message = useMessage() //
const props = defineProps({
@ -519,7 +385,7 @@ const data = ref({
effectiveDate: '',
expirationDate: '',
available: 'TRUE',
process: []
subList: []
})
const dialogVisibleName = ref(false)
@ -534,92 +400,54 @@ if (props.basicFormWidth) {
}
const rules = ref({
...props.rules,
'inspectionCharacteristicsBaseVO.description': [
'inspectionJobCharacteristicsUpdateReqVO.description': [
{ required: true, message: '请填写描述', trigger: ['blur', 'change'] }
],
'inspectionCharacteristicsBaseVO.inspectionMethodCode': [
'inspectionJobCharacteristicsUpdateReqVO.inspectionMethodCode': [
{ required: true, message: '请选择检验方法编码', trigger: 'blur' }
],
'inspectionCharacteristicsBaseVO.dynamicUpdateCode': [
'inspectionJobCharacteristicsUpdateReqVO.dynamicUpdateCode': [
{ required: true, message: '请选择采样过程编码', trigger: ['blur', 'change'] }
],
'inspectionCharacteristicsBaseVO.inspectionMethod': [
'inspectionJobCharacteristicsUpdateReqVO.inspectionMethod': [
{ required: true, message: '请选择动态修改规则编码', trigger: ['blur', 'change'] }
],
'inspectionCharacteristicsBaseVO.resultEntryMethod': [
'inspectionJobCharacteristicsUpdateReqVO.resultEntryMethod': [
{ required: true, message: '请选择结果录入方式', trigger: ['blur', 'change'] }
],
'inspectionCharacteristicsBaseVO.featureType': [
'inspectionJobCharacteristicsUpdateReqVO.featureType': [
{ required: true, message: '请选择特征类型', trigger: ['blur', 'change'] }
],
'inspectionCharacteristicsBaseVO.quantifyTarget': [
'inspectionJobCharacteristicsUpdateReqVO.quantifyTarget': [
{ required: true, message: '请输入目标值', trigger: 'blur' }
],
'inspectionCharacteristicsBaseVO.quantifyCapping': [
'inspectionJobCharacteristicsUpdateReqVO.quantifyCapping': [
{ required: true, message: '请输入上限值', trigger: 'blur' }
],
'inspectionCharacteristicsBaseVO.quantifyLowlimit': [
'inspectionJobCharacteristicsUpdateReqVO.quantifyLowlimit': [
{ required: true, message: '请输入下限值', trigger: 'blur' }
],
'inspectionCharacteristicsBaseVO.quantifyUom': [
'inspectionJobCharacteristicsUpdateReqVO.quantifyUom': [
{ required: true, message: '请选择计量单位', trigger: 'blur' }
],
'inspectionCharacteristicsBaseVO.quantifyDecimal': [
'inspectionJobCharacteristicsUpdateReqVO.quantifyDecimal': [
{ required: true, message: '请输入小数位', trigger: 'blur' }
],
'inspectionCharacteristicsBaseVO.quantifyQuantifyCode': [
{ required: true, message: '请输入选择集编码', trigger: 'blur' }
]
'inspectionJobCharacteristicsUpdateReqVO.quantifyQuantifyCode': [
{ required: true, message: '请输入选择集编码', trigger: 'change' }
],
'inspectionJobCharacteristicsUpdateReqVO.inspectionStartTime': [
{ required: true, message: '请输入选择开始时间', trigger: 'change'}
],
'inspectionJobCharacteristicsUpdateReqVO.inspectionEndTime': [
{ required: true, message: '请输入选择结束时间', trigger: 'blur' }
],
qualifiedQuantity: [
{ required: true, message: '请输入选择结束时间', trigger: 'blur' }
],
})
// const rules = ref({
// itemCode: [{ required: true, message: '', trigger: 'blur' }],
// version: [{ required: true, message: '', trigger: 'blur' }],
// testTypeCode: [{ required: true, message: '', trigger: ['blur', 'change'] }],
// programmeTemplateCode: [
// { required: true, message: '', trigger: ['blur', 'change'] }
// ],
// splitRule: [{ required: true, message: '', trigger: ['blur', 'change'] }],
// aql: [{ required: true, message: 'aql', trigger: ['blur', 'change'] }],
// inspectionLevel: [{ required: true, message: '', trigger: ['blur', 'change'] }],
// effectiveDate: [{ required: true, message: '', trigger: ['blur', 'change'] }],
// expirationDate: [{ required: true, message: '', trigger: ['blur', 'change'] }],
// 'inspectionCharacteristicsBaseVO.description': [
// { required: true, message: '', trigger: ['blur', 'change'] }
// ],
// 'inspectionCharacteristicsBaseVO.inspectionMethodCode': [
// { required: true, message: '', trigger: 'blur' }
// ],
// 'inspectionCharacteristicsBaseVO.dynamicUpdateCode': [
// { required: true, message: '', trigger: ['blur', 'change'] }
// ],
// 'inspectionCharacteristicsBaseVO.inspectionMethod': [
// { required: true, message: '', trigger: ['blur', 'change'] }
// ],
// 'inspectionCharacteristicsBaseVO.resultEntryMethod': [
// { required: true, message: '', trigger: ['blur', 'change'] }
// ],
// 'inspectionCharacteristicsBaseVO.featureType': [
// { required: true, message: '', trigger: ['blur', 'change'] }
// ],
// 'inspectionCharacteristicsBaseVO.quantifyTarget': [
// { required: true, message: '', trigger: 'blur' }
// ],
// 'inspectionCharacteristicsBaseVO.quantifyCapping': [
// { required: true, message: '', trigger: 'blur' }
// ],
// 'inspectionCharacteristicsBaseVO.quantifyLowlimit': [
// { required: true, message: '', trigger: 'blur' }
// ],
// 'inspectionCharacteristicsBaseVO.quantifyUom': [
// { required: true, message: '', trigger: 'blur' }
// ],
// 'inspectionCharacteristicsBaseVO.quantifyDecimal': [
// { required: true, message: '', trigger: 'blur' }
// ],
// 'inspectionCharacteristicsBaseVO.quantifyQuantifyCode': [
// { required: true, message: '', trigger: 'blur' }
// ]
// })
/** 打开弹窗 */
let tabIndex = 1
@ -633,37 +461,56 @@ const open = async (type: string, row?: any, masterParmas?: any, titleName?: any
formType.value = type
if (row) {
data.value = JSON.parse(JSON.stringify(row))
console.log(data.value)
let list = []
list = await InspectionJobDetailPageApi.getInspectionJobDetailList(row.id)
// if (row.inspectionSchemeJson) {
// list = JSON.parse(JSON.parse(row.inspectionSchemeJson))
// } else {
// list = await InspectionJobDetailPageApi.getListByTempleteCode(row.programmeTemplateCode)
// }
console.log(list)
console.log(typeof list)
list.forEach((item, index) => {
editableTabsValue.value = index + 1
item.name = index + 1
item.inspectionCharacteristicsBaseVO = item.inspectionJobCharacteristicsRespVO
item.inspectionJobCharacteristicsUpdateReqVO = item.inspectionJobCharacteristicsRespVO
item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList=[]
// rules.value['inspectionJobCharacteristicsUpdateReqVO.quantifyCapping'][0].required = true
if (item.inspectionJobCharacteristicsUpdateReqVO.resultEntryMethod==0) {
// rules.value['inspectionJobCharacteristicsUpdateReqVO.quantifyCapping'][0].required = true
for(let i=0;i<data.value.sampleTotalAmount;i++){
item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList.push({
inspectionValue:'',//
qualitativeCode:'',//
estimateCode:'',//
defectLevel:'',//
qualifiedQuantity:'',//
unqualifiedQuantity:'',//
})
}
} else {
// rules.value['inspectionJobCharacteristicsUpdateReqVO.quantifyCapping'][0].required = false
item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList=[{
inspectionValue:'',//
qualitativeCode:'',//
estimateCode:'',//
defectLevel:'',//
qualifiedQuantity:'',//
unqualifiedQuantity:'',//
}]
}
//
if (item.inspectionCharacteristicsBaseVO.quantifyIsCapping) {
rules.value['inspectionCharacteristicsBaseVO.quantifyCapping'][0].required = true
if (item.inspectionJobCharacteristicsUpdateReqVO.quantifyIsCapping) {
rules.value['inspectionJobCharacteristicsUpdateReqVO.quantifyCapping'][0].required = true
} else {
rules.value['inspectionCharacteristicsBaseVO.quantifyCapping'][0].required = false
rules.value['inspectionJobCharacteristicsUpdateReqVO.quantifyCapping'][0].required = false
}
if (item.inspectionCharacteristicsBaseVO.quantifyIsLowlimit) {
rules.value['inspectionCharacteristicsBaseVO.quantifyLowlimit'][0].required = true
if (item.inspectionJobCharacteristicsUpdateReqVO.quantifyIsLowlimit) {
rules.value['inspectionJobCharacteristicsUpdateReqVO.quantifyLowlimit'][0].required = true
} else {
rules.value['inspectionCharacteristicsBaseVO.quantifyLowlimit'][0].required = false
rules.value['inspectionJobCharacteristicsUpdateReqVO.quantifyLowlimit'][0].required = false
}
if (item.inspectionCharacteristicsBaseVO.quantifyIsTarget) {
rules.value['inspectionCharacteristicsBaseVO.quantifyTarget'][0].required = true
if (item.inspectionJobCharacteristicsUpdateReqVO.quantifyIsTarget) {
rules.value['inspectionJobCharacteristicsUpdateReqVO.quantifyTarget'][0].required = true
} else {
rules.value['inspectionCharacteristicsBaseVO.quantifyTarget'][0].required = false
rules.value['inspectionJobCharacteristicsUpdateReqVO.quantifyTarget'][0].required = false
}
})
data.value.process = list
data.value.subList = list
formMainRef.value.setValues(row)
} else {
data.value = {
@ -678,11 +525,11 @@ console.log(typeof list)
effectiveDate: '',
expirationDate: '',
available: 'TRUE',
process: []
subList: []
}
}
tabIndex = data.value.process.length + 1
tabIndex = data.value.subList.length + 1
}
defineExpose({ open, dialogVisible, formLoading }) // open
import type { TabPaneName } from 'element-plus'
@ -695,7 +542,7 @@ const handleTabsEdit = (targetName: TabPaneName | undefined, action: 'remove' |
nameForm.value.name = ''
dialogVisibleName.value = true
} else if (action === 'remove') {
const tabs = data.value.process
const tabs = data.value.subList
let activeName = editableTabsValue.value
if (activeName === targetName) {
tabs.forEach((tab, index) => {
@ -708,7 +555,7 @@ const handleTabsEdit = (targetName: TabPaneName | undefined, action: 'remove' |
})
}
editableTabsValue.value = activeName
data.value.process = tabs.filter((tab) => tab.name !== targetName)
data.value.subList = tabs.filter((tab) => tab.name !== targetName)
}
}
/** 修改名称时间 */
@ -719,13 +566,13 @@ const buttonBaseClick1 = (val) => {
nameRef.value.validate((valid, fields) => {
if (valid) {
const newTabName = `${++tabIndex}`
data.value.process.push({
data.value.subList.push({
description: nameForm.value.name,
name: newTabName,
inspectionCode: '',
sequenceCode: '',
inspectionCharCode: '',
inspectionJobCharacteristicsRespVO: {
inspectionJobCharacteristicsUpdateReqVO: {
describe: '',
inspectionMethodCode: '',
dynamicUpdateCode: '',
@ -745,7 +592,7 @@ const buttonBaseClick1 = (val) => {
quantifyQuantifyCode: ''
}
})
console.log(data.value.process)
console.log(data.value.subList)
editableTabsValue.value = newTabName
dialogVisibleName.value = false
@ -786,37 +633,59 @@ const validateForm = (formRef) => {
const submitForm = async () => {
try {
const validateForm1 = await validateForm(formProcessRef.value)
console.log(validateForm1)
await formMainRef.value.validate()
if (!data.value.process || data.value.process.length == 0) {
message.error(`请添加工序`)
return
}
const bol1 = await validateForm(formProcessRef.value)
const bol2 = await validateForm(formFeaturesRef.value)
if (!bol1 || !bol2) {
console.log(data.value.subList)
// const validateForm1 = await validateForm(formMainRef.value)
const elForm = unref(formMainRef)?.getElFormRef()
//
if (!elForm) return
const valid = await elForm.validate()
if (!valid) return
// const bol1 = await validateForm(formProcessRef.value)
const bol2 = await validateForm(formFeaturesRef.value)
if (!bol2) {
message.error(`模板中有检验工序和检验特性未填写完全`)
return
}
const arr = data.value.process.filter(
(item) =>
!item.inspectionCharacteristicsBaseVO.quantifyIsCapping &&
!item.inspectionCharacteristicsBaseVO.quantifyIsLowlimit &&
!item.inspectionCharacteristicsBaseVO.quantifyIsTarget &&
item.inspectionCharacteristicsBaseVO.featureType == 0
)
console.log(arr)
if (arr && arr.length > 0) {
const str = arr.map((item) => item.description).join(',')
message.error(`${str}是否设定上线,是否设定下限,是否是定目标值至少一项为是`)
return
}
//
let arrBol = data.value.subList.map((item, index) => {
let arr1 = []
if(item.inspectionJobCharacteristicsUpdateReqVO.resultEntryMethod == 1){
arr1.push(item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList.some((cur,key) =>{
return !cur.qualifiedQuantity || !cur.unqualifiedQuantity
}))
}
if(item.samplingProcessRespVO.evaluationMode == 1){
arr1.push(item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList.some((cur,key) =>{
return !cur.estimateCode ||!cur.defectLevel
}))
}
if(item.inspectionJobCharacteristicsUpdateReqVO.featureType == 0){
arr1.push( item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList.some((cur,key) =>{
return !cur.inspectionValue
}))
}
if(item.inspectionJobCharacteristicsUpdateReqVO.featureType == 1){
arr1.push(item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList.some((cur,key) =>{
return !cur.qualitativeCode
}))
}
return arr1
})
// console.log(arrBol)
// let isEmpty1 = arrBol.filter(item=>item == true)
// arrBol.forEach(item=>{
// console.log('1q1q')
// console.log(typeof item)
// })
// setTimeout(()=>{
// console.log(arrBol.includes(true))
// },2000)
if (formType.value == 'create') {
//
emit('submitForm', formType.value, data.value)
} else {
//
// /
emit('submitForm', formType.value, data.value)
}
} catch {
@ -837,9 +706,9 @@ if (props.footButttondata) {
const changeFeatureType = (e) => {
console.log(e)
// if (e) {
// rules.value['inspectionCharacteristicsBaseVO.quantifyQuantifyCode'][0].required = true
// rules.value['inspectionJobCharacteristicsUpdateReqVO.quantifyQuantifyCode'][0].required = true
// } else {
// rules.value['inspectionCharacteristicsBaseVO.quantifyQuantifyCode'][0].required = false
// rules.value['inspectionJobCharacteristicsUpdateReqVO.quantifyQuantifyCode'][0].required = false
// }
}
const searchTableRef = ref()
@ -921,13 +790,13 @@ const opensearchTable = (
// val row
const searchTableSuccess = async (formField, searchField, val, type, row) => {
if(type == 'features'){
row.inspectionCharacteristicsBaseVO[formField] = val[0].code
row.inspectionJobCharacteristicsUpdateReqVO[formField] = val[0].code
if(formField == 'inspectionMethodCode'){
row.inspectionCharacteristicsBaseVO.inspectionMethodName = val[0].description
row.inspectionJobCharacteristicsUpdateReqVO.inspectionMethodName = val[0].description
}else if(formField == 'dynamicUpdateCode'){
row.inspectionCharacteristicsBaseVO.dynamicUpdateName = val[0].description
row.inspectionJobCharacteristicsUpdateReqVO.dynamicUpdateName = val[0].description
}else if(formField == 'inspectionMethod'){
row.inspectionCharacteristicsBaseVO.inspectionName = val[0].description
row.inspectionJobCharacteristicsUpdateReqVO.inspectionName = val[0].description
}
} else if(type == 'main'){
data.value[formField] = val[0].code
@ -944,51 +813,61 @@ const searchTableSuccess = async (formField, searchField, val, type, row) => {
editableTabsValue.value = index + 1
item.name = index + 1
//
if (item.inspectionCharacteristicsBaseVO.quantifyIsCapping) {
rules.value['inspectionCharacteristicsBaseVO.quantifyCapping'][0].required = true
if (item.inspectionJobCharacteristicsUpdateReqVO.quantifyIsCapping) {
rules.value['inspectionJobCharacteristicsUpdateReqVO.quantifyCapping'][0].required = true
} else {
rules.value['inspectionCharacteristicsBaseVO.quantifyCapping'][0].required = false
rules.value['inspectionJobCharacteristicsUpdateReqVO.quantifyCapping'][0].required = false
}
if (item.inspectionCharacteristicsBaseVO.quantifyIsLowlimit) {
rules.value['inspectionCharacteristicsBaseVO.quantifyLowlimit'][0].required = true
if (item.inspectionJobCharacteristicsUpdateReqVO.quantifyIsLowlimit) {
rules.value['inspectionJobCharacteristicsUpdateReqVO.quantifyLowlimit'][0].required = true
} else {
rules.value['inspectionCharacteristicsBaseVO.quantifyLowlimit'][0].required = false
rules.value['inspectionJobCharacteristicsUpdateReqVO.quantifyLowlimit'][0].required = false
}
if (item.inspectionCharacteristicsBaseVO.quantifyIsTarget) {
rules.value['inspectionCharacteristicsBaseVO.quantifyTarget'][0].required = true
if (item.inspectionJobCharacteristicsUpdateReqVO.quantifyIsTarget) {
rules.value['inspectionJobCharacteristicsUpdateReqVO.quantifyTarget'][0].required = true
} else {
rules.value['inspectionCharacteristicsBaseVO.quantifyTarget'][0].required = false
rules.value['inspectionJobCharacteristicsUpdateReqVO.quantifyTarget'][0].required = false
}
})
data.value.process = list
data.value.subList = list
}
}
// emit('searchTableSuccess', formField, searchField, val, formRef.value, type, row)
}
//
const changeIsCapping = (e) => {
if (e) {
rules.value['inspectionCharacteristicsBaseVO.quantifyCapping'][0].required = true
} else {
rules.value['inspectionCharacteristicsBaseVO.quantifyCapping'][0].required = false
}
}
//
const changeLowlimit = (e) => {
if (e) {
rules.value['inspectionCharacteristicsBaseVO.quantifyLowlimit'][0].required = true
//
const resultEntryMethodChange = (e,item) => {
item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList =[]
if (e==0) {
// rules.value['inspectionJobCharacteristicsUpdateReqVO.quantifyCapping'][0].required = true
for(let i=0;i<data.value.sampleTotalAmount;i++){
item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList.push({
inspectionValue:'',//
qualitativeCode:'',//
estimateCode:'',//
defectLevel:'',//
qualifiedQuantity:'',//
unqualifiedQuantity:'',//
})
}
} else {
rules.value['inspectionCharacteristicsBaseVO.quantifyLowlimit'][0].required = false
// rules.value['inspectionJobCharacteristicsUpdateReqVO.quantifyCapping'][0].required = false
item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList=[{
inspectionValue:'',//
qualitativeCode:'',//
estimateCode:'',//
defectLevel:'',//
qualifiedQuantity:'',//
unqualifiedQuantity:'',//
}]
}
console.log(222,item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList)
}
//
const changeIsTarget = (e) => {
if (e) {
rules.value['inspectionCharacteristicsBaseVO.quantifyTarget'][0].required = true
} else {
rules.value['inspectionCharacteristicsBaseVO.quantifyTarget'][0].required = false
}
//
const changeQualitativeCode= (e,item,cur)=>{
let obj = item.selectedProjectRespVOList.find(cur=>cur.dictionaryValue==e)
console.log(obj)
cur.defectLevel = obj.defectLevel
}
</script>
<style scoped>

310
src/views/qms/inspection/inspectionJob/detail.vue

@ -0,0 +1,310 @@
<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 v-if="!isBasic">
<Descriptions
:data="data"
labelClassName="label-class-name"
label-align="left"
direction="vertical"
:column="8"
:schema="allSchemas.detailSchema"
:columns="2"
width="200px"
/>
</ContentWrap>
<ContentWrap>
<el-tabs
v-model="editableTabsValue"
class="demo-tabs"
type="border-card"
tab-position="left"
:stretch="false"
>
<el-tab-pane
v-for="item in data.subList"
:key="item.name"
:label="item.processCode"
:name="item.name"
>
<div class="small-title">检验工序</div>
<el-form :model="item" label-width="auto" ref="formProcessRef">
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="编码" prop="processCode">
<el-input v-model="item.processCode" placeholder="根据系统生成" :disabled="true" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="检验方案模板编码">
<el-input
v-model="item.inspectionCode"
placeholder="根据系统生成"
:disabled="true"
/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="描述" prop="processDescribe">
<el-input v-model="item.processDescribe" :disabled="true" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="顺序号" prop="sequenceCode">
<el-input v-model="item.sequenceCode" :disabled="true" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="检验特性编码">
<el-input
v-model="item.inspectionCharCode"
placeholder="根据系统生成"
:disabled="true"
/>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div class="small-title">检验特性</div>
<el-form :model="item" label-width="auto" ref="formFeaturesRef">
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="编码">
<el-input
v-model="item.inspectionJobCharacteristicsRespVO.number"
placeholder="根据系统生成"
:disabled="true"
/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="描述" prop="inspectionJobCharacteristicsRespVO.description">
<el-input v-model="item.inspectionJobCharacteristicsRespVO.description" :disabled="true" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item
label="检验方法"
prop="inspectionJobCharacteristicsRespVO.inspectionMethodCode"
>
<div style="display: flex; width: 100%">
<el-input
v-model="item.inspectionJobCharacteristicsRespVO.inspectionMethodName"
disabled
placeholder="请选择检验方法"
/>
</div>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item
label="采样过程编码"
prop="inspectionJobCharacteristicsRespVO.inspectionMethod"
>
<div style="display: flex; width: 100%">
<el-input
v-model="item.inspectionJobCharacteristicsRespVO.inspectionName"
disabled
placeholder="请选择采样过程编码"
/>
</div>
</el-form-item>
</el-col>
<!-- <el-col :span="12">
<el-form-item
label="动态修改规则编码"
prop="inspectionJobCharacteristicsRespVO.dynamicUpdateCode"
>
<div style="display: flex; width: 100%">
<el-input
v-model="item.inspectionJobCharacteristicsRespVO.dynamicUpdateName"
disabled
placeholder="请选择动态修改规则编码"
/>
</div>
</el-form-item>
</el-col> -->
<el-col :span="12">
<el-form-item
label="是否允许修改特征值"
prop="inspectionJobCharacteristicsRespVO.isCanUpdate"
>
<el-switch
v-model="item.inspectionJobCharacteristicsRespVO.isCanUpdate"
disabled
/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item
label="结果录入方式"
prop="inspectionJobCharacteristicsRespVO.resultEntryMethod"
>
<el-select
v-model="item.inspectionJobCharacteristicsRespVO.resultEntryMethod"
placeholder="请选择结果录入方式"
@change="resultEntryMethodChange($event,item)"
disabled
>
<el-option
v-for="dict in getStrDictOptions(
DICT_TYPE.INSPECTION_CHARACTERISTICS_RESULT_ENTRY
)"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="特征类型" prop="inspectionJobCharacteristicsRespVO.featureType">
<el-select
v-model="item.inspectionJobCharacteristicsRespVO.featureType"
placeholder="请选择特征类型"
@change="changeFeatureType"
disabled
>
<el-option v-for="dict in getStrDictOptions( DICT_TYPE.INSPECTION_CHARACTERISTICS_FEATURE_TYPE )"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="开始时间" prop="inspectionJobCharacteristicsRespVO.inspectionStartTime">
<el-date-picker
v-model="item.inspectionJobCharacteristicsRespVO.inspectionStartTime"
type="datetime"
placeholder="请选择开始时间"
style="width: 100%"
value-format="x"
disabled
/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="结束时间" prop="inspectionJobCharacteristicsRespVO.inspectionEndTime">
<el-date-picker
v-model="item.inspectionJobCharacteristicsRespVO.inspectionEndTime"
type="datetime"
placeholder="请选择结束时间"
style="width: 100%"
value-format="x"
disabled
/>
</el-form-item>
</el-col>
</el-row>
</el-form>
</el-tab-pane>
</el-tabs>
</ContentWrap>
</el-drawer>
</div>
</template>
<script lang="ts" setup>
import * as InspectionJobDetailPageApi from '@/api/qms/inspectionJob/inspectionJobDetail'
import { DICT_TYPE, getStrDictOptions } from '@/utils/dict'
defineOptions({ name: 'Detail' })
const editableTabsValue = ref('1')
const message = useMessage() //
const { t } = useI18n() //
const updateKey = ref(0)
const props = defineProps({
//
allSchemas: {
type: Object,
required: true,
default: null
},
//
detailAllSchemas: {
type: Object,
required: true,
default: null
},
//
buttondataTable: {
type: Array,
required: false,
default: ()=>{
return []
}
},
})
const isShowDrawer = ref(false)
const detailLoading = ref(false)
const data = ref({
code: '',
itemCode: '',
version: '',
testTypeCode: '',
programmeTemplateCode: '',
splitRule: '',
aql: '',
inspectionLevel: '',
effectiveDate: '',
expirationDate: '',
available: 'TRUE',
subList: []
})
/** 打开弹窗 */
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 {
data.value = row
let list = []
list = await InspectionJobDetailPageApi.getInspectionJobDetailList(row.id)
list.forEach((item, index) => {
editableTabsValue.value = index + 1
item.name = index + 1
})
data.value.subList = list
} finally {
detailLoading.value = false
}
}
}
defineExpose({ openDetail }) // open
</script>
<style lang="scss">
.el-drawer__body {
background: #f5f5f5 !important;
}
::v-deep(.label-class-name) {
color: #dedede;
}
</style>
<style scoped lang="scss"></style>

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

@ -39,18 +39,27 @@
:formAllSchemasFeatures="InspectionTemplateFeatures.allSchemas"
:formAllSchemasProcess="InspectionTemplateProcess.allSchemas"
:formAllSchemasMain="InspectionTemplateMain.allSchemas"
:rules="InspectionTemplateRules"
:rules="InspectionJobMainRules"
:formAllSchemas="InspectionJobMain.allSchemas"
@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"
/>
<!-- 详情 -->
<Detail ref="detailRef" :isBasic="false" :allSchemas="InspectionJobMain.allSchemas"
<!-- <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" />
:isShowAddBtn="false" :detailButtonIsShow="true"/> -->
<!-- 导入 -->
<ImportForm ref="importFormRef" url="/wms/purchase-main/import" :importTemplateData="importTemplateData"
@ -68,6 +77,7 @@
import TableHead from '@/components/TableHead/src/TableHead.vue'
import ImportForm from '@/components/ImportForm/src/ImportForm.vue'
import AddForm from './addForm.vue'
import Detail from './detail.vue'
import * as InspectionPlanApi from '@/api/qms/inspectionPlan'
//
@ -131,7 +141,7 @@
//
const HeadButttondata = [
// defaultButtons.defaultAddBtn(null), //
defaultButtons.defaultExportBtn(null), //
// defaultButtons.defaultExportBtn(null), //
defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), //
@ -183,7 +193,7 @@
// -
const buttonTableClick = async (val, row) => {
if (val == 'mainJobExe') { //
execute('update', row)
execute('execute', row)
}
else if (val == 'mainJobClo') { //
handleDelete(row.id)
@ -230,7 +240,7 @@
//
exportLoading.value = true
const data = await InspectionJobMainApi.exportInspectionJobMain(tableObject.params)
download.excel(data, '备件申领记录主.xlsx')
download.excel(data, '检验任务.xlsx')
} catch {
} finally {
exportLoading.value = false
@ -257,13 +267,14 @@
//
const submitForm = async (formType, data) => {
data.subList = tableData.value //
console.log(data)
// return
try {
if (formType === 'create') {
await InspectionJobMainApi.createInspectionJobMain(data)
message.success(t('common.createSuccess'))
} else {
await InspectionJobMainApi.updateInspectionJobMain(data)
} else if(formType === 'execute') {
await InspectionJobMainApi.executeInspectionJobMain(data)
message.success(t('common.updateSuccess'))
}
formRef.value.dialogVisible = false

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

@ -3,6 +3,16 @@ import { dateFormatter2 } from '@/utils/formatTime'
import { validateHanset, validateEmail } from '@/utils/validator'
import { dateFormatter } from '@/utils/formatTime'
const { t } = useI18n() // 国际化
import { DICT_TYPE, getStrDictOptions } from '@/utils/dict'
const resultEntryMethodList = getStrDictOptions(DICT_TYPE.INSPECTION_CHARACTERISTICS_RESULT_ENTRY)
const featureTypeList = getStrDictOptions( DICT_TYPE.INSPECTION_CHARACTERISTICS_FEATURE_TYPE )
const isCanUpdateList = [{
label:'是',
value:true
},{
label:'否',
value:false
}]
/**
* @returns {Array}
@ -13,36 +23,66 @@ export const InspectionJobMain = useCrudSchemas(reactive<CrudSchema[]>([
field: 'number',
sort: 'custom',
isSearch: true,
form: {
componentProps:{
disabled:true
}
},
},
{
label: '申请单号',
field: 'requestNumber',
sort: 'custom',
isSearch: true,
form: {
componentProps:{
disabled:true
}
},
},
{
label: '供应商编码',
field: 'supplierCode',
sort: 'custom',
isSearch: true,
form: {
componentProps:{
disabled:true
}
},
},
{
label: '物料编码',
field: 'materialCode',
sort: 'custom',
isSearch: true,
form: {
componentProps:{
disabled:true
}
},
},
{
label: '物料批次',
field: 'materialBatch',
sort: 'custom',
isSearch: false,
form: {
componentProps:{
disabled:true
}
},
},
{
label: '订单号',
field: 'orderCode',
sort: 'custom',
isSearch: false,
form: {
componentProps:{
disabled:true
}
},
},
{
label: '订单行',
@ -51,7 +91,10 @@ export const InspectionJobMain = useCrudSchemas(reactive<CrudSchema[]>([
isSearch: false,
form: {
component: 'InputNumber',
value: 0
value: 0,
componentProps:{
disabled:true
}
},
},
{
@ -59,6 +102,11 @@ export const InspectionJobMain = useCrudSchemas(reactive<CrudSchema[]>([
field: 'certificateCode',
sort: 'custom',
isSearch: false,
form: {
componentProps:{
disabled:true
}
},
},
{
label: '凭证行',
@ -67,7 +115,10 @@ export const InspectionJobMain = useCrudSchemas(reactive<CrudSchema[]>([
isSearch: false,
form: {
component: 'InputNumber',
value: 0
value: 0,
componentProps:{
disabled:true
}
},
},
{
@ -75,6 +126,11 @@ export const InspectionJobMain = useCrudSchemas(reactive<CrudSchema[]>([
field: 'inspectionSchemeCode',
sort: 'custom',
isSearch: false,
form: {
componentProps:{
disabled:true
}
},
},
// {
// label: '检验方案Json',
@ -87,26 +143,46 @@ export const InspectionJobMain = useCrudSchemas(reactive<CrudSchema[]>([
field: 'inspectionBatch',
sort: 'custom',
isSearch: false,
form: {
componentProps:{
disabled:true
}
},
},
{
label: '检验批数量',
field: 'inspectionBatchAmount',
sort: 'custom',
isSearch: false,
form: {
componentProps:{
disabled:true
}
},
},
{
label: '采样总数量',
field: 'sampleTatalAmount',
sort: 'custom',
isSearch: false,
form: {
componentProps:{
disabled:true
}
},
},
{
label: '检验类型',
field: 'inspectionType',
sort: 'custom',
isSearch: false,
dictType: DICT_TYPE.INSPECTION_TYPE,
dictClass: 'string',
form: {
component: 'Select'
component: 'Select',
componentProps:{
disabled:true
}
},
},
{
@ -114,6 +190,13 @@ export const InspectionJobMain = useCrudSchemas(reactive<CrudSchema[]>([
field: 'inspectionBatchSource',
sort: 'custom',
isSearch: false,
dictType: DICT_TYPE.INSPECTION_BATCH_SOURCE,
dictClass: 'string',
form:{
componentProps:{
disabled:true
}
}
},
{
label: '检验阶段',
@ -122,7 +205,10 @@ export const InspectionJobMain = useCrudSchemas(reactive<CrudSchema[]>([
isSearch: false,
form: {
component: 'InputNumber',
value: 0
value: 0,
componentProps:{
disabled:true
}
},
},
{
@ -130,18 +216,35 @@ export const InspectionJobMain = useCrudSchemas(reactive<CrudSchema[]>([
field: 'inspectionStringency',
sort: 'custom',
isSearch: false,
dictType: DICT_TYPE.INSPECTION_SEVERITY,
dictClass: 'string',
form:{
componentProps:{
disabled:true
}
}
},
{
label: '检验任务包装列表',
field: 'inspectionTaskPackageCode',
sort: 'custom',
isSearch: false,
form:{
componentProps:{
disabled:true
}
}
},
{
label: '检验任务工序列表',
field: 'inspectionTaskProcessCode',
sort: 'custom',
isSearch: false,
form:{
componentProps:{
disabled:true
}
}
},
{
label: '计划开始时间',
@ -161,7 +264,8 @@ export const InspectionJobMain = useCrudSchemas(reactive<CrudSchema[]>([
component: 'DatePicker',
componentProps: {
type: 'datetime',
valueFormat: 'x'
valueFormat: 'x',
disabled:true
}
},
},
@ -183,7 +287,8 @@ export const InspectionJobMain = useCrudSchemas(reactive<CrudSchema[]>([
component: 'DatePicker',
componentProps: {
type: 'datetime',
valueFormat: 'x'
valueFormat: 'x',
disabled:true
}
},
},
@ -192,18 +297,57 @@ export const InspectionJobMain = useCrudSchemas(reactive<CrudSchema[]>([
field: 'inspectionLevel',
sort: 'custom',
isSearch: false,
dictType: DICT_TYPE.INSPECTION_LEVEL,
dictClass: 'string',
form:{
componentProps:{
disabled:true
}
}
},
{
label: 'AQL值',
field: 'aqlValue',
sort: 'custom',
isSearch: false,
dictType: DICT_TYPE.BASIC_AQL,
dictClass: 'string',
form:{
componentProps:{
disabled:true
}
}
},
{
label: '使用决策',
field: 'usageDecision',
sort: 'custom',
isSearch: false,
dictType: DICT_TYPE.USAGE_DECISION,
form:{
componentProps:{
}
}
},
{
label: '是否可用',
field: 'available',
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string',
isTable: true,
sort: 'custom',
isSearch: false,
table: {
width: 150
},
form: {
component: 'Switch',
value: 'TRUE',
componentProps: {
inactiveValue: 'FALSE',
activeValue: 'TRUE',
disabled:true
}
},
},
{
label: '操作',
@ -219,24 +363,7 @@ export const InspectionJobMain = useCrudSchemas(reactive<CrudSchema[]>([
//表单校验
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],
usageDecision: [required],
})
/**
@ -244,25 +371,19 @@ export const InspectionJobMainRules = reactive({
*/
export const InspectionJobDetail = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '单据号',
label: '编码',
field: 'number',
sort: 'custom',
isSearch: true,
},
{
label: '任务编码',
field: 'taskCode',
label: '检验方案模板编码',
field: 'inspectionCode',
sort: 'custom',
isSearch: true,
},
{
label: '工序编码',
field: 'processCode',
sort: 'custom',
isSearch: true,
},
{
label: '工序描述',
label: '描述',
field: 'processDescribe',
sort: 'custom',
isSearch: true,
@ -279,26 +400,54 @@ export const InspectionJobDetail = useCrudSchemas(reactive<CrudSchema[]>([
},
{
label: '检验特性编号',
field: 'inspectionFeatureCode',
field: 'inspectionCharCode',
sort: 'custom',
isSearch: true,
},
{
label: '是否可用',
field: 'available',
label: '检验特性编码',
field: 'inspectionJobCharacteristicsRespVO.number',
sort: 'custom',
isSearch: true,
},
{
label: '操作',
field: 'action',
isDetail: false,
isForm: false,
table: {
width: 150,
fixed: 'right'
label: '检验特性描述',
field: 'inspectionJobCharacteristicsRespVO.description',
sort: 'custom',
},{
label: '检验方法',
field: 'inspectionJobCharacteristicsRespVO.inspectionMethodName',
sort: 'custom',
},{
label: '采样过程编码',
field: 'inspectionJobCharacteristicsRespVO.inspectionMethod',
sort: 'custom',
},{
label: '动态修改规则编码',
field: 'inspectionJobCharacteristicsRespVO.dynamicUpdateCode',
sort: 'custom',
},{
label: '是否允许修改特征值',
field: 'inspectionJobCharacteristicsRespVO.isCanUpdate',
sort: 'custom',
formatter: (_: Recordable, __: TableColumn, cellValue: number) => {
return isCanUpdateList.find((account) => account.value == cellValue)?.label
},
},{
label: '结果录入方式',
field: 'inspectionJobCharacteristicsRespVO.resultEntryMethod',
sort: 'custom',
// dictType: DICT_TYPE.INSPECTION_CHARACTERISTICS_RESULT_ENTRY,
// dictClass: 'string',
formatter: (_: Recordable, __: TableColumn, cellValue: number) => {
return resultEntryMethodList.find((account) => account.value == cellValue)?.label
},
},{
label: '特征类型',
field: 'inspectionJobCharacteristicsRespVO.featureType',
sort: 'custom',
formatter: (_: Recordable, __: TableColumn, cellValue: number) => {
return featureTypeList.find((account) => account.value == cellValue)?.label
},
isTableForm: false,
}
]))

310
src/views/qms/inspection/inspectionRecord/detail.vue

@ -0,0 +1,310 @@
<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 v-if="!isBasic">
<Descriptions
:data="data"
labelClassName="label-class-name"
label-align="left"
direction="vertical"
:column="8"
:schema="allSchemas.detailSchema"
:columns="2"
width="200px"
/>
</ContentWrap>
<ContentWrap>
<el-tabs
v-model="editableTabsValue"
class="demo-tabs"
type="border-card"
tab-position="left"
:stretch="false"
>
<el-tab-pane
v-for="item in data.subList"
:key="item.name"
:label="item.processCode"
:name="item.name"
>
<div class="small-title">检验工序</div>
<el-form :model="item" label-width="auto" ref="formProcessRef">
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="编码" prop="processCode">
<el-input v-model="item.processCode" placeholder="根据系统生成" :disabled="true" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="检验方案模板编码">
<el-input
v-model="item.inspectionCode"
placeholder="根据系统生成"
:disabled="true"
/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="描述" prop="processDescribe">
<el-input v-model="item.processDescribe" :disabled="true" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="顺序号" prop="sequenceCode">
<el-input v-model="item.sequenceCode" :disabled="true" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="检验特性编码">
<el-input
v-model="item.inspectionCharCode"
placeholder="根据系统生成"
:disabled="true"
/>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div class="small-title">检验特性</div>
<el-form :model="item" label-width="auto" ref="formFeaturesRef">
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="编码">
<el-input
v-model="item.inspectionJobCharacteristicsRespVO.number"
placeholder="根据系统生成"
:disabled="true"
/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="描述" prop="inspectionJobCharacteristicsRespVO.description">
<el-input v-model="item.inspectionJobCharacteristicsRespVO.description" :disabled="true" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item
label="检验方法"
prop="inspectionJobCharacteristicsRespVO.inspectionMethodCode"
>
<div style="display: flex; width: 100%">
<el-input
v-model="item.inspectionJobCharacteristicsRespVO.inspectionMethodName"
disabled
placeholder="请选择检验方法"
/>
</div>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item
label="采样过程编码"
prop="inspectionJobCharacteristicsRespVO.inspectionMethod"
>
<div style="display: flex; width: 100%">
<el-input
v-model="item.inspectionJobCharacteristicsRespVO.inspectionName"
disabled
placeholder="请选择采样过程编码"
/>
</div>
</el-form-item>
</el-col>
<!-- <el-col :span="12">
<el-form-item
label="动态修改规则编码"
prop="inspectionJobCharacteristicsRespVO.dynamicUpdateCode"
>
<div style="display: flex; width: 100%">
<el-input
v-model="item.inspectionJobCharacteristicsRespVO.dynamicUpdateName"
disabled
placeholder="请选择动态修改规则编码"
/>
</div>
</el-form-item>
</el-col> -->
<el-col :span="12">
<el-form-item
label="是否允许修改特征值"
prop="inspectionJobCharacteristicsRespVO.isCanUpdate"
>
<el-switch
v-model="item.inspectionJobCharacteristicsRespVO.isCanUpdate"
disabled
/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item
label="结果录入方式"
prop="inspectionJobCharacteristicsRespVO.resultEntryMethod"
>
<el-select
v-model="item.inspectionJobCharacteristicsRespVO.resultEntryMethod"
placeholder="请选择结果录入方式"
@change="resultEntryMethodChange($event,item)"
disabled
>
<el-option
v-for="dict in getStrDictOptions(
DICT_TYPE.INSPECTION_CHARACTERISTICS_RESULT_ENTRY
)"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="特征类型" prop="inspectionJobCharacteristicsRespVO.featureType">
<el-select
v-model="item.inspectionJobCharacteristicsRespVO.featureType"
placeholder="请选择特征类型"
@change="changeFeatureType"
disabled
>
<el-option v-for="dict in getStrDictOptions( DICT_TYPE.INSPECTION_CHARACTERISTICS_FEATURE_TYPE )"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="开始时间" prop="inspectionJobCharacteristicsRespVO.inspectionStartTime">
<el-date-picker
v-model="item.inspectionJobCharacteristicsRespVO.inspectionStartTime"
type="datetime"
placeholder="请选择开始时间"
style="width: 100%"
value-format="x"
disabled
/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="结束时间" prop="inspectionJobCharacteristicsRespVO.inspectionEndTime">
<el-date-picker
v-model="item.inspectionJobCharacteristicsRespVO.inspectionEndTime"
type="datetime"
placeholder="请选择结束时间"
style="width: 100%"
value-format="x"
disabled
/>
</el-form-item>
</el-col>
</el-row>
</el-form>
</el-tab-pane>
</el-tabs>
</ContentWrap>
</el-drawer>
</div>
</template>
<script lang="ts" setup>
import * as InspectionRecordDetailPageApi from '@/api/qms/inspectionRecord/inspectionRecordDetail'
import { DICT_TYPE, getStrDictOptions } from '@/utils/dict'
defineOptions({ name: 'InspectionRecordDetail' })
const editableTabsValue = ref('1')
const message = useMessage() //
const { t } = useI18n() //
const updateKey = ref(0)
const props = defineProps({
//
allSchemas: {
type: Object,
required: true,
default: null
},
//
detailAllSchemas: {
type: Object,
required: true,
default: null
},
//
buttondataTable: {
type: Array,
required: false,
default: ()=>{
return []
}
},
})
const isShowDrawer = ref(false)
const detailLoading = ref(false)
const data = ref({
code: '',
itemCode: '',
version: '',
testTypeCode: '',
programmeTemplateCode: '',
splitRule: '',
aql: '',
inspectionLevel: '',
effectiveDate: '',
expirationDate: '',
available: 'TRUE',
subList: []
})
/** 打开弹窗 */
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 {
data.value = row
let list = []
list = await InspectionRecordDetailPageApi.getInspectionRecordDetailList(row.id)
list.forEach((item, index) => {
editableTabsValue.value = index + 1
item.name = index + 1
})
data.value.subList = list
} finally {
detailLoading.value = false
}
}
}
defineExpose({ openDetail }) // open
</script>
<style lang="scss">
.el-drawer__body {
background: #f5f5f5 !important;
}
::v-deep(.label-class-name) {
color: #dedede;
}
</style>
<style scoped lang="scss"></style>

18
src/views/qms/inspection/inspectionRecord/index.vue

@ -35,17 +35,23 @@
@handleDeleteTable="handleDeleteTable" @searchTableSuccess="searchTableSuccess" @submitForm="submitForm" />
<!-- 详情 -->
<Detail ref="detailRef" :isBasic="false" :allSchemas="InspectionRecordMain.allSchemas"
<!-- <Detail ref="detailRef" :isBasic="false" :allSchemas="InspectionRecordMain.allSchemas"
:detailAllSchemas="InspectionRecordDetail.allSchemas" :detailAllSchemasRules="InspectionRecordDetailRules"
:apiCreate="InspectionRecordDetailApi.createInspectionRecordDetail"
:apiUpdate="InspectionRecordDetailApi.updateInspectionRecordDetail"
:apiPage="InspectionRecordDetailApi.getInspectionRecordDetailPage"
:apiDelete="InspectionRecordDetailApi.deleteInspectionRecordDetail"
@searchTableSuccessDetail="searchTableSuccessDetail" :isShowAddBtn="false" :detailButtonIsShow="true" />
@searchTableSuccessDetail="searchTableSuccessDetail" :isShowAddBtn="false" :detailButtonIsShow="true" /> -->
<Detail
ref="detailRef" :isBasic="false" :allSchemas="InspectionRecordMain.allSchemas"
:detailAllSchemas="InspectionRecordDetail.allSchemas" :detailAllSchemasRules="InspectionRecordDetailRules"
:apiCreate="InspectionRecordDetailApi.createInspectionRecordDetail"
:apiUpdate="InspectionRecordDetailApi.updateInspectionRecordDetail"
:apiPage="InspectionRecordDetailApi.getInspectionRecordDetailPage"
:apiDelete="InspectionRecordDetailApi.deleteInspectionRecordDetail" @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">
@ -55,7 +61,7 @@
import * as InspectionRecordDetailApi from '@/api/qms/inspectionRecord/inspectionRecordDetail'
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 './detail.vue'
//
defineOptions({ name: 'InspectionRecordMain' })

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

@ -42,6 +42,13 @@
<BasicForm
ref="basicFormRef"
@success="formsSuccess"
:sumFormDataByForm ="(formRef,formModel)=>{
console.log(formModel)
const {videoAddress} = formModel
formRef.value.setValues({
installPackageUrl:videoAddress
})
}"
:rules="InspectionMethodRules"
:formAllSchemas="InspectionMethod.allSchemas"
:apiUpdate="InspectionMethodApi.updateInspectionMethod"
@ -149,26 +156,48 @@ const buttonTableClick = async (val, row) => {
/** 添加/修改操作 */
const basicFormRef = ref()
const openForm = (type: string, row?: any) => {
// debugger
console.log(row)
if(row && row.videoAddress.trim()){
row.filePathList = row.videoAddress.split(',')
}
if (row && row.filePathList && row.filePathList.length > 0) {
row.filePathListView = row.filePathList.map((item) => {
return {
name: item,
url: item
}
})
}
if(type=='create'){
const currentTime = new Date().getTime()
const fileId = InspectionMethod.allSchemas.formSchema.find(item=>item.field=='fileId')
const uploadFile = InspectionMethod.allSchemas.formSchema.find(item=>item.field=='videoAddress')
if(fileId){
fileId['value'] = currentTime
}
if(uploadFile){
uploadFile['componentProps']['upData']['tableId'] = currentTime
uploadFile['componentProps']['modelValue']= []
}
}else if(type=='update'){
const uploadFile = InspectionMethod.allSchemas.formSchema.find(item=>item.field=='videoAddress')
uploadFile['componentProps']['modelValue']= row.filePathListView
}
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') {
delete data['uploadFile']
await InspectionMethodApi.createInspectionMethod(data)
message.success(t('common.createSuccess'))
} else {
// debugger
await InspectionMethodApi.updateInspectionMethod(data)
message.success(t('common.updateSuccess'))
}

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

@ -5,6 +5,7 @@ import { dateFormatter } from '@/utils/formatTime'
export const InspectionMethodRules = reactive({
code: [required],
available: [required],
description: [required],
})
export const InspectionMethod = useCrudSchemas(reactive<CrudSchema[]>([
@ -36,11 +37,6 @@ export const InspectionMethod = useCrudSchemas(reactive<CrudSchema[]>([
field: 'operationGuidance',
sort: 'custom',
},
{
label: '视频地址',
field: 'videoAddress',
sort: 'custom',
},
{
label: '是否可用',
field: 'available',
@ -51,6 +47,26 @@ export const InspectionMethod = useCrudSchemas(reactive<CrudSchema[]>([
component: 'SelectV2'
},
},
{
label: '文件',
field: 'videoAddress',
sort: 'custom',
isTable: false,
table: {
},
form: {
component: 'UploadFile',
componentProps: {
upData:{
tableName:'basicInspectionMethod',
tableId:'',
},
fileType:['doc', 'xls', 'ppt', 'txt'],
modelValue:[]
},
}
},
{
label: '创建时间',
field: 'createTime',
@ -66,5 +82,5 @@ export const InspectionMethod = useCrudSchemas(reactive<CrudSchema[]>([
width: 150,
fixed: 'right'
}
}
},
]))

1
src/views/qms/samplingProcess/samplingProcess.data.ts

@ -7,6 +7,7 @@ export const SamplingProcessRules = reactive({
sampleType: [required],
evaluationMode: [required],
available: [required],
description: [required],
})
export const SamplingProcess = useCrudSchemas(reactive<CrudSchema[]>([

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

@ -4,8 +4,8 @@ import { dateFormatter } from '@/utils/formatTime'
// 表单校验
export const SamplingSchemeRules = reactive({
code: [required],
// status: [required],
available: [required],
description: [required],
})
export const SamplingScheme = useCrudSchemas(reactive<CrudSchema[]>([

20
src/views/system/systemInstallPackage/index.vue

@ -41,6 +41,13 @@
<!-- 表单弹窗添加/修改 -->
<BasicForm
ref="basicFormRef"
:sumFormDataByForm ="(formRef,formModel)=>{
console.log(formModel)
const {uploadFile} = formModel
formRef.value.setValues({
installPackageUrl:uploadFile
})
}"
@success="formsSuccess"
:rules="SystemInstallPackageRules"
:formAllSchemas="SystemInstallPackage.allSchemas"
@ -131,12 +138,25 @@ const buttonTableClick = async (val, row) => {
/** 添加/修改操作 */
const basicFormRef = ref()
const openForm = (type: string, row?: any) => {
if('create'==type){
const currentTime = new Date().getTime()
const fileId = SystemInstallPackage.allSchemas.formSchema.find(item=>item.field=='fileId')
const uploadFile = SystemInstallPackage.allSchemas.formSchema.find(item=>item.field=='uploadFile')
if(fileId){
fileId['value'] = currentTime
}
if(uploadFile){
uploadFile['componentProps']['upData']['tableId'] = currentTime
}
}
basicFormRef.value.open(type, row)
}
// form
const formsSuccess = async (formType,data) => {
if (formType === 'create') {
delete data['uploadFile']
await SystemInstallPackageApi.createSystemInstallPackage(data)
message.success(t('common.createSuccess'))
} else {

43
src/views/system/systemInstallPackage/systemInstallPackage.data.ts

@ -10,6 +10,12 @@ export const SystemInstallPackageRules = reactive({
})
export const SystemInstallPackage = useCrudSchemas(reactive<CrudSchema[]>([
{
label: 'id',
field: 'id',
sort: 'custom',
isForm:false,
},
{
label: '安装包名称',
field: 'installPackageName',
@ -20,11 +26,23 @@ export const SystemInstallPackage = useCrudSchemas(reactive<CrudSchema[]>([
label: '安装包版本',
field: 'installPackageVersion',
sort: 'custom',
form: {
component: 'InputNumber',
componentProps: {
min: 0,
precision: 6
}
},
},
{
label: '安装路径',
field: 'installPackageUrl',
sort: 'custom',
form: {
componentProps: {
disabled: true
},
}
},
{
label: '是否强制更新',
@ -53,14 +71,37 @@ export const SystemInstallPackage = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '附件id',
field: 'fileId',
isForm:false,
sort: 'custom',
isForm:false,
form: {
componentProps: {
disabled: true
},
value:'',
}
},
{
label: '备注',
field: 'remark',
sort: 'custom',
},
{
label: '上传附件',
field: 'uploadFile',
sort: 'custom',
form: {
component: 'UploadFile',
componentProps: {
upData:{
tableId: '',
tableName: ''
},
limit:1,
fileType:['apk'],
fileSize:35
}
},
},
{
label: '创建时间',
field: 'createTime',

6
src/views/wms/inventoryjobManage/sparepartsrequisition/sparepartsrequisitionRequestMain/sparepartsrequisitionRequestMain.data.ts

@ -341,6 +341,12 @@ export const UnplannedissueRequestMain = useCrudSchemas(reactive<CrudSchema[]>([
//表单校验
export const UnplannedissueRequestMainRules = reactive({
requestTime: [
{ required: true, message: '请输入申请时间', trigger: 'blur' }
],
dueTime: [
{ required: true, message: '请输入截止时间', trigger: 'blur' }
],
departmentCode: [
{ required: true, message: '请输入部门', trigger: 'blur' }
],

6
src/views/wms/inventoryjobManage/unplannedissue/unplannedissueRequestMain/unplannedissueRequestMain.data.ts

@ -341,6 +341,12 @@ export const UnplannedissueRequestMain = useCrudSchemas(reactive<CrudSchema[]>([
//表单校验
export const UnplannedissueRequestMainRules = reactive({
requestTime: [
{ required: true, message: '请输入申请时间', trigger: 'blur' }
],
dueTime: [
{ required: true, message: '请输入截止时间', trigger: 'blur' }
],
departmentCode: [
{ required: true, message: '请输入部门', trigger: 'blur' }
],

32
src/views/wms/inventoryjobManage/unplannedreceipt/unplannedreceiptRequestMain/index.vue

@ -113,6 +113,7 @@ import * as defaultButtons from '@/utils/disposition/defaultButtons'
import * as ItembasicApi from "@/api/wms/itembasic";
import * as PackageApi from "@/api/wms/package";
import { formatTime } from '@/utils/index'
import { getAccessToken } from '@/utils/auth'
//
defineOptions({ name: 'UnplannedreceiptRequestMain' })
@ -284,16 +285,17 @@ const butttondata = (row) => {
defaultButtons.mainListHandleBtn({hide:isShowMainButton(row,['3']),hasPermi:'wms:unplannedreceipt-request-main:handle'}), //
defaultButtons.mainListEditBtn({hide:isShowMainButton(row,['1']),hasPermi:'wms:unplannedreceipt-request-main:update'}), //
// defaultButtons.mainListDeleteBtn({hasPermi:'wms:unplannedreceipt-request-main:delete'}), //
{
label: '创建标签',
name: 'cjbq',
hide: isShowMainButton(row,['3']),
type: 'primary',
icon: '',
color: '',
hasPermi: '',
link: true, //
},
{
label: '创建标签',
name: 'cjbq',
hide: isShowMainButton(row,['3']),
type: 'primary',
icon: '',
color: '',
hasPermi: '',
link: true, //
},
defaultButtons.mainListPointBtn({ hide: isShowMainButton(row, ['3','8']) }), //
]
}
@ -322,6 +324,9 @@ const buttonTableClick = async (val, row) => {
openForm('update', row)
} else if (val == 'delete') { //
handleDelete(row.id)
} else if (val == 'point') {
//
labelPrint(row)
} else if( val == 'cjbq'){//
//
let isCreateLabel = false
@ -643,6 +648,13 @@ const tableFormSelectOnBlur = (field, val, row, index) => {
}
}
//
const BASE_URL = import.meta.env.VITE_JMREPORT_BASE_URL
const src = ref(BASE_URL + '/jmreport/view/936912164754612224?token=' + getAccessToken())
const labelPrint = async (row) => {
window.open(src.value + '&request_number=' + row.number)
}
/** 初始化 **/
onMounted(async () => {
getList()

84
src/views/wms/inventoryjobManage/unplannedreceipt/unplannedreceiptRequestMain/unplannedreceiptRequestMain.data.ts

@ -1027,6 +1027,90 @@ export const UnplannedreceiptRequestDetailLabel = useCrudSchemas(reactive<CrudSc
}
}
},
{
label: '到货日期',
field: 'arriveDate',
formatter: dateFormatter2,
detail: {
dateFormat: 'YYYY-MM-DD'
},
sort: 'custom',
table: {
width: 180
},
form: {
component: 'DatePicker',
componentProps: {
style: {width: '100%'},
type: 'date',
dateFormat: 'YYYY-MM-DD',
valueFormat: 'x',
disabled:true
}
},
tableForm: {
type: 'FormDate',
dateFormat: 'YYYY-MM-DD',
valueFormat: 'x',
disabled:true
}
},
{
label: '生产日期',
field: 'produceDate',
formatter: dateFormatter2,
detail: {
dateFormat: 'YYYY-MM-DD'
},
sort: 'custom',
table: {
width: 180
},
form: {
component: 'DatePicker',
componentProps: {
style: {width: '100%'},
type: 'date',
dateFormat: 'YYYY-MM-DD',
valueFormat: 'x',
disabled:true
}
},
tableForm: {
type: 'FormDate',
dateFormat: 'YYYY-MM-DD',
valueFormat: 'x',
disabled:true
}
},
{
label: '过期日期',
field: 'expireDate',
formatter: dateFormatter2,
detail: {
dateFormat: 'YYYY-MM-DD'
},
sort: 'custom',
table: {
width: 180
},
form: {
component: 'DatePicker',
componentProps: {
style: {width: '100%'},
type: 'date',
dateFormat: 'YYYY-MM-DD',
valueFormat: 'x',
disabled:true
}
},
tableForm: {
type: 'FormDate',
dateFormat: 'YYYY-MM-DD',
valueFormat: 'x',
disabled:true
}
},
{
label: '来源生产线代码',
field: 'productionLineCode',

8
src/views/wms/purchasereceiptManage/purchasereceipt/purchasereceiptRecordMain/purchasereceiptRecordMain.data.ts

@ -42,6 +42,14 @@ export const PurchasereceiptRecordMain = useCrudSchemas(reactive<CrudSchema[]>([
width: 180
},
},
{
label: 'ERP单据号',
field: 'erpNumber',
sort: 'custom',
table: {
width: 180
},
},
{
label: '要货计划单号',
field: 'ppNumber',

3
src/views/wms/purchasereceiptManage/supplierdeliver/demandforecastingMain/demandforecastingMain.data.ts

@ -430,7 +430,8 @@ export const DemandforecastingDetail = useCrudSchemas(reactive<CrudSchema[]>([
width: 150
},
tableForm: {
type: 'Select'
type: 'Select',
disabled: true
}
},
{

5
src/views/wms/purchasereceiptManage/supplierdeliver/purchaseMain/purchaseMain.data.ts

@ -450,13 +450,10 @@ export const PurchaseDetail = useCrudSchemas(reactive<CrudSchema[]>([
dictClass: 'string',
isSearch: true,
isTable: true,
isTableForm:false,
table: {
width: 150
},
tableForm: {
disabled:true,
type: 'Select'
}
},
{
label: '订单数量',

3
src/views/wms/purchasereceiptManage/supplierdeliver/purchasePlanMain/purchasePlanMain.data.ts

@ -520,7 +520,8 @@ export const PurchasePlanDetail = useCrudSchemas(reactive<CrudSchema[]>([
width: 150
},
tableForm: {
type: 'Select'
type: 'Select',
disabled:false,
}
},
{

49
src/views/wms/supplierManage/supplierinvoice/supplierinvoiceRequestMain/index.vue

@ -85,7 +85,7 @@
}]"
:otherHeadButttonData="[{
label: '打印',
name: 'kuozhan',
name: 'printing',
hide: false,
type: 'primary',
// icon: 'ep:operation',
@ -131,6 +131,7 @@
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import * as SupplierApi from '@/api/wms/supplier'
import { Supplier } from '../../../basicDataManage/supplierManage/supplier/supplier.data'
import { getAccessToken } from '@/utils/auth'
defineOptions({ name: 'SupplierinvoiceRequestMain' })
@ -270,6 +271,15 @@
link: true, //
hasPermi: ''
},
{
label: '发票寄出确认',
name: 'invoice_sent_out',
hide: isShowMainButton(row, ['8']),
type: 'danger',
color: '',
link: true, //
hasPermi: ''
},
{
label: '财务审批通过',
name: 'finance_mainPlanSub',
@ -290,7 +300,7 @@
},
// defaultButtons.mainListPlanAppBtn({ hide: isShowMainButton(row, ['2']) }), //
//defaultButtons.mainListPlanTurBtn({ hide: isShowMainButton(row, ['2']) }), //
defaultButtons.mainListEditBtn({ hasPermi: 'wms:supplierinvoice-request-main:update' , hide: isShowMainButton(row, ['1','6'])}), //
defaultButtons.mainListEditBtn({ hasPermi: 'wms:supplierinvoice-request-main:update' , hide: isShowMainButton(row, ['1','8'])}), //
defaultButtons.mainListPurchasePlanCloBtn({ hide: isShowMainButton(row, ['1', '2','4']) }), //
//
// {
@ -325,6 +335,8 @@ const handleImport = () => {
handleApp(row.id)
} else if (val == 'purchase_mainPlanTur') { //
handleTur(row.id)
} else if (val == 'invoice_sent_out') { //
handleInvoiceSentOut(row.id)
} else if(val == 'finance_mainPlanSub'){ //
handleFinanceApp(row.id)
} else if(val == 'finance_mainPlanTur'){ //
@ -349,9 +361,11 @@ const handleImport = () => {
const { wsCache } = useCache()
/** 详情操作 */
const detailRef = ref()
const clicKRowId = 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))
clicKRowId.value = row.id
detailRef.value.openDetail(row, titleName, titleValue)
}
@ -475,6 +489,23 @@ const handleImport = () => {
}
}
/** 发票寄出确认按钮操作 */
const handleInvoiceSentOut = async (id : number) => {
try {
//
await message.confirm('是否确认发票寄出选中数据?')
tableObject.loading = true
//
await SupplierinvoiceRequestMainApi.invoiceSentOutSupplierinvoiceRequestMain(id)
message.success(t('发票寄出成功!'))
tableObject.loading = false
//
await getList()
} catch { }finally{
tableObject.loading = false
}
}
/** 驳回按钮操作 */
const handleFinaceTur = async (id : number) => {
try {
@ -584,8 +615,20 @@ const importSuccess = () => {
// --
const detailButtonBaseClick = (val, item) => {
console.log(1111)
console.log("点击的按钮",val)
if(val == 'printing'){
//
handleDocumentPrint(clicKRowId.value)
}
}
//
const BASE_URL = import.meta.env.VITE_JMREPORT_BASE_URL
const documentSrc = ref(BASE_URL + '/jmreport/view/936875675614240768?token=' + getAccessToken())
const handleDocumentPrint = async (id) => {
window.open(documentSrc.value + '&id=' + id)
}
/** 初始化 **/
onMounted(async () => {
getList()

19
src/views/wms/supplierManage/supplierinvoice/supplierinvoiceRequestMain/supplierinvoiceRequestMain.data.ts

@ -215,6 +215,7 @@ export const SupplierinvoiceRequestMain = useCrudSchemas(reactive<CrudSchema[]>(
type: 'InputNumber',
min: 0,
precision: 6,
disabled: true,
}
},
{
@ -342,6 +343,9 @@ export const SupplierinvoiceRequestMain = useCrudSchemas(reactive<CrudSchema[]>(
table: {
width: 150
},
isTable:false,
isTableForm:false,
isForm:false,
formatter: (_: Recordable, __: TableColumn, cellValue: number) => {
return userDeptArray.find((account) => account.id == cellValue)?.name
},
@ -616,21 +620,6 @@ export const SupplierinvoiceRequestDetail = useCrudSchemas(reactive<CrudSchema[]
]
}
},
{
label: '供应商税率',
field: 'tax',
table: {
width: 150
},
form: {
componentProps: {
disabled: true
}
},
tableForm:{
disabled: true
}
},
{
label: '项目编码',
field: 'projectCode',

310
src/views/wms/supplierManage/supplierinvoiceInvoiced/index.vue

@ -0,0 +1,310 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="SupplierinvoiceInvoiced.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
</ContentWrap>
<!-- 列表头部 -->
<TableHead
:HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick"
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="SupplierinvoiceInvoiced.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(row)" @button-base-click="buttonTableClick($event,row)" />
</template>
</Table>
</ContentWrap>
<!-- 表单弹窗添加/修改 -->
<BasicForm
ref="basicFormRef"
@success="formsSuccess"
:rules="SupplierinvoiceInvoicedRules"
:formAllSchemas="SupplierinvoiceInvoiced.allSchemas"
:apiUpdate="SupplierinvoiceInvoicedApi.updateSupplierinvoiceInvoiced"
:apiCreate="SupplierinvoiceInvoicedApi.createSupplierinvoiceInvoiced"
@searchTableSuccess="searchTableSuccess"
:isBusiness="false"
/>
<!-- 详情 -->
<Detail ref="detailRef" :isBasic="true" :allSchemas="SupplierinvoiceInvoiced.allSchemas" />
<!-- 导入 -->
<!-- <ImportForm ref="importFormRef" url="/wms/supplierinvoice-invoiced/import" :importTemplateData="importTemplateData" @success="importSuccess" /> -->
</template>
<script setup lang="ts">
import download from '@/utils/download'
import { SupplierinvoiceInvoiced,SupplierinvoiceInvoicedRules } from './supplierinvoiceInvoiced.data'
import * as SupplierinvoiceInvoicedApi from '@/api/wms/supplierinvoiceInvoiced'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import TableHead from '@/components/TableHead/src/TableHead.vue'
import Detail from '@/components/Detail/src/Detail.vue'
defineOptions({ name: 'SupplierinvoiceInvoiced' })
const message = useMessage() //
const { t } = useI18n() //
const route = useRoute() //
const routeName = ref()
routeName.value = route.name
const tableColumns = ref(SupplierinvoiceInvoiced.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: SupplierinvoiceInvoicedApi.getSupplierinvoiceInvoicedPage //
})
//
const { getList, setSearchParams } = tableMethods
//
const isShowMainButton = (row, val) => {
if (val.indexOf(row.status) > -1) {
return false
} else {
return true
}
}
//
const HeadButttondata = [
// defaultButtons.defaultAddBtn({hasPermi:'wms:supplierinvoice-invoiced:create'}), //
// defaultButtons.defaultImportBtn({hasPermi:'wms:supplierinvoice-invoiced:import'}), //
// defaultButtons.defaultExportBtn({hasPermi:'wms:supplierinvoice-invoiced: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 = (row) =>{
return [
// defaultButtons.mainListEditBtn({hasPermi:'wms:supplierinvoice-invoiced:update'}), //
// defaultButtons.mainListDeleteBtn({hasPermi:'wms:supplierinvoice-invoiced:delete'}), //
// defaultButtons.mainListEditBtn({hasPermi:'wms:supplierinvoice-invoiced:update'}),
{
label: '审核通过',
name: 'agree',
hide: isShowMainButton(row, ['1']),
type: 'primary',
color: '',
link: true, //
hasPermi: ''
},
{
label: '审核拒绝',
name: 'refuse',
hide: isShowMainButton(row, ['1']),
type: 'danger',
color: '',
link: true, //
hasPermi: ''
}
]
}
// -
const buttonTableClick = async (val, row) => {
if (val == 'edit') { //
openForm('update', row)
} else if (val == 'delete') { //
handleDelete(row.id)
} else if(val == 'agree'){
handleAgree(row.id)
}
}
/** 添加/修改操作 */
const basicFormRef = ref()
const openForm = (type: string, row?: any) => {
basicFormRef.value.open(type, row)
}
// form
const formsSuccess = async (formType,data) => {
var isHave =SupplierinvoiceInvoiced.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 SupplierinvoiceInvoicedApi.createSupplierinvoiceInvoiced(data)
message.success(t('common.createSuccess'))
} else {
await SupplierinvoiceInvoicedApi.updateSupplierinvoiceInvoiced(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, 'basicSupplierinvoiceInvoiced')
}
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
try {
//
await message.delConfirm()
//
await SupplierinvoiceInvoicedApi.deleteSupplierinvoiceInvoiced(id)
message.success(t('common.delSuccess'))
//
await getList()
} catch {}
}
/** 审批通过按钮操作 */
const handleAgree = async (id : number) => {
try {
//
await message.confirm('是否审批通过所选中数据?')
tableObject.loading = true
//
await SupplierinvoiceInvoicedApi.agreeSupplierinvoiceInvoiced(id)
message.success(t('审批通过成功!'))
tableObject.loading = false
//
await getList()
} catch { }finally{
tableObject.loading = false
}
}
/** 审批通过按钮操作 */
const handleRefuse = async (id : number) => {
try {
//
await message.confirm('是否审批拒绝所选中数据?')
tableObject.loading = true
//
await SupplierinvoiceInvoicedApi.refuseSupplierinvoiceInvoiced(id)
message.success(t('审批成功!'))
tableObject.loading = false
//
await getList()
} catch { }finally{
tableObject.loading = false
}
}
/** 导出按钮操作 */
const exportLoading = ref(false) //
const handleExport = async () => {
try {
//
await message.exportConfirm()
//
exportLoading.value = true
const data = await SupplierinvoiceInvoicedApi.exportSupplierinvoiceInvoiced(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 SupplierinvoiceInvoicedApi.importTemplate()
})
</script>

168
src/views/wms/supplierManage/supplierinvoiceInvoiced/supplierinvoiceInvoiced.data.ts

@ -0,0 +1,168 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime'
// 表单校验
export const SupplierinvoiceInvoicedRules = reactive({
supplierCode: [required],
poNumber: [required],
currency: [required],
concurrencyStamp: [required],
})
export const SupplierinvoiceInvoiced = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '项目编码',
field: 'projectCode',
sort: 'custom',
isSearch: true,
table: {
width: 150
},
},
{
label: '单据类型',
field: 'billType',
sort: 'custom',
form: {
component: 'SelectV2'
},
table: {
width: 150
},
},
{
label: '状态',
field: 'status',
dictType: DICT_TYPE.SUPPLIERINVOICE_STATUS,
dictClass: 'string',
isTable: true,
isForm:false,
sort: 'custom',
table: {
width: 150
},
isSearch: true,
form: {
value: '1',
componentProps: {
disabled: true
}
}
},
{
label: '单据号',
field: 'recvBillNum',
sort: 'custom',
isSearch: true,
table: {
width: 150
},
},
{
label: '发货单号',
field: 'asnBillNum',
sort: 'custom',
table: {
width: 150
},
},
{
label: '供应商代码',
field: 'supplierCode',
sort: 'custom',
table: {
width: 150
},
},
{
label: '订单号',
field: 'poNumber',
sort: 'custom',
table: {
width: 150
},
},
{
label: '订单行',
field: 'poLine',
sort: 'custom',
table: {
width: 150
},
},
{
label: '采购价格',
field: 'purchasePrice',
sort: 'custom',
table: {
width: 150
},
},
{
label: '可开票数量',
field: 'invoicableQuantity',
sort: 'custom',
table: {
width: 150
},
},
{
label: '零件号',
field: 'itemCode',
sort: 'custom',
table: {
width: 150
},
},
{
label: '计量单位',
field: 'uom',
sort: 'custom',
table: {
width: 150
},
},
{
label: '货币',
field: 'currency',
sort: 'custom',
table: {
width: 150
},
},
{
label: '备注',
field: 'remark',
sort: 'custom',
table: {
width: 150
},
},
{
label: '创建时间',
field: 'createTime',
sort: 'custom',
formatter: dateFormatter,
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')]
}
},
table: {
width: 150
},
isForm: false,
},
{
label: '操作',
field: 'action',
isForm: false,
table: {
width: 200,
fixed: 'right'
}
}
]))
Loading…
Cancel
Save