diff --git a/src/views/project/projectManage/projectGGL.vue b/src/views/project/projectManage/projectGGL.vue index cfe23c9..c2de0c1 100644 --- a/src/views/project/projectManage/projectGGL.vue +++ b/src/views/project/projectManage/projectGGL.vue @@ -93,6 +93,7 @@ :saveFileArr="formData.fileList" :refField="'coverPhotos'" :refType="'rtu_site_info'" + :fileType="['pdf']" > diff --git a/src/views/project/projectManage/projectGGL.vue b/src/views/project/projectManage/projectGGL.vue index cfe23c9..c2de0c1 100644 --- a/src/views/project/projectManage/projectGGL.vue +++ b/src/views/project/projectManage/projectGGL.vue @@ -93,6 +93,7 @@ :saveFileArr="formData.fileList" :refField="'coverPhotos'" :refType="'rtu_site_info'" + :fileType="['pdf']" > diff --git a/src/views/project/projectManage/projectReport.vue b/src/views/project/projectManage/projectReport.vue index 5594db1..8d43630 100644 --- a/src/views/project/projectManage/projectReport.vue +++ b/src/views/project/projectManage/projectReport.vue @@ -1,12 +1,234 @@ - +const tableData = ref([]); +const tableLoading = ref(true); +const total = ref(0); +const dialogShow = ref(false); +const dialogTitle = ref(''); +const showSearch = ref(true); +const checkedIds = ref([]); +const multiple = ref(true); - +const allData = reactive({ + queryParams: { + pageNum: 1, + pageSize: 10, + ggType: '', + ggTitle: '', + ggDate: null, + }, + formData: { + ggType: '', + ggTitle: '', + fileList: [], + }, + rulesForm: { + ggType: [{ required: true, message: '请输入', trigger: 'change' }], + ggTitle: [{ required: true, message: '请输入', trigger: 'blur' }], + fileList: [{ required: true, message: '请输入', trigger: 'change', type: 'array' }], + }, +}); +const { queryParams, formData, rulesForm } = toRefs(allData); + +/** 获取查询数据列表 */ +function getDataList() { + tableLoading.value = true; + orderRemindPage(queryParams.value).then(response => { + tableData.value = response.data; + total.value = response.total; + tableLoading.value = false; + }); +} +/** 取消按钮 */ +function cancelForm() { + dialogShow.value = false; +} +/** 搜索按钮操作 */ +function handleQuery() { + queryParams.value.pageNum = 1; + getDataList(); +} +/** 重置按钮操作 */ +function resetQuery() { + proxy.resetForm('queryRef'); + handleQuery(); +} +/** 多选框选中数据 */ +function handleSelectionChange(selection) { + checkedIds.value = selection.map(item => item.id); + multiple.value = !selection.length; +} +/** 新增按钮操作 */ +function handleAdd() { + proxy.resetForm('formRef'); //清空表单 + dialogShow.value = true; + dialogTitle.value = '添加公告栏'; +} +/** 修改按钮操作 */ +function handleUpdate(row) { + const postId = row.id || checkedIds.value; + orderRemindDetail(postId).then(response => { + nextTick(() => { + let datas = response.data; + formData.value = datas; + }); + dialogShow.value = true; + dialogTitle.value = '修改公告栏'; + }); +} +/** 提交按钮 */ +function submitForm() { + proxy.$refs['formRef'].validate(valid => { + if (valid) { + if (dialogTitle.value == '修改公告') { + orderRemindEdit(formData.value).then(response => { + proxy.$modal.msgSuccess('修改成功'); + dialogShow.value = false; + getDataList(); + }); + } else { + orderRemindAdd(formData.value).then(response => { + proxy.$modal.msgSuccess('新增成功'); + dialogShow.value = false; + getDataList(); + }); + } + } + }); +} +/** 删除按钮操作 */ +function handleDelete(row) { + const postIds = row.id || checkedIds.value; + proxy.$modal + .confirm('是否确认删除该数据项?') + .then(function () { + return orderRemindDel(postIds); + }) + .then(() => { + getDataList(); + proxy.$modal.msgSuccess('删除成功'); + }) + .catch(() => {}); +} + +// 文件预览 +function previewPdf(url) { + window.open(url); +} + +onMounted(() => { + getDataList(); +}); +