Browse Source

Merge branch '采购终止合同'

lxf 1 year ago
parent
commit
dbbd6bbc7c
1 changed files with 38 additions and 1 deletions
  1. 38 1
      src/views/group/purchase/contract/index.vue

+ 38 - 1
src/views/group/purchase/contract/index.vue

@@ -435,6 +435,16 @@ const configTwo = computed(() => {
     },
     {
       attrs: {
+        label: "采购状态",
+        prop: "status",
+        width: 100,
+      },
+      render(val) {
+        return proxy.dictKeyValue(val, proxy.useUserStore().allDict["purchase_status"]);
+      },
+    },
+    {
+      attrs: {
         label: "币种",
         prop: "currency",
         width: 100,
@@ -517,7 +527,7 @@ const configTwo = computed(() => {
     {
       attrs: {
         label: "操作",
-        width: 120,
+        width: 140,
         align: "center",
         fixed: "right",
       },
@@ -562,6 +572,19 @@ const configTwo = computed(() => {
                 },
               }
             : {},
+          row.status == 20
+            ? {
+                attrs: {
+                  label: "终止合同",
+                  type: "danger",
+                  text: true,
+                },
+                el: "button",
+                click() {
+                  clickRemove(row);
+                },
+              }
+            : {},
         ];
       },
     },
@@ -755,6 +778,20 @@ const clickDelete = (row) => {
     })
     .catch(() => {});
 };
+const clickRemove = (row) => {
+  ElMessageBox.confirm("你是否确认此操作", "提示", {
+    confirmButtonText: "确定",
+    cancelButtonText: "取消",
+    type: "warning",
+  })
+    .then(() => {
+      proxy.post("/purchase/purchaseTermination", { id: row.id }).then(() => {
+        ElMessage({ message: "终止成功", type: "success" });
+        getListTwo();
+      });
+    })
+    .catch(() => {});
+};
 const openPrint = ref(false);
 const printObj = ref({
   id: "printMe",