From fd78adcc4e60321cdcfad0f136476c009c37c5aa Mon Sep 17 00:00:00 2001
From: haoxuan <haoxuan>
Date: 星期二, 09 四月 2024 18:05:04 +0800
Subject: [PATCH] 产品登记表的样式调整

---
 src/views/productManage/productRegisterForm/index.vue |  106 ++++++++++++++++++++++++++++++++++++++++++++--------
 1 files changed, 89 insertions(+), 17 deletions(-)

diff --git a/src/views/productManage/productRegisterForm/index.vue b/src/views/productManage/productRegisterForm/index.vue
index a9a9bec..5413f60 100644
--- a/src/views/productManage/productRegisterForm/index.vue
+++ b/src/views/productManage/productRegisterForm/index.vue
@@ -13,7 +13,6 @@
           <template slot="tableButton">
             <el-table-column label="鎿嶄綔" width="180">
               <template slot-scope="scope">
-                <el-button @click="viewClick(scope.row)" type="text" size="small">鏌ョ湅</el-button>
                 <el-button @click="editClick(scope.row)" type="text" size="small">缂栬緫</el-button>
                 <el-button @click="delClick(scope.row.id)" type="text" size="small">鍒犻櫎</el-button>
               </template>
@@ -30,6 +29,7 @@
 
 <script>
 import pageMixin from "@/components/makepager/pager/mixin/pageMixin"
+import { getRegisterList,getDeleteRegister } from "@/api/productManage/productRegisterForm.js"
 export default {
   name: "productRegisterForm",
   props: {},
@@ -40,13 +40,14 @@
     return {
       loading: false,
       tableList: {},
+      keyword: '',
       tableColumn: [
-        { label: "缂栧彿", prop: "name", min: 100, default: true },
+        { label: "缂栧彿", prop: "number", min: 100, default: true },
         { label: "鐢熶骇鏃堕棿", prop: "member_name" },
-        { label: "杞︾粍", prop: "client_level" },
-        { label: "瑙勬牸", prop: "next_visit_time", min: 90 },
-        { label: "杞﹂棿", prop: "detail_address", min: 200 },
-        { label: "搴勫彛", prop: "client_status" },
+        { label: "杞︾粍", prop: "workshopGroup" },
+        { label: "瑙勬牸", prop: "spec", min: 90 },
+        { label: "杞﹂棿", prop: "name", min: 200 },
+        { label: "搴勫彛", prop: "market" },
         { label: "鍥炴暟", prop: "contact_name", isContactClick: true },
         { label: "杞︾粍鎬讳骇閲�", prop: "contact_phone" }
       ],
@@ -55,11 +56,12 @@
   },
   created() {
     this.setTable()
+    this.getData(this.keyword)
   },
   methods: {
     setTable() {
       this.tableList = {
-        selectIndex: true,
+        selectIndex: false,
         tableInfomation: [],
         allcol: [],
         showcol: this.showCol,
@@ -85,26 +87,84 @@
       this.showcol = val
       this.tableList.tableColumn = this.setColumnVisible(val)
     },
+     // 璇锋眰鏁版嵁
+     async getData() {
+      this.loading = true
+      await getRegisterList({
+        keyword: this.keyword,
+        page: this.pagerOptions.currPage,
+        pageSize: this.pagerOptions.pageSize
+      })
+        .then((res) => {
+          console.log(res)
+          if (res.code === 200) {
+            if (res.data && res.data.length > 0) {
+              // const list = res.data.map((item) => {
+              //   return {
+              //     ...item,
+              //     client_name: item.client.name,
+              //     contact_name: item.contact.name,
+              //     client_status: item.client_status.name,
+              //     phone: item.contact.phone,
+              //     member_name: item.member.username,
+              //     contact_information_name: item.contact_information.name
+              //   }
+              // })
+              this.tableList.tableInfomation =  res.data || []
+              this.pagerOptions.totalCount = res.count
+            } else {
+              this.tableList.tableInfomation = []
+            }
+          } else {
+            this.tableList.tableInfomation = []
+          }
+          this.loading = false
+        })
+        .catch((err) => {
+          console.log(err)
+          this.tableList.tableInfomation = []
+          this.loading = false
+        })
+    },
     // 鎼滅储
     onFilterSearch(searchText) {
-      console.log(searchText)
+      this.keyword = searchText ?? ""
+      this.pagerOptions.currPage = 1
+      this.getData()
     },
     // 鏂板
     addBtnClick() {
       this.$router.push({ name: "addProductRegisterPage" })
     },
-    // 鏌ョ湅
-    viewClick(row) {
-      console.log(row)
-    },
     // 缂栬緫
     editClick(row) {
-      console.log(row)
+      this.$router.push({
+         name:'addProductRegisterPage',
+         query:{
+            id:row.ID,
+            inspectID:row.finenessCheckID,
+          }
+        });
     },
     // 鍒犻櫎
-    delClick(row) {
-      console.log(row)
-    }
+    delClick(id) {
+      this.$confirm("璇风‘璁ゆ槸鍚﹀垹闄わ紝鍒犻櫎鎿嶄綔涓嶅彲鎾ら攢?", "璀﹀憡", {
+        confirmButtonText: "纭畾",
+        cancelButtonText: "鍙栨秷",
+        type: "warning"
+      })
+        .then(() => {
+          getDeleteRegister({ id: id }).then((response) => {
+            if (response.code === 200) {
+              this.$message.success("鍒犻櫎鎴愬姛")
+              this.getData()
+            } else {
+              this.$message.warning("鍒犻櫎澶辫触")
+            }
+          })
+        })
+        .catch(() => {})
+    },
   }
 }
 </script>
@@ -126,7 +186,19 @@
     margin: 0 30px;
     background-color: #fff;
     padding: 10px 15px;
-    height: calc(100% - 180px);
+    height: calc(100% - 160px);
+    border-radius: 12px;
   }
+    .list-view {
+      height: calc(100% - 60px);
+      overflow: hidden;
+    }
+    .btn-pager {
+      display: flex;
+      margin-top: 10px;
+      .page {
+        margin-left: auto;
+      }
+    }
 }
 </style>

--
Gitblit v1.8.0