|
@@ -2,58 +2,85 @@
|
|
|
<div class="app-container p-2">
|
|
|
<el-row :gutter="20">
|
|
|
<el-row :gutter="20" class="mb8">
|
|
|
- <el-col :span="1.5">
|
|
|
- <el-button v-if="is_filling_ended === 0" type="primary" @click="handleImportExcel">导入Excel文件</el-button>
|
|
|
+ <el-col v-if="reportInfo.issued_status === 1" :span="1.5">
|
|
|
+ <el-button type="primary" @click="handleImportExcel">导入Excel文件</el-button>
|
|
|
</el-col>
|
|
|
- <el-col :span="1.5">
|
|
|
- <el-button v-if="is_filling_ended === 0" type="primary" @click="handleNewTemplate">空白模板</el-button>
|
|
|
+ <el-col v-if="reportInfo.issued_status === 1" :span="1.5">
|
|
|
+ <el-button type="primary" @click="handleNewTemplate">空白模板</el-button>
|
|
|
</el-col>
|
|
|
- <el-col :span="1.5">
|
|
|
- <el-button v-if="is_filling_ended === 0" type="primary" @click="handleReload">重新加载</el-button>
|
|
|
+ <el-col v-if="reportInfo.issued_status === 1" :span="1.5">
|
|
|
+ <el-button type="primary" @click="handleReload">重新加载</el-button>
|
|
|
</el-col>
|
|
|
-<!-- <el-col :span="1.5">-->
|
|
|
-<!-- <el-button v-if="is_filling_ended === 0" type="primary" @click="handleReport()">智能识别</el-button>-->
|
|
|
-<!-- </el-col>-->
|
|
|
- <el-col :span="1.5">
|
|
|
- <el-button v-if="is_filling_ended === 0" type="primary" @click="handleSaveTemporarily(1)">暂存</el-button>
|
|
|
+ <!-- <el-col :span="1.5">-->
|
|
|
+ <!-- <el-button v-if="reportInfo.issued_status === 0" type="primary" @click="handleReport()">智能识别</el-button>-->
|
|
|
+ <!-- </el-col>-->
|
|
|
+ <el-col v-if="reportInfo.issued_status === 1" :span="1.5">
|
|
|
+ <el-button type="primary" @click="handleSaveTemporarily(1)">暂存</el-button>
|
|
|
</el-col>
|
|
|
-<!-- <el-col :span="1.5">-->
|
|
|
-<!-- <el-button v-if="reportInfo.issued_status === 2" type="primary" @click="handleData()">数据</el-button>-->
|
|
|
-<!-- </el-col>-->
|
|
|
- <el-col :span="1.5">
|
|
|
- <el-button v-if="is_filling_ended === 0" type="primary" @click="handleSave(formRef, 2)">发布</el-button>
|
|
|
+ <!-- <el-col :span="1.5">-->
|
|
|
+ <!-- <el-button v-if="reportInfo.issued_status === 2" type="primary" @click="handleData()">数据</el-button>-->
|
|
|
+ <!-- </el-col>-->
|
|
|
+ <el-col v-if="reportInfo.issued_status === 1" :span="1.5">
|
|
|
+ <el-button type="primary" @click="handleSave(formRef, 2)">发布</el-button>
|
|
|
</el-col>
|
|
|
<el-col :span="1.5">
|
|
|
<el-button type="danger" @click="handleReturn()">返回</el-button>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
</el-row>
|
|
|
- <el-form :model="reportInfo" :rules="rules" ref="formRef" style="margin-top: 20px">
|
|
|
+ <el-form ref="formRef" :model="reportInfo" :rules="rules" style="margin-top: 20px">
|
|
|
<el-row :gutter="20">
|
|
|
<el-col :lg="30" :xs="24" style="margin-top: -10px">
|
|
|
<el-row :span="24" :gutter="10">
|
|
|
<!-- 联系人姓名 -->
|
|
|
<el-col :span="8">
|
|
|
<el-form-item label="联系人姓名:" prop="creator_name" label-width="auto">
|
|
|
- <el-input v-model="reportInfo.creator_name" placeholder="请输入联系人姓名" style="width: 300px"></el-input>
|
|
|
+ <el-input
|
|
|
+ v-model="reportInfo.creator_name"
|
|
|
+ placeholder="请输入联系人姓名"
|
|
|
+ :disabled="reportInfo.issued_status === 2"
|
|
|
+ :class="{ 'custom-disabled': reportInfo.issued_status === 2 }"
|
|
|
+ style="width: 300px"
|
|
|
+ />
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<!-- 联系电话 -->
|
|
|
<el-col :span="8">
|
|
|
<el-form-item label="联 系 电 话:" prop="creator_phone" label-width="auto">
|
|
|
- <el-input v-model="reportInfo.creator_phone" placeholder="请输入联系电话" style="width: 300px"></el-input>
|
|
|
+ <el-input
|
|
|
+ v-model="reportInfo.creator_phone"
|
|
|
+ placeholder="请输入联系电话"
|
|
|
+ :disabled="reportInfo.issued_status === 2"
|
|
|
+ :class="{ 'custom-disabled': reportInfo.issued_status === 2 }"
|
|
|
+ style="width: 300px"
|
|
|
+ />
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<!-- 截止时间 -->
|
|
|
<el-col :span="8">
|
|
|
<el-form-item label="截 止 时 间 :" prop="end_time">
|
|
|
- <el-date-picker v-model="reportInfo.end_time" value-format="YYYY-MM-DD HH:mm:ss" time-format="HH:mm" type="datetime" placeholder="选择截止时间" style="width: 300px" @change="handleTimeChange" />
|
|
|
+ <el-date-picker
|
|
|
+ v-model="reportInfo.end_time"
|
|
|
+ value-format="YYYY-MM-DD HH:mm:ss"
|
|
|
+ time-format="HH:mm"
|
|
|
+ type="datetime"
|
|
|
+ placeholder="选择截止时间"
|
|
|
+ :disabled="reportInfo.issued_status === 2"
|
|
|
+ :class="{ 'custom-disabled': reportInfo.issued_status === 2 }"
|
|
|
+ style="width: 300px"
|
|
|
+ />
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<!-- 操作按钮 -->
|
|
|
<el-col :span="8">
|
|
|
<el-form-item label="表           名:" prop="table_name" label-width="auto">
|
|
|
- <el-input v-model="reportInfo.table_name" placeholder="请输入表名" style="width: 300px"></el-input>
|
|
|
+ <el-input
|
|
|
+ v-model="reportInfo.table_name"
|
|
|
+ placeholder="请输入表名"
|
|
|
+ :disabled="reportInfo.issued_status === 2"
|
|
|
+ :class="{ 'custom-disabled': reportInfo.issued_status === 2 }"
|
|
|
+ style="width: 300px"
|
|
|
+ />
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<!-- 选择填报人 -->
|
|
@@ -64,21 +91,21 @@
|
|
|
<el-tag
|
|
|
v-for="tag in selectedReporter"
|
|
|
:key="tag"
|
|
|
- closable
|
|
|
+ :closable="reportInfo.issued_status !== 2"
|
|
|
:disable-transitions="false"
|
|
|
- @close="handleClose(tag)"
|
|
|
style="margin-right: 10px"
|
|
|
+ @close="handleClose(tag)"
|
|
|
>
|
|
|
{{ tag.label }}
|
|
|
</el-tag>
|
|
|
</div>
|
|
|
- <el-button @click="showSelect">点击选择</el-button>
|
|
|
+ <el-button v-if="reportInfo.issued_status !== 2" @click="showSelect">点击选择</el-button>
|
|
|
</el-form-item>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
- <el-col :span="8" v-if="reportInfo.issued_status === 2">
|
|
|
+ <el-col v-if="reportInfo.issued_status === 2" :span="8">
|
|
|
<el-form-item>
|
|
|
- 应填报{{reportInfo.num_reporters}}人,已填报{{reportInfo.num_reported}}人,未填报{{reportInfo.num_unreported}}人
|
|
|
+ 应填报{{ reportInfo.num_reporters }}人,已填报{{ reportInfo.num_reported }}人,未填报{{ reportInfo.num_unreported }}人
|
|
|
<el-text class="common-btn-text-primary" @click="viewSituation">完成情况</el-text>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
@@ -114,9 +141,7 @@ import { HotTable } from '@handsontable/vue3';
|
|
|
import { getPhoneList } from '@/api/informationissue/informationissue';
|
|
|
import informantSelect from './informantSelect.vue';
|
|
|
import { deepClone } from '@/utils';
|
|
|
-import { ElButton, ElCol, ElDatePicker, ElFormItem, ElInput, ElRow } from 'element-plus';
|
|
|
import { validatePhone } from '@/utils/validate';
|
|
|
-import { ref } from 'vue';
|
|
|
|
|
|
const { proxy } = getCurrentInstance();
|
|
|
const isShowSelect = ref(false);
|
|
@@ -153,11 +178,9 @@ const rules = {
|
|
|
{ required: true, message: '联系电话不能为空', trigger: 'blur' },
|
|
|
{ validator: validatePhone, message: '请输入正确格式的联系电话', trigger: 'blur' }
|
|
|
],
|
|
|
- user_ids: [{ required: true, message: '请选择填报人', trigger: 'blur' }],
|
|
|
-}
|
|
|
-const is_filling_ended = ref(0);
|
|
|
+ user_ids: [{ required: true, message: '请选择填报人', trigger: 'blur' }]
|
|
|
+};
|
|
|
const selectedReporter = ref(null);
|
|
|
-const router = useRouter();
|
|
|
const personNum = ref();
|
|
|
|
|
|
const props = defineProps({
|
|
@@ -182,21 +205,23 @@ onMounted(async () => {
|
|
|
const fetchReportDetails = (reportId) => {
|
|
|
return fillingList(reportId).then((res: any) => {
|
|
|
reportInfo.value = res.report_info;
|
|
|
+ hotSettings.readOnly = reportInfo.value.issued_status === 2;
|
|
|
reportInfo.value.user_filling_status = res.report_info.user_filling_status;
|
|
|
- personNum.value = reportInfo.value.user_ids.length; //统计需要填报的总人数
|
|
|
+ personNum.value = reportInfo.value.user_ids.length; //统计需要填报的总人数
|
|
|
let headers = [];
|
|
|
- if (!res.table_data["0"]) {
|
|
|
+ if (!res.table_data[0]) {
|
|
|
return;
|
|
|
} else {
|
|
|
- headers = Object.keys(res.table_data["0"]);
|
|
|
+ headers = Object.keys(res.table_data[0]);
|
|
|
}
|
|
|
- const result = [
|
|
|
- headers.map(header => res.table_data["0"][header])
|
|
|
- ];
|
|
|
+ const result = res.table_data.map(row =>
|
|
|
+ headers.map(header => row[header])
|
|
|
+ );
|
|
|
+ debugger
|
|
|
hotData.value = result;
|
|
|
nextTick(() => {
|
|
|
showTable.value = true;
|
|
|
- })
|
|
|
+ });
|
|
|
});
|
|
|
};
|
|
|
|
|
@@ -231,10 +256,6 @@ const handleContactSelectData = (data) => {
|
|
|
reportInfo.value.user_ids = data1;
|
|
|
};
|
|
|
|
|
|
-function saveEdit(rowIndex, header, value) {
|
|
|
- hotData.value[rowIndex][header] = value;
|
|
|
-}
|
|
|
-
|
|
|
const hotData = ref([]);
|
|
|
const showTable = ref(false);
|
|
|
const handleNewTemplate = () => {
|
|
@@ -260,6 +281,7 @@ const created = () => {
|
|
|
};
|
|
|
const hotSettings = reactive({
|
|
|
language: 'zh-CN',
|
|
|
+ readOnly: false,
|
|
|
colHeaders: true,
|
|
|
rowHeaders: true,
|
|
|
autoColumnSize: true,
|
|
@@ -303,7 +325,7 @@ const hotSettings = reactive({
|
|
|
},
|
|
|
'copy': {
|
|
|
name: '复制'
|
|
|
- },
|
|
|
+ }
|
|
|
// 'alignment': {
|
|
|
// name: '对齐'
|
|
|
// },
|
|
@@ -345,7 +367,7 @@ const handleImportExcel = () => {
|
|
|
hotData.value = jsonData.splice(0, 1); // 只要第一行
|
|
|
nextTick(() => {
|
|
|
showTable.value = true;
|
|
|
- })
|
|
|
+ });
|
|
|
// reportInfo.value.field_names = XLSX.utils.sheet_to_json(worksheet);
|
|
|
// alert('Excel文件已导入');
|
|
|
};
|
|
@@ -366,19 +388,11 @@ const handleSaveTemporarily = async (statuCode) => {
|
|
|
if (!!item) {
|
|
|
data2.push(item);
|
|
|
}
|
|
|
- })
|
|
|
+ });
|
|
|
reportInfo.value.field_names = hotData.value;
|
|
|
}
|
|
|
|
|
|
reportInfo.value.issued_status = statuCode;
|
|
|
- let tempHead = [];
|
|
|
- if (!reportInfo.value.field_names) {
|
|
|
- tempHead = [];
|
|
|
- } else {
|
|
|
- tempHead = reportInfo.value.field_names.flatMap(obj =>
|
|
|
- Object.values(obj).filter(value => typeof value === "string")
|
|
|
- );
|
|
|
- }
|
|
|
|
|
|
let data = {
|
|
|
creator_name: reportInfo.value.creator_name,
|
|
@@ -387,18 +401,15 @@ const handleSaveTemporarily = async (statuCode) => {
|
|
|
status: reportInfo.value.issued_status,
|
|
|
period_type: reportInfo.value.period_type,
|
|
|
end_time: reportInfo.value.end_time,
|
|
|
- new_fields: tempHead,
|
|
|
+ new_fields: reportInfo.value.field_names[0],
|
|
|
user_ids: reportInfo.value.user_ids
|
|
|
- }
|
|
|
+ };
|
|
|
fillingChange(reportId.value, data).then(() => {
|
|
|
proxy.$modal.msgSuccess('暂存成功');
|
|
|
emits('close');
|
|
|
});
|
|
|
};
|
|
|
|
|
|
-const handleReport = () => console.log('上报');
|
|
|
-
|
|
|
-
|
|
|
const handleSave = async (formEl, statuCode) => {
|
|
|
if (!formEl) return;
|
|
|
await formEl.validate((valid, fields) => {
|
|
@@ -413,13 +424,11 @@ const handleSave = async (formEl, statuCode) => {
|
|
|
if (!!item) {
|
|
|
data2.push(item);
|
|
|
}
|
|
|
- })
|
|
|
- };
|
|
|
+ });
|
|
|
+ }
|
|
|
reportInfo.value.field_names = data2;
|
|
|
// reportInfo.value.field_names = hotData.value;
|
|
|
- const tempHead = reportInfo.value.field_names.flatMap(obj =>
|
|
|
- Object.values(obj).filter(value => typeof value === "string")
|
|
|
- );
|
|
|
+ const tempHead = reportInfo.value.field_names.flatMap((obj) => Object.values(obj).filter((value) => typeof value === 'string'));
|
|
|
let data = {
|
|
|
table_name: reportInfo.value.table_name,
|
|
|
issued_status: reportInfo.value.issued_status,
|
|
@@ -430,7 +439,7 @@ const handleSave = async (formEl, statuCode) => {
|
|
|
creator_phone: reportInfo.value.creator_phone,
|
|
|
status: reportInfo.value.status,
|
|
|
user_ids: reportInfo.value.user_ids
|
|
|
- }
|
|
|
+ };
|
|
|
fillingChange(reportId.value, data).then(() => {
|
|
|
proxy.$modal.msgSuccess('发布成功');
|
|
|
emits('close');
|
|
@@ -456,11 +465,6 @@ const handleReturn = () => {
|
|
|
emits('close');
|
|
|
};
|
|
|
|
|
|
-const handleData = () => {
|
|
|
- // 跳转到数据档案管理-详情页
|
|
|
- router.push({ name: 'DataArchiveDetail', params: { reportId: reportInfo.value.report_id } });
|
|
|
-};
|
|
|
-
|
|
|
function findNodeById(data, targetId) {
|
|
|
for (const node of data) {
|
|
|
if ((node.id === targetId || node.id.toString() === targetId) && !node.deptType) {
|
|
@@ -476,7 +480,7 @@ function findNodeById(data, targetId) {
|
|
|
const popUp = ref(false);
|
|
|
const viewSituation = () => {
|
|
|
popUp.value = true;
|
|
|
-}
|
|
|
+};
|
|
|
const handleDialogClose = () => {
|
|
|
popUp.value = false;
|
|
|
};
|
|
@@ -484,12 +488,28 @@ const handleDialogClose = () => {
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
.unreported {
|
|
|
- color: #F56C6C;
|
|
|
+ color: #f56c6c;
|
|
|
font-weight: bold;
|
|
|
}
|
|
|
|
|
|
.reported {
|
|
|
- color: #67C23A;
|
|
|
+ color: #67c23a;
|
|
|
font-weight: bold;
|
|
|
}
|
|
|
+.custom-disabled {
|
|
|
+ :deep(.el-input.is-disabled) {
|
|
|
+ .el-input__wrapper {
|
|
|
+ background-color: #ffffff !important;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ :deep(.el-select__wrapper.is-disabled),
|
|
|
+ :deep(.el-input__wrapper) {
|
|
|
+ background-color: #ffffff !important;
|
|
|
+ }
|
|
|
+ :deep(.el-select__wrapper.is-disabled .el-select__selected-item),
|
|
|
+ :deep(.el-input__inner) {
|
|
|
+ color: rgba(0, 0, 0, 0.85) !important;
|
|
|
+ -webkit-text-fill-color: rgba(0, 0, 0, 0.85) !important;
|
|
|
+ }
|
|
|
+}
|
|
|
</style>
|