|
|
@@ -8,6 +8,12 @@
|
|
|
<span>创建时间:{{ formData?.createdAt }} </span>
|
|
|
</div>
|
|
|
</header>
|
|
|
+ <el-alert
|
|
|
+ v-if="showAlertBar"
|
|
|
+ title="您提交的反馈材料审核不通过,请尽快查看并修改,再次提交进行审核,谢谢!"
|
|
|
+ type="warning"
|
|
|
+ />
|
|
|
+
|
|
|
<main class="safety-platform-container__main">
|
|
|
<el-form ref="formRef" label-width="auto" :model="formData" :rules="rules">
|
|
|
<h4>基本信息</h4>
|
|
|
@@ -27,10 +33,10 @@
|
|
|
<div class="label">签署人数:</div>
|
|
|
<div class="value">{{ formData.signedQuantity }}</div>
|
|
|
</div>
|
|
|
- <div class="col">
|
|
|
+ <!-- <div class="col">
|
|
|
<div class="label">下发对象:</div>
|
|
|
<div class="value">{{ formData.userGroupName }}</div>
|
|
|
- </div>
|
|
|
+ </div> -->
|
|
|
</div>
|
|
|
<div class="row">
|
|
|
<div class="col">
|
|
|
@@ -69,45 +75,133 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <h4>责任书签署文件</h4>
|
|
|
- <div class="detail-ct">
|
|
|
- <div class="row">
|
|
|
- <div class="col">
|
|
|
- <div class="label">责任书文档:</div>
|
|
|
- <div class="value value-s1">
|
|
|
- <div class="file-list">
|
|
|
- <div class="file-item" v-for="item in formData.signsUpload" :key="item.fileId">
|
|
|
- <span class="file-item--name">{{ item.fileName }}</span>
|
|
|
- <div class="file-item--footer">
|
|
|
- <!-- <div class="info">
|
|
|
- <span>{{ item.fileSize }}</span>
|
|
|
- </div> -->
|
|
|
- <el-button link type="primary" @click="previewOnline(item.fileUrl, item.fileType)"
|
|
|
- >预览</el-button
|
|
|
- >
|
|
|
- <el-button link type="primary" @click.stop="downloadFile(item.fileUrl, item.fileName)"
|
|
|
- >下载</el-button
|
|
|
- >
|
|
|
+ <template v-if="signRecords.level1.length">
|
|
|
+ <h4 v-if="currentDepartmentKey === 'A'"> 副院长签署 </h4>
|
|
|
+ <h4 v-if="currentDepartmentKey === 'B'"> 负责人签署 </h4>
|
|
|
+ <h4 v-if="currentDepartmentKey === 'C'"> 负责人签署 </h4>
|
|
|
+ <h4 v-if="currentDepartmentKey === 'D'"> 科室负责人签署 </h4>
|
|
|
+ <div class="detail-ct">
|
|
|
+ <div class="row" v-for="item in signRecords.level1" :key="item.id">
|
|
|
+ <div class="col">
|
|
|
+ <div class="label">签名:</div>
|
|
|
+ <div class="value value-s1">
|
|
|
+ <el-form-item>
|
|
|
+ <UploadFiles
|
|
|
+ :disabled="!item.signFlag || $route.query.mode === 'view'"
|
|
|
+ label="上传文件"
|
|
|
+ :fileList="item.attachment"
|
|
|
+ @upload-success="(fileList) => handleUploadSignsUploadSuccess(item, fileList)"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ <!-- <div class="file-list">
|
|
|
+ <div class="file-item" v-for="file in item.attachment" :key="file.fileId">
|
|
|
+ <span class="file-item--name">{{ file.fileName }}</span>
|
|
|
+ <div class="file-item--footer">
|
|
|
+ <el-button link type="primary" @click="previewOnline(file.fileUrl, file.fileType)"
|
|
|
+ >预览</el-button
|
|
|
+ >
|
|
|
+ <el-button link type="primary" @click.stop="downloadFile(file.fileUrl, file.fileName)"
|
|
|
+ >下载</el-button
|
|
|
+ >
|
|
|
+ </div>
|
|
|
</div>
|
|
|
- </div>
|
|
|
+ </div> -->
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
- </div>
|
|
|
+ </template>
|
|
|
+ <template v-if="signRecords.level2.length">
|
|
|
+ <h4 v-if="currentDepartmentKey === 'A'"> 党委书记签署 </h4>
|
|
|
+ <h4 v-if="currentDepartmentKey === 'B'"> 党委书记签署 </h4>
|
|
|
+ <h4 v-if="currentDepartmentKey === 'C'"> 党委书记签署</h4>
|
|
|
+ <h4 v-if="currentDepartmentKey === 'D'"> 部门负责人签署 </h4>
|
|
|
+ <div class="detail-ct">
|
|
|
+ <div class="row" v-for="item in signRecords.level2" :key="item.id">
|
|
|
+ <div class="col">
|
|
|
+ <div class="label">签名:</div>
|
|
|
+ <div class="value value-s1">
|
|
|
+ <el-form-item>
|
|
|
+ <UploadFiles
|
|
|
+ :disabled="!item.signFlag || $route.query.mode === 'view'"
|
|
|
+ label="上传文件"
|
|
|
+ :fileList="item.attachment"
|
|
|
+ @upload-success="(fileList) => handleUploadSignsUploadSuccess(item, fileList)"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ <!-- <div class="file-list">
|
|
|
+ <div class="file-item" v-for="file in item.attachment" :key="file.fileId">
|
|
|
+ <span class="file-item--name">{{ file.fileName }}</span>
|
|
|
+ <div class="file-item--footer">
|
|
|
+ <el-button link type="primary" @click="previewOnline(file.fileUrl, file.fileType)"
|
|
|
+ >预览</el-button
|
|
|
+ >
|
|
|
+ <el-button link type="primary" @click.stop="downloadFile(file.fileUrl, file.fileName)"
|
|
|
+ >下载</el-button
|
|
|
+ >
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div> -->
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ <template v-if="signRecords.level3.length">
|
|
|
+ <h4 v-if="currentDepartmentKey === 'A'"> 院长签署 </h4>
|
|
|
+ <h4 v-if="currentDepartmentKey === 'B'"> 院长签署 </h4>
|
|
|
+ <h4 v-if="currentDepartmentKey === 'C'"> 所长签署 </h4>
|
|
|
+ <div class="detail-ct">
|
|
|
+ <div class="row" v-for="item in signRecords.level3" :key="item.id">
|
|
|
+ <div class="col">
|
|
|
+ <div class="label">签名:</div>
|
|
|
+ <div class="value value-s1">
|
|
|
+ <el-form-item>
|
|
|
+ <UploadFiles
|
|
|
+ :disabled="!item.signFlag || $route.query.mode === 'view'"
|
|
|
+ label="上传文件"
|
|
|
+ :fileList="item.attachment"
|
|
|
+ @upload-success="(fileList) => handleUploadSignsUploadSuccess(item, fileList)"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ <!-- <div class="file-list">
|
|
|
+ <div class="file-item" v-for="file in item.attachment" :key="file.fileId">
|
|
|
+ <span class="file-item--name">{{ file.fileName }}</span>
|
|
|
+ <div class="file-item--footer">
|
|
|
+ <el-button link type="primary" @click="previewOnline(file.fileUrl, file.fileType)"
|
|
|
+ >预览</el-button
|
|
|
+ >
|
|
|
+ <el-button link type="primary" @click.stop="downloadFile(file.fileUrl, file.fileName)"
|
|
|
+ >下载</el-button
|
|
|
+ >
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div> -->
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+
|
|
|
<h4>材料上传</h4>
|
|
|
+
|
|
|
<div class="detail-ct">
|
|
|
<div class="row">
|
|
|
<div class="col">
|
|
|
<div class="label">上传附件:</div>
|
|
|
<div class="value value-s1">
|
|
|
- <div class="file-list">
|
|
|
+ <el-form-item prop="feedback">
|
|
|
+ <UploadFiles
|
|
|
+ :disabled="$route.query.mode === 'view'"
|
|
|
+ label="上传附件"
|
|
|
+ @upload-success="(fileList) => handleUploadSuccess('feedback', fileList)"
|
|
|
+ :fileList="formData.feedback"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ <div class="file-list" v-if="formData.feedback?.length">
|
|
|
<div class="file-item" v-for="item in formData.feedback" :key="item.fileId">
|
|
|
<span class="file-item--name">{{ item.fileName }}</span>
|
|
|
<div class="file-item--footer">
|
|
|
- <!-- <div class="info">
|
|
|
- <span>{{ item.fileSize }}</span>
|
|
|
- </div> -->
|
|
|
<el-button link type="primary" @click="previewOnline(item.fileUrl, item.fileType)"
|
|
|
>预览</el-button
|
|
|
>
|
|
|
@@ -124,17 +218,16 @@
|
|
|
</el-form>
|
|
|
</main>
|
|
|
<footer class="safety-platform-container__footer">
|
|
|
- <el-button @click="$router.push({ name: 'responsibilityAgreeManage' })">返回</el-button>
|
|
|
- <el-button type="primary" @click="handleReviewFailed">审核不通过</el-button>
|
|
|
- <el-button type="primary" @click="handleReviewApproved" :loading="submiting">审核通过</el-button>
|
|
|
+ <el-button @click="$router.push({ name: 'responsibilityAgreeManageDept' })">返回</el-button>
|
|
|
+ <el-button v-if="$route.query.mode !== 'view'" type="primary" @click="handleSubmit" :loading="submiting"
|
|
|
+ >提交</el-button
|
|
|
+ >
|
|
|
</footer>
|
|
|
</div>
|
|
|
<PreviewOnline ref="previewOnlineRef" />
|
|
|
- <RefuseReason ref="reviewFeedBackRef" @submit="handleReviewFailedSubmit" />
|
|
|
</template>
|
|
|
<script lang="ts" setup>
|
|
|
- import { onMounted, ref, nextTick, reactive, shallowRef } from 'vue';
|
|
|
- import dayjs from 'dayjs';
|
|
|
+ import { onMounted, ref, computed, reactive } from 'vue';
|
|
|
import { ElMessage } from 'element-plus';
|
|
|
import '@wangeditor/editor/dist/css/style.css';
|
|
|
import { useRouter, useRoute } from 'vue-router';
|
|
|
@@ -143,9 +236,9 @@
|
|
|
import UploadFiles from '@/components/UploadFiles/UploadFiles.vue';
|
|
|
import {
|
|
|
safetyResponsibilityDeptQueryDetail,
|
|
|
- safetyResponsibilityAdminApprove,
|
|
|
+ queryAvailableUserList,
|
|
|
+ safetyResponsibilityDeptSignOrFeedback,
|
|
|
} from '@/api/production-safety/responsibility-implementation';
|
|
|
- import RefuseReason from './components/RefuseReason.vue';
|
|
|
|
|
|
import { unformatAttachment, formatAttachmentList } from '@/components/UploadFiles/utils';
|
|
|
import PreviewOnline from '@/views/disaster/components/PreviewOnline.vue';
|
|
|
@@ -164,57 +257,101 @@
|
|
|
signsUpload: [],
|
|
|
responsibilityName: '',
|
|
|
statusName: '',
|
|
|
- signedQuantity: 0,
|
|
|
+ signedQuantity: '',
|
|
|
userGroupName: '',
|
|
|
planStartTime: null,
|
|
|
planEndTime: null,
|
|
|
+ status: '',
|
|
|
+ rejection: '',
|
|
|
+ signRecords: [],
|
|
|
+ });
|
|
|
+
|
|
|
+ const rules = reactive({
|
|
|
+ signsUpload: [
|
|
|
+ {
|
|
|
+ required: true,
|
|
|
+ message: '请上传签署材料',
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ feedback: [
|
|
|
+ {
|
|
|
+ required: true,
|
|
|
+ message: '请上传反馈材料',
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ });
|
|
|
+
|
|
|
+ const signRecords = computed(() => {
|
|
|
+ return {
|
|
|
+ level1: formData.signRecords.filter((item) => item.signLevel === 1),
|
|
|
+ level2: formData.signRecords.filter((item) => item.signLevel === 2),
|
|
|
+ level3: formData.signRecords.filter((item) => item.signLevel === 3),
|
|
|
+ };
|
|
|
});
|
|
|
|
|
|
- const rules = reactive({});
|
|
|
+ const currentDepartmentKey = computed(() => {
|
|
|
+ switch (formData.departmentName.trim()) {
|
|
|
+ case '院领导':
|
|
|
+ return 'A';
|
|
|
+ case '所/中心/职能部门/直属研究部/分公司':
|
|
|
+ return 'B';
|
|
|
+ case '所/中心级部门':
|
|
|
+ return 'C';
|
|
|
+ case '科室':
|
|
|
+ return 'D';
|
|
|
+ case '员工':
|
|
|
+ case '常驻供应商':
|
|
|
+ return 'E';
|
|
|
+ default:
|
|
|
+ return '';
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ const userOptions = ref<any[]>([]);
|
|
|
+
|
|
|
+ const showAlertBar = computed(() => {
|
|
|
+ if (!formData.rejection) {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ return formData.status !== 5 && formData.rejection !== null;
|
|
|
+ });
|
|
|
const previewOnlineRef = ref<InstanceType<typeof PreviewOnline>>();
|
|
|
- const reviewFeedBackRef = ref<any>(null);
|
|
|
+
|
|
|
const previewOnline = (url: string | undefined, type) => {
|
|
|
if (url) {
|
|
|
previewOnlineRef.value?.open(url, type);
|
|
|
}
|
|
|
};
|
|
|
-
|
|
|
- const handleUploadSuccess = (fileList) => {
|
|
|
- formData.attachment = fileList;
|
|
|
- formRef.value.validateField('attachment');
|
|
|
+ const handleUploadSignsUploadSuccess = (item, fileList) => {
|
|
|
+ item.attachment = fileList;
|
|
|
+ formData.signRecords = [...signRecords.value.level1, ...signRecords.value.level2, ...signRecords.value.level3];
|
|
|
};
|
|
|
|
|
|
- const handleReviewFailedSubmit = (formData) => {
|
|
|
- reviewFeedBackRef.value.submitLoading = true;
|
|
|
- safetyResponsibilityAdminApprove({
|
|
|
- approveType: 0,
|
|
|
- refuseReason: formData.refuseReason,
|
|
|
- id: route.query.id,
|
|
|
- })
|
|
|
- .then(() => {
|
|
|
- reviewFeedBackRef.value.dialogHide();
|
|
|
- ElMessage.success('提交成功');
|
|
|
- })
|
|
|
- .finally(() => {
|
|
|
- reviewFeedBackRef.value.submitLoading = false;
|
|
|
- });
|
|
|
+ const handleUploadSuccess = (prop, fileList) => {
|
|
|
+ formData[prop] = fileList;
|
|
|
+ formRef.value.validateField(prop);
|
|
|
};
|
|
|
- const handleReviewApproved = () => {
|
|
|
- submiting.value = true;
|
|
|
- safetyResponsibilityAdminApprove({
|
|
|
- approveType: 1,
|
|
|
- refuseReason: null,
|
|
|
+
|
|
|
+ const handleSubmit = async () => {
|
|
|
+ const params = {
|
|
|
+ updateType: 1,
|
|
|
id: route.query.id,
|
|
|
- })
|
|
|
- .then(() => {
|
|
|
- ElMessage.success('审核成功');
|
|
|
- router.push({
|
|
|
- name: 'responsibilityAgreeManage',
|
|
|
- });
|
|
|
- })
|
|
|
- .finally(() => {
|
|
|
- submiting.value = false;
|
|
|
- });
|
|
|
+ feedback: JSON.stringify(await formatAttachmentList(formData.feedback)),
|
|
|
+ };
|
|
|
+ console.log('params:', params);
|
|
|
+ formRef.value?.validate((valid) => {
|
|
|
+ if (valid) {
|
|
|
+ submiting.value = true;
|
|
|
+ safetyResponsibilityDeptSignOrFeedback(params)
|
|
|
+ .then((res) => {
|
|
|
+ ElMessage.success('提交成功');
|
|
|
+ router.push({ name: 'responsibilityAgreeManageDept' });
|
|
|
+ })
|
|
|
+ .finally(() => {
|
|
|
+ submiting.value = false;
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
};
|
|
|
|
|
|
const handleQueryDetail = () => {
|
|
|
@@ -228,18 +365,31 @@
|
|
|
attachment: unformatAttachment(res.attachment),
|
|
|
signsUpload: unformatAttachment(res.signsUpload),
|
|
|
feedback: unformatAttachment(res.feedback),
|
|
|
+ signRecords: res.signRecords?.map((item) => ({
|
|
|
+ ...item,
|
|
|
+ attachment: unformatAttachment(item.attachment),
|
|
|
+ })),
|
|
|
});
|
|
|
}
|
|
|
});
|
|
|
- console.log(formData);
|
|
|
});
|
|
|
};
|
|
|
|
|
|
- const handleReviewFailed = () => {
|
|
|
- reviewFeedBackRef.value.dialogShow();
|
|
|
+ const getUserData = (realname = '') => {
|
|
|
+ queryAvailableUserList({
|
|
|
+ pageNumber: 1,
|
|
|
+ pageSize: 300,
|
|
|
+ queryParam: { realname },
|
|
|
+ }).then((res: any) => {
|
|
|
+ userOptions.value = (res.records || [])?.map((u: any) => ({
|
|
|
+ value: u.id,
|
|
|
+ label: u.realname,
|
|
|
+ }));
|
|
|
+ });
|
|
|
};
|
|
|
|
|
|
- onMounted(() => {
|
|
|
+ onMounted(async () => {
|
|
|
+ await getUserData('');
|
|
|
handleQueryDetail();
|
|
|
});
|
|
|
</script>
|
|
|
@@ -287,8 +437,9 @@
|
|
|
|
|
|
.value {
|
|
|
display: flex;
|
|
|
+ justify-content: space-between;
|
|
|
flex: 1;
|
|
|
- padding-left: 20px;
|
|
|
+ padding: 10px 20px;
|
|
|
align-items: center;
|
|
|
border-right: 1px solid rgb(220, 223, 230);
|
|
|
}
|
|
|
@@ -303,6 +454,26 @@
|
|
|
border-left: 1px solid rgb(220, 223, 230);
|
|
|
}
|
|
|
}
|
|
|
+ .table {
|
|
|
+ display: flex;
|
|
|
+ align-items: stretch;
|
|
|
+ border: 1px solid rgb(220, 223, 230);
|
|
|
+ border-width: 1px 1px 0 1px;
|
|
|
+ }
|
|
|
+ .table .value {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ // (:deep).el-form-item {
|
|
|
+ // margin-bottom: 0;
|
|
|
+ // }
|
|
|
+ }
|
|
|
+ .table .label {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ border-right: 1px solid rgb(220, 223, 230);
|
|
|
+ background-color: rgb(245, 247, 250);
|
|
|
+ }
|
|
|
+
|
|
|
// :deep(.breadcrumb .title) {
|
|
|
// margin-left: 0;
|
|
|
// }
|