diff --git a/src/api/business/schedule/task.ts b/src/api/business/schedule/task.ts index 625ded7..b9c1fa9 100644 --- a/src/api/business/schedule/task.ts +++ b/src/api/business/schedule/task.ts @@ -175,3 +175,20 @@ }) } +// 批量分发-任务分发 +export function batchExecute(data: object) { + return request({ + url: '/business/labExecutive/handOut/batch/execute', + method: 'post', + data, + }) +} + +// 批量分发-部门检测 +export function batchAllocateLab(data: object) { + return request({ + url: '/business/labExecutive/deptExecutive/batch/allocate', + method: 'post', + data, + }) +} diff --git a/src/api/business/schedule/task.ts b/src/api/business/schedule/task.ts index 625ded7..b9c1fa9 100644 --- a/src/api/business/schedule/task.ts +++ b/src/api/business/schedule/task.ts @@ -175,3 +175,20 @@ }) } +// 批量分发-任务分发 +export function batchExecute(data: object) { + return request({ + url: '/business/labExecutive/handOut/batch/execute', + method: 'post', + data, + }) +} + +// 批量分发-部门检测 +export function batchAllocateLab(data: object) { + return request({ + url: '/business/labExecutive/deptExecutive/batch/allocate', + method: 'post', + data, + }) +} diff --git a/src/assets/icons/icon-batch.svg b/src/assets/icons/icon-batch.svg new file mode 100644 index 0000000..dd196f0 --- /dev/null +++ b/src/assets/icons/icon-batch.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/api/business/schedule/task.ts b/src/api/business/schedule/task.ts index 625ded7..b9c1fa9 100644 --- a/src/api/business/schedule/task.ts +++ b/src/api/business/schedule/task.ts @@ -175,3 +175,20 @@ }) } +// 批量分发-任务分发 +export function batchExecute(data: object) { + return request({ + url: '/business/labExecutive/handOut/batch/execute', + method: 'post', + data, + }) +} + +// 批量分发-部门检测 +export function batchAllocateLab(data: object) { + return request({ + url: '/business/labExecutive/deptExecutive/batch/allocate', + method: 'post', + data, + }) +} diff --git a/src/assets/icons/icon-batch.svg b/src/assets/icons/icon-batch.svg new file mode 100644 index 0000000..dd196f0 --- /dev/null +++ b/src/assets/icons/icon-batch.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/views/business/lab/deptMeasure/deptMeasureList.vue b/src/views/business/lab/deptMeasure/deptMeasureList.vue index 1f5745a..7346023 100644 --- a/src/views/business/lab/deptMeasure/deptMeasureList.vue +++ b/src/views/business/lab/deptMeasure/deptMeasureList.vue @@ -6,6 +6,7 @@ import { ElLoading, ElMessage, ElMessageBox } from 'element-plus' import DistributeDialog from '../../schedule/task/components/distributeDialog.vue' import RollbackDialog from './../components/rollbackDialog.vue' +import batchDistributeDialog from '@/views/business/schedule/task/components/batchDistributeDialog.vue' import type { ILabQuery, ITaskList, ITaskQuery } from '@/views/business/schedule/task/task-interface' import type { TableColumn } from '@/components/NormalTable/table_interface' import { printJSON } from '@/utils/printUtils' @@ -20,6 +21,7 @@ // 右上角按钮 const menu = ref([]) // 右上角审批状态按钮组合 const active = ref('') // 选中的按钮 +const tableRef = ref() // 查询条件 const timeRange = ref<[DateModelType, DateModelType]>(['', '']) const listQuery: Ref = ref({ @@ -114,6 +116,7 @@ // 表格加载状态 const loadingTable = ref(false) // 选中的内容 +const checkoutIdList = ref([]) const checkoutList = ref([]) // 数据查询 @@ -138,7 +141,8 @@ } // 多选发生改变时 function handleSelectionChange(e: any) { - checkoutList.value = e.map((item: { id: string }) => item.id) + checkoutIdList.value = e.map((item: { id: string }) => item.id) + checkoutList.value = e } // 点击搜索 @@ -208,7 +212,7 @@ // customerName: listQuery.value.customerName, // 公司名称 // customerNo: listQuery.value.customerNo, // 任务分发编号 // grade: listQuery.value.grade, // 履约评级 - // ids: checkoutList.value, + // ids: checkoutIdList.value, // } // exportCustomerList(params).then((res) => { // const blob = new Blob([res.data]) @@ -230,11 +234,11 @@ displayName: item.text, } }) - if (checkoutList.value.length <= 0 && list.value.length > 0) { + if (checkoutIdList.value.length <= 0 && list.value.length > 0) { printJSON(list.value, properties, '我的检测列表') } - else if (checkoutList.value.length > 0) { - const printList = list.value.filter((item: ITaskList) => checkoutList.value.includes(item.sampleId)) + else if (checkoutIdList.value.length > 0) { + const printList = list.value.filter((item: ITaskList) => checkoutIdList.value.includes(item.sampleId)) printJSON(printList, properties, '我的检测列表') } else { @@ -295,9 +299,28 @@ window.sessionStorage.setItem('deptMeasureActive', val) // clearList() listQuery.value.measureStatus = active.value - + tableRef.value.clearMulti() fetchData(true) } + +// ----------------------------------------------------批量分配------------------------------------------------ +const batchDistributeDialogRef = ref() +const batchAllocation = () => { + if (!checkoutList.value.length) { + ElMessage.warning('请先选中表格里的数据') + return false + } + // if(checkoutList.value.every) + batchDistributeDialogRef.value.initDialog(checkoutList.value, 'lab') +} + +// 批量分发完成 +const batchDistributeSuccess = () => { + tableRef.value.clearMulti() + fetchData() +} +// ---------------------------------------------------------------------------------------- + // 时间变更 watch(timeRange, (val) => { if (val) { @@ -397,9 +420,11 @@ @@ -425,6 +450,8 @@ + + diff --git a/src/api/business/schedule/task.ts b/src/api/business/schedule/task.ts index 625ded7..b9c1fa9 100644 --- a/src/api/business/schedule/task.ts +++ b/src/api/business/schedule/task.ts @@ -175,3 +175,20 @@ }) } +// 批量分发-任务分发 +export function batchExecute(data: object) { + return request({ + url: '/business/labExecutive/handOut/batch/execute', + method: 'post', + data, + }) +} + +// 批量分发-部门检测 +export function batchAllocateLab(data: object) { + return request({ + url: '/business/labExecutive/deptExecutive/batch/allocate', + method: 'post', + data, + }) +} diff --git a/src/assets/icons/icon-batch.svg b/src/assets/icons/icon-batch.svg new file mode 100644 index 0000000..dd196f0 --- /dev/null +++ b/src/assets/icons/icon-batch.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/views/business/lab/deptMeasure/deptMeasureList.vue b/src/views/business/lab/deptMeasure/deptMeasureList.vue index 1f5745a..7346023 100644 --- a/src/views/business/lab/deptMeasure/deptMeasureList.vue +++ b/src/views/business/lab/deptMeasure/deptMeasureList.vue @@ -6,6 +6,7 @@ import { ElLoading, ElMessage, ElMessageBox } from 'element-plus' import DistributeDialog from '../../schedule/task/components/distributeDialog.vue' import RollbackDialog from './../components/rollbackDialog.vue' +import batchDistributeDialog from '@/views/business/schedule/task/components/batchDistributeDialog.vue' import type { ILabQuery, ITaskList, ITaskQuery } from '@/views/business/schedule/task/task-interface' import type { TableColumn } from '@/components/NormalTable/table_interface' import { printJSON } from '@/utils/printUtils' @@ -20,6 +21,7 @@ // 右上角按钮 const menu = ref([]) // 右上角审批状态按钮组合 const active = ref('') // 选中的按钮 +const tableRef = ref() // 查询条件 const timeRange = ref<[DateModelType, DateModelType]>(['', '']) const listQuery: Ref = ref({ @@ -114,6 +116,7 @@ // 表格加载状态 const loadingTable = ref(false) // 选中的内容 +const checkoutIdList = ref([]) const checkoutList = ref([]) // 数据查询 @@ -138,7 +141,8 @@ } // 多选发生改变时 function handleSelectionChange(e: any) { - checkoutList.value = e.map((item: { id: string }) => item.id) + checkoutIdList.value = e.map((item: { id: string }) => item.id) + checkoutList.value = e } // 点击搜索 @@ -208,7 +212,7 @@ // customerName: listQuery.value.customerName, // 公司名称 // customerNo: listQuery.value.customerNo, // 任务分发编号 // grade: listQuery.value.grade, // 履约评级 - // ids: checkoutList.value, + // ids: checkoutIdList.value, // } // exportCustomerList(params).then((res) => { // const blob = new Blob([res.data]) @@ -230,11 +234,11 @@ displayName: item.text, } }) - if (checkoutList.value.length <= 0 && list.value.length > 0) { + if (checkoutIdList.value.length <= 0 && list.value.length > 0) { printJSON(list.value, properties, '我的检测列表') } - else if (checkoutList.value.length > 0) { - const printList = list.value.filter((item: ITaskList) => checkoutList.value.includes(item.sampleId)) + else if (checkoutIdList.value.length > 0) { + const printList = list.value.filter((item: ITaskList) => checkoutIdList.value.includes(item.sampleId)) printJSON(printList, properties, '我的检测列表') } else { @@ -295,9 +299,28 @@ window.sessionStorage.setItem('deptMeasureActive', val) // clearList() listQuery.value.measureStatus = active.value - + tableRef.value.clearMulti() fetchData(true) } + +// ----------------------------------------------------批量分配------------------------------------------------ +const batchDistributeDialogRef = ref() +const batchAllocation = () => { + if (!checkoutList.value.length) { + ElMessage.warning('请先选中表格里的数据') + return false + } + // if(checkoutList.value.every) + batchDistributeDialogRef.value.initDialog(checkoutList.value, 'lab') +} + +// 批量分发完成 +const batchDistributeSuccess = () => { + tableRef.value.clearMulti() + fetchData() +} +// ---------------------------------------------------------------------------------------- + // 时间变更 watch(timeRange, (val) => { if (val) { @@ -397,9 +420,11 @@ @@ -425,6 +450,8 @@ + + diff --git a/src/views/business/schedule/task/components/batchDistributeDialog.vue b/src/views/business/schedule/task/components/batchDistributeDialog.vue new file mode 100644 index 0000000..b818fed --- /dev/null +++ b/src/views/business/schedule/task/components/batchDistributeDialog.vue @@ -0,0 +1,211 @@ + + + + + + diff --git a/src/api/business/schedule/task.ts b/src/api/business/schedule/task.ts index 625ded7..b9c1fa9 100644 --- a/src/api/business/schedule/task.ts +++ b/src/api/business/schedule/task.ts @@ -175,3 +175,20 @@ }) } +// 批量分发-任务分发 +export function batchExecute(data: object) { + return request({ + url: '/business/labExecutive/handOut/batch/execute', + method: 'post', + data, + }) +} + +// 批量分发-部门检测 +export function batchAllocateLab(data: object) { + return request({ + url: '/business/labExecutive/deptExecutive/batch/allocate', + method: 'post', + data, + }) +} diff --git a/src/assets/icons/icon-batch.svg b/src/assets/icons/icon-batch.svg new file mode 100644 index 0000000..dd196f0 --- /dev/null +++ b/src/assets/icons/icon-batch.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/views/business/lab/deptMeasure/deptMeasureList.vue b/src/views/business/lab/deptMeasure/deptMeasureList.vue index 1f5745a..7346023 100644 --- a/src/views/business/lab/deptMeasure/deptMeasureList.vue +++ b/src/views/business/lab/deptMeasure/deptMeasureList.vue @@ -6,6 +6,7 @@ import { ElLoading, ElMessage, ElMessageBox } from 'element-plus' import DistributeDialog from '../../schedule/task/components/distributeDialog.vue' import RollbackDialog from './../components/rollbackDialog.vue' +import batchDistributeDialog from '@/views/business/schedule/task/components/batchDistributeDialog.vue' import type { ILabQuery, ITaskList, ITaskQuery } from '@/views/business/schedule/task/task-interface' import type { TableColumn } from '@/components/NormalTable/table_interface' import { printJSON } from '@/utils/printUtils' @@ -20,6 +21,7 @@ // 右上角按钮 const menu = ref([]) // 右上角审批状态按钮组合 const active = ref('') // 选中的按钮 +const tableRef = ref() // 查询条件 const timeRange = ref<[DateModelType, DateModelType]>(['', '']) const listQuery: Ref = ref({ @@ -114,6 +116,7 @@ // 表格加载状态 const loadingTable = ref(false) // 选中的内容 +const checkoutIdList = ref([]) const checkoutList = ref([]) // 数据查询 @@ -138,7 +141,8 @@ } // 多选发生改变时 function handleSelectionChange(e: any) { - checkoutList.value = e.map((item: { id: string }) => item.id) + checkoutIdList.value = e.map((item: { id: string }) => item.id) + checkoutList.value = e } // 点击搜索 @@ -208,7 +212,7 @@ // customerName: listQuery.value.customerName, // 公司名称 // customerNo: listQuery.value.customerNo, // 任务分发编号 // grade: listQuery.value.grade, // 履约评级 - // ids: checkoutList.value, + // ids: checkoutIdList.value, // } // exportCustomerList(params).then((res) => { // const blob = new Blob([res.data]) @@ -230,11 +234,11 @@ displayName: item.text, } }) - if (checkoutList.value.length <= 0 && list.value.length > 0) { + if (checkoutIdList.value.length <= 0 && list.value.length > 0) { printJSON(list.value, properties, '我的检测列表') } - else if (checkoutList.value.length > 0) { - const printList = list.value.filter((item: ITaskList) => checkoutList.value.includes(item.sampleId)) + else if (checkoutIdList.value.length > 0) { + const printList = list.value.filter((item: ITaskList) => checkoutIdList.value.includes(item.sampleId)) printJSON(printList, properties, '我的检测列表') } else { @@ -295,9 +299,28 @@ window.sessionStorage.setItem('deptMeasureActive', val) // clearList() listQuery.value.measureStatus = active.value - + tableRef.value.clearMulti() fetchData(true) } + +// ----------------------------------------------------批量分配------------------------------------------------ +const batchDistributeDialogRef = ref() +const batchAllocation = () => { + if (!checkoutList.value.length) { + ElMessage.warning('请先选中表格里的数据') + return false + } + // if(checkoutList.value.every) + batchDistributeDialogRef.value.initDialog(checkoutList.value, 'lab') +} + +// 批量分发完成 +const batchDistributeSuccess = () => { + tableRef.value.clearMulti() + fetchData() +} +// ---------------------------------------------------------------------------------------- + // 时间变更 watch(timeRange, (val) => { if (val) { @@ -397,9 +420,11 @@ @@ -425,6 +450,8 @@ + + diff --git a/src/views/business/schedule/task/components/batchDistributeDialog.vue b/src/views/business/schedule/task/components/batchDistributeDialog.vue new file mode 100644 index 0000000..b818fed --- /dev/null +++ b/src/views/business/schedule/task/components/batchDistributeDialog.vue @@ -0,0 +1,211 @@ + + + + + + diff --git a/src/views/business/schedule/task/taskList.vue b/src/views/business/schedule/task/taskList.vue index 21f2401..2aa6b0c 100644 --- a/src/views/business/schedule/task/taskList.vue +++ b/src/views/business/schedule/task/taskList.vue @@ -5,6 +5,7 @@ import { ElLoading, ElMessage, ElMessageBox } from 'element-plus' import type { ITaskList, ITaskQuery } from './task-interface' import DistributeDialog from './components/distributeDialog.vue' +import batchDistributeDialog from './components/batchDistributeDialog.vue' import BarCodeBind from '@/components/BarCodeBind/index.vue' import type { TableColumn } from '@/components/NormalTable/table_interface' import { printJSON } from '@/utils/printUtils' @@ -110,8 +111,8 @@ const total = ref(0) // 表格加载状态 const loadingTable = ref(false) -// 选中的内容 -const checkoutList = ref([]) +const checkoutIdList = ref([]) // 选中的内容 +const checkoutList: any = ref([]) // 数据查询 function fetchData(isNowPage = false) { @@ -134,7 +135,8 @@ } // 多选发生改变时 function handleSelectionChange(e: any) { - checkoutList.value = e.map((item: { sampleId: string }) => item.sampleId) + checkoutIdList.value = e.map((item: { sampleId: string }) => item.sampleId) + checkoutList.value = e } // 点击搜索 @@ -210,6 +212,23 @@ }) } // ----------------------------------------------------------------------------------- +const batchDistributeDialogRef = ref() +const tableRef = ref() +// 点击批量分发 +const batchDistribute = () => { + console.log('点击批量分发') + if (!checkoutIdList.value.length) { + ElMessage.warning('请先选中表格里的数据') + return false + } + batchDistributeDialogRef.value.initDialog(checkoutList.value) +} + +// 批量分发完成 +const batchDistributeSuccess = () => { + tableRef.value.clearMulti() + fetchData() +} // 导出 const exportAll = () => { @@ -233,7 +252,7 @@ } const params = { ...obj, - ids: checkoutList.value, + ids: checkoutIdList.value, } exportTaskList(params).then((res) => { const blob = new Blob([res.data]) @@ -255,11 +274,11 @@ displayName: item.text, } }) - if (checkoutList.value.length <= 0 && list.value.length > 0) { + if (checkoutIdList.value.length <= 0 && list.value.length > 0) { printJSON(list.value, properties, '任务分发列表') } - else if (checkoutList.value.length > 0) { - const printList = list.value.filter((item: ITaskList) => checkoutList.value.includes(item.sampleId)) + else if (checkoutIdList.value.length > 0) { + const printList = list.value.filter((item: ITaskList) => checkoutIdList.value.includes(item.sampleId)) printJSON(printList, properties, '任务分发列表') } else { @@ -287,7 +306,6 @@ }) }) } - // 选择按钮变更 watch(active, (val: string) => { if (val === null) { @@ -296,6 +314,7 @@ } active.value = val window.sessionStorage.setItem('taskActive', val) + tableRef.value && tableRef.value.clearMulti() fetchData(false) }) watch(timeRange, (val: any) => { @@ -358,6 +377,7 @@ @@ -418,6 +439,8 @@ + +