Răsfoiți Sursa

订单搜索优化

shish 2 ani în urmă
părinte
comite
f33fc12e77
1 a modificat fișierele cu 26 adăugiri și 17 ștergeri
  1. 26 17
      ghs/src/views/order/list.vue

+ 26 - 17
ghs/src/views/order/list.vue

@@ -119,7 +119,8 @@
       </template>
 
       <template #slot-search-option="{scope}">
-        <span style="margin-left:6px;font-size:19px;">付款时间:</span>
+        <el-input v-model="name" placeholder="客户名称 / 订单号" size="mini" style="width:150px;" :clearable="true" ref="orderSearchRef" @input="changeSearch()" @focus="name=''"></el-input>
+        <span style="margin-left:9px;font-size:19px;">付款时间:</span>
         <el-date-picker v-model="currentDateList" type="daterange" align="right" unlink-panels range-separator="至" start-placeholder="开始日期" @change="getSearchDate" value-format="yyyy-MM-dd"
                 end-placeholder="结束日期" :picker-options="pickerOptions" size="mini" style="margin-right:10px;">
         </el-date-picker>
@@ -293,18 +294,34 @@ export default {
 				that.$router.push({path:'/in/add',query})
 			}
 		}
+
+  
+    this.$nextTick(() => {
+      this.$refs.orderSearchRef.focus()
+    })
+  
+
 	},
   methods: {
+		changeSearch(){
+      let that = this
+      if(this.T != null){
+        clearTimeout(this.T)
+      }
+      this.T = setTimeout(function(){
+        that.app.refresh({ status: that.tabIndex,book:that.book,clearSign:that.clearSign,searchTime:that.searchTime,startTime:that.startTime,endTime:that.endTime,name:that.name })
+      },650)			
+		},
     confirmSend(info){
       this.$service.order.fh({id:info.id,fhType:0}).then(data => {
         this.$notify({ title: '操作成功', message: '', type: 'success'})
-        this.app.refresh({ status: this.tabIndex,book:this.book,clearSign:this.clearSign })
+        this.app.refresh({ status: this.tabIndex,book:this.book,clearSign:this.clearSign,name:this.name })
       })
     },
     updateClearSign(info){
       this.$service.order.modifyClearSign({id:info.id}).then(data => {
         this.$notify({ title: '操作成功', message: '', type: 'success'})
-        this.app.refresh({ status: this.tabIndex,book:this.book,clearSign:this.clearSign })
+        this.app.refresh({ status: this.tabIndex,book:this.book,clearSign:this.clearSign,name:this.name })
       })
     },
 		newCg(){
@@ -317,11 +334,11 @@ export default {
     },
     changeClearSign(e){
       this.clearSign = e
-      this.app.refresh({ status: this.tabIndex,book:this.book,clearSign:this.clearSign });
+      this.app.refresh({ status: this.tabIndex,book:this.book,clearSign:this.clearSign,name:this.name });
     },
     changeBook(e){
       this.book = e
-      this.app.refresh({ status: this.tabIndex,book:this.book,clearSign:this.clearSign });
+      this.app.refresh({ status: this.tabIndex,book:this.book,clearSign:this.clearSign,name:this.name });
     },
     getSearchDate(){
       if (this.$util.isEmpty(this.currentDateList)) {
@@ -333,7 +350,7 @@ export default {
         this.startTime = this.currentDateList[0]
         this.endTime = this.currentDateList[1]
       }
-      this.app.refresh({ status: this.tabIndex,book:this.book,clearSign:this.clearSign,searchTime:this.searchTime,startTime:this.startTime,endTime:this.endTime})
+      this.app.refresh({ status: this.tabIndex,book:this.book,clearSign:this.clearSign,searchTime:this.searchTime,startTime:this.startTime,endTime:this.endTime,name:this.name})
     },
     todays(type) {
       var myDate = new Date();
@@ -384,7 +401,7 @@ export default {
         hiprintTemplate.print(printData)
         //增加打印次数
         this.$service.order.addPrintNum({id:info.id}).then(data => {
-          this.app.refresh({ status: this.tabIndex,book:this.book,clearSign:this.clearSign })
+          this.app.refresh({ status: this.tabIndex,book:this.book,clearSign:this.clearSign,name:this.name })
         })
 			});
     },
@@ -425,7 +442,7 @@ export default {
       });
     },
     handleClick(tab, e) {
-      this.app.refresh({ status: this.tabIndex,book:this.book,clearSign:this.clearSign });
+      this.app.refresh({ status: this.tabIndex,book:this.book,clearSign:this.clearSign,name:this.name });
     },
 		exportData(){
 			this.$service.order.getOrderList({status: this.tabIndex,book:this.book,clearSign:this.clearSign,searchTime:this.searchTime,startTime:this.startTime,endTime:this.endTime,pageSize:9999999,export:1,name:this.name}).then(res => {
@@ -588,17 +605,9 @@ export default {
               layout: ['slot-column-option']
             }
           })
-          .set('dict', {
-            search: {
-              keyWord: 'name',
-            }
-          })
-          .set('search', {
-            key: { placeholder: '订单号 / 客户名称'}
-          })
           .set('layout', [
             ['slot-tabs'],
-            ['search-key','slot-search-option','slot-export-order'],
+            ['slot-search-option','slot-export-order'],
             ['data-table'],
             ['flex1', 'pagination']
           ])