|
|
@@ -210,6 +210,9 @@
|
|
|
<!-- 按钮区保持不变 -->
|
|
|
<el-row class="flex justify-end mt-2">
|
|
|
<el-form-item>
|
|
|
+ <el-button type="primary" @click="handleBatchClaim" :disabled="selectedRows.length === 0">
|
|
|
+ 批量认领 ({{ selectedRows.length }})
|
|
|
+ </el-button>
|
|
|
<el-button @click="handleQuery">
|
|
|
<Icon icon="ep:search" class="mr-5px" />
|
|
|
搜索
|
|
|
@@ -265,6 +268,7 @@
|
|
|
border
|
|
|
class-name="cursor-pointer"
|
|
|
@row-dblclick="handleRowDblclick"
|
|
|
+ @selection-change="handleTableSelectionChange"
|
|
|
>
|
|
|
<el-table-column type="selection" align="center" width="55" />
|
|
|
<el-table-column
|
|
|
@@ -498,7 +502,7 @@
|
|
|
</el-button>
|
|
|
<el-button
|
|
|
v-if="
|
|
|
- scope.row.taskStatus == 400 &&
|
|
|
+ scope.row.taskStatus == 500 &&
|
|
|
scope.row.isClaim == true &&
|
|
|
scope.row.mainCheckerUser &&
|
|
|
userStore.user.id === scope.row.mainCheckerUser.id
|
|
|
@@ -902,6 +906,38 @@ const userColumns = ref<any[]>([
|
|
|
const printProjectDialogVisible = ref(false)
|
|
|
const printProjectList = ref([])
|
|
|
const selectionProject = ref([])
|
|
|
+
|
|
|
+// 批量认领相关
|
|
|
+const selectedRows = ref<any[]>([])
|
|
|
+const handleTableSelectionChange = (selection: any[]) => {
|
|
|
+ selectedRows.value = selection
|
|
|
+}
|
|
|
+
|
|
|
+const handleBatchClaim = () => {
|
|
|
+ if (selectedRows.value.length === 0) {
|
|
|
+ ElMessage.warning('请先选择要认领的设备')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ // 过滤出未认领的
|
|
|
+ const unClaimed = selectedRows.value.filter((row) => !row.isClaim)
|
|
|
+ if (unClaimed.length === 0) {
|
|
|
+ ElMessage.warning('所选设备均已认领')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ ElMessageBox.confirm(`确认批量认领 ${unClaimed.length} 个设备?`, '提示', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ type: 'warning'
|
|
|
+ })
|
|
|
+ .then(() => {
|
|
|
+ const orderItemIdList = unClaimed.map((row) => row.id)
|
|
|
+ BoilerTaskOrderApi.batchClaim({ orderItemIdList }).then(() => {
|
|
|
+ ElMessage.success(`成功认领 ${orderItemIdList.length} 个设备`)
|
|
|
+ getList()
|
|
|
+ })
|
|
|
+ })
|
|
|
+ .catch(() => {})
|
|
|
+}
|
|
|
const printProject = (reportDOList) => {
|
|
|
printProjectDialogVisible.value = true
|
|
|
printProjectList.value = reportDOList
|