From eec73ea94ae416977451b09c6e2dc7c83624414b Mon Sep 17 00:00:00 2001
From: guoshilong <123456>
Date: Tue, 02 Aug 2022 10:09:40 +0800
Subject: [PATCH] 加工产品库存显示更新,删除加工记录表中数据,农产品和加工产品数据回滚

---
 src/views/farmplant/processlist.vue |   34 +++++++++++++++++++++++++---------
 1 files changed, 25 insertions(+), 9 deletions(-)

diff --git a/src/views/farmplant/processlist.vue b/src/views/farmplant/processlist.vue
index 0664f55..b4e822f 100644
--- a/src/views/farmplant/processlist.vue
+++ b/src/views/farmplant/processlist.vue
@@ -15,13 +15,13 @@
             @size-change="sizeChange"
             @refresh-change="refreshChange"
             @on-load="onLoad"
-        ></avue-crud>
+            @row-del="rowDel">
+        </avue-crud>
     </basic-container>
 </template>
 
 <script>
-import { getList } from "@/api/process/process"
-
+import { getList,remove } from "@/api/process/process"
 export default {
     data () {
         return {
@@ -36,15 +36,17 @@
                 total: 0,
             },
             selectionList: [],
+            align: "center",
+            menu: true,
             option: {
                 tip: false,
                 searchShow: true,
                 searchMenuSpan: 6,
                 height: 520,
-                editBtn: false,
-                addBtn: false,
                 delBtn: true,
-                viewBtn: true,
+                delBtnText:'删除',
+                delBtnIcon:'el-icon-delete',
+                editBtn:false,
                 menuWidth: 200,
                 menuAlign: "center",
                 align: "center",
@@ -54,7 +56,7 @@
                 selectionFixed: false,
                 expandFixed: false,
                 menuFixed: false,
-                menu: false,
+                menu: true,
                 column: [
                     {
                         label: "品种",
@@ -86,7 +88,7 @@
                         prop: "processNum"
                     },
                     {
-                        label: "销售时间",
+                        label: "加工时间",
                         prop: "saleTime",
                     },
                 ],
@@ -108,7 +110,6 @@
             this.loading = true
             getList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then((res) => {
                 if (res.data.code == 200) {
-                    console.log(res)
                     this.data = res.data.data.records
                     this.page.total = res.data.data.total
                     this.loading = false
@@ -125,6 +126,21 @@
             this.onLoad(this.page, params)
             done()
         },
+        rowDel (row) {
+            this.$confirm("确定将选择数据删除?", {
+                confirmButtonText: "确定",
+                cancelButtonText: "取消",
+                type: "warning"
+            }).then(() => {
+                    return remove(row.id)
+                }).then((res) => {
+                    this.onLoad(this.page)
+                    this.$message({
+                        type: "success",
+                        message: "操作成功!"
+                    })
+                })
+        },
     }
 }
 </script>

--
Gitblit v1.9.3