Browse Source

技术成果转化-审核/驳回弹窗

zhangchuang 4 days ago
parent
commit
a9a25cfb54

+ 116 - 55
src/views/sti/technology-transfer/hooks/useData.hook.ts

@@ -16,6 +16,37 @@ export const useDataListInit = () => {
 
   const updateInfo = ref();
 
+  const componentKey = ref(0);
+  const detailsData = ref();
+  const descriptionsVisible = ref(false);
+
+  // 字段名与标签的映射
+  const labelMapping = {
+    country: "国家",
+    operationStatus: "操作状态",
+    logoResumptionPath: "商标续展申请书文件",
+    idCard: "证件号",
+    idCardPositivelyPath: "身份证正面文件",
+    businessLicensePath: "营业执照文件",
+    applicantAddr: "申请人地址",
+    applicantType: "申请人类型",
+    legislationStatus: "法律状态",
+    sealPath: "公章图片路径",
+    id: "主键",
+    isLogoModify: "商标图样是否变更",
+    corporationsName: "企业名称",
+    idCardPath: "申请人身份证明文件",
+    logoPath: "logo文件",
+    contactDetails: "联系方式",
+    userId: "用户ID",
+    applicant: "申请人",
+    authorizationPath: "委托书照片文件",
+    logoEnrollmentPath: "商标注册证文件",
+    idCardBacksidePath: "身份证反面文件",
+    auditStatus: "审核进度",
+    logoRegistrationNumber: "商标注册号",
+  };
+
   // 控制器
   const isCollapse = ref(true);
   const fieldVisible = ref(false);
@@ -101,12 +132,11 @@ export const useDataListInit = () => {
   };
 
   const onClickReset = () => {
-    formInline.maturityLevel = "",
-    formInline.conveyancing = "",
-    formInline.isTransaction = "",
-
-    // 重置分页
-    currentPage.value = 1; // 或者您设定的其他默认页码
+    (formInline.maturityLevel = ""),
+      (formInline.conveyancing = ""),
+      (formInline.isTransaction = ""),
+      // 重置分页
+      (currentPage.value = 1); // 或者您设定的其他默认页码
     pageSize.value = 10; // 或者您设定的其他默认每页数量
 
     // 调用 fetchList 以获取重置后的数据
@@ -122,63 +152,88 @@ export const useDataListInit = () => {
     fetchList();
   };
 
-  const onUpdate = async (row: any, isExamine: boolean) => {
-    if (isExamine) {
-      ElMessageBox.confirm(
-        "请确认要通过名称为【" + row.technologicalNeedsName + "】的审核批准",
-        "提示信息",
-        {
-          confirmButtonText: "通过",
-          cancelButtonText: "取消",
-          type: "warning",
-        }
-      )
-        .then(async () => {
-          const data = {
-            id: row.id,
-            auditStatus: "1",
-          };
-          const res = (await postUpdate(data)) as unknown as any;
-          if (res.code === 200) {
-            ElMessage({
-              type: "success",
-              message: "操作成功",
-            });
-            fetchList();
-          } else {
-            ElMessage({
-              type: "error",
-              message: "操作失败,请联系管理员",
-            });
-          }
-        })
-        .catch(() => {
+  const onShow = (row: any) => {
+    componentKey.value += 1;
+    detailsData.value = row;
+    descriptionsVisible.value = true;
+  };
+
+  const onReject = () => {
+    ElMessageBox.prompt("请说明驳回原因", "审核未通过", {
+      confirmButtonText: "提交",
+      cancelButtonText: "取消",
+    })
+      .then(async ({ value }) => {
+        const data = {
+          id: detailsData.value.id,
+          auditStatus: "2",
+          rejectInfo: value
+        };
+        const res = (await postUpdate(data)) as unknown as any;
+        if (res.code === 200) {
           ElMessage({
-            type: "info",
-            message: "取消删除",
+            type: "success",
+            message: "操作成功",
           });
-        });
-    } else {
-      const data = {
-        id: row.id,
-        auditStatus: "0",
-      };
-      const res = (await postUpdate(data)) as unknown as any;
-      if (res.code === 200) {
+          descriptionsVisible.value = false;
+          fetchList();
+        } else {
+          ElMessage({
+            type: "error",
+            message: "操作失败,请联系管理员",
+          });
+        }
+      })
+      .catch(() => {
         ElMessage({
-          type: "success",
-          message: "操作成功",
+          type: "info",
+          message: "取消驳回",
         });
-        fetchList();
-      } else {
+      });
+  };
+
+  const onUpdate = async () => {
+    // if (isExamine) {
+    ElMessageBox.confirm(
+      "请确认要通过名称为【" +
+        detailsData.value.patentName +
+        "】的专利运营需求审核",
+      "提示信息",
+      {
+        confirmButtonText: "通过",
+        cancelButtonText: "取消",
+        type: "warning",
+      }
+    )
+      .then(async () => {
+        const data = {
+          id: detailsData.value.id,
+          auditStatus: "1",
+        };
+        const res = (await postUpdate(data)) as unknown as any;
+        if (res.code === 200) {
+          ElMessage({
+            type: "success",
+            message: "操作成功",
+          });
+          descriptionsVisible.value = false;
+          fetchList();
+        } else {
+          ElMessage({
+            type: "error",
+            message: "操作失败,请联系管理员",
+          });
+        }
+      })
+      .catch(() => {
         ElMessage({
-          type: "error",
-          message: "操作失败,请联系管理员",
+          type: "info",
+          message: "取消删除",
         });
-      }
-    }
+      });
   };
 
+
   const onFieldChange = (newTargetKeys: string | string[]) => {
     // 更新临时字段配置
     tempFieldsConfig.value.forEach(
@@ -246,6 +301,10 @@ export const useDataListInit = () => {
   });
 
   return {
+    labelMapping,
+    componentKey,
+    detailsData,
+    descriptionsVisible,
     formInline,
     updateInfo,
     isCollapse,
@@ -264,7 +323,9 @@ export const useDataListInit = () => {
     onClickReset,
     onCollapse,
     handleCurrentChange,
+    onShow,
     onUpdate,
+    onReject,
     onFieldChange,
     saveFieldSettings,
     handleCreate,

+ 23 - 2
src/views/sti/technology-transfer/index.vue

@@ -66,8 +66,9 @@
         />
         <el-table-column fixed="right" label="操作" width="100" align="center">
           <template v-slot="scope">
-            <el-button type="primary" v-if="scope.row.auditStatus === 'foo'" text @click="onUpdate(scope.row, true)">审核</el-button>
-            <el-button type="danger" v-else text @click="onUpdate(scope.row, false)">驳回</el-button>
+            <el-button type="primary" text @click="onShow(scope.row)" :disabled="scope.row.auditStatus > 0"
+              >审核</el-button
+            >
           </template>
         </el-table-column>
       </el-table>
@@ -112,6 +113,19 @@
     <el-dialog v-model="updateVisible" title="国内专利修改" width="1080">
       <Update :updateInfo="updateInfo" />
     </el-dialog>
+    <el-dialog v-model="descriptionsVisible" title="详情信息" width="1280">
+      <Descriptions
+        :data="detailsData"
+        :labelMap="labelMapping"
+        :key="componentKey"
+      />
+      <template #footer>
+        <div class="dialog-footer">
+          <el-button @click="onReject">驳回</el-button>
+          <el-button type="primary" @click="onUpdate"> 审核通过 </el-button>
+        </div>
+      </template>
+    </el-dialog>
   </div>
 </template>
 
@@ -119,7 +133,12 @@
 import { useDataListInit } from "./hooks/useData.hook";
 import Create from "./components/create.vue";
 import Update from "./components/update.vue";
+import Descriptions from "@/components/DescriptionsExamine.vue";
 const {
+  descriptionsVisible,
+  detailsData,
+  labelMapping,
+  componentKey,
   formInline,
   updateInfo,
   isCollapse,
@@ -138,7 +157,9 @@ const {
   onClickReset,
   onCollapse,
   handleCurrentChange,
+  onShow,
   onUpdate,
+  onReject,
   onFieldChange,
   saveFieldSettings,
   handleCreate,