lilei 1 year ago
parent
commit
731c5d65a0

+ 1 - 1
public/version.json

@@ -1,5 +1,5 @@
 {
   "message": "发现有新版本发布,确定更新系统?",
   "vendorJsVersion": "",
-  "version": 1710991960808
+  "version": 1711007227899
 }

+ 10 - 3
src/views/common/rangeDate.vue

@@ -22,7 +22,8 @@
         <a-button @click="setVal('date2')" type="link" size="small">近一个月</a-button>
         <a-button @click="setVal('date3')" type="link" size="small">本月</a-button>
         <a-button @click="setVal('date4')" type="link" size="small">上月</a-button>
-        <a-button @click="setVal('date5')" type="link" size="small">近一年</a-button>
+        <a-button @click="setVal('date5')" v-if="showShortcut" type="link" size="small">近一年</a-button>
+        <a-button @click="setVal('date6')" v-else type="link" size="small">近三个月</a-button>
       </div>
     </a-date-picker>
     </div>
@@ -49,7 +50,8 @@
         <a-button @click="setVal('date2')" type="link" size="small">近一个月</a-button>
         <a-button @click="setVal('date3')" type="link" size="small">本月</a-button>
         <a-button @click="setVal('date4')" type="link" size="small">上月</a-button>
-        <a-button @click="setVal('date5')" type="link" size="small">近一年</a-button>
+        <a-button @click="setVal('date5')" v-if="showShortcut" type="link" size="small">近一年</a-button>
+        <a-button @click="setVal('date6')" v-else type="link" size="small">近三个月</a-button>
       </div>
     </a-date-picker>
     </div>
@@ -77,6 +79,10 @@ export default {
     allowClear: {
       type: Boolean,
       default: true
+    },
+    showShortcut: {
+      type: Boolean,
+      default: true
     }
   },
   data () {
@@ -91,7 +97,8 @@ export default {
         'date2': [moment().subtract(1, 'months'), moment()],
         'date3': [moment().startOf('month'), moment()],
         'date4': [moment().subtract(1, 'months').startOf('month'), moment().subtract(1, 'months').endOf('month')],
-        'date5': [moment().subtract(1, 'years'), moment()]
+        'date5': [moment().subtract(1, 'years'), moment()],
+        'date6': [moment().subtract(3, 'months').startOf('month'), moment().subtract(3, 'months').endOf('month')]
       },
       startMode:'',
       endMode: ''

+ 15 - 9
src/views/reportData/receivedSendStorageReport/list.vue

@@ -16,7 +16,7 @@
           <a-row :gutter="15">
             <a-col :md="6" :sm="24">
               <a-form-model-item label="日期" prop="time">
-                <rangeDate ref="rangeDate" :showShortcut="false" @change="dateChange" />
+                <rangeDate ref="rangeDate" :showShortcut="false" :value="queryParam.time" @change="dateChange" />
               </a-form-model-item>
             </a-col>
             <a-col :md="6" :sm="24">
@@ -92,6 +92,7 @@
 <script>
 import { commonMixin } from '@/utils/mixin'
 import { STable, VSelect } from '@/components'
+import getDate from '@/libs/getDate.js'
 import rangeDate from '@/views/common/rangeDate.vue'
 import { downloadExcel } from '@/libs/JGPrint.js'
 import ProductType from '../../common/productType.js'
@@ -108,9 +109,14 @@ export default {
       spinning: false,
       tableHeight: 0,
       queryParam: { //  查询条件
-        time: [],
-        beginDate: '',
-        endDate: '',
+        time: [
+          // getDate.getMonthDays(3).starttime,
+          // getDate.getMonthDays(3).endtime
+        ],
+        // beginDate: getDate.getMonthDays(3).starttime,
+        // endDate: getDate.getMonthDays(3).endtime,
+        beginDate:'',
+        endDate:'',
         productEntity: {
           code: '', //  产品编码
           name: '', //  产品名称
@@ -201,7 +207,7 @@ export default {
       this.$refs.ruleForm.validate(valid => {
         if (valid) {
           const a = moment(this.queryParam.beginDate)
-          const b = moment(this.queryParam.endDate)
+          const b = moment(this.queryParam.endDate).subtract(1, 'days')
           if (b.diff(a, 'month') > 2) {
             this.$message.info('最多只能查询3个月')
             return false
@@ -225,8 +231,10 @@ export default {
     },
     //  重置
     resetSearchForm () {
+      // this.$refs.rangeDate.resetDate(this.queryParam.time)
+      // this.queryParam.beginDate = getDate.getMonthDays(3).starttime
+      // this.queryParam.endDate = getDate.getMonthDays(3).endtime
       this.$refs.rangeDate.resetDate()
-      this.queryParam.time = []
       this.queryParam.beginDate = ''
       this.queryParam.endDate = ''
       this.queryParam.productEntity.code = ''
@@ -236,9 +244,9 @@ export default {
       this.queryParam.productEntity.productTypeSn2 = ''
       this.queryParam.productEntity.productTypeSn3 = ''
       this.productType = []
-      this.$refs.ruleForm.resetFields()
       this.totalData = null
       this.$refs.table.clearTable()
+      this.$refs.ruleForm.resetFields()
     },
     //  导出
     handleExport () {
@@ -269,14 +277,12 @@ export default {
   },
   mounted () {
     if (!this.$store.state.app.isNewTab) { // 页签刷新时调用
-      this.pageInit()
       this.resetSearchForm()
     }
   },
   activated () {
     // 如果是新页签打开,则重置当前页面
     if (this.$store.state.app.isNewTab) {
-      this.pageInit()
       this.resetSearchForm()
     }
   },