فهرست منبع

prodectFileData

qymljy 2 سال پیش
والد
کامیت
67a0b15816

+ 20 - 11
src/HDrpManagement/prodectFileData/components/add.vue

@@ -6,6 +6,7 @@
         width="1100px"
         @close="onClose"
     >
+      <search @searchActive="searchActive" :placeholder="placeholder"></search>
       <div>
         <tablelayout :layout="tablecols" :data="productsList" :custom="true" :checkbox="true" height="calc(100vh - 452px)" @checkboxCallBack="checkboxCallBack">
           <template v-slot:customcol="scope">
@@ -31,6 +32,7 @@
 
 <script>
 import tablelayout from '@/components/table/index2'
+import search from './search'
 export default {
   name: "add",
   props:["plm_technicalinfoid"],
@@ -38,6 +40,7 @@ export default {
     return {
       drawer:false,
       add:false,
+      placeholder:'商品名称',
       form:{
         itemid:''
       },
@@ -51,11 +54,20 @@ export default {
       tablecols:[],
       tableHieght:420,
       selected:0,
-      total:0
+      total:0,
+      params:{
+        "id": 20220923140602,
+        "content": {
+          "where": {
+            "condition": ""
+          }
+        }
+      }
     }
   },
   components:{
-    tablelayout
+    tablelayout,
+    search
   },
   mounted() {
 
@@ -73,14 +85,7 @@ export default {
       this.form.itemid=''
     },
     async productsData(){
-      const res = await this.$api.requested({
-        "id": 20220923140602,
-        "content": {
-          "where": {
-            "condition": ""
-          }
-        },
-      })
+      const res = await this.$api.requested(this.params)
       console.log(res)
       this.productsList = res.data
       this.total = res.total
@@ -111,7 +116,11 @@ export default {
         this.drawer = false
         this.$emit('addSuccess')
       })
-    }
+    },
+    searchActive(data) {
+      this.params.content.where.condition = data
+      this.productsData()
+    },
   }
 }
 </script>

+ 10 - 0
src/HDrpManagement/prodectFileData/components/relationList.vue

@@ -1,5 +1,6 @@
 <template>
   <div>
+    <search :placeholder="placeholder" @searchActive="searchActive"></search>
     <tableLayout :layout="tablecols" :data="list" :opwidth="200" :custom="true" :height="tableHieght">
       <template v-slot:customcol="scope">
         <div v-if="scope.column.columnname === 'isonsale' ">
@@ -34,11 +35,13 @@
 </template>
 
 <script>
+import search from './search'
 export default {
   name: "relationList",
   props:["id"],
   data(){
     return {
+      placeholder:'商品名称',
       tableHieght:420,
       list:[],
       tablecols:[],
@@ -57,6 +60,9 @@ export default {
       }
     }
   },
+  components:{
+    search
+  },
   mounted() {
     this.listData()
   },
@@ -78,6 +84,10 @@ export default {
       this.params.content.pageNumber = val
       this.listData()
     },
+    searchActive(data){
+      this.params.content.where.condition = data
+      this.listData()
+    }
   },
   created() {
     this.tablecols = this.tool.tabelCol(this.$route.name).relationProductTable.tablecols

+ 48 - 0
src/HDrpManagement/prodectFileData/components/search.vue

@@ -0,0 +1,48 @@
+<template>
+  <div class="container border-bottom">
+    <span>搜索: </span>
+    <el-input
+        with="200"
+        type="text"
+        v-model="search"
+        :placeholder="placeholder"
+        size="small"
+        clearable
+        @searchActive="queryClick"
+        @keyup.enter.native="queryClick()"
+        @clear="queryClick"
+    >
+      <i slot="prefix" class="el-icon-search"  @click="queryClick()"></i>
+    </el-input>
+  </div>
+</template>
+
+<script>
+export default {
+  name: "search",
+  props:["placeholder"],
+  data() {
+    return {
+      search:'',
+    }
+  },
+  methods: {
+    queryClick(){
+      this.$emit('searchActive',this.search)
+    }
+  }
+}
+</script>
+
+<style scoped>
+
+  .el-input {
+    width: 200px;
+    margin-right: 16px;
+  }
+  /deep/.el-input__prefix {
+    display: flex;
+    align-items: center;
+  }
+
+</style>

+ 11 - 1
src/HDrpManagement/prodectFileData/modules/list.vue

@@ -1,5 +1,6 @@
 <template>
   <div>
+    <search @searchActive="searchActive" :placeholder="placeholder"></search>
     <tableLayout :layout="tablecols" :data="list" :opwidth="200" :custom="true" :height="tableHieght">
       <template v-slot:customcol="scope">
         <p>{{scope.column.data[scope.column.columnname]}}</p>
@@ -26,6 +27,7 @@
 </template>
 
 <script>
+import search from '../components/search'
 export default {
   name: "list",
   data(){
@@ -35,6 +37,7 @@ export default {
       list:[],
       total:0,
       currentPage:0,
+      placeholder:'档案名称',
       params:{
         "id": "20220926095803",
         "version":1,
@@ -45,9 +48,12 @@ export default {
             "condition":""
           }
         }
-      }
+      },
     }
   },
+  components:{
+    search
+  },
   mounted() {
     this.listData()
   },
@@ -69,6 +75,10 @@ export default {
       this.params.content.pageNumber = val
       this.listData()
     },
+    searchActive(data){
+      this.params.content.where.condition = data
+      this.listData()
+    }
   },
   created() {
     this.tablecols = this.tool.tabelCol(this.$route.name).prodectFileTable.tablecols