Browse Source

区域分区

lilei 2 years ago
parent
commit
3f01608b8b

+ 76 - 35
src/views/common/chooseDealer.vue

@@ -37,7 +37,7 @@
             </a-col>
           </div>
           <a-col :md="pageType!='viewDealers'?8:6" :sm="24" style="margin-bottom: 10px;">
-            <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="chooseDealer-refresh">查询</a-button>
+            <a-button type="primary" @click="searchForm(true)" :disabled="disabled" id="chooseDealer-refresh">查询</a-button>
             <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="chooseDealer-reset">重置</a-button>
           </a-col>
         </a-row>
@@ -46,7 +46,7 @@
       <div style="margin-bottom: 10px">
         <a-button type="primary" ghost :loading="loading" @click="handleBatchAudit">批量添加</a-button>
         <span style="margin-left: 5px">
-          <template v-if="rowSelectionInfo&&rowSelectionInfo.selectedRowKeys.length>0"> {{ `已选 ${rowSelectionInfo.selectedRowKeys.length} 项` }} </template>
+          <template v-if="selectCount"> {{ `已选 ${selectCount} 项` }} </template>
         </span>
       </div>
     </div>
@@ -54,9 +54,9 @@
       class="sTable"
       ref="table"
       size="small"
-      :rowKey="(record) => record.stockPutSn"
-      rowKeyName="stockPutSn"
-      :row-selection="$hasPermissions('B_warehousingConfirmationpl') ? { columnWidth: 40, getCheckboxProps: record => ({ props: { disabled: record.auditState != 'WAIT' } }) } : null"
+      :rowKey="(record) => record.dealerSn"
+      rowKeyName="dealerSn"
+      :row-selection="{ columnWidth: 40, getCheckboxProps: record => ({ props: { disabled: !!record.subareaAreaSn } }) }"
       @rowSelection="rowSelectionFun"
       :columns="columns"
       :data="loadData"
@@ -64,13 +64,19 @@
       :scroll="{ y: tableHeight }"
       :defaultLoadData="false"
       bordered>
+      <template slot="areas" slot-scope="text, record">
+        <span v-if="record.subareaNameSet">{{ record.subareaNameSet[0] }}</span>
+        <span v-else>--</span>
+      </template>
       <template slot="action" slot-scope="text, record">
         <a-button
           size="small"
           type="link"
           class="button-error"
           @click="handleAdd(record)"
+          v-if="record.subareaAreaSn != parentData.subareaAreaSn"
           id="marketingDivisionSetNew-del-btn">添加</a-button>
+        <span style="color:#666" v-else>已添加</span>
       </template>
     </s-table>
   </a-spin>
@@ -90,6 +96,12 @@ export default {
     pageType: {
       type: String,
       default: ''
+    },
+    parentData: {
+      type: Object,
+      default: function(){
+        return null
+      }
     }
   },
   data () {
@@ -97,22 +109,27 @@ export default {
       spinning: false,
       queryParam: { //  查询条件
         nameLike: '',
-        dealerType: undefined,
-        dealerLevel: undefined,
-        subareaSn: undefined
+        dealerType: null,
+        dealerLevel: null,
+        auditState: undefined,
+        provinceSn: undefined,
+        citySn: undefined,
+        districtSn: undefined
       },
       tableHeight: 0,
       disabled: false, //  查询、重置按钮是否可操作
       loading: false, // 批量添加loading
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
-        this.disabled = true
         this.spinning = true
         return queryDealerPageList(Object.assign(parameter, this.queryParam)).then(res => {
           let data
           if (res.status == 200) {
             data = res.data
-            this.disabled = false
+            const no = 0
+            for (var i = 0; i < data.length; i++) {
+              data[i].no = no + i + 1
+            }
           }
           this.spinning = false
           return data
@@ -125,20 +142,23 @@ export default {
     columns () {
       const _this = this
       const arr = [
-        { title: '经销商名称', dataIndex: 'putTime', width: '30%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '商户别名', dataIndex: 'providerName', align: 'left', width: '30%', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '商户类型', dataIndex: 'putBizTypeDictValue', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '商户级别', dataIndex: 'auditStateDictValue', width: '15%', align: 'center', customRender: function (text) { return text || '--' } }
+        { title: '经销商名称', dataIndex: 'dealerName', width: '30%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true  },
+        { title: '商户别名', dataIndex: 'dealerAlias', align: 'left', width: '30%', customRender: function (text) { return text || '--' }},
+        { title: '商户类型', dataIndex: 'dealerTypeDictValue', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '商户级别', dataIndex: 'dealerLevelDictValue', width: '15%', align: 'center', customRender: function (text) { return text || '--' } }
       ]
       if (_this.pageType == 'viewDealers') {
-        arr.splice(4, 0, { title: '审核状态', dataIndex: 'remark', width: '20%', align: 'left', customRender: function (text) { return text || '--' } })
-        arr.splice(5, 0, { title: '当前所属区域', dataIndex: 'remark', width: '20%', align: 'left', customRender: function (text) { return text || '--' } })
-        arr.splice(6, 0, { title: '操作', scopedSlots: { customRender: 'action' }, width: '30%', align: 'center' })
+        arr.splice(4, 0, { title: '审核状态', dataIndex: 'auditStateDictValue', width: '20%', align: 'center', customRender: function (text) { return text || '--' } })
+        arr.splice(5, 0, { title: '当前所属区域', scopedSlots: { customRender: 'areas' }, width: '30%', align: 'center' })
+        arr.splice(6, 0, { title: '操作', scopedSlots: { customRender: 'action' }, width: '20%', align: 'center' })
       } else {
-        arr.splice(4, 0, { title: '所在区域', dataIndex: 'remark', width: '20%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true })
-        arr.splice(5, 0, { title: '所在分区', dataIndex: 'remark', width: '20%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true })
+        arr.splice(4, 0, { title: '所在区域', dataIndex: 'subareaName', width: '20%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true })
+        arr.splice(5, 0, { title: '所在分区', dataIndex: 'subareaAreaName', width: '20%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true })
       }
       return arr
+    },
+    selectCount(){
+      return this.rowSelectionInfo && this.rowSelectionInfo.selectedRowKeys.length
     }
   },
   methods: {
@@ -151,10 +171,24 @@ export default {
       this.queryParam.citySn = val[1] ? val[1] : ''
       this.queryParam.districtSn = val[2] ? val[2] : ''
     },
+    searchForm(flag){
+      this.$refs.table.refresh(flag)
+      this.$refs.table.clearSelected()
+      this.spinning = false
+    },
     //  重置
     resetSearchForm () {
+      this.queryParam = {
+        nameLike: '',
+        dealerType: null,
+        dealerLevel: null,
+        auditState: undefined,
+        provinceSn: undefined,
+        citySn: undefined,
+        districtSn: undefined
+      }
       this.$refs.table.refresh(true)
-      this.rowSelectionInfo = null
+      this.$refs.table.clearSelected()
     },
     clearTable(){
       this.rowSelectionInfo = null
@@ -167,11 +201,26 @@ export default {
         _this.$message.warning('请在列表勾选后再进行批量操作!')
         return
       }
-      this.isBatch = true
-      this.confirmationModal = true
+      const dealerSnList = _this.rowSelectionInfo.selectedRowKeys
+      this.spinning = true
+      this.$emit("plAdd",dealerSnList)
     },
     handleAdd(row){
-
+      if(row.subareaNameSet&&row.subareaNameSet.length){
+        const _this = this
+        this.$confirm({
+          title: '提示',
+          content: '当前经销商已被其他区域分区绑定,确定要更新绑定关系吗?',
+          centered: true,
+          onOk () {
+            _this.spinning = true
+            _this.$emit("add", row)
+          }
+        })
+      }else{
+        this.spinning = true
+        this.$emit("add", row)
+      }
     },
     pageInit () {
       const _this = this
@@ -182,24 +231,16 @@ export default {
     },
     setTableH () {
       const tableSearchH = this.$refs.tableSearch.offsetHeight
-      this.tableHeight = window.innerHeight - tableSearchH - 165
+      this.tableHeight = window.innerHeight - tableSearchH - 245
     }
   },
+  mounted () {
+    this.pageInit()
+  },
   watch: {
     '$store.state.app.winHeight' (newValue, oldValue) { //  窗口变更时,需同时更改表格高度
       this.setTableH()
     }
-  },
-  mounted () {
-    if (!this.$store.state.app.isNewTab) { // 页签刷新时调用
-      this.resetSearchForm()
-    }
-  },
-  activated () {
-    this.pageInit()
-  },
-  beforeRouteEnter (to, from, next) {
-    next(vm => {})
   }
 }
 </script>

+ 57 - 52
src/views/common/subarea.js

@@ -1,26 +1,26 @@
 import { subareaQueryAll } from '@/api/subarea'
-const Subarea = {
+const AreaList = {
   template: `
-        <a-select
-          :id="id"
-          :placeholder="placeholder"
-          allowClear
-          :value="defaultVal"
-          :mode="mode"
-          :showSearch="true"
+     <a-cascader
+          :size="size"
+          :changeOnSelect="changeOnSelect"
+          :show-search="{ filter }"
           @change="handleChange"
-          :filter-option="filterOption">
-          <a-select-option v-for="item in list" :key="item[defValKey]" :value="item[defValKey]">{{ item.subareaName }}</a-select-option>
-        </a-select>
+          :value="defaultVal"
+          expand-trigger="hover"
+          :allowClear="allowClear"
+          :options="list"
+          :field-names="{ label: 'name', value: defValKey, children: 'subareaAreaList' }" 
+          :id="id"
+          :placeholder="placeholder" 
+          style="width: 100%;" />
     `,
   props: {
     value: {
-      type: [String,Array],
-      defatut: ''
-    },
-    mode: {
-      type: String,
-      default:'default'
+      type: Array,
+      defatut: function(){
+        return []
+      }
     },
     id: {
       type: String,
@@ -28,11 +28,23 @@ const Subarea = {
     },
     defValKey: {
       type: String,
-      default: 'subareaSn'
+      default: 'areaSn'
     },
     placeholder: {
       type: String,
-      default: '请选择分区'
+      default: '请选择区域/分区'
+    },
+    allowClear: {
+        type: Boolean,
+        default: true
+    },
+    size: {
+        type: String,
+        default: 'default'
+    },
+    changeOnSelect:{
+        type: Boolean,
+        default: true
     }
   },
   data() {
@@ -44,48 +56,41 @@ const Subarea = {
   watch: {
     value(newValue, oldValue) {
       this.defaultVal = newValue
-    }
+    },
   },
   mounted() {
-    this.getList()
+    this.getArea()
   },
   methods: {
-    filterOption (input, option) {
-      return (
-        option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
-      )
+    filter(inputValue, path) {
+        return path.some(option => option.name.toLowerCase().indexOf(inputValue.toLowerCase()) > -1);
     },
-    handleChange(value) {
-      console.log(value)
-      this.defaultVal = value;
-      const item = this.list.filter(item =>{
-        if(this.mode !== 'multiple'){
-          return item[this.defValKey] == value
-        }else{
-          return value.includes(item[this.defValKey])
-        }
-      })
-      this.$emit('change', value, item);
-      this.$emit('input', value);
+    handleChange (value, selectedOptions) {
+        this.defaultVal = value
+        this.$emit('input', this.defaultVal)
+        this.$emit('change', this.defaultVal, selectedOptions)
     },
-    // 列表数据
-    getList () {
-      const _this = this
+    getArea () {
       subareaQueryAll().then(res => {
-        if (res.status == 200) {
-          _this.list = res.data.reverse() || []
-        } else {
-          _this.list = []
-        }
-      })
+            if (res.status == 200) {
+                res.data&&res.data.map(item => {
+                  item.name = item.subareaName
+                  item.areaSn = item.subareaSn
+                  if(item.subareaAreaList){
+                    item.subareaAreaList.map(cd => {
+                      cd.name = cd.subareaAreaName
+                      cd.areaSn = cd.subareaAreaSn
+                    })
+                  }
+                })
+                this.list = res.data
+            }
+        })
     },
-    // 根据名称数组 返回对应的 sn 数组
-    getValByName(data){
-      let ret = []
-      this.list.filter(item => data.includes(item.subareaName)).map(item => ret.push(item.subareaSn))
-      return ret
+    clearData(){
+       this.handleChange([],null)
     }
   },
 };
 
-export default Subarea
+export default AreaList

+ 98 - 30
src/views/dealerManagement/marketingDivisionSetNew/viewDealers.vue

@@ -6,6 +6,7 @@
       :zIndex="100"
       :visible="visible"
       :get-container="false"
+      class="viewsDealer"
       :wrap-style="{ position: 'absolute' }"
       @close="visible = false">
       <a-spin :spinning="spinning" tip="Loading...">
@@ -39,7 +40,7 @@
               </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="viewDealers-refresh">查询</a-button>
+                <a-button type="primary" @click="searchForm" :disabled="disabled" id="viewDealers-refresh">查询</a-button>
                 <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="viewDealers-reset">重置</a-button>
               </a-col>
             </a-row>
@@ -67,8 +68,15 @@
             :data="loadData"
             :style="{ height: tableHeight+84.5+'px' }"
             :scroll="{ y: tableHeight }"
-            :defaultLoadData="false"
             bordered>
+            <template slot="action" slot-scope="text, record">
+            <a-button
+              size="small"
+              type="link"
+              class="button-error"
+              @click="handleDel(record)"
+              >删除</a-button>
+          </template>
           </s-table>
         </div>
       </a-spin>
@@ -82,9 +90,10 @@
       :visible="openAddDealer"
       :get-container="false"
       :wrap-style="{ position: 'absolute' }"
+      class="deraw-bindDealer"
       @close="openAddDealer = false">
       <div class="dealerModalCon">
-        <chooseDealer v-if="openAddDealer" pageType="viewDealers"></chooseDealer>
+        <chooseDealer ref="chooseDealer" v-if="openAddDealer" :parentData="parentData" pageType="viewDealers" @add="hanldAdd" @plAdd="hanldPlAdd"></chooseDealer>
       </div>
     </a-drawer>
   </div>
@@ -96,7 +105,7 @@ import { STable, VSelect } from '@/components'
 import chooseDealer from '@/views/common/chooseDealer.vue'
 import AreaList from '@/views/common/areaList.js'
 import { Empty } from 'ant-design-vue'
-import { queryPageAreaDealer } from '@/api/subarea'
+import { queryPageAreaDealer, batchBindDealer, bindDealer, deleteBindDealer } from '@/api/subarea'
 export default {
   mixins: [commonMixin],
   components: { STable, VSelect, chooseDealer, AreaList },
@@ -149,14 +158,13 @@ export default {
       disabled: false,
       tableHeight: 0,
       columns: [
-        { title: '经销商名称', dataIndex: 'subareaName', width: '25%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '商户别名', dataIndex: 'subareaName1', width: '25%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '商户类型', dataIndex: 'subareaName2', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '商户级别', dataIndex: 'subareaName3', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '审核状态', dataIndex: 'subareaName4', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '操作', scopedSlots: { customRender: 'action' }, width: '20%', align: 'center' }
+        { title: '经销商名称', dataIndex: 'dealer.dealerName', width: '30%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '商户别名', dataIndex: 'dealer.dealerAlias', width: '30%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '商户类型', dataIndex: 'dealer.dealerTypeDictValue', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '商户级别', dataIndex: 'dealer.dealerLevelDictValue', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '审核状态', dataIndex: 'dealer.auditStateDictValue', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '操作', scopedSlots: { customRender: 'action' }, width: '10%', align: 'center' }
       ],
-      // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
         this.spinning = true
@@ -164,27 +172,82 @@ export default {
           let data
           if (res.status == 200) {
             data = res.data
-            this.disabled = false
+            const no = 0
+            for (var i = 0; i < data.length; i++) {
+              data[i].no = no + i + 1
+            }
           }
+          this.disabled = false
           this.spinning = false
+          this.setTableH()
           return data
         })
-      }
+      },
     }
   },
-
   methods: {
+    // 绑定
+    hanldAdd(row){
+      console.log(row)
+      bindDealer({subareaAreaSn: this.parentData.subareaAreaSn,dealerSn:row.dealerSn}).then(res => {
+        if(res.status == 200){
+          this.resetSearchForm()
+          this.$refs.chooseDealer.searchForm(false)
+        }
+        this.$refs.chooseDealer.searchForm
+      })
+    },
+    // 批量绑定
+    hanldPlAdd(rows){
+      console.log(rows)
+      batchBindDealer({subareaAreaSn: this.parentData.subareaAreaSn,dealerSnSet:rows}).then(res => {
+        if(res.status == 200){
+          this.resetSearchForm()
+          this.$refs.chooseDealer.searchForm(false)
+        }
+        this.$refs.chooseDealer.spinning = false
+      })
+    },
+    // 删除
+    handleDel(row){
+      const _this = this
+      this.$confirm({
+        title: '提示',
+        content: '确定要删除当前经销商绑定关系吗?',
+        centered: true,
+        onOk () {
+          _this.spinning = true
+          deleteBindDealer({sn: row.subareaAreaDealerSn}).then(res => {
+            if(res.status == 200){
+              _this.resetSearchForm()
+            }
+            _this.spinning = false
+          })
+        }
+      })
+    },
+    searchForm(){
+      if(this.flag){
+        this.hasData()
+      }else{
+        this.$refs.table.refresh(true)
+      }
+    },
     resetSearchForm () {
-      this.queryParam = {
-        nameLike: '',
-        dealerType: null,
-        dealerLevel: null,
-        auditState: undefined,
-        provinceSn: undefined,
-        citySn: undefined,
-        districtSn: undefined
+      if(this.flag){
+        this.hasData()
+      }else{
+        this.queryParam = {
+          nameLike: '',
+          dealerType: null,
+          dealerLevel: null,
+          auditState: undefined,
+          provinceSn: undefined,
+          citySn: undefined,
+          districtSn: undefined
+        }
+        this.$refs.table.refresh(true)
       }
-      this.$refs.table.refresh(true)
     },
     areaChange(val){
       this.queryParam.provinceSn = val[0] ? val[0] : ''
@@ -192,7 +255,7 @@ export default {
       this.queryParam.districtSn = val[2] ? val[2] : ''
     },
    async hasData(){
-      const ret = queryPageAreaDealer({pageNo:1,pageSize:10,subareaSn: this.parentData.subareaSn, subareaAreaSn: this.parentData.subareaAreaSn}).then(res => res.data)
+      const ret = await queryPageAreaDealer({pageNo:1,pageSize:10,subareaSn: this.parentData.subareaSn, subareaAreaSn: this.parentData.subareaAreaSn}).then(res => res.data)
       this.flag = ret.count == 0
     },
     pageInit () {
@@ -200,22 +263,27 @@ export default {
       this.$nextTick(() => { // 页面渲染完成后的回调
         _this.setTableH()
       })
+      this.flag = true
       // 判断是已绑定数据
       this.hasData()
     },
     setTableH () {
       const tableSearchH = this.$refs.tableSearch.offsetHeight
-      this.tableHeight = window.innerHeight - tableSearchH - 345
+      this.tableHeight = window.innerHeight - tableSearchH - 290
     }
   },
 }
 </script>
 
-<style lang="less" scoped>
-.areaSetModal {
-  width: 100%;
-  .areaFooter {
-    text-align:center;
+<style lang="less">
+.viewsDealer{
+  .ant-drawer-body{
+    padding:10px 20px 0;
+  }
+}
+.deraw-bindDealer {
+  .ant-drawer-body{
+    padding:10px 20px 0;
   }
 }
 </style>

+ 1 - 3
src/views/salesManagement/examineVerify/list.vue

@@ -59,11 +59,9 @@
                 </a-form-model-item>
               </a-col>
               <a-col :md="6" :sm="24">
-                <a-form-model-item label="地区">
-                  <a-form-model-item prop="shippingAddrProvinceSn">
+                <a-form-model-item label="地区" prop="shippingAddrProvinceSn">
                     <Area id="examineVerifyList-shippingAddrProvinceSn" v-model="queryParam.shippingAddrProvinceSn" placeholder="请选择省"></Area>
                   </a-form-model-item>
-                </a-form-model-item>
               </a-col>
             </template>
             <a-col :md="6" :sm="24" style="margin-bottom: 10px;">

+ 1 - 3
src/views/salesManagement/outboundOrder/list.vue

@@ -65,11 +65,9 @@
                 </a-form-model-item>
               </a-col>
               <a-col :md="6" :sm="24">
-                <a-form-model-item label="地区">
-                  <a-form-model-item prop="shippingAddrProvinceSn">
+                <a-form-model-item label="地区" prop="shippingAddrProvinceSn">
                     <Area id="outboundOrderList-shippingAddrProvinceSn" v-model="queryParam.shippingAddrProvinceSn" placeholder="请选择省"></Area>
                   </a-form-model-item>
-                </a-form-model-item>
               </a-col>
             </template>
             <a-col :md="6" :sm="24" style="margin-bottom: 10px;">

+ 2 - 4
src/views/salesManagement/pushOrderManagement/list.vue

@@ -81,10 +81,8 @@
                 </a-form-model-item>
               </a-col>
               <a-col :md="6" :sm="24">
-                <a-form-model-item label="地区">
-                  <a-form-model-item prop="shippingAddrProvinceSn">
-                    <Area id="pushOrder-shippingAddrProvinceSn" v-model="queryParam.shippingAddrProvinceSn" placeholder="请选择省"></Area>
-                  </a-form-model-item>
+                <a-form-model-item label="地区" prop="shippingAddrProvinceSn">
+                  <Area id="pushOrder-shippingAddrProvinceSn" v-model="queryParam.shippingAddrProvinceSn" placeholder="请选择省"></Area>
                 </a-form-model-item>
               </a-col>
             </template>

+ 3 - 9
src/views/salesManagement/salesCollection/list.vue

@@ -108,15 +108,9 @@
                 </a-form-item>
               </a-col>
               <a-col :md="6" :sm="24">
-                <a-row>
-                  <a-form-item label="地区">
-                    <a-col span="24">
-                      <a-form-item prop="dealerProvinceSn" style="margin: 0;">
-                        <Area id="salesCollectionList-dealerProvinceSn" v-model="queryParam.dealerProvinceSn" placeholder="请选择省"></Area>
-                      </a-form-item>
-                    </a-col>
-                  </a-form-item>
-                </a-row>
+                <a-form-item label="地区" prop="dealerProvinceSn" style="margin: 0;">
+                  <Area id="salesCollectionList-dealerProvinceSn" v-model="queryParam.dealerProvinceSn" placeholder="请选择省"></Area>
+                </a-form-item>
               </a-col>
             </template>
             <a-col :md="6" :sm="24" style="margin-bottom: 10px;">

+ 9 - 1
src/views/salesManagement/salesQuery/list.vue

@@ -72,7 +72,7 @@
               </a-col>
               <a-col :md="6" :sm="24">
                 <a-form-model-item label="所在区域">
-                  <subarea id="salesManagementList-subarea" v-model="queryParam.subareaSn"></subarea>
+                  <subarea ref="subarea" id="salesManagementList-subarea" @change="subareaChange"></subarea>
                 </a-form-model-item>
               </a-col>
               <a-col :md="6" :sm="24">
@@ -410,6 +410,10 @@ export default {
     custChange (val) {
       this.queryParam.buyerSn = val.key
     },
+    subareaChange(val){
+      this.queryParam.subareaSn = val[0] ? val[0] : ''
+      this.queryParam.subareaAreaSn = val[1] ? val[1] : ''
+    },
     // 新增
     handleAdd () {
       this.openModal = true
@@ -525,7 +529,11 @@ export default {
       this.queryParam.financialStatus = undefined
       this.queryParam.salesBillSource = undefined
       this.queryParam.subareaSn = undefined
+      this.queryParam.subareaAreaSn = undefined
       this.queryParam.shippingAddrProvinceSn = undefined
+      if(this.advanced){
+        this.$refs.subarea.clearData()
+      }
       this.$refs.table.refresh(true)
     },
     pageInit () {

+ 2 - 4
src/views/salesManagement/sendOutOrder/list.vue

@@ -59,10 +59,8 @@
                 </a-form-model-item>
               </a-col>
               <a-col :md="6" :sm="24">
-                <a-form-model-item label="地区">
-                  <a-form-model-item >
-                    <Area id="sendOut-provinceSn" v-model="queryParam.provinceSn" placeholder="请选择省"></Area>
-                  </a-form-model-item>
+                <a-form-model-item label="地区" >
+                  <Area id="sendOut-provinceSn" v-model="queryParam.provinceSn" placeholder="请选择省"></Area>
                 </a-form-model-item>
               </a-col>
             </template>

+ 1 - 3
src/views/salesManagement/stockPrint/list.vue

@@ -79,11 +79,9 @@
                   </a-form-model-item>
                 </a-col>
                 <a-col :md="3" :sm="24">
-                  <a-form-model-item label="地区">
-                    <a-form-model-item prop="shippingAddrProvinceSn">
+                  <a-form-model-item label="地区" prop="shippingAddrProvinceSn">
                       <Area id="stockPrint-shippingAddrProvinceSn" v-model="queryParam.shippingAddrProvinceSn" placeholder="请选择省"></Area>
                     </a-form-model-item>
-                  </a-form-model-item>
                 </a-col>
               </template>
               <a-col :md="6" :sm="24">

+ 1 - 3
src/views/salesReturnManagement/salesReturn/list.vue

@@ -70,11 +70,9 @@
                 </a-form-model-item>
               </a-col>
               <a-col :md="6" :sm="24">
-                <a-form-model-item label="地区">
-                  <a-form-model-item prop="shippingAddrProvinceSn">
+                <a-form-model-item label="地区" prop="shippingAddrProvinceSn">
                     <Area id="salesReturn-provinceSn" v-model="queryParam.shippingAddrProvinceSn" placeholder="请选择省"></Area>
                   </a-form-model-item>
-                </a-form-model-item>
               </a-col>
             </template>
             <a-col :md="6" :sm="24">