shish преди 2 години
родител
ревизия
99b4b6a006
променени са 2 файла, в които са добавени 56 реда и са изтрити 9 реда
  1. 2 2
      ghs/src/views/in/due.vue
  2. 54 7
      ghs/src/views/order/list.vue

+ 2 - 2
ghs/src/views/in/due.vue

@@ -2,7 +2,7 @@
 	<div class="shop-list">
 		<x-crud @load="onLoad">
 			<template #slot-date-select>
-                <el-date-picker v-model="currentDateList" type="daterange" align="right" unlink-panels range-separator="至" start-placeholder="开始日期" @change="getDate" value-format="yyyy-MM-dd"
+                <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"> </el-date-picker>
 			</template>
 
@@ -131,7 +131,7 @@ export default {
 				.done();
 			    app.refresh();
 		},
-        getDate(){
+        getSearchDate(){
             this.searchTime = 'custom'
             this.startTime = this.currentDateList[0]
             this.endTime = this.currentDateList[1]

+ 54 - 7
ghs/src/views/order/list.vue

@@ -115,19 +115,23 @@
       <template #slot-search-option="{scope}">
         <el-radio-group v-model="book" @change="changeBook" style="margin-right:20px;padding-top:6px;margin-left:20px;">
           <el-radio label="-1">全部</el-radio>
-          <el-radio label="0">普通订单</el-radio>
+          <el-radio label="0">常规订单</el-radio>
           <el-radio label="1">预订单</el-radio>
         </el-radio-group>
-        <el-radio-group v-model="clearSign" @change="changeClearSign" style="margin-right:20px;padding-top:6px;margin-left:20px;">
+        <el-radio-group v-model="clearSign" @change="changeClearSign" style="margin-right:20px;padding-top:6px;margin-left:25px;">
         <el-radio label="-1">全部</el-radio>
-          <el-radio label="0">待结</el-radio>
-          <el-radio label="1">已结</el-radio>
+          <el-radio label="0">待结</el-radio>
+          <el-radio label="1">已结</el-radio>
         </el-radio-group>
+
+        <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:20px;">
+        </el-date-picker>
+
       </template>
 
       <template #slot-billing>
 				<el-button type="primary" size="mini" style="margin-left:20px;" @click="billing()">开单</el-button>
-        <el-button type="primary" size="mini" style="margin-left:20px;" @click="newCg()">新增采购</el-button>
 			</template>
 
     </x-crud>
@@ -234,7 +238,38 @@ export default {
       optionData: {},
       orderData:'',
       book:"-1",
-      clearSign:"-1"
+      clearSign:"-1",
+      currentDateList:[],
+      pickerOptions: {
+            shortcuts: [{
+                text: '最近一周',
+                onClick(picker) {
+                const end = new Date();
+                const start = new Date();
+                start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
+                picker.$emit('pick', [start, end]);
+                }
+            }, {
+                text: '最近一个月',
+                onClick(picker) {
+                const end = new Date();
+                const start = new Date();
+                start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
+                picker.$emit('pick', [start, end]);
+                }
+            }, {
+                text: '最近三个月',
+                onClick(picker) {
+                const end = new Date();
+                const start = new Date();
+                start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
+                picker.$emit('pick', [start, end]);
+                }
+            }]
+      },
+      startTime:'',
+      endTime:'',
+      searchTime:''
     };
   },
   created() {
@@ -282,6 +317,18 @@ export default {
       this.book = e
       this.app.refresh({ status: this.tabIndex,book:this.book,clearSign:this.clearSign });
     },
+    getSearchDate(){
+      if (this.$util.isEmpty(this.currentDateList)) {
+        this.searchTime = ''
+        this.startTime = ''
+        this.endTime = ''
+      }else{
+        this.searchTime = 'custom'
+        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})
+    },
     todays(type) {
       var myDate = new Date();
       let todaty = '';
@@ -517,7 +564,7 @@ export default {
             }
           })
           .set('search', {
-            key: { placeholder: '订单号 | 客户名称' }
+            key: { placeholder: '订单号 | 客户名称'}
           })
           .set('layout', [
             ['slot-tabs'],