cz 1 жил өмнө
parent
commit
36eb5554a8

+ 33 - 0
src/views/purchase-sales/inbound-outbound/manyGoods/index.vue

@@ -27,6 +27,12 @@
               </div>
             </template>
 
+            <template #btn="{row}">
+              <div style="width:100%;text-align:right">
+                <van-button type="danger" size="small" style="margin-right:10px" v-if="row.processingMethod==0" @click="toDelete(row)">删除</van-button>
+              </div>
+            </template>
+
           </commonList>
           <div></div>
         </van-list>
@@ -41,6 +47,7 @@ import commonList from "@/components/common-list.vue";
 import { useRoute } from "vue-router";
 import { showSuccessToast, showConfirmDialog } from "vant";
 import useDeviceStore from "@/store/device";
+
 const deviceStore = useDeviceStore();
 
 const loading = ref(false);
@@ -84,6 +91,11 @@ const listConfig = ref([
     slotName: "processingMethod",
     label: "处理结果",
   },
+  {
+    type: "slot",
+    slotName: "btn",
+    label: "",
+  },
 ]);
 const onRefresh = () => {
   req.value.pageNum = 1;
@@ -109,6 +121,27 @@ const toDtl = (row) => {
     },
   });
 };
+
+const toDelete = (row) => {
+  showConfirmDialog({
+    title: "提示",
+    message: `您确定删除该数据吗?`,
+  })
+    .then(() => {
+      proxy
+        .post("/excessGoodsDetails/delete", {
+          id: row.id,
+        })
+        .then((res) => {
+          showSuccessToast("操作成功");
+          onRefresh();
+        });
+    })
+    .catch(() => {
+      return;
+    });
+};
+
 const businessType = ref([
   { label: "线边回仓", value: "1" },
   { label: "完工入库", value: "2" },