Browse Source

修改bug

chenrui 1 year ago
parent
commit
6a0ca24e33

+ 1 - 1
src/config/router.config.js

@@ -1872,7 +1872,7 @@ export const asyncRouterMap = [
               name: 'promotionSalesOrderReportList',
               component: () => import(/* webpackChunkName: "reportData" */ '@/views/reportData/promotionSalesOrderReport/list.vue'),
               meta: {
-                title: '促销销售单报表(统计)列表',
+                title: '促销销售单报表(统计)',
                 icon: 'profile',
                 hidden: true
                 // permission: 'M_promotionSalesOrderReportList'

+ 22 - 18
src/views/common/productType.js

@@ -5,13 +5,13 @@ const ProductType = {
         @change="handleChange"
         :change-on-select="changeOnSelect"
         :value="defaultVal"
-        expand-trigger="hover"
+        :expand-trigger="expandType"
         :options="productTypeList"
         :show-search="{ filter }"
         :fieldNames="{ label: 'productTypeName', value: 'productTypeSn', children: 'children' }"
         :id="id"
         placeholder="请选择产品分类"
-        allowClear />
+        :allowClear="true"/>
     `,
   props: {
     value: {
@@ -20,15 +20,19 @@ const ProductType = {
         return []
       }
     },
+    expandType: {
+      type: String,
+      default: 'hover'
+    },
     id: {
       type: String,
       default: ''
     },
     level: {
-      type: [String,Number],
+      type: [String, Number],
       default: ''
     },
-    changeOnSelect:{
+    changeOnSelect: {
       type: Boolean,
       default: true
     }
@@ -48,25 +52,25 @@ const ProductType = {
     this.getProductType()
   },
   methods: {
-    filter(inputValue, path) {
+    filter (inputValue, path) {
       console.log(inputValue, path)
-      return path.some(option => option.productTypeName.indexOf(inputValue) > -1);
+      return path.some(option => option.productTypeName.indexOf(inputValue) > -1)
     },
-    setDefValue(defaultVal){
+    setDefValue (defaultVal) {
       this.handleChange(defaultVal)
     },
-    handleChange (value,row) {
+    handleChange (value, row) {
       this.defaultVal = value
-      this.$emit('change', this.defaultVal, this.id,row)
+      this.$emit('change', this.defaultVal, this.id, row)
       this.$emit('input', this.defaultVal)
     },
     //  产品分类列表
     getProductType () {
       productTypeQuery({}).then(res => {
         if (res.status == 200) {
-          if(this.level){
+          if (this.level) {
             this.productTypeList = this.getBylevel(res.data)
-          }else{
+          } else {
             this.productTypeList = res.data
           }
         } else {
@@ -74,23 +78,23 @@ const ProductType = {
         }
       })
     },
-    getBylevel(data){
+    getBylevel (data) {
       const ret = []
       // 显示一级分类
-      if(this.level == 1){
+      if (this.level == 1) {
         data.map(item => {
-          if(item.children){
+          if (item.children) {
             delete item.children
           }
         })
       }
       // 显示二级分类
-      if(this.level == 2){
+      if (this.level == 2) {
         data.map(item => {
-          if(item.children){
+          if (item.children) {
             item.children.map(cd => {
-              if(cd.children){
-                 delete cd.children
+              if (cd.children) {
+                delete cd.children
               }
             })
           }

+ 7 - 4
src/views/reportData/promotionSalesOrderReport/list.vue

@@ -75,7 +75,7 @@
                 <a-form-item label="产品分类">
                   <productTypeAll
                     expandType="click"
-                    :changeOnSelect="true"
+                    :changeOnSelect="false"
                     placeholder="请选择产品分类"
                     :level="2"
                     @change="changeProductType"
@@ -212,7 +212,7 @@ export default {
       },
       productType: [],
       form: {
-        monthInfo: []
+        monthInfo: [moment().format('YYYY-MM'), moment().format('YYYY-MM')]
       },
       columns: [
         { title: '区域', dataIndex: 'subareaArea.subareaName', width: '100px', align: 'center', customRender: function (text) { return text || '--' } },
@@ -348,9 +348,12 @@ export default {
     },
     handleSearch () {
       const _this = this
+      if (!_this.form.monthInfo[0] || !_this.monthInfo.time[1]) {
+        _this.$message.error('请选择统计月份')
+        return
+      }
       this.$refs.ruleForm.validate(valid => {
         if (valid) {
-          console.log('11111111111:', valid)
           _this.$refs.table.refresh(true)
         } else {
           _this.$message.error('请选择统计月份')
@@ -374,7 +377,7 @@ export default {
     },
     //  重置
     resetSearchForm () {
-      this.form.monthInfo = []
+      this.form.monthInfo = [this.moment().format('YYYY-MM'), this.moment().format('YYYY-MM')]
       this.startValue = this.moment().format('YYYY-MM')
       this.endValue = this.moment().format('YYYY-MM')
       this.queryParam.brandTypeBeginDate = this.moment().format('YYYYMM')