diff --git a/src/api/business/lab/measureData.ts b/src/api/business/lab/measureData.ts
new file mode 100644
index 0000000..ab3a56e
--- /dev/null
+++ b/src/api/business/lab/measureData.ts
@@ -0,0 +1,78 @@
+/**
+ * 计量数据管理
+*/
+import request from '../../index'
+
+// 计量数据管理列表
+export function getMeasureDataList(data: { offset: number; limit: number }) {
+ return request({
+ url: `/business/certificateReport/approval/listPage?offset=${data.offset}&limit=${data.limit}`,
+ method: 'post',
+ data,
+ })
+}
+
+// 点击下载模板后生成证书
+export function downLoadTemplate(data: any) {
+ return request({
+ url: '/business/certificateReport/exportFile',
+ method: 'post',
+ data,
+ responseType: 'blob',
+ })
+}
+
+// 新增
+export function addMeasureData(data: any) {
+ return request({
+ url: '/business/certificateReport/save',
+ method: 'post',
+ data,
+ })
+}
+
+// 草稿箱更新
+export function draftUpdateMeasureData(data: any) {
+ return request({
+ url: '/business/certificateReport/draftUpdate',
+ method: 'post',
+ data,
+ })
+}
+
+// 未通过-驳回编辑
+export function failUpdateMeasureData(data: any) {
+ return request({
+ url: '/business/certificateReport/failUpdate',
+ method: 'post',
+ data,
+ })
+}
+
+// 提交
+export function submit(data: { formId: string; processId?: string; id: string }) {
+ return request({
+ url: '/business/certificateReport/submit',
+ method: 'post',
+ data,
+ })
+}
+
+// 详情
+export function getMeasureDataDetail(data: { id: string }) {
+ return request({
+ url: '/business/certificateReport/detail',
+ method: 'post',
+ data,
+ })
+}
+
+// 删除
+export function deleteMeasureData(data: any) {
+ return request({
+ url: '/business/certificateReport/batchDelete',
+ method: 'post',
+ data,
+ })
+}
+
diff --git a/src/api/business/lab/measureData.ts b/src/api/business/lab/measureData.ts
new file mode 100644
index 0000000..ab3a56e
--- /dev/null
+++ b/src/api/business/lab/measureData.ts
@@ -0,0 +1,78 @@
+/**
+ * 计量数据管理
+*/
+import request from '../../index'
+
+// 计量数据管理列表
+export function getMeasureDataList(data: { offset: number; limit: number }) {
+ return request({
+ url: `/business/certificateReport/approval/listPage?offset=${data.offset}&limit=${data.limit}`,
+ method: 'post',
+ data,
+ })
+}
+
+// 点击下载模板后生成证书
+export function downLoadTemplate(data: any) {
+ return request({
+ url: '/business/certificateReport/exportFile',
+ method: 'post',
+ data,
+ responseType: 'blob',
+ })
+}
+
+// 新增
+export function addMeasureData(data: any) {
+ return request({
+ url: '/business/certificateReport/save',
+ method: 'post',
+ data,
+ })
+}
+
+// 草稿箱更新
+export function draftUpdateMeasureData(data: any) {
+ return request({
+ url: '/business/certificateReport/draftUpdate',
+ method: 'post',
+ data,
+ })
+}
+
+// 未通过-驳回编辑
+export function failUpdateMeasureData(data: any) {
+ return request({
+ url: '/business/certificateReport/failUpdate',
+ method: 'post',
+ data,
+ })
+}
+
+// 提交
+export function submit(data: { formId: string; processId?: string; id: string }) {
+ return request({
+ url: '/business/certificateReport/submit',
+ method: 'post',
+ data,
+ })
+}
+
+// 详情
+export function getMeasureDataDetail(data: { id: string }) {
+ return request({
+ url: '/business/certificateReport/detail',
+ method: 'post',
+ data,
+ })
+}
+
+// 删除
+export function deleteMeasureData(data: any) {
+ return request({
+ url: '/business/certificateReport/batchDelete',
+ method: 'post',
+ data,
+ })
+}
+
diff --git a/src/api/business/subpackage/apply.ts b/src/api/business/subpackage/apply.ts
index ad17a5a..c778f8e 100644
--- a/src/api/business/subpackage/apply.ts
+++ b/src/api/business/subpackage/apply.ts
@@ -94,3 +94,4 @@
data,
})
}
+
diff --git a/src/api/business/lab/measureData.ts b/src/api/business/lab/measureData.ts
new file mode 100644
index 0000000..ab3a56e
--- /dev/null
+++ b/src/api/business/lab/measureData.ts
@@ -0,0 +1,78 @@
+/**
+ * 计量数据管理
+*/
+import request from '../../index'
+
+// 计量数据管理列表
+export function getMeasureDataList(data: { offset: number; limit: number }) {
+ return request({
+ url: `/business/certificateReport/approval/listPage?offset=${data.offset}&limit=${data.limit}`,
+ method: 'post',
+ data,
+ })
+}
+
+// 点击下载模板后生成证书
+export function downLoadTemplate(data: any) {
+ return request({
+ url: '/business/certificateReport/exportFile',
+ method: 'post',
+ data,
+ responseType: 'blob',
+ })
+}
+
+// 新增
+export function addMeasureData(data: any) {
+ return request({
+ url: '/business/certificateReport/save',
+ method: 'post',
+ data,
+ })
+}
+
+// 草稿箱更新
+export function draftUpdateMeasureData(data: any) {
+ return request({
+ url: '/business/certificateReport/draftUpdate',
+ method: 'post',
+ data,
+ })
+}
+
+// 未通过-驳回编辑
+export function failUpdateMeasureData(data: any) {
+ return request({
+ url: '/business/certificateReport/failUpdate',
+ method: 'post',
+ data,
+ })
+}
+
+// 提交
+export function submit(data: { formId: string; processId?: string; id: string }) {
+ return request({
+ url: '/business/certificateReport/submit',
+ method: 'post',
+ data,
+ })
+}
+
+// 详情
+export function getMeasureDataDetail(data: { id: string }) {
+ return request({
+ url: '/business/certificateReport/detail',
+ method: 'post',
+ data,
+ })
+}
+
+// 删除
+export function deleteMeasureData(data: any) {
+ return request({
+ url: '/business/certificateReport/batchDelete',
+ method: 'post',
+ data,
+ })
+}
+
diff --git a/src/api/business/subpackage/apply.ts b/src/api/business/subpackage/apply.ts
index ad17a5a..c778f8e 100644
--- a/src/api/business/subpackage/apply.ts
+++ b/src/api/business/subpackage/apply.ts
@@ -94,3 +94,4 @@
data,
})
}
+
diff --git a/src/api/system/tool.ts b/src/api/system/tool.ts
index 6b2f5f2..8223e4c 100644
--- a/src/api/system/tool.ts
+++ b/src/api/system/tool.ts
@@ -67,19 +67,10 @@
data,
})
}
-// 原始记录模板/证书报告模板列表(分页)
-export interface listParamsType {
- templateNo: string // 编号
- templateName: string // 名称
- templateCreator: string // 负责人
- // createTime: string // 创建时间
- limit: number
- offset: number
- templateType: string
-}
-export function templatePage(data: listParamsType) {
+
+export function templatePage(data: any) {
return request({
- url: `${prefix}/template/listPage?limit=${data.limit}&offset=${data.offset}`,
+ url: `${prefix}template/listPage?limit=${data.limit}&offset=${data.offset}`,
method: 'post',
data,
})
@@ -87,7 +78,7 @@
// 原始记录模板/证书报告模板列表/详情(
export function templatePageDetail(data: object) {
return request({
- url: `${prefix}/template/detail`,
+ url: `${prefix}template/detail`,
method: 'post',
data,
})
@@ -95,7 +86,7 @@
// 原始记录模板/证书报告模板列表删除
export function templateDelete(data: object) {
return request({
- url: `${prefix}/template/delete`,
+ url: `${prefix}template/delete`,
method: 'post',
data,
})
@@ -103,7 +94,7 @@
// 原始记录模板/证书报告模板列表新建
export function templateAdd(data: object) {
return request({
- url: `${prefix}/template/add`,
+ url: `${prefix}template/add`,
method: 'post',
data,
})
@@ -111,7 +102,7 @@
// 原始记录模板/证书报告模板列表更新
export function templateUpdate(data: object) {
return request({
- url: `${prefix}/template/update`,
+ url: `${prefix}template/update`,
method: 'post',
data,
})
@@ -119,7 +110,7 @@
// 原始记录模板/证书报告模板列表导出
export function templateExport(data: object) {
return request({
- url: `${prefix}/template/listExport`,
+ url: `${prefix}template/listExport`,
method: 'post',
data,
responseType: 'blob',
diff --git a/src/api/business/lab/measureData.ts b/src/api/business/lab/measureData.ts
new file mode 100644
index 0000000..ab3a56e
--- /dev/null
+++ b/src/api/business/lab/measureData.ts
@@ -0,0 +1,78 @@
+/**
+ * 计量数据管理
+*/
+import request from '../../index'
+
+// 计量数据管理列表
+export function getMeasureDataList(data: { offset: number; limit: number }) {
+ return request({
+ url: `/business/certificateReport/approval/listPage?offset=${data.offset}&limit=${data.limit}`,
+ method: 'post',
+ data,
+ })
+}
+
+// 点击下载模板后生成证书
+export function downLoadTemplate(data: any) {
+ return request({
+ url: '/business/certificateReport/exportFile',
+ method: 'post',
+ data,
+ responseType: 'blob',
+ })
+}
+
+// 新增
+export function addMeasureData(data: any) {
+ return request({
+ url: '/business/certificateReport/save',
+ method: 'post',
+ data,
+ })
+}
+
+// 草稿箱更新
+export function draftUpdateMeasureData(data: any) {
+ return request({
+ url: '/business/certificateReport/draftUpdate',
+ method: 'post',
+ data,
+ })
+}
+
+// 未通过-驳回编辑
+export function failUpdateMeasureData(data: any) {
+ return request({
+ url: '/business/certificateReport/failUpdate',
+ method: 'post',
+ data,
+ })
+}
+
+// 提交
+export function submit(data: { formId: string; processId?: string; id: string }) {
+ return request({
+ url: '/business/certificateReport/submit',
+ method: 'post',
+ data,
+ })
+}
+
+// 详情
+export function getMeasureDataDetail(data: { id: string }) {
+ return request({
+ url: '/business/certificateReport/detail',
+ method: 'post',
+ data,
+ })
+}
+
+// 删除
+export function deleteMeasureData(data: any) {
+ return request({
+ url: '/business/certificateReport/batchDelete',
+ method: 'post',
+ data,
+ })
+}
+
diff --git a/src/api/business/subpackage/apply.ts b/src/api/business/subpackage/apply.ts
index ad17a5a..c778f8e 100644
--- a/src/api/business/subpackage/apply.ts
+++ b/src/api/business/subpackage/apply.ts
@@ -94,3 +94,4 @@
data,
})
}
+
diff --git a/src/api/system/tool.ts b/src/api/system/tool.ts
index 6b2f5f2..8223e4c 100644
--- a/src/api/system/tool.ts
+++ b/src/api/system/tool.ts
@@ -67,19 +67,10 @@
data,
})
}
-// 原始记录模板/证书报告模板列表(分页)
-export interface listParamsType {
- templateNo: string // 编号
- templateName: string // 名称
- templateCreator: string // 负责人
- // createTime: string // 创建时间
- limit: number
- offset: number
- templateType: string
-}
-export function templatePage(data: listParamsType) {
+
+export function templatePage(data: any) {
return request({
- url: `${prefix}/template/listPage?limit=${data.limit}&offset=${data.offset}`,
+ url: `${prefix}template/listPage?limit=${data.limit}&offset=${data.offset}`,
method: 'post',
data,
})
@@ -87,7 +78,7 @@
// 原始记录模板/证书报告模板列表/详情(
export function templatePageDetail(data: object) {
return request({
- url: `${prefix}/template/detail`,
+ url: `${prefix}template/detail`,
method: 'post',
data,
})
@@ -95,7 +86,7 @@
// 原始记录模板/证书报告模板列表删除
export function templateDelete(data: object) {
return request({
- url: `${prefix}/template/delete`,
+ url: `${prefix}template/delete`,
method: 'post',
data,
})
@@ -103,7 +94,7 @@
// 原始记录模板/证书报告模板列表新建
export function templateAdd(data: object) {
return request({
- url: `${prefix}/template/add`,
+ url: `${prefix}template/add`,
method: 'post',
data,
})
@@ -111,7 +102,7 @@
// 原始记录模板/证书报告模板列表更新
export function templateUpdate(data: object) {
return request({
- url: `${prefix}/template/update`,
+ url: `${prefix}template/update`,
method: 'post',
data,
})
@@ -119,7 +110,7 @@
// 原始记录模板/证书报告模板列表导出
export function templateExport(data: object) {
return request({
- url: `${prefix}/template/listExport`,
+ url: `${prefix}template/listExport`,
method: 'post',
data,
responseType: 'blob',
diff --git a/src/components.d.ts b/src/components.d.ts
index edc2e04..64cf608 100644
--- a/src/components.d.ts
+++ b/src/components.d.ts
@@ -46,6 +46,7 @@
ImageUpload: typeof import('./components/ImageUpload/index.vue')['default']
LineChart: typeof import('./components/Echart/LineChart.vue')['default']
MeasureRecords: typeof import('./components/Sample/measureRecords.vue')['default']
+ MultiHeaderTable: typeof import('./components/MultiHeaderTable/index.vue')['default']
NodeWrap: typeof import('./components/workFlow/nodeWrap.vue')['default']
NodeWrapBan: typeof import('./components/workFlow/nodeWrapBan.vue')['default']
NormalTable: typeof import('./components/NormalTable/index.vue')['default']
@@ -67,6 +68,7 @@
SelectStaffDialog: typeof import('./components/dialog/selectStaffDialog.vue')['default']
SvgIcon: typeof import('./components/SvgIcon/index.vue')['default']
SystemInfo: typeof import('./components/SystemInfo/index.vue')['default']
+ TableColumn: typeof import('./components/MultiHeaderTable/tableColumn.vue')['default']
TableContainer: typeof import('./components/TableContainer/index.vue')['default']
Trend: typeof import('./components/Trend/index.vue')['default']
WordOreview: typeof import('./components/filePreview/wordOreview.vue')['default']
diff --git a/src/api/business/lab/measureData.ts b/src/api/business/lab/measureData.ts
new file mode 100644
index 0000000..ab3a56e
--- /dev/null
+++ b/src/api/business/lab/measureData.ts
@@ -0,0 +1,78 @@
+/**
+ * 计量数据管理
+*/
+import request from '../../index'
+
+// 计量数据管理列表
+export function getMeasureDataList(data: { offset: number; limit: number }) {
+ return request({
+ url: `/business/certificateReport/approval/listPage?offset=${data.offset}&limit=${data.limit}`,
+ method: 'post',
+ data,
+ })
+}
+
+// 点击下载模板后生成证书
+export function downLoadTemplate(data: any) {
+ return request({
+ url: '/business/certificateReport/exportFile',
+ method: 'post',
+ data,
+ responseType: 'blob',
+ })
+}
+
+// 新增
+export function addMeasureData(data: any) {
+ return request({
+ url: '/business/certificateReport/save',
+ method: 'post',
+ data,
+ })
+}
+
+// 草稿箱更新
+export function draftUpdateMeasureData(data: any) {
+ return request({
+ url: '/business/certificateReport/draftUpdate',
+ method: 'post',
+ data,
+ })
+}
+
+// 未通过-驳回编辑
+export function failUpdateMeasureData(data: any) {
+ return request({
+ url: '/business/certificateReport/failUpdate',
+ method: 'post',
+ data,
+ })
+}
+
+// 提交
+export function submit(data: { formId: string; processId?: string; id: string }) {
+ return request({
+ url: '/business/certificateReport/submit',
+ method: 'post',
+ data,
+ })
+}
+
+// 详情
+export function getMeasureDataDetail(data: { id: string }) {
+ return request({
+ url: '/business/certificateReport/detail',
+ method: 'post',
+ data,
+ })
+}
+
+// 删除
+export function deleteMeasureData(data: any) {
+ return request({
+ url: '/business/certificateReport/batchDelete',
+ method: 'post',
+ data,
+ })
+}
+
diff --git a/src/api/business/subpackage/apply.ts b/src/api/business/subpackage/apply.ts
index ad17a5a..c778f8e 100644
--- a/src/api/business/subpackage/apply.ts
+++ b/src/api/business/subpackage/apply.ts
@@ -94,3 +94,4 @@
data,
})
}
+
diff --git a/src/api/system/tool.ts b/src/api/system/tool.ts
index 6b2f5f2..8223e4c 100644
--- a/src/api/system/tool.ts
+++ b/src/api/system/tool.ts
@@ -67,19 +67,10 @@
data,
})
}
-// 原始记录模板/证书报告模板列表(分页)
-export interface listParamsType {
- templateNo: string // 编号
- templateName: string // 名称
- templateCreator: string // 负责人
- // createTime: string // 创建时间
- limit: number
- offset: number
- templateType: string
-}
-export function templatePage(data: listParamsType) {
+
+export function templatePage(data: any) {
return request({
- url: `${prefix}/template/listPage?limit=${data.limit}&offset=${data.offset}`,
+ url: `${prefix}template/listPage?limit=${data.limit}&offset=${data.offset}`,
method: 'post',
data,
})
@@ -87,7 +78,7 @@
// 原始记录模板/证书报告模板列表/详情(
export function templatePageDetail(data: object) {
return request({
- url: `${prefix}/template/detail`,
+ url: `${prefix}template/detail`,
method: 'post',
data,
})
@@ -95,7 +86,7 @@
// 原始记录模板/证书报告模板列表删除
export function templateDelete(data: object) {
return request({
- url: `${prefix}/template/delete`,
+ url: `${prefix}template/delete`,
method: 'post',
data,
})
@@ -103,7 +94,7 @@
// 原始记录模板/证书报告模板列表新建
export function templateAdd(data: object) {
return request({
- url: `${prefix}/template/add`,
+ url: `${prefix}template/add`,
method: 'post',
data,
})
@@ -111,7 +102,7 @@
// 原始记录模板/证书报告模板列表更新
export function templateUpdate(data: object) {
return request({
- url: `${prefix}/template/update`,
+ url: `${prefix}template/update`,
method: 'post',
data,
})
@@ -119,7 +110,7 @@
// 原始记录模板/证书报告模板列表导出
export function templateExport(data: object) {
return request({
- url: `${prefix}/template/listExport`,
+ url: `${prefix}template/listExport`,
method: 'post',
data,
responseType: 'blob',
diff --git a/src/components.d.ts b/src/components.d.ts
index edc2e04..64cf608 100644
--- a/src/components.d.ts
+++ b/src/components.d.ts
@@ -46,6 +46,7 @@
ImageUpload: typeof import('./components/ImageUpload/index.vue')['default']
LineChart: typeof import('./components/Echart/LineChart.vue')['default']
MeasureRecords: typeof import('./components/Sample/measureRecords.vue')['default']
+ MultiHeaderTable: typeof import('./components/MultiHeaderTable/index.vue')['default']
NodeWrap: typeof import('./components/workFlow/nodeWrap.vue')['default']
NodeWrapBan: typeof import('./components/workFlow/nodeWrapBan.vue')['default']
NormalTable: typeof import('./components/NormalTable/index.vue')['default']
@@ -67,6 +68,7 @@
SelectStaffDialog: typeof import('./components/dialog/selectStaffDialog.vue')['default']
SvgIcon: typeof import('./components/SvgIcon/index.vue')['default']
SystemInfo: typeof import('./components/SystemInfo/index.vue')['default']
+ TableColumn: typeof import('./components/MultiHeaderTable/tableColumn.vue')['default']
TableContainer: typeof import('./components/TableContainer/index.vue')['default']
Trend: typeof import('./components/Trend/index.vue')['default']
WordOreview: typeof import('./components/filePreview/wordOreview.vue')['default']
diff --git a/src/components/MultiHeaderTable/index.vue b/src/components/MultiHeaderTable/index.vue
new file mode 100644
index 0000000..85b8c88
--- /dev/null
+++ b/src/components/MultiHeaderTable/index.vue
@@ -0,0 +1,343 @@
+
+
+
+
+
+
+
diff --git a/src/api/business/lab/measureData.ts b/src/api/business/lab/measureData.ts
new file mode 100644
index 0000000..ab3a56e
--- /dev/null
+++ b/src/api/business/lab/measureData.ts
@@ -0,0 +1,78 @@
+/**
+ * 计量数据管理
+*/
+import request from '../../index'
+
+// 计量数据管理列表
+export function getMeasureDataList(data: { offset: number; limit: number }) {
+ return request({
+ url: `/business/certificateReport/approval/listPage?offset=${data.offset}&limit=${data.limit}`,
+ method: 'post',
+ data,
+ })
+}
+
+// 点击下载模板后生成证书
+export function downLoadTemplate(data: any) {
+ return request({
+ url: '/business/certificateReport/exportFile',
+ method: 'post',
+ data,
+ responseType: 'blob',
+ })
+}
+
+// 新增
+export function addMeasureData(data: any) {
+ return request({
+ url: '/business/certificateReport/save',
+ method: 'post',
+ data,
+ })
+}
+
+// 草稿箱更新
+export function draftUpdateMeasureData(data: any) {
+ return request({
+ url: '/business/certificateReport/draftUpdate',
+ method: 'post',
+ data,
+ })
+}
+
+// 未通过-驳回编辑
+export function failUpdateMeasureData(data: any) {
+ return request({
+ url: '/business/certificateReport/failUpdate',
+ method: 'post',
+ data,
+ })
+}
+
+// 提交
+export function submit(data: { formId: string; processId?: string; id: string }) {
+ return request({
+ url: '/business/certificateReport/submit',
+ method: 'post',
+ data,
+ })
+}
+
+// 详情
+export function getMeasureDataDetail(data: { id: string }) {
+ return request({
+ url: '/business/certificateReport/detail',
+ method: 'post',
+ data,
+ })
+}
+
+// 删除
+export function deleteMeasureData(data: any) {
+ return request({
+ url: '/business/certificateReport/batchDelete',
+ method: 'post',
+ data,
+ })
+}
+
diff --git a/src/api/business/subpackage/apply.ts b/src/api/business/subpackage/apply.ts
index ad17a5a..c778f8e 100644
--- a/src/api/business/subpackage/apply.ts
+++ b/src/api/business/subpackage/apply.ts
@@ -94,3 +94,4 @@
data,
})
}
+
diff --git a/src/api/system/tool.ts b/src/api/system/tool.ts
index 6b2f5f2..8223e4c 100644
--- a/src/api/system/tool.ts
+++ b/src/api/system/tool.ts
@@ -67,19 +67,10 @@
data,
})
}
-// 原始记录模板/证书报告模板列表(分页)
-export interface listParamsType {
- templateNo: string // 编号
- templateName: string // 名称
- templateCreator: string // 负责人
- // createTime: string // 创建时间
- limit: number
- offset: number
- templateType: string
-}
-export function templatePage(data: listParamsType) {
+
+export function templatePage(data: any) {
return request({
- url: `${prefix}/template/listPage?limit=${data.limit}&offset=${data.offset}`,
+ url: `${prefix}template/listPage?limit=${data.limit}&offset=${data.offset}`,
method: 'post',
data,
})
@@ -87,7 +78,7 @@
// 原始记录模板/证书报告模板列表/详情(
export function templatePageDetail(data: object) {
return request({
- url: `${prefix}/template/detail`,
+ url: `${prefix}template/detail`,
method: 'post',
data,
})
@@ -95,7 +86,7 @@
// 原始记录模板/证书报告模板列表删除
export function templateDelete(data: object) {
return request({
- url: `${prefix}/template/delete`,
+ url: `${prefix}template/delete`,
method: 'post',
data,
})
@@ -103,7 +94,7 @@
// 原始记录模板/证书报告模板列表新建
export function templateAdd(data: object) {
return request({
- url: `${prefix}/template/add`,
+ url: `${prefix}template/add`,
method: 'post',
data,
})
@@ -111,7 +102,7 @@
// 原始记录模板/证书报告模板列表更新
export function templateUpdate(data: object) {
return request({
- url: `${prefix}/template/update`,
+ url: `${prefix}template/update`,
method: 'post',
data,
})
@@ -119,7 +110,7 @@
// 原始记录模板/证书报告模板列表导出
export function templateExport(data: object) {
return request({
- url: `${prefix}/template/listExport`,
+ url: `${prefix}template/listExport`,
method: 'post',
data,
responseType: 'blob',
diff --git a/src/components.d.ts b/src/components.d.ts
index edc2e04..64cf608 100644
--- a/src/components.d.ts
+++ b/src/components.d.ts
@@ -46,6 +46,7 @@
ImageUpload: typeof import('./components/ImageUpload/index.vue')['default']
LineChart: typeof import('./components/Echart/LineChart.vue')['default']
MeasureRecords: typeof import('./components/Sample/measureRecords.vue')['default']
+ MultiHeaderTable: typeof import('./components/MultiHeaderTable/index.vue')['default']
NodeWrap: typeof import('./components/workFlow/nodeWrap.vue')['default']
NodeWrapBan: typeof import('./components/workFlow/nodeWrapBan.vue')['default']
NormalTable: typeof import('./components/NormalTable/index.vue')['default']
@@ -67,6 +68,7 @@
SelectStaffDialog: typeof import('./components/dialog/selectStaffDialog.vue')['default']
SvgIcon: typeof import('./components/SvgIcon/index.vue')['default']
SystemInfo: typeof import('./components/SystemInfo/index.vue')['default']
+ TableColumn: typeof import('./components/MultiHeaderTable/tableColumn.vue')['default']
TableContainer: typeof import('./components/TableContainer/index.vue')['default']
Trend: typeof import('./components/Trend/index.vue')['default']
WordOreview: typeof import('./components/filePreview/wordOreview.vue')['default']
diff --git a/src/components/MultiHeaderTable/index.vue b/src/components/MultiHeaderTable/index.vue
new file mode 100644
index 0000000..85b8c88
--- /dev/null
+++ b/src/components/MultiHeaderTable/index.vue
@@ -0,0 +1,343 @@
+
+
+
+
+
+
+
diff --git a/src/components/MultiHeaderTable/tableColumn.vue b/src/components/MultiHeaderTable/tableColumn.vue
new file mode 100644
index 0000000..2b87285
--- /dev/null
+++ b/src/components/MultiHeaderTable/tableColumn.vue
@@ -0,0 +1,147 @@
+
+
+
+
+
+
+
+
+
+
+ *{{ item.text }}
+
+
+ *{{ item.text }}
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ scope.row[item.value] }}
+
+
+ {{
+ scope.row[item.value]
+ }}
+
+
+
+
+
+
diff --git a/src/api/business/lab/measureData.ts b/src/api/business/lab/measureData.ts
new file mode 100644
index 0000000..ab3a56e
--- /dev/null
+++ b/src/api/business/lab/measureData.ts
@@ -0,0 +1,78 @@
+/**
+ * 计量数据管理
+*/
+import request from '../../index'
+
+// 计量数据管理列表
+export function getMeasureDataList(data: { offset: number; limit: number }) {
+ return request({
+ url: `/business/certificateReport/approval/listPage?offset=${data.offset}&limit=${data.limit}`,
+ method: 'post',
+ data,
+ })
+}
+
+// 点击下载模板后生成证书
+export function downLoadTemplate(data: any) {
+ return request({
+ url: '/business/certificateReport/exportFile',
+ method: 'post',
+ data,
+ responseType: 'blob',
+ })
+}
+
+// 新增
+export function addMeasureData(data: any) {
+ return request({
+ url: '/business/certificateReport/save',
+ method: 'post',
+ data,
+ })
+}
+
+// 草稿箱更新
+export function draftUpdateMeasureData(data: any) {
+ return request({
+ url: '/business/certificateReport/draftUpdate',
+ method: 'post',
+ data,
+ })
+}
+
+// 未通过-驳回编辑
+export function failUpdateMeasureData(data: any) {
+ return request({
+ url: '/business/certificateReport/failUpdate',
+ method: 'post',
+ data,
+ })
+}
+
+// 提交
+export function submit(data: { formId: string; processId?: string; id: string }) {
+ return request({
+ url: '/business/certificateReport/submit',
+ method: 'post',
+ data,
+ })
+}
+
+// 详情
+export function getMeasureDataDetail(data: { id: string }) {
+ return request({
+ url: '/business/certificateReport/detail',
+ method: 'post',
+ data,
+ })
+}
+
+// 删除
+export function deleteMeasureData(data: any) {
+ return request({
+ url: '/business/certificateReport/batchDelete',
+ method: 'post',
+ data,
+ })
+}
+
diff --git a/src/api/business/subpackage/apply.ts b/src/api/business/subpackage/apply.ts
index ad17a5a..c778f8e 100644
--- a/src/api/business/subpackage/apply.ts
+++ b/src/api/business/subpackage/apply.ts
@@ -94,3 +94,4 @@
data,
})
}
+
diff --git a/src/api/system/tool.ts b/src/api/system/tool.ts
index 6b2f5f2..8223e4c 100644
--- a/src/api/system/tool.ts
+++ b/src/api/system/tool.ts
@@ -67,19 +67,10 @@
data,
})
}
-// 原始记录模板/证书报告模板列表(分页)
-export interface listParamsType {
- templateNo: string // 编号
- templateName: string // 名称
- templateCreator: string // 负责人
- // createTime: string // 创建时间
- limit: number
- offset: number
- templateType: string
-}
-export function templatePage(data: listParamsType) {
+
+export function templatePage(data: any) {
return request({
- url: `${prefix}/template/listPage?limit=${data.limit}&offset=${data.offset}`,
+ url: `${prefix}template/listPage?limit=${data.limit}&offset=${data.offset}`,
method: 'post',
data,
})
@@ -87,7 +78,7 @@
// 原始记录模板/证书报告模板列表/详情(
export function templatePageDetail(data: object) {
return request({
- url: `${prefix}/template/detail`,
+ url: `${prefix}template/detail`,
method: 'post',
data,
})
@@ -95,7 +86,7 @@
// 原始记录模板/证书报告模板列表删除
export function templateDelete(data: object) {
return request({
- url: `${prefix}/template/delete`,
+ url: `${prefix}template/delete`,
method: 'post',
data,
})
@@ -103,7 +94,7 @@
// 原始记录模板/证书报告模板列表新建
export function templateAdd(data: object) {
return request({
- url: `${prefix}/template/add`,
+ url: `${prefix}template/add`,
method: 'post',
data,
})
@@ -111,7 +102,7 @@
// 原始记录模板/证书报告模板列表更新
export function templateUpdate(data: object) {
return request({
- url: `${prefix}/template/update`,
+ url: `${prefix}template/update`,
method: 'post',
data,
})
@@ -119,7 +110,7 @@
// 原始记录模板/证书报告模板列表导出
export function templateExport(data: object) {
return request({
- url: `${prefix}/template/listExport`,
+ url: `${prefix}template/listExport`,
method: 'post',
data,
responseType: 'blob',
diff --git a/src/components.d.ts b/src/components.d.ts
index edc2e04..64cf608 100644
--- a/src/components.d.ts
+++ b/src/components.d.ts
@@ -46,6 +46,7 @@
ImageUpload: typeof import('./components/ImageUpload/index.vue')['default']
LineChart: typeof import('./components/Echart/LineChart.vue')['default']
MeasureRecords: typeof import('./components/Sample/measureRecords.vue')['default']
+ MultiHeaderTable: typeof import('./components/MultiHeaderTable/index.vue')['default']
NodeWrap: typeof import('./components/workFlow/nodeWrap.vue')['default']
NodeWrapBan: typeof import('./components/workFlow/nodeWrapBan.vue')['default']
NormalTable: typeof import('./components/NormalTable/index.vue')['default']
@@ -67,6 +68,7 @@
SelectStaffDialog: typeof import('./components/dialog/selectStaffDialog.vue')['default']
SvgIcon: typeof import('./components/SvgIcon/index.vue')['default']
SystemInfo: typeof import('./components/SystemInfo/index.vue')['default']
+ TableColumn: typeof import('./components/MultiHeaderTable/tableColumn.vue')['default']
TableContainer: typeof import('./components/TableContainer/index.vue')['default']
Trend: typeof import('./components/Trend/index.vue')['default']
WordOreview: typeof import('./components/filePreview/wordOreview.vue')['default']
diff --git a/src/components/MultiHeaderTable/index.vue b/src/components/MultiHeaderTable/index.vue
new file mode 100644
index 0000000..85b8c88
--- /dev/null
+++ b/src/components/MultiHeaderTable/index.vue
@@ -0,0 +1,343 @@
+
+
+
+
+
+
+
diff --git a/src/components/MultiHeaderTable/tableColumn.vue b/src/components/MultiHeaderTable/tableColumn.vue
new file mode 100644
index 0000000..2b87285
--- /dev/null
+++ b/src/components/MultiHeaderTable/tableColumn.vue
@@ -0,0 +1,147 @@
+
+
+
+
+
+
+
+
+
+
+ *{{ item.text }}
+
+
+ *{{ item.text }}
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ scope.row[item.value] }}
+
+
+ {{
+ scope.row[item.value]
+ }}
+
+
+
+
+
+
diff --git a/src/components/NormalTable/index.vue b/src/components/NormalTable/index.vue
index e56f775..67092d3 100644
--- a/src/components/NormalTable/index.vue
+++ b/src/components/NormalTable/index.vue
@@ -3,6 +3,7 @@
import { ElTable } from 'element-plus'
import { defineExpose, ref } from 'vue'
import type { TableColumn } from './table_interface'
+import showPhoto from '@/views/system/tool/showPhoto.vue'
// ------------------定义props、 emit-------------------
const props = defineProps({
@@ -212,8 +213,8 @@
{{ scope.row[column.value] }}
{{ column.filter(scope.row) }}
- {{ scope.row }}
-
+
+
diff --git a/src/api/business/lab/measureData.ts b/src/api/business/lab/measureData.ts
new file mode 100644
index 0000000..ab3a56e
--- /dev/null
+++ b/src/api/business/lab/measureData.ts
@@ -0,0 +1,78 @@
+/**
+ * 计量数据管理
+*/
+import request from '../../index'
+
+// 计量数据管理列表
+export function getMeasureDataList(data: { offset: number; limit: number }) {
+ return request({
+ url: `/business/certificateReport/approval/listPage?offset=${data.offset}&limit=${data.limit}`,
+ method: 'post',
+ data,
+ })
+}
+
+// 点击下载模板后生成证书
+export function downLoadTemplate(data: any) {
+ return request({
+ url: '/business/certificateReport/exportFile',
+ method: 'post',
+ data,
+ responseType: 'blob',
+ })
+}
+
+// 新增
+export function addMeasureData(data: any) {
+ return request({
+ url: '/business/certificateReport/save',
+ method: 'post',
+ data,
+ })
+}
+
+// 草稿箱更新
+export function draftUpdateMeasureData(data: any) {
+ return request({
+ url: '/business/certificateReport/draftUpdate',
+ method: 'post',
+ data,
+ })
+}
+
+// 未通过-驳回编辑
+export function failUpdateMeasureData(data: any) {
+ return request({
+ url: '/business/certificateReport/failUpdate',
+ method: 'post',
+ data,
+ })
+}
+
+// 提交
+export function submit(data: { formId: string; processId?: string; id: string }) {
+ return request({
+ url: '/business/certificateReport/submit',
+ method: 'post',
+ data,
+ })
+}
+
+// 详情
+export function getMeasureDataDetail(data: { id: string }) {
+ return request({
+ url: '/business/certificateReport/detail',
+ method: 'post',
+ data,
+ })
+}
+
+// 删除
+export function deleteMeasureData(data: any) {
+ return request({
+ url: '/business/certificateReport/batchDelete',
+ method: 'post',
+ data,
+ })
+}
+
diff --git a/src/api/business/subpackage/apply.ts b/src/api/business/subpackage/apply.ts
index ad17a5a..c778f8e 100644
--- a/src/api/business/subpackage/apply.ts
+++ b/src/api/business/subpackage/apply.ts
@@ -94,3 +94,4 @@
data,
})
}
+
diff --git a/src/api/system/tool.ts b/src/api/system/tool.ts
index 6b2f5f2..8223e4c 100644
--- a/src/api/system/tool.ts
+++ b/src/api/system/tool.ts
@@ -67,19 +67,10 @@
data,
})
}
-// 原始记录模板/证书报告模板列表(分页)
-export interface listParamsType {
- templateNo: string // 编号
- templateName: string // 名称
- templateCreator: string // 负责人
- // createTime: string // 创建时间
- limit: number
- offset: number
- templateType: string
-}
-export function templatePage(data: listParamsType) {
+
+export function templatePage(data: any) {
return request({
- url: `${prefix}/template/listPage?limit=${data.limit}&offset=${data.offset}`,
+ url: `${prefix}template/listPage?limit=${data.limit}&offset=${data.offset}`,
method: 'post',
data,
})
@@ -87,7 +78,7 @@
// 原始记录模板/证书报告模板列表/详情(
export function templatePageDetail(data: object) {
return request({
- url: `${prefix}/template/detail`,
+ url: `${prefix}template/detail`,
method: 'post',
data,
})
@@ -95,7 +86,7 @@
// 原始记录模板/证书报告模板列表删除
export function templateDelete(data: object) {
return request({
- url: `${prefix}/template/delete`,
+ url: `${prefix}template/delete`,
method: 'post',
data,
})
@@ -103,7 +94,7 @@
// 原始记录模板/证书报告模板列表新建
export function templateAdd(data: object) {
return request({
- url: `${prefix}/template/add`,
+ url: `${prefix}template/add`,
method: 'post',
data,
})
@@ -111,7 +102,7 @@
// 原始记录模板/证书报告模板列表更新
export function templateUpdate(data: object) {
return request({
- url: `${prefix}/template/update`,
+ url: `${prefix}template/update`,
method: 'post',
data,
})
@@ -119,7 +110,7 @@
// 原始记录模板/证书报告模板列表导出
export function templateExport(data: object) {
return request({
- url: `${prefix}/template/listExport`,
+ url: `${prefix}template/listExport`,
method: 'post',
data,
responseType: 'blob',
diff --git a/src/components.d.ts b/src/components.d.ts
index edc2e04..64cf608 100644
--- a/src/components.d.ts
+++ b/src/components.d.ts
@@ -46,6 +46,7 @@
ImageUpload: typeof import('./components/ImageUpload/index.vue')['default']
LineChart: typeof import('./components/Echart/LineChart.vue')['default']
MeasureRecords: typeof import('./components/Sample/measureRecords.vue')['default']
+ MultiHeaderTable: typeof import('./components/MultiHeaderTable/index.vue')['default']
NodeWrap: typeof import('./components/workFlow/nodeWrap.vue')['default']
NodeWrapBan: typeof import('./components/workFlow/nodeWrapBan.vue')['default']
NormalTable: typeof import('./components/NormalTable/index.vue')['default']
@@ -67,6 +68,7 @@
SelectStaffDialog: typeof import('./components/dialog/selectStaffDialog.vue')['default']
SvgIcon: typeof import('./components/SvgIcon/index.vue')['default']
SystemInfo: typeof import('./components/SystemInfo/index.vue')['default']
+ TableColumn: typeof import('./components/MultiHeaderTable/tableColumn.vue')['default']
TableContainer: typeof import('./components/TableContainer/index.vue')['default']
Trend: typeof import('./components/Trend/index.vue')['default']
WordOreview: typeof import('./components/filePreview/wordOreview.vue')['default']
diff --git a/src/components/MultiHeaderTable/index.vue b/src/components/MultiHeaderTable/index.vue
new file mode 100644
index 0000000..85b8c88
--- /dev/null
+++ b/src/components/MultiHeaderTable/index.vue
@@ -0,0 +1,343 @@
+
+
+
+
+
+
+
diff --git a/src/components/MultiHeaderTable/tableColumn.vue b/src/components/MultiHeaderTable/tableColumn.vue
new file mode 100644
index 0000000..2b87285
--- /dev/null
+++ b/src/components/MultiHeaderTable/tableColumn.vue
@@ -0,0 +1,147 @@
+
+
+
+
+
+
+
+
+
+
+ *{{ item.text }}
+
+
+ *{{ item.text }}
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ scope.row[item.value] }}
+
+
+ {{
+ scope.row[item.value]
+ }}
+
+
+
+
+
+
diff --git a/src/components/NormalTable/index.vue b/src/components/NormalTable/index.vue
index e56f775..67092d3 100644
--- a/src/components/NormalTable/index.vue
+++ b/src/components/NormalTable/index.vue
@@ -3,6 +3,7 @@
import { ElTable } from 'element-plus'
import { defineExpose, ref } from 'vue'
import type { TableColumn } from './table_interface'
+import showPhoto from '@/views/system/tool/showPhoto.vue'
// ------------------定义props、 emit-------------------
const props = defineProps({
@@ -212,8 +213,8 @@
{{ scope.row[column.value] }}
{{ column.filter(scope.row) }}
- {{ scope.row }}
-
+
+
diff --git a/src/utils/useCheckList.ts b/src/utils/useCheckList.ts
new file mode 100644
index 0000000..c7782f0
--- /dev/null
+++ b/src/utils/useCheckList.ts
@@ -0,0 +1,73 @@
+import { ElMessage } from 'element-plus'
+// import type { TableColumn } from '@/components/NormalTable/table_interface'
+
+/**
+ * 检查列表
+ * @param list 要检查的表格数据(被依赖项如果满足某个条件就去检查依赖项,否则不检查依赖项)
+ * @param columns // 表头信息
+ * @param tableTitle // 表格名称
+ * @param depend // 依赖项
+ * @param depended // 被依赖项
+ * @param dependedValue // 被依赖项条件
+ * @param requireLength // 要检查的表格数据长度是否大于0
+ */
+export default function useCheckList(list: any, columns: any, tableTitle = '', depend?: string, depended?: string, dependedValue?: number | string, requireLength = false): boolean {
+ for (const prop of columns) {
+ for (let index = 0; index < list.length; index++) {
+ const item = list[index]
+
+ if (depend && depended && item[depended] === dependedValue && !(`${item[prop.value]}`)) { // 被依赖项满足条件时需要检查
+ ElMessage.warning(`请先完善 ${tableTitle} 第${index + 1}行中 ${prop.text} 字段`)
+ return false
+ }
+ else {
+ // 检查必填
+ if (prop.required && (!(`${item[prop.value]}`) || `${item[prop.value]}` === 'null' || `${item[prop.value]}` === 'undefined' || item[prop.value] == undefined)) {
+ if (`${prop.belongStandardEquipment}` === '15') { // 小功率
+ ElMessage.warning(`${tableTitle} 第${index + 1}行中 ${prop.message} ${prop.text} 字段不能为空`)
+ }
+ else {
+ ElMessage.warning(`请先完善 ${tableTitle} 第${index + 1}行中 ${prop.text} 字段`)
+ }
+ return false
+ }
+ }
+
+ // 验证正则
+ if (prop.reg && typeof prop.reg === 'function') {
+ if (prop.value === 'resolution') { // 分辨力特殊处理
+ if (!prop.reg(item[prop.value])) {
+ ElMessage.warning(`${tableTitle} 第${index + 1}行中 ${prop.text} 不能大于1`)
+ return false
+ }
+ }
+ else {
+ if (!prop.reg(item[prop.value])) {
+ if (`${prop.belongStandardEquipment}` === '15') { // 小功率
+ ElMessage.warning(`${tableTitle} 第${index + 1}行中 ${prop.message} ${prop.text} 字段不能为0`)
+ }
+ else if (`${prop.belongStandardEquipment}` === '17') { // S参数
+ ElMessage.warning(`${tableTitle} 第${index + 1}行中 ${prop.text} 仅允许输入数字、字母、特殊字符`)
+ }
+ else {
+ ElMessage.warning(`${tableTitle} 第${index + 1}行中 ${prop.text} 字段输入不合法`)
+ }
+ return false
+ }
+ }
+ }
+
+ if (prop.children && prop.children.length) {
+ if (!useCheckList(list, prop.children, tableTitle, depend, depended, dependedValue)) {
+ return false
+ }
+ }
+ }
+ }
+
+ if (requireLength && !list.length) {
+ ElMessage.warning(`${tableTitle}表格数据不能为空`)
+ return false
+ }
+ return true
+}
diff --git a/src/api/business/lab/measureData.ts b/src/api/business/lab/measureData.ts
new file mode 100644
index 0000000..ab3a56e
--- /dev/null
+++ b/src/api/business/lab/measureData.ts
@@ -0,0 +1,78 @@
+/**
+ * 计量数据管理
+*/
+import request from '../../index'
+
+// 计量数据管理列表
+export function getMeasureDataList(data: { offset: number; limit: number }) {
+ return request({
+ url: `/business/certificateReport/approval/listPage?offset=${data.offset}&limit=${data.limit}`,
+ method: 'post',
+ data,
+ })
+}
+
+// 点击下载模板后生成证书
+export function downLoadTemplate(data: any) {
+ return request({
+ url: '/business/certificateReport/exportFile',
+ method: 'post',
+ data,
+ responseType: 'blob',
+ })
+}
+
+// 新增
+export function addMeasureData(data: any) {
+ return request({
+ url: '/business/certificateReport/save',
+ method: 'post',
+ data,
+ })
+}
+
+// 草稿箱更新
+export function draftUpdateMeasureData(data: any) {
+ return request({
+ url: '/business/certificateReport/draftUpdate',
+ method: 'post',
+ data,
+ })
+}
+
+// 未通过-驳回编辑
+export function failUpdateMeasureData(data: any) {
+ return request({
+ url: '/business/certificateReport/failUpdate',
+ method: 'post',
+ data,
+ })
+}
+
+// 提交
+export function submit(data: { formId: string; processId?: string; id: string }) {
+ return request({
+ url: '/business/certificateReport/submit',
+ method: 'post',
+ data,
+ })
+}
+
+// 详情
+export function getMeasureDataDetail(data: { id: string }) {
+ return request({
+ url: '/business/certificateReport/detail',
+ method: 'post',
+ data,
+ })
+}
+
+// 删除
+export function deleteMeasureData(data: any) {
+ return request({
+ url: '/business/certificateReport/batchDelete',
+ method: 'post',
+ data,
+ })
+}
+
diff --git a/src/api/business/subpackage/apply.ts b/src/api/business/subpackage/apply.ts
index ad17a5a..c778f8e 100644
--- a/src/api/business/subpackage/apply.ts
+++ b/src/api/business/subpackage/apply.ts
@@ -94,3 +94,4 @@
data,
})
}
+
diff --git a/src/api/system/tool.ts b/src/api/system/tool.ts
index 6b2f5f2..8223e4c 100644
--- a/src/api/system/tool.ts
+++ b/src/api/system/tool.ts
@@ -67,19 +67,10 @@
data,
})
}
-// 原始记录模板/证书报告模板列表(分页)
-export interface listParamsType {
- templateNo: string // 编号
- templateName: string // 名称
- templateCreator: string // 负责人
- // createTime: string // 创建时间
- limit: number
- offset: number
- templateType: string
-}
-export function templatePage(data: listParamsType) {
+
+export function templatePage(data: any) {
return request({
- url: `${prefix}/template/listPage?limit=${data.limit}&offset=${data.offset}`,
+ url: `${prefix}template/listPage?limit=${data.limit}&offset=${data.offset}`,
method: 'post',
data,
})
@@ -87,7 +78,7 @@
// 原始记录模板/证书报告模板列表/详情(
export function templatePageDetail(data: object) {
return request({
- url: `${prefix}/template/detail`,
+ url: `${prefix}template/detail`,
method: 'post',
data,
})
@@ -95,7 +86,7 @@
// 原始记录模板/证书报告模板列表删除
export function templateDelete(data: object) {
return request({
- url: `${prefix}/template/delete`,
+ url: `${prefix}template/delete`,
method: 'post',
data,
})
@@ -103,7 +94,7 @@
// 原始记录模板/证书报告模板列表新建
export function templateAdd(data: object) {
return request({
- url: `${prefix}/template/add`,
+ url: `${prefix}template/add`,
method: 'post',
data,
})
@@ -111,7 +102,7 @@
// 原始记录模板/证书报告模板列表更新
export function templateUpdate(data: object) {
return request({
- url: `${prefix}/template/update`,
+ url: `${prefix}template/update`,
method: 'post',
data,
})
@@ -119,7 +110,7 @@
// 原始记录模板/证书报告模板列表导出
export function templateExport(data: object) {
return request({
- url: `${prefix}/template/listExport`,
+ url: `${prefix}template/listExport`,
method: 'post',
data,
responseType: 'blob',
diff --git a/src/components.d.ts b/src/components.d.ts
index edc2e04..64cf608 100644
--- a/src/components.d.ts
+++ b/src/components.d.ts
@@ -46,6 +46,7 @@
ImageUpload: typeof import('./components/ImageUpload/index.vue')['default']
LineChart: typeof import('./components/Echart/LineChart.vue')['default']
MeasureRecords: typeof import('./components/Sample/measureRecords.vue')['default']
+ MultiHeaderTable: typeof import('./components/MultiHeaderTable/index.vue')['default']
NodeWrap: typeof import('./components/workFlow/nodeWrap.vue')['default']
NodeWrapBan: typeof import('./components/workFlow/nodeWrapBan.vue')['default']
NormalTable: typeof import('./components/NormalTable/index.vue')['default']
@@ -67,6 +68,7 @@
SelectStaffDialog: typeof import('./components/dialog/selectStaffDialog.vue')['default']
SvgIcon: typeof import('./components/SvgIcon/index.vue')['default']
SystemInfo: typeof import('./components/SystemInfo/index.vue')['default']
+ TableColumn: typeof import('./components/MultiHeaderTable/tableColumn.vue')['default']
TableContainer: typeof import('./components/TableContainer/index.vue')['default']
Trend: typeof import('./components/Trend/index.vue')['default']
WordOreview: typeof import('./components/filePreview/wordOreview.vue')['default']
diff --git a/src/components/MultiHeaderTable/index.vue b/src/components/MultiHeaderTable/index.vue
new file mode 100644
index 0000000..85b8c88
--- /dev/null
+++ b/src/components/MultiHeaderTable/index.vue
@@ -0,0 +1,343 @@
+
+
+
+
+
+
+
diff --git a/src/components/MultiHeaderTable/tableColumn.vue b/src/components/MultiHeaderTable/tableColumn.vue
new file mode 100644
index 0000000..2b87285
--- /dev/null
+++ b/src/components/MultiHeaderTable/tableColumn.vue
@@ -0,0 +1,147 @@
+
+
+
+
+
+
+
+
+
+
+ *{{ item.text }}
+
+
+ *{{ item.text }}
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ scope.row[item.value] }}
+
+
+ {{
+ scope.row[item.value]
+ }}
+
+
+
+
+
+
diff --git a/src/components/NormalTable/index.vue b/src/components/NormalTable/index.vue
index e56f775..67092d3 100644
--- a/src/components/NormalTable/index.vue
+++ b/src/components/NormalTable/index.vue
@@ -3,6 +3,7 @@
import { ElTable } from 'element-plus'
import { defineExpose, ref } from 'vue'
import type { TableColumn } from './table_interface'
+import showPhoto from '@/views/system/tool/showPhoto.vue'
// ------------------定义props、 emit-------------------
const props = defineProps({
@@ -212,8 +213,8 @@
{{ scope.row[column.value] }}
{{ column.filter(scope.row) }}
- {{ scope.row }}
-
+
+
diff --git a/src/utils/useCheckList.ts b/src/utils/useCheckList.ts
new file mode 100644
index 0000000..c7782f0
--- /dev/null
+++ b/src/utils/useCheckList.ts
@@ -0,0 +1,73 @@
+import { ElMessage } from 'element-plus'
+// import type { TableColumn } from '@/components/NormalTable/table_interface'
+
+/**
+ * 检查列表
+ * @param list 要检查的表格数据(被依赖项如果满足某个条件就去检查依赖项,否则不检查依赖项)
+ * @param columns // 表头信息
+ * @param tableTitle // 表格名称
+ * @param depend // 依赖项
+ * @param depended // 被依赖项
+ * @param dependedValue // 被依赖项条件
+ * @param requireLength // 要检查的表格数据长度是否大于0
+ */
+export default function useCheckList(list: any, columns: any, tableTitle = '', depend?: string, depended?: string, dependedValue?: number | string, requireLength = false): boolean {
+ for (const prop of columns) {
+ for (let index = 0; index < list.length; index++) {
+ const item = list[index]
+
+ if (depend && depended && item[depended] === dependedValue && !(`${item[prop.value]}`)) { // 被依赖项满足条件时需要检查
+ ElMessage.warning(`请先完善 ${tableTitle} 第${index + 1}行中 ${prop.text} 字段`)
+ return false
+ }
+ else {
+ // 检查必填
+ if (prop.required && (!(`${item[prop.value]}`) || `${item[prop.value]}` === 'null' || `${item[prop.value]}` === 'undefined' || item[prop.value] == undefined)) {
+ if (`${prop.belongStandardEquipment}` === '15') { // 小功率
+ ElMessage.warning(`${tableTitle} 第${index + 1}行中 ${prop.message} ${prop.text} 字段不能为空`)
+ }
+ else {
+ ElMessage.warning(`请先完善 ${tableTitle} 第${index + 1}行中 ${prop.text} 字段`)
+ }
+ return false
+ }
+ }
+
+ // 验证正则
+ if (prop.reg && typeof prop.reg === 'function') {
+ if (prop.value === 'resolution') { // 分辨力特殊处理
+ if (!prop.reg(item[prop.value])) {
+ ElMessage.warning(`${tableTitle} 第${index + 1}行中 ${prop.text} 不能大于1`)
+ return false
+ }
+ }
+ else {
+ if (!prop.reg(item[prop.value])) {
+ if (`${prop.belongStandardEquipment}` === '15') { // 小功率
+ ElMessage.warning(`${tableTitle} 第${index + 1}行中 ${prop.message} ${prop.text} 字段不能为0`)
+ }
+ else if (`${prop.belongStandardEquipment}` === '17') { // S参数
+ ElMessage.warning(`${tableTitle} 第${index + 1}行中 ${prop.text} 仅允许输入数字、字母、特殊字符`)
+ }
+ else {
+ ElMessage.warning(`${tableTitle} 第${index + 1}行中 ${prop.text} 字段输入不合法`)
+ }
+ return false
+ }
+ }
+ }
+
+ if (prop.children && prop.children.length) {
+ if (!useCheckList(list, prop.children, tableTitle, depend, depended, dependedValue)) {
+ return false
+ }
+ }
+ }
+ }
+
+ if (requireLength && !list.length) {
+ ElMessage.warning(`${tableTitle}表格数据不能为空`)
+ return false
+ }
+ return true
+}
diff --git a/src/views/business/lab/components/selectOrderSamplesDialog.vue b/src/views/business/lab/components/selectOrderSamplesDialog.vue
index 4002f83..b004107 100644
--- a/src/views/business/lab/components/selectOrderSamplesDialog.vue
+++ b/src/views/business/lab/components/selectOrderSamplesDialog.vue
@@ -14,6 +14,7 @@
const loadingTable = ref(false) // loading
const list = ref([]) // 表格参数
const tableRef = ref()
+const isMulti = ref(true) // 是否多选默认为多选
const columns = ref
([
{ text: '被测样品名称', value: 'sampleName', align: 'center', required: true },
{ text: '型号规格', value: 'sampleModel', align: 'center', required: true },
@@ -60,9 +61,10 @@
}
// 初始化
-const initDialog = (orderIdParam: string) => {
+const initDialog = (orderIdParam: string, isMultiParam = true) => {
dialogFormVisible.value = true
orderId.value = orderIdParam
+ isMulti.value = isMultiParam
getList()
}
defineExpose({ initDialog })
@@ -78,7 +80,7 @@
:columns="columns"
is-showmulti-select
:list-loading="loadingTable"
- :is-multi="true"
+ :is-multi="isMulti"
:height="300"
:pagination="false"
@multi-select="handleSelectionChange"
diff --git a/src/api/business/lab/measureData.ts b/src/api/business/lab/measureData.ts
new file mode 100644
index 0000000..ab3a56e
--- /dev/null
+++ b/src/api/business/lab/measureData.ts
@@ -0,0 +1,78 @@
+/**
+ * 计量数据管理
+*/
+import request from '../../index'
+
+// 计量数据管理列表
+export function getMeasureDataList(data: { offset: number; limit: number }) {
+ return request({
+ url: `/business/certificateReport/approval/listPage?offset=${data.offset}&limit=${data.limit}`,
+ method: 'post',
+ data,
+ })
+}
+
+// 点击下载模板后生成证书
+export function downLoadTemplate(data: any) {
+ return request({
+ url: '/business/certificateReport/exportFile',
+ method: 'post',
+ data,
+ responseType: 'blob',
+ })
+}
+
+// 新增
+export function addMeasureData(data: any) {
+ return request({
+ url: '/business/certificateReport/save',
+ method: 'post',
+ data,
+ })
+}
+
+// 草稿箱更新
+export function draftUpdateMeasureData(data: any) {
+ return request({
+ url: '/business/certificateReport/draftUpdate',
+ method: 'post',
+ data,
+ })
+}
+
+// 未通过-驳回编辑
+export function failUpdateMeasureData(data: any) {
+ return request({
+ url: '/business/certificateReport/failUpdate',
+ method: 'post',
+ data,
+ })
+}
+
+// 提交
+export function submit(data: { formId: string; processId?: string; id: string }) {
+ return request({
+ url: '/business/certificateReport/submit',
+ method: 'post',
+ data,
+ })
+}
+
+// 详情
+export function getMeasureDataDetail(data: { id: string }) {
+ return request({
+ url: '/business/certificateReport/detail',
+ method: 'post',
+ data,
+ })
+}
+
+// 删除
+export function deleteMeasureData(data: any) {
+ return request({
+ url: '/business/certificateReport/batchDelete',
+ method: 'post',
+ data,
+ })
+}
+
diff --git a/src/api/business/subpackage/apply.ts b/src/api/business/subpackage/apply.ts
index ad17a5a..c778f8e 100644
--- a/src/api/business/subpackage/apply.ts
+++ b/src/api/business/subpackage/apply.ts
@@ -94,3 +94,4 @@
data,
})
}
+
diff --git a/src/api/system/tool.ts b/src/api/system/tool.ts
index 6b2f5f2..8223e4c 100644
--- a/src/api/system/tool.ts
+++ b/src/api/system/tool.ts
@@ -67,19 +67,10 @@
data,
})
}
-// 原始记录模板/证书报告模板列表(分页)
-export interface listParamsType {
- templateNo: string // 编号
- templateName: string // 名称
- templateCreator: string // 负责人
- // createTime: string // 创建时间
- limit: number
- offset: number
- templateType: string
-}
-export function templatePage(data: listParamsType) {
+
+export function templatePage(data: any) {
return request({
- url: `${prefix}/template/listPage?limit=${data.limit}&offset=${data.offset}`,
+ url: `${prefix}template/listPage?limit=${data.limit}&offset=${data.offset}`,
method: 'post',
data,
})
@@ -87,7 +78,7 @@
// 原始记录模板/证书报告模板列表/详情(
export function templatePageDetail(data: object) {
return request({
- url: `${prefix}/template/detail`,
+ url: `${prefix}template/detail`,
method: 'post',
data,
})
@@ -95,7 +86,7 @@
// 原始记录模板/证书报告模板列表删除
export function templateDelete(data: object) {
return request({
- url: `${prefix}/template/delete`,
+ url: `${prefix}template/delete`,
method: 'post',
data,
})
@@ -103,7 +94,7 @@
// 原始记录模板/证书报告模板列表新建
export function templateAdd(data: object) {
return request({
- url: `${prefix}/template/add`,
+ url: `${prefix}template/add`,
method: 'post',
data,
})
@@ -111,7 +102,7 @@
// 原始记录模板/证书报告模板列表更新
export function templateUpdate(data: object) {
return request({
- url: `${prefix}/template/update`,
+ url: `${prefix}template/update`,
method: 'post',
data,
})
@@ -119,7 +110,7 @@
// 原始记录模板/证书报告模板列表导出
export function templateExport(data: object) {
return request({
- url: `${prefix}/template/listExport`,
+ url: `${prefix}template/listExport`,
method: 'post',
data,
responseType: 'blob',
diff --git a/src/components.d.ts b/src/components.d.ts
index edc2e04..64cf608 100644
--- a/src/components.d.ts
+++ b/src/components.d.ts
@@ -46,6 +46,7 @@
ImageUpload: typeof import('./components/ImageUpload/index.vue')['default']
LineChart: typeof import('./components/Echart/LineChart.vue')['default']
MeasureRecords: typeof import('./components/Sample/measureRecords.vue')['default']
+ MultiHeaderTable: typeof import('./components/MultiHeaderTable/index.vue')['default']
NodeWrap: typeof import('./components/workFlow/nodeWrap.vue')['default']
NodeWrapBan: typeof import('./components/workFlow/nodeWrapBan.vue')['default']
NormalTable: typeof import('./components/NormalTable/index.vue')['default']
@@ -67,6 +68,7 @@
SelectStaffDialog: typeof import('./components/dialog/selectStaffDialog.vue')['default']
SvgIcon: typeof import('./components/SvgIcon/index.vue')['default']
SystemInfo: typeof import('./components/SystemInfo/index.vue')['default']
+ TableColumn: typeof import('./components/MultiHeaderTable/tableColumn.vue')['default']
TableContainer: typeof import('./components/TableContainer/index.vue')['default']
Trend: typeof import('./components/Trend/index.vue')['default']
WordOreview: typeof import('./components/filePreview/wordOreview.vue')['default']
diff --git a/src/components/MultiHeaderTable/index.vue b/src/components/MultiHeaderTable/index.vue
new file mode 100644
index 0000000..85b8c88
--- /dev/null
+++ b/src/components/MultiHeaderTable/index.vue
@@ -0,0 +1,343 @@
+
+
+
+
+
+
+
diff --git a/src/components/MultiHeaderTable/tableColumn.vue b/src/components/MultiHeaderTable/tableColumn.vue
new file mode 100644
index 0000000..2b87285
--- /dev/null
+++ b/src/components/MultiHeaderTable/tableColumn.vue
@@ -0,0 +1,147 @@
+
+
+
+
+
+
+
+
+
+
+ *{{ item.text }}
+
+
+ *{{ item.text }}
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ scope.row[item.value] }}
+
+
+ {{
+ scope.row[item.value]
+ }}
+
+
+
+
+
+
diff --git a/src/components/NormalTable/index.vue b/src/components/NormalTable/index.vue
index e56f775..67092d3 100644
--- a/src/components/NormalTable/index.vue
+++ b/src/components/NormalTable/index.vue
@@ -3,6 +3,7 @@
import { ElTable } from 'element-plus'
import { defineExpose, ref } from 'vue'
import type { TableColumn } from './table_interface'
+import showPhoto from '@/views/system/tool/showPhoto.vue'
// ------------------定义props、 emit-------------------
const props = defineProps({
@@ -212,8 +213,8 @@
{{ scope.row[column.value] }}
{{ column.filter(scope.row) }}
- {{ scope.row }}
-
+
+
diff --git a/src/utils/useCheckList.ts b/src/utils/useCheckList.ts
new file mode 100644
index 0000000..c7782f0
--- /dev/null
+++ b/src/utils/useCheckList.ts
@@ -0,0 +1,73 @@
+import { ElMessage } from 'element-plus'
+// import type { TableColumn } from '@/components/NormalTable/table_interface'
+
+/**
+ * 检查列表
+ * @param list 要检查的表格数据(被依赖项如果满足某个条件就去检查依赖项,否则不检查依赖项)
+ * @param columns // 表头信息
+ * @param tableTitle // 表格名称
+ * @param depend // 依赖项
+ * @param depended // 被依赖项
+ * @param dependedValue // 被依赖项条件
+ * @param requireLength // 要检查的表格数据长度是否大于0
+ */
+export default function useCheckList(list: any, columns: any, tableTitle = '', depend?: string, depended?: string, dependedValue?: number | string, requireLength = false): boolean {
+ for (const prop of columns) {
+ for (let index = 0; index < list.length; index++) {
+ const item = list[index]
+
+ if (depend && depended && item[depended] === dependedValue && !(`${item[prop.value]}`)) { // 被依赖项满足条件时需要检查
+ ElMessage.warning(`请先完善 ${tableTitle} 第${index + 1}行中 ${prop.text} 字段`)
+ return false
+ }
+ else {
+ // 检查必填
+ if (prop.required && (!(`${item[prop.value]}`) || `${item[prop.value]}` === 'null' || `${item[prop.value]}` === 'undefined' || item[prop.value] == undefined)) {
+ if (`${prop.belongStandardEquipment}` === '15') { // 小功率
+ ElMessage.warning(`${tableTitle} 第${index + 1}行中 ${prop.message} ${prop.text} 字段不能为空`)
+ }
+ else {
+ ElMessage.warning(`请先完善 ${tableTitle} 第${index + 1}行中 ${prop.text} 字段`)
+ }
+ return false
+ }
+ }
+
+ // 验证正则
+ if (prop.reg && typeof prop.reg === 'function') {
+ if (prop.value === 'resolution') { // 分辨力特殊处理
+ if (!prop.reg(item[prop.value])) {
+ ElMessage.warning(`${tableTitle} 第${index + 1}行中 ${prop.text} 不能大于1`)
+ return false
+ }
+ }
+ else {
+ if (!prop.reg(item[prop.value])) {
+ if (`${prop.belongStandardEquipment}` === '15') { // 小功率
+ ElMessage.warning(`${tableTitle} 第${index + 1}行中 ${prop.message} ${prop.text} 字段不能为0`)
+ }
+ else if (`${prop.belongStandardEquipment}` === '17') { // S参数
+ ElMessage.warning(`${tableTitle} 第${index + 1}行中 ${prop.text} 仅允许输入数字、字母、特殊字符`)
+ }
+ else {
+ ElMessage.warning(`${tableTitle} 第${index + 1}行中 ${prop.text} 字段输入不合法`)
+ }
+ return false
+ }
+ }
+ }
+
+ if (prop.children && prop.children.length) {
+ if (!useCheckList(list, prop.children, tableTitle, depend, depended, dependedValue)) {
+ return false
+ }
+ }
+ }
+ }
+
+ if (requireLength && !list.length) {
+ ElMessage.warning(`${tableTitle}表格数据不能为空`)
+ return false
+ }
+ return true
+}
diff --git a/src/views/business/lab/components/selectOrderSamplesDialog.vue b/src/views/business/lab/components/selectOrderSamplesDialog.vue
index 4002f83..b004107 100644
--- a/src/views/business/lab/components/selectOrderSamplesDialog.vue
+++ b/src/views/business/lab/components/selectOrderSamplesDialog.vue
@@ -14,6 +14,7 @@
const loadingTable = ref(false) // loading
const list = ref([]) // 表格参数
const tableRef = ref()
+const isMulti = ref(true) // 是否多选默认为多选
const columns = ref
([
{ text: '被测样品名称', value: 'sampleName', align: 'center', required: true },
{ text: '型号规格', value: 'sampleModel', align: 'center', required: true },
@@ -60,9 +61,10 @@
}
// 初始化
-const initDialog = (orderIdParam: string) => {
+const initDialog = (orderIdParam: string, isMultiParam = true) => {
dialogFormVisible.value = true
orderId.value = orderIdParam
+ isMulti.value = isMultiParam
getList()
}
defineExpose({ initDialog })
@@ -78,7 +80,7 @@
:columns="columns"
is-showmulti-select
:list-loading="loadingTable"
- :is-multi="true"
+ :is-multi="isMulti"
:height="300"
:pagination="false"
@multi-select="handleSelectionChange"
diff --git a/src/views/business/lab/components/selectReportTemplate.vue b/src/views/business/lab/components/selectReportTemplate.vue
index 5c59693..ec36ef7 100644
--- a/src/views/business/lab/components/selectReportTemplate.vue
+++ b/src/views/business/lab/components/selectReportTemplate.vue
@@ -7,8 +7,9 @@
import type { typeofSign } from '@/views/system/tool/tool_interface'
import { templatePage } from '@/api/system/tool'
-const emits = defineEmits(['add'])
+const emits = defineEmits(['confirm'])
const dialogFormVisible = ref(false) // 控制弹窗显隐
+const createTime = ref()
// 查询参数
const searchQuery = reactive({
templateNo: '', // 编号
@@ -18,31 +19,43 @@
createEndTime: '',
limit: 5,
offset: 1,
- templateType: '',
+ certificationType: '0',
ids: [] as string[],
}) // 查询参数
const loadingTable = ref(false) // loading
const list = ref([]) // 表格参数
const total = ref(0)
const columns = ref([
- { text: '编号', value: 'templateNo', align: 'center', width: '180' },
- { text: '模板名称', value: 'templateName', align: 'center', width: '150' },
- { text: '模板负责人', value: 'templateCreator', align: 'center', width: '100' },
- { text: '创建时间', value: 'createTime', align: 'center', width: '250' },
- { text: '描述', value: 'templateDesc', align: 'center' },
+ { text: '编号', value: 'templateNo', align: 'center', width: '160' },
+ { text: '模板名称', value: 'templateName', align: 'center' },
+ { text: '模板类型', value: 'templateTypeName', align: 'center', width: '100' },
+ { text: '负责人', value: 'templateCreator', align: 'center', width: '100' },
+ { text: '内容描述', value: 'templateDesc', align: 'center' },
+ { text: '创建时间', value: 'createTime', align: 'center', width: '180' },
])
const checkoutList = ref([]) // 多选选中参数
-// 获取类型
-const getType = async () => {
- const res = await getDictByCode('templateType')
- searchQuery.templateType = res.data.filter((item: typeofSign) => item.name === '证书报告模板')[0].value
+// ---------------------------------------字典--------------------------------------------
+const templateTypeMap = ref([]) as any // 模板类型
+// 获取字典值
+async function getDict() {
+ // 模板类型
+ const res = await getDictByCode('certificationType')
+ res.data.forEach((item: { value: string; name: string }) => {
+ templateTypeMap.value[`${item.value}`] = item.name
+ })
}
+// ----------------------------------------------------------------------------------------------
// 获取数据列表
const getList = () => {
loadingTable.value = true
templatePage(searchQuery).then((res) => {
if (res.code === 200) {
- list.value = res.data.rows
+ list.value = res.data.rows.map((item: { certificationType: string }) => {
+ return {
+ ...item,
+ templateTypeName: `${item.certificationType}` ? templateTypeMap.value[item.certificationType] : item.certificationType, // 模板类型
+ }
+ })
total.value = res.data.total
}
loadingTable.value = false
@@ -74,7 +87,8 @@
searchQuery.createEndTime = ''
searchQuery.limit = 5
searchQuery.offset = 1
- // searchQuery.templateType = '' // 类型不能变
+ searchQuery.certificationType = '0'
+ createTime.value = ''
searchQuery.ids = []
getList()
}
@@ -82,10 +96,10 @@
// 点击保存
const submitForm = () => {
if (!checkoutList.value.length) {
- ElMessage.warning('请选择证书报告模板')
+ ElMessage.warning('请选择证书模板')
}
else {
- emits('add', checkoutList.value[0])
+ emits('confirm', checkoutList.value[0])
dialogFormVisible.value = false
}
}
@@ -103,15 +117,25 @@
// 初始化
const initDialog = () => {
dialogFormVisible.value = true
- getType().then((_) => {
+ getDict().then((_) => {
getList()
})
}
+watch(() => createTime.value, (newVal) => {
+ if (newVal) {
+ searchQuery.createStartTime = newVal[0]
+ searchQuery.createEndTime = newVal[1]
+ }
+ else {
+ searchQuery.createStartTime = ''
+ searchQuery.createEndTime = ''
+ }
+})
defineExpose({ initDialog })
-
+
@@ -121,7 +145,18 @@
-
+
+
+
+
diff --git a/src/api/business/lab/measureData.ts b/src/api/business/lab/measureData.ts
new file mode 100644
index 0000000..ab3a56e
--- /dev/null
+++ b/src/api/business/lab/measureData.ts
@@ -0,0 +1,78 @@
+/**
+ * 计量数据管理
+*/
+import request from '../../index'
+
+// 计量数据管理列表
+export function getMeasureDataList(data: { offset: number; limit: number }) {
+ return request({
+ url: `/business/certificateReport/approval/listPage?offset=${data.offset}&limit=${data.limit}`,
+ method: 'post',
+ data,
+ })
+}
+
+// 点击下载模板后生成证书
+export function downLoadTemplate(data: any) {
+ return request({
+ url: '/business/certificateReport/exportFile',
+ method: 'post',
+ data,
+ responseType: 'blob',
+ })
+}
+
+// 新增
+export function addMeasureData(data: any) {
+ return request({
+ url: '/business/certificateReport/save',
+ method: 'post',
+ data,
+ })
+}
+
+// 草稿箱更新
+export function draftUpdateMeasureData(data: any) {
+ return request({
+ url: '/business/certificateReport/draftUpdate',
+ method: 'post',
+ data,
+ })
+}
+
+// 未通过-驳回编辑
+export function failUpdateMeasureData(data: any) {
+ return request({
+ url: '/business/certificateReport/failUpdate',
+ method: 'post',
+ data,
+ })
+}
+
+// 提交
+export function submit(data: { formId: string; processId?: string; id: string }) {
+ return request({
+ url: '/business/certificateReport/submit',
+ method: 'post',
+ data,
+ })
+}
+
+// 详情
+export function getMeasureDataDetail(data: { id: string }) {
+ return request({
+ url: '/business/certificateReport/detail',
+ method: 'post',
+ data,
+ })
+}
+
+// 删除
+export function deleteMeasureData(data: any) {
+ return request({
+ url: '/business/certificateReport/batchDelete',
+ method: 'post',
+ data,
+ })
+}
+
diff --git a/src/api/business/subpackage/apply.ts b/src/api/business/subpackage/apply.ts
index ad17a5a..c778f8e 100644
--- a/src/api/business/subpackage/apply.ts
+++ b/src/api/business/subpackage/apply.ts
@@ -94,3 +94,4 @@
data,
})
}
+
diff --git a/src/api/system/tool.ts b/src/api/system/tool.ts
index 6b2f5f2..8223e4c 100644
--- a/src/api/system/tool.ts
+++ b/src/api/system/tool.ts
@@ -67,19 +67,10 @@
data,
})
}
-// 原始记录模板/证书报告模板列表(分页)
-export interface listParamsType {
- templateNo: string // 编号
- templateName: string // 名称
- templateCreator: string // 负责人
- // createTime: string // 创建时间
- limit: number
- offset: number
- templateType: string
-}
-export function templatePage(data: listParamsType) {
+
+export function templatePage(data: any) {
return request({
- url: `${prefix}/template/listPage?limit=${data.limit}&offset=${data.offset}`,
+ url: `${prefix}template/listPage?limit=${data.limit}&offset=${data.offset}`,
method: 'post',
data,
})
@@ -87,7 +78,7 @@
// 原始记录模板/证书报告模板列表/详情(
export function templatePageDetail(data: object) {
return request({
- url: `${prefix}/template/detail`,
+ url: `${prefix}template/detail`,
method: 'post',
data,
})
@@ -95,7 +86,7 @@
// 原始记录模板/证书报告模板列表删除
export function templateDelete(data: object) {
return request({
- url: `${prefix}/template/delete`,
+ url: `${prefix}template/delete`,
method: 'post',
data,
})
@@ -103,7 +94,7 @@
// 原始记录模板/证书报告模板列表新建
export function templateAdd(data: object) {
return request({
- url: `${prefix}/template/add`,
+ url: `${prefix}template/add`,
method: 'post',
data,
})
@@ -111,7 +102,7 @@
// 原始记录模板/证书报告模板列表更新
export function templateUpdate(data: object) {
return request({
- url: `${prefix}/template/update`,
+ url: `${prefix}template/update`,
method: 'post',
data,
})
@@ -119,7 +110,7 @@
// 原始记录模板/证书报告模板列表导出
export function templateExport(data: object) {
return request({
- url: `${prefix}/template/listExport`,
+ url: `${prefix}template/listExport`,
method: 'post',
data,
responseType: 'blob',
diff --git a/src/components.d.ts b/src/components.d.ts
index edc2e04..64cf608 100644
--- a/src/components.d.ts
+++ b/src/components.d.ts
@@ -46,6 +46,7 @@
ImageUpload: typeof import('./components/ImageUpload/index.vue')['default']
LineChart: typeof import('./components/Echart/LineChart.vue')['default']
MeasureRecords: typeof import('./components/Sample/measureRecords.vue')['default']
+ MultiHeaderTable: typeof import('./components/MultiHeaderTable/index.vue')['default']
NodeWrap: typeof import('./components/workFlow/nodeWrap.vue')['default']
NodeWrapBan: typeof import('./components/workFlow/nodeWrapBan.vue')['default']
NormalTable: typeof import('./components/NormalTable/index.vue')['default']
@@ -67,6 +68,7 @@
SelectStaffDialog: typeof import('./components/dialog/selectStaffDialog.vue')['default']
SvgIcon: typeof import('./components/SvgIcon/index.vue')['default']
SystemInfo: typeof import('./components/SystemInfo/index.vue')['default']
+ TableColumn: typeof import('./components/MultiHeaderTable/tableColumn.vue')['default']
TableContainer: typeof import('./components/TableContainer/index.vue')['default']
Trend: typeof import('./components/Trend/index.vue')['default']
WordOreview: typeof import('./components/filePreview/wordOreview.vue')['default']
diff --git a/src/components/MultiHeaderTable/index.vue b/src/components/MultiHeaderTable/index.vue
new file mode 100644
index 0000000..85b8c88
--- /dev/null
+++ b/src/components/MultiHeaderTable/index.vue
@@ -0,0 +1,343 @@
+
+
+
+
+
+
+
diff --git a/src/components/MultiHeaderTable/tableColumn.vue b/src/components/MultiHeaderTable/tableColumn.vue
new file mode 100644
index 0000000..2b87285
--- /dev/null
+++ b/src/components/MultiHeaderTable/tableColumn.vue
@@ -0,0 +1,147 @@
+
+
+
+
+
+
+
+
+
+
+ *{{ item.text }}
+
+
+ *{{ item.text }}
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ scope.row[item.value] }}
+
+
+ {{
+ scope.row[item.value]
+ }}
+
+
+
+
+
+
diff --git a/src/components/NormalTable/index.vue b/src/components/NormalTable/index.vue
index e56f775..67092d3 100644
--- a/src/components/NormalTable/index.vue
+++ b/src/components/NormalTable/index.vue
@@ -3,6 +3,7 @@
import { ElTable } from 'element-plus'
import { defineExpose, ref } from 'vue'
import type { TableColumn } from './table_interface'
+import showPhoto from '@/views/system/tool/showPhoto.vue'
// ------------------定义props、 emit-------------------
const props = defineProps({
@@ -212,8 +213,8 @@
{{ scope.row[column.value] }}
{{ column.filter(scope.row) }}
- {{ scope.row }}
-
+
+
diff --git a/src/utils/useCheckList.ts b/src/utils/useCheckList.ts
new file mode 100644
index 0000000..c7782f0
--- /dev/null
+++ b/src/utils/useCheckList.ts
@@ -0,0 +1,73 @@
+import { ElMessage } from 'element-plus'
+// import type { TableColumn } from '@/components/NormalTable/table_interface'
+
+/**
+ * 检查列表
+ * @param list 要检查的表格数据(被依赖项如果满足某个条件就去检查依赖项,否则不检查依赖项)
+ * @param columns // 表头信息
+ * @param tableTitle // 表格名称
+ * @param depend // 依赖项
+ * @param depended // 被依赖项
+ * @param dependedValue // 被依赖项条件
+ * @param requireLength // 要检查的表格数据长度是否大于0
+ */
+export default function useCheckList(list: any, columns: any, tableTitle = '', depend?: string, depended?: string, dependedValue?: number | string, requireLength = false): boolean {
+ for (const prop of columns) {
+ for (let index = 0; index < list.length; index++) {
+ const item = list[index]
+
+ if (depend && depended && item[depended] === dependedValue && !(`${item[prop.value]}`)) { // 被依赖项满足条件时需要检查
+ ElMessage.warning(`请先完善 ${tableTitle} 第${index + 1}行中 ${prop.text} 字段`)
+ return false
+ }
+ else {
+ // 检查必填
+ if (prop.required && (!(`${item[prop.value]}`) || `${item[prop.value]}` === 'null' || `${item[prop.value]}` === 'undefined' || item[prop.value] == undefined)) {
+ if (`${prop.belongStandardEquipment}` === '15') { // 小功率
+ ElMessage.warning(`${tableTitle} 第${index + 1}行中 ${prop.message} ${prop.text} 字段不能为空`)
+ }
+ else {
+ ElMessage.warning(`请先完善 ${tableTitle} 第${index + 1}行中 ${prop.text} 字段`)
+ }
+ return false
+ }
+ }
+
+ // 验证正则
+ if (prop.reg && typeof prop.reg === 'function') {
+ if (prop.value === 'resolution') { // 分辨力特殊处理
+ if (!prop.reg(item[prop.value])) {
+ ElMessage.warning(`${tableTitle} 第${index + 1}行中 ${prop.text} 不能大于1`)
+ return false
+ }
+ }
+ else {
+ if (!prop.reg(item[prop.value])) {
+ if (`${prop.belongStandardEquipment}` === '15') { // 小功率
+ ElMessage.warning(`${tableTitle} 第${index + 1}行中 ${prop.message} ${prop.text} 字段不能为0`)
+ }
+ else if (`${prop.belongStandardEquipment}` === '17') { // S参数
+ ElMessage.warning(`${tableTitle} 第${index + 1}行中 ${prop.text} 仅允许输入数字、字母、特殊字符`)
+ }
+ else {
+ ElMessage.warning(`${tableTitle} 第${index + 1}行中 ${prop.text} 字段输入不合法`)
+ }
+ return false
+ }
+ }
+ }
+
+ if (prop.children && prop.children.length) {
+ if (!useCheckList(list, prop.children, tableTitle, depend, depended, dependedValue)) {
+ return false
+ }
+ }
+ }
+ }
+
+ if (requireLength && !list.length) {
+ ElMessage.warning(`${tableTitle}表格数据不能为空`)
+ return false
+ }
+ return true
+}
diff --git a/src/views/business/lab/components/selectOrderSamplesDialog.vue b/src/views/business/lab/components/selectOrderSamplesDialog.vue
index 4002f83..b004107 100644
--- a/src/views/business/lab/components/selectOrderSamplesDialog.vue
+++ b/src/views/business/lab/components/selectOrderSamplesDialog.vue
@@ -14,6 +14,7 @@
const loadingTable = ref(false) // loading
const list = ref([]) // 表格参数
const tableRef = ref()
+const isMulti = ref(true) // 是否多选默认为多选
const columns = ref
([
{ text: '被测样品名称', value: 'sampleName', align: 'center', required: true },
{ text: '型号规格', value: 'sampleModel', align: 'center', required: true },
@@ -60,9 +61,10 @@
}
// 初始化
-const initDialog = (orderIdParam: string) => {
+const initDialog = (orderIdParam: string, isMultiParam = true) => {
dialogFormVisible.value = true
orderId.value = orderIdParam
+ isMulti.value = isMultiParam
getList()
}
defineExpose({ initDialog })
@@ -78,7 +80,7 @@
:columns="columns"
is-showmulti-select
:list-loading="loadingTable"
- :is-multi="true"
+ :is-multi="isMulti"
:height="300"
:pagination="false"
@multi-select="handleSelectionChange"
diff --git a/src/views/business/lab/components/selectReportTemplate.vue b/src/views/business/lab/components/selectReportTemplate.vue
index 5c59693..ec36ef7 100644
--- a/src/views/business/lab/components/selectReportTemplate.vue
+++ b/src/views/business/lab/components/selectReportTemplate.vue
@@ -7,8 +7,9 @@
import type { typeofSign } from '@/views/system/tool/tool_interface'
import { templatePage } from '@/api/system/tool'
-const emits = defineEmits(['add'])
+const emits = defineEmits(['confirm'])
const dialogFormVisible = ref(false) // 控制弹窗显隐
+const createTime = ref()
// 查询参数
const searchQuery = reactive({
templateNo: '', // 编号
@@ -18,31 +19,43 @@
createEndTime: '',
limit: 5,
offset: 1,
- templateType: '',
+ certificationType: '0',
ids: [] as string[],
}) // 查询参数
const loadingTable = ref(false) // loading
const list = ref([]) // 表格参数
const total = ref(0)
const columns = ref([
- { text: '编号', value: 'templateNo', align: 'center', width: '180' },
- { text: '模板名称', value: 'templateName', align: 'center', width: '150' },
- { text: '模板负责人', value: 'templateCreator', align: 'center', width: '100' },
- { text: '创建时间', value: 'createTime', align: 'center', width: '250' },
- { text: '描述', value: 'templateDesc', align: 'center' },
+ { text: '编号', value: 'templateNo', align: 'center', width: '160' },
+ { text: '模板名称', value: 'templateName', align: 'center' },
+ { text: '模板类型', value: 'templateTypeName', align: 'center', width: '100' },
+ { text: '负责人', value: 'templateCreator', align: 'center', width: '100' },
+ { text: '内容描述', value: 'templateDesc', align: 'center' },
+ { text: '创建时间', value: 'createTime', align: 'center', width: '180' },
])
const checkoutList = ref([]) // 多选选中参数
-// 获取类型
-const getType = async () => {
- const res = await getDictByCode('templateType')
- searchQuery.templateType = res.data.filter((item: typeofSign) => item.name === '证书报告模板')[0].value
+// ---------------------------------------字典--------------------------------------------
+const templateTypeMap = ref([]) as any // 模板类型
+// 获取字典值
+async function getDict() {
+ // 模板类型
+ const res = await getDictByCode('certificationType')
+ res.data.forEach((item: { value: string; name: string }) => {
+ templateTypeMap.value[`${item.value}`] = item.name
+ })
}
+// ----------------------------------------------------------------------------------------------
// 获取数据列表
const getList = () => {
loadingTable.value = true
templatePage(searchQuery).then((res) => {
if (res.code === 200) {
- list.value = res.data.rows
+ list.value = res.data.rows.map((item: { certificationType: string }) => {
+ return {
+ ...item,
+ templateTypeName: `${item.certificationType}` ? templateTypeMap.value[item.certificationType] : item.certificationType, // 模板类型
+ }
+ })
total.value = res.data.total
}
loadingTable.value = false
@@ -74,7 +87,8 @@
searchQuery.createEndTime = ''
searchQuery.limit = 5
searchQuery.offset = 1
- // searchQuery.templateType = '' // 类型不能变
+ searchQuery.certificationType = '0'
+ createTime.value = ''
searchQuery.ids = []
getList()
}
@@ -82,10 +96,10 @@
// 点击保存
const submitForm = () => {
if (!checkoutList.value.length) {
- ElMessage.warning('请选择证书报告模板')
+ ElMessage.warning('请选择证书模板')
}
else {
- emits('add', checkoutList.value[0])
+ emits('confirm', checkoutList.value[0])
dialogFormVisible.value = false
}
}
@@ -103,15 +117,25 @@
// 初始化
const initDialog = () => {
dialogFormVisible.value = true
- getType().then((_) => {
+ getDict().then((_) => {
getList()
})
}
+watch(() => createTime.value, (newVal) => {
+ if (newVal) {
+ searchQuery.createStartTime = newVal[0]
+ searchQuery.createEndTime = newVal[1]
+ }
+ else {
+ searchQuery.createStartTime = ''
+ searchQuery.createEndTime = ''
+ }
+})
defineExpose({ initDialog })
-
+
@@ -121,7 +145,18 @@
-
+
+
+
+
diff --git a/src/views/business/lab/measureData/dialog/selectMeasueDataDialog.vue b/src/views/business/lab/measureData/dialog/selectMeasueDataDialog.vue
new file mode 100644
index 0000000..f8be703
--- /dev/null
+++ b/src/views/business/lab/measureData/dialog/selectMeasueDataDialog.vue
@@ -0,0 +1,199 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ (listQuery.offset - 1) * listQuery.limit + scope.$index + 1 }}
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/api/business/lab/measureData.ts b/src/api/business/lab/measureData.ts
new file mode 100644
index 0000000..ab3a56e
--- /dev/null
+++ b/src/api/business/lab/measureData.ts
@@ -0,0 +1,78 @@
+/**
+ * 计量数据管理
+*/
+import request from '../../index'
+
+// 计量数据管理列表
+export function getMeasureDataList(data: { offset: number; limit: number }) {
+ return request({
+ url: `/business/certificateReport/approval/listPage?offset=${data.offset}&limit=${data.limit}`,
+ method: 'post',
+ data,
+ })
+}
+
+// 点击下载模板后生成证书
+export function downLoadTemplate(data: any) {
+ return request({
+ url: '/business/certificateReport/exportFile',
+ method: 'post',
+ data,
+ responseType: 'blob',
+ })
+}
+
+// 新增
+export function addMeasureData(data: any) {
+ return request({
+ url: '/business/certificateReport/save',
+ method: 'post',
+ data,
+ })
+}
+
+// 草稿箱更新
+export function draftUpdateMeasureData(data: any) {
+ return request({
+ url: '/business/certificateReport/draftUpdate',
+ method: 'post',
+ data,
+ })
+}
+
+// 未通过-驳回编辑
+export function failUpdateMeasureData(data: any) {
+ return request({
+ url: '/business/certificateReport/failUpdate',
+ method: 'post',
+ data,
+ })
+}
+
+// 提交
+export function submit(data: { formId: string; processId?: string; id: string }) {
+ return request({
+ url: '/business/certificateReport/submit',
+ method: 'post',
+ data,
+ })
+}
+
+// 详情
+export function getMeasureDataDetail(data: { id: string }) {
+ return request({
+ url: '/business/certificateReport/detail',
+ method: 'post',
+ data,
+ })
+}
+
+// 删除
+export function deleteMeasureData(data: any) {
+ return request({
+ url: '/business/certificateReport/batchDelete',
+ method: 'post',
+ data,
+ })
+}
+
diff --git a/src/api/business/subpackage/apply.ts b/src/api/business/subpackage/apply.ts
index ad17a5a..c778f8e 100644
--- a/src/api/business/subpackage/apply.ts
+++ b/src/api/business/subpackage/apply.ts
@@ -94,3 +94,4 @@
data,
})
}
+
diff --git a/src/api/system/tool.ts b/src/api/system/tool.ts
index 6b2f5f2..8223e4c 100644
--- a/src/api/system/tool.ts
+++ b/src/api/system/tool.ts
@@ -67,19 +67,10 @@
data,
})
}
-// 原始记录模板/证书报告模板列表(分页)
-export interface listParamsType {
- templateNo: string // 编号
- templateName: string // 名称
- templateCreator: string // 负责人
- // createTime: string // 创建时间
- limit: number
- offset: number
- templateType: string
-}
-export function templatePage(data: listParamsType) {
+
+export function templatePage(data: any) {
return request({
- url: `${prefix}/template/listPage?limit=${data.limit}&offset=${data.offset}`,
+ url: `${prefix}template/listPage?limit=${data.limit}&offset=${data.offset}`,
method: 'post',
data,
})
@@ -87,7 +78,7 @@
// 原始记录模板/证书报告模板列表/详情(
export function templatePageDetail(data: object) {
return request({
- url: `${prefix}/template/detail`,
+ url: `${prefix}template/detail`,
method: 'post',
data,
})
@@ -95,7 +86,7 @@
// 原始记录模板/证书报告模板列表删除
export function templateDelete(data: object) {
return request({
- url: `${prefix}/template/delete`,
+ url: `${prefix}template/delete`,
method: 'post',
data,
})
@@ -103,7 +94,7 @@
// 原始记录模板/证书报告模板列表新建
export function templateAdd(data: object) {
return request({
- url: `${prefix}/template/add`,
+ url: `${prefix}template/add`,
method: 'post',
data,
})
@@ -111,7 +102,7 @@
// 原始记录模板/证书报告模板列表更新
export function templateUpdate(data: object) {
return request({
- url: `${prefix}/template/update`,
+ url: `${prefix}template/update`,
method: 'post',
data,
})
@@ -119,7 +110,7 @@
// 原始记录模板/证书报告模板列表导出
export function templateExport(data: object) {
return request({
- url: `${prefix}/template/listExport`,
+ url: `${prefix}template/listExport`,
method: 'post',
data,
responseType: 'blob',
diff --git a/src/components.d.ts b/src/components.d.ts
index edc2e04..64cf608 100644
--- a/src/components.d.ts
+++ b/src/components.d.ts
@@ -46,6 +46,7 @@
ImageUpload: typeof import('./components/ImageUpload/index.vue')['default']
LineChart: typeof import('./components/Echart/LineChart.vue')['default']
MeasureRecords: typeof import('./components/Sample/measureRecords.vue')['default']
+ MultiHeaderTable: typeof import('./components/MultiHeaderTable/index.vue')['default']
NodeWrap: typeof import('./components/workFlow/nodeWrap.vue')['default']
NodeWrapBan: typeof import('./components/workFlow/nodeWrapBan.vue')['default']
NormalTable: typeof import('./components/NormalTable/index.vue')['default']
@@ -67,6 +68,7 @@
SelectStaffDialog: typeof import('./components/dialog/selectStaffDialog.vue')['default']
SvgIcon: typeof import('./components/SvgIcon/index.vue')['default']
SystemInfo: typeof import('./components/SystemInfo/index.vue')['default']
+ TableColumn: typeof import('./components/MultiHeaderTable/tableColumn.vue')['default']
TableContainer: typeof import('./components/TableContainer/index.vue')['default']
Trend: typeof import('./components/Trend/index.vue')['default']
WordOreview: typeof import('./components/filePreview/wordOreview.vue')['default']
diff --git a/src/components/MultiHeaderTable/index.vue b/src/components/MultiHeaderTable/index.vue
new file mode 100644
index 0000000..85b8c88
--- /dev/null
+++ b/src/components/MultiHeaderTable/index.vue
@@ -0,0 +1,343 @@
+
+
+
+
+
+
+
diff --git a/src/components/MultiHeaderTable/tableColumn.vue b/src/components/MultiHeaderTable/tableColumn.vue
new file mode 100644
index 0000000..2b87285
--- /dev/null
+++ b/src/components/MultiHeaderTable/tableColumn.vue
@@ -0,0 +1,147 @@
+
+
+
+
+
+
+
+
+
+
+ *{{ item.text }}
+
+
+ *{{ item.text }}
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ scope.row[item.value] }}
+
+
+ {{
+ scope.row[item.value]
+ }}
+
+
+
+
+
+
diff --git a/src/components/NormalTable/index.vue b/src/components/NormalTable/index.vue
index e56f775..67092d3 100644
--- a/src/components/NormalTable/index.vue
+++ b/src/components/NormalTable/index.vue
@@ -3,6 +3,7 @@
import { ElTable } from 'element-plus'
import { defineExpose, ref } from 'vue'
import type { TableColumn } from './table_interface'
+import showPhoto from '@/views/system/tool/showPhoto.vue'
// ------------------定义props、 emit-------------------
const props = defineProps({
@@ -212,8 +213,8 @@
{{ scope.row[column.value] }}
{{ column.filter(scope.row) }}
- {{ scope.row }}
-
+
+
diff --git a/src/utils/useCheckList.ts b/src/utils/useCheckList.ts
new file mode 100644
index 0000000..c7782f0
--- /dev/null
+++ b/src/utils/useCheckList.ts
@@ -0,0 +1,73 @@
+import { ElMessage } from 'element-plus'
+// import type { TableColumn } from '@/components/NormalTable/table_interface'
+
+/**
+ * 检查列表
+ * @param list 要检查的表格数据(被依赖项如果满足某个条件就去检查依赖项,否则不检查依赖项)
+ * @param columns // 表头信息
+ * @param tableTitle // 表格名称
+ * @param depend // 依赖项
+ * @param depended // 被依赖项
+ * @param dependedValue // 被依赖项条件
+ * @param requireLength // 要检查的表格数据长度是否大于0
+ */
+export default function useCheckList(list: any, columns: any, tableTitle = '', depend?: string, depended?: string, dependedValue?: number | string, requireLength = false): boolean {
+ for (const prop of columns) {
+ for (let index = 0; index < list.length; index++) {
+ const item = list[index]
+
+ if (depend && depended && item[depended] === dependedValue && !(`${item[prop.value]}`)) { // 被依赖项满足条件时需要检查
+ ElMessage.warning(`请先完善 ${tableTitle} 第${index + 1}行中 ${prop.text} 字段`)
+ return false
+ }
+ else {
+ // 检查必填
+ if (prop.required && (!(`${item[prop.value]}`) || `${item[prop.value]}` === 'null' || `${item[prop.value]}` === 'undefined' || item[prop.value] == undefined)) {
+ if (`${prop.belongStandardEquipment}` === '15') { // 小功率
+ ElMessage.warning(`${tableTitle} 第${index + 1}行中 ${prop.message} ${prop.text} 字段不能为空`)
+ }
+ else {
+ ElMessage.warning(`请先完善 ${tableTitle} 第${index + 1}行中 ${prop.text} 字段`)
+ }
+ return false
+ }
+ }
+
+ // 验证正则
+ if (prop.reg && typeof prop.reg === 'function') {
+ if (prop.value === 'resolution') { // 分辨力特殊处理
+ if (!prop.reg(item[prop.value])) {
+ ElMessage.warning(`${tableTitle} 第${index + 1}行中 ${prop.text} 不能大于1`)
+ return false
+ }
+ }
+ else {
+ if (!prop.reg(item[prop.value])) {
+ if (`${prop.belongStandardEquipment}` === '15') { // 小功率
+ ElMessage.warning(`${tableTitle} 第${index + 1}行中 ${prop.message} ${prop.text} 字段不能为0`)
+ }
+ else if (`${prop.belongStandardEquipment}` === '17') { // S参数
+ ElMessage.warning(`${tableTitle} 第${index + 1}行中 ${prop.text} 仅允许输入数字、字母、特殊字符`)
+ }
+ else {
+ ElMessage.warning(`${tableTitle} 第${index + 1}行中 ${prop.text} 字段输入不合法`)
+ }
+ return false
+ }
+ }
+ }
+
+ if (prop.children && prop.children.length) {
+ if (!useCheckList(list, prop.children, tableTitle, depend, depended, dependedValue)) {
+ return false
+ }
+ }
+ }
+ }
+
+ if (requireLength && !list.length) {
+ ElMessage.warning(`${tableTitle}表格数据不能为空`)
+ return false
+ }
+ return true
+}
diff --git a/src/views/business/lab/components/selectOrderSamplesDialog.vue b/src/views/business/lab/components/selectOrderSamplesDialog.vue
index 4002f83..b004107 100644
--- a/src/views/business/lab/components/selectOrderSamplesDialog.vue
+++ b/src/views/business/lab/components/selectOrderSamplesDialog.vue
@@ -14,6 +14,7 @@
const loadingTable = ref(false) // loading
const list = ref([]) // 表格参数
const tableRef = ref()
+const isMulti = ref(true) // 是否多选默认为多选
const columns = ref
([
{ text: '被测样品名称', value: 'sampleName', align: 'center', required: true },
{ text: '型号规格', value: 'sampleModel', align: 'center', required: true },
@@ -60,9 +61,10 @@
}
// 初始化
-const initDialog = (orderIdParam: string) => {
+const initDialog = (orderIdParam: string, isMultiParam = true) => {
dialogFormVisible.value = true
orderId.value = orderIdParam
+ isMulti.value = isMultiParam
getList()
}
defineExpose({ initDialog })
@@ -78,7 +80,7 @@
:columns="columns"
is-showmulti-select
:list-loading="loadingTable"
- :is-multi="true"
+ :is-multi="isMulti"
:height="300"
:pagination="false"
@multi-select="handleSelectionChange"
diff --git a/src/views/business/lab/components/selectReportTemplate.vue b/src/views/business/lab/components/selectReportTemplate.vue
index 5c59693..ec36ef7 100644
--- a/src/views/business/lab/components/selectReportTemplate.vue
+++ b/src/views/business/lab/components/selectReportTemplate.vue
@@ -7,8 +7,9 @@
import type { typeofSign } from '@/views/system/tool/tool_interface'
import { templatePage } from '@/api/system/tool'
-const emits = defineEmits(['add'])
+const emits = defineEmits(['confirm'])
const dialogFormVisible = ref(false) // 控制弹窗显隐
+const createTime = ref()
// 查询参数
const searchQuery = reactive({
templateNo: '', // 编号
@@ -18,31 +19,43 @@
createEndTime: '',
limit: 5,
offset: 1,
- templateType: '',
+ certificationType: '0',
ids: [] as string[],
}) // 查询参数
const loadingTable = ref(false) // loading
const list = ref([]) // 表格参数
const total = ref(0)
const columns = ref([
- { text: '编号', value: 'templateNo', align: 'center', width: '180' },
- { text: '模板名称', value: 'templateName', align: 'center', width: '150' },
- { text: '模板负责人', value: 'templateCreator', align: 'center', width: '100' },
- { text: '创建时间', value: 'createTime', align: 'center', width: '250' },
- { text: '描述', value: 'templateDesc', align: 'center' },
+ { text: '编号', value: 'templateNo', align: 'center', width: '160' },
+ { text: '模板名称', value: 'templateName', align: 'center' },
+ { text: '模板类型', value: 'templateTypeName', align: 'center', width: '100' },
+ { text: '负责人', value: 'templateCreator', align: 'center', width: '100' },
+ { text: '内容描述', value: 'templateDesc', align: 'center' },
+ { text: '创建时间', value: 'createTime', align: 'center', width: '180' },
])
const checkoutList = ref([]) // 多选选中参数
-// 获取类型
-const getType = async () => {
- const res = await getDictByCode('templateType')
- searchQuery.templateType = res.data.filter((item: typeofSign) => item.name === '证书报告模板')[0].value
+// ---------------------------------------字典--------------------------------------------
+const templateTypeMap = ref([]) as any // 模板类型
+// 获取字典值
+async function getDict() {
+ // 模板类型
+ const res = await getDictByCode('certificationType')
+ res.data.forEach((item: { value: string; name: string }) => {
+ templateTypeMap.value[`${item.value}`] = item.name
+ })
}
+// ----------------------------------------------------------------------------------------------
// 获取数据列表
const getList = () => {
loadingTable.value = true
templatePage(searchQuery).then((res) => {
if (res.code === 200) {
- list.value = res.data.rows
+ list.value = res.data.rows.map((item: { certificationType: string }) => {
+ return {
+ ...item,
+ templateTypeName: `${item.certificationType}` ? templateTypeMap.value[item.certificationType] : item.certificationType, // 模板类型
+ }
+ })
total.value = res.data.total
}
loadingTable.value = false
@@ -74,7 +87,8 @@
searchQuery.createEndTime = ''
searchQuery.limit = 5
searchQuery.offset = 1
- // searchQuery.templateType = '' // 类型不能变
+ searchQuery.certificationType = '0'
+ createTime.value = ''
searchQuery.ids = []
getList()
}
@@ -82,10 +96,10 @@
// 点击保存
const submitForm = () => {
if (!checkoutList.value.length) {
- ElMessage.warning('请选择证书报告模板')
+ ElMessage.warning('请选择证书模板')
}
else {
- emits('add', checkoutList.value[0])
+ emits('confirm', checkoutList.value[0])
dialogFormVisible.value = false
}
}
@@ -103,15 +117,25 @@
// 初始化
const initDialog = () => {
dialogFormVisible.value = true
- getType().then((_) => {
+ getDict().then((_) => {
getList()
})
}
+watch(() => createTime.value, (newVal) => {
+ if (newVal) {
+ searchQuery.createStartTime = newVal[0]
+ searchQuery.createEndTime = newVal[1]
+ }
+ else {
+ searchQuery.createStartTime = ''
+ searchQuery.createEndTime = ''
+ }
+})
defineExpose({ initDialog })
-
+
@@ -121,7 +145,18 @@
-
+
+
+
+
diff --git a/src/views/business/lab/measureData/dialog/selectMeasueDataDialog.vue b/src/views/business/lab/measureData/dialog/selectMeasueDataDialog.vue
new file mode 100644
index 0000000..f8be703
--- /dev/null
+++ b/src/views/business/lab/measureData/dialog/selectMeasueDataDialog.vue
@@ -0,0 +1,199 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ (listQuery.offset - 1) * listQuery.limit + scope.$index + 1 }}
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/views/business/lab/measureData/dialog/selectTechFilesDialog.vue b/src/views/business/lab/measureData/dialog/selectTechFilesDialog.vue
new file mode 100644
index 0000000..f6f1a5a
--- /dev/null
+++ b/src/views/business/lab/measureData/dialog/selectTechFilesDialog.vue
@@ -0,0 +1,247 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ (listQuery.offset - 1) * listQuery.limit + scope.$index + 1 }}
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/api/business/lab/measureData.ts b/src/api/business/lab/measureData.ts
new file mode 100644
index 0000000..ab3a56e
--- /dev/null
+++ b/src/api/business/lab/measureData.ts
@@ -0,0 +1,78 @@
+/**
+ * 计量数据管理
+*/
+import request from '../../index'
+
+// 计量数据管理列表
+export function getMeasureDataList(data: { offset: number; limit: number }) {
+ return request({
+ url: `/business/certificateReport/approval/listPage?offset=${data.offset}&limit=${data.limit}`,
+ method: 'post',
+ data,
+ })
+}
+
+// 点击下载模板后生成证书
+export function downLoadTemplate(data: any) {
+ return request({
+ url: '/business/certificateReport/exportFile',
+ method: 'post',
+ data,
+ responseType: 'blob',
+ })
+}
+
+// 新增
+export function addMeasureData(data: any) {
+ return request({
+ url: '/business/certificateReport/save',
+ method: 'post',
+ data,
+ })
+}
+
+// 草稿箱更新
+export function draftUpdateMeasureData(data: any) {
+ return request({
+ url: '/business/certificateReport/draftUpdate',
+ method: 'post',
+ data,
+ })
+}
+
+// 未通过-驳回编辑
+export function failUpdateMeasureData(data: any) {
+ return request({
+ url: '/business/certificateReport/failUpdate',
+ method: 'post',
+ data,
+ })
+}
+
+// 提交
+export function submit(data: { formId: string; processId?: string; id: string }) {
+ return request({
+ url: '/business/certificateReport/submit',
+ method: 'post',
+ data,
+ })
+}
+
+// 详情
+export function getMeasureDataDetail(data: { id: string }) {
+ return request({
+ url: '/business/certificateReport/detail',
+ method: 'post',
+ data,
+ })
+}
+
+// 删除
+export function deleteMeasureData(data: any) {
+ return request({
+ url: '/business/certificateReport/batchDelete',
+ method: 'post',
+ data,
+ })
+}
+
diff --git a/src/api/business/subpackage/apply.ts b/src/api/business/subpackage/apply.ts
index ad17a5a..c778f8e 100644
--- a/src/api/business/subpackage/apply.ts
+++ b/src/api/business/subpackage/apply.ts
@@ -94,3 +94,4 @@
data,
})
}
+
diff --git a/src/api/system/tool.ts b/src/api/system/tool.ts
index 6b2f5f2..8223e4c 100644
--- a/src/api/system/tool.ts
+++ b/src/api/system/tool.ts
@@ -67,19 +67,10 @@
data,
})
}
-// 原始记录模板/证书报告模板列表(分页)
-export interface listParamsType {
- templateNo: string // 编号
- templateName: string // 名称
- templateCreator: string // 负责人
- // createTime: string // 创建时间
- limit: number
- offset: number
- templateType: string
-}
-export function templatePage(data: listParamsType) {
+
+export function templatePage(data: any) {
return request({
- url: `${prefix}/template/listPage?limit=${data.limit}&offset=${data.offset}`,
+ url: `${prefix}template/listPage?limit=${data.limit}&offset=${data.offset}`,
method: 'post',
data,
})
@@ -87,7 +78,7 @@
// 原始记录模板/证书报告模板列表/详情(
export function templatePageDetail(data: object) {
return request({
- url: `${prefix}/template/detail`,
+ url: `${prefix}template/detail`,
method: 'post',
data,
})
@@ -95,7 +86,7 @@
// 原始记录模板/证书报告模板列表删除
export function templateDelete(data: object) {
return request({
- url: `${prefix}/template/delete`,
+ url: `${prefix}template/delete`,
method: 'post',
data,
})
@@ -103,7 +94,7 @@
// 原始记录模板/证书报告模板列表新建
export function templateAdd(data: object) {
return request({
- url: `${prefix}/template/add`,
+ url: `${prefix}template/add`,
method: 'post',
data,
})
@@ -111,7 +102,7 @@
// 原始记录模板/证书报告模板列表更新
export function templateUpdate(data: object) {
return request({
- url: `${prefix}/template/update`,
+ url: `${prefix}template/update`,
method: 'post',
data,
})
@@ -119,7 +110,7 @@
// 原始记录模板/证书报告模板列表导出
export function templateExport(data: object) {
return request({
- url: `${prefix}/template/listExport`,
+ url: `${prefix}template/listExport`,
method: 'post',
data,
responseType: 'blob',
diff --git a/src/components.d.ts b/src/components.d.ts
index edc2e04..64cf608 100644
--- a/src/components.d.ts
+++ b/src/components.d.ts
@@ -46,6 +46,7 @@
ImageUpload: typeof import('./components/ImageUpload/index.vue')['default']
LineChart: typeof import('./components/Echart/LineChart.vue')['default']
MeasureRecords: typeof import('./components/Sample/measureRecords.vue')['default']
+ MultiHeaderTable: typeof import('./components/MultiHeaderTable/index.vue')['default']
NodeWrap: typeof import('./components/workFlow/nodeWrap.vue')['default']
NodeWrapBan: typeof import('./components/workFlow/nodeWrapBan.vue')['default']
NormalTable: typeof import('./components/NormalTable/index.vue')['default']
@@ -67,6 +68,7 @@
SelectStaffDialog: typeof import('./components/dialog/selectStaffDialog.vue')['default']
SvgIcon: typeof import('./components/SvgIcon/index.vue')['default']
SystemInfo: typeof import('./components/SystemInfo/index.vue')['default']
+ TableColumn: typeof import('./components/MultiHeaderTable/tableColumn.vue')['default']
TableContainer: typeof import('./components/TableContainer/index.vue')['default']
Trend: typeof import('./components/Trend/index.vue')['default']
WordOreview: typeof import('./components/filePreview/wordOreview.vue')['default']
diff --git a/src/components/MultiHeaderTable/index.vue b/src/components/MultiHeaderTable/index.vue
new file mode 100644
index 0000000..85b8c88
--- /dev/null
+++ b/src/components/MultiHeaderTable/index.vue
@@ -0,0 +1,343 @@
+
+
+
+
+
+
+
diff --git a/src/components/MultiHeaderTable/tableColumn.vue b/src/components/MultiHeaderTable/tableColumn.vue
new file mode 100644
index 0000000..2b87285
--- /dev/null
+++ b/src/components/MultiHeaderTable/tableColumn.vue
@@ -0,0 +1,147 @@
+
+
+
+
+
+
+
+
+
+
+ *{{ item.text }}
+
+
+ *{{ item.text }}
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ scope.row[item.value] }}
+
+
+ {{
+ scope.row[item.value]
+ }}
+
+
+
+
+
+
diff --git a/src/components/NormalTable/index.vue b/src/components/NormalTable/index.vue
index e56f775..67092d3 100644
--- a/src/components/NormalTable/index.vue
+++ b/src/components/NormalTable/index.vue
@@ -3,6 +3,7 @@
import { ElTable } from 'element-plus'
import { defineExpose, ref } from 'vue'
import type { TableColumn } from './table_interface'
+import showPhoto from '@/views/system/tool/showPhoto.vue'
// ------------------定义props、 emit-------------------
const props = defineProps({
@@ -212,8 +213,8 @@
{{ scope.row[column.value] }}
{{ column.filter(scope.row) }}
- {{ scope.row }}
-
+
+
diff --git a/src/utils/useCheckList.ts b/src/utils/useCheckList.ts
new file mode 100644
index 0000000..c7782f0
--- /dev/null
+++ b/src/utils/useCheckList.ts
@@ -0,0 +1,73 @@
+import { ElMessage } from 'element-plus'
+// import type { TableColumn } from '@/components/NormalTable/table_interface'
+
+/**
+ * 检查列表
+ * @param list 要检查的表格数据(被依赖项如果满足某个条件就去检查依赖项,否则不检查依赖项)
+ * @param columns // 表头信息
+ * @param tableTitle // 表格名称
+ * @param depend // 依赖项
+ * @param depended // 被依赖项
+ * @param dependedValue // 被依赖项条件
+ * @param requireLength // 要检查的表格数据长度是否大于0
+ */
+export default function useCheckList(list: any, columns: any, tableTitle = '', depend?: string, depended?: string, dependedValue?: number | string, requireLength = false): boolean {
+ for (const prop of columns) {
+ for (let index = 0; index < list.length; index++) {
+ const item = list[index]
+
+ if (depend && depended && item[depended] === dependedValue && !(`${item[prop.value]}`)) { // 被依赖项满足条件时需要检查
+ ElMessage.warning(`请先完善 ${tableTitle} 第${index + 1}行中 ${prop.text} 字段`)
+ return false
+ }
+ else {
+ // 检查必填
+ if (prop.required && (!(`${item[prop.value]}`) || `${item[prop.value]}` === 'null' || `${item[prop.value]}` === 'undefined' || item[prop.value] == undefined)) {
+ if (`${prop.belongStandardEquipment}` === '15') { // 小功率
+ ElMessage.warning(`${tableTitle} 第${index + 1}行中 ${prop.message} ${prop.text} 字段不能为空`)
+ }
+ else {
+ ElMessage.warning(`请先完善 ${tableTitle} 第${index + 1}行中 ${prop.text} 字段`)
+ }
+ return false
+ }
+ }
+
+ // 验证正则
+ if (prop.reg && typeof prop.reg === 'function') {
+ if (prop.value === 'resolution') { // 分辨力特殊处理
+ if (!prop.reg(item[prop.value])) {
+ ElMessage.warning(`${tableTitle} 第${index + 1}行中 ${prop.text} 不能大于1`)
+ return false
+ }
+ }
+ else {
+ if (!prop.reg(item[prop.value])) {
+ if (`${prop.belongStandardEquipment}` === '15') { // 小功率
+ ElMessage.warning(`${tableTitle} 第${index + 1}行中 ${prop.message} ${prop.text} 字段不能为0`)
+ }
+ else if (`${prop.belongStandardEquipment}` === '17') { // S参数
+ ElMessage.warning(`${tableTitle} 第${index + 1}行中 ${prop.text} 仅允许输入数字、字母、特殊字符`)
+ }
+ else {
+ ElMessage.warning(`${tableTitle} 第${index + 1}行中 ${prop.text} 字段输入不合法`)
+ }
+ return false
+ }
+ }
+ }
+
+ if (prop.children && prop.children.length) {
+ if (!useCheckList(list, prop.children, tableTitle, depend, depended, dependedValue)) {
+ return false
+ }
+ }
+ }
+ }
+
+ if (requireLength && !list.length) {
+ ElMessage.warning(`${tableTitle}表格数据不能为空`)
+ return false
+ }
+ return true
+}
diff --git a/src/views/business/lab/components/selectOrderSamplesDialog.vue b/src/views/business/lab/components/selectOrderSamplesDialog.vue
index 4002f83..b004107 100644
--- a/src/views/business/lab/components/selectOrderSamplesDialog.vue
+++ b/src/views/business/lab/components/selectOrderSamplesDialog.vue
@@ -14,6 +14,7 @@
const loadingTable = ref(false) // loading
const list = ref([]) // 表格参数
const tableRef = ref()
+const isMulti = ref(true) // 是否多选默认为多选
const columns = ref
([
{ text: '被测样品名称', value: 'sampleName', align: 'center', required: true },
{ text: '型号规格', value: 'sampleModel', align: 'center', required: true },
@@ -60,9 +61,10 @@
}
// 初始化
-const initDialog = (orderIdParam: string) => {
+const initDialog = (orderIdParam: string, isMultiParam = true) => {
dialogFormVisible.value = true
orderId.value = orderIdParam
+ isMulti.value = isMultiParam
getList()
}
defineExpose({ initDialog })
@@ -78,7 +80,7 @@
:columns="columns"
is-showmulti-select
:list-loading="loadingTable"
- :is-multi="true"
+ :is-multi="isMulti"
:height="300"
:pagination="false"
@multi-select="handleSelectionChange"
diff --git a/src/views/business/lab/components/selectReportTemplate.vue b/src/views/business/lab/components/selectReportTemplate.vue
index 5c59693..ec36ef7 100644
--- a/src/views/business/lab/components/selectReportTemplate.vue
+++ b/src/views/business/lab/components/selectReportTemplate.vue
@@ -7,8 +7,9 @@
import type { typeofSign } from '@/views/system/tool/tool_interface'
import { templatePage } from '@/api/system/tool'
-const emits = defineEmits(['add'])
+const emits = defineEmits(['confirm'])
const dialogFormVisible = ref(false) // 控制弹窗显隐
+const createTime = ref()
// 查询参数
const searchQuery = reactive({
templateNo: '', // 编号
@@ -18,31 +19,43 @@
createEndTime: '',
limit: 5,
offset: 1,
- templateType: '',
+ certificationType: '0',
ids: [] as string[],
}) // 查询参数
const loadingTable = ref(false) // loading
const list = ref([]) // 表格参数
const total = ref(0)
const columns = ref([
- { text: '编号', value: 'templateNo', align: 'center', width: '180' },
- { text: '模板名称', value: 'templateName', align: 'center', width: '150' },
- { text: '模板负责人', value: 'templateCreator', align: 'center', width: '100' },
- { text: '创建时间', value: 'createTime', align: 'center', width: '250' },
- { text: '描述', value: 'templateDesc', align: 'center' },
+ { text: '编号', value: 'templateNo', align: 'center', width: '160' },
+ { text: '模板名称', value: 'templateName', align: 'center' },
+ { text: '模板类型', value: 'templateTypeName', align: 'center', width: '100' },
+ { text: '负责人', value: 'templateCreator', align: 'center', width: '100' },
+ { text: '内容描述', value: 'templateDesc', align: 'center' },
+ { text: '创建时间', value: 'createTime', align: 'center', width: '180' },
])
const checkoutList = ref([]) // 多选选中参数
-// 获取类型
-const getType = async () => {
- const res = await getDictByCode('templateType')
- searchQuery.templateType = res.data.filter((item: typeofSign) => item.name === '证书报告模板')[0].value
+// ---------------------------------------字典--------------------------------------------
+const templateTypeMap = ref([]) as any // 模板类型
+// 获取字典值
+async function getDict() {
+ // 模板类型
+ const res = await getDictByCode('certificationType')
+ res.data.forEach((item: { value: string; name: string }) => {
+ templateTypeMap.value[`${item.value}`] = item.name
+ })
}
+// ----------------------------------------------------------------------------------------------
// 获取数据列表
const getList = () => {
loadingTable.value = true
templatePage(searchQuery).then((res) => {
if (res.code === 200) {
- list.value = res.data.rows
+ list.value = res.data.rows.map((item: { certificationType: string }) => {
+ return {
+ ...item,
+ templateTypeName: `${item.certificationType}` ? templateTypeMap.value[item.certificationType] : item.certificationType, // 模板类型
+ }
+ })
total.value = res.data.total
}
loadingTable.value = false
@@ -74,7 +87,8 @@
searchQuery.createEndTime = ''
searchQuery.limit = 5
searchQuery.offset = 1
- // searchQuery.templateType = '' // 类型不能变
+ searchQuery.certificationType = '0'
+ createTime.value = ''
searchQuery.ids = []
getList()
}
@@ -82,10 +96,10 @@
// 点击保存
const submitForm = () => {
if (!checkoutList.value.length) {
- ElMessage.warning('请选择证书报告模板')
+ ElMessage.warning('请选择证书模板')
}
else {
- emits('add', checkoutList.value[0])
+ emits('confirm', checkoutList.value[0])
dialogFormVisible.value = false
}
}
@@ -103,15 +117,25 @@
// 初始化
const initDialog = () => {
dialogFormVisible.value = true
- getType().then((_) => {
+ getDict().then((_) => {
getList()
})
}
+watch(() => createTime.value, (newVal) => {
+ if (newVal) {
+ searchQuery.createStartTime = newVal[0]
+ searchQuery.createEndTime = newVal[1]
+ }
+ else {
+ searchQuery.createStartTime = ''
+ searchQuery.createEndTime = ''
+ }
+})
defineExpose({ initDialog })
-
+
@@ -121,7 +145,18 @@
-
+
+
+
+
diff --git a/src/views/business/lab/measureData/dialog/selectMeasueDataDialog.vue b/src/views/business/lab/measureData/dialog/selectMeasueDataDialog.vue
new file mode 100644
index 0000000..f8be703
--- /dev/null
+++ b/src/views/business/lab/measureData/dialog/selectMeasueDataDialog.vue
@@ -0,0 +1,199 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ (listQuery.offset - 1) * listQuery.limit + scope.$index + 1 }}
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/views/business/lab/measureData/dialog/selectTechFilesDialog.vue b/src/views/business/lab/measureData/dialog/selectTechFilesDialog.vue
new file mode 100644
index 0000000..f6f1a5a
--- /dev/null
+++ b/src/views/business/lab/measureData/dialog/selectTechFilesDialog.vue
@@ -0,0 +1,247 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ (listQuery.offset - 1) * listQuery.limit + scope.$index + 1 }}
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/views/business/lab/measureData/measureData-interface.ts b/src/views/business/lab/measureData/measureData-interface.ts
index 8319f65..d25a212 100644
--- a/src/views/business/lab/measureData/measureData-interface.ts
+++ b/src/views/business/lab/measureData/measureData-interface.ts
@@ -1,13 +1,14 @@
// 查询条件
export interface IListQuery {
- approvalStatus: string // 审批状态
- certificateReportCode: string // 证书编号
- certificateReportName: string // 证书名称
- customerName: string // 委托方名称
- sampleName: string // 样品名称
- measureCategory: string // 检校类别
- approvalStatusName: string // 审批状态名称
- formId: string
+ approvalStatus: string // 审批状态类型code
+ certificateReportCode: string // 证书编号
+ certificateReportName: string // 证书名称
+ customerName: string // 委托方名称
+ formId: string // 表单id(流程定义对应的表单id,等价于业务id)
+ measureCategory: string // 检校类别
+ orderCode: string // 委托书编号
+ sampleName: string // 样品名称
+ sampleNo: string // 样品编号
offset: number
limit: number
}
@@ -28,47 +29,53 @@
calibrationTime: string // 检校日期
taskId?: string // 任务id 用于审批
decisionItem?: string
- applyApprovalStatusName?: string // 审批状态名称
+ approvalStatusName?: string // 审批状态名称
processId?: string // 流程实例id
}
// 表单
export interface IForm {
- tdysczs: number // 替代已生成证书
+ id?: string
+ invalid: number // 替代已生成证书
formId: string
- yzs: string // 原证书
+ oldCertificateCode: string // 原证书
calibrationMajor: string // 检校专业
- certifications: string // 证书类别
+ calibrationMajorName: string // 检校专业名称
+ certificateReportCategory: string // 证书类别
+ certificateReportCategoryName: string // 证书类别名称
certificateReportCode: string // 证书编号
certificateReportName: string // 证书名称
- jdy: string // 检定员
- jjrq: string // 检校日期
+ measurePerson: string // 检定员
+ measurePersonId: string // 检定员id
+ calibrationTime: string // 检校日期
orderCode: string // 委托书
orderId: string // 委托书id
customerId?: string // 委托放id
customerName: string // 委托方名称
+ customerAddress: string // 委托方地址
certificationCompany: string // 证书单位名称
certificationCompanyAddress: string // 证书单位地址
calibrationPlace: string // 检校地点
- fjsj: string // 复校时间
- jssj: string // 接收时间
- jdjg: string // 检定结果
- environmentCode: string// 环境记录单编号
+ repeatTime: string // 复校时间
+ deliverTime: string // 接收时间
+ measureResult: string // 检定结果
+ environmentCode: string // 环境记录单编号
environmentId: string // 环境记录单id
temperature: string // 温度
humidity: string // 湿度
+ techFilesName: string // 依据的技术文件名称
signId: string // 电子签章id
signName: string // 电子签章名称
approvalSignIds: string // 认可标志专用章id
approvalSignName: string // 认可标志专用章名称
remark: string // 备注
- ywy: string // 业务员
+ busPersonId: string // 业务员id
+ busPersonName: string // 业务员名字
templateId: string // 证书模板
templateName: string // 证书模板
- templateNameFile: string // 证书模板文件
certificateReportFile: string // 证书报告附件
processId?: string // 流程实例id
@@ -76,6 +83,7 @@
// 被检样品
export interface ISampleList {
+ id: string // 样品id
sampleNo: string // 样品编号
sampleName: string // 样品名称
sampleModel: string // 型号
diff --git a/src/api/business/lab/measureData.ts b/src/api/business/lab/measureData.ts
new file mode 100644
index 0000000..ab3a56e
--- /dev/null
+++ b/src/api/business/lab/measureData.ts
@@ -0,0 +1,78 @@
+/**
+ * 计量数据管理
+*/
+import request from '../../index'
+
+// 计量数据管理列表
+export function getMeasureDataList(data: { offset: number; limit: number }) {
+ return request({
+ url: `/business/certificateReport/approval/listPage?offset=${data.offset}&limit=${data.limit}`,
+ method: 'post',
+ data,
+ })
+}
+
+// 点击下载模板后生成证书
+export function downLoadTemplate(data: any) {
+ return request({
+ url: '/business/certificateReport/exportFile',
+ method: 'post',
+ data,
+ responseType: 'blob',
+ })
+}
+
+// 新增
+export function addMeasureData(data: any) {
+ return request({
+ url: '/business/certificateReport/save',
+ method: 'post',
+ data,
+ })
+}
+
+// 草稿箱更新
+export function draftUpdateMeasureData(data: any) {
+ return request({
+ url: '/business/certificateReport/draftUpdate',
+ method: 'post',
+ data,
+ })
+}
+
+// 未通过-驳回编辑
+export function failUpdateMeasureData(data: any) {
+ return request({
+ url: '/business/certificateReport/failUpdate',
+ method: 'post',
+ data,
+ })
+}
+
+// 提交
+export function submit(data: { formId: string; processId?: string; id: string }) {
+ return request({
+ url: '/business/certificateReport/submit',
+ method: 'post',
+ data,
+ })
+}
+
+// 详情
+export function getMeasureDataDetail(data: { id: string }) {
+ return request({
+ url: '/business/certificateReport/detail',
+ method: 'post',
+ data,
+ })
+}
+
+// 删除
+export function deleteMeasureData(data: any) {
+ return request({
+ url: '/business/certificateReport/batchDelete',
+ method: 'post',
+ data,
+ })
+}
+
diff --git a/src/api/business/subpackage/apply.ts b/src/api/business/subpackage/apply.ts
index ad17a5a..c778f8e 100644
--- a/src/api/business/subpackage/apply.ts
+++ b/src/api/business/subpackage/apply.ts
@@ -94,3 +94,4 @@
data,
})
}
+
diff --git a/src/api/system/tool.ts b/src/api/system/tool.ts
index 6b2f5f2..8223e4c 100644
--- a/src/api/system/tool.ts
+++ b/src/api/system/tool.ts
@@ -67,19 +67,10 @@
data,
})
}
-// 原始记录模板/证书报告模板列表(分页)
-export interface listParamsType {
- templateNo: string // 编号
- templateName: string // 名称
- templateCreator: string // 负责人
- // createTime: string // 创建时间
- limit: number
- offset: number
- templateType: string
-}
-export function templatePage(data: listParamsType) {
+
+export function templatePage(data: any) {
return request({
- url: `${prefix}/template/listPage?limit=${data.limit}&offset=${data.offset}`,
+ url: `${prefix}template/listPage?limit=${data.limit}&offset=${data.offset}`,
method: 'post',
data,
})
@@ -87,7 +78,7 @@
// 原始记录模板/证书报告模板列表/详情(
export function templatePageDetail(data: object) {
return request({
- url: `${prefix}/template/detail`,
+ url: `${prefix}template/detail`,
method: 'post',
data,
})
@@ -95,7 +86,7 @@
// 原始记录模板/证书报告模板列表删除
export function templateDelete(data: object) {
return request({
- url: `${prefix}/template/delete`,
+ url: `${prefix}template/delete`,
method: 'post',
data,
})
@@ -103,7 +94,7 @@
// 原始记录模板/证书报告模板列表新建
export function templateAdd(data: object) {
return request({
- url: `${prefix}/template/add`,
+ url: `${prefix}template/add`,
method: 'post',
data,
})
@@ -111,7 +102,7 @@
// 原始记录模板/证书报告模板列表更新
export function templateUpdate(data: object) {
return request({
- url: `${prefix}/template/update`,
+ url: `${prefix}template/update`,
method: 'post',
data,
})
@@ -119,7 +110,7 @@
// 原始记录模板/证书报告模板列表导出
export function templateExport(data: object) {
return request({
- url: `${prefix}/template/listExport`,
+ url: `${prefix}template/listExport`,
method: 'post',
data,
responseType: 'blob',
diff --git a/src/components.d.ts b/src/components.d.ts
index edc2e04..64cf608 100644
--- a/src/components.d.ts
+++ b/src/components.d.ts
@@ -46,6 +46,7 @@
ImageUpload: typeof import('./components/ImageUpload/index.vue')['default']
LineChart: typeof import('./components/Echart/LineChart.vue')['default']
MeasureRecords: typeof import('./components/Sample/measureRecords.vue')['default']
+ MultiHeaderTable: typeof import('./components/MultiHeaderTable/index.vue')['default']
NodeWrap: typeof import('./components/workFlow/nodeWrap.vue')['default']
NodeWrapBan: typeof import('./components/workFlow/nodeWrapBan.vue')['default']
NormalTable: typeof import('./components/NormalTable/index.vue')['default']
@@ -67,6 +68,7 @@
SelectStaffDialog: typeof import('./components/dialog/selectStaffDialog.vue')['default']
SvgIcon: typeof import('./components/SvgIcon/index.vue')['default']
SystemInfo: typeof import('./components/SystemInfo/index.vue')['default']
+ TableColumn: typeof import('./components/MultiHeaderTable/tableColumn.vue')['default']
TableContainer: typeof import('./components/TableContainer/index.vue')['default']
Trend: typeof import('./components/Trend/index.vue')['default']
WordOreview: typeof import('./components/filePreview/wordOreview.vue')['default']
diff --git a/src/components/MultiHeaderTable/index.vue b/src/components/MultiHeaderTable/index.vue
new file mode 100644
index 0000000..85b8c88
--- /dev/null
+++ b/src/components/MultiHeaderTable/index.vue
@@ -0,0 +1,343 @@
+
+
+
+
+
+
+
diff --git a/src/components/MultiHeaderTable/tableColumn.vue b/src/components/MultiHeaderTable/tableColumn.vue
new file mode 100644
index 0000000..2b87285
--- /dev/null
+++ b/src/components/MultiHeaderTable/tableColumn.vue
@@ -0,0 +1,147 @@
+
+
+
+
+
+
+
+
+
+
+ *{{ item.text }}
+
+
+ *{{ item.text }}
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ scope.row[item.value] }}
+
+
+ {{
+ scope.row[item.value]
+ }}
+
+
+
+
+
+
diff --git a/src/components/NormalTable/index.vue b/src/components/NormalTable/index.vue
index e56f775..67092d3 100644
--- a/src/components/NormalTable/index.vue
+++ b/src/components/NormalTable/index.vue
@@ -3,6 +3,7 @@
import { ElTable } from 'element-plus'
import { defineExpose, ref } from 'vue'
import type { TableColumn } from './table_interface'
+import showPhoto from '@/views/system/tool/showPhoto.vue'
// ------------------定义props、 emit-------------------
const props = defineProps({
@@ -212,8 +213,8 @@
{{ scope.row[column.value] }}
{{ column.filter(scope.row) }}
- {{ scope.row }}
-
+
+
diff --git a/src/utils/useCheckList.ts b/src/utils/useCheckList.ts
new file mode 100644
index 0000000..c7782f0
--- /dev/null
+++ b/src/utils/useCheckList.ts
@@ -0,0 +1,73 @@
+import { ElMessage } from 'element-plus'
+// import type { TableColumn } from '@/components/NormalTable/table_interface'
+
+/**
+ * 检查列表
+ * @param list 要检查的表格数据(被依赖项如果满足某个条件就去检查依赖项,否则不检查依赖项)
+ * @param columns // 表头信息
+ * @param tableTitle // 表格名称
+ * @param depend // 依赖项
+ * @param depended // 被依赖项
+ * @param dependedValue // 被依赖项条件
+ * @param requireLength // 要检查的表格数据长度是否大于0
+ */
+export default function useCheckList(list: any, columns: any, tableTitle = '', depend?: string, depended?: string, dependedValue?: number | string, requireLength = false): boolean {
+ for (const prop of columns) {
+ for (let index = 0; index < list.length; index++) {
+ const item = list[index]
+
+ if (depend && depended && item[depended] === dependedValue && !(`${item[prop.value]}`)) { // 被依赖项满足条件时需要检查
+ ElMessage.warning(`请先完善 ${tableTitle} 第${index + 1}行中 ${prop.text} 字段`)
+ return false
+ }
+ else {
+ // 检查必填
+ if (prop.required && (!(`${item[prop.value]}`) || `${item[prop.value]}` === 'null' || `${item[prop.value]}` === 'undefined' || item[prop.value] == undefined)) {
+ if (`${prop.belongStandardEquipment}` === '15') { // 小功率
+ ElMessage.warning(`${tableTitle} 第${index + 1}行中 ${prop.message} ${prop.text} 字段不能为空`)
+ }
+ else {
+ ElMessage.warning(`请先完善 ${tableTitle} 第${index + 1}行中 ${prop.text} 字段`)
+ }
+ return false
+ }
+ }
+
+ // 验证正则
+ if (prop.reg && typeof prop.reg === 'function') {
+ if (prop.value === 'resolution') { // 分辨力特殊处理
+ if (!prop.reg(item[prop.value])) {
+ ElMessage.warning(`${tableTitle} 第${index + 1}行中 ${prop.text} 不能大于1`)
+ return false
+ }
+ }
+ else {
+ if (!prop.reg(item[prop.value])) {
+ if (`${prop.belongStandardEquipment}` === '15') { // 小功率
+ ElMessage.warning(`${tableTitle} 第${index + 1}行中 ${prop.message} ${prop.text} 字段不能为0`)
+ }
+ else if (`${prop.belongStandardEquipment}` === '17') { // S参数
+ ElMessage.warning(`${tableTitle} 第${index + 1}行中 ${prop.text} 仅允许输入数字、字母、特殊字符`)
+ }
+ else {
+ ElMessage.warning(`${tableTitle} 第${index + 1}行中 ${prop.text} 字段输入不合法`)
+ }
+ return false
+ }
+ }
+ }
+
+ if (prop.children && prop.children.length) {
+ if (!useCheckList(list, prop.children, tableTitle, depend, depended, dependedValue)) {
+ return false
+ }
+ }
+ }
+ }
+
+ if (requireLength && !list.length) {
+ ElMessage.warning(`${tableTitle}表格数据不能为空`)
+ return false
+ }
+ return true
+}
diff --git a/src/views/business/lab/components/selectOrderSamplesDialog.vue b/src/views/business/lab/components/selectOrderSamplesDialog.vue
index 4002f83..b004107 100644
--- a/src/views/business/lab/components/selectOrderSamplesDialog.vue
+++ b/src/views/business/lab/components/selectOrderSamplesDialog.vue
@@ -14,6 +14,7 @@
const loadingTable = ref(false) // loading
const list = ref([]) // 表格参数
const tableRef = ref()
+const isMulti = ref(true) // 是否多选默认为多选
const columns = ref
([
{ text: '被测样品名称', value: 'sampleName', align: 'center', required: true },
{ text: '型号规格', value: 'sampleModel', align: 'center', required: true },
@@ -60,9 +61,10 @@
}
// 初始化
-const initDialog = (orderIdParam: string) => {
+const initDialog = (orderIdParam: string, isMultiParam = true) => {
dialogFormVisible.value = true
orderId.value = orderIdParam
+ isMulti.value = isMultiParam
getList()
}
defineExpose({ initDialog })
@@ -78,7 +80,7 @@
:columns="columns"
is-showmulti-select
:list-loading="loadingTable"
- :is-multi="true"
+ :is-multi="isMulti"
:height="300"
:pagination="false"
@multi-select="handleSelectionChange"
diff --git a/src/views/business/lab/components/selectReportTemplate.vue b/src/views/business/lab/components/selectReportTemplate.vue
index 5c59693..ec36ef7 100644
--- a/src/views/business/lab/components/selectReportTemplate.vue
+++ b/src/views/business/lab/components/selectReportTemplate.vue
@@ -7,8 +7,9 @@
import type { typeofSign } from '@/views/system/tool/tool_interface'
import { templatePage } from '@/api/system/tool'
-const emits = defineEmits(['add'])
+const emits = defineEmits(['confirm'])
const dialogFormVisible = ref(false) // 控制弹窗显隐
+const createTime = ref()
// 查询参数
const searchQuery = reactive({
templateNo: '', // 编号
@@ -18,31 +19,43 @@
createEndTime: '',
limit: 5,
offset: 1,
- templateType: '',
+ certificationType: '0',
ids: [] as string[],
}) // 查询参数
const loadingTable = ref(false) // loading
const list = ref([]) // 表格参数
const total = ref(0)
const columns = ref([
- { text: '编号', value: 'templateNo', align: 'center', width: '180' },
- { text: '模板名称', value: 'templateName', align: 'center', width: '150' },
- { text: '模板负责人', value: 'templateCreator', align: 'center', width: '100' },
- { text: '创建时间', value: 'createTime', align: 'center', width: '250' },
- { text: '描述', value: 'templateDesc', align: 'center' },
+ { text: '编号', value: 'templateNo', align: 'center', width: '160' },
+ { text: '模板名称', value: 'templateName', align: 'center' },
+ { text: '模板类型', value: 'templateTypeName', align: 'center', width: '100' },
+ { text: '负责人', value: 'templateCreator', align: 'center', width: '100' },
+ { text: '内容描述', value: 'templateDesc', align: 'center' },
+ { text: '创建时间', value: 'createTime', align: 'center', width: '180' },
])
const checkoutList = ref([]) // 多选选中参数
-// 获取类型
-const getType = async () => {
- const res = await getDictByCode('templateType')
- searchQuery.templateType = res.data.filter((item: typeofSign) => item.name === '证书报告模板')[0].value
+// ---------------------------------------字典--------------------------------------------
+const templateTypeMap = ref([]) as any // 模板类型
+// 获取字典值
+async function getDict() {
+ // 模板类型
+ const res = await getDictByCode('certificationType')
+ res.data.forEach((item: { value: string; name: string }) => {
+ templateTypeMap.value[`${item.value}`] = item.name
+ })
}
+// ----------------------------------------------------------------------------------------------
// 获取数据列表
const getList = () => {
loadingTable.value = true
templatePage(searchQuery).then((res) => {
if (res.code === 200) {
- list.value = res.data.rows
+ list.value = res.data.rows.map((item: { certificationType: string }) => {
+ return {
+ ...item,
+ templateTypeName: `${item.certificationType}` ? templateTypeMap.value[item.certificationType] : item.certificationType, // 模板类型
+ }
+ })
total.value = res.data.total
}
loadingTable.value = false
@@ -74,7 +87,8 @@
searchQuery.createEndTime = ''
searchQuery.limit = 5
searchQuery.offset = 1
- // searchQuery.templateType = '' // 类型不能变
+ searchQuery.certificationType = '0'
+ createTime.value = ''
searchQuery.ids = []
getList()
}
@@ -82,10 +96,10 @@
// 点击保存
const submitForm = () => {
if (!checkoutList.value.length) {
- ElMessage.warning('请选择证书报告模板')
+ ElMessage.warning('请选择证书模板')
}
else {
- emits('add', checkoutList.value[0])
+ emits('confirm', checkoutList.value[0])
dialogFormVisible.value = false
}
}
@@ -103,15 +117,25 @@
// 初始化
const initDialog = () => {
dialogFormVisible.value = true
- getType().then((_) => {
+ getDict().then((_) => {
getList()
})
}
+watch(() => createTime.value, (newVal) => {
+ if (newVal) {
+ searchQuery.createStartTime = newVal[0]
+ searchQuery.createEndTime = newVal[1]
+ }
+ else {
+ searchQuery.createStartTime = ''
+ searchQuery.createEndTime = ''
+ }
+})
defineExpose({ initDialog })
-
+
@@ -121,7 +145,18 @@
-
+
+
+
+
diff --git a/src/views/business/lab/measureData/dialog/selectMeasueDataDialog.vue b/src/views/business/lab/measureData/dialog/selectMeasueDataDialog.vue
new file mode 100644
index 0000000..f8be703
--- /dev/null
+++ b/src/views/business/lab/measureData/dialog/selectMeasueDataDialog.vue
@@ -0,0 +1,199 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ (listQuery.offset - 1) * listQuery.limit + scope.$index + 1 }}
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/views/business/lab/measureData/dialog/selectTechFilesDialog.vue b/src/views/business/lab/measureData/dialog/selectTechFilesDialog.vue
new file mode 100644
index 0000000..f6f1a5a
--- /dev/null
+++ b/src/views/business/lab/measureData/dialog/selectTechFilesDialog.vue
@@ -0,0 +1,247 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ (listQuery.offset - 1) * listQuery.limit + scope.$index + 1 }}
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/views/business/lab/measureData/measureData-interface.ts b/src/views/business/lab/measureData/measureData-interface.ts
index 8319f65..d25a212 100644
--- a/src/views/business/lab/measureData/measureData-interface.ts
+++ b/src/views/business/lab/measureData/measureData-interface.ts
@@ -1,13 +1,14 @@
// 查询条件
export interface IListQuery {
- approvalStatus: string // 审批状态
- certificateReportCode: string // 证书编号
- certificateReportName: string // 证书名称
- customerName: string // 委托方名称
- sampleName: string // 样品名称
- measureCategory: string // 检校类别
- approvalStatusName: string // 审批状态名称
- formId: string
+ approvalStatus: string // 审批状态类型code
+ certificateReportCode: string // 证书编号
+ certificateReportName: string // 证书名称
+ customerName: string // 委托方名称
+ formId: string // 表单id(流程定义对应的表单id,等价于业务id)
+ measureCategory: string // 检校类别
+ orderCode: string // 委托书编号
+ sampleName: string // 样品名称
+ sampleNo: string // 样品编号
offset: number
limit: number
}
@@ -28,47 +29,53 @@
calibrationTime: string // 检校日期
taskId?: string // 任务id 用于审批
decisionItem?: string
- applyApprovalStatusName?: string // 审批状态名称
+ approvalStatusName?: string // 审批状态名称
processId?: string // 流程实例id
}
// 表单
export interface IForm {
- tdysczs: number // 替代已生成证书
+ id?: string
+ invalid: number // 替代已生成证书
formId: string
- yzs: string // 原证书
+ oldCertificateCode: string // 原证书
calibrationMajor: string // 检校专业
- certifications: string // 证书类别
+ calibrationMajorName: string // 检校专业名称
+ certificateReportCategory: string // 证书类别
+ certificateReportCategoryName: string // 证书类别名称
certificateReportCode: string // 证书编号
certificateReportName: string // 证书名称
- jdy: string // 检定员
- jjrq: string // 检校日期
+ measurePerson: string // 检定员
+ measurePersonId: string // 检定员id
+ calibrationTime: string // 检校日期
orderCode: string // 委托书
orderId: string // 委托书id
customerId?: string // 委托放id
customerName: string // 委托方名称
+ customerAddress: string // 委托方地址
certificationCompany: string // 证书单位名称
certificationCompanyAddress: string // 证书单位地址
calibrationPlace: string // 检校地点
- fjsj: string // 复校时间
- jssj: string // 接收时间
- jdjg: string // 检定结果
- environmentCode: string// 环境记录单编号
+ repeatTime: string // 复校时间
+ deliverTime: string // 接收时间
+ measureResult: string // 检定结果
+ environmentCode: string // 环境记录单编号
environmentId: string // 环境记录单id
temperature: string // 温度
humidity: string // 湿度
+ techFilesName: string // 依据的技术文件名称
signId: string // 电子签章id
signName: string // 电子签章名称
approvalSignIds: string // 认可标志专用章id
approvalSignName: string // 认可标志专用章名称
remark: string // 备注
- ywy: string // 业务员
+ busPersonId: string // 业务员id
+ busPersonName: string // 业务员名字
templateId: string // 证书模板
templateName: string // 证书模板
- templateNameFile: string // 证书模板文件
certificateReportFile: string // 证书报告附件
processId?: string // 流程实例id
@@ -76,6 +83,7 @@
// 被检样品
export interface ISampleList {
+ id: string // 样品id
sampleNo: string // 样品编号
sampleName: string // 样品名称
sampleModel: string // 型号
diff --git a/src/views/business/lab/measureData/measureDataDetail.vue b/src/views/business/lab/measureData/measureDataDetail.vue
index 4aa9717..c554c33 100644
--- a/src/views/business/lab/measureData/measureDataDetail.vue
+++ b/src/views/business/lab/measureData/measureDataDetail.vue
@@ -3,6 +3,7 @@
import { ElLoading, ElMessage, ElMessageBox } from 'element-plus'
import type { FormInstance, FormRules } from 'element-plus'
import { ref } from 'vue'
+import dayjs from 'dayjs'
import EnvironmentalDialog from '../components/environmentalDialog.vue'
import selectSignature from '../components/selectSignature.vue'
import selectReportTemplate from '../components/selectReportTemplate.vue'
@@ -10,10 +11,12 @@
import SelectSamplesDialog from '../components/selectSamplesDialog.vue'
import selectMeasureDevice from '../components/selectMeasureDevice.vue'
import type { IEquipmentList, IForm, ISampleList } from './measureData-interface'
+import selectMeasueDataDialog from './dialog/selectMeasueDataDialog.vue'
+import selectTechFilesDialog from './dialog/selectTechFilesDialog.vue'
import { UploadFile } from '@/api/measure/file'
import ApprovalDialog from '@/components/Approval/ApprovalDialog.vue'
import type { TableColumn } from '@/components/NormalTable/table_interface'
-import { addApply, detail, failUpdateApply, submit, updateApply } from '@/api/business/subpackage/apply'
+import { addMeasureData, downLoadTemplate, draftUpdateMeasureData, failUpdateMeasureData, getMeasureDataDetail, submit } from '@/api/business/lab/measureData'
import { cancelApproval, fetchApproval, submitApproval } from '@/api/approval'
import showPhoto from '@/views/system/tool/showPhoto.vue'
import { getDictByCode } from '@/api/system/dict'
@@ -21,6 +24,9 @@
import selectOrder from '@/views/business/schedule/interchangeReceipt/selectOrder.vue'
import { downloadFile } from '@/utils/download'
import type { dictType } from '@/global'
+import { getUserList } from '@/api/system/user'
+import { exportFile } from '@/utils/exportUtils'
+
const user = useUserStore() // 用户信息
const textMap: { [key: string]: string } = {
edit: '编辑',
@@ -31,6 +37,8 @@
const $router = useRouter() // 关闭页面使用
const $route = useRoute()
const query = $route.query
+console.log('opopopop', query)
+
const approvalDialog = ref() // 审批对话ref
const pageType = ref('add') // 页面类型: add, edit, detail
const infoId = ref('') // 列表id
@@ -38,57 +46,63 @@
const orderVisible = ref(false) // 控制委托单对话框显隐
const ruleFormRef = ref() as any
const form = ref({
- tdysczs: 0, // 替代已生成证书
+ invalid: 0, // 替代已生成证书
formId: query.formId as string,
- yzs: '', // 原证书
+ oldCertificateCode: '', // 原证书
calibrationMajor: '', // 检校专业
- certifications: '', // 证书类别
+ calibrationMajorName: '', // 检校专业名称
+ certificateReportCategory: '', // 证书类别
+ certificateReportCategoryName: '', // 证书类别名称
certificateReportCode: '', // 证书编号
certificateReportName: '', // 证书名称
- jdy: '', // 检定员
- jjrq: '', // 检校日期
+ measurePerson: '', // 检定员
+ measurePersonId: '', // 检定员id
+ calibrationTime: '', // 检校日期
- orderCode: '', // 委托单
+ orderCode: '', // 委托单编号
orderId: '', // 委托单id
customerName: '', // 委托方名称
+ customerAddress: '', // 委托方地址
certificationCompany: '', // 证书单位名称
certificationCompanyAddress: '', // 证书单位地址
calibrationPlace: '', // 检校地点
- fjsj: '', // 复校时间
- jssj: '', // 接收时间
- jdjg: '', // 检定结果
+ repeatTime: '', // 复校时间
+ deliverTime: '', // 接收时间
+ measureResult: '', // 检定结果
environmentCode: '', // 环境记录单编号
environmentId: '', // 环境记录单id
temperature: '', // 温度
humidity: '', // 湿度
+ techFilesName: '', // 依据的技术文件名称
signId: '', // 电子签章id
signName: '', // 电子签章名称
approvalSignIds: '', // 认可标志专用章id
approvalSignName: '', // 认可标志专用章名称
remark: '', // 备注
- ywy: '', // 业务员
+ busPersonId: '', // 业务员id
+ busPersonName: '', // 业务员名字
templateId: '', // 证书模板
templateName: '', // 证书模板
- templateNameFile: '', // 证书模板文件
certificateReportFile: '', // 证书报告附件
})
// 校验规则
const formRules = ref({
- yzs: [{ required: true, message: '原证书必填', trigger: ['blur', 'change'] }],
+ oldCertificateCode: [{ required: true, message: '原证书必填', trigger: ['blur', 'change'] }],
calibrationMajor: [{ required: true, message: '检校专业必填', trigger: ['blur', 'change'] }],
- certifications: [{ required: true, message: '证书类别必填', trigger: ['blur', 'change'] }],
+ certificateReportCategory: [{ required: true, message: '证书类别必填', trigger: ['blur', 'change'] }],
certificateReportName: [{ required: true, message: '证书名称必填', trigger: ['blur', 'change'] }],
customerName: [{ required: true, message: '委托方名称必填', trigger: ['blur', 'change'] }],
+ customerAddress: [{ required: true, message: '委托方地址必填', trigger: ['blur', 'change'] }],
certificationCompany: [{ required: true, message: '证书单位名称必填', trigger: ['blur', 'change'] }],
certificationCompanyAddress: [{ required: true, message: '证书单位地址必填', trigger: ['blur', 'change'] }],
calibrationPlace: [{ required: true, message: '检校地点必填', trigger: ['blur', 'change'] }],
- jdy: [{ required: true, message: '检定员必填', trigger: ['blur', 'change'] }],
- jjrq: [{ required: true, message: '检校日期必填', trigger: ['blur', 'change'] }],
- fjsj: [{ required: true, message: '复校时间必填', trigger: ['blur', 'change'] }],
- jssj: [{ required: true, message: '接收时间必填', trigger: ['blur', 'change'] }],
- jdjg: [{ required: true, message: '检定结果必填', trigger: ['blur', 'change'] }],
+ measurePersonId: [{ required: true, message: '检定员必填', trigger: ['blur', 'change'] }],
+ calibrationTime: [{ required: true, message: '检校日期必填', trigger: ['blur', 'change'] }],
+ repeatTime: [{ required: true, message: '复校时间必填', trigger: ['blur', 'change'] }],
+ deliverTime: [{ required: true, message: '接收时间必填', trigger: ['blur', 'change'] }],
+ measureResult: [{ required: true, message: '检定结果必填', trigger: ['blur', 'change'] }],
temperature: [
{ required: true, message: '温度必填', trigger: ['blur', 'change'] },
{ pattern: /(^-?\d\d*\.\d*$)|(^-?\d\d*$)|(^-?\.\d\d*$)/, message: '温度只能为数字', trigger: ['blur', 'change'] },
@@ -111,6 +125,7 @@
// ---------------------------------------字典--------------------------------------------
const certificationTypeMap = ref([]) // 证书类别
const calibrationMajorMap = ref([]) // 校检专业
+const userList = ref([]) // 检定员
// 获取字典值
async function getDict() {
// 校检专业
@@ -119,12 +134,22 @@
// 证书类别
const rescertificationType = await getDictByCode('certificationType')
certificationTypeMap.value = rescertificationType.data
+
+ // 获取人员列表
+ getUserList({ offset: 1, limit: 99999 }).then((res) => {
+ userList.value = res.data.rows
+ })
}
getDict()
// -------------------------------------原证书--------------------------------------------
+const selectMeasueDataDialogRef = ref() // 选择原证书组件ref
// 点击选择原证书
const selectOrigin = () => {
- //
+ selectMeasueDataDialogRef.value.initDialog()
+}
+// 选好原证书
+const selectMeasueDataConfirm = (val: any) => {
+ getDetail(val.id, val.certificateReportCode)
}
// ------------------------------------委托单------------------------------------------
// 点击选择委托单编号
@@ -142,12 +167,17 @@
form.value.orderCode = val[0].orderCode // 委托单
form.value.customerId = val[0].customerId// 委托方id
form.value.customerName = val[0].customerName// 委托方名称
+ form.value.customerAddress = val[0].customerAddress// 委托方地址
form.value.certificationCompany = val[0].certificationCompany// 证书单位名称
form.value.certificationCompanyAddress = val[0].certificationCompanyAddress// 证书单位地址
+ form.value.certificationCompanyAddress = val[0].certificationCompanyAddress// 证书单位地址
+ form.value.busPersonId = val[0].busPersonId// 业务员id
+ form.value.busPersonName = val[0].busPersonName// 业务员名字
}
}
// -------------------------------选择环境记录单----------------------------------------
+const businessEnvironmentRecord = ref({}) as any // 环境记录单信息
// 选择环境记录单Ref
const environmentalDialog = ref()
// 选择环境记录单
@@ -156,6 +186,7 @@
}
// 选择环境记录单表格确认
const environmentalAdd = (data: any) => {
+ businessEnvironmentRecord.value = data
form.value.environmentId = data.id // 环境记录单id
form.value.environmentCode = data.environmentCode // 环境记录单编号
form.value.temperature = data.temperature // 温度
@@ -200,35 +231,16 @@
}
// -----------------------------------------所依据的技术文件----------------------------------
+const selectTechFilesRef = ref()
+const fileList = ref([]) // 依据的技术文件
// 点击所依据的技术文件
const selectTechFiles = () => {
- //
+ selectTechFilesRef.value.initDialog()
}
-// --------------------------------------证书模板------------------------------------------
-// 选择证书模板Ref
-const templateDialog = ref()
-// 选择证书模板
-const handleClickTemplate = () => {
- templateDialog.value.initDialog()
-}
-// 选择证书模板确认
-const confirmCheckoutTemplate = (val: any) => {
- form.value.templateId = val.id // 证书报告模板id
- form.value.templateName = val.templateName || '' // 证书报告模板名称
- form.value.templateNameFile = val.minioFileName // 证书模板附件
-}
-
-// 点击下载证书模板按钮
-const downloadCertTemplate = () => {
- if (!form.value.templateId) {
- ElMessage.warning('请先选择证书模板')
- return false
- }
- if (!form.value.templateNameFile) {
- ElMessage.warning('选择的证书模板无附件,请检查')
- return false
- }
- downloadFile(form.value.templateNameFile as any, `${form.value.templateName}-${form.value.templateNameFile}`)
+// 选好依据的技术文件
+const selectTechFilesConfirm = (val: any) => {
+ fileList.value = val
+ form.value.techFilesName = val.map((item: { fileName: string }) => item.fileName).join(',')
}
// ---------------------------------文件上传(上传证书)-------------------------------------------
@@ -283,10 +295,10 @@
// 点击批量添加/选择
const addSample = () => {
- if (form.value.orderId) {
- selectOrderSamplesDialogRef.value.initDialog(form.value.orderId)
+ if (form.value.orderId) { // 选择委托单下的样品
+ selectOrderSamplesDialogRef.value.initDialog(form.value.orderId, false)
}
- else {
+ else { // 选择样品库中的样品
selectSamplesDialogRef.value.initDialog()
}
}
@@ -318,7 +330,7 @@
}
// ----------------------------------------------所用的计量标准器具--------------------------------------------
const equipmentVisible = ref(false) // 选择设备对话框显隐
-const equipmentList = ref([])// 表格数据
+const equipmentInfoList = ref([])// 表格数据
const checkoutEquipmentList = ref([])// 多选设备
// 表头
const equipmentColumns = ref([
@@ -328,8 +340,8 @@
{ text: '出厂编号', value: 'manufacturingNo', align: 'center' },
{ text: '测量范围', value: 'mesureRange', align: 'center' },
{ text: '不确定度', value: 'uncertainty', align: 'center' },
- { text: '溯源机构', value: 'syjg', align: 'center' },
- { text: '证书编号', value: 'zsbh', align: 'center' },
+ { text: '溯源机构', value: 'mesureDeptName', align: 'center' },
+ // { text: '证书编号', value: 'zsbh', align: 'center' },
{ text: '有效日期', value: 'validDate', align: 'center' },
])
@@ -351,9 +363,9 @@
const confirmSelectEquipment = (val: any) => {
val.forEach((item: IEquipmentList) => {
// 只添加列表里不存在的
- const index = equipmentList.value.findIndex((i: IEquipmentList) => item.equipmentNo === i.equipmentNo)
+ const index = equipmentInfoList.value.findIndex((i: IEquipmentList) => item.equipmentNo === i.equipmentNo)
if (index === -1) {
- equipmentList.value.push(item)
+ equipmentInfoList.value.push(item)
}
})
}
@@ -365,28 +377,109 @@
return false
}
checkoutEquipmentList.value.forEach((item: IEquipmentList) => {
- equipmentList.value.forEach((element, index) => {
+ equipmentInfoList.value.forEach((element, index) => {
if (element.equipmentNo === item.equipmentNo) {
- equipmentList.value.splice(index, 1)
+ equipmentInfoList.value.splice(index, 1)
}
})
})
}
+
+// --------------------------------------证书模板------------------------------------------
+// 选择证书模板Ref
+const templateDialogRef = ref()
+// 选择证书模板
+const handleClickTemplate = () => {
+ templateDialogRef.value.initDialog()
+}
+// 选择证书模板确认
+const confirmCheckoutTemplate = (val: any) => {
+ form.value.templateId = val.id // 证书报告模板id
+ form.value.templateName = val.templateName || '' // 证书报告模板名称
+}
+
+// 点击下载证书模板按钮
+const downloadCertTemplate = () => {
+ if (!form.value.templateId) {
+ ElMessage.warning('请先选择证书模板')
+ return false
+ }
+ if (!sampleList.value.length) {
+ ElMessage.warning('被检样品不能为空')
+ return false
+ }
+ if (!equipmentInfoList.value.length) {
+ ElMessage.warning('所用的计量标准器具不能为空')
+ return false
+ }
+
+ ruleFormRef.value.validate((valid: boolean) => {
+ if (valid) {
+ const params = solveParams()
+ const loading = ElLoading.service({
+ lock: true,
+ background: 'rgba(255, 255, 255, 0.8)',
+ })
+ downLoadTemplate(params).then((res) => {
+ exportFile(res.data, `${form.value.certificateReportName}.xls`)
+ loading.close()
+ }).catch(() => {
+ loading.close()
+ })
+ }
+ })
+}
+
// -------------------------------------------------------------------------------------------
+// 处理保存、下载模板参数
+function solveParams() {
+ const params = {
+ ...form.value,
+ businessEnvironmentRecord: businessEnvironmentRecord.value, // 环境记录单
+ fileList: fileList.value, // 依据的技术文件
+ equipmentInfoList: equipmentInfoList.value, // 所用的计量标准器具列表/监测设备
+ sampleId: sampleList.value[0].id, // 样品id(打印证书接口要必传)
+ sampleNo: sampleList.value[0].sampleNo, // 样品编号
+ sampleName: sampleList.value[0].sampleName, // 样品名称
+ sampleModel: sampleList.value[0].sampleModel, // 样品型号
+ manufacturingNo: sampleList.value[0].manufacturingNo, // 出厂编号
+ manufacturer: sampleList.value[0].manufacturer, // 生产厂家
+ sampleRemark: sampleList.value[0].remark, // 样品备注
+ id: pageType.value === 'add' ? '' : form.value.id,
+ }
+ return params
+}
// 获取详情信息
-const getDetail = () => {
+function getDetail(id?: string, certificateReportCode?: string) {
const loading = ElLoading.service({
lock: true,
background: 'rgba(255, 255, 255, 0.8)',
})
- detail({ id: $route.params.id as string }).then((res) => {
+ getMeasureDataDetail({ id: infoId.value! || id! }).then((res) => {
loading.close()
form.value = res.data
- form.value.createUserName = res.data.applicantName || user.name
- list.value = res.data.sampleList.filter((item: ISampleList) => {
- return item !== null
- })
+ sampleList.value = [{
+ sampleNo: res.data.sampleNo, // 样品编号
+ sampleName: res.data.sampleNo, // 样品名称
+ sampleModel: res.data.sampleNo, // 型号
+ manufacturingNo: res.data.sampleNo, // 出厂编号
+ manufacturer: res.data.sampleNo, // 生产厂家
+ remark: res.data.sampleRemark, // 备注
+ id: res.data.sampleId,
+ }]
+ equipmentInfoList.value = res.data.equipmentInfoList.map((item: { validDate: string }) => {
+ return {
+ ...item,
+ validDate: item.validDate ? dayjs(item.validDate).format('YYYY-MM-DD') : item.validDate,
+ }
+ }) // 所用的计量标准器具
+ businessEnvironmentRecord.value = res.data.businessEnvironmentRecord // 环境记录单数据
+ form.value.environmentCode = res.data.businessEnvironmentRecord.environmentCode// 环境记录单编号
+ if (id && certificateReportCode) {
+ form.value.oldCertificateCode = certificateReportCode
+ form.value.invalid = 1
+ }
}).catch(() => {
loading.close()
})
@@ -399,10 +492,13 @@
// 保存
const handleSave = () => {
- const tempList = list.value.filter(item => item.sampleNo)
- if (!tempList.length) {
- ElMessage.warning('样品信息不能为空')
- return
+ if (!sampleList.value.length) {
+ ElMessage.warning('被检样品不能为空')
+ return false
+ }
+ if (!equipmentInfoList.value.length) {
+ ElMessage.warning('所用的计量标准器具不能为空')
+ return false
}
ruleFormRef.value.validate((valid: boolean) => {
if (valid) {
@@ -410,32 +506,22 @@
lock: true,
background: 'rgba(255, 255, 255, 0.8)',
})
- // 样品&委托单列表(保存/编辑草稿接口入参使用)
- const temList = [] as any // 临时数组
- console.log('保存中的数组', list.value)
-
- list.value.forEach((item: any) => {
- if ((item.orderId && item.id) || (item.orderId && item.sampleId)) {
- temList.push({
- orderId: item.orderId,
- sampleId: item.id || item.sampleId,
- })
- }
- })
- form.value.orderSampleList = temList
+ const params = solveParams()
if (pageType.value === 'add') { // 新建
- addApply(form.value).then((res) => {
- submitId.value = res.data.id
- form.value.projectNo = res.data.projectNo // 分包项目编号
+ addMeasureData(params).then((res) => {
+ submitId.value = res.data.data.id
+ form.value.certificateReportCode = res.data.data.certificateReportCode
+ form.value.certificateReportName = res.data.data.certificateReportName
ElMessage.success('保存成功')
loading.close()
}).catch(() => {
loading.close()
})
}
+
else if (pageType.value === 'edit') { // 编辑
if (query.approvalStatusName === '未通过-驳回') { // 未通过-驳回
- failUpdateApply(form.value).then((res) => {
+ failUpdateMeasureData(params).then((res) => {
ElMessage.success('保存成功')
loading.close()
close()
@@ -444,7 +530,7 @@
})
}
else { // 草稿箱和已取消
- updateApply(form.value).then((res) => {
+ draftUpdateMeasureData(params).then((res) => {
ElMessage.success('保存成功')
loading.close()
close()
@@ -466,7 +552,7 @@
})
const params = {
id: submitId.value,
- formId: query.formId, // 表单id
+ formId: query.formId as string, // 表单id
}
submit(params).then(() => {
ElMessage.success('提交成功')
@@ -481,39 +567,6 @@
}
}
-const sampleVisible = ref(false)
-const projectVisible = ref(false)
-const isMulti = ref(false)
-const selectIndex = ref(0)
-// 点击选择
-const handleSelect = (index: number, row: ISampleList) => {
- sampleVisible.value = true // 选择设备对话框显隐
- isMulti.value = false // 是否单选, false单选、true表格多选
- selectIndex.value = index
-}
-
-const checkoutList = ref([]) // 选中的行
-
-// 修改委托方对话框显隐
-const changeSampleVisible = (val: boolean) => {
- sampleVisible.value = val
-}
-// 修改项目选择对话框显隐
-const changeProjectVisible = (val: boolean) => {
- projectVisible.value = val
-}
-
-// 删除行
-const delRow = () => {
- checkoutList.value.forEach((item: ISampleList) => {
- list.value.forEach((element, index) => {
- if (element.sampleNo === item.sampleNo) {
- list.value.splice(index, 1)
- }
- })
- })
-}
-
// ------------------------------------------审批-----------------------------------------
const approvalRecordData = ref([]) // 审批流程数据
@@ -573,11 +626,26 @@
// ------------------------------------事件-------------------------------------------------
// 检校专业变化
const changeCalibrationMajor = (val: string) => {
- form.value.certificateReportName = form.value.certificateReportCode + val + form.value.certifications
+ const index = calibrationMajorMap.value.findIndex((item: { value: string }) => item.value === val)
+ if (index !== -1) {
+ form.value.calibrationMajorName = calibrationMajorMap.value[index].name
+ }
+ console.log(form.value.calibrationMajorName)
}
// 证书类别变化
const changeCertifications = (val: string) => {
- form.value.certificateReportName = form.value.certificateReportCode + form.value.calibrationMajor + val
+ const index = certificationTypeMap.value.findIndex((item: { value: string }) => item.value === val)
+ if (index !== -1) {
+ form.value.certificateReportCategoryName = certificationTypeMap.value[index].name
+ }
+ console.log(form.value.certificateReportCategoryName)
+}
+// 选择检定员变化
+const changeMeasurePersonId = (val: string) => {
+ const index = userList.value.findIndex(item => item.id === val)
+ if (index !== -1) {
+ form.value.measurePerson = userList.value[index].name
+ }
}
// -------------------------------------------------------------------------------------
onMounted(async () => {
@@ -593,8 +661,9 @@
// form.value.createUser = user.id // 创建人id
// form.value.createUserName = user.name // 创建人
// form.value.applicantTime = proxy.dayjs().format('YYYY-MM-DD HH:mm:ss') // 申请时间
- form.value.jdy = user.name // 创建人
- form.value.jjrq = proxy.dayjs().format('YYYY-MM-DD') // 检校日期
+ form.value.measurePerson = user.name // 检定员名字
+ form.value.measurePersonId = user.id // 检定员id
+ form.value.calibrationTime = proxy.dayjs().format('YYYY-MM-DD') // 检校日期
}
})
@@ -606,7 +675,7 @@
上传证书
-
+
下载证书模板
@@ -641,25 +710,25 @@
label-width="140"
:rules="formRules"
>
-
+
-
+
替代已生成证书
-
-
+
+
-
+
选择
@@ -684,15 +753,15 @@
v-for="item in calibrationMajorMap"
:key="item.value"
:label="item.name"
- :value="item.name"
+ :value="item.value"
/>
-
+
@@ -720,7 +789,7 @@
/>
-
+
+
+
+
+
@@ -761,6 +841,18 @@
/>
+
+
+
+
+
-
-
+
+ filterable
+ @change="changeMeasurePersonId"
+ >
+
+
-
+
-
-
+
+
-
-
+
+
-
-
+
+
-
+
-
+
confirmSelectSample(val, 'order')" />
confirmSelectSample(val, 'warehouse')" />
+
+
+
+
diff --git a/src/api/business/lab/measureData.ts b/src/api/business/lab/measureData.ts
new file mode 100644
index 0000000..ab3a56e
--- /dev/null
+++ b/src/api/business/lab/measureData.ts
@@ -0,0 +1,78 @@
+/**
+ * 计量数据管理
+*/
+import request from '../../index'
+
+// 计量数据管理列表
+export function getMeasureDataList(data: { offset: number; limit: number }) {
+ return request({
+ url: `/business/certificateReport/approval/listPage?offset=${data.offset}&limit=${data.limit}`,
+ method: 'post',
+ data,
+ })
+}
+
+// 点击下载模板后生成证书
+export function downLoadTemplate(data: any) {
+ return request({
+ url: '/business/certificateReport/exportFile',
+ method: 'post',
+ data,
+ responseType: 'blob',
+ })
+}
+
+// 新增
+export function addMeasureData(data: any) {
+ return request({
+ url: '/business/certificateReport/save',
+ method: 'post',
+ data,
+ })
+}
+
+// 草稿箱更新
+export function draftUpdateMeasureData(data: any) {
+ return request({
+ url: '/business/certificateReport/draftUpdate',
+ method: 'post',
+ data,
+ })
+}
+
+// 未通过-驳回编辑
+export function failUpdateMeasureData(data: any) {
+ return request({
+ url: '/business/certificateReport/failUpdate',
+ method: 'post',
+ data,
+ })
+}
+
+// 提交
+export function submit(data: { formId: string; processId?: string; id: string }) {
+ return request({
+ url: '/business/certificateReport/submit',
+ method: 'post',
+ data,
+ })
+}
+
+// 详情
+export function getMeasureDataDetail(data: { id: string }) {
+ return request({
+ url: '/business/certificateReport/detail',
+ method: 'post',
+ data,
+ })
+}
+
+// 删除
+export function deleteMeasureData(data: any) {
+ return request({
+ url: '/business/certificateReport/batchDelete',
+ method: 'post',
+ data,
+ })
+}
+
diff --git a/src/api/business/subpackage/apply.ts b/src/api/business/subpackage/apply.ts
index ad17a5a..c778f8e 100644
--- a/src/api/business/subpackage/apply.ts
+++ b/src/api/business/subpackage/apply.ts
@@ -94,3 +94,4 @@
data,
})
}
+
diff --git a/src/api/system/tool.ts b/src/api/system/tool.ts
index 6b2f5f2..8223e4c 100644
--- a/src/api/system/tool.ts
+++ b/src/api/system/tool.ts
@@ -67,19 +67,10 @@
data,
})
}
-// 原始记录模板/证书报告模板列表(分页)
-export interface listParamsType {
- templateNo: string // 编号
- templateName: string // 名称
- templateCreator: string // 负责人
- // createTime: string // 创建时间
- limit: number
- offset: number
- templateType: string
-}
-export function templatePage(data: listParamsType) {
+
+export function templatePage(data: any) {
return request({
- url: `${prefix}/template/listPage?limit=${data.limit}&offset=${data.offset}`,
+ url: `${prefix}template/listPage?limit=${data.limit}&offset=${data.offset}`,
method: 'post',
data,
})
@@ -87,7 +78,7 @@
// 原始记录模板/证书报告模板列表/详情(
export function templatePageDetail(data: object) {
return request({
- url: `${prefix}/template/detail`,
+ url: `${prefix}template/detail`,
method: 'post',
data,
})
@@ -95,7 +86,7 @@
// 原始记录模板/证书报告模板列表删除
export function templateDelete(data: object) {
return request({
- url: `${prefix}/template/delete`,
+ url: `${prefix}template/delete`,
method: 'post',
data,
})
@@ -103,7 +94,7 @@
// 原始记录模板/证书报告模板列表新建
export function templateAdd(data: object) {
return request({
- url: `${prefix}/template/add`,
+ url: `${prefix}template/add`,
method: 'post',
data,
})
@@ -111,7 +102,7 @@
// 原始记录模板/证书报告模板列表更新
export function templateUpdate(data: object) {
return request({
- url: `${prefix}/template/update`,
+ url: `${prefix}template/update`,
method: 'post',
data,
})
@@ -119,7 +110,7 @@
// 原始记录模板/证书报告模板列表导出
export function templateExport(data: object) {
return request({
- url: `${prefix}/template/listExport`,
+ url: `${prefix}template/listExport`,
method: 'post',
data,
responseType: 'blob',
diff --git a/src/components.d.ts b/src/components.d.ts
index edc2e04..64cf608 100644
--- a/src/components.d.ts
+++ b/src/components.d.ts
@@ -46,6 +46,7 @@
ImageUpload: typeof import('./components/ImageUpload/index.vue')['default']
LineChart: typeof import('./components/Echart/LineChart.vue')['default']
MeasureRecords: typeof import('./components/Sample/measureRecords.vue')['default']
+ MultiHeaderTable: typeof import('./components/MultiHeaderTable/index.vue')['default']
NodeWrap: typeof import('./components/workFlow/nodeWrap.vue')['default']
NodeWrapBan: typeof import('./components/workFlow/nodeWrapBan.vue')['default']
NormalTable: typeof import('./components/NormalTable/index.vue')['default']
@@ -67,6 +68,7 @@
SelectStaffDialog: typeof import('./components/dialog/selectStaffDialog.vue')['default']
SvgIcon: typeof import('./components/SvgIcon/index.vue')['default']
SystemInfo: typeof import('./components/SystemInfo/index.vue')['default']
+ TableColumn: typeof import('./components/MultiHeaderTable/tableColumn.vue')['default']
TableContainer: typeof import('./components/TableContainer/index.vue')['default']
Trend: typeof import('./components/Trend/index.vue')['default']
WordOreview: typeof import('./components/filePreview/wordOreview.vue')['default']
diff --git a/src/components/MultiHeaderTable/index.vue b/src/components/MultiHeaderTable/index.vue
new file mode 100644
index 0000000..85b8c88
--- /dev/null
+++ b/src/components/MultiHeaderTable/index.vue
@@ -0,0 +1,343 @@
+
+
+
+
+
+
+
diff --git a/src/components/MultiHeaderTable/tableColumn.vue b/src/components/MultiHeaderTable/tableColumn.vue
new file mode 100644
index 0000000..2b87285
--- /dev/null
+++ b/src/components/MultiHeaderTable/tableColumn.vue
@@ -0,0 +1,147 @@
+
+
+
+
+
+
+
+
+
+
+ *{{ item.text }}
+
+
+ *{{ item.text }}
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ scope.row[item.value] }}
+
+
+ {{
+ scope.row[item.value]
+ }}
+
+
+
+
+
+
diff --git a/src/components/NormalTable/index.vue b/src/components/NormalTable/index.vue
index e56f775..67092d3 100644
--- a/src/components/NormalTable/index.vue
+++ b/src/components/NormalTable/index.vue
@@ -3,6 +3,7 @@
import { ElTable } from 'element-plus'
import { defineExpose, ref } from 'vue'
import type { TableColumn } from './table_interface'
+import showPhoto from '@/views/system/tool/showPhoto.vue'
// ------------------定义props、 emit-------------------
const props = defineProps({
@@ -212,8 +213,8 @@
{{ scope.row[column.value] }}
{{ column.filter(scope.row) }}
- {{ scope.row }}
-
+
+
diff --git a/src/utils/useCheckList.ts b/src/utils/useCheckList.ts
new file mode 100644
index 0000000..c7782f0
--- /dev/null
+++ b/src/utils/useCheckList.ts
@@ -0,0 +1,73 @@
+import { ElMessage } from 'element-plus'
+// import type { TableColumn } from '@/components/NormalTable/table_interface'
+
+/**
+ * 检查列表
+ * @param list 要检查的表格数据(被依赖项如果满足某个条件就去检查依赖项,否则不检查依赖项)
+ * @param columns // 表头信息
+ * @param tableTitle // 表格名称
+ * @param depend // 依赖项
+ * @param depended // 被依赖项
+ * @param dependedValue // 被依赖项条件
+ * @param requireLength // 要检查的表格数据长度是否大于0
+ */
+export default function useCheckList(list: any, columns: any, tableTitle = '', depend?: string, depended?: string, dependedValue?: number | string, requireLength = false): boolean {
+ for (const prop of columns) {
+ for (let index = 0; index < list.length; index++) {
+ const item = list[index]
+
+ if (depend && depended && item[depended] === dependedValue && !(`${item[prop.value]}`)) { // 被依赖项满足条件时需要检查
+ ElMessage.warning(`请先完善 ${tableTitle} 第${index + 1}行中 ${prop.text} 字段`)
+ return false
+ }
+ else {
+ // 检查必填
+ if (prop.required && (!(`${item[prop.value]}`) || `${item[prop.value]}` === 'null' || `${item[prop.value]}` === 'undefined' || item[prop.value] == undefined)) {
+ if (`${prop.belongStandardEquipment}` === '15') { // 小功率
+ ElMessage.warning(`${tableTitle} 第${index + 1}行中 ${prop.message} ${prop.text} 字段不能为空`)
+ }
+ else {
+ ElMessage.warning(`请先完善 ${tableTitle} 第${index + 1}行中 ${prop.text} 字段`)
+ }
+ return false
+ }
+ }
+
+ // 验证正则
+ if (prop.reg && typeof prop.reg === 'function') {
+ if (prop.value === 'resolution') { // 分辨力特殊处理
+ if (!prop.reg(item[prop.value])) {
+ ElMessage.warning(`${tableTitle} 第${index + 1}行中 ${prop.text} 不能大于1`)
+ return false
+ }
+ }
+ else {
+ if (!prop.reg(item[prop.value])) {
+ if (`${prop.belongStandardEquipment}` === '15') { // 小功率
+ ElMessage.warning(`${tableTitle} 第${index + 1}行中 ${prop.message} ${prop.text} 字段不能为0`)
+ }
+ else if (`${prop.belongStandardEquipment}` === '17') { // S参数
+ ElMessage.warning(`${tableTitle} 第${index + 1}行中 ${prop.text} 仅允许输入数字、字母、特殊字符`)
+ }
+ else {
+ ElMessage.warning(`${tableTitle} 第${index + 1}行中 ${prop.text} 字段输入不合法`)
+ }
+ return false
+ }
+ }
+ }
+
+ if (prop.children && prop.children.length) {
+ if (!useCheckList(list, prop.children, tableTitle, depend, depended, dependedValue)) {
+ return false
+ }
+ }
+ }
+ }
+
+ if (requireLength && !list.length) {
+ ElMessage.warning(`${tableTitle}表格数据不能为空`)
+ return false
+ }
+ return true
+}
diff --git a/src/views/business/lab/components/selectOrderSamplesDialog.vue b/src/views/business/lab/components/selectOrderSamplesDialog.vue
index 4002f83..b004107 100644
--- a/src/views/business/lab/components/selectOrderSamplesDialog.vue
+++ b/src/views/business/lab/components/selectOrderSamplesDialog.vue
@@ -14,6 +14,7 @@
const loadingTable = ref(false) // loading
const list = ref([]) // 表格参数
const tableRef = ref()
+const isMulti = ref(true) // 是否多选默认为多选
const columns = ref
([
{ text: '被测样品名称', value: 'sampleName', align: 'center', required: true },
{ text: '型号规格', value: 'sampleModel', align: 'center', required: true },
@@ -60,9 +61,10 @@
}
// 初始化
-const initDialog = (orderIdParam: string) => {
+const initDialog = (orderIdParam: string, isMultiParam = true) => {
dialogFormVisible.value = true
orderId.value = orderIdParam
+ isMulti.value = isMultiParam
getList()
}
defineExpose({ initDialog })
@@ -78,7 +80,7 @@
:columns="columns"
is-showmulti-select
:list-loading="loadingTable"
- :is-multi="true"
+ :is-multi="isMulti"
:height="300"
:pagination="false"
@multi-select="handleSelectionChange"
diff --git a/src/views/business/lab/components/selectReportTemplate.vue b/src/views/business/lab/components/selectReportTemplate.vue
index 5c59693..ec36ef7 100644
--- a/src/views/business/lab/components/selectReportTemplate.vue
+++ b/src/views/business/lab/components/selectReportTemplate.vue
@@ -7,8 +7,9 @@
import type { typeofSign } from '@/views/system/tool/tool_interface'
import { templatePage } from '@/api/system/tool'
-const emits = defineEmits(['add'])
+const emits = defineEmits(['confirm'])
const dialogFormVisible = ref(false) // 控制弹窗显隐
+const createTime = ref()
// 查询参数
const searchQuery = reactive({
templateNo: '', // 编号
@@ -18,31 +19,43 @@
createEndTime: '',
limit: 5,
offset: 1,
- templateType: '',
+ certificationType: '0',
ids: [] as string[],
}) // 查询参数
const loadingTable = ref(false) // loading
const list = ref([]) // 表格参数
const total = ref(0)
const columns = ref([
- { text: '编号', value: 'templateNo', align: 'center', width: '180' },
- { text: '模板名称', value: 'templateName', align: 'center', width: '150' },
- { text: '模板负责人', value: 'templateCreator', align: 'center', width: '100' },
- { text: '创建时间', value: 'createTime', align: 'center', width: '250' },
- { text: '描述', value: 'templateDesc', align: 'center' },
+ { text: '编号', value: 'templateNo', align: 'center', width: '160' },
+ { text: '模板名称', value: 'templateName', align: 'center' },
+ { text: '模板类型', value: 'templateTypeName', align: 'center', width: '100' },
+ { text: '负责人', value: 'templateCreator', align: 'center', width: '100' },
+ { text: '内容描述', value: 'templateDesc', align: 'center' },
+ { text: '创建时间', value: 'createTime', align: 'center', width: '180' },
])
const checkoutList = ref([]) // 多选选中参数
-// 获取类型
-const getType = async () => {
- const res = await getDictByCode('templateType')
- searchQuery.templateType = res.data.filter((item: typeofSign) => item.name === '证书报告模板')[0].value
+// ---------------------------------------字典--------------------------------------------
+const templateTypeMap = ref([]) as any // 模板类型
+// 获取字典值
+async function getDict() {
+ // 模板类型
+ const res = await getDictByCode('certificationType')
+ res.data.forEach((item: { value: string; name: string }) => {
+ templateTypeMap.value[`${item.value}`] = item.name
+ })
}
+// ----------------------------------------------------------------------------------------------
// 获取数据列表
const getList = () => {
loadingTable.value = true
templatePage(searchQuery).then((res) => {
if (res.code === 200) {
- list.value = res.data.rows
+ list.value = res.data.rows.map((item: { certificationType: string }) => {
+ return {
+ ...item,
+ templateTypeName: `${item.certificationType}` ? templateTypeMap.value[item.certificationType] : item.certificationType, // 模板类型
+ }
+ })
total.value = res.data.total
}
loadingTable.value = false
@@ -74,7 +87,8 @@
searchQuery.createEndTime = ''
searchQuery.limit = 5
searchQuery.offset = 1
- // searchQuery.templateType = '' // 类型不能变
+ searchQuery.certificationType = '0'
+ createTime.value = ''
searchQuery.ids = []
getList()
}
@@ -82,10 +96,10 @@
// 点击保存
const submitForm = () => {
if (!checkoutList.value.length) {
- ElMessage.warning('请选择证书报告模板')
+ ElMessage.warning('请选择证书模板')
}
else {
- emits('add', checkoutList.value[0])
+ emits('confirm', checkoutList.value[0])
dialogFormVisible.value = false
}
}
@@ -103,15 +117,25 @@
// 初始化
const initDialog = () => {
dialogFormVisible.value = true
- getType().then((_) => {
+ getDict().then((_) => {
getList()
})
}
+watch(() => createTime.value, (newVal) => {
+ if (newVal) {
+ searchQuery.createStartTime = newVal[0]
+ searchQuery.createEndTime = newVal[1]
+ }
+ else {
+ searchQuery.createStartTime = ''
+ searchQuery.createEndTime = ''
+ }
+})
defineExpose({ initDialog })
-
+
@@ -121,7 +145,18 @@
-
+
+
+
+
diff --git a/src/views/business/lab/measureData/dialog/selectMeasueDataDialog.vue b/src/views/business/lab/measureData/dialog/selectMeasueDataDialog.vue
new file mode 100644
index 0000000..f8be703
--- /dev/null
+++ b/src/views/business/lab/measureData/dialog/selectMeasueDataDialog.vue
@@ -0,0 +1,199 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ (listQuery.offset - 1) * listQuery.limit + scope.$index + 1 }}
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/views/business/lab/measureData/dialog/selectTechFilesDialog.vue b/src/views/business/lab/measureData/dialog/selectTechFilesDialog.vue
new file mode 100644
index 0000000..f6f1a5a
--- /dev/null
+++ b/src/views/business/lab/measureData/dialog/selectTechFilesDialog.vue
@@ -0,0 +1,247 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ (listQuery.offset - 1) * listQuery.limit + scope.$index + 1 }}
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/views/business/lab/measureData/measureData-interface.ts b/src/views/business/lab/measureData/measureData-interface.ts
index 8319f65..d25a212 100644
--- a/src/views/business/lab/measureData/measureData-interface.ts
+++ b/src/views/business/lab/measureData/measureData-interface.ts
@@ -1,13 +1,14 @@
// 查询条件
export interface IListQuery {
- approvalStatus: string // 审批状态
- certificateReportCode: string // 证书编号
- certificateReportName: string // 证书名称
- customerName: string // 委托方名称
- sampleName: string // 样品名称
- measureCategory: string // 检校类别
- approvalStatusName: string // 审批状态名称
- formId: string
+ approvalStatus: string // 审批状态类型code
+ certificateReportCode: string // 证书编号
+ certificateReportName: string // 证书名称
+ customerName: string // 委托方名称
+ formId: string // 表单id(流程定义对应的表单id,等价于业务id)
+ measureCategory: string // 检校类别
+ orderCode: string // 委托书编号
+ sampleName: string // 样品名称
+ sampleNo: string // 样品编号
offset: number
limit: number
}
@@ -28,47 +29,53 @@
calibrationTime: string // 检校日期
taskId?: string // 任务id 用于审批
decisionItem?: string
- applyApprovalStatusName?: string // 审批状态名称
+ approvalStatusName?: string // 审批状态名称
processId?: string // 流程实例id
}
// 表单
export interface IForm {
- tdysczs: number // 替代已生成证书
+ id?: string
+ invalid: number // 替代已生成证书
formId: string
- yzs: string // 原证书
+ oldCertificateCode: string // 原证书
calibrationMajor: string // 检校专业
- certifications: string // 证书类别
+ calibrationMajorName: string // 检校专业名称
+ certificateReportCategory: string // 证书类别
+ certificateReportCategoryName: string // 证书类别名称
certificateReportCode: string // 证书编号
certificateReportName: string // 证书名称
- jdy: string // 检定员
- jjrq: string // 检校日期
+ measurePerson: string // 检定员
+ measurePersonId: string // 检定员id
+ calibrationTime: string // 检校日期
orderCode: string // 委托书
orderId: string // 委托书id
customerId?: string // 委托放id
customerName: string // 委托方名称
+ customerAddress: string // 委托方地址
certificationCompany: string // 证书单位名称
certificationCompanyAddress: string // 证书单位地址
calibrationPlace: string // 检校地点
- fjsj: string // 复校时间
- jssj: string // 接收时间
- jdjg: string // 检定结果
- environmentCode: string// 环境记录单编号
+ repeatTime: string // 复校时间
+ deliverTime: string // 接收时间
+ measureResult: string // 检定结果
+ environmentCode: string // 环境记录单编号
environmentId: string // 环境记录单id
temperature: string // 温度
humidity: string // 湿度
+ techFilesName: string // 依据的技术文件名称
signId: string // 电子签章id
signName: string // 电子签章名称
approvalSignIds: string // 认可标志专用章id
approvalSignName: string // 认可标志专用章名称
remark: string // 备注
- ywy: string // 业务员
+ busPersonId: string // 业务员id
+ busPersonName: string // 业务员名字
templateId: string // 证书模板
templateName: string // 证书模板
- templateNameFile: string // 证书模板文件
certificateReportFile: string // 证书报告附件
processId?: string // 流程实例id
@@ -76,6 +83,7 @@
// 被检样品
export interface ISampleList {
+ id: string // 样品id
sampleNo: string // 样品编号
sampleName: string // 样品名称
sampleModel: string // 型号
diff --git a/src/views/business/lab/measureData/measureDataDetail.vue b/src/views/business/lab/measureData/measureDataDetail.vue
index 4aa9717..c554c33 100644
--- a/src/views/business/lab/measureData/measureDataDetail.vue
+++ b/src/views/business/lab/measureData/measureDataDetail.vue
@@ -3,6 +3,7 @@
import { ElLoading, ElMessage, ElMessageBox } from 'element-plus'
import type { FormInstance, FormRules } from 'element-plus'
import { ref } from 'vue'
+import dayjs from 'dayjs'
import EnvironmentalDialog from '../components/environmentalDialog.vue'
import selectSignature from '../components/selectSignature.vue'
import selectReportTemplate from '../components/selectReportTemplate.vue'
@@ -10,10 +11,12 @@
import SelectSamplesDialog from '../components/selectSamplesDialog.vue'
import selectMeasureDevice from '../components/selectMeasureDevice.vue'
import type { IEquipmentList, IForm, ISampleList } from './measureData-interface'
+import selectMeasueDataDialog from './dialog/selectMeasueDataDialog.vue'
+import selectTechFilesDialog from './dialog/selectTechFilesDialog.vue'
import { UploadFile } from '@/api/measure/file'
import ApprovalDialog from '@/components/Approval/ApprovalDialog.vue'
import type { TableColumn } from '@/components/NormalTable/table_interface'
-import { addApply, detail, failUpdateApply, submit, updateApply } from '@/api/business/subpackage/apply'
+import { addMeasureData, downLoadTemplate, draftUpdateMeasureData, failUpdateMeasureData, getMeasureDataDetail, submit } from '@/api/business/lab/measureData'
import { cancelApproval, fetchApproval, submitApproval } from '@/api/approval'
import showPhoto from '@/views/system/tool/showPhoto.vue'
import { getDictByCode } from '@/api/system/dict'
@@ -21,6 +24,9 @@
import selectOrder from '@/views/business/schedule/interchangeReceipt/selectOrder.vue'
import { downloadFile } from '@/utils/download'
import type { dictType } from '@/global'
+import { getUserList } from '@/api/system/user'
+import { exportFile } from '@/utils/exportUtils'
+
const user = useUserStore() // 用户信息
const textMap: { [key: string]: string } = {
edit: '编辑',
@@ -31,6 +37,8 @@
const $router = useRouter() // 关闭页面使用
const $route = useRoute()
const query = $route.query
+console.log('opopopop', query)
+
const approvalDialog = ref() // 审批对话ref
const pageType = ref('add') // 页面类型: add, edit, detail
const infoId = ref('') // 列表id
@@ -38,57 +46,63 @@
const orderVisible = ref(false) // 控制委托单对话框显隐
const ruleFormRef = ref() as any
const form = ref({
- tdysczs: 0, // 替代已生成证书
+ invalid: 0, // 替代已生成证书
formId: query.formId as string,
- yzs: '', // 原证书
+ oldCertificateCode: '', // 原证书
calibrationMajor: '', // 检校专业
- certifications: '', // 证书类别
+ calibrationMajorName: '', // 检校专业名称
+ certificateReportCategory: '', // 证书类别
+ certificateReportCategoryName: '', // 证书类别名称
certificateReportCode: '', // 证书编号
certificateReportName: '', // 证书名称
- jdy: '', // 检定员
- jjrq: '', // 检校日期
+ measurePerson: '', // 检定员
+ measurePersonId: '', // 检定员id
+ calibrationTime: '', // 检校日期
- orderCode: '', // 委托单
+ orderCode: '', // 委托单编号
orderId: '', // 委托单id
customerName: '', // 委托方名称
+ customerAddress: '', // 委托方地址
certificationCompany: '', // 证书单位名称
certificationCompanyAddress: '', // 证书单位地址
calibrationPlace: '', // 检校地点
- fjsj: '', // 复校时间
- jssj: '', // 接收时间
- jdjg: '', // 检定结果
+ repeatTime: '', // 复校时间
+ deliverTime: '', // 接收时间
+ measureResult: '', // 检定结果
environmentCode: '', // 环境记录单编号
environmentId: '', // 环境记录单id
temperature: '', // 温度
humidity: '', // 湿度
+ techFilesName: '', // 依据的技术文件名称
signId: '', // 电子签章id
signName: '', // 电子签章名称
approvalSignIds: '', // 认可标志专用章id
approvalSignName: '', // 认可标志专用章名称
remark: '', // 备注
- ywy: '', // 业务员
+ busPersonId: '', // 业务员id
+ busPersonName: '', // 业务员名字
templateId: '', // 证书模板
templateName: '', // 证书模板
- templateNameFile: '', // 证书模板文件
certificateReportFile: '', // 证书报告附件
})
// 校验规则
const formRules = ref({
- yzs: [{ required: true, message: '原证书必填', trigger: ['blur', 'change'] }],
+ oldCertificateCode: [{ required: true, message: '原证书必填', trigger: ['blur', 'change'] }],
calibrationMajor: [{ required: true, message: '检校专业必填', trigger: ['blur', 'change'] }],
- certifications: [{ required: true, message: '证书类别必填', trigger: ['blur', 'change'] }],
+ certificateReportCategory: [{ required: true, message: '证书类别必填', trigger: ['blur', 'change'] }],
certificateReportName: [{ required: true, message: '证书名称必填', trigger: ['blur', 'change'] }],
customerName: [{ required: true, message: '委托方名称必填', trigger: ['blur', 'change'] }],
+ customerAddress: [{ required: true, message: '委托方地址必填', trigger: ['blur', 'change'] }],
certificationCompany: [{ required: true, message: '证书单位名称必填', trigger: ['blur', 'change'] }],
certificationCompanyAddress: [{ required: true, message: '证书单位地址必填', trigger: ['blur', 'change'] }],
calibrationPlace: [{ required: true, message: '检校地点必填', trigger: ['blur', 'change'] }],
- jdy: [{ required: true, message: '检定员必填', trigger: ['blur', 'change'] }],
- jjrq: [{ required: true, message: '检校日期必填', trigger: ['blur', 'change'] }],
- fjsj: [{ required: true, message: '复校时间必填', trigger: ['blur', 'change'] }],
- jssj: [{ required: true, message: '接收时间必填', trigger: ['blur', 'change'] }],
- jdjg: [{ required: true, message: '检定结果必填', trigger: ['blur', 'change'] }],
+ measurePersonId: [{ required: true, message: '检定员必填', trigger: ['blur', 'change'] }],
+ calibrationTime: [{ required: true, message: '检校日期必填', trigger: ['blur', 'change'] }],
+ repeatTime: [{ required: true, message: '复校时间必填', trigger: ['blur', 'change'] }],
+ deliverTime: [{ required: true, message: '接收时间必填', trigger: ['blur', 'change'] }],
+ measureResult: [{ required: true, message: '检定结果必填', trigger: ['blur', 'change'] }],
temperature: [
{ required: true, message: '温度必填', trigger: ['blur', 'change'] },
{ pattern: /(^-?\d\d*\.\d*$)|(^-?\d\d*$)|(^-?\.\d\d*$)/, message: '温度只能为数字', trigger: ['blur', 'change'] },
@@ -111,6 +125,7 @@
// ---------------------------------------字典--------------------------------------------
const certificationTypeMap = ref([]) // 证书类别
const calibrationMajorMap = ref([]) // 校检专业
+const userList = ref([]) // 检定员
// 获取字典值
async function getDict() {
// 校检专业
@@ -119,12 +134,22 @@
// 证书类别
const rescertificationType = await getDictByCode('certificationType')
certificationTypeMap.value = rescertificationType.data
+
+ // 获取人员列表
+ getUserList({ offset: 1, limit: 99999 }).then((res) => {
+ userList.value = res.data.rows
+ })
}
getDict()
// -------------------------------------原证书--------------------------------------------
+const selectMeasueDataDialogRef = ref() // 选择原证书组件ref
// 点击选择原证书
const selectOrigin = () => {
- //
+ selectMeasueDataDialogRef.value.initDialog()
+}
+// 选好原证书
+const selectMeasueDataConfirm = (val: any) => {
+ getDetail(val.id, val.certificateReportCode)
}
// ------------------------------------委托单------------------------------------------
// 点击选择委托单编号
@@ -142,12 +167,17 @@
form.value.orderCode = val[0].orderCode // 委托单
form.value.customerId = val[0].customerId// 委托方id
form.value.customerName = val[0].customerName// 委托方名称
+ form.value.customerAddress = val[0].customerAddress// 委托方地址
form.value.certificationCompany = val[0].certificationCompany// 证书单位名称
form.value.certificationCompanyAddress = val[0].certificationCompanyAddress// 证书单位地址
+ form.value.certificationCompanyAddress = val[0].certificationCompanyAddress// 证书单位地址
+ form.value.busPersonId = val[0].busPersonId// 业务员id
+ form.value.busPersonName = val[0].busPersonName// 业务员名字
}
}
// -------------------------------选择环境记录单----------------------------------------
+const businessEnvironmentRecord = ref({}) as any // 环境记录单信息
// 选择环境记录单Ref
const environmentalDialog = ref()
// 选择环境记录单
@@ -156,6 +186,7 @@
}
// 选择环境记录单表格确认
const environmentalAdd = (data: any) => {
+ businessEnvironmentRecord.value = data
form.value.environmentId = data.id // 环境记录单id
form.value.environmentCode = data.environmentCode // 环境记录单编号
form.value.temperature = data.temperature // 温度
@@ -200,35 +231,16 @@
}
// -----------------------------------------所依据的技术文件----------------------------------
+const selectTechFilesRef = ref()
+const fileList = ref([]) // 依据的技术文件
// 点击所依据的技术文件
const selectTechFiles = () => {
- //
+ selectTechFilesRef.value.initDialog()
}
-// --------------------------------------证书模板------------------------------------------
-// 选择证书模板Ref
-const templateDialog = ref()
-// 选择证书模板
-const handleClickTemplate = () => {
- templateDialog.value.initDialog()
-}
-// 选择证书模板确认
-const confirmCheckoutTemplate = (val: any) => {
- form.value.templateId = val.id // 证书报告模板id
- form.value.templateName = val.templateName || '' // 证书报告模板名称
- form.value.templateNameFile = val.minioFileName // 证书模板附件
-}
-
-// 点击下载证书模板按钮
-const downloadCertTemplate = () => {
- if (!form.value.templateId) {
- ElMessage.warning('请先选择证书模板')
- return false
- }
- if (!form.value.templateNameFile) {
- ElMessage.warning('选择的证书模板无附件,请检查')
- return false
- }
- downloadFile(form.value.templateNameFile as any, `${form.value.templateName}-${form.value.templateNameFile}`)
+// 选好依据的技术文件
+const selectTechFilesConfirm = (val: any) => {
+ fileList.value = val
+ form.value.techFilesName = val.map((item: { fileName: string }) => item.fileName).join(',')
}
// ---------------------------------文件上传(上传证书)-------------------------------------------
@@ -283,10 +295,10 @@
// 点击批量添加/选择
const addSample = () => {
- if (form.value.orderId) {
- selectOrderSamplesDialogRef.value.initDialog(form.value.orderId)
+ if (form.value.orderId) { // 选择委托单下的样品
+ selectOrderSamplesDialogRef.value.initDialog(form.value.orderId, false)
}
- else {
+ else { // 选择样品库中的样品
selectSamplesDialogRef.value.initDialog()
}
}
@@ -318,7 +330,7 @@
}
// ----------------------------------------------所用的计量标准器具--------------------------------------------
const equipmentVisible = ref(false) // 选择设备对话框显隐
-const equipmentList = ref([])// 表格数据
+const equipmentInfoList = ref([])// 表格数据
const checkoutEquipmentList = ref([])// 多选设备
// 表头
const equipmentColumns = ref([
@@ -328,8 +340,8 @@
{ text: '出厂编号', value: 'manufacturingNo', align: 'center' },
{ text: '测量范围', value: 'mesureRange', align: 'center' },
{ text: '不确定度', value: 'uncertainty', align: 'center' },
- { text: '溯源机构', value: 'syjg', align: 'center' },
- { text: '证书编号', value: 'zsbh', align: 'center' },
+ { text: '溯源机构', value: 'mesureDeptName', align: 'center' },
+ // { text: '证书编号', value: 'zsbh', align: 'center' },
{ text: '有效日期', value: 'validDate', align: 'center' },
])
@@ -351,9 +363,9 @@
const confirmSelectEquipment = (val: any) => {
val.forEach((item: IEquipmentList) => {
// 只添加列表里不存在的
- const index = equipmentList.value.findIndex((i: IEquipmentList) => item.equipmentNo === i.equipmentNo)
+ const index = equipmentInfoList.value.findIndex((i: IEquipmentList) => item.equipmentNo === i.equipmentNo)
if (index === -1) {
- equipmentList.value.push(item)
+ equipmentInfoList.value.push(item)
}
})
}
@@ -365,28 +377,109 @@
return false
}
checkoutEquipmentList.value.forEach((item: IEquipmentList) => {
- equipmentList.value.forEach((element, index) => {
+ equipmentInfoList.value.forEach((element, index) => {
if (element.equipmentNo === item.equipmentNo) {
- equipmentList.value.splice(index, 1)
+ equipmentInfoList.value.splice(index, 1)
}
})
})
}
+
+// --------------------------------------证书模板------------------------------------------
+// 选择证书模板Ref
+const templateDialogRef = ref()
+// 选择证书模板
+const handleClickTemplate = () => {
+ templateDialogRef.value.initDialog()
+}
+// 选择证书模板确认
+const confirmCheckoutTemplate = (val: any) => {
+ form.value.templateId = val.id // 证书报告模板id
+ form.value.templateName = val.templateName || '' // 证书报告模板名称
+}
+
+// 点击下载证书模板按钮
+const downloadCertTemplate = () => {
+ if (!form.value.templateId) {
+ ElMessage.warning('请先选择证书模板')
+ return false
+ }
+ if (!sampleList.value.length) {
+ ElMessage.warning('被检样品不能为空')
+ return false
+ }
+ if (!equipmentInfoList.value.length) {
+ ElMessage.warning('所用的计量标准器具不能为空')
+ return false
+ }
+
+ ruleFormRef.value.validate((valid: boolean) => {
+ if (valid) {
+ const params = solveParams()
+ const loading = ElLoading.service({
+ lock: true,
+ background: 'rgba(255, 255, 255, 0.8)',
+ })
+ downLoadTemplate(params).then((res) => {
+ exportFile(res.data, `${form.value.certificateReportName}.xls`)
+ loading.close()
+ }).catch(() => {
+ loading.close()
+ })
+ }
+ })
+}
+
// -------------------------------------------------------------------------------------------
+// 处理保存、下载模板参数
+function solveParams() {
+ const params = {
+ ...form.value,
+ businessEnvironmentRecord: businessEnvironmentRecord.value, // 环境记录单
+ fileList: fileList.value, // 依据的技术文件
+ equipmentInfoList: equipmentInfoList.value, // 所用的计量标准器具列表/监测设备
+ sampleId: sampleList.value[0].id, // 样品id(打印证书接口要必传)
+ sampleNo: sampleList.value[0].sampleNo, // 样品编号
+ sampleName: sampleList.value[0].sampleName, // 样品名称
+ sampleModel: sampleList.value[0].sampleModel, // 样品型号
+ manufacturingNo: sampleList.value[0].manufacturingNo, // 出厂编号
+ manufacturer: sampleList.value[0].manufacturer, // 生产厂家
+ sampleRemark: sampleList.value[0].remark, // 样品备注
+ id: pageType.value === 'add' ? '' : form.value.id,
+ }
+ return params
+}
// 获取详情信息
-const getDetail = () => {
+function getDetail(id?: string, certificateReportCode?: string) {
const loading = ElLoading.service({
lock: true,
background: 'rgba(255, 255, 255, 0.8)',
})
- detail({ id: $route.params.id as string }).then((res) => {
+ getMeasureDataDetail({ id: infoId.value! || id! }).then((res) => {
loading.close()
form.value = res.data
- form.value.createUserName = res.data.applicantName || user.name
- list.value = res.data.sampleList.filter((item: ISampleList) => {
- return item !== null
- })
+ sampleList.value = [{
+ sampleNo: res.data.sampleNo, // 样品编号
+ sampleName: res.data.sampleNo, // 样品名称
+ sampleModel: res.data.sampleNo, // 型号
+ manufacturingNo: res.data.sampleNo, // 出厂编号
+ manufacturer: res.data.sampleNo, // 生产厂家
+ remark: res.data.sampleRemark, // 备注
+ id: res.data.sampleId,
+ }]
+ equipmentInfoList.value = res.data.equipmentInfoList.map((item: { validDate: string }) => {
+ return {
+ ...item,
+ validDate: item.validDate ? dayjs(item.validDate).format('YYYY-MM-DD') : item.validDate,
+ }
+ }) // 所用的计量标准器具
+ businessEnvironmentRecord.value = res.data.businessEnvironmentRecord // 环境记录单数据
+ form.value.environmentCode = res.data.businessEnvironmentRecord.environmentCode// 环境记录单编号
+ if (id && certificateReportCode) {
+ form.value.oldCertificateCode = certificateReportCode
+ form.value.invalid = 1
+ }
}).catch(() => {
loading.close()
})
@@ -399,10 +492,13 @@
// 保存
const handleSave = () => {
- const tempList = list.value.filter(item => item.sampleNo)
- if (!tempList.length) {
- ElMessage.warning('样品信息不能为空')
- return
+ if (!sampleList.value.length) {
+ ElMessage.warning('被检样品不能为空')
+ return false
+ }
+ if (!equipmentInfoList.value.length) {
+ ElMessage.warning('所用的计量标准器具不能为空')
+ return false
}
ruleFormRef.value.validate((valid: boolean) => {
if (valid) {
@@ -410,32 +506,22 @@
lock: true,
background: 'rgba(255, 255, 255, 0.8)',
})
- // 样品&委托单列表(保存/编辑草稿接口入参使用)
- const temList = [] as any // 临时数组
- console.log('保存中的数组', list.value)
-
- list.value.forEach((item: any) => {
- if ((item.orderId && item.id) || (item.orderId && item.sampleId)) {
- temList.push({
- orderId: item.orderId,
- sampleId: item.id || item.sampleId,
- })
- }
- })
- form.value.orderSampleList = temList
+ const params = solveParams()
if (pageType.value === 'add') { // 新建
- addApply(form.value).then((res) => {
- submitId.value = res.data.id
- form.value.projectNo = res.data.projectNo // 分包项目编号
+ addMeasureData(params).then((res) => {
+ submitId.value = res.data.data.id
+ form.value.certificateReportCode = res.data.data.certificateReportCode
+ form.value.certificateReportName = res.data.data.certificateReportName
ElMessage.success('保存成功')
loading.close()
}).catch(() => {
loading.close()
})
}
+
else if (pageType.value === 'edit') { // 编辑
if (query.approvalStatusName === '未通过-驳回') { // 未通过-驳回
- failUpdateApply(form.value).then((res) => {
+ failUpdateMeasureData(params).then((res) => {
ElMessage.success('保存成功')
loading.close()
close()
@@ -444,7 +530,7 @@
})
}
else { // 草稿箱和已取消
- updateApply(form.value).then((res) => {
+ draftUpdateMeasureData(params).then((res) => {
ElMessage.success('保存成功')
loading.close()
close()
@@ -466,7 +552,7 @@
})
const params = {
id: submitId.value,
- formId: query.formId, // 表单id
+ formId: query.formId as string, // 表单id
}
submit(params).then(() => {
ElMessage.success('提交成功')
@@ -481,39 +567,6 @@
}
}
-const sampleVisible = ref(false)
-const projectVisible = ref(false)
-const isMulti = ref(false)
-const selectIndex = ref(0)
-// 点击选择
-const handleSelect = (index: number, row: ISampleList) => {
- sampleVisible.value = true // 选择设备对话框显隐
- isMulti.value = false // 是否单选, false单选、true表格多选
- selectIndex.value = index
-}
-
-const checkoutList = ref([]) // 选中的行
-
-// 修改委托方对话框显隐
-const changeSampleVisible = (val: boolean) => {
- sampleVisible.value = val
-}
-// 修改项目选择对话框显隐
-const changeProjectVisible = (val: boolean) => {
- projectVisible.value = val
-}
-
-// 删除行
-const delRow = () => {
- checkoutList.value.forEach((item: ISampleList) => {
- list.value.forEach((element, index) => {
- if (element.sampleNo === item.sampleNo) {
- list.value.splice(index, 1)
- }
- })
- })
-}
-
// ------------------------------------------审批-----------------------------------------
const approvalRecordData = ref([]) // 审批流程数据
@@ -573,11 +626,26 @@
// ------------------------------------事件-------------------------------------------------
// 检校专业变化
const changeCalibrationMajor = (val: string) => {
- form.value.certificateReportName = form.value.certificateReportCode + val + form.value.certifications
+ const index = calibrationMajorMap.value.findIndex((item: { value: string }) => item.value === val)
+ if (index !== -1) {
+ form.value.calibrationMajorName = calibrationMajorMap.value[index].name
+ }
+ console.log(form.value.calibrationMajorName)
}
// 证书类别变化
const changeCertifications = (val: string) => {
- form.value.certificateReportName = form.value.certificateReportCode + form.value.calibrationMajor + val
+ const index = certificationTypeMap.value.findIndex((item: { value: string }) => item.value === val)
+ if (index !== -1) {
+ form.value.certificateReportCategoryName = certificationTypeMap.value[index].name
+ }
+ console.log(form.value.certificateReportCategoryName)
+}
+// 选择检定员变化
+const changeMeasurePersonId = (val: string) => {
+ const index = userList.value.findIndex(item => item.id === val)
+ if (index !== -1) {
+ form.value.measurePerson = userList.value[index].name
+ }
}
// -------------------------------------------------------------------------------------
onMounted(async () => {
@@ -593,8 +661,9 @@
// form.value.createUser = user.id // 创建人id
// form.value.createUserName = user.name // 创建人
// form.value.applicantTime = proxy.dayjs().format('YYYY-MM-DD HH:mm:ss') // 申请时间
- form.value.jdy = user.name // 创建人
- form.value.jjrq = proxy.dayjs().format('YYYY-MM-DD') // 检校日期
+ form.value.measurePerson = user.name // 检定员名字
+ form.value.measurePersonId = user.id // 检定员id
+ form.value.calibrationTime = proxy.dayjs().format('YYYY-MM-DD') // 检校日期
}
})
@@ -606,7 +675,7 @@
上传证书
-
+
下载证书模板
@@ -641,25 +710,25 @@
label-width="140"
:rules="formRules"
>
-
+
-
+
替代已生成证书
-
-
+
+
-
+
选择
@@ -684,15 +753,15 @@
v-for="item in calibrationMajorMap"
:key="item.value"
:label="item.name"
- :value="item.name"
+ :value="item.value"
/>
-
+
@@ -720,7 +789,7 @@
/>
-
+
+
+
+
+
@@ -761,6 +841,18 @@
/>
+
+
+
+
+
-
-
+
+ filterable
+ @change="changeMeasurePersonId"
+ >
+
+
-
+
-
-
+
+
-
-
+
+
-
-
+
+
-
+
-
+
confirmSelectSample(val, 'order')" />
confirmSelectSample(val, 'warehouse')" />
+
+
+
+
diff --git a/src/views/business/lab/measureData/measureDataList.vue b/src/views/business/lab/measureData/measureDataList.vue
index 5c011b8..96ffa13 100644
--- a/src/views/business/lab/measureData/measureDataList.vue
+++ b/src/views/business/lab/measureData/measureDataList.vue
@@ -2,16 +2,19 @@
-
+
-
-
-
@@ -369,6 +385,7 @@
is-showmulti-select
@change="changePage"
@multi-select="handleSelectionChange"
+ @handleClickFollowLink="handleClickFollowLink"
>
@@ -483,3 +500,12 @@
+
+
diff --git a/src/api/business/lab/measureData.ts b/src/api/business/lab/measureData.ts
new file mode 100644
index 0000000..ab3a56e
--- /dev/null
+++ b/src/api/business/lab/measureData.ts
@@ -0,0 +1,78 @@
+/**
+ * 计量数据管理
+*/
+import request from '../../index'
+
+// 计量数据管理列表
+export function getMeasureDataList(data: { offset: number; limit: number }) {
+ return request({
+ url: `/business/certificateReport/approval/listPage?offset=${data.offset}&limit=${data.limit}`,
+ method: 'post',
+ data,
+ })
+}
+
+// 点击下载模板后生成证书
+export function downLoadTemplate(data: any) {
+ return request({
+ url: '/business/certificateReport/exportFile',
+ method: 'post',
+ data,
+ responseType: 'blob',
+ })
+}
+
+// 新增
+export function addMeasureData(data: any) {
+ return request({
+ url: '/business/certificateReport/save',
+ method: 'post',
+ data,
+ })
+}
+
+// 草稿箱更新
+export function draftUpdateMeasureData(data: any) {
+ return request({
+ url: '/business/certificateReport/draftUpdate',
+ method: 'post',
+ data,
+ })
+}
+
+// 未通过-驳回编辑
+export function failUpdateMeasureData(data: any) {
+ return request({
+ url: '/business/certificateReport/failUpdate',
+ method: 'post',
+ data,
+ })
+}
+
+// 提交
+export function submit(data: { formId: string; processId?: string; id: string }) {
+ return request({
+ url: '/business/certificateReport/submit',
+ method: 'post',
+ data,
+ })
+}
+
+// 详情
+export function getMeasureDataDetail(data: { id: string }) {
+ return request({
+ url: '/business/certificateReport/detail',
+ method: 'post',
+ data,
+ })
+}
+
+// 删除
+export function deleteMeasureData(data: any) {
+ return request({
+ url: '/business/certificateReport/batchDelete',
+ method: 'post',
+ data,
+ })
+}
+
diff --git a/src/api/business/subpackage/apply.ts b/src/api/business/subpackage/apply.ts
index ad17a5a..c778f8e 100644
--- a/src/api/business/subpackage/apply.ts
+++ b/src/api/business/subpackage/apply.ts
@@ -94,3 +94,4 @@
data,
})
}
+
diff --git a/src/api/system/tool.ts b/src/api/system/tool.ts
index 6b2f5f2..8223e4c 100644
--- a/src/api/system/tool.ts
+++ b/src/api/system/tool.ts
@@ -67,19 +67,10 @@
data,
})
}
-// 原始记录模板/证书报告模板列表(分页)
-export interface listParamsType {
- templateNo: string // 编号
- templateName: string // 名称
- templateCreator: string // 负责人
- // createTime: string // 创建时间
- limit: number
- offset: number
- templateType: string
-}
-export function templatePage(data: listParamsType) {
+
+export function templatePage(data: any) {
return request({
- url: `${prefix}/template/listPage?limit=${data.limit}&offset=${data.offset}`,
+ url: `${prefix}template/listPage?limit=${data.limit}&offset=${data.offset}`,
method: 'post',
data,
})
@@ -87,7 +78,7 @@
// 原始记录模板/证书报告模板列表/详情(
export function templatePageDetail(data: object) {
return request({
- url: `${prefix}/template/detail`,
+ url: `${prefix}template/detail`,
method: 'post',
data,
})
@@ -95,7 +86,7 @@
// 原始记录模板/证书报告模板列表删除
export function templateDelete(data: object) {
return request({
- url: `${prefix}/template/delete`,
+ url: `${prefix}template/delete`,
method: 'post',
data,
})
@@ -103,7 +94,7 @@
// 原始记录模板/证书报告模板列表新建
export function templateAdd(data: object) {
return request({
- url: `${prefix}/template/add`,
+ url: `${prefix}template/add`,
method: 'post',
data,
})
@@ -111,7 +102,7 @@
// 原始记录模板/证书报告模板列表更新
export function templateUpdate(data: object) {
return request({
- url: `${prefix}/template/update`,
+ url: `${prefix}template/update`,
method: 'post',
data,
})
@@ -119,7 +110,7 @@
// 原始记录模板/证书报告模板列表导出
export function templateExport(data: object) {
return request({
- url: `${prefix}/template/listExport`,
+ url: `${prefix}template/listExport`,
method: 'post',
data,
responseType: 'blob',
diff --git a/src/components.d.ts b/src/components.d.ts
index edc2e04..64cf608 100644
--- a/src/components.d.ts
+++ b/src/components.d.ts
@@ -46,6 +46,7 @@
ImageUpload: typeof import('./components/ImageUpload/index.vue')['default']
LineChart: typeof import('./components/Echart/LineChart.vue')['default']
MeasureRecords: typeof import('./components/Sample/measureRecords.vue')['default']
+ MultiHeaderTable: typeof import('./components/MultiHeaderTable/index.vue')['default']
NodeWrap: typeof import('./components/workFlow/nodeWrap.vue')['default']
NodeWrapBan: typeof import('./components/workFlow/nodeWrapBan.vue')['default']
NormalTable: typeof import('./components/NormalTable/index.vue')['default']
@@ -67,6 +68,7 @@
SelectStaffDialog: typeof import('./components/dialog/selectStaffDialog.vue')['default']
SvgIcon: typeof import('./components/SvgIcon/index.vue')['default']
SystemInfo: typeof import('./components/SystemInfo/index.vue')['default']
+ TableColumn: typeof import('./components/MultiHeaderTable/tableColumn.vue')['default']
TableContainer: typeof import('./components/TableContainer/index.vue')['default']
Trend: typeof import('./components/Trend/index.vue')['default']
WordOreview: typeof import('./components/filePreview/wordOreview.vue')['default']
diff --git a/src/components/MultiHeaderTable/index.vue b/src/components/MultiHeaderTable/index.vue
new file mode 100644
index 0000000..85b8c88
--- /dev/null
+++ b/src/components/MultiHeaderTable/index.vue
@@ -0,0 +1,343 @@
+
+
+
+
+
+
+
diff --git a/src/components/MultiHeaderTable/tableColumn.vue b/src/components/MultiHeaderTable/tableColumn.vue
new file mode 100644
index 0000000..2b87285
--- /dev/null
+++ b/src/components/MultiHeaderTable/tableColumn.vue
@@ -0,0 +1,147 @@
+
+
+
+
+
+
+
+
+
+
+ *{{ item.text }}
+
+
+ *{{ item.text }}
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ scope.row[item.value] }}
+
+
+ {{
+ scope.row[item.value]
+ }}
+
+
+
+
+
+
diff --git a/src/components/NormalTable/index.vue b/src/components/NormalTable/index.vue
index e56f775..67092d3 100644
--- a/src/components/NormalTable/index.vue
+++ b/src/components/NormalTable/index.vue
@@ -3,6 +3,7 @@
import { ElTable } from 'element-plus'
import { defineExpose, ref } from 'vue'
import type { TableColumn } from './table_interface'
+import showPhoto from '@/views/system/tool/showPhoto.vue'
// ------------------定义props、 emit-------------------
const props = defineProps({
@@ -212,8 +213,8 @@
{{ scope.row[column.value] }}
{{ column.filter(scope.row) }}
- {{ scope.row }}
-
+
+
diff --git a/src/utils/useCheckList.ts b/src/utils/useCheckList.ts
new file mode 100644
index 0000000..c7782f0
--- /dev/null
+++ b/src/utils/useCheckList.ts
@@ -0,0 +1,73 @@
+import { ElMessage } from 'element-plus'
+// import type { TableColumn } from '@/components/NormalTable/table_interface'
+
+/**
+ * 检查列表
+ * @param list 要检查的表格数据(被依赖项如果满足某个条件就去检查依赖项,否则不检查依赖项)
+ * @param columns // 表头信息
+ * @param tableTitle // 表格名称
+ * @param depend // 依赖项
+ * @param depended // 被依赖项
+ * @param dependedValue // 被依赖项条件
+ * @param requireLength // 要检查的表格数据长度是否大于0
+ */
+export default function useCheckList(list: any, columns: any, tableTitle = '', depend?: string, depended?: string, dependedValue?: number | string, requireLength = false): boolean {
+ for (const prop of columns) {
+ for (let index = 0; index < list.length; index++) {
+ const item = list[index]
+
+ if (depend && depended && item[depended] === dependedValue && !(`${item[prop.value]}`)) { // 被依赖项满足条件时需要检查
+ ElMessage.warning(`请先完善 ${tableTitle} 第${index + 1}行中 ${prop.text} 字段`)
+ return false
+ }
+ else {
+ // 检查必填
+ if (prop.required && (!(`${item[prop.value]}`) || `${item[prop.value]}` === 'null' || `${item[prop.value]}` === 'undefined' || item[prop.value] == undefined)) {
+ if (`${prop.belongStandardEquipment}` === '15') { // 小功率
+ ElMessage.warning(`${tableTitle} 第${index + 1}行中 ${prop.message} ${prop.text} 字段不能为空`)
+ }
+ else {
+ ElMessage.warning(`请先完善 ${tableTitle} 第${index + 1}行中 ${prop.text} 字段`)
+ }
+ return false
+ }
+ }
+
+ // 验证正则
+ if (prop.reg && typeof prop.reg === 'function') {
+ if (prop.value === 'resolution') { // 分辨力特殊处理
+ if (!prop.reg(item[prop.value])) {
+ ElMessage.warning(`${tableTitle} 第${index + 1}行中 ${prop.text} 不能大于1`)
+ return false
+ }
+ }
+ else {
+ if (!prop.reg(item[prop.value])) {
+ if (`${prop.belongStandardEquipment}` === '15') { // 小功率
+ ElMessage.warning(`${tableTitle} 第${index + 1}行中 ${prop.message} ${prop.text} 字段不能为0`)
+ }
+ else if (`${prop.belongStandardEquipment}` === '17') { // S参数
+ ElMessage.warning(`${tableTitle} 第${index + 1}行中 ${prop.text} 仅允许输入数字、字母、特殊字符`)
+ }
+ else {
+ ElMessage.warning(`${tableTitle} 第${index + 1}行中 ${prop.text} 字段输入不合法`)
+ }
+ return false
+ }
+ }
+ }
+
+ if (prop.children && prop.children.length) {
+ if (!useCheckList(list, prop.children, tableTitle, depend, depended, dependedValue)) {
+ return false
+ }
+ }
+ }
+ }
+
+ if (requireLength && !list.length) {
+ ElMessage.warning(`${tableTitle}表格数据不能为空`)
+ return false
+ }
+ return true
+}
diff --git a/src/views/business/lab/components/selectOrderSamplesDialog.vue b/src/views/business/lab/components/selectOrderSamplesDialog.vue
index 4002f83..b004107 100644
--- a/src/views/business/lab/components/selectOrderSamplesDialog.vue
+++ b/src/views/business/lab/components/selectOrderSamplesDialog.vue
@@ -14,6 +14,7 @@
const loadingTable = ref(false) // loading
const list = ref([]) // 表格参数
const tableRef = ref()
+const isMulti = ref(true) // 是否多选默认为多选
const columns = ref
([
{ text: '被测样品名称', value: 'sampleName', align: 'center', required: true },
{ text: '型号规格', value: 'sampleModel', align: 'center', required: true },
@@ -60,9 +61,10 @@
}
// 初始化
-const initDialog = (orderIdParam: string) => {
+const initDialog = (orderIdParam: string, isMultiParam = true) => {
dialogFormVisible.value = true
orderId.value = orderIdParam
+ isMulti.value = isMultiParam
getList()
}
defineExpose({ initDialog })
@@ -78,7 +80,7 @@
:columns="columns"
is-showmulti-select
:list-loading="loadingTable"
- :is-multi="true"
+ :is-multi="isMulti"
:height="300"
:pagination="false"
@multi-select="handleSelectionChange"
diff --git a/src/views/business/lab/components/selectReportTemplate.vue b/src/views/business/lab/components/selectReportTemplate.vue
index 5c59693..ec36ef7 100644
--- a/src/views/business/lab/components/selectReportTemplate.vue
+++ b/src/views/business/lab/components/selectReportTemplate.vue
@@ -7,8 +7,9 @@
import type { typeofSign } from '@/views/system/tool/tool_interface'
import { templatePage } from '@/api/system/tool'
-const emits = defineEmits(['add'])
+const emits = defineEmits(['confirm'])
const dialogFormVisible = ref(false) // 控制弹窗显隐
+const createTime = ref()
// 查询参数
const searchQuery = reactive({
templateNo: '', // 编号
@@ -18,31 +19,43 @@
createEndTime: '',
limit: 5,
offset: 1,
- templateType: '',
+ certificationType: '0',
ids: [] as string[],
}) // 查询参数
const loadingTable = ref(false) // loading
const list = ref([]) // 表格参数
const total = ref(0)
const columns = ref([
- { text: '编号', value: 'templateNo', align: 'center', width: '180' },
- { text: '模板名称', value: 'templateName', align: 'center', width: '150' },
- { text: '模板负责人', value: 'templateCreator', align: 'center', width: '100' },
- { text: '创建时间', value: 'createTime', align: 'center', width: '250' },
- { text: '描述', value: 'templateDesc', align: 'center' },
+ { text: '编号', value: 'templateNo', align: 'center', width: '160' },
+ { text: '模板名称', value: 'templateName', align: 'center' },
+ { text: '模板类型', value: 'templateTypeName', align: 'center', width: '100' },
+ { text: '负责人', value: 'templateCreator', align: 'center', width: '100' },
+ { text: '内容描述', value: 'templateDesc', align: 'center' },
+ { text: '创建时间', value: 'createTime', align: 'center', width: '180' },
])
const checkoutList = ref([]) // 多选选中参数
-// 获取类型
-const getType = async () => {
- const res = await getDictByCode('templateType')
- searchQuery.templateType = res.data.filter((item: typeofSign) => item.name === '证书报告模板')[0].value
+// ---------------------------------------字典--------------------------------------------
+const templateTypeMap = ref([]) as any // 模板类型
+// 获取字典值
+async function getDict() {
+ // 模板类型
+ const res = await getDictByCode('certificationType')
+ res.data.forEach((item: { value: string; name: string }) => {
+ templateTypeMap.value[`${item.value}`] = item.name
+ })
}
+// ----------------------------------------------------------------------------------------------
// 获取数据列表
const getList = () => {
loadingTable.value = true
templatePage(searchQuery).then((res) => {
if (res.code === 200) {
- list.value = res.data.rows
+ list.value = res.data.rows.map((item: { certificationType: string }) => {
+ return {
+ ...item,
+ templateTypeName: `${item.certificationType}` ? templateTypeMap.value[item.certificationType] : item.certificationType, // 模板类型
+ }
+ })
total.value = res.data.total
}
loadingTable.value = false
@@ -74,7 +87,8 @@
searchQuery.createEndTime = ''
searchQuery.limit = 5
searchQuery.offset = 1
- // searchQuery.templateType = '' // 类型不能变
+ searchQuery.certificationType = '0'
+ createTime.value = ''
searchQuery.ids = []
getList()
}
@@ -82,10 +96,10 @@
// 点击保存
const submitForm = () => {
if (!checkoutList.value.length) {
- ElMessage.warning('请选择证书报告模板')
+ ElMessage.warning('请选择证书模板')
}
else {
- emits('add', checkoutList.value[0])
+ emits('confirm', checkoutList.value[0])
dialogFormVisible.value = false
}
}
@@ -103,15 +117,25 @@
// 初始化
const initDialog = () => {
dialogFormVisible.value = true
- getType().then((_) => {
+ getDict().then((_) => {
getList()
})
}
+watch(() => createTime.value, (newVal) => {
+ if (newVal) {
+ searchQuery.createStartTime = newVal[0]
+ searchQuery.createEndTime = newVal[1]
+ }
+ else {
+ searchQuery.createStartTime = ''
+ searchQuery.createEndTime = ''
+ }
+})
defineExpose({ initDialog })
-
+
@@ -121,7 +145,18 @@
-
+
+
+
+
diff --git a/src/views/business/lab/measureData/dialog/selectMeasueDataDialog.vue b/src/views/business/lab/measureData/dialog/selectMeasueDataDialog.vue
new file mode 100644
index 0000000..f8be703
--- /dev/null
+++ b/src/views/business/lab/measureData/dialog/selectMeasueDataDialog.vue
@@ -0,0 +1,199 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ (listQuery.offset - 1) * listQuery.limit + scope.$index + 1 }}
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/views/business/lab/measureData/dialog/selectTechFilesDialog.vue b/src/views/business/lab/measureData/dialog/selectTechFilesDialog.vue
new file mode 100644
index 0000000..f6f1a5a
--- /dev/null
+++ b/src/views/business/lab/measureData/dialog/selectTechFilesDialog.vue
@@ -0,0 +1,247 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ (listQuery.offset - 1) * listQuery.limit + scope.$index + 1 }}
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/views/business/lab/measureData/measureData-interface.ts b/src/views/business/lab/measureData/measureData-interface.ts
index 8319f65..d25a212 100644
--- a/src/views/business/lab/measureData/measureData-interface.ts
+++ b/src/views/business/lab/measureData/measureData-interface.ts
@@ -1,13 +1,14 @@
// 查询条件
export interface IListQuery {
- approvalStatus: string // 审批状态
- certificateReportCode: string // 证书编号
- certificateReportName: string // 证书名称
- customerName: string // 委托方名称
- sampleName: string // 样品名称
- measureCategory: string // 检校类别
- approvalStatusName: string // 审批状态名称
- formId: string
+ approvalStatus: string // 审批状态类型code
+ certificateReportCode: string // 证书编号
+ certificateReportName: string // 证书名称
+ customerName: string // 委托方名称
+ formId: string // 表单id(流程定义对应的表单id,等价于业务id)
+ measureCategory: string // 检校类别
+ orderCode: string // 委托书编号
+ sampleName: string // 样品名称
+ sampleNo: string // 样品编号
offset: number
limit: number
}
@@ -28,47 +29,53 @@
calibrationTime: string // 检校日期
taskId?: string // 任务id 用于审批
decisionItem?: string
- applyApprovalStatusName?: string // 审批状态名称
+ approvalStatusName?: string // 审批状态名称
processId?: string // 流程实例id
}
// 表单
export interface IForm {
- tdysczs: number // 替代已生成证书
+ id?: string
+ invalid: number // 替代已生成证书
formId: string
- yzs: string // 原证书
+ oldCertificateCode: string // 原证书
calibrationMajor: string // 检校专业
- certifications: string // 证书类别
+ calibrationMajorName: string // 检校专业名称
+ certificateReportCategory: string // 证书类别
+ certificateReportCategoryName: string // 证书类别名称
certificateReportCode: string // 证书编号
certificateReportName: string // 证书名称
- jdy: string // 检定员
- jjrq: string // 检校日期
+ measurePerson: string // 检定员
+ measurePersonId: string // 检定员id
+ calibrationTime: string // 检校日期
orderCode: string // 委托书
orderId: string // 委托书id
customerId?: string // 委托放id
customerName: string // 委托方名称
+ customerAddress: string // 委托方地址
certificationCompany: string // 证书单位名称
certificationCompanyAddress: string // 证书单位地址
calibrationPlace: string // 检校地点
- fjsj: string // 复校时间
- jssj: string // 接收时间
- jdjg: string // 检定结果
- environmentCode: string// 环境记录单编号
+ repeatTime: string // 复校时间
+ deliverTime: string // 接收时间
+ measureResult: string // 检定结果
+ environmentCode: string // 环境记录单编号
environmentId: string // 环境记录单id
temperature: string // 温度
humidity: string // 湿度
+ techFilesName: string // 依据的技术文件名称
signId: string // 电子签章id
signName: string // 电子签章名称
approvalSignIds: string // 认可标志专用章id
approvalSignName: string // 认可标志专用章名称
remark: string // 备注
- ywy: string // 业务员
+ busPersonId: string // 业务员id
+ busPersonName: string // 业务员名字
templateId: string // 证书模板
templateName: string // 证书模板
- templateNameFile: string // 证书模板文件
certificateReportFile: string // 证书报告附件
processId?: string // 流程实例id
@@ -76,6 +83,7 @@
// 被检样品
export interface ISampleList {
+ id: string // 样品id
sampleNo: string // 样品编号
sampleName: string // 样品名称
sampleModel: string // 型号
diff --git a/src/views/business/lab/measureData/measureDataDetail.vue b/src/views/business/lab/measureData/measureDataDetail.vue
index 4aa9717..c554c33 100644
--- a/src/views/business/lab/measureData/measureDataDetail.vue
+++ b/src/views/business/lab/measureData/measureDataDetail.vue
@@ -3,6 +3,7 @@
import { ElLoading, ElMessage, ElMessageBox } from 'element-plus'
import type { FormInstance, FormRules } from 'element-plus'
import { ref } from 'vue'
+import dayjs from 'dayjs'
import EnvironmentalDialog from '../components/environmentalDialog.vue'
import selectSignature from '../components/selectSignature.vue'
import selectReportTemplate from '../components/selectReportTemplate.vue'
@@ -10,10 +11,12 @@
import SelectSamplesDialog from '../components/selectSamplesDialog.vue'
import selectMeasureDevice from '../components/selectMeasureDevice.vue'
import type { IEquipmentList, IForm, ISampleList } from './measureData-interface'
+import selectMeasueDataDialog from './dialog/selectMeasueDataDialog.vue'
+import selectTechFilesDialog from './dialog/selectTechFilesDialog.vue'
import { UploadFile } from '@/api/measure/file'
import ApprovalDialog from '@/components/Approval/ApprovalDialog.vue'
import type { TableColumn } from '@/components/NormalTable/table_interface'
-import { addApply, detail, failUpdateApply, submit, updateApply } from '@/api/business/subpackage/apply'
+import { addMeasureData, downLoadTemplate, draftUpdateMeasureData, failUpdateMeasureData, getMeasureDataDetail, submit } from '@/api/business/lab/measureData'
import { cancelApproval, fetchApproval, submitApproval } from '@/api/approval'
import showPhoto from '@/views/system/tool/showPhoto.vue'
import { getDictByCode } from '@/api/system/dict'
@@ -21,6 +24,9 @@
import selectOrder from '@/views/business/schedule/interchangeReceipt/selectOrder.vue'
import { downloadFile } from '@/utils/download'
import type { dictType } from '@/global'
+import { getUserList } from '@/api/system/user'
+import { exportFile } from '@/utils/exportUtils'
+
const user = useUserStore() // 用户信息
const textMap: { [key: string]: string } = {
edit: '编辑',
@@ -31,6 +37,8 @@
const $router = useRouter() // 关闭页面使用
const $route = useRoute()
const query = $route.query
+console.log('opopopop', query)
+
const approvalDialog = ref() // 审批对话ref
const pageType = ref('add') // 页面类型: add, edit, detail
const infoId = ref('') // 列表id
@@ -38,57 +46,63 @@
const orderVisible = ref(false) // 控制委托单对话框显隐
const ruleFormRef = ref() as any
const form = ref({
- tdysczs: 0, // 替代已生成证书
+ invalid: 0, // 替代已生成证书
formId: query.formId as string,
- yzs: '', // 原证书
+ oldCertificateCode: '', // 原证书
calibrationMajor: '', // 检校专业
- certifications: '', // 证书类别
+ calibrationMajorName: '', // 检校专业名称
+ certificateReportCategory: '', // 证书类别
+ certificateReportCategoryName: '', // 证书类别名称
certificateReportCode: '', // 证书编号
certificateReportName: '', // 证书名称
- jdy: '', // 检定员
- jjrq: '', // 检校日期
+ measurePerson: '', // 检定员
+ measurePersonId: '', // 检定员id
+ calibrationTime: '', // 检校日期
- orderCode: '', // 委托单
+ orderCode: '', // 委托单编号
orderId: '', // 委托单id
customerName: '', // 委托方名称
+ customerAddress: '', // 委托方地址
certificationCompany: '', // 证书单位名称
certificationCompanyAddress: '', // 证书单位地址
calibrationPlace: '', // 检校地点
- fjsj: '', // 复校时间
- jssj: '', // 接收时间
- jdjg: '', // 检定结果
+ repeatTime: '', // 复校时间
+ deliverTime: '', // 接收时间
+ measureResult: '', // 检定结果
environmentCode: '', // 环境记录单编号
environmentId: '', // 环境记录单id
temperature: '', // 温度
humidity: '', // 湿度
+ techFilesName: '', // 依据的技术文件名称
signId: '', // 电子签章id
signName: '', // 电子签章名称
approvalSignIds: '', // 认可标志专用章id
approvalSignName: '', // 认可标志专用章名称
remark: '', // 备注
- ywy: '', // 业务员
+ busPersonId: '', // 业务员id
+ busPersonName: '', // 业务员名字
templateId: '', // 证书模板
templateName: '', // 证书模板
- templateNameFile: '', // 证书模板文件
certificateReportFile: '', // 证书报告附件
})
// 校验规则
const formRules = ref({
- yzs: [{ required: true, message: '原证书必填', trigger: ['blur', 'change'] }],
+ oldCertificateCode: [{ required: true, message: '原证书必填', trigger: ['blur', 'change'] }],
calibrationMajor: [{ required: true, message: '检校专业必填', trigger: ['blur', 'change'] }],
- certifications: [{ required: true, message: '证书类别必填', trigger: ['blur', 'change'] }],
+ certificateReportCategory: [{ required: true, message: '证书类别必填', trigger: ['blur', 'change'] }],
certificateReportName: [{ required: true, message: '证书名称必填', trigger: ['blur', 'change'] }],
customerName: [{ required: true, message: '委托方名称必填', trigger: ['blur', 'change'] }],
+ customerAddress: [{ required: true, message: '委托方地址必填', trigger: ['blur', 'change'] }],
certificationCompany: [{ required: true, message: '证书单位名称必填', trigger: ['blur', 'change'] }],
certificationCompanyAddress: [{ required: true, message: '证书单位地址必填', trigger: ['blur', 'change'] }],
calibrationPlace: [{ required: true, message: '检校地点必填', trigger: ['blur', 'change'] }],
- jdy: [{ required: true, message: '检定员必填', trigger: ['blur', 'change'] }],
- jjrq: [{ required: true, message: '检校日期必填', trigger: ['blur', 'change'] }],
- fjsj: [{ required: true, message: '复校时间必填', trigger: ['blur', 'change'] }],
- jssj: [{ required: true, message: '接收时间必填', trigger: ['blur', 'change'] }],
- jdjg: [{ required: true, message: '检定结果必填', trigger: ['blur', 'change'] }],
+ measurePersonId: [{ required: true, message: '检定员必填', trigger: ['blur', 'change'] }],
+ calibrationTime: [{ required: true, message: '检校日期必填', trigger: ['blur', 'change'] }],
+ repeatTime: [{ required: true, message: '复校时间必填', trigger: ['blur', 'change'] }],
+ deliverTime: [{ required: true, message: '接收时间必填', trigger: ['blur', 'change'] }],
+ measureResult: [{ required: true, message: '检定结果必填', trigger: ['blur', 'change'] }],
temperature: [
{ required: true, message: '温度必填', trigger: ['blur', 'change'] },
{ pattern: /(^-?\d\d*\.\d*$)|(^-?\d\d*$)|(^-?\.\d\d*$)/, message: '温度只能为数字', trigger: ['blur', 'change'] },
@@ -111,6 +125,7 @@
// ---------------------------------------字典--------------------------------------------
const certificationTypeMap = ref([]) // 证书类别
const calibrationMajorMap = ref([]) // 校检专业
+const userList = ref([]) // 检定员
// 获取字典值
async function getDict() {
// 校检专业
@@ -119,12 +134,22 @@
// 证书类别
const rescertificationType = await getDictByCode('certificationType')
certificationTypeMap.value = rescertificationType.data
+
+ // 获取人员列表
+ getUserList({ offset: 1, limit: 99999 }).then((res) => {
+ userList.value = res.data.rows
+ })
}
getDict()
// -------------------------------------原证书--------------------------------------------
+const selectMeasueDataDialogRef = ref() // 选择原证书组件ref
// 点击选择原证书
const selectOrigin = () => {
- //
+ selectMeasueDataDialogRef.value.initDialog()
+}
+// 选好原证书
+const selectMeasueDataConfirm = (val: any) => {
+ getDetail(val.id, val.certificateReportCode)
}
// ------------------------------------委托单------------------------------------------
// 点击选择委托单编号
@@ -142,12 +167,17 @@
form.value.orderCode = val[0].orderCode // 委托单
form.value.customerId = val[0].customerId// 委托方id
form.value.customerName = val[0].customerName// 委托方名称
+ form.value.customerAddress = val[0].customerAddress// 委托方地址
form.value.certificationCompany = val[0].certificationCompany// 证书单位名称
form.value.certificationCompanyAddress = val[0].certificationCompanyAddress// 证书单位地址
+ form.value.certificationCompanyAddress = val[0].certificationCompanyAddress// 证书单位地址
+ form.value.busPersonId = val[0].busPersonId// 业务员id
+ form.value.busPersonName = val[0].busPersonName// 业务员名字
}
}
// -------------------------------选择环境记录单----------------------------------------
+const businessEnvironmentRecord = ref({}) as any // 环境记录单信息
// 选择环境记录单Ref
const environmentalDialog = ref()
// 选择环境记录单
@@ -156,6 +186,7 @@
}
// 选择环境记录单表格确认
const environmentalAdd = (data: any) => {
+ businessEnvironmentRecord.value = data
form.value.environmentId = data.id // 环境记录单id
form.value.environmentCode = data.environmentCode // 环境记录单编号
form.value.temperature = data.temperature // 温度
@@ -200,35 +231,16 @@
}
// -----------------------------------------所依据的技术文件----------------------------------
+const selectTechFilesRef = ref()
+const fileList = ref([]) // 依据的技术文件
// 点击所依据的技术文件
const selectTechFiles = () => {
- //
+ selectTechFilesRef.value.initDialog()
}
-// --------------------------------------证书模板------------------------------------------
-// 选择证书模板Ref
-const templateDialog = ref()
-// 选择证书模板
-const handleClickTemplate = () => {
- templateDialog.value.initDialog()
-}
-// 选择证书模板确认
-const confirmCheckoutTemplate = (val: any) => {
- form.value.templateId = val.id // 证书报告模板id
- form.value.templateName = val.templateName || '' // 证书报告模板名称
- form.value.templateNameFile = val.minioFileName // 证书模板附件
-}
-
-// 点击下载证书模板按钮
-const downloadCertTemplate = () => {
- if (!form.value.templateId) {
- ElMessage.warning('请先选择证书模板')
- return false
- }
- if (!form.value.templateNameFile) {
- ElMessage.warning('选择的证书模板无附件,请检查')
- return false
- }
- downloadFile(form.value.templateNameFile as any, `${form.value.templateName}-${form.value.templateNameFile}`)
+// 选好依据的技术文件
+const selectTechFilesConfirm = (val: any) => {
+ fileList.value = val
+ form.value.techFilesName = val.map((item: { fileName: string }) => item.fileName).join(',')
}
// ---------------------------------文件上传(上传证书)-------------------------------------------
@@ -283,10 +295,10 @@
// 点击批量添加/选择
const addSample = () => {
- if (form.value.orderId) {
- selectOrderSamplesDialogRef.value.initDialog(form.value.orderId)
+ if (form.value.orderId) { // 选择委托单下的样品
+ selectOrderSamplesDialogRef.value.initDialog(form.value.orderId, false)
}
- else {
+ else { // 选择样品库中的样品
selectSamplesDialogRef.value.initDialog()
}
}
@@ -318,7 +330,7 @@
}
// ----------------------------------------------所用的计量标准器具--------------------------------------------
const equipmentVisible = ref(false) // 选择设备对话框显隐
-const equipmentList = ref([])// 表格数据
+const equipmentInfoList = ref([])// 表格数据
const checkoutEquipmentList = ref([])// 多选设备
// 表头
const equipmentColumns = ref([
@@ -328,8 +340,8 @@
{ text: '出厂编号', value: 'manufacturingNo', align: 'center' },
{ text: '测量范围', value: 'mesureRange', align: 'center' },
{ text: '不确定度', value: 'uncertainty', align: 'center' },
- { text: '溯源机构', value: 'syjg', align: 'center' },
- { text: '证书编号', value: 'zsbh', align: 'center' },
+ { text: '溯源机构', value: 'mesureDeptName', align: 'center' },
+ // { text: '证书编号', value: 'zsbh', align: 'center' },
{ text: '有效日期', value: 'validDate', align: 'center' },
])
@@ -351,9 +363,9 @@
const confirmSelectEquipment = (val: any) => {
val.forEach((item: IEquipmentList) => {
// 只添加列表里不存在的
- const index = equipmentList.value.findIndex((i: IEquipmentList) => item.equipmentNo === i.equipmentNo)
+ const index = equipmentInfoList.value.findIndex((i: IEquipmentList) => item.equipmentNo === i.equipmentNo)
if (index === -1) {
- equipmentList.value.push(item)
+ equipmentInfoList.value.push(item)
}
})
}
@@ -365,28 +377,109 @@
return false
}
checkoutEquipmentList.value.forEach((item: IEquipmentList) => {
- equipmentList.value.forEach((element, index) => {
+ equipmentInfoList.value.forEach((element, index) => {
if (element.equipmentNo === item.equipmentNo) {
- equipmentList.value.splice(index, 1)
+ equipmentInfoList.value.splice(index, 1)
}
})
})
}
+
+// --------------------------------------证书模板------------------------------------------
+// 选择证书模板Ref
+const templateDialogRef = ref()
+// 选择证书模板
+const handleClickTemplate = () => {
+ templateDialogRef.value.initDialog()
+}
+// 选择证书模板确认
+const confirmCheckoutTemplate = (val: any) => {
+ form.value.templateId = val.id // 证书报告模板id
+ form.value.templateName = val.templateName || '' // 证书报告模板名称
+}
+
+// 点击下载证书模板按钮
+const downloadCertTemplate = () => {
+ if (!form.value.templateId) {
+ ElMessage.warning('请先选择证书模板')
+ return false
+ }
+ if (!sampleList.value.length) {
+ ElMessage.warning('被检样品不能为空')
+ return false
+ }
+ if (!equipmentInfoList.value.length) {
+ ElMessage.warning('所用的计量标准器具不能为空')
+ return false
+ }
+
+ ruleFormRef.value.validate((valid: boolean) => {
+ if (valid) {
+ const params = solveParams()
+ const loading = ElLoading.service({
+ lock: true,
+ background: 'rgba(255, 255, 255, 0.8)',
+ })
+ downLoadTemplate(params).then((res) => {
+ exportFile(res.data, `${form.value.certificateReportName}.xls`)
+ loading.close()
+ }).catch(() => {
+ loading.close()
+ })
+ }
+ })
+}
+
// -------------------------------------------------------------------------------------------
+// 处理保存、下载模板参数
+function solveParams() {
+ const params = {
+ ...form.value,
+ businessEnvironmentRecord: businessEnvironmentRecord.value, // 环境记录单
+ fileList: fileList.value, // 依据的技术文件
+ equipmentInfoList: equipmentInfoList.value, // 所用的计量标准器具列表/监测设备
+ sampleId: sampleList.value[0].id, // 样品id(打印证书接口要必传)
+ sampleNo: sampleList.value[0].sampleNo, // 样品编号
+ sampleName: sampleList.value[0].sampleName, // 样品名称
+ sampleModel: sampleList.value[0].sampleModel, // 样品型号
+ manufacturingNo: sampleList.value[0].manufacturingNo, // 出厂编号
+ manufacturer: sampleList.value[0].manufacturer, // 生产厂家
+ sampleRemark: sampleList.value[0].remark, // 样品备注
+ id: pageType.value === 'add' ? '' : form.value.id,
+ }
+ return params
+}
// 获取详情信息
-const getDetail = () => {
+function getDetail(id?: string, certificateReportCode?: string) {
const loading = ElLoading.service({
lock: true,
background: 'rgba(255, 255, 255, 0.8)',
})
- detail({ id: $route.params.id as string }).then((res) => {
+ getMeasureDataDetail({ id: infoId.value! || id! }).then((res) => {
loading.close()
form.value = res.data
- form.value.createUserName = res.data.applicantName || user.name
- list.value = res.data.sampleList.filter((item: ISampleList) => {
- return item !== null
- })
+ sampleList.value = [{
+ sampleNo: res.data.sampleNo, // 样品编号
+ sampleName: res.data.sampleNo, // 样品名称
+ sampleModel: res.data.sampleNo, // 型号
+ manufacturingNo: res.data.sampleNo, // 出厂编号
+ manufacturer: res.data.sampleNo, // 生产厂家
+ remark: res.data.sampleRemark, // 备注
+ id: res.data.sampleId,
+ }]
+ equipmentInfoList.value = res.data.equipmentInfoList.map((item: { validDate: string }) => {
+ return {
+ ...item,
+ validDate: item.validDate ? dayjs(item.validDate).format('YYYY-MM-DD') : item.validDate,
+ }
+ }) // 所用的计量标准器具
+ businessEnvironmentRecord.value = res.data.businessEnvironmentRecord // 环境记录单数据
+ form.value.environmentCode = res.data.businessEnvironmentRecord.environmentCode// 环境记录单编号
+ if (id && certificateReportCode) {
+ form.value.oldCertificateCode = certificateReportCode
+ form.value.invalid = 1
+ }
}).catch(() => {
loading.close()
})
@@ -399,10 +492,13 @@
// 保存
const handleSave = () => {
- const tempList = list.value.filter(item => item.sampleNo)
- if (!tempList.length) {
- ElMessage.warning('样品信息不能为空')
- return
+ if (!sampleList.value.length) {
+ ElMessage.warning('被检样品不能为空')
+ return false
+ }
+ if (!equipmentInfoList.value.length) {
+ ElMessage.warning('所用的计量标准器具不能为空')
+ return false
}
ruleFormRef.value.validate((valid: boolean) => {
if (valid) {
@@ -410,32 +506,22 @@
lock: true,
background: 'rgba(255, 255, 255, 0.8)',
})
- // 样品&委托单列表(保存/编辑草稿接口入参使用)
- const temList = [] as any // 临时数组
- console.log('保存中的数组', list.value)
-
- list.value.forEach((item: any) => {
- if ((item.orderId && item.id) || (item.orderId && item.sampleId)) {
- temList.push({
- orderId: item.orderId,
- sampleId: item.id || item.sampleId,
- })
- }
- })
- form.value.orderSampleList = temList
+ const params = solveParams()
if (pageType.value === 'add') { // 新建
- addApply(form.value).then((res) => {
- submitId.value = res.data.id
- form.value.projectNo = res.data.projectNo // 分包项目编号
+ addMeasureData(params).then((res) => {
+ submitId.value = res.data.data.id
+ form.value.certificateReportCode = res.data.data.certificateReportCode
+ form.value.certificateReportName = res.data.data.certificateReportName
ElMessage.success('保存成功')
loading.close()
}).catch(() => {
loading.close()
})
}
+
else if (pageType.value === 'edit') { // 编辑
if (query.approvalStatusName === '未通过-驳回') { // 未通过-驳回
- failUpdateApply(form.value).then((res) => {
+ failUpdateMeasureData(params).then((res) => {
ElMessage.success('保存成功')
loading.close()
close()
@@ -444,7 +530,7 @@
})
}
else { // 草稿箱和已取消
- updateApply(form.value).then((res) => {
+ draftUpdateMeasureData(params).then((res) => {
ElMessage.success('保存成功')
loading.close()
close()
@@ -466,7 +552,7 @@
})
const params = {
id: submitId.value,
- formId: query.formId, // 表单id
+ formId: query.formId as string, // 表单id
}
submit(params).then(() => {
ElMessage.success('提交成功')
@@ -481,39 +567,6 @@
}
}
-const sampleVisible = ref(false)
-const projectVisible = ref(false)
-const isMulti = ref(false)
-const selectIndex = ref(0)
-// 点击选择
-const handleSelect = (index: number, row: ISampleList) => {
- sampleVisible.value = true // 选择设备对话框显隐
- isMulti.value = false // 是否单选, false单选、true表格多选
- selectIndex.value = index
-}
-
-const checkoutList = ref([]) // 选中的行
-
-// 修改委托方对话框显隐
-const changeSampleVisible = (val: boolean) => {
- sampleVisible.value = val
-}
-// 修改项目选择对话框显隐
-const changeProjectVisible = (val: boolean) => {
- projectVisible.value = val
-}
-
-// 删除行
-const delRow = () => {
- checkoutList.value.forEach((item: ISampleList) => {
- list.value.forEach((element, index) => {
- if (element.sampleNo === item.sampleNo) {
- list.value.splice(index, 1)
- }
- })
- })
-}
-
// ------------------------------------------审批-----------------------------------------
const approvalRecordData = ref([]) // 审批流程数据
@@ -573,11 +626,26 @@
// ------------------------------------事件-------------------------------------------------
// 检校专业变化
const changeCalibrationMajor = (val: string) => {
- form.value.certificateReportName = form.value.certificateReportCode + val + form.value.certifications
+ const index = calibrationMajorMap.value.findIndex((item: { value: string }) => item.value === val)
+ if (index !== -1) {
+ form.value.calibrationMajorName = calibrationMajorMap.value[index].name
+ }
+ console.log(form.value.calibrationMajorName)
}
// 证书类别变化
const changeCertifications = (val: string) => {
- form.value.certificateReportName = form.value.certificateReportCode + form.value.calibrationMajor + val
+ const index = certificationTypeMap.value.findIndex((item: { value: string }) => item.value === val)
+ if (index !== -1) {
+ form.value.certificateReportCategoryName = certificationTypeMap.value[index].name
+ }
+ console.log(form.value.certificateReportCategoryName)
+}
+// 选择检定员变化
+const changeMeasurePersonId = (val: string) => {
+ const index = userList.value.findIndex(item => item.id === val)
+ if (index !== -1) {
+ form.value.measurePerson = userList.value[index].name
+ }
}
// -------------------------------------------------------------------------------------
onMounted(async () => {
@@ -593,8 +661,9 @@
// form.value.createUser = user.id // 创建人id
// form.value.createUserName = user.name // 创建人
// form.value.applicantTime = proxy.dayjs().format('YYYY-MM-DD HH:mm:ss') // 申请时间
- form.value.jdy = user.name // 创建人
- form.value.jjrq = proxy.dayjs().format('YYYY-MM-DD') // 检校日期
+ form.value.measurePerson = user.name // 检定员名字
+ form.value.measurePersonId = user.id // 检定员id
+ form.value.calibrationTime = proxy.dayjs().format('YYYY-MM-DD') // 检校日期
}
})
@@ -606,7 +675,7 @@
上传证书
-
+
下载证书模板
@@ -641,25 +710,25 @@
label-width="140"
:rules="formRules"
>
-
+
-
+
替代已生成证书
-
-
+
+
-
+
选择
@@ -684,15 +753,15 @@
v-for="item in calibrationMajorMap"
:key="item.value"
:label="item.name"
- :value="item.name"
+ :value="item.value"
/>
-
+
@@ -720,7 +789,7 @@
/>
-
+
+
+
+
+
@@ -761,6 +841,18 @@
/>
+
+
+
+
+
-
-
+
+ filterable
+ @change="changeMeasurePersonId"
+ >
+
+
-
+
-
-
+
+
-
-
+
+
-
-
+
+
-
+
-
+
confirmSelectSample(val, 'order')" />
confirmSelectSample(val, 'warehouse')" />
+
+
+
+
diff --git a/src/views/business/lab/measureData/measureDataList.vue b/src/views/business/lab/measureData/measureDataList.vue
index 5c011b8..96ffa13 100644
--- a/src/views/business/lab/measureData/measureDataList.vue
+++ b/src/views/business/lab/measureData/measureDataList.vue
@@ -2,16 +2,19 @@
-
+
-
-
-
@@ -369,6 +385,7 @@
is-showmulti-select
@change="changePage"
@multi-select="handleSelectionChange"
+ @handleClickFollowLink="handleClickFollowLink"
>
@@ -483,3 +500,12 @@
+
+
diff --git a/src/views/business/schedule/interchangeReceipt/receiptEdit.vue b/src/views/business/schedule/interchangeReceipt/receiptEdit.vue
index 13ee3ab..877ea57 100644
--- a/src/views/business/schedule/interchangeReceipt/receiptEdit.vue
+++ b/src/views/business/schedule/interchangeReceipt/receiptEdit.vue
@@ -356,7 +356,7 @@
getInterchangeReceiptDetail({ id: infoId.value }).then((res) => {
dataForm.value = res.data // 表单
sampleList.value = res.data.customerSampleList // 样品列表
- dataForm.value.orderId = res.data.customerSampleList[0].orderId // orderId
+ dataForm.value.orderId = res.data.orderId // orderId
minioFileNameAutograph.value = res.data.recieverSignFile // 签名图片
loading.close()
})
diff --git a/src/api/business/lab/measureData.ts b/src/api/business/lab/measureData.ts
new file mode 100644
index 0000000..ab3a56e
--- /dev/null
+++ b/src/api/business/lab/measureData.ts
@@ -0,0 +1,78 @@
+/**
+ * 计量数据管理
+*/
+import request from '../../index'
+
+// 计量数据管理列表
+export function getMeasureDataList(data: { offset: number; limit: number }) {
+ return request({
+ url: `/business/certificateReport/approval/listPage?offset=${data.offset}&limit=${data.limit}`,
+ method: 'post',
+ data,
+ })
+}
+
+// 点击下载模板后生成证书
+export function downLoadTemplate(data: any) {
+ return request({
+ url: '/business/certificateReport/exportFile',
+ method: 'post',
+ data,
+ responseType: 'blob',
+ })
+}
+
+// 新增
+export function addMeasureData(data: any) {
+ return request({
+ url: '/business/certificateReport/save',
+ method: 'post',
+ data,
+ })
+}
+
+// 草稿箱更新
+export function draftUpdateMeasureData(data: any) {
+ return request({
+ url: '/business/certificateReport/draftUpdate',
+ method: 'post',
+ data,
+ })
+}
+
+// 未通过-驳回编辑
+export function failUpdateMeasureData(data: any) {
+ return request({
+ url: '/business/certificateReport/failUpdate',
+ method: 'post',
+ data,
+ })
+}
+
+// 提交
+export function submit(data: { formId: string; processId?: string; id: string }) {
+ return request({
+ url: '/business/certificateReport/submit',
+ method: 'post',
+ data,
+ })
+}
+
+// 详情
+export function getMeasureDataDetail(data: { id: string }) {
+ return request({
+ url: '/business/certificateReport/detail',
+ method: 'post',
+ data,
+ })
+}
+
+// 删除
+export function deleteMeasureData(data: any) {
+ return request({
+ url: '/business/certificateReport/batchDelete',
+ method: 'post',
+ data,
+ })
+}
+
diff --git a/src/api/business/subpackage/apply.ts b/src/api/business/subpackage/apply.ts
index ad17a5a..c778f8e 100644
--- a/src/api/business/subpackage/apply.ts
+++ b/src/api/business/subpackage/apply.ts
@@ -94,3 +94,4 @@
data,
})
}
+
diff --git a/src/api/system/tool.ts b/src/api/system/tool.ts
index 6b2f5f2..8223e4c 100644
--- a/src/api/system/tool.ts
+++ b/src/api/system/tool.ts
@@ -67,19 +67,10 @@
data,
})
}
-// 原始记录模板/证书报告模板列表(分页)
-export interface listParamsType {
- templateNo: string // 编号
- templateName: string // 名称
- templateCreator: string // 负责人
- // createTime: string // 创建时间
- limit: number
- offset: number
- templateType: string
-}
-export function templatePage(data: listParamsType) {
+
+export function templatePage(data: any) {
return request({
- url: `${prefix}/template/listPage?limit=${data.limit}&offset=${data.offset}`,
+ url: `${prefix}template/listPage?limit=${data.limit}&offset=${data.offset}`,
method: 'post',
data,
})
@@ -87,7 +78,7 @@
// 原始记录模板/证书报告模板列表/详情(
export function templatePageDetail(data: object) {
return request({
- url: `${prefix}/template/detail`,
+ url: `${prefix}template/detail`,
method: 'post',
data,
})
@@ -95,7 +86,7 @@
// 原始记录模板/证书报告模板列表删除
export function templateDelete(data: object) {
return request({
- url: `${prefix}/template/delete`,
+ url: `${prefix}template/delete`,
method: 'post',
data,
})
@@ -103,7 +94,7 @@
// 原始记录模板/证书报告模板列表新建
export function templateAdd(data: object) {
return request({
- url: `${prefix}/template/add`,
+ url: `${prefix}template/add`,
method: 'post',
data,
})
@@ -111,7 +102,7 @@
// 原始记录模板/证书报告模板列表更新
export function templateUpdate(data: object) {
return request({
- url: `${prefix}/template/update`,
+ url: `${prefix}template/update`,
method: 'post',
data,
})
@@ -119,7 +110,7 @@
// 原始记录模板/证书报告模板列表导出
export function templateExport(data: object) {
return request({
- url: `${prefix}/template/listExport`,
+ url: `${prefix}template/listExport`,
method: 'post',
data,
responseType: 'blob',
diff --git a/src/components.d.ts b/src/components.d.ts
index edc2e04..64cf608 100644
--- a/src/components.d.ts
+++ b/src/components.d.ts
@@ -46,6 +46,7 @@
ImageUpload: typeof import('./components/ImageUpload/index.vue')['default']
LineChart: typeof import('./components/Echart/LineChart.vue')['default']
MeasureRecords: typeof import('./components/Sample/measureRecords.vue')['default']
+ MultiHeaderTable: typeof import('./components/MultiHeaderTable/index.vue')['default']
NodeWrap: typeof import('./components/workFlow/nodeWrap.vue')['default']
NodeWrapBan: typeof import('./components/workFlow/nodeWrapBan.vue')['default']
NormalTable: typeof import('./components/NormalTable/index.vue')['default']
@@ -67,6 +68,7 @@
SelectStaffDialog: typeof import('./components/dialog/selectStaffDialog.vue')['default']
SvgIcon: typeof import('./components/SvgIcon/index.vue')['default']
SystemInfo: typeof import('./components/SystemInfo/index.vue')['default']
+ TableColumn: typeof import('./components/MultiHeaderTable/tableColumn.vue')['default']
TableContainer: typeof import('./components/TableContainer/index.vue')['default']
Trend: typeof import('./components/Trend/index.vue')['default']
WordOreview: typeof import('./components/filePreview/wordOreview.vue')['default']
diff --git a/src/components/MultiHeaderTable/index.vue b/src/components/MultiHeaderTable/index.vue
new file mode 100644
index 0000000..85b8c88
--- /dev/null
+++ b/src/components/MultiHeaderTable/index.vue
@@ -0,0 +1,343 @@
+
+
+
+
+
+
+
diff --git a/src/components/MultiHeaderTable/tableColumn.vue b/src/components/MultiHeaderTable/tableColumn.vue
new file mode 100644
index 0000000..2b87285
--- /dev/null
+++ b/src/components/MultiHeaderTable/tableColumn.vue
@@ -0,0 +1,147 @@
+
+
+
+
+
+
+
+
+
+
+ *{{ item.text }}
+
+
+ *{{ item.text }}
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ scope.row[item.value] }}
+
+
+ {{
+ scope.row[item.value]
+ }}
+
+
+
+
+
+
diff --git a/src/components/NormalTable/index.vue b/src/components/NormalTable/index.vue
index e56f775..67092d3 100644
--- a/src/components/NormalTable/index.vue
+++ b/src/components/NormalTable/index.vue
@@ -3,6 +3,7 @@
import { ElTable } from 'element-plus'
import { defineExpose, ref } from 'vue'
import type { TableColumn } from './table_interface'
+import showPhoto from '@/views/system/tool/showPhoto.vue'
// ------------------定义props、 emit-------------------
const props = defineProps({
@@ -212,8 +213,8 @@
{{ scope.row[column.value] }}
{{ column.filter(scope.row) }}
- {{ scope.row }}
-
+
+
diff --git a/src/utils/useCheckList.ts b/src/utils/useCheckList.ts
new file mode 100644
index 0000000..c7782f0
--- /dev/null
+++ b/src/utils/useCheckList.ts
@@ -0,0 +1,73 @@
+import { ElMessage } from 'element-plus'
+// import type { TableColumn } from '@/components/NormalTable/table_interface'
+
+/**
+ * 检查列表
+ * @param list 要检查的表格数据(被依赖项如果满足某个条件就去检查依赖项,否则不检查依赖项)
+ * @param columns // 表头信息
+ * @param tableTitle // 表格名称
+ * @param depend // 依赖项
+ * @param depended // 被依赖项
+ * @param dependedValue // 被依赖项条件
+ * @param requireLength // 要检查的表格数据长度是否大于0
+ */
+export default function useCheckList(list: any, columns: any, tableTitle = '', depend?: string, depended?: string, dependedValue?: number | string, requireLength = false): boolean {
+ for (const prop of columns) {
+ for (let index = 0; index < list.length; index++) {
+ const item = list[index]
+
+ if (depend && depended && item[depended] === dependedValue && !(`${item[prop.value]}`)) { // 被依赖项满足条件时需要检查
+ ElMessage.warning(`请先完善 ${tableTitle} 第${index + 1}行中 ${prop.text} 字段`)
+ return false
+ }
+ else {
+ // 检查必填
+ if (prop.required && (!(`${item[prop.value]}`) || `${item[prop.value]}` === 'null' || `${item[prop.value]}` === 'undefined' || item[prop.value] == undefined)) {
+ if (`${prop.belongStandardEquipment}` === '15') { // 小功率
+ ElMessage.warning(`${tableTitle} 第${index + 1}行中 ${prop.message} ${prop.text} 字段不能为空`)
+ }
+ else {
+ ElMessage.warning(`请先完善 ${tableTitle} 第${index + 1}行中 ${prop.text} 字段`)
+ }
+ return false
+ }
+ }
+
+ // 验证正则
+ if (prop.reg && typeof prop.reg === 'function') {
+ if (prop.value === 'resolution') { // 分辨力特殊处理
+ if (!prop.reg(item[prop.value])) {
+ ElMessage.warning(`${tableTitle} 第${index + 1}行中 ${prop.text} 不能大于1`)
+ return false
+ }
+ }
+ else {
+ if (!prop.reg(item[prop.value])) {
+ if (`${prop.belongStandardEquipment}` === '15') { // 小功率
+ ElMessage.warning(`${tableTitle} 第${index + 1}行中 ${prop.message} ${prop.text} 字段不能为0`)
+ }
+ else if (`${prop.belongStandardEquipment}` === '17') { // S参数
+ ElMessage.warning(`${tableTitle} 第${index + 1}行中 ${prop.text} 仅允许输入数字、字母、特殊字符`)
+ }
+ else {
+ ElMessage.warning(`${tableTitle} 第${index + 1}行中 ${prop.text} 字段输入不合法`)
+ }
+ return false
+ }
+ }
+ }
+
+ if (prop.children && prop.children.length) {
+ if (!useCheckList(list, prop.children, tableTitle, depend, depended, dependedValue)) {
+ return false
+ }
+ }
+ }
+ }
+
+ if (requireLength && !list.length) {
+ ElMessage.warning(`${tableTitle}表格数据不能为空`)
+ return false
+ }
+ return true
+}
diff --git a/src/views/business/lab/components/selectOrderSamplesDialog.vue b/src/views/business/lab/components/selectOrderSamplesDialog.vue
index 4002f83..b004107 100644
--- a/src/views/business/lab/components/selectOrderSamplesDialog.vue
+++ b/src/views/business/lab/components/selectOrderSamplesDialog.vue
@@ -14,6 +14,7 @@
const loadingTable = ref(false) // loading
const list = ref([]) // 表格参数
const tableRef = ref()
+const isMulti = ref(true) // 是否多选默认为多选
const columns = ref
([
{ text: '被测样品名称', value: 'sampleName', align: 'center', required: true },
{ text: '型号规格', value: 'sampleModel', align: 'center', required: true },
@@ -60,9 +61,10 @@
}
// 初始化
-const initDialog = (orderIdParam: string) => {
+const initDialog = (orderIdParam: string, isMultiParam = true) => {
dialogFormVisible.value = true
orderId.value = orderIdParam
+ isMulti.value = isMultiParam
getList()
}
defineExpose({ initDialog })
@@ -78,7 +80,7 @@
:columns="columns"
is-showmulti-select
:list-loading="loadingTable"
- :is-multi="true"
+ :is-multi="isMulti"
:height="300"
:pagination="false"
@multi-select="handleSelectionChange"
diff --git a/src/views/business/lab/components/selectReportTemplate.vue b/src/views/business/lab/components/selectReportTemplate.vue
index 5c59693..ec36ef7 100644
--- a/src/views/business/lab/components/selectReportTemplate.vue
+++ b/src/views/business/lab/components/selectReportTemplate.vue
@@ -7,8 +7,9 @@
import type { typeofSign } from '@/views/system/tool/tool_interface'
import { templatePage } from '@/api/system/tool'
-const emits = defineEmits(['add'])
+const emits = defineEmits(['confirm'])
const dialogFormVisible = ref(false) // 控制弹窗显隐
+const createTime = ref()
// 查询参数
const searchQuery = reactive({
templateNo: '', // 编号
@@ -18,31 +19,43 @@
createEndTime: '',
limit: 5,
offset: 1,
- templateType: '',
+ certificationType: '0',
ids: [] as string[],
}) // 查询参数
const loadingTable = ref(false) // loading
const list = ref([]) // 表格参数
const total = ref(0)
const columns = ref([
- { text: '编号', value: 'templateNo', align: 'center', width: '180' },
- { text: '模板名称', value: 'templateName', align: 'center', width: '150' },
- { text: '模板负责人', value: 'templateCreator', align: 'center', width: '100' },
- { text: '创建时间', value: 'createTime', align: 'center', width: '250' },
- { text: '描述', value: 'templateDesc', align: 'center' },
+ { text: '编号', value: 'templateNo', align: 'center', width: '160' },
+ { text: '模板名称', value: 'templateName', align: 'center' },
+ { text: '模板类型', value: 'templateTypeName', align: 'center', width: '100' },
+ { text: '负责人', value: 'templateCreator', align: 'center', width: '100' },
+ { text: '内容描述', value: 'templateDesc', align: 'center' },
+ { text: '创建时间', value: 'createTime', align: 'center', width: '180' },
])
const checkoutList = ref([]) // 多选选中参数
-// 获取类型
-const getType = async () => {
- const res = await getDictByCode('templateType')
- searchQuery.templateType = res.data.filter((item: typeofSign) => item.name === '证书报告模板')[0].value
+// ---------------------------------------字典--------------------------------------------
+const templateTypeMap = ref([]) as any // 模板类型
+// 获取字典值
+async function getDict() {
+ // 模板类型
+ const res = await getDictByCode('certificationType')
+ res.data.forEach((item: { value: string; name: string }) => {
+ templateTypeMap.value[`${item.value}`] = item.name
+ })
}
+// ----------------------------------------------------------------------------------------------
// 获取数据列表
const getList = () => {
loadingTable.value = true
templatePage(searchQuery).then((res) => {
if (res.code === 200) {
- list.value = res.data.rows
+ list.value = res.data.rows.map((item: { certificationType: string }) => {
+ return {
+ ...item,
+ templateTypeName: `${item.certificationType}` ? templateTypeMap.value[item.certificationType] : item.certificationType, // 模板类型
+ }
+ })
total.value = res.data.total
}
loadingTable.value = false
@@ -74,7 +87,8 @@
searchQuery.createEndTime = ''
searchQuery.limit = 5
searchQuery.offset = 1
- // searchQuery.templateType = '' // 类型不能变
+ searchQuery.certificationType = '0'
+ createTime.value = ''
searchQuery.ids = []
getList()
}
@@ -82,10 +96,10 @@
// 点击保存
const submitForm = () => {
if (!checkoutList.value.length) {
- ElMessage.warning('请选择证书报告模板')
+ ElMessage.warning('请选择证书模板')
}
else {
- emits('add', checkoutList.value[0])
+ emits('confirm', checkoutList.value[0])
dialogFormVisible.value = false
}
}
@@ -103,15 +117,25 @@
// 初始化
const initDialog = () => {
dialogFormVisible.value = true
- getType().then((_) => {
+ getDict().then((_) => {
getList()
})
}
+watch(() => createTime.value, (newVal) => {
+ if (newVal) {
+ searchQuery.createStartTime = newVal[0]
+ searchQuery.createEndTime = newVal[1]
+ }
+ else {
+ searchQuery.createStartTime = ''
+ searchQuery.createEndTime = ''
+ }
+})
defineExpose({ initDialog })
-
+
@@ -121,7 +145,18 @@
-
+
+
+
+
diff --git a/src/views/business/lab/measureData/dialog/selectMeasueDataDialog.vue b/src/views/business/lab/measureData/dialog/selectMeasueDataDialog.vue
new file mode 100644
index 0000000..f8be703
--- /dev/null
+++ b/src/views/business/lab/measureData/dialog/selectMeasueDataDialog.vue
@@ -0,0 +1,199 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ (listQuery.offset - 1) * listQuery.limit + scope.$index + 1 }}
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/views/business/lab/measureData/dialog/selectTechFilesDialog.vue b/src/views/business/lab/measureData/dialog/selectTechFilesDialog.vue
new file mode 100644
index 0000000..f6f1a5a
--- /dev/null
+++ b/src/views/business/lab/measureData/dialog/selectTechFilesDialog.vue
@@ -0,0 +1,247 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ (listQuery.offset - 1) * listQuery.limit + scope.$index + 1 }}
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/views/business/lab/measureData/measureData-interface.ts b/src/views/business/lab/measureData/measureData-interface.ts
index 8319f65..d25a212 100644
--- a/src/views/business/lab/measureData/measureData-interface.ts
+++ b/src/views/business/lab/measureData/measureData-interface.ts
@@ -1,13 +1,14 @@
// 查询条件
export interface IListQuery {
- approvalStatus: string // 审批状态
- certificateReportCode: string // 证书编号
- certificateReportName: string // 证书名称
- customerName: string // 委托方名称
- sampleName: string // 样品名称
- measureCategory: string // 检校类别
- approvalStatusName: string // 审批状态名称
- formId: string
+ approvalStatus: string // 审批状态类型code
+ certificateReportCode: string // 证书编号
+ certificateReportName: string // 证书名称
+ customerName: string // 委托方名称
+ formId: string // 表单id(流程定义对应的表单id,等价于业务id)
+ measureCategory: string // 检校类别
+ orderCode: string // 委托书编号
+ sampleName: string // 样品名称
+ sampleNo: string // 样品编号
offset: number
limit: number
}
@@ -28,47 +29,53 @@
calibrationTime: string // 检校日期
taskId?: string // 任务id 用于审批
decisionItem?: string
- applyApprovalStatusName?: string // 审批状态名称
+ approvalStatusName?: string // 审批状态名称
processId?: string // 流程实例id
}
// 表单
export interface IForm {
- tdysczs: number // 替代已生成证书
+ id?: string
+ invalid: number // 替代已生成证书
formId: string
- yzs: string // 原证书
+ oldCertificateCode: string // 原证书
calibrationMajor: string // 检校专业
- certifications: string // 证书类别
+ calibrationMajorName: string // 检校专业名称
+ certificateReportCategory: string // 证书类别
+ certificateReportCategoryName: string // 证书类别名称
certificateReportCode: string // 证书编号
certificateReportName: string // 证书名称
- jdy: string // 检定员
- jjrq: string // 检校日期
+ measurePerson: string // 检定员
+ measurePersonId: string // 检定员id
+ calibrationTime: string // 检校日期
orderCode: string // 委托书
orderId: string // 委托书id
customerId?: string // 委托放id
customerName: string // 委托方名称
+ customerAddress: string // 委托方地址
certificationCompany: string // 证书单位名称
certificationCompanyAddress: string // 证书单位地址
calibrationPlace: string // 检校地点
- fjsj: string // 复校时间
- jssj: string // 接收时间
- jdjg: string // 检定结果
- environmentCode: string// 环境记录单编号
+ repeatTime: string // 复校时间
+ deliverTime: string // 接收时间
+ measureResult: string // 检定结果
+ environmentCode: string // 环境记录单编号
environmentId: string // 环境记录单id
temperature: string // 温度
humidity: string // 湿度
+ techFilesName: string // 依据的技术文件名称
signId: string // 电子签章id
signName: string // 电子签章名称
approvalSignIds: string // 认可标志专用章id
approvalSignName: string // 认可标志专用章名称
remark: string // 备注
- ywy: string // 业务员
+ busPersonId: string // 业务员id
+ busPersonName: string // 业务员名字
templateId: string // 证书模板
templateName: string // 证书模板
- templateNameFile: string // 证书模板文件
certificateReportFile: string // 证书报告附件
processId?: string // 流程实例id
@@ -76,6 +83,7 @@
// 被检样品
export interface ISampleList {
+ id: string // 样品id
sampleNo: string // 样品编号
sampleName: string // 样品名称
sampleModel: string // 型号
diff --git a/src/views/business/lab/measureData/measureDataDetail.vue b/src/views/business/lab/measureData/measureDataDetail.vue
index 4aa9717..c554c33 100644
--- a/src/views/business/lab/measureData/measureDataDetail.vue
+++ b/src/views/business/lab/measureData/measureDataDetail.vue
@@ -3,6 +3,7 @@
import { ElLoading, ElMessage, ElMessageBox } from 'element-plus'
import type { FormInstance, FormRules } from 'element-plus'
import { ref } from 'vue'
+import dayjs from 'dayjs'
import EnvironmentalDialog from '../components/environmentalDialog.vue'
import selectSignature from '../components/selectSignature.vue'
import selectReportTemplate from '../components/selectReportTemplate.vue'
@@ -10,10 +11,12 @@
import SelectSamplesDialog from '../components/selectSamplesDialog.vue'
import selectMeasureDevice from '../components/selectMeasureDevice.vue'
import type { IEquipmentList, IForm, ISampleList } from './measureData-interface'
+import selectMeasueDataDialog from './dialog/selectMeasueDataDialog.vue'
+import selectTechFilesDialog from './dialog/selectTechFilesDialog.vue'
import { UploadFile } from '@/api/measure/file'
import ApprovalDialog from '@/components/Approval/ApprovalDialog.vue'
import type { TableColumn } from '@/components/NormalTable/table_interface'
-import { addApply, detail, failUpdateApply, submit, updateApply } from '@/api/business/subpackage/apply'
+import { addMeasureData, downLoadTemplate, draftUpdateMeasureData, failUpdateMeasureData, getMeasureDataDetail, submit } from '@/api/business/lab/measureData'
import { cancelApproval, fetchApproval, submitApproval } from '@/api/approval'
import showPhoto from '@/views/system/tool/showPhoto.vue'
import { getDictByCode } from '@/api/system/dict'
@@ -21,6 +24,9 @@
import selectOrder from '@/views/business/schedule/interchangeReceipt/selectOrder.vue'
import { downloadFile } from '@/utils/download'
import type { dictType } from '@/global'
+import { getUserList } from '@/api/system/user'
+import { exportFile } from '@/utils/exportUtils'
+
const user = useUserStore() // 用户信息
const textMap: { [key: string]: string } = {
edit: '编辑',
@@ -31,6 +37,8 @@
const $router = useRouter() // 关闭页面使用
const $route = useRoute()
const query = $route.query
+console.log('opopopop', query)
+
const approvalDialog = ref() // 审批对话ref
const pageType = ref('add') // 页面类型: add, edit, detail
const infoId = ref('') // 列表id
@@ -38,57 +46,63 @@
const orderVisible = ref(false) // 控制委托单对话框显隐
const ruleFormRef = ref() as any
const form = ref({
- tdysczs: 0, // 替代已生成证书
+ invalid: 0, // 替代已生成证书
formId: query.formId as string,
- yzs: '', // 原证书
+ oldCertificateCode: '', // 原证书
calibrationMajor: '', // 检校专业
- certifications: '', // 证书类别
+ calibrationMajorName: '', // 检校专业名称
+ certificateReportCategory: '', // 证书类别
+ certificateReportCategoryName: '', // 证书类别名称
certificateReportCode: '', // 证书编号
certificateReportName: '', // 证书名称
- jdy: '', // 检定员
- jjrq: '', // 检校日期
+ measurePerson: '', // 检定员
+ measurePersonId: '', // 检定员id
+ calibrationTime: '', // 检校日期
- orderCode: '', // 委托单
+ orderCode: '', // 委托单编号
orderId: '', // 委托单id
customerName: '', // 委托方名称
+ customerAddress: '', // 委托方地址
certificationCompany: '', // 证书单位名称
certificationCompanyAddress: '', // 证书单位地址
calibrationPlace: '', // 检校地点
- fjsj: '', // 复校时间
- jssj: '', // 接收时间
- jdjg: '', // 检定结果
+ repeatTime: '', // 复校时间
+ deliverTime: '', // 接收时间
+ measureResult: '', // 检定结果
environmentCode: '', // 环境记录单编号
environmentId: '', // 环境记录单id
temperature: '', // 温度
humidity: '', // 湿度
+ techFilesName: '', // 依据的技术文件名称
signId: '', // 电子签章id
signName: '', // 电子签章名称
approvalSignIds: '', // 认可标志专用章id
approvalSignName: '', // 认可标志专用章名称
remark: '', // 备注
- ywy: '', // 业务员
+ busPersonId: '', // 业务员id
+ busPersonName: '', // 业务员名字
templateId: '', // 证书模板
templateName: '', // 证书模板
- templateNameFile: '', // 证书模板文件
certificateReportFile: '', // 证书报告附件
})
// 校验规则
const formRules = ref({
- yzs: [{ required: true, message: '原证书必填', trigger: ['blur', 'change'] }],
+ oldCertificateCode: [{ required: true, message: '原证书必填', trigger: ['blur', 'change'] }],
calibrationMajor: [{ required: true, message: '检校专业必填', trigger: ['blur', 'change'] }],
- certifications: [{ required: true, message: '证书类别必填', trigger: ['blur', 'change'] }],
+ certificateReportCategory: [{ required: true, message: '证书类别必填', trigger: ['blur', 'change'] }],
certificateReportName: [{ required: true, message: '证书名称必填', trigger: ['blur', 'change'] }],
customerName: [{ required: true, message: '委托方名称必填', trigger: ['blur', 'change'] }],
+ customerAddress: [{ required: true, message: '委托方地址必填', trigger: ['blur', 'change'] }],
certificationCompany: [{ required: true, message: '证书单位名称必填', trigger: ['blur', 'change'] }],
certificationCompanyAddress: [{ required: true, message: '证书单位地址必填', trigger: ['blur', 'change'] }],
calibrationPlace: [{ required: true, message: '检校地点必填', trigger: ['blur', 'change'] }],
- jdy: [{ required: true, message: '检定员必填', trigger: ['blur', 'change'] }],
- jjrq: [{ required: true, message: '检校日期必填', trigger: ['blur', 'change'] }],
- fjsj: [{ required: true, message: '复校时间必填', trigger: ['blur', 'change'] }],
- jssj: [{ required: true, message: '接收时间必填', trigger: ['blur', 'change'] }],
- jdjg: [{ required: true, message: '检定结果必填', trigger: ['blur', 'change'] }],
+ measurePersonId: [{ required: true, message: '检定员必填', trigger: ['blur', 'change'] }],
+ calibrationTime: [{ required: true, message: '检校日期必填', trigger: ['blur', 'change'] }],
+ repeatTime: [{ required: true, message: '复校时间必填', trigger: ['blur', 'change'] }],
+ deliverTime: [{ required: true, message: '接收时间必填', trigger: ['blur', 'change'] }],
+ measureResult: [{ required: true, message: '检定结果必填', trigger: ['blur', 'change'] }],
temperature: [
{ required: true, message: '温度必填', trigger: ['blur', 'change'] },
{ pattern: /(^-?\d\d*\.\d*$)|(^-?\d\d*$)|(^-?\.\d\d*$)/, message: '温度只能为数字', trigger: ['blur', 'change'] },
@@ -111,6 +125,7 @@
// ---------------------------------------字典--------------------------------------------
const certificationTypeMap = ref([]) // 证书类别
const calibrationMajorMap = ref([]) // 校检专业
+const userList = ref([]) // 检定员
// 获取字典值
async function getDict() {
// 校检专业
@@ -119,12 +134,22 @@
// 证书类别
const rescertificationType = await getDictByCode('certificationType')
certificationTypeMap.value = rescertificationType.data
+
+ // 获取人员列表
+ getUserList({ offset: 1, limit: 99999 }).then((res) => {
+ userList.value = res.data.rows
+ })
}
getDict()
// -------------------------------------原证书--------------------------------------------
+const selectMeasueDataDialogRef = ref() // 选择原证书组件ref
// 点击选择原证书
const selectOrigin = () => {
- //
+ selectMeasueDataDialogRef.value.initDialog()
+}
+// 选好原证书
+const selectMeasueDataConfirm = (val: any) => {
+ getDetail(val.id, val.certificateReportCode)
}
// ------------------------------------委托单------------------------------------------
// 点击选择委托单编号
@@ -142,12 +167,17 @@
form.value.orderCode = val[0].orderCode // 委托单
form.value.customerId = val[0].customerId// 委托方id
form.value.customerName = val[0].customerName// 委托方名称
+ form.value.customerAddress = val[0].customerAddress// 委托方地址
form.value.certificationCompany = val[0].certificationCompany// 证书单位名称
form.value.certificationCompanyAddress = val[0].certificationCompanyAddress// 证书单位地址
+ form.value.certificationCompanyAddress = val[0].certificationCompanyAddress// 证书单位地址
+ form.value.busPersonId = val[0].busPersonId// 业务员id
+ form.value.busPersonName = val[0].busPersonName// 业务员名字
}
}
// -------------------------------选择环境记录单----------------------------------------
+const businessEnvironmentRecord = ref({}) as any // 环境记录单信息
// 选择环境记录单Ref
const environmentalDialog = ref()
// 选择环境记录单
@@ -156,6 +186,7 @@
}
// 选择环境记录单表格确认
const environmentalAdd = (data: any) => {
+ businessEnvironmentRecord.value = data
form.value.environmentId = data.id // 环境记录单id
form.value.environmentCode = data.environmentCode // 环境记录单编号
form.value.temperature = data.temperature // 温度
@@ -200,35 +231,16 @@
}
// -----------------------------------------所依据的技术文件----------------------------------
+const selectTechFilesRef = ref()
+const fileList = ref([]) // 依据的技术文件
// 点击所依据的技术文件
const selectTechFiles = () => {
- //
+ selectTechFilesRef.value.initDialog()
}
-// --------------------------------------证书模板------------------------------------------
-// 选择证书模板Ref
-const templateDialog = ref()
-// 选择证书模板
-const handleClickTemplate = () => {
- templateDialog.value.initDialog()
-}
-// 选择证书模板确认
-const confirmCheckoutTemplate = (val: any) => {
- form.value.templateId = val.id // 证书报告模板id
- form.value.templateName = val.templateName || '' // 证书报告模板名称
- form.value.templateNameFile = val.minioFileName // 证书模板附件
-}
-
-// 点击下载证书模板按钮
-const downloadCertTemplate = () => {
- if (!form.value.templateId) {
- ElMessage.warning('请先选择证书模板')
- return false
- }
- if (!form.value.templateNameFile) {
- ElMessage.warning('选择的证书模板无附件,请检查')
- return false
- }
- downloadFile(form.value.templateNameFile as any, `${form.value.templateName}-${form.value.templateNameFile}`)
+// 选好依据的技术文件
+const selectTechFilesConfirm = (val: any) => {
+ fileList.value = val
+ form.value.techFilesName = val.map((item: { fileName: string }) => item.fileName).join(',')
}
// ---------------------------------文件上传(上传证书)-------------------------------------------
@@ -283,10 +295,10 @@
// 点击批量添加/选择
const addSample = () => {
- if (form.value.orderId) {
- selectOrderSamplesDialogRef.value.initDialog(form.value.orderId)
+ if (form.value.orderId) { // 选择委托单下的样品
+ selectOrderSamplesDialogRef.value.initDialog(form.value.orderId, false)
}
- else {
+ else { // 选择样品库中的样品
selectSamplesDialogRef.value.initDialog()
}
}
@@ -318,7 +330,7 @@
}
// ----------------------------------------------所用的计量标准器具--------------------------------------------
const equipmentVisible = ref(false) // 选择设备对话框显隐
-const equipmentList = ref([])// 表格数据
+const equipmentInfoList = ref([])// 表格数据
const checkoutEquipmentList = ref([])// 多选设备
// 表头
const equipmentColumns = ref([
@@ -328,8 +340,8 @@
{ text: '出厂编号', value: 'manufacturingNo', align: 'center' },
{ text: '测量范围', value: 'mesureRange', align: 'center' },
{ text: '不确定度', value: 'uncertainty', align: 'center' },
- { text: '溯源机构', value: 'syjg', align: 'center' },
- { text: '证书编号', value: 'zsbh', align: 'center' },
+ { text: '溯源机构', value: 'mesureDeptName', align: 'center' },
+ // { text: '证书编号', value: 'zsbh', align: 'center' },
{ text: '有效日期', value: 'validDate', align: 'center' },
])
@@ -351,9 +363,9 @@
const confirmSelectEquipment = (val: any) => {
val.forEach((item: IEquipmentList) => {
// 只添加列表里不存在的
- const index = equipmentList.value.findIndex((i: IEquipmentList) => item.equipmentNo === i.equipmentNo)
+ const index = equipmentInfoList.value.findIndex((i: IEquipmentList) => item.equipmentNo === i.equipmentNo)
if (index === -1) {
- equipmentList.value.push(item)
+ equipmentInfoList.value.push(item)
}
})
}
@@ -365,28 +377,109 @@
return false
}
checkoutEquipmentList.value.forEach((item: IEquipmentList) => {
- equipmentList.value.forEach((element, index) => {
+ equipmentInfoList.value.forEach((element, index) => {
if (element.equipmentNo === item.equipmentNo) {
- equipmentList.value.splice(index, 1)
+ equipmentInfoList.value.splice(index, 1)
}
})
})
}
+
+// --------------------------------------证书模板------------------------------------------
+// 选择证书模板Ref
+const templateDialogRef = ref()
+// 选择证书模板
+const handleClickTemplate = () => {
+ templateDialogRef.value.initDialog()
+}
+// 选择证书模板确认
+const confirmCheckoutTemplate = (val: any) => {
+ form.value.templateId = val.id // 证书报告模板id
+ form.value.templateName = val.templateName || '' // 证书报告模板名称
+}
+
+// 点击下载证书模板按钮
+const downloadCertTemplate = () => {
+ if (!form.value.templateId) {
+ ElMessage.warning('请先选择证书模板')
+ return false
+ }
+ if (!sampleList.value.length) {
+ ElMessage.warning('被检样品不能为空')
+ return false
+ }
+ if (!equipmentInfoList.value.length) {
+ ElMessage.warning('所用的计量标准器具不能为空')
+ return false
+ }
+
+ ruleFormRef.value.validate((valid: boolean) => {
+ if (valid) {
+ const params = solveParams()
+ const loading = ElLoading.service({
+ lock: true,
+ background: 'rgba(255, 255, 255, 0.8)',
+ })
+ downLoadTemplate(params).then((res) => {
+ exportFile(res.data, `${form.value.certificateReportName}.xls`)
+ loading.close()
+ }).catch(() => {
+ loading.close()
+ })
+ }
+ })
+}
+
// -------------------------------------------------------------------------------------------
+// 处理保存、下载模板参数
+function solveParams() {
+ const params = {
+ ...form.value,
+ businessEnvironmentRecord: businessEnvironmentRecord.value, // 环境记录单
+ fileList: fileList.value, // 依据的技术文件
+ equipmentInfoList: equipmentInfoList.value, // 所用的计量标准器具列表/监测设备
+ sampleId: sampleList.value[0].id, // 样品id(打印证书接口要必传)
+ sampleNo: sampleList.value[0].sampleNo, // 样品编号
+ sampleName: sampleList.value[0].sampleName, // 样品名称
+ sampleModel: sampleList.value[0].sampleModel, // 样品型号
+ manufacturingNo: sampleList.value[0].manufacturingNo, // 出厂编号
+ manufacturer: sampleList.value[0].manufacturer, // 生产厂家
+ sampleRemark: sampleList.value[0].remark, // 样品备注
+ id: pageType.value === 'add' ? '' : form.value.id,
+ }
+ return params
+}
// 获取详情信息
-const getDetail = () => {
+function getDetail(id?: string, certificateReportCode?: string) {
const loading = ElLoading.service({
lock: true,
background: 'rgba(255, 255, 255, 0.8)',
})
- detail({ id: $route.params.id as string }).then((res) => {
+ getMeasureDataDetail({ id: infoId.value! || id! }).then((res) => {
loading.close()
form.value = res.data
- form.value.createUserName = res.data.applicantName || user.name
- list.value = res.data.sampleList.filter((item: ISampleList) => {
- return item !== null
- })
+ sampleList.value = [{
+ sampleNo: res.data.sampleNo, // 样品编号
+ sampleName: res.data.sampleNo, // 样品名称
+ sampleModel: res.data.sampleNo, // 型号
+ manufacturingNo: res.data.sampleNo, // 出厂编号
+ manufacturer: res.data.sampleNo, // 生产厂家
+ remark: res.data.sampleRemark, // 备注
+ id: res.data.sampleId,
+ }]
+ equipmentInfoList.value = res.data.equipmentInfoList.map((item: { validDate: string }) => {
+ return {
+ ...item,
+ validDate: item.validDate ? dayjs(item.validDate).format('YYYY-MM-DD') : item.validDate,
+ }
+ }) // 所用的计量标准器具
+ businessEnvironmentRecord.value = res.data.businessEnvironmentRecord // 环境记录单数据
+ form.value.environmentCode = res.data.businessEnvironmentRecord.environmentCode// 环境记录单编号
+ if (id && certificateReportCode) {
+ form.value.oldCertificateCode = certificateReportCode
+ form.value.invalid = 1
+ }
}).catch(() => {
loading.close()
})
@@ -399,10 +492,13 @@
// 保存
const handleSave = () => {
- const tempList = list.value.filter(item => item.sampleNo)
- if (!tempList.length) {
- ElMessage.warning('样品信息不能为空')
- return
+ if (!sampleList.value.length) {
+ ElMessage.warning('被检样品不能为空')
+ return false
+ }
+ if (!equipmentInfoList.value.length) {
+ ElMessage.warning('所用的计量标准器具不能为空')
+ return false
}
ruleFormRef.value.validate((valid: boolean) => {
if (valid) {
@@ -410,32 +506,22 @@
lock: true,
background: 'rgba(255, 255, 255, 0.8)',
})
- // 样品&委托单列表(保存/编辑草稿接口入参使用)
- const temList = [] as any // 临时数组
- console.log('保存中的数组', list.value)
-
- list.value.forEach((item: any) => {
- if ((item.orderId && item.id) || (item.orderId && item.sampleId)) {
- temList.push({
- orderId: item.orderId,
- sampleId: item.id || item.sampleId,
- })
- }
- })
- form.value.orderSampleList = temList
+ const params = solveParams()
if (pageType.value === 'add') { // 新建
- addApply(form.value).then((res) => {
- submitId.value = res.data.id
- form.value.projectNo = res.data.projectNo // 分包项目编号
+ addMeasureData(params).then((res) => {
+ submitId.value = res.data.data.id
+ form.value.certificateReportCode = res.data.data.certificateReportCode
+ form.value.certificateReportName = res.data.data.certificateReportName
ElMessage.success('保存成功')
loading.close()
}).catch(() => {
loading.close()
})
}
+
else if (pageType.value === 'edit') { // 编辑
if (query.approvalStatusName === '未通过-驳回') { // 未通过-驳回
- failUpdateApply(form.value).then((res) => {
+ failUpdateMeasureData(params).then((res) => {
ElMessage.success('保存成功')
loading.close()
close()
@@ -444,7 +530,7 @@
})
}
else { // 草稿箱和已取消
- updateApply(form.value).then((res) => {
+ draftUpdateMeasureData(params).then((res) => {
ElMessage.success('保存成功')
loading.close()
close()
@@ -466,7 +552,7 @@
})
const params = {
id: submitId.value,
- formId: query.formId, // 表单id
+ formId: query.formId as string, // 表单id
}
submit(params).then(() => {
ElMessage.success('提交成功')
@@ -481,39 +567,6 @@
}
}
-const sampleVisible = ref(false)
-const projectVisible = ref(false)
-const isMulti = ref(false)
-const selectIndex = ref(0)
-// 点击选择
-const handleSelect = (index: number, row: ISampleList) => {
- sampleVisible.value = true // 选择设备对话框显隐
- isMulti.value = false // 是否单选, false单选、true表格多选
- selectIndex.value = index
-}
-
-const checkoutList = ref([]) // 选中的行
-
-// 修改委托方对话框显隐
-const changeSampleVisible = (val: boolean) => {
- sampleVisible.value = val
-}
-// 修改项目选择对话框显隐
-const changeProjectVisible = (val: boolean) => {
- projectVisible.value = val
-}
-
-// 删除行
-const delRow = () => {
- checkoutList.value.forEach((item: ISampleList) => {
- list.value.forEach((element, index) => {
- if (element.sampleNo === item.sampleNo) {
- list.value.splice(index, 1)
- }
- })
- })
-}
-
// ------------------------------------------审批-----------------------------------------
const approvalRecordData = ref([]) // 审批流程数据
@@ -573,11 +626,26 @@
// ------------------------------------事件-------------------------------------------------
// 检校专业变化
const changeCalibrationMajor = (val: string) => {
- form.value.certificateReportName = form.value.certificateReportCode + val + form.value.certifications
+ const index = calibrationMajorMap.value.findIndex((item: { value: string }) => item.value === val)
+ if (index !== -1) {
+ form.value.calibrationMajorName = calibrationMajorMap.value[index].name
+ }
+ console.log(form.value.calibrationMajorName)
}
// 证书类别变化
const changeCertifications = (val: string) => {
- form.value.certificateReportName = form.value.certificateReportCode + form.value.calibrationMajor + val
+ const index = certificationTypeMap.value.findIndex((item: { value: string }) => item.value === val)
+ if (index !== -1) {
+ form.value.certificateReportCategoryName = certificationTypeMap.value[index].name
+ }
+ console.log(form.value.certificateReportCategoryName)
+}
+// 选择检定员变化
+const changeMeasurePersonId = (val: string) => {
+ const index = userList.value.findIndex(item => item.id === val)
+ if (index !== -1) {
+ form.value.measurePerson = userList.value[index].name
+ }
}
// -------------------------------------------------------------------------------------
onMounted(async () => {
@@ -593,8 +661,9 @@
// form.value.createUser = user.id // 创建人id
// form.value.createUserName = user.name // 创建人
// form.value.applicantTime = proxy.dayjs().format('YYYY-MM-DD HH:mm:ss') // 申请时间
- form.value.jdy = user.name // 创建人
- form.value.jjrq = proxy.dayjs().format('YYYY-MM-DD') // 检校日期
+ form.value.measurePerson = user.name // 检定员名字
+ form.value.measurePersonId = user.id // 检定员id
+ form.value.calibrationTime = proxy.dayjs().format('YYYY-MM-DD') // 检校日期
}
})
@@ -606,7 +675,7 @@
上传证书
-
+
下载证书模板
@@ -641,25 +710,25 @@
label-width="140"
:rules="formRules"
>
-
+
-
+
替代已生成证书
-
-
+
+
-
+
选择
@@ -684,15 +753,15 @@
v-for="item in calibrationMajorMap"
:key="item.value"
:label="item.name"
- :value="item.name"
+ :value="item.value"
/>
-
+
@@ -720,7 +789,7 @@
/>
-
+
+
+
+
+
@@ -761,6 +841,18 @@
/>
+
+
+
+
+
-
-
+
+ filterable
+ @change="changeMeasurePersonId"
+ >
+
+
-
+
-
-
+
+
-
-
+
+
-
-
+
+
-
+
-
+
confirmSelectSample(val, 'order')" />
confirmSelectSample(val, 'warehouse')" />
+
+
+
+
diff --git a/src/views/business/lab/measureData/measureDataList.vue b/src/views/business/lab/measureData/measureDataList.vue
index 5c011b8..96ffa13 100644
--- a/src/views/business/lab/measureData/measureDataList.vue
+++ b/src/views/business/lab/measureData/measureDataList.vue
@@ -2,16 +2,19 @@
-
+
-
-
-
@@ -369,6 +385,7 @@
is-showmulti-select
@change="changePage"
@multi-select="handleSelectionChange"
+ @handleClickFollowLink="handleClickFollowLink"
>
@@ -483,3 +500,12 @@
+
+
diff --git a/src/views/business/schedule/interchangeReceipt/receiptEdit.vue b/src/views/business/schedule/interchangeReceipt/receiptEdit.vue
index 13ee3ab..877ea57 100644
--- a/src/views/business/schedule/interchangeReceipt/receiptEdit.vue
+++ b/src/views/business/schedule/interchangeReceipt/receiptEdit.vue
@@ -356,7 +356,7 @@
getInterchangeReceiptDetail({ id: infoId.value }).then((res) => {
dataForm.value = res.data // 表单
sampleList.value = res.data.customerSampleList // 样品列表
- dataForm.value.orderId = res.data.customerSampleList[0].orderId // orderId
+ dataForm.value.orderId = res.data.orderId // orderId
minioFileNameAutograph.value = res.data.recieverSignFile // 签名图片
loading.close()
})
diff --git a/src/views/finance/businessSettlement/businessSettlement-interface.ts b/src/views/finance/businessSettlement/businessSettlement-interface.ts
index 13a1a0c..454788f 100644
--- a/src/views/finance/businessSettlement/businessSettlement-interface.ts
+++ b/src/views/finance/businessSettlement/businessSettlement-interface.ts
@@ -4,6 +4,8 @@
customerNo: string // 委托方代码
customerName: string // 委托方名称
deliverer: string // 送样人
+ orderTimeStart: string // 委托日期开始
+ orderTimeEnd: string // 委托日期结束
offset: number
limit: number
}
@@ -14,17 +16,17 @@
orderCode: string // 委托书编号
customerNo: string // 委托方代码
customerName: string // 委托方名称
- deliverer: string // 送样人
- delivererTel: string // 联系方式
+ orderTime: string // 委托日期
sampleCount: string // 样品数量
- isUrgent: string // 是否加急
- createTime: string // 创建时间
- postedPrice: number // 标价(单位分)
- suggestedDiscount: string // 建议折扣-单位%
- suggestedPrice: number // 建议价格-单位分
- extraCharge: number // 附加费用-单位分
- extraChargeIllustration: string // 附加费用说明
- totalSettlement: number // 总计结算费用-单位分
+ sampleWarehouseName: string // 样品库房
+ certWarehouseName: string // 证书库房
+ feeStatus: string // 费用状态
+ received: string // 是否到账
+ actualTestFee: string // 检测费(实)(元)
+ shouldTestFee: string // 检测费(应)(元)
+ actualTotalFee: string // 实收合计(元)
+ receivedAmount: string // 到账金额(元)
+ invoiceAmount: string // 开票金额(元)
}
// 字典
@@ -49,21 +51,22 @@
// 表单
export interface IForm {
orderCode: string // 委托书编号
- orderId: string // 委托书编号
- deliverer: string // 送检人
- delivererTel: string // 送样人联系方式
- createTime: string // 委托单创建时间
- planDeliverTime: string // 预计送达时间
- requireOverTime: string // 要求检完时间
- customerNo: string // 委托方代码
- customerId: string // 委托方id
+ orderId: string // 委托单id
customerName: string // 委托方名称
- phone: string // 委托方电话
- priceFront: number // 标价
- suggestedDiscount: number // 建议折扣
- suggestedPrice: number // 建议价格
- extraCharge: number // 附加费用-单位分
- extraChargeIllustration: string // 附加费用说明
- totalSettlement: number // 总计结算费用
- samplePriceList: Array // 样品清单
+ orderTime: string // 委托日期
+ sampleCount: string // 样品数量
+ certificationCompany: string // 证书单位名称
+ certificationCompanyAddress: string // 证书单位地址
+ deliverer: string // 联系人
+ delivererTel: string // 联系方式
+ sampleWarehouse: string // 样品库房
+ certWarehouse: string // 证书库房
+ feeStatus: string // 费用状态
+ received: string // 是否到账
+ actualTestFee: Number // 检测费(实)(元)
+ shouldTestFee: Number // 检测费(应)(元)
+ actualTotalFee: Number // 实收合计(元)
+ receivedAmount: Number // 到账金额(元)
+ invoiceAmount: Number // 开票金额(元)
+ remark: string // 备注
}
diff --git a/src/api/business/lab/measureData.ts b/src/api/business/lab/measureData.ts
new file mode 100644
index 0000000..ab3a56e
--- /dev/null
+++ b/src/api/business/lab/measureData.ts
@@ -0,0 +1,78 @@
+/**
+ * 计量数据管理
+*/
+import request from '../../index'
+
+// 计量数据管理列表
+export function getMeasureDataList(data: { offset: number; limit: number }) {
+ return request({
+ url: `/business/certificateReport/approval/listPage?offset=${data.offset}&limit=${data.limit}`,
+ method: 'post',
+ data,
+ })
+}
+
+// 点击下载模板后生成证书
+export function downLoadTemplate(data: any) {
+ return request({
+ url: '/business/certificateReport/exportFile',
+ method: 'post',
+ data,
+ responseType: 'blob',
+ })
+}
+
+// 新增
+export function addMeasureData(data: any) {
+ return request({
+ url: '/business/certificateReport/save',
+ method: 'post',
+ data,
+ })
+}
+
+// 草稿箱更新
+export function draftUpdateMeasureData(data: any) {
+ return request({
+ url: '/business/certificateReport/draftUpdate',
+ method: 'post',
+ data,
+ })
+}
+
+// 未通过-驳回编辑
+export function failUpdateMeasureData(data: any) {
+ return request({
+ url: '/business/certificateReport/failUpdate',
+ method: 'post',
+ data,
+ })
+}
+
+// 提交
+export function submit(data: { formId: string; processId?: string; id: string }) {
+ return request({
+ url: '/business/certificateReport/submit',
+ method: 'post',
+ data,
+ })
+}
+
+// 详情
+export function getMeasureDataDetail(data: { id: string }) {
+ return request({
+ url: '/business/certificateReport/detail',
+ method: 'post',
+ data,
+ })
+}
+
+// 删除
+export function deleteMeasureData(data: any) {
+ return request({
+ url: '/business/certificateReport/batchDelete',
+ method: 'post',
+ data,
+ })
+}
+
diff --git a/src/api/business/subpackage/apply.ts b/src/api/business/subpackage/apply.ts
index ad17a5a..c778f8e 100644
--- a/src/api/business/subpackage/apply.ts
+++ b/src/api/business/subpackage/apply.ts
@@ -94,3 +94,4 @@
data,
})
}
+
diff --git a/src/api/system/tool.ts b/src/api/system/tool.ts
index 6b2f5f2..8223e4c 100644
--- a/src/api/system/tool.ts
+++ b/src/api/system/tool.ts
@@ -67,19 +67,10 @@
data,
})
}
-// 原始记录模板/证书报告模板列表(分页)
-export interface listParamsType {
- templateNo: string // 编号
- templateName: string // 名称
- templateCreator: string // 负责人
- // createTime: string // 创建时间
- limit: number
- offset: number
- templateType: string
-}
-export function templatePage(data: listParamsType) {
+
+export function templatePage(data: any) {
return request({
- url: `${prefix}/template/listPage?limit=${data.limit}&offset=${data.offset}`,
+ url: `${prefix}template/listPage?limit=${data.limit}&offset=${data.offset}`,
method: 'post',
data,
})
@@ -87,7 +78,7 @@
// 原始记录模板/证书报告模板列表/详情(
export function templatePageDetail(data: object) {
return request({
- url: `${prefix}/template/detail`,
+ url: `${prefix}template/detail`,
method: 'post',
data,
})
@@ -95,7 +86,7 @@
// 原始记录模板/证书报告模板列表删除
export function templateDelete(data: object) {
return request({
- url: `${prefix}/template/delete`,
+ url: `${prefix}template/delete`,
method: 'post',
data,
})
@@ -103,7 +94,7 @@
// 原始记录模板/证书报告模板列表新建
export function templateAdd(data: object) {
return request({
- url: `${prefix}/template/add`,
+ url: `${prefix}template/add`,
method: 'post',
data,
})
@@ -111,7 +102,7 @@
// 原始记录模板/证书报告模板列表更新
export function templateUpdate(data: object) {
return request({
- url: `${prefix}/template/update`,
+ url: `${prefix}template/update`,
method: 'post',
data,
})
@@ -119,7 +110,7 @@
// 原始记录模板/证书报告模板列表导出
export function templateExport(data: object) {
return request({
- url: `${prefix}/template/listExport`,
+ url: `${prefix}template/listExport`,
method: 'post',
data,
responseType: 'blob',
diff --git a/src/components.d.ts b/src/components.d.ts
index edc2e04..64cf608 100644
--- a/src/components.d.ts
+++ b/src/components.d.ts
@@ -46,6 +46,7 @@
ImageUpload: typeof import('./components/ImageUpload/index.vue')['default']
LineChart: typeof import('./components/Echart/LineChart.vue')['default']
MeasureRecords: typeof import('./components/Sample/measureRecords.vue')['default']
+ MultiHeaderTable: typeof import('./components/MultiHeaderTable/index.vue')['default']
NodeWrap: typeof import('./components/workFlow/nodeWrap.vue')['default']
NodeWrapBan: typeof import('./components/workFlow/nodeWrapBan.vue')['default']
NormalTable: typeof import('./components/NormalTable/index.vue')['default']
@@ -67,6 +68,7 @@
SelectStaffDialog: typeof import('./components/dialog/selectStaffDialog.vue')['default']
SvgIcon: typeof import('./components/SvgIcon/index.vue')['default']
SystemInfo: typeof import('./components/SystemInfo/index.vue')['default']
+ TableColumn: typeof import('./components/MultiHeaderTable/tableColumn.vue')['default']
TableContainer: typeof import('./components/TableContainer/index.vue')['default']
Trend: typeof import('./components/Trend/index.vue')['default']
WordOreview: typeof import('./components/filePreview/wordOreview.vue')['default']
diff --git a/src/components/MultiHeaderTable/index.vue b/src/components/MultiHeaderTable/index.vue
new file mode 100644
index 0000000..85b8c88
--- /dev/null
+++ b/src/components/MultiHeaderTable/index.vue
@@ -0,0 +1,343 @@
+
+
+
+
+
+
+
diff --git a/src/components/MultiHeaderTable/tableColumn.vue b/src/components/MultiHeaderTable/tableColumn.vue
new file mode 100644
index 0000000..2b87285
--- /dev/null
+++ b/src/components/MultiHeaderTable/tableColumn.vue
@@ -0,0 +1,147 @@
+
+
+
+
+
+
+
+
+
+
+ *{{ item.text }}
+
+
+ *{{ item.text }}
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ scope.row[item.value] }}
+
+
+ {{
+ scope.row[item.value]
+ }}
+
+
+
+
+
+
diff --git a/src/components/NormalTable/index.vue b/src/components/NormalTable/index.vue
index e56f775..67092d3 100644
--- a/src/components/NormalTable/index.vue
+++ b/src/components/NormalTable/index.vue
@@ -3,6 +3,7 @@
import { ElTable } from 'element-plus'
import { defineExpose, ref } from 'vue'
import type { TableColumn } from './table_interface'
+import showPhoto from '@/views/system/tool/showPhoto.vue'
// ------------------定义props、 emit-------------------
const props = defineProps({
@@ -212,8 +213,8 @@
{{ scope.row[column.value] }}
{{ column.filter(scope.row) }}
- {{ scope.row }}
-
+
+
diff --git a/src/utils/useCheckList.ts b/src/utils/useCheckList.ts
new file mode 100644
index 0000000..c7782f0
--- /dev/null
+++ b/src/utils/useCheckList.ts
@@ -0,0 +1,73 @@
+import { ElMessage } from 'element-plus'
+// import type { TableColumn } from '@/components/NormalTable/table_interface'
+
+/**
+ * 检查列表
+ * @param list 要检查的表格数据(被依赖项如果满足某个条件就去检查依赖项,否则不检查依赖项)
+ * @param columns // 表头信息
+ * @param tableTitle // 表格名称
+ * @param depend // 依赖项
+ * @param depended // 被依赖项
+ * @param dependedValue // 被依赖项条件
+ * @param requireLength // 要检查的表格数据长度是否大于0
+ */
+export default function useCheckList(list: any, columns: any, tableTitle = '', depend?: string, depended?: string, dependedValue?: number | string, requireLength = false): boolean {
+ for (const prop of columns) {
+ for (let index = 0; index < list.length; index++) {
+ const item = list[index]
+
+ if (depend && depended && item[depended] === dependedValue && !(`${item[prop.value]}`)) { // 被依赖项满足条件时需要检查
+ ElMessage.warning(`请先完善 ${tableTitle} 第${index + 1}行中 ${prop.text} 字段`)
+ return false
+ }
+ else {
+ // 检查必填
+ if (prop.required && (!(`${item[prop.value]}`) || `${item[prop.value]}` === 'null' || `${item[prop.value]}` === 'undefined' || item[prop.value] == undefined)) {
+ if (`${prop.belongStandardEquipment}` === '15') { // 小功率
+ ElMessage.warning(`${tableTitle} 第${index + 1}行中 ${prop.message} ${prop.text} 字段不能为空`)
+ }
+ else {
+ ElMessage.warning(`请先完善 ${tableTitle} 第${index + 1}行中 ${prop.text} 字段`)
+ }
+ return false
+ }
+ }
+
+ // 验证正则
+ if (prop.reg && typeof prop.reg === 'function') {
+ if (prop.value === 'resolution') { // 分辨力特殊处理
+ if (!prop.reg(item[prop.value])) {
+ ElMessage.warning(`${tableTitle} 第${index + 1}行中 ${prop.text} 不能大于1`)
+ return false
+ }
+ }
+ else {
+ if (!prop.reg(item[prop.value])) {
+ if (`${prop.belongStandardEquipment}` === '15') { // 小功率
+ ElMessage.warning(`${tableTitle} 第${index + 1}行中 ${prop.message} ${prop.text} 字段不能为0`)
+ }
+ else if (`${prop.belongStandardEquipment}` === '17') { // S参数
+ ElMessage.warning(`${tableTitle} 第${index + 1}行中 ${prop.text} 仅允许输入数字、字母、特殊字符`)
+ }
+ else {
+ ElMessage.warning(`${tableTitle} 第${index + 1}行中 ${prop.text} 字段输入不合法`)
+ }
+ return false
+ }
+ }
+ }
+
+ if (prop.children && prop.children.length) {
+ if (!useCheckList(list, prop.children, tableTitle, depend, depended, dependedValue)) {
+ return false
+ }
+ }
+ }
+ }
+
+ if (requireLength && !list.length) {
+ ElMessage.warning(`${tableTitle}表格数据不能为空`)
+ return false
+ }
+ return true
+}
diff --git a/src/views/business/lab/components/selectOrderSamplesDialog.vue b/src/views/business/lab/components/selectOrderSamplesDialog.vue
index 4002f83..b004107 100644
--- a/src/views/business/lab/components/selectOrderSamplesDialog.vue
+++ b/src/views/business/lab/components/selectOrderSamplesDialog.vue
@@ -14,6 +14,7 @@
const loadingTable = ref(false) // loading
const list = ref([]) // 表格参数
const tableRef = ref()
+const isMulti = ref(true) // 是否多选默认为多选
const columns = ref
([
{ text: '被测样品名称', value: 'sampleName', align: 'center', required: true },
{ text: '型号规格', value: 'sampleModel', align: 'center', required: true },
@@ -60,9 +61,10 @@
}
// 初始化
-const initDialog = (orderIdParam: string) => {
+const initDialog = (orderIdParam: string, isMultiParam = true) => {
dialogFormVisible.value = true
orderId.value = orderIdParam
+ isMulti.value = isMultiParam
getList()
}
defineExpose({ initDialog })
@@ -78,7 +80,7 @@
:columns="columns"
is-showmulti-select
:list-loading="loadingTable"
- :is-multi="true"
+ :is-multi="isMulti"
:height="300"
:pagination="false"
@multi-select="handleSelectionChange"
diff --git a/src/views/business/lab/components/selectReportTemplate.vue b/src/views/business/lab/components/selectReportTemplate.vue
index 5c59693..ec36ef7 100644
--- a/src/views/business/lab/components/selectReportTemplate.vue
+++ b/src/views/business/lab/components/selectReportTemplate.vue
@@ -7,8 +7,9 @@
import type { typeofSign } from '@/views/system/tool/tool_interface'
import { templatePage } from '@/api/system/tool'
-const emits = defineEmits(['add'])
+const emits = defineEmits(['confirm'])
const dialogFormVisible = ref(false) // 控制弹窗显隐
+const createTime = ref()
// 查询参数
const searchQuery = reactive({
templateNo: '', // 编号
@@ -18,31 +19,43 @@
createEndTime: '',
limit: 5,
offset: 1,
- templateType: '',
+ certificationType: '0',
ids: [] as string[],
}) // 查询参数
const loadingTable = ref(false) // loading
const list = ref([]) // 表格参数
const total = ref(0)
const columns = ref([
- { text: '编号', value: 'templateNo', align: 'center', width: '180' },
- { text: '模板名称', value: 'templateName', align: 'center', width: '150' },
- { text: '模板负责人', value: 'templateCreator', align: 'center', width: '100' },
- { text: '创建时间', value: 'createTime', align: 'center', width: '250' },
- { text: '描述', value: 'templateDesc', align: 'center' },
+ { text: '编号', value: 'templateNo', align: 'center', width: '160' },
+ { text: '模板名称', value: 'templateName', align: 'center' },
+ { text: '模板类型', value: 'templateTypeName', align: 'center', width: '100' },
+ { text: '负责人', value: 'templateCreator', align: 'center', width: '100' },
+ { text: '内容描述', value: 'templateDesc', align: 'center' },
+ { text: '创建时间', value: 'createTime', align: 'center', width: '180' },
])
const checkoutList = ref([]) // 多选选中参数
-// 获取类型
-const getType = async () => {
- const res = await getDictByCode('templateType')
- searchQuery.templateType = res.data.filter((item: typeofSign) => item.name === '证书报告模板')[0].value
+// ---------------------------------------字典--------------------------------------------
+const templateTypeMap = ref([]) as any // 模板类型
+// 获取字典值
+async function getDict() {
+ // 模板类型
+ const res = await getDictByCode('certificationType')
+ res.data.forEach((item: { value: string; name: string }) => {
+ templateTypeMap.value[`${item.value}`] = item.name
+ })
}
+// ----------------------------------------------------------------------------------------------
// 获取数据列表
const getList = () => {
loadingTable.value = true
templatePage(searchQuery).then((res) => {
if (res.code === 200) {
- list.value = res.data.rows
+ list.value = res.data.rows.map((item: { certificationType: string }) => {
+ return {
+ ...item,
+ templateTypeName: `${item.certificationType}` ? templateTypeMap.value[item.certificationType] : item.certificationType, // 模板类型
+ }
+ })
total.value = res.data.total
}
loadingTable.value = false
@@ -74,7 +87,8 @@
searchQuery.createEndTime = ''
searchQuery.limit = 5
searchQuery.offset = 1
- // searchQuery.templateType = '' // 类型不能变
+ searchQuery.certificationType = '0'
+ createTime.value = ''
searchQuery.ids = []
getList()
}
@@ -82,10 +96,10 @@
// 点击保存
const submitForm = () => {
if (!checkoutList.value.length) {
- ElMessage.warning('请选择证书报告模板')
+ ElMessage.warning('请选择证书模板')
}
else {
- emits('add', checkoutList.value[0])
+ emits('confirm', checkoutList.value[0])
dialogFormVisible.value = false
}
}
@@ -103,15 +117,25 @@
// 初始化
const initDialog = () => {
dialogFormVisible.value = true
- getType().then((_) => {
+ getDict().then((_) => {
getList()
})
}
+watch(() => createTime.value, (newVal) => {
+ if (newVal) {
+ searchQuery.createStartTime = newVal[0]
+ searchQuery.createEndTime = newVal[1]
+ }
+ else {
+ searchQuery.createStartTime = ''
+ searchQuery.createEndTime = ''
+ }
+})
defineExpose({ initDialog })
-
+
@@ -121,7 +145,18 @@
-
+
+
+
+
diff --git a/src/views/business/lab/measureData/dialog/selectMeasueDataDialog.vue b/src/views/business/lab/measureData/dialog/selectMeasueDataDialog.vue
new file mode 100644
index 0000000..f8be703
--- /dev/null
+++ b/src/views/business/lab/measureData/dialog/selectMeasueDataDialog.vue
@@ -0,0 +1,199 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ (listQuery.offset - 1) * listQuery.limit + scope.$index + 1 }}
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/views/business/lab/measureData/dialog/selectTechFilesDialog.vue b/src/views/business/lab/measureData/dialog/selectTechFilesDialog.vue
new file mode 100644
index 0000000..f6f1a5a
--- /dev/null
+++ b/src/views/business/lab/measureData/dialog/selectTechFilesDialog.vue
@@ -0,0 +1,247 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ (listQuery.offset - 1) * listQuery.limit + scope.$index + 1 }}
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/views/business/lab/measureData/measureData-interface.ts b/src/views/business/lab/measureData/measureData-interface.ts
index 8319f65..d25a212 100644
--- a/src/views/business/lab/measureData/measureData-interface.ts
+++ b/src/views/business/lab/measureData/measureData-interface.ts
@@ -1,13 +1,14 @@
// 查询条件
export interface IListQuery {
- approvalStatus: string // 审批状态
- certificateReportCode: string // 证书编号
- certificateReportName: string // 证书名称
- customerName: string // 委托方名称
- sampleName: string // 样品名称
- measureCategory: string // 检校类别
- approvalStatusName: string // 审批状态名称
- formId: string
+ approvalStatus: string // 审批状态类型code
+ certificateReportCode: string // 证书编号
+ certificateReportName: string // 证书名称
+ customerName: string // 委托方名称
+ formId: string // 表单id(流程定义对应的表单id,等价于业务id)
+ measureCategory: string // 检校类别
+ orderCode: string // 委托书编号
+ sampleName: string // 样品名称
+ sampleNo: string // 样品编号
offset: number
limit: number
}
@@ -28,47 +29,53 @@
calibrationTime: string // 检校日期
taskId?: string // 任务id 用于审批
decisionItem?: string
- applyApprovalStatusName?: string // 审批状态名称
+ approvalStatusName?: string // 审批状态名称
processId?: string // 流程实例id
}
// 表单
export interface IForm {
- tdysczs: number // 替代已生成证书
+ id?: string
+ invalid: number // 替代已生成证书
formId: string
- yzs: string // 原证书
+ oldCertificateCode: string // 原证书
calibrationMajor: string // 检校专业
- certifications: string // 证书类别
+ calibrationMajorName: string // 检校专业名称
+ certificateReportCategory: string // 证书类别
+ certificateReportCategoryName: string // 证书类别名称
certificateReportCode: string // 证书编号
certificateReportName: string // 证书名称
- jdy: string // 检定员
- jjrq: string // 检校日期
+ measurePerson: string // 检定员
+ measurePersonId: string // 检定员id
+ calibrationTime: string // 检校日期
orderCode: string // 委托书
orderId: string // 委托书id
customerId?: string // 委托放id
customerName: string // 委托方名称
+ customerAddress: string // 委托方地址
certificationCompany: string // 证书单位名称
certificationCompanyAddress: string // 证书单位地址
calibrationPlace: string // 检校地点
- fjsj: string // 复校时间
- jssj: string // 接收时间
- jdjg: string // 检定结果
- environmentCode: string// 环境记录单编号
+ repeatTime: string // 复校时间
+ deliverTime: string // 接收时间
+ measureResult: string // 检定结果
+ environmentCode: string // 环境记录单编号
environmentId: string // 环境记录单id
temperature: string // 温度
humidity: string // 湿度
+ techFilesName: string // 依据的技术文件名称
signId: string // 电子签章id
signName: string // 电子签章名称
approvalSignIds: string // 认可标志专用章id
approvalSignName: string // 认可标志专用章名称
remark: string // 备注
- ywy: string // 业务员
+ busPersonId: string // 业务员id
+ busPersonName: string // 业务员名字
templateId: string // 证书模板
templateName: string // 证书模板
- templateNameFile: string // 证书模板文件
certificateReportFile: string // 证书报告附件
processId?: string // 流程实例id
@@ -76,6 +83,7 @@
// 被检样品
export interface ISampleList {
+ id: string // 样品id
sampleNo: string // 样品编号
sampleName: string // 样品名称
sampleModel: string // 型号
diff --git a/src/views/business/lab/measureData/measureDataDetail.vue b/src/views/business/lab/measureData/measureDataDetail.vue
index 4aa9717..c554c33 100644
--- a/src/views/business/lab/measureData/measureDataDetail.vue
+++ b/src/views/business/lab/measureData/measureDataDetail.vue
@@ -3,6 +3,7 @@
import { ElLoading, ElMessage, ElMessageBox } from 'element-plus'
import type { FormInstance, FormRules } from 'element-plus'
import { ref } from 'vue'
+import dayjs from 'dayjs'
import EnvironmentalDialog from '../components/environmentalDialog.vue'
import selectSignature from '../components/selectSignature.vue'
import selectReportTemplate from '../components/selectReportTemplate.vue'
@@ -10,10 +11,12 @@
import SelectSamplesDialog from '../components/selectSamplesDialog.vue'
import selectMeasureDevice from '../components/selectMeasureDevice.vue'
import type { IEquipmentList, IForm, ISampleList } from './measureData-interface'
+import selectMeasueDataDialog from './dialog/selectMeasueDataDialog.vue'
+import selectTechFilesDialog from './dialog/selectTechFilesDialog.vue'
import { UploadFile } from '@/api/measure/file'
import ApprovalDialog from '@/components/Approval/ApprovalDialog.vue'
import type { TableColumn } from '@/components/NormalTable/table_interface'
-import { addApply, detail, failUpdateApply, submit, updateApply } from '@/api/business/subpackage/apply'
+import { addMeasureData, downLoadTemplate, draftUpdateMeasureData, failUpdateMeasureData, getMeasureDataDetail, submit } from '@/api/business/lab/measureData'
import { cancelApproval, fetchApproval, submitApproval } from '@/api/approval'
import showPhoto from '@/views/system/tool/showPhoto.vue'
import { getDictByCode } from '@/api/system/dict'
@@ -21,6 +24,9 @@
import selectOrder from '@/views/business/schedule/interchangeReceipt/selectOrder.vue'
import { downloadFile } from '@/utils/download'
import type { dictType } from '@/global'
+import { getUserList } from '@/api/system/user'
+import { exportFile } from '@/utils/exportUtils'
+
const user = useUserStore() // 用户信息
const textMap: { [key: string]: string } = {
edit: '编辑',
@@ -31,6 +37,8 @@
const $router = useRouter() // 关闭页面使用
const $route = useRoute()
const query = $route.query
+console.log('opopopop', query)
+
const approvalDialog = ref() // 审批对话ref
const pageType = ref('add') // 页面类型: add, edit, detail
const infoId = ref('') // 列表id
@@ -38,57 +46,63 @@
const orderVisible = ref(false) // 控制委托单对话框显隐
const ruleFormRef = ref() as any
const form = ref({
- tdysczs: 0, // 替代已生成证书
+ invalid: 0, // 替代已生成证书
formId: query.formId as string,
- yzs: '', // 原证书
+ oldCertificateCode: '', // 原证书
calibrationMajor: '', // 检校专业
- certifications: '', // 证书类别
+ calibrationMajorName: '', // 检校专业名称
+ certificateReportCategory: '', // 证书类别
+ certificateReportCategoryName: '', // 证书类别名称
certificateReportCode: '', // 证书编号
certificateReportName: '', // 证书名称
- jdy: '', // 检定员
- jjrq: '', // 检校日期
+ measurePerson: '', // 检定员
+ measurePersonId: '', // 检定员id
+ calibrationTime: '', // 检校日期
- orderCode: '', // 委托单
+ orderCode: '', // 委托单编号
orderId: '', // 委托单id
customerName: '', // 委托方名称
+ customerAddress: '', // 委托方地址
certificationCompany: '', // 证书单位名称
certificationCompanyAddress: '', // 证书单位地址
calibrationPlace: '', // 检校地点
- fjsj: '', // 复校时间
- jssj: '', // 接收时间
- jdjg: '', // 检定结果
+ repeatTime: '', // 复校时间
+ deliverTime: '', // 接收时间
+ measureResult: '', // 检定结果
environmentCode: '', // 环境记录单编号
environmentId: '', // 环境记录单id
temperature: '', // 温度
humidity: '', // 湿度
+ techFilesName: '', // 依据的技术文件名称
signId: '', // 电子签章id
signName: '', // 电子签章名称
approvalSignIds: '', // 认可标志专用章id
approvalSignName: '', // 认可标志专用章名称
remark: '', // 备注
- ywy: '', // 业务员
+ busPersonId: '', // 业务员id
+ busPersonName: '', // 业务员名字
templateId: '', // 证书模板
templateName: '', // 证书模板
- templateNameFile: '', // 证书模板文件
certificateReportFile: '', // 证书报告附件
})
// 校验规则
const formRules = ref({
- yzs: [{ required: true, message: '原证书必填', trigger: ['blur', 'change'] }],
+ oldCertificateCode: [{ required: true, message: '原证书必填', trigger: ['blur', 'change'] }],
calibrationMajor: [{ required: true, message: '检校专业必填', trigger: ['blur', 'change'] }],
- certifications: [{ required: true, message: '证书类别必填', trigger: ['blur', 'change'] }],
+ certificateReportCategory: [{ required: true, message: '证书类别必填', trigger: ['blur', 'change'] }],
certificateReportName: [{ required: true, message: '证书名称必填', trigger: ['blur', 'change'] }],
customerName: [{ required: true, message: '委托方名称必填', trigger: ['blur', 'change'] }],
+ customerAddress: [{ required: true, message: '委托方地址必填', trigger: ['blur', 'change'] }],
certificationCompany: [{ required: true, message: '证书单位名称必填', trigger: ['blur', 'change'] }],
certificationCompanyAddress: [{ required: true, message: '证书单位地址必填', trigger: ['blur', 'change'] }],
calibrationPlace: [{ required: true, message: '检校地点必填', trigger: ['blur', 'change'] }],
- jdy: [{ required: true, message: '检定员必填', trigger: ['blur', 'change'] }],
- jjrq: [{ required: true, message: '检校日期必填', trigger: ['blur', 'change'] }],
- fjsj: [{ required: true, message: '复校时间必填', trigger: ['blur', 'change'] }],
- jssj: [{ required: true, message: '接收时间必填', trigger: ['blur', 'change'] }],
- jdjg: [{ required: true, message: '检定结果必填', trigger: ['blur', 'change'] }],
+ measurePersonId: [{ required: true, message: '检定员必填', trigger: ['blur', 'change'] }],
+ calibrationTime: [{ required: true, message: '检校日期必填', trigger: ['blur', 'change'] }],
+ repeatTime: [{ required: true, message: '复校时间必填', trigger: ['blur', 'change'] }],
+ deliverTime: [{ required: true, message: '接收时间必填', trigger: ['blur', 'change'] }],
+ measureResult: [{ required: true, message: '检定结果必填', trigger: ['blur', 'change'] }],
temperature: [
{ required: true, message: '温度必填', trigger: ['blur', 'change'] },
{ pattern: /(^-?\d\d*\.\d*$)|(^-?\d\d*$)|(^-?\.\d\d*$)/, message: '温度只能为数字', trigger: ['blur', 'change'] },
@@ -111,6 +125,7 @@
// ---------------------------------------字典--------------------------------------------
const certificationTypeMap = ref([]) // 证书类别
const calibrationMajorMap = ref([]) // 校检专业
+const userList = ref([]) // 检定员
// 获取字典值
async function getDict() {
// 校检专业
@@ -119,12 +134,22 @@
// 证书类别
const rescertificationType = await getDictByCode('certificationType')
certificationTypeMap.value = rescertificationType.data
+
+ // 获取人员列表
+ getUserList({ offset: 1, limit: 99999 }).then((res) => {
+ userList.value = res.data.rows
+ })
}
getDict()
// -------------------------------------原证书--------------------------------------------
+const selectMeasueDataDialogRef = ref() // 选择原证书组件ref
// 点击选择原证书
const selectOrigin = () => {
- //
+ selectMeasueDataDialogRef.value.initDialog()
+}
+// 选好原证书
+const selectMeasueDataConfirm = (val: any) => {
+ getDetail(val.id, val.certificateReportCode)
}
// ------------------------------------委托单------------------------------------------
// 点击选择委托单编号
@@ -142,12 +167,17 @@
form.value.orderCode = val[0].orderCode // 委托单
form.value.customerId = val[0].customerId// 委托方id
form.value.customerName = val[0].customerName// 委托方名称
+ form.value.customerAddress = val[0].customerAddress// 委托方地址
form.value.certificationCompany = val[0].certificationCompany// 证书单位名称
form.value.certificationCompanyAddress = val[0].certificationCompanyAddress// 证书单位地址
+ form.value.certificationCompanyAddress = val[0].certificationCompanyAddress// 证书单位地址
+ form.value.busPersonId = val[0].busPersonId// 业务员id
+ form.value.busPersonName = val[0].busPersonName// 业务员名字
}
}
// -------------------------------选择环境记录单----------------------------------------
+const businessEnvironmentRecord = ref({}) as any // 环境记录单信息
// 选择环境记录单Ref
const environmentalDialog = ref()
// 选择环境记录单
@@ -156,6 +186,7 @@
}
// 选择环境记录单表格确认
const environmentalAdd = (data: any) => {
+ businessEnvironmentRecord.value = data
form.value.environmentId = data.id // 环境记录单id
form.value.environmentCode = data.environmentCode // 环境记录单编号
form.value.temperature = data.temperature // 温度
@@ -200,35 +231,16 @@
}
// -----------------------------------------所依据的技术文件----------------------------------
+const selectTechFilesRef = ref()
+const fileList = ref([]) // 依据的技术文件
// 点击所依据的技术文件
const selectTechFiles = () => {
- //
+ selectTechFilesRef.value.initDialog()
}
-// --------------------------------------证书模板------------------------------------------
-// 选择证书模板Ref
-const templateDialog = ref()
-// 选择证书模板
-const handleClickTemplate = () => {
- templateDialog.value.initDialog()
-}
-// 选择证书模板确认
-const confirmCheckoutTemplate = (val: any) => {
- form.value.templateId = val.id // 证书报告模板id
- form.value.templateName = val.templateName || '' // 证书报告模板名称
- form.value.templateNameFile = val.minioFileName // 证书模板附件
-}
-
-// 点击下载证书模板按钮
-const downloadCertTemplate = () => {
- if (!form.value.templateId) {
- ElMessage.warning('请先选择证书模板')
- return false
- }
- if (!form.value.templateNameFile) {
- ElMessage.warning('选择的证书模板无附件,请检查')
- return false
- }
- downloadFile(form.value.templateNameFile as any, `${form.value.templateName}-${form.value.templateNameFile}`)
+// 选好依据的技术文件
+const selectTechFilesConfirm = (val: any) => {
+ fileList.value = val
+ form.value.techFilesName = val.map((item: { fileName: string }) => item.fileName).join(',')
}
// ---------------------------------文件上传(上传证书)-------------------------------------------
@@ -283,10 +295,10 @@
// 点击批量添加/选择
const addSample = () => {
- if (form.value.orderId) {
- selectOrderSamplesDialogRef.value.initDialog(form.value.orderId)
+ if (form.value.orderId) { // 选择委托单下的样品
+ selectOrderSamplesDialogRef.value.initDialog(form.value.orderId, false)
}
- else {
+ else { // 选择样品库中的样品
selectSamplesDialogRef.value.initDialog()
}
}
@@ -318,7 +330,7 @@
}
// ----------------------------------------------所用的计量标准器具--------------------------------------------
const equipmentVisible = ref(false) // 选择设备对话框显隐
-const equipmentList = ref([])// 表格数据
+const equipmentInfoList = ref([])// 表格数据
const checkoutEquipmentList = ref([])// 多选设备
// 表头
const equipmentColumns = ref([
@@ -328,8 +340,8 @@
{ text: '出厂编号', value: 'manufacturingNo', align: 'center' },
{ text: '测量范围', value: 'mesureRange', align: 'center' },
{ text: '不确定度', value: 'uncertainty', align: 'center' },
- { text: '溯源机构', value: 'syjg', align: 'center' },
- { text: '证书编号', value: 'zsbh', align: 'center' },
+ { text: '溯源机构', value: 'mesureDeptName', align: 'center' },
+ // { text: '证书编号', value: 'zsbh', align: 'center' },
{ text: '有效日期', value: 'validDate', align: 'center' },
])
@@ -351,9 +363,9 @@
const confirmSelectEquipment = (val: any) => {
val.forEach((item: IEquipmentList) => {
// 只添加列表里不存在的
- const index = equipmentList.value.findIndex((i: IEquipmentList) => item.equipmentNo === i.equipmentNo)
+ const index = equipmentInfoList.value.findIndex((i: IEquipmentList) => item.equipmentNo === i.equipmentNo)
if (index === -1) {
- equipmentList.value.push(item)
+ equipmentInfoList.value.push(item)
}
})
}
@@ -365,28 +377,109 @@
return false
}
checkoutEquipmentList.value.forEach((item: IEquipmentList) => {
- equipmentList.value.forEach((element, index) => {
+ equipmentInfoList.value.forEach((element, index) => {
if (element.equipmentNo === item.equipmentNo) {
- equipmentList.value.splice(index, 1)
+ equipmentInfoList.value.splice(index, 1)
}
})
})
}
+
+// --------------------------------------证书模板------------------------------------------
+// 选择证书模板Ref
+const templateDialogRef = ref()
+// 选择证书模板
+const handleClickTemplate = () => {
+ templateDialogRef.value.initDialog()
+}
+// 选择证书模板确认
+const confirmCheckoutTemplate = (val: any) => {
+ form.value.templateId = val.id // 证书报告模板id
+ form.value.templateName = val.templateName || '' // 证书报告模板名称
+}
+
+// 点击下载证书模板按钮
+const downloadCertTemplate = () => {
+ if (!form.value.templateId) {
+ ElMessage.warning('请先选择证书模板')
+ return false
+ }
+ if (!sampleList.value.length) {
+ ElMessage.warning('被检样品不能为空')
+ return false
+ }
+ if (!equipmentInfoList.value.length) {
+ ElMessage.warning('所用的计量标准器具不能为空')
+ return false
+ }
+
+ ruleFormRef.value.validate((valid: boolean) => {
+ if (valid) {
+ const params = solveParams()
+ const loading = ElLoading.service({
+ lock: true,
+ background: 'rgba(255, 255, 255, 0.8)',
+ })
+ downLoadTemplate(params).then((res) => {
+ exportFile(res.data, `${form.value.certificateReportName}.xls`)
+ loading.close()
+ }).catch(() => {
+ loading.close()
+ })
+ }
+ })
+}
+
// -------------------------------------------------------------------------------------------
+// 处理保存、下载模板参数
+function solveParams() {
+ const params = {
+ ...form.value,
+ businessEnvironmentRecord: businessEnvironmentRecord.value, // 环境记录单
+ fileList: fileList.value, // 依据的技术文件
+ equipmentInfoList: equipmentInfoList.value, // 所用的计量标准器具列表/监测设备
+ sampleId: sampleList.value[0].id, // 样品id(打印证书接口要必传)
+ sampleNo: sampleList.value[0].sampleNo, // 样品编号
+ sampleName: sampleList.value[0].sampleName, // 样品名称
+ sampleModel: sampleList.value[0].sampleModel, // 样品型号
+ manufacturingNo: sampleList.value[0].manufacturingNo, // 出厂编号
+ manufacturer: sampleList.value[0].manufacturer, // 生产厂家
+ sampleRemark: sampleList.value[0].remark, // 样品备注
+ id: pageType.value === 'add' ? '' : form.value.id,
+ }
+ return params
+}
// 获取详情信息
-const getDetail = () => {
+function getDetail(id?: string, certificateReportCode?: string) {
const loading = ElLoading.service({
lock: true,
background: 'rgba(255, 255, 255, 0.8)',
})
- detail({ id: $route.params.id as string }).then((res) => {
+ getMeasureDataDetail({ id: infoId.value! || id! }).then((res) => {
loading.close()
form.value = res.data
- form.value.createUserName = res.data.applicantName || user.name
- list.value = res.data.sampleList.filter((item: ISampleList) => {
- return item !== null
- })
+ sampleList.value = [{
+ sampleNo: res.data.sampleNo, // 样品编号
+ sampleName: res.data.sampleNo, // 样品名称
+ sampleModel: res.data.sampleNo, // 型号
+ manufacturingNo: res.data.sampleNo, // 出厂编号
+ manufacturer: res.data.sampleNo, // 生产厂家
+ remark: res.data.sampleRemark, // 备注
+ id: res.data.sampleId,
+ }]
+ equipmentInfoList.value = res.data.equipmentInfoList.map((item: { validDate: string }) => {
+ return {
+ ...item,
+ validDate: item.validDate ? dayjs(item.validDate).format('YYYY-MM-DD') : item.validDate,
+ }
+ }) // 所用的计量标准器具
+ businessEnvironmentRecord.value = res.data.businessEnvironmentRecord // 环境记录单数据
+ form.value.environmentCode = res.data.businessEnvironmentRecord.environmentCode// 环境记录单编号
+ if (id && certificateReportCode) {
+ form.value.oldCertificateCode = certificateReportCode
+ form.value.invalid = 1
+ }
}).catch(() => {
loading.close()
})
@@ -399,10 +492,13 @@
// 保存
const handleSave = () => {
- const tempList = list.value.filter(item => item.sampleNo)
- if (!tempList.length) {
- ElMessage.warning('样品信息不能为空')
- return
+ if (!sampleList.value.length) {
+ ElMessage.warning('被检样品不能为空')
+ return false
+ }
+ if (!equipmentInfoList.value.length) {
+ ElMessage.warning('所用的计量标准器具不能为空')
+ return false
}
ruleFormRef.value.validate((valid: boolean) => {
if (valid) {
@@ -410,32 +506,22 @@
lock: true,
background: 'rgba(255, 255, 255, 0.8)',
})
- // 样品&委托单列表(保存/编辑草稿接口入参使用)
- const temList = [] as any // 临时数组
- console.log('保存中的数组', list.value)
-
- list.value.forEach((item: any) => {
- if ((item.orderId && item.id) || (item.orderId && item.sampleId)) {
- temList.push({
- orderId: item.orderId,
- sampleId: item.id || item.sampleId,
- })
- }
- })
- form.value.orderSampleList = temList
+ const params = solveParams()
if (pageType.value === 'add') { // 新建
- addApply(form.value).then((res) => {
- submitId.value = res.data.id
- form.value.projectNo = res.data.projectNo // 分包项目编号
+ addMeasureData(params).then((res) => {
+ submitId.value = res.data.data.id
+ form.value.certificateReportCode = res.data.data.certificateReportCode
+ form.value.certificateReportName = res.data.data.certificateReportName
ElMessage.success('保存成功')
loading.close()
}).catch(() => {
loading.close()
})
}
+
else if (pageType.value === 'edit') { // 编辑
if (query.approvalStatusName === '未通过-驳回') { // 未通过-驳回
- failUpdateApply(form.value).then((res) => {
+ failUpdateMeasureData(params).then((res) => {
ElMessage.success('保存成功')
loading.close()
close()
@@ -444,7 +530,7 @@
})
}
else { // 草稿箱和已取消
- updateApply(form.value).then((res) => {
+ draftUpdateMeasureData(params).then((res) => {
ElMessage.success('保存成功')
loading.close()
close()
@@ -466,7 +552,7 @@
})
const params = {
id: submitId.value,
- formId: query.formId, // 表单id
+ formId: query.formId as string, // 表单id
}
submit(params).then(() => {
ElMessage.success('提交成功')
@@ -481,39 +567,6 @@
}
}
-const sampleVisible = ref(false)
-const projectVisible = ref(false)
-const isMulti = ref(false)
-const selectIndex = ref(0)
-// 点击选择
-const handleSelect = (index: number, row: ISampleList) => {
- sampleVisible.value = true // 选择设备对话框显隐
- isMulti.value = false // 是否单选, false单选、true表格多选
- selectIndex.value = index
-}
-
-const checkoutList = ref([]) // 选中的行
-
-// 修改委托方对话框显隐
-const changeSampleVisible = (val: boolean) => {
- sampleVisible.value = val
-}
-// 修改项目选择对话框显隐
-const changeProjectVisible = (val: boolean) => {
- projectVisible.value = val
-}
-
-// 删除行
-const delRow = () => {
- checkoutList.value.forEach((item: ISampleList) => {
- list.value.forEach((element, index) => {
- if (element.sampleNo === item.sampleNo) {
- list.value.splice(index, 1)
- }
- })
- })
-}
-
// ------------------------------------------审批-----------------------------------------
const approvalRecordData = ref([]) // 审批流程数据
@@ -573,11 +626,26 @@
// ------------------------------------事件-------------------------------------------------
// 检校专业变化
const changeCalibrationMajor = (val: string) => {
- form.value.certificateReportName = form.value.certificateReportCode + val + form.value.certifications
+ const index = calibrationMajorMap.value.findIndex((item: { value: string }) => item.value === val)
+ if (index !== -1) {
+ form.value.calibrationMajorName = calibrationMajorMap.value[index].name
+ }
+ console.log(form.value.calibrationMajorName)
}
// 证书类别变化
const changeCertifications = (val: string) => {
- form.value.certificateReportName = form.value.certificateReportCode + form.value.calibrationMajor + val
+ const index = certificationTypeMap.value.findIndex((item: { value: string }) => item.value === val)
+ if (index !== -1) {
+ form.value.certificateReportCategoryName = certificationTypeMap.value[index].name
+ }
+ console.log(form.value.certificateReportCategoryName)
+}
+// 选择检定员变化
+const changeMeasurePersonId = (val: string) => {
+ const index = userList.value.findIndex(item => item.id === val)
+ if (index !== -1) {
+ form.value.measurePerson = userList.value[index].name
+ }
}
// -------------------------------------------------------------------------------------
onMounted(async () => {
@@ -593,8 +661,9 @@
// form.value.createUser = user.id // 创建人id
// form.value.createUserName = user.name // 创建人
// form.value.applicantTime = proxy.dayjs().format('YYYY-MM-DD HH:mm:ss') // 申请时间
- form.value.jdy = user.name // 创建人
- form.value.jjrq = proxy.dayjs().format('YYYY-MM-DD') // 检校日期
+ form.value.measurePerson = user.name // 检定员名字
+ form.value.measurePersonId = user.id // 检定员id
+ form.value.calibrationTime = proxy.dayjs().format('YYYY-MM-DD') // 检校日期
}
})
@@ -606,7 +675,7 @@
上传证书
-
+
下载证书模板
@@ -641,25 +710,25 @@
label-width="140"
:rules="formRules"
>
-
+
-
+
替代已生成证书
-
-
+
+
-
+
选择
@@ -684,15 +753,15 @@
v-for="item in calibrationMajorMap"
:key="item.value"
:label="item.name"
- :value="item.name"
+ :value="item.value"
/>
-
+
@@ -720,7 +789,7 @@
/>
-
+
+
+
+
+
@@ -761,6 +841,18 @@
/>
+
+
+
+
+
-
-
+
+ filterable
+ @change="changeMeasurePersonId"
+ >
+
+
-
+
-
-
+
+
-
-
+
+
-
-
+
+
-
+
-
+
confirmSelectSample(val, 'order')" />
confirmSelectSample(val, 'warehouse')" />
+
+
+
+
diff --git a/src/views/business/lab/measureData/measureDataList.vue b/src/views/business/lab/measureData/measureDataList.vue
index 5c011b8..96ffa13 100644
--- a/src/views/business/lab/measureData/measureDataList.vue
+++ b/src/views/business/lab/measureData/measureDataList.vue
@@ -2,16 +2,19 @@
-
+
-
-
-
@@ -369,6 +385,7 @@
is-showmulti-select
@change="changePage"
@multi-select="handleSelectionChange"
+ @handleClickFollowLink="handleClickFollowLink"
>
@@ -483,3 +500,12 @@
+
+
diff --git a/src/views/business/schedule/interchangeReceipt/receiptEdit.vue b/src/views/business/schedule/interchangeReceipt/receiptEdit.vue
index 13ee3ab..877ea57 100644
--- a/src/views/business/schedule/interchangeReceipt/receiptEdit.vue
+++ b/src/views/business/schedule/interchangeReceipt/receiptEdit.vue
@@ -356,7 +356,7 @@
getInterchangeReceiptDetail({ id: infoId.value }).then((res) => {
dataForm.value = res.data // 表单
sampleList.value = res.data.customerSampleList // 样品列表
- dataForm.value.orderId = res.data.customerSampleList[0].orderId // orderId
+ dataForm.value.orderId = res.data.orderId // orderId
minioFileNameAutograph.value = res.data.recieverSignFile // 签名图片
loading.close()
})
diff --git a/src/views/finance/businessSettlement/businessSettlement-interface.ts b/src/views/finance/businessSettlement/businessSettlement-interface.ts
index 13a1a0c..454788f 100644
--- a/src/views/finance/businessSettlement/businessSettlement-interface.ts
+++ b/src/views/finance/businessSettlement/businessSettlement-interface.ts
@@ -4,6 +4,8 @@
customerNo: string // 委托方代码
customerName: string // 委托方名称
deliverer: string // 送样人
+ orderTimeStart: string // 委托日期开始
+ orderTimeEnd: string // 委托日期结束
offset: number
limit: number
}
@@ -14,17 +16,17 @@
orderCode: string // 委托书编号
customerNo: string // 委托方代码
customerName: string // 委托方名称
- deliverer: string // 送样人
- delivererTel: string // 联系方式
+ orderTime: string // 委托日期
sampleCount: string // 样品数量
- isUrgent: string // 是否加急
- createTime: string // 创建时间
- postedPrice: number // 标价(单位分)
- suggestedDiscount: string // 建议折扣-单位%
- suggestedPrice: number // 建议价格-单位分
- extraCharge: number // 附加费用-单位分
- extraChargeIllustration: string // 附加费用说明
- totalSettlement: number // 总计结算费用-单位分
+ sampleWarehouseName: string // 样品库房
+ certWarehouseName: string // 证书库房
+ feeStatus: string // 费用状态
+ received: string // 是否到账
+ actualTestFee: string // 检测费(实)(元)
+ shouldTestFee: string // 检测费(应)(元)
+ actualTotalFee: string // 实收合计(元)
+ receivedAmount: string // 到账金额(元)
+ invoiceAmount: string // 开票金额(元)
}
// 字典
@@ -49,21 +51,22 @@
// 表单
export interface IForm {
orderCode: string // 委托书编号
- orderId: string // 委托书编号
- deliverer: string // 送检人
- delivererTel: string // 送样人联系方式
- createTime: string // 委托单创建时间
- planDeliverTime: string // 预计送达时间
- requireOverTime: string // 要求检完时间
- customerNo: string // 委托方代码
- customerId: string // 委托方id
+ orderId: string // 委托单id
customerName: string // 委托方名称
- phone: string // 委托方电话
- priceFront: number // 标价
- suggestedDiscount: number // 建议折扣
- suggestedPrice: number // 建议价格
- extraCharge: number // 附加费用-单位分
- extraChargeIllustration: string // 附加费用说明
- totalSettlement: number // 总计结算费用
- samplePriceList: Array // 样品清单
+ orderTime: string // 委托日期
+ sampleCount: string // 样品数量
+ certificationCompany: string // 证书单位名称
+ certificationCompanyAddress: string // 证书单位地址
+ deliverer: string // 联系人
+ delivererTel: string // 联系方式
+ sampleWarehouse: string // 样品库房
+ certWarehouse: string // 证书库房
+ feeStatus: string // 费用状态
+ received: string // 是否到账
+ actualTestFee: Number // 检测费(实)(元)
+ shouldTestFee: Number // 检测费(应)(元)
+ actualTotalFee: Number // 实收合计(元)
+ receivedAmount: Number // 到账金额(元)
+ invoiceAmount: Number // 开票金额(元)
+ remark: string // 备注
}
diff --git a/src/views/finance/businessSettlement/edit.vue b/src/views/finance/businessSettlement/edit.vue
index e11f337..7630aeb 100644
--- a/src/views/finance/businessSettlement/edit.vue
+++ b/src/views/finance/businessSettlement/edit.vue
@@ -7,13 +7,18 @@
import { useRoute, useRouter } from 'vue-router'
import { el } from 'element-plus/es/locale'
import type { IForm, IsampleList } from './businessSettlement-interface'
+import multiTable from '@/components/MultiHeaderTable/index.vue'
+import { getDictByCode } from '@/api/system/dict'
+import { UploadFile } from '@/api/measure/file'
+import { calc } from '@/utils/useCalc'
+import type { dictType } from '@/global'
import type { TableColumn } from '@/components/NormalTable/table_interface'
import useUserStore from '@/store/modules/user'
import selectOrder from '@/views/business/schedule/interchangeReceipt/selectOrder.vue'
import type { IOrderList } from '@/views/business/schedule/order/orderList_interface'
import { getOrderDetail } from '@/api/business/schedule/order'
import { isNumber, validateMoney } from '@/utils/validate'
-import { calc } from '@/utils/useCalc'
+import useCheckList from '@/utils/useCheckList'
import { addBusinessSettlement, getBusinessSettlementDetail, updateBusinessSettlement } from '@/api/finance/businessSettlement'
const user = useUserStore() // 用户信息
const $route = useRoute()
@@ -27,54 +32,215 @@
// 表单数据
const form = ref({
orderCode: '', // 委托书编号
- orderId: '', // 委托书编号
- deliverer: '', // 送检人
- delivererTel: '', // 送样人联系方式
- createTime: '', // 委托单创建时间
- planDeliverTime: '', // 预计送达时间
- requireOverTime: '', // 要求检完时间
- customerNo: '', // 委托方代码
- customerId: '', // 委托方id
+ orderId: '', // 委托单id
customerName: '', // 委托方名称
- phone: '', // 委托方电话
- priceFront: 0, // 标价
- suggestedDiscount: 95, // 建议折扣
- suggestedPrice: 0, // 建议价格
- extraCharge: 0, // 附加费用-单位分
- extraChargeIllustration: '', // 附加费用说明
- totalSettlement: 0, // 总计结算费用
- samplePriceList: [], // 样品清单
+ orderTime: '', // 委托日期
+ sampleCount: '', // 样品数量
+ certificationCompany: '', // 证书单位名称
+ certificationCompanyAddress: '', // 证书单位地址
+ deliverer: '', // 联系人
+ delivererTel: '', // 联系方式
+ sampleWarehouse: '未入库', // 样品库房
+ certWarehouse: '未入库', // 证书库房
+ feeStatus: '未录费', // 费用状态
+ received: '未到账', // 是否到账
+ actualTestFee: 0, // 检测费(实)(元)
+ shouldTestFee: 0, // 检测费(应)(元)
+ actualTotalFee: 0, // 实收合计(元)
+ receivedAmount: 0, // 到账金额(元)
+ invoiceAmount: 0, // 开票金额(元)
+ remark: '', // 备注
})
-const ruleFormRef = ref() as any
-const list = ref([])// 表格数据
-const orderVisible = ref(false) // 控制委托书对话框显隐
-
-// 表头
-const columns = ref([
- { text: '样品编号', value: 'sampleNo', align: 'center', width: '170', required: false },
- { text: '样品名称', value: 'sampleName', align: 'center', required: false },
- { text: '型号', value: 'sampleModel', align: 'center', required: false },
- { text: '出厂编号', value: 'manufacturingNo', align: 'center', required: false },
- { text: '检定项目', value: 'measureContent', align: 'center', required: false },
- { text: '标价(元)', value: 'price', align: 'center', required: true, reg: validateMoney },
-])
// 表单校验规则
const rules = reactive({
- orderCode: [{ required: true, message: '委托书编号必填', trigger: 'blur' }],
- price: [{ required: true, message: '标价必填', trigger: ['blur', 'change'] },
- { pattern: /(^-?\d\d*\.\d*$)|(^-?\d\d*$)|(^-?\.\d\d*$)/, message: '标价只能为数字', trigger: ['blur', 'change'] }],
- suggestedDiscount: [{ required: true, message: '建议折扣必填', trigger: ['blur', 'change'] },
- { pattern: /^([0]|[1-9][0-9]*)$/, message: '建议折扣只能为正整数或0', trigger: ['blur', 'change'] }],
- extraCharge: [{ required: true, message: '附加费用必填', trigger: ['blur', 'change'] },
- { pattern: /(^[0-9](\d+)?(\.\d{1,2})?$)|(^\d\.\d{1,2}$)/, message: '要求不小于0,且最多保留两位小数', trigger: ['blur', 'change'] }],
- extraChargeIllustration: [{ required: true, message: '附加费用说明必填', trigger: 'blur' }],
+ orderCode: [{ required: true, message: '委托单编号必填', trigger: 'blur' }],
+ customerName: [{ required: true, message: '委托方名称必填', trigger: 'blur' }],
+ orderTime: [{ required: true, message: '委托日期必填', trigger: 'blur' }],
+ sampleCount: [{ required: true, message: '样品数量必填', trigger: 'blur' }],
+ certificationCompany: [{ required: true, message: '证书单位名称必填', trigger: 'blur' }],
+ certificationCompanyAddress: [{ required: true, message: '证书单位地址必填', trigger: 'blur' }],
+ deliverer: [{ required: true, message: '联系人必填', trigger: 'blur' }],
+ delivererTel: [{ required: true, message: '联系电话必填', trigger: 'blur' }],
+ sampleWarehouse: [{ required: true, message: '样品库房必填', trigger: 'blur' }],
+ certWarehouse: [{ required: true, message: '证书库房必填', trigger: 'blur' }],
+ feeStatus: [{ required: true, message: '费用状态必填', trigger: 'blur' }],
+ received: [{ required: true, message: '是否到账必填', trigger: 'blur' }],
+ actualTestFee: [{ required: true, message: '检测费(实)(元)必填', trigger: 'blur' }],
+ shouldTestFee: [{ required: true, message: '检测费(应)(元)必填', trigger: 'blur' }],
+ actualTotalFee: [{ required: true, message: '实收合计(元)必填', trigger: 'blur' }],
+ receivedAmount: [{ required: true, message: '到账金额(元)必填', trigger: 'blur' }],
+ invoiceAmount: [{ required: true, message: '开票金额(元)必填', trigger: 'blur' }],
})
+const ruleFormRef = ref() as any
+const orderVisible = ref(false) // 控制委托书对话框显隐
// ---------------------------------------路由参数--------------------------------------
if ($route.params && $route.params.type) {
pageType.value = $route.params.type as string
infoId.value = $route.params.id as string
}
+// ---------------------------------------字典--------------------------------------
+
+const financeSampleWarehouseList = ref([]) // 样品库房
+const financeCertWarehouseList = ref([]) // 证书库房
+const financeReceivedList = ref([]) // 是否到账
+// 获取字典值
+function getDict() {
+ // 样品库房
+ getDictByCode('financeSampleWarehouse').then((response) => {
+ financeSampleWarehouseList.value = response.data
+ })
+ // 证书库房
+ getDictByCode('financeCertWarehouse').then((response) => {
+ financeCertWarehouseList.value = response.data
+ })
+ // 是否到账
+ getDictByCode('financeReceived').then((response) => {
+ financeReceivedList.value = response.data
+ })
+}
+getDict()
+// -----------------------------------到账金额明细--------------------------------------------------
+const receivedAmountList = ref([]) as any // 到账金额明细
+const checkoutReceivedAmountList = ref([]) as any // 到账金额明细多选
+// 表头
+const receivedAmountcolumns = ref([
+ { text: '到账金额(元)', value: 'money', align: 'center', width: '220', required: true },
+ { text: '到账时间', value: 'moneyTime', align: 'center', width: '220', required: true },
+ { text: '附件', value: 'attachment', align: 'center', required: false },
+])
+
+// -------------------------------------开票金额明细--------------------------------------------------------------
+const invoiceAmountList = ref([]) as any // 开票金额明细
+const checkoutInvoiceAmountList = ref([]) as any // 开票金额明细多选
+// 表头
+const invoiceAmountcolumns = ref([
+ { text: '开票金额(元)', value: 'money', align: 'center', width: '220', required: true },
+ { text: '开票时间', value: 'moneyTime', align: 'center', width: '220', required: true },
+ { text: '附件', value: 'attachment', align: 'center', required: false },
+])
+
+// 多选发生改变时
+const handleSelectionChange = (e: any, type: 'addReceived' | 'invoiceAmount') => {
+ if (type === 'addReceived') { // 到账金额明细
+ checkoutReceivedAmountList.value = e
+ }
+ else { // 开票金额明细
+ checkoutInvoiceAmountList.value = e
+ }
+}
+
+// 点击增加行
+const addRow = (type: 'addReceived' | 'invoiceAmount') => {
+ if (type === 'addReceived') {
+ if (useCheckList(receivedAmountList.value, receivedAmountcolumns.value, '到账金额明细')) {
+ receivedAmountList.value.push({
+ money: undefined,
+ moneyTime: '',
+ attachment: [],
+ moneyType: '1',
+ })
+ }
+ }
+ else {
+ if (useCheckList(invoiceAmountList.value, invoiceAmountcolumns.value, '开票金额明细')) {
+ invoiceAmountList.value.push({
+ money: undefined,
+ moneyTime: '',
+ attachment: [],
+ moneyType: '2',
+ })
+ }
+ }
+}
+
+// 删除行
+const delRow = (type: 'addReceived' | 'invoiceAmount') => {
+ if ((type === 'addReceived' && checkoutReceivedAmountList.value.length <= 0) || (type === 'invoiceAmount' && checkoutInvoiceAmountList.value.length <= 0)) {
+ ElMessage({
+ message: '请选中要删除的行',
+ type: 'warning',
+ })
+ }
+ else {
+ if (type === 'addReceived') {
+ receivedAmountList.value = receivedAmountList.value.filter(
+ (item: any) => {
+ return !checkoutReceivedAmountList.value.includes(item)
+ },
+ )
+ }
+ else {
+ invoiceAmountList.value = invoiceAmountList.value.filter(
+ (item: any) => {
+ return !checkoutInvoiceAmountList.value.includes(item)
+ },
+ )
+ }
+ }
+}
+
+// ----------------------------------------上传附件----------------------------------------------------
+// 删除附件
+const del = (index: number, row: any) => {
+ row.value.attachment.splice(index, 1)
+}
+
+const fileRef = ref() // 文件上传input
+const onFileChange = (event: any, row?: any, type?: 'receivedAmount' | 'invoiceAmount') => {
+ // 原生上传
+ console.log(event.target.files)
+ const files = event.target.files
+ if (files.length !== 0) {
+ // 创建formdata对象
+ const fd = new FormData()
+ for (var i = 0; i < files.length; i++) {
+ fd.append('multipartFile', files[i])
+ }
+ UploadFile(fd).then((res) => {
+ if (res.code === 200) {
+ res.data.forEach((item: string) => {
+ row.attachment.push({
+ minioFileName: item,
+ })
+ })
+ ElMessage.success('文件上传成功')
+ }
+ else {
+ ElMessage.error(res.message)
+ }
+ })
+ }
+}
+const upload = () => {
+ fileRef.value.click()
+}
+// ------------------------------------结算明细--------------------------------------------------------------------
+const list = ref([]) // 开票金额明细
+// 表头
+const columns = ref([
+ { text: '器具名称', value: 'sampleName', align: 'center', required: true, type: 'text' },
+ { text: '型号规格', value: 'sampleModel', align: 'center', width: '180', required: true, type: 'input' },
+ { text: '套数/退', value: 'sets', align: 'center', required: true, width: '180', type: 'inputNumber' },
+ { text: '出厂编号', value: 'manufacturingNo', align: 'center', width: '180', required: true, type: 'input' },
+ { text: '委托日期', value: 'orderTime', align: 'center', required: true, width: '160', type: 'date' },
+ { text: '检测规范', value: 'accordStandard', align: 'center', width: '180', required: false, type: 'input' },
+ {
+ text: '收费(元)含6%增值税',
+ value: 'price',
+ align: 'center',
+ required: false,
+ children: [
+ { text: '检测费(应)', value: 'shouldTestFee', align: 'center', width: '180', required: true, type: 'inputNumber' },
+ { text: '检测费(实)', value: 'actualTestFee', align: 'center', required: true, width: '180', type: 'inputNumber' },
+ { text: '附加费', value: 'extraFee', align: 'center', required: false, width: '180', type: 'inputNumber' },
+ { text: '修理费', value: 'repairFee', align: 'center', required: false, width: '180', type: 'inputNumber' },
+ { text: '其他费', value: 'otherFee', align: 'center', required: false, width: '180', type: 'inputNumber' },
+ { text: '小计', value: 'subtotal', align: 'center', required: false, type: 'text' },
+ ],
+ },
+])
+
// ------------------------------------委托书---------------------------------------------
// 点击选择委托书编号
const handleClickOrder = () => {
@@ -87,87 +253,63 @@
// 选好委托书
const confirmCheckoutOrder = (val: Array) => {
if (val && val.length) {
- form.value.priceFront = 0 // 标价
- // form.value.suggestedDiscount = 95 // 建议折扣
- form.value.suggestedPrice = 0 // 建议价格
- form.value.extraCharge = 0// 附加费用-单位分
- form.value.extraChargeIllustration = '' // 附加费用说明
- form.value.totalSettlement = 0 // 总计结算费用
getOrderDetail({ id: val[0].id }).then((res) => { // 样品清单
form.value.orderCode = res.data.orderCode // 委托书编号
form.value.orderId = res.data.id // 委托书id
- form.value.deliverer = res.data.deliverer // 送检人
- form.value.delivererTel = res.data.delivererTel // 送检人
- form.value.createTime = res.data.createTime // 委托单创建时间
- form.value.customerNo = res.data.customerNo // 委托方代码
- form.value.customerId = res.data.customerId // 委托方id
form.value.customerName = res.data.customerName // 委托方名称
- form.value.planDeliverTime = res.data.planDeliverTime // 预计送达时间
- form.value.requireOverTime = res.data.requireOverTime // 要求检完时间
- form.value.phone = res.data.customerPhone // 委托方电话
- list.value = res.data.customerSampleInfoList.map((item: { isEdit: boolean }) => {
+ form.value.orderTime = res.data.createTime // 委托日期(委托单创建时间)
+ form.value.certificationCompany = res.data.certificationCompany // 证书单位名称
+ form.value.certificationCompanyAddress = res.data.certificationCompanyAddress // 证书单位地址
+ form.value.deliverer = res.data.deliverer // 联系人
+ form.value.delivererTel = res.data.delivererTel // 联系方式
+ form.value.sampleCount = res.data.customerSampleInfoList.length // 样品数量
+ list.value = res.data.customerSampleInfoList.map((item: { createTime: string; editable: boolean }) => {
return {
...item,
- isEdit: true,
+ orderTime: item.createTime ? dayjs(item.createTime).format('YYYY-MM-DD') : item.createTime, // 委托日期
+ editable: pageType.value !== 'detail',
+ shouldTestFee: 0, // 检测费(应)
+ actualTestFee: 0, // 检测费(实)
+ extraFee: 0, // 附加费
+ repairFee: 0, // 修理费
+ otherFee: 0, // 其他费
+ sets: 0, // 套数
+ subtotal: 0, // 小计
+ id: '',
}
})
})
}
}
-// -----------------------------------------样品清单--------------------------------------------
-// 检查列表
-function checkSampleList() {
- for (let index = 0; index < list.value.length; index++) {
- const item = list.value[index]
- for (const prop of columns.value) {
- // 检查必填
- if (prop.required && !item[prop.value]) {
- ElMessage.warning(`请先完善第${index + 1}行中${prop.text}`)
- return false
- }
- // 验证正则
- if (prop.reg && typeof prop.reg === 'function') {
- if (!prop.reg(item[prop.value])) {
- // ElMessage.warning(`第${index + 1}行中${prop.text}输入不合法`)
- ElMessage.warning(`第${index + 1}行: 要求标价为正数,且最多保留两位小数`)
- return false
- }
- }
- }
- }
- return true
-}
+// --------------------------------------------计算----------------------------------------------
+// 计算
+const handleInputNumberChange = ({ row }: any) => {
+ // 计算小计
+ row.subtotal = calc(Number(calc(Number(calc(Number(calc(Number(row.shouldTestFee), Number(row.actualTestFee), '+')), row.extraFee, '+')), row.repairFee, '+')), row.otherFee, '+')
+ // 计算检测费(应)(元)
+ form.value.shouldTestFee = list.value.reduce((accumulator, current: any) => accumulator + current.shouldTestFee, 0)
+ // 计算检测费(实)(元)
+ form.value.actualTestFee = list.value.reduce((accumulator, current: any) => accumulator + current.actualTestFee, 0)
+ // 实收合计
+ form.value.actualTotalFee = list.value.reduce((accumulator, current: any) => accumulator + current.subtotal, 0)
-// --------------------------------------------自动计算----------------------------------------------
-// 折扣改变-计算建议价格
-const changeSuggestedDiscount = () => {
- console.log('折扣改变')
- if (form.value.priceFront) {
- form.value.suggestedPrice = calc(Number(form.value.priceFront), Number(form.value.suggestedDiscount / 100), '*') as number
- form.value.suggestedPrice = Number(form.value.suggestedPrice.toFixed(2))
+ if (list.value.every((item: { actualTestFee: number }) => item.actualTestFee === 0 || `${item.actualTestFee}` === 'undefined' || `${item.actualTestFee}` === 'null' || `${item.actualTestFee}` === '')) {
+ form.value.feeStatus = '未录费'
+ }
+ else if (list.value.every((item: { actualTestFee: number }) => item.actualTestFee !== 0 || `${item.actualTestFee}` === 'undefined' || `${item.actualTestFee}` === 'null' || `${item.actualTestFee}` === '')) {
+ form.value.feeStatus = '已录费'
+ }
+ else {
+ form.value.feeStatus = '部分录费'
}
}
-// 标价改变
-const changePrice = () => {
- console.log('标价改变')
- let sum = 0
- list.value.forEach((item) => {
- if (item.price) {
- sum = calc(Number(sum), Number(item.price), '+') as number
- }
- })
- form.value.priceFront = sum
- changeSuggestedDiscount() // 建议价格随之变化
+const changeTableInputNumber = () => {
+ // 到账金额
+ form.value.receivedAmount = receivedAmountList.value.reduce((accumulator: any, current: any) => accumulator + current.money, 0)
+ // 开票金额
+ form.value.invoiceAmount = invoiceAmountList.value.reduce((accumulator: any, current: any) => accumulator + current.money, 0)
}
-// 附加费用改变
-const changeExtraCharge = () => {
- console.log('附加费用改变')
- form.value.totalSettlement = calc(Number(form.value.suggestedPrice), Number(form.value.extraCharge), '+') as number
-}
-watch(() => form.value.suggestedPrice, (newValue) => {
- changeExtraCharge()
-})
// ----------------------------------------------------------------------------------------
const $router = useRouter()
@@ -176,9 +318,35 @@
$router.back()
}
+// 校验表格
+const checkList = () => {
+ if (!receivedAmountList.value.length) {
+ ElMessage.warning('到账金额明细不能为空')
+ return false
+ }
+ if (!invoiceAmountList.value.length) {
+ ElMessage.warning('开票金额明细不能为空')
+ return false
+ }
+ if (!list.value.length) {
+ ElMessage.warning('结算明细不能为空')
+ return false
+ }
+ if (!useCheckList(receivedAmountList.value, receivedAmountcolumns.value, '到账金额明细')) {
+ return false
+ }
+ if (!useCheckList(invoiceAmountList.value, invoiceAmountcolumns.value, '开票金额明细')) {
+ return false
+ }
+ if (!useCheckList(list.value, columns.value, '结算明细')) {
+ return false
+ }
+ return true
+}
+
// 保存
const save = () => {
- if (!checkSampleList()) {
+ if (!checkList()) {
return false
}
ruleFormRef.value.validate((valid: boolean) => {
@@ -188,17 +356,10 @@
background: 'rgba(255, 255, 255, 0.8)',
})
const params = {
- extraCharge: calc(Number(form.value.extraCharge), 100, '*'), // 附加费用-单位分
- extraChargeIllustration: form.value.extraChargeIllustration, // 附加费用说明
id: infoId.value,
- orderId: form.value.orderId, // 委托书id
- suggestedDiscount: form.value.suggestedDiscount, // 建议折扣-单位%
- samplePriceList: list.value.map((item) => {
- return {
- price: calc(Number(item.price), 100, '*'), // 标价-单位分
- relationId: item.relationId, // 样品id
- }
- }), // 样品清单
+ ...form.value,
+ amountDetailsList: receivedAmountList.value.concat(invoiceAmountList.value),
+ sampleList: list.value,
}
// 新建
if (pageType.value === 'add') {
@@ -229,24 +390,22 @@
// 编辑、详情--获取详细信息
const fetchDetail = () => {
+ const loading = ElLoading.service({})
getBusinessSettlementDetail({ id: infoId.value }).then((res) => {
form.value = res.data
- form.value.phone = res.data.customerPhone
- list.value = res.data.sampleList.map((item: { postedPrice: number; id: string }) => {
+ receivedAmountList.value = res.data.amountDetailsList.filter((item: { moneyType: string }) => `${item.moneyType}` === '1')
+ invoiceAmountList.value = res.data.amountDetailsList.filter((item: { moneyType: string }) => `${item.moneyType}` === '2')
+ list.value = res.data.sampleDetailsList.map((item: { editable: boolean; orderTime: string }) => {
return {
...item,
- price: calc(Number(item.postedPrice), 100, '/') as number,
- isEdit: pageType.value === 'edit',
- relationId: item.id,
+ editable: pageType.value !== 'detail',
+ orderTime: item.orderTime ? dayjs(item.orderTime).format('YYYY-MM-DD') : item.orderTime,
}
})
- form.value.priceFront = calc(Number(res.data.postedPrice), 100, '/') as number // 标价
- // form.value.suggestedDiscount = // 建议折扣
- form.value.suggestedPrice = calc(Number(res.data.suggestedPrice), 100, '/') as number// 建议价格
- form.value.extraCharge = calc(Number(res.data.extraCharge), 100, '/') as number// 附加费用-单位分
- // form.value.extraChargeIllustration = // 附加费用说明
- form.value.totalSettlement = calc(Number(res.data.totalSettlement), 100, '/') as number // 总计结算费用
- })
+ form.value.orderTime = res.data.sampleDetailsList[0].orderTime // 委托日期
+ form.value.sampleCount = res.data.sampleDetailsList.length // 样品数量
+ loading.close()
+ }).catch(() => loading.close())
}
onMounted(() => {
@@ -278,10 +437,10 @@
>
-
+
@@ -294,51 +453,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -467,17 +645,26 @@
-
-
+
+
+
+ 增加行
+
+
+ 删除行
+
+
handleSelectionChange(e, 'addReceived')"
>
+
*{{ item.text }}
-
-
-
- {{ scope.row[item.value] }}
+
+
+
+
+ {{ '上传' }}
+
+
+
+ ×
+
+
+
onFileChange(e, scope.row, 'receivedAmount')">
+
+
+
+
+ 增加行
+
+
+ 删除行
+
+
+ handleSelectionChange(e, 'invoiceAmount')"
+ >
+
+
+
+
+ *{{ item.text }}
+
+
+
+
+
+
+
+ {{ '上传' }}
+
+
+
+ ×
+
+
+
onFileChange(e, scope.row, 'receivedAmount')">
+
+
+
+
+
+
+
+
diff --git a/src/api/business/lab/measureData.ts b/src/api/business/lab/measureData.ts
new file mode 100644
index 0000000..ab3a56e
--- /dev/null
+++ b/src/api/business/lab/measureData.ts
@@ -0,0 +1,78 @@
+/**
+ * 计量数据管理
+*/
+import request from '../../index'
+
+// 计量数据管理列表
+export function getMeasureDataList(data: { offset: number; limit: number }) {
+ return request({
+ url: `/business/certificateReport/approval/listPage?offset=${data.offset}&limit=${data.limit}`,
+ method: 'post',
+ data,
+ })
+}
+
+// 点击下载模板后生成证书
+export function downLoadTemplate(data: any) {
+ return request({
+ url: '/business/certificateReport/exportFile',
+ method: 'post',
+ data,
+ responseType: 'blob',
+ })
+}
+
+// 新增
+export function addMeasureData(data: any) {
+ return request({
+ url: '/business/certificateReport/save',
+ method: 'post',
+ data,
+ })
+}
+
+// 草稿箱更新
+export function draftUpdateMeasureData(data: any) {
+ return request({
+ url: '/business/certificateReport/draftUpdate',
+ method: 'post',
+ data,
+ })
+}
+
+// 未通过-驳回编辑
+export function failUpdateMeasureData(data: any) {
+ return request({
+ url: '/business/certificateReport/failUpdate',
+ method: 'post',
+ data,
+ })
+}
+
+// 提交
+export function submit(data: { formId: string; processId?: string; id: string }) {
+ return request({
+ url: '/business/certificateReport/submit',
+ method: 'post',
+ data,
+ })
+}
+
+// 详情
+export function getMeasureDataDetail(data: { id: string }) {
+ return request({
+ url: '/business/certificateReport/detail',
+ method: 'post',
+ data,
+ })
+}
+
+// 删除
+export function deleteMeasureData(data: any) {
+ return request({
+ url: '/business/certificateReport/batchDelete',
+ method: 'post',
+ data,
+ })
+}
+
diff --git a/src/api/business/subpackage/apply.ts b/src/api/business/subpackage/apply.ts
index ad17a5a..c778f8e 100644
--- a/src/api/business/subpackage/apply.ts
+++ b/src/api/business/subpackage/apply.ts
@@ -94,3 +94,4 @@
data,
})
}
+
diff --git a/src/api/system/tool.ts b/src/api/system/tool.ts
index 6b2f5f2..8223e4c 100644
--- a/src/api/system/tool.ts
+++ b/src/api/system/tool.ts
@@ -67,19 +67,10 @@
data,
})
}
-// 原始记录模板/证书报告模板列表(分页)
-export interface listParamsType {
- templateNo: string // 编号
- templateName: string // 名称
- templateCreator: string // 负责人
- // createTime: string // 创建时间
- limit: number
- offset: number
- templateType: string
-}
-export function templatePage(data: listParamsType) {
+
+export function templatePage(data: any) {
return request({
- url: `${prefix}/template/listPage?limit=${data.limit}&offset=${data.offset}`,
+ url: `${prefix}template/listPage?limit=${data.limit}&offset=${data.offset}`,
method: 'post',
data,
})
@@ -87,7 +78,7 @@
// 原始记录模板/证书报告模板列表/详情(
export function templatePageDetail(data: object) {
return request({
- url: `${prefix}/template/detail`,
+ url: `${prefix}template/detail`,
method: 'post',
data,
})
@@ -95,7 +86,7 @@
// 原始记录模板/证书报告模板列表删除
export function templateDelete(data: object) {
return request({
- url: `${prefix}/template/delete`,
+ url: `${prefix}template/delete`,
method: 'post',
data,
})
@@ -103,7 +94,7 @@
// 原始记录模板/证书报告模板列表新建
export function templateAdd(data: object) {
return request({
- url: `${prefix}/template/add`,
+ url: `${prefix}template/add`,
method: 'post',
data,
})
@@ -111,7 +102,7 @@
// 原始记录模板/证书报告模板列表更新
export function templateUpdate(data: object) {
return request({
- url: `${prefix}/template/update`,
+ url: `${prefix}template/update`,
method: 'post',
data,
})
@@ -119,7 +110,7 @@
// 原始记录模板/证书报告模板列表导出
export function templateExport(data: object) {
return request({
- url: `${prefix}/template/listExport`,
+ url: `${prefix}template/listExport`,
method: 'post',
data,
responseType: 'blob',
diff --git a/src/components.d.ts b/src/components.d.ts
index edc2e04..64cf608 100644
--- a/src/components.d.ts
+++ b/src/components.d.ts
@@ -46,6 +46,7 @@
ImageUpload: typeof import('./components/ImageUpload/index.vue')['default']
LineChart: typeof import('./components/Echart/LineChart.vue')['default']
MeasureRecords: typeof import('./components/Sample/measureRecords.vue')['default']
+ MultiHeaderTable: typeof import('./components/MultiHeaderTable/index.vue')['default']
NodeWrap: typeof import('./components/workFlow/nodeWrap.vue')['default']
NodeWrapBan: typeof import('./components/workFlow/nodeWrapBan.vue')['default']
NormalTable: typeof import('./components/NormalTable/index.vue')['default']
@@ -67,6 +68,7 @@
SelectStaffDialog: typeof import('./components/dialog/selectStaffDialog.vue')['default']
SvgIcon: typeof import('./components/SvgIcon/index.vue')['default']
SystemInfo: typeof import('./components/SystemInfo/index.vue')['default']
+ TableColumn: typeof import('./components/MultiHeaderTable/tableColumn.vue')['default']
TableContainer: typeof import('./components/TableContainer/index.vue')['default']
Trend: typeof import('./components/Trend/index.vue')['default']
WordOreview: typeof import('./components/filePreview/wordOreview.vue')['default']
diff --git a/src/components/MultiHeaderTable/index.vue b/src/components/MultiHeaderTable/index.vue
new file mode 100644
index 0000000..85b8c88
--- /dev/null
+++ b/src/components/MultiHeaderTable/index.vue
@@ -0,0 +1,343 @@
+
+
+
+
+
+
+
diff --git a/src/components/MultiHeaderTable/tableColumn.vue b/src/components/MultiHeaderTable/tableColumn.vue
new file mode 100644
index 0000000..2b87285
--- /dev/null
+++ b/src/components/MultiHeaderTable/tableColumn.vue
@@ -0,0 +1,147 @@
+
+
+
+
+
+
+
+
+
+
+ *{{ item.text }}
+
+
+ *{{ item.text }}
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ scope.row[item.value] }}
+
+
+ {{
+ scope.row[item.value]
+ }}
+
+
+
+
+
+
diff --git a/src/components/NormalTable/index.vue b/src/components/NormalTable/index.vue
index e56f775..67092d3 100644
--- a/src/components/NormalTable/index.vue
+++ b/src/components/NormalTable/index.vue
@@ -3,6 +3,7 @@
import { ElTable } from 'element-plus'
import { defineExpose, ref } from 'vue'
import type { TableColumn } from './table_interface'
+import showPhoto from '@/views/system/tool/showPhoto.vue'
// ------------------定义props、 emit-------------------
const props = defineProps({
@@ -212,8 +213,8 @@
{{ scope.row[column.value] }}
{{ column.filter(scope.row) }}
- {{ scope.row }}
-
+
+
diff --git a/src/utils/useCheckList.ts b/src/utils/useCheckList.ts
new file mode 100644
index 0000000..c7782f0
--- /dev/null
+++ b/src/utils/useCheckList.ts
@@ -0,0 +1,73 @@
+import { ElMessage } from 'element-plus'
+// import type { TableColumn } from '@/components/NormalTable/table_interface'
+
+/**
+ * 检查列表
+ * @param list 要检查的表格数据(被依赖项如果满足某个条件就去检查依赖项,否则不检查依赖项)
+ * @param columns // 表头信息
+ * @param tableTitle // 表格名称
+ * @param depend // 依赖项
+ * @param depended // 被依赖项
+ * @param dependedValue // 被依赖项条件
+ * @param requireLength // 要检查的表格数据长度是否大于0
+ */
+export default function useCheckList(list: any, columns: any, tableTitle = '', depend?: string, depended?: string, dependedValue?: number | string, requireLength = false): boolean {
+ for (const prop of columns) {
+ for (let index = 0; index < list.length; index++) {
+ const item = list[index]
+
+ if (depend && depended && item[depended] === dependedValue && !(`${item[prop.value]}`)) { // 被依赖项满足条件时需要检查
+ ElMessage.warning(`请先完善 ${tableTitle} 第${index + 1}行中 ${prop.text} 字段`)
+ return false
+ }
+ else {
+ // 检查必填
+ if (prop.required && (!(`${item[prop.value]}`) || `${item[prop.value]}` === 'null' || `${item[prop.value]}` === 'undefined' || item[prop.value] == undefined)) {
+ if (`${prop.belongStandardEquipment}` === '15') { // 小功率
+ ElMessage.warning(`${tableTitle} 第${index + 1}行中 ${prop.message} ${prop.text} 字段不能为空`)
+ }
+ else {
+ ElMessage.warning(`请先完善 ${tableTitle} 第${index + 1}行中 ${prop.text} 字段`)
+ }
+ return false
+ }
+ }
+
+ // 验证正则
+ if (prop.reg && typeof prop.reg === 'function') {
+ if (prop.value === 'resolution') { // 分辨力特殊处理
+ if (!prop.reg(item[prop.value])) {
+ ElMessage.warning(`${tableTitle} 第${index + 1}行中 ${prop.text} 不能大于1`)
+ return false
+ }
+ }
+ else {
+ if (!prop.reg(item[prop.value])) {
+ if (`${prop.belongStandardEquipment}` === '15') { // 小功率
+ ElMessage.warning(`${tableTitle} 第${index + 1}行中 ${prop.message} ${prop.text} 字段不能为0`)
+ }
+ else if (`${prop.belongStandardEquipment}` === '17') { // S参数
+ ElMessage.warning(`${tableTitle} 第${index + 1}行中 ${prop.text} 仅允许输入数字、字母、特殊字符`)
+ }
+ else {
+ ElMessage.warning(`${tableTitle} 第${index + 1}行中 ${prop.text} 字段输入不合法`)
+ }
+ return false
+ }
+ }
+ }
+
+ if (prop.children && prop.children.length) {
+ if (!useCheckList(list, prop.children, tableTitle, depend, depended, dependedValue)) {
+ return false
+ }
+ }
+ }
+ }
+
+ if (requireLength && !list.length) {
+ ElMessage.warning(`${tableTitle}表格数据不能为空`)
+ return false
+ }
+ return true
+}
diff --git a/src/views/business/lab/components/selectOrderSamplesDialog.vue b/src/views/business/lab/components/selectOrderSamplesDialog.vue
index 4002f83..b004107 100644
--- a/src/views/business/lab/components/selectOrderSamplesDialog.vue
+++ b/src/views/business/lab/components/selectOrderSamplesDialog.vue
@@ -14,6 +14,7 @@
const loadingTable = ref(false) // loading
const list = ref([]) // 表格参数
const tableRef = ref()
+const isMulti = ref(true) // 是否多选默认为多选
const columns = ref
([
{ text: '被测样品名称', value: 'sampleName', align: 'center', required: true },
{ text: '型号规格', value: 'sampleModel', align: 'center', required: true },
@@ -60,9 +61,10 @@
}
// 初始化
-const initDialog = (orderIdParam: string) => {
+const initDialog = (orderIdParam: string, isMultiParam = true) => {
dialogFormVisible.value = true
orderId.value = orderIdParam
+ isMulti.value = isMultiParam
getList()
}
defineExpose({ initDialog })
@@ -78,7 +80,7 @@
:columns="columns"
is-showmulti-select
:list-loading="loadingTable"
- :is-multi="true"
+ :is-multi="isMulti"
:height="300"
:pagination="false"
@multi-select="handleSelectionChange"
diff --git a/src/views/business/lab/components/selectReportTemplate.vue b/src/views/business/lab/components/selectReportTemplate.vue
index 5c59693..ec36ef7 100644
--- a/src/views/business/lab/components/selectReportTemplate.vue
+++ b/src/views/business/lab/components/selectReportTemplate.vue
@@ -7,8 +7,9 @@
import type { typeofSign } from '@/views/system/tool/tool_interface'
import { templatePage } from '@/api/system/tool'
-const emits = defineEmits(['add'])
+const emits = defineEmits(['confirm'])
const dialogFormVisible = ref(false) // 控制弹窗显隐
+const createTime = ref()
// 查询参数
const searchQuery = reactive({
templateNo: '', // 编号
@@ -18,31 +19,43 @@
createEndTime: '',
limit: 5,
offset: 1,
- templateType: '',
+ certificationType: '0',
ids: [] as string[],
}) // 查询参数
const loadingTable = ref(false) // loading
const list = ref([]) // 表格参数
const total = ref(0)
const columns = ref([
- { text: '编号', value: 'templateNo', align: 'center', width: '180' },
- { text: '模板名称', value: 'templateName', align: 'center', width: '150' },
- { text: '模板负责人', value: 'templateCreator', align: 'center', width: '100' },
- { text: '创建时间', value: 'createTime', align: 'center', width: '250' },
- { text: '描述', value: 'templateDesc', align: 'center' },
+ { text: '编号', value: 'templateNo', align: 'center', width: '160' },
+ { text: '模板名称', value: 'templateName', align: 'center' },
+ { text: '模板类型', value: 'templateTypeName', align: 'center', width: '100' },
+ { text: '负责人', value: 'templateCreator', align: 'center', width: '100' },
+ { text: '内容描述', value: 'templateDesc', align: 'center' },
+ { text: '创建时间', value: 'createTime', align: 'center', width: '180' },
])
const checkoutList = ref([]) // 多选选中参数
-// 获取类型
-const getType = async () => {
- const res = await getDictByCode('templateType')
- searchQuery.templateType = res.data.filter((item: typeofSign) => item.name === '证书报告模板')[0].value
+// ---------------------------------------字典--------------------------------------------
+const templateTypeMap = ref([]) as any // 模板类型
+// 获取字典值
+async function getDict() {
+ // 模板类型
+ const res = await getDictByCode('certificationType')
+ res.data.forEach((item: { value: string; name: string }) => {
+ templateTypeMap.value[`${item.value}`] = item.name
+ })
}
+// ----------------------------------------------------------------------------------------------
// 获取数据列表
const getList = () => {
loadingTable.value = true
templatePage(searchQuery).then((res) => {
if (res.code === 200) {
- list.value = res.data.rows
+ list.value = res.data.rows.map((item: { certificationType: string }) => {
+ return {
+ ...item,
+ templateTypeName: `${item.certificationType}` ? templateTypeMap.value[item.certificationType] : item.certificationType, // 模板类型
+ }
+ })
total.value = res.data.total
}
loadingTable.value = false
@@ -74,7 +87,8 @@
searchQuery.createEndTime = ''
searchQuery.limit = 5
searchQuery.offset = 1
- // searchQuery.templateType = '' // 类型不能变
+ searchQuery.certificationType = '0'
+ createTime.value = ''
searchQuery.ids = []
getList()
}
@@ -82,10 +96,10 @@
// 点击保存
const submitForm = () => {
if (!checkoutList.value.length) {
- ElMessage.warning('请选择证书报告模板')
+ ElMessage.warning('请选择证书模板')
}
else {
- emits('add', checkoutList.value[0])
+ emits('confirm', checkoutList.value[0])
dialogFormVisible.value = false
}
}
@@ -103,15 +117,25 @@
// 初始化
const initDialog = () => {
dialogFormVisible.value = true
- getType().then((_) => {
+ getDict().then((_) => {
getList()
})
}
+watch(() => createTime.value, (newVal) => {
+ if (newVal) {
+ searchQuery.createStartTime = newVal[0]
+ searchQuery.createEndTime = newVal[1]
+ }
+ else {
+ searchQuery.createStartTime = ''
+ searchQuery.createEndTime = ''
+ }
+})
defineExpose({ initDialog })
-
+
@@ -121,7 +145,18 @@
-
+
+
+
+
diff --git a/src/views/business/lab/measureData/dialog/selectMeasueDataDialog.vue b/src/views/business/lab/measureData/dialog/selectMeasueDataDialog.vue
new file mode 100644
index 0000000..f8be703
--- /dev/null
+++ b/src/views/business/lab/measureData/dialog/selectMeasueDataDialog.vue
@@ -0,0 +1,199 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ (listQuery.offset - 1) * listQuery.limit + scope.$index + 1 }}
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/views/business/lab/measureData/dialog/selectTechFilesDialog.vue b/src/views/business/lab/measureData/dialog/selectTechFilesDialog.vue
new file mode 100644
index 0000000..f6f1a5a
--- /dev/null
+++ b/src/views/business/lab/measureData/dialog/selectTechFilesDialog.vue
@@ -0,0 +1,247 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ (listQuery.offset - 1) * listQuery.limit + scope.$index + 1 }}
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/views/business/lab/measureData/measureData-interface.ts b/src/views/business/lab/measureData/measureData-interface.ts
index 8319f65..d25a212 100644
--- a/src/views/business/lab/measureData/measureData-interface.ts
+++ b/src/views/business/lab/measureData/measureData-interface.ts
@@ -1,13 +1,14 @@
// 查询条件
export interface IListQuery {
- approvalStatus: string // 审批状态
- certificateReportCode: string // 证书编号
- certificateReportName: string // 证书名称
- customerName: string // 委托方名称
- sampleName: string // 样品名称
- measureCategory: string // 检校类别
- approvalStatusName: string // 审批状态名称
- formId: string
+ approvalStatus: string // 审批状态类型code
+ certificateReportCode: string // 证书编号
+ certificateReportName: string // 证书名称
+ customerName: string // 委托方名称
+ formId: string // 表单id(流程定义对应的表单id,等价于业务id)
+ measureCategory: string // 检校类别
+ orderCode: string // 委托书编号
+ sampleName: string // 样品名称
+ sampleNo: string // 样品编号
offset: number
limit: number
}
@@ -28,47 +29,53 @@
calibrationTime: string // 检校日期
taskId?: string // 任务id 用于审批
decisionItem?: string
- applyApprovalStatusName?: string // 审批状态名称
+ approvalStatusName?: string // 审批状态名称
processId?: string // 流程实例id
}
// 表单
export interface IForm {
- tdysczs: number // 替代已生成证书
+ id?: string
+ invalid: number // 替代已生成证书
formId: string
- yzs: string // 原证书
+ oldCertificateCode: string // 原证书
calibrationMajor: string // 检校专业
- certifications: string // 证书类别
+ calibrationMajorName: string // 检校专业名称
+ certificateReportCategory: string // 证书类别
+ certificateReportCategoryName: string // 证书类别名称
certificateReportCode: string // 证书编号
certificateReportName: string // 证书名称
- jdy: string // 检定员
- jjrq: string // 检校日期
+ measurePerson: string // 检定员
+ measurePersonId: string // 检定员id
+ calibrationTime: string // 检校日期
orderCode: string // 委托书
orderId: string // 委托书id
customerId?: string // 委托放id
customerName: string // 委托方名称
+ customerAddress: string // 委托方地址
certificationCompany: string // 证书单位名称
certificationCompanyAddress: string // 证书单位地址
calibrationPlace: string // 检校地点
- fjsj: string // 复校时间
- jssj: string // 接收时间
- jdjg: string // 检定结果
- environmentCode: string// 环境记录单编号
+ repeatTime: string // 复校时间
+ deliverTime: string // 接收时间
+ measureResult: string // 检定结果
+ environmentCode: string // 环境记录单编号
environmentId: string // 环境记录单id
temperature: string // 温度
humidity: string // 湿度
+ techFilesName: string // 依据的技术文件名称
signId: string // 电子签章id
signName: string // 电子签章名称
approvalSignIds: string // 认可标志专用章id
approvalSignName: string // 认可标志专用章名称
remark: string // 备注
- ywy: string // 业务员
+ busPersonId: string // 业务员id
+ busPersonName: string // 业务员名字
templateId: string // 证书模板
templateName: string // 证书模板
- templateNameFile: string // 证书模板文件
certificateReportFile: string // 证书报告附件
processId?: string // 流程实例id
@@ -76,6 +83,7 @@
// 被检样品
export interface ISampleList {
+ id: string // 样品id
sampleNo: string // 样品编号
sampleName: string // 样品名称
sampleModel: string // 型号
diff --git a/src/views/business/lab/measureData/measureDataDetail.vue b/src/views/business/lab/measureData/measureDataDetail.vue
index 4aa9717..c554c33 100644
--- a/src/views/business/lab/measureData/measureDataDetail.vue
+++ b/src/views/business/lab/measureData/measureDataDetail.vue
@@ -3,6 +3,7 @@
import { ElLoading, ElMessage, ElMessageBox } from 'element-plus'
import type { FormInstance, FormRules } from 'element-plus'
import { ref } from 'vue'
+import dayjs from 'dayjs'
import EnvironmentalDialog from '../components/environmentalDialog.vue'
import selectSignature from '../components/selectSignature.vue'
import selectReportTemplate from '../components/selectReportTemplate.vue'
@@ -10,10 +11,12 @@
import SelectSamplesDialog from '../components/selectSamplesDialog.vue'
import selectMeasureDevice from '../components/selectMeasureDevice.vue'
import type { IEquipmentList, IForm, ISampleList } from './measureData-interface'
+import selectMeasueDataDialog from './dialog/selectMeasueDataDialog.vue'
+import selectTechFilesDialog from './dialog/selectTechFilesDialog.vue'
import { UploadFile } from '@/api/measure/file'
import ApprovalDialog from '@/components/Approval/ApprovalDialog.vue'
import type { TableColumn } from '@/components/NormalTable/table_interface'
-import { addApply, detail, failUpdateApply, submit, updateApply } from '@/api/business/subpackage/apply'
+import { addMeasureData, downLoadTemplate, draftUpdateMeasureData, failUpdateMeasureData, getMeasureDataDetail, submit } from '@/api/business/lab/measureData'
import { cancelApproval, fetchApproval, submitApproval } from '@/api/approval'
import showPhoto from '@/views/system/tool/showPhoto.vue'
import { getDictByCode } from '@/api/system/dict'
@@ -21,6 +24,9 @@
import selectOrder from '@/views/business/schedule/interchangeReceipt/selectOrder.vue'
import { downloadFile } from '@/utils/download'
import type { dictType } from '@/global'
+import { getUserList } from '@/api/system/user'
+import { exportFile } from '@/utils/exportUtils'
+
const user = useUserStore() // 用户信息
const textMap: { [key: string]: string } = {
edit: '编辑',
@@ -31,6 +37,8 @@
const $router = useRouter() // 关闭页面使用
const $route = useRoute()
const query = $route.query
+console.log('opopopop', query)
+
const approvalDialog = ref() // 审批对话ref
const pageType = ref('add') // 页面类型: add, edit, detail
const infoId = ref('') // 列表id
@@ -38,57 +46,63 @@
const orderVisible = ref(false) // 控制委托单对话框显隐
const ruleFormRef = ref() as any
const form = ref({
- tdysczs: 0, // 替代已生成证书
+ invalid: 0, // 替代已生成证书
formId: query.formId as string,
- yzs: '', // 原证书
+ oldCertificateCode: '', // 原证书
calibrationMajor: '', // 检校专业
- certifications: '', // 证书类别
+ calibrationMajorName: '', // 检校专业名称
+ certificateReportCategory: '', // 证书类别
+ certificateReportCategoryName: '', // 证书类别名称
certificateReportCode: '', // 证书编号
certificateReportName: '', // 证书名称
- jdy: '', // 检定员
- jjrq: '', // 检校日期
+ measurePerson: '', // 检定员
+ measurePersonId: '', // 检定员id
+ calibrationTime: '', // 检校日期
- orderCode: '', // 委托单
+ orderCode: '', // 委托单编号
orderId: '', // 委托单id
customerName: '', // 委托方名称
+ customerAddress: '', // 委托方地址
certificationCompany: '', // 证书单位名称
certificationCompanyAddress: '', // 证书单位地址
calibrationPlace: '', // 检校地点
- fjsj: '', // 复校时间
- jssj: '', // 接收时间
- jdjg: '', // 检定结果
+ repeatTime: '', // 复校时间
+ deliverTime: '', // 接收时间
+ measureResult: '', // 检定结果
environmentCode: '', // 环境记录单编号
environmentId: '', // 环境记录单id
temperature: '', // 温度
humidity: '', // 湿度
+ techFilesName: '', // 依据的技术文件名称
signId: '', // 电子签章id
signName: '', // 电子签章名称
approvalSignIds: '', // 认可标志专用章id
approvalSignName: '', // 认可标志专用章名称
remark: '', // 备注
- ywy: '', // 业务员
+ busPersonId: '', // 业务员id
+ busPersonName: '', // 业务员名字
templateId: '', // 证书模板
templateName: '', // 证书模板
- templateNameFile: '', // 证书模板文件
certificateReportFile: '', // 证书报告附件
})
// 校验规则
const formRules = ref({
- yzs: [{ required: true, message: '原证书必填', trigger: ['blur', 'change'] }],
+ oldCertificateCode: [{ required: true, message: '原证书必填', trigger: ['blur', 'change'] }],
calibrationMajor: [{ required: true, message: '检校专业必填', trigger: ['blur', 'change'] }],
- certifications: [{ required: true, message: '证书类别必填', trigger: ['blur', 'change'] }],
+ certificateReportCategory: [{ required: true, message: '证书类别必填', trigger: ['blur', 'change'] }],
certificateReportName: [{ required: true, message: '证书名称必填', trigger: ['blur', 'change'] }],
customerName: [{ required: true, message: '委托方名称必填', trigger: ['blur', 'change'] }],
+ customerAddress: [{ required: true, message: '委托方地址必填', trigger: ['blur', 'change'] }],
certificationCompany: [{ required: true, message: '证书单位名称必填', trigger: ['blur', 'change'] }],
certificationCompanyAddress: [{ required: true, message: '证书单位地址必填', trigger: ['blur', 'change'] }],
calibrationPlace: [{ required: true, message: '检校地点必填', trigger: ['blur', 'change'] }],
- jdy: [{ required: true, message: '检定员必填', trigger: ['blur', 'change'] }],
- jjrq: [{ required: true, message: '检校日期必填', trigger: ['blur', 'change'] }],
- fjsj: [{ required: true, message: '复校时间必填', trigger: ['blur', 'change'] }],
- jssj: [{ required: true, message: '接收时间必填', trigger: ['blur', 'change'] }],
- jdjg: [{ required: true, message: '检定结果必填', trigger: ['blur', 'change'] }],
+ measurePersonId: [{ required: true, message: '检定员必填', trigger: ['blur', 'change'] }],
+ calibrationTime: [{ required: true, message: '检校日期必填', trigger: ['blur', 'change'] }],
+ repeatTime: [{ required: true, message: '复校时间必填', trigger: ['blur', 'change'] }],
+ deliverTime: [{ required: true, message: '接收时间必填', trigger: ['blur', 'change'] }],
+ measureResult: [{ required: true, message: '检定结果必填', trigger: ['blur', 'change'] }],
temperature: [
{ required: true, message: '温度必填', trigger: ['blur', 'change'] },
{ pattern: /(^-?\d\d*\.\d*$)|(^-?\d\d*$)|(^-?\.\d\d*$)/, message: '温度只能为数字', trigger: ['blur', 'change'] },
@@ -111,6 +125,7 @@
// ---------------------------------------字典--------------------------------------------
const certificationTypeMap = ref([]) // 证书类别
const calibrationMajorMap = ref([]) // 校检专业
+const userList = ref([]) // 检定员
// 获取字典值
async function getDict() {
// 校检专业
@@ -119,12 +134,22 @@
// 证书类别
const rescertificationType = await getDictByCode('certificationType')
certificationTypeMap.value = rescertificationType.data
+
+ // 获取人员列表
+ getUserList({ offset: 1, limit: 99999 }).then((res) => {
+ userList.value = res.data.rows
+ })
}
getDict()
// -------------------------------------原证书--------------------------------------------
+const selectMeasueDataDialogRef = ref() // 选择原证书组件ref
// 点击选择原证书
const selectOrigin = () => {
- //
+ selectMeasueDataDialogRef.value.initDialog()
+}
+// 选好原证书
+const selectMeasueDataConfirm = (val: any) => {
+ getDetail(val.id, val.certificateReportCode)
}
// ------------------------------------委托单------------------------------------------
// 点击选择委托单编号
@@ -142,12 +167,17 @@
form.value.orderCode = val[0].orderCode // 委托单
form.value.customerId = val[0].customerId// 委托方id
form.value.customerName = val[0].customerName// 委托方名称
+ form.value.customerAddress = val[0].customerAddress// 委托方地址
form.value.certificationCompany = val[0].certificationCompany// 证书单位名称
form.value.certificationCompanyAddress = val[0].certificationCompanyAddress// 证书单位地址
+ form.value.certificationCompanyAddress = val[0].certificationCompanyAddress// 证书单位地址
+ form.value.busPersonId = val[0].busPersonId// 业务员id
+ form.value.busPersonName = val[0].busPersonName// 业务员名字
}
}
// -------------------------------选择环境记录单----------------------------------------
+const businessEnvironmentRecord = ref({}) as any // 环境记录单信息
// 选择环境记录单Ref
const environmentalDialog = ref()
// 选择环境记录单
@@ -156,6 +186,7 @@
}
// 选择环境记录单表格确认
const environmentalAdd = (data: any) => {
+ businessEnvironmentRecord.value = data
form.value.environmentId = data.id // 环境记录单id
form.value.environmentCode = data.environmentCode // 环境记录单编号
form.value.temperature = data.temperature // 温度
@@ -200,35 +231,16 @@
}
// -----------------------------------------所依据的技术文件----------------------------------
+const selectTechFilesRef = ref()
+const fileList = ref([]) // 依据的技术文件
// 点击所依据的技术文件
const selectTechFiles = () => {
- //
+ selectTechFilesRef.value.initDialog()
}
-// --------------------------------------证书模板------------------------------------------
-// 选择证书模板Ref
-const templateDialog = ref()
-// 选择证书模板
-const handleClickTemplate = () => {
- templateDialog.value.initDialog()
-}
-// 选择证书模板确认
-const confirmCheckoutTemplate = (val: any) => {
- form.value.templateId = val.id // 证书报告模板id
- form.value.templateName = val.templateName || '' // 证书报告模板名称
- form.value.templateNameFile = val.minioFileName // 证书模板附件
-}
-
-// 点击下载证书模板按钮
-const downloadCertTemplate = () => {
- if (!form.value.templateId) {
- ElMessage.warning('请先选择证书模板')
- return false
- }
- if (!form.value.templateNameFile) {
- ElMessage.warning('选择的证书模板无附件,请检查')
- return false
- }
- downloadFile(form.value.templateNameFile as any, `${form.value.templateName}-${form.value.templateNameFile}`)
+// 选好依据的技术文件
+const selectTechFilesConfirm = (val: any) => {
+ fileList.value = val
+ form.value.techFilesName = val.map((item: { fileName: string }) => item.fileName).join(',')
}
// ---------------------------------文件上传(上传证书)-------------------------------------------
@@ -283,10 +295,10 @@
// 点击批量添加/选择
const addSample = () => {
- if (form.value.orderId) {
- selectOrderSamplesDialogRef.value.initDialog(form.value.orderId)
+ if (form.value.orderId) { // 选择委托单下的样品
+ selectOrderSamplesDialogRef.value.initDialog(form.value.orderId, false)
}
- else {
+ else { // 选择样品库中的样品
selectSamplesDialogRef.value.initDialog()
}
}
@@ -318,7 +330,7 @@
}
// ----------------------------------------------所用的计量标准器具--------------------------------------------
const equipmentVisible = ref(false) // 选择设备对话框显隐
-const equipmentList = ref([])// 表格数据
+const equipmentInfoList = ref([])// 表格数据
const checkoutEquipmentList = ref([])// 多选设备
// 表头
const equipmentColumns = ref([
@@ -328,8 +340,8 @@
{ text: '出厂编号', value: 'manufacturingNo', align: 'center' },
{ text: '测量范围', value: 'mesureRange', align: 'center' },
{ text: '不确定度', value: 'uncertainty', align: 'center' },
- { text: '溯源机构', value: 'syjg', align: 'center' },
- { text: '证书编号', value: 'zsbh', align: 'center' },
+ { text: '溯源机构', value: 'mesureDeptName', align: 'center' },
+ // { text: '证书编号', value: 'zsbh', align: 'center' },
{ text: '有效日期', value: 'validDate', align: 'center' },
])
@@ -351,9 +363,9 @@
const confirmSelectEquipment = (val: any) => {
val.forEach((item: IEquipmentList) => {
// 只添加列表里不存在的
- const index = equipmentList.value.findIndex((i: IEquipmentList) => item.equipmentNo === i.equipmentNo)
+ const index = equipmentInfoList.value.findIndex((i: IEquipmentList) => item.equipmentNo === i.equipmentNo)
if (index === -1) {
- equipmentList.value.push(item)
+ equipmentInfoList.value.push(item)
}
})
}
@@ -365,28 +377,109 @@
return false
}
checkoutEquipmentList.value.forEach((item: IEquipmentList) => {
- equipmentList.value.forEach((element, index) => {
+ equipmentInfoList.value.forEach((element, index) => {
if (element.equipmentNo === item.equipmentNo) {
- equipmentList.value.splice(index, 1)
+ equipmentInfoList.value.splice(index, 1)
}
})
})
}
+
+// --------------------------------------证书模板------------------------------------------
+// 选择证书模板Ref
+const templateDialogRef = ref()
+// 选择证书模板
+const handleClickTemplate = () => {
+ templateDialogRef.value.initDialog()
+}
+// 选择证书模板确认
+const confirmCheckoutTemplate = (val: any) => {
+ form.value.templateId = val.id // 证书报告模板id
+ form.value.templateName = val.templateName || '' // 证书报告模板名称
+}
+
+// 点击下载证书模板按钮
+const downloadCertTemplate = () => {
+ if (!form.value.templateId) {
+ ElMessage.warning('请先选择证书模板')
+ return false
+ }
+ if (!sampleList.value.length) {
+ ElMessage.warning('被检样品不能为空')
+ return false
+ }
+ if (!equipmentInfoList.value.length) {
+ ElMessage.warning('所用的计量标准器具不能为空')
+ return false
+ }
+
+ ruleFormRef.value.validate((valid: boolean) => {
+ if (valid) {
+ const params = solveParams()
+ const loading = ElLoading.service({
+ lock: true,
+ background: 'rgba(255, 255, 255, 0.8)',
+ })
+ downLoadTemplate(params).then((res) => {
+ exportFile(res.data, `${form.value.certificateReportName}.xls`)
+ loading.close()
+ }).catch(() => {
+ loading.close()
+ })
+ }
+ })
+}
+
// -------------------------------------------------------------------------------------------
+// 处理保存、下载模板参数
+function solveParams() {
+ const params = {
+ ...form.value,
+ businessEnvironmentRecord: businessEnvironmentRecord.value, // 环境记录单
+ fileList: fileList.value, // 依据的技术文件
+ equipmentInfoList: equipmentInfoList.value, // 所用的计量标准器具列表/监测设备
+ sampleId: sampleList.value[0].id, // 样品id(打印证书接口要必传)
+ sampleNo: sampleList.value[0].sampleNo, // 样品编号
+ sampleName: sampleList.value[0].sampleName, // 样品名称
+ sampleModel: sampleList.value[0].sampleModel, // 样品型号
+ manufacturingNo: sampleList.value[0].manufacturingNo, // 出厂编号
+ manufacturer: sampleList.value[0].manufacturer, // 生产厂家
+ sampleRemark: sampleList.value[0].remark, // 样品备注
+ id: pageType.value === 'add' ? '' : form.value.id,
+ }
+ return params
+}
// 获取详情信息
-const getDetail = () => {
+function getDetail(id?: string, certificateReportCode?: string) {
const loading = ElLoading.service({
lock: true,
background: 'rgba(255, 255, 255, 0.8)',
})
- detail({ id: $route.params.id as string }).then((res) => {
+ getMeasureDataDetail({ id: infoId.value! || id! }).then((res) => {
loading.close()
form.value = res.data
- form.value.createUserName = res.data.applicantName || user.name
- list.value = res.data.sampleList.filter((item: ISampleList) => {
- return item !== null
- })
+ sampleList.value = [{
+ sampleNo: res.data.sampleNo, // 样品编号
+ sampleName: res.data.sampleNo, // 样品名称
+ sampleModel: res.data.sampleNo, // 型号
+ manufacturingNo: res.data.sampleNo, // 出厂编号
+ manufacturer: res.data.sampleNo, // 生产厂家
+ remark: res.data.sampleRemark, // 备注
+ id: res.data.sampleId,
+ }]
+ equipmentInfoList.value = res.data.equipmentInfoList.map((item: { validDate: string }) => {
+ return {
+ ...item,
+ validDate: item.validDate ? dayjs(item.validDate).format('YYYY-MM-DD') : item.validDate,
+ }
+ }) // 所用的计量标准器具
+ businessEnvironmentRecord.value = res.data.businessEnvironmentRecord // 环境记录单数据
+ form.value.environmentCode = res.data.businessEnvironmentRecord.environmentCode// 环境记录单编号
+ if (id && certificateReportCode) {
+ form.value.oldCertificateCode = certificateReportCode
+ form.value.invalid = 1
+ }
}).catch(() => {
loading.close()
})
@@ -399,10 +492,13 @@
// 保存
const handleSave = () => {
- const tempList = list.value.filter(item => item.sampleNo)
- if (!tempList.length) {
- ElMessage.warning('样品信息不能为空')
- return
+ if (!sampleList.value.length) {
+ ElMessage.warning('被检样品不能为空')
+ return false
+ }
+ if (!equipmentInfoList.value.length) {
+ ElMessage.warning('所用的计量标准器具不能为空')
+ return false
}
ruleFormRef.value.validate((valid: boolean) => {
if (valid) {
@@ -410,32 +506,22 @@
lock: true,
background: 'rgba(255, 255, 255, 0.8)',
})
- // 样品&委托单列表(保存/编辑草稿接口入参使用)
- const temList = [] as any // 临时数组
- console.log('保存中的数组', list.value)
-
- list.value.forEach((item: any) => {
- if ((item.orderId && item.id) || (item.orderId && item.sampleId)) {
- temList.push({
- orderId: item.orderId,
- sampleId: item.id || item.sampleId,
- })
- }
- })
- form.value.orderSampleList = temList
+ const params = solveParams()
if (pageType.value === 'add') { // 新建
- addApply(form.value).then((res) => {
- submitId.value = res.data.id
- form.value.projectNo = res.data.projectNo // 分包项目编号
+ addMeasureData(params).then((res) => {
+ submitId.value = res.data.data.id
+ form.value.certificateReportCode = res.data.data.certificateReportCode
+ form.value.certificateReportName = res.data.data.certificateReportName
ElMessage.success('保存成功')
loading.close()
}).catch(() => {
loading.close()
})
}
+
else if (pageType.value === 'edit') { // 编辑
if (query.approvalStatusName === '未通过-驳回') { // 未通过-驳回
- failUpdateApply(form.value).then((res) => {
+ failUpdateMeasureData(params).then((res) => {
ElMessage.success('保存成功')
loading.close()
close()
@@ -444,7 +530,7 @@
})
}
else { // 草稿箱和已取消
- updateApply(form.value).then((res) => {
+ draftUpdateMeasureData(params).then((res) => {
ElMessage.success('保存成功')
loading.close()
close()
@@ -466,7 +552,7 @@
})
const params = {
id: submitId.value,
- formId: query.formId, // 表单id
+ formId: query.formId as string, // 表单id
}
submit(params).then(() => {
ElMessage.success('提交成功')
@@ -481,39 +567,6 @@
}
}
-const sampleVisible = ref(false)
-const projectVisible = ref(false)
-const isMulti = ref(false)
-const selectIndex = ref(0)
-// 点击选择
-const handleSelect = (index: number, row: ISampleList) => {
- sampleVisible.value = true // 选择设备对话框显隐
- isMulti.value = false // 是否单选, false单选、true表格多选
- selectIndex.value = index
-}
-
-const checkoutList = ref([]) // 选中的行
-
-// 修改委托方对话框显隐
-const changeSampleVisible = (val: boolean) => {
- sampleVisible.value = val
-}
-// 修改项目选择对话框显隐
-const changeProjectVisible = (val: boolean) => {
- projectVisible.value = val
-}
-
-// 删除行
-const delRow = () => {
- checkoutList.value.forEach((item: ISampleList) => {
- list.value.forEach((element, index) => {
- if (element.sampleNo === item.sampleNo) {
- list.value.splice(index, 1)
- }
- })
- })
-}
-
// ------------------------------------------审批-----------------------------------------
const approvalRecordData = ref([]) // 审批流程数据
@@ -573,11 +626,26 @@
// ------------------------------------事件-------------------------------------------------
// 检校专业变化
const changeCalibrationMajor = (val: string) => {
- form.value.certificateReportName = form.value.certificateReportCode + val + form.value.certifications
+ const index = calibrationMajorMap.value.findIndex((item: { value: string }) => item.value === val)
+ if (index !== -1) {
+ form.value.calibrationMajorName = calibrationMajorMap.value[index].name
+ }
+ console.log(form.value.calibrationMajorName)
}
// 证书类别变化
const changeCertifications = (val: string) => {
- form.value.certificateReportName = form.value.certificateReportCode + form.value.calibrationMajor + val
+ const index = certificationTypeMap.value.findIndex((item: { value: string }) => item.value === val)
+ if (index !== -1) {
+ form.value.certificateReportCategoryName = certificationTypeMap.value[index].name
+ }
+ console.log(form.value.certificateReportCategoryName)
+}
+// 选择检定员变化
+const changeMeasurePersonId = (val: string) => {
+ const index = userList.value.findIndex(item => item.id === val)
+ if (index !== -1) {
+ form.value.measurePerson = userList.value[index].name
+ }
}
// -------------------------------------------------------------------------------------
onMounted(async () => {
@@ -593,8 +661,9 @@
// form.value.createUser = user.id // 创建人id
// form.value.createUserName = user.name // 创建人
// form.value.applicantTime = proxy.dayjs().format('YYYY-MM-DD HH:mm:ss') // 申请时间
- form.value.jdy = user.name // 创建人
- form.value.jjrq = proxy.dayjs().format('YYYY-MM-DD') // 检校日期
+ form.value.measurePerson = user.name // 检定员名字
+ form.value.measurePersonId = user.id // 检定员id
+ form.value.calibrationTime = proxy.dayjs().format('YYYY-MM-DD') // 检校日期
}
})
@@ -606,7 +675,7 @@
上传证书
-
+
下载证书模板
@@ -641,25 +710,25 @@
label-width="140"
:rules="formRules"
>
-
+
-
+
替代已生成证书
-
-
+
+
-
+
选择
@@ -684,15 +753,15 @@
v-for="item in calibrationMajorMap"
:key="item.value"
:label="item.name"
- :value="item.name"
+ :value="item.value"
/>
-
+
@@ -720,7 +789,7 @@
/>
-
+
+
+
+
+
@@ -761,6 +841,18 @@
/>
+
+
+
+
+
-
-
+
+ filterable
+ @change="changeMeasurePersonId"
+ >
+
+
-
+
-
-
+
+
-
-
+
+
-
-
+
+
-
+
-
+
confirmSelectSample(val, 'order')" />
confirmSelectSample(val, 'warehouse')" />
+
+
+
+
diff --git a/src/views/business/lab/measureData/measureDataList.vue b/src/views/business/lab/measureData/measureDataList.vue
index 5c011b8..96ffa13 100644
--- a/src/views/business/lab/measureData/measureDataList.vue
+++ b/src/views/business/lab/measureData/measureDataList.vue
@@ -2,16 +2,19 @@
-
+
-
-
-
@@ -369,6 +385,7 @@
is-showmulti-select
@change="changePage"
@multi-select="handleSelectionChange"
+ @handleClickFollowLink="handleClickFollowLink"
>
@@ -483,3 +500,12 @@
+
+
diff --git a/src/views/business/schedule/interchangeReceipt/receiptEdit.vue b/src/views/business/schedule/interchangeReceipt/receiptEdit.vue
index 13ee3ab..877ea57 100644
--- a/src/views/business/schedule/interchangeReceipt/receiptEdit.vue
+++ b/src/views/business/schedule/interchangeReceipt/receiptEdit.vue
@@ -356,7 +356,7 @@
getInterchangeReceiptDetail({ id: infoId.value }).then((res) => {
dataForm.value = res.data // 表单
sampleList.value = res.data.customerSampleList // 样品列表
- dataForm.value.orderId = res.data.customerSampleList[0].orderId // orderId
+ dataForm.value.orderId = res.data.orderId // orderId
minioFileNameAutograph.value = res.data.recieverSignFile // 签名图片
loading.close()
})
diff --git a/src/views/finance/businessSettlement/businessSettlement-interface.ts b/src/views/finance/businessSettlement/businessSettlement-interface.ts
index 13a1a0c..454788f 100644
--- a/src/views/finance/businessSettlement/businessSettlement-interface.ts
+++ b/src/views/finance/businessSettlement/businessSettlement-interface.ts
@@ -4,6 +4,8 @@
customerNo: string // 委托方代码
customerName: string // 委托方名称
deliverer: string // 送样人
+ orderTimeStart: string // 委托日期开始
+ orderTimeEnd: string // 委托日期结束
offset: number
limit: number
}
@@ -14,17 +16,17 @@
orderCode: string // 委托书编号
customerNo: string // 委托方代码
customerName: string // 委托方名称
- deliverer: string // 送样人
- delivererTel: string // 联系方式
+ orderTime: string // 委托日期
sampleCount: string // 样品数量
- isUrgent: string // 是否加急
- createTime: string // 创建时间
- postedPrice: number // 标价(单位分)
- suggestedDiscount: string // 建议折扣-单位%
- suggestedPrice: number // 建议价格-单位分
- extraCharge: number // 附加费用-单位分
- extraChargeIllustration: string // 附加费用说明
- totalSettlement: number // 总计结算费用-单位分
+ sampleWarehouseName: string // 样品库房
+ certWarehouseName: string // 证书库房
+ feeStatus: string // 费用状态
+ received: string // 是否到账
+ actualTestFee: string // 检测费(实)(元)
+ shouldTestFee: string // 检测费(应)(元)
+ actualTotalFee: string // 实收合计(元)
+ receivedAmount: string // 到账金额(元)
+ invoiceAmount: string // 开票金额(元)
}
// 字典
@@ -49,21 +51,22 @@
// 表单
export interface IForm {
orderCode: string // 委托书编号
- orderId: string // 委托书编号
- deliverer: string // 送检人
- delivererTel: string // 送样人联系方式
- createTime: string // 委托单创建时间
- planDeliverTime: string // 预计送达时间
- requireOverTime: string // 要求检完时间
- customerNo: string // 委托方代码
- customerId: string // 委托方id
+ orderId: string // 委托单id
customerName: string // 委托方名称
- phone: string // 委托方电话
- priceFront: number // 标价
- suggestedDiscount: number // 建议折扣
- suggestedPrice: number // 建议价格
- extraCharge: number // 附加费用-单位分
- extraChargeIllustration: string // 附加费用说明
- totalSettlement: number // 总计结算费用
- samplePriceList: Array // 样品清单
+ orderTime: string // 委托日期
+ sampleCount: string // 样品数量
+ certificationCompany: string // 证书单位名称
+ certificationCompanyAddress: string // 证书单位地址
+ deliverer: string // 联系人
+ delivererTel: string // 联系方式
+ sampleWarehouse: string // 样品库房
+ certWarehouse: string // 证书库房
+ feeStatus: string // 费用状态
+ received: string // 是否到账
+ actualTestFee: Number // 检测费(实)(元)
+ shouldTestFee: Number // 检测费(应)(元)
+ actualTotalFee: Number // 实收合计(元)
+ receivedAmount: Number // 到账金额(元)
+ invoiceAmount: Number // 开票金额(元)
+ remark: string // 备注
}
diff --git a/src/views/finance/businessSettlement/edit.vue b/src/views/finance/businessSettlement/edit.vue
index e11f337..7630aeb 100644
--- a/src/views/finance/businessSettlement/edit.vue
+++ b/src/views/finance/businessSettlement/edit.vue
@@ -7,13 +7,18 @@
import { useRoute, useRouter } from 'vue-router'
import { el } from 'element-plus/es/locale'
import type { IForm, IsampleList } from './businessSettlement-interface'
+import multiTable from '@/components/MultiHeaderTable/index.vue'
+import { getDictByCode } from '@/api/system/dict'
+import { UploadFile } from '@/api/measure/file'
+import { calc } from '@/utils/useCalc'
+import type { dictType } from '@/global'
import type { TableColumn } from '@/components/NormalTable/table_interface'
import useUserStore from '@/store/modules/user'
import selectOrder from '@/views/business/schedule/interchangeReceipt/selectOrder.vue'
import type { IOrderList } from '@/views/business/schedule/order/orderList_interface'
import { getOrderDetail } from '@/api/business/schedule/order'
import { isNumber, validateMoney } from '@/utils/validate'
-import { calc } from '@/utils/useCalc'
+import useCheckList from '@/utils/useCheckList'
import { addBusinessSettlement, getBusinessSettlementDetail, updateBusinessSettlement } from '@/api/finance/businessSettlement'
const user = useUserStore() // 用户信息
const $route = useRoute()
@@ -27,54 +32,215 @@
// 表单数据
const form = ref({
orderCode: '', // 委托书编号
- orderId: '', // 委托书编号
- deliverer: '', // 送检人
- delivererTel: '', // 送样人联系方式
- createTime: '', // 委托单创建时间
- planDeliverTime: '', // 预计送达时间
- requireOverTime: '', // 要求检完时间
- customerNo: '', // 委托方代码
- customerId: '', // 委托方id
+ orderId: '', // 委托单id
customerName: '', // 委托方名称
- phone: '', // 委托方电话
- priceFront: 0, // 标价
- suggestedDiscount: 95, // 建议折扣
- suggestedPrice: 0, // 建议价格
- extraCharge: 0, // 附加费用-单位分
- extraChargeIllustration: '', // 附加费用说明
- totalSettlement: 0, // 总计结算费用
- samplePriceList: [], // 样品清单
+ orderTime: '', // 委托日期
+ sampleCount: '', // 样品数量
+ certificationCompany: '', // 证书单位名称
+ certificationCompanyAddress: '', // 证书单位地址
+ deliverer: '', // 联系人
+ delivererTel: '', // 联系方式
+ sampleWarehouse: '未入库', // 样品库房
+ certWarehouse: '未入库', // 证书库房
+ feeStatus: '未录费', // 费用状态
+ received: '未到账', // 是否到账
+ actualTestFee: 0, // 检测费(实)(元)
+ shouldTestFee: 0, // 检测费(应)(元)
+ actualTotalFee: 0, // 实收合计(元)
+ receivedAmount: 0, // 到账金额(元)
+ invoiceAmount: 0, // 开票金额(元)
+ remark: '', // 备注
})
-const ruleFormRef = ref() as any
-const list = ref([])// 表格数据
-const orderVisible = ref(false) // 控制委托书对话框显隐
-
-// 表头
-const columns = ref([
- { text: '样品编号', value: 'sampleNo', align: 'center', width: '170', required: false },
- { text: '样品名称', value: 'sampleName', align: 'center', required: false },
- { text: '型号', value: 'sampleModel', align: 'center', required: false },
- { text: '出厂编号', value: 'manufacturingNo', align: 'center', required: false },
- { text: '检定项目', value: 'measureContent', align: 'center', required: false },
- { text: '标价(元)', value: 'price', align: 'center', required: true, reg: validateMoney },
-])
// 表单校验规则
const rules = reactive({
- orderCode: [{ required: true, message: '委托书编号必填', trigger: 'blur' }],
- price: [{ required: true, message: '标价必填', trigger: ['blur', 'change'] },
- { pattern: /(^-?\d\d*\.\d*$)|(^-?\d\d*$)|(^-?\.\d\d*$)/, message: '标价只能为数字', trigger: ['blur', 'change'] }],
- suggestedDiscount: [{ required: true, message: '建议折扣必填', trigger: ['blur', 'change'] },
- { pattern: /^([0]|[1-9][0-9]*)$/, message: '建议折扣只能为正整数或0', trigger: ['blur', 'change'] }],
- extraCharge: [{ required: true, message: '附加费用必填', trigger: ['blur', 'change'] },
- { pattern: /(^[0-9](\d+)?(\.\d{1,2})?$)|(^\d\.\d{1,2}$)/, message: '要求不小于0,且最多保留两位小数', trigger: ['blur', 'change'] }],
- extraChargeIllustration: [{ required: true, message: '附加费用说明必填', trigger: 'blur' }],
+ orderCode: [{ required: true, message: '委托单编号必填', trigger: 'blur' }],
+ customerName: [{ required: true, message: '委托方名称必填', trigger: 'blur' }],
+ orderTime: [{ required: true, message: '委托日期必填', trigger: 'blur' }],
+ sampleCount: [{ required: true, message: '样品数量必填', trigger: 'blur' }],
+ certificationCompany: [{ required: true, message: '证书单位名称必填', trigger: 'blur' }],
+ certificationCompanyAddress: [{ required: true, message: '证书单位地址必填', trigger: 'blur' }],
+ deliverer: [{ required: true, message: '联系人必填', trigger: 'blur' }],
+ delivererTel: [{ required: true, message: '联系电话必填', trigger: 'blur' }],
+ sampleWarehouse: [{ required: true, message: '样品库房必填', trigger: 'blur' }],
+ certWarehouse: [{ required: true, message: '证书库房必填', trigger: 'blur' }],
+ feeStatus: [{ required: true, message: '费用状态必填', trigger: 'blur' }],
+ received: [{ required: true, message: '是否到账必填', trigger: 'blur' }],
+ actualTestFee: [{ required: true, message: '检测费(实)(元)必填', trigger: 'blur' }],
+ shouldTestFee: [{ required: true, message: '检测费(应)(元)必填', trigger: 'blur' }],
+ actualTotalFee: [{ required: true, message: '实收合计(元)必填', trigger: 'blur' }],
+ receivedAmount: [{ required: true, message: '到账金额(元)必填', trigger: 'blur' }],
+ invoiceAmount: [{ required: true, message: '开票金额(元)必填', trigger: 'blur' }],
})
+const ruleFormRef = ref() as any
+const orderVisible = ref(false) // 控制委托书对话框显隐
// ---------------------------------------路由参数--------------------------------------
if ($route.params && $route.params.type) {
pageType.value = $route.params.type as string
infoId.value = $route.params.id as string
}
+// ---------------------------------------字典--------------------------------------
+
+const financeSampleWarehouseList = ref([]) // 样品库房
+const financeCertWarehouseList = ref([]) // 证书库房
+const financeReceivedList = ref([]) // 是否到账
+// 获取字典值
+function getDict() {
+ // 样品库房
+ getDictByCode('financeSampleWarehouse').then((response) => {
+ financeSampleWarehouseList.value = response.data
+ })
+ // 证书库房
+ getDictByCode('financeCertWarehouse').then((response) => {
+ financeCertWarehouseList.value = response.data
+ })
+ // 是否到账
+ getDictByCode('financeReceived').then((response) => {
+ financeReceivedList.value = response.data
+ })
+}
+getDict()
+// -----------------------------------到账金额明细--------------------------------------------------
+const receivedAmountList = ref([]) as any // 到账金额明细
+const checkoutReceivedAmountList = ref([]) as any // 到账金额明细多选
+// 表头
+const receivedAmountcolumns = ref([
+ { text: '到账金额(元)', value: 'money', align: 'center', width: '220', required: true },
+ { text: '到账时间', value: 'moneyTime', align: 'center', width: '220', required: true },
+ { text: '附件', value: 'attachment', align: 'center', required: false },
+])
+
+// -------------------------------------开票金额明细--------------------------------------------------------------
+const invoiceAmountList = ref([]) as any // 开票金额明细
+const checkoutInvoiceAmountList = ref([]) as any // 开票金额明细多选
+// 表头
+const invoiceAmountcolumns = ref([
+ { text: '开票金额(元)', value: 'money', align: 'center', width: '220', required: true },
+ { text: '开票时间', value: 'moneyTime', align: 'center', width: '220', required: true },
+ { text: '附件', value: 'attachment', align: 'center', required: false },
+])
+
+// 多选发生改变时
+const handleSelectionChange = (e: any, type: 'addReceived' | 'invoiceAmount') => {
+ if (type === 'addReceived') { // 到账金额明细
+ checkoutReceivedAmountList.value = e
+ }
+ else { // 开票金额明细
+ checkoutInvoiceAmountList.value = e
+ }
+}
+
+// 点击增加行
+const addRow = (type: 'addReceived' | 'invoiceAmount') => {
+ if (type === 'addReceived') {
+ if (useCheckList(receivedAmountList.value, receivedAmountcolumns.value, '到账金额明细')) {
+ receivedAmountList.value.push({
+ money: undefined,
+ moneyTime: '',
+ attachment: [],
+ moneyType: '1',
+ })
+ }
+ }
+ else {
+ if (useCheckList(invoiceAmountList.value, invoiceAmountcolumns.value, '开票金额明细')) {
+ invoiceAmountList.value.push({
+ money: undefined,
+ moneyTime: '',
+ attachment: [],
+ moneyType: '2',
+ })
+ }
+ }
+}
+
+// 删除行
+const delRow = (type: 'addReceived' | 'invoiceAmount') => {
+ if ((type === 'addReceived' && checkoutReceivedAmountList.value.length <= 0) || (type === 'invoiceAmount' && checkoutInvoiceAmountList.value.length <= 0)) {
+ ElMessage({
+ message: '请选中要删除的行',
+ type: 'warning',
+ })
+ }
+ else {
+ if (type === 'addReceived') {
+ receivedAmountList.value = receivedAmountList.value.filter(
+ (item: any) => {
+ return !checkoutReceivedAmountList.value.includes(item)
+ },
+ )
+ }
+ else {
+ invoiceAmountList.value = invoiceAmountList.value.filter(
+ (item: any) => {
+ return !checkoutInvoiceAmountList.value.includes(item)
+ },
+ )
+ }
+ }
+}
+
+// ----------------------------------------上传附件----------------------------------------------------
+// 删除附件
+const del = (index: number, row: any) => {
+ row.value.attachment.splice(index, 1)
+}
+
+const fileRef = ref() // 文件上传input
+const onFileChange = (event: any, row?: any, type?: 'receivedAmount' | 'invoiceAmount') => {
+ // 原生上传
+ console.log(event.target.files)
+ const files = event.target.files
+ if (files.length !== 0) {
+ // 创建formdata对象
+ const fd = new FormData()
+ for (var i = 0; i < files.length; i++) {
+ fd.append('multipartFile', files[i])
+ }
+ UploadFile(fd).then((res) => {
+ if (res.code === 200) {
+ res.data.forEach((item: string) => {
+ row.attachment.push({
+ minioFileName: item,
+ })
+ })
+ ElMessage.success('文件上传成功')
+ }
+ else {
+ ElMessage.error(res.message)
+ }
+ })
+ }
+}
+const upload = () => {
+ fileRef.value.click()
+}
+// ------------------------------------结算明细--------------------------------------------------------------------
+const list = ref([]) // 开票金额明细
+// 表头
+const columns = ref([
+ { text: '器具名称', value: 'sampleName', align: 'center', required: true, type: 'text' },
+ { text: '型号规格', value: 'sampleModel', align: 'center', width: '180', required: true, type: 'input' },
+ { text: '套数/退', value: 'sets', align: 'center', required: true, width: '180', type: 'inputNumber' },
+ { text: '出厂编号', value: 'manufacturingNo', align: 'center', width: '180', required: true, type: 'input' },
+ { text: '委托日期', value: 'orderTime', align: 'center', required: true, width: '160', type: 'date' },
+ { text: '检测规范', value: 'accordStandard', align: 'center', width: '180', required: false, type: 'input' },
+ {
+ text: '收费(元)含6%增值税',
+ value: 'price',
+ align: 'center',
+ required: false,
+ children: [
+ { text: '检测费(应)', value: 'shouldTestFee', align: 'center', width: '180', required: true, type: 'inputNumber' },
+ { text: '检测费(实)', value: 'actualTestFee', align: 'center', required: true, width: '180', type: 'inputNumber' },
+ { text: '附加费', value: 'extraFee', align: 'center', required: false, width: '180', type: 'inputNumber' },
+ { text: '修理费', value: 'repairFee', align: 'center', required: false, width: '180', type: 'inputNumber' },
+ { text: '其他费', value: 'otherFee', align: 'center', required: false, width: '180', type: 'inputNumber' },
+ { text: '小计', value: 'subtotal', align: 'center', required: false, type: 'text' },
+ ],
+ },
+])
+
// ------------------------------------委托书---------------------------------------------
// 点击选择委托书编号
const handleClickOrder = () => {
@@ -87,87 +253,63 @@
// 选好委托书
const confirmCheckoutOrder = (val: Array) => {
if (val && val.length) {
- form.value.priceFront = 0 // 标价
- // form.value.suggestedDiscount = 95 // 建议折扣
- form.value.suggestedPrice = 0 // 建议价格
- form.value.extraCharge = 0// 附加费用-单位分
- form.value.extraChargeIllustration = '' // 附加费用说明
- form.value.totalSettlement = 0 // 总计结算费用
getOrderDetail({ id: val[0].id }).then((res) => { // 样品清单
form.value.orderCode = res.data.orderCode // 委托书编号
form.value.orderId = res.data.id // 委托书id
- form.value.deliverer = res.data.deliverer // 送检人
- form.value.delivererTel = res.data.delivererTel // 送检人
- form.value.createTime = res.data.createTime // 委托单创建时间
- form.value.customerNo = res.data.customerNo // 委托方代码
- form.value.customerId = res.data.customerId // 委托方id
form.value.customerName = res.data.customerName // 委托方名称
- form.value.planDeliverTime = res.data.planDeliverTime // 预计送达时间
- form.value.requireOverTime = res.data.requireOverTime // 要求检完时间
- form.value.phone = res.data.customerPhone // 委托方电话
- list.value = res.data.customerSampleInfoList.map((item: { isEdit: boolean }) => {
+ form.value.orderTime = res.data.createTime // 委托日期(委托单创建时间)
+ form.value.certificationCompany = res.data.certificationCompany // 证书单位名称
+ form.value.certificationCompanyAddress = res.data.certificationCompanyAddress // 证书单位地址
+ form.value.deliverer = res.data.deliverer // 联系人
+ form.value.delivererTel = res.data.delivererTel // 联系方式
+ form.value.sampleCount = res.data.customerSampleInfoList.length // 样品数量
+ list.value = res.data.customerSampleInfoList.map((item: { createTime: string; editable: boolean }) => {
return {
...item,
- isEdit: true,
+ orderTime: item.createTime ? dayjs(item.createTime).format('YYYY-MM-DD') : item.createTime, // 委托日期
+ editable: pageType.value !== 'detail',
+ shouldTestFee: 0, // 检测费(应)
+ actualTestFee: 0, // 检测费(实)
+ extraFee: 0, // 附加费
+ repairFee: 0, // 修理费
+ otherFee: 0, // 其他费
+ sets: 0, // 套数
+ subtotal: 0, // 小计
+ id: '',
}
})
})
}
}
-// -----------------------------------------样品清单--------------------------------------------
-// 检查列表
-function checkSampleList() {
- for (let index = 0; index < list.value.length; index++) {
- const item = list.value[index]
- for (const prop of columns.value) {
- // 检查必填
- if (prop.required && !item[prop.value]) {
- ElMessage.warning(`请先完善第${index + 1}行中${prop.text}`)
- return false
- }
- // 验证正则
- if (prop.reg && typeof prop.reg === 'function') {
- if (!prop.reg(item[prop.value])) {
- // ElMessage.warning(`第${index + 1}行中${prop.text}输入不合法`)
- ElMessage.warning(`第${index + 1}行: 要求标价为正数,且最多保留两位小数`)
- return false
- }
- }
- }
- }
- return true
-}
+// --------------------------------------------计算----------------------------------------------
+// 计算
+const handleInputNumberChange = ({ row }: any) => {
+ // 计算小计
+ row.subtotal = calc(Number(calc(Number(calc(Number(calc(Number(row.shouldTestFee), Number(row.actualTestFee), '+')), row.extraFee, '+')), row.repairFee, '+')), row.otherFee, '+')
+ // 计算检测费(应)(元)
+ form.value.shouldTestFee = list.value.reduce((accumulator, current: any) => accumulator + current.shouldTestFee, 0)
+ // 计算检测费(实)(元)
+ form.value.actualTestFee = list.value.reduce((accumulator, current: any) => accumulator + current.actualTestFee, 0)
+ // 实收合计
+ form.value.actualTotalFee = list.value.reduce((accumulator, current: any) => accumulator + current.subtotal, 0)
-// --------------------------------------------自动计算----------------------------------------------
-// 折扣改变-计算建议价格
-const changeSuggestedDiscount = () => {
- console.log('折扣改变')
- if (form.value.priceFront) {
- form.value.suggestedPrice = calc(Number(form.value.priceFront), Number(form.value.suggestedDiscount / 100), '*') as number
- form.value.suggestedPrice = Number(form.value.suggestedPrice.toFixed(2))
+ if (list.value.every((item: { actualTestFee: number }) => item.actualTestFee === 0 || `${item.actualTestFee}` === 'undefined' || `${item.actualTestFee}` === 'null' || `${item.actualTestFee}` === '')) {
+ form.value.feeStatus = '未录费'
+ }
+ else if (list.value.every((item: { actualTestFee: number }) => item.actualTestFee !== 0 || `${item.actualTestFee}` === 'undefined' || `${item.actualTestFee}` === 'null' || `${item.actualTestFee}` === '')) {
+ form.value.feeStatus = '已录费'
+ }
+ else {
+ form.value.feeStatus = '部分录费'
}
}
-// 标价改变
-const changePrice = () => {
- console.log('标价改变')
- let sum = 0
- list.value.forEach((item) => {
- if (item.price) {
- sum = calc(Number(sum), Number(item.price), '+') as number
- }
- })
- form.value.priceFront = sum
- changeSuggestedDiscount() // 建议价格随之变化
+const changeTableInputNumber = () => {
+ // 到账金额
+ form.value.receivedAmount = receivedAmountList.value.reduce((accumulator: any, current: any) => accumulator + current.money, 0)
+ // 开票金额
+ form.value.invoiceAmount = invoiceAmountList.value.reduce((accumulator: any, current: any) => accumulator + current.money, 0)
}
-// 附加费用改变
-const changeExtraCharge = () => {
- console.log('附加费用改变')
- form.value.totalSettlement = calc(Number(form.value.suggestedPrice), Number(form.value.extraCharge), '+') as number
-}
-watch(() => form.value.suggestedPrice, (newValue) => {
- changeExtraCharge()
-})
// ----------------------------------------------------------------------------------------
const $router = useRouter()
@@ -176,9 +318,35 @@
$router.back()
}
+// 校验表格
+const checkList = () => {
+ if (!receivedAmountList.value.length) {
+ ElMessage.warning('到账金额明细不能为空')
+ return false
+ }
+ if (!invoiceAmountList.value.length) {
+ ElMessage.warning('开票金额明细不能为空')
+ return false
+ }
+ if (!list.value.length) {
+ ElMessage.warning('结算明细不能为空')
+ return false
+ }
+ if (!useCheckList(receivedAmountList.value, receivedAmountcolumns.value, '到账金额明细')) {
+ return false
+ }
+ if (!useCheckList(invoiceAmountList.value, invoiceAmountcolumns.value, '开票金额明细')) {
+ return false
+ }
+ if (!useCheckList(list.value, columns.value, '结算明细')) {
+ return false
+ }
+ return true
+}
+
// 保存
const save = () => {
- if (!checkSampleList()) {
+ if (!checkList()) {
return false
}
ruleFormRef.value.validate((valid: boolean) => {
@@ -188,17 +356,10 @@
background: 'rgba(255, 255, 255, 0.8)',
})
const params = {
- extraCharge: calc(Number(form.value.extraCharge), 100, '*'), // 附加费用-单位分
- extraChargeIllustration: form.value.extraChargeIllustration, // 附加费用说明
id: infoId.value,
- orderId: form.value.orderId, // 委托书id
- suggestedDiscount: form.value.suggestedDiscount, // 建议折扣-单位%
- samplePriceList: list.value.map((item) => {
- return {
- price: calc(Number(item.price), 100, '*'), // 标价-单位分
- relationId: item.relationId, // 样品id
- }
- }), // 样品清单
+ ...form.value,
+ amountDetailsList: receivedAmountList.value.concat(invoiceAmountList.value),
+ sampleList: list.value,
}
// 新建
if (pageType.value === 'add') {
@@ -229,24 +390,22 @@
// 编辑、详情--获取详细信息
const fetchDetail = () => {
+ const loading = ElLoading.service({})
getBusinessSettlementDetail({ id: infoId.value }).then((res) => {
form.value = res.data
- form.value.phone = res.data.customerPhone
- list.value = res.data.sampleList.map((item: { postedPrice: number; id: string }) => {
+ receivedAmountList.value = res.data.amountDetailsList.filter((item: { moneyType: string }) => `${item.moneyType}` === '1')
+ invoiceAmountList.value = res.data.amountDetailsList.filter((item: { moneyType: string }) => `${item.moneyType}` === '2')
+ list.value = res.data.sampleDetailsList.map((item: { editable: boolean; orderTime: string }) => {
return {
...item,
- price: calc(Number(item.postedPrice), 100, '/') as number,
- isEdit: pageType.value === 'edit',
- relationId: item.id,
+ editable: pageType.value !== 'detail',
+ orderTime: item.orderTime ? dayjs(item.orderTime).format('YYYY-MM-DD') : item.orderTime,
}
})
- form.value.priceFront = calc(Number(res.data.postedPrice), 100, '/') as number // 标价
- // form.value.suggestedDiscount = // 建议折扣
- form.value.suggestedPrice = calc(Number(res.data.suggestedPrice), 100, '/') as number// 建议价格
- form.value.extraCharge = calc(Number(res.data.extraCharge), 100, '/') as number// 附加费用-单位分
- // form.value.extraChargeIllustration = // 附加费用说明
- form.value.totalSettlement = calc(Number(res.data.totalSettlement), 100, '/') as number // 总计结算费用
- })
+ form.value.orderTime = res.data.sampleDetailsList[0].orderTime // 委托日期
+ form.value.sampleCount = res.data.sampleDetailsList.length // 样品数量
+ loading.close()
+ }).catch(() => loading.close())
}
onMounted(() => {
@@ -278,10 +437,10 @@
>
-
+
@@ -294,51 +453,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -467,17 +645,26 @@
-
-
+
+
+
+ 增加行
+
+
+ 删除行
+
+
handleSelectionChange(e, 'addReceived')"
>
+
*{{ item.text }}
-
-
-
- {{ scope.row[item.value] }}
+
+
+
+
+ {{ '上传' }}
+
+
+
+ ×
+
+
+
onFileChange(e, scope.row, 'receivedAmount')">
+
+
+
+
+ 增加行
+
+
+ 删除行
+
+
+ handleSelectionChange(e, 'invoiceAmount')"
+ >
+
+
+
+
+ *{{ item.text }}
+
+
+
+
+
+
+
+ {{ '上传' }}
+
+
+
+ ×
+
+
+
onFileChange(e, scope.row, 'receivedAmount')">
+
+
+
+
+
+
+
+
diff --git a/src/views/finance/businessSettlement/list.vue b/src/views/finance/businessSettlement/list.vue
index eea28d8..2852223 100644
--- a/src/views/finance/businessSettlement/list.vue
+++ b/src/views/finance/businessSettlement/list.vue
@@ -2,6 +2,8 @@
+
+
+
+
+
+
diff --git a/src/components/MultiHeaderTable/tableColumn.vue b/src/components/MultiHeaderTable/tableColumn.vue
new file mode 100644
index 0000000..2b87285
--- /dev/null
+++ b/src/components/MultiHeaderTable/tableColumn.vue
@@ -0,0 +1,147 @@
+
+
+
+
+
+
+
+
+
+
+ *{{ item.text }}
+
+
+ *{{ item.text }}
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ scope.row[item.value] }}
+
+
+ {{
+ scope.row[item.value]
+ }}
+
+
+
+
+
+
diff --git a/src/components/NormalTable/index.vue b/src/components/NormalTable/index.vue
index e56f775..67092d3 100644
--- a/src/components/NormalTable/index.vue
+++ b/src/components/NormalTable/index.vue
@@ -3,6 +3,7 @@
import { ElTable } from 'element-plus'
import { defineExpose, ref } from 'vue'
import type { TableColumn } from './table_interface'
+import showPhoto from '@/views/system/tool/showPhoto.vue'
// ------------------定义props、 emit-------------------
const props = defineProps({
@@ -212,8 +213,8 @@
{{ scope.row[column.value] }}
{{ column.filter(scope.row) }}
- {{ scope.row }}
-
+
+
diff --git a/src/utils/useCheckList.ts b/src/utils/useCheckList.ts
new file mode 100644
index 0000000..c7782f0
--- /dev/null
+++ b/src/utils/useCheckList.ts
@@ -0,0 +1,73 @@
+import { ElMessage } from 'element-plus'
+// import type { TableColumn } from '@/components/NormalTable/table_interface'
+
+/**
+ * 检查列表
+ * @param list 要检查的表格数据(被依赖项如果满足某个条件就去检查依赖项,否则不检查依赖项)
+ * @param columns // 表头信息
+ * @param tableTitle // 表格名称
+ * @param depend // 依赖项
+ * @param depended // 被依赖项
+ * @param dependedValue // 被依赖项条件
+ * @param requireLength // 要检查的表格数据长度是否大于0
+ */
+export default function useCheckList(list: any, columns: any, tableTitle = '', depend?: string, depended?: string, dependedValue?: number | string, requireLength = false): boolean {
+ for (const prop of columns) {
+ for (let index = 0; index < list.length; index++) {
+ const item = list[index]
+
+ if (depend && depended && item[depended] === dependedValue && !(`${item[prop.value]}`)) { // 被依赖项满足条件时需要检查
+ ElMessage.warning(`请先完善 ${tableTitle} 第${index + 1}行中 ${prop.text} 字段`)
+ return false
+ }
+ else {
+ // 检查必填
+ if (prop.required && (!(`${item[prop.value]}`) || `${item[prop.value]}` === 'null' || `${item[prop.value]}` === 'undefined' || item[prop.value] == undefined)) {
+ if (`${prop.belongStandardEquipment}` === '15') { // 小功率
+ ElMessage.warning(`${tableTitle} 第${index + 1}行中 ${prop.message} ${prop.text} 字段不能为空`)
+ }
+ else {
+ ElMessage.warning(`请先完善 ${tableTitle} 第${index + 1}行中 ${prop.text} 字段`)
+ }
+ return false
+ }
+ }
+
+ // 验证正则
+ if (prop.reg && typeof prop.reg === 'function') {
+ if (prop.value === 'resolution') { // 分辨力特殊处理
+ if (!prop.reg(item[prop.value])) {
+ ElMessage.warning(`${tableTitle} 第${index + 1}行中 ${prop.text} 不能大于1`)
+ return false
+ }
+ }
+ else {
+ if (!prop.reg(item[prop.value])) {
+ if (`${prop.belongStandardEquipment}` === '15') { // 小功率
+ ElMessage.warning(`${tableTitle} 第${index + 1}行中 ${prop.message} ${prop.text} 字段不能为0`)
+ }
+ else if (`${prop.belongStandardEquipment}` === '17') { // S参数
+ ElMessage.warning(`${tableTitle} 第${index + 1}行中 ${prop.text} 仅允许输入数字、字母、特殊字符`)
+ }
+ else {
+ ElMessage.warning(`${tableTitle} 第${index + 1}行中 ${prop.text} 字段输入不合法`)
+ }
+ return false
+ }
+ }
+ }
+
+ if (prop.children && prop.children.length) {
+ if (!useCheckList(list, prop.children, tableTitle, depend, depended, dependedValue)) {
+ return false
+ }
+ }
+ }
+ }
+
+ if (requireLength && !list.length) {
+ ElMessage.warning(`${tableTitle}表格数据不能为空`)
+ return false
+ }
+ return true
+}
diff --git a/src/views/business/lab/components/selectOrderSamplesDialog.vue b/src/views/business/lab/components/selectOrderSamplesDialog.vue
index 4002f83..b004107 100644
--- a/src/views/business/lab/components/selectOrderSamplesDialog.vue
+++ b/src/views/business/lab/components/selectOrderSamplesDialog.vue
@@ -14,6 +14,7 @@
const loadingTable = ref(false) // loading
const list = ref([]) // 表格参数
const tableRef = ref()
+const isMulti = ref(true) // 是否多选默认为多选
const columns = ref
([
{ text: '被测样品名称', value: 'sampleName', align: 'center', required: true },
{ text: '型号规格', value: 'sampleModel', align: 'center', required: true },
@@ -60,9 +61,10 @@
}
// 初始化
-const initDialog = (orderIdParam: string) => {
+const initDialog = (orderIdParam: string, isMultiParam = true) => {
dialogFormVisible.value = true
orderId.value = orderIdParam
+ isMulti.value = isMultiParam
getList()
}
defineExpose({ initDialog })
@@ -78,7 +80,7 @@
:columns="columns"
is-showmulti-select
:list-loading="loadingTable"
- :is-multi="true"
+ :is-multi="isMulti"
:height="300"
:pagination="false"
@multi-select="handleSelectionChange"
diff --git a/src/views/business/lab/components/selectReportTemplate.vue b/src/views/business/lab/components/selectReportTemplate.vue
index 5c59693..ec36ef7 100644
--- a/src/views/business/lab/components/selectReportTemplate.vue
+++ b/src/views/business/lab/components/selectReportTemplate.vue
@@ -7,8 +7,9 @@
import type { typeofSign } from '@/views/system/tool/tool_interface'
import { templatePage } from '@/api/system/tool'
-const emits = defineEmits(['add'])
+const emits = defineEmits(['confirm'])
const dialogFormVisible = ref(false) // 控制弹窗显隐
+const createTime = ref()
// 查询参数
const searchQuery = reactive({
templateNo: '', // 编号
@@ -18,31 +19,43 @@
createEndTime: '',
limit: 5,
offset: 1,
- templateType: '',
+ certificationType: '0',
ids: [] as string[],
}) // 查询参数
const loadingTable = ref(false) // loading
const list = ref([]) // 表格参数
const total = ref(0)
const columns = ref([
- { text: '编号', value: 'templateNo', align: 'center', width: '180' },
- { text: '模板名称', value: 'templateName', align: 'center', width: '150' },
- { text: '模板负责人', value: 'templateCreator', align: 'center', width: '100' },
- { text: '创建时间', value: 'createTime', align: 'center', width: '250' },
- { text: '描述', value: 'templateDesc', align: 'center' },
+ { text: '编号', value: 'templateNo', align: 'center', width: '160' },
+ { text: '模板名称', value: 'templateName', align: 'center' },
+ { text: '模板类型', value: 'templateTypeName', align: 'center', width: '100' },
+ { text: '负责人', value: 'templateCreator', align: 'center', width: '100' },
+ { text: '内容描述', value: 'templateDesc', align: 'center' },
+ { text: '创建时间', value: 'createTime', align: 'center', width: '180' },
])
const checkoutList = ref([]) // 多选选中参数
-// 获取类型
-const getType = async () => {
- const res = await getDictByCode('templateType')
- searchQuery.templateType = res.data.filter((item: typeofSign) => item.name === '证书报告模板')[0].value
+// ---------------------------------------字典--------------------------------------------
+const templateTypeMap = ref([]) as any // 模板类型
+// 获取字典值
+async function getDict() {
+ // 模板类型
+ const res = await getDictByCode('certificationType')
+ res.data.forEach((item: { value: string; name: string }) => {
+ templateTypeMap.value[`${item.value}`] = item.name
+ })
}
+// ----------------------------------------------------------------------------------------------
// 获取数据列表
const getList = () => {
loadingTable.value = true
templatePage(searchQuery).then((res) => {
if (res.code === 200) {
- list.value = res.data.rows
+ list.value = res.data.rows.map((item: { certificationType: string }) => {
+ return {
+ ...item,
+ templateTypeName: `${item.certificationType}` ? templateTypeMap.value[item.certificationType] : item.certificationType, // 模板类型
+ }
+ })
total.value = res.data.total
}
loadingTable.value = false
@@ -74,7 +87,8 @@
searchQuery.createEndTime = ''
searchQuery.limit = 5
searchQuery.offset = 1
- // searchQuery.templateType = '' // 类型不能变
+ searchQuery.certificationType = '0'
+ createTime.value = ''
searchQuery.ids = []
getList()
}
@@ -82,10 +96,10 @@
// 点击保存
const submitForm = () => {
if (!checkoutList.value.length) {
- ElMessage.warning('请选择证书报告模板')
+ ElMessage.warning('请选择证书模板')
}
else {
- emits('add', checkoutList.value[0])
+ emits('confirm', checkoutList.value[0])
dialogFormVisible.value = false
}
}
@@ -103,15 +117,25 @@
// 初始化
const initDialog = () => {
dialogFormVisible.value = true
- getType().then((_) => {
+ getDict().then((_) => {
getList()
})
}
+watch(() => createTime.value, (newVal) => {
+ if (newVal) {
+ searchQuery.createStartTime = newVal[0]
+ searchQuery.createEndTime = newVal[1]
+ }
+ else {
+ searchQuery.createStartTime = ''
+ searchQuery.createEndTime = ''
+ }
+})
defineExpose({ initDialog })
-
+
@@ -121,7 +145,18 @@
-
+
+
+
+
diff --git a/src/views/business/lab/measureData/dialog/selectMeasueDataDialog.vue b/src/views/business/lab/measureData/dialog/selectMeasueDataDialog.vue
new file mode 100644
index 0000000..f8be703
--- /dev/null
+++ b/src/views/business/lab/measureData/dialog/selectMeasueDataDialog.vue
@@ -0,0 +1,199 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ (listQuery.offset - 1) * listQuery.limit + scope.$index + 1 }}
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/views/business/lab/measureData/dialog/selectTechFilesDialog.vue b/src/views/business/lab/measureData/dialog/selectTechFilesDialog.vue
new file mode 100644
index 0000000..f6f1a5a
--- /dev/null
+++ b/src/views/business/lab/measureData/dialog/selectTechFilesDialog.vue
@@ -0,0 +1,247 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ (listQuery.offset - 1) * listQuery.limit + scope.$index + 1 }}
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/views/business/lab/measureData/measureData-interface.ts b/src/views/business/lab/measureData/measureData-interface.ts
index 8319f65..d25a212 100644
--- a/src/views/business/lab/measureData/measureData-interface.ts
+++ b/src/views/business/lab/measureData/measureData-interface.ts
@@ -1,13 +1,14 @@
// 查询条件
export interface IListQuery {
- approvalStatus: string // 审批状态
- certificateReportCode: string // 证书编号
- certificateReportName: string // 证书名称
- customerName: string // 委托方名称
- sampleName: string // 样品名称
- measureCategory: string // 检校类别
- approvalStatusName: string // 审批状态名称
- formId: string
+ approvalStatus: string // 审批状态类型code
+ certificateReportCode: string // 证书编号
+ certificateReportName: string // 证书名称
+ customerName: string // 委托方名称
+ formId: string // 表单id(流程定义对应的表单id,等价于业务id)
+ measureCategory: string // 检校类别
+ orderCode: string // 委托书编号
+ sampleName: string // 样品名称
+ sampleNo: string // 样品编号
offset: number
limit: number
}
@@ -28,47 +29,53 @@
calibrationTime: string // 检校日期
taskId?: string // 任务id 用于审批
decisionItem?: string
- applyApprovalStatusName?: string // 审批状态名称
+ approvalStatusName?: string // 审批状态名称
processId?: string // 流程实例id
}
// 表单
export interface IForm {
- tdysczs: number // 替代已生成证书
+ id?: string
+ invalid: number // 替代已生成证书
formId: string
- yzs: string // 原证书
+ oldCertificateCode: string // 原证书
calibrationMajor: string // 检校专业
- certifications: string // 证书类别
+ calibrationMajorName: string // 检校专业名称
+ certificateReportCategory: string // 证书类别
+ certificateReportCategoryName: string // 证书类别名称
certificateReportCode: string // 证书编号
certificateReportName: string // 证书名称
- jdy: string // 检定员
- jjrq: string // 检校日期
+ measurePerson: string // 检定员
+ measurePersonId: string // 检定员id
+ calibrationTime: string // 检校日期
orderCode: string // 委托书
orderId: string // 委托书id
customerId?: string // 委托放id
customerName: string // 委托方名称
+ customerAddress: string // 委托方地址
certificationCompany: string // 证书单位名称
certificationCompanyAddress: string // 证书单位地址
calibrationPlace: string // 检校地点
- fjsj: string // 复校时间
- jssj: string // 接收时间
- jdjg: string // 检定结果
- environmentCode: string// 环境记录单编号
+ repeatTime: string // 复校时间
+ deliverTime: string // 接收时间
+ measureResult: string // 检定结果
+ environmentCode: string // 环境记录单编号
environmentId: string // 环境记录单id
temperature: string // 温度
humidity: string // 湿度
+ techFilesName: string // 依据的技术文件名称
signId: string // 电子签章id
signName: string // 电子签章名称
approvalSignIds: string // 认可标志专用章id
approvalSignName: string // 认可标志专用章名称
remark: string // 备注
- ywy: string // 业务员
+ busPersonId: string // 业务员id
+ busPersonName: string // 业务员名字
templateId: string // 证书模板
templateName: string // 证书模板
- templateNameFile: string // 证书模板文件
certificateReportFile: string // 证书报告附件
processId?: string // 流程实例id
@@ -76,6 +83,7 @@
// 被检样品
export interface ISampleList {
+ id: string // 样品id
sampleNo: string // 样品编号
sampleName: string // 样品名称
sampleModel: string // 型号
diff --git a/src/views/business/lab/measureData/measureDataDetail.vue b/src/views/business/lab/measureData/measureDataDetail.vue
index 4aa9717..c554c33 100644
--- a/src/views/business/lab/measureData/measureDataDetail.vue
+++ b/src/views/business/lab/measureData/measureDataDetail.vue
@@ -3,6 +3,7 @@
import { ElLoading, ElMessage, ElMessageBox } from 'element-plus'
import type { FormInstance, FormRules } from 'element-plus'
import { ref } from 'vue'
+import dayjs from 'dayjs'
import EnvironmentalDialog from '../components/environmentalDialog.vue'
import selectSignature from '../components/selectSignature.vue'
import selectReportTemplate from '../components/selectReportTemplate.vue'
@@ -10,10 +11,12 @@
import SelectSamplesDialog from '../components/selectSamplesDialog.vue'
import selectMeasureDevice from '../components/selectMeasureDevice.vue'
import type { IEquipmentList, IForm, ISampleList } from './measureData-interface'
+import selectMeasueDataDialog from './dialog/selectMeasueDataDialog.vue'
+import selectTechFilesDialog from './dialog/selectTechFilesDialog.vue'
import { UploadFile } from '@/api/measure/file'
import ApprovalDialog from '@/components/Approval/ApprovalDialog.vue'
import type { TableColumn } from '@/components/NormalTable/table_interface'
-import { addApply, detail, failUpdateApply, submit, updateApply } from '@/api/business/subpackage/apply'
+import { addMeasureData, downLoadTemplate, draftUpdateMeasureData, failUpdateMeasureData, getMeasureDataDetail, submit } from '@/api/business/lab/measureData'
import { cancelApproval, fetchApproval, submitApproval } from '@/api/approval'
import showPhoto from '@/views/system/tool/showPhoto.vue'
import { getDictByCode } from '@/api/system/dict'
@@ -21,6 +24,9 @@
import selectOrder from '@/views/business/schedule/interchangeReceipt/selectOrder.vue'
import { downloadFile } from '@/utils/download'
import type { dictType } from '@/global'
+import { getUserList } from '@/api/system/user'
+import { exportFile } from '@/utils/exportUtils'
+
const user = useUserStore() // 用户信息
const textMap: { [key: string]: string } = {
edit: '编辑',
@@ -31,6 +37,8 @@
const $router = useRouter() // 关闭页面使用
const $route = useRoute()
const query = $route.query
+console.log('opopopop', query)
+
const approvalDialog = ref() // 审批对话ref
const pageType = ref('add') // 页面类型: add, edit, detail
const infoId = ref('') // 列表id
@@ -38,57 +46,63 @@
const orderVisible = ref(false) // 控制委托单对话框显隐
const ruleFormRef = ref() as any
const form = ref({
- tdysczs: 0, // 替代已生成证书
+ invalid: 0, // 替代已生成证书
formId: query.formId as string,
- yzs: '', // 原证书
+ oldCertificateCode: '', // 原证书
calibrationMajor: '', // 检校专业
- certifications: '', // 证书类别
+ calibrationMajorName: '', // 检校专业名称
+ certificateReportCategory: '', // 证书类别
+ certificateReportCategoryName: '', // 证书类别名称
certificateReportCode: '', // 证书编号
certificateReportName: '', // 证书名称
- jdy: '', // 检定员
- jjrq: '', // 检校日期
+ measurePerson: '', // 检定员
+ measurePersonId: '', // 检定员id
+ calibrationTime: '', // 检校日期
- orderCode: '', // 委托单
+ orderCode: '', // 委托单编号
orderId: '', // 委托单id
customerName: '', // 委托方名称
+ customerAddress: '', // 委托方地址
certificationCompany: '', // 证书单位名称
certificationCompanyAddress: '', // 证书单位地址
calibrationPlace: '', // 检校地点
- fjsj: '', // 复校时间
- jssj: '', // 接收时间
- jdjg: '', // 检定结果
+ repeatTime: '', // 复校时间
+ deliverTime: '', // 接收时间
+ measureResult: '', // 检定结果
environmentCode: '', // 环境记录单编号
environmentId: '', // 环境记录单id
temperature: '', // 温度
humidity: '', // 湿度
+ techFilesName: '', // 依据的技术文件名称
signId: '', // 电子签章id
signName: '', // 电子签章名称
approvalSignIds: '', // 认可标志专用章id
approvalSignName: '', // 认可标志专用章名称
remark: '', // 备注
- ywy: '', // 业务员
+ busPersonId: '', // 业务员id
+ busPersonName: '', // 业务员名字
templateId: '', // 证书模板
templateName: '', // 证书模板
- templateNameFile: '', // 证书模板文件
certificateReportFile: '', // 证书报告附件
})
// 校验规则
const formRules = ref({
- yzs: [{ required: true, message: '原证书必填', trigger: ['blur', 'change'] }],
+ oldCertificateCode: [{ required: true, message: '原证书必填', trigger: ['blur', 'change'] }],
calibrationMajor: [{ required: true, message: '检校专业必填', trigger: ['blur', 'change'] }],
- certifications: [{ required: true, message: '证书类别必填', trigger: ['blur', 'change'] }],
+ certificateReportCategory: [{ required: true, message: '证书类别必填', trigger: ['blur', 'change'] }],
certificateReportName: [{ required: true, message: '证书名称必填', trigger: ['blur', 'change'] }],
customerName: [{ required: true, message: '委托方名称必填', trigger: ['blur', 'change'] }],
+ customerAddress: [{ required: true, message: '委托方地址必填', trigger: ['blur', 'change'] }],
certificationCompany: [{ required: true, message: '证书单位名称必填', trigger: ['blur', 'change'] }],
certificationCompanyAddress: [{ required: true, message: '证书单位地址必填', trigger: ['blur', 'change'] }],
calibrationPlace: [{ required: true, message: '检校地点必填', trigger: ['blur', 'change'] }],
- jdy: [{ required: true, message: '检定员必填', trigger: ['blur', 'change'] }],
- jjrq: [{ required: true, message: '检校日期必填', trigger: ['blur', 'change'] }],
- fjsj: [{ required: true, message: '复校时间必填', trigger: ['blur', 'change'] }],
- jssj: [{ required: true, message: '接收时间必填', trigger: ['blur', 'change'] }],
- jdjg: [{ required: true, message: '检定结果必填', trigger: ['blur', 'change'] }],
+ measurePersonId: [{ required: true, message: '检定员必填', trigger: ['blur', 'change'] }],
+ calibrationTime: [{ required: true, message: '检校日期必填', trigger: ['blur', 'change'] }],
+ repeatTime: [{ required: true, message: '复校时间必填', trigger: ['blur', 'change'] }],
+ deliverTime: [{ required: true, message: '接收时间必填', trigger: ['blur', 'change'] }],
+ measureResult: [{ required: true, message: '检定结果必填', trigger: ['blur', 'change'] }],
temperature: [
{ required: true, message: '温度必填', trigger: ['blur', 'change'] },
{ pattern: /(^-?\d\d*\.\d*$)|(^-?\d\d*$)|(^-?\.\d\d*$)/, message: '温度只能为数字', trigger: ['blur', 'change'] },
@@ -111,6 +125,7 @@
// ---------------------------------------字典--------------------------------------------
const certificationTypeMap = ref([]) // 证书类别
const calibrationMajorMap = ref([]) // 校检专业
+const userList = ref([]) // 检定员
// 获取字典值
async function getDict() {
// 校检专业
@@ -119,12 +134,22 @@
// 证书类别
const rescertificationType = await getDictByCode('certificationType')
certificationTypeMap.value = rescertificationType.data
+
+ // 获取人员列表
+ getUserList({ offset: 1, limit: 99999 }).then((res) => {
+ userList.value = res.data.rows
+ })
}
getDict()
// -------------------------------------原证书--------------------------------------------
+const selectMeasueDataDialogRef = ref() // 选择原证书组件ref
// 点击选择原证书
const selectOrigin = () => {
- //
+ selectMeasueDataDialogRef.value.initDialog()
+}
+// 选好原证书
+const selectMeasueDataConfirm = (val: any) => {
+ getDetail(val.id, val.certificateReportCode)
}
// ------------------------------------委托单------------------------------------------
// 点击选择委托单编号
@@ -142,12 +167,17 @@
form.value.orderCode = val[0].orderCode // 委托单
form.value.customerId = val[0].customerId// 委托方id
form.value.customerName = val[0].customerName// 委托方名称
+ form.value.customerAddress = val[0].customerAddress// 委托方地址
form.value.certificationCompany = val[0].certificationCompany// 证书单位名称
form.value.certificationCompanyAddress = val[0].certificationCompanyAddress// 证书单位地址
+ form.value.certificationCompanyAddress = val[0].certificationCompanyAddress// 证书单位地址
+ form.value.busPersonId = val[0].busPersonId// 业务员id
+ form.value.busPersonName = val[0].busPersonName// 业务员名字
}
}
// -------------------------------选择环境记录单----------------------------------------
+const businessEnvironmentRecord = ref({}) as any // 环境记录单信息
// 选择环境记录单Ref
const environmentalDialog = ref()
// 选择环境记录单
@@ -156,6 +186,7 @@
}
// 选择环境记录单表格确认
const environmentalAdd = (data: any) => {
+ businessEnvironmentRecord.value = data
form.value.environmentId = data.id // 环境记录单id
form.value.environmentCode = data.environmentCode // 环境记录单编号
form.value.temperature = data.temperature // 温度
@@ -200,35 +231,16 @@
}
// -----------------------------------------所依据的技术文件----------------------------------
+const selectTechFilesRef = ref()
+const fileList = ref([]) // 依据的技术文件
// 点击所依据的技术文件
const selectTechFiles = () => {
- //
+ selectTechFilesRef.value.initDialog()
}
-// --------------------------------------证书模板------------------------------------------
-// 选择证书模板Ref
-const templateDialog = ref()
-// 选择证书模板
-const handleClickTemplate = () => {
- templateDialog.value.initDialog()
-}
-// 选择证书模板确认
-const confirmCheckoutTemplate = (val: any) => {
- form.value.templateId = val.id // 证书报告模板id
- form.value.templateName = val.templateName || '' // 证书报告模板名称
- form.value.templateNameFile = val.minioFileName // 证书模板附件
-}
-
-// 点击下载证书模板按钮
-const downloadCertTemplate = () => {
- if (!form.value.templateId) {
- ElMessage.warning('请先选择证书模板')
- return false
- }
- if (!form.value.templateNameFile) {
- ElMessage.warning('选择的证书模板无附件,请检查')
- return false
- }
- downloadFile(form.value.templateNameFile as any, `${form.value.templateName}-${form.value.templateNameFile}`)
+// 选好依据的技术文件
+const selectTechFilesConfirm = (val: any) => {
+ fileList.value = val
+ form.value.techFilesName = val.map((item: { fileName: string }) => item.fileName).join(',')
}
// ---------------------------------文件上传(上传证书)-------------------------------------------
@@ -283,10 +295,10 @@
// 点击批量添加/选择
const addSample = () => {
- if (form.value.orderId) {
- selectOrderSamplesDialogRef.value.initDialog(form.value.orderId)
+ if (form.value.orderId) { // 选择委托单下的样品
+ selectOrderSamplesDialogRef.value.initDialog(form.value.orderId, false)
}
- else {
+ else { // 选择样品库中的样品
selectSamplesDialogRef.value.initDialog()
}
}
@@ -318,7 +330,7 @@
}
// ----------------------------------------------所用的计量标准器具--------------------------------------------
const equipmentVisible = ref(false) // 选择设备对话框显隐
-const equipmentList = ref([])// 表格数据
+const equipmentInfoList = ref([])// 表格数据
const checkoutEquipmentList = ref([])// 多选设备
// 表头
const equipmentColumns = ref([
@@ -328,8 +340,8 @@
{ text: '出厂编号', value: 'manufacturingNo', align: 'center' },
{ text: '测量范围', value: 'mesureRange', align: 'center' },
{ text: '不确定度', value: 'uncertainty', align: 'center' },
- { text: '溯源机构', value: 'syjg', align: 'center' },
- { text: '证书编号', value: 'zsbh', align: 'center' },
+ { text: '溯源机构', value: 'mesureDeptName', align: 'center' },
+ // { text: '证书编号', value: 'zsbh', align: 'center' },
{ text: '有效日期', value: 'validDate', align: 'center' },
])
@@ -351,9 +363,9 @@
const confirmSelectEquipment = (val: any) => {
val.forEach((item: IEquipmentList) => {
// 只添加列表里不存在的
- const index = equipmentList.value.findIndex((i: IEquipmentList) => item.equipmentNo === i.equipmentNo)
+ const index = equipmentInfoList.value.findIndex((i: IEquipmentList) => item.equipmentNo === i.equipmentNo)
if (index === -1) {
- equipmentList.value.push(item)
+ equipmentInfoList.value.push(item)
}
})
}
@@ -365,28 +377,109 @@
return false
}
checkoutEquipmentList.value.forEach((item: IEquipmentList) => {
- equipmentList.value.forEach((element, index) => {
+ equipmentInfoList.value.forEach((element, index) => {
if (element.equipmentNo === item.equipmentNo) {
- equipmentList.value.splice(index, 1)
+ equipmentInfoList.value.splice(index, 1)
}
})
})
}
+
+// --------------------------------------证书模板------------------------------------------
+// 选择证书模板Ref
+const templateDialogRef = ref()
+// 选择证书模板
+const handleClickTemplate = () => {
+ templateDialogRef.value.initDialog()
+}
+// 选择证书模板确认
+const confirmCheckoutTemplate = (val: any) => {
+ form.value.templateId = val.id // 证书报告模板id
+ form.value.templateName = val.templateName || '' // 证书报告模板名称
+}
+
+// 点击下载证书模板按钮
+const downloadCertTemplate = () => {
+ if (!form.value.templateId) {
+ ElMessage.warning('请先选择证书模板')
+ return false
+ }
+ if (!sampleList.value.length) {
+ ElMessage.warning('被检样品不能为空')
+ return false
+ }
+ if (!equipmentInfoList.value.length) {
+ ElMessage.warning('所用的计量标准器具不能为空')
+ return false
+ }
+
+ ruleFormRef.value.validate((valid: boolean) => {
+ if (valid) {
+ const params = solveParams()
+ const loading = ElLoading.service({
+ lock: true,
+ background: 'rgba(255, 255, 255, 0.8)',
+ })
+ downLoadTemplate(params).then((res) => {
+ exportFile(res.data, `${form.value.certificateReportName}.xls`)
+ loading.close()
+ }).catch(() => {
+ loading.close()
+ })
+ }
+ })
+}
+
// -------------------------------------------------------------------------------------------
+// 处理保存、下载模板参数
+function solveParams() {
+ const params = {
+ ...form.value,
+ businessEnvironmentRecord: businessEnvironmentRecord.value, // 环境记录单
+ fileList: fileList.value, // 依据的技术文件
+ equipmentInfoList: equipmentInfoList.value, // 所用的计量标准器具列表/监测设备
+ sampleId: sampleList.value[0].id, // 样品id(打印证书接口要必传)
+ sampleNo: sampleList.value[0].sampleNo, // 样品编号
+ sampleName: sampleList.value[0].sampleName, // 样品名称
+ sampleModel: sampleList.value[0].sampleModel, // 样品型号
+ manufacturingNo: sampleList.value[0].manufacturingNo, // 出厂编号
+ manufacturer: sampleList.value[0].manufacturer, // 生产厂家
+ sampleRemark: sampleList.value[0].remark, // 样品备注
+ id: pageType.value === 'add' ? '' : form.value.id,
+ }
+ return params
+}
// 获取详情信息
-const getDetail = () => {
+function getDetail(id?: string, certificateReportCode?: string) {
const loading = ElLoading.service({
lock: true,
background: 'rgba(255, 255, 255, 0.8)',
})
- detail({ id: $route.params.id as string }).then((res) => {
+ getMeasureDataDetail({ id: infoId.value! || id! }).then((res) => {
loading.close()
form.value = res.data
- form.value.createUserName = res.data.applicantName || user.name
- list.value = res.data.sampleList.filter((item: ISampleList) => {
- return item !== null
- })
+ sampleList.value = [{
+ sampleNo: res.data.sampleNo, // 样品编号
+ sampleName: res.data.sampleNo, // 样品名称
+ sampleModel: res.data.sampleNo, // 型号
+ manufacturingNo: res.data.sampleNo, // 出厂编号
+ manufacturer: res.data.sampleNo, // 生产厂家
+ remark: res.data.sampleRemark, // 备注
+ id: res.data.sampleId,
+ }]
+ equipmentInfoList.value = res.data.equipmentInfoList.map((item: { validDate: string }) => {
+ return {
+ ...item,
+ validDate: item.validDate ? dayjs(item.validDate).format('YYYY-MM-DD') : item.validDate,
+ }
+ }) // 所用的计量标准器具
+ businessEnvironmentRecord.value = res.data.businessEnvironmentRecord // 环境记录单数据
+ form.value.environmentCode = res.data.businessEnvironmentRecord.environmentCode// 环境记录单编号
+ if (id && certificateReportCode) {
+ form.value.oldCertificateCode = certificateReportCode
+ form.value.invalid = 1
+ }
}).catch(() => {
loading.close()
})
@@ -399,10 +492,13 @@
// 保存
const handleSave = () => {
- const tempList = list.value.filter(item => item.sampleNo)
- if (!tempList.length) {
- ElMessage.warning('样品信息不能为空')
- return
+ if (!sampleList.value.length) {
+ ElMessage.warning('被检样品不能为空')
+ return false
+ }
+ if (!equipmentInfoList.value.length) {
+ ElMessage.warning('所用的计量标准器具不能为空')
+ return false
}
ruleFormRef.value.validate((valid: boolean) => {
if (valid) {
@@ -410,32 +506,22 @@
lock: true,
background: 'rgba(255, 255, 255, 0.8)',
})
- // 样品&委托单列表(保存/编辑草稿接口入参使用)
- const temList = [] as any // 临时数组
- console.log('保存中的数组', list.value)
-
- list.value.forEach((item: any) => {
- if ((item.orderId && item.id) || (item.orderId && item.sampleId)) {
- temList.push({
- orderId: item.orderId,
- sampleId: item.id || item.sampleId,
- })
- }
- })
- form.value.orderSampleList = temList
+ const params = solveParams()
if (pageType.value === 'add') { // 新建
- addApply(form.value).then((res) => {
- submitId.value = res.data.id
- form.value.projectNo = res.data.projectNo // 分包项目编号
+ addMeasureData(params).then((res) => {
+ submitId.value = res.data.data.id
+ form.value.certificateReportCode = res.data.data.certificateReportCode
+ form.value.certificateReportName = res.data.data.certificateReportName
ElMessage.success('保存成功')
loading.close()
}).catch(() => {
loading.close()
})
}
+
else if (pageType.value === 'edit') { // 编辑
if (query.approvalStatusName === '未通过-驳回') { // 未通过-驳回
- failUpdateApply(form.value).then((res) => {
+ failUpdateMeasureData(params).then((res) => {
ElMessage.success('保存成功')
loading.close()
close()
@@ -444,7 +530,7 @@
})
}
else { // 草稿箱和已取消
- updateApply(form.value).then((res) => {
+ draftUpdateMeasureData(params).then((res) => {
ElMessage.success('保存成功')
loading.close()
close()
@@ -466,7 +552,7 @@
})
const params = {
id: submitId.value,
- formId: query.formId, // 表单id
+ formId: query.formId as string, // 表单id
}
submit(params).then(() => {
ElMessage.success('提交成功')
@@ -481,39 +567,6 @@
}
}
-const sampleVisible = ref(false)
-const projectVisible = ref(false)
-const isMulti = ref(false)
-const selectIndex = ref(0)
-// 点击选择
-const handleSelect = (index: number, row: ISampleList) => {
- sampleVisible.value = true // 选择设备对话框显隐
- isMulti.value = false // 是否单选, false单选、true表格多选
- selectIndex.value = index
-}
-
-const checkoutList = ref([]) // 选中的行
-
-// 修改委托方对话框显隐
-const changeSampleVisible = (val: boolean) => {
- sampleVisible.value = val
-}
-// 修改项目选择对话框显隐
-const changeProjectVisible = (val: boolean) => {
- projectVisible.value = val
-}
-
-// 删除行
-const delRow = () => {
- checkoutList.value.forEach((item: ISampleList) => {
- list.value.forEach((element, index) => {
- if (element.sampleNo === item.sampleNo) {
- list.value.splice(index, 1)
- }
- })
- })
-}
-
// ------------------------------------------审批-----------------------------------------
const approvalRecordData = ref([]) // 审批流程数据
@@ -573,11 +626,26 @@
// ------------------------------------事件-------------------------------------------------
// 检校专业变化
const changeCalibrationMajor = (val: string) => {
- form.value.certificateReportName = form.value.certificateReportCode + val + form.value.certifications
+ const index = calibrationMajorMap.value.findIndex((item: { value: string }) => item.value === val)
+ if (index !== -1) {
+ form.value.calibrationMajorName = calibrationMajorMap.value[index].name
+ }
+ console.log(form.value.calibrationMajorName)
}
// 证书类别变化
const changeCertifications = (val: string) => {
- form.value.certificateReportName = form.value.certificateReportCode + form.value.calibrationMajor + val
+ const index = certificationTypeMap.value.findIndex((item: { value: string }) => item.value === val)
+ if (index !== -1) {
+ form.value.certificateReportCategoryName = certificationTypeMap.value[index].name
+ }
+ console.log(form.value.certificateReportCategoryName)
+}
+// 选择检定员变化
+const changeMeasurePersonId = (val: string) => {
+ const index = userList.value.findIndex(item => item.id === val)
+ if (index !== -1) {
+ form.value.measurePerson = userList.value[index].name
+ }
}
// -------------------------------------------------------------------------------------
onMounted(async () => {
@@ -593,8 +661,9 @@
// form.value.createUser = user.id // 创建人id
// form.value.createUserName = user.name // 创建人
// form.value.applicantTime = proxy.dayjs().format('YYYY-MM-DD HH:mm:ss') // 申请时间
- form.value.jdy = user.name // 创建人
- form.value.jjrq = proxy.dayjs().format('YYYY-MM-DD') // 检校日期
+ form.value.measurePerson = user.name // 检定员名字
+ form.value.measurePersonId = user.id // 检定员id
+ form.value.calibrationTime = proxy.dayjs().format('YYYY-MM-DD') // 检校日期
}
})
@@ -606,7 +675,7 @@
上传证书
-
+
下载证书模板
@@ -641,25 +710,25 @@
label-width="140"
:rules="formRules"
>
-
+
-
+
替代已生成证书
-
-
+
+
-
+
选择
@@ -684,15 +753,15 @@
v-for="item in calibrationMajorMap"
:key="item.value"
:label="item.name"
- :value="item.name"
+ :value="item.value"
/>
-
+
@@ -720,7 +789,7 @@
/>
-
+
+
+
+
+
@@ -761,6 +841,18 @@
/>
+
+
+
+
+
-
-
+
+ filterable
+ @change="changeMeasurePersonId"
+ >
+
+
-
+
-
-
+
+
-
-
+
+
-
-
+
+
-
+
-
+
confirmSelectSample(val, 'order')" />
confirmSelectSample(val, 'warehouse')" />
+
+
+
+
diff --git a/src/views/business/lab/measureData/measureDataList.vue b/src/views/business/lab/measureData/measureDataList.vue
index 5c011b8..96ffa13 100644
--- a/src/views/business/lab/measureData/measureDataList.vue
+++ b/src/views/business/lab/measureData/measureDataList.vue
@@ -2,16 +2,19 @@
-
+
-
-
-
@@ -369,6 +385,7 @@
is-showmulti-select
@change="changePage"
@multi-select="handleSelectionChange"
+ @handleClickFollowLink="handleClickFollowLink"
>
@@ -483,3 +500,12 @@
+
+
diff --git a/src/views/business/schedule/interchangeReceipt/receiptEdit.vue b/src/views/business/schedule/interchangeReceipt/receiptEdit.vue
index 13ee3ab..877ea57 100644
--- a/src/views/business/schedule/interchangeReceipt/receiptEdit.vue
+++ b/src/views/business/schedule/interchangeReceipt/receiptEdit.vue
@@ -356,7 +356,7 @@
getInterchangeReceiptDetail({ id: infoId.value }).then((res) => {
dataForm.value = res.data // 表单
sampleList.value = res.data.customerSampleList // 样品列表
- dataForm.value.orderId = res.data.customerSampleList[0].orderId // orderId
+ dataForm.value.orderId = res.data.orderId // orderId
minioFileNameAutograph.value = res.data.recieverSignFile // 签名图片
loading.close()
})
diff --git a/src/views/finance/businessSettlement/businessSettlement-interface.ts b/src/views/finance/businessSettlement/businessSettlement-interface.ts
index 13a1a0c..454788f 100644
--- a/src/views/finance/businessSettlement/businessSettlement-interface.ts
+++ b/src/views/finance/businessSettlement/businessSettlement-interface.ts
@@ -4,6 +4,8 @@
customerNo: string // 委托方代码
customerName: string // 委托方名称
deliverer: string // 送样人
+ orderTimeStart: string // 委托日期开始
+ orderTimeEnd: string // 委托日期结束
offset: number
limit: number
}
@@ -14,17 +16,17 @@
orderCode: string // 委托书编号
customerNo: string // 委托方代码
customerName: string // 委托方名称
- deliverer: string // 送样人
- delivererTel: string // 联系方式
+ orderTime: string // 委托日期
sampleCount: string // 样品数量
- isUrgent: string // 是否加急
- createTime: string // 创建时间
- postedPrice: number // 标价(单位分)
- suggestedDiscount: string // 建议折扣-单位%
- suggestedPrice: number // 建议价格-单位分
- extraCharge: number // 附加费用-单位分
- extraChargeIllustration: string // 附加费用说明
- totalSettlement: number // 总计结算费用-单位分
+ sampleWarehouseName: string // 样品库房
+ certWarehouseName: string // 证书库房
+ feeStatus: string // 费用状态
+ received: string // 是否到账
+ actualTestFee: string // 检测费(实)(元)
+ shouldTestFee: string // 检测费(应)(元)
+ actualTotalFee: string // 实收合计(元)
+ receivedAmount: string // 到账金额(元)
+ invoiceAmount: string // 开票金额(元)
}
// 字典
@@ -49,21 +51,22 @@
// 表单
export interface IForm {
orderCode: string // 委托书编号
- orderId: string // 委托书编号
- deliverer: string // 送检人
- delivererTel: string // 送样人联系方式
- createTime: string // 委托单创建时间
- planDeliverTime: string // 预计送达时间
- requireOverTime: string // 要求检完时间
- customerNo: string // 委托方代码
- customerId: string // 委托方id
+ orderId: string // 委托单id
customerName: string // 委托方名称
- phone: string // 委托方电话
- priceFront: number // 标价
- suggestedDiscount: number // 建议折扣
- suggestedPrice: number // 建议价格
- extraCharge: number // 附加费用-单位分
- extraChargeIllustration: string // 附加费用说明
- totalSettlement: number // 总计结算费用
- samplePriceList: Array // 样品清单
+ orderTime: string // 委托日期
+ sampleCount: string // 样品数量
+ certificationCompany: string // 证书单位名称
+ certificationCompanyAddress: string // 证书单位地址
+ deliverer: string // 联系人
+ delivererTel: string // 联系方式
+ sampleWarehouse: string // 样品库房
+ certWarehouse: string // 证书库房
+ feeStatus: string // 费用状态
+ received: string // 是否到账
+ actualTestFee: Number // 检测费(实)(元)
+ shouldTestFee: Number // 检测费(应)(元)
+ actualTotalFee: Number // 实收合计(元)
+ receivedAmount: Number // 到账金额(元)
+ invoiceAmount: Number // 开票金额(元)
+ remark: string // 备注
}
diff --git a/src/views/finance/businessSettlement/edit.vue b/src/views/finance/businessSettlement/edit.vue
index e11f337..7630aeb 100644
--- a/src/views/finance/businessSettlement/edit.vue
+++ b/src/views/finance/businessSettlement/edit.vue
@@ -7,13 +7,18 @@
import { useRoute, useRouter } from 'vue-router'
import { el } from 'element-plus/es/locale'
import type { IForm, IsampleList } from './businessSettlement-interface'
+import multiTable from '@/components/MultiHeaderTable/index.vue'
+import { getDictByCode } from '@/api/system/dict'
+import { UploadFile } from '@/api/measure/file'
+import { calc } from '@/utils/useCalc'
+import type { dictType } from '@/global'
import type { TableColumn } from '@/components/NormalTable/table_interface'
import useUserStore from '@/store/modules/user'
import selectOrder from '@/views/business/schedule/interchangeReceipt/selectOrder.vue'
import type { IOrderList } from '@/views/business/schedule/order/orderList_interface'
import { getOrderDetail } from '@/api/business/schedule/order'
import { isNumber, validateMoney } from '@/utils/validate'
-import { calc } from '@/utils/useCalc'
+import useCheckList from '@/utils/useCheckList'
import { addBusinessSettlement, getBusinessSettlementDetail, updateBusinessSettlement } from '@/api/finance/businessSettlement'
const user = useUserStore() // 用户信息
const $route = useRoute()
@@ -27,54 +32,215 @@
// 表单数据
const form = ref({
orderCode: '', // 委托书编号
- orderId: '', // 委托书编号
- deliverer: '', // 送检人
- delivererTel: '', // 送样人联系方式
- createTime: '', // 委托单创建时间
- planDeliverTime: '', // 预计送达时间
- requireOverTime: '', // 要求检完时间
- customerNo: '', // 委托方代码
- customerId: '', // 委托方id
+ orderId: '', // 委托单id
customerName: '', // 委托方名称
- phone: '', // 委托方电话
- priceFront: 0, // 标价
- suggestedDiscount: 95, // 建议折扣
- suggestedPrice: 0, // 建议价格
- extraCharge: 0, // 附加费用-单位分
- extraChargeIllustration: '', // 附加费用说明
- totalSettlement: 0, // 总计结算费用
- samplePriceList: [], // 样品清单
+ orderTime: '', // 委托日期
+ sampleCount: '', // 样品数量
+ certificationCompany: '', // 证书单位名称
+ certificationCompanyAddress: '', // 证书单位地址
+ deliverer: '', // 联系人
+ delivererTel: '', // 联系方式
+ sampleWarehouse: '未入库', // 样品库房
+ certWarehouse: '未入库', // 证书库房
+ feeStatus: '未录费', // 费用状态
+ received: '未到账', // 是否到账
+ actualTestFee: 0, // 检测费(实)(元)
+ shouldTestFee: 0, // 检测费(应)(元)
+ actualTotalFee: 0, // 实收合计(元)
+ receivedAmount: 0, // 到账金额(元)
+ invoiceAmount: 0, // 开票金额(元)
+ remark: '', // 备注
})
-const ruleFormRef = ref() as any
-const list = ref([])// 表格数据
-const orderVisible = ref(false) // 控制委托书对话框显隐
-
-// 表头
-const columns = ref([
- { text: '样品编号', value: 'sampleNo', align: 'center', width: '170', required: false },
- { text: '样品名称', value: 'sampleName', align: 'center', required: false },
- { text: '型号', value: 'sampleModel', align: 'center', required: false },
- { text: '出厂编号', value: 'manufacturingNo', align: 'center', required: false },
- { text: '检定项目', value: 'measureContent', align: 'center', required: false },
- { text: '标价(元)', value: 'price', align: 'center', required: true, reg: validateMoney },
-])
// 表单校验规则
const rules = reactive({
- orderCode: [{ required: true, message: '委托书编号必填', trigger: 'blur' }],
- price: [{ required: true, message: '标价必填', trigger: ['blur', 'change'] },
- { pattern: /(^-?\d\d*\.\d*$)|(^-?\d\d*$)|(^-?\.\d\d*$)/, message: '标价只能为数字', trigger: ['blur', 'change'] }],
- suggestedDiscount: [{ required: true, message: '建议折扣必填', trigger: ['blur', 'change'] },
- { pattern: /^([0]|[1-9][0-9]*)$/, message: '建议折扣只能为正整数或0', trigger: ['blur', 'change'] }],
- extraCharge: [{ required: true, message: '附加费用必填', trigger: ['blur', 'change'] },
- { pattern: /(^[0-9](\d+)?(\.\d{1,2})?$)|(^\d\.\d{1,2}$)/, message: '要求不小于0,且最多保留两位小数', trigger: ['blur', 'change'] }],
- extraChargeIllustration: [{ required: true, message: '附加费用说明必填', trigger: 'blur' }],
+ orderCode: [{ required: true, message: '委托单编号必填', trigger: 'blur' }],
+ customerName: [{ required: true, message: '委托方名称必填', trigger: 'blur' }],
+ orderTime: [{ required: true, message: '委托日期必填', trigger: 'blur' }],
+ sampleCount: [{ required: true, message: '样品数量必填', trigger: 'blur' }],
+ certificationCompany: [{ required: true, message: '证书单位名称必填', trigger: 'blur' }],
+ certificationCompanyAddress: [{ required: true, message: '证书单位地址必填', trigger: 'blur' }],
+ deliverer: [{ required: true, message: '联系人必填', trigger: 'blur' }],
+ delivererTel: [{ required: true, message: '联系电话必填', trigger: 'blur' }],
+ sampleWarehouse: [{ required: true, message: '样品库房必填', trigger: 'blur' }],
+ certWarehouse: [{ required: true, message: '证书库房必填', trigger: 'blur' }],
+ feeStatus: [{ required: true, message: '费用状态必填', trigger: 'blur' }],
+ received: [{ required: true, message: '是否到账必填', trigger: 'blur' }],
+ actualTestFee: [{ required: true, message: '检测费(实)(元)必填', trigger: 'blur' }],
+ shouldTestFee: [{ required: true, message: '检测费(应)(元)必填', trigger: 'blur' }],
+ actualTotalFee: [{ required: true, message: '实收合计(元)必填', trigger: 'blur' }],
+ receivedAmount: [{ required: true, message: '到账金额(元)必填', trigger: 'blur' }],
+ invoiceAmount: [{ required: true, message: '开票金额(元)必填', trigger: 'blur' }],
})
+const ruleFormRef = ref() as any
+const orderVisible = ref(false) // 控制委托书对话框显隐
// ---------------------------------------路由参数--------------------------------------
if ($route.params && $route.params.type) {
pageType.value = $route.params.type as string
infoId.value = $route.params.id as string
}
+// ---------------------------------------字典--------------------------------------
+
+const financeSampleWarehouseList = ref([]) // 样品库房
+const financeCertWarehouseList = ref([]) // 证书库房
+const financeReceivedList = ref([]) // 是否到账
+// 获取字典值
+function getDict() {
+ // 样品库房
+ getDictByCode('financeSampleWarehouse').then((response) => {
+ financeSampleWarehouseList.value = response.data
+ })
+ // 证书库房
+ getDictByCode('financeCertWarehouse').then((response) => {
+ financeCertWarehouseList.value = response.data
+ })
+ // 是否到账
+ getDictByCode('financeReceived').then((response) => {
+ financeReceivedList.value = response.data
+ })
+}
+getDict()
+// -----------------------------------到账金额明细--------------------------------------------------
+const receivedAmountList = ref([]) as any // 到账金额明细
+const checkoutReceivedAmountList = ref([]) as any // 到账金额明细多选
+// 表头
+const receivedAmountcolumns = ref([
+ { text: '到账金额(元)', value: 'money', align: 'center', width: '220', required: true },
+ { text: '到账时间', value: 'moneyTime', align: 'center', width: '220', required: true },
+ { text: '附件', value: 'attachment', align: 'center', required: false },
+])
+
+// -------------------------------------开票金额明细--------------------------------------------------------------
+const invoiceAmountList = ref([]) as any // 开票金额明细
+const checkoutInvoiceAmountList = ref([]) as any // 开票金额明细多选
+// 表头
+const invoiceAmountcolumns = ref([
+ { text: '开票金额(元)', value: 'money', align: 'center', width: '220', required: true },
+ { text: '开票时间', value: 'moneyTime', align: 'center', width: '220', required: true },
+ { text: '附件', value: 'attachment', align: 'center', required: false },
+])
+
+// 多选发生改变时
+const handleSelectionChange = (e: any, type: 'addReceived' | 'invoiceAmount') => {
+ if (type === 'addReceived') { // 到账金额明细
+ checkoutReceivedAmountList.value = e
+ }
+ else { // 开票金额明细
+ checkoutInvoiceAmountList.value = e
+ }
+}
+
+// 点击增加行
+const addRow = (type: 'addReceived' | 'invoiceAmount') => {
+ if (type === 'addReceived') {
+ if (useCheckList(receivedAmountList.value, receivedAmountcolumns.value, '到账金额明细')) {
+ receivedAmountList.value.push({
+ money: undefined,
+ moneyTime: '',
+ attachment: [],
+ moneyType: '1',
+ })
+ }
+ }
+ else {
+ if (useCheckList(invoiceAmountList.value, invoiceAmountcolumns.value, '开票金额明细')) {
+ invoiceAmountList.value.push({
+ money: undefined,
+ moneyTime: '',
+ attachment: [],
+ moneyType: '2',
+ })
+ }
+ }
+}
+
+// 删除行
+const delRow = (type: 'addReceived' | 'invoiceAmount') => {
+ if ((type === 'addReceived' && checkoutReceivedAmountList.value.length <= 0) || (type === 'invoiceAmount' && checkoutInvoiceAmountList.value.length <= 0)) {
+ ElMessage({
+ message: '请选中要删除的行',
+ type: 'warning',
+ })
+ }
+ else {
+ if (type === 'addReceived') {
+ receivedAmountList.value = receivedAmountList.value.filter(
+ (item: any) => {
+ return !checkoutReceivedAmountList.value.includes(item)
+ },
+ )
+ }
+ else {
+ invoiceAmountList.value = invoiceAmountList.value.filter(
+ (item: any) => {
+ return !checkoutInvoiceAmountList.value.includes(item)
+ },
+ )
+ }
+ }
+}
+
+// ----------------------------------------上传附件----------------------------------------------------
+// 删除附件
+const del = (index: number, row: any) => {
+ row.value.attachment.splice(index, 1)
+}
+
+const fileRef = ref() // 文件上传input
+const onFileChange = (event: any, row?: any, type?: 'receivedAmount' | 'invoiceAmount') => {
+ // 原生上传
+ console.log(event.target.files)
+ const files = event.target.files
+ if (files.length !== 0) {
+ // 创建formdata对象
+ const fd = new FormData()
+ for (var i = 0; i < files.length; i++) {
+ fd.append('multipartFile', files[i])
+ }
+ UploadFile(fd).then((res) => {
+ if (res.code === 200) {
+ res.data.forEach((item: string) => {
+ row.attachment.push({
+ minioFileName: item,
+ })
+ })
+ ElMessage.success('文件上传成功')
+ }
+ else {
+ ElMessage.error(res.message)
+ }
+ })
+ }
+}
+const upload = () => {
+ fileRef.value.click()
+}
+// ------------------------------------结算明细--------------------------------------------------------------------
+const list = ref([]) // 开票金额明细
+// 表头
+const columns = ref([
+ { text: '器具名称', value: 'sampleName', align: 'center', required: true, type: 'text' },
+ { text: '型号规格', value: 'sampleModel', align: 'center', width: '180', required: true, type: 'input' },
+ { text: '套数/退', value: 'sets', align: 'center', required: true, width: '180', type: 'inputNumber' },
+ { text: '出厂编号', value: 'manufacturingNo', align: 'center', width: '180', required: true, type: 'input' },
+ { text: '委托日期', value: 'orderTime', align: 'center', required: true, width: '160', type: 'date' },
+ { text: '检测规范', value: 'accordStandard', align: 'center', width: '180', required: false, type: 'input' },
+ {
+ text: '收费(元)含6%增值税',
+ value: 'price',
+ align: 'center',
+ required: false,
+ children: [
+ { text: '检测费(应)', value: 'shouldTestFee', align: 'center', width: '180', required: true, type: 'inputNumber' },
+ { text: '检测费(实)', value: 'actualTestFee', align: 'center', required: true, width: '180', type: 'inputNumber' },
+ { text: '附加费', value: 'extraFee', align: 'center', required: false, width: '180', type: 'inputNumber' },
+ { text: '修理费', value: 'repairFee', align: 'center', required: false, width: '180', type: 'inputNumber' },
+ { text: '其他费', value: 'otherFee', align: 'center', required: false, width: '180', type: 'inputNumber' },
+ { text: '小计', value: 'subtotal', align: 'center', required: false, type: 'text' },
+ ],
+ },
+])
+
// ------------------------------------委托书---------------------------------------------
// 点击选择委托书编号
const handleClickOrder = () => {
@@ -87,87 +253,63 @@
// 选好委托书
const confirmCheckoutOrder = (val: Array) => {
if (val && val.length) {
- form.value.priceFront = 0 // 标价
- // form.value.suggestedDiscount = 95 // 建议折扣
- form.value.suggestedPrice = 0 // 建议价格
- form.value.extraCharge = 0// 附加费用-单位分
- form.value.extraChargeIllustration = '' // 附加费用说明
- form.value.totalSettlement = 0 // 总计结算费用
getOrderDetail({ id: val[0].id }).then((res) => { // 样品清单
form.value.orderCode = res.data.orderCode // 委托书编号
form.value.orderId = res.data.id // 委托书id
- form.value.deliverer = res.data.deliverer // 送检人
- form.value.delivererTel = res.data.delivererTel // 送检人
- form.value.createTime = res.data.createTime // 委托单创建时间
- form.value.customerNo = res.data.customerNo // 委托方代码
- form.value.customerId = res.data.customerId // 委托方id
form.value.customerName = res.data.customerName // 委托方名称
- form.value.planDeliverTime = res.data.planDeliverTime // 预计送达时间
- form.value.requireOverTime = res.data.requireOverTime // 要求检完时间
- form.value.phone = res.data.customerPhone // 委托方电话
- list.value = res.data.customerSampleInfoList.map((item: { isEdit: boolean }) => {
+ form.value.orderTime = res.data.createTime // 委托日期(委托单创建时间)
+ form.value.certificationCompany = res.data.certificationCompany // 证书单位名称
+ form.value.certificationCompanyAddress = res.data.certificationCompanyAddress // 证书单位地址
+ form.value.deliverer = res.data.deliverer // 联系人
+ form.value.delivererTel = res.data.delivererTel // 联系方式
+ form.value.sampleCount = res.data.customerSampleInfoList.length // 样品数量
+ list.value = res.data.customerSampleInfoList.map((item: { createTime: string; editable: boolean }) => {
return {
...item,
- isEdit: true,
+ orderTime: item.createTime ? dayjs(item.createTime).format('YYYY-MM-DD') : item.createTime, // 委托日期
+ editable: pageType.value !== 'detail',
+ shouldTestFee: 0, // 检测费(应)
+ actualTestFee: 0, // 检测费(实)
+ extraFee: 0, // 附加费
+ repairFee: 0, // 修理费
+ otherFee: 0, // 其他费
+ sets: 0, // 套数
+ subtotal: 0, // 小计
+ id: '',
}
})
})
}
}
-// -----------------------------------------样品清单--------------------------------------------
-// 检查列表
-function checkSampleList() {
- for (let index = 0; index < list.value.length; index++) {
- const item = list.value[index]
- for (const prop of columns.value) {
- // 检查必填
- if (prop.required && !item[prop.value]) {
- ElMessage.warning(`请先完善第${index + 1}行中${prop.text}`)
- return false
- }
- // 验证正则
- if (prop.reg && typeof prop.reg === 'function') {
- if (!prop.reg(item[prop.value])) {
- // ElMessage.warning(`第${index + 1}行中${prop.text}输入不合法`)
- ElMessage.warning(`第${index + 1}行: 要求标价为正数,且最多保留两位小数`)
- return false
- }
- }
- }
- }
- return true
-}
+// --------------------------------------------计算----------------------------------------------
+// 计算
+const handleInputNumberChange = ({ row }: any) => {
+ // 计算小计
+ row.subtotal = calc(Number(calc(Number(calc(Number(calc(Number(row.shouldTestFee), Number(row.actualTestFee), '+')), row.extraFee, '+')), row.repairFee, '+')), row.otherFee, '+')
+ // 计算检测费(应)(元)
+ form.value.shouldTestFee = list.value.reduce((accumulator, current: any) => accumulator + current.shouldTestFee, 0)
+ // 计算检测费(实)(元)
+ form.value.actualTestFee = list.value.reduce((accumulator, current: any) => accumulator + current.actualTestFee, 0)
+ // 实收合计
+ form.value.actualTotalFee = list.value.reduce((accumulator, current: any) => accumulator + current.subtotal, 0)
-// --------------------------------------------自动计算----------------------------------------------
-// 折扣改变-计算建议价格
-const changeSuggestedDiscount = () => {
- console.log('折扣改变')
- if (form.value.priceFront) {
- form.value.suggestedPrice = calc(Number(form.value.priceFront), Number(form.value.suggestedDiscount / 100), '*') as number
- form.value.suggestedPrice = Number(form.value.suggestedPrice.toFixed(2))
+ if (list.value.every((item: { actualTestFee: number }) => item.actualTestFee === 0 || `${item.actualTestFee}` === 'undefined' || `${item.actualTestFee}` === 'null' || `${item.actualTestFee}` === '')) {
+ form.value.feeStatus = '未录费'
+ }
+ else if (list.value.every((item: { actualTestFee: number }) => item.actualTestFee !== 0 || `${item.actualTestFee}` === 'undefined' || `${item.actualTestFee}` === 'null' || `${item.actualTestFee}` === '')) {
+ form.value.feeStatus = '已录费'
+ }
+ else {
+ form.value.feeStatus = '部分录费'
}
}
-// 标价改变
-const changePrice = () => {
- console.log('标价改变')
- let sum = 0
- list.value.forEach((item) => {
- if (item.price) {
- sum = calc(Number(sum), Number(item.price), '+') as number
- }
- })
- form.value.priceFront = sum
- changeSuggestedDiscount() // 建议价格随之变化
+const changeTableInputNumber = () => {
+ // 到账金额
+ form.value.receivedAmount = receivedAmountList.value.reduce((accumulator: any, current: any) => accumulator + current.money, 0)
+ // 开票金额
+ form.value.invoiceAmount = invoiceAmountList.value.reduce((accumulator: any, current: any) => accumulator + current.money, 0)
}
-// 附加费用改变
-const changeExtraCharge = () => {
- console.log('附加费用改变')
- form.value.totalSettlement = calc(Number(form.value.suggestedPrice), Number(form.value.extraCharge), '+') as number
-}
-watch(() => form.value.suggestedPrice, (newValue) => {
- changeExtraCharge()
-})
// ----------------------------------------------------------------------------------------
const $router = useRouter()
@@ -176,9 +318,35 @@
$router.back()
}
+// 校验表格
+const checkList = () => {
+ if (!receivedAmountList.value.length) {
+ ElMessage.warning('到账金额明细不能为空')
+ return false
+ }
+ if (!invoiceAmountList.value.length) {
+ ElMessage.warning('开票金额明细不能为空')
+ return false
+ }
+ if (!list.value.length) {
+ ElMessage.warning('结算明细不能为空')
+ return false
+ }
+ if (!useCheckList(receivedAmountList.value, receivedAmountcolumns.value, '到账金额明细')) {
+ return false
+ }
+ if (!useCheckList(invoiceAmountList.value, invoiceAmountcolumns.value, '开票金额明细')) {
+ return false
+ }
+ if (!useCheckList(list.value, columns.value, '结算明细')) {
+ return false
+ }
+ return true
+}
+
// 保存
const save = () => {
- if (!checkSampleList()) {
+ if (!checkList()) {
return false
}
ruleFormRef.value.validate((valid: boolean) => {
@@ -188,17 +356,10 @@
background: 'rgba(255, 255, 255, 0.8)',
})
const params = {
- extraCharge: calc(Number(form.value.extraCharge), 100, '*'), // 附加费用-单位分
- extraChargeIllustration: form.value.extraChargeIllustration, // 附加费用说明
id: infoId.value,
- orderId: form.value.orderId, // 委托书id
- suggestedDiscount: form.value.suggestedDiscount, // 建议折扣-单位%
- samplePriceList: list.value.map((item) => {
- return {
- price: calc(Number(item.price), 100, '*'), // 标价-单位分
- relationId: item.relationId, // 样品id
- }
- }), // 样品清单
+ ...form.value,
+ amountDetailsList: receivedAmountList.value.concat(invoiceAmountList.value),
+ sampleList: list.value,
}
// 新建
if (pageType.value === 'add') {
@@ -229,24 +390,22 @@
// 编辑、详情--获取详细信息
const fetchDetail = () => {
+ const loading = ElLoading.service({})
getBusinessSettlementDetail({ id: infoId.value }).then((res) => {
form.value = res.data
- form.value.phone = res.data.customerPhone
- list.value = res.data.sampleList.map((item: { postedPrice: number; id: string }) => {
+ receivedAmountList.value = res.data.amountDetailsList.filter((item: { moneyType: string }) => `${item.moneyType}` === '1')
+ invoiceAmountList.value = res.data.amountDetailsList.filter((item: { moneyType: string }) => `${item.moneyType}` === '2')
+ list.value = res.data.sampleDetailsList.map((item: { editable: boolean; orderTime: string }) => {
return {
...item,
- price: calc(Number(item.postedPrice), 100, '/') as number,
- isEdit: pageType.value === 'edit',
- relationId: item.id,
+ editable: pageType.value !== 'detail',
+ orderTime: item.orderTime ? dayjs(item.orderTime).format('YYYY-MM-DD') : item.orderTime,
}
})
- form.value.priceFront = calc(Number(res.data.postedPrice), 100, '/') as number // 标价
- // form.value.suggestedDiscount = // 建议折扣
- form.value.suggestedPrice = calc(Number(res.data.suggestedPrice), 100, '/') as number// 建议价格
- form.value.extraCharge = calc(Number(res.data.extraCharge), 100, '/') as number// 附加费用-单位分
- // form.value.extraChargeIllustration = // 附加费用说明
- form.value.totalSettlement = calc(Number(res.data.totalSettlement), 100, '/') as number // 总计结算费用
- })
+ form.value.orderTime = res.data.sampleDetailsList[0].orderTime // 委托日期
+ form.value.sampleCount = res.data.sampleDetailsList.length // 样品数量
+ loading.close()
+ }).catch(() => loading.close())
}
onMounted(() => {
@@ -278,10 +437,10 @@
>
-
+
@@ -294,51 +453,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -467,17 +645,26 @@
-
-
+
+
+
+ 增加行
+
+
+ 删除行
+
+
handleSelectionChange(e, 'addReceived')"
>
+
*{{ item.text }}
-
-
-
- {{ scope.row[item.value] }}
+
+
+
+
+ {{ '上传' }}
+
+
+
+ ×
+
+
+
onFileChange(e, scope.row, 'receivedAmount')">
+
+
+
+
+ 增加行
+
+
+ 删除行
+
+
+ handleSelectionChange(e, 'invoiceAmount')"
+ >
+
+
+
+
+ *{{ item.text }}
+
+
+
+
+
+
+
+ {{ '上传' }}
+
+
+
+ ×
+
+
+
onFileChange(e, scope.row, 'receivedAmount')">
+
+
+
+
+
+
+
+
diff --git a/src/views/finance/businessSettlement/list.vue b/src/views/finance/businessSettlement/list.vue
index eea28d8..2852223 100644
--- a/src/views/finance/businessSettlement/list.vue
+++ b/src/views/finance/businessSettlement/list.vue
@@ -2,6 +2,8 @@
+
+
+
+
+
+
diff --git a/src/components/MultiHeaderTable/tableColumn.vue b/src/components/MultiHeaderTable/tableColumn.vue
new file mode 100644
index 0000000..2b87285
--- /dev/null
+++ b/src/components/MultiHeaderTable/tableColumn.vue
@@ -0,0 +1,147 @@
+
+
+
+
+
+
+
+
+
+
+ *{{ item.text }}
+
+
+ *{{ item.text }}
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ scope.row[item.value] }}
+
+
+ {{
+ scope.row[item.value]
+ }}
+
+
+
+
+
+
diff --git a/src/components/NormalTable/index.vue b/src/components/NormalTable/index.vue
index e56f775..67092d3 100644
--- a/src/components/NormalTable/index.vue
+++ b/src/components/NormalTable/index.vue
@@ -3,6 +3,7 @@
import { ElTable } from 'element-plus'
import { defineExpose, ref } from 'vue'
import type { TableColumn } from './table_interface'
+import showPhoto from '@/views/system/tool/showPhoto.vue'
// ------------------定义props、 emit-------------------
const props = defineProps({
@@ -212,8 +213,8 @@
{{ scope.row[column.value] }}
{{ column.filter(scope.row) }}
- {{ scope.row }}
-
+
+
diff --git a/src/utils/useCheckList.ts b/src/utils/useCheckList.ts
new file mode 100644
index 0000000..c7782f0
--- /dev/null
+++ b/src/utils/useCheckList.ts
@@ -0,0 +1,73 @@
+import { ElMessage } from 'element-plus'
+// import type { TableColumn } from '@/components/NormalTable/table_interface'
+
+/**
+ * 检查列表
+ * @param list 要检查的表格数据(被依赖项如果满足某个条件就去检查依赖项,否则不检查依赖项)
+ * @param columns // 表头信息
+ * @param tableTitle // 表格名称
+ * @param depend // 依赖项
+ * @param depended // 被依赖项
+ * @param dependedValue // 被依赖项条件
+ * @param requireLength // 要检查的表格数据长度是否大于0
+ */
+export default function useCheckList(list: any, columns: any, tableTitle = '', depend?: string, depended?: string, dependedValue?: number | string, requireLength = false): boolean {
+ for (const prop of columns) {
+ for (let index = 0; index < list.length; index++) {
+ const item = list[index]
+
+ if (depend && depended && item[depended] === dependedValue && !(`${item[prop.value]}`)) { // 被依赖项满足条件时需要检查
+ ElMessage.warning(`请先完善 ${tableTitle} 第${index + 1}行中 ${prop.text} 字段`)
+ return false
+ }
+ else {
+ // 检查必填
+ if (prop.required && (!(`${item[prop.value]}`) || `${item[prop.value]}` === 'null' || `${item[prop.value]}` === 'undefined' || item[prop.value] == undefined)) {
+ if (`${prop.belongStandardEquipment}` === '15') { // 小功率
+ ElMessage.warning(`${tableTitle} 第${index + 1}行中 ${prop.message} ${prop.text} 字段不能为空`)
+ }
+ else {
+ ElMessage.warning(`请先完善 ${tableTitle} 第${index + 1}行中 ${prop.text} 字段`)
+ }
+ return false
+ }
+ }
+
+ // 验证正则
+ if (prop.reg && typeof prop.reg === 'function') {
+ if (prop.value === 'resolution') { // 分辨力特殊处理
+ if (!prop.reg(item[prop.value])) {
+ ElMessage.warning(`${tableTitle} 第${index + 1}行中 ${prop.text} 不能大于1`)
+ return false
+ }
+ }
+ else {
+ if (!prop.reg(item[prop.value])) {
+ if (`${prop.belongStandardEquipment}` === '15') { // 小功率
+ ElMessage.warning(`${tableTitle} 第${index + 1}行中 ${prop.message} ${prop.text} 字段不能为0`)
+ }
+ else if (`${prop.belongStandardEquipment}` === '17') { // S参数
+ ElMessage.warning(`${tableTitle} 第${index + 1}行中 ${prop.text} 仅允许输入数字、字母、特殊字符`)
+ }
+ else {
+ ElMessage.warning(`${tableTitle} 第${index + 1}行中 ${prop.text} 字段输入不合法`)
+ }
+ return false
+ }
+ }
+ }
+
+ if (prop.children && prop.children.length) {
+ if (!useCheckList(list, prop.children, tableTitle, depend, depended, dependedValue)) {
+ return false
+ }
+ }
+ }
+ }
+
+ if (requireLength && !list.length) {
+ ElMessage.warning(`${tableTitle}表格数据不能为空`)
+ return false
+ }
+ return true
+}
diff --git a/src/views/business/lab/components/selectOrderSamplesDialog.vue b/src/views/business/lab/components/selectOrderSamplesDialog.vue
index 4002f83..b004107 100644
--- a/src/views/business/lab/components/selectOrderSamplesDialog.vue
+++ b/src/views/business/lab/components/selectOrderSamplesDialog.vue
@@ -14,6 +14,7 @@
const loadingTable = ref(false) // loading
const list = ref([]) // 表格参数
const tableRef = ref()
+const isMulti = ref(true) // 是否多选默认为多选
const columns = ref
([
{ text: '被测样品名称', value: 'sampleName', align: 'center', required: true },
{ text: '型号规格', value: 'sampleModel', align: 'center', required: true },
@@ -60,9 +61,10 @@
}
// 初始化
-const initDialog = (orderIdParam: string) => {
+const initDialog = (orderIdParam: string, isMultiParam = true) => {
dialogFormVisible.value = true
orderId.value = orderIdParam
+ isMulti.value = isMultiParam
getList()
}
defineExpose({ initDialog })
@@ -78,7 +80,7 @@
:columns="columns"
is-showmulti-select
:list-loading="loadingTable"
- :is-multi="true"
+ :is-multi="isMulti"
:height="300"
:pagination="false"
@multi-select="handleSelectionChange"
diff --git a/src/views/business/lab/components/selectReportTemplate.vue b/src/views/business/lab/components/selectReportTemplate.vue
index 5c59693..ec36ef7 100644
--- a/src/views/business/lab/components/selectReportTemplate.vue
+++ b/src/views/business/lab/components/selectReportTemplate.vue
@@ -7,8 +7,9 @@
import type { typeofSign } from '@/views/system/tool/tool_interface'
import { templatePage } from '@/api/system/tool'
-const emits = defineEmits(['add'])
+const emits = defineEmits(['confirm'])
const dialogFormVisible = ref(false) // 控制弹窗显隐
+const createTime = ref()
// 查询参数
const searchQuery = reactive({
templateNo: '', // 编号
@@ -18,31 +19,43 @@
createEndTime: '',
limit: 5,
offset: 1,
- templateType: '',
+ certificationType: '0',
ids: [] as string[],
}) // 查询参数
const loadingTable = ref(false) // loading
const list = ref([]) // 表格参数
const total = ref(0)
const columns = ref([
- { text: '编号', value: 'templateNo', align: 'center', width: '180' },
- { text: '模板名称', value: 'templateName', align: 'center', width: '150' },
- { text: '模板负责人', value: 'templateCreator', align: 'center', width: '100' },
- { text: '创建时间', value: 'createTime', align: 'center', width: '250' },
- { text: '描述', value: 'templateDesc', align: 'center' },
+ { text: '编号', value: 'templateNo', align: 'center', width: '160' },
+ { text: '模板名称', value: 'templateName', align: 'center' },
+ { text: '模板类型', value: 'templateTypeName', align: 'center', width: '100' },
+ { text: '负责人', value: 'templateCreator', align: 'center', width: '100' },
+ { text: '内容描述', value: 'templateDesc', align: 'center' },
+ { text: '创建时间', value: 'createTime', align: 'center', width: '180' },
])
const checkoutList = ref([]) // 多选选中参数
-// 获取类型
-const getType = async () => {
- const res = await getDictByCode('templateType')
- searchQuery.templateType = res.data.filter((item: typeofSign) => item.name === '证书报告模板')[0].value
+// ---------------------------------------字典--------------------------------------------
+const templateTypeMap = ref([]) as any // 模板类型
+// 获取字典值
+async function getDict() {
+ // 模板类型
+ const res = await getDictByCode('certificationType')
+ res.data.forEach((item: { value: string; name: string }) => {
+ templateTypeMap.value[`${item.value}`] = item.name
+ })
}
+// ----------------------------------------------------------------------------------------------
// 获取数据列表
const getList = () => {
loadingTable.value = true
templatePage(searchQuery).then((res) => {
if (res.code === 200) {
- list.value = res.data.rows
+ list.value = res.data.rows.map((item: { certificationType: string }) => {
+ return {
+ ...item,
+ templateTypeName: `${item.certificationType}` ? templateTypeMap.value[item.certificationType] : item.certificationType, // 模板类型
+ }
+ })
total.value = res.data.total
}
loadingTable.value = false
@@ -74,7 +87,8 @@
searchQuery.createEndTime = ''
searchQuery.limit = 5
searchQuery.offset = 1
- // searchQuery.templateType = '' // 类型不能变
+ searchQuery.certificationType = '0'
+ createTime.value = ''
searchQuery.ids = []
getList()
}
@@ -82,10 +96,10 @@
// 点击保存
const submitForm = () => {
if (!checkoutList.value.length) {
- ElMessage.warning('请选择证书报告模板')
+ ElMessage.warning('请选择证书模板')
}
else {
- emits('add', checkoutList.value[0])
+ emits('confirm', checkoutList.value[0])
dialogFormVisible.value = false
}
}
@@ -103,15 +117,25 @@
// 初始化
const initDialog = () => {
dialogFormVisible.value = true
- getType().then((_) => {
+ getDict().then((_) => {
getList()
})
}
+watch(() => createTime.value, (newVal) => {
+ if (newVal) {
+ searchQuery.createStartTime = newVal[0]
+ searchQuery.createEndTime = newVal[1]
+ }
+ else {
+ searchQuery.createStartTime = ''
+ searchQuery.createEndTime = ''
+ }
+})
defineExpose({ initDialog })
-
+
@@ -121,7 +145,18 @@
-
+
+
+
+
diff --git a/src/views/business/lab/measureData/dialog/selectMeasueDataDialog.vue b/src/views/business/lab/measureData/dialog/selectMeasueDataDialog.vue
new file mode 100644
index 0000000..f8be703
--- /dev/null
+++ b/src/views/business/lab/measureData/dialog/selectMeasueDataDialog.vue
@@ -0,0 +1,199 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ (listQuery.offset - 1) * listQuery.limit + scope.$index + 1 }}
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/views/business/lab/measureData/dialog/selectTechFilesDialog.vue b/src/views/business/lab/measureData/dialog/selectTechFilesDialog.vue
new file mode 100644
index 0000000..f6f1a5a
--- /dev/null
+++ b/src/views/business/lab/measureData/dialog/selectTechFilesDialog.vue
@@ -0,0 +1,247 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ (listQuery.offset - 1) * listQuery.limit + scope.$index + 1 }}
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/views/business/lab/measureData/measureData-interface.ts b/src/views/business/lab/measureData/measureData-interface.ts
index 8319f65..d25a212 100644
--- a/src/views/business/lab/measureData/measureData-interface.ts
+++ b/src/views/business/lab/measureData/measureData-interface.ts
@@ -1,13 +1,14 @@
// 查询条件
export interface IListQuery {
- approvalStatus: string // 审批状态
- certificateReportCode: string // 证书编号
- certificateReportName: string // 证书名称
- customerName: string // 委托方名称
- sampleName: string // 样品名称
- measureCategory: string // 检校类别
- approvalStatusName: string // 审批状态名称
- formId: string
+ approvalStatus: string // 审批状态类型code
+ certificateReportCode: string // 证书编号
+ certificateReportName: string // 证书名称
+ customerName: string // 委托方名称
+ formId: string // 表单id(流程定义对应的表单id,等价于业务id)
+ measureCategory: string // 检校类别
+ orderCode: string // 委托书编号
+ sampleName: string // 样品名称
+ sampleNo: string // 样品编号
offset: number
limit: number
}
@@ -28,47 +29,53 @@
calibrationTime: string // 检校日期
taskId?: string // 任务id 用于审批
decisionItem?: string
- applyApprovalStatusName?: string // 审批状态名称
+ approvalStatusName?: string // 审批状态名称
processId?: string // 流程实例id
}
// 表单
export interface IForm {
- tdysczs: number // 替代已生成证书
+ id?: string
+ invalid: number // 替代已生成证书
formId: string
- yzs: string // 原证书
+ oldCertificateCode: string // 原证书
calibrationMajor: string // 检校专业
- certifications: string // 证书类别
+ calibrationMajorName: string // 检校专业名称
+ certificateReportCategory: string // 证书类别
+ certificateReportCategoryName: string // 证书类别名称
certificateReportCode: string // 证书编号
certificateReportName: string // 证书名称
- jdy: string // 检定员
- jjrq: string // 检校日期
+ measurePerson: string // 检定员
+ measurePersonId: string // 检定员id
+ calibrationTime: string // 检校日期
orderCode: string // 委托书
orderId: string // 委托书id
customerId?: string // 委托放id
customerName: string // 委托方名称
+ customerAddress: string // 委托方地址
certificationCompany: string // 证书单位名称
certificationCompanyAddress: string // 证书单位地址
calibrationPlace: string // 检校地点
- fjsj: string // 复校时间
- jssj: string // 接收时间
- jdjg: string // 检定结果
- environmentCode: string// 环境记录单编号
+ repeatTime: string // 复校时间
+ deliverTime: string // 接收时间
+ measureResult: string // 检定结果
+ environmentCode: string // 环境记录单编号
environmentId: string // 环境记录单id
temperature: string // 温度
humidity: string // 湿度
+ techFilesName: string // 依据的技术文件名称
signId: string // 电子签章id
signName: string // 电子签章名称
approvalSignIds: string // 认可标志专用章id
approvalSignName: string // 认可标志专用章名称
remark: string // 备注
- ywy: string // 业务员
+ busPersonId: string // 业务员id
+ busPersonName: string // 业务员名字
templateId: string // 证书模板
templateName: string // 证书模板
- templateNameFile: string // 证书模板文件
certificateReportFile: string // 证书报告附件
processId?: string // 流程实例id
@@ -76,6 +83,7 @@
// 被检样品
export interface ISampleList {
+ id: string // 样品id
sampleNo: string // 样品编号
sampleName: string // 样品名称
sampleModel: string // 型号
diff --git a/src/views/business/lab/measureData/measureDataDetail.vue b/src/views/business/lab/measureData/measureDataDetail.vue
index 4aa9717..c554c33 100644
--- a/src/views/business/lab/measureData/measureDataDetail.vue
+++ b/src/views/business/lab/measureData/measureDataDetail.vue
@@ -3,6 +3,7 @@
import { ElLoading, ElMessage, ElMessageBox } from 'element-plus'
import type { FormInstance, FormRules } from 'element-plus'
import { ref } from 'vue'
+import dayjs from 'dayjs'
import EnvironmentalDialog from '../components/environmentalDialog.vue'
import selectSignature from '../components/selectSignature.vue'
import selectReportTemplate from '../components/selectReportTemplate.vue'
@@ -10,10 +11,12 @@
import SelectSamplesDialog from '../components/selectSamplesDialog.vue'
import selectMeasureDevice from '../components/selectMeasureDevice.vue'
import type { IEquipmentList, IForm, ISampleList } from './measureData-interface'
+import selectMeasueDataDialog from './dialog/selectMeasueDataDialog.vue'
+import selectTechFilesDialog from './dialog/selectTechFilesDialog.vue'
import { UploadFile } from '@/api/measure/file'
import ApprovalDialog from '@/components/Approval/ApprovalDialog.vue'
import type { TableColumn } from '@/components/NormalTable/table_interface'
-import { addApply, detail, failUpdateApply, submit, updateApply } from '@/api/business/subpackage/apply'
+import { addMeasureData, downLoadTemplate, draftUpdateMeasureData, failUpdateMeasureData, getMeasureDataDetail, submit } from '@/api/business/lab/measureData'
import { cancelApproval, fetchApproval, submitApproval } from '@/api/approval'
import showPhoto from '@/views/system/tool/showPhoto.vue'
import { getDictByCode } from '@/api/system/dict'
@@ -21,6 +24,9 @@
import selectOrder from '@/views/business/schedule/interchangeReceipt/selectOrder.vue'
import { downloadFile } from '@/utils/download'
import type { dictType } from '@/global'
+import { getUserList } from '@/api/system/user'
+import { exportFile } from '@/utils/exportUtils'
+
const user = useUserStore() // 用户信息
const textMap: { [key: string]: string } = {
edit: '编辑',
@@ -31,6 +37,8 @@
const $router = useRouter() // 关闭页面使用
const $route = useRoute()
const query = $route.query
+console.log('opopopop', query)
+
const approvalDialog = ref() // 审批对话ref
const pageType = ref('add') // 页面类型: add, edit, detail
const infoId = ref('') // 列表id
@@ -38,57 +46,63 @@
const orderVisible = ref(false) // 控制委托单对话框显隐
const ruleFormRef = ref() as any
const form = ref({
- tdysczs: 0, // 替代已生成证书
+ invalid: 0, // 替代已生成证书
formId: query.formId as string,
- yzs: '', // 原证书
+ oldCertificateCode: '', // 原证书
calibrationMajor: '', // 检校专业
- certifications: '', // 证书类别
+ calibrationMajorName: '', // 检校专业名称
+ certificateReportCategory: '', // 证书类别
+ certificateReportCategoryName: '', // 证书类别名称
certificateReportCode: '', // 证书编号
certificateReportName: '', // 证书名称
- jdy: '', // 检定员
- jjrq: '', // 检校日期
+ measurePerson: '', // 检定员
+ measurePersonId: '', // 检定员id
+ calibrationTime: '', // 检校日期
- orderCode: '', // 委托单
+ orderCode: '', // 委托单编号
orderId: '', // 委托单id
customerName: '', // 委托方名称
+ customerAddress: '', // 委托方地址
certificationCompany: '', // 证书单位名称
certificationCompanyAddress: '', // 证书单位地址
calibrationPlace: '', // 检校地点
- fjsj: '', // 复校时间
- jssj: '', // 接收时间
- jdjg: '', // 检定结果
+ repeatTime: '', // 复校时间
+ deliverTime: '', // 接收时间
+ measureResult: '', // 检定结果
environmentCode: '', // 环境记录单编号
environmentId: '', // 环境记录单id
temperature: '', // 温度
humidity: '', // 湿度
+ techFilesName: '', // 依据的技术文件名称
signId: '', // 电子签章id
signName: '', // 电子签章名称
approvalSignIds: '', // 认可标志专用章id
approvalSignName: '', // 认可标志专用章名称
remark: '', // 备注
- ywy: '', // 业务员
+ busPersonId: '', // 业务员id
+ busPersonName: '', // 业务员名字
templateId: '', // 证书模板
templateName: '', // 证书模板
- templateNameFile: '', // 证书模板文件
certificateReportFile: '', // 证书报告附件
})
// 校验规则
const formRules = ref({
- yzs: [{ required: true, message: '原证书必填', trigger: ['blur', 'change'] }],
+ oldCertificateCode: [{ required: true, message: '原证书必填', trigger: ['blur', 'change'] }],
calibrationMajor: [{ required: true, message: '检校专业必填', trigger: ['blur', 'change'] }],
- certifications: [{ required: true, message: '证书类别必填', trigger: ['blur', 'change'] }],
+ certificateReportCategory: [{ required: true, message: '证书类别必填', trigger: ['blur', 'change'] }],
certificateReportName: [{ required: true, message: '证书名称必填', trigger: ['blur', 'change'] }],
customerName: [{ required: true, message: '委托方名称必填', trigger: ['blur', 'change'] }],
+ customerAddress: [{ required: true, message: '委托方地址必填', trigger: ['blur', 'change'] }],
certificationCompany: [{ required: true, message: '证书单位名称必填', trigger: ['blur', 'change'] }],
certificationCompanyAddress: [{ required: true, message: '证书单位地址必填', trigger: ['blur', 'change'] }],
calibrationPlace: [{ required: true, message: '检校地点必填', trigger: ['blur', 'change'] }],
- jdy: [{ required: true, message: '检定员必填', trigger: ['blur', 'change'] }],
- jjrq: [{ required: true, message: '检校日期必填', trigger: ['blur', 'change'] }],
- fjsj: [{ required: true, message: '复校时间必填', trigger: ['blur', 'change'] }],
- jssj: [{ required: true, message: '接收时间必填', trigger: ['blur', 'change'] }],
- jdjg: [{ required: true, message: '检定结果必填', trigger: ['blur', 'change'] }],
+ measurePersonId: [{ required: true, message: '检定员必填', trigger: ['blur', 'change'] }],
+ calibrationTime: [{ required: true, message: '检校日期必填', trigger: ['blur', 'change'] }],
+ repeatTime: [{ required: true, message: '复校时间必填', trigger: ['blur', 'change'] }],
+ deliverTime: [{ required: true, message: '接收时间必填', trigger: ['blur', 'change'] }],
+ measureResult: [{ required: true, message: '检定结果必填', trigger: ['blur', 'change'] }],
temperature: [
{ required: true, message: '温度必填', trigger: ['blur', 'change'] },
{ pattern: /(^-?\d\d*\.\d*$)|(^-?\d\d*$)|(^-?\.\d\d*$)/, message: '温度只能为数字', trigger: ['blur', 'change'] },
@@ -111,6 +125,7 @@
// ---------------------------------------字典--------------------------------------------
const certificationTypeMap = ref([]) // 证书类别
const calibrationMajorMap = ref([]) // 校检专业
+const userList = ref([]) // 检定员
// 获取字典值
async function getDict() {
// 校检专业
@@ -119,12 +134,22 @@
// 证书类别
const rescertificationType = await getDictByCode('certificationType')
certificationTypeMap.value = rescertificationType.data
+
+ // 获取人员列表
+ getUserList({ offset: 1, limit: 99999 }).then((res) => {
+ userList.value = res.data.rows
+ })
}
getDict()
// -------------------------------------原证书--------------------------------------------
+const selectMeasueDataDialogRef = ref() // 选择原证书组件ref
// 点击选择原证书
const selectOrigin = () => {
- //
+ selectMeasueDataDialogRef.value.initDialog()
+}
+// 选好原证书
+const selectMeasueDataConfirm = (val: any) => {
+ getDetail(val.id, val.certificateReportCode)
}
// ------------------------------------委托单------------------------------------------
// 点击选择委托单编号
@@ -142,12 +167,17 @@
form.value.orderCode = val[0].orderCode // 委托单
form.value.customerId = val[0].customerId// 委托方id
form.value.customerName = val[0].customerName// 委托方名称
+ form.value.customerAddress = val[0].customerAddress// 委托方地址
form.value.certificationCompany = val[0].certificationCompany// 证书单位名称
form.value.certificationCompanyAddress = val[0].certificationCompanyAddress// 证书单位地址
+ form.value.certificationCompanyAddress = val[0].certificationCompanyAddress// 证书单位地址
+ form.value.busPersonId = val[0].busPersonId// 业务员id
+ form.value.busPersonName = val[0].busPersonName// 业务员名字
}
}
// -------------------------------选择环境记录单----------------------------------------
+const businessEnvironmentRecord = ref({}) as any // 环境记录单信息
// 选择环境记录单Ref
const environmentalDialog = ref()
// 选择环境记录单
@@ -156,6 +186,7 @@
}
// 选择环境记录单表格确认
const environmentalAdd = (data: any) => {
+ businessEnvironmentRecord.value = data
form.value.environmentId = data.id // 环境记录单id
form.value.environmentCode = data.environmentCode // 环境记录单编号
form.value.temperature = data.temperature // 温度
@@ -200,35 +231,16 @@
}
// -----------------------------------------所依据的技术文件----------------------------------
+const selectTechFilesRef = ref()
+const fileList = ref([]) // 依据的技术文件
// 点击所依据的技术文件
const selectTechFiles = () => {
- //
+ selectTechFilesRef.value.initDialog()
}
-// --------------------------------------证书模板------------------------------------------
-// 选择证书模板Ref
-const templateDialog = ref()
-// 选择证书模板
-const handleClickTemplate = () => {
- templateDialog.value.initDialog()
-}
-// 选择证书模板确认
-const confirmCheckoutTemplate = (val: any) => {
- form.value.templateId = val.id // 证书报告模板id
- form.value.templateName = val.templateName || '' // 证书报告模板名称
- form.value.templateNameFile = val.minioFileName // 证书模板附件
-}
-
-// 点击下载证书模板按钮
-const downloadCertTemplate = () => {
- if (!form.value.templateId) {
- ElMessage.warning('请先选择证书模板')
- return false
- }
- if (!form.value.templateNameFile) {
- ElMessage.warning('选择的证书模板无附件,请检查')
- return false
- }
- downloadFile(form.value.templateNameFile as any, `${form.value.templateName}-${form.value.templateNameFile}`)
+// 选好依据的技术文件
+const selectTechFilesConfirm = (val: any) => {
+ fileList.value = val
+ form.value.techFilesName = val.map((item: { fileName: string }) => item.fileName).join(',')
}
// ---------------------------------文件上传(上传证书)-------------------------------------------
@@ -283,10 +295,10 @@
// 点击批量添加/选择
const addSample = () => {
- if (form.value.orderId) {
- selectOrderSamplesDialogRef.value.initDialog(form.value.orderId)
+ if (form.value.orderId) { // 选择委托单下的样品
+ selectOrderSamplesDialogRef.value.initDialog(form.value.orderId, false)
}
- else {
+ else { // 选择样品库中的样品
selectSamplesDialogRef.value.initDialog()
}
}
@@ -318,7 +330,7 @@
}
// ----------------------------------------------所用的计量标准器具--------------------------------------------
const equipmentVisible = ref(false) // 选择设备对话框显隐
-const equipmentList = ref([])// 表格数据
+const equipmentInfoList = ref([])// 表格数据
const checkoutEquipmentList = ref([])// 多选设备
// 表头
const equipmentColumns = ref([
@@ -328,8 +340,8 @@
{ text: '出厂编号', value: 'manufacturingNo', align: 'center' },
{ text: '测量范围', value: 'mesureRange', align: 'center' },
{ text: '不确定度', value: 'uncertainty', align: 'center' },
- { text: '溯源机构', value: 'syjg', align: 'center' },
- { text: '证书编号', value: 'zsbh', align: 'center' },
+ { text: '溯源机构', value: 'mesureDeptName', align: 'center' },
+ // { text: '证书编号', value: 'zsbh', align: 'center' },
{ text: '有效日期', value: 'validDate', align: 'center' },
])
@@ -351,9 +363,9 @@
const confirmSelectEquipment = (val: any) => {
val.forEach((item: IEquipmentList) => {
// 只添加列表里不存在的
- const index = equipmentList.value.findIndex((i: IEquipmentList) => item.equipmentNo === i.equipmentNo)
+ const index = equipmentInfoList.value.findIndex((i: IEquipmentList) => item.equipmentNo === i.equipmentNo)
if (index === -1) {
- equipmentList.value.push(item)
+ equipmentInfoList.value.push(item)
}
})
}
@@ -365,28 +377,109 @@
return false
}
checkoutEquipmentList.value.forEach((item: IEquipmentList) => {
- equipmentList.value.forEach((element, index) => {
+ equipmentInfoList.value.forEach((element, index) => {
if (element.equipmentNo === item.equipmentNo) {
- equipmentList.value.splice(index, 1)
+ equipmentInfoList.value.splice(index, 1)
}
})
})
}
+
+// --------------------------------------证书模板------------------------------------------
+// 选择证书模板Ref
+const templateDialogRef = ref()
+// 选择证书模板
+const handleClickTemplate = () => {
+ templateDialogRef.value.initDialog()
+}
+// 选择证书模板确认
+const confirmCheckoutTemplate = (val: any) => {
+ form.value.templateId = val.id // 证书报告模板id
+ form.value.templateName = val.templateName || '' // 证书报告模板名称
+}
+
+// 点击下载证书模板按钮
+const downloadCertTemplate = () => {
+ if (!form.value.templateId) {
+ ElMessage.warning('请先选择证书模板')
+ return false
+ }
+ if (!sampleList.value.length) {
+ ElMessage.warning('被检样品不能为空')
+ return false
+ }
+ if (!equipmentInfoList.value.length) {
+ ElMessage.warning('所用的计量标准器具不能为空')
+ return false
+ }
+
+ ruleFormRef.value.validate((valid: boolean) => {
+ if (valid) {
+ const params = solveParams()
+ const loading = ElLoading.service({
+ lock: true,
+ background: 'rgba(255, 255, 255, 0.8)',
+ })
+ downLoadTemplate(params).then((res) => {
+ exportFile(res.data, `${form.value.certificateReportName}.xls`)
+ loading.close()
+ }).catch(() => {
+ loading.close()
+ })
+ }
+ })
+}
+
// -------------------------------------------------------------------------------------------
+// 处理保存、下载模板参数
+function solveParams() {
+ const params = {
+ ...form.value,
+ businessEnvironmentRecord: businessEnvironmentRecord.value, // 环境记录单
+ fileList: fileList.value, // 依据的技术文件
+ equipmentInfoList: equipmentInfoList.value, // 所用的计量标准器具列表/监测设备
+ sampleId: sampleList.value[0].id, // 样品id(打印证书接口要必传)
+ sampleNo: sampleList.value[0].sampleNo, // 样品编号
+ sampleName: sampleList.value[0].sampleName, // 样品名称
+ sampleModel: sampleList.value[0].sampleModel, // 样品型号
+ manufacturingNo: sampleList.value[0].manufacturingNo, // 出厂编号
+ manufacturer: sampleList.value[0].manufacturer, // 生产厂家
+ sampleRemark: sampleList.value[0].remark, // 样品备注
+ id: pageType.value === 'add' ? '' : form.value.id,
+ }
+ return params
+}
// 获取详情信息
-const getDetail = () => {
+function getDetail(id?: string, certificateReportCode?: string) {
const loading = ElLoading.service({
lock: true,
background: 'rgba(255, 255, 255, 0.8)',
})
- detail({ id: $route.params.id as string }).then((res) => {
+ getMeasureDataDetail({ id: infoId.value! || id! }).then((res) => {
loading.close()
form.value = res.data
- form.value.createUserName = res.data.applicantName || user.name
- list.value = res.data.sampleList.filter((item: ISampleList) => {
- return item !== null
- })
+ sampleList.value = [{
+ sampleNo: res.data.sampleNo, // 样品编号
+ sampleName: res.data.sampleNo, // 样品名称
+ sampleModel: res.data.sampleNo, // 型号
+ manufacturingNo: res.data.sampleNo, // 出厂编号
+ manufacturer: res.data.sampleNo, // 生产厂家
+ remark: res.data.sampleRemark, // 备注
+ id: res.data.sampleId,
+ }]
+ equipmentInfoList.value = res.data.equipmentInfoList.map((item: { validDate: string }) => {
+ return {
+ ...item,
+ validDate: item.validDate ? dayjs(item.validDate).format('YYYY-MM-DD') : item.validDate,
+ }
+ }) // 所用的计量标准器具
+ businessEnvironmentRecord.value = res.data.businessEnvironmentRecord // 环境记录单数据
+ form.value.environmentCode = res.data.businessEnvironmentRecord.environmentCode// 环境记录单编号
+ if (id && certificateReportCode) {
+ form.value.oldCertificateCode = certificateReportCode
+ form.value.invalid = 1
+ }
}).catch(() => {
loading.close()
})
@@ -399,10 +492,13 @@
// 保存
const handleSave = () => {
- const tempList = list.value.filter(item => item.sampleNo)
- if (!tempList.length) {
- ElMessage.warning('样品信息不能为空')
- return
+ if (!sampleList.value.length) {
+ ElMessage.warning('被检样品不能为空')
+ return false
+ }
+ if (!equipmentInfoList.value.length) {
+ ElMessage.warning('所用的计量标准器具不能为空')
+ return false
}
ruleFormRef.value.validate((valid: boolean) => {
if (valid) {
@@ -410,32 +506,22 @@
lock: true,
background: 'rgba(255, 255, 255, 0.8)',
})
- // 样品&委托单列表(保存/编辑草稿接口入参使用)
- const temList = [] as any // 临时数组
- console.log('保存中的数组', list.value)
-
- list.value.forEach((item: any) => {
- if ((item.orderId && item.id) || (item.orderId && item.sampleId)) {
- temList.push({
- orderId: item.orderId,
- sampleId: item.id || item.sampleId,
- })
- }
- })
- form.value.orderSampleList = temList
+ const params = solveParams()
if (pageType.value === 'add') { // 新建
- addApply(form.value).then((res) => {
- submitId.value = res.data.id
- form.value.projectNo = res.data.projectNo // 分包项目编号
+ addMeasureData(params).then((res) => {
+ submitId.value = res.data.data.id
+ form.value.certificateReportCode = res.data.data.certificateReportCode
+ form.value.certificateReportName = res.data.data.certificateReportName
ElMessage.success('保存成功')
loading.close()
}).catch(() => {
loading.close()
})
}
+
else if (pageType.value === 'edit') { // 编辑
if (query.approvalStatusName === '未通过-驳回') { // 未通过-驳回
- failUpdateApply(form.value).then((res) => {
+ failUpdateMeasureData(params).then((res) => {
ElMessage.success('保存成功')
loading.close()
close()
@@ -444,7 +530,7 @@
})
}
else { // 草稿箱和已取消
- updateApply(form.value).then((res) => {
+ draftUpdateMeasureData(params).then((res) => {
ElMessage.success('保存成功')
loading.close()
close()
@@ -466,7 +552,7 @@
})
const params = {
id: submitId.value,
- formId: query.formId, // 表单id
+ formId: query.formId as string, // 表单id
}
submit(params).then(() => {
ElMessage.success('提交成功')
@@ -481,39 +567,6 @@
}
}
-const sampleVisible = ref(false)
-const projectVisible = ref(false)
-const isMulti = ref(false)
-const selectIndex = ref(0)
-// 点击选择
-const handleSelect = (index: number, row: ISampleList) => {
- sampleVisible.value = true // 选择设备对话框显隐
- isMulti.value = false // 是否单选, false单选、true表格多选
- selectIndex.value = index
-}
-
-const checkoutList = ref([]) // 选中的行
-
-// 修改委托方对话框显隐
-const changeSampleVisible = (val: boolean) => {
- sampleVisible.value = val
-}
-// 修改项目选择对话框显隐
-const changeProjectVisible = (val: boolean) => {
- projectVisible.value = val
-}
-
-// 删除行
-const delRow = () => {
- checkoutList.value.forEach((item: ISampleList) => {
- list.value.forEach((element, index) => {
- if (element.sampleNo === item.sampleNo) {
- list.value.splice(index, 1)
- }
- })
- })
-}
-
// ------------------------------------------审批-----------------------------------------
const approvalRecordData = ref([]) // 审批流程数据
@@ -573,11 +626,26 @@
// ------------------------------------事件-------------------------------------------------
// 检校专业变化
const changeCalibrationMajor = (val: string) => {
- form.value.certificateReportName = form.value.certificateReportCode + val + form.value.certifications
+ const index = calibrationMajorMap.value.findIndex((item: { value: string }) => item.value === val)
+ if (index !== -1) {
+ form.value.calibrationMajorName = calibrationMajorMap.value[index].name
+ }
+ console.log(form.value.calibrationMajorName)
}
// 证书类别变化
const changeCertifications = (val: string) => {
- form.value.certificateReportName = form.value.certificateReportCode + form.value.calibrationMajor + val
+ const index = certificationTypeMap.value.findIndex((item: { value: string }) => item.value === val)
+ if (index !== -1) {
+ form.value.certificateReportCategoryName = certificationTypeMap.value[index].name
+ }
+ console.log(form.value.certificateReportCategoryName)
+}
+// 选择检定员变化
+const changeMeasurePersonId = (val: string) => {
+ const index = userList.value.findIndex(item => item.id === val)
+ if (index !== -1) {
+ form.value.measurePerson = userList.value[index].name
+ }
}
// -------------------------------------------------------------------------------------
onMounted(async () => {
@@ -593,8 +661,9 @@
// form.value.createUser = user.id // 创建人id
// form.value.createUserName = user.name // 创建人
// form.value.applicantTime = proxy.dayjs().format('YYYY-MM-DD HH:mm:ss') // 申请时间
- form.value.jdy = user.name // 创建人
- form.value.jjrq = proxy.dayjs().format('YYYY-MM-DD') // 检校日期
+ form.value.measurePerson = user.name // 检定员名字
+ form.value.measurePersonId = user.id // 检定员id
+ form.value.calibrationTime = proxy.dayjs().format('YYYY-MM-DD') // 检校日期
}
})
@@ -606,7 +675,7 @@
上传证书
-
+
下载证书模板
@@ -641,25 +710,25 @@
label-width="140"
:rules="formRules"
>
-
+
-
+
替代已生成证书
-
-
+
+
-
+
选择
@@ -684,15 +753,15 @@
v-for="item in calibrationMajorMap"
:key="item.value"
:label="item.name"
- :value="item.name"
+ :value="item.value"
/>
-
+
@@ -720,7 +789,7 @@
/>
-
+
+
+
+
+
@@ -761,6 +841,18 @@
/>
+
+
+
+
+
-
-
+
+ filterable
+ @change="changeMeasurePersonId"
+ >
+
+
-
+
-
-
+
+
-
-
+
+
-
-
+
+
-
+
-
+
confirmSelectSample(val, 'order')" />
confirmSelectSample(val, 'warehouse')" />
+
+
+
+
diff --git a/src/views/business/lab/measureData/measureDataList.vue b/src/views/business/lab/measureData/measureDataList.vue
index 5c011b8..96ffa13 100644
--- a/src/views/business/lab/measureData/measureDataList.vue
+++ b/src/views/business/lab/measureData/measureDataList.vue
@@ -2,16 +2,19 @@
-
+
-
-
-
@@ -369,6 +385,7 @@
is-showmulti-select
@change="changePage"
@multi-select="handleSelectionChange"
+ @handleClickFollowLink="handleClickFollowLink"
>
@@ -483,3 +500,12 @@
+
+
diff --git a/src/views/business/schedule/interchangeReceipt/receiptEdit.vue b/src/views/business/schedule/interchangeReceipt/receiptEdit.vue
index 13ee3ab..877ea57 100644
--- a/src/views/business/schedule/interchangeReceipt/receiptEdit.vue
+++ b/src/views/business/schedule/interchangeReceipt/receiptEdit.vue
@@ -356,7 +356,7 @@
getInterchangeReceiptDetail({ id: infoId.value }).then((res) => {
dataForm.value = res.data // 表单
sampleList.value = res.data.customerSampleList // 样品列表
- dataForm.value.orderId = res.data.customerSampleList[0].orderId // orderId
+ dataForm.value.orderId = res.data.orderId // orderId
minioFileNameAutograph.value = res.data.recieverSignFile // 签名图片
loading.close()
})
diff --git a/src/views/finance/businessSettlement/businessSettlement-interface.ts b/src/views/finance/businessSettlement/businessSettlement-interface.ts
index 13a1a0c..454788f 100644
--- a/src/views/finance/businessSettlement/businessSettlement-interface.ts
+++ b/src/views/finance/businessSettlement/businessSettlement-interface.ts
@@ -4,6 +4,8 @@
customerNo: string // 委托方代码
customerName: string // 委托方名称
deliverer: string // 送样人
+ orderTimeStart: string // 委托日期开始
+ orderTimeEnd: string // 委托日期结束
offset: number
limit: number
}
@@ -14,17 +16,17 @@
orderCode: string // 委托书编号
customerNo: string // 委托方代码
customerName: string // 委托方名称
- deliverer: string // 送样人
- delivererTel: string // 联系方式
+ orderTime: string // 委托日期
sampleCount: string // 样品数量
- isUrgent: string // 是否加急
- createTime: string // 创建时间
- postedPrice: number // 标价(单位分)
- suggestedDiscount: string // 建议折扣-单位%
- suggestedPrice: number // 建议价格-单位分
- extraCharge: number // 附加费用-单位分
- extraChargeIllustration: string // 附加费用说明
- totalSettlement: number // 总计结算费用-单位分
+ sampleWarehouseName: string // 样品库房
+ certWarehouseName: string // 证书库房
+ feeStatus: string // 费用状态
+ received: string // 是否到账
+ actualTestFee: string // 检测费(实)(元)
+ shouldTestFee: string // 检测费(应)(元)
+ actualTotalFee: string // 实收合计(元)
+ receivedAmount: string // 到账金额(元)
+ invoiceAmount: string // 开票金额(元)
}
// 字典
@@ -49,21 +51,22 @@
// 表单
export interface IForm {
orderCode: string // 委托书编号
- orderId: string // 委托书编号
- deliverer: string // 送检人
- delivererTel: string // 送样人联系方式
- createTime: string // 委托单创建时间
- planDeliverTime: string // 预计送达时间
- requireOverTime: string // 要求检完时间
- customerNo: string // 委托方代码
- customerId: string // 委托方id
+ orderId: string // 委托单id
customerName: string // 委托方名称
- phone: string // 委托方电话
- priceFront: number // 标价
- suggestedDiscount: number // 建议折扣
- suggestedPrice: number // 建议价格
- extraCharge: number // 附加费用-单位分
- extraChargeIllustration: string // 附加费用说明
- totalSettlement: number // 总计结算费用
- samplePriceList: Array // 样品清单
+ orderTime: string // 委托日期
+ sampleCount: string // 样品数量
+ certificationCompany: string // 证书单位名称
+ certificationCompanyAddress: string // 证书单位地址
+ deliverer: string // 联系人
+ delivererTel: string // 联系方式
+ sampleWarehouse: string // 样品库房
+ certWarehouse: string // 证书库房
+ feeStatus: string // 费用状态
+ received: string // 是否到账
+ actualTestFee: Number // 检测费(实)(元)
+ shouldTestFee: Number // 检测费(应)(元)
+ actualTotalFee: Number // 实收合计(元)
+ receivedAmount: Number // 到账金额(元)
+ invoiceAmount: Number // 开票金额(元)
+ remark: string // 备注
}
diff --git a/src/views/finance/businessSettlement/edit.vue b/src/views/finance/businessSettlement/edit.vue
index e11f337..7630aeb 100644
--- a/src/views/finance/businessSettlement/edit.vue
+++ b/src/views/finance/businessSettlement/edit.vue
@@ -7,13 +7,18 @@
import { useRoute, useRouter } from 'vue-router'
import { el } from 'element-plus/es/locale'
import type { IForm, IsampleList } from './businessSettlement-interface'
+import multiTable from '@/components/MultiHeaderTable/index.vue'
+import { getDictByCode } from '@/api/system/dict'
+import { UploadFile } from '@/api/measure/file'
+import { calc } from '@/utils/useCalc'
+import type { dictType } from '@/global'
import type { TableColumn } from '@/components/NormalTable/table_interface'
import useUserStore from '@/store/modules/user'
import selectOrder from '@/views/business/schedule/interchangeReceipt/selectOrder.vue'
import type { IOrderList } from '@/views/business/schedule/order/orderList_interface'
import { getOrderDetail } from '@/api/business/schedule/order'
import { isNumber, validateMoney } from '@/utils/validate'
-import { calc } from '@/utils/useCalc'
+import useCheckList from '@/utils/useCheckList'
import { addBusinessSettlement, getBusinessSettlementDetail, updateBusinessSettlement } from '@/api/finance/businessSettlement'
const user = useUserStore() // 用户信息
const $route = useRoute()
@@ -27,54 +32,215 @@
// 表单数据
const form = ref({
orderCode: '', // 委托书编号
- orderId: '', // 委托书编号
- deliverer: '', // 送检人
- delivererTel: '', // 送样人联系方式
- createTime: '', // 委托单创建时间
- planDeliverTime: '', // 预计送达时间
- requireOverTime: '', // 要求检完时间
- customerNo: '', // 委托方代码
- customerId: '', // 委托方id
+ orderId: '', // 委托单id
customerName: '', // 委托方名称
- phone: '', // 委托方电话
- priceFront: 0, // 标价
- suggestedDiscount: 95, // 建议折扣
- suggestedPrice: 0, // 建议价格
- extraCharge: 0, // 附加费用-单位分
- extraChargeIllustration: '', // 附加费用说明
- totalSettlement: 0, // 总计结算费用
- samplePriceList: [], // 样品清单
+ orderTime: '', // 委托日期
+ sampleCount: '', // 样品数量
+ certificationCompany: '', // 证书单位名称
+ certificationCompanyAddress: '', // 证书单位地址
+ deliverer: '', // 联系人
+ delivererTel: '', // 联系方式
+ sampleWarehouse: '未入库', // 样品库房
+ certWarehouse: '未入库', // 证书库房
+ feeStatus: '未录费', // 费用状态
+ received: '未到账', // 是否到账
+ actualTestFee: 0, // 检测费(实)(元)
+ shouldTestFee: 0, // 检测费(应)(元)
+ actualTotalFee: 0, // 实收合计(元)
+ receivedAmount: 0, // 到账金额(元)
+ invoiceAmount: 0, // 开票金额(元)
+ remark: '', // 备注
})
-const ruleFormRef = ref() as any
-const list = ref([])// 表格数据
-const orderVisible = ref(false) // 控制委托书对话框显隐
-
-// 表头
-const columns = ref([
- { text: '样品编号', value: 'sampleNo', align: 'center', width: '170', required: false },
- { text: '样品名称', value: 'sampleName', align: 'center', required: false },
- { text: '型号', value: 'sampleModel', align: 'center', required: false },
- { text: '出厂编号', value: 'manufacturingNo', align: 'center', required: false },
- { text: '检定项目', value: 'measureContent', align: 'center', required: false },
- { text: '标价(元)', value: 'price', align: 'center', required: true, reg: validateMoney },
-])
// 表单校验规则
const rules = reactive({
- orderCode: [{ required: true, message: '委托书编号必填', trigger: 'blur' }],
- price: [{ required: true, message: '标价必填', trigger: ['blur', 'change'] },
- { pattern: /(^-?\d\d*\.\d*$)|(^-?\d\d*$)|(^-?\.\d\d*$)/, message: '标价只能为数字', trigger: ['blur', 'change'] }],
- suggestedDiscount: [{ required: true, message: '建议折扣必填', trigger: ['blur', 'change'] },
- { pattern: /^([0]|[1-9][0-9]*)$/, message: '建议折扣只能为正整数或0', trigger: ['blur', 'change'] }],
- extraCharge: [{ required: true, message: '附加费用必填', trigger: ['blur', 'change'] },
- { pattern: /(^[0-9](\d+)?(\.\d{1,2})?$)|(^\d\.\d{1,2}$)/, message: '要求不小于0,且最多保留两位小数', trigger: ['blur', 'change'] }],
- extraChargeIllustration: [{ required: true, message: '附加费用说明必填', trigger: 'blur' }],
+ orderCode: [{ required: true, message: '委托单编号必填', trigger: 'blur' }],
+ customerName: [{ required: true, message: '委托方名称必填', trigger: 'blur' }],
+ orderTime: [{ required: true, message: '委托日期必填', trigger: 'blur' }],
+ sampleCount: [{ required: true, message: '样品数量必填', trigger: 'blur' }],
+ certificationCompany: [{ required: true, message: '证书单位名称必填', trigger: 'blur' }],
+ certificationCompanyAddress: [{ required: true, message: '证书单位地址必填', trigger: 'blur' }],
+ deliverer: [{ required: true, message: '联系人必填', trigger: 'blur' }],
+ delivererTel: [{ required: true, message: '联系电话必填', trigger: 'blur' }],
+ sampleWarehouse: [{ required: true, message: '样品库房必填', trigger: 'blur' }],
+ certWarehouse: [{ required: true, message: '证书库房必填', trigger: 'blur' }],
+ feeStatus: [{ required: true, message: '费用状态必填', trigger: 'blur' }],
+ received: [{ required: true, message: '是否到账必填', trigger: 'blur' }],
+ actualTestFee: [{ required: true, message: '检测费(实)(元)必填', trigger: 'blur' }],
+ shouldTestFee: [{ required: true, message: '检测费(应)(元)必填', trigger: 'blur' }],
+ actualTotalFee: [{ required: true, message: '实收合计(元)必填', trigger: 'blur' }],
+ receivedAmount: [{ required: true, message: '到账金额(元)必填', trigger: 'blur' }],
+ invoiceAmount: [{ required: true, message: '开票金额(元)必填', trigger: 'blur' }],
})
+const ruleFormRef = ref() as any
+const orderVisible = ref(false) // 控制委托书对话框显隐
// ---------------------------------------路由参数--------------------------------------
if ($route.params && $route.params.type) {
pageType.value = $route.params.type as string
infoId.value = $route.params.id as string
}
+// ---------------------------------------字典--------------------------------------
+
+const financeSampleWarehouseList = ref([]) // 样品库房
+const financeCertWarehouseList = ref([]) // 证书库房
+const financeReceivedList = ref([]) // 是否到账
+// 获取字典值
+function getDict() {
+ // 样品库房
+ getDictByCode('financeSampleWarehouse').then((response) => {
+ financeSampleWarehouseList.value = response.data
+ })
+ // 证书库房
+ getDictByCode('financeCertWarehouse').then((response) => {
+ financeCertWarehouseList.value = response.data
+ })
+ // 是否到账
+ getDictByCode('financeReceived').then((response) => {
+ financeReceivedList.value = response.data
+ })
+}
+getDict()
+// -----------------------------------到账金额明细--------------------------------------------------
+const receivedAmountList = ref([]) as any // 到账金额明细
+const checkoutReceivedAmountList = ref([]) as any // 到账金额明细多选
+// 表头
+const receivedAmountcolumns = ref([
+ { text: '到账金额(元)', value: 'money', align: 'center', width: '220', required: true },
+ { text: '到账时间', value: 'moneyTime', align: 'center', width: '220', required: true },
+ { text: '附件', value: 'attachment', align: 'center', required: false },
+])
+
+// -------------------------------------开票金额明细--------------------------------------------------------------
+const invoiceAmountList = ref([]) as any // 开票金额明细
+const checkoutInvoiceAmountList = ref([]) as any // 开票金额明细多选
+// 表头
+const invoiceAmountcolumns = ref([
+ { text: '开票金额(元)', value: 'money', align: 'center', width: '220', required: true },
+ { text: '开票时间', value: 'moneyTime', align: 'center', width: '220', required: true },
+ { text: '附件', value: 'attachment', align: 'center', required: false },
+])
+
+// 多选发生改变时
+const handleSelectionChange = (e: any, type: 'addReceived' | 'invoiceAmount') => {
+ if (type === 'addReceived') { // 到账金额明细
+ checkoutReceivedAmountList.value = e
+ }
+ else { // 开票金额明细
+ checkoutInvoiceAmountList.value = e
+ }
+}
+
+// 点击增加行
+const addRow = (type: 'addReceived' | 'invoiceAmount') => {
+ if (type === 'addReceived') {
+ if (useCheckList(receivedAmountList.value, receivedAmountcolumns.value, '到账金额明细')) {
+ receivedAmountList.value.push({
+ money: undefined,
+ moneyTime: '',
+ attachment: [],
+ moneyType: '1',
+ })
+ }
+ }
+ else {
+ if (useCheckList(invoiceAmountList.value, invoiceAmountcolumns.value, '开票金额明细')) {
+ invoiceAmountList.value.push({
+ money: undefined,
+ moneyTime: '',
+ attachment: [],
+ moneyType: '2',
+ })
+ }
+ }
+}
+
+// 删除行
+const delRow = (type: 'addReceived' | 'invoiceAmount') => {
+ if ((type === 'addReceived' && checkoutReceivedAmountList.value.length <= 0) || (type === 'invoiceAmount' && checkoutInvoiceAmountList.value.length <= 0)) {
+ ElMessage({
+ message: '请选中要删除的行',
+ type: 'warning',
+ })
+ }
+ else {
+ if (type === 'addReceived') {
+ receivedAmountList.value = receivedAmountList.value.filter(
+ (item: any) => {
+ return !checkoutReceivedAmountList.value.includes(item)
+ },
+ )
+ }
+ else {
+ invoiceAmountList.value = invoiceAmountList.value.filter(
+ (item: any) => {
+ return !checkoutInvoiceAmountList.value.includes(item)
+ },
+ )
+ }
+ }
+}
+
+// ----------------------------------------上传附件----------------------------------------------------
+// 删除附件
+const del = (index: number, row: any) => {
+ row.value.attachment.splice(index, 1)
+}
+
+const fileRef = ref() // 文件上传input
+const onFileChange = (event: any, row?: any, type?: 'receivedAmount' | 'invoiceAmount') => {
+ // 原生上传
+ console.log(event.target.files)
+ const files = event.target.files
+ if (files.length !== 0) {
+ // 创建formdata对象
+ const fd = new FormData()
+ for (var i = 0; i < files.length; i++) {
+ fd.append('multipartFile', files[i])
+ }
+ UploadFile(fd).then((res) => {
+ if (res.code === 200) {
+ res.data.forEach((item: string) => {
+ row.attachment.push({
+ minioFileName: item,
+ })
+ })
+ ElMessage.success('文件上传成功')
+ }
+ else {
+ ElMessage.error(res.message)
+ }
+ })
+ }
+}
+const upload = () => {
+ fileRef.value.click()
+}
+// ------------------------------------结算明细--------------------------------------------------------------------
+const list = ref([]) // 开票金额明细
+// 表头
+const columns = ref([
+ { text: '器具名称', value: 'sampleName', align: 'center', required: true, type: 'text' },
+ { text: '型号规格', value: 'sampleModel', align: 'center', width: '180', required: true, type: 'input' },
+ { text: '套数/退', value: 'sets', align: 'center', required: true, width: '180', type: 'inputNumber' },
+ { text: '出厂编号', value: 'manufacturingNo', align: 'center', width: '180', required: true, type: 'input' },
+ { text: '委托日期', value: 'orderTime', align: 'center', required: true, width: '160', type: 'date' },
+ { text: '检测规范', value: 'accordStandard', align: 'center', width: '180', required: false, type: 'input' },
+ {
+ text: '收费(元)含6%增值税',
+ value: 'price',
+ align: 'center',
+ required: false,
+ children: [
+ { text: '检测费(应)', value: 'shouldTestFee', align: 'center', width: '180', required: true, type: 'inputNumber' },
+ { text: '检测费(实)', value: 'actualTestFee', align: 'center', required: true, width: '180', type: 'inputNumber' },
+ { text: '附加费', value: 'extraFee', align: 'center', required: false, width: '180', type: 'inputNumber' },
+ { text: '修理费', value: 'repairFee', align: 'center', required: false, width: '180', type: 'inputNumber' },
+ { text: '其他费', value: 'otherFee', align: 'center', required: false, width: '180', type: 'inputNumber' },
+ { text: '小计', value: 'subtotal', align: 'center', required: false, type: 'text' },
+ ],
+ },
+])
+
// ------------------------------------委托书---------------------------------------------
// 点击选择委托书编号
const handleClickOrder = () => {
@@ -87,87 +253,63 @@
// 选好委托书
const confirmCheckoutOrder = (val: Array) => {
if (val && val.length) {
- form.value.priceFront = 0 // 标价
- // form.value.suggestedDiscount = 95 // 建议折扣
- form.value.suggestedPrice = 0 // 建议价格
- form.value.extraCharge = 0// 附加费用-单位分
- form.value.extraChargeIllustration = '' // 附加费用说明
- form.value.totalSettlement = 0 // 总计结算费用
getOrderDetail({ id: val[0].id }).then((res) => { // 样品清单
form.value.orderCode = res.data.orderCode // 委托书编号
form.value.orderId = res.data.id // 委托书id
- form.value.deliverer = res.data.deliverer // 送检人
- form.value.delivererTel = res.data.delivererTel // 送检人
- form.value.createTime = res.data.createTime // 委托单创建时间
- form.value.customerNo = res.data.customerNo // 委托方代码
- form.value.customerId = res.data.customerId // 委托方id
form.value.customerName = res.data.customerName // 委托方名称
- form.value.planDeliverTime = res.data.planDeliverTime // 预计送达时间
- form.value.requireOverTime = res.data.requireOverTime // 要求检完时间
- form.value.phone = res.data.customerPhone // 委托方电话
- list.value = res.data.customerSampleInfoList.map((item: { isEdit: boolean }) => {
+ form.value.orderTime = res.data.createTime // 委托日期(委托单创建时间)
+ form.value.certificationCompany = res.data.certificationCompany // 证书单位名称
+ form.value.certificationCompanyAddress = res.data.certificationCompanyAddress // 证书单位地址
+ form.value.deliverer = res.data.deliverer // 联系人
+ form.value.delivererTel = res.data.delivererTel // 联系方式
+ form.value.sampleCount = res.data.customerSampleInfoList.length // 样品数量
+ list.value = res.data.customerSampleInfoList.map((item: { createTime: string; editable: boolean }) => {
return {
...item,
- isEdit: true,
+ orderTime: item.createTime ? dayjs(item.createTime).format('YYYY-MM-DD') : item.createTime, // 委托日期
+ editable: pageType.value !== 'detail',
+ shouldTestFee: 0, // 检测费(应)
+ actualTestFee: 0, // 检测费(实)
+ extraFee: 0, // 附加费
+ repairFee: 0, // 修理费
+ otherFee: 0, // 其他费
+ sets: 0, // 套数
+ subtotal: 0, // 小计
+ id: '',
}
})
})
}
}
-// -----------------------------------------样品清单--------------------------------------------
-// 检查列表
-function checkSampleList() {
- for (let index = 0; index < list.value.length; index++) {
- const item = list.value[index]
- for (const prop of columns.value) {
- // 检查必填
- if (prop.required && !item[prop.value]) {
- ElMessage.warning(`请先完善第${index + 1}行中${prop.text}`)
- return false
- }
- // 验证正则
- if (prop.reg && typeof prop.reg === 'function') {
- if (!prop.reg(item[prop.value])) {
- // ElMessage.warning(`第${index + 1}行中${prop.text}输入不合法`)
- ElMessage.warning(`第${index + 1}行: 要求标价为正数,且最多保留两位小数`)
- return false
- }
- }
- }
- }
- return true
-}
+// --------------------------------------------计算----------------------------------------------
+// 计算
+const handleInputNumberChange = ({ row }: any) => {
+ // 计算小计
+ row.subtotal = calc(Number(calc(Number(calc(Number(calc(Number(row.shouldTestFee), Number(row.actualTestFee), '+')), row.extraFee, '+')), row.repairFee, '+')), row.otherFee, '+')
+ // 计算检测费(应)(元)
+ form.value.shouldTestFee = list.value.reduce((accumulator, current: any) => accumulator + current.shouldTestFee, 0)
+ // 计算检测费(实)(元)
+ form.value.actualTestFee = list.value.reduce((accumulator, current: any) => accumulator + current.actualTestFee, 0)
+ // 实收合计
+ form.value.actualTotalFee = list.value.reduce((accumulator, current: any) => accumulator + current.subtotal, 0)
-// --------------------------------------------自动计算----------------------------------------------
-// 折扣改变-计算建议价格
-const changeSuggestedDiscount = () => {
- console.log('折扣改变')
- if (form.value.priceFront) {
- form.value.suggestedPrice = calc(Number(form.value.priceFront), Number(form.value.suggestedDiscount / 100), '*') as number
- form.value.suggestedPrice = Number(form.value.suggestedPrice.toFixed(2))
+ if (list.value.every((item: { actualTestFee: number }) => item.actualTestFee === 0 || `${item.actualTestFee}` === 'undefined' || `${item.actualTestFee}` === 'null' || `${item.actualTestFee}` === '')) {
+ form.value.feeStatus = '未录费'
+ }
+ else if (list.value.every((item: { actualTestFee: number }) => item.actualTestFee !== 0 || `${item.actualTestFee}` === 'undefined' || `${item.actualTestFee}` === 'null' || `${item.actualTestFee}` === '')) {
+ form.value.feeStatus = '已录费'
+ }
+ else {
+ form.value.feeStatus = '部分录费'
}
}
-// 标价改变
-const changePrice = () => {
- console.log('标价改变')
- let sum = 0
- list.value.forEach((item) => {
- if (item.price) {
- sum = calc(Number(sum), Number(item.price), '+') as number
- }
- })
- form.value.priceFront = sum
- changeSuggestedDiscount() // 建议价格随之变化
+const changeTableInputNumber = () => {
+ // 到账金额
+ form.value.receivedAmount = receivedAmountList.value.reduce((accumulator: any, current: any) => accumulator + current.money, 0)
+ // 开票金额
+ form.value.invoiceAmount = invoiceAmountList.value.reduce((accumulator: any, current: any) => accumulator + current.money, 0)
}
-// 附加费用改变
-const changeExtraCharge = () => {
- console.log('附加费用改变')
- form.value.totalSettlement = calc(Number(form.value.suggestedPrice), Number(form.value.extraCharge), '+') as number
-}
-watch(() => form.value.suggestedPrice, (newValue) => {
- changeExtraCharge()
-})
// ----------------------------------------------------------------------------------------
const $router = useRouter()
@@ -176,9 +318,35 @@
$router.back()
}
+// 校验表格
+const checkList = () => {
+ if (!receivedAmountList.value.length) {
+ ElMessage.warning('到账金额明细不能为空')
+ return false
+ }
+ if (!invoiceAmountList.value.length) {
+ ElMessage.warning('开票金额明细不能为空')
+ return false
+ }
+ if (!list.value.length) {
+ ElMessage.warning('结算明细不能为空')
+ return false
+ }
+ if (!useCheckList(receivedAmountList.value, receivedAmountcolumns.value, '到账金额明细')) {
+ return false
+ }
+ if (!useCheckList(invoiceAmountList.value, invoiceAmountcolumns.value, '开票金额明细')) {
+ return false
+ }
+ if (!useCheckList(list.value, columns.value, '结算明细')) {
+ return false
+ }
+ return true
+}
+
// 保存
const save = () => {
- if (!checkSampleList()) {
+ if (!checkList()) {
return false
}
ruleFormRef.value.validate((valid: boolean) => {
@@ -188,17 +356,10 @@
background: 'rgba(255, 255, 255, 0.8)',
})
const params = {
- extraCharge: calc(Number(form.value.extraCharge), 100, '*'), // 附加费用-单位分
- extraChargeIllustration: form.value.extraChargeIllustration, // 附加费用说明
id: infoId.value,
- orderId: form.value.orderId, // 委托书id
- suggestedDiscount: form.value.suggestedDiscount, // 建议折扣-单位%
- samplePriceList: list.value.map((item) => {
- return {
- price: calc(Number(item.price), 100, '*'), // 标价-单位分
- relationId: item.relationId, // 样品id
- }
- }), // 样品清单
+ ...form.value,
+ amountDetailsList: receivedAmountList.value.concat(invoiceAmountList.value),
+ sampleList: list.value,
}
// 新建
if (pageType.value === 'add') {
@@ -229,24 +390,22 @@
// 编辑、详情--获取详细信息
const fetchDetail = () => {
+ const loading = ElLoading.service({})
getBusinessSettlementDetail({ id: infoId.value }).then((res) => {
form.value = res.data
- form.value.phone = res.data.customerPhone
- list.value = res.data.sampleList.map((item: { postedPrice: number; id: string }) => {
+ receivedAmountList.value = res.data.amountDetailsList.filter((item: { moneyType: string }) => `${item.moneyType}` === '1')
+ invoiceAmountList.value = res.data.amountDetailsList.filter((item: { moneyType: string }) => `${item.moneyType}` === '2')
+ list.value = res.data.sampleDetailsList.map((item: { editable: boolean; orderTime: string }) => {
return {
...item,
- price: calc(Number(item.postedPrice), 100, '/') as number,
- isEdit: pageType.value === 'edit',
- relationId: item.id,
+ editable: pageType.value !== 'detail',
+ orderTime: item.orderTime ? dayjs(item.orderTime).format('YYYY-MM-DD') : item.orderTime,
}
})
- form.value.priceFront = calc(Number(res.data.postedPrice), 100, '/') as number // 标价
- // form.value.suggestedDiscount = // 建议折扣
- form.value.suggestedPrice = calc(Number(res.data.suggestedPrice), 100, '/') as number// 建议价格
- form.value.extraCharge = calc(Number(res.data.extraCharge), 100, '/') as number// 附加费用-单位分
- // form.value.extraChargeIllustration = // 附加费用说明
- form.value.totalSettlement = calc(Number(res.data.totalSettlement), 100, '/') as number // 总计结算费用
- })
+ form.value.orderTime = res.data.sampleDetailsList[0].orderTime // 委托日期
+ form.value.sampleCount = res.data.sampleDetailsList.length // 样品数量
+ loading.close()
+ }).catch(() => loading.close())
}
onMounted(() => {
@@ -278,10 +437,10 @@
>
-
+
@@ -294,51 +453,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -467,17 +645,26 @@
-
-
+
+
+
+ 增加行
+
+
+ 删除行
+
+
handleSelectionChange(e, 'addReceived')"
>
+
*{{ item.text }}
-
-
-
- {{ scope.row[item.value] }}
+
+
+
+
+ {{ '上传' }}
+
+
+
+ ×
+
+
+
onFileChange(e, scope.row, 'receivedAmount')">
+
+
+
+
+ 增加行
+
+
+ 删除行
+
+
+ handleSelectionChange(e, 'invoiceAmount')"
+ >
+
+
+
+
+ *{{ item.text }}
+
+
+
+
+
+
+
+ {{ '上传' }}
+
+
+
+ ×
+
+
+
onFileChange(e, scope.row, 'receivedAmount')">
+
+
+
+
+
+
+
+
diff --git a/src/views/finance/businessSettlement/list.vue b/src/views/finance/businessSettlement/list.vue
index eea28d8..2852223 100644
--- a/src/views/finance/businessSettlement/list.vue
+++ b/src/views/finance/businessSettlement/list.vue
@@ -2,6 +2,8 @@
+
+
+
+
+
+
diff --git a/src/components/MultiHeaderTable/tableColumn.vue b/src/components/MultiHeaderTable/tableColumn.vue
new file mode 100644
index 0000000..2b87285
--- /dev/null
+++ b/src/components/MultiHeaderTable/tableColumn.vue
@@ -0,0 +1,147 @@
+
+
+
+
+
+
+
+
+
+
+ *{{ item.text }}
+
+
+ *{{ item.text }}
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ scope.row[item.value] }}
+
+
+ {{
+ scope.row[item.value]
+ }}
+
+
+
+
+
+
diff --git a/src/components/NormalTable/index.vue b/src/components/NormalTable/index.vue
index e56f775..67092d3 100644
--- a/src/components/NormalTable/index.vue
+++ b/src/components/NormalTable/index.vue
@@ -3,6 +3,7 @@
import { ElTable } from 'element-plus'
import { defineExpose, ref } from 'vue'
import type { TableColumn } from './table_interface'
+import showPhoto from '@/views/system/tool/showPhoto.vue'
// ------------------定义props、 emit-------------------
const props = defineProps({
@@ -212,8 +213,8 @@
{{ scope.row[column.value] }}
{{ column.filter(scope.row) }}
- {{ scope.row }}
-
+
+
diff --git a/src/utils/useCheckList.ts b/src/utils/useCheckList.ts
new file mode 100644
index 0000000..c7782f0
--- /dev/null
+++ b/src/utils/useCheckList.ts
@@ -0,0 +1,73 @@
+import { ElMessage } from 'element-plus'
+// import type { TableColumn } from '@/components/NormalTable/table_interface'
+
+/**
+ * 检查列表
+ * @param list 要检查的表格数据(被依赖项如果满足某个条件就去检查依赖项,否则不检查依赖项)
+ * @param columns // 表头信息
+ * @param tableTitle // 表格名称
+ * @param depend // 依赖项
+ * @param depended // 被依赖项
+ * @param dependedValue // 被依赖项条件
+ * @param requireLength // 要检查的表格数据长度是否大于0
+ */
+export default function useCheckList(list: any, columns: any, tableTitle = '', depend?: string, depended?: string, dependedValue?: number | string, requireLength = false): boolean {
+ for (const prop of columns) {
+ for (let index = 0; index < list.length; index++) {
+ const item = list[index]
+
+ if (depend && depended && item[depended] === dependedValue && !(`${item[prop.value]}`)) { // 被依赖项满足条件时需要检查
+ ElMessage.warning(`请先完善 ${tableTitle} 第${index + 1}行中 ${prop.text} 字段`)
+ return false
+ }
+ else {
+ // 检查必填
+ if (prop.required && (!(`${item[prop.value]}`) || `${item[prop.value]}` === 'null' || `${item[prop.value]}` === 'undefined' || item[prop.value] == undefined)) {
+ if (`${prop.belongStandardEquipment}` === '15') { // 小功率
+ ElMessage.warning(`${tableTitle} 第${index + 1}行中 ${prop.message} ${prop.text} 字段不能为空`)
+ }
+ else {
+ ElMessage.warning(`请先完善 ${tableTitle} 第${index + 1}行中 ${prop.text} 字段`)
+ }
+ return false
+ }
+ }
+
+ // 验证正则
+ if (prop.reg && typeof prop.reg === 'function') {
+ if (prop.value === 'resolution') { // 分辨力特殊处理
+ if (!prop.reg(item[prop.value])) {
+ ElMessage.warning(`${tableTitle} 第${index + 1}行中 ${prop.text} 不能大于1`)
+ return false
+ }
+ }
+ else {
+ if (!prop.reg(item[prop.value])) {
+ if (`${prop.belongStandardEquipment}` === '15') { // 小功率
+ ElMessage.warning(`${tableTitle} 第${index + 1}行中 ${prop.message} ${prop.text} 字段不能为0`)
+ }
+ else if (`${prop.belongStandardEquipment}` === '17') { // S参数
+ ElMessage.warning(`${tableTitle} 第${index + 1}行中 ${prop.text} 仅允许输入数字、字母、特殊字符`)
+ }
+ else {
+ ElMessage.warning(`${tableTitle} 第${index + 1}行中 ${prop.text} 字段输入不合法`)
+ }
+ return false
+ }
+ }
+ }
+
+ if (prop.children && prop.children.length) {
+ if (!useCheckList(list, prop.children, tableTitle, depend, depended, dependedValue)) {
+ return false
+ }
+ }
+ }
+ }
+
+ if (requireLength && !list.length) {
+ ElMessage.warning(`${tableTitle}表格数据不能为空`)
+ return false
+ }
+ return true
+}
diff --git a/src/views/business/lab/components/selectOrderSamplesDialog.vue b/src/views/business/lab/components/selectOrderSamplesDialog.vue
index 4002f83..b004107 100644
--- a/src/views/business/lab/components/selectOrderSamplesDialog.vue
+++ b/src/views/business/lab/components/selectOrderSamplesDialog.vue
@@ -14,6 +14,7 @@
const loadingTable = ref(false) // loading
const list = ref([]) // 表格参数
const tableRef = ref()
+const isMulti = ref(true) // 是否多选默认为多选
const columns = ref
([
{ text: '被测样品名称', value: 'sampleName', align: 'center', required: true },
{ text: '型号规格', value: 'sampleModel', align: 'center', required: true },
@@ -60,9 +61,10 @@
}
// 初始化
-const initDialog = (orderIdParam: string) => {
+const initDialog = (orderIdParam: string, isMultiParam = true) => {
dialogFormVisible.value = true
orderId.value = orderIdParam
+ isMulti.value = isMultiParam
getList()
}
defineExpose({ initDialog })
@@ -78,7 +80,7 @@
:columns="columns"
is-showmulti-select
:list-loading="loadingTable"
- :is-multi="true"
+ :is-multi="isMulti"
:height="300"
:pagination="false"
@multi-select="handleSelectionChange"
diff --git a/src/views/business/lab/components/selectReportTemplate.vue b/src/views/business/lab/components/selectReportTemplate.vue
index 5c59693..ec36ef7 100644
--- a/src/views/business/lab/components/selectReportTemplate.vue
+++ b/src/views/business/lab/components/selectReportTemplate.vue
@@ -7,8 +7,9 @@
import type { typeofSign } from '@/views/system/tool/tool_interface'
import { templatePage } from '@/api/system/tool'
-const emits = defineEmits(['add'])
+const emits = defineEmits(['confirm'])
const dialogFormVisible = ref(false) // 控制弹窗显隐
+const createTime = ref()
// 查询参数
const searchQuery = reactive({
templateNo: '', // 编号
@@ -18,31 +19,43 @@
createEndTime: '',
limit: 5,
offset: 1,
- templateType: '',
+ certificationType: '0',
ids: [] as string[],
}) // 查询参数
const loadingTable = ref(false) // loading
const list = ref([]) // 表格参数
const total = ref(0)
const columns = ref([
- { text: '编号', value: 'templateNo', align: 'center', width: '180' },
- { text: '模板名称', value: 'templateName', align: 'center', width: '150' },
- { text: '模板负责人', value: 'templateCreator', align: 'center', width: '100' },
- { text: '创建时间', value: 'createTime', align: 'center', width: '250' },
- { text: '描述', value: 'templateDesc', align: 'center' },
+ { text: '编号', value: 'templateNo', align: 'center', width: '160' },
+ { text: '模板名称', value: 'templateName', align: 'center' },
+ { text: '模板类型', value: 'templateTypeName', align: 'center', width: '100' },
+ { text: '负责人', value: 'templateCreator', align: 'center', width: '100' },
+ { text: '内容描述', value: 'templateDesc', align: 'center' },
+ { text: '创建时间', value: 'createTime', align: 'center', width: '180' },
])
const checkoutList = ref([]) // 多选选中参数
-// 获取类型
-const getType = async () => {
- const res = await getDictByCode('templateType')
- searchQuery.templateType = res.data.filter((item: typeofSign) => item.name === '证书报告模板')[0].value
+// ---------------------------------------字典--------------------------------------------
+const templateTypeMap = ref([]) as any // 模板类型
+// 获取字典值
+async function getDict() {
+ // 模板类型
+ const res = await getDictByCode('certificationType')
+ res.data.forEach((item: { value: string; name: string }) => {
+ templateTypeMap.value[`${item.value}`] = item.name
+ })
}
+// ----------------------------------------------------------------------------------------------
// 获取数据列表
const getList = () => {
loadingTable.value = true
templatePage(searchQuery).then((res) => {
if (res.code === 200) {
- list.value = res.data.rows
+ list.value = res.data.rows.map((item: { certificationType: string }) => {
+ return {
+ ...item,
+ templateTypeName: `${item.certificationType}` ? templateTypeMap.value[item.certificationType] : item.certificationType, // 模板类型
+ }
+ })
total.value = res.data.total
}
loadingTable.value = false
@@ -74,7 +87,8 @@
searchQuery.createEndTime = ''
searchQuery.limit = 5
searchQuery.offset = 1
- // searchQuery.templateType = '' // 类型不能变
+ searchQuery.certificationType = '0'
+ createTime.value = ''
searchQuery.ids = []
getList()
}
@@ -82,10 +96,10 @@
// 点击保存
const submitForm = () => {
if (!checkoutList.value.length) {
- ElMessage.warning('请选择证书报告模板')
+ ElMessage.warning('请选择证书模板')
}
else {
- emits('add', checkoutList.value[0])
+ emits('confirm', checkoutList.value[0])
dialogFormVisible.value = false
}
}
@@ -103,15 +117,25 @@
// 初始化
const initDialog = () => {
dialogFormVisible.value = true
- getType().then((_) => {
+ getDict().then((_) => {
getList()
})
}
+watch(() => createTime.value, (newVal) => {
+ if (newVal) {
+ searchQuery.createStartTime = newVal[0]
+ searchQuery.createEndTime = newVal[1]
+ }
+ else {
+ searchQuery.createStartTime = ''
+ searchQuery.createEndTime = ''
+ }
+})
defineExpose({ initDialog })
-
+
@@ -121,7 +145,18 @@
-
+
+
+
+
diff --git a/src/views/business/lab/measureData/dialog/selectMeasueDataDialog.vue b/src/views/business/lab/measureData/dialog/selectMeasueDataDialog.vue
new file mode 100644
index 0000000..f8be703
--- /dev/null
+++ b/src/views/business/lab/measureData/dialog/selectMeasueDataDialog.vue
@@ -0,0 +1,199 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ (listQuery.offset - 1) * listQuery.limit + scope.$index + 1 }}
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/views/business/lab/measureData/dialog/selectTechFilesDialog.vue b/src/views/business/lab/measureData/dialog/selectTechFilesDialog.vue
new file mode 100644
index 0000000..f6f1a5a
--- /dev/null
+++ b/src/views/business/lab/measureData/dialog/selectTechFilesDialog.vue
@@ -0,0 +1,247 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ (listQuery.offset - 1) * listQuery.limit + scope.$index + 1 }}
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/views/business/lab/measureData/measureData-interface.ts b/src/views/business/lab/measureData/measureData-interface.ts
index 8319f65..d25a212 100644
--- a/src/views/business/lab/measureData/measureData-interface.ts
+++ b/src/views/business/lab/measureData/measureData-interface.ts
@@ -1,13 +1,14 @@
// 查询条件
export interface IListQuery {
- approvalStatus: string // 审批状态
- certificateReportCode: string // 证书编号
- certificateReportName: string // 证书名称
- customerName: string // 委托方名称
- sampleName: string // 样品名称
- measureCategory: string // 检校类别
- approvalStatusName: string // 审批状态名称
- formId: string
+ approvalStatus: string // 审批状态类型code
+ certificateReportCode: string // 证书编号
+ certificateReportName: string // 证书名称
+ customerName: string // 委托方名称
+ formId: string // 表单id(流程定义对应的表单id,等价于业务id)
+ measureCategory: string // 检校类别
+ orderCode: string // 委托书编号
+ sampleName: string // 样品名称
+ sampleNo: string // 样品编号
offset: number
limit: number
}
@@ -28,47 +29,53 @@
calibrationTime: string // 检校日期
taskId?: string // 任务id 用于审批
decisionItem?: string
- applyApprovalStatusName?: string // 审批状态名称
+ approvalStatusName?: string // 审批状态名称
processId?: string // 流程实例id
}
// 表单
export interface IForm {
- tdysczs: number // 替代已生成证书
+ id?: string
+ invalid: number // 替代已生成证书
formId: string
- yzs: string // 原证书
+ oldCertificateCode: string // 原证书
calibrationMajor: string // 检校专业
- certifications: string // 证书类别
+ calibrationMajorName: string // 检校专业名称
+ certificateReportCategory: string // 证书类别
+ certificateReportCategoryName: string // 证书类别名称
certificateReportCode: string // 证书编号
certificateReportName: string // 证书名称
- jdy: string // 检定员
- jjrq: string // 检校日期
+ measurePerson: string // 检定员
+ measurePersonId: string // 检定员id
+ calibrationTime: string // 检校日期
orderCode: string // 委托书
orderId: string // 委托书id
customerId?: string // 委托放id
customerName: string // 委托方名称
+ customerAddress: string // 委托方地址
certificationCompany: string // 证书单位名称
certificationCompanyAddress: string // 证书单位地址
calibrationPlace: string // 检校地点
- fjsj: string // 复校时间
- jssj: string // 接收时间
- jdjg: string // 检定结果
- environmentCode: string// 环境记录单编号
+ repeatTime: string // 复校时间
+ deliverTime: string // 接收时间
+ measureResult: string // 检定结果
+ environmentCode: string // 环境记录单编号
environmentId: string // 环境记录单id
temperature: string // 温度
humidity: string // 湿度
+ techFilesName: string // 依据的技术文件名称
signId: string // 电子签章id
signName: string // 电子签章名称
approvalSignIds: string // 认可标志专用章id
approvalSignName: string // 认可标志专用章名称
remark: string // 备注
- ywy: string // 业务员
+ busPersonId: string // 业务员id
+ busPersonName: string // 业务员名字
templateId: string // 证书模板
templateName: string // 证书模板
- templateNameFile: string // 证书模板文件
certificateReportFile: string // 证书报告附件
processId?: string // 流程实例id
@@ -76,6 +83,7 @@
// 被检样品
export interface ISampleList {
+ id: string // 样品id
sampleNo: string // 样品编号
sampleName: string // 样品名称
sampleModel: string // 型号
diff --git a/src/views/business/lab/measureData/measureDataDetail.vue b/src/views/business/lab/measureData/measureDataDetail.vue
index 4aa9717..c554c33 100644
--- a/src/views/business/lab/measureData/measureDataDetail.vue
+++ b/src/views/business/lab/measureData/measureDataDetail.vue
@@ -3,6 +3,7 @@
import { ElLoading, ElMessage, ElMessageBox } from 'element-plus'
import type { FormInstance, FormRules } from 'element-plus'
import { ref } from 'vue'
+import dayjs from 'dayjs'
import EnvironmentalDialog from '../components/environmentalDialog.vue'
import selectSignature from '../components/selectSignature.vue'
import selectReportTemplate from '../components/selectReportTemplate.vue'
@@ -10,10 +11,12 @@
import SelectSamplesDialog from '../components/selectSamplesDialog.vue'
import selectMeasureDevice from '../components/selectMeasureDevice.vue'
import type { IEquipmentList, IForm, ISampleList } from './measureData-interface'
+import selectMeasueDataDialog from './dialog/selectMeasueDataDialog.vue'
+import selectTechFilesDialog from './dialog/selectTechFilesDialog.vue'
import { UploadFile } from '@/api/measure/file'
import ApprovalDialog from '@/components/Approval/ApprovalDialog.vue'
import type { TableColumn } from '@/components/NormalTable/table_interface'
-import { addApply, detail, failUpdateApply, submit, updateApply } from '@/api/business/subpackage/apply'
+import { addMeasureData, downLoadTemplate, draftUpdateMeasureData, failUpdateMeasureData, getMeasureDataDetail, submit } from '@/api/business/lab/measureData'
import { cancelApproval, fetchApproval, submitApproval } from '@/api/approval'
import showPhoto from '@/views/system/tool/showPhoto.vue'
import { getDictByCode } from '@/api/system/dict'
@@ -21,6 +24,9 @@
import selectOrder from '@/views/business/schedule/interchangeReceipt/selectOrder.vue'
import { downloadFile } from '@/utils/download'
import type { dictType } from '@/global'
+import { getUserList } from '@/api/system/user'
+import { exportFile } from '@/utils/exportUtils'
+
const user = useUserStore() // 用户信息
const textMap: { [key: string]: string } = {
edit: '编辑',
@@ -31,6 +37,8 @@
const $router = useRouter() // 关闭页面使用
const $route = useRoute()
const query = $route.query
+console.log('opopopop', query)
+
const approvalDialog = ref() // 审批对话ref
const pageType = ref('add') // 页面类型: add, edit, detail
const infoId = ref('') // 列表id
@@ -38,57 +46,63 @@
const orderVisible = ref(false) // 控制委托单对话框显隐
const ruleFormRef = ref() as any
const form = ref({
- tdysczs: 0, // 替代已生成证书
+ invalid: 0, // 替代已生成证书
formId: query.formId as string,
- yzs: '', // 原证书
+ oldCertificateCode: '', // 原证书
calibrationMajor: '', // 检校专业
- certifications: '', // 证书类别
+ calibrationMajorName: '', // 检校专业名称
+ certificateReportCategory: '', // 证书类别
+ certificateReportCategoryName: '', // 证书类别名称
certificateReportCode: '', // 证书编号
certificateReportName: '', // 证书名称
- jdy: '', // 检定员
- jjrq: '', // 检校日期
+ measurePerson: '', // 检定员
+ measurePersonId: '', // 检定员id
+ calibrationTime: '', // 检校日期
- orderCode: '', // 委托单
+ orderCode: '', // 委托单编号
orderId: '', // 委托单id
customerName: '', // 委托方名称
+ customerAddress: '', // 委托方地址
certificationCompany: '', // 证书单位名称
certificationCompanyAddress: '', // 证书单位地址
calibrationPlace: '', // 检校地点
- fjsj: '', // 复校时间
- jssj: '', // 接收时间
- jdjg: '', // 检定结果
+ repeatTime: '', // 复校时间
+ deliverTime: '', // 接收时间
+ measureResult: '', // 检定结果
environmentCode: '', // 环境记录单编号
environmentId: '', // 环境记录单id
temperature: '', // 温度
humidity: '', // 湿度
+ techFilesName: '', // 依据的技术文件名称
signId: '', // 电子签章id
signName: '', // 电子签章名称
approvalSignIds: '', // 认可标志专用章id
approvalSignName: '', // 认可标志专用章名称
remark: '', // 备注
- ywy: '', // 业务员
+ busPersonId: '', // 业务员id
+ busPersonName: '', // 业务员名字
templateId: '', // 证书模板
templateName: '', // 证书模板
- templateNameFile: '', // 证书模板文件
certificateReportFile: '', // 证书报告附件
})
// 校验规则
const formRules = ref({
- yzs: [{ required: true, message: '原证书必填', trigger: ['blur', 'change'] }],
+ oldCertificateCode: [{ required: true, message: '原证书必填', trigger: ['blur', 'change'] }],
calibrationMajor: [{ required: true, message: '检校专业必填', trigger: ['blur', 'change'] }],
- certifications: [{ required: true, message: '证书类别必填', trigger: ['blur', 'change'] }],
+ certificateReportCategory: [{ required: true, message: '证书类别必填', trigger: ['blur', 'change'] }],
certificateReportName: [{ required: true, message: '证书名称必填', trigger: ['blur', 'change'] }],
customerName: [{ required: true, message: '委托方名称必填', trigger: ['blur', 'change'] }],
+ customerAddress: [{ required: true, message: '委托方地址必填', trigger: ['blur', 'change'] }],
certificationCompany: [{ required: true, message: '证书单位名称必填', trigger: ['blur', 'change'] }],
certificationCompanyAddress: [{ required: true, message: '证书单位地址必填', trigger: ['blur', 'change'] }],
calibrationPlace: [{ required: true, message: '检校地点必填', trigger: ['blur', 'change'] }],
- jdy: [{ required: true, message: '检定员必填', trigger: ['blur', 'change'] }],
- jjrq: [{ required: true, message: '检校日期必填', trigger: ['blur', 'change'] }],
- fjsj: [{ required: true, message: '复校时间必填', trigger: ['blur', 'change'] }],
- jssj: [{ required: true, message: '接收时间必填', trigger: ['blur', 'change'] }],
- jdjg: [{ required: true, message: '检定结果必填', trigger: ['blur', 'change'] }],
+ measurePersonId: [{ required: true, message: '检定员必填', trigger: ['blur', 'change'] }],
+ calibrationTime: [{ required: true, message: '检校日期必填', trigger: ['blur', 'change'] }],
+ repeatTime: [{ required: true, message: '复校时间必填', trigger: ['blur', 'change'] }],
+ deliverTime: [{ required: true, message: '接收时间必填', trigger: ['blur', 'change'] }],
+ measureResult: [{ required: true, message: '检定结果必填', trigger: ['blur', 'change'] }],
temperature: [
{ required: true, message: '温度必填', trigger: ['blur', 'change'] },
{ pattern: /(^-?\d\d*\.\d*$)|(^-?\d\d*$)|(^-?\.\d\d*$)/, message: '温度只能为数字', trigger: ['blur', 'change'] },
@@ -111,6 +125,7 @@
// ---------------------------------------字典--------------------------------------------
const certificationTypeMap = ref([]) // 证书类别
const calibrationMajorMap = ref([]) // 校检专业
+const userList = ref([]) // 检定员
// 获取字典值
async function getDict() {
// 校检专业
@@ -119,12 +134,22 @@
// 证书类别
const rescertificationType = await getDictByCode('certificationType')
certificationTypeMap.value = rescertificationType.data
+
+ // 获取人员列表
+ getUserList({ offset: 1, limit: 99999 }).then((res) => {
+ userList.value = res.data.rows
+ })
}
getDict()
// -------------------------------------原证书--------------------------------------------
+const selectMeasueDataDialogRef = ref() // 选择原证书组件ref
// 点击选择原证书
const selectOrigin = () => {
- //
+ selectMeasueDataDialogRef.value.initDialog()
+}
+// 选好原证书
+const selectMeasueDataConfirm = (val: any) => {
+ getDetail(val.id, val.certificateReportCode)
}
// ------------------------------------委托单------------------------------------------
// 点击选择委托单编号
@@ -142,12 +167,17 @@
form.value.orderCode = val[0].orderCode // 委托单
form.value.customerId = val[0].customerId// 委托方id
form.value.customerName = val[0].customerName// 委托方名称
+ form.value.customerAddress = val[0].customerAddress// 委托方地址
form.value.certificationCompany = val[0].certificationCompany// 证书单位名称
form.value.certificationCompanyAddress = val[0].certificationCompanyAddress// 证书单位地址
+ form.value.certificationCompanyAddress = val[0].certificationCompanyAddress// 证书单位地址
+ form.value.busPersonId = val[0].busPersonId// 业务员id
+ form.value.busPersonName = val[0].busPersonName// 业务员名字
}
}
// -------------------------------选择环境记录单----------------------------------------
+const businessEnvironmentRecord = ref({}) as any // 环境记录单信息
// 选择环境记录单Ref
const environmentalDialog = ref()
// 选择环境记录单
@@ -156,6 +186,7 @@
}
// 选择环境记录单表格确认
const environmentalAdd = (data: any) => {
+ businessEnvironmentRecord.value = data
form.value.environmentId = data.id // 环境记录单id
form.value.environmentCode = data.environmentCode // 环境记录单编号
form.value.temperature = data.temperature // 温度
@@ -200,35 +231,16 @@
}
// -----------------------------------------所依据的技术文件----------------------------------
+const selectTechFilesRef = ref()
+const fileList = ref([]) // 依据的技术文件
// 点击所依据的技术文件
const selectTechFiles = () => {
- //
+ selectTechFilesRef.value.initDialog()
}
-// --------------------------------------证书模板------------------------------------------
-// 选择证书模板Ref
-const templateDialog = ref()
-// 选择证书模板
-const handleClickTemplate = () => {
- templateDialog.value.initDialog()
-}
-// 选择证书模板确认
-const confirmCheckoutTemplate = (val: any) => {
- form.value.templateId = val.id // 证书报告模板id
- form.value.templateName = val.templateName || '' // 证书报告模板名称
- form.value.templateNameFile = val.minioFileName // 证书模板附件
-}
-
-// 点击下载证书模板按钮
-const downloadCertTemplate = () => {
- if (!form.value.templateId) {
- ElMessage.warning('请先选择证书模板')
- return false
- }
- if (!form.value.templateNameFile) {
- ElMessage.warning('选择的证书模板无附件,请检查')
- return false
- }
- downloadFile(form.value.templateNameFile as any, `${form.value.templateName}-${form.value.templateNameFile}`)
+// 选好依据的技术文件
+const selectTechFilesConfirm = (val: any) => {
+ fileList.value = val
+ form.value.techFilesName = val.map((item: { fileName: string }) => item.fileName).join(',')
}
// ---------------------------------文件上传(上传证书)-------------------------------------------
@@ -283,10 +295,10 @@
// 点击批量添加/选择
const addSample = () => {
- if (form.value.orderId) {
- selectOrderSamplesDialogRef.value.initDialog(form.value.orderId)
+ if (form.value.orderId) { // 选择委托单下的样品
+ selectOrderSamplesDialogRef.value.initDialog(form.value.orderId, false)
}
- else {
+ else { // 选择样品库中的样品
selectSamplesDialogRef.value.initDialog()
}
}
@@ -318,7 +330,7 @@
}
// ----------------------------------------------所用的计量标准器具--------------------------------------------
const equipmentVisible = ref(false) // 选择设备对话框显隐
-const equipmentList = ref([])// 表格数据
+const equipmentInfoList = ref([])// 表格数据
const checkoutEquipmentList = ref([])// 多选设备
// 表头
const equipmentColumns = ref([
@@ -328,8 +340,8 @@
{ text: '出厂编号', value: 'manufacturingNo', align: 'center' },
{ text: '测量范围', value: 'mesureRange', align: 'center' },
{ text: '不确定度', value: 'uncertainty', align: 'center' },
- { text: '溯源机构', value: 'syjg', align: 'center' },
- { text: '证书编号', value: 'zsbh', align: 'center' },
+ { text: '溯源机构', value: 'mesureDeptName', align: 'center' },
+ // { text: '证书编号', value: 'zsbh', align: 'center' },
{ text: '有效日期', value: 'validDate', align: 'center' },
])
@@ -351,9 +363,9 @@
const confirmSelectEquipment = (val: any) => {
val.forEach((item: IEquipmentList) => {
// 只添加列表里不存在的
- const index = equipmentList.value.findIndex((i: IEquipmentList) => item.equipmentNo === i.equipmentNo)
+ const index = equipmentInfoList.value.findIndex((i: IEquipmentList) => item.equipmentNo === i.equipmentNo)
if (index === -1) {
- equipmentList.value.push(item)
+ equipmentInfoList.value.push(item)
}
})
}
@@ -365,28 +377,109 @@
return false
}
checkoutEquipmentList.value.forEach((item: IEquipmentList) => {
- equipmentList.value.forEach((element, index) => {
+ equipmentInfoList.value.forEach((element, index) => {
if (element.equipmentNo === item.equipmentNo) {
- equipmentList.value.splice(index, 1)
+ equipmentInfoList.value.splice(index, 1)
}
})
})
}
+
+// --------------------------------------证书模板------------------------------------------
+// 选择证书模板Ref
+const templateDialogRef = ref()
+// 选择证书模板
+const handleClickTemplate = () => {
+ templateDialogRef.value.initDialog()
+}
+// 选择证书模板确认
+const confirmCheckoutTemplate = (val: any) => {
+ form.value.templateId = val.id // 证书报告模板id
+ form.value.templateName = val.templateName || '' // 证书报告模板名称
+}
+
+// 点击下载证书模板按钮
+const downloadCertTemplate = () => {
+ if (!form.value.templateId) {
+ ElMessage.warning('请先选择证书模板')
+ return false
+ }
+ if (!sampleList.value.length) {
+ ElMessage.warning('被检样品不能为空')
+ return false
+ }
+ if (!equipmentInfoList.value.length) {
+ ElMessage.warning('所用的计量标准器具不能为空')
+ return false
+ }
+
+ ruleFormRef.value.validate((valid: boolean) => {
+ if (valid) {
+ const params = solveParams()
+ const loading = ElLoading.service({
+ lock: true,
+ background: 'rgba(255, 255, 255, 0.8)',
+ })
+ downLoadTemplate(params).then((res) => {
+ exportFile(res.data, `${form.value.certificateReportName}.xls`)
+ loading.close()
+ }).catch(() => {
+ loading.close()
+ })
+ }
+ })
+}
+
// -------------------------------------------------------------------------------------------
+// 处理保存、下载模板参数
+function solveParams() {
+ const params = {
+ ...form.value,
+ businessEnvironmentRecord: businessEnvironmentRecord.value, // 环境记录单
+ fileList: fileList.value, // 依据的技术文件
+ equipmentInfoList: equipmentInfoList.value, // 所用的计量标准器具列表/监测设备
+ sampleId: sampleList.value[0].id, // 样品id(打印证书接口要必传)
+ sampleNo: sampleList.value[0].sampleNo, // 样品编号
+ sampleName: sampleList.value[0].sampleName, // 样品名称
+ sampleModel: sampleList.value[0].sampleModel, // 样品型号
+ manufacturingNo: sampleList.value[0].manufacturingNo, // 出厂编号
+ manufacturer: sampleList.value[0].manufacturer, // 生产厂家
+ sampleRemark: sampleList.value[0].remark, // 样品备注
+ id: pageType.value === 'add' ? '' : form.value.id,
+ }
+ return params
+}
// 获取详情信息
-const getDetail = () => {
+function getDetail(id?: string, certificateReportCode?: string) {
const loading = ElLoading.service({
lock: true,
background: 'rgba(255, 255, 255, 0.8)',
})
- detail({ id: $route.params.id as string }).then((res) => {
+ getMeasureDataDetail({ id: infoId.value! || id! }).then((res) => {
loading.close()
form.value = res.data
- form.value.createUserName = res.data.applicantName || user.name
- list.value = res.data.sampleList.filter((item: ISampleList) => {
- return item !== null
- })
+ sampleList.value = [{
+ sampleNo: res.data.sampleNo, // 样品编号
+ sampleName: res.data.sampleNo, // 样品名称
+ sampleModel: res.data.sampleNo, // 型号
+ manufacturingNo: res.data.sampleNo, // 出厂编号
+ manufacturer: res.data.sampleNo, // 生产厂家
+ remark: res.data.sampleRemark, // 备注
+ id: res.data.sampleId,
+ }]
+ equipmentInfoList.value = res.data.equipmentInfoList.map((item: { validDate: string }) => {
+ return {
+ ...item,
+ validDate: item.validDate ? dayjs(item.validDate).format('YYYY-MM-DD') : item.validDate,
+ }
+ }) // 所用的计量标准器具
+ businessEnvironmentRecord.value = res.data.businessEnvironmentRecord // 环境记录单数据
+ form.value.environmentCode = res.data.businessEnvironmentRecord.environmentCode// 环境记录单编号
+ if (id && certificateReportCode) {
+ form.value.oldCertificateCode = certificateReportCode
+ form.value.invalid = 1
+ }
}).catch(() => {
loading.close()
})
@@ -399,10 +492,13 @@
// 保存
const handleSave = () => {
- const tempList = list.value.filter(item => item.sampleNo)
- if (!tempList.length) {
- ElMessage.warning('样品信息不能为空')
- return
+ if (!sampleList.value.length) {
+ ElMessage.warning('被检样品不能为空')
+ return false
+ }
+ if (!equipmentInfoList.value.length) {
+ ElMessage.warning('所用的计量标准器具不能为空')
+ return false
}
ruleFormRef.value.validate((valid: boolean) => {
if (valid) {
@@ -410,32 +506,22 @@
lock: true,
background: 'rgba(255, 255, 255, 0.8)',
})
- // 样品&委托单列表(保存/编辑草稿接口入参使用)
- const temList = [] as any // 临时数组
- console.log('保存中的数组', list.value)
-
- list.value.forEach((item: any) => {
- if ((item.orderId && item.id) || (item.orderId && item.sampleId)) {
- temList.push({
- orderId: item.orderId,
- sampleId: item.id || item.sampleId,
- })
- }
- })
- form.value.orderSampleList = temList
+ const params = solveParams()
if (pageType.value === 'add') { // 新建
- addApply(form.value).then((res) => {
- submitId.value = res.data.id
- form.value.projectNo = res.data.projectNo // 分包项目编号
+ addMeasureData(params).then((res) => {
+ submitId.value = res.data.data.id
+ form.value.certificateReportCode = res.data.data.certificateReportCode
+ form.value.certificateReportName = res.data.data.certificateReportName
ElMessage.success('保存成功')
loading.close()
}).catch(() => {
loading.close()
})
}
+
else if (pageType.value === 'edit') { // 编辑
if (query.approvalStatusName === '未通过-驳回') { // 未通过-驳回
- failUpdateApply(form.value).then((res) => {
+ failUpdateMeasureData(params).then((res) => {
ElMessage.success('保存成功')
loading.close()
close()
@@ -444,7 +530,7 @@
})
}
else { // 草稿箱和已取消
- updateApply(form.value).then((res) => {
+ draftUpdateMeasureData(params).then((res) => {
ElMessage.success('保存成功')
loading.close()
close()
@@ -466,7 +552,7 @@
})
const params = {
id: submitId.value,
- formId: query.formId, // 表单id
+ formId: query.formId as string, // 表单id
}
submit(params).then(() => {
ElMessage.success('提交成功')
@@ -481,39 +567,6 @@
}
}
-const sampleVisible = ref(false)
-const projectVisible = ref(false)
-const isMulti = ref(false)
-const selectIndex = ref(0)
-// 点击选择
-const handleSelect = (index: number, row: ISampleList) => {
- sampleVisible.value = true // 选择设备对话框显隐
- isMulti.value = false // 是否单选, false单选、true表格多选
- selectIndex.value = index
-}
-
-const checkoutList = ref([]) // 选中的行
-
-// 修改委托方对话框显隐
-const changeSampleVisible = (val: boolean) => {
- sampleVisible.value = val
-}
-// 修改项目选择对话框显隐
-const changeProjectVisible = (val: boolean) => {
- projectVisible.value = val
-}
-
-// 删除行
-const delRow = () => {
- checkoutList.value.forEach((item: ISampleList) => {
- list.value.forEach((element, index) => {
- if (element.sampleNo === item.sampleNo) {
- list.value.splice(index, 1)
- }
- })
- })
-}
-
// ------------------------------------------审批-----------------------------------------
const approvalRecordData = ref([]) // 审批流程数据
@@ -573,11 +626,26 @@
// ------------------------------------事件-------------------------------------------------
// 检校专业变化
const changeCalibrationMajor = (val: string) => {
- form.value.certificateReportName = form.value.certificateReportCode + val + form.value.certifications
+ const index = calibrationMajorMap.value.findIndex((item: { value: string }) => item.value === val)
+ if (index !== -1) {
+ form.value.calibrationMajorName = calibrationMajorMap.value[index].name
+ }
+ console.log(form.value.calibrationMajorName)
}
// 证书类别变化
const changeCertifications = (val: string) => {
- form.value.certificateReportName = form.value.certificateReportCode + form.value.calibrationMajor + val
+ const index = certificationTypeMap.value.findIndex((item: { value: string }) => item.value === val)
+ if (index !== -1) {
+ form.value.certificateReportCategoryName = certificationTypeMap.value[index].name
+ }
+ console.log(form.value.certificateReportCategoryName)
+}
+// 选择检定员变化
+const changeMeasurePersonId = (val: string) => {
+ const index = userList.value.findIndex(item => item.id === val)
+ if (index !== -1) {
+ form.value.measurePerson = userList.value[index].name
+ }
}
// -------------------------------------------------------------------------------------
onMounted(async () => {
@@ -593,8 +661,9 @@
// form.value.createUser = user.id // 创建人id
// form.value.createUserName = user.name // 创建人
// form.value.applicantTime = proxy.dayjs().format('YYYY-MM-DD HH:mm:ss') // 申请时间
- form.value.jdy = user.name // 创建人
- form.value.jjrq = proxy.dayjs().format('YYYY-MM-DD') // 检校日期
+ form.value.measurePerson = user.name // 检定员名字
+ form.value.measurePersonId = user.id // 检定员id
+ form.value.calibrationTime = proxy.dayjs().format('YYYY-MM-DD') // 检校日期
}
})
@@ -606,7 +675,7 @@
上传证书
-
+
下载证书模板
@@ -641,25 +710,25 @@
label-width="140"
:rules="formRules"
>
-
+
-
+
替代已生成证书
-
-
+
+
-
+
选择
@@ -684,15 +753,15 @@
v-for="item in calibrationMajorMap"
:key="item.value"
:label="item.name"
- :value="item.name"
+ :value="item.value"
/>
-
+
@@ -720,7 +789,7 @@
/>
-
+
+
+
+
+
@@ -761,6 +841,18 @@
/>
+
+
+
+
+
-
-
+
+ filterable
+ @change="changeMeasurePersonId"
+ >
+
+
-
+
-
-
+
+
-
-
+
+
-
-
+
+
-
+
-
+
confirmSelectSample(val, 'order')" />
confirmSelectSample(val, 'warehouse')" />
+
+
+
+
diff --git a/src/views/business/lab/measureData/measureDataList.vue b/src/views/business/lab/measureData/measureDataList.vue
index 5c011b8..96ffa13 100644
--- a/src/views/business/lab/measureData/measureDataList.vue
+++ b/src/views/business/lab/measureData/measureDataList.vue
@@ -2,16 +2,19 @@
-
+
-
-
-
@@ -369,6 +385,7 @@
is-showmulti-select
@change="changePage"
@multi-select="handleSelectionChange"
+ @handleClickFollowLink="handleClickFollowLink"
>
@@ -483,3 +500,12 @@
+
+
diff --git a/src/views/business/schedule/interchangeReceipt/receiptEdit.vue b/src/views/business/schedule/interchangeReceipt/receiptEdit.vue
index 13ee3ab..877ea57 100644
--- a/src/views/business/schedule/interchangeReceipt/receiptEdit.vue
+++ b/src/views/business/schedule/interchangeReceipt/receiptEdit.vue
@@ -356,7 +356,7 @@
getInterchangeReceiptDetail({ id: infoId.value }).then((res) => {
dataForm.value = res.data // 表单
sampleList.value = res.data.customerSampleList // 样品列表
- dataForm.value.orderId = res.data.customerSampleList[0].orderId // orderId
+ dataForm.value.orderId = res.data.orderId // orderId
minioFileNameAutograph.value = res.data.recieverSignFile // 签名图片
loading.close()
})
diff --git a/src/views/finance/businessSettlement/businessSettlement-interface.ts b/src/views/finance/businessSettlement/businessSettlement-interface.ts
index 13a1a0c..454788f 100644
--- a/src/views/finance/businessSettlement/businessSettlement-interface.ts
+++ b/src/views/finance/businessSettlement/businessSettlement-interface.ts
@@ -4,6 +4,8 @@
customerNo: string // 委托方代码
customerName: string // 委托方名称
deliverer: string // 送样人
+ orderTimeStart: string // 委托日期开始
+ orderTimeEnd: string // 委托日期结束
offset: number
limit: number
}
@@ -14,17 +16,17 @@
orderCode: string // 委托书编号
customerNo: string // 委托方代码
customerName: string // 委托方名称
- deliverer: string // 送样人
- delivererTel: string // 联系方式
+ orderTime: string // 委托日期
sampleCount: string // 样品数量
- isUrgent: string // 是否加急
- createTime: string // 创建时间
- postedPrice: number // 标价(单位分)
- suggestedDiscount: string // 建议折扣-单位%
- suggestedPrice: number // 建议价格-单位分
- extraCharge: number // 附加费用-单位分
- extraChargeIllustration: string // 附加费用说明
- totalSettlement: number // 总计结算费用-单位分
+ sampleWarehouseName: string // 样品库房
+ certWarehouseName: string // 证书库房
+ feeStatus: string // 费用状态
+ received: string // 是否到账
+ actualTestFee: string // 检测费(实)(元)
+ shouldTestFee: string // 检测费(应)(元)
+ actualTotalFee: string // 实收合计(元)
+ receivedAmount: string // 到账金额(元)
+ invoiceAmount: string // 开票金额(元)
}
// 字典
@@ -49,21 +51,22 @@
// 表单
export interface IForm {
orderCode: string // 委托书编号
- orderId: string // 委托书编号
- deliverer: string // 送检人
- delivererTel: string // 送样人联系方式
- createTime: string // 委托单创建时间
- planDeliverTime: string // 预计送达时间
- requireOverTime: string // 要求检完时间
- customerNo: string // 委托方代码
- customerId: string // 委托方id
+ orderId: string // 委托单id
customerName: string // 委托方名称
- phone: string // 委托方电话
- priceFront: number // 标价
- suggestedDiscount: number // 建议折扣
- suggestedPrice: number // 建议价格
- extraCharge: number // 附加费用-单位分
- extraChargeIllustration: string // 附加费用说明
- totalSettlement: number // 总计结算费用
- samplePriceList: Array // 样品清单
+ orderTime: string // 委托日期
+ sampleCount: string // 样品数量
+ certificationCompany: string // 证书单位名称
+ certificationCompanyAddress: string // 证书单位地址
+ deliverer: string // 联系人
+ delivererTel: string // 联系方式
+ sampleWarehouse: string // 样品库房
+ certWarehouse: string // 证书库房
+ feeStatus: string // 费用状态
+ received: string // 是否到账
+ actualTestFee: Number // 检测费(实)(元)
+ shouldTestFee: Number // 检测费(应)(元)
+ actualTotalFee: Number // 实收合计(元)
+ receivedAmount: Number // 到账金额(元)
+ invoiceAmount: Number // 开票金额(元)
+ remark: string // 备注
}
diff --git a/src/views/finance/businessSettlement/edit.vue b/src/views/finance/businessSettlement/edit.vue
index e11f337..7630aeb 100644
--- a/src/views/finance/businessSettlement/edit.vue
+++ b/src/views/finance/businessSettlement/edit.vue
@@ -7,13 +7,18 @@
import { useRoute, useRouter } from 'vue-router'
import { el } from 'element-plus/es/locale'
import type { IForm, IsampleList } from './businessSettlement-interface'
+import multiTable from '@/components/MultiHeaderTable/index.vue'
+import { getDictByCode } from '@/api/system/dict'
+import { UploadFile } from '@/api/measure/file'
+import { calc } from '@/utils/useCalc'
+import type { dictType } from '@/global'
import type { TableColumn } from '@/components/NormalTable/table_interface'
import useUserStore from '@/store/modules/user'
import selectOrder from '@/views/business/schedule/interchangeReceipt/selectOrder.vue'
import type { IOrderList } from '@/views/business/schedule/order/orderList_interface'
import { getOrderDetail } from '@/api/business/schedule/order'
import { isNumber, validateMoney } from '@/utils/validate'
-import { calc } from '@/utils/useCalc'
+import useCheckList from '@/utils/useCheckList'
import { addBusinessSettlement, getBusinessSettlementDetail, updateBusinessSettlement } from '@/api/finance/businessSettlement'
const user = useUserStore() // 用户信息
const $route = useRoute()
@@ -27,54 +32,215 @@
// 表单数据
const form = ref({
orderCode: '', // 委托书编号
- orderId: '', // 委托书编号
- deliverer: '', // 送检人
- delivererTel: '', // 送样人联系方式
- createTime: '', // 委托单创建时间
- planDeliverTime: '', // 预计送达时间
- requireOverTime: '', // 要求检完时间
- customerNo: '', // 委托方代码
- customerId: '', // 委托方id
+ orderId: '', // 委托单id
customerName: '', // 委托方名称
- phone: '', // 委托方电话
- priceFront: 0, // 标价
- suggestedDiscount: 95, // 建议折扣
- suggestedPrice: 0, // 建议价格
- extraCharge: 0, // 附加费用-单位分
- extraChargeIllustration: '', // 附加费用说明
- totalSettlement: 0, // 总计结算费用
- samplePriceList: [], // 样品清单
+ orderTime: '', // 委托日期
+ sampleCount: '', // 样品数量
+ certificationCompany: '', // 证书单位名称
+ certificationCompanyAddress: '', // 证书单位地址
+ deliverer: '', // 联系人
+ delivererTel: '', // 联系方式
+ sampleWarehouse: '未入库', // 样品库房
+ certWarehouse: '未入库', // 证书库房
+ feeStatus: '未录费', // 费用状态
+ received: '未到账', // 是否到账
+ actualTestFee: 0, // 检测费(实)(元)
+ shouldTestFee: 0, // 检测费(应)(元)
+ actualTotalFee: 0, // 实收合计(元)
+ receivedAmount: 0, // 到账金额(元)
+ invoiceAmount: 0, // 开票金额(元)
+ remark: '', // 备注
})
-const ruleFormRef = ref() as any
-const list = ref([])// 表格数据
-const orderVisible = ref(false) // 控制委托书对话框显隐
-
-// 表头
-const columns = ref([
- { text: '样品编号', value: 'sampleNo', align: 'center', width: '170', required: false },
- { text: '样品名称', value: 'sampleName', align: 'center', required: false },
- { text: '型号', value: 'sampleModel', align: 'center', required: false },
- { text: '出厂编号', value: 'manufacturingNo', align: 'center', required: false },
- { text: '检定项目', value: 'measureContent', align: 'center', required: false },
- { text: '标价(元)', value: 'price', align: 'center', required: true, reg: validateMoney },
-])
// 表单校验规则
const rules = reactive({
- orderCode: [{ required: true, message: '委托书编号必填', trigger: 'blur' }],
- price: [{ required: true, message: '标价必填', trigger: ['blur', 'change'] },
- { pattern: /(^-?\d\d*\.\d*$)|(^-?\d\d*$)|(^-?\.\d\d*$)/, message: '标价只能为数字', trigger: ['blur', 'change'] }],
- suggestedDiscount: [{ required: true, message: '建议折扣必填', trigger: ['blur', 'change'] },
- { pattern: /^([0]|[1-9][0-9]*)$/, message: '建议折扣只能为正整数或0', trigger: ['blur', 'change'] }],
- extraCharge: [{ required: true, message: '附加费用必填', trigger: ['blur', 'change'] },
- { pattern: /(^[0-9](\d+)?(\.\d{1,2})?$)|(^\d\.\d{1,2}$)/, message: '要求不小于0,且最多保留两位小数', trigger: ['blur', 'change'] }],
- extraChargeIllustration: [{ required: true, message: '附加费用说明必填', trigger: 'blur' }],
+ orderCode: [{ required: true, message: '委托单编号必填', trigger: 'blur' }],
+ customerName: [{ required: true, message: '委托方名称必填', trigger: 'blur' }],
+ orderTime: [{ required: true, message: '委托日期必填', trigger: 'blur' }],
+ sampleCount: [{ required: true, message: '样品数量必填', trigger: 'blur' }],
+ certificationCompany: [{ required: true, message: '证书单位名称必填', trigger: 'blur' }],
+ certificationCompanyAddress: [{ required: true, message: '证书单位地址必填', trigger: 'blur' }],
+ deliverer: [{ required: true, message: '联系人必填', trigger: 'blur' }],
+ delivererTel: [{ required: true, message: '联系电话必填', trigger: 'blur' }],
+ sampleWarehouse: [{ required: true, message: '样品库房必填', trigger: 'blur' }],
+ certWarehouse: [{ required: true, message: '证书库房必填', trigger: 'blur' }],
+ feeStatus: [{ required: true, message: '费用状态必填', trigger: 'blur' }],
+ received: [{ required: true, message: '是否到账必填', trigger: 'blur' }],
+ actualTestFee: [{ required: true, message: '检测费(实)(元)必填', trigger: 'blur' }],
+ shouldTestFee: [{ required: true, message: '检测费(应)(元)必填', trigger: 'blur' }],
+ actualTotalFee: [{ required: true, message: '实收合计(元)必填', trigger: 'blur' }],
+ receivedAmount: [{ required: true, message: '到账金额(元)必填', trigger: 'blur' }],
+ invoiceAmount: [{ required: true, message: '开票金额(元)必填', trigger: 'blur' }],
})
+const ruleFormRef = ref() as any
+const orderVisible = ref(false) // 控制委托书对话框显隐
// ---------------------------------------路由参数--------------------------------------
if ($route.params && $route.params.type) {
pageType.value = $route.params.type as string
infoId.value = $route.params.id as string
}
+// ---------------------------------------字典--------------------------------------
+
+const financeSampleWarehouseList = ref([]) // 样品库房
+const financeCertWarehouseList = ref([]) // 证书库房
+const financeReceivedList = ref([]) // 是否到账
+// 获取字典值
+function getDict() {
+ // 样品库房
+ getDictByCode('financeSampleWarehouse').then((response) => {
+ financeSampleWarehouseList.value = response.data
+ })
+ // 证书库房
+ getDictByCode('financeCertWarehouse').then((response) => {
+ financeCertWarehouseList.value = response.data
+ })
+ // 是否到账
+ getDictByCode('financeReceived').then((response) => {
+ financeReceivedList.value = response.data
+ })
+}
+getDict()
+// -----------------------------------到账金额明细--------------------------------------------------
+const receivedAmountList = ref([]) as any // 到账金额明细
+const checkoutReceivedAmountList = ref([]) as any // 到账金额明细多选
+// 表头
+const receivedAmountcolumns = ref([
+ { text: '到账金额(元)', value: 'money', align: 'center', width: '220', required: true },
+ { text: '到账时间', value: 'moneyTime', align: 'center', width: '220', required: true },
+ { text: '附件', value: 'attachment', align: 'center', required: false },
+])
+
+// -------------------------------------开票金额明细--------------------------------------------------------------
+const invoiceAmountList = ref([]) as any // 开票金额明细
+const checkoutInvoiceAmountList = ref([]) as any // 开票金额明细多选
+// 表头
+const invoiceAmountcolumns = ref([
+ { text: '开票金额(元)', value: 'money', align: 'center', width: '220', required: true },
+ { text: '开票时间', value: 'moneyTime', align: 'center', width: '220', required: true },
+ { text: '附件', value: 'attachment', align: 'center', required: false },
+])
+
+// 多选发生改变时
+const handleSelectionChange = (e: any, type: 'addReceived' | 'invoiceAmount') => {
+ if (type === 'addReceived') { // 到账金额明细
+ checkoutReceivedAmountList.value = e
+ }
+ else { // 开票金额明细
+ checkoutInvoiceAmountList.value = e
+ }
+}
+
+// 点击增加行
+const addRow = (type: 'addReceived' | 'invoiceAmount') => {
+ if (type === 'addReceived') {
+ if (useCheckList(receivedAmountList.value, receivedAmountcolumns.value, '到账金额明细')) {
+ receivedAmountList.value.push({
+ money: undefined,
+ moneyTime: '',
+ attachment: [],
+ moneyType: '1',
+ })
+ }
+ }
+ else {
+ if (useCheckList(invoiceAmountList.value, invoiceAmountcolumns.value, '开票金额明细')) {
+ invoiceAmountList.value.push({
+ money: undefined,
+ moneyTime: '',
+ attachment: [],
+ moneyType: '2',
+ })
+ }
+ }
+}
+
+// 删除行
+const delRow = (type: 'addReceived' | 'invoiceAmount') => {
+ if ((type === 'addReceived' && checkoutReceivedAmountList.value.length <= 0) || (type === 'invoiceAmount' && checkoutInvoiceAmountList.value.length <= 0)) {
+ ElMessage({
+ message: '请选中要删除的行',
+ type: 'warning',
+ })
+ }
+ else {
+ if (type === 'addReceived') {
+ receivedAmountList.value = receivedAmountList.value.filter(
+ (item: any) => {
+ return !checkoutReceivedAmountList.value.includes(item)
+ },
+ )
+ }
+ else {
+ invoiceAmountList.value = invoiceAmountList.value.filter(
+ (item: any) => {
+ return !checkoutInvoiceAmountList.value.includes(item)
+ },
+ )
+ }
+ }
+}
+
+// ----------------------------------------上传附件----------------------------------------------------
+// 删除附件
+const del = (index: number, row: any) => {
+ row.value.attachment.splice(index, 1)
+}
+
+const fileRef = ref() // 文件上传input
+const onFileChange = (event: any, row?: any, type?: 'receivedAmount' | 'invoiceAmount') => {
+ // 原生上传
+ console.log(event.target.files)
+ const files = event.target.files
+ if (files.length !== 0) {
+ // 创建formdata对象
+ const fd = new FormData()
+ for (var i = 0; i < files.length; i++) {
+ fd.append('multipartFile', files[i])
+ }
+ UploadFile(fd).then((res) => {
+ if (res.code === 200) {
+ res.data.forEach((item: string) => {
+ row.attachment.push({
+ minioFileName: item,
+ })
+ })
+ ElMessage.success('文件上传成功')
+ }
+ else {
+ ElMessage.error(res.message)
+ }
+ })
+ }
+}
+const upload = () => {
+ fileRef.value.click()
+}
+// ------------------------------------结算明细--------------------------------------------------------------------
+const list = ref([]) // 开票金额明细
+// 表头
+const columns = ref([
+ { text: '器具名称', value: 'sampleName', align: 'center', required: true, type: 'text' },
+ { text: '型号规格', value: 'sampleModel', align: 'center', width: '180', required: true, type: 'input' },
+ { text: '套数/退', value: 'sets', align: 'center', required: true, width: '180', type: 'inputNumber' },
+ { text: '出厂编号', value: 'manufacturingNo', align: 'center', width: '180', required: true, type: 'input' },
+ { text: '委托日期', value: 'orderTime', align: 'center', required: true, width: '160', type: 'date' },
+ { text: '检测规范', value: 'accordStandard', align: 'center', width: '180', required: false, type: 'input' },
+ {
+ text: '收费(元)含6%增值税',
+ value: 'price',
+ align: 'center',
+ required: false,
+ children: [
+ { text: '检测费(应)', value: 'shouldTestFee', align: 'center', width: '180', required: true, type: 'inputNumber' },
+ { text: '检测费(实)', value: 'actualTestFee', align: 'center', required: true, width: '180', type: 'inputNumber' },
+ { text: '附加费', value: 'extraFee', align: 'center', required: false, width: '180', type: 'inputNumber' },
+ { text: '修理费', value: 'repairFee', align: 'center', required: false, width: '180', type: 'inputNumber' },
+ { text: '其他费', value: 'otherFee', align: 'center', required: false, width: '180', type: 'inputNumber' },
+ { text: '小计', value: 'subtotal', align: 'center', required: false, type: 'text' },
+ ],
+ },
+])
+
// ------------------------------------委托书---------------------------------------------
// 点击选择委托书编号
const handleClickOrder = () => {
@@ -87,87 +253,63 @@
// 选好委托书
const confirmCheckoutOrder = (val: Array) => {
if (val && val.length) {
- form.value.priceFront = 0 // 标价
- // form.value.suggestedDiscount = 95 // 建议折扣
- form.value.suggestedPrice = 0 // 建议价格
- form.value.extraCharge = 0// 附加费用-单位分
- form.value.extraChargeIllustration = '' // 附加费用说明
- form.value.totalSettlement = 0 // 总计结算费用
getOrderDetail({ id: val[0].id }).then((res) => { // 样品清单
form.value.orderCode = res.data.orderCode // 委托书编号
form.value.orderId = res.data.id // 委托书id
- form.value.deliverer = res.data.deliverer // 送检人
- form.value.delivererTel = res.data.delivererTel // 送检人
- form.value.createTime = res.data.createTime // 委托单创建时间
- form.value.customerNo = res.data.customerNo // 委托方代码
- form.value.customerId = res.data.customerId // 委托方id
form.value.customerName = res.data.customerName // 委托方名称
- form.value.planDeliverTime = res.data.planDeliverTime // 预计送达时间
- form.value.requireOverTime = res.data.requireOverTime // 要求检完时间
- form.value.phone = res.data.customerPhone // 委托方电话
- list.value = res.data.customerSampleInfoList.map((item: { isEdit: boolean }) => {
+ form.value.orderTime = res.data.createTime // 委托日期(委托单创建时间)
+ form.value.certificationCompany = res.data.certificationCompany // 证书单位名称
+ form.value.certificationCompanyAddress = res.data.certificationCompanyAddress // 证书单位地址
+ form.value.deliverer = res.data.deliverer // 联系人
+ form.value.delivererTel = res.data.delivererTel // 联系方式
+ form.value.sampleCount = res.data.customerSampleInfoList.length // 样品数量
+ list.value = res.data.customerSampleInfoList.map((item: { createTime: string; editable: boolean }) => {
return {
...item,
- isEdit: true,
+ orderTime: item.createTime ? dayjs(item.createTime).format('YYYY-MM-DD') : item.createTime, // 委托日期
+ editable: pageType.value !== 'detail',
+ shouldTestFee: 0, // 检测费(应)
+ actualTestFee: 0, // 检测费(实)
+ extraFee: 0, // 附加费
+ repairFee: 0, // 修理费
+ otherFee: 0, // 其他费
+ sets: 0, // 套数
+ subtotal: 0, // 小计
+ id: '',
}
})
})
}
}
-// -----------------------------------------样品清单--------------------------------------------
-// 检查列表
-function checkSampleList() {
- for (let index = 0; index < list.value.length; index++) {
- const item = list.value[index]
- for (const prop of columns.value) {
- // 检查必填
- if (prop.required && !item[prop.value]) {
- ElMessage.warning(`请先完善第${index + 1}行中${prop.text}`)
- return false
- }
- // 验证正则
- if (prop.reg && typeof prop.reg === 'function') {
- if (!prop.reg(item[prop.value])) {
- // ElMessage.warning(`第${index + 1}行中${prop.text}输入不合法`)
- ElMessage.warning(`第${index + 1}行: 要求标价为正数,且最多保留两位小数`)
- return false
- }
- }
- }
- }
- return true
-}
+// --------------------------------------------计算----------------------------------------------
+// 计算
+const handleInputNumberChange = ({ row }: any) => {
+ // 计算小计
+ row.subtotal = calc(Number(calc(Number(calc(Number(calc(Number(row.shouldTestFee), Number(row.actualTestFee), '+')), row.extraFee, '+')), row.repairFee, '+')), row.otherFee, '+')
+ // 计算检测费(应)(元)
+ form.value.shouldTestFee = list.value.reduce((accumulator, current: any) => accumulator + current.shouldTestFee, 0)
+ // 计算检测费(实)(元)
+ form.value.actualTestFee = list.value.reduce((accumulator, current: any) => accumulator + current.actualTestFee, 0)
+ // 实收合计
+ form.value.actualTotalFee = list.value.reduce((accumulator, current: any) => accumulator + current.subtotal, 0)
-// --------------------------------------------自动计算----------------------------------------------
-// 折扣改变-计算建议价格
-const changeSuggestedDiscount = () => {
- console.log('折扣改变')
- if (form.value.priceFront) {
- form.value.suggestedPrice = calc(Number(form.value.priceFront), Number(form.value.suggestedDiscount / 100), '*') as number
- form.value.suggestedPrice = Number(form.value.suggestedPrice.toFixed(2))
+ if (list.value.every((item: { actualTestFee: number }) => item.actualTestFee === 0 || `${item.actualTestFee}` === 'undefined' || `${item.actualTestFee}` === 'null' || `${item.actualTestFee}` === '')) {
+ form.value.feeStatus = '未录费'
+ }
+ else if (list.value.every((item: { actualTestFee: number }) => item.actualTestFee !== 0 || `${item.actualTestFee}` === 'undefined' || `${item.actualTestFee}` === 'null' || `${item.actualTestFee}` === '')) {
+ form.value.feeStatus = '已录费'
+ }
+ else {
+ form.value.feeStatus = '部分录费'
}
}
-// 标价改变
-const changePrice = () => {
- console.log('标价改变')
- let sum = 0
- list.value.forEach((item) => {
- if (item.price) {
- sum = calc(Number(sum), Number(item.price), '+') as number
- }
- })
- form.value.priceFront = sum
- changeSuggestedDiscount() // 建议价格随之变化
+const changeTableInputNumber = () => {
+ // 到账金额
+ form.value.receivedAmount = receivedAmountList.value.reduce((accumulator: any, current: any) => accumulator + current.money, 0)
+ // 开票金额
+ form.value.invoiceAmount = invoiceAmountList.value.reduce((accumulator: any, current: any) => accumulator + current.money, 0)
}
-// 附加费用改变
-const changeExtraCharge = () => {
- console.log('附加费用改变')
- form.value.totalSettlement = calc(Number(form.value.suggestedPrice), Number(form.value.extraCharge), '+') as number
-}
-watch(() => form.value.suggestedPrice, (newValue) => {
- changeExtraCharge()
-})
// ----------------------------------------------------------------------------------------
const $router = useRouter()
@@ -176,9 +318,35 @@
$router.back()
}
+// 校验表格
+const checkList = () => {
+ if (!receivedAmountList.value.length) {
+ ElMessage.warning('到账金额明细不能为空')
+ return false
+ }
+ if (!invoiceAmountList.value.length) {
+ ElMessage.warning('开票金额明细不能为空')
+ return false
+ }
+ if (!list.value.length) {
+ ElMessage.warning('结算明细不能为空')
+ return false
+ }
+ if (!useCheckList(receivedAmountList.value, receivedAmountcolumns.value, '到账金额明细')) {
+ return false
+ }
+ if (!useCheckList(invoiceAmountList.value, invoiceAmountcolumns.value, '开票金额明细')) {
+ return false
+ }
+ if (!useCheckList(list.value, columns.value, '结算明细')) {
+ return false
+ }
+ return true
+}
+
// 保存
const save = () => {
- if (!checkSampleList()) {
+ if (!checkList()) {
return false
}
ruleFormRef.value.validate((valid: boolean) => {
@@ -188,17 +356,10 @@
background: 'rgba(255, 255, 255, 0.8)',
})
const params = {
- extraCharge: calc(Number(form.value.extraCharge), 100, '*'), // 附加费用-单位分
- extraChargeIllustration: form.value.extraChargeIllustration, // 附加费用说明
id: infoId.value,
- orderId: form.value.orderId, // 委托书id
- suggestedDiscount: form.value.suggestedDiscount, // 建议折扣-单位%
- samplePriceList: list.value.map((item) => {
- return {
- price: calc(Number(item.price), 100, '*'), // 标价-单位分
- relationId: item.relationId, // 样品id
- }
- }), // 样品清单
+ ...form.value,
+ amountDetailsList: receivedAmountList.value.concat(invoiceAmountList.value),
+ sampleList: list.value,
}
// 新建
if (pageType.value === 'add') {
@@ -229,24 +390,22 @@
// 编辑、详情--获取详细信息
const fetchDetail = () => {
+ const loading = ElLoading.service({})
getBusinessSettlementDetail({ id: infoId.value }).then((res) => {
form.value = res.data
- form.value.phone = res.data.customerPhone
- list.value = res.data.sampleList.map((item: { postedPrice: number; id: string }) => {
+ receivedAmountList.value = res.data.amountDetailsList.filter((item: { moneyType: string }) => `${item.moneyType}` === '1')
+ invoiceAmountList.value = res.data.amountDetailsList.filter((item: { moneyType: string }) => `${item.moneyType}` === '2')
+ list.value = res.data.sampleDetailsList.map((item: { editable: boolean; orderTime: string }) => {
return {
...item,
- price: calc(Number(item.postedPrice), 100, '/') as number,
- isEdit: pageType.value === 'edit',
- relationId: item.id,
+ editable: pageType.value !== 'detail',
+ orderTime: item.orderTime ? dayjs(item.orderTime).format('YYYY-MM-DD') : item.orderTime,
}
})
- form.value.priceFront = calc(Number(res.data.postedPrice), 100, '/') as number // 标价
- // form.value.suggestedDiscount = // 建议折扣
- form.value.suggestedPrice = calc(Number(res.data.suggestedPrice), 100, '/') as number// 建议价格
- form.value.extraCharge = calc(Number(res.data.extraCharge), 100, '/') as number// 附加费用-单位分
- // form.value.extraChargeIllustration = // 附加费用说明
- form.value.totalSettlement = calc(Number(res.data.totalSettlement), 100, '/') as number // 总计结算费用
- })
+ form.value.orderTime = res.data.sampleDetailsList[0].orderTime // 委托日期
+ form.value.sampleCount = res.data.sampleDetailsList.length // 样品数量
+ loading.close()
+ }).catch(() => loading.close())
}
onMounted(() => {
@@ -278,10 +437,10 @@
>
-
+
@@ -294,51 +453,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -467,17 +645,26 @@
-
-
+
+
+
+ 增加行
+
+
+ 删除行
+
+
handleSelectionChange(e, 'addReceived')"
>
+
*{{ item.text }}
-
-
-
- {{ scope.row[item.value] }}
+
+
+
+
+ {{ '上传' }}
+
+
+
+ ×
+
+
+
onFileChange(e, scope.row, 'receivedAmount')">
+
+
+
+
+ 增加行
+
+
+ 删除行
+
+
+ handleSelectionChange(e, 'invoiceAmount')"
+ >
+
+
+
+
+ *{{ item.text }}
+
+
+
+
+
+
+
+ {{ '上传' }}
+
+
+
+ ×
+
+
+
onFileChange(e, scope.row, 'receivedAmount')">
+
+
+
+
+
+
+
+
diff --git a/src/views/finance/businessSettlement/list.vue b/src/views/finance/businessSettlement/list.vue
index eea28d8..2852223 100644
--- a/src/views/finance/businessSettlement/list.vue
+++ b/src/views/finance/businessSettlement/list.vue
@@ -2,6 +2,8 @@
+
+
+
+
+
+
diff --git a/src/components/MultiHeaderTable/tableColumn.vue b/src/components/MultiHeaderTable/tableColumn.vue
new file mode 100644
index 0000000..2b87285
--- /dev/null
+++ b/src/components/MultiHeaderTable/tableColumn.vue
@@ -0,0 +1,147 @@
+
+
+
+
+
+
+
+
+
+
+ *{{ item.text }}
+
+
+ *{{ item.text }}
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ scope.row[item.value] }}
+
+
+ {{
+ scope.row[item.value]
+ }}
+
+
+
+
+
+
diff --git a/src/components/NormalTable/index.vue b/src/components/NormalTable/index.vue
index e56f775..67092d3 100644
--- a/src/components/NormalTable/index.vue
+++ b/src/components/NormalTable/index.vue
@@ -3,6 +3,7 @@
import { ElTable } from 'element-plus'
import { defineExpose, ref } from 'vue'
import type { TableColumn } from './table_interface'
+import showPhoto from '@/views/system/tool/showPhoto.vue'
// ------------------定义props、 emit-------------------
const props = defineProps({
@@ -212,8 +213,8 @@
{{ scope.row[column.value] }}
{{ column.filter(scope.row) }}
- {{ scope.row }}
-
+
+
diff --git a/src/utils/useCheckList.ts b/src/utils/useCheckList.ts
new file mode 100644
index 0000000..c7782f0
--- /dev/null
+++ b/src/utils/useCheckList.ts
@@ -0,0 +1,73 @@
+import { ElMessage } from 'element-plus'
+// import type { TableColumn } from '@/components/NormalTable/table_interface'
+
+/**
+ * 检查列表
+ * @param list 要检查的表格数据(被依赖项如果满足某个条件就去检查依赖项,否则不检查依赖项)
+ * @param columns // 表头信息
+ * @param tableTitle // 表格名称
+ * @param depend // 依赖项
+ * @param depended // 被依赖项
+ * @param dependedValue // 被依赖项条件
+ * @param requireLength // 要检查的表格数据长度是否大于0
+ */
+export default function useCheckList(list: any, columns: any, tableTitle = '', depend?: string, depended?: string, dependedValue?: number | string, requireLength = false): boolean {
+ for (const prop of columns) {
+ for (let index = 0; index < list.length; index++) {
+ const item = list[index]
+
+ if (depend && depended && item[depended] === dependedValue && !(`${item[prop.value]}`)) { // 被依赖项满足条件时需要检查
+ ElMessage.warning(`请先完善 ${tableTitle} 第${index + 1}行中 ${prop.text} 字段`)
+ return false
+ }
+ else {
+ // 检查必填
+ if (prop.required && (!(`${item[prop.value]}`) || `${item[prop.value]}` === 'null' || `${item[prop.value]}` === 'undefined' || item[prop.value] == undefined)) {
+ if (`${prop.belongStandardEquipment}` === '15') { // 小功率
+ ElMessage.warning(`${tableTitle} 第${index + 1}行中 ${prop.message} ${prop.text} 字段不能为空`)
+ }
+ else {
+ ElMessage.warning(`请先完善 ${tableTitle} 第${index + 1}行中 ${prop.text} 字段`)
+ }
+ return false
+ }
+ }
+
+ // 验证正则
+ if (prop.reg && typeof prop.reg === 'function') {
+ if (prop.value === 'resolution') { // 分辨力特殊处理
+ if (!prop.reg(item[prop.value])) {
+ ElMessage.warning(`${tableTitle} 第${index + 1}行中 ${prop.text} 不能大于1`)
+ return false
+ }
+ }
+ else {
+ if (!prop.reg(item[prop.value])) {
+ if (`${prop.belongStandardEquipment}` === '15') { // 小功率
+ ElMessage.warning(`${tableTitle} 第${index + 1}行中 ${prop.message} ${prop.text} 字段不能为0`)
+ }
+ else if (`${prop.belongStandardEquipment}` === '17') { // S参数
+ ElMessage.warning(`${tableTitle} 第${index + 1}行中 ${prop.text} 仅允许输入数字、字母、特殊字符`)
+ }
+ else {
+ ElMessage.warning(`${tableTitle} 第${index + 1}行中 ${prop.text} 字段输入不合法`)
+ }
+ return false
+ }
+ }
+ }
+
+ if (prop.children && prop.children.length) {
+ if (!useCheckList(list, prop.children, tableTitle, depend, depended, dependedValue)) {
+ return false
+ }
+ }
+ }
+ }
+
+ if (requireLength && !list.length) {
+ ElMessage.warning(`${tableTitle}表格数据不能为空`)
+ return false
+ }
+ return true
+}
diff --git a/src/views/business/lab/components/selectOrderSamplesDialog.vue b/src/views/business/lab/components/selectOrderSamplesDialog.vue
index 4002f83..b004107 100644
--- a/src/views/business/lab/components/selectOrderSamplesDialog.vue
+++ b/src/views/business/lab/components/selectOrderSamplesDialog.vue
@@ -14,6 +14,7 @@
const loadingTable = ref(false) // loading
const list = ref([]) // 表格参数
const tableRef = ref()
+const isMulti = ref(true) // 是否多选默认为多选
const columns = ref
([
{ text: '被测样品名称', value: 'sampleName', align: 'center', required: true },
{ text: '型号规格', value: 'sampleModel', align: 'center', required: true },
@@ -60,9 +61,10 @@
}
// 初始化
-const initDialog = (orderIdParam: string) => {
+const initDialog = (orderIdParam: string, isMultiParam = true) => {
dialogFormVisible.value = true
orderId.value = orderIdParam
+ isMulti.value = isMultiParam
getList()
}
defineExpose({ initDialog })
@@ -78,7 +80,7 @@
:columns="columns"
is-showmulti-select
:list-loading="loadingTable"
- :is-multi="true"
+ :is-multi="isMulti"
:height="300"
:pagination="false"
@multi-select="handleSelectionChange"
diff --git a/src/views/business/lab/components/selectReportTemplate.vue b/src/views/business/lab/components/selectReportTemplate.vue
index 5c59693..ec36ef7 100644
--- a/src/views/business/lab/components/selectReportTemplate.vue
+++ b/src/views/business/lab/components/selectReportTemplate.vue
@@ -7,8 +7,9 @@
import type { typeofSign } from '@/views/system/tool/tool_interface'
import { templatePage } from '@/api/system/tool'
-const emits = defineEmits(['add'])
+const emits = defineEmits(['confirm'])
const dialogFormVisible = ref(false) // 控制弹窗显隐
+const createTime = ref()
// 查询参数
const searchQuery = reactive({
templateNo: '', // 编号
@@ -18,31 +19,43 @@
createEndTime: '',
limit: 5,
offset: 1,
- templateType: '',
+ certificationType: '0',
ids: [] as string[],
}) // 查询参数
const loadingTable = ref(false) // loading
const list = ref([]) // 表格参数
const total = ref(0)
const columns = ref([
- { text: '编号', value: 'templateNo', align: 'center', width: '180' },
- { text: '模板名称', value: 'templateName', align: 'center', width: '150' },
- { text: '模板负责人', value: 'templateCreator', align: 'center', width: '100' },
- { text: '创建时间', value: 'createTime', align: 'center', width: '250' },
- { text: '描述', value: 'templateDesc', align: 'center' },
+ { text: '编号', value: 'templateNo', align: 'center', width: '160' },
+ { text: '模板名称', value: 'templateName', align: 'center' },
+ { text: '模板类型', value: 'templateTypeName', align: 'center', width: '100' },
+ { text: '负责人', value: 'templateCreator', align: 'center', width: '100' },
+ { text: '内容描述', value: 'templateDesc', align: 'center' },
+ { text: '创建时间', value: 'createTime', align: 'center', width: '180' },
])
const checkoutList = ref([]) // 多选选中参数
-// 获取类型
-const getType = async () => {
- const res = await getDictByCode('templateType')
- searchQuery.templateType = res.data.filter((item: typeofSign) => item.name === '证书报告模板')[0].value
+// ---------------------------------------字典--------------------------------------------
+const templateTypeMap = ref([]) as any // 模板类型
+// 获取字典值
+async function getDict() {
+ // 模板类型
+ const res = await getDictByCode('certificationType')
+ res.data.forEach((item: { value: string; name: string }) => {
+ templateTypeMap.value[`${item.value}`] = item.name
+ })
}
+// ----------------------------------------------------------------------------------------------
// 获取数据列表
const getList = () => {
loadingTable.value = true
templatePage(searchQuery).then((res) => {
if (res.code === 200) {
- list.value = res.data.rows
+ list.value = res.data.rows.map((item: { certificationType: string }) => {
+ return {
+ ...item,
+ templateTypeName: `${item.certificationType}` ? templateTypeMap.value[item.certificationType] : item.certificationType, // 模板类型
+ }
+ })
total.value = res.data.total
}
loadingTable.value = false
@@ -74,7 +87,8 @@
searchQuery.createEndTime = ''
searchQuery.limit = 5
searchQuery.offset = 1
- // searchQuery.templateType = '' // 类型不能变
+ searchQuery.certificationType = '0'
+ createTime.value = ''
searchQuery.ids = []
getList()
}
@@ -82,10 +96,10 @@
// 点击保存
const submitForm = () => {
if (!checkoutList.value.length) {
- ElMessage.warning('请选择证书报告模板')
+ ElMessage.warning('请选择证书模板')
}
else {
- emits('add', checkoutList.value[0])
+ emits('confirm', checkoutList.value[0])
dialogFormVisible.value = false
}
}
@@ -103,15 +117,25 @@
// 初始化
const initDialog = () => {
dialogFormVisible.value = true
- getType().then((_) => {
+ getDict().then((_) => {
getList()
})
}
+watch(() => createTime.value, (newVal) => {
+ if (newVal) {
+ searchQuery.createStartTime = newVal[0]
+ searchQuery.createEndTime = newVal[1]
+ }
+ else {
+ searchQuery.createStartTime = ''
+ searchQuery.createEndTime = ''
+ }
+})
defineExpose({ initDialog })
-
+
@@ -121,7 +145,18 @@
-
+
+
+
+
diff --git a/src/views/business/lab/measureData/dialog/selectMeasueDataDialog.vue b/src/views/business/lab/measureData/dialog/selectMeasueDataDialog.vue
new file mode 100644
index 0000000..f8be703
--- /dev/null
+++ b/src/views/business/lab/measureData/dialog/selectMeasueDataDialog.vue
@@ -0,0 +1,199 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ (listQuery.offset - 1) * listQuery.limit + scope.$index + 1 }}
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/views/business/lab/measureData/dialog/selectTechFilesDialog.vue b/src/views/business/lab/measureData/dialog/selectTechFilesDialog.vue
new file mode 100644
index 0000000..f6f1a5a
--- /dev/null
+++ b/src/views/business/lab/measureData/dialog/selectTechFilesDialog.vue
@@ -0,0 +1,247 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ (listQuery.offset - 1) * listQuery.limit + scope.$index + 1 }}
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/views/business/lab/measureData/measureData-interface.ts b/src/views/business/lab/measureData/measureData-interface.ts
index 8319f65..d25a212 100644
--- a/src/views/business/lab/measureData/measureData-interface.ts
+++ b/src/views/business/lab/measureData/measureData-interface.ts
@@ -1,13 +1,14 @@
// 查询条件
export interface IListQuery {
- approvalStatus: string // 审批状态
- certificateReportCode: string // 证书编号
- certificateReportName: string // 证书名称
- customerName: string // 委托方名称
- sampleName: string // 样品名称
- measureCategory: string // 检校类别
- approvalStatusName: string // 审批状态名称
- formId: string
+ approvalStatus: string // 审批状态类型code
+ certificateReportCode: string // 证书编号
+ certificateReportName: string // 证书名称
+ customerName: string // 委托方名称
+ formId: string // 表单id(流程定义对应的表单id,等价于业务id)
+ measureCategory: string // 检校类别
+ orderCode: string // 委托书编号
+ sampleName: string // 样品名称
+ sampleNo: string // 样品编号
offset: number
limit: number
}
@@ -28,47 +29,53 @@
calibrationTime: string // 检校日期
taskId?: string // 任务id 用于审批
decisionItem?: string
- applyApprovalStatusName?: string // 审批状态名称
+ approvalStatusName?: string // 审批状态名称
processId?: string // 流程实例id
}
// 表单
export interface IForm {
- tdysczs: number // 替代已生成证书
+ id?: string
+ invalid: number // 替代已生成证书
formId: string
- yzs: string // 原证书
+ oldCertificateCode: string // 原证书
calibrationMajor: string // 检校专业
- certifications: string // 证书类别
+ calibrationMajorName: string // 检校专业名称
+ certificateReportCategory: string // 证书类别
+ certificateReportCategoryName: string // 证书类别名称
certificateReportCode: string // 证书编号
certificateReportName: string // 证书名称
- jdy: string // 检定员
- jjrq: string // 检校日期
+ measurePerson: string // 检定员
+ measurePersonId: string // 检定员id
+ calibrationTime: string // 检校日期
orderCode: string // 委托书
orderId: string // 委托书id
customerId?: string // 委托放id
customerName: string // 委托方名称
+ customerAddress: string // 委托方地址
certificationCompany: string // 证书单位名称
certificationCompanyAddress: string // 证书单位地址
calibrationPlace: string // 检校地点
- fjsj: string // 复校时间
- jssj: string // 接收时间
- jdjg: string // 检定结果
- environmentCode: string// 环境记录单编号
+ repeatTime: string // 复校时间
+ deliverTime: string // 接收时间
+ measureResult: string // 检定结果
+ environmentCode: string // 环境记录单编号
environmentId: string // 环境记录单id
temperature: string // 温度
humidity: string // 湿度
+ techFilesName: string // 依据的技术文件名称
signId: string // 电子签章id
signName: string // 电子签章名称
approvalSignIds: string // 认可标志专用章id
approvalSignName: string // 认可标志专用章名称
remark: string // 备注
- ywy: string // 业务员
+ busPersonId: string // 业务员id
+ busPersonName: string // 业务员名字
templateId: string // 证书模板
templateName: string // 证书模板
- templateNameFile: string // 证书模板文件
certificateReportFile: string // 证书报告附件
processId?: string // 流程实例id
@@ -76,6 +83,7 @@
// 被检样品
export interface ISampleList {
+ id: string // 样品id
sampleNo: string // 样品编号
sampleName: string // 样品名称
sampleModel: string // 型号
diff --git a/src/views/business/lab/measureData/measureDataDetail.vue b/src/views/business/lab/measureData/measureDataDetail.vue
index 4aa9717..c554c33 100644
--- a/src/views/business/lab/measureData/measureDataDetail.vue
+++ b/src/views/business/lab/measureData/measureDataDetail.vue
@@ -3,6 +3,7 @@
import { ElLoading, ElMessage, ElMessageBox } from 'element-plus'
import type { FormInstance, FormRules } from 'element-plus'
import { ref } from 'vue'
+import dayjs from 'dayjs'
import EnvironmentalDialog from '../components/environmentalDialog.vue'
import selectSignature from '../components/selectSignature.vue'
import selectReportTemplate from '../components/selectReportTemplate.vue'
@@ -10,10 +11,12 @@
import SelectSamplesDialog from '../components/selectSamplesDialog.vue'
import selectMeasureDevice from '../components/selectMeasureDevice.vue'
import type { IEquipmentList, IForm, ISampleList } from './measureData-interface'
+import selectMeasueDataDialog from './dialog/selectMeasueDataDialog.vue'
+import selectTechFilesDialog from './dialog/selectTechFilesDialog.vue'
import { UploadFile } from '@/api/measure/file'
import ApprovalDialog from '@/components/Approval/ApprovalDialog.vue'
import type { TableColumn } from '@/components/NormalTable/table_interface'
-import { addApply, detail, failUpdateApply, submit, updateApply } from '@/api/business/subpackage/apply'
+import { addMeasureData, downLoadTemplate, draftUpdateMeasureData, failUpdateMeasureData, getMeasureDataDetail, submit } from '@/api/business/lab/measureData'
import { cancelApproval, fetchApproval, submitApproval } from '@/api/approval'
import showPhoto from '@/views/system/tool/showPhoto.vue'
import { getDictByCode } from '@/api/system/dict'
@@ -21,6 +24,9 @@
import selectOrder from '@/views/business/schedule/interchangeReceipt/selectOrder.vue'
import { downloadFile } from '@/utils/download'
import type { dictType } from '@/global'
+import { getUserList } from '@/api/system/user'
+import { exportFile } from '@/utils/exportUtils'
+
const user = useUserStore() // 用户信息
const textMap: { [key: string]: string } = {
edit: '编辑',
@@ -31,6 +37,8 @@
const $router = useRouter() // 关闭页面使用
const $route = useRoute()
const query = $route.query
+console.log('opopopop', query)
+
const approvalDialog = ref() // 审批对话ref
const pageType = ref('add') // 页面类型: add, edit, detail
const infoId = ref('') // 列表id
@@ -38,57 +46,63 @@
const orderVisible = ref(false) // 控制委托单对话框显隐
const ruleFormRef = ref() as any
const form = ref({
- tdysczs: 0, // 替代已生成证书
+ invalid: 0, // 替代已生成证书
formId: query.formId as string,
- yzs: '', // 原证书
+ oldCertificateCode: '', // 原证书
calibrationMajor: '', // 检校专业
- certifications: '', // 证书类别
+ calibrationMajorName: '', // 检校专业名称
+ certificateReportCategory: '', // 证书类别
+ certificateReportCategoryName: '', // 证书类别名称
certificateReportCode: '', // 证书编号
certificateReportName: '', // 证书名称
- jdy: '', // 检定员
- jjrq: '', // 检校日期
+ measurePerson: '', // 检定员
+ measurePersonId: '', // 检定员id
+ calibrationTime: '', // 检校日期
- orderCode: '', // 委托单
+ orderCode: '', // 委托单编号
orderId: '', // 委托单id
customerName: '', // 委托方名称
+ customerAddress: '', // 委托方地址
certificationCompany: '', // 证书单位名称
certificationCompanyAddress: '', // 证书单位地址
calibrationPlace: '', // 检校地点
- fjsj: '', // 复校时间
- jssj: '', // 接收时间
- jdjg: '', // 检定结果
+ repeatTime: '', // 复校时间
+ deliverTime: '', // 接收时间
+ measureResult: '', // 检定结果
environmentCode: '', // 环境记录单编号
environmentId: '', // 环境记录单id
temperature: '', // 温度
humidity: '', // 湿度
+ techFilesName: '', // 依据的技术文件名称
signId: '', // 电子签章id
signName: '', // 电子签章名称
approvalSignIds: '', // 认可标志专用章id
approvalSignName: '', // 认可标志专用章名称
remark: '', // 备注
- ywy: '', // 业务员
+ busPersonId: '', // 业务员id
+ busPersonName: '', // 业务员名字
templateId: '', // 证书模板
templateName: '', // 证书模板
- templateNameFile: '', // 证书模板文件
certificateReportFile: '', // 证书报告附件
})
// 校验规则
const formRules = ref({
- yzs: [{ required: true, message: '原证书必填', trigger: ['blur', 'change'] }],
+ oldCertificateCode: [{ required: true, message: '原证书必填', trigger: ['blur', 'change'] }],
calibrationMajor: [{ required: true, message: '检校专业必填', trigger: ['blur', 'change'] }],
- certifications: [{ required: true, message: '证书类别必填', trigger: ['blur', 'change'] }],
+ certificateReportCategory: [{ required: true, message: '证书类别必填', trigger: ['blur', 'change'] }],
certificateReportName: [{ required: true, message: '证书名称必填', trigger: ['blur', 'change'] }],
customerName: [{ required: true, message: '委托方名称必填', trigger: ['blur', 'change'] }],
+ customerAddress: [{ required: true, message: '委托方地址必填', trigger: ['blur', 'change'] }],
certificationCompany: [{ required: true, message: '证书单位名称必填', trigger: ['blur', 'change'] }],
certificationCompanyAddress: [{ required: true, message: '证书单位地址必填', trigger: ['blur', 'change'] }],
calibrationPlace: [{ required: true, message: '检校地点必填', trigger: ['blur', 'change'] }],
- jdy: [{ required: true, message: '检定员必填', trigger: ['blur', 'change'] }],
- jjrq: [{ required: true, message: '检校日期必填', trigger: ['blur', 'change'] }],
- fjsj: [{ required: true, message: '复校时间必填', trigger: ['blur', 'change'] }],
- jssj: [{ required: true, message: '接收时间必填', trigger: ['blur', 'change'] }],
- jdjg: [{ required: true, message: '检定结果必填', trigger: ['blur', 'change'] }],
+ measurePersonId: [{ required: true, message: '检定员必填', trigger: ['blur', 'change'] }],
+ calibrationTime: [{ required: true, message: '检校日期必填', trigger: ['blur', 'change'] }],
+ repeatTime: [{ required: true, message: '复校时间必填', trigger: ['blur', 'change'] }],
+ deliverTime: [{ required: true, message: '接收时间必填', trigger: ['blur', 'change'] }],
+ measureResult: [{ required: true, message: '检定结果必填', trigger: ['blur', 'change'] }],
temperature: [
{ required: true, message: '温度必填', trigger: ['blur', 'change'] },
{ pattern: /(^-?\d\d*\.\d*$)|(^-?\d\d*$)|(^-?\.\d\d*$)/, message: '温度只能为数字', trigger: ['blur', 'change'] },
@@ -111,6 +125,7 @@
// ---------------------------------------字典--------------------------------------------
const certificationTypeMap = ref([]) // 证书类别
const calibrationMajorMap = ref([]) // 校检专业
+const userList = ref([]) // 检定员
// 获取字典值
async function getDict() {
// 校检专业
@@ -119,12 +134,22 @@
// 证书类别
const rescertificationType = await getDictByCode('certificationType')
certificationTypeMap.value = rescertificationType.data
+
+ // 获取人员列表
+ getUserList({ offset: 1, limit: 99999 }).then((res) => {
+ userList.value = res.data.rows
+ })
}
getDict()
// -------------------------------------原证书--------------------------------------------
+const selectMeasueDataDialogRef = ref() // 选择原证书组件ref
// 点击选择原证书
const selectOrigin = () => {
- //
+ selectMeasueDataDialogRef.value.initDialog()
+}
+// 选好原证书
+const selectMeasueDataConfirm = (val: any) => {
+ getDetail(val.id, val.certificateReportCode)
}
// ------------------------------------委托单------------------------------------------
// 点击选择委托单编号
@@ -142,12 +167,17 @@
form.value.orderCode = val[0].orderCode // 委托单
form.value.customerId = val[0].customerId// 委托方id
form.value.customerName = val[0].customerName// 委托方名称
+ form.value.customerAddress = val[0].customerAddress// 委托方地址
form.value.certificationCompany = val[0].certificationCompany// 证书单位名称
form.value.certificationCompanyAddress = val[0].certificationCompanyAddress// 证书单位地址
+ form.value.certificationCompanyAddress = val[0].certificationCompanyAddress// 证书单位地址
+ form.value.busPersonId = val[0].busPersonId// 业务员id
+ form.value.busPersonName = val[0].busPersonName// 业务员名字
}
}
// -------------------------------选择环境记录单----------------------------------------
+const businessEnvironmentRecord = ref({}) as any // 环境记录单信息
// 选择环境记录单Ref
const environmentalDialog = ref()
// 选择环境记录单
@@ -156,6 +186,7 @@
}
// 选择环境记录单表格确认
const environmentalAdd = (data: any) => {
+ businessEnvironmentRecord.value = data
form.value.environmentId = data.id // 环境记录单id
form.value.environmentCode = data.environmentCode // 环境记录单编号
form.value.temperature = data.temperature // 温度
@@ -200,35 +231,16 @@
}
// -----------------------------------------所依据的技术文件----------------------------------
+const selectTechFilesRef = ref()
+const fileList = ref([]) // 依据的技术文件
// 点击所依据的技术文件
const selectTechFiles = () => {
- //
+ selectTechFilesRef.value.initDialog()
}
-// --------------------------------------证书模板------------------------------------------
-// 选择证书模板Ref
-const templateDialog = ref()
-// 选择证书模板
-const handleClickTemplate = () => {
- templateDialog.value.initDialog()
-}
-// 选择证书模板确认
-const confirmCheckoutTemplate = (val: any) => {
- form.value.templateId = val.id // 证书报告模板id
- form.value.templateName = val.templateName || '' // 证书报告模板名称
- form.value.templateNameFile = val.minioFileName // 证书模板附件
-}
-
-// 点击下载证书模板按钮
-const downloadCertTemplate = () => {
- if (!form.value.templateId) {
- ElMessage.warning('请先选择证书模板')
- return false
- }
- if (!form.value.templateNameFile) {
- ElMessage.warning('选择的证书模板无附件,请检查')
- return false
- }
- downloadFile(form.value.templateNameFile as any, `${form.value.templateName}-${form.value.templateNameFile}`)
+// 选好依据的技术文件
+const selectTechFilesConfirm = (val: any) => {
+ fileList.value = val
+ form.value.techFilesName = val.map((item: { fileName: string }) => item.fileName).join(',')
}
// ---------------------------------文件上传(上传证书)-------------------------------------------
@@ -283,10 +295,10 @@
// 点击批量添加/选择
const addSample = () => {
- if (form.value.orderId) {
- selectOrderSamplesDialogRef.value.initDialog(form.value.orderId)
+ if (form.value.orderId) { // 选择委托单下的样品
+ selectOrderSamplesDialogRef.value.initDialog(form.value.orderId, false)
}
- else {
+ else { // 选择样品库中的样品
selectSamplesDialogRef.value.initDialog()
}
}
@@ -318,7 +330,7 @@
}
// ----------------------------------------------所用的计量标准器具--------------------------------------------
const equipmentVisible = ref(false) // 选择设备对话框显隐
-const equipmentList = ref([])// 表格数据
+const equipmentInfoList = ref([])// 表格数据
const checkoutEquipmentList = ref([])// 多选设备
// 表头
const equipmentColumns = ref([
@@ -328,8 +340,8 @@
{ text: '出厂编号', value: 'manufacturingNo', align: 'center' },
{ text: '测量范围', value: 'mesureRange', align: 'center' },
{ text: '不确定度', value: 'uncertainty', align: 'center' },
- { text: '溯源机构', value: 'syjg', align: 'center' },
- { text: '证书编号', value: 'zsbh', align: 'center' },
+ { text: '溯源机构', value: 'mesureDeptName', align: 'center' },
+ // { text: '证书编号', value: 'zsbh', align: 'center' },
{ text: '有效日期', value: 'validDate', align: 'center' },
])
@@ -351,9 +363,9 @@
const confirmSelectEquipment = (val: any) => {
val.forEach((item: IEquipmentList) => {
// 只添加列表里不存在的
- const index = equipmentList.value.findIndex((i: IEquipmentList) => item.equipmentNo === i.equipmentNo)
+ const index = equipmentInfoList.value.findIndex((i: IEquipmentList) => item.equipmentNo === i.equipmentNo)
if (index === -1) {
- equipmentList.value.push(item)
+ equipmentInfoList.value.push(item)
}
})
}
@@ -365,28 +377,109 @@
return false
}
checkoutEquipmentList.value.forEach((item: IEquipmentList) => {
- equipmentList.value.forEach((element, index) => {
+ equipmentInfoList.value.forEach((element, index) => {
if (element.equipmentNo === item.equipmentNo) {
- equipmentList.value.splice(index, 1)
+ equipmentInfoList.value.splice(index, 1)
}
})
})
}
+
+// --------------------------------------证书模板------------------------------------------
+// 选择证书模板Ref
+const templateDialogRef = ref()
+// 选择证书模板
+const handleClickTemplate = () => {
+ templateDialogRef.value.initDialog()
+}
+// 选择证书模板确认
+const confirmCheckoutTemplate = (val: any) => {
+ form.value.templateId = val.id // 证书报告模板id
+ form.value.templateName = val.templateName || '' // 证书报告模板名称
+}
+
+// 点击下载证书模板按钮
+const downloadCertTemplate = () => {
+ if (!form.value.templateId) {
+ ElMessage.warning('请先选择证书模板')
+ return false
+ }
+ if (!sampleList.value.length) {
+ ElMessage.warning('被检样品不能为空')
+ return false
+ }
+ if (!equipmentInfoList.value.length) {
+ ElMessage.warning('所用的计量标准器具不能为空')
+ return false
+ }
+
+ ruleFormRef.value.validate((valid: boolean) => {
+ if (valid) {
+ const params = solveParams()
+ const loading = ElLoading.service({
+ lock: true,
+ background: 'rgba(255, 255, 255, 0.8)',
+ })
+ downLoadTemplate(params).then((res) => {
+ exportFile(res.data, `${form.value.certificateReportName}.xls`)
+ loading.close()
+ }).catch(() => {
+ loading.close()
+ })
+ }
+ })
+}
+
// -------------------------------------------------------------------------------------------
+// 处理保存、下载模板参数
+function solveParams() {
+ const params = {
+ ...form.value,
+ businessEnvironmentRecord: businessEnvironmentRecord.value, // 环境记录单
+ fileList: fileList.value, // 依据的技术文件
+ equipmentInfoList: equipmentInfoList.value, // 所用的计量标准器具列表/监测设备
+ sampleId: sampleList.value[0].id, // 样品id(打印证书接口要必传)
+ sampleNo: sampleList.value[0].sampleNo, // 样品编号
+ sampleName: sampleList.value[0].sampleName, // 样品名称
+ sampleModel: sampleList.value[0].sampleModel, // 样品型号
+ manufacturingNo: sampleList.value[0].manufacturingNo, // 出厂编号
+ manufacturer: sampleList.value[0].manufacturer, // 生产厂家
+ sampleRemark: sampleList.value[0].remark, // 样品备注
+ id: pageType.value === 'add' ? '' : form.value.id,
+ }
+ return params
+}
// 获取详情信息
-const getDetail = () => {
+function getDetail(id?: string, certificateReportCode?: string) {
const loading = ElLoading.service({
lock: true,
background: 'rgba(255, 255, 255, 0.8)',
})
- detail({ id: $route.params.id as string }).then((res) => {
+ getMeasureDataDetail({ id: infoId.value! || id! }).then((res) => {
loading.close()
form.value = res.data
- form.value.createUserName = res.data.applicantName || user.name
- list.value = res.data.sampleList.filter((item: ISampleList) => {
- return item !== null
- })
+ sampleList.value = [{
+ sampleNo: res.data.sampleNo, // 样品编号
+ sampleName: res.data.sampleNo, // 样品名称
+ sampleModel: res.data.sampleNo, // 型号
+ manufacturingNo: res.data.sampleNo, // 出厂编号
+ manufacturer: res.data.sampleNo, // 生产厂家
+ remark: res.data.sampleRemark, // 备注
+ id: res.data.sampleId,
+ }]
+ equipmentInfoList.value = res.data.equipmentInfoList.map((item: { validDate: string }) => {
+ return {
+ ...item,
+ validDate: item.validDate ? dayjs(item.validDate).format('YYYY-MM-DD') : item.validDate,
+ }
+ }) // 所用的计量标准器具
+ businessEnvironmentRecord.value = res.data.businessEnvironmentRecord // 环境记录单数据
+ form.value.environmentCode = res.data.businessEnvironmentRecord.environmentCode// 环境记录单编号
+ if (id && certificateReportCode) {
+ form.value.oldCertificateCode = certificateReportCode
+ form.value.invalid = 1
+ }
}).catch(() => {
loading.close()
})
@@ -399,10 +492,13 @@
// 保存
const handleSave = () => {
- const tempList = list.value.filter(item => item.sampleNo)
- if (!tempList.length) {
- ElMessage.warning('样品信息不能为空')
- return
+ if (!sampleList.value.length) {
+ ElMessage.warning('被检样品不能为空')
+ return false
+ }
+ if (!equipmentInfoList.value.length) {
+ ElMessage.warning('所用的计量标准器具不能为空')
+ return false
}
ruleFormRef.value.validate((valid: boolean) => {
if (valid) {
@@ -410,32 +506,22 @@
lock: true,
background: 'rgba(255, 255, 255, 0.8)',
})
- // 样品&委托单列表(保存/编辑草稿接口入参使用)
- const temList = [] as any // 临时数组
- console.log('保存中的数组', list.value)
-
- list.value.forEach((item: any) => {
- if ((item.orderId && item.id) || (item.orderId && item.sampleId)) {
- temList.push({
- orderId: item.orderId,
- sampleId: item.id || item.sampleId,
- })
- }
- })
- form.value.orderSampleList = temList
+ const params = solveParams()
if (pageType.value === 'add') { // 新建
- addApply(form.value).then((res) => {
- submitId.value = res.data.id
- form.value.projectNo = res.data.projectNo // 分包项目编号
+ addMeasureData(params).then((res) => {
+ submitId.value = res.data.data.id
+ form.value.certificateReportCode = res.data.data.certificateReportCode
+ form.value.certificateReportName = res.data.data.certificateReportName
ElMessage.success('保存成功')
loading.close()
}).catch(() => {
loading.close()
})
}
+
else if (pageType.value === 'edit') { // 编辑
if (query.approvalStatusName === '未通过-驳回') { // 未通过-驳回
- failUpdateApply(form.value).then((res) => {
+ failUpdateMeasureData(params).then((res) => {
ElMessage.success('保存成功')
loading.close()
close()
@@ -444,7 +530,7 @@
})
}
else { // 草稿箱和已取消
- updateApply(form.value).then((res) => {
+ draftUpdateMeasureData(params).then((res) => {
ElMessage.success('保存成功')
loading.close()
close()
@@ -466,7 +552,7 @@
})
const params = {
id: submitId.value,
- formId: query.formId, // 表单id
+ formId: query.formId as string, // 表单id
}
submit(params).then(() => {
ElMessage.success('提交成功')
@@ -481,39 +567,6 @@
}
}
-const sampleVisible = ref(false)
-const projectVisible = ref(false)
-const isMulti = ref(false)
-const selectIndex = ref(0)
-// 点击选择
-const handleSelect = (index: number, row: ISampleList) => {
- sampleVisible.value = true // 选择设备对话框显隐
- isMulti.value = false // 是否单选, false单选、true表格多选
- selectIndex.value = index
-}
-
-const checkoutList = ref([]) // 选中的行
-
-// 修改委托方对话框显隐
-const changeSampleVisible = (val: boolean) => {
- sampleVisible.value = val
-}
-// 修改项目选择对话框显隐
-const changeProjectVisible = (val: boolean) => {
- projectVisible.value = val
-}
-
-// 删除行
-const delRow = () => {
- checkoutList.value.forEach((item: ISampleList) => {
- list.value.forEach((element, index) => {
- if (element.sampleNo === item.sampleNo) {
- list.value.splice(index, 1)
- }
- })
- })
-}
-
// ------------------------------------------审批-----------------------------------------
const approvalRecordData = ref([]) // 审批流程数据
@@ -573,11 +626,26 @@
// ------------------------------------事件-------------------------------------------------
// 检校专业变化
const changeCalibrationMajor = (val: string) => {
- form.value.certificateReportName = form.value.certificateReportCode + val + form.value.certifications
+ const index = calibrationMajorMap.value.findIndex((item: { value: string }) => item.value === val)
+ if (index !== -1) {
+ form.value.calibrationMajorName = calibrationMajorMap.value[index].name
+ }
+ console.log(form.value.calibrationMajorName)
}
// 证书类别变化
const changeCertifications = (val: string) => {
- form.value.certificateReportName = form.value.certificateReportCode + form.value.calibrationMajor + val
+ const index = certificationTypeMap.value.findIndex((item: { value: string }) => item.value === val)
+ if (index !== -1) {
+ form.value.certificateReportCategoryName = certificationTypeMap.value[index].name
+ }
+ console.log(form.value.certificateReportCategoryName)
+}
+// 选择检定员变化
+const changeMeasurePersonId = (val: string) => {
+ const index = userList.value.findIndex(item => item.id === val)
+ if (index !== -1) {
+ form.value.measurePerson = userList.value[index].name
+ }
}
// -------------------------------------------------------------------------------------
onMounted(async () => {
@@ -593,8 +661,9 @@
// form.value.createUser = user.id // 创建人id
// form.value.createUserName = user.name // 创建人
// form.value.applicantTime = proxy.dayjs().format('YYYY-MM-DD HH:mm:ss') // 申请时间
- form.value.jdy = user.name // 创建人
- form.value.jjrq = proxy.dayjs().format('YYYY-MM-DD') // 检校日期
+ form.value.measurePerson = user.name // 检定员名字
+ form.value.measurePersonId = user.id // 检定员id
+ form.value.calibrationTime = proxy.dayjs().format('YYYY-MM-DD') // 检校日期
}
})
@@ -606,7 +675,7 @@
上传证书
-
+
下载证书模板
@@ -641,25 +710,25 @@
label-width="140"
:rules="formRules"
>
-
+
-
+
替代已生成证书
-
-
+
+
-
+
选择
@@ -684,15 +753,15 @@
v-for="item in calibrationMajorMap"
:key="item.value"
:label="item.name"
- :value="item.name"
+ :value="item.value"
/>
-
+
@@ -720,7 +789,7 @@
/>
-
+
+
+
+
+
@@ -761,6 +841,18 @@
/>
+
+
+
+
+
-
-
+
+ filterable
+ @change="changeMeasurePersonId"
+ >
+
+
-
+
-
-
+
+
-
-
+
+
-
-
+
+
-
+
-
+
confirmSelectSample(val, 'order')" />
confirmSelectSample(val, 'warehouse')" />
+
+
+
+
diff --git a/src/views/business/lab/measureData/measureDataList.vue b/src/views/business/lab/measureData/measureDataList.vue
index 5c011b8..96ffa13 100644
--- a/src/views/business/lab/measureData/measureDataList.vue
+++ b/src/views/business/lab/measureData/measureDataList.vue
@@ -2,16 +2,19 @@
-
+
-
-
-
@@ -369,6 +385,7 @@
is-showmulti-select
@change="changePage"
@multi-select="handleSelectionChange"
+ @handleClickFollowLink="handleClickFollowLink"
>
@@ -483,3 +500,12 @@
+
+
diff --git a/src/views/business/schedule/interchangeReceipt/receiptEdit.vue b/src/views/business/schedule/interchangeReceipt/receiptEdit.vue
index 13ee3ab..877ea57 100644
--- a/src/views/business/schedule/interchangeReceipt/receiptEdit.vue
+++ b/src/views/business/schedule/interchangeReceipt/receiptEdit.vue
@@ -356,7 +356,7 @@
getInterchangeReceiptDetail({ id: infoId.value }).then((res) => {
dataForm.value = res.data // 表单
sampleList.value = res.data.customerSampleList // 样品列表
- dataForm.value.orderId = res.data.customerSampleList[0].orderId // orderId
+ dataForm.value.orderId = res.data.orderId // orderId
minioFileNameAutograph.value = res.data.recieverSignFile // 签名图片
loading.close()
})
diff --git a/src/views/finance/businessSettlement/businessSettlement-interface.ts b/src/views/finance/businessSettlement/businessSettlement-interface.ts
index 13a1a0c..454788f 100644
--- a/src/views/finance/businessSettlement/businessSettlement-interface.ts
+++ b/src/views/finance/businessSettlement/businessSettlement-interface.ts
@@ -4,6 +4,8 @@
customerNo: string // 委托方代码
customerName: string // 委托方名称
deliverer: string // 送样人
+ orderTimeStart: string // 委托日期开始
+ orderTimeEnd: string // 委托日期结束
offset: number
limit: number
}
@@ -14,17 +16,17 @@
orderCode: string // 委托书编号
customerNo: string // 委托方代码
customerName: string // 委托方名称
- deliverer: string // 送样人
- delivererTel: string // 联系方式
+ orderTime: string // 委托日期
sampleCount: string // 样品数量
- isUrgent: string // 是否加急
- createTime: string // 创建时间
- postedPrice: number // 标价(单位分)
- suggestedDiscount: string // 建议折扣-单位%
- suggestedPrice: number // 建议价格-单位分
- extraCharge: number // 附加费用-单位分
- extraChargeIllustration: string // 附加费用说明
- totalSettlement: number // 总计结算费用-单位分
+ sampleWarehouseName: string // 样品库房
+ certWarehouseName: string // 证书库房
+ feeStatus: string // 费用状态
+ received: string // 是否到账
+ actualTestFee: string // 检测费(实)(元)
+ shouldTestFee: string // 检测费(应)(元)
+ actualTotalFee: string // 实收合计(元)
+ receivedAmount: string // 到账金额(元)
+ invoiceAmount: string // 开票金额(元)
}
// 字典
@@ -49,21 +51,22 @@
// 表单
export interface IForm {
orderCode: string // 委托书编号
- orderId: string // 委托书编号
- deliverer: string // 送检人
- delivererTel: string // 送样人联系方式
- createTime: string // 委托单创建时间
- planDeliverTime: string // 预计送达时间
- requireOverTime: string // 要求检完时间
- customerNo: string // 委托方代码
- customerId: string // 委托方id
+ orderId: string // 委托单id
customerName: string // 委托方名称
- phone: string // 委托方电话
- priceFront: number // 标价
- suggestedDiscount: number // 建议折扣
- suggestedPrice: number // 建议价格
- extraCharge: number // 附加费用-单位分
- extraChargeIllustration: string // 附加费用说明
- totalSettlement: number // 总计结算费用
- samplePriceList: Array // 样品清单
+ orderTime: string // 委托日期
+ sampleCount: string // 样品数量
+ certificationCompany: string // 证书单位名称
+ certificationCompanyAddress: string // 证书单位地址
+ deliverer: string // 联系人
+ delivererTel: string // 联系方式
+ sampleWarehouse: string // 样品库房
+ certWarehouse: string // 证书库房
+ feeStatus: string // 费用状态
+ received: string // 是否到账
+ actualTestFee: Number // 检测费(实)(元)
+ shouldTestFee: Number // 检测费(应)(元)
+ actualTotalFee: Number // 实收合计(元)
+ receivedAmount: Number // 到账金额(元)
+ invoiceAmount: Number // 开票金额(元)
+ remark: string // 备注
}
diff --git a/src/views/finance/businessSettlement/edit.vue b/src/views/finance/businessSettlement/edit.vue
index e11f337..7630aeb 100644
--- a/src/views/finance/businessSettlement/edit.vue
+++ b/src/views/finance/businessSettlement/edit.vue
@@ -7,13 +7,18 @@
import { useRoute, useRouter } from 'vue-router'
import { el } from 'element-plus/es/locale'
import type { IForm, IsampleList } from './businessSettlement-interface'
+import multiTable from '@/components/MultiHeaderTable/index.vue'
+import { getDictByCode } from '@/api/system/dict'
+import { UploadFile } from '@/api/measure/file'
+import { calc } from '@/utils/useCalc'
+import type { dictType } from '@/global'
import type { TableColumn } from '@/components/NormalTable/table_interface'
import useUserStore from '@/store/modules/user'
import selectOrder from '@/views/business/schedule/interchangeReceipt/selectOrder.vue'
import type { IOrderList } from '@/views/business/schedule/order/orderList_interface'
import { getOrderDetail } from '@/api/business/schedule/order'
import { isNumber, validateMoney } from '@/utils/validate'
-import { calc } from '@/utils/useCalc'
+import useCheckList from '@/utils/useCheckList'
import { addBusinessSettlement, getBusinessSettlementDetail, updateBusinessSettlement } from '@/api/finance/businessSettlement'
const user = useUserStore() // 用户信息
const $route = useRoute()
@@ -27,54 +32,215 @@
// 表单数据
const form = ref({
orderCode: '', // 委托书编号
- orderId: '', // 委托书编号
- deliverer: '', // 送检人
- delivererTel: '', // 送样人联系方式
- createTime: '', // 委托单创建时间
- planDeliverTime: '', // 预计送达时间
- requireOverTime: '', // 要求检完时间
- customerNo: '', // 委托方代码
- customerId: '', // 委托方id
+ orderId: '', // 委托单id
customerName: '', // 委托方名称
- phone: '', // 委托方电话
- priceFront: 0, // 标价
- suggestedDiscount: 95, // 建议折扣
- suggestedPrice: 0, // 建议价格
- extraCharge: 0, // 附加费用-单位分
- extraChargeIllustration: '', // 附加费用说明
- totalSettlement: 0, // 总计结算费用
- samplePriceList: [], // 样品清单
+ orderTime: '', // 委托日期
+ sampleCount: '', // 样品数量
+ certificationCompany: '', // 证书单位名称
+ certificationCompanyAddress: '', // 证书单位地址
+ deliverer: '', // 联系人
+ delivererTel: '', // 联系方式
+ sampleWarehouse: '未入库', // 样品库房
+ certWarehouse: '未入库', // 证书库房
+ feeStatus: '未录费', // 费用状态
+ received: '未到账', // 是否到账
+ actualTestFee: 0, // 检测费(实)(元)
+ shouldTestFee: 0, // 检测费(应)(元)
+ actualTotalFee: 0, // 实收合计(元)
+ receivedAmount: 0, // 到账金额(元)
+ invoiceAmount: 0, // 开票金额(元)
+ remark: '', // 备注
})
-const ruleFormRef = ref() as any
-const list = ref([])// 表格数据
-const orderVisible = ref(false) // 控制委托书对话框显隐
-
-// 表头
-const columns = ref([
- { text: '样品编号', value: 'sampleNo', align: 'center', width: '170', required: false },
- { text: '样品名称', value: 'sampleName', align: 'center', required: false },
- { text: '型号', value: 'sampleModel', align: 'center', required: false },
- { text: '出厂编号', value: 'manufacturingNo', align: 'center', required: false },
- { text: '检定项目', value: 'measureContent', align: 'center', required: false },
- { text: '标价(元)', value: 'price', align: 'center', required: true, reg: validateMoney },
-])
// 表单校验规则
const rules = reactive({
- orderCode: [{ required: true, message: '委托书编号必填', trigger: 'blur' }],
- price: [{ required: true, message: '标价必填', trigger: ['blur', 'change'] },
- { pattern: /(^-?\d\d*\.\d*$)|(^-?\d\d*$)|(^-?\.\d\d*$)/, message: '标价只能为数字', trigger: ['blur', 'change'] }],
- suggestedDiscount: [{ required: true, message: '建议折扣必填', trigger: ['blur', 'change'] },
- { pattern: /^([0]|[1-9][0-9]*)$/, message: '建议折扣只能为正整数或0', trigger: ['blur', 'change'] }],
- extraCharge: [{ required: true, message: '附加费用必填', trigger: ['blur', 'change'] },
- { pattern: /(^[0-9](\d+)?(\.\d{1,2})?$)|(^\d\.\d{1,2}$)/, message: '要求不小于0,且最多保留两位小数', trigger: ['blur', 'change'] }],
- extraChargeIllustration: [{ required: true, message: '附加费用说明必填', trigger: 'blur' }],
+ orderCode: [{ required: true, message: '委托单编号必填', trigger: 'blur' }],
+ customerName: [{ required: true, message: '委托方名称必填', trigger: 'blur' }],
+ orderTime: [{ required: true, message: '委托日期必填', trigger: 'blur' }],
+ sampleCount: [{ required: true, message: '样品数量必填', trigger: 'blur' }],
+ certificationCompany: [{ required: true, message: '证书单位名称必填', trigger: 'blur' }],
+ certificationCompanyAddress: [{ required: true, message: '证书单位地址必填', trigger: 'blur' }],
+ deliverer: [{ required: true, message: '联系人必填', trigger: 'blur' }],
+ delivererTel: [{ required: true, message: '联系电话必填', trigger: 'blur' }],
+ sampleWarehouse: [{ required: true, message: '样品库房必填', trigger: 'blur' }],
+ certWarehouse: [{ required: true, message: '证书库房必填', trigger: 'blur' }],
+ feeStatus: [{ required: true, message: '费用状态必填', trigger: 'blur' }],
+ received: [{ required: true, message: '是否到账必填', trigger: 'blur' }],
+ actualTestFee: [{ required: true, message: '检测费(实)(元)必填', trigger: 'blur' }],
+ shouldTestFee: [{ required: true, message: '检测费(应)(元)必填', trigger: 'blur' }],
+ actualTotalFee: [{ required: true, message: '实收合计(元)必填', trigger: 'blur' }],
+ receivedAmount: [{ required: true, message: '到账金额(元)必填', trigger: 'blur' }],
+ invoiceAmount: [{ required: true, message: '开票金额(元)必填', trigger: 'blur' }],
})
+const ruleFormRef = ref() as any
+const orderVisible = ref(false) // 控制委托书对话框显隐
// ---------------------------------------路由参数--------------------------------------
if ($route.params && $route.params.type) {
pageType.value = $route.params.type as string
infoId.value = $route.params.id as string
}
+// ---------------------------------------字典--------------------------------------
+
+const financeSampleWarehouseList = ref([]) // 样品库房
+const financeCertWarehouseList = ref([]) // 证书库房
+const financeReceivedList = ref([]) // 是否到账
+// 获取字典值
+function getDict() {
+ // 样品库房
+ getDictByCode('financeSampleWarehouse').then((response) => {
+ financeSampleWarehouseList.value = response.data
+ })
+ // 证书库房
+ getDictByCode('financeCertWarehouse').then((response) => {
+ financeCertWarehouseList.value = response.data
+ })
+ // 是否到账
+ getDictByCode('financeReceived').then((response) => {
+ financeReceivedList.value = response.data
+ })
+}
+getDict()
+// -----------------------------------到账金额明细--------------------------------------------------
+const receivedAmountList = ref([]) as any // 到账金额明细
+const checkoutReceivedAmountList = ref([]) as any // 到账金额明细多选
+// 表头
+const receivedAmountcolumns = ref([
+ { text: '到账金额(元)', value: 'money', align: 'center', width: '220', required: true },
+ { text: '到账时间', value: 'moneyTime', align: 'center', width: '220', required: true },
+ { text: '附件', value: 'attachment', align: 'center', required: false },
+])
+
+// -------------------------------------开票金额明细--------------------------------------------------------------
+const invoiceAmountList = ref([]) as any // 开票金额明细
+const checkoutInvoiceAmountList = ref([]) as any // 开票金额明细多选
+// 表头
+const invoiceAmountcolumns = ref([
+ { text: '开票金额(元)', value: 'money', align: 'center', width: '220', required: true },
+ { text: '开票时间', value: 'moneyTime', align: 'center', width: '220', required: true },
+ { text: '附件', value: 'attachment', align: 'center', required: false },
+])
+
+// 多选发生改变时
+const handleSelectionChange = (e: any, type: 'addReceived' | 'invoiceAmount') => {
+ if (type === 'addReceived') { // 到账金额明细
+ checkoutReceivedAmountList.value = e
+ }
+ else { // 开票金额明细
+ checkoutInvoiceAmountList.value = e
+ }
+}
+
+// 点击增加行
+const addRow = (type: 'addReceived' | 'invoiceAmount') => {
+ if (type === 'addReceived') {
+ if (useCheckList(receivedAmountList.value, receivedAmountcolumns.value, '到账金额明细')) {
+ receivedAmountList.value.push({
+ money: undefined,
+ moneyTime: '',
+ attachment: [],
+ moneyType: '1',
+ })
+ }
+ }
+ else {
+ if (useCheckList(invoiceAmountList.value, invoiceAmountcolumns.value, '开票金额明细')) {
+ invoiceAmountList.value.push({
+ money: undefined,
+ moneyTime: '',
+ attachment: [],
+ moneyType: '2',
+ })
+ }
+ }
+}
+
+// 删除行
+const delRow = (type: 'addReceived' | 'invoiceAmount') => {
+ if ((type === 'addReceived' && checkoutReceivedAmountList.value.length <= 0) || (type === 'invoiceAmount' && checkoutInvoiceAmountList.value.length <= 0)) {
+ ElMessage({
+ message: '请选中要删除的行',
+ type: 'warning',
+ })
+ }
+ else {
+ if (type === 'addReceived') {
+ receivedAmountList.value = receivedAmountList.value.filter(
+ (item: any) => {
+ return !checkoutReceivedAmountList.value.includes(item)
+ },
+ )
+ }
+ else {
+ invoiceAmountList.value = invoiceAmountList.value.filter(
+ (item: any) => {
+ return !checkoutInvoiceAmountList.value.includes(item)
+ },
+ )
+ }
+ }
+}
+
+// ----------------------------------------上传附件----------------------------------------------------
+// 删除附件
+const del = (index: number, row: any) => {
+ row.value.attachment.splice(index, 1)
+}
+
+const fileRef = ref() // 文件上传input
+const onFileChange = (event: any, row?: any, type?: 'receivedAmount' | 'invoiceAmount') => {
+ // 原生上传
+ console.log(event.target.files)
+ const files = event.target.files
+ if (files.length !== 0) {
+ // 创建formdata对象
+ const fd = new FormData()
+ for (var i = 0; i < files.length; i++) {
+ fd.append('multipartFile', files[i])
+ }
+ UploadFile(fd).then((res) => {
+ if (res.code === 200) {
+ res.data.forEach((item: string) => {
+ row.attachment.push({
+ minioFileName: item,
+ })
+ })
+ ElMessage.success('文件上传成功')
+ }
+ else {
+ ElMessage.error(res.message)
+ }
+ })
+ }
+}
+const upload = () => {
+ fileRef.value.click()
+}
+// ------------------------------------结算明细--------------------------------------------------------------------
+const list = ref([]) // 开票金额明细
+// 表头
+const columns = ref([
+ { text: '器具名称', value: 'sampleName', align: 'center', required: true, type: 'text' },
+ { text: '型号规格', value: 'sampleModel', align: 'center', width: '180', required: true, type: 'input' },
+ { text: '套数/退', value: 'sets', align: 'center', required: true, width: '180', type: 'inputNumber' },
+ { text: '出厂编号', value: 'manufacturingNo', align: 'center', width: '180', required: true, type: 'input' },
+ { text: '委托日期', value: 'orderTime', align: 'center', required: true, width: '160', type: 'date' },
+ { text: '检测规范', value: 'accordStandard', align: 'center', width: '180', required: false, type: 'input' },
+ {
+ text: '收费(元)含6%增值税',
+ value: 'price',
+ align: 'center',
+ required: false,
+ children: [
+ { text: '检测费(应)', value: 'shouldTestFee', align: 'center', width: '180', required: true, type: 'inputNumber' },
+ { text: '检测费(实)', value: 'actualTestFee', align: 'center', required: true, width: '180', type: 'inputNumber' },
+ { text: '附加费', value: 'extraFee', align: 'center', required: false, width: '180', type: 'inputNumber' },
+ { text: '修理费', value: 'repairFee', align: 'center', required: false, width: '180', type: 'inputNumber' },
+ { text: '其他费', value: 'otherFee', align: 'center', required: false, width: '180', type: 'inputNumber' },
+ { text: '小计', value: 'subtotal', align: 'center', required: false, type: 'text' },
+ ],
+ },
+])
+
// ------------------------------------委托书---------------------------------------------
// 点击选择委托书编号
const handleClickOrder = () => {
@@ -87,87 +253,63 @@
// 选好委托书
const confirmCheckoutOrder = (val: Array) => {
if (val && val.length) {
- form.value.priceFront = 0 // 标价
- // form.value.suggestedDiscount = 95 // 建议折扣
- form.value.suggestedPrice = 0 // 建议价格
- form.value.extraCharge = 0// 附加费用-单位分
- form.value.extraChargeIllustration = '' // 附加费用说明
- form.value.totalSettlement = 0 // 总计结算费用
getOrderDetail({ id: val[0].id }).then((res) => { // 样品清单
form.value.orderCode = res.data.orderCode // 委托书编号
form.value.orderId = res.data.id // 委托书id
- form.value.deliverer = res.data.deliverer // 送检人
- form.value.delivererTel = res.data.delivererTel // 送检人
- form.value.createTime = res.data.createTime // 委托单创建时间
- form.value.customerNo = res.data.customerNo // 委托方代码
- form.value.customerId = res.data.customerId // 委托方id
form.value.customerName = res.data.customerName // 委托方名称
- form.value.planDeliverTime = res.data.planDeliverTime // 预计送达时间
- form.value.requireOverTime = res.data.requireOverTime // 要求检完时间
- form.value.phone = res.data.customerPhone // 委托方电话
- list.value = res.data.customerSampleInfoList.map((item: { isEdit: boolean }) => {
+ form.value.orderTime = res.data.createTime // 委托日期(委托单创建时间)
+ form.value.certificationCompany = res.data.certificationCompany // 证书单位名称
+ form.value.certificationCompanyAddress = res.data.certificationCompanyAddress // 证书单位地址
+ form.value.deliverer = res.data.deliverer // 联系人
+ form.value.delivererTel = res.data.delivererTel // 联系方式
+ form.value.sampleCount = res.data.customerSampleInfoList.length // 样品数量
+ list.value = res.data.customerSampleInfoList.map((item: { createTime: string; editable: boolean }) => {
return {
...item,
- isEdit: true,
+ orderTime: item.createTime ? dayjs(item.createTime).format('YYYY-MM-DD') : item.createTime, // 委托日期
+ editable: pageType.value !== 'detail',
+ shouldTestFee: 0, // 检测费(应)
+ actualTestFee: 0, // 检测费(实)
+ extraFee: 0, // 附加费
+ repairFee: 0, // 修理费
+ otherFee: 0, // 其他费
+ sets: 0, // 套数
+ subtotal: 0, // 小计
+ id: '',
}
})
})
}
}
-// -----------------------------------------样品清单--------------------------------------------
-// 检查列表
-function checkSampleList() {
- for (let index = 0; index < list.value.length; index++) {
- const item = list.value[index]
- for (const prop of columns.value) {
- // 检查必填
- if (prop.required && !item[prop.value]) {
- ElMessage.warning(`请先完善第${index + 1}行中${prop.text}`)
- return false
- }
- // 验证正则
- if (prop.reg && typeof prop.reg === 'function') {
- if (!prop.reg(item[prop.value])) {
- // ElMessage.warning(`第${index + 1}行中${prop.text}输入不合法`)
- ElMessage.warning(`第${index + 1}行: 要求标价为正数,且最多保留两位小数`)
- return false
- }
- }
- }
- }
- return true
-}
+// --------------------------------------------计算----------------------------------------------
+// 计算
+const handleInputNumberChange = ({ row }: any) => {
+ // 计算小计
+ row.subtotal = calc(Number(calc(Number(calc(Number(calc(Number(row.shouldTestFee), Number(row.actualTestFee), '+')), row.extraFee, '+')), row.repairFee, '+')), row.otherFee, '+')
+ // 计算检测费(应)(元)
+ form.value.shouldTestFee = list.value.reduce((accumulator, current: any) => accumulator + current.shouldTestFee, 0)
+ // 计算检测费(实)(元)
+ form.value.actualTestFee = list.value.reduce((accumulator, current: any) => accumulator + current.actualTestFee, 0)
+ // 实收合计
+ form.value.actualTotalFee = list.value.reduce((accumulator, current: any) => accumulator + current.subtotal, 0)
-// --------------------------------------------自动计算----------------------------------------------
-// 折扣改变-计算建议价格
-const changeSuggestedDiscount = () => {
- console.log('折扣改变')
- if (form.value.priceFront) {
- form.value.suggestedPrice = calc(Number(form.value.priceFront), Number(form.value.suggestedDiscount / 100), '*') as number
- form.value.suggestedPrice = Number(form.value.suggestedPrice.toFixed(2))
+ if (list.value.every((item: { actualTestFee: number }) => item.actualTestFee === 0 || `${item.actualTestFee}` === 'undefined' || `${item.actualTestFee}` === 'null' || `${item.actualTestFee}` === '')) {
+ form.value.feeStatus = '未录费'
+ }
+ else if (list.value.every((item: { actualTestFee: number }) => item.actualTestFee !== 0 || `${item.actualTestFee}` === 'undefined' || `${item.actualTestFee}` === 'null' || `${item.actualTestFee}` === '')) {
+ form.value.feeStatus = '已录费'
+ }
+ else {
+ form.value.feeStatus = '部分录费'
}
}
-// 标价改变
-const changePrice = () => {
- console.log('标价改变')
- let sum = 0
- list.value.forEach((item) => {
- if (item.price) {
- sum = calc(Number(sum), Number(item.price), '+') as number
- }
- })
- form.value.priceFront = sum
- changeSuggestedDiscount() // 建议价格随之变化
+const changeTableInputNumber = () => {
+ // 到账金额
+ form.value.receivedAmount = receivedAmountList.value.reduce((accumulator: any, current: any) => accumulator + current.money, 0)
+ // 开票金额
+ form.value.invoiceAmount = invoiceAmountList.value.reduce((accumulator: any, current: any) => accumulator + current.money, 0)
}
-// 附加费用改变
-const changeExtraCharge = () => {
- console.log('附加费用改变')
- form.value.totalSettlement = calc(Number(form.value.suggestedPrice), Number(form.value.extraCharge), '+') as number
-}
-watch(() => form.value.suggestedPrice, (newValue) => {
- changeExtraCharge()
-})
// ----------------------------------------------------------------------------------------
const $router = useRouter()
@@ -176,9 +318,35 @@
$router.back()
}
+// 校验表格
+const checkList = () => {
+ if (!receivedAmountList.value.length) {
+ ElMessage.warning('到账金额明细不能为空')
+ return false
+ }
+ if (!invoiceAmountList.value.length) {
+ ElMessage.warning('开票金额明细不能为空')
+ return false
+ }
+ if (!list.value.length) {
+ ElMessage.warning('结算明细不能为空')
+ return false
+ }
+ if (!useCheckList(receivedAmountList.value, receivedAmountcolumns.value, '到账金额明细')) {
+ return false
+ }
+ if (!useCheckList(invoiceAmountList.value, invoiceAmountcolumns.value, '开票金额明细')) {
+ return false
+ }
+ if (!useCheckList(list.value, columns.value, '结算明细')) {
+ return false
+ }
+ return true
+}
+
// 保存
const save = () => {
- if (!checkSampleList()) {
+ if (!checkList()) {
return false
}
ruleFormRef.value.validate((valid: boolean) => {
@@ -188,17 +356,10 @@
background: 'rgba(255, 255, 255, 0.8)',
})
const params = {
- extraCharge: calc(Number(form.value.extraCharge), 100, '*'), // 附加费用-单位分
- extraChargeIllustration: form.value.extraChargeIllustration, // 附加费用说明
id: infoId.value,
- orderId: form.value.orderId, // 委托书id
- suggestedDiscount: form.value.suggestedDiscount, // 建议折扣-单位%
- samplePriceList: list.value.map((item) => {
- return {
- price: calc(Number(item.price), 100, '*'), // 标价-单位分
- relationId: item.relationId, // 样品id
- }
- }), // 样品清单
+ ...form.value,
+ amountDetailsList: receivedAmountList.value.concat(invoiceAmountList.value),
+ sampleList: list.value,
}
// 新建
if (pageType.value === 'add') {
@@ -229,24 +390,22 @@
// 编辑、详情--获取详细信息
const fetchDetail = () => {
+ const loading = ElLoading.service({})
getBusinessSettlementDetail({ id: infoId.value }).then((res) => {
form.value = res.data
- form.value.phone = res.data.customerPhone
- list.value = res.data.sampleList.map((item: { postedPrice: number; id: string }) => {
+ receivedAmountList.value = res.data.amountDetailsList.filter((item: { moneyType: string }) => `${item.moneyType}` === '1')
+ invoiceAmountList.value = res.data.amountDetailsList.filter((item: { moneyType: string }) => `${item.moneyType}` === '2')
+ list.value = res.data.sampleDetailsList.map((item: { editable: boolean; orderTime: string }) => {
return {
...item,
- price: calc(Number(item.postedPrice), 100, '/') as number,
- isEdit: pageType.value === 'edit',
- relationId: item.id,
+ editable: pageType.value !== 'detail',
+ orderTime: item.orderTime ? dayjs(item.orderTime).format('YYYY-MM-DD') : item.orderTime,
}
})
- form.value.priceFront = calc(Number(res.data.postedPrice), 100, '/') as number // 标价
- // form.value.suggestedDiscount = // 建议折扣
- form.value.suggestedPrice = calc(Number(res.data.suggestedPrice), 100, '/') as number// 建议价格
- form.value.extraCharge = calc(Number(res.data.extraCharge), 100, '/') as number// 附加费用-单位分
- // form.value.extraChargeIllustration = // 附加费用说明
- form.value.totalSettlement = calc(Number(res.data.totalSettlement), 100, '/') as number // 总计结算费用
- })
+ form.value.orderTime = res.data.sampleDetailsList[0].orderTime // 委托日期
+ form.value.sampleCount = res.data.sampleDetailsList.length // 样品数量
+ loading.close()
+ }).catch(() => loading.close())
}
onMounted(() => {
@@ -278,10 +437,10 @@
>
-
+
@@ -294,51 +453,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -467,17 +645,26 @@
-
-
+
+
+
+ 增加行
+
+
+ 删除行
+
+
handleSelectionChange(e, 'addReceived')"
>
+
*{{ item.text }}
-
-
-
- {{ scope.row[item.value] }}
+
+
+
+
+ {{ '上传' }}
+
+
+
+ ×
+
+
+
onFileChange(e, scope.row, 'receivedAmount')">
+
+
+
+
+ 增加行
+
+
+ 删除行
+
+
+ handleSelectionChange(e, 'invoiceAmount')"
+ >
+
+
+
+
+ *{{ item.text }}
+
+
+
+
+
+
+
+ {{ '上传' }}
+
+
+
+ ×
+
+
+
onFileChange(e, scope.row, 'receivedAmount')">
+
+
+
+
+
+
+
+
diff --git a/src/views/finance/businessSettlement/list.vue b/src/views/finance/businessSettlement/list.vue
index eea28d8..2852223 100644
--- a/src/views/finance/businessSettlement/list.vue
+++ b/src/views/finance/businessSettlement/list.vue
@@ -2,6 +2,8 @@
diff --git a/src/api/business/lab/measureData.ts b/src/api/business/lab/measureData.ts
new file mode 100644
index 0000000..ab3a56e
--- /dev/null
+++ b/src/api/business/lab/measureData.ts
@@ -0,0 +1,78 @@
+/**
+ * 计量数据管理
+*/
+import request from '../../index'
+
+// 计量数据管理列表
+export function getMeasureDataList(data: { offset: number; limit: number }) {
+ return request({
+ url: `/business/certificateReport/approval/listPage?offset=${data.offset}&limit=${data.limit}`,
+ method: 'post',
+ data,
+ })
+}
+
+// 点击下载模板后生成证书
+export function downLoadTemplate(data: any) {
+ return request({
+ url: '/business/certificateReport/exportFile',
+ method: 'post',
+ data,
+ responseType: 'blob',
+ })
+}
+
+// 新增
+export function addMeasureData(data: any) {
+ return request({
+ url: '/business/certificateReport/save',
+ method: 'post',
+ data,
+ })
+}
+
+// 草稿箱更新
+export function draftUpdateMeasureData(data: any) {
+ return request({
+ url: '/business/certificateReport/draftUpdate',
+ method: 'post',
+ data,
+ })
+}
+
+// 未通过-驳回编辑
+export function failUpdateMeasureData(data: any) {
+ return request({
+ url: '/business/certificateReport/failUpdate',
+ method: 'post',
+ data,
+ })
+}
+
+// 提交
+export function submit(data: { formId: string; processId?: string; id: string }) {
+ return request({
+ url: '/business/certificateReport/submit',
+ method: 'post',
+ data,
+ })
+}
+
+// 详情
+export function getMeasureDataDetail(data: { id: string }) {
+ return request({
+ url: '/business/certificateReport/detail',
+ method: 'post',
+ data,
+ })
+}
+
+// 删除
+export function deleteMeasureData(data: any) {
+ return request({
+ url: '/business/certificateReport/batchDelete',
+ method: 'post',
+ data,
+ })
+}
+
diff --git a/src/api/business/subpackage/apply.ts b/src/api/business/subpackage/apply.ts
index ad17a5a..c778f8e 100644
--- a/src/api/business/subpackage/apply.ts
+++ b/src/api/business/subpackage/apply.ts
@@ -94,3 +94,4 @@
data,
})
}
+
diff --git a/src/api/system/tool.ts b/src/api/system/tool.ts
index 6b2f5f2..8223e4c 100644
--- a/src/api/system/tool.ts
+++ b/src/api/system/tool.ts
@@ -67,19 +67,10 @@
data,
})
}
-// 原始记录模板/证书报告模板列表(分页)
-export interface listParamsType {
- templateNo: string // 编号
- templateName: string // 名称
- templateCreator: string // 负责人
- // createTime: string // 创建时间
- limit: number
- offset: number
- templateType: string
-}
-export function templatePage(data: listParamsType) {
+
+export function templatePage(data: any) {
return request({
- url: `${prefix}/template/listPage?limit=${data.limit}&offset=${data.offset}`,
+ url: `${prefix}template/listPage?limit=${data.limit}&offset=${data.offset}`,
method: 'post',
data,
})
@@ -87,7 +78,7 @@
// 原始记录模板/证书报告模板列表/详情(
export function templatePageDetail(data: object) {
return request({
- url: `${prefix}/template/detail`,
+ url: `${prefix}template/detail`,
method: 'post',
data,
})
@@ -95,7 +86,7 @@
// 原始记录模板/证书报告模板列表删除
export function templateDelete(data: object) {
return request({
- url: `${prefix}/template/delete`,
+ url: `${prefix}template/delete`,
method: 'post',
data,
})
@@ -103,7 +94,7 @@
// 原始记录模板/证书报告模板列表新建
export function templateAdd(data: object) {
return request({
- url: `${prefix}/template/add`,
+ url: `${prefix}template/add`,
method: 'post',
data,
})
@@ -111,7 +102,7 @@
// 原始记录模板/证书报告模板列表更新
export function templateUpdate(data: object) {
return request({
- url: `${prefix}/template/update`,
+ url: `${prefix}template/update`,
method: 'post',
data,
})
@@ -119,7 +110,7 @@
// 原始记录模板/证书报告模板列表导出
export function templateExport(data: object) {
return request({
- url: `${prefix}/template/listExport`,
+ url: `${prefix}template/listExport`,
method: 'post',
data,
responseType: 'blob',
diff --git a/src/components.d.ts b/src/components.d.ts
index edc2e04..64cf608 100644
--- a/src/components.d.ts
+++ b/src/components.d.ts
@@ -46,6 +46,7 @@
ImageUpload: typeof import('./components/ImageUpload/index.vue')['default']
LineChart: typeof import('./components/Echart/LineChart.vue')['default']
MeasureRecords: typeof import('./components/Sample/measureRecords.vue')['default']
+ MultiHeaderTable: typeof import('./components/MultiHeaderTable/index.vue')['default']
NodeWrap: typeof import('./components/workFlow/nodeWrap.vue')['default']
NodeWrapBan: typeof import('./components/workFlow/nodeWrapBan.vue')['default']
NormalTable: typeof import('./components/NormalTable/index.vue')['default']
@@ -67,6 +68,7 @@
SelectStaffDialog: typeof import('./components/dialog/selectStaffDialog.vue')['default']
SvgIcon: typeof import('./components/SvgIcon/index.vue')['default']
SystemInfo: typeof import('./components/SystemInfo/index.vue')['default']
+ TableColumn: typeof import('./components/MultiHeaderTable/tableColumn.vue')['default']
TableContainer: typeof import('./components/TableContainer/index.vue')['default']
Trend: typeof import('./components/Trend/index.vue')['default']
WordOreview: typeof import('./components/filePreview/wordOreview.vue')['default']
diff --git a/src/components/MultiHeaderTable/index.vue b/src/components/MultiHeaderTable/index.vue
new file mode 100644
index 0000000..85b8c88
--- /dev/null
+++ b/src/components/MultiHeaderTable/index.vue
@@ -0,0 +1,343 @@
+
+
+
+
+
+
+
diff --git a/src/components/MultiHeaderTable/tableColumn.vue b/src/components/MultiHeaderTable/tableColumn.vue
new file mode 100644
index 0000000..2b87285
--- /dev/null
+++ b/src/components/MultiHeaderTable/tableColumn.vue
@@ -0,0 +1,147 @@
+
+
+
+
+
+
+
+
+
+
+ *{{ item.text }}
+
+
+ *{{ item.text }}
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ scope.row[item.value] }}
+
+
+ {{
+ scope.row[item.value]
+ }}
+
+
+
+
+
+
diff --git a/src/components/NormalTable/index.vue b/src/components/NormalTable/index.vue
index e56f775..67092d3 100644
--- a/src/components/NormalTable/index.vue
+++ b/src/components/NormalTable/index.vue
@@ -3,6 +3,7 @@
import { ElTable } from 'element-plus'
import { defineExpose, ref } from 'vue'
import type { TableColumn } from './table_interface'
+import showPhoto from '@/views/system/tool/showPhoto.vue'
// ------------------定义props、 emit-------------------
const props = defineProps({
@@ -212,8 +213,8 @@
{{ scope.row[column.value] }}
{{ column.filter(scope.row) }}
- {{ scope.row }}
-
+
+
diff --git a/src/utils/useCheckList.ts b/src/utils/useCheckList.ts
new file mode 100644
index 0000000..c7782f0
--- /dev/null
+++ b/src/utils/useCheckList.ts
@@ -0,0 +1,73 @@
+import { ElMessage } from 'element-plus'
+// import type { TableColumn } from '@/components/NormalTable/table_interface'
+
+/**
+ * 检查列表
+ * @param list 要检查的表格数据(被依赖项如果满足某个条件就去检查依赖项,否则不检查依赖项)
+ * @param columns // 表头信息
+ * @param tableTitle // 表格名称
+ * @param depend // 依赖项
+ * @param depended // 被依赖项
+ * @param dependedValue // 被依赖项条件
+ * @param requireLength // 要检查的表格数据长度是否大于0
+ */
+export default function useCheckList(list: any, columns: any, tableTitle = '', depend?: string, depended?: string, dependedValue?: number | string, requireLength = false): boolean {
+ for (const prop of columns) {
+ for (let index = 0; index < list.length; index++) {
+ const item = list[index]
+
+ if (depend && depended && item[depended] === dependedValue && !(`${item[prop.value]}`)) { // 被依赖项满足条件时需要检查
+ ElMessage.warning(`请先完善 ${tableTitle} 第${index + 1}行中 ${prop.text} 字段`)
+ return false
+ }
+ else {
+ // 检查必填
+ if (prop.required && (!(`${item[prop.value]}`) || `${item[prop.value]}` === 'null' || `${item[prop.value]}` === 'undefined' || item[prop.value] == undefined)) {
+ if (`${prop.belongStandardEquipment}` === '15') { // 小功率
+ ElMessage.warning(`${tableTitle} 第${index + 1}行中 ${prop.message} ${prop.text} 字段不能为空`)
+ }
+ else {
+ ElMessage.warning(`请先完善 ${tableTitle} 第${index + 1}行中 ${prop.text} 字段`)
+ }
+ return false
+ }
+ }
+
+ // 验证正则
+ if (prop.reg && typeof prop.reg === 'function') {
+ if (prop.value === 'resolution') { // 分辨力特殊处理
+ if (!prop.reg(item[prop.value])) {
+ ElMessage.warning(`${tableTitle} 第${index + 1}行中 ${prop.text} 不能大于1`)
+ return false
+ }
+ }
+ else {
+ if (!prop.reg(item[prop.value])) {
+ if (`${prop.belongStandardEquipment}` === '15') { // 小功率
+ ElMessage.warning(`${tableTitle} 第${index + 1}行中 ${prop.message} ${prop.text} 字段不能为0`)
+ }
+ else if (`${prop.belongStandardEquipment}` === '17') { // S参数
+ ElMessage.warning(`${tableTitle} 第${index + 1}行中 ${prop.text} 仅允许输入数字、字母、特殊字符`)
+ }
+ else {
+ ElMessage.warning(`${tableTitle} 第${index + 1}行中 ${prop.text} 字段输入不合法`)
+ }
+ return false
+ }
+ }
+ }
+
+ if (prop.children && prop.children.length) {
+ if (!useCheckList(list, prop.children, tableTitle, depend, depended, dependedValue)) {
+ return false
+ }
+ }
+ }
+ }
+
+ if (requireLength && !list.length) {
+ ElMessage.warning(`${tableTitle}表格数据不能为空`)
+ return false
+ }
+ return true
+}
diff --git a/src/views/business/lab/components/selectOrderSamplesDialog.vue b/src/views/business/lab/components/selectOrderSamplesDialog.vue
index 4002f83..b004107 100644
--- a/src/views/business/lab/components/selectOrderSamplesDialog.vue
+++ b/src/views/business/lab/components/selectOrderSamplesDialog.vue
@@ -14,6 +14,7 @@
const loadingTable = ref(false) // loading
const list = ref([]) // 表格参数
const tableRef = ref()
+const isMulti = ref(true) // 是否多选默认为多选
const columns = ref
([
{ text: '被测样品名称', value: 'sampleName', align: 'center', required: true },
{ text: '型号规格', value: 'sampleModel', align: 'center', required: true },
@@ -60,9 +61,10 @@
}
// 初始化
-const initDialog = (orderIdParam: string) => {
+const initDialog = (orderIdParam: string, isMultiParam = true) => {
dialogFormVisible.value = true
orderId.value = orderIdParam
+ isMulti.value = isMultiParam
getList()
}
defineExpose({ initDialog })
@@ -78,7 +80,7 @@
:columns="columns"
is-showmulti-select
:list-loading="loadingTable"
- :is-multi="true"
+ :is-multi="isMulti"
:height="300"
:pagination="false"
@multi-select="handleSelectionChange"
diff --git a/src/views/business/lab/components/selectReportTemplate.vue b/src/views/business/lab/components/selectReportTemplate.vue
index 5c59693..ec36ef7 100644
--- a/src/views/business/lab/components/selectReportTemplate.vue
+++ b/src/views/business/lab/components/selectReportTemplate.vue
@@ -7,8 +7,9 @@
import type { typeofSign } from '@/views/system/tool/tool_interface'
import { templatePage } from '@/api/system/tool'
-const emits = defineEmits(['add'])
+const emits = defineEmits(['confirm'])
const dialogFormVisible = ref(false) // 控制弹窗显隐
+const createTime = ref()
// 查询参数
const searchQuery = reactive({
templateNo: '', // 编号
@@ -18,31 +19,43 @@
createEndTime: '',
limit: 5,
offset: 1,
- templateType: '',
+ certificationType: '0',
ids: [] as string[],
}) // 查询参数
const loadingTable = ref(false) // loading
const list = ref([]) // 表格参数
const total = ref(0)
const columns = ref([
- { text: '编号', value: 'templateNo', align: 'center', width: '180' },
- { text: '模板名称', value: 'templateName', align: 'center', width: '150' },
- { text: '模板负责人', value: 'templateCreator', align: 'center', width: '100' },
- { text: '创建时间', value: 'createTime', align: 'center', width: '250' },
- { text: '描述', value: 'templateDesc', align: 'center' },
+ { text: '编号', value: 'templateNo', align: 'center', width: '160' },
+ { text: '模板名称', value: 'templateName', align: 'center' },
+ { text: '模板类型', value: 'templateTypeName', align: 'center', width: '100' },
+ { text: '负责人', value: 'templateCreator', align: 'center', width: '100' },
+ { text: '内容描述', value: 'templateDesc', align: 'center' },
+ { text: '创建时间', value: 'createTime', align: 'center', width: '180' },
])
const checkoutList = ref([]) // 多选选中参数
-// 获取类型
-const getType = async () => {
- const res = await getDictByCode('templateType')
- searchQuery.templateType = res.data.filter((item: typeofSign) => item.name === '证书报告模板')[0].value
+// ---------------------------------------字典--------------------------------------------
+const templateTypeMap = ref([]) as any // 模板类型
+// 获取字典值
+async function getDict() {
+ // 模板类型
+ const res = await getDictByCode('certificationType')
+ res.data.forEach((item: { value: string; name: string }) => {
+ templateTypeMap.value[`${item.value}`] = item.name
+ })
}
+// ----------------------------------------------------------------------------------------------
// 获取数据列表
const getList = () => {
loadingTable.value = true
templatePage(searchQuery).then((res) => {
if (res.code === 200) {
- list.value = res.data.rows
+ list.value = res.data.rows.map((item: { certificationType: string }) => {
+ return {
+ ...item,
+ templateTypeName: `${item.certificationType}` ? templateTypeMap.value[item.certificationType] : item.certificationType, // 模板类型
+ }
+ })
total.value = res.data.total
}
loadingTable.value = false
@@ -74,7 +87,8 @@
searchQuery.createEndTime = ''
searchQuery.limit = 5
searchQuery.offset = 1
- // searchQuery.templateType = '' // 类型不能变
+ searchQuery.certificationType = '0'
+ createTime.value = ''
searchQuery.ids = []
getList()
}
@@ -82,10 +96,10 @@
// 点击保存
const submitForm = () => {
if (!checkoutList.value.length) {
- ElMessage.warning('请选择证书报告模板')
+ ElMessage.warning('请选择证书模板')
}
else {
- emits('add', checkoutList.value[0])
+ emits('confirm', checkoutList.value[0])
dialogFormVisible.value = false
}
}
@@ -103,15 +117,25 @@
// 初始化
const initDialog = () => {
dialogFormVisible.value = true
- getType().then((_) => {
+ getDict().then((_) => {
getList()
})
}
+watch(() => createTime.value, (newVal) => {
+ if (newVal) {
+ searchQuery.createStartTime = newVal[0]
+ searchQuery.createEndTime = newVal[1]
+ }
+ else {
+ searchQuery.createStartTime = ''
+ searchQuery.createEndTime = ''
+ }
+})
defineExpose({ initDialog })
-
+
@@ -121,7 +145,18 @@
-
+
+
+
+
diff --git a/src/views/business/lab/measureData/dialog/selectMeasueDataDialog.vue b/src/views/business/lab/measureData/dialog/selectMeasueDataDialog.vue
new file mode 100644
index 0000000..f8be703
--- /dev/null
+++ b/src/views/business/lab/measureData/dialog/selectMeasueDataDialog.vue
@@ -0,0 +1,199 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ (listQuery.offset - 1) * listQuery.limit + scope.$index + 1 }}
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/views/business/lab/measureData/dialog/selectTechFilesDialog.vue b/src/views/business/lab/measureData/dialog/selectTechFilesDialog.vue
new file mode 100644
index 0000000..f6f1a5a
--- /dev/null
+++ b/src/views/business/lab/measureData/dialog/selectTechFilesDialog.vue
@@ -0,0 +1,247 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ (listQuery.offset - 1) * listQuery.limit + scope.$index + 1 }}
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/views/business/lab/measureData/measureData-interface.ts b/src/views/business/lab/measureData/measureData-interface.ts
index 8319f65..d25a212 100644
--- a/src/views/business/lab/measureData/measureData-interface.ts
+++ b/src/views/business/lab/measureData/measureData-interface.ts
@@ -1,13 +1,14 @@
// 查询条件
export interface IListQuery {
- approvalStatus: string // 审批状态
- certificateReportCode: string // 证书编号
- certificateReportName: string // 证书名称
- customerName: string // 委托方名称
- sampleName: string // 样品名称
- measureCategory: string // 检校类别
- approvalStatusName: string // 审批状态名称
- formId: string
+ approvalStatus: string // 审批状态类型code
+ certificateReportCode: string // 证书编号
+ certificateReportName: string // 证书名称
+ customerName: string // 委托方名称
+ formId: string // 表单id(流程定义对应的表单id,等价于业务id)
+ measureCategory: string // 检校类别
+ orderCode: string // 委托书编号
+ sampleName: string // 样品名称
+ sampleNo: string // 样品编号
offset: number
limit: number
}
@@ -28,47 +29,53 @@
calibrationTime: string // 检校日期
taskId?: string // 任务id 用于审批
decisionItem?: string
- applyApprovalStatusName?: string // 审批状态名称
+ approvalStatusName?: string // 审批状态名称
processId?: string // 流程实例id
}
// 表单
export interface IForm {
- tdysczs: number // 替代已生成证书
+ id?: string
+ invalid: number // 替代已生成证书
formId: string
- yzs: string // 原证书
+ oldCertificateCode: string // 原证书
calibrationMajor: string // 检校专业
- certifications: string // 证书类别
+ calibrationMajorName: string // 检校专业名称
+ certificateReportCategory: string // 证书类别
+ certificateReportCategoryName: string // 证书类别名称
certificateReportCode: string // 证书编号
certificateReportName: string // 证书名称
- jdy: string // 检定员
- jjrq: string // 检校日期
+ measurePerson: string // 检定员
+ measurePersonId: string // 检定员id
+ calibrationTime: string // 检校日期
orderCode: string // 委托书
orderId: string // 委托书id
customerId?: string // 委托放id
customerName: string // 委托方名称
+ customerAddress: string // 委托方地址
certificationCompany: string // 证书单位名称
certificationCompanyAddress: string // 证书单位地址
calibrationPlace: string // 检校地点
- fjsj: string // 复校时间
- jssj: string // 接收时间
- jdjg: string // 检定结果
- environmentCode: string// 环境记录单编号
+ repeatTime: string // 复校时间
+ deliverTime: string // 接收时间
+ measureResult: string // 检定结果
+ environmentCode: string // 环境记录单编号
environmentId: string // 环境记录单id
temperature: string // 温度
humidity: string // 湿度
+ techFilesName: string // 依据的技术文件名称
signId: string // 电子签章id
signName: string // 电子签章名称
approvalSignIds: string // 认可标志专用章id
approvalSignName: string // 认可标志专用章名称
remark: string // 备注
- ywy: string // 业务员
+ busPersonId: string // 业务员id
+ busPersonName: string // 业务员名字
templateId: string // 证书模板
templateName: string // 证书模板
- templateNameFile: string // 证书模板文件
certificateReportFile: string // 证书报告附件
processId?: string // 流程实例id
@@ -76,6 +83,7 @@
// 被检样品
export interface ISampleList {
+ id: string // 样品id
sampleNo: string // 样品编号
sampleName: string // 样品名称
sampleModel: string // 型号
diff --git a/src/views/business/lab/measureData/measureDataDetail.vue b/src/views/business/lab/measureData/measureDataDetail.vue
index 4aa9717..c554c33 100644
--- a/src/views/business/lab/measureData/measureDataDetail.vue
+++ b/src/views/business/lab/measureData/measureDataDetail.vue
@@ -3,6 +3,7 @@
import { ElLoading, ElMessage, ElMessageBox } from 'element-plus'
import type { FormInstance, FormRules } from 'element-plus'
import { ref } from 'vue'
+import dayjs from 'dayjs'
import EnvironmentalDialog from '../components/environmentalDialog.vue'
import selectSignature from '../components/selectSignature.vue'
import selectReportTemplate from '../components/selectReportTemplate.vue'
@@ -10,10 +11,12 @@
import SelectSamplesDialog from '../components/selectSamplesDialog.vue'
import selectMeasureDevice from '../components/selectMeasureDevice.vue'
import type { IEquipmentList, IForm, ISampleList } from './measureData-interface'
+import selectMeasueDataDialog from './dialog/selectMeasueDataDialog.vue'
+import selectTechFilesDialog from './dialog/selectTechFilesDialog.vue'
import { UploadFile } from '@/api/measure/file'
import ApprovalDialog from '@/components/Approval/ApprovalDialog.vue'
import type { TableColumn } from '@/components/NormalTable/table_interface'
-import { addApply, detail, failUpdateApply, submit, updateApply } from '@/api/business/subpackage/apply'
+import { addMeasureData, downLoadTemplate, draftUpdateMeasureData, failUpdateMeasureData, getMeasureDataDetail, submit } from '@/api/business/lab/measureData'
import { cancelApproval, fetchApproval, submitApproval } from '@/api/approval'
import showPhoto from '@/views/system/tool/showPhoto.vue'
import { getDictByCode } from '@/api/system/dict'
@@ -21,6 +24,9 @@
import selectOrder from '@/views/business/schedule/interchangeReceipt/selectOrder.vue'
import { downloadFile } from '@/utils/download'
import type { dictType } from '@/global'
+import { getUserList } from '@/api/system/user'
+import { exportFile } from '@/utils/exportUtils'
+
const user = useUserStore() // 用户信息
const textMap: { [key: string]: string } = {
edit: '编辑',
@@ -31,6 +37,8 @@
const $router = useRouter() // 关闭页面使用
const $route = useRoute()
const query = $route.query
+console.log('opopopop', query)
+
const approvalDialog = ref() // 审批对话ref
const pageType = ref('add') // 页面类型: add, edit, detail
const infoId = ref('') // 列表id
@@ -38,57 +46,63 @@
const orderVisible = ref(false) // 控制委托单对话框显隐
const ruleFormRef = ref() as any
const form = ref({
- tdysczs: 0, // 替代已生成证书
+ invalid: 0, // 替代已生成证书
formId: query.formId as string,
- yzs: '', // 原证书
+ oldCertificateCode: '', // 原证书
calibrationMajor: '', // 检校专业
- certifications: '', // 证书类别
+ calibrationMajorName: '', // 检校专业名称
+ certificateReportCategory: '', // 证书类别
+ certificateReportCategoryName: '', // 证书类别名称
certificateReportCode: '', // 证书编号
certificateReportName: '', // 证书名称
- jdy: '', // 检定员
- jjrq: '', // 检校日期
+ measurePerson: '', // 检定员
+ measurePersonId: '', // 检定员id
+ calibrationTime: '', // 检校日期
- orderCode: '', // 委托单
+ orderCode: '', // 委托单编号
orderId: '', // 委托单id
customerName: '', // 委托方名称
+ customerAddress: '', // 委托方地址
certificationCompany: '', // 证书单位名称
certificationCompanyAddress: '', // 证书单位地址
calibrationPlace: '', // 检校地点
- fjsj: '', // 复校时间
- jssj: '', // 接收时间
- jdjg: '', // 检定结果
+ repeatTime: '', // 复校时间
+ deliverTime: '', // 接收时间
+ measureResult: '', // 检定结果
environmentCode: '', // 环境记录单编号
environmentId: '', // 环境记录单id
temperature: '', // 温度
humidity: '', // 湿度
+ techFilesName: '', // 依据的技术文件名称
signId: '', // 电子签章id
signName: '', // 电子签章名称
approvalSignIds: '', // 认可标志专用章id
approvalSignName: '', // 认可标志专用章名称
remark: '', // 备注
- ywy: '', // 业务员
+ busPersonId: '', // 业务员id
+ busPersonName: '', // 业务员名字
templateId: '', // 证书模板
templateName: '', // 证书模板
- templateNameFile: '', // 证书模板文件
certificateReportFile: '', // 证书报告附件
})
// 校验规则
const formRules = ref({
- yzs: [{ required: true, message: '原证书必填', trigger: ['blur', 'change'] }],
+ oldCertificateCode: [{ required: true, message: '原证书必填', trigger: ['blur', 'change'] }],
calibrationMajor: [{ required: true, message: '检校专业必填', trigger: ['blur', 'change'] }],
- certifications: [{ required: true, message: '证书类别必填', trigger: ['blur', 'change'] }],
+ certificateReportCategory: [{ required: true, message: '证书类别必填', trigger: ['blur', 'change'] }],
certificateReportName: [{ required: true, message: '证书名称必填', trigger: ['blur', 'change'] }],
customerName: [{ required: true, message: '委托方名称必填', trigger: ['blur', 'change'] }],
+ customerAddress: [{ required: true, message: '委托方地址必填', trigger: ['blur', 'change'] }],
certificationCompany: [{ required: true, message: '证书单位名称必填', trigger: ['blur', 'change'] }],
certificationCompanyAddress: [{ required: true, message: '证书单位地址必填', trigger: ['blur', 'change'] }],
calibrationPlace: [{ required: true, message: '检校地点必填', trigger: ['blur', 'change'] }],
- jdy: [{ required: true, message: '检定员必填', trigger: ['blur', 'change'] }],
- jjrq: [{ required: true, message: '检校日期必填', trigger: ['blur', 'change'] }],
- fjsj: [{ required: true, message: '复校时间必填', trigger: ['blur', 'change'] }],
- jssj: [{ required: true, message: '接收时间必填', trigger: ['blur', 'change'] }],
- jdjg: [{ required: true, message: '检定结果必填', trigger: ['blur', 'change'] }],
+ measurePersonId: [{ required: true, message: '检定员必填', trigger: ['blur', 'change'] }],
+ calibrationTime: [{ required: true, message: '检校日期必填', trigger: ['blur', 'change'] }],
+ repeatTime: [{ required: true, message: '复校时间必填', trigger: ['blur', 'change'] }],
+ deliverTime: [{ required: true, message: '接收时间必填', trigger: ['blur', 'change'] }],
+ measureResult: [{ required: true, message: '检定结果必填', trigger: ['blur', 'change'] }],
temperature: [
{ required: true, message: '温度必填', trigger: ['blur', 'change'] },
{ pattern: /(^-?\d\d*\.\d*$)|(^-?\d\d*$)|(^-?\.\d\d*$)/, message: '温度只能为数字', trigger: ['blur', 'change'] },
@@ -111,6 +125,7 @@
// ---------------------------------------字典--------------------------------------------
const certificationTypeMap = ref([]) // 证书类别
const calibrationMajorMap = ref([]) // 校检专业
+const userList = ref([]) // 检定员
// 获取字典值
async function getDict() {
// 校检专业
@@ -119,12 +134,22 @@
// 证书类别
const rescertificationType = await getDictByCode('certificationType')
certificationTypeMap.value = rescertificationType.data
+
+ // 获取人员列表
+ getUserList({ offset: 1, limit: 99999 }).then((res) => {
+ userList.value = res.data.rows
+ })
}
getDict()
// -------------------------------------原证书--------------------------------------------
+const selectMeasueDataDialogRef = ref() // 选择原证书组件ref
// 点击选择原证书
const selectOrigin = () => {
- //
+ selectMeasueDataDialogRef.value.initDialog()
+}
+// 选好原证书
+const selectMeasueDataConfirm = (val: any) => {
+ getDetail(val.id, val.certificateReportCode)
}
// ------------------------------------委托单------------------------------------------
// 点击选择委托单编号
@@ -142,12 +167,17 @@
form.value.orderCode = val[0].orderCode // 委托单
form.value.customerId = val[0].customerId// 委托方id
form.value.customerName = val[0].customerName// 委托方名称
+ form.value.customerAddress = val[0].customerAddress// 委托方地址
form.value.certificationCompany = val[0].certificationCompany// 证书单位名称
form.value.certificationCompanyAddress = val[0].certificationCompanyAddress// 证书单位地址
+ form.value.certificationCompanyAddress = val[0].certificationCompanyAddress// 证书单位地址
+ form.value.busPersonId = val[0].busPersonId// 业务员id
+ form.value.busPersonName = val[0].busPersonName// 业务员名字
}
}
// -------------------------------选择环境记录单----------------------------------------
+const businessEnvironmentRecord = ref({}) as any // 环境记录单信息
// 选择环境记录单Ref
const environmentalDialog = ref()
// 选择环境记录单
@@ -156,6 +186,7 @@
}
// 选择环境记录单表格确认
const environmentalAdd = (data: any) => {
+ businessEnvironmentRecord.value = data
form.value.environmentId = data.id // 环境记录单id
form.value.environmentCode = data.environmentCode // 环境记录单编号
form.value.temperature = data.temperature // 温度
@@ -200,35 +231,16 @@
}
// -----------------------------------------所依据的技术文件----------------------------------
+const selectTechFilesRef = ref()
+const fileList = ref([]) // 依据的技术文件
// 点击所依据的技术文件
const selectTechFiles = () => {
- //
+ selectTechFilesRef.value.initDialog()
}
-// --------------------------------------证书模板------------------------------------------
-// 选择证书模板Ref
-const templateDialog = ref()
-// 选择证书模板
-const handleClickTemplate = () => {
- templateDialog.value.initDialog()
-}
-// 选择证书模板确认
-const confirmCheckoutTemplate = (val: any) => {
- form.value.templateId = val.id // 证书报告模板id
- form.value.templateName = val.templateName || '' // 证书报告模板名称
- form.value.templateNameFile = val.minioFileName // 证书模板附件
-}
-
-// 点击下载证书模板按钮
-const downloadCertTemplate = () => {
- if (!form.value.templateId) {
- ElMessage.warning('请先选择证书模板')
- return false
- }
- if (!form.value.templateNameFile) {
- ElMessage.warning('选择的证书模板无附件,请检查')
- return false
- }
- downloadFile(form.value.templateNameFile as any, `${form.value.templateName}-${form.value.templateNameFile}`)
+// 选好依据的技术文件
+const selectTechFilesConfirm = (val: any) => {
+ fileList.value = val
+ form.value.techFilesName = val.map((item: { fileName: string }) => item.fileName).join(',')
}
// ---------------------------------文件上传(上传证书)-------------------------------------------
@@ -283,10 +295,10 @@
// 点击批量添加/选择
const addSample = () => {
- if (form.value.orderId) {
- selectOrderSamplesDialogRef.value.initDialog(form.value.orderId)
+ if (form.value.orderId) { // 选择委托单下的样品
+ selectOrderSamplesDialogRef.value.initDialog(form.value.orderId, false)
}
- else {
+ else { // 选择样品库中的样品
selectSamplesDialogRef.value.initDialog()
}
}
@@ -318,7 +330,7 @@
}
// ----------------------------------------------所用的计量标准器具--------------------------------------------
const equipmentVisible = ref(false) // 选择设备对话框显隐
-const equipmentList = ref([])// 表格数据
+const equipmentInfoList = ref([])// 表格数据
const checkoutEquipmentList = ref([])// 多选设备
// 表头
const equipmentColumns = ref([
@@ -328,8 +340,8 @@
{ text: '出厂编号', value: 'manufacturingNo', align: 'center' },
{ text: '测量范围', value: 'mesureRange', align: 'center' },
{ text: '不确定度', value: 'uncertainty', align: 'center' },
- { text: '溯源机构', value: 'syjg', align: 'center' },
- { text: '证书编号', value: 'zsbh', align: 'center' },
+ { text: '溯源机构', value: 'mesureDeptName', align: 'center' },
+ // { text: '证书编号', value: 'zsbh', align: 'center' },
{ text: '有效日期', value: 'validDate', align: 'center' },
])
@@ -351,9 +363,9 @@
const confirmSelectEquipment = (val: any) => {
val.forEach((item: IEquipmentList) => {
// 只添加列表里不存在的
- const index = equipmentList.value.findIndex((i: IEquipmentList) => item.equipmentNo === i.equipmentNo)
+ const index = equipmentInfoList.value.findIndex((i: IEquipmentList) => item.equipmentNo === i.equipmentNo)
if (index === -1) {
- equipmentList.value.push(item)
+ equipmentInfoList.value.push(item)
}
})
}
@@ -365,28 +377,109 @@
return false
}
checkoutEquipmentList.value.forEach((item: IEquipmentList) => {
- equipmentList.value.forEach((element, index) => {
+ equipmentInfoList.value.forEach((element, index) => {
if (element.equipmentNo === item.equipmentNo) {
- equipmentList.value.splice(index, 1)
+ equipmentInfoList.value.splice(index, 1)
}
})
})
}
+
+// --------------------------------------证书模板------------------------------------------
+// 选择证书模板Ref
+const templateDialogRef = ref()
+// 选择证书模板
+const handleClickTemplate = () => {
+ templateDialogRef.value.initDialog()
+}
+// 选择证书模板确认
+const confirmCheckoutTemplate = (val: any) => {
+ form.value.templateId = val.id // 证书报告模板id
+ form.value.templateName = val.templateName || '' // 证书报告模板名称
+}
+
+// 点击下载证书模板按钮
+const downloadCertTemplate = () => {
+ if (!form.value.templateId) {
+ ElMessage.warning('请先选择证书模板')
+ return false
+ }
+ if (!sampleList.value.length) {
+ ElMessage.warning('被检样品不能为空')
+ return false
+ }
+ if (!equipmentInfoList.value.length) {
+ ElMessage.warning('所用的计量标准器具不能为空')
+ return false
+ }
+
+ ruleFormRef.value.validate((valid: boolean) => {
+ if (valid) {
+ const params = solveParams()
+ const loading = ElLoading.service({
+ lock: true,
+ background: 'rgba(255, 255, 255, 0.8)',
+ })
+ downLoadTemplate(params).then((res) => {
+ exportFile(res.data, `${form.value.certificateReportName}.xls`)
+ loading.close()
+ }).catch(() => {
+ loading.close()
+ })
+ }
+ })
+}
+
// -------------------------------------------------------------------------------------------
+// 处理保存、下载模板参数
+function solveParams() {
+ const params = {
+ ...form.value,
+ businessEnvironmentRecord: businessEnvironmentRecord.value, // 环境记录单
+ fileList: fileList.value, // 依据的技术文件
+ equipmentInfoList: equipmentInfoList.value, // 所用的计量标准器具列表/监测设备
+ sampleId: sampleList.value[0].id, // 样品id(打印证书接口要必传)
+ sampleNo: sampleList.value[0].sampleNo, // 样品编号
+ sampleName: sampleList.value[0].sampleName, // 样品名称
+ sampleModel: sampleList.value[0].sampleModel, // 样品型号
+ manufacturingNo: sampleList.value[0].manufacturingNo, // 出厂编号
+ manufacturer: sampleList.value[0].manufacturer, // 生产厂家
+ sampleRemark: sampleList.value[0].remark, // 样品备注
+ id: pageType.value === 'add' ? '' : form.value.id,
+ }
+ return params
+}
// 获取详情信息
-const getDetail = () => {
+function getDetail(id?: string, certificateReportCode?: string) {
const loading = ElLoading.service({
lock: true,
background: 'rgba(255, 255, 255, 0.8)',
})
- detail({ id: $route.params.id as string }).then((res) => {
+ getMeasureDataDetail({ id: infoId.value! || id! }).then((res) => {
loading.close()
form.value = res.data
- form.value.createUserName = res.data.applicantName || user.name
- list.value = res.data.sampleList.filter((item: ISampleList) => {
- return item !== null
- })
+ sampleList.value = [{
+ sampleNo: res.data.sampleNo, // 样品编号
+ sampleName: res.data.sampleNo, // 样品名称
+ sampleModel: res.data.sampleNo, // 型号
+ manufacturingNo: res.data.sampleNo, // 出厂编号
+ manufacturer: res.data.sampleNo, // 生产厂家
+ remark: res.data.sampleRemark, // 备注
+ id: res.data.sampleId,
+ }]
+ equipmentInfoList.value = res.data.equipmentInfoList.map((item: { validDate: string }) => {
+ return {
+ ...item,
+ validDate: item.validDate ? dayjs(item.validDate).format('YYYY-MM-DD') : item.validDate,
+ }
+ }) // 所用的计量标准器具
+ businessEnvironmentRecord.value = res.data.businessEnvironmentRecord // 环境记录单数据
+ form.value.environmentCode = res.data.businessEnvironmentRecord.environmentCode// 环境记录单编号
+ if (id && certificateReportCode) {
+ form.value.oldCertificateCode = certificateReportCode
+ form.value.invalid = 1
+ }
}).catch(() => {
loading.close()
})
@@ -399,10 +492,13 @@
// 保存
const handleSave = () => {
- const tempList = list.value.filter(item => item.sampleNo)
- if (!tempList.length) {
- ElMessage.warning('样品信息不能为空')
- return
+ if (!sampleList.value.length) {
+ ElMessage.warning('被检样品不能为空')
+ return false
+ }
+ if (!equipmentInfoList.value.length) {
+ ElMessage.warning('所用的计量标准器具不能为空')
+ return false
}
ruleFormRef.value.validate((valid: boolean) => {
if (valid) {
@@ -410,32 +506,22 @@
lock: true,
background: 'rgba(255, 255, 255, 0.8)',
})
- // 样品&委托单列表(保存/编辑草稿接口入参使用)
- const temList = [] as any // 临时数组
- console.log('保存中的数组', list.value)
-
- list.value.forEach((item: any) => {
- if ((item.orderId && item.id) || (item.orderId && item.sampleId)) {
- temList.push({
- orderId: item.orderId,
- sampleId: item.id || item.sampleId,
- })
- }
- })
- form.value.orderSampleList = temList
+ const params = solveParams()
if (pageType.value === 'add') { // 新建
- addApply(form.value).then((res) => {
- submitId.value = res.data.id
- form.value.projectNo = res.data.projectNo // 分包项目编号
+ addMeasureData(params).then((res) => {
+ submitId.value = res.data.data.id
+ form.value.certificateReportCode = res.data.data.certificateReportCode
+ form.value.certificateReportName = res.data.data.certificateReportName
ElMessage.success('保存成功')
loading.close()
}).catch(() => {
loading.close()
})
}
+
else if (pageType.value === 'edit') { // 编辑
if (query.approvalStatusName === '未通过-驳回') { // 未通过-驳回
- failUpdateApply(form.value).then((res) => {
+ failUpdateMeasureData(params).then((res) => {
ElMessage.success('保存成功')
loading.close()
close()
@@ -444,7 +530,7 @@
})
}
else { // 草稿箱和已取消
- updateApply(form.value).then((res) => {
+ draftUpdateMeasureData(params).then((res) => {
ElMessage.success('保存成功')
loading.close()
close()
@@ -466,7 +552,7 @@
})
const params = {
id: submitId.value,
- formId: query.formId, // 表单id
+ formId: query.formId as string, // 表单id
}
submit(params).then(() => {
ElMessage.success('提交成功')
@@ -481,39 +567,6 @@
}
}
-const sampleVisible = ref(false)
-const projectVisible = ref(false)
-const isMulti = ref(false)
-const selectIndex = ref(0)
-// 点击选择
-const handleSelect = (index: number, row: ISampleList) => {
- sampleVisible.value = true // 选择设备对话框显隐
- isMulti.value = false // 是否单选, false单选、true表格多选
- selectIndex.value = index
-}
-
-const checkoutList = ref([]) // 选中的行
-
-// 修改委托方对话框显隐
-const changeSampleVisible = (val: boolean) => {
- sampleVisible.value = val
-}
-// 修改项目选择对话框显隐
-const changeProjectVisible = (val: boolean) => {
- projectVisible.value = val
-}
-
-// 删除行
-const delRow = () => {
- checkoutList.value.forEach((item: ISampleList) => {
- list.value.forEach((element, index) => {
- if (element.sampleNo === item.sampleNo) {
- list.value.splice(index, 1)
- }
- })
- })
-}
-
// ------------------------------------------审批-----------------------------------------
const approvalRecordData = ref([]) // 审批流程数据
@@ -573,11 +626,26 @@
// ------------------------------------事件-------------------------------------------------
// 检校专业变化
const changeCalibrationMajor = (val: string) => {
- form.value.certificateReportName = form.value.certificateReportCode + val + form.value.certifications
+ const index = calibrationMajorMap.value.findIndex((item: { value: string }) => item.value === val)
+ if (index !== -1) {
+ form.value.calibrationMajorName = calibrationMajorMap.value[index].name
+ }
+ console.log(form.value.calibrationMajorName)
}
// 证书类别变化
const changeCertifications = (val: string) => {
- form.value.certificateReportName = form.value.certificateReportCode + form.value.calibrationMajor + val
+ const index = certificationTypeMap.value.findIndex((item: { value: string }) => item.value === val)
+ if (index !== -1) {
+ form.value.certificateReportCategoryName = certificationTypeMap.value[index].name
+ }
+ console.log(form.value.certificateReportCategoryName)
+}
+// 选择检定员变化
+const changeMeasurePersonId = (val: string) => {
+ const index = userList.value.findIndex(item => item.id === val)
+ if (index !== -1) {
+ form.value.measurePerson = userList.value[index].name
+ }
}
// -------------------------------------------------------------------------------------
onMounted(async () => {
@@ -593,8 +661,9 @@
// form.value.createUser = user.id // 创建人id
// form.value.createUserName = user.name // 创建人
// form.value.applicantTime = proxy.dayjs().format('YYYY-MM-DD HH:mm:ss') // 申请时间
- form.value.jdy = user.name // 创建人
- form.value.jjrq = proxy.dayjs().format('YYYY-MM-DD') // 检校日期
+ form.value.measurePerson = user.name // 检定员名字
+ form.value.measurePersonId = user.id // 检定员id
+ form.value.calibrationTime = proxy.dayjs().format('YYYY-MM-DD') // 检校日期
}
})
@@ -606,7 +675,7 @@
上传证书
-
+
下载证书模板
@@ -641,25 +710,25 @@
label-width="140"
:rules="formRules"
>
-
+
-
+
替代已生成证书
-
-
+
+
-
+
选择
@@ -684,15 +753,15 @@
v-for="item in calibrationMajorMap"
:key="item.value"
:label="item.name"
- :value="item.name"
+ :value="item.value"
/>
-
+
@@ -720,7 +789,7 @@
/>
-
+
+
+
+
+
@@ -761,6 +841,18 @@
/>
+
+
+
+
+
-
-
+
+ filterable
+ @change="changeMeasurePersonId"
+ >
+
+
-
+
-
-
+
+
-
-
+
+
-
-
+
+
-
+
-
+
confirmSelectSample(val, 'order')" />
confirmSelectSample(val, 'warehouse')" />
+
+
+
+
diff --git a/src/views/business/lab/measureData/measureDataList.vue b/src/views/business/lab/measureData/measureDataList.vue
index 5c011b8..96ffa13 100644
--- a/src/views/business/lab/measureData/measureDataList.vue
+++ b/src/views/business/lab/measureData/measureDataList.vue
@@ -2,16 +2,19 @@
-
+
-
-
-
@@ -369,6 +385,7 @@
is-showmulti-select
@change="changePage"
@multi-select="handleSelectionChange"
+ @handleClickFollowLink="handleClickFollowLink"
>
@@ -483,3 +500,12 @@
+
+
diff --git a/src/views/business/schedule/interchangeReceipt/receiptEdit.vue b/src/views/business/schedule/interchangeReceipt/receiptEdit.vue
index 13ee3ab..877ea57 100644
--- a/src/views/business/schedule/interchangeReceipt/receiptEdit.vue
+++ b/src/views/business/schedule/interchangeReceipt/receiptEdit.vue
@@ -356,7 +356,7 @@
getInterchangeReceiptDetail({ id: infoId.value }).then((res) => {
dataForm.value = res.data // 表单
sampleList.value = res.data.customerSampleList // 样品列表
- dataForm.value.orderId = res.data.customerSampleList[0].orderId // orderId
+ dataForm.value.orderId = res.data.orderId // orderId
minioFileNameAutograph.value = res.data.recieverSignFile // 签名图片
loading.close()
})
diff --git a/src/views/finance/businessSettlement/businessSettlement-interface.ts b/src/views/finance/businessSettlement/businessSettlement-interface.ts
index 13a1a0c..454788f 100644
--- a/src/views/finance/businessSettlement/businessSettlement-interface.ts
+++ b/src/views/finance/businessSettlement/businessSettlement-interface.ts
@@ -4,6 +4,8 @@
customerNo: string // 委托方代码
customerName: string // 委托方名称
deliverer: string // 送样人
+ orderTimeStart: string // 委托日期开始
+ orderTimeEnd: string // 委托日期结束
offset: number
limit: number
}
@@ -14,17 +16,17 @@
orderCode: string // 委托书编号
customerNo: string // 委托方代码
customerName: string // 委托方名称
- deliverer: string // 送样人
- delivererTel: string // 联系方式
+ orderTime: string // 委托日期
sampleCount: string // 样品数量
- isUrgent: string // 是否加急
- createTime: string // 创建时间
- postedPrice: number // 标价(单位分)
- suggestedDiscount: string // 建议折扣-单位%
- suggestedPrice: number // 建议价格-单位分
- extraCharge: number // 附加费用-单位分
- extraChargeIllustration: string // 附加费用说明
- totalSettlement: number // 总计结算费用-单位分
+ sampleWarehouseName: string // 样品库房
+ certWarehouseName: string // 证书库房
+ feeStatus: string // 费用状态
+ received: string // 是否到账
+ actualTestFee: string // 检测费(实)(元)
+ shouldTestFee: string // 检测费(应)(元)
+ actualTotalFee: string // 实收合计(元)
+ receivedAmount: string // 到账金额(元)
+ invoiceAmount: string // 开票金额(元)
}
// 字典
@@ -49,21 +51,22 @@
// 表单
export interface IForm {
orderCode: string // 委托书编号
- orderId: string // 委托书编号
- deliverer: string // 送检人
- delivererTel: string // 送样人联系方式
- createTime: string // 委托单创建时间
- planDeliverTime: string // 预计送达时间
- requireOverTime: string // 要求检完时间
- customerNo: string // 委托方代码
- customerId: string // 委托方id
+ orderId: string // 委托单id
customerName: string // 委托方名称
- phone: string // 委托方电话
- priceFront: number // 标价
- suggestedDiscount: number // 建议折扣
- suggestedPrice: number // 建议价格
- extraCharge: number // 附加费用-单位分
- extraChargeIllustration: string // 附加费用说明
- totalSettlement: number // 总计结算费用
- samplePriceList: Array // 样品清单
+ orderTime: string // 委托日期
+ sampleCount: string // 样品数量
+ certificationCompany: string // 证书单位名称
+ certificationCompanyAddress: string // 证书单位地址
+ deliverer: string // 联系人
+ delivererTel: string // 联系方式
+ sampleWarehouse: string // 样品库房
+ certWarehouse: string // 证书库房
+ feeStatus: string // 费用状态
+ received: string // 是否到账
+ actualTestFee: Number // 检测费(实)(元)
+ shouldTestFee: Number // 检测费(应)(元)
+ actualTotalFee: Number // 实收合计(元)
+ receivedAmount: Number // 到账金额(元)
+ invoiceAmount: Number // 开票金额(元)
+ remark: string // 备注
}
diff --git a/src/views/finance/businessSettlement/edit.vue b/src/views/finance/businessSettlement/edit.vue
index e11f337..7630aeb 100644
--- a/src/views/finance/businessSettlement/edit.vue
+++ b/src/views/finance/businessSettlement/edit.vue
@@ -7,13 +7,18 @@
import { useRoute, useRouter } from 'vue-router'
import { el } from 'element-plus/es/locale'
import type { IForm, IsampleList } from './businessSettlement-interface'
+import multiTable from '@/components/MultiHeaderTable/index.vue'
+import { getDictByCode } from '@/api/system/dict'
+import { UploadFile } from '@/api/measure/file'
+import { calc } from '@/utils/useCalc'
+import type { dictType } from '@/global'
import type { TableColumn } from '@/components/NormalTable/table_interface'
import useUserStore from '@/store/modules/user'
import selectOrder from '@/views/business/schedule/interchangeReceipt/selectOrder.vue'
import type { IOrderList } from '@/views/business/schedule/order/orderList_interface'
import { getOrderDetail } from '@/api/business/schedule/order'
import { isNumber, validateMoney } from '@/utils/validate'
-import { calc } from '@/utils/useCalc'
+import useCheckList from '@/utils/useCheckList'
import { addBusinessSettlement, getBusinessSettlementDetail, updateBusinessSettlement } from '@/api/finance/businessSettlement'
const user = useUserStore() // 用户信息
const $route = useRoute()
@@ -27,54 +32,215 @@
// 表单数据
const form = ref({
orderCode: '', // 委托书编号
- orderId: '', // 委托书编号
- deliverer: '', // 送检人
- delivererTel: '', // 送样人联系方式
- createTime: '', // 委托单创建时间
- planDeliverTime: '', // 预计送达时间
- requireOverTime: '', // 要求检完时间
- customerNo: '', // 委托方代码
- customerId: '', // 委托方id
+ orderId: '', // 委托单id
customerName: '', // 委托方名称
- phone: '', // 委托方电话
- priceFront: 0, // 标价
- suggestedDiscount: 95, // 建议折扣
- suggestedPrice: 0, // 建议价格
- extraCharge: 0, // 附加费用-单位分
- extraChargeIllustration: '', // 附加费用说明
- totalSettlement: 0, // 总计结算费用
- samplePriceList: [], // 样品清单
+ orderTime: '', // 委托日期
+ sampleCount: '', // 样品数量
+ certificationCompany: '', // 证书单位名称
+ certificationCompanyAddress: '', // 证书单位地址
+ deliverer: '', // 联系人
+ delivererTel: '', // 联系方式
+ sampleWarehouse: '未入库', // 样品库房
+ certWarehouse: '未入库', // 证书库房
+ feeStatus: '未录费', // 费用状态
+ received: '未到账', // 是否到账
+ actualTestFee: 0, // 检测费(实)(元)
+ shouldTestFee: 0, // 检测费(应)(元)
+ actualTotalFee: 0, // 实收合计(元)
+ receivedAmount: 0, // 到账金额(元)
+ invoiceAmount: 0, // 开票金额(元)
+ remark: '', // 备注
})
-const ruleFormRef = ref() as any
-const list = ref([])// 表格数据
-const orderVisible = ref(false) // 控制委托书对话框显隐
-
-// 表头
-const columns = ref([
- { text: '样品编号', value: 'sampleNo', align: 'center', width: '170', required: false },
- { text: '样品名称', value: 'sampleName', align: 'center', required: false },
- { text: '型号', value: 'sampleModel', align: 'center', required: false },
- { text: '出厂编号', value: 'manufacturingNo', align: 'center', required: false },
- { text: '检定项目', value: 'measureContent', align: 'center', required: false },
- { text: '标价(元)', value: 'price', align: 'center', required: true, reg: validateMoney },
-])
// 表单校验规则
const rules = reactive({
- orderCode: [{ required: true, message: '委托书编号必填', trigger: 'blur' }],
- price: [{ required: true, message: '标价必填', trigger: ['blur', 'change'] },
- { pattern: /(^-?\d\d*\.\d*$)|(^-?\d\d*$)|(^-?\.\d\d*$)/, message: '标价只能为数字', trigger: ['blur', 'change'] }],
- suggestedDiscount: [{ required: true, message: '建议折扣必填', trigger: ['blur', 'change'] },
- { pattern: /^([0]|[1-9][0-9]*)$/, message: '建议折扣只能为正整数或0', trigger: ['blur', 'change'] }],
- extraCharge: [{ required: true, message: '附加费用必填', trigger: ['blur', 'change'] },
- { pattern: /(^[0-9](\d+)?(\.\d{1,2})?$)|(^\d\.\d{1,2}$)/, message: '要求不小于0,且最多保留两位小数', trigger: ['blur', 'change'] }],
- extraChargeIllustration: [{ required: true, message: '附加费用说明必填', trigger: 'blur' }],
+ orderCode: [{ required: true, message: '委托单编号必填', trigger: 'blur' }],
+ customerName: [{ required: true, message: '委托方名称必填', trigger: 'blur' }],
+ orderTime: [{ required: true, message: '委托日期必填', trigger: 'blur' }],
+ sampleCount: [{ required: true, message: '样品数量必填', trigger: 'blur' }],
+ certificationCompany: [{ required: true, message: '证书单位名称必填', trigger: 'blur' }],
+ certificationCompanyAddress: [{ required: true, message: '证书单位地址必填', trigger: 'blur' }],
+ deliverer: [{ required: true, message: '联系人必填', trigger: 'blur' }],
+ delivererTel: [{ required: true, message: '联系电话必填', trigger: 'blur' }],
+ sampleWarehouse: [{ required: true, message: '样品库房必填', trigger: 'blur' }],
+ certWarehouse: [{ required: true, message: '证书库房必填', trigger: 'blur' }],
+ feeStatus: [{ required: true, message: '费用状态必填', trigger: 'blur' }],
+ received: [{ required: true, message: '是否到账必填', trigger: 'blur' }],
+ actualTestFee: [{ required: true, message: '检测费(实)(元)必填', trigger: 'blur' }],
+ shouldTestFee: [{ required: true, message: '检测费(应)(元)必填', trigger: 'blur' }],
+ actualTotalFee: [{ required: true, message: '实收合计(元)必填', trigger: 'blur' }],
+ receivedAmount: [{ required: true, message: '到账金额(元)必填', trigger: 'blur' }],
+ invoiceAmount: [{ required: true, message: '开票金额(元)必填', trigger: 'blur' }],
})
+const ruleFormRef = ref() as any
+const orderVisible = ref(false) // 控制委托书对话框显隐
// ---------------------------------------路由参数--------------------------------------
if ($route.params && $route.params.type) {
pageType.value = $route.params.type as string
infoId.value = $route.params.id as string
}
+// ---------------------------------------字典--------------------------------------
+
+const financeSampleWarehouseList = ref([]) // 样品库房
+const financeCertWarehouseList = ref([]) // 证书库房
+const financeReceivedList = ref([]) // 是否到账
+// 获取字典值
+function getDict() {
+ // 样品库房
+ getDictByCode('financeSampleWarehouse').then((response) => {
+ financeSampleWarehouseList.value = response.data
+ })
+ // 证书库房
+ getDictByCode('financeCertWarehouse').then((response) => {
+ financeCertWarehouseList.value = response.data
+ })
+ // 是否到账
+ getDictByCode('financeReceived').then((response) => {
+ financeReceivedList.value = response.data
+ })
+}
+getDict()
+// -----------------------------------到账金额明细--------------------------------------------------
+const receivedAmountList = ref([]) as any // 到账金额明细
+const checkoutReceivedAmountList = ref([]) as any // 到账金额明细多选
+// 表头
+const receivedAmountcolumns = ref([
+ { text: '到账金额(元)', value: 'money', align: 'center', width: '220', required: true },
+ { text: '到账时间', value: 'moneyTime', align: 'center', width: '220', required: true },
+ { text: '附件', value: 'attachment', align: 'center', required: false },
+])
+
+// -------------------------------------开票金额明细--------------------------------------------------------------
+const invoiceAmountList = ref([]) as any // 开票金额明细
+const checkoutInvoiceAmountList = ref([]) as any // 开票金额明细多选
+// 表头
+const invoiceAmountcolumns = ref([
+ { text: '开票金额(元)', value: 'money', align: 'center', width: '220', required: true },
+ { text: '开票时间', value: 'moneyTime', align: 'center', width: '220', required: true },
+ { text: '附件', value: 'attachment', align: 'center', required: false },
+])
+
+// 多选发生改变时
+const handleSelectionChange = (e: any, type: 'addReceived' | 'invoiceAmount') => {
+ if (type === 'addReceived') { // 到账金额明细
+ checkoutReceivedAmountList.value = e
+ }
+ else { // 开票金额明细
+ checkoutInvoiceAmountList.value = e
+ }
+}
+
+// 点击增加行
+const addRow = (type: 'addReceived' | 'invoiceAmount') => {
+ if (type === 'addReceived') {
+ if (useCheckList(receivedAmountList.value, receivedAmountcolumns.value, '到账金额明细')) {
+ receivedAmountList.value.push({
+ money: undefined,
+ moneyTime: '',
+ attachment: [],
+ moneyType: '1',
+ })
+ }
+ }
+ else {
+ if (useCheckList(invoiceAmountList.value, invoiceAmountcolumns.value, '开票金额明细')) {
+ invoiceAmountList.value.push({
+ money: undefined,
+ moneyTime: '',
+ attachment: [],
+ moneyType: '2',
+ })
+ }
+ }
+}
+
+// 删除行
+const delRow = (type: 'addReceived' | 'invoiceAmount') => {
+ if ((type === 'addReceived' && checkoutReceivedAmountList.value.length <= 0) || (type === 'invoiceAmount' && checkoutInvoiceAmountList.value.length <= 0)) {
+ ElMessage({
+ message: '请选中要删除的行',
+ type: 'warning',
+ })
+ }
+ else {
+ if (type === 'addReceived') {
+ receivedAmountList.value = receivedAmountList.value.filter(
+ (item: any) => {
+ return !checkoutReceivedAmountList.value.includes(item)
+ },
+ )
+ }
+ else {
+ invoiceAmountList.value = invoiceAmountList.value.filter(
+ (item: any) => {
+ return !checkoutInvoiceAmountList.value.includes(item)
+ },
+ )
+ }
+ }
+}
+
+// ----------------------------------------上传附件----------------------------------------------------
+// 删除附件
+const del = (index: number, row: any) => {
+ row.value.attachment.splice(index, 1)
+}
+
+const fileRef = ref() // 文件上传input
+const onFileChange = (event: any, row?: any, type?: 'receivedAmount' | 'invoiceAmount') => {
+ // 原生上传
+ console.log(event.target.files)
+ const files = event.target.files
+ if (files.length !== 0) {
+ // 创建formdata对象
+ const fd = new FormData()
+ for (var i = 0; i < files.length; i++) {
+ fd.append('multipartFile', files[i])
+ }
+ UploadFile(fd).then((res) => {
+ if (res.code === 200) {
+ res.data.forEach((item: string) => {
+ row.attachment.push({
+ minioFileName: item,
+ })
+ })
+ ElMessage.success('文件上传成功')
+ }
+ else {
+ ElMessage.error(res.message)
+ }
+ })
+ }
+}
+const upload = () => {
+ fileRef.value.click()
+}
+// ------------------------------------结算明细--------------------------------------------------------------------
+const list = ref([]) // 开票金额明细
+// 表头
+const columns = ref([
+ { text: '器具名称', value: 'sampleName', align: 'center', required: true, type: 'text' },
+ { text: '型号规格', value: 'sampleModel', align: 'center', width: '180', required: true, type: 'input' },
+ { text: '套数/退', value: 'sets', align: 'center', required: true, width: '180', type: 'inputNumber' },
+ { text: '出厂编号', value: 'manufacturingNo', align: 'center', width: '180', required: true, type: 'input' },
+ { text: '委托日期', value: 'orderTime', align: 'center', required: true, width: '160', type: 'date' },
+ { text: '检测规范', value: 'accordStandard', align: 'center', width: '180', required: false, type: 'input' },
+ {
+ text: '收费(元)含6%增值税',
+ value: 'price',
+ align: 'center',
+ required: false,
+ children: [
+ { text: '检测费(应)', value: 'shouldTestFee', align: 'center', width: '180', required: true, type: 'inputNumber' },
+ { text: '检测费(实)', value: 'actualTestFee', align: 'center', required: true, width: '180', type: 'inputNumber' },
+ { text: '附加费', value: 'extraFee', align: 'center', required: false, width: '180', type: 'inputNumber' },
+ { text: '修理费', value: 'repairFee', align: 'center', required: false, width: '180', type: 'inputNumber' },
+ { text: '其他费', value: 'otherFee', align: 'center', required: false, width: '180', type: 'inputNumber' },
+ { text: '小计', value: 'subtotal', align: 'center', required: false, type: 'text' },
+ ],
+ },
+])
+
// ------------------------------------委托书---------------------------------------------
// 点击选择委托书编号
const handleClickOrder = () => {
@@ -87,87 +253,63 @@
// 选好委托书
const confirmCheckoutOrder = (val: Array) => {
if (val && val.length) {
- form.value.priceFront = 0 // 标价
- // form.value.suggestedDiscount = 95 // 建议折扣
- form.value.suggestedPrice = 0 // 建议价格
- form.value.extraCharge = 0// 附加费用-单位分
- form.value.extraChargeIllustration = '' // 附加费用说明
- form.value.totalSettlement = 0 // 总计结算费用
getOrderDetail({ id: val[0].id }).then((res) => { // 样品清单
form.value.orderCode = res.data.orderCode // 委托书编号
form.value.orderId = res.data.id // 委托书id
- form.value.deliverer = res.data.deliverer // 送检人
- form.value.delivererTel = res.data.delivererTel // 送检人
- form.value.createTime = res.data.createTime // 委托单创建时间
- form.value.customerNo = res.data.customerNo // 委托方代码
- form.value.customerId = res.data.customerId // 委托方id
form.value.customerName = res.data.customerName // 委托方名称
- form.value.planDeliverTime = res.data.planDeliverTime // 预计送达时间
- form.value.requireOverTime = res.data.requireOverTime // 要求检完时间
- form.value.phone = res.data.customerPhone // 委托方电话
- list.value = res.data.customerSampleInfoList.map((item: { isEdit: boolean }) => {
+ form.value.orderTime = res.data.createTime // 委托日期(委托单创建时间)
+ form.value.certificationCompany = res.data.certificationCompany // 证书单位名称
+ form.value.certificationCompanyAddress = res.data.certificationCompanyAddress // 证书单位地址
+ form.value.deliverer = res.data.deliverer // 联系人
+ form.value.delivererTel = res.data.delivererTel // 联系方式
+ form.value.sampleCount = res.data.customerSampleInfoList.length // 样品数量
+ list.value = res.data.customerSampleInfoList.map((item: { createTime: string; editable: boolean }) => {
return {
...item,
- isEdit: true,
+ orderTime: item.createTime ? dayjs(item.createTime).format('YYYY-MM-DD') : item.createTime, // 委托日期
+ editable: pageType.value !== 'detail',
+ shouldTestFee: 0, // 检测费(应)
+ actualTestFee: 0, // 检测费(实)
+ extraFee: 0, // 附加费
+ repairFee: 0, // 修理费
+ otherFee: 0, // 其他费
+ sets: 0, // 套数
+ subtotal: 0, // 小计
+ id: '',
}
})
})
}
}
-// -----------------------------------------样品清单--------------------------------------------
-// 检查列表
-function checkSampleList() {
- for (let index = 0; index < list.value.length; index++) {
- const item = list.value[index]
- for (const prop of columns.value) {
- // 检查必填
- if (prop.required && !item[prop.value]) {
- ElMessage.warning(`请先完善第${index + 1}行中${prop.text}`)
- return false
- }
- // 验证正则
- if (prop.reg && typeof prop.reg === 'function') {
- if (!prop.reg(item[prop.value])) {
- // ElMessage.warning(`第${index + 1}行中${prop.text}输入不合法`)
- ElMessage.warning(`第${index + 1}行: 要求标价为正数,且最多保留两位小数`)
- return false
- }
- }
- }
- }
- return true
-}
+// --------------------------------------------计算----------------------------------------------
+// 计算
+const handleInputNumberChange = ({ row }: any) => {
+ // 计算小计
+ row.subtotal = calc(Number(calc(Number(calc(Number(calc(Number(row.shouldTestFee), Number(row.actualTestFee), '+')), row.extraFee, '+')), row.repairFee, '+')), row.otherFee, '+')
+ // 计算检测费(应)(元)
+ form.value.shouldTestFee = list.value.reduce((accumulator, current: any) => accumulator + current.shouldTestFee, 0)
+ // 计算检测费(实)(元)
+ form.value.actualTestFee = list.value.reduce((accumulator, current: any) => accumulator + current.actualTestFee, 0)
+ // 实收合计
+ form.value.actualTotalFee = list.value.reduce((accumulator, current: any) => accumulator + current.subtotal, 0)
-// --------------------------------------------自动计算----------------------------------------------
-// 折扣改变-计算建议价格
-const changeSuggestedDiscount = () => {
- console.log('折扣改变')
- if (form.value.priceFront) {
- form.value.suggestedPrice = calc(Number(form.value.priceFront), Number(form.value.suggestedDiscount / 100), '*') as number
- form.value.suggestedPrice = Number(form.value.suggestedPrice.toFixed(2))
+ if (list.value.every((item: { actualTestFee: number }) => item.actualTestFee === 0 || `${item.actualTestFee}` === 'undefined' || `${item.actualTestFee}` === 'null' || `${item.actualTestFee}` === '')) {
+ form.value.feeStatus = '未录费'
+ }
+ else if (list.value.every((item: { actualTestFee: number }) => item.actualTestFee !== 0 || `${item.actualTestFee}` === 'undefined' || `${item.actualTestFee}` === 'null' || `${item.actualTestFee}` === '')) {
+ form.value.feeStatus = '已录费'
+ }
+ else {
+ form.value.feeStatus = '部分录费'
}
}
-// 标价改变
-const changePrice = () => {
- console.log('标价改变')
- let sum = 0
- list.value.forEach((item) => {
- if (item.price) {
- sum = calc(Number(sum), Number(item.price), '+') as number
- }
- })
- form.value.priceFront = sum
- changeSuggestedDiscount() // 建议价格随之变化
+const changeTableInputNumber = () => {
+ // 到账金额
+ form.value.receivedAmount = receivedAmountList.value.reduce((accumulator: any, current: any) => accumulator + current.money, 0)
+ // 开票金额
+ form.value.invoiceAmount = invoiceAmountList.value.reduce((accumulator: any, current: any) => accumulator + current.money, 0)
}
-// 附加费用改变
-const changeExtraCharge = () => {
- console.log('附加费用改变')
- form.value.totalSettlement = calc(Number(form.value.suggestedPrice), Number(form.value.extraCharge), '+') as number
-}
-watch(() => form.value.suggestedPrice, (newValue) => {
- changeExtraCharge()
-})
// ----------------------------------------------------------------------------------------
const $router = useRouter()
@@ -176,9 +318,35 @@
$router.back()
}
+// 校验表格
+const checkList = () => {
+ if (!receivedAmountList.value.length) {
+ ElMessage.warning('到账金额明细不能为空')
+ return false
+ }
+ if (!invoiceAmountList.value.length) {
+ ElMessage.warning('开票金额明细不能为空')
+ return false
+ }
+ if (!list.value.length) {
+ ElMessage.warning('结算明细不能为空')
+ return false
+ }
+ if (!useCheckList(receivedAmountList.value, receivedAmountcolumns.value, '到账金额明细')) {
+ return false
+ }
+ if (!useCheckList(invoiceAmountList.value, invoiceAmountcolumns.value, '开票金额明细')) {
+ return false
+ }
+ if (!useCheckList(list.value, columns.value, '结算明细')) {
+ return false
+ }
+ return true
+}
+
// 保存
const save = () => {
- if (!checkSampleList()) {
+ if (!checkList()) {
return false
}
ruleFormRef.value.validate((valid: boolean) => {
@@ -188,17 +356,10 @@
background: 'rgba(255, 255, 255, 0.8)',
})
const params = {
- extraCharge: calc(Number(form.value.extraCharge), 100, '*'), // 附加费用-单位分
- extraChargeIllustration: form.value.extraChargeIllustration, // 附加费用说明
id: infoId.value,
- orderId: form.value.orderId, // 委托书id
- suggestedDiscount: form.value.suggestedDiscount, // 建议折扣-单位%
- samplePriceList: list.value.map((item) => {
- return {
- price: calc(Number(item.price), 100, '*'), // 标价-单位分
- relationId: item.relationId, // 样品id
- }
- }), // 样品清单
+ ...form.value,
+ amountDetailsList: receivedAmountList.value.concat(invoiceAmountList.value),
+ sampleList: list.value,
}
// 新建
if (pageType.value === 'add') {
@@ -229,24 +390,22 @@
// 编辑、详情--获取详细信息
const fetchDetail = () => {
+ const loading = ElLoading.service({})
getBusinessSettlementDetail({ id: infoId.value }).then((res) => {
form.value = res.data
- form.value.phone = res.data.customerPhone
- list.value = res.data.sampleList.map((item: { postedPrice: number; id: string }) => {
+ receivedAmountList.value = res.data.amountDetailsList.filter((item: { moneyType: string }) => `${item.moneyType}` === '1')
+ invoiceAmountList.value = res.data.amountDetailsList.filter((item: { moneyType: string }) => `${item.moneyType}` === '2')
+ list.value = res.data.sampleDetailsList.map((item: { editable: boolean; orderTime: string }) => {
return {
...item,
- price: calc(Number(item.postedPrice), 100, '/') as number,
- isEdit: pageType.value === 'edit',
- relationId: item.id,
+ editable: pageType.value !== 'detail',
+ orderTime: item.orderTime ? dayjs(item.orderTime).format('YYYY-MM-DD') : item.orderTime,
}
})
- form.value.priceFront = calc(Number(res.data.postedPrice), 100, '/') as number // 标价
- // form.value.suggestedDiscount = // 建议折扣
- form.value.suggestedPrice = calc(Number(res.data.suggestedPrice), 100, '/') as number// 建议价格
- form.value.extraCharge = calc(Number(res.data.extraCharge), 100, '/') as number// 附加费用-单位分
- // form.value.extraChargeIllustration = // 附加费用说明
- form.value.totalSettlement = calc(Number(res.data.totalSettlement), 100, '/') as number // 总计结算费用
- })
+ form.value.orderTime = res.data.sampleDetailsList[0].orderTime // 委托日期
+ form.value.sampleCount = res.data.sampleDetailsList.length // 样品数量
+ loading.close()
+ }).catch(() => loading.close())
}
onMounted(() => {
@@ -278,10 +437,10 @@
>
-
+
@@ -294,51 +453,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -467,17 +645,26 @@
-
-
+
+
+
+ 增加行
+
+
+ 删除行
+
+
handleSelectionChange(e, 'addReceived')"
>
+
*{{ item.text }}
-
-
-
- {{ scope.row[item.value] }}
+
+
+
+
+ {{ '上传' }}
+
+
+
+ ×
+
+
+
onFileChange(e, scope.row, 'receivedAmount')">
+
+
+
+
+ 增加行
+
+
+ 删除行
+
+
+ handleSelectionChange(e, 'invoiceAmount')"
+ >
+
+
+
+
+ *{{ item.text }}
+
+
+
+
+
+
+
+ {{ '上传' }}
+
+
+
+ ×
+
+
+
onFileChange(e, scope.row, 'receivedAmount')">
+
+
+
+
+
+
+
+
diff --git a/src/views/finance/businessSettlement/list.vue b/src/views/finance/businessSettlement/list.vue
index eea28d8..2852223 100644
--- a/src/views/finance/businessSettlement/list.vue
+++ b/src/views/finance/businessSettlement/list.vue
@@ -2,6 +2,8 @@
diff --git a/src/views/system/tool/fileTemplate/addDDialog.vue b/src/views/system/tool/fileTemplate/addDDialog.vue
index 1ff8ac0..6cba8a4 100644
--- a/src/views/system/tool/fileTemplate/addDDialog.vue
+++ b/src/views/system/tool/fileTemplate/addDDialog.vue
@@ -1,7 +1,7 @@
+
+
+
+
+
+
diff --git a/src/components/MultiHeaderTable/tableColumn.vue b/src/components/MultiHeaderTable/tableColumn.vue
new file mode 100644
index 0000000..2b87285
--- /dev/null
+++ b/src/components/MultiHeaderTable/tableColumn.vue
@@ -0,0 +1,147 @@
+
+
+
+
+
+
+
+
+
+
+ *{{ item.text }}
+
+
+ *{{ item.text }}
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ scope.row[item.value] }}
+
+
+ {{
+ scope.row[item.value]
+ }}
+
+
+
+
+
+
diff --git a/src/components/NormalTable/index.vue b/src/components/NormalTable/index.vue
index e56f775..67092d3 100644
--- a/src/components/NormalTable/index.vue
+++ b/src/components/NormalTable/index.vue
@@ -3,6 +3,7 @@
import { ElTable } from 'element-plus'
import { defineExpose, ref } from 'vue'
import type { TableColumn } from './table_interface'
+import showPhoto from '@/views/system/tool/showPhoto.vue'
// ------------------定义props、 emit-------------------
const props = defineProps({
@@ -212,8 +213,8 @@
{{ scope.row[column.value] }}
{{ column.filter(scope.row) }}
- {{ scope.row }}
-
+
+
diff --git a/src/utils/useCheckList.ts b/src/utils/useCheckList.ts
new file mode 100644
index 0000000..c7782f0
--- /dev/null
+++ b/src/utils/useCheckList.ts
@@ -0,0 +1,73 @@
+import { ElMessage } from 'element-plus'
+// import type { TableColumn } from '@/components/NormalTable/table_interface'
+
+/**
+ * 检查列表
+ * @param list 要检查的表格数据(被依赖项如果满足某个条件就去检查依赖项,否则不检查依赖项)
+ * @param columns // 表头信息
+ * @param tableTitle // 表格名称
+ * @param depend // 依赖项
+ * @param depended // 被依赖项
+ * @param dependedValue // 被依赖项条件
+ * @param requireLength // 要检查的表格数据长度是否大于0
+ */
+export default function useCheckList(list: any, columns: any, tableTitle = '', depend?: string, depended?: string, dependedValue?: number | string, requireLength = false): boolean {
+ for (const prop of columns) {
+ for (let index = 0; index < list.length; index++) {
+ const item = list[index]
+
+ if (depend && depended && item[depended] === dependedValue && !(`${item[prop.value]}`)) { // 被依赖项满足条件时需要检查
+ ElMessage.warning(`请先完善 ${tableTitle} 第${index + 1}行中 ${prop.text} 字段`)
+ return false
+ }
+ else {
+ // 检查必填
+ if (prop.required && (!(`${item[prop.value]}`) || `${item[prop.value]}` === 'null' || `${item[prop.value]}` === 'undefined' || item[prop.value] == undefined)) {
+ if (`${prop.belongStandardEquipment}` === '15') { // 小功率
+ ElMessage.warning(`${tableTitle} 第${index + 1}行中 ${prop.message} ${prop.text} 字段不能为空`)
+ }
+ else {
+ ElMessage.warning(`请先完善 ${tableTitle} 第${index + 1}行中 ${prop.text} 字段`)
+ }
+ return false
+ }
+ }
+
+ // 验证正则
+ if (prop.reg && typeof prop.reg === 'function') {
+ if (prop.value === 'resolution') { // 分辨力特殊处理
+ if (!prop.reg(item[prop.value])) {
+ ElMessage.warning(`${tableTitle} 第${index + 1}行中 ${prop.text} 不能大于1`)
+ return false
+ }
+ }
+ else {
+ if (!prop.reg(item[prop.value])) {
+ if (`${prop.belongStandardEquipment}` === '15') { // 小功率
+ ElMessage.warning(`${tableTitle} 第${index + 1}行中 ${prop.message} ${prop.text} 字段不能为0`)
+ }
+ else if (`${prop.belongStandardEquipment}` === '17') { // S参数
+ ElMessage.warning(`${tableTitle} 第${index + 1}行中 ${prop.text} 仅允许输入数字、字母、特殊字符`)
+ }
+ else {
+ ElMessage.warning(`${tableTitle} 第${index + 1}行中 ${prop.text} 字段输入不合法`)
+ }
+ return false
+ }
+ }
+ }
+
+ if (prop.children && prop.children.length) {
+ if (!useCheckList(list, prop.children, tableTitle, depend, depended, dependedValue)) {
+ return false
+ }
+ }
+ }
+ }
+
+ if (requireLength && !list.length) {
+ ElMessage.warning(`${tableTitle}表格数据不能为空`)
+ return false
+ }
+ return true
+}
diff --git a/src/views/business/lab/components/selectOrderSamplesDialog.vue b/src/views/business/lab/components/selectOrderSamplesDialog.vue
index 4002f83..b004107 100644
--- a/src/views/business/lab/components/selectOrderSamplesDialog.vue
+++ b/src/views/business/lab/components/selectOrderSamplesDialog.vue
@@ -14,6 +14,7 @@
const loadingTable = ref(false) // loading
const list = ref([]) // 表格参数
const tableRef = ref()
+const isMulti = ref(true) // 是否多选默认为多选
const columns = ref
([
{ text: '被测样品名称', value: 'sampleName', align: 'center', required: true },
{ text: '型号规格', value: 'sampleModel', align: 'center', required: true },
@@ -60,9 +61,10 @@
}
// 初始化
-const initDialog = (orderIdParam: string) => {
+const initDialog = (orderIdParam: string, isMultiParam = true) => {
dialogFormVisible.value = true
orderId.value = orderIdParam
+ isMulti.value = isMultiParam
getList()
}
defineExpose({ initDialog })
@@ -78,7 +80,7 @@
:columns="columns"
is-showmulti-select
:list-loading="loadingTable"
- :is-multi="true"
+ :is-multi="isMulti"
:height="300"
:pagination="false"
@multi-select="handleSelectionChange"
diff --git a/src/views/business/lab/components/selectReportTemplate.vue b/src/views/business/lab/components/selectReportTemplate.vue
index 5c59693..ec36ef7 100644
--- a/src/views/business/lab/components/selectReportTemplate.vue
+++ b/src/views/business/lab/components/selectReportTemplate.vue
@@ -7,8 +7,9 @@
import type { typeofSign } from '@/views/system/tool/tool_interface'
import { templatePage } from '@/api/system/tool'
-const emits = defineEmits(['add'])
+const emits = defineEmits(['confirm'])
const dialogFormVisible = ref(false) // 控制弹窗显隐
+const createTime = ref()
// 查询参数
const searchQuery = reactive({
templateNo: '', // 编号
@@ -18,31 +19,43 @@
createEndTime: '',
limit: 5,
offset: 1,
- templateType: '',
+ certificationType: '0',
ids: [] as string[],
}) // 查询参数
const loadingTable = ref(false) // loading
const list = ref([]) // 表格参数
const total = ref(0)
const columns = ref([
- { text: '编号', value: 'templateNo', align: 'center', width: '180' },
- { text: '模板名称', value: 'templateName', align: 'center', width: '150' },
- { text: '模板负责人', value: 'templateCreator', align: 'center', width: '100' },
- { text: '创建时间', value: 'createTime', align: 'center', width: '250' },
- { text: '描述', value: 'templateDesc', align: 'center' },
+ { text: '编号', value: 'templateNo', align: 'center', width: '160' },
+ { text: '模板名称', value: 'templateName', align: 'center' },
+ { text: '模板类型', value: 'templateTypeName', align: 'center', width: '100' },
+ { text: '负责人', value: 'templateCreator', align: 'center', width: '100' },
+ { text: '内容描述', value: 'templateDesc', align: 'center' },
+ { text: '创建时间', value: 'createTime', align: 'center', width: '180' },
])
const checkoutList = ref([]) // 多选选中参数
-// 获取类型
-const getType = async () => {
- const res = await getDictByCode('templateType')
- searchQuery.templateType = res.data.filter((item: typeofSign) => item.name === '证书报告模板')[0].value
+// ---------------------------------------字典--------------------------------------------
+const templateTypeMap = ref([]) as any // 模板类型
+// 获取字典值
+async function getDict() {
+ // 模板类型
+ const res = await getDictByCode('certificationType')
+ res.data.forEach((item: { value: string; name: string }) => {
+ templateTypeMap.value[`${item.value}`] = item.name
+ })
}
+// ----------------------------------------------------------------------------------------------
// 获取数据列表
const getList = () => {
loadingTable.value = true
templatePage(searchQuery).then((res) => {
if (res.code === 200) {
- list.value = res.data.rows
+ list.value = res.data.rows.map((item: { certificationType: string }) => {
+ return {
+ ...item,
+ templateTypeName: `${item.certificationType}` ? templateTypeMap.value[item.certificationType] : item.certificationType, // 模板类型
+ }
+ })
total.value = res.data.total
}
loadingTable.value = false
@@ -74,7 +87,8 @@
searchQuery.createEndTime = ''
searchQuery.limit = 5
searchQuery.offset = 1
- // searchQuery.templateType = '' // 类型不能变
+ searchQuery.certificationType = '0'
+ createTime.value = ''
searchQuery.ids = []
getList()
}
@@ -82,10 +96,10 @@
// 点击保存
const submitForm = () => {
if (!checkoutList.value.length) {
- ElMessage.warning('请选择证书报告模板')
+ ElMessage.warning('请选择证书模板')
}
else {
- emits('add', checkoutList.value[0])
+ emits('confirm', checkoutList.value[0])
dialogFormVisible.value = false
}
}
@@ -103,15 +117,25 @@
// 初始化
const initDialog = () => {
dialogFormVisible.value = true
- getType().then((_) => {
+ getDict().then((_) => {
getList()
})
}
+watch(() => createTime.value, (newVal) => {
+ if (newVal) {
+ searchQuery.createStartTime = newVal[0]
+ searchQuery.createEndTime = newVal[1]
+ }
+ else {
+ searchQuery.createStartTime = ''
+ searchQuery.createEndTime = ''
+ }
+})
defineExpose({ initDialog })
-
+
@@ -121,7 +145,18 @@
-
+
+
+
+
diff --git a/src/views/business/lab/measureData/dialog/selectMeasueDataDialog.vue b/src/views/business/lab/measureData/dialog/selectMeasueDataDialog.vue
new file mode 100644
index 0000000..f8be703
--- /dev/null
+++ b/src/views/business/lab/measureData/dialog/selectMeasueDataDialog.vue
@@ -0,0 +1,199 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ (listQuery.offset - 1) * listQuery.limit + scope.$index + 1 }}
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/views/business/lab/measureData/dialog/selectTechFilesDialog.vue b/src/views/business/lab/measureData/dialog/selectTechFilesDialog.vue
new file mode 100644
index 0000000..f6f1a5a
--- /dev/null
+++ b/src/views/business/lab/measureData/dialog/selectTechFilesDialog.vue
@@ -0,0 +1,247 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ (listQuery.offset - 1) * listQuery.limit + scope.$index + 1 }}
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/views/business/lab/measureData/measureData-interface.ts b/src/views/business/lab/measureData/measureData-interface.ts
index 8319f65..d25a212 100644
--- a/src/views/business/lab/measureData/measureData-interface.ts
+++ b/src/views/business/lab/measureData/measureData-interface.ts
@@ -1,13 +1,14 @@
// 查询条件
export interface IListQuery {
- approvalStatus: string // 审批状态
- certificateReportCode: string // 证书编号
- certificateReportName: string // 证书名称
- customerName: string // 委托方名称
- sampleName: string // 样品名称
- measureCategory: string // 检校类别
- approvalStatusName: string // 审批状态名称
- formId: string
+ approvalStatus: string // 审批状态类型code
+ certificateReportCode: string // 证书编号
+ certificateReportName: string // 证书名称
+ customerName: string // 委托方名称
+ formId: string // 表单id(流程定义对应的表单id,等价于业务id)
+ measureCategory: string // 检校类别
+ orderCode: string // 委托书编号
+ sampleName: string // 样品名称
+ sampleNo: string // 样品编号
offset: number
limit: number
}
@@ -28,47 +29,53 @@
calibrationTime: string // 检校日期
taskId?: string // 任务id 用于审批
decisionItem?: string
- applyApprovalStatusName?: string // 审批状态名称
+ approvalStatusName?: string // 审批状态名称
processId?: string // 流程实例id
}
// 表单
export interface IForm {
- tdysczs: number // 替代已生成证书
+ id?: string
+ invalid: number // 替代已生成证书
formId: string
- yzs: string // 原证书
+ oldCertificateCode: string // 原证书
calibrationMajor: string // 检校专业
- certifications: string // 证书类别
+ calibrationMajorName: string // 检校专业名称
+ certificateReportCategory: string // 证书类别
+ certificateReportCategoryName: string // 证书类别名称
certificateReportCode: string // 证书编号
certificateReportName: string // 证书名称
- jdy: string // 检定员
- jjrq: string // 检校日期
+ measurePerson: string // 检定员
+ measurePersonId: string // 检定员id
+ calibrationTime: string // 检校日期
orderCode: string // 委托书
orderId: string // 委托书id
customerId?: string // 委托放id
customerName: string // 委托方名称
+ customerAddress: string // 委托方地址
certificationCompany: string // 证书单位名称
certificationCompanyAddress: string // 证书单位地址
calibrationPlace: string // 检校地点
- fjsj: string // 复校时间
- jssj: string // 接收时间
- jdjg: string // 检定结果
- environmentCode: string// 环境记录单编号
+ repeatTime: string // 复校时间
+ deliverTime: string // 接收时间
+ measureResult: string // 检定结果
+ environmentCode: string // 环境记录单编号
environmentId: string // 环境记录单id
temperature: string // 温度
humidity: string // 湿度
+ techFilesName: string // 依据的技术文件名称
signId: string // 电子签章id
signName: string // 电子签章名称
approvalSignIds: string // 认可标志专用章id
approvalSignName: string // 认可标志专用章名称
remark: string // 备注
- ywy: string // 业务员
+ busPersonId: string // 业务员id
+ busPersonName: string // 业务员名字
templateId: string // 证书模板
templateName: string // 证书模板
- templateNameFile: string // 证书模板文件
certificateReportFile: string // 证书报告附件
processId?: string // 流程实例id
@@ -76,6 +83,7 @@
// 被检样品
export interface ISampleList {
+ id: string // 样品id
sampleNo: string // 样品编号
sampleName: string // 样品名称
sampleModel: string // 型号
diff --git a/src/views/business/lab/measureData/measureDataDetail.vue b/src/views/business/lab/measureData/measureDataDetail.vue
index 4aa9717..c554c33 100644
--- a/src/views/business/lab/measureData/measureDataDetail.vue
+++ b/src/views/business/lab/measureData/measureDataDetail.vue
@@ -3,6 +3,7 @@
import { ElLoading, ElMessage, ElMessageBox } from 'element-plus'
import type { FormInstance, FormRules } from 'element-plus'
import { ref } from 'vue'
+import dayjs from 'dayjs'
import EnvironmentalDialog from '../components/environmentalDialog.vue'
import selectSignature from '../components/selectSignature.vue'
import selectReportTemplate from '../components/selectReportTemplate.vue'
@@ -10,10 +11,12 @@
import SelectSamplesDialog from '../components/selectSamplesDialog.vue'
import selectMeasureDevice from '../components/selectMeasureDevice.vue'
import type { IEquipmentList, IForm, ISampleList } from './measureData-interface'
+import selectMeasueDataDialog from './dialog/selectMeasueDataDialog.vue'
+import selectTechFilesDialog from './dialog/selectTechFilesDialog.vue'
import { UploadFile } from '@/api/measure/file'
import ApprovalDialog from '@/components/Approval/ApprovalDialog.vue'
import type { TableColumn } from '@/components/NormalTable/table_interface'
-import { addApply, detail, failUpdateApply, submit, updateApply } from '@/api/business/subpackage/apply'
+import { addMeasureData, downLoadTemplate, draftUpdateMeasureData, failUpdateMeasureData, getMeasureDataDetail, submit } from '@/api/business/lab/measureData'
import { cancelApproval, fetchApproval, submitApproval } from '@/api/approval'
import showPhoto from '@/views/system/tool/showPhoto.vue'
import { getDictByCode } from '@/api/system/dict'
@@ -21,6 +24,9 @@
import selectOrder from '@/views/business/schedule/interchangeReceipt/selectOrder.vue'
import { downloadFile } from '@/utils/download'
import type { dictType } from '@/global'
+import { getUserList } from '@/api/system/user'
+import { exportFile } from '@/utils/exportUtils'
+
const user = useUserStore() // 用户信息
const textMap: { [key: string]: string } = {
edit: '编辑',
@@ -31,6 +37,8 @@
const $router = useRouter() // 关闭页面使用
const $route = useRoute()
const query = $route.query
+console.log('opopopop', query)
+
const approvalDialog = ref() // 审批对话ref
const pageType = ref('add') // 页面类型: add, edit, detail
const infoId = ref('') // 列表id
@@ -38,57 +46,63 @@
const orderVisible = ref(false) // 控制委托单对话框显隐
const ruleFormRef = ref() as any
const form = ref({
- tdysczs: 0, // 替代已生成证书
+ invalid: 0, // 替代已生成证书
formId: query.formId as string,
- yzs: '', // 原证书
+ oldCertificateCode: '', // 原证书
calibrationMajor: '', // 检校专业
- certifications: '', // 证书类别
+ calibrationMajorName: '', // 检校专业名称
+ certificateReportCategory: '', // 证书类别
+ certificateReportCategoryName: '', // 证书类别名称
certificateReportCode: '', // 证书编号
certificateReportName: '', // 证书名称
- jdy: '', // 检定员
- jjrq: '', // 检校日期
+ measurePerson: '', // 检定员
+ measurePersonId: '', // 检定员id
+ calibrationTime: '', // 检校日期
- orderCode: '', // 委托单
+ orderCode: '', // 委托单编号
orderId: '', // 委托单id
customerName: '', // 委托方名称
+ customerAddress: '', // 委托方地址
certificationCompany: '', // 证书单位名称
certificationCompanyAddress: '', // 证书单位地址
calibrationPlace: '', // 检校地点
- fjsj: '', // 复校时间
- jssj: '', // 接收时间
- jdjg: '', // 检定结果
+ repeatTime: '', // 复校时间
+ deliverTime: '', // 接收时间
+ measureResult: '', // 检定结果
environmentCode: '', // 环境记录单编号
environmentId: '', // 环境记录单id
temperature: '', // 温度
humidity: '', // 湿度
+ techFilesName: '', // 依据的技术文件名称
signId: '', // 电子签章id
signName: '', // 电子签章名称
approvalSignIds: '', // 认可标志专用章id
approvalSignName: '', // 认可标志专用章名称
remark: '', // 备注
- ywy: '', // 业务员
+ busPersonId: '', // 业务员id
+ busPersonName: '', // 业务员名字
templateId: '', // 证书模板
templateName: '', // 证书模板
- templateNameFile: '', // 证书模板文件
certificateReportFile: '', // 证书报告附件
})
// 校验规则
const formRules = ref({
- yzs: [{ required: true, message: '原证书必填', trigger: ['blur', 'change'] }],
+ oldCertificateCode: [{ required: true, message: '原证书必填', trigger: ['blur', 'change'] }],
calibrationMajor: [{ required: true, message: '检校专业必填', trigger: ['blur', 'change'] }],
- certifications: [{ required: true, message: '证书类别必填', trigger: ['blur', 'change'] }],
+ certificateReportCategory: [{ required: true, message: '证书类别必填', trigger: ['blur', 'change'] }],
certificateReportName: [{ required: true, message: '证书名称必填', trigger: ['blur', 'change'] }],
customerName: [{ required: true, message: '委托方名称必填', trigger: ['blur', 'change'] }],
+ customerAddress: [{ required: true, message: '委托方地址必填', trigger: ['blur', 'change'] }],
certificationCompany: [{ required: true, message: '证书单位名称必填', trigger: ['blur', 'change'] }],
certificationCompanyAddress: [{ required: true, message: '证书单位地址必填', trigger: ['blur', 'change'] }],
calibrationPlace: [{ required: true, message: '检校地点必填', trigger: ['blur', 'change'] }],
- jdy: [{ required: true, message: '检定员必填', trigger: ['blur', 'change'] }],
- jjrq: [{ required: true, message: '检校日期必填', trigger: ['blur', 'change'] }],
- fjsj: [{ required: true, message: '复校时间必填', trigger: ['blur', 'change'] }],
- jssj: [{ required: true, message: '接收时间必填', trigger: ['blur', 'change'] }],
- jdjg: [{ required: true, message: '检定结果必填', trigger: ['blur', 'change'] }],
+ measurePersonId: [{ required: true, message: '检定员必填', trigger: ['blur', 'change'] }],
+ calibrationTime: [{ required: true, message: '检校日期必填', trigger: ['blur', 'change'] }],
+ repeatTime: [{ required: true, message: '复校时间必填', trigger: ['blur', 'change'] }],
+ deliverTime: [{ required: true, message: '接收时间必填', trigger: ['blur', 'change'] }],
+ measureResult: [{ required: true, message: '检定结果必填', trigger: ['blur', 'change'] }],
temperature: [
{ required: true, message: '温度必填', trigger: ['blur', 'change'] },
{ pattern: /(^-?\d\d*\.\d*$)|(^-?\d\d*$)|(^-?\.\d\d*$)/, message: '温度只能为数字', trigger: ['blur', 'change'] },
@@ -111,6 +125,7 @@
// ---------------------------------------字典--------------------------------------------
const certificationTypeMap = ref([]) // 证书类别
const calibrationMajorMap = ref([]) // 校检专业
+const userList = ref([]) // 检定员
// 获取字典值
async function getDict() {
// 校检专业
@@ -119,12 +134,22 @@
// 证书类别
const rescertificationType = await getDictByCode('certificationType')
certificationTypeMap.value = rescertificationType.data
+
+ // 获取人员列表
+ getUserList({ offset: 1, limit: 99999 }).then((res) => {
+ userList.value = res.data.rows
+ })
}
getDict()
// -------------------------------------原证书--------------------------------------------
+const selectMeasueDataDialogRef = ref() // 选择原证书组件ref
// 点击选择原证书
const selectOrigin = () => {
- //
+ selectMeasueDataDialogRef.value.initDialog()
+}
+// 选好原证书
+const selectMeasueDataConfirm = (val: any) => {
+ getDetail(val.id, val.certificateReportCode)
}
// ------------------------------------委托单------------------------------------------
// 点击选择委托单编号
@@ -142,12 +167,17 @@
form.value.orderCode = val[0].orderCode // 委托单
form.value.customerId = val[0].customerId// 委托方id
form.value.customerName = val[0].customerName// 委托方名称
+ form.value.customerAddress = val[0].customerAddress// 委托方地址
form.value.certificationCompany = val[0].certificationCompany// 证书单位名称
form.value.certificationCompanyAddress = val[0].certificationCompanyAddress// 证书单位地址
+ form.value.certificationCompanyAddress = val[0].certificationCompanyAddress// 证书单位地址
+ form.value.busPersonId = val[0].busPersonId// 业务员id
+ form.value.busPersonName = val[0].busPersonName// 业务员名字
}
}
// -------------------------------选择环境记录单----------------------------------------
+const businessEnvironmentRecord = ref({}) as any // 环境记录单信息
// 选择环境记录单Ref
const environmentalDialog = ref()
// 选择环境记录单
@@ -156,6 +186,7 @@
}
// 选择环境记录单表格确认
const environmentalAdd = (data: any) => {
+ businessEnvironmentRecord.value = data
form.value.environmentId = data.id // 环境记录单id
form.value.environmentCode = data.environmentCode // 环境记录单编号
form.value.temperature = data.temperature // 温度
@@ -200,35 +231,16 @@
}
// -----------------------------------------所依据的技术文件----------------------------------
+const selectTechFilesRef = ref()
+const fileList = ref([]) // 依据的技术文件
// 点击所依据的技术文件
const selectTechFiles = () => {
- //
+ selectTechFilesRef.value.initDialog()
}
-// --------------------------------------证书模板------------------------------------------
-// 选择证书模板Ref
-const templateDialog = ref()
-// 选择证书模板
-const handleClickTemplate = () => {
- templateDialog.value.initDialog()
-}
-// 选择证书模板确认
-const confirmCheckoutTemplate = (val: any) => {
- form.value.templateId = val.id // 证书报告模板id
- form.value.templateName = val.templateName || '' // 证书报告模板名称
- form.value.templateNameFile = val.minioFileName // 证书模板附件
-}
-
-// 点击下载证书模板按钮
-const downloadCertTemplate = () => {
- if (!form.value.templateId) {
- ElMessage.warning('请先选择证书模板')
- return false
- }
- if (!form.value.templateNameFile) {
- ElMessage.warning('选择的证书模板无附件,请检查')
- return false
- }
- downloadFile(form.value.templateNameFile as any, `${form.value.templateName}-${form.value.templateNameFile}`)
+// 选好依据的技术文件
+const selectTechFilesConfirm = (val: any) => {
+ fileList.value = val
+ form.value.techFilesName = val.map((item: { fileName: string }) => item.fileName).join(',')
}
// ---------------------------------文件上传(上传证书)-------------------------------------------
@@ -283,10 +295,10 @@
// 点击批量添加/选择
const addSample = () => {
- if (form.value.orderId) {
- selectOrderSamplesDialogRef.value.initDialog(form.value.orderId)
+ if (form.value.orderId) { // 选择委托单下的样品
+ selectOrderSamplesDialogRef.value.initDialog(form.value.orderId, false)
}
- else {
+ else { // 选择样品库中的样品
selectSamplesDialogRef.value.initDialog()
}
}
@@ -318,7 +330,7 @@
}
// ----------------------------------------------所用的计量标准器具--------------------------------------------
const equipmentVisible = ref(false) // 选择设备对话框显隐
-const equipmentList = ref([])// 表格数据
+const equipmentInfoList = ref([])// 表格数据
const checkoutEquipmentList = ref([])// 多选设备
// 表头
const equipmentColumns = ref([
@@ -328,8 +340,8 @@
{ text: '出厂编号', value: 'manufacturingNo', align: 'center' },
{ text: '测量范围', value: 'mesureRange', align: 'center' },
{ text: '不确定度', value: 'uncertainty', align: 'center' },
- { text: '溯源机构', value: 'syjg', align: 'center' },
- { text: '证书编号', value: 'zsbh', align: 'center' },
+ { text: '溯源机构', value: 'mesureDeptName', align: 'center' },
+ // { text: '证书编号', value: 'zsbh', align: 'center' },
{ text: '有效日期', value: 'validDate', align: 'center' },
])
@@ -351,9 +363,9 @@
const confirmSelectEquipment = (val: any) => {
val.forEach((item: IEquipmentList) => {
// 只添加列表里不存在的
- const index = equipmentList.value.findIndex((i: IEquipmentList) => item.equipmentNo === i.equipmentNo)
+ const index = equipmentInfoList.value.findIndex((i: IEquipmentList) => item.equipmentNo === i.equipmentNo)
if (index === -1) {
- equipmentList.value.push(item)
+ equipmentInfoList.value.push(item)
}
})
}
@@ -365,28 +377,109 @@
return false
}
checkoutEquipmentList.value.forEach((item: IEquipmentList) => {
- equipmentList.value.forEach((element, index) => {
+ equipmentInfoList.value.forEach((element, index) => {
if (element.equipmentNo === item.equipmentNo) {
- equipmentList.value.splice(index, 1)
+ equipmentInfoList.value.splice(index, 1)
}
})
})
}
+
+// --------------------------------------证书模板------------------------------------------
+// 选择证书模板Ref
+const templateDialogRef = ref()
+// 选择证书模板
+const handleClickTemplate = () => {
+ templateDialogRef.value.initDialog()
+}
+// 选择证书模板确认
+const confirmCheckoutTemplate = (val: any) => {
+ form.value.templateId = val.id // 证书报告模板id
+ form.value.templateName = val.templateName || '' // 证书报告模板名称
+}
+
+// 点击下载证书模板按钮
+const downloadCertTemplate = () => {
+ if (!form.value.templateId) {
+ ElMessage.warning('请先选择证书模板')
+ return false
+ }
+ if (!sampleList.value.length) {
+ ElMessage.warning('被检样品不能为空')
+ return false
+ }
+ if (!equipmentInfoList.value.length) {
+ ElMessage.warning('所用的计量标准器具不能为空')
+ return false
+ }
+
+ ruleFormRef.value.validate((valid: boolean) => {
+ if (valid) {
+ const params = solveParams()
+ const loading = ElLoading.service({
+ lock: true,
+ background: 'rgba(255, 255, 255, 0.8)',
+ })
+ downLoadTemplate(params).then((res) => {
+ exportFile(res.data, `${form.value.certificateReportName}.xls`)
+ loading.close()
+ }).catch(() => {
+ loading.close()
+ })
+ }
+ })
+}
+
// -------------------------------------------------------------------------------------------
+// 处理保存、下载模板参数
+function solveParams() {
+ const params = {
+ ...form.value,
+ businessEnvironmentRecord: businessEnvironmentRecord.value, // 环境记录单
+ fileList: fileList.value, // 依据的技术文件
+ equipmentInfoList: equipmentInfoList.value, // 所用的计量标准器具列表/监测设备
+ sampleId: sampleList.value[0].id, // 样品id(打印证书接口要必传)
+ sampleNo: sampleList.value[0].sampleNo, // 样品编号
+ sampleName: sampleList.value[0].sampleName, // 样品名称
+ sampleModel: sampleList.value[0].sampleModel, // 样品型号
+ manufacturingNo: sampleList.value[0].manufacturingNo, // 出厂编号
+ manufacturer: sampleList.value[0].manufacturer, // 生产厂家
+ sampleRemark: sampleList.value[0].remark, // 样品备注
+ id: pageType.value === 'add' ? '' : form.value.id,
+ }
+ return params
+}
// 获取详情信息
-const getDetail = () => {
+function getDetail(id?: string, certificateReportCode?: string) {
const loading = ElLoading.service({
lock: true,
background: 'rgba(255, 255, 255, 0.8)',
})
- detail({ id: $route.params.id as string }).then((res) => {
+ getMeasureDataDetail({ id: infoId.value! || id! }).then((res) => {
loading.close()
form.value = res.data
- form.value.createUserName = res.data.applicantName || user.name
- list.value = res.data.sampleList.filter((item: ISampleList) => {
- return item !== null
- })
+ sampleList.value = [{
+ sampleNo: res.data.sampleNo, // 样品编号
+ sampleName: res.data.sampleNo, // 样品名称
+ sampleModel: res.data.sampleNo, // 型号
+ manufacturingNo: res.data.sampleNo, // 出厂编号
+ manufacturer: res.data.sampleNo, // 生产厂家
+ remark: res.data.sampleRemark, // 备注
+ id: res.data.sampleId,
+ }]
+ equipmentInfoList.value = res.data.equipmentInfoList.map((item: { validDate: string }) => {
+ return {
+ ...item,
+ validDate: item.validDate ? dayjs(item.validDate).format('YYYY-MM-DD') : item.validDate,
+ }
+ }) // 所用的计量标准器具
+ businessEnvironmentRecord.value = res.data.businessEnvironmentRecord // 环境记录单数据
+ form.value.environmentCode = res.data.businessEnvironmentRecord.environmentCode// 环境记录单编号
+ if (id && certificateReportCode) {
+ form.value.oldCertificateCode = certificateReportCode
+ form.value.invalid = 1
+ }
}).catch(() => {
loading.close()
})
@@ -399,10 +492,13 @@
// 保存
const handleSave = () => {
- const tempList = list.value.filter(item => item.sampleNo)
- if (!tempList.length) {
- ElMessage.warning('样品信息不能为空')
- return
+ if (!sampleList.value.length) {
+ ElMessage.warning('被检样品不能为空')
+ return false
+ }
+ if (!equipmentInfoList.value.length) {
+ ElMessage.warning('所用的计量标准器具不能为空')
+ return false
}
ruleFormRef.value.validate((valid: boolean) => {
if (valid) {
@@ -410,32 +506,22 @@
lock: true,
background: 'rgba(255, 255, 255, 0.8)',
})
- // 样品&委托单列表(保存/编辑草稿接口入参使用)
- const temList = [] as any // 临时数组
- console.log('保存中的数组', list.value)
-
- list.value.forEach((item: any) => {
- if ((item.orderId && item.id) || (item.orderId && item.sampleId)) {
- temList.push({
- orderId: item.orderId,
- sampleId: item.id || item.sampleId,
- })
- }
- })
- form.value.orderSampleList = temList
+ const params = solveParams()
if (pageType.value === 'add') { // 新建
- addApply(form.value).then((res) => {
- submitId.value = res.data.id
- form.value.projectNo = res.data.projectNo // 分包项目编号
+ addMeasureData(params).then((res) => {
+ submitId.value = res.data.data.id
+ form.value.certificateReportCode = res.data.data.certificateReportCode
+ form.value.certificateReportName = res.data.data.certificateReportName
ElMessage.success('保存成功')
loading.close()
}).catch(() => {
loading.close()
})
}
+
else if (pageType.value === 'edit') { // 编辑
if (query.approvalStatusName === '未通过-驳回') { // 未通过-驳回
- failUpdateApply(form.value).then((res) => {
+ failUpdateMeasureData(params).then((res) => {
ElMessage.success('保存成功')
loading.close()
close()
@@ -444,7 +530,7 @@
})
}
else { // 草稿箱和已取消
- updateApply(form.value).then((res) => {
+ draftUpdateMeasureData(params).then((res) => {
ElMessage.success('保存成功')
loading.close()
close()
@@ -466,7 +552,7 @@
})
const params = {
id: submitId.value,
- formId: query.formId, // 表单id
+ formId: query.formId as string, // 表单id
}
submit(params).then(() => {
ElMessage.success('提交成功')
@@ -481,39 +567,6 @@
}
}
-const sampleVisible = ref(false)
-const projectVisible = ref(false)
-const isMulti = ref(false)
-const selectIndex = ref(0)
-// 点击选择
-const handleSelect = (index: number, row: ISampleList) => {
- sampleVisible.value = true // 选择设备对话框显隐
- isMulti.value = false // 是否单选, false单选、true表格多选
- selectIndex.value = index
-}
-
-const checkoutList = ref([]) // 选中的行
-
-// 修改委托方对话框显隐
-const changeSampleVisible = (val: boolean) => {
- sampleVisible.value = val
-}
-// 修改项目选择对话框显隐
-const changeProjectVisible = (val: boolean) => {
- projectVisible.value = val
-}
-
-// 删除行
-const delRow = () => {
- checkoutList.value.forEach((item: ISampleList) => {
- list.value.forEach((element, index) => {
- if (element.sampleNo === item.sampleNo) {
- list.value.splice(index, 1)
- }
- })
- })
-}
-
// ------------------------------------------审批-----------------------------------------
const approvalRecordData = ref([]) // 审批流程数据
@@ -573,11 +626,26 @@
// ------------------------------------事件-------------------------------------------------
// 检校专业变化
const changeCalibrationMajor = (val: string) => {
- form.value.certificateReportName = form.value.certificateReportCode + val + form.value.certifications
+ const index = calibrationMajorMap.value.findIndex((item: { value: string }) => item.value === val)
+ if (index !== -1) {
+ form.value.calibrationMajorName = calibrationMajorMap.value[index].name
+ }
+ console.log(form.value.calibrationMajorName)
}
// 证书类别变化
const changeCertifications = (val: string) => {
- form.value.certificateReportName = form.value.certificateReportCode + form.value.calibrationMajor + val
+ const index = certificationTypeMap.value.findIndex((item: { value: string }) => item.value === val)
+ if (index !== -1) {
+ form.value.certificateReportCategoryName = certificationTypeMap.value[index].name
+ }
+ console.log(form.value.certificateReportCategoryName)
+}
+// 选择检定员变化
+const changeMeasurePersonId = (val: string) => {
+ const index = userList.value.findIndex(item => item.id === val)
+ if (index !== -1) {
+ form.value.measurePerson = userList.value[index].name
+ }
}
// -------------------------------------------------------------------------------------
onMounted(async () => {
@@ -593,8 +661,9 @@
// form.value.createUser = user.id // 创建人id
// form.value.createUserName = user.name // 创建人
// form.value.applicantTime = proxy.dayjs().format('YYYY-MM-DD HH:mm:ss') // 申请时间
- form.value.jdy = user.name // 创建人
- form.value.jjrq = proxy.dayjs().format('YYYY-MM-DD') // 检校日期
+ form.value.measurePerson = user.name // 检定员名字
+ form.value.measurePersonId = user.id // 检定员id
+ form.value.calibrationTime = proxy.dayjs().format('YYYY-MM-DD') // 检校日期
}
})
@@ -606,7 +675,7 @@
上传证书
-
+
下载证书模板
@@ -641,25 +710,25 @@
label-width="140"
:rules="formRules"
>
-
+
-
+
替代已生成证书
-
-
+
+
-
+
选择
@@ -684,15 +753,15 @@
v-for="item in calibrationMajorMap"
:key="item.value"
:label="item.name"
- :value="item.name"
+ :value="item.value"
/>
-
+
@@ -720,7 +789,7 @@
/>
-
+
+
+
+
+
@@ -761,6 +841,18 @@
/>
+
+
+
+
+
-
-
+
+ filterable
+ @change="changeMeasurePersonId"
+ >
+
+
-
+
-
-
+
+
-
-
+
+
-
-
+
+
-
+
-
+
confirmSelectSample(val, 'order')" />
confirmSelectSample(val, 'warehouse')" />
+
+
+
+
diff --git a/src/views/business/lab/measureData/measureDataList.vue b/src/views/business/lab/measureData/measureDataList.vue
index 5c011b8..96ffa13 100644
--- a/src/views/business/lab/measureData/measureDataList.vue
+++ b/src/views/business/lab/measureData/measureDataList.vue
@@ -2,16 +2,19 @@
-
+
-
-
-
@@ -369,6 +385,7 @@
is-showmulti-select
@change="changePage"
@multi-select="handleSelectionChange"
+ @handleClickFollowLink="handleClickFollowLink"
>
@@ -483,3 +500,12 @@
+
+
diff --git a/src/views/business/schedule/interchangeReceipt/receiptEdit.vue b/src/views/business/schedule/interchangeReceipt/receiptEdit.vue
index 13ee3ab..877ea57 100644
--- a/src/views/business/schedule/interchangeReceipt/receiptEdit.vue
+++ b/src/views/business/schedule/interchangeReceipt/receiptEdit.vue
@@ -356,7 +356,7 @@
getInterchangeReceiptDetail({ id: infoId.value }).then((res) => {
dataForm.value = res.data // 表单
sampleList.value = res.data.customerSampleList // 样品列表
- dataForm.value.orderId = res.data.customerSampleList[0].orderId // orderId
+ dataForm.value.orderId = res.data.orderId // orderId
minioFileNameAutograph.value = res.data.recieverSignFile // 签名图片
loading.close()
})
diff --git a/src/views/finance/businessSettlement/businessSettlement-interface.ts b/src/views/finance/businessSettlement/businessSettlement-interface.ts
index 13a1a0c..454788f 100644
--- a/src/views/finance/businessSettlement/businessSettlement-interface.ts
+++ b/src/views/finance/businessSettlement/businessSettlement-interface.ts
@@ -4,6 +4,8 @@
customerNo: string // 委托方代码
customerName: string // 委托方名称
deliverer: string // 送样人
+ orderTimeStart: string // 委托日期开始
+ orderTimeEnd: string // 委托日期结束
offset: number
limit: number
}
@@ -14,17 +16,17 @@
orderCode: string // 委托书编号
customerNo: string // 委托方代码
customerName: string // 委托方名称
- deliverer: string // 送样人
- delivererTel: string // 联系方式
+ orderTime: string // 委托日期
sampleCount: string // 样品数量
- isUrgent: string // 是否加急
- createTime: string // 创建时间
- postedPrice: number // 标价(单位分)
- suggestedDiscount: string // 建议折扣-单位%
- suggestedPrice: number // 建议价格-单位分
- extraCharge: number // 附加费用-单位分
- extraChargeIllustration: string // 附加费用说明
- totalSettlement: number // 总计结算费用-单位分
+ sampleWarehouseName: string // 样品库房
+ certWarehouseName: string // 证书库房
+ feeStatus: string // 费用状态
+ received: string // 是否到账
+ actualTestFee: string // 检测费(实)(元)
+ shouldTestFee: string // 检测费(应)(元)
+ actualTotalFee: string // 实收合计(元)
+ receivedAmount: string // 到账金额(元)
+ invoiceAmount: string // 开票金额(元)
}
// 字典
@@ -49,21 +51,22 @@
// 表单
export interface IForm {
orderCode: string // 委托书编号
- orderId: string // 委托书编号
- deliverer: string // 送检人
- delivererTel: string // 送样人联系方式
- createTime: string // 委托单创建时间
- planDeliverTime: string // 预计送达时间
- requireOverTime: string // 要求检完时间
- customerNo: string // 委托方代码
- customerId: string // 委托方id
+ orderId: string // 委托单id
customerName: string // 委托方名称
- phone: string // 委托方电话
- priceFront: number // 标价
- suggestedDiscount: number // 建议折扣
- suggestedPrice: number // 建议价格
- extraCharge: number // 附加费用-单位分
- extraChargeIllustration: string // 附加费用说明
- totalSettlement: number // 总计结算费用
- samplePriceList: Array // 样品清单
+ orderTime: string // 委托日期
+ sampleCount: string // 样品数量
+ certificationCompany: string // 证书单位名称
+ certificationCompanyAddress: string // 证书单位地址
+ deliverer: string // 联系人
+ delivererTel: string // 联系方式
+ sampleWarehouse: string // 样品库房
+ certWarehouse: string // 证书库房
+ feeStatus: string // 费用状态
+ received: string // 是否到账
+ actualTestFee: Number // 检测费(实)(元)
+ shouldTestFee: Number // 检测费(应)(元)
+ actualTotalFee: Number // 实收合计(元)
+ receivedAmount: Number // 到账金额(元)
+ invoiceAmount: Number // 开票金额(元)
+ remark: string // 备注
}
diff --git a/src/views/finance/businessSettlement/edit.vue b/src/views/finance/businessSettlement/edit.vue
index e11f337..7630aeb 100644
--- a/src/views/finance/businessSettlement/edit.vue
+++ b/src/views/finance/businessSettlement/edit.vue
@@ -7,13 +7,18 @@
import { useRoute, useRouter } from 'vue-router'
import { el } from 'element-plus/es/locale'
import type { IForm, IsampleList } from './businessSettlement-interface'
+import multiTable from '@/components/MultiHeaderTable/index.vue'
+import { getDictByCode } from '@/api/system/dict'
+import { UploadFile } from '@/api/measure/file'
+import { calc } from '@/utils/useCalc'
+import type { dictType } from '@/global'
import type { TableColumn } from '@/components/NormalTable/table_interface'
import useUserStore from '@/store/modules/user'
import selectOrder from '@/views/business/schedule/interchangeReceipt/selectOrder.vue'
import type { IOrderList } from '@/views/business/schedule/order/orderList_interface'
import { getOrderDetail } from '@/api/business/schedule/order'
import { isNumber, validateMoney } from '@/utils/validate'
-import { calc } from '@/utils/useCalc'
+import useCheckList from '@/utils/useCheckList'
import { addBusinessSettlement, getBusinessSettlementDetail, updateBusinessSettlement } from '@/api/finance/businessSettlement'
const user = useUserStore() // 用户信息
const $route = useRoute()
@@ -27,54 +32,215 @@
// 表单数据
const form = ref({
orderCode: '', // 委托书编号
- orderId: '', // 委托书编号
- deliverer: '', // 送检人
- delivererTel: '', // 送样人联系方式
- createTime: '', // 委托单创建时间
- planDeliverTime: '', // 预计送达时间
- requireOverTime: '', // 要求检完时间
- customerNo: '', // 委托方代码
- customerId: '', // 委托方id
+ orderId: '', // 委托单id
customerName: '', // 委托方名称
- phone: '', // 委托方电话
- priceFront: 0, // 标价
- suggestedDiscount: 95, // 建议折扣
- suggestedPrice: 0, // 建议价格
- extraCharge: 0, // 附加费用-单位分
- extraChargeIllustration: '', // 附加费用说明
- totalSettlement: 0, // 总计结算费用
- samplePriceList: [], // 样品清单
+ orderTime: '', // 委托日期
+ sampleCount: '', // 样品数量
+ certificationCompany: '', // 证书单位名称
+ certificationCompanyAddress: '', // 证书单位地址
+ deliverer: '', // 联系人
+ delivererTel: '', // 联系方式
+ sampleWarehouse: '未入库', // 样品库房
+ certWarehouse: '未入库', // 证书库房
+ feeStatus: '未录费', // 费用状态
+ received: '未到账', // 是否到账
+ actualTestFee: 0, // 检测费(实)(元)
+ shouldTestFee: 0, // 检测费(应)(元)
+ actualTotalFee: 0, // 实收合计(元)
+ receivedAmount: 0, // 到账金额(元)
+ invoiceAmount: 0, // 开票金额(元)
+ remark: '', // 备注
})
-const ruleFormRef = ref() as any
-const list = ref([])// 表格数据
-const orderVisible = ref(false) // 控制委托书对话框显隐
-
-// 表头
-const columns = ref([
- { text: '样品编号', value: 'sampleNo', align: 'center', width: '170', required: false },
- { text: '样品名称', value: 'sampleName', align: 'center', required: false },
- { text: '型号', value: 'sampleModel', align: 'center', required: false },
- { text: '出厂编号', value: 'manufacturingNo', align: 'center', required: false },
- { text: '检定项目', value: 'measureContent', align: 'center', required: false },
- { text: '标价(元)', value: 'price', align: 'center', required: true, reg: validateMoney },
-])
// 表单校验规则
const rules = reactive({
- orderCode: [{ required: true, message: '委托书编号必填', trigger: 'blur' }],
- price: [{ required: true, message: '标价必填', trigger: ['blur', 'change'] },
- { pattern: /(^-?\d\d*\.\d*$)|(^-?\d\d*$)|(^-?\.\d\d*$)/, message: '标价只能为数字', trigger: ['blur', 'change'] }],
- suggestedDiscount: [{ required: true, message: '建议折扣必填', trigger: ['blur', 'change'] },
- { pattern: /^([0]|[1-9][0-9]*)$/, message: '建议折扣只能为正整数或0', trigger: ['blur', 'change'] }],
- extraCharge: [{ required: true, message: '附加费用必填', trigger: ['blur', 'change'] },
- { pattern: /(^[0-9](\d+)?(\.\d{1,2})?$)|(^\d\.\d{1,2}$)/, message: '要求不小于0,且最多保留两位小数', trigger: ['blur', 'change'] }],
- extraChargeIllustration: [{ required: true, message: '附加费用说明必填', trigger: 'blur' }],
+ orderCode: [{ required: true, message: '委托单编号必填', trigger: 'blur' }],
+ customerName: [{ required: true, message: '委托方名称必填', trigger: 'blur' }],
+ orderTime: [{ required: true, message: '委托日期必填', trigger: 'blur' }],
+ sampleCount: [{ required: true, message: '样品数量必填', trigger: 'blur' }],
+ certificationCompany: [{ required: true, message: '证书单位名称必填', trigger: 'blur' }],
+ certificationCompanyAddress: [{ required: true, message: '证书单位地址必填', trigger: 'blur' }],
+ deliverer: [{ required: true, message: '联系人必填', trigger: 'blur' }],
+ delivererTel: [{ required: true, message: '联系电话必填', trigger: 'blur' }],
+ sampleWarehouse: [{ required: true, message: '样品库房必填', trigger: 'blur' }],
+ certWarehouse: [{ required: true, message: '证书库房必填', trigger: 'blur' }],
+ feeStatus: [{ required: true, message: '费用状态必填', trigger: 'blur' }],
+ received: [{ required: true, message: '是否到账必填', trigger: 'blur' }],
+ actualTestFee: [{ required: true, message: '检测费(实)(元)必填', trigger: 'blur' }],
+ shouldTestFee: [{ required: true, message: '检测费(应)(元)必填', trigger: 'blur' }],
+ actualTotalFee: [{ required: true, message: '实收合计(元)必填', trigger: 'blur' }],
+ receivedAmount: [{ required: true, message: '到账金额(元)必填', trigger: 'blur' }],
+ invoiceAmount: [{ required: true, message: '开票金额(元)必填', trigger: 'blur' }],
})
+const ruleFormRef = ref() as any
+const orderVisible = ref(false) // 控制委托书对话框显隐
// ---------------------------------------路由参数--------------------------------------
if ($route.params && $route.params.type) {
pageType.value = $route.params.type as string
infoId.value = $route.params.id as string
}
+// ---------------------------------------字典--------------------------------------
+
+const financeSampleWarehouseList = ref([]) // 样品库房
+const financeCertWarehouseList = ref([]) // 证书库房
+const financeReceivedList = ref([]) // 是否到账
+// 获取字典值
+function getDict() {
+ // 样品库房
+ getDictByCode('financeSampleWarehouse').then((response) => {
+ financeSampleWarehouseList.value = response.data
+ })
+ // 证书库房
+ getDictByCode('financeCertWarehouse').then((response) => {
+ financeCertWarehouseList.value = response.data
+ })
+ // 是否到账
+ getDictByCode('financeReceived').then((response) => {
+ financeReceivedList.value = response.data
+ })
+}
+getDict()
+// -----------------------------------到账金额明细--------------------------------------------------
+const receivedAmountList = ref([]) as any // 到账金额明细
+const checkoutReceivedAmountList = ref([]) as any // 到账金额明细多选
+// 表头
+const receivedAmountcolumns = ref([
+ { text: '到账金额(元)', value: 'money', align: 'center', width: '220', required: true },
+ { text: '到账时间', value: 'moneyTime', align: 'center', width: '220', required: true },
+ { text: '附件', value: 'attachment', align: 'center', required: false },
+])
+
+// -------------------------------------开票金额明细--------------------------------------------------------------
+const invoiceAmountList = ref([]) as any // 开票金额明细
+const checkoutInvoiceAmountList = ref([]) as any // 开票金额明细多选
+// 表头
+const invoiceAmountcolumns = ref([
+ { text: '开票金额(元)', value: 'money', align: 'center', width: '220', required: true },
+ { text: '开票时间', value: 'moneyTime', align: 'center', width: '220', required: true },
+ { text: '附件', value: 'attachment', align: 'center', required: false },
+])
+
+// 多选发生改变时
+const handleSelectionChange = (e: any, type: 'addReceived' | 'invoiceAmount') => {
+ if (type === 'addReceived') { // 到账金额明细
+ checkoutReceivedAmountList.value = e
+ }
+ else { // 开票金额明细
+ checkoutInvoiceAmountList.value = e
+ }
+}
+
+// 点击增加行
+const addRow = (type: 'addReceived' | 'invoiceAmount') => {
+ if (type === 'addReceived') {
+ if (useCheckList(receivedAmountList.value, receivedAmountcolumns.value, '到账金额明细')) {
+ receivedAmountList.value.push({
+ money: undefined,
+ moneyTime: '',
+ attachment: [],
+ moneyType: '1',
+ })
+ }
+ }
+ else {
+ if (useCheckList(invoiceAmountList.value, invoiceAmountcolumns.value, '开票金额明细')) {
+ invoiceAmountList.value.push({
+ money: undefined,
+ moneyTime: '',
+ attachment: [],
+ moneyType: '2',
+ })
+ }
+ }
+}
+
+// 删除行
+const delRow = (type: 'addReceived' | 'invoiceAmount') => {
+ if ((type === 'addReceived' && checkoutReceivedAmountList.value.length <= 0) || (type === 'invoiceAmount' && checkoutInvoiceAmountList.value.length <= 0)) {
+ ElMessage({
+ message: '请选中要删除的行',
+ type: 'warning',
+ })
+ }
+ else {
+ if (type === 'addReceived') {
+ receivedAmountList.value = receivedAmountList.value.filter(
+ (item: any) => {
+ return !checkoutReceivedAmountList.value.includes(item)
+ },
+ )
+ }
+ else {
+ invoiceAmountList.value = invoiceAmountList.value.filter(
+ (item: any) => {
+ return !checkoutInvoiceAmountList.value.includes(item)
+ },
+ )
+ }
+ }
+}
+
+// ----------------------------------------上传附件----------------------------------------------------
+// 删除附件
+const del = (index: number, row: any) => {
+ row.value.attachment.splice(index, 1)
+}
+
+const fileRef = ref() // 文件上传input
+const onFileChange = (event: any, row?: any, type?: 'receivedAmount' | 'invoiceAmount') => {
+ // 原生上传
+ console.log(event.target.files)
+ const files = event.target.files
+ if (files.length !== 0) {
+ // 创建formdata对象
+ const fd = new FormData()
+ for (var i = 0; i < files.length; i++) {
+ fd.append('multipartFile', files[i])
+ }
+ UploadFile(fd).then((res) => {
+ if (res.code === 200) {
+ res.data.forEach((item: string) => {
+ row.attachment.push({
+ minioFileName: item,
+ })
+ })
+ ElMessage.success('文件上传成功')
+ }
+ else {
+ ElMessage.error(res.message)
+ }
+ })
+ }
+}
+const upload = () => {
+ fileRef.value.click()
+}
+// ------------------------------------结算明细--------------------------------------------------------------------
+const list = ref([]) // 开票金额明细
+// 表头
+const columns = ref([
+ { text: '器具名称', value: 'sampleName', align: 'center', required: true, type: 'text' },
+ { text: '型号规格', value: 'sampleModel', align: 'center', width: '180', required: true, type: 'input' },
+ { text: '套数/退', value: 'sets', align: 'center', required: true, width: '180', type: 'inputNumber' },
+ { text: '出厂编号', value: 'manufacturingNo', align: 'center', width: '180', required: true, type: 'input' },
+ { text: '委托日期', value: 'orderTime', align: 'center', required: true, width: '160', type: 'date' },
+ { text: '检测规范', value: 'accordStandard', align: 'center', width: '180', required: false, type: 'input' },
+ {
+ text: '收费(元)含6%增值税',
+ value: 'price',
+ align: 'center',
+ required: false,
+ children: [
+ { text: '检测费(应)', value: 'shouldTestFee', align: 'center', width: '180', required: true, type: 'inputNumber' },
+ { text: '检测费(实)', value: 'actualTestFee', align: 'center', required: true, width: '180', type: 'inputNumber' },
+ { text: '附加费', value: 'extraFee', align: 'center', required: false, width: '180', type: 'inputNumber' },
+ { text: '修理费', value: 'repairFee', align: 'center', required: false, width: '180', type: 'inputNumber' },
+ { text: '其他费', value: 'otherFee', align: 'center', required: false, width: '180', type: 'inputNumber' },
+ { text: '小计', value: 'subtotal', align: 'center', required: false, type: 'text' },
+ ],
+ },
+])
+
// ------------------------------------委托书---------------------------------------------
// 点击选择委托书编号
const handleClickOrder = () => {
@@ -87,87 +253,63 @@
// 选好委托书
const confirmCheckoutOrder = (val: Array) => {
if (val && val.length) {
- form.value.priceFront = 0 // 标价
- // form.value.suggestedDiscount = 95 // 建议折扣
- form.value.suggestedPrice = 0 // 建议价格
- form.value.extraCharge = 0// 附加费用-单位分
- form.value.extraChargeIllustration = '' // 附加费用说明
- form.value.totalSettlement = 0 // 总计结算费用
getOrderDetail({ id: val[0].id }).then((res) => { // 样品清单
form.value.orderCode = res.data.orderCode // 委托书编号
form.value.orderId = res.data.id // 委托书id
- form.value.deliverer = res.data.deliverer // 送检人
- form.value.delivererTel = res.data.delivererTel // 送检人
- form.value.createTime = res.data.createTime // 委托单创建时间
- form.value.customerNo = res.data.customerNo // 委托方代码
- form.value.customerId = res.data.customerId // 委托方id
form.value.customerName = res.data.customerName // 委托方名称
- form.value.planDeliverTime = res.data.planDeliverTime // 预计送达时间
- form.value.requireOverTime = res.data.requireOverTime // 要求检完时间
- form.value.phone = res.data.customerPhone // 委托方电话
- list.value = res.data.customerSampleInfoList.map((item: { isEdit: boolean }) => {
+ form.value.orderTime = res.data.createTime // 委托日期(委托单创建时间)
+ form.value.certificationCompany = res.data.certificationCompany // 证书单位名称
+ form.value.certificationCompanyAddress = res.data.certificationCompanyAddress // 证书单位地址
+ form.value.deliverer = res.data.deliverer // 联系人
+ form.value.delivererTel = res.data.delivererTel // 联系方式
+ form.value.sampleCount = res.data.customerSampleInfoList.length // 样品数量
+ list.value = res.data.customerSampleInfoList.map((item: { createTime: string; editable: boolean }) => {
return {
...item,
- isEdit: true,
+ orderTime: item.createTime ? dayjs(item.createTime).format('YYYY-MM-DD') : item.createTime, // 委托日期
+ editable: pageType.value !== 'detail',
+ shouldTestFee: 0, // 检测费(应)
+ actualTestFee: 0, // 检测费(实)
+ extraFee: 0, // 附加费
+ repairFee: 0, // 修理费
+ otherFee: 0, // 其他费
+ sets: 0, // 套数
+ subtotal: 0, // 小计
+ id: '',
}
})
})
}
}
-// -----------------------------------------样品清单--------------------------------------------
-// 检查列表
-function checkSampleList() {
- for (let index = 0; index < list.value.length; index++) {
- const item = list.value[index]
- for (const prop of columns.value) {
- // 检查必填
- if (prop.required && !item[prop.value]) {
- ElMessage.warning(`请先完善第${index + 1}行中${prop.text}`)
- return false
- }
- // 验证正则
- if (prop.reg && typeof prop.reg === 'function') {
- if (!prop.reg(item[prop.value])) {
- // ElMessage.warning(`第${index + 1}行中${prop.text}输入不合法`)
- ElMessage.warning(`第${index + 1}行: 要求标价为正数,且最多保留两位小数`)
- return false
- }
- }
- }
- }
- return true
-}
+// --------------------------------------------计算----------------------------------------------
+// 计算
+const handleInputNumberChange = ({ row }: any) => {
+ // 计算小计
+ row.subtotal = calc(Number(calc(Number(calc(Number(calc(Number(row.shouldTestFee), Number(row.actualTestFee), '+')), row.extraFee, '+')), row.repairFee, '+')), row.otherFee, '+')
+ // 计算检测费(应)(元)
+ form.value.shouldTestFee = list.value.reduce((accumulator, current: any) => accumulator + current.shouldTestFee, 0)
+ // 计算检测费(实)(元)
+ form.value.actualTestFee = list.value.reduce((accumulator, current: any) => accumulator + current.actualTestFee, 0)
+ // 实收合计
+ form.value.actualTotalFee = list.value.reduce((accumulator, current: any) => accumulator + current.subtotal, 0)
-// --------------------------------------------自动计算----------------------------------------------
-// 折扣改变-计算建议价格
-const changeSuggestedDiscount = () => {
- console.log('折扣改变')
- if (form.value.priceFront) {
- form.value.suggestedPrice = calc(Number(form.value.priceFront), Number(form.value.suggestedDiscount / 100), '*') as number
- form.value.suggestedPrice = Number(form.value.suggestedPrice.toFixed(2))
+ if (list.value.every((item: { actualTestFee: number }) => item.actualTestFee === 0 || `${item.actualTestFee}` === 'undefined' || `${item.actualTestFee}` === 'null' || `${item.actualTestFee}` === '')) {
+ form.value.feeStatus = '未录费'
+ }
+ else if (list.value.every((item: { actualTestFee: number }) => item.actualTestFee !== 0 || `${item.actualTestFee}` === 'undefined' || `${item.actualTestFee}` === 'null' || `${item.actualTestFee}` === '')) {
+ form.value.feeStatus = '已录费'
+ }
+ else {
+ form.value.feeStatus = '部分录费'
}
}
-// 标价改变
-const changePrice = () => {
- console.log('标价改变')
- let sum = 0
- list.value.forEach((item) => {
- if (item.price) {
- sum = calc(Number(sum), Number(item.price), '+') as number
- }
- })
- form.value.priceFront = sum
- changeSuggestedDiscount() // 建议价格随之变化
+const changeTableInputNumber = () => {
+ // 到账金额
+ form.value.receivedAmount = receivedAmountList.value.reduce((accumulator: any, current: any) => accumulator + current.money, 0)
+ // 开票金额
+ form.value.invoiceAmount = invoiceAmountList.value.reduce((accumulator: any, current: any) => accumulator + current.money, 0)
}
-// 附加费用改变
-const changeExtraCharge = () => {
- console.log('附加费用改变')
- form.value.totalSettlement = calc(Number(form.value.suggestedPrice), Number(form.value.extraCharge), '+') as number
-}
-watch(() => form.value.suggestedPrice, (newValue) => {
- changeExtraCharge()
-})
// ----------------------------------------------------------------------------------------
const $router = useRouter()
@@ -176,9 +318,35 @@
$router.back()
}
+// 校验表格
+const checkList = () => {
+ if (!receivedAmountList.value.length) {
+ ElMessage.warning('到账金额明细不能为空')
+ return false
+ }
+ if (!invoiceAmountList.value.length) {
+ ElMessage.warning('开票金额明细不能为空')
+ return false
+ }
+ if (!list.value.length) {
+ ElMessage.warning('结算明细不能为空')
+ return false
+ }
+ if (!useCheckList(receivedAmountList.value, receivedAmountcolumns.value, '到账金额明细')) {
+ return false
+ }
+ if (!useCheckList(invoiceAmountList.value, invoiceAmountcolumns.value, '开票金额明细')) {
+ return false
+ }
+ if (!useCheckList(list.value, columns.value, '结算明细')) {
+ return false
+ }
+ return true
+}
+
// 保存
const save = () => {
- if (!checkSampleList()) {
+ if (!checkList()) {
return false
}
ruleFormRef.value.validate((valid: boolean) => {
@@ -188,17 +356,10 @@
background: 'rgba(255, 255, 255, 0.8)',
})
const params = {
- extraCharge: calc(Number(form.value.extraCharge), 100, '*'), // 附加费用-单位分
- extraChargeIllustration: form.value.extraChargeIllustration, // 附加费用说明
id: infoId.value,
- orderId: form.value.orderId, // 委托书id
- suggestedDiscount: form.value.suggestedDiscount, // 建议折扣-单位%
- samplePriceList: list.value.map((item) => {
- return {
- price: calc(Number(item.price), 100, '*'), // 标价-单位分
- relationId: item.relationId, // 样品id
- }
- }), // 样品清单
+ ...form.value,
+ amountDetailsList: receivedAmountList.value.concat(invoiceAmountList.value),
+ sampleList: list.value,
}
// 新建
if (pageType.value === 'add') {
@@ -229,24 +390,22 @@
// 编辑、详情--获取详细信息
const fetchDetail = () => {
+ const loading = ElLoading.service({})
getBusinessSettlementDetail({ id: infoId.value }).then((res) => {
form.value = res.data
- form.value.phone = res.data.customerPhone
- list.value = res.data.sampleList.map((item: { postedPrice: number; id: string }) => {
+ receivedAmountList.value = res.data.amountDetailsList.filter((item: { moneyType: string }) => `${item.moneyType}` === '1')
+ invoiceAmountList.value = res.data.amountDetailsList.filter((item: { moneyType: string }) => `${item.moneyType}` === '2')
+ list.value = res.data.sampleDetailsList.map((item: { editable: boolean; orderTime: string }) => {
return {
...item,
- price: calc(Number(item.postedPrice), 100, '/') as number,
- isEdit: pageType.value === 'edit',
- relationId: item.id,
+ editable: pageType.value !== 'detail',
+ orderTime: item.orderTime ? dayjs(item.orderTime).format('YYYY-MM-DD') : item.orderTime,
}
})
- form.value.priceFront = calc(Number(res.data.postedPrice), 100, '/') as number // 标价
- // form.value.suggestedDiscount = // 建议折扣
- form.value.suggestedPrice = calc(Number(res.data.suggestedPrice), 100, '/') as number// 建议价格
- form.value.extraCharge = calc(Number(res.data.extraCharge), 100, '/') as number// 附加费用-单位分
- // form.value.extraChargeIllustration = // 附加费用说明
- form.value.totalSettlement = calc(Number(res.data.totalSettlement), 100, '/') as number // 总计结算费用
- })
+ form.value.orderTime = res.data.sampleDetailsList[0].orderTime // 委托日期
+ form.value.sampleCount = res.data.sampleDetailsList.length // 样品数量
+ loading.close()
+ }).catch(() => loading.close())
}
onMounted(() => {
@@ -278,10 +437,10 @@
>
-
+
@@ -294,51 +453,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -467,17 +645,26 @@
-
-
+
+
+
+ 增加行
+
+
+ 删除行
+
+
handleSelectionChange(e, 'addReceived')"
>
+
*{{ item.text }}
-
-
-
- {{ scope.row[item.value] }}
+
+
+
+
+ {{ '上传' }}
+
+
+
+ ×
+
+
+
onFileChange(e, scope.row, 'receivedAmount')">
+
+
+
+
+ 增加行
+
+
+ 删除行
+
+
+ handleSelectionChange(e, 'invoiceAmount')"
+ >
+
+
+
+
+ *{{ item.text }}
+
+
+
+
+
+
+
+ {{ '上传' }}
+
+
+
+ ×
+
+
+
onFileChange(e, scope.row, 'receivedAmount')">
+
+
+
+
+
+
+
+
diff --git a/src/views/finance/businessSettlement/list.vue b/src/views/finance/businessSettlement/list.vue
index eea28d8..2852223 100644
--- a/src/views/finance/businessSettlement/list.vue
+++ b/src/views/finance/businessSettlement/list.vue
@@ -2,6 +2,8 @@
diff --git a/src/views/system/tool/fileTemplate/addDDialog.vue b/src/views/system/tool/fileTemplate/addDDialog.vue
index 1ff8ac0..6cba8a4 100644
--- a/src/views/system/tool/fileTemplate/addDDialog.vue
+++ b/src/views/system/tool/fileTemplate/addDDialog.vue
@@ -1,7 +1,7 @@
+
+
+
+
+
+
diff --git a/src/components/MultiHeaderTable/tableColumn.vue b/src/components/MultiHeaderTable/tableColumn.vue
new file mode 100644
index 0000000..2b87285
--- /dev/null
+++ b/src/components/MultiHeaderTable/tableColumn.vue
@@ -0,0 +1,147 @@
+
+
+
+
+
+
+
+
+
+
+ *{{ item.text }}
+
+
+ *{{ item.text }}
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ scope.row[item.value] }}
+
+
+ {{
+ scope.row[item.value]
+ }}
+
+
+
+
+
+
diff --git a/src/components/NormalTable/index.vue b/src/components/NormalTable/index.vue
index e56f775..67092d3 100644
--- a/src/components/NormalTable/index.vue
+++ b/src/components/NormalTable/index.vue
@@ -3,6 +3,7 @@
import { ElTable } from 'element-plus'
import { defineExpose, ref } from 'vue'
import type { TableColumn } from './table_interface'
+import showPhoto from '@/views/system/tool/showPhoto.vue'
// ------------------定义props、 emit-------------------
const props = defineProps({
@@ -212,8 +213,8 @@
{{ scope.row[column.value] }}
{{ column.filter(scope.row) }}
- {{ scope.row }}
-
+
+
diff --git a/src/utils/useCheckList.ts b/src/utils/useCheckList.ts
new file mode 100644
index 0000000..c7782f0
--- /dev/null
+++ b/src/utils/useCheckList.ts
@@ -0,0 +1,73 @@
+import { ElMessage } from 'element-plus'
+// import type { TableColumn } from '@/components/NormalTable/table_interface'
+
+/**
+ * 检查列表
+ * @param list 要检查的表格数据(被依赖项如果满足某个条件就去检查依赖项,否则不检查依赖项)
+ * @param columns // 表头信息
+ * @param tableTitle // 表格名称
+ * @param depend // 依赖项
+ * @param depended // 被依赖项
+ * @param dependedValue // 被依赖项条件
+ * @param requireLength // 要检查的表格数据长度是否大于0
+ */
+export default function useCheckList(list: any, columns: any, tableTitle = '', depend?: string, depended?: string, dependedValue?: number | string, requireLength = false): boolean {
+ for (const prop of columns) {
+ for (let index = 0; index < list.length; index++) {
+ const item = list[index]
+
+ if (depend && depended && item[depended] === dependedValue && !(`${item[prop.value]}`)) { // 被依赖项满足条件时需要检查
+ ElMessage.warning(`请先完善 ${tableTitle} 第${index + 1}行中 ${prop.text} 字段`)
+ return false
+ }
+ else {
+ // 检查必填
+ if (prop.required && (!(`${item[prop.value]}`) || `${item[prop.value]}` === 'null' || `${item[prop.value]}` === 'undefined' || item[prop.value] == undefined)) {
+ if (`${prop.belongStandardEquipment}` === '15') { // 小功率
+ ElMessage.warning(`${tableTitle} 第${index + 1}行中 ${prop.message} ${prop.text} 字段不能为空`)
+ }
+ else {
+ ElMessage.warning(`请先完善 ${tableTitle} 第${index + 1}行中 ${prop.text} 字段`)
+ }
+ return false
+ }
+ }
+
+ // 验证正则
+ if (prop.reg && typeof prop.reg === 'function') {
+ if (prop.value === 'resolution') { // 分辨力特殊处理
+ if (!prop.reg(item[prop.value])) {
+ ElMessage.warning(`${tableTitle} 第${index + 1}行中 ${prop.text} 不能大于1`)
+ return false
+ }
+ }
+ else {
+ if (!prop.reg(item[prop.value])) {
+ if (`${prop.belongStandardEquipment}` === '15') { // 小功率
+ ElMessage.warning(`${tableTitle} 第${index + 1}行中 ${prop.message} ${prop.text} 字段不能为0`)
+ }
+ else if (`${prop.belongStandardEquipment}` === '17') { // S参数
+ ElMessage.warning(`${tableTitle} 第${index + 1}行中 ${prop.text} 仅允许输入数字、字母、特殊字符`)
+ }
+ else {
+ ElMessage.warning(`${tableTitle} 第${index + 1}行中 ${prop.text} 字段输入不合法`)
+ }
+ return false
+ }
+ }
+ }
+
+ if (prop.children && prop.children.length) {
+ if (!useCheckList(list, prop.children, tableTitle, depend, depended, dependedValue)) {
+ return false
+ }
+ }
+ }
+ }
+
+ if (requireLength && !list.length) {
+ ElMessage.warning(`${tableTitle}表格数据不能为空`)
+ return false
+ }
+ return true
+}
diff --git a/src/views/business/lab/components/selectOrderSamplesDialog.vue b/src/views/business/lab/components/selectOrderSamplesDialog.vue
index 4002f83..b004107 100644
--- a/src/views/business/lab/components/selectOrderSamplesDialog.vue
+++ b/src/views/business/lab/components/selectOrderSamplesDialog.vue
@@ -14,6 +14,7 @@
const loadingTable = ref(false) // loading
const list = ref([]) // 表格参数
const tableRef = ref()
+const isMulti = ref(true) // 是否多选默认为多选
const columns = ref
([
{ text: '被测样品名称', value: 'sampleName', align: 'center', required: true },
{ text: '型号规格', value: 'sampleModel', align: 'center', required: true },
@@ -60,9 +61,10 @@
}
// 初始化
-const initDialog = (orderIdParam: string) => {
+const initDialog = (orderIdParam: string, isMultiParam = true) => {
dialogFormVisible.value = true
orderId.value = orderIdParam
+ isMulti.value = isMultiParam
getList()
}
defineExpose({ initDialog })
@@ -78,7 +80,7 @@
:columns="columns"
is-showmulti-select
:list-loading="loadingTable"
- :is-multi="true"
+ :is-multi="isMulti"
:height="300"
:pagination="false"
@multi-select="handleSelectionChange"
diff --git a/src/views/business/lab/components/selectReportTemplate.vue b/src/views/business/lab/components/selectReportTemplate.vue
index 5c59693..ec36ef7 100644
--- a/src/views/business/lab/components/selectReportTemplate.vue
+++ b/src/views/business/lab/components/selectReportTemplate.vue
@@ -7,8 +7,9 @@
import type { typeofSign } from '@/views/system/tool/tool_interface'
import { templatePage } from '@/api/system/tool'
-const emits = defineEmits(['add'])
+const emits = defineEmits(['confirm'])
const dialogFormVisible = ref(false) // 控制弹窗显隐
+const createTime = ref()
// 查询参数
const searchQuery = reactive({
templateNo: '', // 编号
@@ -18,31 +19,43 @@
createEndTime: '',
limit: 5,
offset: 1,
- templateType: '',
+ certificationType: '0',
ids: [] as string[],
}) // 查询参数
const loadingTable = ref(false) // loading
const list = ref([]) // 表格参数
const total = ref(0)
const columns = ref([
- { text: '编号', value: 'templateNo', align: 'center', width: '180' },
- { text: '模板名称', value: 'templateName', align: 'center', width: '150' },
- { text: '模板负责人', value: 'templateCreator', align: 'center', width: '100' },
- { text: '创建时间', value: 'createTime', align: 'center', width: '250' },
- { text: '描述', value: 'templateDesc', align: 'center' },
+ { text: '编号', value: 'templateNo', align: 'center', width: '160' },
+ { text: '模板名称', value: 'templateName', align: 'center' },
+ { text: '模板类型', value: 'templateTypeName', align: 'center', width: '100' },
+ { text: '负责人', value: 'templateCreator', align: 'center', width: '100' },
+ { text: '内容描述', value: 'templateDesc', align: 'center' },
+ { text: '创建时间', value: 'createTime', align: 'center', width: '180' },
])
const checkoutList = ref([]) // 多选选中参数
-// 获取类型
-const getType = async () => {
- const res = await getDictByCode('templateType')
- searchQuery.templateType = res.data.filter((item: typeofSign) => item.name === '证书报告模板')[0].value
+// ---------------------------------------字典--------------------------------------------
+const templateTypeMap = ref([]) as any // 模板类型
+// 获取字典值
+async function getDict() {
+ // 模板类型
+ const res = await getDictByCode('certificationType')
+ res.data.forEach((item: { value: string; name: string }) => {
+ templateTypeMap.value[`${item.value}`] = item.name
+ })
}
+// ----------------------------------------------------------------------------------------------
// 获取数据列表
const getList = () => {
loadingTable.value = true
templatePage(searchQuery).then((res) => {
if (res.code === 200) {
- list.value = res.data.rows
+ list.value = res.data.rows.map((item: { certificationType: string }) => {
+ return {
+ ...item,
+ templateTypeName: `${item.certificationType}` ? templateTypeMap.value[item.certificationType] : item.certificationType, // 模板类型
+ }
+ })
total.value = res.data.total
}
loadingTable.value = false
@@ -74,7 +87,8 @@
searchQuery.createEndTime = ''
searchQuery.limit = 5
searchQuery.offset = 1
- // searchQuery.templateType = '' // 类型不能变
+ searchQuery.certificationType = '0'
+ createTime.value = ''
searchQuery.ids = []
getList()
}
@@ -82,10 +96,10 @@
// 点击保存
const submitForm = () => {
if (!checkoutList.value.length) {
- ElMessage.warning('请选择证书报告模板')
+ ElMessage.warning('请选择证书模板')
}
else {
- emits('add', checkoutList.value[0])
+ emits('confirm', checkoutList.value[0])
dialogFormVisible.value = false
}
}
@@ -103,15 +117,25 @@
// 初始化
const initDialog = () => {
dialogFormVisible.value = true
- getType().then((_) => {
+ getDict().then((_) => {
getList()
})
}
+watch(() => createTime.value, (newVal) => {
+ if (newVal) {
+ searchQuery.createStartTime = newVal[0]
+ searchQuery.createEndTime = newVal[1]
+ }
+ else {
+ searchQuery.createStartTime = ''
+ searchQuery.createEndTime = ''
+ }
+})
defineExpose({ initDialog })
-
+
@@ -121,7 +145,18 @@
-
+
+
+
+
diff --git a/src/views/business/lab/measureData/dialog/selectMeasueDataDialog.vue b/src/views/business/lab/measureData/dialog/selectMeasueDataDialog.vue
new file mode 100644
index 0000000..f8be703
--- /dev/null
+++ b/src/views/business/lab/measureData/dialog/selectMeasueDataDialog.vue
@@ -0,0 +1,199 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ (listQuery.offset - 1) * listQuery.limit + scope.$index + 1 }}
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/views/business/lab/measureData/dialog/selectTechFilesDialog.vue b/src/views/business/lab/measureData/dialog/selectTechFilesDialog.vue
new file mode 100644
index 0000000..f6f1a5a
--- /dev/null
+++ b/src/views/business/lab/measureData/dialog/selectTechFilesDialog.vue
@@ -0,0 +1,247 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ (listQuery.offset - 1) * listQuery.limit + scope.$index + 1 }}
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/views/business/lab/measureData/measureData-interface.ts b/src/views/business/lab/measureData/measureData-interface.ts
index 8319f65..d25a212 100644
--- a/src/views/business/lab/measureData/measureData-interface.ts
+++ b/src/views/business/lab/measureData/measureData-interface.ts
@@ -1,13 +1,14 @@
// 查询条件
export interface IListQuery {
- approvalStatus: string // 审批状态
- certificateReportCode: string // 证书编号
- certificateReportName: string // 证书名称
- customerName: string // 委托方名称
- sampleName: string // 样品名称
- measureCategory: string // 检校类别
- approvalStatusName: string // 审批状态名称
- formId: string
+ approvalStatus: string // 审批状态类型code
+ certificateReportCode: string // 证书编号
+ certificateReportName: string // 证书名称
+ customerName: string // 委托方名称
+ formId: string // 表单id(流程定义对应的表单id,等价于业务id)
+ measureCategory: string // 检校类别
+ orderCode: string // 委托书编号
+ sampleName: string // 样品名称
+ sampleNo: string // 样品编号
offset: number
limit: number
}
@@ -28,47 +29,53 @@
calibrationTime: string // 检校日期
taskId?: string // 任务id 用于审批
decisionItem?: string
- applyApprovalStatusName?: string // 审批状态名称
+ approvalStatusName?: string // 审批状态名称
processId?: string // 流程实例id
}
// 表单
export interface IForm {
- tdysczs: number // 替代已生成证书
+ id?: string
+ invalid: number // 替代已生成证书
formId: string
- yzs: string // 原证书
+ oldCertificateCode: string // 原证书
calibrationMajor: string // 检校专业
- certifications: string // 证书类别
+ calibrationMajorName: string // 检校专业名称
+ certificateReportCategory: string // 证书类别
+ certificateReportCategoryName: string // 证书类别名称
certificateReportCode: string // 证书编号
certificateReportName: string // 证书名称
- jdy: string // 检定员
- jjrq: string // 检校日期
+ measurePerson: string // 检定员
+ measurePersonId: string // 检定员id
+ calibrationTime: string // 检校日期
orderCode: string // 委托书
orderId: string // 委托书id
customerId?: string // 委托放id
customerName: string // 委托方名称
+ customerAddress: string // 委托方地址
certificationCompany: string // 证书单位名称
certificationCompanyAddress: string // 证书单位地址
calibrationPlace: string // 检校地点
- fjsj: string // 复校时间
- jssj: string // 接收时间
- jdjg: string // 检定结果
- environmentCode: string// 环境记录单编号
+ repeatTime: string // 复校时间
+ deliverTime: string // 接收时间
+ measureResult: string // 检定结果
+ environmentCode: string // 环境记录单编号
environmentId: string // 环境记录单id
temperature: string // 温度
humidity: string // 湿度
+ techFilesName: string // 依据的技术文件名称
signId: string // 电子签章id
signName: string // 电子签章名称
approvalSignIds: string // 认可标志专用章id
approvalSignName: string // 认可标志专用章名称
remark: string // 备注
- ywy: string // 业务员
+ busPersonId: string // 业务员id
+ busPersonName: string // 业务员名字
templateId: string // 证书模板
templateName: string // 证书模板
- templateNameFile: string // 证书模板文件
certificateReportFile: string // 证书报告附件
processId?: string // 流程实例id
@@ -76,6 +83,7 @@
// 被检样品
export interface ISampleList {
+ id: string // 样品id
sampleNo: string // 样品编号
sampleName: string // 样品名称
sampleModel: string // 型号
diff --git a/src/views/business/lab/measureData/measureDataDetail.vue b/src/views/business/lab/measureData/measureDataDetail.vue
index 4aa9717..c554c33 100644
--- a/src/views/business/lab/measureData/measureDataDetail.vue
+++ b/src/views/business/lab/measureData/measureDataDetail.vue
@@ -3,6 +3,7 @@
import { ElLoading, ElMessage, ElMessageBox } from 'element-plus'
import type { FormInstance, FormRules } from 'element-plus'
import { ref } from 'vue'
+import dayjs from 'dayjs'
import EnvironmentalDialog from '../components/environmentalDialog.vue'
import selectSignature from '../components/selectSignature.vue'
import selectReportTemplate from '../components/selectReportTemplate.vue'
@@ -10,10 +11,12 @@
import SelectSamplesDialog from '../components/selectSamplesDialog.vue'
import selectMeasureDevice from '../components/selectMeasureDevice.vue'
import type { IEquipmentList, IForm, ISampleList } from './measureData-interface'
+import selectMeasueDataDialog from './dialog/selectMeasueDataDialog.vue'
+import selectTechFilesDialog from './dialog/selectTechFilesDialog.vue'
import { UploadFile } from '@/api/measure/file'
import ApprovalDialog from '@/components/Approval/ApprovalDialog.vue'
import type { TableColumn } from '@/components/NormalTable/table_interface'
-import { addApply, detail, failUpdateApply, submit, updateApply } from '@/api/business/subpackage/apply'
+import { addMeasureData, downLoadTemplate, draftUpdateMeasureData, failUpdateMeasureData, getMeasureDataDetail, submit } from '@/api/business/lab/measureData'
import { cancelApproval, fetchApproval, submitApproval } from '@/api/approval'
import showPhoto from '@/views/system/tool/showPhoto.vue'
import { getDictByCode } from '@/api/system/dict'
@@ -21,6 +24,9 @@
import selectOrder from '@/views/business/schedule/interchangeReceipt/selectOrder.vue'
import { downloadFile } from '@/utils/download'
import type { dictType } from '@/global'
+import { getUserList } from '@/api/system/user'
+import { exportFile } from '@/utils/exportUtils'
+
const user = useUserStore() // 用户信息
const textMap: { [key: string]: string } = {
edit: '编辑',
@@ -31,6 +37,8 @@
const $router = useRouter() // 关闭页面使用
const $route = useRoute()
const query = $route.query
+console.log('opopopop', query)
+
const approvalDialog = ref() // 审批对话ref
const pageType = ref('add') // 页面类型: add, edit, detail
const infoId = ref('') // 列表id
@@ -38,57 +46,63 @@
const orderVisible = ref(false) // 控制委托单对话框显隐
const ruleFormRef = ref() as any
const form = ref({
- tdysczs: 0, // 替代已生成证书
+ invalid: 0, // 替代已生成证书
formId: query.formId as string,
- yzs: '', // 原证书
+ oldCertificateCode: '', // 原证书
calibrationMajor: '', // 检校专业
- certifications: '', // 证书类别
+ calibrationMajorName: '', // 检校专业名称
+ certificateReportCategory: '', // 证书类别
+ certificateReportCategoryName: '', // 证书类别名称
certificateReportCode: '', // 证书编号
certificateReportName: '', // 证书名称
- jdy: '', // 检定员
- jjrq: '', // 检校日期
+ measurePerson: '', // 检定员
+ measurePersonId: '', // 检定员id
+ calibrationTime: '', // 检校日期
- orderCode: '', // 委托单
+ orderCode: '', // 委托单编号
orderId: '', // 委托单id
customerName: '', // 委托方名称
+ customerAddress: '', // 委托方地址
certificationCompany: '', // 证书单位名称
certificationCompanyAddress: '', // 证书单位地址
calibrationPlace: '', // 检校地点
- fjsj: '', // 复校时间
- jssj: '', // 接收时间
- jdjg: '', // 检定结果
+ repeatTime: '', // 复校时间
+ deliverTime: '', // 接收时间
+ measureResult: '', // 检定结果
environmentCode: '', // 环境记录单编号
environmentId: '', // 环境记录单id
temperature: '', // 温度
humidity: '', // 湿度
+ techFilesName: '', // 依据的技术文件名称
signId: '', // 电子签章id
signName: '', // 电子签章名称
approvalSignIds: '', // 认可标志专用章id
approvalSignName: '', // 认可标志专用章名称
remark: '', // 备注
- ywy: '', // 业务员
+ busPersonId: '', // 业务员id
+ busPersonName: '', // 业务员名字
templateId: '', // 证书模板
templateName: '', // 证书模板
- templateNameFile: '', // 证书模板文件
certificateReportFile: '', // 证书报告附件
})
// 校验规则
const formRules = ref({
- yzs: [{ required: true, message: '原证书必填', trigger: ['blur', 'change'] }],
+ oldCertificateCode: [{ required: true, message: '原证书必填', trigger: ['blur', 'change'] }],
calibrationMajor: [{ required: true, message: '检校专业必填', trigger: ['blur', 'change'] }],
- certifications: [{ required: true, message: '证书类别必填', trigger: ['blur', 'change'] }],
+ certificateReportCategory: [{ required: true, message: '证书类别必填', trigger: ['blur', 'change'] }],
certificateReportName: [{ required: true, message: '证书名称必填', trigger: ['blur', 'change'] }],
customerName: [{ required: true, message: '委托方名称必填', trigger: ['blur', 'change'] }],
+ customerAddress: [{ required: true, message: '委托方地址必填', trigger: ['blur', 'change'] }],
certificationCompany: [{ required: true, message: '证书单位名称必填', trigger: ['blur', 'change'] }],
certificationCompanyAddress: [{ required: true, message: '证书单位地址必填', trigger: ['blur', 'change'] }],
calibrationPlace: [{ required: true, message: '检校地点必填', trigger: ['blur', 'change'] }],
- jdy: [{ required: true, message: '检定员必填', trigger: ['blur', 'change'] }],
- jjrq: [{ required: true, message: '检校日期必填', trigger: ['blur', 'change'] }],
- fjsj: [{ required: true, message: '复校时间必填', trigger: ['blur', 'change'] }],
- jssj: [{ required: true, message: '接收时间必填', trigger: ['blur', 'change'] }],
- jdjg: [{ required: true, message: '检定结果必填', trigger: ['blur', 'change'] }],
+ measurePersonId: [{ required: true, message: '检定员必填', trigger: ['blur', 'change'] }],
+ calibrationTime: [{ required: true, message: '检校日期必填', trigger: ['blur', 'change'] }],
+ repeatTime: [{ required: true, message: '复校时间必填', trigger: ['blur', 'change'] }],
+ deliverTime: [{ required: true, message: '接收时间必填', trigger: ['blur', 'change'] }],
+ measureResult: [{ required: true, message: '检定结果必填', trigger: ['blur', 'change'] }],
temperature: [
{ required: true, message: '温度必填', trigger: ['blur', 'change'] },
{ pattern: /(^-?\d\d*\.\d*$)|(^-?\d\d*$)|(^-?\.\d\d*$)/, message: '温度只能为数字', trigger: ['blur', 'change'] },
@@ -111,6 +125,7 @@
// ---------------------------------------字典--------------------------------------------
const certificationTypeMap = ref([]) // 证书类别
const calibrationMajorMap = ref([]) // 校检专业
+const userList = ref([]) // 检定员
// 获取字典值
async function getDict() {
// 校检专业
@@ -119,12 +134,22 @@
// 证书类别
const rescertificationType = await getDictByCode('certificationType')
certificationTypeMap.value = rescertificationType.data
+
+ // 获取人员列表
+ getUserList({ offset: 1, limit: 99999 }).then((res) => {
+ userList.value = res.data.rows
+ })
}
getDict()
// -------------------------------------原证书--------------------------------------------
+const selectMeasueDataDialogRef = ref() // 选择原证书组件ref
// 点击选择原证书
const selectOrigin = () => {
- //
+ selectMeasueDataDialogRef.value.initDialog()
+}
+// 选好原证书
+const selectMeasueDataConfirm = (val: any) => {
+ getDetail(val.id, val.certificateReportCode)
}
// ------------------------------------委托单------------------------------------------
// 点击选择委托单编号
@@ -142,12 +167,17 @@
form.value.orderCode = val[0].orderCode // 委托单
form.value.customerId = val[0].customerId// 委托方id
form.value.customerName = val[0].customerName// 委托方名称
+ form.value.customerAddress = val[0].customerAddress// 委托方地址
form.value.certificationCompany = val[0].certificationCompany// 证书单位名称
form.value.certificationCompanyAddress = val[0].certificationCompanyAddress// 证书单位地址
+ form.value.certificationCompanyAddress = val[0].certificationCompanyAddress// 证书单位地址
+ form.value.busPersonId = val[0].busPersonId// 业务员id
+ form.value.busPersonName = val[0].busPersonName// 业务员名字
}
}
// -------------------------------选择环境记录单----------------------------------------
+const businessEnvironmentRecord = ref({}) as any // 环境记录单信息
// 选择环境记录单Ref
const environmentalDialog = ref()
// 选择环境记录单
@@ -156,6 +186,7 @@
}
// 选择环境记录单表格确认
const environmentalAdd = (data: any) => {
+ businessEnvironmentRecord.value = data
form.value.environmentId = data.id // 环境记录单id
form.value.environmentCode = data.environmentCode // 环境记录单编号
form.value.temperature = data.temperature // 温度
@@ -200,35 +231,16 @@
}
// -----------------------------------------所依据的技术文件----------------------------------
+const selectTechFilesRef = ref()
+const fileList = ref([]) // 依据的技术文件
// 点击所依据的技术文件
const selectTechFiles = () => {
- //
+ selectTechFilesRef.value.initDialog()
}
-// --------------------------------------证书模板------------------------------------------
-// 选择证书模板Ref
-const templateDialog = ref()
-// 选择证书模板
-const handleClickTemplate = () => {
- templateDialog.value.initDialog()
-}
-// 选择证书模板确认
-const confirmCheckoutTemplate = (val: any) => {
- form.value.templateId = val.id // 证书报告模板id
- form.value.templateName = val.templateName || '' // 证书报告模板名称
- form.value.templateNameFile = val.minioFileName // 证书模板附件
-}
-
-// 点击下载证书模板按钮
-const downloadCertTemplate = () => {
- if (!form.value.templateId) {
- ElMessage.warning('请先选择证书模板')
- return false
- }
- if (!form.value.templateNameFile) {
- ElMessage.warning('选择的证书模板无附件,请检查')
- return false
- }
- downloadFile(form.value.templateNameFile as any, `${form.value.templateName}-${form.value.templateNameFile}`)
+// 选好依据的技术文件
+const selectTechFilesConfirm = (val: any) => {
+ fileList.value = val
+ form.value.techFilesName = val.map((item: { fileName: string }) => item.fileName).join(',')
}
// ---------------------------------文件上传(上传证书)-------------------------------------------
@@ -283,10 +295,10 @@
// 点击批量添加/选择
const addSample = () => {
- if (form.value.orderId) {
- selectOrderSamplesDialogRef.value.initDialog(form.value.orderId)
+ if (form.value.orderId) { // 选择委托单下的样品
+ selectOrderSamplesDialogRef.value.initDialog(form.value.orderId, false)
}
- else {
+ else { // 选择样品库中的样品
selectSamplesDialogRef.value.initDialog()
}
}
@@ -318,7 +330,7 @@
}
// ----------------------------------------------所用的计量标准器具--------------------------------------------
const equipmentVisible = ref(false) // 选择设备对话框显隐
-const equipmentList = ref([])// 表格数据
+const equipmentInfoList = ref([])// 表格数据
const checkoutEquipmentList = ref([])// 多选设备
// 表头
const equipmentColumns = ref([
@@ -328,8 +340,8 @@
{ text: '出厂编号', value: 'manufacturingNo', align: 'center' },
{ text: '测量范围', value: 'mesureRange', align: 'center' },
{ text: '不确定度', value: 'uncertainty', align: 'center' },
- { text: '溯源机构', value: 'syjg', align: 'center' },
- { text: '证书编号', value: 'zsbh', align: 'center' },
+ { text: '溯源机构', value: 'mesureDeptName', align: 'center' },
+ // { text: '证书编号', value: 'zsbh', align: 'center' },
{ text: '有效日期', value: 'validDate', align: 'center' },
])
@@ -351,9 +363,9 @@
const confirmSelectEquipment = (val: any) => {
val.forEach((item: IEquipmentList) => {
// 只添加列表里不存在的
- const index = equipmentList.value.findIndex((i: IEquipmentList) => item.equipmentNo === i.equipmentNo)
+ const index = equipmentInfoList.value.findIndex((i: IEquipmentList) => item.equipmentNo === i.equipmentNo)
if (index === -1) {
- equipmentList.value.push(item)
+ equipmentInfoList.value.push(item)
}
})
}
@@ -365,28 +377,109 @@
return false
}
checkoutEquipmentList.value.forEach((item: IEquipmentList) => {
- equipmentList.value.forEach((element, index) => {
+ equipmentInfoList.value.forEach((element, index) => {
if (element.equipmentNo === item.equipmentNo) {
- equipmentList.value.splice(index, 1)
+ equipmentInfoList.value.splice(index, 1)
}
})
})
}
+
+// --------------------------------------证书模板------------------------------------------
+// 选择证书模板Ref
+const templateDialogRef = ref()
+// 选择证书模板
+const handleClickTemplate = () => {
+ templateDialogRef.value.initDialog()
+}
+// 选择证书模板确认
+const confirmCheckoutTemplate = (val: any) => {
+ form.value.templateId = val.id // 证书报告模板id
+ form.value.templateName = val.templateName || '' // 证书报告模板名称
+}
+
+// 点击下载证书模板按钮
+const downloadCertTemplate = () => {
+ if (!form.value.templateId) {
+ ElMessage.warning('请先选择证书模板')
+ return false
+ }
+ if (!sampleList.value.length) {
+ ElMessage.warning('被检样品不能为空')
+ return false
+ }
+ if (!equipmentInfoList.value.length) {
+ ElMessage.warning('所用的计量标准器具不能为空')
+ return false
+ }
+
+ ruleFormRef.value.validate((valid: boolean) => {
+ if (valid) {
+ const params = solveParams()
+ const loading = ElLoading.service({
+ lock: true,
+ background: 'rgba(255, 255, 255, 0.8)',
+ })
+ downLoadTemplate(params).then((res) => {
+ exportFile(res.data, `${form.value.certificateReportName}.xls`)
+ loading.close()
+ }).catch(() => {
+ loading.close()
+ })
+ }
+ })
+}
+
// -------------------------------------------------------------------------------------------
+// 处理保存、下载模板参数
+function solveParams() {
+ const params = {
+ ...form.value,
+ businessEnvironmentRecord: businessEnvironmentRecord.value, // 环境记录单
+ fileList: fileList.value, // 依据的技术文件
+ equipmentInfoList: equipmentInfoList.value, // 所用的计量标准器具列表/监测设备
+ sampleId: sampleList.value[0].id, // 样品id(打印证书接口要必传)
+ sampleNo: sampleList.value[0].sampleNo, // 样品编号
+ sampleName: sampleList.value[0].sampleName, // 样品名称
+ sampleModel: sampleList.value[0].sampleModel, // 样品型号
+ manufacturingNo: sampleList.value[0].manufacturingNo, // 出厂编号
+ manufacturer: sampleList.value[0].manufacturer, // 生产厂家
+ sampleRemark: sampleList.value[0].remark, // 样品备注
+ id: pageType.value === 'add' ? '' : form.value.id,
+ }
+ return params
+}
// 获取详情信息
-const getDetail = () => {
+function getDetail(id?: string, certificateReportCode?: string) {
const loading = ElLoading.service({
lock: true,
background: 'rgba(255, 255, 255, 0.8)',
})
- detail({ id: $route.params.id as string }).then((res) => {
+ getMeasureDataDetail({ id: infoId.value! || id! }).then((res) => {
loading.close()
form.value = res.data
- form.value.createUserName = res.data.applicantName || user.name
- list.value = res.data.sampleList.filter((item: ISampleList) => {
- return item !== null
- })
+ sampleList.value = [{
+ sampleNo: res.data.sampleNo, // 样品编号
+ sampleName: res.data.sampleNo, // 样品名称
+ sampleModel: res.data.sampleNo, // 型号
+ manufacturingNo: res.data.sampleNo, // 出厂编号
+ manufacturer: res.data.sampleNo, // 生产厂家
+ remark: res.data.sampleRemark, // 备注
+ id: res.data.sampleId,
+ }]
+ equipmentInfoList.value = res.data.equipmentInfoList.map((item: { validDate: string }) => {
+ return {
+ ...item,
+ validDate: item.validDate ? dayjs(item.validDate).format('YYYY-MM-DD') : item.validDate,
+ }
+ }) // 所用的计量标准器具
+ businessEnvironmentRecord.value = res.data.businessEnvironmentRecord // 环境记录单数据
+ form.value.environmentCode = res.data.businessEnvironmentRecord.environmentCode// 环境记录单编号
+ if (id && certificateReportCode) {
+ form.value.oldCertificateCode = certificateReportCode
+ form.value.invalid = 1
+ }
}).catch(() => {
loading.close()
})
@@ -399,10 +492,13 @@
// 保存
const handleSave = () => {
- const tempList = list.value.filter(item => item.sampleNo)
- if (!tempList.length) {
- ElMessage.warning('样品信息不能为空')
- return
+ if (!sampleList.value.length) {
+ ElMessage.warning('被检样品不能为空')
+ return false
+ }
+ if (!equipmentInfoList.value.length) {
+ ElMessage.warning('所用的计量标准器具不能为空')
+ return false
}
ruleFormRef.value.validate((valid: boolean) => {
if (valid) {
@@ -410,32 +506,22 @@
lock: true,
background: 'rgba(255, 255, 255, 0.8)',
})
- // 样品&委托单列表(保存/编辑草稿接口入参使用)
- const temList = [] as any // 临时数组
- console.log('保存中的数组', list.value)
-
- list.value.forEach((item: any) => {
- if ((item.orderId && item.id) || (item.orderId && item.sampleId)) {
- temList.push({
- orderId: item.orderId,
- sampleId: item.id || item.sampleId,
- })
- }
- })
- form.value.orderSampleList = temList
+ const params = solveParams()
if (pageType.value === 'add') { // 新建
- addApply(form.value).then((res) => {
- submitId.value = res.data.id
- form.value.projectNo = res.data.projectNo // 分包项目编号
+ addMeasureData(params).then((res) => {
+ submitId.value = res.data.data.id
+ form.value.certificateReportCode = res.data.data.certificateReportCode
+ form.value.certificateReportName = res.data.data.certificateReportName
ElMessage.success('保存成功')
loading.close()
}).catch(() => {
loading.close()
})
}
+
else if (pageType.value === 'edit') { // 编辑
if (query.approvalStatusName === '未通过-驳回') { // 未通过-驳回
- failUpdateApply(form.value).then((res) => {
+ failUpdateMeasureData(params).then((res) => {
ElMessage.success('保存成功')
loading.close()
close()
@@ -444,7 +530,7 @@
})
}
else { // 草稿箱和已取消
- updateApply(form.value).then((res) => {
+ draftUpdateMeasureData(params).then((res) => {
ElMessage.success('保存成功')
loading.close()
close()
@@ -466,7 +552,7 @@
})
const params = {
id: submitId.value,
- formId: query.formId, // 表单id
+ formId: query.formId as string, // 表单id
}
submit(params).then(() => {
ElMessage.success('提交成功')
@@ -481,39 +567,6 @@
}
}
-const sampleVisible = ref(false)
-const projectVisible = ref(false)
-const isMulti = ref(false)
-const selectIndex = ref(0)
-// 点击选择
-const handleSelect = (index: number, row: ISampleList) => {
- sampleVisible.value = true // 选择设备对话框显隐
- isMulti.value = false // 是否单选, false单选、true表格多选
- selectIndex.value = index
-}
-
-const checkoutList = ref([]) // 选中的行
-
-// 修改委托方对话框显隐
-const changeSampleVisible = (val: boolean) => {
- sampleVisible.value = val
-}
-// 修改项目选择对话框显隐
-const changeProjectVisible = (val: boolean) => {
- projectVisible.value = val
-}
-
-// 删除行
-const delRow = () => {
- checkoutList.value.forEach((item: ISampleList) => {
- list.value.forEach((element, index) => {
- if (element.sampleNo === item.sampleNo) {
- list.value.splice(index, 1)
- }
- })
- })
-}
-
// ------------------------------------------审批-----------------------------------------
const approvalRecordData = ref([]) // 审批流程数据
@@ -573,11 +626,26 @@
// ------------------------------------事件-------------------------------------------------
// 检校专业变化
const changeCalibrationMajor = (val: string) => {
- form.value.certificateReportName = form.value.certificateReportCode + val + form.value.certifications
+ const index = calibrationMajorMap.value.findIndex((item: { value: string }) => item.value === val)
+ if (index !== -1) {
+ form.value.calibrationMajorName = calibrationMajorMap.value[index].name
+ }
+ console.log(form.value.calibrationMajorName)
}
// 证书类别变化
const changeCertifications = (val: string) => {
- form.value.certificateReportName = form.value.certificateReportCode + form.value.calibrationMajor + val
+ const index = certificationTypeMap.value.findIndex((item: { value: string }) => item.value === val)
+ if (index !== -1) {
+ form.value.certificateReportCategoryName = certificationTypeMap.value[index].name
+ }
+ console.log(form.value.certificateReportCategoryName)
+}
+// 选择检定员变化
+const changeMeasurePersonId = (val: string) => {
+ const index = userList.value.findIndex(item => item.id === val)
+ if (index !== -1) {
+ form.value.measurePerson = userList.value[index].name
+ }
}
// -------------------------------------------------------------------------------------
onMounted(async () => {
@@ -593,8 +661,9 @@
// form.value.createUser = user.id // 创建人id
// form.value.createUserName = user.name // 创建人
// form.value.applicantTime = proxy.dayjs().format('YYYY-MM-DD HH:mm:ss') // 申请时间
- form.value.jdy = user.name // 创建人
- form.value.jjrq = proxy.dayjs().format('YYYY-MM-DD') // 检校日期
+ form.value.measurePerson = user.name // 检定员名字
+ form.value.measurePersonId = user.id // 检定员id
+ form.value.calibrationTime = proxy.dayjs().format('YYYY-MM-DD') // 检校日期
}
})
@@ -606,7 +675,7 @@
上传证书
-
+
下载证书模板
@@ -641,25 +710,25 @@
label-width="140"
:rules="formRules"
>
-
+
-
+
替代已生成证书
-
-
+
+
-
+
选择
@@ -684,15 +753,15 @@
v-for="item in calibrationMajorMap"
:key="item.value"
:label="item.name"
- :value="item.name"
+ :value="item.value"
/>
-
+
@@ -720,7 +789,7 @@
/>
-
+
+
+
+
+
@@ -761,6 +841,18 @@
/>
+
+
+
+
+
-
-
+
+ filterable
+ @change="changeMeasurePersonId"
+ >
+
+
-
+
-
-
+
+
-
-
+
+
-
-
+
+
-
+
-
+
confirmSelectSample(val, 'order')" />
confirmSelectSample(val, 'warehouse')" />
+
+
+
+
diff --git a/src/views/business/lab/measureData/measureDataList.vue b/src/views/business/lab/measureData/measureDataList.vue
index 5c011b8..96ffa13 100644
--- a/src/views/business/lab/measureData/measureDataList.vue
+++ b/src/views/business/lab/measureData/measureDataList.vue
@@ -2,16 +2,19 @@
-
+
-
-
-
@@ -369,6 +385,7 @@
is-showmulti-select
@change="changePage"
@multi-select="handleSelectionChange"
+ @handleClickFollowLink="handleClickFollowLink"
>
@@ -483,3 +500,12 @@
+
+
diff --git a/src/views/business/schedule/interchangeReceipt/receiptEdit.vue b/src/views/business/schedule/interchangeReceipt/receiptEdit.vue
index 13ee3ab..877ea57 100644
--- a/src/views/business/schedule/interchangeReceipt/receiptEdit.vue
+++ b/src/views/business/schedule/interchangeReceipt/receiptEdit.vue
@@ -356,7 +356,7 @@
getInterchangeReceiptDetail({ id: infoId.value }).then((res) => {
dataForm.value = res.data // 表单
sampleList.value = res.data.customerSampleList // 样品列表
- dataForm.value.orderId = res.data.customerSampleList[0].orderId // orderId
+ dataForm.value.orderId = res.data.orderId // orderId
minioFileNameAutograph.value = res.data.recieverSignFile // 签名图片
loading.close()
})
diff --git a/src/views/finance/businessSettlement/businessSettlement-interface.ts b/src/views/finance/businessSettlement/businessSettlement-interface.ts
index 13a1a0c..454788f 100644
--- a/src/views/finance/businessSettlement/businessSettlement-interface.ts
+++ b/src/views/finance/businessSettlement/businessSettlement-interface.ts
@@ -4,6 +4,8 @@
customerNo: string // 委托方代码
customerName: string // 委托方名称
deliverer: string // 送样人
+ orderTimeStart: string // 委托日期开始
+ orderTimeEnd: string // 委托日期结束
offset: number
limit: number
}
@@ -14,17 +16,17 @@
orderCode: string // 委托书编号
customerNo: string // 委托方代码
customerName: string // 委托方名称
- deliverer: string // 送样人
- delivererTel: string // 联系方式
+ orderTime: string // 委托日期
sampleCount: string // 样品数量
- isUrgent: string // 是否加急
- createTime: string // 创建时间
- postedPrice: number // 标价(单位分)
- suggestedDiscount: string // 建议折扣-单位%
- suggestedPrice: number // 建议价格-单位分
- extraCharge: number // 附加费用-单位分
- extraChargeIllustration: string // 附加费用说明
- totalSettlement: number // 总计结算费用-单位分
+ sampleWarehouseName: string // 样品库房
+ certWarehouseName: string // 证书库房
+ feeStatus: string // 费用状态
+ received: string // 是否到账
+ actualTestFee: string // 检测费(实)(元)
+ shouldTestFee: string // 检测费(应)(元)
+ actualTotalFee: string // 实收合计(元)
+ receivedAmount: string // 到账金额(元)
+ invoiceAmount: string // 开票金额(元)
}
// 字典
@@ -49,21 +51,22 @@
// 表单
export interface IForm {
orderCode: string // 委托书编号
- orderId: string // 委托书编号
- deliverer: string // 送检人
- delivererTel: string // 送样人联系方式
- createTime: string // 委托单创建时间
- planDeliverTime: string // 预计送达时间
- requireOverTime: string // 要求检完时间
- customerNo: string // 委托方代码
- customerId: string // 委托方id
+ orderId: string // 委托单id
customerName: string // 委托方名称
- phone: string // 委托方电话
- priceFront: number // 标价
- suggestedDiscount: number // 建议折扣
- suggestedPrice: number // 建议价格
- extraCharge: number // 附加费用-单位分
- extraChargeIllustration: string // 附加费用说明
- totalSettlement: number // 总计结算费用
- samplePriceList: Array // 样品清单
+ orderTime: string // 委托日期
+ sampleCount: string // 样品数量
+ certificationCompany: string // 证书单位名称
+ certificationCompanyAddress: string // 证书单位地址
+ deliverer: string // 联系人
+ delivererTel: string // 联系方式
+ sampleWarehouse: string // 样品库房
+ certWarehouse: string // 证书库房
+ feeStatus: string // 费用状态
+ received: string // 是否到账
+ actualTestFee: Number // 检测费(实)(元)
+ shouldTestFee: Number // 检测费(应)(元)
+ actualTotalFee: Number // 实收合计(元)
+ receivedAmount: Number // 到账金额(元)
+ invoiceAmount: Number // 开票金额(元)
+ remark: string // 备注
}
diff --git a/src/views/finance/businessSettlement/edit.vue b/src/views/finance/businessSettlement/edit.vue
index e11f337..7630aeb 100644
--- a/src/views/finance/businessSettlement/edit.vue
+++ b/src/views/finance/businessSettlement/edit.vue
@@ -7,13 +7,18 @@
import { useRoute, useRouter } from 'vue-router'
import { el } from 'element-plus/es/locale'
import type { IForm, IsampleList } from './businessSettlement-interface'
+import multiTable from '@/components/MultiHeaderTable/index.vue'
+import { getDictByCode } from '@/api/system/dict'
+import { UploadFile } from '@/api/measure/file'
+import { calc } from '@/utils/useCalc'
+import type { dictType } from '@/global'
import type { TableColumn } from '@/components/NormalTable/table_interface'
import useUserStore from '@/store/modules/user'
import selectOrder from '@/views/business/schedule/interchangeReceipt/selectOrder.vue'
import type { IOrderList } from '@/views/business/schedule/order/orderList_interface'
import { getOrderDetail } from '@/api/business/schedule/order'
import { isNumber, validateMoney } from '@/utils/validate'
-import { calc } from '@/utils/useCalc'
+import useCheckList from '@/utils/useCheckList'
import { addBusinessSettlement, getBusinessSettlementDetail, updateBusinessSettlement } from '@/api/finance/businessSettlement'
const user = useUserStore() // 用户信息
const $route = useRoute()
@@ -27,54 +32,215 @@
// 表单数据
const form = ref({
orderCode: '', // 委托书编号
- orderId: '', // 委托书编号
- deliverer: '', // 送检人
- delivererTel: '', // 送样人联系方式
- createTime: '', // 委托单创建时间
- planDeliverTime: '', // 预计送达时间
- requireOverTime: '', // 要求检完时间
- customerNo: '', // 委托方代码
- customerId: '', // 委托方id
+ orderId: '', // 委托单id
customerName: '', // 委托方名称
- phone: '', // 委托方电话
- priceFront: 0, // 标价
- suggestedDiscount: 95, // 建议折扣
- suggestedPrice: 0, // 建议价格
- extraCharge: 0, // 附加费用-单位分
- extraChargeIllustration: '', // 附加费用说明
- totalSettlement: 0, // 总计结算费用
- samplePriceList: [], // 样品清单
+ orderTime: '', // 委托日期
+ sampleCount: '', // 样品数量
+ certificationCompany: '', // 证书单位名称
+ certificationCompanyAddress: '', // 证书单位地址
+ deliverer: '', // 联系人
+ delivererTel: '', // 联系方式
+ sampleWarehouse: '未入库', // 样品库房
+ certWarehouse: '未入库', // 证书库房
+ feeStatus: '未录费', // 费用状态
+ received: '未到账', // 是否到账
+ actualTestFee: 0, // 检测费(实)(元)
+ shouldTestFee: 0, // 检测费(应)(元)
+ actualTotalFee: 0, // 实收合计(元)
+ receivedAmount: 0, // 到账金额(元)
+ invoiceAmount: 0, // 开票金额(元)
+ remark: '', // 备注
})
-const ruleFormRef = ref() as any
-const list = ref([])// 表格数据
-const orderVisible = ref(false) // 控制委托书对话框显隐
-
-// 表头
-const columns = ref([
- { text: '样品编号', value: 'sampleNo', align: 'center', width: '170', required: false },
- { text: '样品名称', value: 'sampleName', align: 'center', required: false },
- { text: '型号', value: 'sampleModel', align: 'center', required: false },
- { text: '出厂编号', value: 'manufacturingNo', align: 'center', required: false },
- { text: '检定项目', value: 'measureContent', align: 'center', required: false },
- { text: '标价(元)', value: 'price', align: 'center', required: true, reg: validateMoney },
-])
// 表单校验规则
const rules = reactive({
- orderCode: [{ required: true, message: '委托书编号必填', trigger: 'blur' }],
- price: [{ required: true, message: '标价必填', trigger: ['blur', 'change'] },
- { pattern: /(^-?\d\d*\.\d*$)|(^-?\d\d*$)|(^-?\.\d\d*$)/, message: '标价只能为数字', trigger: ['blur', 'change'] }],
- suggestedDiscount: [{ required: true, message: '建议折扣必填', trigger: ['blur', 'change'] },
- { pattern: /^([0]|[1-9][0-9]*)$/, message: '建议折扣只能为正整数或0', trigger: ['blur', 'change'] }],
- extraCharge: [{ required: true, message: '附加费用必填', trigger: ['blur', 'change'] },
- { pattern: /(^[0-9](\d+)?(\.\d{1,2})?$)|(^\d\.\d{1,2}$)/, message: '要求不小于0,且最多保留两位小数', trigger: ['blur', 'change'] }],
- extraChargeIllustration: [{ required: true, message: '附加费用说明必填', trigger: 'blur' }],
+ orderCode: [{ required: true, message: '委托单编号必填', trigger: 'blur' }],
+ customerName: [{ required: true, message: '委托方名称必填', trigger: 'blur' }],
+ orderTime: [{ required: true, message: '委托日期必填', trigger: 'blur' }],
+ sampleCount: [{ required: true, message: '样品数量必填', trigger: 'blur' }],
+ certificationCompany: [{ required: true, message: '证书单位名称必填', trigger: 'blur' }],
+ certificationCompanyAddress: [{ required: true, message: '证书单位地址必填', trigger: 'blur' }],
+ deliverer: [{ required: true, message: '联系人必填', trigger: 'blur' }],
+ delivererTel: [{ required: true, message: '联系电话必填', trigger: 'blur' }],
+ sampleWarehouse: [{ required: true, message: '样品库房必填', trigger: 'blur' }],
+ certWarehouse: [{ required: true, message: '证书库房必填', trigger: 'blur' }],
+ feeStatus: [{ required: true, message: '费用状态必填', trigger: 'blur' }],
+ received: [{ required: true, message: '是否到账必填', trigger: 'blur' }],
+ actualTestFee: [{ required: true, message: '检测费(实)(元)必填', trigger: 'blur' }],
+ shouldTestFee: [{ required: true, message: '检测费(应)(元)必填', trigger: 'blur' }],
+ actualTotalFee: [{ required: true, message: '实收合计(元)必填', trigger: 'blur' }],
+ receivedAmount: [{ required: true, message: '到账金额(元)必填', trigger: 'blur' }],
+ invoiceAmount: [{ required: true, message: '开票金额(元)必填', trigger: 'blur' }],
})
+const ruleFormRef = ref() as any
+const orderVisible = ref(false) // 控制委托书对话框显隐
// ---------------------------------------路由参数--------------------------------------
if ($route.params && $route.params.type) {
pageType.value = $route.params.type as string
infoId.value = $route.params.id as string
}
+// ---------------------------------------字典--------------------------------------
+
+const financeSampleWarehouseList = ref([]) // 样品库房
+const financeCertWarehouseList = ref([]) // 证书库房
+const financeReceivedList = ref([]) // 是否到账
+// 获取字典值
+function getDict() {
+ // 样品库房
+ getDictByCode('financeSampleWarehouse').then((response) => {
+ financeSampleWarehouseList.value = response.data
+ })
+ // 证书库房
+ getDictByCode('financeCertWarehouse').then((response) => {
+ financeCertWarehouseList.value = response.data
+ })
+ // 是否到账
+ getDictByCode('financeReceived').then((response) => {
+ financeReceivedList.value = response.data
+ })
+}
+getDict()
+// -----------------------------------到账金额明细--------------------------------------------------
+const receivedAmountList = ref([]) as any // 到账金额明细
+const checkoutReceivedAmountList = ref([]) as any // 到账金额明细多选
+// 表头
+const receivedAmountcolumns = ref([
+ { text: '到账金额(元)', value: 'money', align: 'center', width: '220', required: true },
+ { text: '到账时间', value: 'moneyTime', align: 'center', width: '220', required: true },
+ { text: '附件', value: 'attachment', align: 'center', required: false },
+])
+
+// -------------------------------------开票金额明细--------------------------------------------------------------
+const invoiceAmountList = ref([]) as any // 开票金额明细
+const checkoutInvoiceAmountList = ref([]) as any // 开票金额明细多选
+// 表头
+const invoiceAmountcolumns = ref([
+ { text: '开票金额(元)', value: 'money', align: 'center', width: '220', required: true },
+ { text: '开票时间', value: 'moneyTime', align: 'center', width: '220', required: true },
+ { text: '附件', value: 'attachment', align: 'center', required: false },
+])
+
+// 多选发生改变时
+const handleSelectionChange = (e: any, type: 'addReceived' | 'invoiceAmount') => {
+ if (type === 'addReceived') { // 到账金额明细
+ checkoutReceivedAmountList.value = e
+ }
+ else { // 开票金额明细
+ checkoutInvoiceAmountList.value = e
+ }
+}
+
+// 点击增加行
+const addRow = (type: 'addReceived' | 'invoiceAmount') => {
+ if (type === 'addReceived') {
+ if (useCheckList(receivedAmountList.value, receivedAmountcolumns.value, '到账金额明细')) {
+ receivedAmountList.value.push({
+ money: undefined,
+ moneyTime: '',
+ attachment: [],
+ moneyType: '1',
+ })
+ }
+ }
+ else {
+ if (useCheckList(invoiceAmountList.value, invoiceAmountcolumns.value, '开票金额明细')) {
+ invoiceAmountList.value.push({
+ money: undefined,
+ moneyTime: '',
+ attachment: [],
+ moneyType: '2',
+ })
+ }
+ }
+}
+
+// 删除行
+const delRow = (type: 'addReceived' | 'invoiceAmount') => {
+ if ((type === 'addReceived' && checkoutReceivedAmountList.value.length <= 0) || (type === 'invoiceAmount' && checkoutInvoiceAmountList.value.length <= 0)) {
+ ElMessage({
+ message: '请选中要删除的行',
+ type: 'warning',
+ })
+ }
+ else {
+ if (type === 'addReceived') {
+ receivedAmountList.value = receivedAmountList.value.filter(
+ (item: any) => {
+ return !checkoutReceivedAmountList.value.includes(item)
+ },
+ )
+ }
+ else {
+ invoiceAmountList.value = invoiceAmountList.value.filter(
+ (item: any) => {
+ return !checkoutInvoiceAmountList.value.includes(item)
+ },
+ )
+ }
+ }
+}
+
+// ----------------------------------------上传附件----------------------------------------------------
+// 删除附件
+const del = (index: number, row: any) => {
+ row.value.attachment.splice(index, 1)
+}
+
+const fileRef = ref() // 文件上传input
+const onFileChange = (event: any, row?: any, type?: 'receivedAmount' | 'invoiceAmount') => {
+ // 原生上传
+ console.log(event.target.files)
+ const files = event.target.files
+ if (files.length !== 0) {
+ // 创建formdata对象
+ const fd = new FormData()
+ for (var i = 0; i < files.length; i++) {
+ fd.append('multipartFile', files[i])
+ }
+ UploadFile(fd).then((res) => {
+ if (res.code === 200) {
+ res.data.forEach((item: string) => {
+ row.attachment.push({
+ minioFileName: item,
+ })
+ })
+ ElMessage.success('文件上传成功')
+ }
+ else {
+ ElMessage.error(res.message)
+ }
+ })
+ }
+}
+const upload = () => {
+ fileRef.value.click()
+}
+// ------------------------------------结算明细--------------------------------------------------------------------
+const list = ref([]) // 开票金额明细
+// 表头
+const columns = ref([
+ { text: '器具名称', value: 'sampleName', align: 'center', required: true, type: 'text' },
+ { text: '型号规格', value: 'sampleModel', align: 'center', width: '180', required: true, type: 'input' },
+ { text: '套数/退', value: 'sets', align: 'center', required: true, width: '180', type: 'inputNumber' },
+ { text: '出厂编号', value: 'manufacturingNo', align: 'center', width: '180', required: true, type: 'input' },
+ { text: '委托日期', value: 'orderTime', align: 'center', required: true, width: '160', type: 'date' },
+ { text: '检测规范', value: 'accordStandard', align: 'center', width: '180', required: false, type: 'input' },
+ {
+ text: '收费(元)含6%增值税',
+ value: 'price',
+ align: 'center',
+ required: false,
+ children: [
+ { text: '检测费(应)', value: 'shouldTestFee', align: 'center', width: '180', required: true, type: 'inputNumber' },
+ { text: '检测费(实)', value: 'actualTestFee', align: 'center', required: true, width: '180', type: 'inputNumber' },
+ { text: '附加费', value: 'extraFee', align: 'center', required: false, width: '180', type: 'inputNumber' },
+ { text: '修理费', value: 'repairFee', align: 'center', required: false, width: '180', type: 'inputNumber' },
+ { text: '其他费', value: 'otherFee', align: 'center', required: false, width: '180', type: 'inputNumber' },
+ { text: '小计', value: 'subtotal', align: 'center', required: false, type: 'text' },
+ ],
+ },
+])
+
// ------------------------------------委托书---------------------------------------------
// 点击选择委托书编号
const handleClickOrder = () => {
@@ -87,87 +253,63 @@
// 选好委托书
const confirmCheckoutOrder = (val: Array) => {
if (val && val.length) {
- form.value.priceFront = 0 // 标价
- // form.value.suggestedDiscount = 95 // 建议折扣
- form.value.suggestedPrice = 0 // 建议价格
- form.value.extraCharge = 0// 附加费用-单位分
- form.value.extraChargeIllustration = '' // 附加费用说明
- form.value.totalSettlement = 0 // 总计结算费用
getOrderDetail({ id: val[0].id }).then((res) => { // 样品清单
form.value.orderCode = res.data.orderCode // 委托书编号
form.value.orderId = res.data.id // 委托书id
- form.value.deliverer = res.data.deliverer // 送检人
- form.value.delivererTel = res.data.delivererTel // 送检人
- form.value.createTime = res.data.createTime // 委托单创建时间
- form.value.customerNo = res.data.customerNo // 委托方代码
- form.value.customerId = res.data.customerId // 委托方id
form.value.customerName = res.data.customerName // 委托方名称
- form.value.planDeliverTime = res.data.planDeliverTime // 预计送达时间
- form.value.requireOverTime = res.data.requireOverTime // 要求检完时间
- form.value.phone = res.data.customerPhone // 委托方电话
- list.value = res.data.customerSampleInfoList.map((item: { isEdit: boolean }) => {
+ form.value.orderTime = res.data.createTime // 委托日期(委托单创建时间)
+ form.value.certificationCompany = res.data.certificationCompany // 证书单位名称
+ form.value.certificationCompanyAddress = res.data.certificationCompanyAddress // 证书单位地址
+ form.value.deliverer = res.data.deliverer // 联系人
+ form.value.delivererTel = res.data.delivererTel // 联系方式
+ form.value.sampleCount = res.data.customerSampleInfoList.length // 样品数量
+ list.value = res.data.customerSampleInfoList.map((item: { createTime: string; editable: boolean }) => {
return {
...item,
- isEdit: true,
+ orderTime: item.createTime ? dayjs(item.createTime).format('YYYY-MM-DD') : item.createTime, // 委托日期
+ editable: pageType.value !== 'detail',
+ shouldTestFee: 0, // 检测费(应)
+ actualTestFee: 0, // 检测费(实)
+ extraFee: 0, // 附加费
+ repairFee: 0, // 修理费
+ otherFee: 0, // 其他费
+ sets: 0, // 套数
+ subtotal: 0, // 小计
+ id: '',
}
})
})
}
}
-// -----------------------------------------样品清单--------------------------------------------
-// 检查列表
-function checkSampleList() {
- for (let index = 0; index < list.value.length; index++) {
- const item = list.value[index]
- for (const prop of columns.value) {
- // 检查必填
- if (prop.required && !item[prop.value]) {
- ElMessage.warning(`请先完善第${index + 1}行中${prop.text}`)
- return false
- }
- // 验证正则
- if (prop.reg && typeof prop.reg === 'function') {
- if (!prop.reg(item[prop.value])) {
- // ElMessage.warning(`第${index + 1}行中${prop.text}输入不合法`)
- ElMessage.warning(`第${index + 1}行: 要求标价为正数,且最多保留两位小数`)
- return false
- }
- }
- }
- }
- return true
-}
+// --------------------------------------------计算----------------------------------------------
+// 计算
+const handleInputNumberChange = ({ row }: any) => {
+ // 计算小计
+ row.subtotal = calc(Number(calc(Number(calc(Number(calc(Number(row.shouldTestFee), Number(row.actualTestFee), '+')), row.extraFee, '+')), row.repairFee, '+')), row.otherFee, '+')
+ // 计算检测费(应)(元)
+ form.value.shouldTestFee = list.value.reduce((accumulator, current: any) => accumulator + current.shouldTestFee, 0)
+ // 计算检测费(实)(元)
+ form.value.actualTestFee = list.value.reduce((accumulator, current: any) => accumulator + current.actualTestFee, 0)
+ // 实收合计
+ form.value.actualTotalFee = list.value.reduce((accumulator, current: any) => accumulator + current.subtotal, 0)
-// --------------------------------------------自动计算----------------------------------------------
-// 折扣改变-计算建议价格
-const changeSuggestedDiscount = () => {
- console.log('折扣改变')
- if (form.value.priceFront) {
- form.value.suggestedPrice = calc(Number(form.value.priceFront), Number(form.value.suggestedDiscount / 100), '*') as number
- form.value.suggestedPrice = Number(form.value.suggestedPrice.toFixed(2))
+ if (list.value.every((item: { actualTestFee: number }) => item.actualTestFee === 0 || `${item.actualTestFee}` === 'undefined' || `${item.actualTestFee}` === 'null' || `${item.actualTestFee}` === '')) {
+ form.value.feeStatus = '未录费'
+ }
+ else if (list.value.every((item: { actualTestFee: number }) => item.actualTestFee !== 0 || `${item.actualTestFee}` === 'undefined' || `${item.actualTestFee}` === 'null' || `${item.actualTestFee}` === '')) {
+ form.value.feeStatus = '已录费'
+ }
+ else {
+ form.value.feeStatus = '部分录费'
}
}
-// 标价改变
-const changePrice = () => {
- console.log('标价改变')
- let sum = 0
- list.value.forEach((item) => {
- if (item.price) {
- sum = calc(Number(sum), Number(item.price), '+') as number
- }
- })
- form.value.priceFront = sum
- changeSuggestedDiscount() // 建议价格随之变化
+const changeTableInputNumber = () => {
+ // 到账金额
+ form.value.receivedAmount = receivedAmountList.value.reduce((accumulator: any, current: any) => accumulator + current.money, 0)
+ // 开票金额
+ form.value.invoiceAmount = invoiceAmountList.value.reduce((accumulator: any, current: any) => accumulator + current.money, 0)
}
-// 附加费用改变
-const changeExtraCharge = () => {
- console.log('附加费用改变')
- form.value.totalSettlement = calc(Number(form.value.suggestedPrice), Number(form.value.extraCharge), '+') as number
-}
-watch(() => form.value.suggestedPrice, (newValue) => {
- changeExtraCharge()
-})
// ----------------------------------------------------------------------------------------
const $router = useRouter()
@@ -176,9 +318,35 @@
$router.back()
}
+// 校验表格
+const checkList = () => {
+ if (!receivedAmountList.value.length) {
+ ElMessage.warning('到账金额明细不能为空')
+ return false
+ }
+ if (!invoiceAmountList.value.length) {
+ ElMessage.warning('开票金额明细不能为空')
+ return false
+ }
+ if (!list.value.length) {
+ ElMessage.warning('结算明细不能为空')
+ return false
+ }
+ if (!useCheckList(receivedAmountList.value, receivedAmountcolumns.value, '到账金额明细')) {
+ return false
+ }
+ if (!useCheckList(invoiceAmountList.value, invoiceAmountcolumns.value, '开票金额明细')) {
+ return false
+ }
+ if (!useCheckList(list.value, columns.value, '结算明细')) {
+ return false
+ }
+ return true
+}
+
// 保存
const save = () => {
- if (!checkSampleList()) {
+ if (!checkList()) {
return false
}
ruleFormRef.value.validate((valid: boolean) => {
@@ -188,17 +356,10 @@
background: 'rgba(255, 255, 255, 0.8)',
})
const params = {
- extraCharge: calc(Number(form.value.extraCharge), 100, '*'), // 附加费用-单位分
- extraChargeIllustration: form.value.extraChargeIllustration, // 附加费用说明
id: infoId.value,
- orderId: form.value.orderId, // 委托书id
- suggestedDiscount: form.value.suggestedDiscount, // 建议折扣-单位%
- samplePriceList: list.value.map((item) => {
- return {
- price: calc(Number(item.price), 100, '*'), // 标价-单位分
- relationId: item.relationId, // 样品id
- }
- }), // 样品清单
+ ...form.value,
+ amountDetailsList: receivedAmountList.value.concat(invoiceAmountList.value),
+ sampleList: list.value,
}
// 新建
if (pageType.value === 'add') {
@@ -229,24 +390,22 @@
// 编辑、详情--获取详细信息
const fetchDetail = () => {
+ const loading = ElLoading.service({})
getBusinessSettlementDetail({ id: infoId.value }).then((res) => {
form.value = res.data
- form.value.phone = res.data.customerPhone
- list.value = res.data.sampleList.map((item: { postedPrice: number; id: string }) => {
+ receivedAmountList.value = res.data.amountDetailsList.filter((item: { moneyType: string }) => `${item.moneyType}` === '1')
+ invoiceAmountList.value = res.data.amountDetailsList.filter((item: { moneyType: string }) => `${item.moneyType}` === '2')
+ list.value = res.data.sampleDetailsList.map((item: { editable: boolean; orderTime: string }) => {
return {
...item,
- price: calc(Number(item.postedPrice), 100, '/') as number,
- isEdit: pageType.value === 'edit',
- relationId: item.id,
+ editable: pageType.value !== 'detail',
+ orderTime: item.orderTime ? dayjs(item.orderTime).format('YYYY-MM-DD') : item.orderTime,
}
})
- form.value.priceFront = calc(Number(res.data.postedPrice), 100, '/') as number // 标价
- // form.value.suggestedDiscount = // 建议折扣
- form.value.suggestedPrice = calc(Number(res.data.suggestedPrice), 100, '/') as number// 建议价格
- form.value.extraCharge = calc(Number(res.data.extraCharge), 100, '/') as number// 附加费用-单位分
- // form.value.extraChargeIllustration = // 附加费用说明
- form.value.totalSettlement = calc(Number(res.data.totalSettlement), 100, '/') as number // 总计结算费用
- })
+ form.value.orderTime = res.data.sampleDetailsList[0].orderTime // 委托日期
+ form.value.sampleCount = res.data.sampleDetailsList.length // 样品数量
+ loading.close()
+ }).catch(() => loading.close())
}
onMounted(() => {
@@ -278,10 +437,10 @@
>
-
+
@@ -294,51 +453,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -467,17 +645,26 @@
-
-
+
+
+
+ 增加行
+
+
+ 删除行
+
+
handleSelectionChange(e, 'addReceived')"
>
+
*{{ item.text }}
-
-
-
- {{ scope.row[item.value] }}
+
+
+
+
+ {{ '上传' }}
+
+
+
+ ×
+
+
+
onFileChange(e, scope.row, 'receivedAmount')">
+
+
+
+
+ 增加行
+
+
+ 删除行
+
+
+ handleSelectionChange(e, 'invoiceAmount')"
+ >
+
+
+
+
+ *{{ item.text }}
+
+
+
+
+
+
+
+ {{ '上传' }}
+
+
+
+ ×
+
+
+
onFileChange(e, scope.row, 'receivedAmount')">
+
+
+
+
+
+
+
+
diff --git a/src/views/finance/businessSettlement/list.vue b/src/views/finance/businessSettlement/list.vue
index eea28d8..2852223 100644
--- a/src/views/finance/businessSettlement/list.vue
+++ b/src/views/finance/businessSettlement/list.vue
@@ -2,6 +2,8 @@
diff --git a/src/views/system/tool/fileTemplate/addDDialog.vue b/src/views/system/tool/fileTemplate/addDDialog.vue
index 1ff8ac0..6cba8a4 100644
--- a/src/views/system/tool/fileTemplate/addDDialog.vue
+++ b/src/views/system/tool/fileTemplate/addDDialog.vue
@@ -1,7 +1,7 @@