|
@@ -63,22 +63,29 @@
|
|
|
<el-button @click="handleRestParams">重置</el-button>
|
|
<el-button @click="handleRestParams">重置</el-button>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
+ <div style="margin-bottom: 20px">
|
|
|
|
|
+ <el-button type="primary" @click="handleOpenBatchSign">批量签署</el-button>
|
|
|
|
|
+ </div>
|
|
|
|
|
|
|
|
<div class="table-content">
|
|
<div class="table-content">
|
|
|
- <el-table :data="tableData.data">
|
|
|
|
|
|
|
+ <el-table ref="multipleTableRef" :data="tableData.data" @selection-change="handleSelectionChange">
|
|
|
|
|
+ <el-table-column type="selection" :selectable="selectable" width="55" />
|
|
|
<el-table-column label="责任书名称" prop="responsibilityName" width="180" />
|
|
<el-table-column label="责任书名称" prop="responsibilityName" width="180" />
|
|
|
<el-table-column label="状态" prop="statusName" width="100" />
|
|
<el-table-column label="状态" prop="statusName" width="100" />
|
|
|
- <el-table-column label="所属部门" prop="departmentName" width="180" />
|
|
|
|
|
|
|
+ <el-table-column label="类别" prop="departmentName" width="180" />
|
|
|
<el-table-column label="下发数" prop="issuedQuantity" width="120" />
|
|
<el-table-column label="下发数" prop="issuedQuantity" width="120" />
|
|
|
<el-table-column label="签署人数" prop="signedQuantity" width="120" />
|
|
<el-table-column label="签署人数" prop="signedQuantity" width="120" />
|
|
|
<el-table-column label="签署比例" prop="signedRatio" width="120" />
|
|
<el-table-column label="签署比例" prop="signedRatio" width="120" />
|
|
|
<el-table-column label="分组名称" prop="userGroupName" width="150" />
|
|
<el-table-column label="分组名称" prop="userGroupName" width="150" />
|
|
|
<el-table-column label="计划完成时间" prop="planEndTime" width="150" />
|
|
<el-table-column label="计划完成时间" prop="planEndTime" width="150" />
|
|
|
- <el-table-column fixed="right" min-width="300" label="操作">
|
|
|
|
|
|
|
+ <el-table-column fixed="right" min-width="200" label="操作">
|
|
|
<template #default="scope">
|
|
<template #default="scope">
|
|
|
<div style="display: flex">
|
|
<div style="display: flex">
|
|
|
<el-button
|
|
<el-button
|
|
|
- v-if="scope.row.status === 2"
|
|
|
|
|
|
|
+ v-if="
|
|
|
|
|
+ scope.row.status === 2 &&
|
|
|
|
|
+ (scope.row.departmentName !== '员工' || scope.row.departmentName !== '常驻供应商')
|
|
|
|
|
+ "
|
|
|
type="primary"
|
|
type="primary"
|
|
|
link
|
|
link
|
|
|
@click="
|
|
@click="
|
|
@@ -90,8 +97,20 @@
|
|
|
},
|
|
},
|
|
|
})
|
|
})
|
|
|
"
|
|
"
|
|
|
- >签署</el-button
|
|
|
|
|
>
|
|
>
|
|
|
|
|
+ 签署
|
|
|
|
|
+ </el-button>
|
|
|
|
|
+ <el-button
|
|
|
|
|
+ v-if="
|
|
|
|
|
+ scope.row.status === 2 &&
|
|
|
|
|
+ (scope.row.departmentName === '员工' || scope.row.departmentName === '常驻供应商')
|
|
|
|
|
+ "
|
|
|
|
|
+ type="primary"
|
|
|
|
|
+ link
|
|
|
|
|
+ @click="handleConfirm(scope)"
|
|
|
|
|
+ >
|
|
|
|
|
+ 确认
|
|
|
|
|
+ </el-button>
|
|
|
<el-dropdown trigger="click">
|
|
<el-dropdown trigger="click">
|
|
|
<el-button type="primary" link>反馈</el-button>
|
|
<el-button type="primary" link>反馈</el-button>
|
|
|
<template #dropdown>
|
|
<template #dropdown>
|
|
@@ -141,12 +160,25 @@
|
|
|
</div>
|
|
</div>
|
|
|
</main>
|
|
</main>
|
|
|
</div>
|
|
</div>
|
|
|
- <IssueSafetyResponsibility
|
|
|
|
|
|
|
+ <!-- <IssueSafetyResponsibility
|
|
|
:groupList="groupList"
|
|
:groupList="groupList"
|
|
|
:currentRowData="currentRowData"
|
|
:currentRowData="currentRowData"
|
|
|
ref="issueSafetyResponsibilityRef"
|
|
ref="issueSafetyResponsibilityRef"
|
|
|
@submit="handleSubmit"
|
|
@submit="handleSubmit"
|
|
|
- />
|
|
|
|
|
|
|
+ /> -->
|
|
|
|
|
+ <el-dialog title="批量签署" v-if="batchSignDialogVisible" v-model="batchSignDialogVisible" width="600">
|
|
|
|
|
+ <el-form-item label="">
|
|
|
|
|
+ <UploadFiles label="上传附件" :maxCount="1" @uploadSuccess="handleUploadSuccess" :fileList="attachment" />
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ <template #footer>
|
|
|
|
|
+ <div class="dialog-footer">
|
|
|
|
|
+ <el-button @click="handleCloseBatchSign">取消</el-button>
|
|
|
|
|
+ <el-button type="primary" @click="handleSafetyResponsibilityDeptBatchSign" :loading="submitLoading">
|
|
|
|
|
+ 保存
|
|
|
|
|
+ </el-button>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-dialog>
|
|
|
</template>
|
|
</template>
|
|
|
<script lang="ts" setup>
|
|
<script lang="ts" setup>
|
|
|
import { onMounted, ref, reactive } from 'vue';
|
|
import { onMounted, ref, reactive } from 'vue';
|
|
@@ -157,18 +189,25 @@
|
|
|
safetyResponsibilityDeptQueryPage,
|
|
safetyResponsibilityDeptQueryPage,
|
|
|
safetyResponsibilityAdminDelete,
|
|
safetyResponsibilityAdminDelete,
|
|
|
safetyResponsibilityAdminIssuedSafety,
|
|
safetyResponsibilityAdminIssuedSafety,
|
|
|
|
|
+ safetyResponsibilityDeptSignOrFeedback,
|
|
|
|
|
+ safetyResponsibilityDeptBatchSign,
|
|
|
} from '@/api/production-safety/responsibility-implementation';
|
|
} from '@/api/production-safety/responsibility-implementation';
|
|
|
import { omit } from 'lodash-es';
|
|
import { omit } from 'lodash-es';
|
|
|
import { queryUserGroupPage } from '@/api/system/person-group';
|
|
import { queryUserGroupPage } from '@/api/system/person-group';
|
|
|
|
|
+ import { formatAttachmentList } from '@/components/UploadFiles/utils';
|
|
|
|
|
+
|
|
|
|
|
+ import UploadFiles from '@/components/UploadFiles/UploadFiles.vue';
|
|
|
|
|
|
|
|
import { unformatAttachment } from '@/components/UploadFiles/utils';
|
|
import { unformatAttachment } from '@/components/UploadFiles/utils';
|
|
|
import { downloadFile } from '@/views/disaster/utils';
|
|
import { downloadFile } from '@/views/disaster/utils';
|
|
|
- import IssueSafetyResponsibility from './components/IssueSafetyResponsibility.vue';
|
|
|
|
|
|
|
+ import { el } from 'element-plus/es/locale';
|
|
|
|
|
+ // import IssueSafetyResponsibility from './components/IssueSafetyResponsibility.vue';
|
|
|
const router = useRouter();
|
|
const router = useRouter();
|
|
|
- const issueSafetyResponsibilityRef = ref<any>(null);
|
|
|
|
|
- const currentRowData = ref<any>(null);
|
|
|
|
|
|
|
+ const batchSignDialogVisible = ref(false);
|
|
|
|
|
+ const selectedRows = ref([]);
|
|
|
const activeTab = ref('');
|
|
const activeTab = ref('');
|
|
|
const groupList = ref<any[]>([]);
|
|
const groupList = ref<any[]>([]);
|
|
|
|
|
+ const submitLoading = ref(false);
|
|
|
const queryParams = reactive<any>({
|
|
const queryParams = reactive<any>({
|
|
|
pageNumber: 1,
|
|
pageNumber: 1,
|
|
|
pageSize: 10,
|
|
pageSize: 10,
|
|
@@ -180,12 +219,27 @@
|
|
|
responsibilityPersonId: '',
|
|
responsibilityPersonId: '',
|
|
|
},
|
|
},
|
|
|
});
|
|
});
|
|
|
-
|
|
|
|
|
|
|
+ const multipleTableRef = ref<any>();
|
|
|
const tableData = reactive({
|
|
const tableData = reactive({
|
|
|
data: [],
|
|
data: [],
|
|
|
total: 0,
|
|
total: 0,
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
|
|
+ const attachment = ref<any[]>([]);
|
|
|
|
|
+
|
|
|
|
|
+ const selectable = (row) => {
|
|
|
|
|
+ return row.status === 2 && (row.departmentName !== '员工' || row.departmentName !== '常驻供应商');
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
|
|
+ const handleSelectionChange = (val) => {
|
|
|
|
|
+ selectedRows.value = val;
|
|
|
|
|
+ console.log('当前勾选的数据:', selectedRows.value);
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
|
|
+ const handleUploadSuccess = (fileList) => {
|
|
|
|
|
+ attachment.value = fileList;
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
const handleQueryUserGroupPage = () => {
|
|
const handleQueryUserGroupPage = () => {
|
|
|
queryUserGroupPage({
|
|
queryUserGroupPage({
|
|
|
pageNumber: 1,
|
|
pageNumber: 1,
|
|
@@ -195,11 +249,65 @@
|
|
|
});
|
|
});
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
- const handleIssueSafetyResponsibility = (scope) => {
|
|
|
|
|
- currentRowData.value = scope.row;
|
|
|
|
|
- issueSafetyResponsibilityRef.value.dialogShow();
|
|
|
|
|
|
|
+ const handleOpenBatchSign = () => {
|
|
|
|
|
+ if (!selectedRows.value.length) {
|
|
|
|
|
+ ElMessage.warning('请选择需要批量签署的责任书');
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ if (!selectedRows.value.every((item: any, i, data: any[]) => item.departmentName === data[0]?.departmentName)) {
|
|
|
|
|
+ ElMessage.warning('请选择相同类别的责任书');
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ batchSignDialogVisible.value = true;
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
|
|
+ const handleCloseBatchSign = () => {
|
|
|
|
|
+ attachment.value = [];
|
|
|
|
|
+ selectedRows.value = [];
|
|
|
|
|
+ batchSignDialogVisible.value = false;
|
|
|
|
|
+ multipleTableRef.value.clearSelection();
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
|
|
+ const handleSafetyResponsibilityDeptBatchSign = async () => {
|
|
|
|
|
+ if (!attachment.value.length) {
|
|
|
|
|
+ ElMessage.warning('请上传附件');
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ submitLoading.value = true;
|
|
|
|
|
+
|
|
|
|
|
+ const attachments = await formatAttachmentList(attachment.value);
|
|
|
|
|
+ safetyResponsibilityDeptBatchSign({
|
|
|
|
|
+ ids: selectedRows.value.map((item: any) => item.id)?.join(','),
|
|
|
|
|
+ attachment: JSON.stringify(attachments),
|
|
|
|
|
+ })
|
|
|
|
|
+ .then(() => {
|
|
|
|
|
+ ElMessage.success('批量签署成功');
|
|
|
|
|
+ queryTableList();
|
|
|
|
|
+ handleCloseBatchSign();
|
|
|
|
|
+ })
|
|
|
|
|
+ .finally(() => {
|
|
|
|
|
+ submitLoading.value = false;
|
|
|
|
|
+ });
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
|
|
+ const handleConfirm = (scope) => {
|
|
|
|
|
+ safetyResponsibilityDeptSignOrFeedback({
|
|
|
|
|
+ id: scope.row.id,
|
|
|
|
|
+ updateType: 0,
|
|
|
|
|
+ })
|
|
|
|
|
+ .then(() => {
|
|
|
|
|
+ ElMessage.success('确认成功');
|
|
|
|
|
+ router.push({
|
|
|
|
|
+ name: 'responsibilityAgreeManageDept',
|
|
|
|
|
+ });
|
|
|
|
|
+ })
|
|
|
|
|
+ .finally(() => {});
|
|
|
|
|
+ };
|
|
|
|
|
+ // const handleIssueSafetyResponsibility = (scope) => {
|
|
|
|
|
+ // currentRowData.value = scope.row;
|
|
|
|
|
+ // issueSafetyResponsibilityRef.value.dialogShow();
|
|
|
|
|
+ // };
|
|
|
|
|
+
|
|
|
const handleSizeChange = (value) => {};
|
|
const handleSizeChange = (value) => {};
|
|
|
const handleCurrentChange = (value) => {
|
|
const handleCurrentChange = (value) => {
|
|
|
queryParams.pageNumber = value;
|
|
queryParams.pageNumber = value;
|
|
@@ -212,12 +320,12 @@
|
|
|
downloadFile(item.fileUrl, item.fileName);
|
|
downloadFile(item.fileUrl, item.fileName);
|
|
|
});
|
|
});
|
|
|
};
|
|
};
|
|
|
- const handleConfirmDeleteRow = (scope) => {
|
|
|
|
|
- safetyResponsibilityAdminDelete(scope.row.id).then(() => {
|
|
|
|
|
- ElMessage.success('删除成功!');
|
|
|
|
|
- queryTableList();
|
|
|
|
|
- });
|
|
|
|
|
- };
|
|
|
|
|
|
|
+ // const handleConfirmDeleteRow = (scope) => {
|
|
|
|
|
+ // safetyResponsibilityAdminDelete(scope.row.id).then(() => {
|
|
|
|
|
+ // ElMessage.success('删除成功!');
|
|
|
|
|
+ // queryTableList();
|
|
|
|
|
+ // });
|
|
|
|
|
+ // };
|
|
|
const queryTableList = () => {
|
|
const queryTableList = () => {
|
|
|
safetyResponsibilityDeptQueryPage({
|
|
safetyResponsibilityDeptQueryPage({
|
|
|
...queryParams,
|
|
...queryParams,
|
|
@@ -250,24 +358,24 @@
|
|
|
queryTableList();
|
|
queryTableList();
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
- const handleSubmit = (formData) => {
|
|
|
|
|
- issueSafetyResponsibilityRef.value.submitLoading = true;
|
|
|
|
|
- safetyResponsibilityAdminIssuedSafety({
|
|
|
|
|
- ...formData,
|
|
|
|
|
- userGroupId: formData.userGroupId.join(','),
|
|
|
|
|
- // planStartTime: dayjs(formData.planStartTime).format('YYYY-MM-DD'),
|
|
|
|
|
- // planEndTime: dayjs(formData.planEndTime).format('YYYY-MM-DD'),
|
|
|
|
|
- id: currentRowData.value.id,
|
|
|
|
|
- })
|
|
|
|
|
- .then(() => {
|
|
|
|
|
- queryTableList();
|
|
|
|
|
- issueSafetyResponsibilityRef.value.dialogHide();
|
|
|
|
|
- currentRowData.value = {};
|
|
|
|
|
- })
|
|
|
|
|
- .finally(() => {
|
|
|
|
|
- issueSafetyResponsibilityRef.value.submitLoading = false;
|
|
|
|
|
- });
|
|
|
|
|
- };
|
|
|
|
|
|
|
+ // const handleSubmit = (formData) => {
|
|
|
|
|
+ // issueSafetyResponsibilityRef.value.submitLoading = true;
|
|
|
|
|
+ // safetyResponsibilityAdminIssuedSafety({
|
|
|
|
|
+ // ...formData,
|
|
|
|
|
+ // userGroupId: formData.userGroupId.join(','),
|
|
|
|
|
+ // // planStartTime: dayjs(formData.planStartTime).format('YYYY-MM-DD'),
|
|
|
|
|
+ // // planEndTime: dayjs(formData.planEndTime).format('YYYY-MM-DD'),
|
|
|
|
|
+ // id: currentRowData.value.id,
|
|
|
|
|
+ // })
|
|
|
|
|
+ // .then(() => {
|
|
|
|
|
+ // queryTableList();
|
|
|
|
|
+ // issueSafetyResponsibilityRef.value.dialogHide();
|
|
|
|
|
+ // currentRowData.value = {};
|
|
|
|
|
+ // })
|
|
|
|
|
+ // .finally(() => {
|
|
|
|
|
+ // issueSafetyResponsibilityRef.value.submitLoading = false;
|
|
|
|
|
+ // });
|
|
|
|
|
+ // };
|
|
|
|
|
|
|
|
onMounted(async () => {
|
|
onMounted(async () => {
|
|
|
await handleQueryUserGroupPage();
|
|
await handleQueryUserGroupPage();
|