Browse Source

专利运营需求-细化

zhangchuang 1 week ago
parent
commit
e0c9df9527

+ 5 - 5
src/views/ip/patent-management/operate/hooks/useAxios.hook.ts

@@ -14,11 +14,11 @@ export const getList = async (data: any) => {
   }
 };
 
-// 添加商标
+// 添加
 export const postCreate = async (data: any) => {
   try {
     const res = await http(RequestHttpEnum.POST)(
-      "/intellectual-property/patent-operations/create",
+      "/intellectual-property/patent-operations/patent_operation",
       data
     );
     return res;
@@ -27,11 +27,11 @@ export const postCreate = async (data: any) => {
   }
 };
 
-// 编辑商标
+// 编辑
 export const postUpdate = async (data: any) => {
   try {
     const res = await http(RequestHttpEnum.POST)(
-      "/intellectual-property/patent-operations/create",
+      "/intellectual-property/patent-operations/patent_operation",
       data
     );
     return res;
@@ -40,7 +40,7 @@ export const postUpdate = async (data: any) => {
   }
 };
 
-// 删除商标
+// 删除
 export const deleteProject = async (id: number) => {
   try {
     const res = await http(RequestHttpEnum.DELETE)(

+ 58 - 5
src/views/ip/patent-management/operate/hooks/useData.hook.ts

@@ -1,6 +1,6 @@
 import { ref, reactive, onMounted } from "vue";
 import { useDictStore } from "@/store/modules/useDictStore/index";
-import { getList, deleteProject } from "./useAxios.hook";
+import { getList, postUpdate, deleteProject } from "./useAxios.hook";
 import { ElMessage, ElMessageBox } from "element-plus";
 
 // 数据初始化
@@ -64,6 +64,7 @@ export const useDataListInit = () => {
   const review_status = dictStore.dictData.review_status;
   const requirement_type = dictStore.dictData.requirement_type;
 
+  console.log('review_status ===>', review_status)
 
   const formFields = [
     {
@@ -170,9 +171,61 @@ export const useDataListInit = () => {
     fetchList();
   };
 
-  const onUpdate = (row: any) => {
-    updateInfo.value = row;
-    updateVisible.value = true;
+  const onUpdate = async (row: any, isExamine: boolean) => {
+    if (isExamine) {
+      ElMessageBox.confirm(
+        "请确认要通过名称为【" + row.patentName + "】的专利运营需求审核",
+        "提示信息",
+        {
+          confirmButtonText: "通过",
+          cancelButtonText: "取消",
+          type: "warning",
+        }
+      )
+        .then(async () => {
+          const data = {
+            id: row.id,
+            status: "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(() => {
+          ElMessage({
+            type: "info",
+            message: "取消删除",
+          });
+        });
+    } else {
+      const data = {
+        id: row.id,
+        status: "0",
+      };
+      const res = (await postUpdate(data)) as unknown as any;
+      if (res.code === 200) {
+        ElMessage({
+          type: "success",
+          message: "操作成功",
+        });
+        fetchList();
+      } else {
+        ElMessage({
+          type: "error",
+          message: "操作失败,请联系管理员",
+        });
+      }
+    }
   };
 
   const onFieldChange = (newTargetKeys: string | string[]) => {
@@ -206,7 +259,7 @@ export const useDataListInit = () => {
   // 执行删除专利,记得加提示
   const onDelete = (row: any) => {
     ElMessageBox.confirm(
-      "请确认要删除专利名称为【" + row.patentsName + "】的专利信息",
+      "请确认要删除专利名称为【" + row.patentName + "】的专利信息",
       "提示信息",
       {
         confirmButtonText: "确认",

+ 3 - 2
src/views/ip/patent-management/operate/index.vue

@@ -64,9 +64,10 @@
           :prop="field.key"
           :label="field.label"
         />
-        <el-table-column fixed="right" label="操作" width="300" align="center">
+        <el-table-column fixed="right" label="操作" width="100" align="center">
           <template v-slot="scope">
-            <el-button type="primary" text @click="">审核</el-button>
+            <el-button type="primary" v-if="scope.row.status === '未审核'" text @click="onUpdate(scope.row, true)">审核</el-button>
+            <el-button type="danger" v-else text @click="onUpdate(scope.row, false)">驳回</el-button>
           </template>
         </el-table-column>
       </el-table>