时ㅤ间:
diff --git a/src/api/business/manager/interchangeReceipt.ts b/src/api/business/manager/interchangeReceipt.ts
index 20e6441..588d0c9 100644
--- a/src/api/business/manager/interchangeReceipt.ts
+++ b/src/api/business/manager/interchangeReceipt.ts
@@ -1,6 +1,6 @@
/**
* 设备交接单
-*/
+ */
import request from '../../index'
import type { IListQuery } from '@/views/business/manager/interchangeReceipt/interchangeReceipt-interface'
const prefix = '/business/interchange'
@@ -61,7 +61,14 @@
}
// 查询样品列表
-export function getSampleList(data: { customerId: string; customerName: string; sampleName: string; sampleNo: string; offset: number; limit: number }) {
+export function getSampleList(data: {
+ customerId: string
+ customerName: string
+ sampleName: string
+ sampleNo: string
+ offset: number
+ limit: number
+}) {
return request({
url: `${prefix}/listPageByInterchange?offset=${data.offset}&limit=${data.limit}`,
method: 'post',
@@ -78,3 +85,22 @@
})
}
+// 导出word/pdf/打印
+export function getStream(data: any) {
+ return request({
+ url: '/business/interchange/exportFile',
+ method: 'post',
+ responseType: 'blob',
+ data,
+ })
+}
+
+// 批量打印
+export function batchPrint(data: any) {
+ return request({
+ url: '/business/interchange/batchPrint',
+ method: 'post',
+ responseType: 'blob',
+ data,
+ })
+}
diff --git a/src/api/system/dept.ts b/src/api/system/dept.ts
index eaf221c..de9e792 100644
--- a/src/api/system/dept.ts
+++ b/src/api/system/dept.ts
@@ -90,6 +90,7 @@
})
}
+// 组织部门
export function getDept(params?: { deptId?: string }) {
return request({
url: '/system/dept/listPage',
@@ -97,3 +98,4 @@
params,
})
}
+
diff --git a/src/components.d.ts b/src/components.d.ts
index 37a7e06..2461bf8 100644
--- a/src/components.d.ts
+++ b/src/components.d.ts
@@ -30,7 +30,6 @@
CertificationMonitor: typeof import('./components/Sample/certificationMonitor.vue')['default']
CertificationRecords: typeof import('./components/Sample/certificationRecords.vue')['default']
ConditionDrawer: typeof import('./components/drawer/conditionDrawer.vue')['default']
- copy: typeof import('./components/NormalTable copy/index.vue')['default']
CopyerDrawer: typeof import('./components/drawer/copyerDrawer.vue')['default']
Copyright: typeof import('./components/Copyright/index.vue')['default']
DeptSelect: typeof import('./components/DeptSelect/index.vue')['default']
diff --git a/src/components/DeptSelect/index.vue b/src/components/DeptSelect/index.vue
index a884b89..bd7042d 100644
--- a/src/components/DeptSelect/index.vue
+++ b/src/components/DeptSelect/index.vue
@@ -51,6 +51,10 @@
type: Boolean,
default: false,
},
+ deptNotControlledByPermissions: { // 查询部门不熟当前用户的权限控制
+ type: Boolean,
+ default: false,
+ },
})
const emit = defineEmits(['update:modelValue', 'change'])
// ------------------------------定义props参数---------------------------------------------
@@ -106,11 +110,20 @@
})
}
else {
- getDeptTreeList().then((res) => {
- const list = res.data
- dictStore.setAllDeptList(list)
- refreshList(list)
- })
+ if (props.deptNotControlledByPermissions) { // 无权限控制
+ getDept().then((res) => {
+ const list = res.data
+ dictStore.setAllDeptList(list)
+ refreshList(list)
+ })
+ }
+ else {
+ getDeptTreeList().then((res) => {
+ const list = res.data
+ dictStore.setAllDeptList(list)
+ refreshList(list)
+ })
+ }
}
}
else { // 如果指定了需要展示的部门类型
@@ -139,11 +152,20 @@
})
}
else {
- getDeptTreeList({ deptType: props.deptType }).then((res) => {
- const list = res.data
- dictStore.setAllCompanyList(list)
- refreshList(list)
- })
+ if (props.deptNotControlledByPermissions) { // 无权限控制
+ getDept().then((res) => {
+ const list = res.data
+ dictStore.setAllDeptList(list)
+ refreshList(list)
+ })
+ }
+ else {
+ getDeptTreeList({ deptType: props.deptType }).then((res) => {
+ const list = res.data
+ dictStore.setAllCompanyList(list)
+ refreshList(list)
+ })
+ }
}
}
}
diff --git a/src/components/dialog/selectDeptTree.vue b/src/components/dialog/selectDeptTree.vue
index 64cf1f3..24f6843 100644
--- a/src/components/dialog/selectDeptTree.vue
+++ b/src/components/dialog/selectDeptTree.vue
@@ -1,13 +1,23 @@
+
+
+ 展开/折叠
+
+
+ 全选
+
+
+ 父子联动
+
+
diff --git a/src/components/showPhoto/index.vue b/src/components/showPhoto/index.vue
index 1882f61..07a7a7a 100644
--- a/src/components/showPhoto/index.vue
+++ b/src/components/showPhoto/index.vue
@@ -16,6 +16,10 @@
type: String,
default: '100px',
},
+ fit: {
+ type: String,
+ default: 'cover',
+ },
})
const isPhoto = computed(() => {
return props.minioFileName.split('.')[1] === 'png' || props.minioFileName.split('.')[1] === 'jpg' || props.minioFileName.split('.')[1] === 'jpeg'
@@ -45,7 +49,7 @@
:style="{ width: props.width, height: props.height }"
:src="url"
:preview-src-list="[url]"
- fit="cover"
+ :fit="props.fit"
/>
= ref({
@@ -347,7 +349,10 @@
labCode: user.bizLabCode, // 实验室代码
}
if (pageType.value === 'edit') { // 编辑
- updateInterchangeReceipt(params).then(() => {
+ updateInterchangeReceipt({
+ ...params,
+ id: infoId.value,
+ }).then(() => {
ElMessage.success('已保存')
loading.close()
pageType.value = 'detail'
@@ -358,7 +363,8 @@
if (pageType.value === 'add') { // 新建
addInterchangeReceipt(params).then((res) => {
ElMessage.success('已保存')
- form.value.interchangeNo = res.data
+ form.value.interchangeNo = res.data.interchangeNo
+ infoId.value = res.data.id
loading.close()
pageType.value = 'detail'
}).catch(() => {
@@ -373,10 +379,7 @@
const edit = () => {
pageType.value = 'edit'
}
-// 打印
-const print = () => {
- ElMessage.info('敬请期待')
-}
+
// ---------------------------------------------扫描--------------------------------------
const scanSampleRef = ref()
// 点击扫描收添加
@@ -537,38 +540,27 @@
form.value.signatureTime = dayjs().format('YYYY-MM-DD HH-mm:ss') // 签名时间
ElMessage.success('上传成功')
canvasDialogRef.value.close() // 关闭对话框
- loading.close()
- ElMessageBox.confirm(
- '签名成功,是否保存签名?',
- 'Warning',
- {
- confirmButtonText: '保存',
- cancelButtonText: '取消',
- type: 'warning',
- },
- )
- .then(() => {
- // 保存签名
- const params = {
- ...form.value,
- delivererTel: form.value.delivererTel, // 委托方电话
- sampleIdList: list.value.map(item => item.sampleId),
- deviceTotal: list.value.length, // 设备总量
- labCode: user.bizLabCode, // 实验室代码
- }
- const loading = ElLoading.service({
- lock: true,
- background: 'rgba(255, 255, 255, 0.8)',
- })
- updateInterchangeReceipt(params).then(() => {
- printSignaturePicture.value = res.data[0] // 打印签名
- ElMessage.success('已保存签名')
- loading.close()
- pageType.value = 'detail'
- }).catch(() => {
- loading.close()
- })
- })
+ // 保存签名
+ const params = {
+ ...form.value,
+ delivererTel: form.value.delivererTel, // 委托方电话
+ sampleIdList: list.value.map(item => item.sampleId),
+ deviceTotal: list.value.length, // 设备总量
+ labCode: user.bizLabCode, // 实验室代码
+ id: infoId.value,
+ }
+ const loading = ElLoading.service({
+ lock: true,
+ background: 'rgba(255, 255, 255, 0.8)',
+ })
+ updateInterchangeReceipt(params).then(() => {
+ printSignaturePicture.value = res.data[0] // 打印签名
+ ElMessage.success('已保存签名')
+ loading.close()
+ pageType.value = 'detail'
+ }).catch(() => {
+ loading.close()
+ })
}
else {
ElMessage.error(res.message)
@@ -576,6 +568,21 @@
}
})
}
+
+// 点击打印
+const print = () => {
+ const loading = ElLoading.service({
+ lock: true,
+ text: '加载中...',
+ background: 'rgba(255, 255, 255, 0.6)',
+ })
+ getStream({ id: infoId.value, pdf: true }).then((res) => {
+ pdfStream.value = new Blob([res.data])
+ loading.close()
+ const blobUrl = URL.createObjectURL(pdfStream.value)
+ printPdf(blobUrl)
+ })
+}
// ----------------------------------------------------钩子----------------------------------------------------
onMounted(async () => {
getDict().then(() => {
@@ -944,6 +951,7 @@