contractManagement.vue 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844
  1. <template>
  2. <div class="card content-box">
  3. <div class="content-section">
  4. <!-- <div class="tip-text">店铺到期时间:{{ expirationTime || "&#45;&#45;" }}</div>-->
  5. <div />
  6. <div class="action-buttons">
  7. <el-button type="primary" @click="handleReplace"> 更换 </el-button>
  8. <el-button type="primary" @click="handleViewChangeRecord"> 查看变更记录 </el-button>
  9. </div>
  10. </div>
  11. <div class="contract-container" v-if="contractList && contractList.length > 0">
  12. <el-row :gutter="20">
  13. <el-col v-for="(item, index) in contractList" :key="index" :xs="12" :sm="8" :md="6" :lg="4" :xl="4">
  14. <div class="contract-item">
  15. <el-image
  16. :src="item.imgUrl"
  17. fit=""
  18. class="contract-image"
  19. :preview-src-list="contractList.map(img => img.imgUrl)"
  20. :initial-index="index"
  21. >
  22. <template #error>
  23. <div class="image-slot">
  24. <el-icon><Picture /></el-icon>
  25. </div>
  26. </template>
  27. </el-image>
  28. </div>
  29. </el-col>
  30. </el-row>
  31. </div>
  32. <div v-else class="empty-contract">
  33. <el-empty description="暂无合同图片" :image-size="100" />
  34. </div>
  35. <!-- 更换合同弹窗 -->
  36. <el-dialog
  37. v-model="replaceDialogVisible"
  38. title="更换合同"
  39. width="860px"
  40. :before-close="handleReplaceDialogClose"
  41. :close-on-click-modal="false"
  42. :close-on-press-escape="false"
  43. >
  44. <el-scrollbar height="400px" class="replace-upload-scrollbar">
  45. <div class="replace-upload-area" :class="{ 'upload-full': uploadedImageCount >= uploadMaxCount }">
  46. <div class="upload-tip">只允许上传jpg,jpeg,png格式图片;上传图片不得超过20M</div>
  47. <el-upload
  48. v-model:file-list="fileList"
  49. list-type="picture-card"
  50. :accept="'.jpg,.jpeg,.png'"
  51. :limit="uploadMaxCount"
  52. :auto-upload="false"
  53. :disabled="hasUnuploadedImages"
  54. multiple
  55. :on-change="handleUploadChange"
  56. :on-exceed="handleUploadExceed"
  57. :on-preview="handlePictureCardPreview"
  58. :before-remove="handleBeforeRemove"
  59. :on-remove="handleRemove"
  60. :show-file-list="true"
  61. >
  62. <template #trigger>
  63. <div v-if="uploadedImageCount < uploadMaxCount" class="upload-trigger-card el-upload--picture-card">
  64. <el-icon>
  65. <Plus />
  66. </el-icon>
  67. <div class="upload-tip">({{ uploadedImageCount }}/{{ uploadMaxCount }})</div>
  68. </div>
  69. </template>
  70. </el-upload>
  71. </div>
  72. </el-scrollbar>
  73. <template #footer>
  74. <div class="dialog-footer">
  75. <el-button @click="handleCancelReplace" :disabled="hasUnuploadedImages"> 取消 </el-button>
  76. <el-button type="primary" @click="handleSubmitReplace" :disabled="hasUnuploadedImages"> 去审核 </el-button>
  77. </div>
  78. </template>
  79. </el-dialog>
  80. <!-- 图片预览 -->
  81. <PcImagePreviewViewer
  82. v-model:visible="imageViewerVisible"
  83. :url-list="imageViewerUrlList"
  84. :initial-index="imageViewerInitialIndex"
  85. />
  86. <!-- 变更记录弹窗 -->
  87. <el-dialog v-model="changeRecordDialogVisible" title="变更记录" width="900px" :close-on-click-modal="false">
  88. <el-scrollbar height="400px" class="change-record-scrollbar">
  89. <div v-if="changeRecordList && changeRecordList.length > 0" class="change-record-content">
  90. <div v-for="(item, index) in changeRecordList" :key="index" class="record-group">
  91. <div class="record-date">
  92. {{ item.createdDateFormat }}
  93. </div>
  94. <div class="record-items">
  95. <div class="record-item" v-for="(citem, cindex) in item.licenseList" :key="cindex">
  96. <el-image
  97. :src="citem.imgUrl"
  98. fit="cover"
  99. class="record-image"
  100. :preview-src-list="item.licenseList.map(v => v.imgUrl)"
  101. :initial-index="cindex"
  102. >
  103. <template #error>
  104. <div class="image-slot">
  105. <el-icon><Picture /></el-icon>
  106. </div>
  107. </template>
  108. </el-image>
  109. <div class="record-status-badge" :class="getStatusClass(item.licenseExecuteStatus)">
  110. {{ item.licenseExecuteName }}
  111. </div>
  112. </div>
  113. </div>
  114. <div v-if="item.reasonRefusal" class="rejection-reason">拒绝原因: {{ item.reasonRefusal }}</div>
  115. </div>
  116. </div>
  117. <div v-else class="empty-record">
  118. <el-empty description="暂无变更记录" :image-size="100" />
  119. </div>
  120. </el-scrollbar>
  121. <template #footer>
  122. <div class="dialog-footer">
  123. <el-button type="primary" @click="changeRecordDialogVisible = false"> 关闭 </el-button>
  124. </div>
  125. </template>
  126. </el-dialog>
  127. </div>
  128. </template>
  129. <script setup lang="ts" name="contractManagement">
  130. import { ref, onMounted, computed } from "vue";
  131. import { ElMessage, ElMessageBox } from "element-plus";
  132. import { Plus, Picture } from "@element-plus/icons-vue";
  133. import type { UploadProps, UploadFile } from "element-plus";
  134. import { localGet } from "@/utils";
  135. import PcImagePreviewViewer from "@/components/pcMediaPreview/PcImagePreviewViewer.vue";
  136. import {
  137. getContractImages,
  138. uploadContractImage,
  139. submitContractReview,
  140. getStoreContractStatus,
  141. queryContractByStatusList
  142. } from "@/api/modules/licenseManagement";
  143. // 状态映射对象
  144. const statusMap: Record<number, { name: string; class: string }> = {
  145. 1: { name: "审核通过", class: "status-success" },
  146. 2: { name: "审核中", class: "status-pending" },
  147. 3: { name: "审核拒绝", class: "status-failed" }
  148. };
  149. const contractList = ref<any>([]);
  150. const expirationTime = ref<string>("");
  151. const replaceDialogVisible = ref(false);
  152. const changeRecordDialogVisible = ref(false);
  153. const fileList = ref<UploadFile[]>([]);
  154. const changeRecordList = ref<any>([]);
  155. const id = localGet("createdId");
  156. // ==================== 图片上传相关变量 ====================
  157. const uploadMaxCount = 20;
  158. const uploading = ref(false);
  159. const pendingUploadFiles = ref<UploadFile[]>([]);
  160. const imageUrlList = ref<string[]>([]); // 存储图片URL列表
  161. // 图片预览相关
  162. const imageViewerVisible = ref(false);
  163. const imageViewerUrlList = ref<string[]>([]);
  164. const imageViewerInitialIndex = ref(0);
  165. // 计算属性:获取已成功上传的图片数量
  166. const uploadedImageCount = computed(() => {
  167. return fileList.value.filter((file: any) => file.status === "success" && file.url).length;
  168. });
  169. // 计算属性:检查是否有未上传完成的图片
  170. const hasUnuploadedImages = computed(() => {
  171. // 检查是否有正在上传的文件
  172. if (uploading.value || pendingUploadFiles.value.length > 0) {
  173. return true;
  174. }
  175. // 检查文件列表中是否有状态为 "ready"(待上传)或 "uploading"(上传中)的图片
  176. if (fileList.value && fileList.value.length > 0) {
  177. return fileList.value.some((file: any) => {
  178. return file.status === "ready" || file.status === "uploading";
  179. });
  180. }
  181. return false;
  182. });
  183. onMounted(async () => {
  184. await initData();
  185. });
  186. const initData = async () => {
  187. const params = {
  188. id: id
  189. };
  190. const res: any = await getContractImages(params);
  191. if (res.code == 200) {
  192. contractList.value = res.data;
  193. // 如果返回的数据中包含到期时间,从第一个合同项中获取
  194. if (res.data && res.data.length > 0 && res.data[0]?.expirationTime) {
  195. expirationTime.value = res.data[0].expirationTime;
  196. }
  197. }
  198. };
  199. const handleReplace = async () => {
  200. fileList.value = [];
  201. imageUrlList.value = [];
  202. pendingUploadFiles.value = [];
  203. uploading.value = false;
  204. const params = {
  205. id: localGet("createdId")
  206. };
  207. const res: any = await getStoreContractStatus(params);
  208. if (res.data.renewContractStatus == 2) {
  209. ElMessage.warning("合同审核中,请耐心等待");
  210. } else {
  211. replaceDialogVisible.value = true;
  212. }
  213. };
  214. const handleViewChangeRecord = async () => {
  215. try {
  216. const params = {
  217. storeId: localGet("createdId")
  218. };
  219. const res: any = await queryContractByStatusList(params);
  220. if (res.code === 200) {
  221. changeRecordList.value = res.data;
  222. } else {
  223. // 请求失败时清空数据
  224. changeRecordList.value = [];
  225. }
  226. changeRecordDialogVisible.value = true;
  227. } catch (error) {
  228. ElMessage.error("获取变更记录失败");
  229. // 发生错误时清空数据并显示空状态
  230. changeRecordList.value = [];
  231. changeRecordDialogVisible.value = true;
  232. }
  233. };
  234. /**
  235. * 检查文件是否在排队中(未上传)
  236. * @param file 文件对象
  237. * @returns 是否在排队中
  238. */
  239. const isFilePending = (file: any): boolean => {
  240. // 只检查 ready 状态(排队中),不包括 uploading(正在上传)
  241. if (file.status === "ready") {
  242. return true;
  243. }
  244. // 检查是否在待上传队列中
  245. if (pendingUploadFiles.value.some(item => item.uid === file.uid)) {
  246. return true;
  247. }
  248. return false;
  249. };
  250. /**
  251. * 图片上传 - 删除前确认
  252. * @param uploadFile 要删除的文件对象
  253. * @param uploadFiles 当前文件列表
  254. * @returns Promise<boolean>,true 允许删除,false 阻止删除
  255. */
  256. const handleBeforeRemove = async (uploadFile: any, uploadFiles: any[]): Promise<boolean> => {
  257. // 如果文件在排队中(未上传),禁止删除
  258. if (isFilePending(uploadFile)) {
  259. ElMessage.warning("图片尚未上传,请等待上传完成后再删除");
  260. return false;
  261. }
  262. try {
  263. await ElMessageBox.confirm("确定要删除这张图片吗?", "提示", {
  264. confirmButtonText: "确定",
  265. cancelButtonText: "取消",
  266. type: "warning"
  267. });
  268. // 用户确认删除,返回 true 允许删除
  269. return true;
  270. } catch {
  271. // 用户取消删除,返回 false 阻止删除
  272. return false;
  273. }
  274. };
  275. /**
  276. * 图片上传 - 移除图片回调(删除成功后调用)
  277. * @param uploadFile 已删除的文件对象
  278. * @param uploadFiles 删除后的文件列表
  279. */
  280. const handleRemove: UploadProps["onRemove"] = (uploadFile, uploadFiles) => {
  281. // 从被删除的文件对象中获取 url
  282. const file = uploadFile as any;
  283. const imageUrl = file.url;
  284. if (imageUrl) {
  285. // 从 imageUrl 数组中删除对应的 URL
  286. const urlIndex = imageUrlList.value.indexOf(imageUrl);
  287. if (urlIndex > -1) {
  288. imageUrlList.value.splice(urlIndex, 1);
  289. }
  290. }
  291. if (file.url && file.url.startsWith("blob:")) {
  292. URL.revokeObjectURL(file.url);
  293. }
  294. // 同步文件列表
  295. fileList.value = [...uploadFiles];
  296. // 删除成功后提示
  297. ElMessage.success("图片已删除");
  298. };
  299. /**
  300. * 上传文件超出限制提示
  301. */
  302. const handleUploadExceed: UploadProps["onExceed"] = () => {
  303. ElMessage.warning(`最多只能上传${uploadMaxCount}张图片`);
  304. };
  305. /**
  306. * el-upload 文件变更(选中或移除)
  307. */
  308. const handleUploadChange: UploadProps["onChange"] = async (uploadFile, uploadFiles) => {
  309. // 检查文件类型,只允许 jpg 和 png
  310. if (uploadFile.raw) {
  311. const fileType = uploadFile.raw.type.toLowerCase();
  312. const fileName = uploadFile.name.toLowerCase();
  313. const validTypes = ["image/jpeg", "image/jpg", "image/png"];
  314. const validExtensions = [".jpg", ".jpeg", ".png"];
  315. // 检查 MIME 类型或文件扩展名
  316. const isValidType = validTypes.includes(fileType) || validExtensions.some(ext => fileName.endsWith(ext));
  317. if (!isValidType) {
  318. // 从文件列表中移除不符合类型的文件
  319. const index = fileList.value.findIndex((f: any) => f.uid === uploadFile.uid);
  320. if (index > -1) {
  321. fileList.value.splice(index, 1);
  322. }
  323. // 从 uploadFiles 中移除
  324. const uploadIndex = uploadFiles.findIndex((f: any) => f.uid === uploadFile.uid);
  325. if (uploadIndex > -1) {
  326. uploadFiles.splice(uploadIndex, 1);
  327. }
  328. // 如果文件有 blob URL,释放它
  329. if (uploadFile.url && uploadFile.url.startsWith("blob:")) {
  330. URL.revokeObjectURL(uploadFile.url);
  331. }
  332. ElMessage.warning("只支持上传 JPG、JPEG 和 PNG 格式的图片");
  333. return;
  334. }
  335. // 检查文件大小,不得超过20M
  336. const maxSize = 20 * 1024 * 1024; // 20MB
  337. if (uploadFile.raw.size > maxSize) {
  338. // 从文件列表中移除超过大小的文件
  339. const index = fileList.value.findIndex((f: any) => f.uid === uploadFile.uid);
  340. if (index > -1) {
  341. fileList.value.splice(index, 1);
  342. }
  343. // 从 uploadFiles 中移除
  344. const uploadIndex = uploadFiles.findIndex((f: any) => f.uid === uploadFile.uid);
  345. if (uploadIndex > -1) {
  346. uploadFiles.splice(uploadIndex, 1);
  347. }
  348. // 如果文件有 blob URL,释放它
  349. if (uploadFile.url && uploadFile.url.startsWith("blob:")) {
  350. URL.revokeObjectURL(uploadFile.url);
  351. }
  352. ElMessage.warning("上传图片不得超过20M");
  353. return;
  354. }
  355. }
  356. // 同步文件列表到表单数据(只添加通过验证的文件)
  357. const existingIndex = fileList.value.findIndex((f: any) => f.uid === uploadFile.uid);
  358. if (existingIndex === -1) {
  359. fileList.value.push(uploadFile);
  360. }
  361. const readyFiles = fileList.value.filter(file => file.status === "ready");
  362. if (readyFiles.length) {
  363. readyFiles.forEach(file => {
  364. if (!pendingUploadFiles.value.some(item => item.uid === file.uid)) {
  365. pendingUploadFiles.value.push(file);
  366. }
  367. });
  368. }
  369. processUploadQueue();
  370. };
  371. /**
  372. * 处理上传队列 - 逐个上传文件
  373. */
  374. const processUploadQueue = async () => {
  375. if (uploading.value || pendingUploadFiles.value.length === 0) {
  376. return;
  377. }
  378. // 每次只取一个文件进行上传
  379. const file = pendingUploadFiles.value.shift();
  380. if (file) {
  381. await uploadSingleFile(file);
  382. // 继续处理队列中的下一个文件
  383. processUploadQueue();
  384. }
  385. };
  386. /**
  387. * 单文件上传图片
  388. * @param file 待上传的文件
  389. */
  390. const uploadSingleFile = async (file: UploadFile) => {
  391. if (!file.raw) {
  392. return;
  393. }
  394. const rawFile = file.raw as File;
  395. const formData = new FormData();
  396. formData.append("file", rawFile);
  397. formData.append("user", "text");
  398. file.status = "uploading";
  399. file.percentage = 0;
  400. uploading.value = true;
  401. try {
  402. // 上传过程中先保持进度为 0,避免接口异常时进度条误显示 100%
  403. const result: any = await uploadContractImage(formData);
  404. if (result?.code === 200 && result.data) {
  405. // 处理单个文件的上传结果
  406. let imageUrl = result.data[0];
  407. if (!imageUrl) {
  408. throw new Error("上传成功但未获取到图片URL");
  409. }
  410. file.status = "success";
  411. file.percentage = 100;
  412. // 保存图片URL到文件对象
  413. file.url = imageUrl;
  414. file.response = { url: imageUrl };
  415. // 保存图片URL
  416. if (!Array.isArray(imageUrlList.value)) {
  417. imageUrlList.value = [];
  418. }
  419. if (!imageUrlList.value.includes(imageUrl)) {
  420. imageUrlList.value.push(imageUrl);
  421. }
  422. } else {
  423. throw new Error(result?.msg || "图片上传失败");
  424. }
  425. } catch (error: any) {
  426. // 上传失败时保持进度条为 0
  427. file.percentage = 0;
  428. file.status = "fail";
  429. if (file.url && file.url.startsWith("blob:")) {
  430. URL.revokeObjectURL(file.url);
  431. }
  432. // 从文件列表中移除失败的文件
  433. const index = fileList.value.findIndex((f: any) => f.uid === file.uid);
  434. if (index > -1) {
  435. fileList.value.splice(index, 1);
  436. }
  437. } finally {
  438. uploading.value = false;
  439. // 触发视图更新
  440. fileList.value = [...fileList.value];
  441. }
  442. };
  443. /**
  444. * 图片预览 - 使用统一 PcImagePreviewViewer(Element Plus 图集层)
  445. * @param file 上传文件对象
  446. */
  447. const handlePictureCardPreview = (file: any) => {
  448. // 如果文件在排队中(未上传),禁止预览
  449. if (isFilePending(file)) {
  450. ElMessage.warning("图片尚未上传,请等待上传完成后再预览");
  451. return;
  452. }
  453. // 如果文件正在上传中,允许预览(使用本地预览)
  454. if (file.status === "uploading" && file.url) {
  455. imageViewerUrlList.value = [file.url];
  456. imageViewerInitialIndex.value = 0;
  457. imageViewerVisible.value = true;
  458. return;
  459. }
  460. // 获取所有图片的 URL 列表(只包含已上传成功的图片)
  461. const urlList = fileList.value
  462. .filter((item: any) => item.status === "success" && (item.url || item.response?.data))
  463. .map((item: any) => item.url || item.response?.data);
  464. // 找到当前点击的图片索引
  465. const currentIndex = urlList.findIndex((url: string) => url === (file.url || file.response?.data));
  466. if (currentIndex < 0) {
  467. ElMessage.warning("图片尚未上传完成,无法预览");
  468. return;
  469. }
  470. imageViewerUrlList.value = urlList;
  471. imageViewerInitialIndex.value = currentIndex;
  472. imageViewerVisible.value = true;
  473. };
  474. const handleCancelReplace = async () => {
  475. // 如果有图片正在上传,阻止关闭
  476. if (hasUnuploadedImages.value) {
  477. ElMessage.warning("请等待图片上传完成后再关闭");
  478. return;
  479. }
  480. if (fileList.value.length > 0) {
  481. try {
  482. await ElMessageBox.confirm("确定要取消本次图片上传吗?已上传的图片将不保存", "提示", {
  483. confirmButtonText: "确定",
  484. cancelButtonText: "取消",
  485. type: "warning"
  486. });
  487. // 用户确认取消
  488. fileList.value = [];
  489. imageUrlList.value = [];
  490. pendingUploadFiles.value = [];
  491. uploading.value = false;
  492. replaceDialogVisible.value = false;
  493. } catch {
  494. // 用户取消操作,不做任何处理
  495. }
  496. } else {
  497. replaceDialogVisible.value = false;
  498. }
  499. };
  500. const handleReplaceDialogClose = async (done: () => void) => {
  501. // 如果有图片正在上传,阻止关闭
  502. if (hasUnuploadedImages.value) {
  503. ElMessage.warning("请等待图片上传完成后再关闭");
  504. return; // 不调用 done(),阻止关闭弹窗
  505. }
  506. if (fileList.value.length > 0) {
  507. try {
  508. await ElMessageBox.confirm("确定要取消本次图片上传吗?已上传的图片将不保存", "提示", {
  509. confirmButtonText: "确定",
  510. cancelButtonText: "取消",
  511. type: "warning"
  512. });
  513. // 用户确认取消,清空数据并关闭弹窗
  514. fileList.value = [];
  515. imageUrlList.value = [];
  516. pendingUploadFiles.value = [];
  517. uploading.value = false;
  518. done(); // 调用 done() 允许关闭弹窗
  519. } catch {
  520. // 用户取消操作,不调用 done(),阻止关闭弹窗
  521. }
  522. } else {
  523. // 没有文件,直接关闭
  524. done();
  525. }
  526. };
  527. const handleSubmitReplace = async () => {
  528. // 检查是否有未上传完成的图片
  529. if (hasUnuploadedImages.value) {
  530. ElMessage.warning("请等待图片上传完成后再提交");
  531. return;
  532. }
  533. if (fileList.value.length === 0) {
  534. ElMessage.warning("请至少上传一张图片");
  535. return;
  536. }
  537. const uploadedFiles = fileList.value.filter(file => file.status === "success");
  538. if (uploadedFiles.length === 0) {
  539. ElMessage.warning("请先上传图片");
  540. return;
  541. }
  542. try {
  543. // 根据文件列表顺序,生成带排序的图片数据(排序从0开始)
  544. const imageDataWithSort = uploadedFiles.map((file, index) => ({
  545. imgUrl: file.url,
  546. imgSort: index,
  547. storeId: localGet("createdId")
  548. }));
  549. await submitContractReview(imageDataWithSort);
  550. ElMessage.success("提交审核成功");
  551. replaceDialogVisible.value = false;
  552. fileList.value = [];
  553. imageUrlList.value = [];
  554. pendingUploadFiles.value = [];
  555. uploading.value = false;
  556. await initData();
  557. } catch (error) {
  558. ElMessage.error("提交审核失败");
  559. }
  560. };
  561. const getStatusClass = (status: number) => {
  562. const statusInfo = statusMap[status];
  563. return statusInfo ? statusInfo.class : "";
  564. };
  565. const getStatusName = (status: number) => {
  566. const statusInfo = statusMap[status];
  567. return statusInfo ? statusInfo.name : "未知";
  568. };
  569. </script>
  570. <style lang="scss" scoped>
  571. .page-header {
  572. margin-bottom: 20px;
  573. }
  574. .store-title {
  575. margin: 0;
  576. font-size: 24px;
  577. font-weight: 600;
  578. color: var(--el-text-color-primary);
  579. }
  580. .content-section {
  581. display: flex;
  582. align-items: center;
  583. justify-content: space-between;
  584. width: 100%;
  585. margin-top: 20px;
  586. margin-bottom: 50px;
  587. }
  588. .tip-text {
  589. font-size: 18px;
  590. color: var(--el-text-color-regular);
  591. }
  592. .action-buttons {
  593. display: flex;
  594. flex-shrink: 0;
  595. gap: 10px;
  596. }
  597. .contract-container {
  598. width: 100%;
  599. min-height: 570px;
  600. padding: 20px;
  601. background-color: var(--el-bg-color-page);
  602. border-radius: 8px;
  603. }
  604. .empty-contract {
  605. display: flex;
  606. align-items: center;
  607. justify-content: center;
  608. min-height: 570px;
  609. padding: 40px 20px;
  610. }
  611. .contract-item {
  612. display: flex;
  613. align-items: center;
  614. justify-content: center;
  615. aspect-ratio: 1;
  616. margin-bottom: 20px;
  617. overflow: hidden;
  618. background-color: var(--el-bg-color);
  619. border: 1px solid var(--el-border-color-light);
  620. border-radius: 8px;
  621. .contract-image {
  622. display: block;
  623. width: 100%;
  624. height: 100%;
  625. }
  626. .image-slot {
  627. display: flex;
  628. align-items: center;
  629. justify-content: center;
  630. width: 100%;
  631. height: 100%;
  632. font-size: 30px;
  633. color: var(--el-text-color-placeholder);
  634. background: var(--el-fill-color-light);
  635. }
  636. }
  637. .replace-upload-scrollbar {
  638. :deep(.el-scrollbar__wrap) {
  639. overflow-x: hidden;
  640. }
  641. }
  642. .replace-upload-area {
  643. min-height: 300px;
  644. padding: 20px;
  645. .upload-tip {
  646. margin-bottom: 10px;
  647. }
  648. :deep(.el-upload-list--picture-card .el-upload-list__item:hover .el-upload-list__item-status-label) {
  649. display: inline-flex !important;
  650. opacity: 1 !important;
  651. }
  652. :deep(.el-upload-list__item.is-success:focus .el-upload-list__item-status-label) {
  653. display: inline-flex !important;
  654. opacity: 1 !important;
  655. }
  656. :deep(.el-upload-list--picture-card .el-icon--close-tip) {
  657. display: none !important;
  658. }
  659. &.upload-full {
  660. :deep(.el-upload--picture-card) {
  661. display: none !important;
  662. }
  663. }
  664. }
  665. .dialog-footer {
  666. display: flex;
  667. gap: 10px;
  668. justify-content: center;
  669. }
  670. /* el-upload 图片预览铺满容器 */
  671. :deep(.el-upload-list--picture-card) {
  672. .el-upload-list__item {
  673. overflow: hidden;
  674. .el-upload-list__item-thumbnail {
  675. width: 100%;
  676. height: 100%;
  677. object-fit: fill;
  678. }
  679. }
  680. /* 排队中(未上传)的图片禁用样式 */
  681. .el-upload-list__item[data-status="ready"],
  682. .el-upload-list__item.is-ready {
  683. position: relative;
  684. pointer-events: none;
  685. cursor: not-allowed;
  686. opacity: 0.6;
  687. &::after {
  688. position: absolute;
  689. inset: 0;
  690. z-index: 1;
  691. content: "";
  692. background-color: rgb(0 0 0 / 30%);
  693. }
  694. .el-upload-list__item-actions {
  695. pointer-events: none;
  696. opacity: 0.5;
  697. }
  698. }
  699. }
  700. .upload-trigger-card {
  701. display: flex;
  702. flex-direction: column;
  703. align-items: center;
  704. justify-content: center;
  705. width: 100%;
  706. height: 100%;
  707. font-size: 28px;
  708. color: #8c939d;
  709. .upload-tip {
  710. margin-top: 8px;
  711. font-size: 14px;
  712. color: #8c939d;
  713. }
  714. }
  715. .change-record-scrollbar {
  716. :deep(.el-scrollbar__wrap) {
  717. overflow-x: hidden;
  718. }
  719. }
  720. .change-record-content {
  721. .record-group {
  722. padding: 20px;
  723. margin-bottom: 30px;
  724. background-color: var(--el-fill-color-lighter);
  725. &:last-child {
  726. margin-bottom: 0;
  727. }
  728. .record-date {
  729. margin-bottom: 15px;
  730. font-size: 16px;
  731. font-weight: 500;
  732. color: var(--el-text-color-primary);
  733. }
  734. .record-items {
  735. display: flex;
  736. flex-wrap: wrap;
  737. gap: 15px;
  738. }
  739. .record-item {
  740. position: relative;
  741. width: 150px;
  742. height: 150px;
  743. overflow: hidden;
  744. border-radius: 8px;
  745. .record-status-badge {
  746. position: absolute;
  747. right: 0;
  748. bottom: 0;
  749. left: 0;
  750. z-index: 1;
  751. padding: 4px 8px;
  752. font-size: 12px;
  753. font-weight: 500;
  754. text-align: center;
  755. border-radius: 0 0 8px 8px;
  756. &.status-pending {
  757. color: #e6a23c;
  758. background-color: rgb(253 246 236 / 90%);
  759. border-top: 1px solid #e6a23c;
  760. }
  761. &.status-success {
  762. color: #67c23a;
  763. background-color: rgb(240 249 255 / 90%);
  764. border-top: 1px solid #67c23a;
  765. }
  766. &.status-failed {
  767. color: #f56c6c;
  768. background-color: rgb(254 240 240 / 90%);
  769. border-top: 1px solid #f56c6c;
  770. }
  771. }
  772. .record-image {
  773. width: 100%;
  774. height: 100%;
  775. .image-slot {
  776. display: flex;
  777. align-items: center;
  778. justify-content: center;
  779. width: 100%;
  780. height: 100%;
  781. font-size: 30px;
  782. color: var(--el-text-color-placeholder);
  783. background: var(--el-fill-color-light);
  784. }
  785. }
  786. }
  787. .rejection-reason {
  788. margin-top: 15px;
  789. font-size: 14px;
  790. font-weight: 500;
  791. color: var(--el-text-color-regular);
  792. border-radius: 8px;
  793. }
  794. }
  795. }
  796. .empty-record {
  797. display: flex;
  798. align-items: center;
  799. justify-content: center;
  800. min-height: 300px;
  801. padding: 40px 20px;
  802. }
  803. </style>