submitDetail.vue 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884
  1. <template>
  2. <view class="page_body">
  3. <!-- 头部 -->
  4. <nav-bar height="96" title="提交材料" :onlyTitle="true" :showHeaderborder="true" @GoBack="GoBack"></nav-bar>
  5. <view class="page_content_height">
  6. <view class="page_content padding_btm">
  7. <view class="task_title">{{state?.details?.taskName}}</view>
  8. <view class="task_class_collect">
  9. <text class="class_item">{{state?.details?.departmentName}}</text>
  10. <text class="class_item">{{state?.details?.materialCategoryName}}</text>
  11. <text class="class_item">{{state?.details?.createdBy}}</text>
  12. </view>
  13. <view class="task_time">
  14. <view class="time_day">
  15. <text class="time_item">{{state?.details?.startTime}}</text>
  16. <text class="time_item">至</text>
  17. <text class="time_item">{{state?.details?.endTime}}</text>
  18. <text class="time_item" v-if="state?.details?.taskStatus === 1 && remainingDays(state?.details?.endTime) > 0">剩余{{remainingDays(state?.details?.endTime)}}天</text>
  19. </view>
  20. <view :class="['task_status', statusClassMap[state?.details?.taskStatus]]">
  21. {{taskStatusMap[state?.details?.taskStatus]}}
  22. </view>
  23. </view>
  24. <view :class="['task_desc',{'over':!state.isExpand}]">
  25. 采集要求:{{state?.details?.collectionRequire}}
  26. </view>
  27. <view class="task_desc_all">
  28. 采集要求:{{state?.details?.collectionRequire}}
  29. </view>
  30. <view class="expand_btn" v-if="state.showExpandBtn" @click="toggleExpand"><text
  31. class="expand_text">{{!state.isExpand?'展开':'收起'}}</text><uni-icons class="expand_icon"
  32. :type="!state.isExpand?'down':'up'"></uni-icons></view>
  33. </view>
  34. <!-- 间隔 -->
  35. <view class="row_gap"></view>
  36. <view class="page_content">
  37. <view class="target_status">
  38. <view class="target_tag">
  39. <template v-for="text in ['departmentName','departmentGroupName','subjectName','gradeName','classTypeName','className']">
  40. <text class="info_text" v-if="state?.targetFileList?.[text]" :key="text">{{state?.targetFileList?.[text]}}</text>
  41. </template>
  42. </view>
  43. <template v-if="state?.details?.auditMechanism === 1">
  44. <view v-if="state?.targetFileList?.targetStatus=== 1" class="status_tag notSubmitList">
  45. <text>待提交</text>
  46. </view>
  47. <view v-if="state?.targetFileList?.targetStatus=== 3" class="status_tag reviewReasonList">
  48. <text>已驳回</text>
  49. </view>
  50. <view v-if="state?.targetFileList?.targetStatus=== 2" class="status_tag notReviewList">
  51. <text>审核中</text>
  52. </view>
  53. <view v-if="state?.targetFileList?.targetStatus=== 4" class="status_tag reviewList">
  54. <text>已提交</text>
  55. </view>
  56. </template>
  57. <template v-if="state?.details?.auditMechanism === 0">
  58. <view v-if="state?.targetFileList?.targetStatus=== 1" class="status_tag notSubmitList">
  59. <text>待提交</text>
  60. </view>
  61. <view v-else class="status_tag reviewList">
  62. <text>已提交</text>
  63. </view>
  64. </template>
  65. </view>
  66. <!-- 上传按钮 提交状态 1待提交 2审核中 3已驳回 4已提交 -->
  67. <!-- maxSize:单文件上限 MB;0 表示不限制 maxCount:列表最多文件数 -->
  68. <kex-file-uploader
  69. ref="fileUploader"
  70. v-model="files"
  71. mode="headless"
  72. :multiple="true"
  73. :auto-upload="true"
  74. :upload-url="`${apiBaseUrl}/api/v1/teach/oss/file/oss/upload_file_list`"
  75. :upload-options="{
  76. name: 'files',
  77. header: {
  78. Authorization: token
  79. },
  80. formData: {
  81. taskId:state.taskId,
  82. targetId:state.targetId
  83. },
  84. }"
  85. :max-count="20"
  86. :maxSize="100"
  87. formats="doc,docx,xls,xlsx,ppt,pptx,png,jpg,jpeg,gif,bmp"
  88. @uploadSuccess="onUploadSuccess">
  89. </kex-file-uploader>
  90. <view class="upload_box" @click="FileChooseUploader" v-if="state?.targetFileList?.targetStatus === 1 && state?.details?.taskStatus !== 2">
  91. <image class="upload_icon" src="@/static/image/icon/upload_icon.png"></image>
  92. <view class="upload_text">
  93. <view class="upload_title">点击上传文件</view>
  94. <view class="upload_desc">支持Word、Excel、PPT、图片(最大100MB)</view>
  95. </view>
  96. </view>
  97. <view class="upload_box" v-if="(state?.targetFileList?.targetStatus === 2 || state?.targetFileList?.targetStatus === 4) && state?.details?.taskStatus !== 2">
  98. <image class="upload_icon" src="@/static/image/icon/upload_locked.png"></image>
  99. <view class="upload_text">
  100. <view class="upload_title">点击重新编辑可再提交</view>
  101. <view class="upload_desc">支持Word、Excel、PPT、图片(最大100MB)</view>
  102. </view>
  103. </view>
  104. <view class="upload_box" v-if="state?.targetFileList?.targetStatus === 3 && state?.details?.taskStatus !== 2">
  105. <image class="upload_icon" src="@/static/image/icon/upload_locked.png"></image>
  106. <view class="upload_text">
  107. <view class="upload_title">请先删除全部文件,再提交调整后的合规材料</view>
  108. <view class="upload_desc">支持Word、Excel、PPT、图片(最大100MB)</view>
  109. </view>
  110. </view>
  111. <view class="upload_box" v-if="state?.details?.taskStatus == 2">
  112. <image class="upload_icon" src="@/static/image/icon/upload_locked.png"></image>
  113. <view class="upload_text">
  114. <view class="upload_title">已结束不可再提交</view>
  115. <view class="upload_desc">支持Word、Excel、PPT、图片(最大100MB)</view>
  116. </view>
  117. </view>
  118. <view class="list_item" @click="OpenPreviewFile(item)" v-for="item in (state?.targetFileList?.taskTargetFileVos || [])" :Key="item.id">
  119. <!-- #ifdef APP-PLUS -->
  120. <!-- app端处理 -->
  121. <template v-if="['word','excel','pdf','txt'].includes(getFileTypeBySuffix(item.fileType))">
  122. <cjx-previewOffice :value="item.filePath" :name="item.fileName" :type="getFileTypeBySuffix(item.fileType)">
  123. <image class="file_icon" src="@/static/image/icon/file.png"></image>
  124. <view class="file_info">
  125. <view class="file_name">{{item.fileName}}</view>
  126. <view class="file_size">
  127. <text>{{getFileSize(item.fileSize)}}</text>
  128. <text>{{ item.createTime }}</text>
  129. </view>
  130. </view>
  131. <view class="file_btn">
  132. <text @click.stop="HandleDeleteFileList(item)" :class="['del',{'disabled':state?.targetFileList?.targetStatus === 2 || state?.targetFileList?.targetStatus === 4}]">删除</text>
  133. <text class="download" @click.stop="ToDownloadFile(item)">下载</text>
  134. </view>
  135. </cjx-previewOffice>
  136. </template>
  137. <template v-else>
  138. <image class="file_icon" src="@/static/image/icon/file.png"></image>
  139. <view class="file_info">
  140. <view class="file_name">{{item.fileName}}</view>
  141. <view class="file_size">
  142. <text>{{getFileSize(item.fileSize)}}</text>
  143. <text>{{ item.createTime }}</text>
  144. </view>
  145. </view>
  146. <view class="file_btn">
  147. <text @click.stop="HandleDeleteFileList(item)" :class="['del',{'disabled':state?.targetFileList?.targetStatus === 2 || state?.targetFileList?.targetStatus === 4}]">删除</text>
  148. <text class="download" @click.stop="ToDownloadFile(item)">下载</text>
  149. </view>
  150. </template>
  151. <!-- #endif -->
  152. <!-- #ifndef APP-PLUS -->
  153. <!-- 不包含app端 -->
  154. <image class="file_icon" src="@/static/image/icon/file.png"></image>
  155. <view class="file_info">
  156. <view class="file_name">{{item.fileName}}</view>
  157. <view class="file_size">
  158. <text>{{getFileSize(item.fileSize)}}</text>
  159. <text>{{ item.createTime }}</text>
  160. </view>
  161. </view>
  162. <view class="file_btn">
  163. <text @click.stop="HandleDeleteFileList(item)" :class="['del',{'disabled':state?.targetFileList?.targetStatus === 2 || state?.targetFileList?.targetStatus === 4}]">删除</text>
  164. <text class="download" @click.stop="ToDownloadFile(item)">下载</text>
  165. </view>
  166. <!-- #endif -->
  167. </view>
  168. </view>
  169. </view>
  170. <view class="page_foot" v-if="state?.details?.taskStatus!=2">
  171. <!-- 提交状态 1待提交 2审核中 3已驳回 4已提交 -->
  172. <template v-if="(state?.targetFileList?.targetStatus === 1 || state?.targetFileList?.targetStatus === 3)">
  173. <view @click="DeleteAllFiles" :class="['del',{'disabled':!state?.targetFileList?.taskTargetFileVos?.length}]">删除全部</view>
  174. <view :class="['submit',{'disabled':state?.targetFileList?.targetStatus === 3}]" @click="UpdateTaskTarget">提交</view>
  175. </template>
  176. <template v-else>
  177. <view class="del disabled">删除全部</view>
  178. <view class="submit" @click="UpdateTaskTargetReset">重新编辑</view>
  179. </template>
  180. </view>
  181. <!-- 删除确认框 -->
  182. <popupDialog ref="popupConfirmDialogRef" :showFootBorder="true" :content="state.confirmDialog.content" @DialogConfirm="DialogConfirm" />
  183. <!-- 图片 视频预览 -->
  184. <popupPreviewFile ref="imgVideoPreview" :fileType="state.previewPopup.fileType" :fileName="state.previewPopup.fileName" :filePath="state.previewPopup.filePath" @ToDownloadFile="ToDownloadFile"></popupPreviewFile>
  185. <!-- 默认指H5端 此插件只支持h5 PDF、Word、Excel、PPTX、TXT预览-->
  186. <!-- #ifdef H5 -->
  187. <wg-h5-preview-file ref="webPreviewFile" />
  188. <!-- #endif -->
  189. <!-- 文件、图片下载 -->
  190. <ss-download ref="ssdownload"></ss-download>
  191. </view>
  192. </template>
  193. <script setup>
  194. import uniIcons from '@/uni_modules/uni-icons/components/uni-icons/uni-icons.vue';
  195. import ssDownload from '@/uni_modules/ss-download/components/ss-download/ss-download.vue';
  196. import popupDialog from '@/components/popupDialog.vue';
  197. import popupPreviewFile from '@/components/popupPreviewFile.vue';//图片 音视频 zip等预览
  198. // #ifdef H5
  199. import wgH5PreviewFile from '@/components/wg-h5-preview-file/wg-h5-preview-file.vue';//web端文件预览 'word','excel','pptx','pdf','txt'
  200. // #endif
  201. // #ifdef APP-PLUS
  202. import cjxPreviewOffice from '@/uni_modules/cjx-previewOffice/components/cjx-previewOffice/cjx-previewOffice.vue';//APP端文件预览 'word','excel','pdf','txt'
  203. // #endif
  204. import kexFileUploader from '@/uni_modules/kex-file-uploader/components/kex-file-uploader/kex-file-uploader.vue';
  205. import navBar from '@/components/navBar.vue';
  206. import { remainingDays,getFileSize,getFileTypeBySuffix } from '@/common/common.js';
  207. import {getTaskTargetFileList,DeleteFileList,DelTaskTargetFileList,updateTaskTarget,uploadTaskTargetFileList} from '@/reqApi/notification.js';
  208. import {onLoad} from '@dcloudio/uni-app';
  209. import config from '@/config.js'; // 引入配置文件
  210. import {
  211. reactive,
  212. ref,
  213. nextTick,
  214. getCurrentInstance,
  215. computed,
  216. onMounted
  217. } from 'vue';
  218. const state = reactive({
  219. taskId: '', //任务id
  220. targetId:'',//
  221. auditStatus:'',//审核状态
  222. showExpandBtn: false, //是否显示展开按钮
  223. isExpand: false, //是否展开
  224. details: {}, //详情信息
  225. targetFileList:{},
  226. confirmDialog:{
  227. type:'',
  228. content:'',
  229. fileUrls:[],
  230. targetFileIds:[]
  231. },
  232. previewPopup:{
  233. fileType:'',
  234. filePath:'',
  235. fileName:''
  236. }
  237. });
  238. const popupConfirmDialogRef = ref(null);
  239. const imgVideoPreview = ref(null);//图片 视频
  240. const webPreviewFile = ref(null);//web端文件预览
  241. const appPreviewOfficeRef = ref(null);//APP端文件预览
  242. const fileUploader = ref(null);
  243. const ssdownload = ref(null);//下载
  244. const files = ref([]);
  245. const token = ref(uni.getStorageSync('token'));
  246. const apiBaseUrl = ref('');
  247. const statusClassMap = {
  248. 1: 'status_published',
  249. 2: 'status_closed'
  250. };
  251. const taskStatusMap = {
  252. 1: '进行中',
  253. 2: '已结束'
  254. };
  255. onLoad((option) => {
  256. state.taskId = option.taskId;
  257. state.targetId = option.targetId;
  258. state.auditStatus = Number(option.auditStatus);
  259. })
  260. onMounted(() => {
  261. state.details = uni.getStorageSync('submitMaterialDetailInfo') || {};
  262. uni.removeStorageSync('isLoadSubmitMaterialTaskDetail');//返回是否重新更新任务详情数据
  263. uni.removeStorageSync('isLoadSubmitMaterialIndex');//返回是否重新更新提交材料首页
  264. getApiBaseUrl();//上传接口地址
  265. GetTaskTargetFileList(true);
  266. });
  267. //上传接口地址
  268. const getApiBaseUrl = () => {
  269. if (process.env.NODE_ENV === 'development') {//本地开发环境
  270. const SYSTEM_INFO = uni.getSystemInfoSync();//获取系统信息的同步接口
  271. apiBaseUrl.value = SYSTEM_INFO.uniPlatform === 'web' ? config.proxyBaseUrl:config.apiBaseUrl;//读取配置文件的apiBaseUrl变量
  272. } else {//生产/测试环境
  273. apiBaseUrl.value = config.apiBaseUrl
  274. }
  275. }
  276. //选择文件上传
  277. const FileChooseUploader = () => {
  278. fileUploader.value && fileUploader.value.choose();
  279. }
  280. const onUploadSuccess = ({
  281. index,
  282. file, // 当前文件
  283. url, // 优先为解析出的远程地址
  284. statusCode,
  285. data, // 解析后的服务端 JSON(失败则为原始字符串)
  286. res, // 原始回调
  287. fileList // 当前全部
  288. }) => {
  289. console.log(res)
  290. const result = JSON.parse(res.data || res.result);
  291. const list = result?.data || [];
  292. const fileInfoList = list.map(item => ({
  293. ...item,
  294. filePath: item.fileUrl
  295. }))
  296. UploadTargetFileList(fileInfoList);
  297. }
  298. //具体采集任务保存上传的文件地址
  299. const UploadTargetFileList = (fileInfoList) => {
  300. uploadTaskTargetFileList({
  301. fileInfoList,
  302. taskId:state.taskId,
  303. targetId:state.targetId
  304. }).then(res=>{
  305. if (res.code === 200) {
  306. uni.showToast({
  307. title: '上传成功!',
  308. icon: 'none'
  309. });
  310. GetTaskTargetFileList(false,'upload');
  311. }
  312. })
  313. }
  314. //预览
  315. const OpenPreviewFile = (item) => {
  316. const fileType = getFileTypeBySuffix(item.fileType);
  317. state.previewPopup.fileType = fileType?fileType:item.fileType;
  318. state.previewPopup.filePath = item.filePath;
  319. state.previewPopup.fileName = item.fileName;
  320. if(['word','excel','pptx','pdf','txt'].includes(fileType)){
  321. // #ifdef H5
  322. nextTick(()=>{//h5文件预览
  323. webPreviewFile.value && webPreviewFile.value.preview({
  324. url: item.filePath,
  325. type: fileType
  326. });
  327. })
  328. // #endif
  329. // #ifdef APP-PLUS
  330. if(fileType == 'pptx'){
  331. imgVideoPreview.value.OpenDialog();
  332. }
  333. // #endif
  334. }else{
  335. imgVideoPreview.value.OpenDialog();
  336. }
  337. // const fileType = item.fileType;
  338. // if(IsImageExts(fileType)){//图片预览
  339. // state.previewPopup.filePath = item.filePath;
  340. // imgVideoPreview.value.OpenDialog();
  341. // }else{//文件预览
  342. // // 1. 先下载文件到本地临时目录
  343. // uni.downloadFile({
  344. // url: item.filePath,
  345. // success: (downloadRes) => {
  346. // if (downloadRes.statusCode === 200) {
  347. // // 2. 下载成功后,得到临时文件路径 tempFilePath
  348. // const localPath = downloadRes.tempFilePath;
  349. // // 3. 构造 file 对象(必须有 path)
  350. // const fileObj = {
  351. // name: item.fileName,
  352. // path: localPath, // 关键字段
  353. // size: item.fileSize // 可选
  354. // };
  355. // // 4. 调用 kex-file-uploader 的 openDocument 方法预览
  356. // fileUploader.value?.openDocument({
  357. // file: fileObj,
  358. // success: () => console.log('预览成功'),
  359. // fail: (err) => console.error('预览失败', err)
  360. // });
  361. // }
  362. // },
  363. // fail: (err) => {
  364. // uni.showToast({ title: '文件下载失败', icon: 'none' });
  365. // }
  366. // });
  367. // }
  368. }
  369. //下载
  370. const ToDownloadFile = (item) => {
  371. const fileType = getFileTypeBySuffix(item.fileType);//文件类型
  372. let type = '';
  373. if(fileType == 'image'){
  374. type = '1';//1:图片 2 文档
  375. }else if(['word','excel','pptx','pdf','txt'].includes(fileType)){
  376. type = '2';
  377. }else{
  378. type = '';
  379. }
  380. ssdownload?.value?.toDownload({
  381. type:type,
  382. src:item.filePath,
  383. fileName:item.fileName
  384. });
  385. }
  386. // 展开收起切换
  387. const toggleExpand = () => {
  388. state.isExpand = !state.isExpand;
  389. }
  390. //获取当前教师提交的文件列表
  391. const GetTaskTargetFileList = (init,type) => {
  392. getTaskTargetFileList(state.targetId).then(res=>{
  393. if(res.code == 200){
  394. state.targetFileList = res.data || {};
  395. //对比审核状态是否发生变化同时更新缓存数据
  396. if(!init){
  397. uni.setStorageSync('isLoadSubmitMaterialIndex',true);//返回是否重新更新提交材料首页
  398. updateCacheData(type);
  399. }
  400. }
  401. })
  402. }
  403. //单个删除
  404. const HandleDeleteFileList = (item) => {
  405. if(state?.targetFileList?.targetStatus === 2 || state?.targetFileList?.targetStatus === 4){
  406. return false
  407. }
  408. const { filePath, id } = item;
  409. state.confirmDialog = {
  410. type:'del',
  411. content:'是否删除当前文件?',
  412. fileUrls:[filePath],
  413. targetFileIds:[id]
  414. };
  415. popupConfirmDialogRef.value.OpenDialog();
  416. }
  417. //删除全部
  418. const DeleteAllFiles = () => {
  419. let fileUrls = [],targetFileIds = [];
  420. const taskTargetFileVos = state?.targetFileList?.taskTargetFileVos || [];
  421. if(taskTargetFileVos.length > 0){
  422. taskTargetFileVos.forEach(item => {
  423. fileUrls.push(item.filePath);
  424. targetFileIds.push(item.id)
  425. })
  426. state.confirmDialog = {
  427. type:'del',
  428. content:'是否删除全部当前文件?',
  429. fileUrls:fileUrls,
  430. targetFileIds:targetFileIds
  431. };
  432. popupConfirmDialogRef.value.OpenDialog();
  433. }
  434. }
  435. //提交
  436. const UpdateTaskTarget = () => {
  437. const taskTargetFileVos = state?.targetFileList?.taskTargetFileVos || [];
  438. if(taskTargetFileVos.length == 0){
  439. uni.showToast({
  440. title: '请上传提交文件!',
  441. icon: 'none'
  442. });
  443. return false
  444. }
  445. state.confirmDialog = {
  446. type:'submit',
  447. content:'是否提交当前任务?',
  448. fileUrls:[],
  449. targetFileIds:[]
  450. };
  451. popupConfirmDialogRef.value.OpenDialog();
  452. }
  453. //重新提交
  454. const UpdateTaskTargetReset = () => {
  455. state.confirmDialog = {
  456. type:'submit',
  457. content:'是否重新编辑当前任务?',
  458. fileUrls:[],
  459. targetFileIds:[]
  460. };
  461. popupConfirmDialogRef.value.OpenDialog();
  462. }
  463. //确定删除 确定提交
  464. const DialogConfirm = () => {
  465. if(state.confirmDialog.type == 'del'){//单个删除 批量删除
  466. DelFileList();
  467. }else if(state.confirmDialog.type == 'submit') {//提交
  468. submitTaskTarget();
  469. }
  470. }
  471. const DelFileList = async() => {
  472. const res = await DeleteFileList({ fileUrls: state.confirmDialog.fileUrls })
  473. if (res.code !== 200) {
  474. uni.showToast({
  475. title: res.msg,
  476. icon: 'none'
  477. });
  478. return false
  479. }
  480. const resData = await DelTaskTargetFileList({
  481. targetId: state.targetId,
  482. targetFileIds: state.confirmDialog.targetFileIds
  483. })
  484. if (resData.code === 200) {
  485. uni.showToast({
  486. title: '删除成功!',
  487. icon: 'none'
  488. });
  489. GetTaskTargetFileList(false,'del');
  490. }
  491. }
  492. //提交
  493. const submitTaskTarget = () => {
  494. updateTaskTarget(state.targetId).then(res => {
  495. if (res.code === 200) {
  496. uni.showToast({
  497. title: '提交成功!',
  498. icon: 'none'
  499. });
  500. GetTaskTargetFileList(false,'submit');
  501. }
  502. })
  503. }
  504. //对比审核状态是否发生变化同时更新缓存数据
  505. const updateCacheData = (type) => {
  506. const targetStatus = state?.targetFileList?.targetStatus;
  507. let taskTargetList = state?.details?.taskTargetVos || [];
  508. if (state.auditStatus !== targetStatus) {
  509. // 状态变化,删除目标项
  510. taskTargetList.forEach(item=>{
  511. if(item.id == state.targetId){
  512. item.isShow = 1;//删除状态
  513. }
  514. })
  515. } else {
  516. // 状态未变且非提交(上传或删除)操作,更新文件列表
  517. if (type !== 'submit'){
  518. const targetItem = taskTargetList.find(item => item.id === state.targetId);
  519. if (targetItem) {
  520. targetItem.taskTargetFileVos = state?.targetFileList?.taskTargetFileVos || [];
  521. targetItem.fileNum = targetItem.taskTargetFileVos.length;
  522. }
  523. }else{
  524. taskTargetList.forEach(item=>{
  525. if(item.id == state.targetId){
  526. item.isShow = 0;//显示
  527. }
  528. })
  529. }
  530. }
  531. // 关键:将结果写回 state
  532. if (state?.details) {
  533. state.details.taskTargetVos = taskTargetList;
  534. uni.setStorageSync('submitMaterialDetailInfo',state.details);
  535. uni.setStorageSync('isLoadSubmitMaterialTaskDetail',true);//返回是否重新更新任务详情数据
  536. }
  537. }
  538. //返回
  539. const GoBack = () => {
  540. uni.navigateBack({
  541. delta: 1
  542. });
  543. }
  544. </script>
  545. <style scoped lang="scss">
  546. .page_body{
  547. height: 100%;
  548. }
  549. .page_content_height{
  550. display: flex;
  551. flex-direction: column;
  552. width: 100%;
  553. height: calc(100% - 240rpx);
  554. overflow: auto;
  555. }
  556. .page_content {
  557. &.padding_btm {
  558. padding-bottom: 24rpx;
  559. .task_title {
  560. font-weight: 500;
  561. font-size: 32rpx;
  562. color: #333333;
  563. margin-top: 24rpx;
  564. }
  565. .task_class_collect {
  566. display: inline-flex;
  567. align-items: center;
  568. flex-wrap: wrap;
  569. width: 100%;
  570. margin-top: 16rpx;
  571. gap: 16rpx;
  572. .class_item {
  573. font-weight: 400;
  574. font-size: 24rpx;
  575. color: #999999;
  576. }
  577. }
  578. .task_time {
  579. display: flex;
  580. align-items: flex-start;
  581. width: 100%;
  582. margin-top: 16rpx;
  583. .time_day {
  584. display: inline-flex;
  585. align-items: center;
  586. flex-wrap: wrap;
  587. flex: 1;
  588. .time_item {
  589. font-weight: 400;
  590. font-size: 24rpx;
  591. line-height: 48rpx;
  592. color: #999999;
  593. &:nth-child(2) {
  594. margin: 0 8rpx;
  595. }
  596. &:nth-child(4) {
  597. color: #2E64FA;
  598. margin-left: 16rpx;
  599. }
  600. }
  601. }
  602. .task_status {
  603. display: inline-flex;
  604. align-items: center;
  605. height: 48rpx;
  606. padding: 0 12rpx;
  607. border-radius: 8rpx;
  608. font-weight: 400;
  609. font-size: 24rpx;
  610. &.status_pending {
  611. background: rgba(46, 100, 250, 0.1);
  612. color: #2E64FA;
  613. }
  614. &.status_published {
  615. background: rgba(82, 196, 26, 0.1);
  616. color: #2BC644;
  617. }
  618. &.status_closed {
  619. background: #6666661a;
  620. color: #666666;
  621. }
  622. }
  623. }
  624. .task_desc {
  625. margin-top: 24rpx;
  626. display: flex;
  627. width: 100%;
  628. padding-top: 24rpx;
  629. border-top: 2rpx solid #F3F3F3;
  630. font-weight: 400;
  631. font-size: 28rpx;
  632. color: #999999;
  633. line-height: 44rpx;
  634. box-sizing: border-box;
  635. position: relative;
  636. &.over {
  637. max-height: 168rpx;
  638. overflow: hidden;
  639. transition: all 0.25s;
  640. display: -webkit-box;
  641. -webkit-line-clamp: 3;
  642. -webkit-box-orient: vertical;
  643. }
  644. }
  645. .task_desc_all {
  646. display: flex;
  647. width: 100%;
  648. padding-top: 24rpx;
  649. border-top: 2rpx solid #F3F3F3;
  650. font-weight: 400;
  651. font-size: 28rpx;
  652. color: #999999;
  653. line-height: 44rpx;
  654. box-sizing: border-box;
  655. position: absolute;
  656. left: -9999px;
  657. top: 0;
  658. visibility: hidden; // 不可见但占据空间(不影响布局,因为absolute)
  659. pointer-events: none;
  660. }
  661. .expand_btn {
  662. width: 100%;
  663. height: 40rpx;
  664. background-color: #FFFFFF;
  665. display: flex;
  666. justify-content: flex-end;
  667. align-items: center;
  668. .expand_text {
  669. font-weight: 400;
  670. font-size: 28rpx;
  671. color: #2E64FA;
  672. margin-right: 8rpx;
  673. }
  674. .expand_icon {
  675. font-size: 32rpx !important;
  676. color: #2E64FA !important;
  677. }
  678. }
  679. }
  680. }
  681. .row_gap {
  682. background-color: #F8F9FD;
  683. width: 100%;
  684. height: 24rpx;
  685. }
  686. .target_status {
  687. width: 100%;
  688. display: flex;
  689. align-items: center;
  690. padding: 24rpx 0;
  691. border-bottom: 2rpx solid #F3F3F3;
  692. .target_tag{
  693. flex: 1;
  694. font-weight: 500;
  695. font-size: 32rpx;
  696. color: #333333;
  697. .info_text{
  698. flex-shrink: 0;
  699. margin-right: 12rpx;
  700. }
  701. }
  702. .status_tag{
  703. font-size: 24rpx;
  704. text-align: center;
  705. padding: 8rpx 12rpx;
  706. font-weight: 400;
  707. border-radius: 8rpx;
  708. flex-shrink: 0;
  709. &.notSubmitList {
  710. background: rgba(46,100,250,0.1);
  711. color: #2E64FA;
  712. }
  713. &.notReviewList {
  714. background: rgba(251,159,52,0.1);
  715. color: #FB9F34;
  716. }
  717. &.reviewReasonList {
  718. background: rgba(245,108,108,0.1);
  719. color: #F56C6C;
  720. }
  721. &.reviewList {
  722. background: rgba(43,198,68,0.1);
  723. color: #2BC644;
  724. }
  725. }
  726. }
  727. .upload_box{
  728. margin-top: 24rpx;
  729. width: 100%;
  730. background-color: #FAFBFF;
  731. border-radius: 20rpx;
  732. border: 2rpx dashed #CCCED4;
  733. display: flex;
  734. box-sizing: border-box;
  735. align-items: center;
  736. padding: 22rpx 0 22rpx 40rpx;
  737. .upload_icon{
  738. width: 64rpx;
  739. height: 64rpx;
  740. margin-right: 24rpx;
  741. flex-shrink: 0;
  742. }
  743. .upload_text{
  744. flex:1;
  745. display: flex;
  746. flex-direction: column;
  747. .upload_title{
  748. font-weight: 400;
  749. font-size: 28rpx;
  750. color: #666666;
  751. }
  752. .upload_desc{
  753. margin-top: 8rpx;
  754. font-weight: 400;
  755. font-size: 20rpx;
  756. color: #CCCED4;
  757. }
  758. }
  759. }
  760. .list_item {
  761. display: flex;
  762. align-items: center;
  763. width: 100%;
  764. padding: 20rpx 24rpx;
  765. background: #FFFFFF;
  766. border-radius: 20rpx;
  767. border: 2rpx solid #EBEEF5;
  768. box-sizing: border-box;
  769. margin-top: 24rpx;
  770. gap:20rpx;
  771. .file_icon{
  772. flex-shrink: 0;
  773. width: 80rpx;
  774. height: 80rpx;
  775. }
  776. .file_info{
  777. flex:1;
  778. display: flex;
  779. flex-direction: column;
  780. overflow: hidden;
  781. .file_name{
  782. width: 100%;
  783. font-weight: 500;
  784. font-size: 28rpx;
  785. color: #333333;
  786. overflow: hidden;
  787. white-space: nowrap;
  788. text-overflow: ellipsis;
  789. }
  790. .file_size{
  791. display: flex;
  792. width: 100%;
  793. gap: 20rpx;
  794. font-weight: 400;
  795. font-size: 24rpx;
  796. color: #999999;
  797. margin-top: 8rpx;
  798. }
  799. }
  800. .file_btn{
  801. flex-shrink: 0;
  802. display: flex;
  803. gap:24rpx;
  804. font-weight: 400;
  805. font-size: 28rpx;
  806. .del{
  807. color: #F56C6C;
  808. &.disabled{
  809. color: #C0C4CC;
  810. }
  811. }
  812. .download{
  813. color: #2E64FA;
  814. }
  815. }
  816. }
  817. .page_foot{
  818. position: fixed;
  819. display: flex;
  820. align-items: center;
  821. left: 0;
  822. right: 0;
  823. bottom: 0;
  824. padding: 0 24rpx;
  825. height: 130rpx;
  826. background-color: #FFFFFF;
  827. gap: 32rpx;
  828. .del{
  829. display: flex;
  830. align-items: center;
  831. justify-content: center;
  832. width: 240rpx;
  833. height: 90rpx;
  834. box-sizing: border-box;
  835. border-radius: 8rpx;
  836. border: 2rpx solid #F56C6C;
  837. font-weight: 400;
  838. font-size: 28rpx;
  839. color: #F56C6C;
  840. &.disabled{
  841. color: #C0C4CC;
  842. border: 2rpx solid #C0C4CC;
  843. }
  844. }
  845. .submit {
  846. flex:1;
  847. height: 90rpx;
  848. background-color: #2E64FA;
  849. border-radius: 8rpx;
  850. display: flex;
  851. justify-content: center;
  852. align-items: center;
  853. font-weight: 500;
  854. font-size: 28rpx;
  855. color: #FFFFFF;
  856. &.disabled{
  857. background-color: #C0C4CC;
  858. }
  859. }
  860. }
  861. </style>