Browse Source

省市区组件封装

lilei 2 năm trước cách đây
mục cha
commit
52ba5f6fb8
37 tập tin đã thay đổi với 457 bổ sung1616 xóa
  1. 1 1
      src/api/data.js
  2. 16 38
      src/components/index.less
  3. 33 0
      src/utils/util.js
  4. 3 9
      src/views/allocationManagement/transfersPrint/list.vue
  5. 88 0
      src/views/common/areaList.js
  6. 5 1
      src/views/common/productType.js
  7. 14 69
      src/views/reportData/actualSalesReport/list.vue
  8. 0 16
      src/views/reportData/allCountryCostReport/list.vue
  9. 4 38
      src/views/reportData/allocationDetails/list.vue
  10. 1 1
      src/views/reportData/allocationOrderTotal/list.vue
  11. 15 79
      src/views/reportData/allocationPresentation/list.vue
  12. 18 90
      src/views/reportData/billingBackReport/list.vue
  13. 22 83
      src/views/reportData/billingOrderReport/list.vue
  14. 14 75
      src/views/reportData/billingReturnReport/list.vue
  15. 5 2
      src/views/reportData/expenseAccountReport/bearerList.vue
  16. 3 1
      src/views/reportData/expenseAccountReport/categoryList.vue
  17. 6 41
      src/views/reportData/hPriceDifferenceDetailReport/list.vue
  18. 7 44
      src/views/reportData/priceDifferenceDetailReport/list.vue
  19. 1 1
      src/views/reportData/productRebateReport/detailList.vue
  20. 1 1
      src/views/reportData/productRebateReport/list.vue
  21. 10 46
      src/views/reportData/regionTypeSalesReport/list.vue
  22. 17 75
      src/views/reportData/returnGoodsPresentation/list.vue
  23. 14 72
      src/views/reportData/returnSlipReport/list.vue
  24. 15 76
      src/views/reportData/salesAmountReport/list.vue
  25. 14 82
      src/views/reportData/salesDetails/list.vue
  26. 7 38
      src/views/reportData/salesOrderTotal/list.vue
  27. 15 76
      src/views/reportData/salesPresentation/list.vue
  28. 38 115
      src/views/reportData/salesReturnDetailReport/list.vue
  29. 14 74
      src/views/reportData/salesReturnReport/list.vue
  30. 13 82
      src/views/reportData/salesReturnsReport/list.vue
  31. 15 76
      src/views/reportData/salesSlipReport/list.vue
  32. 5 45
      src/views/reportData/transferReturnDetailReport/list.vue
  33. 1 6
      src/views/reportData/transferReturnReport/list.vue
  34. 15 161
      src/views/reportData/urchaseDetailReturn/detailList.vue
  35. 1 0
      src/views/reportData/urchaseReturn/list.vue
  36. 3 1
      src/views/reportData/warehousingOrder/list.vue
  37. 3 1
      src/views/reportData/warehousingOrderDetail/list.vue

+ 1 - 1
src/api/data.js

@@ -42,7 +42,7 @@ export const getAreaAll = () => {
   return axios({
     url: '/area/findAll',
     method: 'get'
-  }).then(res => res.data)
+  })
 }
 
 export const uploadFile = (params) => {

+ 16 - 38
src/components/index.less

@@ -157,28 +157,24 @@
 }
 // 查询条件样式
 .table-page-search-wrapper {
-  .ant-form.ant-form-inline{
-    .ant-form-item {
-      margin-bottom: 10px!important;
-      .ant-input,.ant-select-selection{
-        border-radius: 2px;
-        padding: 0px 11px;
-        font-size: 12px;
-      }
-      .ant-form-item-label{
-        line-height: 32px!important;
-        padding-right: 8px!important;
-      }
-      .ant-form-item-control{
-        line-height: 31px!important;
-      }
-      .ant-form-item-control-wrapper{
-        .ant-select-selection__rendered{
-          margin: 0!important;
-        }
-      }
+  margin-bottom: 6px;
+  .ant-form.ant-form-inline .ant-form-item .ant-input, .ant-form.ant-form-inline .ant-form-item .ant-select-selection{
+    border:0;
+    box-shadow: none !important;
+  }
+  .ant-form.ant-form-inline .ant-form-item{
+    border:1px solid #dadada;
+    border-radius: 3px;
+    overflow: hidden;
+    margin-bottom: 10px!important;
+    .ant-form-item-label{
+      padding-left: 11px;
+      padding-right: 0!important;
     }
   }
+  .ant-input-group-addon{
+    border: 0;
+  }
   .form-model-con.ant-form.ant-form-inline{  // a-form-model  有必选条件(因校验提示信息原因,因此边距需高于无必选条件边距)
     .ant-form-item {
       margin-bottom: 16px!important;
@@ -367,24 +363,6 @@
 }
 
 
-//表格查询条件  样式
-.newTableSearchName{
-   margin-bottom: 6px;
-   .ant-form.ant-form-inline .ant-form-item .ant-input, .ant-form.ant-form-inline .ant-form-item .ant-select-selection{
-     border:0;
-     box-shadow: none !important;
-   }
-   .ant-form.ant-form-inline .ant-form-item{
-     border:1px solid #dadada;
-     border-radius: 3px;
-     overflow: hidden;
-     margin-bottom: 10px!important;
-     .ant-form-item-label{
-       padding-left: 11px;
-       padding-right: 0!important;
-     }
-   }
-}
 //头部样式
 .header-bar{
   margin:6px auto;

+ 33 - 0
src/utils/util.js

@@ -134,6 +134,39 @@ export function formatThousands (number) {
 
   return segs.join(',').split('').reverse().join('') + (arr.length>1 ? ("."+arr[1]) : '')
 }
+/**
+ * 数组转树形结构
+ * @param {array} list 被转换的数组
+ * @param {number|string} root 根节点(最外层节点)的 id
+ * @return array
+ */
+export function arrayToTree(list, root) {
+  const result = [] // 用于存放结果
+  const map = {} // 用于存放 list 下的节点
+
+  // 1. 遍历 list,将 list 下的所有节点以 id 作为索引存入 map
+  for (const item of list) {
+    map[item.id] = { ...item } // 浅拷贝
+  }
+
+  // 2. 再次遍历,将根节点放入最外层,子节点放入父节点
+  for (const item of list) {
+    // 3. 获取节点的 id 和 父 id
+    const { id, parentId } = item // ES6 解构赋值
+    // 4. 如果是根节点,存入 result
+    if (item.parentId == root) {
+      result.push(map[id])
+    } else {
+      // 5. 反之,存入到父节点
+      map[parentId].children
+        ? map[parentId].children.push(map[id])
+        : (map[parentId].children = [map[id]])
+    }
+  }
+
+  // 将结果返回
+  return result
+}
 // 树查找
 export function treeFind (tree, func) {
   for (const data of tree) {

+ 3 - 9
src/views/allocationManagement/transfersPrint/list.vue

@@ -65,15 +65,9 @@
                   </a-form-item>
                 </a-col>
                 <a-col :md="3" :sm="24">
-                  <a-row>
-                    <a-form-item label="地区">
-                      <a-col span="24">
-                        <a-form-item style="margin: 0;">
-                          <Area id="allocateBillList-shippingAddrProvinceSn" v-model="queryParam.shippingAddrProvinceSn" placeholder="请选择省"></Area>
-                        </a-form-item>
-                      </a-col>
-                    </a-form-item>
-                  </a-row>
+                  <a-form-item label="地区">
+                    <Area id="allocateBillList-shippingAddrProvinceSn" v-model="queryParam.shippingAddrProvinceSn" placeholder="请选择省"></Area>
+                  </a-form-item>
                 </a-col>
               </template>
               <a-col :md="6" :sm="24">

+ 88 - 0
src/views/common/areaList.js

@@ -0,0 +1,88 @@
+import { getAreaAll } from '@/api/data'
+import { arrayToTree } from '@/utils/util'
+const AreaList = {
+  template: `
+     <a-cascader
+          :size="size"
+          :changeOnSelect="changeOnSelect"
+          :show-search="{ filter }"
+          @change="handleChange"
+          :value="defaultVal"
+          expand-trigger="hover"
+          :allowClear="allowClear"
+          :options="list"
+          :field-names="{ label: 'name', value: defValKey, children: 'children' }" 
+          :id="id"
+          :placeholder="placeholder" 
+          style="width: 100%;" />
+    `,
+  props: {
+    value: {
+      type: Array,
+      defatut: function(){
+        return []
+      }
+    },
+    id: {
+      type: String,
+      default: ''
+    },
+    defValKey: {
+      type: String,
+      default: 'areaSn'
+    },
+    placeholder: {
+      type: String,
+      default: '请选择省/市/区'
+    },
+    allowClear: {
+        type: Boolean,
+        default: true
+    },
+    size: {
+        type: String,
+        default: 'default'
+    },
+    changeOnSelect:{
+        type: Boolean,
+        default: false
+    }
+  },
+  data() {
+    return {
+      defaultVal: this.value,
+      list: []
+    };
+  },
+  watch: {
+    value(newValue, oldValue) {
+      this.defaultVal = newValue
+    },
+  },
+  mounted() {
+    this.getArea()
+  },
+  methods: {
+    filter(inputValue, path) {
+        return path.some(option => option.name.toLowerCase().indexOf(inputValue.toLowerCase()) > -1);
+    },
+    handleChange (value, selectedOptions) {
+        this.defaultVal = value
+        this.$emit('input', this.defaultVal)
+        this.$emit('change', this.defaultVal, selectedOptions)
+    },
+    //  省/市/区
+    getArea () {
+        getAreaAll().then(res => {
+            if (res.status == 200) {
+                this.list = arrayToTree(res.data,0)
+            }
+        })
+    },
+    clearData(){
+       this.handleChange([],null)
+    }
+  },
+};
+
+export default AreaList

+ 5 - 1
src/views/common/productType.js

@@ -3,7 +3,7 @@ const ProductType = {
   template: `
       <a-cascader
         @change="handleChange"
-        change-on-select
+        :change-on-select="changeOnSelect"
         :value="defaultVal"
         expand-trigger="hover"
         :options="productTypeList"
@@ -28,6 +28,10 @@ const ProductType = {
       type: [String,Number],
       default: ''
     },
+    changeOnSelect:{
+      type: Boolean,
+      default: true
+    }
   },
   data () {
     return {

+ 14 - 69
src/views/reportData/actualSalesReport/list.vue

@@ -39,26 +39,10 @@
               </a-form-model-item>
             </a-col>
             <template v-if="advanced">
-              <a-col :md="12" :sm="24">
-                <a-row>
-                  <a-form-model-item label="地区" >
-                    <a-col span="7">
-                      <a-select v-model="queryParam.dealer.provinceSn" allowClear @change="getCityList" placeholder="请选择省">
-                        <a-select-option v-for="item in addrProvinceList" :value="item.id" :key="item.id + 'a'">{{ item.name }}</a-select-option>
-                      </a-select>
-                    </a-col>
-                    <a-col span="7" offset="1">
-                      <a-select v-model="queryParam.dealer.citySn" allowClear @change="getAreaList" placeholder="请选择市">
-                        <a-select-option v-for="item in addrCityList" :value="item.id" :key="item.id + 'b'">{{ item.name }}</a-select-option>
-                      </a-select>
-                    </a-col>
-                    <a-col span="7" offset="1">
-                      <a-select v-model="queryParam.dealer.districtSn" allowClear placeholder="请选择区/县">
-                        <a-select-option v-for="item in addrDistrictList" :value="item.id" :key="item.id + 'c'">{{ item.name }}</a-select-option>
-                      </a-select>
-                    </a-col>
-                  </a-form-model-item>
-                </a-row>
+              <a-col :md="6" :sm="24">
+                <a-form-model-item label="地区">
+                    <AreaList id="actualSalesReportList-areaList" changeOnSelect ref="areaList" @change="areaChange" defValKey="id"></AreaList>
+                </a-form-model-item>
               </a-col>
             </template>
             <a-col :md="24" :sm="24" style="text-align:center;">
@@ -140,14 +124,14 @@ import rangeDate from '@/views/common/rangeDate.vue'
 import custList from '@/views/common/custList.vue'
 import reportModal from '@/views/common/reportModal.vue'
 import subarea from '@/views/common/subarea.js'
-import { getArea } from '@/api/data'
+import AreaList from '@/views/common/areaList.js'
 import { hdExportExcel } from '@/libs/exportExcel'
 import { salesBillRealAmountQueryPageList, salesBillRealReportCount } from '@/api/salesBillReport'
 import { actualSalesExport } from '@/api/reportData'
 export default {
   name: 'ActualSalesReportList',
   mixins: [commonMixin],
-  components: { STable, VSelect, rangeDate, subarea, custList, reportModal },
+  components: { STable, VSelect, rangeDate, subarea, custList, reportModal, AreaList },
   data () {
     return {
       spinning: false,
@@ -446,6 +430,7 @@ export default {
         if (valid) {
           _this.$refs.table.refresh(true)
         } else {
+          _this.$message.error("请选择销售日期")
           return false
         }
       })
@@ -481,67 +466,27 @@ export default {
         'dealerLevel': undefined
       }
       this.totalData = null
+      if(this.advanced){
+        this.$refs.areaList.clearData()
+      }
       this.$refs.custList.resetForm()
       this.$refs.ruleForm.resetFields()
       this.$refs.table.clearTable()
     },
-    // 获取城市列表
-    getCityList (val) {
-      this.addrCityList = []
-      this.addrDistrictList = []
-      this.queryParam.dealerCitySn = undefined
-      this.queryParam.dealerCountySn = undefined
-      if (val) {
-        this.getArea('city', val)
-      }
-    },
-    // 获取区县列表
-    getAreaList (val) {
-      this.addrDistrictList = []
-      this.queryParam.dealerCountySn = undefined
-      if (val) {
-        this.getArea('district', val)
-      }
+    areaChange(val){
+      this.queryParam.dealer.provinceSn = val[0] ? val[0] : ''
+      this.queryParam.dealer.citySn = val[1] ? val[1] : ''
+      this.queryParam.dealer.districtSn = val[2] ? val[2] : ''
     },
-    //  省/市/区
-    getArea (leve, sn) {
-      let params
-      if (leve == 'province') {
-        params = { type: '2' }
-      } else {
-        params = { parentId: sn, type: leve == 'city' ? '3' : '4' }
-      }
-      getArea(params).then(res => {
-        if (res.status == 200) {
-          if (leve == 'province') {
-            this.addrProvinceList = res.data || []
-          } else if (leve == 'city') {
-            this.addrCityList = res.data || []
-          } else if (leve == 'district') {
-            this.addrDistrictList = res.data || []
-          }
-        } else {
-          if (leve == 'province') {
-            this.addrProvinceList = []
-          } else if (leve == 'city') {
-            this.addrCityList = []
-          } else if (leve == 'district') {
-            this.addrDistrictList = []
-          }
-        }
-      })
-    }
   },
   mounted () {
     if (!this.$store.state.app.isNewTab) { // 页签刷新时调用
-      this.getArea('province')
       this.resetSearchForm()
     }
   },
   activated () {
     // 如果是新页签打开,则重置当前页面
     if (this.$store.state.app.isNewTab) {
-      this.getArea('province')
       this.resetSearchForm()
     }
   },

+ 0 - 16
src/views/reportData/allCountryCostReport/list.vue

@@ -16,22 +16,6 @@
           :model="queryParam"
           @keyup.enter.native="handleSearch">
           <a-row :gutter="15">
-            <!-- <a-col :md="6" :sm="24">
-              <a-form-model-item label="创建时间" prop="time">
-                <a-date-picker
-                  style="width:100%"
-                  placeholder="请选择年份"
-                  format="YYYY"
-                  mode="year"
-                  :disabledDate="disabledDate"
-                  @change="onChange"
-                  :value="year"
-                  :open="open"
-                  @openChange="openChange"
-                  @panelChange="panelChange"
-                />
-              </a-form-model-item>
-            </a-col> -->
             <a-col :md="6" :sm="24">
               <a-form-model-item label="所在区域">
                 <subarea id="returnGoodsPresentationList-subareaSn" v-model="queryParam.dealer.subareaSn"></subarea>

+ 4 - 38
src/views/reportData/allocationDetails/list.vue

@@ -88,11 +88,7 @@
               </a-col>
               <a-col :md="6" :sm="24">
                 <a-form-model-item label="地区">
-                  <a-form-model-item prop="dealerProvinceSn">
-                    <a-select id="allocationDetailsList-dealerProvinceSn" allowClear v-model="queryParam.dealerProvinceSn" placeholder="请选择省">
-                      <a-select-option v-for="item in addrProvinceList" :value="item.areaSn" :key="item.areaSn + 'a'">{{ item.name }}</a-select-option>
-                    </a-select>
-                  </a-form-model-item>
+                  <Area id="allocationDetailsList-shippingAddrProvinceSn" v-model="queryParam.dealerProvinceSn" placeholder="请选择省"></Area>
                 </a-form-model-item>
               </a-col>
             </template>
@@ -158,7 +154,7 @@ import reportModal from '@/views/common/reportModal.vue'
 import subarea from '@/views/common/subarea.js'
 import { productBrandQuery } from '@/api/productBrand'
 import { productTypeQuery } from '@/api/productType'
-import { getArea } from '@/api/data'
+import Area from '@/views/common/area.js'
 import { allocateTypeAllList } from '@/api/allocateType'
 import ProductBrand from '@/views/common/productBrand.js'
 import { hdExportExcel } from '@/libs/exportExcel'
@@ -168,7 +164,7 @@ import { allocateReportDetailList, allocateReportDetailCount, allocateReportDeta
 export default {
   name: 'AllocationDetailsList',
   mixins: [commonMixin],
-  components: { STable, VSelect, rangeDate, subarea, ProductBrand, reportModal, AllocateType },
+  components: { STable, VSelect, rangeDate, subarea, Area, ProductBrand, reportModal, AllocateType },
   data () {
     return {
       spinning: false,
@@ -250,7 +246,6 @@ export default {
       productBrandList: [], //  品牌下拉数据
       productTypeList: [], //  分类下拉数据
       operatorList: [], //  操作员下拉数据
-      addrProvinceList: [], //  省下拉
       totalData: null //  合计
     }
   },
@@ -340,7 +335,7 @@ export default {
         if (valid) {
           _this.$refs.table.refresh(true)
         } else {
-          console.log('error submit!!')
+          _this.$message.error("请选择调拨开单日期")
           return false
         }
       })
@@ -443,40 +438,11 @@ export default {
         }
       })
     },
-    //  省/市/区
-    getArea (leve, sn) {
-      let params
-      if (leve == 'province') {
-        params = { type: '2' }
-      } else {
-        params = { parentId: sn, type: leve == 'city' ? '3' : '4' }
-      }
-      getArea(params).then(res => {
-        if (res.status == 200) {
-          if (leve == 'province') {
-            this.addrProvinceList = res.data || []
-          } else if (leve == 'city') {
-            this.addrCityList = res.data || []
-          } else if (leve == 'district') {
-            this.addrDistrictList = res.data || []
-          }
-        } else {
-          if (leve == 'province') {
-            this.addrProvinceList = []
-          } else if (leve == 'city') {
-            this.addrCityList = []
-          } else if (leve == 'district') {
-            this.addrDistrictList = []
-          }
-        }
-      })
-    },
     pageInit () {
       this.getProductBrand()
       this.getProductType()
       this.getAllocateTypeAllList()
       this.getUserList()
-      this.getArea('province')
     }
   },
   mounted () {

+ 1 - 1
src/views/reportData/allocationOrderTotal/list.vue

@@ -205,7 +205,7 @@ export default {
         if (valid) {
           _this.$refs.table.refresh(true)
         } else {
-          console.log('error submit!!')
+          _this.$message.error("请选择调拨开单日期")
           return false
         }
       })

+ 15 - 79
src/views/reportData/allocationPresentation/list.vue

@@ -44,32 +44,10 @@
                   <subarea id="allocationPresentationList-subareaSn" v-model="queryParam.dealer.subareaSn"></subarea>
                 </a-form-model-item>
               </a-col>
-              <a-col :md="12" :sm="24">
-                <a-row>
-                  <a-form-model-item label="地区" style="margin-bottom: 0!important;">
-                    <a-col span="7">
-                      <a-form-model-item prop="dealerProvinceSn" style="margin: 0;">
-                        <a-select v-model="queryParam.dealer.provinceSn" allowClear @change="getCityList" placeholder="请选择省">
-                          <a-select-option v-for="item in addrProvinceList" :value="item.id" :key="item.id + 'a'">{{ item.name }}</a-select-option>
-                        </a-select>
-                      </a-form-model-item>
-                    </a-col>
-                    <a-col span="7" offset="1">
-                      <a-form-model-item prop="dealerCitySn" style="margin: 0;">
-                        <a-select v-model="queryParam.dealer.citySn" allowClear @change="getAreaList" placeholder="请选择市">
-                          <a-select-option v-for="item in addrCityList" :value="item.id" :key="item.id + 'b'">{{ item.name }}</a-select-option>
-                        </a-select>
-                      </a-form-model-item>
-                    </a-col>
-                    <a-col span="7" offset="1">
-                      <a-form-model-item prop="dealerCountySn" style="margin: 0;">
-                        <a-select v-model="queryParam.dealer.districtSn" allowClear placeholder="请选择区/县">
-                          <a-select-option v-for="item in addrDistrictList" :value="item.id" :key="item.id + 'c'">{{ item.name }}</a-select-option>
-                        </a-select>
-                      </a-form-model-item>
-                    </a-col>
-                  </a-form-model-item>
-                </a-row>
+              <a-col :md="6" :sm="24">
+                <a-form-model-item label="地区">
+                    <AreaList id="allocationPresentationList-areaList" changeOnSelect ref="areaList" @change="areaChange" defValKey="id"></AreaList>
+                </a-form-model-item>
               </a-col>
             </template>
             <a-col :md="6" :sm="24">
@@ -165,13 +143,13 @@ import rangeDate from '@/views/common/rangeDate.vue'
 import reportModal from '@/views/common/reportModal.vue'
 import subarea from '@/views/common/subarea.js'
 import { allocateTypeTreeList } from '@/api/allocateType'
-import { getArea } from '@/api/data'
+import AreaList from '@/views/common/areaList.js'
 import { hdExportExcel } from '@/libs/exportExcel'
 import { reportAllocateDbjdReportList, reportAllocateDbjdReportCount, reportAllocateDbjdReportExport } from '@/api/reportData'
 export default {
   name: 'AllocationPresentationList',
   mixins: [commonMixin],
-  components: { STable, VSelect, rangeDate, subarea, reportModal },
+  components: { STable, VSelect, rangeDate, subarea, AreaList, reportModal },
   data () {
     return {
       spinning: false,
@@ -217,9 +195,6 @@ export default {
         })
       },
       totalData: null,
-      addrProvinceList: [], //  省下拉
-      addrCityList: [], //  市下拉
-      addrDistrictList: [], //  区下拉
       allocateType: [], // 调拨类型
       atypeColList: [],
       tableWidth: 0
@@ -314,6 +289,7 @@ export default {
         if (valid) {
           _this.$refs.table.refresh(true)
         } else {
+          _this.$message.error('请选择调拨日期')
           return false
         }
       })
@@ -344,71 +320,31 @@ export default {
         'dealerLevel': undefined
       }
       this.totalData = null
+      if (this.advanced) {
+        this.$refs.areaList.clearData()
+      }
       this.$refs.ruleForm.resetFields()
       this.$refs.table.clearTable()
     },
-    // 获取城市列表
-    getCityList (val) {
-      this.addrCityList = []
-      this.addrDistrictList = []
-      this.queryParam.dealer.citySn = undefined
-      this.queryParam.dealer.districtSn = undefined
-      if (val) {
-        this.getArea('city', val)
-      }
-    },
-    // 获取区县列表
-    getAreaList (val) {
-      this.addrDistrictList = []
-      this.queryParam.dealer.districtSn = undefined
-      if (val) {
-        this.getArea('district', val)
-      }
-    },
-    //  省/市/区
-    getArea (leve, sn) {
-      let params
-      if (leve == 'province') {
-        params = { type: '2' }
-      } else {
-        params = { parentId: sn, type: leve == 'city' ? '3' : '4' }
-      }
-      getArea(params).then(res => {
-        if (res.status == 200) {
-          if (leve == 'province') {
-            this.addrProvinceList = res.data || []
-          } else if (leve == 'city') {
-            this.addrCityList = res.data || []
-          } else if (leve == 'district') {
-            this.addrDistrictList = res.data || []
-          }
-        } else {
-          if (leve == 'province') {
-            this.addrProvinceList = []
-          } else if (leve == 'city') {
-            this.addrCityList = []
-          } else if (leve == 'district') {
-            this.addrDistrictList = []
-          }
-        }
-      })
+    areaChange(val){
+      this.queryParam.dealer.provinceSn = val[0] ? val[0] : ''
+      this.queryParam.dealer.citySn = val[1] ? val[1] : ''
+      this.queryParam.dealer.districtSn = val[2] ? val[2] : ''
     },
     pageInit () {
-      this.getArea('province')
       this.getAllocateType()
+      this.resetSearchForm()
     }
   },
   mounted () {
     if (!this.$store.state.app.isNewTab) { // 页签刷新时调用
       this.pageInit()
-      this.resetSearchForm()
     }
   },
   activated () {
     // 如果是新页签打开,则重置当前页面
     if (this.$store.state.app.isNewTab) {
       this.pageInit()
-      this.resetSearchForm()
     }
   },
   beforeRouteEnter (to, from, next) {

+ 18 - 90
src/views/reportData/billingBackReport/list.vue

@@ -26,21 +26,11 @@
                 <subarea id="billingBackReportList-subareaSn" v-model="queryParam.subareaSn"></subarea>
               </a-form-model-item>
             </a-col>
-            <a-col :md="7" :sm="24">
-              <a-form-model-item label="地区">
-                <div style="display:flex;algin-item:center;">
-                  <a-select v-model="queryParam.provinceSn" allowClear @change="getCityList" placeholder="请选择省">
-                    <a-select-option v-for="item in addrProvinceList" :value="item.id" :key="item.id + 'a'">{{ item.name }}</a-select-option>
-                  </a-select>
-                  <a-select v-model="queryParam.citySn" allowClear @change="getAreaList" placeholder="请选择市">
-                    <a-select-option v-for="item in addrCityList" :value="item.id" :key="item.id + 'b'">{{ item.name }}</a-select-option>
-                  </a-select>
-                  <a-select v-model="queryParam.districtSn" allowClear placeholder="请选择区/县">
-                    <a-select-option v-for="item in addrDistrictList" :value="item.id" :key="item.id + 'c'">{{ item.name }}</a-select-option>
-                  </a-select>
-                </div>
-              </a-form-model-item>
-            </a-col>
+            <a-col :md="6" :sm="24">
+                <a-form-model-item label="地区">
+                    <AreaList id="returnSlipReportList-areaList" changeOnSelect ref="areaList" @change="areaChange" defValKey="id"></AreaList>
+                </a-form-model-item>
+              </a-col>
             <a-col :md="24" :sm="24" style="margin-bottom: 10px;display:flex;algin-item:center;justify-content: center;">
               <a-button type="primary" @click="handleSearch" :disabled="disabled" id="billingBackReportList-refresh">查询</a-button>
               <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="billingBackReportList-reset">重置</a-button>
@@ -125,7 +115,7 @@
 import { commonMixin } from '@/utils/mixin'
 import { STable, VSelect } from '@/components'
 import rangeDate from '@/views/common/rangeDate.vue'
-import { getArea } from '@/api/data'
+import AreaList from '@/views/common/areaList.js'
 import subarea from '@/views/common/subarea.js'
 import { hdExportExcel } from '@/libs/exportExcel'
 import reportModal from '@/views/common/reportModal.vue'
@@ -133,12 +123,10 @@ import { realReportSalesByProvince, realReportSalesByProvinceExport, realReportS
 export default {
   name: 'RegionTypeSalesReportList',
   mixins: [commonMixin],
-  components: { STable, VSelect, rangeDate, subarea, reportModal },
+  components: { STable, VSelect, rangeDate, subarea, reportModal, AreaList },
   data () {
     return {
       spinning: false,
-      tabsList: [{ id: 0, name: '各省品类实售明细' }, { id: 1, name: '各区品类实售明细' }],
-      salesStatusTypeList: [{ code: 'SALES', name: '实售销售' }, { code: 'SALES_RETURN', name: '实售退货' }, { code: 'REAL_SALES', name: '实际销售' }],
       activeKey: 0,
       showExport: false,
       queryParam: {
@@ -151,19 +139,13 @@ export default {
         citySn: undefined,
         districtSn: undefined,
         dealerLevel: undefined,
-        dealerProvinceSn: undefined,
         subareaSn: undefined,
-        salesStatusType: 'REAL_SALES'
       },
-      addrProvinceList: [], //  省下拉
-      addrCityList: [], //  市下拉
-      addrDistrictList: [], //  区下拉
       disabled: false, //  查询、重置按钮是否可操作
       exportLoading: false,
       totalData: null,
       rules: {
-        'time': [{ required: true, message: '请选择审核时间', trigger: 'change' }],
-        'salesStatusType': [{ required: true, message: '请选择销售状态', trigger: 'change' }]
+        'time': [{ required: true, message: '请选择退货完成时间', trigger: 'change' }],
       },
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
@@ -240,65 +222,6 @@ export default {
     callback (key) {
       this.activeKey = key
       this.resetSearchForm()
-      // this.queryParam.time = []
-      // this.$refs.rangeDate.resetDate(this.queryParam.time)
-      // this.$refs.ruleForm.resetFields()
-      // this.$refs.table.clearTable()
-      console.log(key, this.activeKey)
-    },
-    // 获取城市列表
-    getCityList (val) {
-      this.addrCityList = []
-      this.addrDistrictList = []
-      this.queryParam.dealerCitySn = undefined
-      this.queryParam.dealerCountySn = undefined
-      if (val) {
-        this.getArea('city', val)
-      }
-    },
-    // 获取区县列表
-    getAreaList (val) {
-      this.addrDistrictList = []
-      this.queryParam.dealerCountySn = undefined
-      if (val) {
-        this.getArea('district', val)
-      }
-    },
-    // 获取区县列表
-    getAreaList (val) {
-      this.addrDistrictList = []
-      this.queryParam.dealerCountySn = undefined
-      if (val) {
-        this.getArea('district', val)
-      }
-    },
-    //  省/市/区
-    getArea (leve, sn) {
-      let params
-      if (leve == 'province') {
-        params = { type: '2' }
-      } else {
-        params = { parentId: sn, type: leve == 'city' ? '3' : '4' }
-      }
-      getArea(params).then(res => {
-        if (res.status == 200) {
-          if (leve == 'province') {
-            this.addrProvinceList = res.data || []
-          } else if (leve == 'city') {
-            this.addrCityList = res.data || []
-          } else if (leve == 'district') {
-            this.addrDistrictList = res.data || []
-          }
-        } else {
-          if (leve == 'province') {
-            this.addrProvinceList = []
-          } else if (leve == 'city') {
-            this.addrCityList = []
-          } else if (leve == 'district') {
-            this.addrDistrictList = []
-          }
-        }
-      })
     },
     //  创建时间  change
     dateChange (date) {
@@ -317,6 +240,7 @@ export default {
         if (valid) {
           _this.$refs.table.refresh(true)
         } else {
+          _this.$message.error("请选择退货完成时间")
           return false
         }
       })
@@ -329,11 +253,18 @@ export default {
       this.queryParam.beginDate = ''
       this.queryParam.endDate = ''
       this.queryParam.supplierName = ''
-      this.queryParam.dealerProvinceSn = undefined
+      this.queryParam.provinceSn = undefined
+      this.queryParam.citySn = undefined
+      this.queryParam.districtSn = undefined
       this.queryParam.subareaSn = undefined
-      this.queryParam.salesStatusType = 'REAL_SALES'
+      this.$refs.areaList.clearData()
       this.$refs.table.clearTable()
     },
+    areaChange(val){
+      this.queryParam.provinceSn = val[0] ? val[0] : ''
+      this.queryParam.citySn = val[1] ? val[1] : ''
+      this.queryParam.districtSn = val[2] ? val[2] : ''
+    },
     //  导出
     handleExport () {
       const _this = this
@@ -358,21 +289,18 @@ export default {
     },
     pageInit () {
       this.activeKey = 0
-      this.getArea('province')
       this.resetSearchForm()
     }
   },
   mounted () {
     if (!this.$store.state.app.isNewTab) { // 页签刷新时调用
       this.pageInit()
-      // this.resetSearchForm()
     }
   },
   activated () {
     // 如果是新页签打开,则重置当前页面
     if (this.$store.state.app.isNewTab) {
       this.pageInit()
-      // this.resetSearchForm()
     }
   },
   beforeRouteEnter (to, from, next) {

+ 22 - 83
src/views/reportData/billingOrderReport/list.vue

@@ -11,42 +11,31 @@
           :model="queryParam"
           @keyup.enter.native="handleSearch">
           <a-row :gutter="15">
-            <a-col :md="5" :sm="24">
+            <a-col :md="6" :sm="24">
               <a-form-model-item label="退货完成时间" prop="time">
                 <rangeDate ref="rangeDate" :value="queryParam.time" @change="dateChange"/>
               </a-form-model-item>
             </a-col>
-            <a-col :md="5" :sm="24">
+            <a-col :md="4" :sm="24">
               <a-form-model-item label="供应商名称">
                 <a-input id="billingBackReport-supplierName" v-model.trim="queryParam.supplierName" allowClear placeholder="请输入供应商名称"/>
               </a-form-model-item>
             </a-col>
-            <a-col :md="5" :sm="24">
+            <a-col :md="4" :sm="24">
               <a-form-model-item label="采购退货单号" >
                 <a-input id="billingBackReport-supplierName" v-model.trim="queryParam.supplierName" allowClear placeholder="请输入供应商名称"/>
               </a-form-model-item>
             </a-col>
-            <a-col :md="5" :sm="24">
-              <a-form-model-item label="地区">
-                <div style="display:flex;algin-item:center;">
-                  <a-select v-model="queryParam.dealer.provinceSn" allowClear @change="getCityList" placeholder="请选择省">
-                    <a-select-option v-for="item in addrProvinceList" :value="item.id" :key="item.id + 'a'">{{ item.name }}</a-select-option>
-                  </a-select>
-                  <a-select v-model="queryParam.dealer.citySn" allowClear @change="getAreaList" placeholder="请选择市">
-                    <a-select-option v-for="item in addrCityList" :value="item.id" :key="item.id + 'b'">{{ item.name }}</a-select-option>
-                  </a-select>
-                  <a-select v-model="queryParam.dealer.districtSn" allowClear placeholder="请选择区/县">
-                    <a-select-option v-for="item in addrDistrictList" :value="item.id" :key="item.id + 'c'">{{ item.name }}</a-select-option>
-                  </a-select>
-                </div>
-              </a-form-model-item>
-            </a-col>
             <a-col :md="4" :sm="24">
               <a-form-model-item label="所在区域/分区">
                 <subarea id="billingBackReportList-subareaSn" v-model="queryParam.subareaSn"></subarea>
               </a-form-model-item>
             </a-col>
-
+            <a-col :md="4" :sm="24">
+                <a-form-model-item label="地区">
+                    <AreaList id="returnSlipReportList-areaList" changeOnSelect ref="areaList" @change="areaChange" defValKey="id"></AreaList>
+                </a-form-model-item>
+              </a-col>
             <a-col :md="24" :sm="24" style="margin-bottom: 10px;display:flex;algin-item:center;justify-content: center;">
               <a-button type="primary" @click="handleSearch" :disabled="disabled" id="billingBackReportList-refresh">查询</a-button>
               <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="billingBackReportList-reset">重置</a-button>
@@ -130,20 +119,18 @@
 import { commonMixin } from '@/utils/mixin'
 import { STable, VSelect } from '@/components'
 import rangeDate from '@/views/common/rangeDate.vue'
-import { getArea } from '@/api/data'
+import AreaList from '@/views/common/areaList.js'
 import subarea from '@/views/common/subarea.js'
 import { hdExportExcel } from '@/libs/exportExcel'
 import reportModal from '@/views/common/reportModal.vue'
 import { realReportSalesByProvince, realReportSalesByProvinceExport, realReportSalesBySubArea, realReportSalesBySubAreaExport } from '@/api/reportData.js'
 export default {
-  name: 'RegionTypeSalesReportList',
+  name: 'BillingOrderReportList',
   mixins: [commonMixin],
-  components: { STable, VSelect, rangeDate, subarea, reportModal },
+  components: { STable, VSelect, rangeDate, subarea, reportModal,AreaList },
   data () {
     return {
       spinning: false,
-      tabsList: [{ id: 0, name: '各省品类实售明细' }, { id: 1, name: '各区品类实售明细' }],
-      salesStatusTypeList: [{ code: 'SALES', name: '实售销售' }, { code: 'SALES_RETURN', name: '实售退货' }, { code: 'REAL_SALES', name: '实际销售' }],
       activeKey: 0,
       showExport: false,
       queryParam: {
@@ -159,14 +146,11 @@ export default {
           'dealerLevel': undefined
         },
         subareaSn: undefined,
-        salesStatusType: 'REAL_SALES'
       },
-      addrProvinceList: [], //  省下拉
       disabled: false, //  查询、重置按钮是否可操作
       exportLoading: false,
       rules: {
-        'time': [{ required: true, message: '请选择审核时间', trigger: 'change' }],
-        'salesStatusType': [{ required: true, message: '请选择销售状态', trigger: 'change' }]
+        'time': [{ required: true, message: '请选择退货完成时间', trigger: 'change' }],
       },
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
@@ -243,58 +227,8 @@ export default {
     callback (key) {
       this.activeKey = key
       this.resetSearchForm()
-      // this.queryParam.time = []
-      // this.$refs.rangeDate.resetDate(this.queryParam.time)
-      // this.$refs.ruleForm.resetFields()
-      // this.$refs.table.clearTable()
       console.log(key, this.activeKey)
     },
-    // 获取城市列表
-    getCityList (val) {
-      this.addrCityList = []
-      this.addrDistrictList = []
-      this.queryParam.dealerCitySn = undefined
-      this.queryParam.dealerCountySn = undefined
-      if (val) {
-        this.getArea('city', val)
-      }
-    },
-    // 获取区县列表
-    getAreaList (val) {
-      this.addrDistrictList = []
-      this.queryParam.dealerCountySn = undefined
-      if (val) {
-        this.getArea('district', val)
-      }
-    },
-    //  省/市/区
-    getArea (leve, sn) {
-      let params
-      if (leve == 'province') {
-        params = { type: '2' }
-      } else {
-        params = { parentId: sn, type: leve == 'city' ? '3' : '4' }
-      }
-      getArea(params).then(res => {
-        if (res.status == 200) {
-          if (leve == 'province') {
-            this.addrProvinceList = res.data || []
-          } else if (leve == 'city') {
-            this.addrCityList = res.data || []
-          } else if (leve == 'district') {
-            this.addrDistrictList = res.data || []
-          }
-        } else {
-          if (leve == 'province') {
-            this.addrProvinceList = []
-          } else if (leve == 'city') {
-            this.addrCityList = []
-          } else if (leve == 'district') {
-            this.addrDistrictList = []
-          }
-        }
-      })
-    },
     //  创建时间  change
     dateChange (date) {
       if (date[0] && date[1]) {
@@ -312,6 +246,7 @@ export default {
         if (valid) {
           _this.$refs.table.refresh(true)
         } else {
+          _this.$message.error("请选择退货完成时间")
           return false
         }
       })
@@ -323,11 +258,18 @@ export default {
       this.$refs.rangeDate.resetDate(this.queryParam.time)
       this.queryParam.beginDate = ''
       this.queryParam.endDate = ''
-      this.queryParam.dealerProvinceSn = undefined
+      this.queryParam.provinceSn = undefined
+      this.queryParam.citySn = undefined
+      this.queryParam.districtSn = undefined
       this.queryParam.subareaSn = undefined
-      this.queryParam.salesStatusType = 'REAL_SALES'
+      this.$refs.areaList.clearData()
       this.$refs.table.clearTable()
     },
+    areaChange(val){
+      this.queryParam.provinceSn = val[0] ? val[0] : ''
+      this.queryParam.citySn = val[1] ? val[1] : ''
+      this.queryParam.districtSn = val[2] ? val[2] : ''
+    },
     //  导出
     handleExport () {
       const _this = this
@@ -352,21 +294,18 @@ export default {
     },
     pageInit () {
       this.activeKey = 0
-      this.getArea('province')
       this.resetSearchForm()
     }
   },
   mounted () {
     if (!this.$store.state.app.isNewTab) { // 页签刷新时调用
       this.pageInit()
-      // this.resetSearchForm()
     }
   },
   activated () {
     // 如果是新页签打开,则重置当前页面
     if (this.$store.state.app.isNewTab) {
       this.pageInit()
-      // this.resetSearchForm()
     }
   },
   beforeRouteEnter (to, from, next) {

+ 14 - 75
src/views/reportData/billingReturnReport/list.vue

@@ -39,26 +39,10 @@
               </a-form-model-item>
             </a-col>
             <template v-if="advanced">
-              <a-col :md="12" :sm="24">
-                <a-row>
-                  <a-form-model-item label="地区">
-                    <a-col span="7">
-                      <a-select v-model="queryParam.provinceSn" allowClear @change="getCityList" placeholder="请选择省">
-                        <a-select-option v-for="item in addrProvinceList" :value="item.id" :key="item.id + 'a'">{{ item.name }}</a-select-option>
-                      </a-select>
-                    </a-col>
-                    <a-col span="7" offset="1">
-                      <a-select v-model="queryParam.citySn" allowClear @change="getAreaList" placeholder="请选择市">
-                        <a-select-option v-for="item in addrCityList" :value="item.id" :key="item.id + 'b'">{{ item.name }}</a-select-option>
-                      </a-select>
-                    </a-col>
-                    <a-col span="7" offset="1">
-                      <a-select v-model="queryParam.districtSn" allowClear placeholder="请选择区/县">
-                        <a-select-option v-for="item in addrDistrictList" :value="item.id" :key="item.id + 'c'">{{ item.name }}</a-select-option>
-                      </a-select>
-                    </a-col>
-                  </a-form-model-item>
-                </a-row>
+              <a-col :md="6" :sm="24">
+                <a-form-model-item label="地区">
+                    <AreaList id="billingReturnReportList-areaList" changeOnSelect ref="areaList" @change="areaChange" defValKey="id"></AreaList>
+                </a-form-model-item>
               </a-col>
             </template>
             <a-col :md="24" :sm="24" style="text-align:center;">
@@ -139,13 +123,13 @@ import rangeDate from '@/views/common/rangeDate.vue'
 import custList from '@/views/common/custList.vue'
 import subarea from '@/views/common/subarea.js'
 import reportModal from '@/views/common/reportModal.vue'
-import { getArea } from '@/api/data'
+import AreaList from '@/views/common/areaList.js'
 import { hdExportExcel } from '@/libs/exportExcel'
 import { salesReportReturnList, salesReportReturnCount, billingReturnExport } from '@/api/reportData'
 export default {
   name: 'BillingReturnReportList',
   mixins: [commonMixin],
-  components: { STable, VSelect, custList, subarea, rangeDate, reportModal },
+  components: { STable, VSelect, custList, subarea, rangeDate, reportModal, AreaList },
   data () {
     return {
       spinning: false,
@@ -171,9 +155,6 @@ export default {
       },
       disabled: false, //  查询、重置按钮是否可操作
       exportLoading: false, // 导出loading
-      addrProvinceList: [], //  省下拉
-      addrCityList: [], //  市下拉
-      addrDistrictList: [], //  区下拉
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
@@ -424,6 +405,7 @@ export default {
         if (valid) {
           _this.$refs.table.refresh(true)
         } else {
+          _this.$message.error("请选择退货时间")
           return false
         }
       })
@@ -457,70 +439,27 @@ export default {
       this.queryParam.subareaSn = undefined
       this.queryParam.dealerLevel = undefined
       this.totalData = null
+      if (this.advanced) {
+        this.$refs.areaList.clearData()
+      }
       this.$refs.custList.resetForm()
       this.$refs.ruleForm.resetFields()
       this.$refs.table.clearTable()
     },
-    // 获取城市列表
-    getCityList (val) {
-      this.addrCityList = []
-      this.addrDistrictList = []
-      this.queryParam.citySn = undefined
-      this.queryParam.districtSn = undefined
-      if (val) {
-        this.getArea('city', val)
-      }
-    },
-    // 获取区县列表
-    getAreaList (val) {
-      this.addrDistrictList = []
-      this.queryParam.districtSn = undefined
-      if (val) {
-        this.getArea('district', val)
-      }
-    },
-    //  省/市/区
-    getArea (leve, sn) {
-      let params
-      if (leve == 'province') {
-        params = { type: '2' }
-      } else {
-        params = { parentId: sn, type: leve == 'city' ? '3' : '4' }
-      }
-      getArea(params).then(res => {
-        if (res.status == 200) {
-          if (leve == 'province') {
-            this.addrProvinceList = res.data || []
-          } else if (leve == 'city') {
-            this.addrCityList = res.data || []
-          } else if (leve == 'district') {
-            this.addrDistrictList = res.data || []
-          }
-        } else {
-          if (leve == 'province') {
-            this.addrProvinceList = []
-          } else if (leve == 'city') {
-            this.addrCityList = []
-          } else if (leve == 'district') {
-            this.addrDistrictList = []
-          }
-        }
-      })
+    areaChange(val){
+      this.queryParam.provinceSn = val[0] ? val[0] : ''
+      this.queryParam.citySn = val[1] ? val[1] : ''
+      this.queryParam.districtSn = val[2] ? val[2] : ''
     },
-    pageInit () {
-      this.getArea('province')
-    }
   },
   mounted () {
     if (!this.$store.state.app.isNewTab) { // 页签刷新时调用
-      this.pageInit()
       this.resetSearchForm()
     }
   },
   activated () {
     // 如果是新页签打开,则重置当前页面
     if (this.$store.state.app.isNewTab) {
-      this.pageInit()
       this.resetSearchForm()
     }
   },

+ 5 - 2
src/views/reportData/expenseAccountReport/bearerList.vue

@@ -68,7 +68,8 @@
         ref="table"
         size="small"
         :defaultLoadData="false"
-        :rowKey="(record) => record.id"
+        :rowKey="(record) => record.no"
+        rowKeyName = 'no'
         :columns="columns"
         :showPagination="false"
         :data="loadData"
@@ -138,7 +139,8 @@ export default {
               data.list[i].no = no + i + 1
             }
           }
-          this.spinning = false
+          _this.spinning = false
+          _this.disabled = false
           this.getCount(paramsPage)
           return data
         })
@@ -253,6 +255,7 @@ export default {
           _this.getColumns()
           _this.$refs.table.refresh(true)
         } else {
+          _this.$message.error("请选择查询条件")
           return false
         }
       })

+ 3 - 1
src/views/reportData/expenseAccountReport/categoryList.vue

@@ -22,7 +22,7 @@
             </a-col>
             <a-col :md="6" :sm="24">
               <a-form-model-item label="费用归属品类(二级)" prop="productTypeSn2">
-                <ProductType v-model="productType" :level="2" @change="changeProductType" placeholder="请选择费用归属品类"></ProductType>
+                <ProductType v-model="productType" :changeOnSelect="false" :level="2" @change="changeProductType" placeholder="请选择费用归属品类"></ProductType>
               </a-form-model-item>
             </a-col>
             <a-col :md="6" :sm="24">
@@ -117,6 +117,7 @@ export default {
             }
           }
           this.spinning = false
+          this.disabled = false
           this.getCount(paramsPage)
           return data
         })
@@ -225,6 +226,7 @@ export default {
           _this.getColumns()
           _this.$refs.table.refresh(true)
         } else {
+          _this.$message.error("请选择查询条件")
           return false
         }
       })

+ 6 - 41
src/views/reportData/hPriceDifferenceDetailReport/list.vue

@@ -61,9 +61,7 @@
               </a-col>
               <a-col :md="6" :sm="24">
                 <a-form-model-item label="省级区域">
-                  <a-select id="hPriceDifferenceDetailList-provinceSn" allowClear v-model="queryParam.dealer.provinceSn" placeholder="请选择省">
-                    <a-select-option v-for="item in addrProvinceList" :value="item.areaSn" :key="item.areaSn + 'a'">{{ item.name }}</a-select-option>
-                  </a-select>
+                  <Area id="hPriceDifferenceDetailList-provinceSn" v-model="queryParam.dealer.provinceSn" placeholder="请选择省"></Area>
                 </a-form-model-item>
               </a-col>
               <a-col :md="6" :sm="24">
@@ -103,7 +101,8 @@
         class="sTable"
         ref="table"
         size="small"
-        :rowKey="(record) => record.id"
+        :rowKey="(record) => record.no"
+        rowKeyName="no"
         :columns="columns"
         :data="loadData"
         :defaultLoadData="false"
@@ -134,7 +133,7 @@ import rangeDate from '@/views/common/rangeDate.vue'
 import custList from '@/views/common/custList.vue'
 import subarea from '@/views/common/subarea.js'
 import reportModal from '@/views/common/reportModal.vue'
-import { getArea } from '@/api/data'
+import Area from '@/views/common/area.js'
 import ProductBrand from '@/views/common/productBrand.js'
 import ProductType from '@/views/common/productType.js'
 import { hdExportExcel } from '@/libs/exportExcel'
@@ -142,7 +141,7 @@ import { headRebateDetailReportList, headRebateDetailReportCount, headRebateDeta
 export default {
   name: 'HPriceDifferenceDetailReportList',
   mixins: [commonMixin],
-  components: { STable, VSelect, custList, subarea, rangeDate, ProductBrand, ProductType, reportModal },
+  components: { STable, VSelect, custList, subarea, Area, rangeDate, ProductBrand, ProductType, reportModal },
   data () {
     return {
       spinning: false,
@@ -175,7 +174,6 @@ export default {
         'time': [{ required: true, message: '请选择日期', trigger: 'change' }]
       },
       disabled: false, //  查询、重置按钮是否可操作
-      addrProvinceList: [], //  省下拉
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
@@ -294,7 +292,7 @@ export default {
         if (valid) {
           _this.$refs.table.refresh(true)
         } else {
-          console.log('error submit!!')
+          _this.$message.error('请选择日期')
           return false
         }
       })
@@ -308,34 +306,6 @@ export default {
       this.queryParam.product.productTypeSn2 = val[1] ? val[1] : ''
       this.queryParam.product.productTypeSn3 = val[2] ? val[2] : ''
     },
-    //  省/市/区
-    getArea (leve, sn) {
-      let params
-      if (leve == 'province') {
-        params = { type: '2' }
-      } else {
-        params = { parentId: sn, type: leve == 'city' ? '3' : '4' }
-      }
-      getArea(params).then(res => {
-        if (res.status == 200) {
-          if (leve == 'province') {
-            this.addrProvinceList = res.data || []
-          } else if (leve == 'city') {
-            this.addrCityList = res.data || []
-          } else if (leve == 'district') {
-            this.addrDistrictList = res.data || []
-          }
-        } else {
-          if (leve == 'province') {
-            this.addrProvinceList = []
-          } else if (leve == 'city') {
-            this.addrCityList = []
-          } else if (leve == 'district') {
-            this.addrDistrictList = []
-          }
-        }
-      })
-    },
     //  重置
     resetSearchForm () {
       this.queryParam.time = [
@@ -361,21 +331,16 @@ export default {
       this.$refs.custList.resetForm()
       this.$refs.ruleForm.resetFields()
       this.$refs.table.clearTable()
-    },
-    pageInit () {
-      this.getArea('province')
     }
   },
   mounted () {
     if (!this.$store.state.app.isNewTab) { // 页签刷新时调用
-      this.pageInit()
       this.resetSearchForm()
     }
   },
   activated () {
     // 如果是新页签打开,则重置当前页面
     if (this.$store.state.app.isNewTab) {
-      this.pageInit()
       this.resetSearchForm()
     }
   },

+ 7 - 44
src/views/reportData/priceDifferenceDetailReport/list.vue

@@ -23,11 +23,9 @@
                   style="width: 100%;"/>
               </a-form-model-item>
             </a-col>
-            <a-col :md="3" :sm="24">
+            <a-col :md="4" :sm="24">
               <a-form-model-item label="省份" prop="provinceSn">
-                <a-select v-model="queryParam.provinceSn" allowClear placeholder="请选择省">
-                  <a-select-option v-for="item in addrProvinceList" :value="item.id" :key="item.id + 'a'">{{ item.name }}</a-select-option>
-                </a-select>
+                <Area id="priceDifferenceDetailList-provinceSn" v-model="queryParam.provinceSn" placeholder="请选择省"></Area>
               </a-form-model-item>
             </a-col>
             <a-col :md="5" :sm="24">
@@ -61,7 +59,8 @@
         class="sTable"
         ref="table"
         size="small"
-        :rowKey="(record) => record.id"
+        :rowKey="(record) => record.no"
+        rowKeyName="no"
         :columns="columns"
         :data="loadData"
         :defaultLoadData="false"
@@ -96,7 +95,7 @@ import { commonMixin } from '@/utils/mixin'
 import moment from 'moment'
 import { STable, VSelect } from '@/components'
 import custList from '@/views/common/custList.vue'
-import { getArea } from '@/api/data'
+import Area from '@/views/common/area.js'
 import subarea from '@/views/common/subarea.js'
 import rangeDate from '@/views/common/rangeDate.vue'
 import reportModal from '@/views/common/reportModal.vue'
@@ -105,7 +104,7 @@ import { reportRebateReportList, reportRebateCount, reportRebateExport } from '@
 export default {
   name: 'PriceDifferenceDetailReportList',
   mixins: [commonMixin],
-  components: { STable, VSelect, custList, subarea, rangeDate, reportModal },
+  components: { STable, VSelect, custList, subarea, Area, rangeDate, reportModal },
   data () {
     return {
       spinning: false,
@@ -123,7 +122,6 @@ export default {
         'provinceSn': [{ required: true, message: '请选择省份', trigger: 'change' }]
       },
       disabled: false, //  查询、重置按钮是否可操作
-      addrProvinceList: [], //  省下拉
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
@@ -162,11 +160,9 @@ export default {
         { title: '产品品牌+二级分类', dataIndex: 'productBrandAndType2', width: '15%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '类型', dataIndex: 'bizType', width: '10%', align: 'center', customRender: function (text) { return text || '--' } }
       ]
-      // if (this.$hasPermissions('B_isShowPrice')) { //  售价权限
         arr.splice(4, 0, { title: '实售金额', dataIndex: 'totalRealAmount', width: '8%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
         arr.splice(5, 0, { title: '开单金额', dataIndex: 'totalAmount', width: '8%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
         arr.splice(6, 0, { title: '差价金额', dataIndex: 'rebateAmount', width: '8%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
-      // }
       return arr
     }
   },
@@ -194,7 +190,7 @@ export default {
         if (valid) {
           _this.$refs.table.refresh(true)
         } else {
-          console.log('error submit!!')
+          _this.$message.error('请选择月份和省份')
           return false
         }
       })
@@ -205,34 +201,6 @@ export default {
     custChange (val) {
       this.queryParam.dealerSn = val.key
     },
-    //  省/市/区
-    getArea (leve, sn) {
-      let params
-      if (leve == 'province') {
-        params = { type: '2' }
-      } else {
-        params = { parentId: sn, type: leve == 'city' ? '3' : '4' }
-      }
-      getArea(params).then(res => {
-        if (res.status == 200) {
-          if (leve == 'province') {
-            this.addrProvinceList = res.data || []
-          } else if (leve == 'city') {
-            this.addrCityList = res.data || []
-          } else if (leve == 'district') {
-            this.addrDistrictList = res.data || []
-          }
-        } else {
-          if (leve == 'province') {
-            this.addrProvinceList = []
-          } else if (leve == 'city') {
-            this.addrCityList = []
-          } else if (leve == 'district') {
-            this.addrDistrictList = []
-          }
-        }
-      })
-    },
     //  重置
     resetSearchForm () {
       this.queryParam.month = moment().format('YYYY-MM')
@@ -266,21 +234,16 @@ export default {
           return false
         }
       })
-    },
-    pageInit () {
-      this.getArea('province')
     }
   },
   mounted () {
     if (!this.$store.state.app.isNewTab) { // 页签刷新时调用
-      this.pageInit()
       this.resetSearchForm()
     }
   },
   activated () {
     // 如果是新页签打开,则重置当前页面
     if (this.$store.state.app.isNewTab) {
-      this.pageInit()
       this.resetSearchForm()
     }
   },

+ 1 - 1
src/views/reportData/productRebateReport/detailList.vue

@@ -228,7 +228,7 @@ export default {
         if (valid) {
           this.$refs.table.refresh(true)
         } else {
-          console.log('error submit!!')
+          this.$message.error("请选择日期")
           return false
         }
       })

+ 1 - 1
src/views/reportData/productRebateReport/list.vue

@@ -189,7 +189,7 @@ export default {
         if (valid) {
           this.$refs.table.refresh(true)
         } else {
-          console.log('error submit!!')
+          this.$message.error("请选择日期")
           return false
         }
       })

+ 10 - 46
src/views/reportData/regionTypeSalesReport/list.vue

@@ -35,9 +35,7 @@
             <template v-if="advanced && activeKey==0">
               <a-col :md="6" :sm="24">
                 <a-form-model-item prop="dealerProvinceSn" style="margin: 0;" label="地区">
-                  <a-select v-model="queryParam.dealerProvinceSn" allowClear placeholder="请选择省">
-                    <a-select-option v-for="item in addrProvinceList" :value="item.areaSn" :key="item.areaSn + 'a'">{{ item.name }}</a-select-option>
-                  </a-select>
+                  <Area id="returnGoodsPresentationList-dealerProvinceSn" v-model="queryParam.dealerProvinceSn" placeholder="请选择省"></Area>
                 </a-form-model-item>
               </a-col>
             </template>
@@ -67,7 +65,8 @@
         ref="table"
         size="small"
         :defaultLoadData="false"
-        :rowKey="(record) => record.id"
+        :rowKey="(record) => record.no"
+        rowKeyName="no"
         :columns="columns"
         :data="loadData"
         :showPagination="false"
@@ -84,7 +83,7 @@
 import { commonMixin } from '@/utils/mixin'
 import { STable, VSelect } from '@/components'
 import rangeDate from '@/views/common/rangeDate.vue'
-import { getArea } from '@/api/data'
+import Area from '@/views/common/area.js'
 import subarea from '@/views/common/subarea.js'
 import { hdExportExcel } from '@/libs/exportExcel'
 import reportModal from '@/views/common/reportModal.vue'
@@ -92,7 +91,7 @@ import { realReportSalesByProvince, realReportSalesByProvinceExport, realReportS
 export default {
   name: 'RegionTypeSalesReportList',
   mixins: [commonMixin],
-  components: { STable, VSelect, rangeDate, subarea, reportModal },
+  components: { STable, VSelect, rangeDate, subarea, Area, reportModal },
   data () {
     return {
       spinning: false,
@@ -109,7 +108,6 @@ export default {
         subareaSn: undefined,
         salesStatusType: 'REAL_SALES'
       },
-      addrProvinceList: [], //  省下拉
       disabled: false, //  查询、重置按钮是否可操作
       exportLoading: false,
       rules: {
@@ -126,6 +124,9 @@ export default {
           let data
           if (res.status == 200) {
             data = res.data
+            data.map((item,index) => {
+              item.no = index + 1
+            })
           }
           this.disabled = false
           this.spinning = false
@@ -184,41 +185,8 @@ export default {
     callback (key) {
       this.activeKey = key
       this.resetSearchForm()
-      // this.queryParam.time = []
-      // this.$refs.rangeDate.resetDate(this.queryParam.time)
-      // this.$refs.ruleForm.resetFields()
-      // this.$refs.table.clearTable()
       console.log(key, this.activeKey)
     },
-    // 查询省
-    getProvinceData (leve, sn) {
-      let params
-      if (leve == 'province') {
-        params = { type: '2' }
-      } else {
-        params = { parentId: sn, type: leve == 'city' ? '3' : '4' }
-      }
-      getArea(params).then(res => {
-        if (res.status == 200) {
-          console.log(res, '=============地区')
-          if (leve == 'province') {
-            this.addrProvinceList = res.data || []
-          } else if (leve == 'city') {
-            this.addrCityList = res.data || []
-          } else if (leve == 'district') {
-            this.addrDistrictList = res.data || []
-          }
-        } else {
-          if (leve == 'province') {
-            this.addrProvinceList = []
-          } else if (leve == 'city') {
-            this.addrCityList = []
-          } else if (leve == 'district') {
-            this.addrDistrictList = []
-          }
-        }
-      })
-    },
     //  创建时间  change
     dateChange (date) {
       if (date[0] && date[1]) {
@@ -236,6 +204,7 @@ export default {
         if (valid) {
           _this.$refs.table.refresh(true)
         } else {
+          _this.$message.error('请选择审核时间和销售状态')
           return false
         }
       })
@@ -276,21 +245,18 @@ export default {
     },
     pageInit () {
       this.activeKey = 0
-      this.getProvinceData('province')
       this.resetSearchForm()
     }
   },
   mounted () {
     if (!this.$store.state.app.isNewTab) { // 页签刷新时调用
       this.pageInit()
-      // this.resetSearchForm()
     }
   },
   activated () {
     // 如果是新页签打开,则重置当前页面
     if (this.$store.state.app.isNewTab) {
       this.pageInit()
-      // this.resetSearchForm()
     }
   },
   beforeRouteEnter (to, from, next) {
@@ -300,7 +266,5 @@ export default {
 </script>
 
 <style style="less">
-  .regionTypeSalesReportList-wrap{
-
-  }
+  
 </style>

+ 17 - 75
src/views/reportData/returnGoodsPresentation/list.vue

@@ -44,26 +44,10 @@
                   <subarea id="returnGoodsPresentationList-subareaSn" v-model="queryParam.dealer.subareaSn"></subarea>
                 </a-form-model-item>
               </a-col>
-              <a-col :md="12" :sm="24">
-                <a-row>
-                  <a-form-model-item label="地区" style="margin-bottom: 0!important;">
-                    <a-col span="7">
-                      <a-select v-model="queryParam.dealer.provinceSn" allowClear @change="getCityList" placeholder="请选择省">
-                        <a-select-option v-for="item in addrProvinceList" :value="item.id" :key="item.id + 'a'">{{ item.name }}</a-select-option>
-                      </a-select>
-                    </a-col>
-                    <a-col span="7" offset="1">
-                      <a-select v-model="queryParam.dealer.citySn" allowClear @change="getAreaList" placeholder="请选择市">
-                        <a-select-option v-for="item in addrCityList" :value="item.id" :key="item.id + 'b'">{{ item.name }}</a-select-option>
-                      </a-select>
-                    </a-col>
-                    <a-col span="7" offset="1">
-                      <a-select v-model="queryParam.dealer.districtSn" allowClear placeholder="请选择区/县">
-                        <a-select-option v-for="item in addrDistrictList" :value="item.id" :key="item.id + 'c'">{{ item.name }}</a-select-option>
-                      </a-select>
-                    </a-col>
-                  </a-form-model-item>
-                </a-row>
+              <a-col :md="6" :sm="24">
+                <a-form-model-item label="地区">
+                    <AreaList id="returnGoodsPresentationList-areaList" changeOnSelect ref="areaList" @change="areaChange" defValKey="id"></AreaList>
+                </a-form-model-item>
               </a-col>
             </template>
             <a-col :md="24" :sm="24" style="text-align:center;">
@@ -144,14 +128,14 @@ import { commonMixin } from '@/utils/mixin'
 import { STable, VSelect } from '@/components'
 import rangeDate from '@/views/common/rangeDate.vue'
 import subarea from '@/views/common/subarea.js'
-import { getArea } from '@/api/data'
+import AreaList from '@/views/common/areaList.js'
 import reportModal from '@/views/common/reportModal.vue'
 import { hdExportExcel } from '@/libs/exportExcel'
 import { reportSalesReturnThjdReportList, reportSalesReturnThjdReportCount, reportSalesReturnThjdReportExport } from '@/api/reportData'
 export default {
   name: 'ReturnGoodsPresentationList',
   mixins: [commonMixin],
-  components: { STable, VSelect, rangeDate, subarea, reportModal },
+  components: { STable, VSelect, rangeDate, subarea, AreaList, reportModal },
   data () {
     return {
       spinning: false,
@@ -196,10 +180,7 @@ export default {
           return data
         })
       },
-      totalData: null,
-      addrProvinceList: [], //  省下拉
-      addrCityList: [], //  市下拉
-      addrDistrictList: [] //  区下拉
+      totalData: null
     }
   },
   computed: {
@@ -459,6 +440,7 @@ export default {
         if (valid) {
           _this.$refs.table.refresh(true)
         } else {
+          _this.$message.error("请选择调拨日期")
           return false
         }
       })
@@ -489,70 +471,30 @@ export default {
         'dealerLevel': undefined
       }
       this.totalData = null
+      if (this.advanced) {
+        this.$refs.areaList.clearData()
+      }
       this.$refs.ruleForm.resetFields()
       this.$refs.table.clearTable()
     },
-    // 获取城市列表
-    getCityList (val) {
-      this.addrCityList = []
-      this.addrDistrictList = []
-      this.queryParam.dealer.citySn = undefined
-      this.queryParam.dealer.districtSn = undefined
-      if (val) {
-        this.getArea('city', val)
-      }
-    },
-    // 获取区县列表
-    getAreaList (val) {
-      this.addrDistrictList = []
-      this.queryParam.dealer.districtSn = undefined
-      if (val) {
-        this.getArea('district', val)
-      }
-    },
-    //  省/市/区
-    getArea (leve, sn) {
-      let params
-      if (leve == 'province') {
-        params = { type: '2' }
-      } else {
-        params = { parentId: sn, type: leve == 'city' ? '3' : '4' }
-      }
-      getArea(params).then(res => {
-        if (res.status == 200) {
-          if (leve == 'province') {
-            this.addrProvinceList = res.data || []
-          } else if (leve == 'city') {
-            this.addrCityList = res.data || []
-          } else if (leve == 'district') {
-            this.addrDistrictList = res.data || []
-          }
-        } else {
-          if (leve == 'province') {
-            this.addrProvinceList = []
-          } else if (leve == 'city') {
-            this.addrCityList = []
-          } else if (leve == 'district') {
-            this.addrDistrictList = []
-          }
-        }
-      })
-    },
+    areaChange(val){
+      this.queryParam.dealer.provinceSn = val[0] ? val[0] : ''
+      this.queryParam.dealer.citySn = val[1] ? val[1] : ''
+      this.queryParam.dealer.districtSn = val[2] ? val[2] : ''
+    },  
     pageInit () {
-      this.getArea('province')
+      this.resetSearchForm()
     }
   },
   mounted () {
     if (!this.$store.state.app.isNewTab) { // 页签刷新时调用
       this.pageInit()
-      this.resetSearchForm()
     }
   },
   activated () {
     // 如果是新页签打开,则重置当前页面
     if (this.$store.state.app.isNewTab) {
       this.pageInit()
-      this.resetSearchForm()
     }
   },
   beforeRouteEnter (to, from, next) {

+ 14 - 72
src/views/reportData/returnSlipReport/list.vue

@@ -44,26 +44,10 @@
                   <subarea id="returnSlipReportList-subareaSn" v-model="queryParam.subareaSn"></subarea>
                 </a-form-model-item>
               </a-col>
-              <a-col :md="12" :sm="24">
-                <a-row>
-                  <a-form-model-item label="地区" style="margin-bottom: 0!important;">
-                    <a-col span="7">
-                      <a-select v-model="queryParam.provinceSn" allowClear @change="getCityList" placeholder="请选择省">
-                        <a-select-option v-for="item in addrProvinceList" :value="item.id" :key="item.id + 'a'">{{ item.name }}</a-select-option>
-                      </a-select>
-                    </a-col>
-                    <a-col span="7" offset="1">
-                      <a-select v-model="queryParam.citySn" allowClear @change="getAreaList" placeholder="请选择市">
-                        <a-select-option v-for="item in addrCityList" :value="item.id" :key="item.id + 'b'">{{ item.name }}</a-select-option>
-                      </a-select>
-                    </a-col>
-                    <a-col span="7" offset="1">
-                      <a-select v-model="queryParam.districtSn" allowClear placeholder="请选择区/县">
-                        <a-select-option v-for="item in addrDistrictList" :value="item.id" :key="item.id + 'c'">{{ item.name }}</a-select-option>
-                      </a-select>
-                    </a-col>
-                  </a-form-model-item>
-                </a-row>
+              <a-col :md="6" :sm="24">
+                <a-form-model-item label="地区">
+                    <AreaList id="returnSlipReportList-areaList" changeOnSelect ref="areaList" @change="areaChange" defValKey="id"></AreaList>
+                </a-form-model-item>
               </a-col>
             </template>
             <a-col :md="24" :sm="24" style="text-align:center;">
@@ -147,13 +131,13 @@ import rangeDate from '@/views/common/rangeDate.vue'
 import custList from '@/views/common/custList.vue'
 import subarea from '@/views/common/subarea.js'
 import reportModal from '@/views/common/reportModal.vue'
-import { getArea } from '@/api/data'
+import AreaList from '@/views/common/areaList.js'
 import { hdExportExcel } from '@/libs/exportExcel'
 import { salesReportReturnBillList, salesReportReturnBillCount, returnSlipExport } from '@/api/reportData'
 export default {
   name: 'ReturnSlipReportList',
   mixins: [commonMixin],
-  components: { STable, VSelect, custList, subarea, rangeDate, reportModal },
+  components: { STable, VSelect, custList, subarea, rangeDate, reportModal, AreaList },
   data () {
     return {
       spinning: false,
@@ -466,6 +450,7 @@ export default {
         if (valid) {
           _this.$refs.table.refresh(true)
         } else {
+          _this.$message.error("请选择退货日期")
           return false
         }
       })
@@ -501,69 +486,26 @@ export default {
       this.queryParam.salesReturnBillNo = ''
       this.$refs.custList.resetForm()
       this.totalData = null
+      if (this.advanced) {
+        this.$refs.areaList.clearData()
+      }
       this.$refs.ruleForm.resetFields()
       this.$refs.table.clearTable()
     },
-    // 获取城市列表
-    getCityList (val) {
-      this.addrCityList = []
-      this.addrDistrictList = []
-      this.queryParam.citySn = undefined
-      this.queryParam.districtSn = undefined
-      if (val) {
-        this.getArea('city', val)
-      }
-    },
-    // 获取区县列表
-    getAreaList (val) {
-      this.addrDistrictList = []
-      this.queryParam.districtSn = undefined
-      if (val) {
-        this.getArea('district', val)
-      }
-    },
-    //  省/市/区
-    getArea (leve, sn) {
-      let params
-      if (leve == 'province') {
-        params = { type: '2' }
-      } else {
-        params = { parentId: sn, type: leve == 'city' ? '3' : '4' }
-      }
-      getArea(params).then(res => {
-        if (res.status == 200) {
-          if (leve == 'province') {
-            this.addrProvinceList = res.data || []
-          } else if (leve == 'city') {
-            this.addrCityList = res.data || []
-          } else if (leve == 'district') {
-            this.addrDistrictList = res.data || []
-          }
-        } else {
-          if (leve == 'province') {
-            this.addrProvinceList = []
-          } else if (leve == 'city') {
-            this.addrCityList = []
-          } else if (leve == 'district') {
-            this.addrDistrictList = []
-          }
-        }
-      })
+    areaChange(val){
+      this.queryParam.provinceSn = val[0] ? val[0] : ''
+      this.queryParam.citySn = val[1] ? val[1] : ''
+      this.queryParam.districtSn = val[2] ? val[2] : ''
     },
-    pageInit () {
-      this.getArea('province')
-    }
   },
   mounted () {
     if (!this.$store.state.app.isNewTab) { // 页签刷新时调用
-      this.pageInit()
       this.resetSearchForm()
     }
   },
   activated () {
     // 如果是新页签打开,则重置当前页面
     if (this.$store.state.app.isNewTab) {
-      this.pageInit()
       this.resetSearchForm()
     }
   },

+ 15 - 76
src/views/reportData/salesAmountReport/list.vue

@@ -39,26 +39,10 @@
               </a-form-model-item>
             </a-col>
             <template v-if="advanced">
-              <a-col :md="12" :sm="24">
-                <a-row>
-                  <a-form-model-item label="地区">
-                    <a-col span="7">
-                      <a-select v-model="queryParam.dealer.provinceSn" allowClear @change="getCityList" placeholder="请选择省">
-                        <a-select-option v-for="item in addrProvinceList" :value="item.id" :key="item.id + 'a'">{{ item.name }}</a-select-option>
-                      </a-select>
-                    </a-col>
-                    <a-col span="7" offset="1">
-                      <a-select v-model="queryParam.dealer.citySn" allowClear @change="getAreaList" placeholder="请选择市">
-                        <a-select-option v-for="item in addrCityList" :value="item.id" :key="item.id + 'b'">{{ item.name }}</a-select-option>
-                      </a-select>
-                    </a-col>
-                    <a-col span="7" offset="1">
-                      <a-select v-model="queryParam.dealer.districtSn" allowClear placeholder="请选择区/县">
-                        <a-select-option v-for="item in addrDistrictList" :value="item.id" :key="item.id + 'c'">{{ item.name }}</a-select-option>
-                      </a-select>
-                    </a-col>
-                  </a-form-model-item>
-                </a-row>
+              <a-col :md="6" :sm="24">
+                <a-form-model-item label="地区">
+                    <AreaList id="salesAmountReportList-areaList" changeOnSelect ref="areaList" @change="areaChange" defValKey="id"></AreaList>
+                </a-form-model-item>
               </a-col>
             </template>
             <a-col :md="24" :sm="24" style="text-align:center;">
@@ -139,14 +123,14 @@ import rangeDate from '@/views/common/rangeDate.vue'
 import custList from '@/views/common/custList.vue'
 import subarea from '@/views/common/subarea.js'
 import reportModal from '@/views/common/reportModal.vue'
-import { getArea } from '@/api/data'
+import AreaList from '@/views/common/areaList.js'
 import { hdExportExcel } from '@/libs/exportExcel'
 import { salesBillReportGroupByBuyerList, salesBillReportCountByBuyer } from '@/api/salesBillReport'
 import { salesAmountExport } from '@/api/reportData'
 export default {
   name: 'SalesAmountReportList',
   mixins: [commonMixin],
-  components: { STable, VSelect, rangeDate, subarea, custList, reportModal },
+  components: { STable, VSelect, rangeDate, subarea, custList, reportModal, AreaList },
   data () {
     return {
       spinning: false,
@@ -197,10 +181,7 @@ export default {
           return data
         })
       },
-      totalData: null,
-      addrProvinceList: [], //  省下拉
-      addrCityList: [], //  市下拉
-      addrDistrictList: [] //  区下拉
+      totalData: null
     }
   },
   computed: {
@@ -425,6 +406,7 @@ export default {
         if (valid) {
           _this.$refs.table.refresh(true)
         } else {
+          _this.$message.error("请选择销售日期")
           return false
         }
       })
@@ -460,70 +442,27 @@ export default {
         'dealerLevel': undefined
       }
       this.totalData = null
+      if(this.advanced){
+        this.$refs.areaList.clearData()
+      }
       this.$refs.custList.resetForm()
       this.$refs.ruleForm.resetFields()
       this.$refs.table.clearTable()
     },
-    // 获取城市列表
-    getCityList (val) {
-      this.addrCityList = []
-      this.addrDistrictList = []
-      this.queryParam.dealerCitySn = undefined
-      this.queryParam.dealerCountySn = undefined
-      if (val) {
-        this.getArea('city', val)
-      }
-    },
-    // 获取区县列表
-    getAreaList (val) {
-      this.addrDistrictList = []
-      this.queryParam.dealerCountySn = undefined
-      if (val) {
-        this.getArea('district', val)
-      }
-    },
-    //  省/市/区
-    getArea (leve, sn) {
-      let params
-      if (leve == 'province') {
-        params = { type: '2' }
-      } else {
-        params = { parentId: sn, type: leve == 'city' ? '3' : '4' }
-      }
-      getArea(params).then(res => {
-        if (res.status == 200) {
-          if (leve == 'province') {
-            this.addrProvinceList = res.data || []
-          } else if (leve == 'city') {
-            this.addrCityList = res.data || []
-          } else if (leve == 'district') {
-            this.addrDistrictList = res.data || []
-          }
-        } else {
-          if (leve == 'province') {
-            this.addrProvinceList = []
-          } else if (leve == 'city') {
-            this.addrCityList = []
-          } else if (leve == 'district') {
-            this.addrDistrictList = []
-          }
-        }
-      })
-    },
-    pageInit () {
-      this.getArea('province')
+    areaChange(val){
+      this.queryParam.dealer.provinceSn = val[0] ? val[0] : ''
+      this.queryParam.dealer.citySn = val[1] ? val[1] : ''
+      this.queryParam.dealer.districtSn = val[2] ? val[2] : ''
     }
   },
   mounted () {
     if (!this.$store.state.app.isNewTab) { // 页签刷新时调用
-      this.pageInit()
       this.resetSearchForm()
     }
   },
   activated () {
     // 如果是新页签打开,则重置当前页面
     if (this.$store.state.app.isNewTab) {
-      this.pageInit()
       this.resetSearchForm()
     }
   },

+ 14 - 82
src/views/reportData/salesDetails/list.vue

@@ -78,32 +78,10 @@
                   <subarea id="salesDetailsList-subareaSn" v-model="queryParam.subareaSn"></subarea>
                 </a-form-model-item>
               </a-col>
-              <a-col :md="12" :sm="24">
-                <a-row>
-                  <a-form-model-item label="地区">
-                    <a-col span="7">
-                      <a-form-model-item prop="dealerProvinceSn" style="margin: 0;">
-                        <a-select v-model="queryParam.dealerProvinceSn" allowClear @change="getCityList" placeholder="请选择省">
-                          <a-select-option v-for="item in addrProvinceList" :value="item.id" :key="item.id + 'a'">{{ item.name }}</a-select-option>
-                        </a-select>
-                      </a-form-model-item>
-                    </a-col>
-                    <a-col span="7" offset="1">
-                      <a-form-model-item prop="dealerCitySn" style="margin: 0;">
-                        <a-select v-model="queryParam.dealerCitySn" allowClear @change="getAreaList" placeholder="请选择市">
-                          <a-select-option v-for="item in addrCityList" :value="item.id" :key="item.id + 'b'">{{ item.name }}</a-select-option>
-                        </a-select>
-                      </a-form-model-item>
-                    </a-col>
-                    <a-col span="7" offset="1">
-                      <a-form-model-item prop="dealerCountySn" style="margin: 0;">
-                        <a-select v-model="queryParam.dealerCountySn" allowClear placeholder="请选择区/县">
-                          <a-select-option v-for="item in addrDistrictList" :value="item.id" :key="item.id + 'c'">{{ item.name }}</a-select-option>
-                        </a-select>
-                      </a-form-model-item>
-                    </a-col>
-                  </a-form-model-item>
-                </a-row>
+              <a-col :md="6" :sm="24">
+                <a-form-model-item label="地区">
+                    <AreaList id="salesDetailsList-areaList" changeOnSelect ref="areaList" @change="areaChange" defValKey="id"></AreaList>
+                </a-form-model-item>
               </a-col>
             </template>
             <a-col :md="8" :sm="24" style="margin-bottom: 10px;">
@@ -168,7 +146,7 @@ import rangeDate from '@/views/common/rangeDate.vue'
 import subarea from '@/views/common/subarea.js'
 import custList from '@/views/common/custList.vue'
 import reportModal from '@/views/common/reportModal.vue'
-import { getArea } from '@/api/data'
+import AreaList from '@/views/common/areaList.js'
 import { productTypeQuery } from '@/api/productType'
 import ProductBrand from '@/views/common/productBrand.js'
 import { hdExportExcel } from '@/libs/exportExcel'
@@ -176,7 +154,7 @@ import { reportSalesBillDetailList, reportSalesBillDetailCount, reportSalesBillD
 export default {
   name: 'SalesDetailsList',
   mixins: [commonMixin],
-  components: { STable, VSelect, rangeDate, custList, subarea, ProductBrand, reportModal },
+  components: { STable, VSelect, rangeDate, custList, subarea, ProductBrand, reportModal, AreaList },
   data () {
     return {
       spinning: false,
@@ -232,9 +210,6 @@ export default {
         })
       },
       totalData: null,
-      addrProvinceList: [], //  省下拉
-      addrCityList: [], //  市下拉
-      addrDistrictList: [], //  区下拉
       productTypeList: [] //  分类下拉数据
     }
   },
@@ -307,6 +282,7 @@ export default {
         if (valid) {
           _this.$refs.table.refresh(true)
         } else {
+          _this.$message.error("请选择销售日期")
           return false
         }
       })
@@ -347,6 +323,9 @@ export default {
       this.queryParam.dealerProvinceSn = undefined
       this.queryParam.dealerCitySn = undefined
       this.queryParam.dealerCountySn = undefined
+      if(this.advanced){
+        this.$refs.areaList.clearData()
+      }
       this.productType = []
       this.totalData = null
       this.$refs.ruleForm.resetFields()
@@ -372,11 +351,6 @@ export default {
         }
       })
     },
-    filterOption (input, option) {
-      return (
-        option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
-      )
-    },
     //  产品分类  change
     changeProductType (val, opt) {
       this.queryParam.productTypeSn1 = val[0] ? val[0] : ''
@@ -393,55 +367,13 @@ export default {
         }
       })
     },
-    // 获取城市列表
-    getCityList (val) {
-      this.addrCityList = []
-      this.addrDistrictList = []
-      this.queryParam.dealerCitySn = undefined
-      this.queryParam.dealerCountySn = undefined
-      if (val) {
-        this.getArea('city', val)
-      }
-    },
-    // 获取区县列表
-    getAreaList (val) {
-      this.addrDistrictList = []
-      this.queryParam.dealerCountySn = undefined
-      if (val) {
-        this.getArea('district', val)
-      }
-    },
-    //  省/市/区
-    getArea (leve, sn) {
-      let params
-      if (leve == 'province') {
-        params = { type: '2' }
-      } else {
-        params = { parentId: sn, type: leve == 'city' ? '3' : '4' }
-      }
-      getArea(params).then(res => {
-        if (res.status == 200) {
-          if (leve == 'province') {
-            this.addrProvinceList = res.data || []
-          } else if (leve == 'city') {
-            this.addrCityList = res.data || []
-          } else if (leve == 'district') {
-            this.addrDistrictList = res.data || []
-          }
-        } else {
-          if (leve == 'province') {
-            this.addrProvinceList = []
-          } else if (leve == 'city') {
-            this.addrCityList = []
-          } else if (leve == 'district') {
-            this.addrDistrictList = []
-          }
-        }
-      })
+    areaChange(val){
+      this.queryParam.dealerProvinceSn = val[0] ? val[0] : ''
+      this.queryParam.dealerCitySn = val[1] ? val[1] : ''
+      this.queryParam.dealerCountySn = val[2] ? val[2] : ''
     },
     pageInit () {
       this.getProductType()
-      this.getArea('province')
     }
   },
   mounted () {

+ 7 - 38
src/views/reportData/salesOrderTotal/list.vue

@@ -59,12 +59,8 @@
                 </a-form-model-item>
               </a-col>
               <a-col :md="5" :sm="24">
-                <a-form-model-item label="地区">
-                  <a-form-model-item prop="dealerProvinceSn" style="margin: 0;">
-                    <a-select v-model="queryParam.dealerProvinceSn" allowClear placeholder="请选择省">
-                      <a-select-option v-for="item in addrProvinceList" :value="item.id" :key="item.id + 'a'">{{ item.name }}</a-select-option>
-                    </a-select>
-                  </a-form-model-item>
+                <a-form-model-item label="地区" prop="dealerProvinceSn">
+                  <Area id="salesOrderTotalList-shippingAddrProvinceSn" defValKey="id" v-model="queryParam.dealerProvinceSn" placeholder="请选择省"></Area>
                 </a-form-model-item>
               </a-col>
             </template>
@@ -99,7 +95,8 @@
         class="sTable"
         ref="table"
         size="small"
-        :rowKey="(record) => record.id"
+        :rowKey="(record) => record.salesBillNo"
+        rowKeyName="salesBillNo"
         :columns="columns"
         :data="loadData"
         :scroll="{ x: 1990 }"
@@ -132,14 +129,14 @@ import rangeDate from '@/views/common/rangeDate.vue'
 import subarea from '@/views/common/subarea.js'
 import custList from '@/views/common/custList.vue'
 import reportModal from '@/views/common/reportModal.vue'
-import { getArea } from '@/api/data'
+import Area  from '@/views/common/area.js'
 import { hdExportExcel } from '@/libs/exportExcel'
 import { userQueryList } from '@/api/power-user'
 import { reportSalesBillList, reportSalesBillCount, reportSalesBillExport } from '@/api/reportData'
 export default {
   name: 'SalesOrderTotalList',
   mixins: [commonMixin],
-  components: { STable, VSelect, rangeDate, custList, subarea, reportModal },
+  components: { STable, VSelect, rangeDate, custList, subarea, reportModal, Area },
   data () {
     return {
       spinning: false,
@@ -267,6 +264,7 @@ export default {
         if (valid) {
           _this.$refs.table.refresh(true)
         } else {
+          _this.$message.error("请选择销售日期")
           return false
         }
       })
@@ -338,37 +336,8 @@ export default {
         }
       })
     },
-    //  省/市/区
-    getArea (leve, sn) {
-      let params
-      if (leve == 'province') {
-        params = { type: '2' }
-      } else {
-        params = { parentId: sn, type: leve == 'city' ? '3' : '4' }
-      }
-      getArea(params).then(res => {
-        if (res.status == 200) {
-          if (leve == 'province') {
-            this.addrProvinceList = res.data || []
-          } else if (leve == 'city') {
-            this.addrCityList = res.data || []
-          } else if (leve == 'district') {
-            this.addrDistrictList = res.data || []
-          }
-        } else {
-          if (leve == 'province') {
-            this.addrProvinceList = []
-          } else if (leve == 'city') {
-            this.addrCityList = []
-          } else if (leve == 'district') {
-            this.addrDistrictList = []
-          }
-        }
-      })
-    },
     pageInit () {
       this.getUserList()
-      this.getArea('province')
     }
   },
   mounted () {

+ 15 - 76
src/views/reportData/salesPresentation/list.vue

@@ -44,26 +44,10 @@
                   <subarea id="salesPresentationList-subareaSn" v-model="queryParam.dealer.subareaSn"></subarea>
                 </a-form-model-item>
               </a-col>
-              <a-col :md="12" :sm="24">
-                <a-row>
-                  <a-form-model-item label="地区" style="margin-bottom: 0!important;">
-                    <a-col span="7">
-                      <a-select v-model="queryParam.dealer.provinceSn" allowClear @change="getCityList" placeholder="请选择省">
-                        <a-select-option v-for="item in addrProvinceList" :value="item.id" :key="item.id + 'a'">{{ item.name }}</a-select-option>
-                      </a-select>
-                    </a-col>
-                    <a-col span="7" offset="1">
-                      <a-select v-model="queryParam.dealer.citySn" allowClear @change="getAreaList" placeholder="请选择市">
-                        <a-select-option v-for="item in addrCityList" :value="item.id" :key="item.id + 'b'">{{ item.name }}</a-select-option>
-                      </a-select>
-                    </a-col>
-                    <a-col span="7" offset="1">
-                      <a-select v-model="queryParam.dealer.districtSn" allowClear placeholder="请选择区/县">
-                        <a-select-option v-for="item in addrDistrictList" :value="item.id" :key="item.id + 'c'">{{ item.name }}</a-select-option>
-                      </a-select>
-                    </a-col>
-                  </a-form-model-item>
-                </a-row>
+              <a-col :md="6" :sm="24">
+                <a-form-model-item label="地区">
+                    <AreaList id="salesPresentationList-areaList" changeOnSelect ref="areaList" @change="areaChange" defValKey="id"></AreaList>
+                </a-form-model-item>
               </a-col>
             </template>
             <a-col :md="24" :sm="24" style="text-align:center;">
@@ -146,13 +130,13 @@ import rangeDate from '@/views/common/rangeDate.vue'
 import custList from '@/views/common/custList.vue'
 import subarea from '@/views/common/subarea.js'
 import reportModal from '@/views/common/reportModal.vue'
-import { getArea } from '@/api/data'
+import AreaList from '@/views/common/areaList.js'
 import { hdExportExcel } from '@/libs/exportExcel'
 import { reportDispatchReportList, reportDispatchReportCount, reportDispatchReportExport } from '@/api/reportData'
 export default {
   name: 'SalesPresentationList',
   mixins: [commonMixin],
-  components: { STable, VSelect, rangeDate, subarea, custList, reportModal },
+  components: { STable, VSelect, rangeDate, subarea, AreaList, custList, reportModal },
   data () {
     return {
       spinning: false,
@@ -197,10 +181,7 @@ export default {
           return data
         })
       },
-      totalData: null,
-      addrProvinceList: [], //  省下拉
-      addrCityList: [], //  市下拉
-      addrDistrictList: [] //  区下拉
+      totalData: null
     }
   },
   computed: {
@@ -460,6 +441,7 @@ export default {
         if (valid) {
           _this.$refs.table.refresh(true)
         } else {
+          _this.$message.error('请选择备货销售日期')
           return false
         }
       })
@@ -493,70 +475,27 @@ export default {
         'dealerLevel': undefined
       }
       this.totalData = null
+      if (this.advanced) {
+        this.$refs.areaList.clearData()
+      }
       this.$refs.custList.resetForm()
       this.$refs.ruleForm.resetFields()
       this.$refs.table.clearTable()
     },
-    // 获取城市列表
-    getCityList (val) {
-      this.addrCityList = []
-      this.addrDistrictList = []
-      this.queryParam.dealer.citySn = undefined
-      this.queryParam.dealer.districtSn = undefined
-      if (val) {
-        this.getArea('city', val)
-      }
-    },
-    // 获取区县列表
-    getAreaList (val) {
-      this.addrDistrictList = []
-      this.queryParam.dealer.districtSn = undefined
-      if (val) {
-        this.getArea('district', val)
-      }
-    },
-    //  省/市/区
-    getArea (leve, sn) {
-      let params
-      if (leve == 'province') {
-        params = { type: '2' }
-      } else {
-        params = { parentId: sn, type: leve == 'city' ? '3' : '4' }
-      }
-      getArea(params).then(res => {
-        if (res.status == 200) {
-          if (leve == 'province') {
-            this.addrProvinceList = res.data || []
-          } else if (leve == 'city') {
-            this.addrCityList = res.data || []
-          } else if (leve == 'district') {
-            this.addrDistrictList = res.data || []
-          }
-        } else {
-          if (leve == 'province') {
-            this.addrProvinceList = []
-          } else if (leve == 'city') {
-            this.addrCityList = []
-          } else if (leve == 'district') {
-            this.addrDistrictList = []
-          }
-        }
-      })
-    },
-    pageInit () {
-      this.getArea('province')
+    areaChange(val){
+      this.queryParam.dealer.provinceSn = val[0] ? val[0] : ''
+      this.queryParam.dealer.citySn = val[1] ? val[1] : ''
+      this.queryParam.dealer.districtSn = val[2] ? val[2] : ''
     }
   },
   mounted () {
     if (!this.$store.state.app.isNewTab) { // 页签刷新时调用
-      this.pageInit()
       this.resetSearchForm()
     }
   },
   activated () {
     // 如果是新页签打开,则重置当前页面
     if (this.$store.state.app.isNewTab) {
-      this.pageInit()
       this.resetSearchForm()
     }
   },

+ 38 - 115
src/views/reportData/salesReturnDetailReport/list.vue

@@ -78,32 +78,10 @@
                   <subarea id="salesReturnDetailList-subareaSn" v-model="queryParam.subareaSn"></subarea>
                 </a-form-model-item>
               </a-col>
-              <a-col :md="12" :sm="24">
-                <a-row>
-                  <a-form-model-item label="地区">
-                    <a-col span="7">
-                      <a-form-model-item prop="dealerProvinceSn" style="margin: 0;">
-                        <a-select v-model="queryParam.dealerProvinceSn" allowClear @change="getCityList" placeholder="请选择省">
-                          <a-select-option v-for="item in addrProvinceList" :value="item.id" :key="item.id + 'a'">{{ item.name }}</a-select-option>
-                        </a-select>
-                      </a-form-model-item>
-                    </a-col>
-                    <a-col span="7" offset="1">
-                      <a-form-model-item prop="dealerCitySn" style="margin: 0;">
-                        <a-select v-model="queryParam.dealerCitySn" allowClear @change="getAreaList" placeholder="请选择市">
-                          <a-select-option v-for="item in addrCityList" :value="item.id" :key="item.id + 'b'">{{ item.name }}</a-select-option>
-                        </a-select>
-                      </a-form-model-item>
-                    </a-col>
-                    <a-col span="7" offset="1">
-                      <a-form-model-item prop="dealerCountySn" style="margin: 0;">
-                        <a-select v-model="queryParam.dealerCountySn" allowClear placeholder="请选择区/县">
-                          <a-select-option v-for="item in addrDistrictList" :value="item.id" :key="item.id + 'c'">{{ item.name }}</a-select-option>
-                        </a-select>
-                      </a-form-model-item>
-                    </a-col>
-                  </a-form-model-item>
-                </a-row>
+              <a-col :md="6" :sm="24">
+                <a-form-model-item label="地区">
+                    <AreaList id="salesReturnDetailList-areaList" changeOnSelect ref="areaList" @change="areaChange" defValKey="id"></AreaList>
+                </a-form-model-item>
               </a-col>
             </template>
             <a-col :md="8" :sm="24" style="margin-bottom: 10px;">
@@ -170,10 +148,8 @@ import getDate from '@/libs/getDate.js'
 import { STable, VSelect } from '@/components'
 import rangeDate from '@/views/common/rangeDate.vue'
 import subarea from '@/views/common/subarea.js'
-import custList from '@/views/common/custList.vue'
 import reportModal from '@/views/common/reportModal.vue'
-import { getArea } from '@/api/data'
-import { productBrandQuery } from '@/api/productBrand'
+import AreaList from '@/views/common/areaList.js'
 import { productTypeQuery } from '@/api/productType'
 import ProductBrand from '@/views/common/productBrand.js'
 import { hdExportExcel } from '@/libs/exportExcel'
@@ -181,7 +157,7 @@ import { reportSalesReturnDetailList, reportSalesReturnDetailCount, reportSalesR
 export default {
   name: 'SalesReturnDetailReportList',
   mixins: [commonMixin],
-  components: { STable, VSelect, rangeDate, custList, subarea, ProductBrand, reportModal },
+  components: { STable, VSelect, rangeDate, subarea, ProductBrand, reportModal, AreaList },
   data () {
     return {
       spinning: false,
@@ -238,10 +214,6 @@ export default {
         })
       },
       totalData: null,
-      addrProvinceList: [], //  省下拉
-      addrCityList: [], //  市下拉
-      addrDistrictList: [], //  区下拉
-      productBrandList: [], //  品牌下拉数据
       productTypeList: [] //  分类下拉数据
     }
   },
@@ -327,6 +299,7 @@ export default {
         if (valid) {
           _this.$refs.table.refresh(true)
         } else {
+          _this.$message.error("请选择退货完成日期")
           return false
         }
       })
@@ -344,34 +317,6 @@ export default {
     custChange (val) {
       this.queryParam.dealerSn = val.key
     },
-    //  重置
-    resetSearchForm () {
-      this.queryParam.time = [
-        getDate.getCurrMonthDays().starttime,
-        getDate.getCurrMonthDays().endtime
-      ]
-      this.$refs.rangeDate.resetDate(this.queryParam.time)
-      this.queryParam.beginDate = getDate.getCurrMonthDays().starttime
-      this.queryParam.endDate = getDate.getCurrMonthDays().endtime
-      this.queryParam.salesReturnBillNo = ''
-      this.queryParam.productCode = ''
-      this.queryParam.productName = ''
-      this.queryParam.dealerName = ''
-      this.queryParam.dealerLevel = undefined
-      this.queryParam.productBrandTypeSn = undefined
-      this.queryParam.productBrandSn = undefined
-      this.queryParam.productTypeSn1 = ''
-      this.queryParam.productTypeSn2 = ''
-      this.queryParam.productTypeSn3 = ''
-      this.queryParam.subareaSn = undefined
-      this.queryParam.dealerProvinceSn = undefined
-      this.queryParam.dealerCitySn = undefined
-      this.queryParam.dealerCountySn = undefined
-      this.productType = []
-      this.totalData = null
-      this.$refs.ruleForm.resetFields()
-      this.$refs.table.clearTable()
-    },
     //  导出
     handleExport () {
       const _this = this
@@ -403,16 +348,6 @@ export default {
       this.queryParam.productTypeSn2 = val[1] ? val[1] : ''
       this.queryParam.productTypeSn3 = val[2] ? val[2] : ''
     },
-    //  产品品牌  列表
-    getProductBrand () {
-      productBrandQuery({}).then(res => {
-        if (res.status == 200) {
-          this.productBrandList = res.data
-        } else {
-          this.productBrandList = []
-        }
-      })
-    },
     //  产品分类  列表
     getProductType () {
       productTypeQuery({}).then(res => {
@@ -423,56 +358,44 @@ export default {
         }
       })
     },
-    // 获取城市列表
-    getCityList (val) {
-      this.addrCityList = []
-      this.addrDistrictList = []
+    //  重置
+    resetSearchForm () {
+      this.queryParam.time = [
+        getDate.getCurrMonthDays().starttime,
+        getDate.getCurrMonthDays().endtime
+      ]
+      this.$refs.rangeDate.resetDate(this.queryParam.time)
+      this.queryParam.beginDate = getDate.getCurrMonthDays().starttime
+      this.queryParam.endDate = getDate.getCurrMonthDays().endtime
+      this.queryParam.salesReturnBillNo = ''
+      this.queryParam.productCode = ''
+      this.queryParam.productName = ''
+      this.queryParam.dealerName = ''
+      this.queryParam.dealerLevel = undefined
+      this.queryParam.productBrandTypeSn = undefined
+      this.queryParam.productBrandSn = undefined
+      this.queryParam.productTypeSn1 = ''
+      this.queryParam.productTypeSn2 = ''
+      this.queryParam.productTypeSn3 = ''
+      this.queryParam.subareaSn = undefined
+      this.queryParam.dealerProvinceSn = undefined
       this.queryParam.dealerCitySn = undefined
       this.queryParam.dealerCountySn = undefined
-      if (val) {
-        this.getArea('city', val)
-      }
-    },
-    // 获取区县列表
-    getAreaList (val) {
-      this.addrDistrictList = []
-      this.queryParam.dealerCountySn = undefined
-      if (val) {
-        this.getArea('district', val)
+      this.productType = []
+      if (this.advanced) {
+        this.$refs.areaList.clearData()
       }
+      this.totalData = null
+      this.$refs.ruleForm.resetFields()
+      this.$refs.table.clearTable()
     },
-    //  省/市/区
-    getArea (leve, sn) {
-      let params
-      if (leve == 'province') {
-        params = { type: '2' }
-      } else {
-        params = { parentId: sn, type: leve == 'city' ? '3' : '4' }
-      }
-      getArea(params).then(res => {
-        if (res.status == 200) {
-          if (leve == 'province') {
-            this.addrProvinceList = res.data || []
-          } else if (leve == 'city') {
-            this.addrCityList = res.data || []
-          } else if (leve == 'district') {
-            this.addrDistrictList = res.data || []
-          }
-        } else {
-          if (leve == 'province') {
-            this.addrProvinceList = []
-          } else if (leve == 'city') {
-            this.addrCityList = []
-          } else if (leve == 'district') {
-            this.addrDistrictList = []
-          }
-        }
-      })
+    areaChange(val){
+      this.queryParam.dealerProvinceSn = val[0] ? val[0] : ''
+      this.queryParam.dealerCitySn = val[1] ? val[1] : ''
+      this.queryParam.dealerCountySn = val[2] ? val[2] : ''
     },
     pageInit () {
-      this.getProductBrand()
       this.getProductType()
-      this.getArea('province')
     }
   },
   mounted () {

+ 14 - 74
src/views/reportData/salesReturnReport/list.vue

@@ -39,26 +39,10 @@
               </a-form-model-item>
             </a-col>
             <template v-if="advanced">
-              <a-col :md="12" :sm="24">
-                <a-row>
-                  <a-form-model-item label="地区">
-                    <a-col span="7">
-                      <a-select v-model="queryParam.provinceSn" allowClear @change="getCityList" placeholder="请选择省">
-                        <a-select-option v-for="item in addrProvinceList" :value="item.id" :key="item.id + 'a'">{{ item.name }}</a-select-option>
-                      </a-select>
-                    </a-col>
-                    <a-col span="7" offset="1">
-                      <a-select v-model="queryParam.citySn" allowClear @change="getAreaList" placeholder="请选择市">
-                        <a-select-option v-for="item in addrCityList" :value="item.id" :key="item.id + 'b'">{{ item.name }}</a-select-option>
-                      </a-select>
-                    </a-col>
-                    <a-col span="7" offset="1">
-                      <a-select v-model="queryParam.districtSn" allowClear placeholder="请选择区/县">
-                        <a-select-option v-for="item in addrDistrictList" :value="item.id" :key="item.id + 'c'">{{ item.name }}</a-select-option>
-                      </a-select>
-                    </a-col>
-                  </a-form-model-item>
-                </a-row>
+              <a-col :md="6" :sm="24">
+                <a-form-model-item label="地区">
+                    <AreaList id="salesReturnDetailList-areaList" changeOnSelect ref="areaList" @change="areaChange" defValKey="id"></AreaList>
+                </a-form-model-item>
               </a-col>
             </template>
             <a-col :md="24" :sm="24" style="text-align:center;">
@@ -141,14 +125,14 @@ import rangeDate from '@/views/common/rangeDate.vue'
 import custList from '@/views/common/custList.vue'
 import reportModal from '@/views/common/reportModal.vue'
 import subarea from '@/views/common/subarea.js'
-import { getArea } from '@/api/data'
+import AreaList from '@/views/common/areaList.js'
 import { hdExportExcel } from '@/libs/exportExcel'
 import { salesReportReturnRebateList, salesReportReturnRebateCount, salesReturnExport } from '@/api/reportData'
 
 export default {
   name: 'SalesReturnReportList',
   mixins: [commonMixin],
-  components: { STable, VSelect, custList, subarea, rangeDate, reportModal },
+  components: { STable, VSelect, custList, subarea, rangeDate, reportModal, AreaList },
   data () {
     return {
       spinning: false,
@@ -402,9 +386,7 @@ export default {
           ] }
         // { title: '实售退货合计金额', width: 90, dataIndex: 'totalAmount', align: 'center', customRender: function (text) { return (text || text == 0) ?  _this.toThousands(text) : '--' } }
       ]
-      // if (this.$hasPermissions('B_isShowPrice')) { //  售价权限
       arr.splice(arr.length, 0, { title: '实售退货合计金额', width: 90, dataIndex: 'totalAmount', align: 'right', customRender: function (text) { return (text || text == 0) ? _this.toThousands(text) : '--' } })
-      // }
       return arr
     }
   },
@@ -445,6 +427,7 @@ export default {
         if (valid) {
           _this.$refs.table.refresh(true)
         } else {
+          _this.$message.error("请选择退货日期")
           return false
         }
       })
@@ -478,70 +461,27 @@ export default {
       this.queryParam.subareaSn = undefined
       this.queryParam.dealerLevel = undefined
       this.totalData = null
+      if (this.advanced) {
+        this.$refs.areaList.clearData()
+      }
       this.$refs.custList.resetForm()
       this.$refs.ruleForm.resetFields()
       this.$refs.table.clearTable()
     },
-    // 获取城市列表
-    getCityList (val) {
-      this.addrCityList = []
-      this.addrDistrictList = []
-      this.queryParam.citySn = undefined
-      this.queryParam.districtSn = undefined
-      if (val) {
-        this.getArea('city', val)
-      }
-    },
-    // 获取区县列表
-    getAreaList (val) {
-      this.addrDistrictList = []
-      this.queryParam.districtSn = undefined
-      if (val) {
-        this.getArea('district', val)
-      }
-    },
-    //  省/市/区
-    getArea (leve, sn) {
-      let params
-      if (leve == 'province') {
-        params = { type: '2' }
-      } else {
-        params = { parentId: sn, type: leve == 'city' ? '3' : '4' }
-      }
-      getArea(params).then(res => {
-        if (res.status == 200) {
-          if (leve == 'province') {
-            this.addrProvinceList = res.data || []
-          } else if (leve == 'city') {
-            this.addrCityList = res.data || []
-          } else if (leve == 'district') {
-            this.addrDistrictList = res.data || []
-          }
-        } else {
-          if (leve == 'province') {
-            this.addrProvinceList = []
-          } else if (leve == 'city') {
-            this.addrCityList = []
-          } else if (leve == 'district') {
-            this.addrDistrictList = []
-          }
-        }
-      })
-    },
-    pageInit () {
-      this.getArea('province')
+    areaChange(val){
+      this.queryParam.provinceSn = val[0] ? val[0] : ''
+      this.queryParam.citySn = val[1] ? val[1] : ''
+      this.queryParam.districtSn = val[2] ? val[2] : ''
     }
   },
   mounted () {
     if (!this.$store.state.app.isNewTab) { // 页签刷新时调用
-      this.pageInit()
       this.resetSearchForm()
     }
   },
   activated () {
     // 如果是新页签打开,则重置当前页面
     if (this.$store.state.app.isNewTab) {
-      this.pageInit()
       this.resetSearchForm()
     }
   },

+ 13 - 82
src/views/reportData/salesReturnsReport/list.vue

@@ -44,32 +44,10 @@
                     allowClear></v-select>
                 </a-form-model-item>
               </a-col>
-              <a-col :md="11" :sm="24">
-                <a-row>
-                  <a-form-model-item label="地区" style="margin-bottom: 0!important;">
-                    <a-col span="7">
-                      <a-form-model-item prop="dealerProvinceSn" style="margin: 0;">
-                        <a-select v-model="queryParam.dealerProvinceSn" allowClear @change="getCityList" placeholder="请选择省">
-                          <a-select-option v-for="item in addrProvinceList" :value="item.id" :key="item.id + 'a'">{{ item.name }}</a-select-option>
-                        </a-select>
-                      </a-form-model-item>
-                    </a-col>
-                    <a-col span="7" offset="1">
-                      <a-form-model-item prop="dealerCitySn" style="margin: 0;">
-                        <a-select v-model="queryParam.dealerCitySn" allowClear @change="getAreaList" placeholder="请选择市">
-                          <a-select-option v-for="item in addrCityList" :value="item.id" :key="item.id + 'b'">{{ item.name }}</a-select-option>
-                        </a-select>
-                      </a-form-model-item>
-                    </a-col>
-                    <a-col span="7" offset="1">
-                      <a-form-model-item prop="dealerCountySn" style="margin: 0;">
-                        <a-select v-model="queryParam.dealerCountySn" allowClear placeholder="请选择区/县">
-                          <a-select-option v-for="item in addrDistrictList" :value="item.id" :key="item.id + 'c'">{{ item.name }}</a-select-option>
-                        </a-select>
-                      </a-form-model-item>
-                    </a-col>
-                  </a-form-model-item>
-                </a-row>
+              <a-col :md="6" :sm="24">
+                <a-form-model-item label="地区">
+                    <AreaList id="salesReturnsReportList-areaList" changeOnSelect ref="areaList" @change="areaChange" defValKey="id"></AreaList>
+                </a-form-model-item>
               </a-col>
             </template>
             <a-col :md="8" :sm="24" style="margin-bottom: 10px;">
@@ -134,13 +112,13 @@ import rangeDate from '@/views/common/rangeDate.vue'
 import subarea from '@/views/common/subarea.js'
 import custList from '@/views/common/custList.vue'
 import reportModal from '@/views/common/reportModal.vue'
-import { getArea } from '@/api/data'
+import AreaList from '@/views/common/areaList.js'
 import { hdExportExcel } from '@/libs/exportExcel'
 import { reportSalesReturnList, reportSalesReturnCount, salesReturnsExport } from '@/api/reportData'
 export default {
   name: 'SalesReturnsReportList',
   mixins: [commonMixin],
-  components: { STable, VSelect, rangeDate, subarea, custList, reportModal },
+  components: { STable, VSelect, rangeDate, subarea, custList, reportModal, AreaList },
   data () {
     return {
       spinning: false,
@@ -188,10 +166,7 @@ export default {
           return data
         })
       },
-      totalData: null,
-      addrProvinceList: [], //  省下拉
-      addrCityList: [], //  市下拉
-      addrDistrictList: [] //  区下拉
+      totalData: null
     }
   },
   computed: {
@@ -278,6 +253,7 @@ export default {
         if (valid) {
           _this.$refs.table.refresh(true)
         } else {
+          _this.$message.error("请选择退货完成日期")
           return false
         }
       })
@@ -313,71 +289,26 @@ export default {
       this.queryParam.dealerCountySn = undefined
       if (this.advanced) {
         this.$refs.custList.resetForm()
+        this.$refs.areaList.clearData()
       }
       this.totalData = null
       this.$refs.ruleForm.resetFields()
       this.$refs.table.clearTable()
     },
-    // 获取城市列表
-    getCityList (val) {
-      this.addrCityList = []
-      this.addrDistrictList = []
-      this.queryParam.dealerCitySn = undefined
-      this.queryParam.dealerCountySn = undefined
-      if (val) {
-        this.getArea('city', val)
-      }
-    },
-    // 获取区县列表
-    getAreaList (val) {
-      this.addrDistrictList = []
-      this.queryParam.dealerCountySn = undefined
-      if (val) {
-        this.getArea('district', val)
-      }
-    },
-    //  省/市/区
-    getArea (leve, sn) {
-      let params
-      if (leve == 'province') {
-        params = { type: '2' }
-      } else {
-        params = { parentId: sn, type: leve == 'city' ? '3' : '4' }
-      }
-      getArea(params).then(res => {
-        if (res.status == 200) {
-          if (leve == 'province') {
-            this.addrProvinceList = res.data || []
-          } else if (leve == 'city') {
-            this.addrCityList = res.data || []
-          } else if (leve == 'district') {
-            this.addrDistrictList = res.data || []
-          }
-        } else {
-          if (leve == 'province') {
-            this.addrProvinceList = []
-          } else if (leve == 'city') {
-            this.addrCityList = []
-          } else if (leve == 'district') {
-            this.addrDistrictList = []
-          }
-        }
-      })
-    },
-    pageInit () {
-      this.getArea('province')
+    areaChange(val){
+      this.queryParam.dealerProvinceSn = val[0] ? val[0] : ''
+      this.queryParam.dealerCitySn = val[1] ? val[1] : ''
+      this.queryParam.dealerCountySn = val[2] ? val[2] : ''
     }
   },
   mounted () {
     if (!this.$store.state.app.isNewTab) { // 页签刷新时调用
-      this.pageInit()
       this.resetSearchForm()
     }
   },
   activated () {
     // 如果是新页签打开,则重置当前页面
     if (this.$store.state.app.isNewTab) {
-      this.pageInit()
       this.resetSearchForm()
     }
   },

+ 15 - 76
src/views/reportData/salesSlipReport/list.vue

@@ -44,26 +44,10 @@
                   <subarea id="salesSlipReportList-allocateTypeSn" v-model="queryParam.dealer.subareaSn"></subarea>
                 </a-form-model-item>
               </a-col>
-              <a-col :md="12" :sm="24">
-                <a-row>
-                  <a-form-model-item label="地区" >
-                    <a-col span="7">
-                      <a-select v-model="queryParam.dealer.provinceSn" allowClear @change="getCityList" placeholder="请选择省">
-                        <a-select-option v-for="item in addrProvinceList" :value="item.id" :key="item.id + 'a'">{{ item.name }}</a-select-option>
-                      </a-select>
-                    </a-col>
-                    <a-col span="7" offset="1">
-                      <a-select v-model="queryParam.dealer.citySn" allowClear @change="getAreaList" placeholder="请选择市">
-                        <a-select-option v-for="item in addrCityList" :value="item.id" :key="item.id + 'b'">{{ item.name }}</a-select-option>
-                      </a-select>
-                    </a-col>
-                    <a-col span="7" offset="1">
-                      <a-select v-model="queryParam.dealer.districtSn" allowClear placeholder="请选择区/县">
-                        <a-select-option v-for="item in addrDistrictList" :value="item.id" :key="item.id + 'c'">{{ item.name }}</a-select-option>
-                      </a-select>
-                    </a-col>
-                  </a-form-model-item>
-                </a-row>
+              <a-col :md="6" :sm="24">
+                <a-form-model-item label="地区">
+                    <AreaList id="salesSlipReportList-areaList" changeOnSelect ref="areaList" @change="areaChange" defValKey="id"></AreaList>
+                </a-form-model-item>
               </a-col>
             </template>
             <a-col :md="24" :sm="24" style="text-align:center;">
@@ -147,14 +131,14 @@ import rangeDate from '@/views/common/rangeDate.vue'
 import custList from '@/views/common/custList.vue'
 import subarea from '@/views/common/subarea.js'
 import reportModal from '@/views/common/reportModal.vue'
-import { getArea } from '@/api/data'
+import AreaList from '@/views/common/areaList.js'
 import { hdExportExcel } from '@/libs/exportExcel'
 import { salesBillReportList, salesBillReportCount } from '@/api/salesBillReport'
 import { salesSlipExport } from '@/api/reportData'
 export default {
   name: 'SalesSlipReportList',
   mixins: [commonMixin],
-  components: { STable, VSelect, rangeDate, subarea, custList, reportModal },
+  components: { STable, VSelect, rangeDate, subarea, custList, reportModal, AreaList },
   data () {
     return {
       spinning: false,
@@ -206,10 +190,7 @@ export default {
           return data
         })
       },
-      totalData: null,
-      addrProvinceList: [], //  省下拉
-      addrCityList: [], //  市下拉
-      addrDistrictList: [] //  区下拉
+      totalData: null
     }
   },
   computed: {
@@ -466,6 +447,7 @@ export default {
         if (valid) {
           _this.$refs.table.refresh(true)
         } else {
+          _this.$message.error("请选择销售日期")
           return false
         }
       })
@@ -502,70 +484,27 @@ export default {
         'dealerLevel': undefined
       }
       this.totalData = null
+      if(this.advanced){
+        this.$refs.areaList.clearData()
+      }
       this.$refs.custList.resetForm()
       this.$refs.ruleForm.resetFields()
       this.$refs.table.clearTable()
     },
-    // 获取城市列表
-    getCityList (val) {
-      this.addrCityList = []
-      this.addrDistrictList = []
-      this.queryParam.dealer.citySn = undefined
-      this.queryParam.dealer.districtSn = undefined
-      if (val) {
-        this.getArea('city', val)
-      }
-    },
-    // 获取区县列表
-    getAreaList (val) {
-      this.addrDistrictList = []
-      this.queryParam.dealer.districtSn = undefined
-      if (val) {
-        this.getArea('district', val)
-      }
+    areaChange(val){
+      this.queryParam.dealer.provinceSn = val[0] ? val[0] : ''
+      this.queryParam.dealer.citySn = val[1] ? val[1] : ''
+      this.queryParam.dealer.districtSn = val[2] ? val[2] : ''
     },
-    //  省/市/区
-    getArea (leve, sn) {
-      let params
-      if (leve == 'province') {
-        params = { type: '2' }
-      } else {
-        params = { parentId: sn, type: leve == 'city' ? '3' : '4' }
-      }
-      getArea(params).then(res => {
-        if (res.status == 200) {
-          if (leve == 'province') {
-            this.addrProvinceList = res.data || []
-          } else if (leve == 'city') {
-            this.addrCityList = res.data || []
-          } else if (leve == 'district') {
-            this.addrDistrictList = res.data || []
-          }
-        } else {
-          if (leve == 'province') {
-            this.addrProvinceList = []
-          } else if (leve == 'city') {
-            this.addrCityList = []
-          } else if (leve == 'district') {
-            this.addrDistrictList = []
-          }
-        }
-      })
-    },
-    pageInit () {
-      this.getArea('province')
-    }
   },
   mounted () {
     if (!this.$store.state.app.isNewTab) { // 页签刷新时调用
-      this.pageInit()
       this.resetSearchForm()
     }
   },
   activated () {
     // 如果是新页签打开,则重置当前页面
     if (this.$store.state.app.isNewTab) {
-      this.pageInit()
       this.resetSearchForm()
     }
   },

+ 5 - 45
src/views/reportData/transferReturnDetailReport/list.vue

@@ -49,9 +49,7 @@
             </a-col>
             <a-col :md="4" :sm="24">
               <a-form-model-item label="所在省份">
-                <a-select v-model="queryParam.provinceSn" allowClear placeholder="请选择省">
-                  <a-select-option v-for="item in addrProvinceList" :value="item.id" :key="item.id + 'a'">{{ item.name }}</a-select-option>
-                </a-select>
+                <Area id="allocateReturnDetailReport-provinceSn" defValKey="id" v-model="queryParam.provinceSn" placeholder="请选择省"></Area>
               </a-form-model-item>
             </a-col>
             <template v-if="advanced">
@@ -91,12 +89,6 @@
               </a-col>
             </template>
             <a-col :md="8" :sm="24" style="margin-bottom: 10px;">
-              <!-- <a-button
-                type="primary"
-                class="button-info"
-                size="small"
-                @click="handleStock"
-                id="allocateReturnDetailReport-stockDate">盘点区间日期</a-button> -->
               <a-button style="margin-left: 5px" type="primary" @click="handleSearch" :disabled="disabled" id="allocateReturnDetailReport-refresh">查询</a-button>
               <a-button style="margin-left: 8px" @click="resetSearchForm" :disabled="disabled" id="allocateReturnDetailReport-reset">重置</a-button>
               <a-button
@@ -160,7 +152,7 @@ import rangeDate from '@/views/common/rangeDate.vue'
 import subarea from '@/views/common/subarea.js'
 import reportModal from '@/views/common/reportModal.vue'
 import AllocateType from '@/views/common/allocateType.js'
-import { getArea } from '@/api/data'
+import Area from '@/views/common/area.js'
 import { productTypeQuery } from '@/api/productType'
 import ProductBrand from '@/views/common/productBrand.js'
 import { hdExportExcel } from '@/libs/exportExcel'
@@ -168,7 +160,7 @@ import { allocateReturnReportDetailQueryPage, allocateReturnReportDetailQueryCou
 export default {
   name: 'TransferReturnDetailReportList',
   mixins: [commonMixin],
-  components: { STable, VSelect, rangeDate, subarea, ProductBrand, reportModal, AllocateType },
+  components: { STable, VSelect, rangeDate, subarea, Area, ProductBrand, reportModal, AllocateType },
   data () {
     return {
       spinning: false,
@@ -240,9 +232,6 @@ export default {
         })
       },
       totalData: null,
-      addrProvinceList: [], //  省下拉
-      addrCityList: [], //  市下拉
-      addrDistrictList: [], //  区下拉
       productTypeList: [], //  分类下拉数据
       allocateTypeVal: []
     }
@@ -306,6 +295,7 @@ export default {
         if (valid) {
           _this.$refs.table.refresh(true)
         } else {
+          _this.$message.error("请选择退货完成日期")
           return false
         }
       })
@@ -394,50 +384,20 @@ export default {
         }
       })
     },
-    //  省/市/区
-    getArea (leve, sn) {
-      let params
-      if (leve == 'province') {
-        params = { type: '2' }
-      } else {
-        params = { parentId: sn, type: leve == 'city' ? '3' : '4' }
-      }
-      getArea(params).then(res => {
-        if (res.status == 200) {
-          if (leve == 'province') {
-            this.addrProvinceList = res.data || []
-          } else if (leve == 'city') {
-            this.addrCityList = res.data || []
-          } else if (leve == 'district') {
-            this.addrDistrictList = res.data || []
-          }
-        } else {
-          if (leve == 'province') {
-            this.addrProvinceList = []
-          } else if (leve == 'city') {
-            this.addrCityList = []
-          } else if (leve == 'district') {
-            this.addrDistrictList = []
-          }
-        }
-      })
-    },
     pageInit () {
       this.getProductType()
-      this.getArea('province')
+      this.resetSearchForm()
     }
   },
   mounted () {
     if (!this.$store.state.app.isNewTab) { // 页签刷新时调用
       this.pageInit()
-      this.resetSearchForm()
     }
   },
   activated () {
     // 如果是新页签打开,则重置当前页面
     if (this.$store.state.app.isNewTab) {
       this.pageInit()
-      this.resetSearchForm()
     }
   },
   beforeRouteEnter (to, from, next) {

+ 1 - 6
src/views/reportData/transferReturnReport/list.vue

@@ -50,12 +50,6 @@
               </a-col>
             </template>
             <a-col :md="6" :sm="24" style="margin-bottom: 10px;">
-              <!-- <a-button
-                type="primary"
-                class="button-info"
-                size="small"
-                @click="handleStock"
-                id="allocateReturnReport-stockDate">盘点区间日期</a-button> -->
               <a-button style="margin-left: 5px" type="primary" @click="handleSearch" :disabled="disabled" id="allocateReturnReport-refresh">查询</a-button>
               <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="allocateReturnReport-reset">重置</a-button>
               <a-button
@@ -248,6 +242,7 @@ export default {
         if (valid) {
           _this.$refs.table.refresh(true)
         } else {
+          _this.$message.error("请选择退货完成日期")
           return false
         }
       })

+ 15 - 161
src/views/reportData/urchaseDetailReturn/detailList.vue

@@ -58,51 +58,10 @@
                   <v-select code="BRAND_TYPE" id="urchaseDetailReturn-productBrandTypeSn" v-model="queryParam.product.brandType" allowClear placeholder="请选择品牌分类"></v-select>
                 </a-form-model-item>
               </a-col>
-              <!-- <a-col :md="6" :sm="24">
-                <a-form-model-item label="产品分类">
-                  <a-cascader
-                    @change="changeProductType"
-                    expand-trigger="hover"
-                    change-on-select
-                    :options="productTypeList"
-                    :fieldNames="{ label: 'productTypeName', value: 'productTypeSn', children: 'children' }"
-                    id="salesReturnDetailList-productType"
-                    placeholder="请选择产品分类"
-                    allowClear
-                    v-model="productType" />
-                </a-form-model-item>
-              </a-col> -->
-              <!-- <a-col :md="6" :sm="24">
-                <a-form-model-item label="所在区域">
-                  <subarea id="salesReturnDetailList-subareaSn" v-model="queryParam.subareaSn"></subarea>
+              <a-col :md="6" :sm="24">
+                <a-form-model-item label="地区">
+                    <AreaList id="salesSlipReportList-areaList" changeOnSelect ref="areaList" @change="areaChange" defValKey="id"></AreaList>
                 </a-form-model-item>
-              </a-col> -->
-              <a-col :md="12" :sm="24">
-                <a-row>
-                  <a-form-model-item label="地区">
-                    <a-col span="7">
-                      <a-form-model-item prop="provinceSn" style="margin: 0;">
-                        <a-select v-model="queryParam.supplier.provinceSn" allowClear @change="getCityList" placeholder="请选择省">
-                          <a-select-option v-for="item in addrProvinceList" :value="item.id" :key="item.id + 'a'">{{ item.name }}</a-select-option>
-                        </a-select>
-                      </a-form-model-item>
-                    </a-col>
-                    <a-col span="7" offset="1">
-                      <a-form-model-item prop="citySn" style="margin: 0;">
-                        <a-select v-model="queryParam.supplier.citySn" allowClear @change="getAreaList" placeholder="请选择市">
-                          <a-select-option v-for="item in addrCityList" :value="item.id" :key="item.id + 'b'">{{ item.name }}</a-select-option>
-                        </a-select>
-                      </a-form-model-item>
-                    </a-col>
-                    <a-col span="7" offset="1">
-                      <a-form-model-item prop="districtSn" style="margin: 0;">
-                        <a-select v-model="queryParam.supplier.districtSn" allowClear placeholder="请选择区/县">
-                          <a-select-option v-for="item in addrDistrictList" :value="item.id" :key="item.id + 'c'">{{ item.name }}</a-select-option>
-                        </a-select>
-                      </a-form-model-item>
-                    </a-col>
-                  </a-form-model-item>
-                </a-row>
               </a-col>
             </template>
             <a-col :md="6" :sm="24" style="margin-bottom: 10px;">
@@ -151,39 +110,7 @@
           </span>
           <span v-else>--</span>
         </template>
-        <!-- <template slot="footer" v-if="totalData && $hasPermissions('M_urchaseDetailReturnList_costPrice')">
-          <a-row>
-            <a-col span="2">合计:</a-col>
-            <a-col span="22">
-              <a-row>
-                <a-col span="4" v-if="totalData && totalData.jpLqqAmount">箭牌滤清器:{{ totalData.jpLqqAmount }}</a-col>
-                <a-col span="4" v-if="totalData && totalData.jpBsxLqqAmount">箭牌变速箱滤清器:{{ totalData.jpBsxLqqAmount }}</a-col>
-                <a-col span="4" v-if="totalData && totalData.jpYgpAmount">箭牌雨刮片:{{ totalData.jpYgpAmount }}</a-col>
-                <a-col span="4" v-if="totalData && totalData.jpLbAmount">箭牌喇叭:{{ totalData.jpLbAmount }}</a-col>
-                <a-col span="4" v-if="totalData && totalData.jpScpAmount">箭牌刹车片:{{ totalData.jpScpAmount }}</a-col>
-                <a-col span="4" v-if="totalData && totalData.jpGyxAmount">箭牌感应线:{{ totalData.jpGyxAmount }}</a-col>
-                <a-col span="4" v-if="totalData && totalData.gpLqqAmount">冠牌滤清器:{{ totalData.gpLqqAmount }}</a-col>
-                <a-col span="4" v-if="totalData && totalData.gpYgpAmount">冠牌雨刮片:{{ totalData.gpYgpAmount }}</a-col>
-                <a-col span="4" v-if="totalData && totalData.gpScpAmount">冠牌刹车片:{{ totalData.gpScpAmount }}</a-col>
-                <a-col span="4" v-if="totalData && totalData.wsDhxqAmount">稳升点火线圈:{{ totalData.wsDhxqAmount }}</a-col>
-                <a-col span="4" v-if="totalData && totalData.wsDpAmount">稳升灯泡:{{ totalData.wsDpAmount }}</a-col>
-                <a-col span="4" v-if="totalData && totalData.hjAmount">汇箭:{{ totalData.hjAmount }}</a-col>
-                <a-col span="4" v-if="totalData && totalData.dlsAmount">德路斯:{{ totalData.dlsAmount }}</a-col>
-                <a-col span="4" v-if="totalData && totalData.tbuAmount">TBU:{{ totalData.tbuAmount }}</a-col>
-                <a-col span="4" v-if="totalData && totalData.tbupAmount">TBU-P:{{ totalData.tbupAmount }}</a-col>
-                <a-col span="4" v-if="totalData && totalData.brsAmount">布瑞斯:{{ totalData.brsAmount }}</a-col>
-                <a-col span="4" v-if="totalData && totalData.ngkAmount">NGK:{{ totalData.ngkAmount }}</a-col>
-                <a-col span="4" v-if="totalData && totalData.flpAmount">飞利浦:{{ totalData.flpAmount }}</a-col>
-                <a-col span="4" v-if="totalData && totalData.cpAmount">车仆:{{ totalData.cpAmount }}</a-col>
-                <a-col span="4" v-if="totalData && totalData.wetAmount">瓦尔塔:{{ totalData.wetAmount }}</a-col>
-                <a-col span="4" v-if="totalData && totalData.lbstAmount">雷贝斯托:{{ totalData.lbstAmount }}</a-col>
-                <a-col span="4" v-if="totalData && totalData.defAmount">德尔福:{{ totalData.defAmount }}</a-col>
-                <a-col span="4" v-if="totalData && totalData.bndAmount">巴诺德:{{ totalData.bndAmount }}</a-col>
-                <a-col span="6" v-if="totalData && totalData.totalAmount">实售销售合计金额:{{ totalData.totalAmount }}</a-col>
-              </a-row>
-            </a-col>
-          </a-row>
-        </template> -->
+         
         <template slot="footer">
           <a-row :gutter="15">
             <a-col :md="4" :sm="24">申请退货数量:{{ (totalData && (totalData.qty || totalData.qty==0)) ? totalData.qty : '--' }}</a-col>
@@ -202,19 +129,16 @@ import { commonMixin } from '@/utils/mixin'
 import getDate from '@/libs/getDate.js'
 import { STable, VSelect } from '@/components'
 import rangeDate from '@/views/common/rangeDate.vue'
-// import subarea from '@/views/common/subarea.js'
 import supplier from '@/views/common/supplier.js'
 import reportModal from '@/views/common/reportModal.vue'
-import { getArea } from '@/api/data'
-import { productBrandQuery } from '@/api/productBrand'
-import { productTypeQuery } from '@/api/productType'
+import AreaList from '@/views/common/areaList.js'
 import ProductBrand from '@/views/common/productBrand.js'
 import { hdExportExcel } from '@/libs/exportExcel'
 import { sparePartsReturnDetailReportList, sparePartsReturnDetailReportStat, sparePartsReturnReportExportDetail } from '@/api/reportData'
 export default {
   name: 'UrchaseDetailReturnList',
   mixins: [commonMixin],
-  components: { STable, VSelect, rangeDate, supplier, ProductBrand, reportModal },
+  components: { STable, VSelect, rangeDate, supplier, ProductBrand, reportModal, AreaList },
   data () {
     return {
       spinning: false,
@@ -244,7 +168,6 @@ export default {
           districtSn: undefined
         }
       },
-      // productType: [],
       rules: {
         'time': [{ required: true, message: '请选择退货完成日期', trigger: 'change' }]
       },
@@ -267,12 +190,7 @@ export default {
           return data
         })
       },
-      totalData: null,
-      addrProvinceList: [], //  省下拉
-      addrCityList: [], //  市下拉
-      addrDistrictList: [], //  区下拉
-      productBrandList: [], //  品牌下拉数据
-      productTypeList: [] //  分类下拉数据
+      totalData: null
     }
   },
   computed: {
@@ -331,6 +249,7 @@ export default {
           }
           _this.$refs.table.refresh(true)
         } else {
+          _this.$message.error("请选择退货完成日期")
           return false
         }
       })
@@ -366,6 +285,9 @@ export default {
       this.queryParam.supplier.citySn = undefined
       this.queryParam.supplier.districtSn = undefined
       this.totalData = null
+      if(this.advanced){
+        this.$refs.areaList.clearData()
+      }
       this.$refs.ruleForm.resetFields()
       this.$refs.table.clearTable()
     },
@@ -389,88 +311,20 @@ export default {
         }
       })
     },
-    //  产品品牌  列表
-    getProductBrand () {
-      productBrandQuery({}).then(res => {
-        if (res.status == 200) {
-          this.productBrandList = res.data
-        } else {
-          this.productBrandList = []
-        }
-      })
-    },
-    //  产品分类  列表
-    getProductType () {
-      productTypeQuery({}).then(res => {
-        if (res.status == 200) {
-          this.productTypeList = res.data
-        } else {
-          this.productTypeList = []
-        }
-      })
-    },
-    // 获取城市列表
-    getCityList (val) {
-      this.addrCityList = []
-      this.addrDistrictList = []
-      this.queryParam.dealerCitySn = undefined
-      this.queryParam.dealerCountySn = undefined
-      if (val) {
-        this.getArea('city', val)
-      }
-    },
-    // 获取区县列表
-    getAreaList (val) {
-      this.addrDistrictList = []
-      this.queryParam.dealerCountySn = undefined
-      if (val) {
-        this.getArea('district', val)
-      }
-    },
-    //  省/市/区
-    getArea (leve, sn) {
-      let params
-      if (leve == 'province') {
-        params = { type: '2' }
-      } else {
-        params = { parentId: sn, type: leve == 'city' ? '3' : '4' }
-      }
-      getArea(params).then(res => {
-        if (res.status == 200) {
-          if (leve == 'province') {
-            this.addrProvinceList = res.data || []
-          } else if (leve == 'city') {
-            this.addrCityList = res.data || []
-          } else if (leve == 'district') {
-            this.addrDistrictList = res.data || []
-          }
-        } else {
-          if (leve == 'province') {
-            this.addrProvinceList = []
-          } else if (leve == 'city') {
-            this.addrCityList = []
-          } else if (leve == 'district') {
-            this.addrDistrictList = []
-          }
-        }
-      })
-    },
-    pageInit () {
-      this.getProductBrand()
-      this.getProductType()
-      this.getArea('province')
+    areaChange(val){
+      this.queryParam.supplier.provinceSn = val[0] ? val[0] : ''
+      this.queryParam.supplier.citySn = val[1] ? val[1] : ''
+      this.queryParam.supplier.districtSn = val[2] ? val[2] : ''
     }
   },
   mounted () {
     if (!this.$store.state.app.isNewTab) { // 页签刷新时调用
-      this.pageInit()
       this.resetSearchForm()
     }
   },
   activated () {
     // 如果是新页签打开,则重置当前页面
     if (this.$store.state.app.isNewTab) {
-      this.pageInit()
       this.resetSearchForm()
     }
   },

+ 1 - 0
src/views/reportData/urchaseReturn/list.vue

@@ -205,6 +205,7 @@ export default {
         if (valid) {
           _this.$refs.table.refresh(true)
         } else {
+          _this.$message.error("请选择退货完成日期")
           return false
         }
       })

+ 3 - 1
src/views/reportData/warehousingOrder/list.vue

@@ -82,7 +82,8 @@
         class="sTable"
         ref="table"
         size="small"
-        :rowKey="(record) => record.id"
+        :rowKey="(record) => record.no"
+        rowKeyName = 'no'
         :columns="columns"
         :data="loadData"
         :defaultLoadData="false"
@@ -198,6 +199,7 @@ export default {
         if (valid) {
           _this.$refs.table.refresh(true)
         } else {
+          _this.$message.error('请选择完成日期')
           return false
         }
       })

+ 3 - 1
src/views/reportData/warehousingOrderDetail/list.vue

@@ -92,7 +92,8 @@
         class="sTable"
         ref="table"
         size="small"
-        :rowKey="(record) => record.id"
+        :rowKey="(record) => record.no"
+        rowKeyName = 'no'
         :columns="columns"
         :data="loadData"
         :defaultLoadData="false"
@@ -215,6 +216,7 @@ export default {
         if (valid) {
           _this.$refs.table.refresh(true)
         } else {
+          _this.$message.error('请选择完成日期')
           return false
         }
       })