From 1ed83e98d5bc89f4e87b8ae6692eb31888e55579 Mon Sep 17 00:00:00 2001
From: yangfeng <wanwan926_4@163.com>
Date: 星期四, 21 九月 2023 16:45:09 +0800
Subject: [PATCH] 入库、出库、内部调拨列表及新建接口联调

---
 src/components/makepager/CommonFormTableView.vue |   49 ++++++++++++++++++++++++++++++-------------------
 1 files changed, 30 insertions(+), 19 deletions(-)

diff --git a/src/components/makepager/CommonFormTableView.vue b/src/components/makepager/CommonFormTableView.vue
index 640f96d..60108e2 100644
--- a/src/components/makepager/CommonFormTableView.vue
+++ b/src/components/makepager/CommonFormTableView.vue
@@ -50,10 +50,19 @@
                     v-model="scope.row[item.prop]"
                     placeholder="璇烽�夋嫨"
                     size="mini"
-                    style="width: 63%"
-                    @change="selProductClick"
+                    style="width: 80%"
+                    @change="
+                      (val) => {
+                        selProductClick(val)
+                      }
+                    "
                   >
-                    <el-option v-for="item in productNameOptions" :key="item.id" :label="item.name" :value="item">
+                    <el-option
+                      v-for="item in productNameOptions"
+                      :key="item.id"
+                      :label="item.name"
+                      :value="{ value: item.id, label: item.name, amount: item.amount, unit: item.unit }"
+                    >
                     </el-option>
                   </el-select>
                 </div>
@@ -144,7 +153,7 @@
 </template>
 
 <script>
-// import { getProductListFromGrpc, getProductList } from "@/api/productManage/product"
+import { getProductList } from "@/api/product/product"
 // import SelectCommonDialog from "@/views/other/commonDialog/SelectCommonDialog"
 export default {
   name: "CommmonFormTableView",
@@ -182,10 +191,7 @@
         infomation: {}
       },
       productIndex: 0,
-      productNameOptions: [
-        { id: 1, name: "aaaaa" },
-        { id: 2, name: "bbbbbbbbbb" }
-      ],
+      productNameOptions: [],
       selOptions: [
         { id: 1, name: "浠�" },
         { id: 2, name: "鎵�" }
@@ -193,7 +199,7 @@
     }
   },
   created() {
-    // this.getProductList()
+    this.getProductList()
     this.tableList = this.productTableList
   },
   computed: {},
@@ -205,24 +211,29 @@
   methods: {
     // 浜у搧鍚嶇О
     async getProductList() {
-      // let fn = this.sign == "purchase" ? getProductList : getProductListFromGrpc
-      let fn
-      await fn({
+      await getProductList({
         page: 1,
         pageSize: 100
       }).then((res) => {
-        console.log(res.data)
-        if (res.data.code === 200) {
-          if (res.data.data.list && res.data.data.list.length > 0) {
-            this.productList = res.data.data.list
+        // console.log(res.data)
+        if (res.code === 200) {
+          if (res.data && res.data.length > 0) {
+            this.productNameOptions = res.data
           }
         }
       })
     },
     // 閫夋嫨浜у搧
-    selProductClick(val) {
-      console.log("aaa")
-      console.log(val)
+    selProductClick(item) {
+      this.tableList.tableData.map((ite) => {
+        if (ite.productName.label === item.label) {
+          ite.productId = item.value
+          ite.productName = item.label
+          ite.amount = item.amount
+          ite.unit = item.unit
+        }
+      })
+      console.log(this.tableList.tableData)
     },
     // 閫夋嫨鍗曚綅
     selCommonClick(item) {

--
Gitblit v1.8.0