| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831 |
- <template>
- <el-drawer
- :visible.sync="drawerVisible"
- :size="drawerSize"
- :with-header="true"
- :modal="true"
- :close-on-click-modal="false"
- :show-close="true"
- @close="handleDrawerClose"
- @update:visible="(val) => $emit('update:visible', val)"
- >
- <div slot="title" class="drawer-title">
- <span>{{ pageTitle || '填报任务' }}</span>
- </div>
- <div class="audit-task-manage-container">
- <!-- 操作按钮 -->
- <div class="action-buttons" style="margin-bottom: 20px">
- <el-button
- type="primary"
- :loading="loading.submit"
- :disabled="isViewMode"
- @click="handleSubmit"
- >
- 提交
- </el-button>
- <!-- <el-button type="primary" :loading="loading.save" @click="handleSave" :disabled="isViewMode">
- 保存
- </el-button> -->
- <!-- <el-button type="primary" class="ml10" @click="handleBack">
- 返回
- </el-button> -->
- </div>
- <!-- 标签页容器 -->
- <div
- v-loading="tabLoading[activeTab]"
- class="tabs-container"
- element-loading-text="数据加载中..."
- >
- <el-tabs
- v-model="activeTab"
- type="border-card"
- @tab-click="handleTabClick"
- >
- <!-- 立项信息 -->
- <el-tab-pane label="立项信息" name="projectInfo">
- <project-info-tab
- :form-data="formData.basicInfo"
- :is-view-mode="isViewMode"
- :unit-list="unitList"
- :org-list="OrgList"
- :user-list="userList"
- :dict-data="dictData"
- @change="handleProjectInfoChange"
- @handleCatalogChange="handleCatalogChange"
- @handleRegionChange="handleRegionChange"
- @addCostYear="addCostYear"
- @deleteCostYear="deleteCostYear"
- />
- </el-tab-pane>
- <!-- 监审文书 -->
- <el-tab-pane label="监审文书" name="auditDocument">
- <audit-document-tab
- :form-data="formData.auditDocument"
- :is-view-mode="isViewMode"
- @handleClick="handleClick"
- @handleDownload="handleDownload"
- @handleUpload="handleUpload"
- />
- </el-tab-pane>
- <!-- 报送资料 -->
- <el-tab-pane
- v-if="currentNode === 'clcs' || currentNode === 'tjcl'"
- label="报送资料"
- name="dataRequirements"
- >
- <data-requirements-tab
- :data-requirements="groupedDataRequirements"
- :is-view-mode="isViewMode"
- :dict-data="dictData"
- @handleAddMaterial="handleAddMaterial"
- @handleFileView="handleFileView"
- @handleFileDownload="handleFileDownload"
- @handleFileUpload="handleFileUpload"
- @handleTemplateDownload="handleTemplateDownload"
- @handleDataUpload="handleDataUpload"
- />
- </el-tab-pane>
- <!-- 成本调查表 -->
- <el-tab-pane
- v-if="currentNode === 'clcs' || currentNode === 'tjcl'"
- label="成本调查表"
- name="costSurvey"
- >
- <cost-survey-tab
- :paginated-data="paginatedData"
- :pagination="pagination"
- :is-view-mode="isViewMode"
- @handle-modify="handleModify"
- @handle-data-download="handleDataDownload"
- @handle-data-upload="handleDataUpload"
- @handle-preview="handlePreview"
- @handlePageChange="handlePageChange"
- />
- </el-tab-pane>
- <!-- 监审意见 -->
- <el-tab-pane
- v-if="currentNode === 'yjfk'"
- label="监审意见"
- name="auditOpinion"
- >
- <audit-opinion-tab
- :id="taskId"
- ref="auditOpinionTabRef"
- :form-data="formData.auditOpinion"
- :is-view-mode="isViewMode"
- @change="handleAuditOpinionChange"
- @data-loaded="handleAuditOpinionDataLoaded"
- />
- </el-tab-pane>
- <!-- 消息通知 -->
- <el-tab-pane label="消息通知" name="messageNotice">
- <message-notice-tab
- :form-data="formData.messageNotice"
- :pagination="messageNoticePagination"
- @handleCurrentChange="handleMessageNoticePageChange"
- @handleSizeChange="handleMessageNoticeSizeChange"
- />
- </el-tab-pane>
- </el-tabs>
- </div>
- <!-- 补充材料弹窗 -->
- <el-dialog
- title="补充材料"
- :visible.sync="materialDialogVisible"
- width="600px"
- :close-on-click-modal="false"
- :modal="false"
- append-to-body
- >
- <el-form
- ref="materialForm"
- :model="materialForm"
- :rules="materialRules"
- label-width="100px"
- >
- <el-form-item label="资料类别" prop="informationType">
- <el-select
- v-model="materialForm.informationType"
- placeholder="请选择资料类别"
- style="width: 100%"
- :disabled="isViewMode"
- >
- <el-option
- v-for="item in dictData['materialType']"
- :key="item.key"
- :label="item.name"
- :value="item.key"
- ></el-option>
- </el-select>
- </el-form-item>
- <el-form-item label="资料名称" prop="informationName">
- <el-input
- v-model="materialForm.informationName"
- placeholder="请输入资料名称"
- style="width: 100%"
- :disabled="isViewMode"
- ></el-input>
- </el-form-item>
- <el-form-item label="资料要求:" prop="informationRequire">
- <el-input
- v-model="materialForm.informationRequire"
- placeholder="请输入资料要求"
- :disabled="isViewMode"
- ></el-input>
- </el-form-item>
- <el-form-item label="格式要求:" prop="formatRequired">
- <el-select
- v-model="materialForm.formatRequired"
- placeholder="请选择格式要求"
- style="width: 100%"
- :disabled="isViewMode"
- >
- <el-option
- v-for="item in dictData['formatAsk']"
- :key="item.id"
- :label="item.name"
- :value="item.key"
- ></el-option>
- </el-select>
- </el-form-item>
- <el-form-item label="上传附件:" prop="fileList">
- <el-upload
- class="upload-demo"
- :action="''"
- :http-request="handleMaterialUpload"
- :on-remove="handleMaterialRemove"
- :before-upload="beforeMaterialUpload"
- :on-success="handleMaterialUploadSuccess"
- :on-error="handleMaterialUploadError"
- :on-progress="handleMaterialUploadProgress"
- :file-list="materialForm.fileList"
- :limit="1"
- :on-exceed="handleMaterialExceed"
- >
- <el-button
- v-show="
- !materialForm.fileList || materialForm.fileList.length === 0
- "
- size="small"
- type="primary"
- :disabled="isViewMode"
- >
- 选择文件
- </el-button>
- <!-- <div slot="tip" class="el-upload__tip">
- 最多上传1个文件,支持 pdf, doc, docx, xls, xlsx, csv 格式,单个文件不超过50MB
- </div> -->
- </el-upload>
- </el-form-item>
- <!-- <el-button
- type="text"
- size="mini"
- @click="handleMaterialUpload"
- >
- 上传附件
- </el-button> -->
- </el-form>
- <div slot="footer" class="dialog-footer">
- <el-button
- type="primary"
- :disabled="isViewMode"
- @click="handleMaterialSubmit"
- >
- 保 存
- </el-button>
- <el-button :disabled="isViewMode" @click="handleMaterialCancel">
- 取 消
- </el-button>
- </div>
- </el-dialog>
- <!-- 在线填报弹窗 -->
- <OnlineFillDialog
- :visible.sync="onlineFillDialogVisible"
- :table-type="currentSurveyData ? currentSurveyData.tableType : '单记录'"
- :survey-data="currentSurveyData || {}"
- />
- </div>
- </el-drawer>
- </template>
- <script>
- import { Message } from 'element-ui'
- import OnlineFillDialog from './OnlineFill.vue'
- import {
- getProjectInformationInfo,
- getTaskRequirementList,
- addOrUpdateTaskRequirement,
- submitTaskRequirement,
- sendMessage,
- } from '@/api/auditTaskProcessing'
- // import UploadComponent from '@/components/costAudit/UploadComponent.vue'
- import { getAllUnitList } from '@/api/auditEntityManage'
- import { getDefaultDem, getOrgListByDemId } from '@/api/annualReviewPlan'
- import { getAllUserList } from '@/api/uc'
- import { dictMixin } from '@/mixins/useDict'
- import { uploadFile } from '@/api/file'
- import { submitPreliminaryOpinion } from '@/api/audit/preliminaryOpinion'
- import ProjectInfoTab from './components/ProjectInfoTab.vue'
- import AuditDocumentTab from './components/AuditDocumentTab.vue'
- import DataRequirementsTab from './components/DataRequirementsTab.vue'
- import CostSurveyTab from './components/CostSurveyTab.vue'
- import AuditOpinionTab from './components/AuditOpinionTab.vue'
- import MessageNoticeTab from './components/MessageNoticeTab.vue'
- export default {
- name: 'TaskFillIn',
- components: {
- OnlineFillDialog,
- // UploadComponent,
- ProjectInfoTab,
- AuditDocumentTab,
- DataRequirementsTab,
- CostSurveyTab,
- AuditOpinionTab,
- MessageNoticeTab,
- },
- mixins: [dictMixin],
- props: {
- // 侧边弹窗是否显示
- visible: {
- type: Boolean,
- default: false,
- },
- // 侧边弹窗尺寸
- drawerSize: {
- type: String,
- default: '85%',
- },
- // 任务信息(从props传入,替代路由query)
- taskInfo: {
- type: Object,
- default: () => ({}),
- },
- // 是否为查看模式
- viewMode: {
- type: Boolean,
- default: false,
- },
- },
- data() {
- return {
- drawerVisible: false, // 侧边弹窗显示状态
- isViewMode: false, // 是否为查看模式
- localTaskInfo: {}, // 本地任务信息(用于存储)
- unitList: [],
- OrgList: [],
- userList: [],
- dictData: {
- attributionYear: [], // 归属年度
- projectProposal: [], // 立项来源
- auditType: [], //监审形式
- materialType: [], // 资料类别
- materialCategory: [], // 资料类别
- formatAsk: [], // 资料类型
- clshzt: [], // 是否通过
- },
- // 立项依据文件列表
- accordingFileList: [],
- // 其他材料文件列表
- otherFileList: [],
- // 页面标题
- pageTitle: '立项信息',
- projectId: '', // 项目ID
- taskId: '', // 任务ID
- auditedUnitId: '', // 被监审单位ID
- // 当前激活的标签页
- activeTab: 'projectInfo',
- // 加载状态管理
- loading: {
- submit: false,
- save: false,
- },
- // 标签页加载状态
- tabLoading: {
- projectInfo: false,
- auditDocument: false,
- dataRequirements: false,
- costSurvey: false,
- auditOpinion: false,
- messageNotice: false,
- },
- isDisabled: false,
- tabCheck: '', // 状态判断监审意见是否显示
- tabVisiable: true, // 标签页是否显示
- // 成本调查表分页相关
- costSurveyPagination: {
- currentPage: 1,
- pageSize: 10,
- total: 0,
- },
- // 消息通知分页相关
- messageNoticePagination: {
- pageNo: 1,
- pageSize: 10,
- total: 0,
- },
- // 所有表单数据聚合
- formData: {
- basicInfo: {
- projectName: '',
- catalogId: '',
- areaCode: '',
- auditUnitId: [],
- auditUnitName: '',
- orgId: '',
- orgName: '',
- projectYear: '',
- sourceType: '',
- auditType: '',
- auditPeriod: '',
- auditPeriodArray: [{ value: '' }],
- needHearing: 1,
- isEmergency: 1,
- establishmentReason: '',
- accordingFileUrl: '',
- otherFileUrl: '',
- auditGroup: '',
- auditTeamMembers: [],
- expertStr: '',
- plannedAuditStartDate: '',
- plannedAuditEndDate: '',
- },
- auditDocument: [
- {
- date: '2016-05-02',
- name: '王小虎',
- province: '上海',
- city: '普陀区',
- address: '上海市普陀区金沙江路 1518 弄',
- zip: 200333,
- },
- {
- date: '2016-05-04',
- name: '王小虎',
- province: '上海',
- city: '普陀区',
- address: '上海市普陀区金沙江路 1517 弄',
- zip: 200333,
- },
- ],
- dataRequirements: [],
- costSurveyData: [
- {
- index: 1,
- name: '封面',
- dataType: '模版定制',
- tableType: '单记录',
- isRequired: '是',
- isUploaded: false,
- isDisabled: false,
- },
- {
- index: 2,
- name: '企业基本情况调查表',
- dataType: '模版定制',
- tableType: '固定表',
- isRequired: '是',
- isUploaded: true,
- isDisabled: false,
- },
- {
- index: 3,
- name: '企业成本费用调查表',
- dataType: '模版定制',
- tableType: '固定表',
- isRequired: '是',
- isUploaded: true,
- isDisabled: false,
- },
- {
- index: 4,
- name: '企业期间费用调查表',
- dataType: '模版定制',
- tableType: '动态表',
- isRequired: '是',
- isUploaded: false,
- isDisabled: true, // 灰色不可点击
- },
- {
- index: 5,
- name: '企业职工薪酬调查表',
- dataType: '模版定制',
- tableType: '动态表',
- isRequired: '是',
- isUploaded: false,
- isDisabled: true, // 灰色不可点击
- },
- {
- index: 6,
- name: '……',
- dataType: '模版定制',
- tableType: '动态表',
- isRequired: '是',
- isUploaded: false,
- isDisabled: false,
- },
- ],
- auditOpinion: {
- basicFinancialInfo:
- '此处为被监审单位基本情况及主要财务状况的内容...',
- priceStandard: '此处为监审项目现行执行的价格标准的内容...',
- costComposition:
- '此处为监审项目的成本构成、数据核增核减情况、依据及理由的内容...',
- preliminaryOpinion: '此处为成本审核初步意见的内容...',
- feedbackOpinion: '', // 被监审单位可输入反馈意见
- feedbackMaterials: [], // 被监审单位上传的反馈文件
- },
- messageNotice: [], // 消息通知列表
- },
- // 监审地区级联选择器
- regionOptions: [
- {
- value: 'zhinan',
- label: '指南',
- children: [
- {
- value: 'shejiyuanze',
- label: '设计原则',
- children: [
- {
- value: 'yizhi',
- label: '一致',
- },
- {
- value: 'fankui',
- label: '反馈',
- },
- {
- value: 'xiaolv',
- label: '效率',
- },
- {
- value: 'kekong',
- label: '可控',
- },
- ],
- },
- ],
- },
- ],
- dialogVisible: false,
- catalogueData: [
- {
- label: '一级 1',
- children: [
- {
- label: '二级 1-1',
- children: [
- {
- label: '三级 1-1-1',
- },
- ],
- },
- ],
- },
- {
- label: '一级 2',
- children: [
- {
- label: '二级 2-1',
- children: [
- {
- label: '三级 2-1-1',
- },
- ],
- },
- {
- label: '二级 2-2',
- children: [
- {
- label: '三级 2-2-1',
- },
- ],
- },
- ],
- },
- {
- label: '一级 3',
- children: [
- {
- label: '二级 3-1',
- children: [
- {
- label: '三级 3-1-1',
- },
- ],
- },
- {
- label: '二级 3-2',
- children: [
- {
- label: '三级 3-2-1',
- },
- ],
- },
- ],
- },
- ],
- defaultProps: {
- children: 'children',
- label: 'label',
- },
- // 补充材料弹窗相关数据
- materialDialogVisible: false,
- materialForm: {
- informationType: '',
- informationName: '',
- informationRequire: '',
- formatRequired: '',
- fileList: [],
- fileUrl: '',
- },
- materialRules: {
- informationType: [
- { required: true, message: '请选择资料类别', trigger: 'change' },
- ],
- informationName: [
- { required: true, message: '请输入资料名称', trigger: 'blur' },
- ],
- formatRequired: [
- { required: true, message: '请选择格式要求', trigger: 'change' },
- ],
- informationRequire: [
- { required: true, message: '请输入资料要求', trigger: 'blur' },
- ],
- },
- materialCategoryOptions: [
- { label: '综合性资料', value: 'comprehensive' },
- { label: '财务会计资料', value: 'financial' },
- { label: '其他资料', value: 'other' },
- ],
- // 修复未定义的变量
- value: [], // 监审地区级联选择器的值
- value3: null, // 年份选择器的值
- // 在线填报弹窗相关数据
- onlineFillDialogVisible: false,
- currentSurveyData: null,
- }
- },
- computed: {
- // 按类别分组的报送资料列表
- groupedDataRequirements() {
- if (
- !this.formData.dataRequirements ||
- !Array.isArray(this.formData.dataRequirements) ||
- this.formData.dataRequirements.length === 0
- ) {
- return []
- }
- // 按类别分组
- const groups = {}
- this.formData.dataRequirements.forEach((item, index) => {
- // 获取类别标识,使用 informationType 作为类别 key
- const categoryKey =
- item.informationType ||
- item.category ||
- item.categoryId ||
- item.categoryName ||
- 'other'
- // 优先从字典中获取类别名称
- let categoryName = ''
- if (categoryKey) {
- // 优先使用 getDictNameByValue 根据 value 查找
- categoryName = this.getDictNameByValue(
- 'materialCategory',
- categoryKey
- )
- // 如果 getDictNameByValue 没找到,尝试使用 getDictName 根据 key 查找
- if (!categoryName || categoryName === String(categoryKey)) {
- categoryName = this.getDictName('materialCategory', categoryKey)
- }
- // 如果字典中都找不到,使用 item.categoryName 作为后备
- if (!categoryName || categoryName === String(categoryKey)) {
- categoryName = item.informationTypeName || categoryKey
- }
- }
- if (!groups[categoryKey]) {
- groups[categoryKey] = {
- categoryKey,
- categoryName: categoryName || String(categoryKey),
- items: [],
- }
- }
- // 添加序号(每个类别内从1开始)
- const itemWithSeq = {
- ...item,
- index: index + 1,
- seq: groups[categoryKey].items.length + 1,
- }
- groups[categoryKey].items.push(itemWithSeq)
- })
- // 将分组转换为扁平数组,插入类别标题行
- const result = []
- Object.keys(groups).forEach((categoryKey) => {
- const group = groups[categoryKey]
- // 添加类别标题行
- result.push({
- isCategoryHeader: true,
- categoryName: group.categoryName,
- categoryKey: group.categoryKey,
- })
- // 添加该类别下的所有项目
- group.items.forEach((item) => {
- result.push({
- ...item,
- isCategoryHeader: false,
- })
- })
- })
- return result
- },
- // 分页后的成本调查表数据
- paginatedCostSurveyData() {
- const start =
- (this.costSurveyPagination.currentPage - 1) *
- this.costSurveyPagination.pageSize
- const end = start + this.costSurveyPagination.pageSize
- return this.formData.costSurveyData.slice(start, end)
- },
- },
- watch: {
- visible: {
- immediate: true,
- handler(newVal) {
- this.drawerVisible = newVal
- if (
- newVal &&
- this.taskInfo &&
- Object.keys(this.taskInfo).length > 0
- ) {
- // 弹窗打开时初始化数据
- this.initData()
- }
- },
- },
- drawerVisible(newVal) {
- if (!newVal) {
- this.$emit('update:visible', false)
- this.$emit('close')
- }
- },
- taskInfo: {
- immediate: true,
- deep: true,
- handler(newVal) {
- // 如果props传入taskInfo且有值,且弹窗已打开,则初始化数据
- if (newVal && Object.keys(newVal).length > 0 && this.drawerVisible) {
- this.initData()
- }
- },
- },
- },
- mounted() {
- this.drawerVisible = this.visible
- this.getAllUnitList()
- this.getDefaultDem()
- this.getUser()
- // 默认设置立项信息标签页
- this.activeTab = 'projectInfo'
- this.pageTitle = '立项信息'
- // 如果有传入taskInfo,初始化数据
- if (this.taskInfo && Object.keys(this.taskInfo).length > 0) {
- this.initData()
- }
- // 初始化成本调查表分页总数
- this.costSurveyPagination.total = this.formData.costSurveyData.length
- },
- methods: {
- // 初始化数据
- initData() {
- // 优先使用props传入的taskInfo,其次使用localTaskInfo
- const info =
- this.taskInfo && Object.keys(this.taskInfo).length > 0
- ? this.taskInfo
- : this.localTaskInfo
- // 判断是否为查看模式
- this.isViewMode = this.viewMode || false
- this.projectId = info.projectId || ''
- this.taskId = (info.userTask && info.userTask.id) || info.taskId || ''
- this.tabCheck = info.status || ''
- this.auditedUnitId = info.auditedUnitId || ''
- this.currentNode = info.currentNode || ''
- if (this.tabCheck === 'jtsy') {
- this.tabVisiable = false
- }
- // 默认显示立项信息标签页
- this.activeTab = 'projectInfo'
- this.pageTitle = '立项信息'
- // 加载立项信息数据
- if (this.projectId) {
- this.getProjectInformation()
- }
- },
- // 打开弹窗方法(供外部调用)
- open(taskInfo, viewMode = false) {
- this.localTaskInfo = taskInfo || {}
- this.initData()
- this.drawerVisible = true
- },
- // 关闭弹窗方法
- close() {
- this.drawerVisible = false
- },
- getAllUnitList() {
- getAllUnitList().then((res) => {
- this.unitList = res.value || []
- })
- },
- // 获取默认维度
- getDefaultDem() {
- getDefaultDem().then((res) => {
- if (res && res.code === 200) {
- const demId = res.value ? res.value.id : null
- if (demId) {
- this.getOrgListByDemId(demId)
- }
- }
- })
- },
- // 根据维度ID获取单位列表
- getOrgListByDemId(demId) {
- getOrgListByDemId({ demId }).then((res) => {
- if (res && res.code === 200) {
- this.OrgList = res.value || []
- }
- })
- },
- // 获取用户信息
- getUser() {
- getAllUserList()
- .then((res) => {
- this.userList = res.value || []
- })
- .catch(() => {})
- },
- // 添加监审年份
- addCostYear() {
- this.formData.basicInfo.auditPeriodArray.push({ value: '' })
- },
- // 删除监审年份
- deleteCostYear(index) {
- // 若只剩1条,禁止删除并提示
- if (this.formData.basicInfo.auditPeriodArray.length <= 1) {
- Message.warning('监审期间至少需保留1条,无法删除')
- return
- }
- this.formData.basicInfo.auditPeriodArray.splice(index, 1)
- },
- // 更新auditPeriod字符串
- updateAuditPeriodString() {
- const values = this.formData.basicInfo.auditPeriodArray
- .map((item) => item.value)
- .filter(Boolean)
- const uniqueValues = [...new Set(values)]
- this.formData.basicInfo.auditPeriod = uniqueValues.join(',')
- },
- // 立项依据文件处理
- saveAccordingFiles(data) {
- this.accordingFileList = data
- this.formData.basicInfo.accordingFileUrl = data[0]?.savePath || ''
- },
- // 移除立项依据文件
- removeAccordingFile() {
- this.accordingFileList = []
- this.formData.basicInfo.accordingFileUrl = ''
- },
- // 其他材料文件处理
- saveOtherFiles(data) {
- this.otherFileList = data
- this.formData.basicInfo.otherFileUrl = data[0]?.savePath || ''
- },
- // 移除其他材料文件
- removeOtherFile() {
- this.otherFileList = []
- this.formData.basicInfo.otherFileUrl = ''
- },
- // 处理地区选择变化
- handleRegionChange(region) {
- this.formData.basicInfo.areaCode = region.code
- },
- // 处理监审目录选择后的回调
- handleCatalogChange(value) {
- // this.formData.catalogId = value.join(',')
- this.formData.basicInfo.catalogId = value
- },
- // 处理立项信息变化
- handleProjectInfoChange(data) {
- this.formData.basicInfo = { ...data }
- },
- // 处理监审意见变化
- handleAuditOpinionChange(data) {
- this.formData.auditOpinion = { ...data }
- },
- // 处理监审意见数据加载完成
- handleAuditOpinionDataLoaded() {
- // 数据加载完成后,关闭加载状态
- this.tabLoading.auditOpinion = false
- },
- // 表格行样式
- getRowClassName({ row }) {
- if (row.isCategoryHeader) {
- return 'category-header-row'
- }
- return ''
- },
- // 标签页切换
- handleTabClick(tab) {
- console.log(tab, 'qiehuan')
- if (tab.name === 'projectInfo') {
- // 立项项目信息
- this.getProjectInformation()
- } else if (tab.name === 'dataRequirements') {
- // 报送资料要求
- this.getTaskRequirementPage()
- } else if (tab.name === 'messageNotice') {
- // 消息通知
- this.getSendMessage()
- } else if (tab.name === 'auditOpinion') {
- // 监审意见标签页,设置加载状态并调用接口
- this.tabLoading.auditOpinion = true
- // 通过 ref 调用子组件方法,确保接口被调用
- this.$nextTick(() => {
- this.$nextTick(() => {
- const auditOpinionTab = this.$refs.auditOpinionTabRef
- if (
- auditOpinionTab &&
- typeof auditOpinionTab.getPreliminaryOpinionData === 'function'
- ) {
- auditOpinionTab.getPreliminaryOpinionData()
- } else {
- // 如果找不到组件,可能是组件还未创建,延迟调用
- setTimeout(() => {
- const tab = this.$refs.auditOpinionTabRef
- if (
- tab &&
- typeof tab.getPreliminaryOpinionData === 'function'
- ) {
- tab.getPreliminaryOpinionData()
- } else {
- this.tabLoading.auditOpinion = false
- }
- }, 200)
- }
- })
- })
- }
- // 其他标签页(如 auditDocument、costSurvey)如果不需要异步加载数据,则不需要设置加载状态
- // 可添加标签页切换时的逻辑
- this.pageTitle = tab.label
- },
- // 获取立项项目信息
- getProjectInformation() {
- this.tabLoading.projectInfo = true
- getProjectInformationInfo(this.projectId)
- .then((res) => {
- console.log('立项项目信息', res)
- if (res && res.value) {
- const data = res.value
- // 处理监审期间数组
- let auditPeriodArray = [{ value: '' }]
- if (data.auditPeriod && typeof data.auditPeriod === 'string') {
- const periods = data.auditPeriod.split(',').filter(Boolean)
- auditPeriodArray = periods.map((p) => ({ value: p }))
- }
- // 赋值并添加转换后的数组
- this.formData.basicInfo = {
- ...data,
- auditPeriodArray: auditPeriodArray,
- }
- }
- })
- .catch((err) => {
- console.error('获取立项项目信息失败', err)
- })
- .finally(() => {
- this.tabLoading.projectInfo = false
- })
- },
- // 获取报送资料要求列表
- getTaskRequirementPage() {
- this.tabLoading.dataRequirements = true
- console.log('送报资料接口', this.taskId)
- getTaskRequirementList(this.taskId)
- .then((res) => {
- console.log('报送资料要求', res)
- if (res && res.code === 200 && res.value) {
- this.formData.dataRequirements = Array.isArray(res.value)
- ? res.value
- : []
- } else {
- this.formData.dataRequirements = []
- }
- })
- .catch((err) => {
- console.error('获取报送资料失败', err)
- this.formData.dataRequirements = []
- })
- .finally(() => {
- this.tabLoading.dataRequirements = false
- })
- },
- // 消息通知
- getSendMessage() {
- this.tabLoading.messageNotice = true
- const params = {
- taskId: this.taskId,
- auditedUnitId: this.auditedUnitId,
- projectId: this.projectId,
- pageNum: this.messageNoticePagination.pageNo,
- pageSize: this.messageNoticePagination.pageSize,
- }
- sendMessage(params)
- .then((res) => {
- console.log('消息通知', res)
- if (res && res.code === 200 && res.value) {
- this.formData.messageNotice = res.value.records || []
- this.messageNoticePagination.total = res.value.total || 0
- } else {
- this.formData.messageNotice = []
- this.messageNoticePagination.total = 0
- }
- })
- .catch((err) => {
- console.error('获取消息通知失败', err)
- this.formData.messageNoticeData = []
- this.messageNoticePagination.total = 0
- })
- .finally(() => {
- this.tabLoading.messageNotice = false
- })
- },
- // 消息通知分页处理
- handleMessageNoticePageChange(pageNo) {
- this.messageNoticePagination.pageNo = pageNo
- this.getSendMessage()
- },
- // 消息通知每页大小变化
- handleMessageNoticeSizeChange(pageSize) {
- this.messageNoticePagination.pageSize = pageSize
- this.messageNoticePagination.pageNo = 1
- this.getSendMessage()
- },
- // 提交
- handleSubmit() {
- this.loading.submit = true
- // 判断是否为监审意见提交(currentNode === 'yjfk')
- if (this.currentNode === 'yjfk') {
- // 企业监审意见提交
- // 处理文件列表,提取文件URL
- // let fileUrlList = []
- // if (this.formData.auditOpinion?.feedbackMaterials && Array.isArray(this.formData.auditOpinion.feedbackMaterials)) {
- // fileUrlList = this.formData.auditOpinion.feedbackMaterials.map((file) => {
- // // 如果file是字符串,直接返回
- // if (typeof file === 'string') {
- // return file
- // }
- // // 如果file是对象,提取url字段
- // return file.url || file.response?.savePath || file.savePath || ''
- // }).filter((url) => url) // 过滤空值
- // }
- const submitData = {
- taskId: this.taskId,
- // 成本监审意见数据
- basicSituation: this.formData.auditOpinion?.basicSituation || '',
- currentPriceStandard:
- this.formData.auditOpinion?.currentPriceStandard || '',
- costComposition: this.formData.auditOpinion?.costComposition || '',
- preliminaryOpinion:
- this.formData.auditOpinion?.preliminaryOpinion || '',
- // 被监审单位反馈意见数据
- feedbackOpinion: this.formData.auditOpinion?.feedbackOpinion || '',
- feedbackMaterials:
- this.formData.auditOpinion?.feedbackMaterials[0]?.url || '', // 附件URL
- }
- submitPreliminaryOpinion(submitData)
- .then((res) => {
- this.loading.submit = false
- console.log('企业监审意见提交成功', res)
- if (res && res.code === 200) {
- Message.success('提交成功')
- // 关闭弹窗
- this.handleBack()
- // 通知父组件刷新列表
- this.$emit('refresh')
- } else {
- Message.error(res?.message || '提交失败')
- }
- })
- .catch((err) => {
- this.loading.submit = false
- console.error('企业监审意见提交失败', err)
- Message.error('提交失败:' + (err.message || '未知错误'))
- })
- } else {
- // 其他情况走原有逻辑
- setTimeout(() => {
- submitTaskRequirement({ taskId: this.taskId })
- .then((res) => {
- this.loading.submit = false
- console.log('提交成功', res)
- if (res && res.code === 200) {
- Message.success('提交成功')
- this.handleBack()
- // 通知父组件刷新列表
- this.$emit('refresh')
- } else {
- Message.error('提交失败')
- }
- })
- .catch((err) => {
- this.loading.submit = false
- console.error('提交失败', err)
- Message.error('提交失败')
- })
- }, 500)
- }
- },
- // 保存
- handleSave() {
- this.loading.save = true
- // 保存逻辑
- setTimeout(() => {
- this.loading.save = false
- Message.success('保存成功')
- }, 500)
- },
- // 返回
- handleBack() {
- this.drawerVisible = false
- this.$emit('close')
- },
- // 侧边弹窗关闭事件
- handleDrawerClose() {
- this.$emit('update:visible', false)
- this.$emit('close')
- },
- // 监审地区级联选择器
- handleChange(value) {
- console.log(value)
- },
- // 监审地区级联选择器节点点击
- handleNodeClick(data) {
- console.log(data)
- this.formData.basicInfo.projectName = data.label
- },
- // 查看文书
- handleClick(row) {
- console.log(row)
- if (row.fileUrl) {
- window.open(row.fileUrl, '_blank')
- } else {
- this.$message.warning('暂无文件可查看')
- }
- },
- // 下载文书
- handleDownload(row) {
- console.log(row)
- if (!row.fileUrl) {
- this.$message.warning('该文书暂无文件可下载')
- return
- }
- // 创建隐藏的a标签进行下载
- const link = document.createElement('a')
- link.style.display = 'none'
- link.href = row.fileUrl
- // 设置下载文件名
- link.download = row.name || '文书文件'
- document.body.appendChild(link)
- link.click()
- document.body.removeChild(link)
- this.$message.success('开始下载文件')
- },
- // 上传附件
- handleUpload(row) {
- console.log(row)
- },
- // 报送资料相关操作方法
- handleFileView(row) {
- console.log('查看文件:', row)
- // 实际开发中可添加文件预览逻辑(如打开新窗口、弹窗展示等)
- if (row.fileUrl) {
- window.open(row.fileUrl, '_blank')
- } else {
- this.$message.warning('暂无文件可查看')
- }
- },
- handleFileDownload(row) {
- console.log('下载文件:', row)
- if (!row.fileUrl) {
- this.$message.warning('该资料暂无文件可下载')
- return
- }
- // 创建隐藏的a标签进行下载
- const link = document.createElement('a')
- link.style.display = 'none'
- link.href = row.fileUrl
- // 设置下载文件名,优先使用资料名称
- link.download = row.informationName || '下载文件'
- document.body.appendChild(link)
- link.click()
- document.body.removeChild(link)
- this.$message.success('开始下载文件')
- },
- // 报送资料文件上传
- async handleFileUpload(row) {
- // 创建文件选择器
- const input = document.createElement('input')
- input.type = 'file'
- input.accept = '.pdf,.doc,.docx,.xls,.xlsx,.csv' // 允许的文件类型
- input.onchange = async (event) => {
- const file = event.target.files[0]
- if (!file) return
- try {
- // 校验文件大小(50MB)
- const maxSize = 50 * 1024 * 1024 // 50MB
- if (file.size > maxSize) {
- this.$message.error('文件大小不能超过50MB!')
- return
- }
- // 校验文件格式
- const allowedFormats = [
- '.pdf',
- '.doc',
- '.docx',
- '.xls',
- '.xlsx',
- '.csv',
- ]
- const fileName = file.name.toLowerCase()
- const isValidFormat = allowedFormats.some((format) =>
- fileName.endsWith(format)
- )
- if (!isValidFormat) {
- this.$message.error(
- '只允许上传.pdf,.doc,.docx,.xls,.xlsx,.csv格式的文件!'
- )
- return
- }
- // 显示上传加载提示
- const loading = this.$baseLoading(1, '文件上传中...')
- // 创建FormData并上传文件
- const formData = new FormData()
- formData.append('file', file)
- // 调用上传API
- const uploadRes = await uploadFile('/api/file/v1/upload', formData)
- // 检查上传结果
- if (!uploadRes || uploadRes.code !== 200 || !uploadRes.value) {
- loading.close()
- this.$message.error('文件上传失败,请稍后重试')
- return
- }
- // 文件上传成功后,更新报送资料项
- const fileInfo = uploadRes.value
- const updateData = {
- // id: row.id,
- // taskId: this.taskId,
- // projectId: this.projectId,
- // informationType: row.informationType,
- // informationName: row.informationName,
- // informationRequire: row.informationRequire,
- // formatRequired: row.formatRequired,
- // isRequired: row.isRequired,
- ...row,
- fileUrl: fileInfo.savePath || fileInfo.url, // 更新文件URL
- }
- // 调用更新API
- const updateRes = await addOrUpdateTaskRequirement(updateData)
- loading.close()
- if (updateRes && updateRes.code === 200) {
- this.$message.success('文件上传并更新成功!')
- // 刷新报送资料列表
- this.getTaskRequirementPage()
- } else {
- this.$message.error('文件上传成功,但更新资料失败')
- }
- } catch (error) {
- console.error('文件上传失败:', error)
- this.$message.error('操作失败:' + (error.message || '未知错误'))
- }
- }
- // 触发文件选择
- input.click()
- },
- handleTemplateDownload(row) {
- console.log('下载预置模版:', row)
- if (!row.templateUrl && !row.fileUrl) {
- this.$message.warning('该模版暂无文件可下载')
- return
- }
- const downloadUrl = row.templateUrl || row.fileUrl
- const link = document.createElement('a')
- link.style.display = 'none'
- link.href = downloadUrl
- link.download = row.name ? `${row.name}_模版` : '模版文件'
- document.body.appendChild(link)
- link.click()
- document.body.removeChild(link)
- this.$message.success('开始下载模版')
- },
- handleDataUpload(row) {
- console.log('上传模版数据:', row)
- // 实际开发中可添加基于模版的数据上传逻辑
- },
- handleRemove(file, fileList) {
- console.log(file, fileList)
- },
- handlePreview(file) {
- console.log(file)
- },
- handleExceed(files, fileList) {
- this.$message.warning(
- `当前限制选择 3 个文件,本次选择了 ${files.length} 个文件,共选择了 ${
- files.length + fileList.length
- } 个文件`
- )
- },
- beforeRemove(file, fileList) {
- return this.$confirm(`确定移除 ${file.name}?`)
- },
- // 成本调查表点击事件(可点击时触发)
- handleSurveyClick(row) {
- console.log('点击成本调查表:', row.name)
- // 实际逻辑:跳转页面、打开弹窗等
- },
- // 在线填报
- handleOnlineFill(row) {
- console.log('在线填报:', row.name)
- this.currentSurveyData = row
- this.onlineFillDialogVisible = true
- },
- // 修改已上传的表
- handleModify(row) {
- console.log('修改:', row.name)
- // 实际逻辑:打开修改表单
- },
- // 数据下载
- handleDataDownload(row) {
- console.log('数据下载:', row.name)
- if (!row.fileUrl && !row.dataUrl) {
- this.$message.warning('该数据暂无文件可下载')
- return
- }
- const downloadUrl = row.dataUrl || row.fileUrl
- const link = document.createElement('a')
- link.style.display = 'none'
- link.href = downloadUrl
- link.download = row.name ? `${row.name}_数据` : '数据文件'
- document.body.appendChild(link)
- link.click()
- document.body.removeChild(link)
- this.$message.success('开始下载数据')
- },
- // 补充材料相关方法
- handleAddMaterial() {
- this.materialDialogVisible = true
- this.resetMaterialForm()
- },
- // 重置补充材料表单
- resetMaterialForm() {
- this.materialForm = {
- informationType: '',
- informationName: '',
- informationRequire: '',
- formatRequired: '',
- fileList: [],
- fileUrl: '',
- }
- if (this.$refs.materialForm) {
- this.$refs.materialForm.resetFields()
- }
- },
- // 补充材料弹窗取消
- handleMaterialCancel() {
- this.materialDialogVisible = false
- this.resetMaterialForm()
- },
- // 补充材料弹窗确定
- handleMaterialSubmit() {
- this.$refs.materialForm.validate((valid) => {
- if (valid) {
- // 这里可以添加提交逻辑
- console.log('补充材料表单数据:', this.materialForm)
- addOrUpdateTaskRequirement({
- taskId: this.taskId,
- projectId: this.projectId,
- informationType: this.materialForm.informationType,
- informationName: this.materialForm.informationName,
- informationRequire: this.materialForm.informationRequire,
- formatRequired: this.materialForm.formatRequired,
- fileUrl: this.materialForm.fileUrl,
- })
- .then((res) => {
- console.log('补充材料提交成功', res)
- if (res && res.code === 200) {
- Message.success('补充材料提交成功')
- this.materialDialogVisible = false
- this.resetMaterialForm()
- this.getTaskRequirementPage()
- } else {
- Message.error('补充材料提交失败')
- }
- })
- .catch((err) => {
- console.error('补充材料提交失败', err)
- Message.error('补充材料提交失败')
- })
- } else {
- Message.error('请完善表单信息')
- return false
- }
- })
- },
- // 上传
- // handleMaterialUpload(row, type) {
- // let loading = null
- // // 第一步:创建文件选择器
- // const input = document.createElement('input')
- // input.type = 'file'
- // input.accept = '.pdf,.doc,.docx,.xls,.xlsx,.csv' // 允许的文件类型
- // input.onchange = async (event) => {
- // const file = event.target.files[0]
- // if (!file) return
- // try {
- // // 校验文件大小(50MB)
- // const maxSize = 50 * 1024 * 1024 // 50MB
- // if (file.size > maxSize) {
- // this.$message.error('文件大小不能超过50MB!')
- // return
- // }
- // // 校验文件格式
- // const allowedFormats = [
- // '.pdf',
- // '.doc',
- // '.docx',
- // '.xls',
- // '.xlsx',
- // 'csv',
- // ]
- // const fileName = file.name.toLowerCase()
- // const isValidFormat = allowedFormats.some((format) =>
- // fileName.endsWith(format)
- // )
- // if (!isValidFormat) {
- // this.$message.error(
- // '只允许上传.pdf,.doc,.docx,.xls,.xlsx,.csv格式的文件!'
- // )
- // return
- // }
- // // 显示遮罩层
- // loading = this.$baseLoading(1, '文件上传中...')
- // // 第三步:创建FormData并上传文件
- // const formData = new FormData()
- // formData.append('file', file)
- // // 先调用上传API
- // const uploadRes = await uploadFile('/api/file/v1/upload', formData)
- // // 第四步:检查上传结果
- // if (!uploadRes || !uploadRes.value) {
- // // this.$message.error('文件上传失败!');
- // return
- // }
- // // 第五步:文件上传成功后,再更新数据
- // const fileInfo = uploadRes.value
- // // 创建更新数据对象
- // const updateData = {
- // ...row,
- // fileUrl: fileInfo?.savePath, // 更新扫描件URL
- // }
- // // 第六步:调用更新API
- // // await updateCostProjectDocument(updateData)
- // // // 第七步:更新成功,显示提示并刷新
- // // this.$message.success('文件上传成功并更新数据!')
- // // this.$emit('refresh', this.project.projectId) // 通知父组件刷新
- // } catch (error) {
- // // 错误处理
- // this.$message.error('操作失败:' + (error.message || '未知错误'))
- // } finally {
- // // 关闭遮罩层
- // loading.close()
- // }
- // }
- // // 触发文件选择
- // input.click()
- // },
- // 文件上传前验证
- beforeMaterialUpload(file) {
- const allowedTypes = [
- 'application/pdf',
- 'application/msword',
- 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
- 'application/vnd.ms-excel',
- 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
- 'text/csv',
- ]
- const allowedExtensions = [
- '.pdf',
- '.doc',
- '.docx',
- '.xls',
- '.xlsx',
- '.csv',
- ]
- const fileExtension = '.' + file.name.split('.').pop().toLowerCase()
- // 检查文件格式
- const isCorrectType = allowedTypes.includes(file.type)
- const isCorrectExtension = allowedExtensions.includes(fileExtension)
- if (!isCorrectType && !isCorrectExtension) {
- this.$message.error(
- '只允许上传 pdf, doc, docx, xls, xlsx, csv 格式的文件!'
- )
- return false
- }
- // 检查文件大小 (50MB)
- const isLt50M = file.size / 1024 / 1024 < 50
- if (!isLt50M) {
- this.$message.error('文件大小不能超过 50MB!')
- return false
- }
- return true
- },
- // 自定义上传方法
- async handleMaterialUpload(options) {
- const { file, onProgress, onSuccess, onError } = options
- // 检查是否已经上传了文件
- if (
- this.materialForm.fileList &&
- this.materialForm.fileList.length >= 1
- ) {
- this.$message.warning('只能上传一个文件,请先删除已上传的文件')
- // 手动触发onError回调
- if (onError) {
- onError(new Error('只能上传一个文件'))
- }
- return
- }
- const formData = new FormData()
- formData.append('file', file)
- try {
- // 显示上传进度
- if (onProgress) {
- onProgress({ percent: 0 })
- }
- // 调用上传API
- const uploadRes = await uploadFile('/api/file/v1/upload', formData, {
- onUploadProgress: (progressEvent) => {
- // 计算上传进度
- if (progressEvent.total) {
- const percent = Math.round(
- (progressEvent.loaded * 100) / progressEvent.total
- )
- if (onProgress) {
- onProgress({ percent })
- }
- }
- },
- })
- // 检查上传结果
- if (uploadRes && uploadRes.code === 200 && uploadRes.value) {
- const fileInfo = uploadRes.value
- // 构造文件信息对象,符合element-ui upload组件的格式
- const fileObj = {
- uid: file.uid,
- name: file.name,
- status: 'success',
- size: file.size,
- response: fileInfo,
- url: fileInfo.savePath || fileInfo.url,
- }
- if (onSuccess) {
- onSuccess(fileInfo, fileObj)
- this.materialForm.fileUrl = fileInfo.savePath || fileInfo.url
- }
- this.$message.success(`${file.name} 上传成功`)
- } else {
- throw new Error(uploadRes?.message || '上传失败,请稍后重试')
- }
- } catch (error) {
- console.error('文件上传失败:', error)
- this.$message.error(`文件上传失败:${error.message || '未知错误'}`)
- if (onError) {
- onError(error)
- }
- }
- },
- // 上传成功回调
- handleMaterialUploadSuccess(response, file, fileList) {
- // 更新文件列表,添加文件URL信息
- this.materialForm.fileList = fileList.map((item) => {
- if (item.uid === file.uid && response) {
- return {
- ...item,
- url: response.savePath || response.url || item.url,
- response: response,
- }
- }
- return item
- })
- },
- // 上传进度回调
- handleMaterialUploadProgress(event, file, fileList) {
- // 可以在这里显示上传进度,element-ui 会自动处理
- },
- // 上传失败回调
- handleMaterialUploadError(err, file, fileList) {
- console.error('文件上传错误:', err)
- this.$message.error(`${file.name} 上传失败`)
- // 从文件列表中移除失败的文件
- this.materialForm.fileList = fileList.filter(
- (item) => item.uid !== file.uid
- )
- },
- // 超出文件数量限制
- handleMaterialExceed(files, fileList) {
- this.$message.warning(
- `当前限制选择 5 个文件,本次选择了 ${files.length} 个文件,共选择了 ${fileList.length} 个文件`
- )
- },
- // 移除文件
- handleMaterialRemove(file, fileList) {
- this.materialForm.fileList = fileList
- this.$message.info(`${file.name} 已移除`)
- },
- // 成本调查表分页 - 页码改变
- handleCostSurveyPageChange(page) {
- this.costSurveyPagination.currentPage = page
- // 如果成本调查表数据来自API,可以在这里调用API
- // this.getCostSurveyData()
- },
- // 成本调查表分页 - 每页条数改变
- handleCostSurveySizeChange(size) {
- this.costSurveyPagination.pageSize = size
- this.costSurveyPagination.currentPage = 1
- // 如果成本调查表数据来自API,可以在这里调用API
- // this.getCostSurveyData()
- },
- },
- }
- </script>
- <style scoped lang="scss">
- .drawer-title {
- font-size: 18px;
- font-weight: 600;
- color: #303133;
- }
- .audit-task-manage-container {
- padding: 20px;
- height: 100%;
- overflow-y: auto;
- h3 {
- text-align: center;
- margin-top: 0;
- margin-bottom: 20px;
- font-size: 18px;
- font-weight: bold;
- }
- }
- .cost-opinion-section,
- .feedback-section {
- border: 1px solid #dcdcdc;
- border-radius: 4px;
- padding: 20px;
- margin-bottom: 20px;
- background-color: #f9f9f9;
- }
- .opinion-item,
- .feedback-item {
- margin-bottom: 20px;
- display: flex;
- align-items: center;
- label {
- width: 120px;
- margin-bottom: 8px;
- font-weight: bold;
- color: #1549ad;
- }
- }
- .file-info {
- margin-bottom: 10px;
- }
- .file-info a {
- color: #0066cc;
- text-decoration: none;
- }
- .file-info a:hover {
- text-decoration: underline;
- }
- .upload-btn {
- background-color: #007bff;
- color: #fff;
- border: none;
- border-radius: 4px;
- padding: 8px 16px;
- cursor: pointer;
- }
- .upload-btn:hover {
- background-color: #0056b3;
- }
- .cost-period-container {
- display: flex;
- align-items: flex-start;
- }
- .add-cost-year-btn {
- margin-right: 10px;
- }
- .delete-cost-year-btn {
- margin-left: 10px;
- }
- .cost-years-wrapper {
- flex: 1;
- }
- .cost-year-item {
- margin-bottom: 10px;
- display: flex;
- align-items: center;
- }
- .ml10 {
- margin-left: 10px;
- }
- .text-danger {
- color: #d9001b;
- }
- // 类别头行样式
- ::v-deep .category-header-row {
- background-color: #f5f7fa !important;
- td {
- background-color: #f5f7fa !important;
- padding: 12px 16px !important;
- }
- }
- .category-header-cell {
- font-weight: 700;
- color: #303133;
- padding-left: 16px;
- }
- // 侧边弹窗样式优化
- ::v-deep .el-drawer__body {
- overflow-y: auto;
- padding: 0;
- }
- ::v-deep .el-drawer__header {
- margin-bottom: 0;
- padding: 20px;
- border-bottom: 1px solid #e4e7ed;
- }
- ::v-deep .el-drawer__body {
- padding: 0;
- }
- </style>
|