From 23a2fff92f73b9759849a8016601a6817d7470b1 Mon Sep 17 00:00:00 2001
From: zhangwei <1504152376@qq.com>
Date: 星期一, 25 八月 2025 17:30:30 +0800
Subject: [PATCH] -

---
 src/views/system/dept/utils/detail.tsx |   88 ++++++++++++++++++++++++++++++++++++++++++--
 1 files changed, 84 insertions(+), 4 deletions(-)

diff --git a/src/views/system/dept/utils/detail.tsx b/src/views/system/dept/utils/detail.tsx
index 8199063..68ef1a9 100644
--- a/src/views/system/dept/utils/detail.tsx
+++ b/src/views/system/dept/utils/detail.tsx
@@ -9,7 +9,8 @@
 import {
   fabuzhaobiao,
   changezhaobiao,
-  getTenderOrderDetail
+  getTenderOrderDetail,
+  updateTittle
 } from "@/api/item/index";
 
 const formRef = ref();
@@ -59,7 +60,85 @@
             res = await changezhaobiao(curData);
           }
           if (res.code == "200") {
-            getTenderOrderDetail({ id: row?.id });
+            getTenderOrderDetail({ id: row?.id }).then(res => {
+              state.nowInfo = res.result;
+            });
+            done(); // 鍏抽棴寮规
+          } else {
+            closeLoading();
+            message(res.message, {
+              type: "error"
+            });
+          }
+        }
+        FormRef.validate((valid, obj) => {
+          if (valid) {
+            // 琛ㄥ崟瑙勫垯鏍¢獙閫氳繃
+            if (title === "鏂板") {
+              // 瀹為檯寮�鍙戝厛璋冪敤鏂板鎺ュ彛锛屽啀杩涜涓嬮潰鎿嶄綔
+              chores();
+            } else {
+              // 瀹為檯寮�鍙戝厛璋冪敤淇敼鎺ュ彛锛屽啀杩涜涓嬮潰鎿嶄綔
+              chores();
+            }
+          } else {
+            closeLoading();
+            const fail = [];
+            for (const key in obj) {
+              fail.push(obj[key][0].message);
+            }
+            message(fail[0], {
+              type: "warning"
+            });
+            return false;
+          }
+        });
+      }
+    });
+  }
+  function changeDialog(title = "涓婁紶", row?: TenderInfo) {
+    addDialog({
+      title: `淇敼鏍囬`,
+      props: {
+        formInline: {
+          tenderId: title == "涓婁紶鍙樻洿" ? row?.id : "",
+          id: title == "涓婁紶" ? row?.id : "",
+          projectName: row?.projectName ?? "",
+          toubiaoStartDate: row?.toubiaoStartDate ?? "", //鎶曟爣鎶ュ悕寮�濮嬫椂闂�
+          toubiaoEndDate: row?.toubiaoEndDate ?? "", //鎶曟爣鎶ュ悕缁撴潫鏃堕棿
+          kaibiaoDate: row?.kaibiaoDate ?? "", //寮�鏍囨椂闂�
+          biangengwenjian: "", //鎷涙爣鏂囦欢
+          fujian: row?.fujian ?? "", //闄勪欢
+          kaibiaodidian: row?.kaibiaodidian ?? "" //寮�鏍囧湴鐐�
+        }
+      },
+      width: "30%",
+      draggable: true,
+      fullscreen: deviceDetection(),
+      fullscreenIcon: true,
+      sureBtnLoading: true,
+      closeOnClickModal: false,
+      contentRenderer: () =>
+        h(tenderForm, {
+          ref: formRef,
+          formInline: null,
+          changeDetail: true,
+          isChange: true
+        }),
+      beforeSure: (done, { options, closeLoading }) => {
+        const FormRef = formRef.value.getRef();
+        const curData = cloneDeep(options.props.formInline as TenderInfo);
+        async function chores() {
+          // message(`鎮�${title}浜嗛」鐩悕绉颁负${curData.projectName}鐨勮繖鏉℃暟鎹甡, {
+          //   type: "success"
+          // });
+          // curData.dingbiaoguize = curData.dingbiaoguize.join("");
+          curData.id = state.nowInfo.id;
+          const res = await updateTittle(curData);
+          if (res.code == "200") {
+            getTenderOrderDetail({ id: row?.id }).then(res => {
+              state.nowInfo = res.result;
+            });
             done(); // 鍏抽棴寮规
           } else {
             closeLoading();
@@ -129,12 +208,13 @@
     );
     // 鎷兼帴鏃堕棿鎴冲拰闅忔満鏁�
     return (
-      `${dirPath}/${timestamp}_${randomNumber}` + filename.match(/\.[^.]+$/)
+      `${dirPath}${timestamp}_${randomNumber}` + filename.match(/\.[^.]+$/)
     );
   }
   return {
     openUploadDialog,
     state,
-    generateTimestampWithRandom
+    generateTimestampWithRandom,
+    changeDialog
   };
 }

--
Gitblit v1.9.1