|
@@ -40,7 +40,7 @@
|
|
|
</el-select>
|
|
</el-select>
|
|
|
</div>
|
|
</div>
|
|
|
<div class="select-box--item">
|
|
<div class="select-box--item">
|
|
|
- <span>上传日期范围:</span>
|
|
|
|
|
|
|
+ <span>计划日期范围:</span>
|
|
|
<el-date-picker v-model="uploadDateRange" type="daterange" range-separator="至" start-placeholder="开始日期"
|
|
<el-date-picker v-model="uploadDateRange" type="daterange" range-separator="至" start-placeholder="开始日期"
|
|
|
end-placeholder="结束日期" value-format="YYYY-MM-DD" format="YYYY-MM-DD" />
|
|
end-placeholder="结束日期" value-format="YYYY-MM-DD" format="YYYY-MM-DD" />
|
|
|
</div>
|
|
</div>
|
|
@@ -66,12 +66,84 @@
|
|
|
<ActionButton text="删除" :popconfirm="{
|
|
<ActionButton text="删除" :popconfirm="{
|
|
|
title: '确定要删除?',
|
|
title: '确定要删除?',
|
|
|
}" @confirm="handleDelete(scope.row.id)" />
|
|
}" @confirm="handleDelete(scope.row.id)" />
|
|
|
- <ActionButton text="查看" @click="handleView(scope.row.id)" />
|
|
|
|
|
|
|
+ <!-- <ActionButton text="查看" @click="handleView(scope.row.id)" /> -->
|
|
|
|
|
+ <ActionButton text="下发" @click="handleDispatch(scope.row.id)" />
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
|
</BasicTable>
|
|
</BasicTable>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
+
|
|
|
|
|
+ <el-dialog v-model="issueDialogVisible" title="安全文化活动下发" width="480px" destroy-on-close>
|
|
|
|
|
+ <el-form :model="issueForm" label-width="130px" class="issue-dialog-form">
|
|
|
|
|
+ <el-form-item label="负责人部门名称:">
|
|
|
|
|
+ <el-cascader
|
|
|
|
|
+ ref="issueDeptCascaderRef"
|
|
|
|
|
+ v-model="issueDeptIds"
|
|
|
|
|
+ :options="deptTree"
|
|
|
|
|
+ :props="cascaderDeptProp"
|
|
|
|
|
+ :show-all-levels="false"
|
|
|
|
|
+ placeholder="请选择部门(可多选)"
|
|
|
|
|
+ filterable
|
|
|
|
|
+ clearable
|
|
|
|
|
+ collapse-tags
|
|
|
|
|
+ collapse-tags-tooltip
|
|
|
|
|
+ style="width: 100%"
|
|
|
|
|
+ @change="handleIssueDeptChange"
|
|
|
|
|
+ />
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ <el-form-item label="负责人名称:">
|
|
|
|
|
+ <el-select
|
|
|
|
|
+ v-model="issueForm.userGroupId"
|
|
|
|
|
+ placeholder="请选择用户组"
|
|
|
|
|
+ filterable
|
|
|
|
|
+ clearable
|
|
|
|
|
+ style="width: 100%"
|
|
|
|
|
+ >
|
|
|
|
|
+ <el-option v-for="item in userGroupOptions" :key="item.id" :label="item.name" :value="item.id" />
|
|
|
|
|
+ </el-select>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ <el-form-item label="计划开始日期:">
|
|
|
|
|
+ <el-date-picker
|
|
|
|
|
+ v-model="issueForm.startDate"
|
|
|
|
|
+ type="date"
|
|
|
|
|
+ placeholder="请选择计划开始日期"
|
|
|
|
|
+ value-format="YYYY-MM-DD"
|
|
|
|
|
+ format="YYYY-MM-DD"
|
|
|
|
|
+ style="width: 100%"
|
|
|
|
|
+ :disabled-date="(date: Date) => {
|
|
|
|
|
+ if (issueForm.endDate) {
|
|
|
|
|
+ return date > new Date(issueForm.endDate);
|
|
|
|
|
+ }
|
|
|
|
|
+ return false;
|
|
|
|
|
+ }"
|
|
|
|
|
+ />
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ <el-form-item label="计划结束日期:">
|
|
|
|
|
+ <el-date-picker
|
|
|
|
|
+ v-model="issueForm.endDate"
|
|
|
|
|
+ type="date"
|
|
|
|
|
+ placeholder="请选择计划结束日期"
|
|
|
|
|
+ value-format="YYYY-MM-DD"
|
|
|
|
|
+ format="YYYY-MM-DD"
|
|
|
|
|
+ style="width: 100%"
|
|
|
|
|
+ :disabled-date="(date: Date) => {
|
|
|
|
|
+ if (issueForm.startDate) {
|
|
|
|
|
+ return date < new Date(issueForm.startDate);
|
|
|
|
|
+ }
|
|
|
|
|
+ return false;
|
|
|
|
|
+ }"
|
|
|
|
|
+ />
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ </el-form>
|
|
|
|
|
+ <template #footer>
|
|
|
|
|
+ <span class="dialog-footer">
|
|
|
|
|
+ <el-button @click="issueDialogVisible = false">取消</el-button>
|
|
|
|
|
+ <el-button type="primary" @click="handleIssueConfirm">确定</el-button>
|
|
|
|
|
+ </span>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-dialog>
|
|
|
|
|
+
|
|
|
</main>
|
|
</main>
|
|
|
<BatchImport v-if="batchImportVisible" :visible="batchImportVisible" :import-api-url="importApiUrl"
|
|
<BatchImport v-if="batchImportVisible" :visible="batchImportVisible" :import-api-url="importApiUrl"
|
|
|
:template-url="templateUrl" template-name="下载模板" :show-template="false" @close="batchImportVisible = false"
|
|
:template-url="templateUrl" template-name="下载模板" :show-template="false" @close="batchImportVisible = false"
|
|
@@ -104,6 +176,18 @@ import { http } from '@/utils/http/axios';
|
|
|
|
|
|
|
|
const router = useRouter();
|
|
const router = useRouter();
|
|
|
|
|
|
|
|
|
|
+// 下发弹窗相关
|
|
|
|
|
+const issueDialogVisible = ref(false);
|
|
|
|
|
+const currentIssueId = ref<number | null>(null);
|
|
|
|
|
+const issueForm = reactive({
|
|
|
|
|
+ departmentName: '',
|
|
|
|
|
+ startDate: '',
|
|
|
|
|
+ endDate: '',
|
|
|
|
|
+ userGroupId: undefined as number | undefined,
|
|
|
|
|
+ deptSelfApproveUserId: undefined as number | undefined, // 部门自评审核人ID
|
|
|
|
|
+});
|
|
|
|
|
+const issueDeptIds = ref<number[]>([]);
|
|
|
|
|
+
|
|
|
// 表格
|
|
// 表格
|
|
|
const basicTableRef = ref<InstanceType<typeof BasicTable>>();
|
|
const basicTableRef = ref<InstanceType<typeof BasicTable>>();
|
|
|
|
|
|
|
@@ -388,11 +472,62 @@ const activityRegistration = async (id: number) => {
|
|
|
});
|
|
});
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
|
|
+const handleIssueConfirm = async () => {
|
|
|
|
|
+ if (!currentIssueId.value) {
|
|
|
|
|
+ ElMessage.error('缺少考核表ID');
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ if (!issueDeptIds.value?.length) {
|
|
|
|
|
+ ElMessage.error('请至少选择一个部门');
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 验证日期:开始日期不能大于结束日期
|
|
|
|
|
+ if (issueForm.startDate && issueForm.endDate) {
|
|
|
|
|
+ const startDate = new Date(issueForm.startDate);
|
|
|
|
|
+ const endDate = new Date(issueForm.endDate);
|
|
|
|
|
+ if (startDate > endDate) {
|
|
|
|
|
+ ElMessage.error('计划开始日期不能大于计划结束日期');
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ try {
|
|
|
|
|
+ const payload = {
|
|
|
|
|
+ id: currentIssueId.value,
|
|
|
|
|
+ deptNames: issueForm.departmentName,
|
|
|
|
|
+ deptIds: issueDeptIds.value,
|
|
|
|
|
+ getUserGroupId: issueForm.userGroupId,
|
|
|
|
|
+ deptSelfApproveUserId: issueForm.deptSelfApproveUserId,
|
|
|
|
|
+ planStartTime: issueForm.startDate || undefined,
|
|
|
|
|
+ planEndTime: issueForm.endDate || undefined,
|
|
|
|
|
+ };
|
|
|
|
|
+ // await saveSecurityExamineIssue(payload);
|
|
|
|
|
+ ElMessage.success('下发成功');
|
|
|
|
|
+ // issueDialogVisible.value = false;
|
|
|
|
|
+ // getTableData();
|
|
|
|
|
+ } catch (e) {
|
|
|
|
|
+ console.error('下发失败:', e);
|
|
|
|
|
+ ElMessage.error(e?.message || e?.data || '下发失败,请重试');
|
|
|
|
|
+ }
|
|
|
|
|
+};
|
|
|
|
|
+
|
|
|
|
|
+const handleDispatch = async (id: number) => {
|
|
|
|
|
+ issueDialogVisible.value = true;
|
|
|
|
|
+};
|
|
|
|
|
+
|
|
|
|
|
+const getDeptData = () => {
|
|
|
|
|
+ getAllDepartments().then((res) => {
|
|
|
|
|
+ firstLevelDepts.value = formatDeptTree(res);
|
|
|
|
|
+ });
|
|
|
|
|
+};
|
|
|
|
|
+
|
|
|
onMounted(() => {
|
|
onMounted(() => {
|
|
|
loadDeptNameMap().finally(() => {
|
|
loadDeptNameMap().finally(() => {
|
|
|
getTableData();
|
|
getTableData();
|
|
|
});
|
|
});
|
|
|
// loginSw();
|
|
// loginSw();
|
|
|
|
|
+ getDeptData();
|
|
|
});
|
|
});
|
|
|
</script>
|
|
</script>
|
|
|
|
|
|