lilei 2 years ago
parent
commit
db8b0d2c1d

+ 13 - 83
src/views/common/chooseCustomerModal.vue

@@ -14,37 +14,15 @@
         <div class="table-page-search-wrapper">
           <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
             <a-row :gutter="15">
-              <a-col :md="6" :sm="24">
+              <a-col :md="8" :sm="24">
                 <a-form-item label="客户名称">
                   <a-input id="chooseCustomer-dealerName" v-model.trim="queryParam.dealerName" allowClear placeholder="请输入客户名称"/>
                 </a-form-item>
               </a-col>
-              <a-col :md="12" :sm="24">
-                <a-row>
-                  <a-form-item label="地区">
-                    <a-col span="7">
-                      <a-form-item prop="provinceSn" style="margin: 0;">
-                        <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-form-item>
-                    </a-col>
-                    <a-col span="7" offset="1">
-                      <a-form-item prop="citySn" style="margin: 0;">
-                        <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-form-item>
-                    </a-col>
-                    <a-col span="7" offset="1">
-                      <a-form-item prop="districtSn" style="margin: 0;">
-                        <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-form-item>
-                    </a-col>
-                  </a-form-item>
-                </a-row>
+              <a-col :md="8" :sm="24">
+                <a-form-model-item label="地区">
+                    <AreaList id="chooseCustomer-areaList" changeOnSelect ref="areaList" @change="areaChange" defValKey="id"></AreaList>
+                </a-form-model-item>
               </a-col>
               <a-col :md="6" :sm="24" style="margin-bottom: 10px;">
                 <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="promotionRulesList-refresh">查询</a-button>
@@ -91,11 +69,11 @@
 
 <script>
 import { STable } from '@/components'
-import { getArea } from '@/api/data'
+import AreaList from '@/views/common/areaList.js'
 import { dealerQueryList } from '@/api/dealer'
 export default {
   name: 'ChooseCustomerModal',
-  components: { STable },
+  components: { STable, AreaList },
   props: {
     openModal: { //  弹框显示状态
       type: Boolean,
@@ -141,9 +119,6 @@ export default {
           return data
         })
       },
-      addrProvinceList: [], //  省下拉
-      addrCityList: [], //  市下拉
-      addrDistrictList: [], //  区下拉
       rowSelectionInfo: null
     }
   },
@@ -162,8 +137,12 @@ export default {
       this.queryParam.provinceSn = undefined
       this.queryParam.citySn = undefined
       this.queryParam.districtSn = undefined
-      this.addrCityList = []
-      this.addrDistrictList = []
+      this.$refs.areaList.clearData()
+    },
+    areaChange(val){
+      this.queryParam.provinceSn = val[0] ? val[0] : ''
+      this.queryParam.citySn = val[1] ? val[1] : ''
+      this.queryParam.districtSn = val[2] ? val[2] : ''
     },
     //  确定
     handleSubmit () {
@@ -174,52 +153,6 @@ export default {
       this.$emit('ok', this.rowSelectionInfo && this.rowSelectionInfo.selectedRowKeys)
       this.isShow = false
     },
-    // 获取城市列表
-    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 = []
-          }
-        }
-      })
-    }
   },
   watch: {
     //  父页面传过来的弹框状态
@@ -232,9 +165,6 @@ export default {
         this.$emit('close')
         this.resetData()
       } else {
-        if (this.addrProvinceList.length == 0) {
-          this.getArea('province')
-        }
         const _this = this
         this.$nextTick(() => { // 页面渲染完成后的回调
           _this.$refs.table.refresh(true)

+ 2 - 4
src/views/dealerManagement/marketingDivisionSetNew/addAreaModal.vue

@@ -40,12 +40,10 @@
 
 <script>
 import { STable, Upload } from '@/components'
-import Editor from '@/components/WEeditor'
-import { getArea } from '@/api/data'
-import { subareaSaveSubareaArea, subareaFindBySn } from '@/api/subarea'
+import { subareaSaveSubareaArea } from '@/api/subarea'
 export default {
   name: 'MarketingDivisionSetEditModal',
-  components: { STable, Upload, Editor },
+  components: { STable, Upload },
   props: {
     openModal: { //  弹框显示状态
       type: Boolean,

+ 2 - 5
src/views/dealerManagement/marketingDivisionSetNew/addZoneModal.vue

@@ -36,13 +36,10 @@
 </template>
 
 <script>
-import { STable, Upload } from '@/components'
-import Editor from '@/components/WEeditor'
-import { getArea } from '@/api/data'
-import { subareaSaveSubareaArea, subareaFindBySn } from '@/api/subarea'
+import { subareaSaveSubareaArea } from '@/api/subarea'
 export default {
   name: 'MarketingDivisionSetEditModal',
-  components: { STable, Upload, Editor },
+  components: { },
   props: {
     openModal: { //  弹框显示状态
       type: Boolean,

+ 4 - 56
src/views/reportData/allCountryCostReport/list.vue

@@ -23,9 +23,7 @@
             </a-col>
             <a-col :md="6" :sm="24" v-if="activeKey == 0">
               <a-form-model-item prop="dealerProvinceSn" style="margin: 0;" label="地区">
-                <a-select v-model="queryParam.dealer.provinceSn" 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-shippingAddrProvinceSn" v-model="queryParam.dealer.provinceSn" placeholder="请选择省"></Area>
               </a-form-model-item>
             </a-col>
             <a-col :md="6" :sm="24">
@@ -96,15 +94,14 @@ import { commonMixin } from '@/utils/mixin'
 import { STable, VSelect } from '@/components'
 import rangeDate from '@/views/common/rangeDate.vue'
 import reportModal from '@/views/common/reportModal.vue'
-import { getArea } from '@/api/data'
+import Area from '@/views/common/area.js'
 import subarea from '@/views/common/subarea.js'
-import { reportSalesReturnThjdReportList } from '@/api/reportData'
 import moment from 'moment'
 import reportData from '@/libs/reportData.js'
 export default {
   name: 'AllCountryCostReportList',
   mixins: [commonMixin],
-  components: { STable, VSelect, rangeDate, subarea, moment, reportModal },
+  components: { STable, VSelect, rangeDate, subarea, Area, moment, reportModal },
   data () {
     return {
       spinning: false,
@@ -148,22 +145,6 @@ export default {
           _this.disabled = false
           resolve(data)
         })
-
-        // const paramsPage = Object.assign(this.queryParam) //  有分页
-        // return reportSalesReturnThjdReportList(paramsPage).then(res => {
-        //   let data
-        //   if (res.status == 200) {
-        //     data = res.data
-        //     // this.getCount(paramsPage)
-        //     const no = (data.pageNo - 1) * data.pageSize
-        //     for (var i = 0; i < data.list.length; i++) {
-        //       data.list[i].no = no + i + 1
-        //     }
-        //     this.disabled = false
-        //   }
-        //   this.spinning = false
-        //   return data
-        // })
       },
       totalData: null
     }
@@ -451,37 +432,6 @@ export default {
       console.log(currentDate)
       return currentDate && currentDate < moment().endOf('year')
     },
-    // 分页
-
-    // 查询省
-    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]) {
@@ -566,7 +516,5 @@ export default {
 </script>
 
 <style style="less">
-  .regionTypeSalesReportList-wrap{
-
-  }
+   
 </style>

+ 3 - 34
src/views/salesManagement/salesQuery/list.vue

@@ -78,9 +78,7 @@
               <a-col :md="6" :sm="24">
                 <a-form-model-item label="地区">
                   <a-form-model-item prop="shippingAddrProvinceSn">
-                    <a-select id="salesManagementList-shippingAddrProvinceSn" allowClear v-model="queryParam.shippingAddrProvinceSn" 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="salesManagementList-shippingAddrProvinceSn" v-model="queryParam.shippingAddrProvinceSn" placeholder="请选择省"></Area>
                   </a-form-model-item>
                 </a-form-model-item>
               </a-col>
@@ -257,7 +255,7 @@ import { commonMixin } from '@/utils/mixin'
 import moment from 'moment'
 import getDate from '@/libs/getDate.js'
 import subarea from '@/views/common/subarea.js'
-import { getArea } from '@/api/data'
+import Area from '@/views/common/area.js'
 import rangeDate from '@/views/common/rangeDate.vue'
 import { STable, VSelect } from '@/components'
 import commonModal from '@/views/common/commonModal.vue'
@@ -271,7 +269,7 @@ import { salesDetailExport } from '@/api/salesBillReport'
 export default {
   name: 'SalesQueryList',
   mixins: [commonMixin],
-  components: { STable, VSelect, chooseCustomModal, dealerSubareaScopeList, rangeDate, subarea, commonModal, reportModal },
+  components: { STable, VSelect, chooseCustomModal, dealerSubareaScopeList, Area, rangeDate, subarea, commonModal, reportModal },
   data () {
     return {
       spinning: false,
@@ -338,7 +336,6 @@ export default {
           return data
         })
       },
-      addrProvinceList: [], //  省下拉
       showCancelNum: false, //  是否显示取消数量和待下推数量
       tipData: null, // 备货单信息
       tempSalesBillSn: null,
@@ -533,34 +530,6 @@ export default {
       this.queryParam.shippingAddrProvinceSn = undefined
       this.$refs.table.refresh(true)
     },
-    //  省/市/区
-    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 () {
       const _this = this
       this.$nextTick(() => { // 页面渲染完成后的回调