taskDetail.vue 28 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147
  1. <template>
  2. <view class="container">
  3. <Watermark />
  4. <view class="status-bar" :style="{ height: statusBarHeight + 'px' }"></view>
  5. <view class="top">
  6. <image class="return" @click="goBack" src="https://ysrw-1395926010.cos.ap-chengdu.myqcloud.com/image/back_white.png"></image>
  7. <text>任务详情</text>
  8. </view>
  9. <scroll-view class="content" scroll-y>
  10. <!-- 任务卡片 -->
  11. <view class="task-card">
  12. <view class="card-header">
  13. <view class="card-title">{{ detail.taskName||'-' }}</view>
  14. </view>
  15. <view class="card-meta">
  16. <view class="meta-tag">{{ detail.taskTypeName||'-' }}</view>
  17. <view class="meta-id">ID:{{utils.parseIdCard(detail.taskNo)||'-' }}</view>
  18. </view>
  19. </view>
  20. <!-- 任务信息 -->
  21. <view class="info-section">
  22. <view class="section-header">
  23. <view class="section-indicator"></view>
  24. <text class="section-title">任务信息</text>
  25. </view>
  26. <view class="info-list">
  27. <view class="info-item">
  28. <text class="info-label">费用分摊:</text>
  29. <text class="info-value">{{ detail.costShareName||'-' }}</text>
  30. </view>
  31. <view class="info-item">
  32. <text class="info-label">归属项目:</text>
  33. <text class="info-value">{{ detail.projectName ||'-' }}</text>
  34. </view>
  35. <view class="info-item">
  36. <text class="info-label">归属部门:</text>
  37. <text class="info-value">{{ detail.deptName ||'-' }}</text>
  38. </view>
  39. <view class="info-item">
  40. <text class="info-label">归属产品:</text>
  41. <text class="info-value">{{ detail.productName ||'-' }}</text>
  42. </view>
  43. <!-- <view class="info-item">
  44. <text class="info-label">申请补充直播任务:</text>
  45. <text class="info-value">{{ detail.applySupplementLive ||'-' }}</text>
  46. </view>
  47. <view class="info-item">
  48. <text class="info-label">补充任务直播间ID:</text>
  49. <text class="info-value">{{ detail.supplementRoomId ||'-' }}</text>
  50. </view>
  51. <view class="info-item">
  52. <text class="info-label">申请补充任务原因:</text>
  53. <text class="info-value">{{ detail.supplementReason ||'-' }}</text>
  54. </view> -->
  55. </view>
  56. </view>
  57. <!-- 内容信息 -->
  58. <view class="info-section">
  59. <view class="section-header">
  60. <view class="section-indicator"></view>
  61. <text class="section-title">内容信息</text>
  62. </view>
  63. <view class="info-list">
  64. <view class="info-item">
  65. <text class="info-label">交付物名称:</text>
  66. <text class="info-value">{{ detail.deliverableName ||'-' }}</text>
  67. </view>
  68. <view class="info-item">
  69. <text class="info-label">交付物ID:</text>
  70. <text class="info-value">{{ detail.deliverableId||'-' }}</text>
  71. </view>
  72. <!-- <view class="info-item">
  73. <text class="info-label">直播间地址:</text>
  74. <text class="info-value">{{ detail.liveRoomUrl ||'-' }}</text>
  75. <text class="copy-btn" @click="copyToClipboard(contentInfo.liveRoomUrl)">复制</text>
  76. </view>
  77. <view class="info-item">
  78. <text class="info-label">推流地址:</text>
  79. <text class="info-value">{{ detail.pushUrl ||'-' }}</text>
  80. <text class="copy-btn" @click="copyToClipboard(contentInfo.pushUrl)">复制</text>
  81. </view>
  82. <view class="info-item">
  83. <text class="info-label">开播地址:</text>
  84. <text class="info-value">{{ detail.startUrl||'-' }}</text>
  85. <text class="copy-btn" @click="copyToClipboard(contentInfo.startUrl)">复制</text>
  86. </view>
  87. <view class="info-item">
  88. <text class="info-label">直播回放:</text>
  89. <text class="info-value">{{ detail.liveReplay ||'-' }}</text>
  90. </view>
  91. <view class="info-item">
  92. <text class="info-label">播放视频:</text>
  93. <text class="info-value">{{ detail.playVideo||'-' }}</text>
  94. </view>
  95. <view class="info-item">
  96. <text class="info-label">下载视频:</text>
  97. <text class="info-value">{{ detail.downloadVideo||'-' }}</text>
  98. </view>
  99. <view class="info-item">
  100. <text class="info-label">观众人数:</text>
  101. <text class="info-value">{{ detail.viewerCount||'0' }}</text>
  102. </view>
  103. <view class="info-item">
  104. <text class="info-label">有效观看:</text>
  105. <text class="info-value">{{ detail.validView||'-' }}</text>
  106. </view>
  107. <view class="info-item">
  108. <text class="info-label">情况说明:</text>
  109. <text class="info-value">{{ detail.description||'-' }}</text>
  110. </view> -->
  111. </view>
  112. </view>
  113. <!-- 客户信息 -->
  114. <view class="info-section">
  115. <view class="section-header">
  116. <view class="section-indicator"></view>
  117. <text class="section-title">客户信息</text>
  118. </view>
  119. <view class="client-list">
  120. <view class="client-item" >
  121. <view class="client-info">
  122. <image class="avatar" src="https://ysrw-1395926010.cos.ap-chengdu.myqcloud.com/image/my_heads_icon.png"></image>
  123. <view class="client-txt">
  124. <view class="client-name">
  125. {{ detail.doctorVO.doctorName||'-' }}
  126. <text class="client-level" v-if="detail.doctorVO.jobTitle">{{ detail.doctorVO.jobTitle }}</text>
  127. </view>
  128. <view class="client-hospital">
  129. <text>{{ detail.doctorVO.institution ||'-'}} </text>
  130. <view class="line"></view>
  131. <text>{{ detail.doctorVO.department ||'-'}}</text>
  132. </view>
  133. </view>
  134. </view>
  135. <view class="client-stats">
  136. <view class="stat-item"><text class="num">{{detail.taskCount ||'0'}} </text>任务</view>
  137. <view class="stat-item"><text class="num">{{ detail.taskIntegral||'0' }} </text>积分</view>
  138. </view>
  139. </view>
  140. </view>
  141. </view>
  142. <!-- 补充材料 -->
  143. <view class="info-section">
  144. <view class="section-header">
  145. <view class="section-indicator"></view>
  146. <text class="section-title">补充材料</text>
  147. </view>
  148. <view class="info-list">
  149. <template v-if="detail.materialInfoList && detail.materialInfoList.length > 0">
  150. <view v-for="(material, index) in detail.materialInfoList" :key="index" class="material-item">
  151. <view class="material-header">
  152. <text class="material-title" v-if="detail.materialInfoList.length > 1">材料 {{ index + 1 }}</text>
  153. </view>
  154. <view class="info-item">
  155. <text class="info-label">交付物名称:</text>
  156. <text class="info-value">{{ material.materialName || '-' }}</text>
  157. </view>
  158. <view class="info-item">
  159. <text class="info-label">情况说明:</text>
  160. <text class="info-value">{{ material.materialDesc || '-' }}</text>
  161. </view>
  162. <view class="info-item column">
  163. <text class="info-label">附件:</text>
  164. <view class="attachment-item" v-if="material.materialLink">
  165. <view class="left">
  166. <image class="img" src="https://ysrw-1395926010.cos.ap-chengdu.myqcloud.com/image/icon_attachment.png"></image>
  167. <view class="txt-item">
  168. <view class="attachment-name">{{ material.materialLink || '-' }}</view>
  169. <view class="attachment-size">{{ formatFileSize(material.fileSize || 0) }}</view>
  170. </view>
  171. </view>
  172. <image class="download-btn" @click="downloadAttachment(material.materialLink)"
  173. src="https://ysrw-1395926010.cos.ap-chengdu.myqcloud.com/image/icon_downlad.png"></image>
  174. </view>
  175. </view>
  176. </view>
  177. </template>
  178. <view v-else class="empty-material">
  179. <text>暂无补充材料</text>
  180. </view>
  181. </view>
  182. </view>
  183. <!-- 审批信息 -->
  184. <view class="info-section">
  185. <view class="section-header">
  186. <view class="section-indicator"></view>
  187. <text class="section-title">审批信息</text>
  188. </view>
  189. <view class="audit-tabs">
  190. <view class="audit-tab" :class="{ active: activeTab === 'create' }" @click="switchTab('create')">创建任务审批</view>
  191. <view class="audit-tab" v-if="detail.createAuditStatus!=0" :class="{ active: activeTab === 'complete' }" @click="switchTab('complete')">完成任务审批</view>
  192. </view>
  193. <view class="approval-list">
  194. <view class="approval-item" v-for="(item, index) in currentApprovalInfo" :key="index">
  195. <view class="left">
  196. <view class="avatar-box">
  197. <image class="avatar" src="https://ysrw-1395926010.cos.ap-chengdu.myqcloud.com/image/my_heads_icon.png"></image>
  198. <image class="icon" v-if="item.status=='待审核'" src="https://ysrw-1395926010.cos.ap-chengdu.myqcloud.com/image/icon_wait.png"></image>
  199. <image class="icon" v-if="item.status=='已通过'" src="https://ysrw-1395926010.cos.ap-chengdu.myqcloud.com/image/icon_pass.png"></image>
  200. <image class="icon" v-if="item.status=='已驳回'" src="https://ysrw-1395926010.cos.ap-chengdu.myqcloud.com/image/icon_refuse.png"></image>
  201. </view>
  202. <view class="approval-user">
  203. <view class="user-name">{{ item.name }}</view>
  204. <view class="user-status" :style="{ color: item.statusColor }">{{ item.status }}</view>
  205. </view>
  206. </view>
  207. <text class="approval-time">{{ item.time }}</text>
  208. <view class="approval-line" v-if="index < currentApprovalInfo.length - 1"></view>
  209. </view>
  210. <view v-if="currentApprovalInfo.length === 0" class="empty-approval">
  211. <text>暂无审批信息</text>
  212. </view>
  213. </view>
  214. </view>
  215. </scroll-view>
  216. <view class="bottom-bar" v-if="auditStatus==1&&detailType==='audit'">
  217. <view class="action-buttons">
  218. <view class="btn btn-cancel" @click="openRejectPopup">
  219. <image class="icon" src="https://ysrw-1395926010.cos.ap-chengdu.myqcloud.com/image/icon_approval_no.png"></image>
  220. <text>驳回</text>
  221. </view>
  222. <view class="btn btn-submit" @click="handleNext">
  223. <image class="icon" src="https://ysrw-1395926010.cos.ap-chengdu.myqcloud.com/image/icon_approval_yes.png"></image>
  224. <text>通过</text>
  225. </view>
  226. </view>
  227. </view>
  228. <!-- 驳回弹窗 -->
  229. <u-popup :show="showRejectPopup" mode="bottom" round="24" z-index="9999999">
  230. <view class="reject-popup-content">
  231. <view class="popup-header">
  232. <text class="popup-title">驳回</text>
  233. <image @click="showRejectPopup = false;" class="close" src="https://ysrw-1395926010.cos.ap-chengdu.myqcloud.com/image/icon_close.png"></image>
  234. </view>
  235. <view class="input-area">
  236. <textarea v-model="rejectReason" placeholder="请输入驳回意见" class="reason-input" :auto-height="true"
  237. maxlength="200" />
  238. </view>
  239. <view class="btn-group">
  240. <view class="button reject" @click="showRejectPopup = false">取消</view>
  241. <view class="button confirm" @click="handleConfirmReject ">确认驳回</view>
  242. </view>
  243. </view>
  244. </u-popup>
  245. </view>
  246. </template>
  247. <script>
  248. import { doAudit
  249. // ,doCreateAudit
  250. } from '@/api/audit.js'
  251. import { info } from '@/api/task.js';
  252. import { detail} from '@/api/audit.js';
  253. export default {
  254. data() {
  255. return {
  256. // 仅获取微信小程序状态栏高度,无多余逻辑
  257. statusBarHeight: uni.getSystemInfoSync().statusBarHeight,
  258. taskId: '',
  259. // 任务基础信息
  260. taskData: {
  261. },
  262. // 任务信息
  263. taskInfo: {
  264. },
  265. // 内容信息
  266. contentInfo: {
  267. },
  268. // 客户信息列表
  269. clientList: [
  270. ],
  271. // 补充材料
  272. supplementMaterial: {
  273. deliverableName: '-',
  274. description: '-',
  275. attachment: {
  276. }
  277. },
  278. // 审批信息
  279. createApprovalInfo: [],
  280. completeApprovalInfo: [],
  281. activeTab: 'create',
  282. taskId:'',
  283. taskId2:'',
  284. detail:{},
  285. createStatus:'',
  286. completeStatus:'',
  287. auditStatus:'',
  288. userInfo:{},
  289. showRejectPopup:false,//是否展示驳回弹窗
  290. rejectReason:'',//驳回原因
  291. detailType:''//详情type
  292. }
  293. },
  294. computed: {
  295. currentApprovalInfo() {
  296. return this.activeTab === 'create' ? this.createApprovalInfo : this.completeApprovalInfo
  297. }
  298. },
  299. onLoad(options) {
  300. console.log("任务详情数据",options)
  301. if (options.taskId) {
  302. this.taskId = options.taskId
  303. this.loadData(this.taskId,'create')
  304. }
  305. if (options.taskId2) {
  306. this.taskId2 = options.taskId2
  307. this.loadData(this.taskId2,'complete')
  308. }
  309. if (options.id) {
  310. const id = options.id
  311. this.info(id);
  312. }
  313. if(options.type){
  314. this.detailType = options.type
  315. }
  316. // 初始化 auditStatus
  317. this.auditStatus = this.createStatus;
  318. this.userInfo = uni.getStorageSync('userInfo')
  319. },
  320. methods: { // 打开驳回弹窗
  321. openRejectPopup() {
  322. // 直接打开驳回弹窗
  323. this.showRejectPopup = true
  324. },
  325. // 确认驳回
  326. async handleConfirmReject() {
  327. if (!this.rejectReason.trim()) {
  328. uni.showToast({
  329. title: '请输入驳回意见',
  330. icon: 'none'
  331. })
  332. return
  333. }
  334. try {
  335. uni.showLoading({
  336. title: '提交中...'
  337. })
  338. console.log("this.userInfo",this.userInfo)
  339. // 根据当前标签选择不同的审核接口
  340. // const auditApi = this.activeTab === 'create' ? doCreateAudit : doAudit;
  341. const auditApi = doAudit;
  342. // 调用审核接口,传递action=2表示驳回
  343. const res = await auditApi({
  344. auditId: this.activeTab === 'create' ? this.taskId : this.taskId2,
  345. userId: this.userInfo.userId,
  346. userType: 0,
  347. action: 2,
  348. comment: this.rejectReason,
  349. companyId: this.userInfo.companyId
  350. })
  351. uni.hideLoading()
  352. if (res.code === 200) {
  353. uni.showToast({
  354. title: res.data.message,
  355. icon: 'none'
  356. })
  357. // 关闭弹窗
  358. this.showRejectPopup = false
  359. // 重置输入
  360. this.rejectReason = ''
  361. // 重新加载数据
  362. this.loadData()
  363. } else {
  364. uni.showToast({
  365. title: res.msg || '驳回失败',
  366. icon: 'none'
  367. })
  368. }
  369. } catch (e) {
  370. uni.hideLoading()
  371. console.error('驳回失败', e)
  372. uni.showToast({
  373. title: '驳回失败,请稍后重试',
  374. icon: 'none'
  375. })
  376. }
  377. },
  378. // 审批通过
  379. async handleNext() {
  380. try {
  381. uni.showLoading({
  382. title: '提交中...'
  383. })
  384. console.log("this.userInfo",this.userInfo)
  385. // 根据当前标签选择不同的审核接口
  386. // const auditApi = this.activeTab === 'create' ? doCreateAudit : doAudit;
  387. const auditApi = doAudit;
  388. // 调用审核接口,传递action=1表示通过
  389. const res = await auditApi({
  390. auditId: this.activeTab === 'create' ? this.taskId : this.taskId2,
  391. userId: this.userInfo.userId,
  392. userType: 0,
  393. action: 1,
  394. comment: "",
  395. companyId: this.userInfo.companyId
  396. })
  397. uni.hideLoading()
  398. if (res.code === 200) {
  399. uni.showToast({
  400. title: res.data.message,
  401. icon: 'none'
  402. })
  403. // 审核通过后,再次调用对应的审核接口
  404. try {
  405. const res2 = await auditApi({
  406. auditId: this.activeTab === 'create' ? this.taskId : this.taskId2,
  407. userId: this.userInfo.userId,
  408. userType: 0,
  409. action: 1,
  410. comment: "",
  411. companyId: this.userInfo.companyId
  412. })
  413. console.log('第二次调用审核接口返回:', res2)
  414. } catch (e2) {
  415. console.error('第二次调用审核接口失败', e2)
  416. }
  417. // 重新加载数据
  418. // this.loadData()
  419. } else {
  420. uni.showToast({
  421. title: res.msg || '审批通过失败',
  422. icon: 'none'
  423. })
  424. }
  425. } catch (e) {
  426. uni.hideLoading()
  427. console.error('审批通过失败', e)
  428. uni.showToast({
  429. title: '审批通过失败,请稍后重试',
  430. icon: 'none'
  431. })
  432. }
  433. },
  434. goBack() {
  435. uni.navigateBack()
  436. },
  437. switchTab(tab) {
  438. this.activeTab = tab
  439. // 根据切换的标签更新 auditStatus
  440. this.auditStatus = tab === 'create' ? this.createStatus : this.completeStatus
  441. },
  442. info(id){
  443. info(id).then(res=>{
  444. if(res.code===200){
  445. this.detail = res.data
  446. console.log("任务详情",this.detail)
  447. }
  448. })},
  449. async loadData(taskId,type) {
  450. // 如果没有传递参数,根据当前选中的标签加载对应的数据
  451. if (!taskId || !type) {
  452. if (this.activeTab === 'create' && this.taskId) {
  453. await this.loadData(this.taskId, 'create');
  454. }
  455. if (this.activeTab === 'complete' && this.taskId2) {
  456. await this.loadData(this.taskId2, 'complete');
  457. }
  458. return;
  459. }
  460. try {
  461. uni.showLoading({
  462. title: '加载中...'
  463. })
  464. // 调用接口获取任务详情
  465. const res = await detail({ auditId:taskId})
  466. uni.hideLoading()
  467. if (res.code === 200) {
  468. // 处理返回的数据
  469. const data = res.data.auditFlows
  470. if(type==='create'){
  471. this.createApprovalInfo = data?.map(item => ({
  472. name: item.auditUserName || '审批人',
  473. status: item.statusName || '-',
  474. statusColor: this.getAuditStatusColor(item.status),
  475. time: item.auditTime || ''
  476. })) || []
  477. this.createStatus = res.data.audit.status
  478. // 如果当前选中的是创建审批标签,更新 auditStatus
  479. if (this.activeTab === 'create') {
  480. this.auditStatus = this.createStatus;
  481. }
  482. }
  483. if(type==='complete'){
  484. this.completeApprovalInfo = data?.map(item => ({
  485. name: item.auditUserName || '审批人',
  486. status: item.statusName || '-',
  487. statusColor: this.getAuditStatusColor(item.status),
  488. time: item.auditTime || ''
  489. })) || []
  490. this.completeStatus = res.data.audit.status
  491. // 如果当前选中的是完成审批标签,更新 auditStatus
  492. if (this.activeTab === 'complete') {
  493. this.auditStatus = this.completeStatus;
  494. }
  495. }
  496. } else {
  497. uni.showToast({
  498. title: '获取任务详情失败',
  499. icon: 'none'
  500. })
  501. }
  502. } catch (e) {
  503. uni.hideLoading()
  504. console.error('加载数据失败', e)
  505. uni.showToast({
  506. title: '网络错误',
  507. icon: 'none'
  508. })
  509. }
  510. },
  511. getAuditStatusText(status) {
  512. // 根据审核状态获取状态文本
  513. const statusMap = {
  514. 0: '待审核',
  515. 1: '已通过',
  516. 2: '已驳回'
  517. }
  518. return statusMap[status] || '-'
  519. },
  520. getAuditStatusColor(status) {
  521. // 根据审核状态获取状态颜色
  522. const colorMap = {
  523. 1: '#FF9800',
  524. 2: '#4CAF50',
  525. 3: '#F44336'
  526. }
  527. return colorMap[status] || '#999'
  528. },
  529. // 复制到剪贴板
  530. copyToClipboard(text) {
  531. uni.setClipboardData({
  532. data: text,
  533. success() {
  534. uni.showToast({
  535. title: '复制成功',
  536. icon: 'success'
  537. })
  538. }
  539. })
  540. },
  541. // 下载附件
  542. downloadAttachment(materialLink) {
  543. if (!materialLink) {
  544. uni.showToast({
  545. title: '附件链接不存在',
  546. icon: 'none'
  547. })
  548. return
  549. }
  550. uni.showLoading({
  551. title: '下载中...'
  552. })
  553. uni.downloadFile({
  554. url: materialLink,
  555. success: (res) => {
  556. if (res.statusCode === 200) {
  557. uni.saveFile({
  558. tempFilePath: res.tempFilePath,
  559. success: (saveRes) => {
  560. uni.hideLoading()
  561. uni.showToast({
  562. title: '下载成功',
  563. icon: 'success'
  564. })
  565. },
  566. fail: (err) => {
  567. uni.hideLoading()
  568. uni.showToast({
  569. title: '保存失败',
  570. icon: 'none'
  571. })
  572. }
  573. })
  574. } else {
  575. uni.hideLoading()
  576. uni.showToast({
  577. title: '下载失败',
  578. icon: 'none'
  579. })
  580. }
  581. },
  582. fail: (err) => {
  583. uni.hideLoading()
  584. uni.showToast({
  585. title: '下载失败',
  586. icon: 'none'
  587. })
  588. }
  589. })
  590. },
  591. // 格式化文件大小
  592. formatFileSize(bytes) {
  593. if (bytes === 0) return '0 B';
  594. const k = 1024;
  595. const sizes = ['B', 'KB', 'MB', 'GB', 'TB'];
  596. const i = Math.floor(Math.log(bytes) / Math.log(k));
  597. return parseFloat((bytes / Math.pow(k, i)).toFixed(2)) + ' ' + sizes[i];
  598. }
  599. }
  600. }
  601. </script>
  602. <style lang="scss" scoped>
  603. .material-item {
  604. margin-bottom: 20px;
  605. padding: 15px;
  606. background: #fff;
  607. border-radius: 8px;
  608. box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  609. }
  610. .material-header {
  611. margin-bottom: 15px;
  612. padding-bottom: 10px;
  613. border-bottom: 1px solid #f0f0f0;
  614. }
  615. .material-title {
  616. font-size: 16px;
  617. font-weight: 600;
  618. color: #333;
  619. }
  620. .empty-material {
  621. padding: 40px 0;
  622. text-align: center;
  623. color: #999;
  624. font-size: 14px;
  625. }
  626. .container {
  627. min-height: 100vh;
  628. background: #f5f5f5;
  629. display: flex;
  630. flex-direction: column;
  631. height: auto;
  632. &::before {
  633. content: '';
  634. position: absolute;
  635. top: 0;
  636. left: 0;
  637. right: 0;
  638. width: 100%;
  639. height: 532rpx;
  640. background: linear-gradient(180deg, rgba(56, 139, 255, 0.79) 0%, rgba(56, 139, 255, 0) 100%);
  641. }
  642. }
  643. .top {
  644. display: flex;
  645. justify-content: center;
  646. align-items: center;
  647. height: 88rpx;
  648. position: relative;
  649. font-weight: 600;
  650. font-size: 36rpx;
  651. color: #FFFFFF;
  652. .return {
  653. position: absolute;
  654. left: 32rpx;
  655. width: 40rpx;
  656. height: 40rpx;
  657. }
  658. }
  659. .content {
  660. flex: 1;
  661. padding: 24rpx 24rpx 120rpx;
  662. box-sizing: border-box;
  663. }
  664. /* 任务卡片样式 */
  665. .task-card {
  666. background: #fff;
  667. border-radius: 16rpx;
  668. padding: 24rpx;
  669. margin-bottom: 24rpx;
  670. .card-header {
  671. .card-title {
  672. font-weight: 500;
  673. font-size: 36rpx;
  674. color: #333333;
  675. margin-bottom: 24rpx;
  676. }
  677. }
  678. .card-meta {
  679. display: flex;
  680. align-items: center;
  681. gap: 16rpx;
  682. font-size: 24rpx;
  683. color: #666;
  684. .meta-tag {
  685. border-radius: 8rpx 8rpx 8rpx 8rpx;
  686. border: 2rpx solid rgba(56, 139, 255, 0.4);
  687. padding: 4rpx 8rpx;
  688. color: #388BFF;
  689. }
  690. }
  691. }
  692. /* 通用信息区块样式 */
  693. .info-section {
  694. background: #fff;
  695. border-radius: 16rpx;
  696. padding: 24rpx;
  697. margin-bottom: 24rpx;
  698. .section-header {
  699. display: flex;
  700. align-items: center;
  701. margin-bottom: 24rpx;
  702. .section-indicator {
  703. width: 6rpx;
  704. height: 32rpx;
  705. background: #388BFF;
  706. border-radius: 3rpx;
  707. margin-right: 16rpx;
  708. }
  709. .section-title {
  710. font-weight: 600;
  711. font-size: 32rpx;
  712. color: #333333;
  713. }
  714. }
  715. .info-list {
  716. .info-item {
  717. display: flex;
  718. margin-bottom: 24rpx;
  719. &:last-child {
  720. margin-bottom: 0;
  721. }
  722. .info-label {
  723. width: 50%;
  724. font-size: 28rpx;
  725. color: #666;
  726. flex-shrink: 0;
  727. }
  728. .info-value {
  729. flex: 1;
  730. text-align: end;
  731. font-size: 28rpx;
  732. color: #333;
  733. }
  734. .copy-btn {
  735. margin-left: 16rpx;
  736. color: #2196F3;
  737. font-size: 24rpx;
  738. cursor: pointer;
  739. }
  740. .column {
  741. flex-direction: column;
  742. }
  743. .attachment-item {
  744. margin-top: 24rpx;
  745. display: flex;
  746. justify-content: space-between;
  747. align-items: center;
  748. gap: 16rpx;
  749. background: #F7F8FA;
  750. border-radius: 16rpx 16rpx 16rpx 16rpx;
  751. .left {
  752. display: flex;
  753. align-items: center;
  754. .img {
  755. width: 72rpx;
  756. height: 72rpx;
  757. margin-right: 24rpx;
  758. }
  759. .txt-item {
  760. .attachment-name {
  761. font-size: 28rpx;
  762. color: #333;
  763. }
  764. .attachment-size {
  765. font-size: 24rpx;
  766. color: #999;
  767. }
  768. }
  769. }
  770. .download-btn {
  771. width: 32rpx;
  772. height: 32rpx;
  773. }
  774. }
  775. }
  776. }
  777. }
  778. /* 客户信息样式 */
  779. .client-list {
  780. .client-item {
  781. display: flex;
  782. justify-content: space-between;
  783. align-items: center;
  784. padding: 16rpx 0;
  785. &:last-child {
  786. border-bottom: none;
  787. }
  788. .client-info {
  789. display: flex;
  790. align-items: center;
  791. .avatar {
  792. width: 88rpx;
  793. height: 88rpx;
  794. margin-right: 24rpx;
  795. }
  796. .client-txt {
  797. .client-name {
  798. font-size: 28rpx;
  799. font-weight: 500;
  800. color: #333;
  801. .client-level {
  802. margin-left: 8rpx;
  803. padding: 2rpx 8rpx;
  804. background: #FFF6E5;
  805. color: #C89743;
  806. font-size: 22rpx;
  807. border-radius: 8rpx;
  808. }
  809. }
  810. }
  811. .client-hospital {
  812. font-size: 24rpx;
  813. color: #666;
  814. margin-top: 4rpx;
  815. display: flex;
  816. align-items: center;
  817. .line {
  818. width: 2rpx;
  819. height: 28rpx;
  820. background: #EAEBEE;
  821. margin: 0 24rpx;
  822. }
  823. }
  824. }
  825. .client-stats {
  826. display: flex;
  827. gap: 24rpx;
  828. font-size: 24rpx;
  829. color: #999999;
  830. .stat-item {
  831. display: flex;
  832. flex-direction: column;
  833. align-items: center;
  834. .num {
  835. font-weight: 500;
  836. font-size: 28rpx;
  837. color: #333333;
  838. }
  839. }
  840. }
  841. }
  842. }
  843. /* 审批信息样式 */
  844. .approval-list {
  845. .approval-item {
  846. position: relative;
  847. padding-left: 24rpx;
  848. margin-bottom: 68rpx;
  849. display: flex;
  850. align-items: center;
  851. justify-content: space-between;
  852. &:last-child {
  853. margin-bottom: 0;
  854. }
  855. .left {
  856. display: flex;
  857. align-items: center;
  858. .avatar-box {
  859. width: 80rpx;
  860. height: 80rpx;
  861. margin-right: 32rpx;
  862. position: relative;
  863. .avatar {
  864. width: 100%;
  865. height: 100%;
  866. }
  867. .icon {
  868. position: absolute;
  869. bottom: 0;
  870. right: 0;
  871. width: 32rpx;
  872. height: 32rpx;
  873. }
  874. }
  875. .approval-user {
  876. gap: 12rpx;
  877. .user-name {
  878. font-weight: 500;
  879. font-size: 28rpx;
  880. color: #333;
  881. }
  882. .user-status {
  883. font-size: 24rpx;
  884. }
  885. }
  886. }
  887. .approval-time {
  888. font-size: 24rpx;
  889. color: #999;
  890. margin-top: 4rpx;
  891. }
  892. }
  893. .approval-line {
  894. position: absolute;
  895. left: 64rpx;
  896. bottom: -64rpx;
  897. width: 1rpx;
  898. height: 56rpx;
  899. background: #BFD8FF;
  900. }
  901. }
  902. .reason {
  903. font-size: 28rpx;
  904. color: #666666;
  905. line-height: 40rpx;
  906. margin-left: 136rpx;
  907. }
  908. /* 审批标签样式 */
  909. .audit-tabs {
  910. display: flex;
  911. margin: 24rpx 0;
  912. border-radius: 8rpx;
  913. background-color: #F7F8FA;
  914. overflow: hidden;
  915. }
  916. .audit-tab {
  917. flex: 1;
  918. text-align: center;
  919. padding: 16rpx 0;
  920. font-size: 28rpx;
  921. color: #666666;
  922. transition: all 0.3s ease;
  923. cursor: pointer;
  924. }
  925. .audit-tab.active {
  926. background-color: #4080FF;
  927. color: #FFFFFF;
  928. font-weight: 500;
  929. }
  930. .bottom-bar {
  931. position: fixed;
  932. bottom: 0;
  933. left: 0;
  934. right: 0;
  935. background: #fff;
  936. padding: 24rpx 32rpx;
  937. border-top: 1rpx solid #F2F3F5;
  938. z-index: 100;
  939. display: flex;
  940. align-items: center;
  941. .action-buttons {
  942. display: flex;
  943. flex: 1;
  944. justify-content: space-between;
  945. .btn {
  946. width: 292rpx;
  947. height: 88rpx;
  948. display: flex;
  949. align-items: center;
  950. justify-content: center;
  951. font-size: 32rpx;
  952. font-weight: 500;
  953. border-radius: 200rpx 200rpx 200rpx 200rpx;
  954. cursor: pointer;
  955. display: flex;
  956. align-items: center;
  957. &.btn-cancel {
  958. background: #fff;
  959. border: 2rpx solid #CF3546;
  960. color: #CF3546;
  961. }
  962. &.btn-submit {
  963. background: #388BFF;
  964. color: #fff;
  965. }
  966. .icon {
  967. width: 32rpx;
  968. height: 32rpx;
  969. margin-right: 16rpx;
  970. }
  971. }
  972. }
  973. }// 弹窗样式
  974. .reject-popup-content {
  975. padding: 32rpx;
  976. box-sizing: border-box;
  977. overflow: hidden;
  978. border-radius: 24rpx 24rpx 0 0;
  979. .popup-header {
  980. display: flex;
  981. justify-content: center;
  982. align-items: center;
  983. margin-bottom: 32rpx;
  984. position: relative;
  985. .popup-title {
  986. font-size: 32rpx;
  987. font-weight: bold;
  988. color: #333;
  989. }
  990. .close {
  991. position: absolute;
  992. right: 0;
  993. width: 44rpx;
  994. height: 44rpx;
  995. }
  996. }
  997. .input-area {
  998. margin-bottom: 40rpx;
  999. .reason-input {
  1000. min-height: 120rpx;
  1001. padding: 20rpx;
  1002. background: #F7F8FA;
  1003. border-radius: 12rpx;
  1004. font-size: 28rpx;
  1005. color: #333;
  1006. width: 100%; // 新增:确保输入框宽度100%
  1007. box-sizing: border-box;
  1008. }
  1009. }
  1010. .btn-group {
  1011. display: flex;
  1012. gap: 24rpx;
  1013. .button {
  1014. width: 332rpx;
  1015. height: 80rpx;
  1016. flex: 1;
  1017. border-radius: 200rpx;
  1018. font-size: 28rpx;
  1019. text-align: center;
  1020. line-height: 80rpx;
  1021. }
  1022. .reject {
  1023. color: #388BFF;
  1024. background: #FFFFFF;
  1025. border-radius: 200rpx 200rpx 200rpx 200rpx;
  1026. border: 2rpx solid #388BFF;
  1027. }
  1028. .confirm {
  1029. background: #388BFF;
  1030. color: #FFFFFF;
  1031. }
  1032. }
  1033. }
  1034. </style>