From 03cfba0f636b42417070fc8caef44bcdd792a085 Mon Sep 17 00:00:00 2001
From: haoxuan <haoxuan>
Date: 星期二, 07 五月 2024 17:34:37 +0800
Subject: [PATCH] 概述 出库模块 编辑的时候循环处理对应产品调用接口获取在库数量的逻辑处理

---
 src/components/makepager/SimpleSearchInput.vue |  143 ++++++++++++++++++++++++++++++++++-------------
 1 files changed, 103 insertions(+), 40 deletions(-)

diff --git a/src/components/makepager/SimpleSearchInput.vue b/src/components/makepager/SimpleSearchInput.vue
index ddd2114..9b93314 100644
--- a/src/components/makepager/SimpleSearchInput.vue
+++ b/src/components/makepager/SimpleSearchInput.vue
@@ -44,21 +44,37 @@
           <ul class="infinite-list" @scroll="loadList">
             <div class="background_color_eee">
               <el-row :gutter="0">
-                <el-col :span="8">
-                  <div class="grid-content bg-purple">
-                    <span class="name">浜у搧鍚嶇О</span>
-                  </div>
-                </el-col>
-                <el-col :span="8">
-                  <div class="grid-content bg-purple">鍐呴儴缂栫爜</div>
-                </el-col>
+                <template v-if="request==2">
+                  <el-col :span="12">
+                    <div class="grid-content bg-purple">
+                      <span class="name">浜哄憳鍚嶇О</span>
+                    </div>
+                  </el-col>
+                  <el-col :span="12">
+                    <div class="grid-content bg-purple">浜哄憳ID</div>
+                  </el-col>
 
-                <el-col :span="5">
-                  <div class="grid-content bg-purple">鍦ㄥ簱鏁伴噺</div>
-                </el-col>
-                <el-col :span="3">
-                  <div class="grid-content bg-purple">璁¢噺鍗曚綅</div>
-                </el-col>
+                  <!-- <el-col :span="5">
+                    <div class="grid-content bg-purple">鍦ㄥ簱鏁伴噺</div>
+                  </el-col> -->
+                </template>
+                <template v-else>
+                  <el-col :span="13">
+                    <div class="grid-content bg-purple">
+                      <span class="name">浜у搧鍚嶇О</span>
+                    </div>
+                  </el-col>
+                  <el-col :span="8">
+                    <div class="grid-content bg-purple">浜у搧缂栫爜</div>
+                  </el-col>
+
+                  <!-- <el-col :span="5">
+                    <div class="grid-content bg-purple">鍦ㄥ簱鏁伴噺</div>
+                  </el-col> -->
+                  <el-col :span="3">
+                    <div class="grid-content bg-purple">鍗曚綅</div>
+                  </el-col>
+                </template>
               </el-row>
             </div>
             <li class="empty" v-if="listData.length === 0">鏆傛棤鏁版嵁</li>
@@ -70,26 +86,45 @@
                 :class="selectValue == user.id ? 'highlight-color' : ''"
               >
                 <el-row :gutter="0">
-                  <el-col :span="8">
-                    <div class="grid-content bg-purple" :title="user[obj.name]">
-                      {{ user[obj.name] || "--" }}
-                    </div>
-                  </el-col>
-                  <el-col :span="6">
-                    <div class="grid-content bg-purple" :title="user.internalReference">
-                      <span class="name">{{ user.internalReference || "--" }}</span>
-                    </div>
-                  </el-col>
-                  <el-col :span="6">
-                    <div class="grid-content bg-purple" :title="user.amount">
-                      {{ user.amount || "--" }}
-                    </div>
-                  </el-col>
-                  <el-col :span="4">
-                    <div class="grid-content bg-purple" :title="user.unit">
-                      {{ user.unit || "--" }}
-                    </div>
-                  </el-col>
+                  <template v-if="request==2">
+                    <el-col :span="12">
+                      <div class="grid-content bg-purple" :title="user[obj.name]">
+                        {{ user[obj.name] || "--" }}
+                      </div>
+                    </el-col>
+                    <el-col :span="12">
+                      <div class="grid-content bg-purple" :title="user.id">
+                        <span class="name">{{ user.id || "--" }}</span>
+                      </div>
+                    </el-col>
+                    <!-- <el-col :span="6">
+                      <div class="grid-content bg-purple" :title="user.amount">
+                        {{ user.amount || "--" }}
+                      </div>
+                    </el-col> -->
+                  </template>
+                  <template v-else>
+                    <el-col :span="13">
+                      <div class="grid-content bg-purple" :title="user[obj.name]">
+                        {{ user[obj.name] || "--" }}
+                      </div>
+                    </el-col>
+                    <el-col :span="8">
+                      <div class="grid-content bg-purple" :title="user.id">
+                        <span class="name">{{ user.id || "--" }}</span>
+                      </div>
+                    </el-col>
+                    <!-- <el-col :span="6">
+                      <div class="grid-content bg-purple" :title="user.amount">
+                        {{ user.amount || "--" }}
+                      </div>
+                    </el-col> -->
+                    <el-col :span="3">
+                      <div class="grid-content bg-purple" :title="user.unit">
+                        {{ user.unit || "--" }}
+                      </div>
+                    </el-col>
+                  </template>
                 </el-row>
               </li>
               <li class="loading">{{ loading ? "鍔犺浇涓�" : "宸茬粡鍒板簳" }}</li>
@@ -103,7 +138,7 @@
 </template>
 
 <script>
-import { getProductList } from "@/api/product/product"
+import { getProductList,getPersonnelList } from "@/api/product/product"
 // import DataSet from "@/views/ShopFloorControl/facilty/components/DataSet";
 export default {
   name: "UserSimpleSearchInput",
@@ -151,7 +186,8 @@
     size: {
       type: [String],
       defalut: "medium"
-    }
+    },
+
   },
   data() {
     return {
@@ -203,10 +239,16 @@
           name: "gaugeName",
           id: "id"
         }
+      }else if (val == 2) {
+        // 鍏朵粬鎼滅储閰嶇疆杩欓噷
+        this.obj = {
+          name: "name",
+          id: "id"
+        }
       }
     },
     // 鏇存柊鎼滅储鍒楄〃
-    updateSearchList(needInit = false, param = {}) {
+    async updateSearchList(needInit = false, param = {}) {
       let listParams
       // 鍒濆鍖栫敤鎴蜂俊鎭垪琛ㄥ叆鍙�
       if (needInit) {
@@ -224,9 +266,30 @@
       this.loading = true
       if (this.request) {
         // 鍏朵粬
+        // 浜哄憳
+        if (this.request == 2) {
+          //浜哄憳  request==1
+          listParams = {
+            condition: this.keyword,
+            page: this.page,
+            pageSize: this.pageSize,
+            ...param,
+          };
+          const res = await getPersonnelList(listParams);
+          if (res && res.code == "200" && res.data) {
+            this.loading = false;
+            this.page = res.page + 1;
+            this.count = res.total;
+            if (res.data && Array.isArray(res.data)) {
+              let arr = JSON.parse(JSON.stringify(res.data));
+              this.listData = this.listData.concat(arr);
+            }
+            this.num += 1;
+          }
+        }
       } else {
         // 浜у搧
-        getProductList(listParams).then((res) => {
+        await  getProductList(listParams).then((res) => {
           if (res && res.code === 200 && res.data) {
             this.loading = false
             this.page = this.page + 1
@@ -371,9 +434,9 @@
 
 <style lang="scss">
 .user-simple-search-input-popper {
-  max-width: 630px;
+  max-width: 500px;
   .el-select-dropdown__wrap {
-    min-width: 509px;
+    min-width: 409px;
     width: 100%;
     min-height: 370px;
 

--
Gitblit v1.8.0