diff --git a/src/api/business/subpackage/record.ts b/src/api/business/subpackage/record.ts index 6042716..bf4fb0e 100644 --- a/src/api/business/subpackage/record.ts +++ b/src/api/business/subpackage/record.ts @@ -23,6 +23,15 @@ }) } +// 批量导入 +export function batchImportSubpackageRecord(data: FormData) { + return request({ + url: '/business/outsourcer/import', + method: 'post', + data, + }) +} + // 人员列表查询 export function getPersonList(data: { outsourcerId: string; offset?: number; limit?: number }) { return request({ @@ -78,7 +87,7 @@ } // 审批通过列表 -export function getListApprovePass(data: Object) { +export function getListApprovePass(data: any) { return request({ url: `/business/outsourceProject/check/listPage?offset=${data.offset}&limit=${data.limit}`, method: 'post', diff --git a/src/api/business/subpackage/record.ts b/src/api/business/subpackage/record.ts index 6042716..bf4fb0e 100644 --- a/src/api/business/subpackage/record.ts +++ b/src/api/business/subpackage/record.ts @@ -23,6 +23,15 @@ }) } +// 批量导入 +export function batchImportSubpackageRecord(data: FormData) { + return request({ + url: '/business/outsourcer/import', + method: 'post', + data, + }) +} + // 人员列表查询 export function getPersonList(data: { outsourcerId: string; offset?: number; limit?: number }) { return request({ @@ -78,7 +87,7 @@ } // 审批通过列表 -export function getListApprovePass(data: Object) { +export function getListApprovePass(data: any) { return request({ url: `/business/outsourceProject/check/listPage?offset=${data.offset}&limit=${data.limit}`, method: 'post', diff --git a/src/api/customer/customer.ts b/src/api/customer/customer.ts index dfae297..85584a7 100644 --- a/src/api/customer/customer.ts +++ b/src/api/customer/customer.ts @@ -101,3 +101,12 @@ }) } +// 批量导入 +export function batchImportCustomer(data: FormData) { + return request({ + url: '/customer/import', + method: 'post', + data, + }) +} + diff --git a/src/api/business/subpackage/record.ts b/src/api/business/subpackage/record.ts index 6042716..bf4fb0e 100644 --- a/src/api/business/subpackage/record.ts +++ b/src/api/business/subpackage/record.ts @@ -23,6 +23,15 @@ }) } +// 批量导入 +export function batchImportSubpackageRecord(data: FormData) { + return request({ + url: '/business/outsourcer/import', + method: 'post', + data, + }) +} + // 人员列表查询 export function getPersonList(data: { outsourcerId: string; offset?: number; limit?: number }) { return request({ @@ -78,7 +87,7 @@ } // 审批通过列表 -export function getListApprovePass(data: Object) { +export function getListApprovePass(data: any) { return request({ url: `/business/outsourceProject/check/listPage?offset=${data.offset}&limit=${data.limit}`, method: 'post', diff --git a/src/api/customer/customer.ts b/src/api/customer/customer.ts index dfae297..85584a7 100644 --- a/src/api/customer/customer.ts +++ b/src/api/customer/customer.ts @@ -101,3 +101,12 @@ }) } +// 批量导入 +export function batchImportCustomer(data: FormData) { + return request({ + url: '/customer/import', + method: 'post', + data, + }) +} + diff --git a/src/api/customer/sampleList.ts b/src/api/customer/sampleList.ts index 65acbce..17d4f14 100644 --- a/src/api/customer/sampleList.ts +++ b/src/api/customer/sampleList.ts @@ -76,3 +76,11 @@ data, }) } +// 批量导入 +export function batchImportSample(data: FormData) { + return request({ + url: '/customer/sample/import', + method: 'post', + data, + }) +} diff --git a/src/api/business/subpackage/record.ts b/src/api/business/subpackage/record.ts index 6042716..bf4fb0e 100644 --- a/src/api/business/subpackage/record.ts +++ b/src/api/business/subpackage/record.ts @@ -23,6 +23,15 @@ }) } +// 批量导入 +export function batchImportSubpackageRecord(data: FormData) { + return request({ + url: '/business/outsourcer/import', + method: 'post', + data, + }) +} + // 人员列表查询 export function getPersonList(data: { outsourcerId: string; offset?: number; limit?: number }) { return request({ @@ -78,7 +87,7 @@ } // 审批通过列表 -export function getListApprovePass(data: Object) { +export function getListApprovePass(data: any) { return request({ url: `/business/outsourceProject/check/listPage?offset=${data.offset}&limit=${data.limit}`, method: 'post', diff --git a/src/api/customer/customer.ts b/src/api/customer/customer.ts index dfae297..85584a7 100644 --- a/src/api/customer/customer.ts +++ b/src/api/customer/customer.ts @@ -101,3 +101,12 @@ }) } +// 批量导入 +export function batchImportCustomer(data: FormData) { + return request({ + url: '/customer/import', + method: 'post', + data, + }) +} + diff --git a/src/api/customer/sampleList.ts b/src/api/customer/sampleList.ts index 65acbce..17d4f14 100644 --- a/src/api/customer/sampleList.ts +++ b/src/api/customer/sampleList.ts @@ -76,3 +76,11 @@ data, }) } +// 批量导入 +export function batchImportSample(data: FormData) { + return request({ + url: '/customer/sample/import', + method: 'post', + data, + }) +} diff --git a/src/api/measure/source.ts b/src/api/measure/source.ts index cb7dee6..d59e346 100644 --- a/src/api/measure/source.ts +++ b/src/api/measure/source.ts @@ -90,3 +90,13 @@ data, }) } + +// 批量导入 +export function batchImportSource(data: FormData) { + return request({ + url: `${prefix}/supplier/import`, + method: 'post', + data, + }) +} + diff --git a/src/api/business/subpackage/record.ts b/src/api/business/subpackage/record.ts index 6042716..bf4fb0e 100644 --- a/src/api/business/subpackage/record.ts +++ b/src/api/business/subpackage/record.ts @@ -23,6 +23,15 @@ }) } +// 批量导入 +export function batchImportSubpackageRecord(data: FormData) { + return request({ + url: '/business/outsourcer/import', + method: 'post', + data, + }) +} + // 人员列表查询 export function getPersonList(data: { outsourcerId: string; offset?: number; limit?: number }) { return request({ @@ -78,7 +87,7 @@ } // 审批通过列表 -export function getListApprovePass(data: Object) { +export function getListApprovePass(data: any) { return request({ url: `/business/outsourceProject/check/listPage?offset=${data.offset}&limit=${data.limit}`, method: 'post', diff --git a/src/api/customer/customer.ts b/src/api/customer/customer.ts index dfae297..85584a7 100644 --- a/src/api/customer/customer.ts +++ b/src/api/customer/customer.ts @@ -101,3 +101,12 @@ }) } +// 批量导入 +export function batchImportCustomer(data: FormData) { + return request({ + url: '/customer/import', + method: 'post', + data, + }) +} + diff --git a/src/api/customer/sampleList.ts b/src/api/customer/sampleList.ts index 65acbce..17d4f14 100644 --- a/src/api/customer/sampleList.ts +++ b/src/api/customer/sampleList.ts @@ -76,3 +76,11 @@ data, }) } +// 批量导入 +export function batchImportSample(data: FormData) { + return request({ + url: '/customer/sample/import', + method: 'post', + data, + }) +} diff --git a/src/api/measure/source.ts b/src/api/measure/source.ts index cb7dee6..d59e346 100644 --- a/src/api/measure/source.ts +++ b/src/api/measure/source.ts @@ -90,3 +90,13 @@ data, }) } + +// 批量导入 +export function batchImportSource(data: FormData) { + return request({ + url: `${prefix}/supplier/import`, + method: 'post', + data, + }) +} + diff --git a/src/api/system/price.ts b/src/api/system/price.ts index f20de6a..393725e 100644 --- a/src/api/system/price.ts +++ b/src/api/system/price.ts @@ -70,3 +70,12 @@ data, }) } + +// 批量导入 +export function batchImportPrice(data: FormData) { + return request({ + url: '/price/import', + method: 'post', + data, + }) +} diff --git a/src/api/business/subpackage/record.ts b/src/api/business/subpackage/record.ts index 6042716..bf4fb0e 100644 --- a/src/api/business/subpackage/record.ts +++ b/src/api/business/subpackage/record.ts @@ -23,6 +23,15 @@ }) } +// 批量导入 +export function batchImportSubpackageRecord(data: FormData) { + return request({ + url: '/business/outsourcer/import', + method: 'post', + data, + }) +} + // 人员列表查询 export function getPersonList(data: { outsourcerId: string; offset?: number; limit?: number }) { return request({ @@ -78,7 +87,7 @@ } // 审批通过列表 -export function getListApprovePass(data: Object) { +export function getListApprovePass(data: any) { return request({ url: `/business/outsourceProject/check/listPage?offset=${data.offset}&limit=${data.limit}`, method: 'post', diff --git a/src/api/customer/customer.ts b/src/api/customer/customer.ts index dfae297..85584a7 100644 --- a/src/api/customer/customer.ts +++ b/src/api/customer/customer.ts @@ -101,3 +101,12 @@ }) } +// 批量导入 +export function batchImportCustomer(data: FormData) { + return request({ + url: '/customer/import', + method: 'post', + data, + }) +} + diff --git a/src/api/customer/sampleList.ts b/src/api/customer/sampleList.ts index 65acbce..17d4f14 100644 --- a/src/api/customer/sampleList.ts +++ b/src/api/customer/sampleList.ts @@ -76,3 +76,11 @@ data, }) } +// 批量导入 +export function batchImportSample(data: FormData) { + return request({ + url: '/customer/sample/import', + method: 'post', + data, + }) +} diff --git a/src/api/measure/source.ts b/src/api/measure/source.ts index cb7dee6..d59e346 100644 --- a/src/api/measure/source.ts +++ b/src/api/measure/source.ts @@ -90,3 +90,13 @@ data, }) } + +// 批量导入 +export function batchImportSource(data: FormData) { + return request({ + url: `${prefix}/supplier/import`, + method: 'post', + data, + }) +} + diff --git a/src/api/system/price.ts b/src/api/system/price.ts index f20de6a..393725e 100644 --- a/src/api/system/price.ts +++ b/src/api/system/price.ts @@ -70,3 +70,12 @@ data, }) } + +// 批量导入 +export function batchImportPrice(data: FormData) { + return request({ + url: '/price/import', + method: 'post', + data, + }) +} diff --git a/src/api/system/tool.ts b/src/api/system/tool.ts index ba9fa40..6b2f5f2 100644 --- a/src/api/system/tool.ts +++ b/src/api/system/tool.ts @@ -191,3 +191,4 @@ responseType: 'blob', }) } + diff --git a/src/api/business/subpackage/record.ts b/src/api/business/subpackage/record.ts index 6042716..bf4fb0e 100644 --- a/src/api/business/subpackage/record.ts +++ b/src/api/business/subpackage/record.ts @@ -23,6 +23,15 @@ }) } +// 批量导入 +export function batchImportSubpackageRecord(data: FormData) { + return request({ + url: '/business/outsourcer/import', + method: 'post', + data, + }) +} + // 人员列表查询 export function getPersonList(data: { outsourcerId: string; offset?: number; limit?: number }) { return request({ @@ -78,7 +87,7 @@ } // 审批通过列表 -export function getListApprovePass(data: Object) { +export function getListApprovePass(data: any) { return request({ url: `/business/outsourceProject/check/listPage?offset=${data.offset}&limit=${data.limit}`, method: 'post', diff --git a/src/api/customer/customer.ts b/src/api/customer/customer.ts index dfae297..85584a7 100644 --- a/src/api/customer/customer.ts +++ b/src/api/customer/customer.ts @@ -101,3 +101,12 @@ }) } +// 批量导入 +export function batchImportCustomer(data: FormData) { + return request({ + url: '/customer/import', + method: 'post', + data, + }) +} + diff --git a/src/api/customer/sampleList.ts b/src/api/customer/sampleList.ts index 65acbce..17d4f14 100644 --- a/src/api/customer/sampleList.ts +++ b/src/api/customer/sampleList.ts @@ -76,3 +76,11 @@ data, }) } +// 批量导入 +export function batchImportSample(data: FormData) { + return request({ + url: '/customer/sample/import', + method: 'post', + data, + }) +} diff --git a/src/api/measure/source.ts b/src/api/measure/source.ts index cb7dee6..d59e346 100644 --- a/src/api/measure/source.ts +++ b/src/api/measure/source.ts @@ -90,3 +90,13 @@ data, }) } + +// 批量导入 +export function batchImportSource(data: FormData) { + return request({ + url: `${prefix}/supplier/import`, + method: 'post', + data, + }) +} + diff --git a/src/api/system/price.ts b/src/api/system/price.ts index f20de6a..393725e 100644 --- a/src/api/system/price.ts +++ b/src/api/system/price.ts @@ -70,3 +70,12 @@ data, }) } + +// 批量导入 +export function batchImportPrice(data: FormData) { + return request({ + url: '/price/import', + method: 'post', + data, + }) +} diff --git a/src/api/system/tool.ts b/src/api/system/tool.ts index ba9fa40..6b2f5f2 100644 --- a/src/api/system/tool.ts +++ b/src/api/system/tool.ts @@ -191,3 +191,4 @@ responseType: 'blob', }) } + diff --git a/src/utils/useTemplateDownload.ts b/src/utils/useTemplateDownload.ts index 67feef4..a155045 100644 --- a/src/utils/useTemplateDownload.ts +++ b/src/utils/useTemplateDownload.ts @@ -5,7 +5,8 @@ * 模板下载 * @param modelName 模块名称 */ -export default function useTemplateDownload(modelName: string) { +export default function +useTemplateDownload(modelName: string) { const searchQuery = { // 获取模板文件名称请求参数 fileName: '', // 文件名称 moduleName: modelName, // 模块名 diff --git a/src/api/business/subpackage/record.ts b/src/api/business/subpackage/record.ts index 6042716..bf4fb0e 100644 --- a/src/api/business/subpackage/record.ts +++ b/src/api/business/subpackage/record.ts @@ -23,6 +23,15 @@ }) } +// 批量导入 +export function batchImportSubpackageRecord(data: FormData) { + return request({ + url: '/business/outsourcer/import', + method: 'post', + data, + }) +} + // 人员列表查询 export function getPersonList(data: { outsourcerId: string; offset?: number; limit?: number }) { return request({ @@ -78,7 +87,7 @@ } // 审批通过列表 -export function getListApprovePass(data: Object) { +export function getListApprovePass(data: any) { return request({ url: `/business/outsourceProject/check/listPage?offset=${data.offset}&limit=${data.limit}`, method: 'post', diff --git a/src/api/customer/customer.ts b/src/api/customer/customer.ts index dfae297..85584a7 100644 --- a/src/api/customer/customer.ts +++ b/src/api/customer/customer.ts @@ -101,3 +101,12 @@ }) } +// 批量导入 +export function batchImportCustomer(data: FormData) { + return request({ + url: '/customer/import', + method: 'post', + data, + }) +} + diff --git a/src/api/customer/sampleList.ts b/src/api/customer/sampleList.ts index 65acbce..17d4f14 100644 --- a/src/api/customer/sampleList.ts +++ b/src/api/customer/sampleList.ts @@ -76,3 +76,11 @@ data, }) } +// 批量导入 +export function batchImportSample(data: FormData) { + return request({ + url: '/customer/sample/import', + method: 'post', + data, + }) +} diff --git a/src/api/measure/source.ts b/src/api/measure/source.ts index cb7dee6..d59e346 100644 --- a/src/api/measure/source.ts +++ b/src/api/measure/source.ts @@ -90,3 +90,13 @@ data, }) } + +// 批量导入 +export function batchImportSource(data: FormData) { + return request({ + url: `${prefix}/supplier/import`, + method: 'post', + data, + }) +} + diff --git a/src/api/system/price.ts b/src/api/system/price.ts index f20de6a..393725e 100644 --- a/src/api/system/price.ts +++ b/src/api/system/price.ts @@ -70,3 +70,12 @@ data, }) } + +// 批量导入 +export function batchImportPrice(data: FormData) { + return request({ + url: '/price/import', + method: 'post', + data, + }) +} diff --git a/src/api/system/tool.ts b/src/api/system/tool.ts index ba9fa40..6b2f5f2 100644 --- a/src/api/system/tool.ts +++ b/src/api/system/tool.ts @@ -191,3 +191,4 @@ responseType: 'blob', }) } + diff --git a/src/utils/useTemplateDownload.ts b/src/utils/useTemplateDownload.ts index 67feef4..a155045 100644 --- a/src/utils/useTemplateDownload.ts +++ b/src/utils/useTemplateDownload.ts @@ -5,7 +5,8 @@ * 模板下载 * @param modelName 模块名称 */ -export default function useTemplateDownload(modelName: string) { +export default function +useTemplateDownload(modelName: string) { const searchQuery = { // 获取模板文件名称请求参数 fileName: '', // 文件名称 moduleName: modelName, // 模块名 diff --git a/src/views/business/schedule/task/taskList.vue b/src/views/business/schedule/task/taskList.vue index 6eeff55..cbc8dab 100644 --- a/src/views/business/schedule/task/taskList.vue +++ b/src/views/business/schedule/task/taskList.vue @@ -2,7 +2,7 @@ import { getCurrentInstance, ref } from 'vue' import type { Ref } from 'vue' import type { DateModelType } from 'element-plus' -import { ElLoading, ElMessage } from 'element-plus' +import { ElLoading, ElMessage, ElMessageBox } from 'element-plus' import type { ITaskList, ITaskQuery } from './task-interface' import DistributeDialog from './components/distributeDialog.vue' import BarCodeBind from '@/components/BarCodeBind/index.vue' @@ -13,6 +13,7 @@ import { exportTaskList, getTaskList } from '@/api/business/schedule/task' import type { dictType } from '@/global' import type { IMenu } from '@/components/buttonBox/buttonBox' +import { interchangeListUrge } from '@/api/business/schedule/interchangeList' const { proxy } = getCurrentInstance() as any const $router = useRouter() @@ -227,6 +228,27 @@ } } +// 催办 +const urge = (row: ITaskList) => { + ElMessageBox.confirm( + '确认催办吗?', + '提示', + { + confirmButtonText: '确认', + cancelButtonText: '取消', + type: 'warning', + }, + ) + .then(() => { + interchangeListUrge({ orderId: row.orderId, reason: '', sampleId: row.sampleId, status: '' }).then((res) => { + if (res.code === 200) { + ElMessage.success('已催办') + fetchData(true) + } + }) + }) +} + // 选择按钮变更 watch(active, (val: string) => { if (val === null) { @@ -324,7 +346,7 @@ {{ row.handOutProperty }} - + diff --git a/src/api/business/subpackage/record.ts b/src/api/business/subpackage/record.ts index 6042716..bf4fb0e 100644 --- a/src/api/business/subpackage/record.ts +++ b/src/api/business/subpackage/record.ts @@ -23,6 +23,15 @@ }) } +// 批量导入 +export function batchImportSubpackageRecord(data: FormData) { + return request({ + url: '/business/outsourcer/import', + method: 'post', + data, + }) +} + // 人员列表查询 export function getPersonList(data: { outsourcerId: string; offset?: number; limit?: number }) { return request({ @@ -78,7 +87,7 @@ } // 审批通过列表 -export function getListApprovePass(data: Object) { +export function getListApprovePass(data: any) { return request({ url: `/business/outsourceProject/check/listPage?offset=${data.offset}&limit=${data.limit}`, method: 'post', diff --git a/src/api/customer/customer.ts b/src/api/customer/customer.ts index dfae297..85584a7 100644 --- a/src/api/customer/customer.ts +++ b/src/api/customer/customer.ts @@ -101,3 +101,12 @@ }) } +// 批量导入 +export function batchImportCustomer(data: FormData) { + return request({ + url: '/customer/import', + method: 'post', + data, + }) +} + diff --git a/src/api/customer/sampleList.ts b/src/api/customer/sampleList.ts index 65acbce..17d4f14 100644 --- a/src/api/customer/sampleList.ts +++ b/src/api/customer/sampleList.ts @@ -76,3 +76,11 @@ data, }) } +// 批量导入 +export function batchImportSample(data: FormData) { + return request({ + url: '/customer/sample/import', + method: 'post', + data, + }) +} diff --git a/src/api/measure/source.ts b/src/api/measure/source.ts index cb7dee6..d59e346 100644 --- a/src/api/measure/source.ts +++ b/src/api/measure/source.ts @@ -90,3 +90,13 @@ data, }) } + +// 批量导入 +export function batchImportSource(data: FormData) { + return request({ + url: `${prefix}/supplier/import`, + method: 'post', + data, + }) +} + diff --git a/src/api/system/price.ts b/src/api/system/price.ts index f20de6a..393725e 100644 --- a/src/api/system/price.ts +++ b/src/api/system/price.ts @@ -70,3 +70,12 @@ data, }) } + +// 批量导入 +export function batchImportPrice(data: FormData) { + return request({ + url: '/price/import', + method: 'post', + data, + }) +} diff --git a/src/api/system/tool.ts b/src/api/system/tool.ts index ba9fa40..6b2f5f2 100644 --- a/src/api/system/tool.ts +++ b/src/api/system/tool.ts @@ -191,3 +191,4 @@ responseType: 'blob', }) } + diff --git a/src/utils/useTemplateDownload.ts b/src/utils/useTemplateDownload.ts index 67feef4..a155045 100644 --- a/src/utils/useTemplateDownload.ts +++ b/src/utils/useTemplateDownload.ts @@ -5,7 +5,8 @@ * 模板下载 * @param modelName 模块名称 */ -export default function useTemplateDownload(modelName: string) { +export default function +useTemplateDownload(modelName: string) { const searchQuery = { // 获取模板文件名称请求参数 fileName: '', // 文件名称 moduleName: modelName, // 模块名 diff --git a/src/views/business/schedule/task/taskList.vue b/src/views/business/schedule/task/taskList.vue index 6eeff55..cbc8dab 100644 --- a/src/views/business/schedule/task/taskList.vue +++ b/src/views/business/schedule/task/taskList.vue @@ -2,7 +2,7 @@ import { getCurrentInstance, ref } from 'vue' import type { Ref } from 'vue' import type { DateModelType } from 'element-plus' -import { ElLoading, ElMessage } from 'element-plus' +import { ElLoading, ElMessage, ElMessageBox } from 'element-plus' import type { ITaskList, ITaskQuery } from './task-interface' import DistributeDialog from './components/distributeDialog.vue' import BarCodeBind from '@/components/BarCodeBind/index.vue' @@ -13,6 +13,7 @@ import { exportTaskList, getTaskList } from '@/api/business/schedule/task' import type { dictType } from '@/global' import type { IMenu } from '@/components/buttonBox/buttonBox' +import { interchangeListUrge } from '@/api/business/schedule/interchangeList' const { proxy } = getCurrentInstance() as any const $router = useRouter() @@ -227,6 +228,27 @@ } } +// 催办 +const urge = (row: ITaskList) => { + ElMessageBox.confirm( + '确认催办吗?', + '提示', + { + confirmButtonText: '确认', + cancelButtonText: '取消', + type: 'warning', + }, + ) + .then(() => { + interchangeListUrge({ orderId: row.orderId, reason: '', sampleId: row.sampleId, status: '' }).then((res) => { + if (res.code === 200) { + ElMessage.success('已催办') + fetchData(true) + } + }) + }) +} + // 选择按钮变更 watch(active, (val: string) => { if (val === null) { @@ -324,7 +346,7 @@ {{ row.handOutProperty }} - + diff --git a/src/views/business/subpackage/record/list.vue b/src/views/business/subpackage/record/list.vue index d7b26a8..51abc6d 100644 --- a/src/views/business/subpackage/record/list.vue +++ b/src/views/business/subpackage/record/list.vue @@ -9,7 +9,8 @@ import type { TableColumn } from '@/components/NormalTable/table_interface' import { getDictByCode } from '@/api/system/dict' import type { dictType } from '@/views/device/receive/receive' -import { exportRecordList, getListPage } from '@/api/business/subpackage/record' +import useTemplateDownload from '@/utils/useTemplateDownload' +import { batchImportSubpackageRecord, exportRecordList, getListPage } from '@/api/business/subpackage/record' import { SCHEDULE } from '@/utils/scheduleDict' const { proxy } = getCurrentInstance() as any const loadingTable = ref(false) @@ -164,6 +165,47 @@ }) } +// -------------------------------------模板下载、批量导入----------------------------------- +// 模板下载 +const templateDownload = () => { + useTemplateDownload('分包方模块') +} +const fileRef = ref() // 文件上传input +const onFileChange = (event: any) => { + // 原生上传 + // console.log(event.target.files) + // if (event.target.files[0].type === 'application/pdf') { + if (event.target.files?.length !== 0) { + // 创建formdata对象 + const fd = new FormData() + fd.append('multipartFile', event.target.files[0]) + const loading = ElLoading.service({ + lock: true, + background: 'rgba(255, 255, 255, 0.8)', + }) + batchImportSubpackageRecord(fd).then((res) => { + if (res.code === 200) { + ElMessage.success('导入成功') + fetchData(true) + loading.close() + event.target.value = '' + } + else { + ElMessage.error(res.message) + } + }) + } +// } +// else { +// ElMessage.error('请上传pdf格式') +// } +} +// 批量导入 +const batchImport = () => { + fileRef.value.click() +} +// -------------------------------------------------------------------------------------------- + onMounted(async () => { await getDict() // 获取字典 fetchData(true) @@ -194,9 +236,12 @@ + { + ElMessageBox.confirm( + '确认催办吗?', + '提示', + { + confirmButtonText: '确认', + cancelButtonText: '取消', + type: 'warning', + }, + ) + .then(() => { + interchangeListUrge({ orderId: row.orderId, reason: '', sampleId: row.sampleId, status: '' }).then((res) => { + if (res.code === 200) { + ElMessage.success('已催办') + fetchData(true) + } + }) + }) +} + // 选择按钮变更 watch(active, (val: string) => { if (val === null) { @@ -324,7 +346,7 @@ {{ row.handOutProperty }} - + diff --git a/src/views/business/subpackage/record/list.vue b/src/views/business/subpackage/record/list.vue index d7b26a8..51abc6d 100644 --- a/src/views/business/subpackage/record/list.vue +++ b/src/views/business/subpackage/record/list.vue @@ -9,7 +9,8 @@ import type { TableColumn } from '@/components/NormalTable/table_interface' import { getDictByCode } from '@/api/system/dict' import type { dictType } from '@/views/device/receive/receive' -import { exportRecordList, getListPage } from '@/api/business/subpackage/record' +import useTemplateDownload from '@/utils/useTemplateDownload' +import { batchImportSubpackageRecord, exportRecordList, getListPage } from '@/api/business/subpackage/record' import { SCHEDULE } from '@/utils/scheduleDict' const { proxy } = getCurrentInstance() as any const loadingTable = ref(false) @@ -164,6 +165,47 @@ }) } +// -------------------------------------模板下载、批量导入----------------------------------- +// 模板下载 +const templateDownload = () => { + useTemplateDownload('分包方模块') +} +const fileRef = ref() // 文件上传input +const onFileChange = (event: any) => { + // 原生上传 + // console.log(event.target.files) + // if (event.target.files[0].type === 'application/pdf') { + if (event.target.files?.length !== 0) { + // 创建formdata对象 + const fd = new FormData() + fd.append('multipartFile', event.target.files[0]) + const loading = ElLoading.service({ + lock: true, + background: 'rgba(255, 255, 255, 0.8)', + }) + batchImportSubpackageRecord(fd).then((res) => { + if (res.code === 200) { + ElMessage.success('导入成功') + fetchData(true) + loading.close() + event.target.value = '' + } + else { + ElMessage.error(res.message) + } + }) + } +// } +// else { +// ElMessage.error('请上传pdf格式') +// } +} +// 批量导入 +const batchImport = () => { + fileRef.value.click() +} +// -------------------------------------------------------------------------------------------- + onMounted(async () => { await getDict() // 获取字典 fetchData(true) @@ -194,9 +236,12 @@ + ([]) -// 文件上传input -const fileRef = ref() // 数据查询 function fetchData(isNowPage = false) { loadingTable.value = true @@ -143,28 +142,6 @@ fetchData(true) } -// 上传文件/批量导入 -const onFileChange = (event: any) => { - // todo: 校验文件类型,调用上传接口 - if (event.target.files[0].type === 'application/pdf') { - if (event.target.files?.length !== 0) { - // 创建formdata对象 - // const fd = new FormData() - // fd.append('multipartFile', event.target.files[0]) - // uploadApi(fd).then((res) => { - // if (res.code === 200) { - // ElMessage.success('上传成功') - // } - // else { - // ElMessage.error(res.message) - // } - // }) - } - } - else { - ElMessage.error('请上传pdf格式') - } -} // 页数发生变化后的操作,可能是页码变化,可能是每页容量变化,此函数必写 const changePage = (val: { size?: number; page?: number }) => { if (val && val.size) { @@ -176,10 +153,6 @@ fetchData(true) } -// 点击批量导入 -const uploadAll = () => { - fileRef.value.click() -} // 添加客户 const add = () => { $router.push('/customerManage/add') @@ -231,6 +204,47 @@ } } +// -------------------------------------模板下载、批量导入----------------------------------- +// 模板下载 +const templateDownload = () => { + useTemplateDownload('客户模块') +} +const fileRef = ref() // 文件上传input +const onFileChange = (event: any) => { + // 原生上传 + // console.log(event.target.files) + // if (event.target.files[0].type === 'application/pdf') { + if (event.target.files?.length !== 0) { + // 创建formdata对象 + const fd = new FormData() + fd.append('multipartFile', event.target.files[0]) + const loading = ElLoading.service({ + lock: true, + background: 'rgba(255, 255, 255, 0.8)', + }) + batchImportCustomer(fd).then((res) => { + if (res.code === 200) { + ElMessage.success('导入成功') + fetchData(true) + loading.close() + event.target.value = '' + } + else { + ElMessage.error(res.message) + } + }) + } +// } +// else { +// ElMessage.error('请上传pdf格式') +// } +} +// 批量导入 +const batchImport = () => { + fileRef.value.click() +} +// -------------------------------------------------------------------------------------------- + fetchData(true) @@ -267,8 +281,8 @@ diff --git a/src/views/business/subpackage/record/list.vue b/src/views/business/subpackage/record/list.vue index d7b26a8..51abc6d 100644 --- a/src/views/business/subpackage/record/list.vue +++ b/src/views/business/subpackage/record/list.vue @@ -9,7 +9,8 @@ import type { TableColumn } from '@/components/NormalTable/table_interface' import { getDictByCode } from '@/api/system/dict' import type { dictType } from '@/views/device/receive/receive' -import { exportRecordList, getListPage } from '@/api/business/subpackage/record' +import useTemplateDownload from '@/utils/useTemplateDownload' +import { batchImportSubpackageRecord, exportRecordList, getListPage } from '@/api/business/subpackage/record' import { SCHEDULE } from '@/utils/scheduleDict' const { proxy } = getCurrentInstance() as any const loadingTable = ref(false) @@ -164,6 +165,47 @@ }) } +// -------------------------------------模板下载、批量导入----------------------------------- +// 模板下载 +const templateDownload = () => { + useTemplateDownload('分包方模块') +} +const fileRef = ref() // 文件上传input +const onFileChange = (event: any) => { + // 原生上传 + // console.log(event.target.files) + // if (event.target.files[0].type === 'application/pdf') { + if (event.target.files?.length !== 0) { + // 创建formdata对象 + const fd = new FormData() + fd.append('multipartFile', event.target.files[0]) + const loading = ElLoading.service({ + lock: true, + background: 'rgba(255, 255, 255, 0.8)', + }) + batchImportSubpackageRecord(fd).then((res) => { + if (res.code === 200) { + ElMessage.success('导入成功') + fetchData(true) + loading.close() + event.target.value = '' + } + else { + ElMessage.error(res.message) + } + }) + } +// } +// else { +// ElMessage.error('请上传pdf格式') +// } +} +// 批量导入 +const batchImport = () => { + fileRef.value.click() +} +// -------------------------------------------------------------------------------------------- + onMounted(async () => { await getDict() // 获取字典 fetchData(true) @@ -194,9 +236,12 @@ + ([]) -// 文件上传input -const fileRef = ref() // 数据查询 function fetchData(isNowPage = false) { loadingTable.value = true @@ -143,28 +142,6 @@ fetchData(true) } -// 上传文件/批量导入 -const onFileChange = (event: any) => { - // todo: 校验文件类型,调用上传接口 - if (event.target.files[0].type === 'application/pdf') { - if (event.target.files?.length !== 0) { - // 创建formdata对象 - // const fd = new FormData() - // fd.append('multipartFile', event.target.files[0]) - // uploadApi(fd).then((res) => { - // if (res.code === 200) { - // ElMessage.success('上传成功') - // } - // else { - // ElMessage.error(res.message) - // } - // }) - } - } - else { - ElMessage.error('请上传pdf格式') - } -} // 页数发生变化后的操作,可能是页码变化,可能是每页容量变化,此函数必写 const changePage = (val: { size?: number; page?: number }) => { if (val && val.size) { @@ -176,10 +153,6 @@ fetchData(true) } -// 点击批量导入 -const uploadAll = () => { - fileRef.value.click() -} // 添加客户 const add = () => { $router.push('/customerManage/add') @@ -231,6 +204,47 @@ } } +// -------------------------------------模板下载、批量导入----------------------------------- +// 模板下载 +const templateDownload = () => { + useTemplateDownload('客户模块') +} +const fileRef = ref() // 文件上传input +const onFileChange = (event: any) => { + // 原生上传 + // console.log(event.target.files) + // if (event.target.files[0].type === 'application/pdf') { + if (event.target.files?.length !== 0) { + // 创建formdata对象 + const fd = new FormData() + fd.append('multipartFile', event.target.files[0]) + const loading = ElLoading.service({ + lock: true, + background: 'rgba(255, 255, 255, 0.8)', + }) + batchImportCustomer(fd).then((res) => { + if (res.code === 200) { + ElMessage.success('导入成功') + fetchData(true) + loading.close() + event.target.value = '' + } + else { + ElMessage.error(res.message) + } + }) + } +// } +// else { +// ElMessage.error('请上传pdf格式') +// } +} +// 批量导入 +const batchImport = () => { + fileRef.value.click() +} +// -------------------------------------------------------------------------------------------- + fetchData(true) @@ -267,8 +281,8 @@