Browse Source

Merge branch 'deploy_0804' of jianguan-web/qpls-md-html into master

陈瑞 4 years ago
parent
commit
2cd1ae8a62
30 changed files with 402 additions and 240 deletions
  1. 17 12
      src/permission.js
  2. 4 0
      src/views/allocationManagement/chainTransferIn/edit.vue
  3. 4 0
      src/views/allocationManagement/chainTransferOut/edit.vue
  4. 5 1
      src/views/allocationManagement/storeTransferOut/edit.vue
  5. 9 1
      src/views/allocationManagement/warehouseAllocation/edit.vue
  6. 1 1
      src/views/bulkManagement/bulkReturnGoods/edit.vue
  7. 9 1
      src/views/bulkManagement/bulkWarehousingOrder/edit.vue
  8. 8 1
      src/views/common/custSatelliteList.vue
  9. 1 0
      src/views/customerManagement/customerInfo/detailModal.vue
  10. 36 28
      src/views/customerManagement/customerInfo/edit.vue
  11. 16 11
      src/views/customerManagement/customerInfo/list.vue
  12. 2 0
      src/views/financialManagement/companyReceivablePayable/collectionPayment.vue
  13. 17 18
      src/views/financialManagement/ledgerRecord/list.vue
  14. 1 1
      src/views/inventoryManagement/inventoryChecking/selfDisk.vue
  15. 4 10
      src/views/inventoryManagement/inventoryQuery/list.vue
  16. 4 1
      src/views/inventoryManagement/inventoryWarning/list.vue
  17. 1 1
      src/views/inventoryManagement/satelliteWarehouseInventory/list.vue
  18. 3 3
      src/views/productManagement/productInfo/detailModal.vue
  19. 1 1
      src/views/productManagement/productInfoJg/list.vue
  20. 15 1
      src/views/purchasingManagement/purchaseOrder/basicInfoModal.vue
  21. 1 0
      src/views/purchasingManagement/purchaseOrder/receivingAddress/chooseAddressModal.vue
  22. 23 11
      src/views/purchasingManagement/purchaseOrder/receivingAddress/editAddressModal.vue
  23. 2 2
      src/views/purchasingManagement/purchaseOrder/warehousing.vue
  24. 9 1
      src/views/purchasingManagement/purchaseReturn/edit.vue
  25. 10 5
      src/views/reportData/chainSalesDetailReport/list.vue
  26. 12 8
      src/views/reportData/chainSalesReport/list.vue
  27. 12 8
      src/views/reportData/customerReport/list.vue
  28. 80 47
      src/views/salesManagement/salesQuery/chooseCustomModal.vue
  29. 71 45
      src/views/salesManagement/salesReturn/chooseCustomModal.vue
  30. 24 21
      src/views/supplierManagement/supplierInfo/editModal.vue

+ 17 - 12
src/permission.js

@@ -32,7 +32,8 @@ router.beforeEach((to, from, next) => {
         store.dispatch('SetInfo', userInfo)
       } else {
         store.dispatch('Logout').then(() => {
-          next({ path: '/user/login', query: { redirect: to.fullPath } })
+          // next({ path: '/user/login', query: { redirect: to.fullPath } })
+          next({ path: '/user/login' })
         })
       }
       // console.log(store.getters.roles)
@@ -45,22 +46,24 @@ router.beforeEach((to, from, next) => {
             if (roles.permissionList.length == 0 || !roles) {
               store.dispatch('Logout').then(() => {
                 store.dispatch('ResetRoutes').then(() => {
-                  next({ path: '/user/login', query: { redirect: to.fullPath } })
+                  // next({ path: '/user/login', query: { redirect: to.fullPath } })
+                  next({ path: '/user/login' })
                 })
               })
             } else {
               store.dispatch('GenerateRoutes', { roles }).then(() => {
                 // 根据roles权限生成可访问的路由表
+                next({ ...to, replace: true })
                 // 动态添加可访问路由表
                 // router.addRoutes(store.getters.addRouters)
-                const redirect = decodeURIComponent(from.query.redirect || to.path)
-                if (to.path === redirect) {
-                  // hack方法 确保addRoutes已完成 ,set the replace: true so the navigation will not leave a history record
-                  next({ ...to, replace: true })
-                } else {
-                  // 跳转到目的路由
-                  next({ path: redirect })
-                }
+                // const redirect = decodeURIComponent(from.query.redirect || to.path)
+                // if (to.path === redirect) {
+                //   // hack方法 确保addRoutes已完成 ,set the replace: true so the navigation will not leave a history record
+                //   next({ ...to, replace: true })
+                // } else {
+                //   // 跳转到目的路由
+                //   next({ path: redirect })
+                // }
               })
             }
           })
@@ -70,7 +73,8 @@ router.beforeEach((to, from, next) => {
               description: '请求用户信息失败,请重试'
             })
             store.dispatch('Logout').then(() => {
-              next({ path: '/user/login', query: { redirect: to.fullPath } })
+              // next({ path: '/user/login', query: { redirect: to.fullPath } })
+              next({ path: '/user/login' })
             })
           })
       } else {
@@ -83,7 +87,8 @@ router.beforeEach((to, from, next) => {
       // 在免登录白名单,直接进入
       next()
     } else {
-      next({ path: '/user/login', query: { redirect: to.fullPath } })
+      // next({ path: '/user/login', query: { redirect: to.fullPath } })
+      next({ path: '/user/login' })
       NProgress.done() // if current page is login will not trigger afterEach hook, so manually handle it
     }
   }

+ 4 - 0
src/views/allocationManagement/chainTransferIn/edit.vue

@@ -81,6 +81,7 @@
           :rowKey="(record) => record.id"
           :columns="columns"
           :dataSource="loadData"
+          :loading="loading"
           :scroll="{ x: 1415 }"
           bordered>
           <!-- 仓库仓位 -->
@@ -134,6 +135,7 @@ export default {
         productTypeSn3: '' //  产品分类3
       },
       disabled: false, //  查询、重置按钮是否可操作
+      loading: false, //  表格加载中
       productTypeList: [], //  产品分类  下拉数据
       productType: [],
       warehouseCascadeData: [], //  仓库仓位
@@ -202,9 +204,11 @@ export default {
     // 产品列表数据
     getProductList (pageNo) {
       this.disabled = true
+      this.loading = true
       this.pageNo = pageNo || this.pageNo
       const params = Object.assign({ pageNo: this.pageNo, pageSize: this.pageSize }, this.queryParam, { allocationLinkagePutSn: this.$route.params.sn })
       allocLinkagePutDetailList(params).then(res => {
+        this.loading = false
         if (res.status == 200) {
           this.getDetailCount(params)
           const data = res.data

+ 4 - 0
src/views/allocationManagement/chainTransferOut/edit.vue

@@ -97,6 +97,7 @@
               :columns="columns"
               :customRow="handleClickRow"
               :dataSource="loadData"
+              :loading="loading"
               :scroll="{ x: 1680, y: 300 }"
               bordered>
               <!-- 调出数量 -->
@@ -222,6 +223,7 @@ export default {
       productType: [],
       warehouseList: [], //  仓库  下拉数据
       disabled: false, //  查询、重置按钮是否可操作
+      loading: false, //  表格加载中
       chooseDisabled: false,
       advanced: false, // 高级搜索 展开/关闭
       // 表头
@@ -432,11 +434,13 @@ export default {
     // 产品列表数据
     getProductList (pageNo) {
       this.disabled = true
+      this.loading = true
       this.pageNo = pageNo || this.pageNo
       // 箭冠品牌 sysFlag传1,非箭冠品牌传0。与新增时所选调出产品类型有关
       this.queryParam.sysFlag = this.basicInfoData.allocationType == 'JIANGUAN' ? '1' : '0'
       const params = Object.assign({ pageNo: this.pageNo, pageSize: this.pageSize }, this.queryParam)
       productQuery(params).then(res => {
+        this.loading = false
         if (res.status == 200) {
           const data = res.data
           this.paginationProps.total = Number(res.data.count) || 0

+ 5 - 1
src/views/allocationManagement/storeTransferOut/edit.vue

@@ -140,7 +140,7 @@
                 </div>
               </a-col>
               <a-col :span="4" style="text-align: right;">
-                <a-button size="small" id="storeTransferOutEdit-import-btn">导入明细</a-button>
+                <!-- <a-button size="small" id="storeTransferOutEdit-import-btn">导入明细</a-button> -->
               </a-col>
             </a-row>
             <!-- 列表 -->
@@ -151,6 +151,7 @@
               :rowKey="(record) => record.id"
               :columns="chooseColumns"
               :dataSource="chooseLoadData"
+              :loading="loading"
               :scroll="{ x: 1335, y: 300 }"
               :pagination="choosePaginationProps"
               bordered>
@@ -218,6 +219,7 @@ export default {
         productName: ''
       },
       disabled: false, //  查询、重置按钮是否可操作
+      loading: false, //  表格加载中
       chooseDisabled: false, //  查询、重置按钮是否可操作
       advanced: false, // 高级搜索 展开/关闭
       productBrandList: [], //  产品品牌  下拉数据
@@ -461,12 +463,14 @@ export default {
     getChooseProductList (pageNo) {
       this.choosePageNo = this.choosePageNo || pageNo
       this.chooseDisabled = true
+      this.loading = true
       const params = {
         pageNo: this.choosePageNo,
         pageSize: this.choosePageSize,
         storeCallOutSn: this.$route.params.sn
       }
       storeCallOutDetailList(Object.assign(params, this.chooseQueryParam)).then(res => {
+        this.loading = false
         if (res.status == 200) {
           //  合计
           this.getDetailCount(Object.assign(params, this.chooseQueryParam))

+ 9 - 1
src/views/allocationManagement/warehouseAllocation/edit.vue

@@ -95,6 +95,7 @@
               :customRow="handleClickRow"
               :dataSource="loadData"
               :scroll="{ x: 1880, y: 300 }"
+              :loading="loading"
               :pagination="paginationProps"
               bordered>
               <!-- 产品分类 -->
@@ -165,7 +166,7 @@
                 </div>
               </a-col>
               <a-col :span="7">
-                <a-button size="small" style="margin-left: 8px" id="chainTransferOutEdit-import-btn">导入明细</a-button>
+                <!-- <a-button size="small" style="margin-left: 8px" id="chainTransferOutEdit-import-btn">导入明细</a-button> -->
                 <a-button size="small" type="danger" style="margin-left: 8px" @click.stop="handleDel('', 'all')" id="warehouseAllocationEdit-del-all-btn">整单删除</a-button>
               </a-col>
             </a-row>
@@ -178,6 +179,7 @@
               :columns="chooseColumns"
               :dataSource="chooseLoadData"
               :scroll="{ x: 1680, y: 300 }"
+              :loading="chooseLoading"
               :pagination="choosePaginationProps"
               bordered>
               <!-- 产品分类 -->
@@ -243,6 +245,8 @@ export default {
   data () {
     return {
       spinning: false,
+      loading: false,
+      chooseLoading: false,
       queryParam: {
         productCode: '',
         productName: '',
@@ -480,11 +484,13 @@ export default {
     // 产品列表数据
     getProductList (pageNo) {
       this.disabled = true
+      this.loading = true
       this.pageNo = pageNo || this.pageNo
       const params = Object.assign({ pageNo: this.pageNo, pageSize: this.pageSize }, this.queryParam)
       params.enabledFlag = 1
       params.warehouseSn = this.basicInfoData.outWarehouseSn
       productQuery(params).then(res => {
+        this.loading = false
         if (res.status == 200) {
           const data = res.data
           this.paginationProps.total = Number(res.data.count) || 0
@@ -528,12 +534,14 @@ export default {
     getChooseProductList (pageNo) {
       this.choosePageNo = this.choosePageNo || pageNo
       this.chooseDisabled = true
+      this.chooseLoading = true
       const params = {
         pageNo: this.choosePageNo,
         pageSize: this.choosePageSize,
         allocationWarehouseSn: this.$route.params.sn
       }
       allocWarehouseDetailList(Object.assign(params, this.chooseQueryParam)).then(res => {
+        this.chooseLoading = false
         if (res.status == 200) {
           //  合计
           this.getDetailCount(Object.assign(params, this.chooseQueryParam))

+ 1 - 1
src/views/bulkManagement/bulkReturnGoods/edit.vue

@@ -111,7 +111,7 @@
         <a-collapse-panel key="1">
           <template slot="header">
             已选产品
-            <a-button size="small" class="import-btn" id="bulkReturnGoodsEdit-import-btn" @click.stop="handleImport">导入明细</a-button>
+            <!-- <a-button size="small" class="import-btn" id="bulkReturnGoodsEdit-import-btn" @click.stop="handleImport">导入明细</a-button> -->
           </template>
           <!-- 已选产品 -->
           <div>

+ 9 - 1
src/views/bulkManagement/bulkWarehousingOrder/edit.vue

@@ -96,6 +96,7 @@
                 :columns="columns"
                 :customRow="handleClickRow"
                 :dataSource="loadData"
+                :loading="loading"
                 :scroll="{ x: 1600, y: 300 }"
                 :pagination="paginationProps"
                 @change="onTableChange"
@@ -150,7 +151,7 @@
           <a-collapse-panel key="1">
             <template slot="header">
               已选产品
-              <a-button size="small" class="import-btn" id="bulkWarehousingOrderEdit-import-btn" @click.stop="handleImport">导入明细</a-button>
+              <!-- <a-button size="small" class="import-btn" id="bulkWarehousingOrderEdit-import-btn" @click.stop="handleImport">导入明细</a-button> -->
             </template>
             <!-- 已选产品 -->
             <div>
@@ -171,6 +172,7 @@
                 :columns="chooseColumns"
                 :dataSource="chooseLoadData"
                 :scroll="{ x: 1700, y: 300 }"
+                :loading="chooseLoading"
                 :pagination="choosePaginationProps"
                 @change="onChooseTableChange"
                 bordered>
@@ -253,6 +255,8 @@ export default {
   data () {
     return {
       spinning: false,
+      loading: false,
+      chooseLoading: false,
       queryParam: {
         queryWord: '',
         productBrandSn: undefined,
@@ -579,6 +583,7 @@ export default {
     // 产品列表数据
     getDealerProductList (pageNo, sorter) {
       this.disabled = true
+      this.loading = true
       this.pageNo = pageNo || this.pageNo
       const params = Object.assign({ pageNo: this.pageNo, pageSize: this.pageSize }, this.queryParam)
       params.enabledFlag = 1
@@ -589,6 +594,7 @@ export default {
         params.sortAlias = 'dp'
       }
       dealerProductList(params).then(res => {
+        this.loading = false
         if (res.status == 200) {
           const data = res.data
           this.paginationProps.total = Number(res.data.count) || 0
@@ -626,7 +632,9 @@ export default {
         params.sortOrder = sorter.order
         params.sortAlias = sorter.field == 'brandName' ? 'dp' : 'sppd'
       }
+      this.chooseLoading = true
       sparePartsPurDetailList(params).then(res => {
+        this.chooseLoading = false
         if (res.status == 200) {
           this.getDetailCount(params)
           const data = res.data

+ 8 - 1
src/views/common/custSatelliteList.vue

@@ -21,6 +21,10 @@ import debounce from 'lodash/debounce'
 import { custList } from '@/api/customer'
 export default {
   props: {
+    verify: { //  当前输入客户名称是否是卫星仓客户 提示信息
+      type: Boolean,
+      default: false
+    }
   },
   data () {
     this.lastFetchId = 0
@@ -39,11 +43,14 @@ export default {
       const fetchId = this.lastFetchId
       this.data = []
       this.fetching = true
-      custList({ name: dealerName, satelliteFlag: 1, pageNo: 1, pageSize: 20 }).then(res => {
+      custList({ customerName: dealerName, satelliteFlag: 1, pageNo: 1, pageSize: 20 }).then(res => {
         if (fetchId !== this.lastFetchId) {
           return
         }
         this.data = res.data && res.data.list ? res.data.list : []
+        if (this.verify && this.data.length == 0) {
+          this.$message.info('客户不存在')
+        }
         this.fetching = false
       })
     },

+ 1 - 0
src/views/customerManagement/customerInfo/detailModal.vue

@@ -15,6 +15,7 @@
           <a-descriptions-item label="客户名称:">{{ detailData&&detailData.customerName || '--' }}</a-descriptions-item>
           <a-descriptions-item label="联系人:">{{ detailData&&detailData.contactName || '--' }}</a-descriptions-item>
           <a-descriptions-item label="联系电话:">{{ detailData&&detailData.contactTel || '--' }}</a-descriptions-item>
+          <a-descriptions-item label="联系手机:">{{ detailData&&detailData.contactMobile || '--' }}</a-descriptions-item>
           <a-descriptions-item label="客户地址:" :span="3">{{ addressStr }}</a-descriptions-item>
           <a-descriptions-item label="客户传真:">{{ detailData&&detailData.fax || '--' }}</a-descriptions-item>
           <a-descriptions-item label="配送方式:">{{ detailData&&detailData.dispatchTypeDictValue || '--' }}</a-descriptions-item>

+ 36 - 28
src/views/customerManagement/customerInfo/edit.vue

@@ -30,7 +30,12 @@
             </a-col>
             <a-col :span="8">
               <a-form-model-item label="联系电话" prop="contactTel">
-                <a-input id="customerManagementEdit-contactTel" :maxLength="11" v-model.trim="form.contactTel" placeholder="请输入联系电话(最多11个字符)" allowClear />
+                <a-input id="customerManagementEdit-contactTel" :maxLength="15" v-model.trim="form.contactTel" placeholder="请输入联系电话(最多15个字符)" allowClear />
+              </a-form-model-item>
+            </a-col>
+            <a-col :span="8">
+              <a-form-model-item label="联系手机" prop="contactMobile">
+                <a-input id="customerManagementEdit-contactMobile" :maxLength="11" v-model.trim="form.contactMobile" placeholder="请输入联系手机(最多11个字符)" allowClear />
               </a-form-model-item>
             </a-col>
             <a-col :span="8">
@@ -40,36 +45,36 @@
             </a-col>
           </a-row>
           <a-row :gutter="15">
-            <a-col :span="16">
-              <a-form-model-item label="客户地址" required style="margin: 0;" :labelCol="{ span: 4 }" :wrapperCol="{ span: 20 }">
+            <a-col :span="24">
+              <a-form-model-item label="客户地址" required style="margin: 0;" :labelCol="{ span: 3 }" :wrapperCol="{ span: 20 }">
                 <a-row :gutter="15">
                   <!-- 客户地址 -->
                   <a-col span="8">
                     <a-form-model-item prop="provinceSn">
-                      <a-select id="customerManagementEdit-provinceSn" @change="getCityList" v-model="form.provinceSn" placeholder="请选择省">
-                        <a-select-option v-for="item in addrProvinceList" :value="item.id" :key="item.id + 'a'">{{ item.name }}</a-select-option>
+                      <a-select id="customerManagementEdit-provinceSn" allowClear @change="getCityList" v-model="form.provinceSn" 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>
                   </a-col>
                   <a-col span="8">
                     <a-form-model-item prop="citySn">
-                      <a-select id="customerManagementEdit-citySn" @change="getAreaList" v-model="form.citySn" placeholder="请选择市">
-                        <a-select-option v-for="item in addrCityList" :value="item.id" :key="item.id + 'b'">{{ item.name }}</a-select-option>
+                      <a-select id="customerManagementEdit-citySn" allowClear @change="getAreaList" v-model="form.citySn" placeholder="请选择市">
+                        <a-select-option v-for="item in addrCityList" :value="item.areaSn" :key="item.areaSn + 'b'">{{ item.name }}</a-select-option>
                       </a-select>
                     </a-form-model-item>
                   </a-col>
                   <a-col span="8">
                     <a-form-model-item prop="countySn">
-                      <a-select id="customerManagementEdit-countySn" @change="areaCharged" v-model="form.countySn" placeholder="请选择区/县">
-                        <a-select-option v-for="item in addrDistrictList" :value="item.id" :key="item.id + 'c'">{{ item.name }}</a-select-option>
+                      <a-select id="customerManagementEdit-countySn" allowClear @change="areaCharged" v-model="form.countySn" placeholder="请选择区/县">
+                        <a-select-option v-for="item in addrDistrictList" :value="item.areaSn" :key="item.areaSn + 'c'">{{ item.name }}</a-select-option>
                       </a-select>
                     </a-form-model-item>
                   </a-col>
                 </a-row>
               </a-form-model-item>
             </a-col>
-            <a-col :span="8">
-              <a-form-model-item label="" prop="customerAddr">
+            <a-col :span="24">
+              <a-form-model-item label="详细地址" prop="customerAddr" :labelCol="{ span: 3 }" :wrapperCol="{ span: 20 }">
                 <a-input id="customerManagementEdit-customerAddr" :maxLength="60" v-model.trim="form.customerAddr" placeholder="请输入详细地址(最多60个字符)" allowClear />
               </a-form-model-item>
             </a-col>
@@ -146,12 +151,13 @@ export default {
       spinning: false,
       formItemLayout: {
         labelCol: { span: 9 },
-        wrapperCol: { span: 15 }
+        wrapperCol: { span: 14 }
       },
       form: {
         id: null,
         customerName: '', // 客户名称
         contactTel: '', //  联系电话
+        contactMobile: '', //  联系手机
         contactName: '', //  联系人
         provinceSn: undefined, //  省
         provinceName: '',
@@ -169,11 +175,10 @@ export default {
       },
       rules: {
         customerName: [{ required: true, message: '请输入客户名称', trigger: 'blur' }],
-        contactTel: [{ required: true, message: '请输入联系电话', trigger: 'blur' }, { pattern: /^\d{11}$/, message: '请输入正确的手机号' }],
+        contactMobile: [{ required: false, pattern: /^\d{11}$/, message: '请输入正确的手机号', trigger: 'blur' }],
         provinceSn: [{ required: true, message: '请选择省', trigger: 'change' }],
         citySn: [{ required: true, message: '请选择市', trigger: 'change' }],
         countySn: [{ required: true, message: '请选择区/县', trigger: 'change' }],
-        customerAddr: [{ required: true, message: '请输入详细地址', trigger: 'blur' }],
         priceType: [{ required: true, message: '请选择价格类型', trigger: 'change' }],
         settleStyleSn: [{ required: true, message: '请选择收款方式', trigger: 'change' }]
       },
@@ -260,35 +265,38 @@ export default {
     },
     // 获取城市列表
     getCityList (val) {
-      const index = this.addrProvinceList.findIndex(item => item.id == val)
-      if (index >= 0) {
-        this.form.provinceName = this.addrProvinceList[index].name
-      }
       this.addrCityList = []
       this.addrDistrictList = []
       this.form.citySn = undefined
       this.form.countySn = undefined
       this.form.customerAddr = ''
-      this.getArea('city', val)
+      if (val) {
+        this.getArea('city', val)
+        this.form.provinceName = this.addrProvinceList.find(item => item.areaSn == val).name
+      } else {
+        this.form.provinceName = ''
+      }
     },
     // 获取区县列表
     getAreaList (val) {
-      const index = this.addrCityList.findIndex(item => item.id == val)
-      if (index >= 0) {
-        this.form.cityName = this.addrCityList[index].name
-      }
       this.addrDistrictList = []
       this.form.countySn = undefined
       this.form.customerAddr = ''
-      this.getArea('district', val)
+      if (val) {
+        this.getArea('district', val)
+        this.form.cityName = this.addrCityList.find(item => item.areaSn == val).name
+      } else {
+        this.form.cityName = ''
+      }
     },
     // 区县变更
     areaCharged (val) {
-      const index = this.addrDistrictList.findIndex(item => item.id == val)
-      if (index >= 0) {
-        this.form.countyName = this.addrDistrictList[index].name
-      }
       this.form.customerAddr = ''
+      if (val) {
+        this.form.countyName = this.addrDistrictList.find(item => item.areaSn == val).name
+      } else {
+        this.form.countyName = ''
+      }
     },
     //  省/市/区
     getArea (leve, sn) {

+ 16 - 11
src/views/customerManagement/customerInfo/list.vue

@@ -32,22 +32,22 @@
                   <a-form-item label="客户地址">
                     <a-col span="7">
                       <a-form-item prop="provinceSn" style="margin: 0;">
-                        <a-select v-model="queryParam.provinceSn" @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 v-model="queryParam.provinceSn" allowClear @change="getCityList" 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-item>
                     </a-col>
                     <a-col span="7" offset="1">
                       <a-form-item prop="citySn" style="margin: 0;">
-                        <a-select v-model="queryParam.citySn" @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 v-model="queryParam.citySn" allowClear @change="getAreaList" placeholder="请选择市">
+                          <a-select-option v-for="item in addrCityList" :value="item.areaSn" :key="item.areaSn + 'b'">{{ item.name }}</a-select-option>
                         </a-select>
                       </a-form-item>
                     </a-col>
                     <a-col span="7" offset="1">
                       <a-form-item prop="countySn" style="margin: 0;">
-                        <a-select v-model="queryParam.countySn" placeholder="请选择区/县">
-                          <a-select-option v-for="item in addrDistrictList" :value="item.id" :key="item.id + 'c'">{{ item.name }}</a-select-option>
+                        <a-select v-model="queryParam.countySn" allowClear placeholder="请选择区/县">
+                          <a-select-option v-for="item in addrDistrictList" :value="item.areaSn" :key="item.areaSn + 'c'">{{ item.name }}</a-select-option>
                         </a-select>
                       </a-form-item>
                     </a-col>
@@ -91,7 +91,7 @@
         :rowKey="(record) => record.id"
         :columns="columns"
         :data="loadData"
-        :scroll="{ x: 1240, y: tableHeight }"
+        :scroll="{ x: 1400, y: tableHeight }"
         bordered>
         <!-- 操作 -->
         <template slot="action" slot-scope="text, record">
@@ -154,8 +154,9 @@ export default {
         { title: '序号', dataIndex: 'no', width: 80, align: 'center' },
         { title: '创建时间', dataIndex: 'createDate', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '客户名称', dataIndex: 'customerName', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '联系人', dataIndex: 'contactName', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '联系电话', dataIndex: 'contactTel', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '联系人', dataIndex: 'contactName', width: 140, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '联系电话', dataIndex: 'contactTel', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '联系手机', dataIndex: 'contactMobile', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '最后销售时间', dataIndex: 'lastSaleTime', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '是否卫星仓', dataIndex: 'satelliteFlagDictValue', width: 110, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '启用禁用', scopedSlots: { customRender: 'enableAction' }, width: 100, align: 'center', fixed: 'right' },
@@ -299,13 +300,17 @@ export default {
       this.addrDistrictList = []
       this.queryParam.citySn = undefined
       this.queryParam.countySn = undefined
-      this.getArea('city', val)
+      if (val) {
+        this.getArea('city', val)
+      }
     },
     // 获取区县列表
     getAreaList (val) {
       this.addrDistrictList = []
       this.queryParam.countySn = undefined
-      this.getArea('district', val)
+      if (val) {
+        this.getArea('district', val)
+      }
     },
     //  省/市/区
     getArea (leve, sn) {

+ 2 - 0
src/views/financialManagement/companyReceivablePayable/collectionPayment.vue

@@ -34,6 +34,7 @@
               :columns="chooseColumns"
               :dataSource="chooseLoadData"
               :scroll="{ x: 1040, y: 300 }"
+              :loading="loading"
               :pagination="false"
               bordered>
               <!-- 序号 -->
@@ -154,6 +155,7 @@ export default {
   data () {
     return {
       spinning: false,
+      loading: false, //  表格加载中
       chooseQueryParam: {
         productCode: '',
         productName: ''

+ 17 - 18
src/views/financialManagement/ledgerRecord/list.vue

@@ -6,7 +6,7 @@
         <a-row :gutter="15">
           <a-col :md="6" :sm="24">
             <a-form-item label="分账时间">
-              <rangeDateTime ref="rangeDate" :value="createDate" @change="dateChange" />
+              <rangeDate ref="rangeDate" :value="createDate" @change="dateChange" />
             </a-form-item>
           </a-col>
           <a-col :md="6" :sm="24">
@@ -15,14 +15,14 @@
             </a-form-item>
           </a-col>
           <a-col :md="6" :sm="24">
-            <a-form-item label="配件名称">
-              <a-input id="ledgerRecordList-name" v-model.trim="queryParam.dealerProduct.name" allowClear placeholder="请输入配件名称"/>
+            <a-form-item label="产品名称">
+              <a-input id="ledgerRecordList-name" v-model.trim="queryParam.dealerProduct.name" allowClear placeholder="请输入产品名称"/>
             </a-form-item>
           </a-col>
           <template v-if="advanced">
             <a-col :md="6" :sm="24">
-              <a-form-item label="配件编码">
-                <a-input id="ledgerRecordList-code" v-model.trim="queryParam.dealerProduct.code" allowClear placeholder="请输入配件编码"/>
+              <a-form-item label="产品编码">
+                <a-input id="ledgerRecordList-code" v-model.trim="queryParam.dealerProduct.code" allowClear placeholder="请输入产品编码"/>
               </a-form-item>
             </a-col>
           </template>
@@ -61,21 +61,20 @@
 </template>
 
 <script>
-import moment from 'moment'
 import getDate from '@/libs/getDate.js'
 import { STable, VSelect } from '@/components'
-import rangeDateTime from '@/views/common/rangeDateTime.vue'
+import rangeDate from '@/views/common/rangeDate.vue'
 import custSatelliteList from '@/views/common/custSatelliteList.vue'
 import { satelliteWHSeparateList, satelliteWHSeparateTotal } from '@/api/satelliteWH'
 export default {
-  components: { STable, VSelect, rangeDateTime, custSatelliteList },
+  components: { STable, VSelect, rangeDate, custSatelliteList },
   data () {
     return {
       advanced: false, //  高级搜索 展开/关闭
       disabled: false, //  查询、重置按钮是否可操作
       createDate: [
-        moment(getDate.getRecentTime().starttime, 'YYYY-MM-DD HH:mm:ss'),
-        moment(getDate.getRecentTime().endtime, 'YYYY-MM-DD HH:mm:ss')
+        getDate.getRecentday().starttime,
+        getDate.getRecentday().endtime
       ],
       // 查询参数
       queryParam: {
@@ -86,8 +85,8 @@ export default {
           name: '',
           code: ''
         },
-        beginDate: getDate.getRecentTime().starttime,
-        endDate: getDate.getRecentTime().endtime
+        beginDate: getDate.getRecentday().starttime + ' 00:00:00',
+        endDate: getDate.getRecentday().endtime + ' 23:59:59'
       },
       // 表头
       columns: [
@@ -95,8 +94,8 @@ export default {
         { title: '分账时间', dataIndex: 'separateTime', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '客户名称', dataIndex: 'customer.customerName', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '关联工单号', dataIndex: 'separateBizNo', width: 220, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '配件名称', dataIndex: 'dealerProduct.name', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '配件编码', dataIndex: 'dealerProduct.code', width: 220, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品名称', dataIndex: 'dealerProduct.name', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '产品编码', dataIndex: 'dealerProduct.code', width: 220, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '数量', dataIndex: 'productQty', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '分账金额(¥)', dataIndex: 'separateAmount', width: 120, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '分账状态', dataIndex: 'stateDictValue', width: 150, align: 'center', customRender: function (text) { return text || '--' } },
@@ -124,8 +123,8 @@ export default {
   methods: {
     //  时间  change
     dateChange (date) {
-      this.queryParam.beginDate = date[0]
-      this.queryParam.endDate = date[1]
+      this.queryParam.beginDate = date[0] ? date[0] + ' 00:00:00' : ''
+      this.queryParam.endDate = date[1] ? date[1] + ' 23:59:59' : ''
     },
     // 合计
     getTotal (params) {
@@ -143,8 +142,8 @@ export default {
     //  重置
     resetSearchForm () {
       this.$refs.rangeDate.resetDate(this.createDate)
-      this.queryParam.beginDate = getDate.getRecentTime().starttime
-      this.queryParam.endDate = getDate.getRecentTime().endtime
+      this.queryParam.beginDate = getDate.getRecentday().starttime + ' 00:00:00'
+      this.queryParam.endDate = getDate.getRecentday().endtime + ' 23:59:59'
       this.queryParam.customer.customerSn = undefined
       this.queryParam.dealerProduct.name = ''
       this.queryParam.dealerProduct.code = ''

+ 1 - 1
src/views/inventoryManagement/inventoryChecking/selfDisk.vue

@@ -121,7 +121,7 @@
         <a-collapse-panel key="1">
           <template slot="header">
             已选产品
-            <a-button size="small" class="import-btn" id="selfDisk-import-btn" @click.stop="handleImport">导入明细</a-button>
+            <!-- <a-button size="small" class="import-btn" id="selfDisk-import-btn" @click.stop="handleImport">导入明细</a-button> -->
           </template>
           <!-- 已选产品 -->
           <div>

+ 4 - 10
src/views/inventoryManagement/inventoryQuery/list.vue

@@ -77,8 +77,8 @@
       <!-- 合计 -->
       <a-alert type="info" showIcon style="margin-bottom:15px">
         <div class="ftext" slot="message">
-          现有库存总数量(个):<strong>{{ currentStock&&(currentStock.currentStockQty || currentStock.currentStockQty==0) ? currentStock.currentStockQty : '--' }}</strong>;
-          现有库存总成本(¥):<strong>{{ currentStock&&(currentStock.currentStockCost || currentStock.currentStockCost==0) ? currentStock.currentStockCost : '--' }}</strong>。
+          现有库存总数量(个):<strong>{{ currentStock&&(currentStock.totalCurrentStockQty || currentStock.totalCurrentStockQty==0) ? currentStock.totalCurrentStockQty : '--' }}</strong>;
+          现有库存总成本(¥):<strong>{{ currentStock&&(currentStock.totalCurrentStockCost || currentStock.totalCurrentStockCost==0) ? currentStock.totalCurrentStockCost : '--' }}</strong>。
         </div>
       </a-alert>
       <!-- 列表 -->
@@ -210,10 +210,7 @@ export default {
       },
       openModal: false, //  查看库存详情  弹框
       itemId: '', //  当前库存记录id
-      currentStock: { // 合计信息
-        currentStockQty: '',
-        currentStockCost: ''
-      }
+      currentStock: null
     }
   },
   methods: {
@@ -238,10 +235,7 @@ export default {
         if (res.status == 200 && res.data) {
           this.currentStock = res.data
         } else {
-          this.currentStock = { // 合计信息
-            currentStockQty: '',
-            currentStockCost: ''
-          }
+          this.currentStock = null
         }
       })
     },

+ 4 - 1
src/views/inventoryManagement/inventoryWarning/list.vue

@@ -83,7 +83,7 @@
       </div>
       <!-- 操作按钮 -->
       <div class="table-operator">
-        <a-button type="primary" v-if="$hasPermissions('B_inventoryWarningBatchSave')" id="inventoryWarningList-update" :loading="loading" @click="handleupdate">批量更新</a-button>
+        <a-button type="primary" v-if="$hasPermissions('B_inventoryWarningBatchSave')" id="inventoryWarningList-update" @click="handleupdate">批量更新</a-button>
         <span style="margin-left: 8px" v-if="$hasPermissions('B_inventoryWarningBatchSave')">
           <template v-if="hasSelected">{{ `已选 ${selectedRowKeys.length} 项` }}</template>
         </span>
@@ -99,6 +99,7 @@
         :dataSource="loadData"
         :scroll="{ x: 2200, y: tableHeight }"
         :pagination="paginationProps"
+        :loading="loading"
         bordered>
         <!-- 产品分类 -->
         <template slot="productType" slot-scope="text, record">
@@ -249,9 +250,11 @@ export default {
         this.tableHeight = window.innerHeight - 380
       }
       this.disabled = true
+      this.loading = true
       this.pageNo = pageNo || this.pageNo
       const params = Object.assign({ pageNo: this.pageNo, pageSize: this.pageSize }, this.queryParam)
       stockWarnList(params).then(res => {
+        this.loading = false
         if (res.status == 200) {
           const data = res.data
           this.paginationProps.total = Number(res.data.count) || 0

+ 1 - 1
src/views/inventoryManagement/satelliteWarehouseInventory/list.vue

@@ -14,7 +14,7 @@
           <a-row :gutter="15">
             <a-col :md="6" :sm="24">
               <a-form-model-item label="客户名称" prop="customer.customerSn">
-                <custSatelliteList ref="custSatelliteList" @change="custSatelliteChange"></custSatelliteList>
+                <custSatelliteList ref="custSatelliteList" :verify="true" @change="custSatelliteChange"></custSatelliteList>
               </a-form-model-item>
             </a-col>
             <a-col :md="6" :sm="24">

+ 3 - 3
src/views/productManagement/productInfo/detailModal.vue

@@ -42,9 +42,9 @@ export default {
   },
   computed: {
     productTypeName () {
-      const productTypeName1 = this.detailsData.productTypeName1 ? this.detailsData.productTypeName1 : ''
-      const productTypeName2 = this.detailsData.productTypeName2 ? ' > ' + this.detailsData.productTypeName2 : ''
-      const productTypeName3 = this.detailsData.productTypeName3 ? ' > ' + this.detailsData.productTypeName3 : ''
+      const productTypeName1 = this.detailsData&&this.detailsData.productTypeName1 ? this.detailsData.productTypeName1 : ''
+      const productTypeName2 = this.detailsData&&this.detailsData.productTypeName2 ? ' > ' + this.detailsData.productTypeName2 : ''
+      const productTypeName3 = this.detailsData&&this.detailsData.productTypeName3 ? ' > ' + this.detailsData.productTypeName3 : ''
       return productTypeName1 + productTypeName2 + productTypeName3
     }
   },

+ 1 - 1
src/views/productManagement/productInfoJg/list.vue

@@ -188,7 +188,7 @@ export default {
             )
           }
           if (res.data.isShowSpecialPrice && res.data.isShowSpecialPrice == '1') { //  是否展示特约价
-            this.columns.push({ title: '特约价', dataIndex: 'specialPrice', width: 100, align: 'center' })
+            this.columns.push({ title: '特约价', dataIndex: 'specialPrice', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
           }
           this.columns = [...this.columns, ...cArr]
         }

+ 15 - 1
src/views/purchasingManagement/purchaseOrder/basicInfoModal.vue

@@ -44,7 +44,7 @@
       </a-form-model>
     </a-spin>
     <!-- 选择地址 -->
-    <choose-address-modal :openModal="openAddrModal" @ok="handleOk" @close="openAddrModal=false" />
+    <choose-address-modal :openModal="openAddrModal" @ok="handleOk" @verify="verifyFun" @close="openAddrModal=false" />
   </a-modal>
 </template>
 
@@ -96,6 +96,7 @@ export default {
       purchaseTragetType: [],
       addressVal: '选择地址', //  选择地址/更换地址
       chooseAddr: '', //  当前已选地址信息
+      addressId: undefined,
       openAddrModal: false // 选择地址弹框是否显示
     }
   },
@@ -198,10 +199,23 @@ export default {
         if (res.status == 200) {
           if (res.data.length == 1) {
             res.data[0].address = res.data[0].provinceName + '-' + res.data[0].cityName + '-' + res.data[0].countyName + '-' + res.data[0].addr
+            this.addressId = res.data[0].id || undefined
             this.handleOk(res.data[0])
           }
         }
       })
+    },
+    verifyFun (id) {
+      if (id == this.addressId) {
+        this.chooseAddr = ''
+        this.addressVal = '选择地址'
+        this.form.shippingAddressProvinceName = ''// 省
+        this.form.shippingAddressCityName = '' // 市
+        this.form.shippingAddressCountyName = '' // 区
+        this.form.shippingAddress = ''// 详细地址
+        this.form.consigneeTel = '' // 联系电话
+        this.form.consigneeName = ''
+      }
     }
   },
   watch: {

+ 1 - 0
src/views/purchasingManagement/purchaseOrder/receivingAddress/chooseAddressModal.vue

@@ -174,6 +174,7 @@ export default {
           }).then(res => {
             if (res.status == 200) {
               _this.$message.success(res.message)
+              _this.$emit('verify', row.id)
               _this.$refs.table.refresh(true)
               _this.spinning = false
             } else {

+ 23 - 11
src/views/purchasingManagement/purchaseOrder/receivingAddress/editAddressModal.vue

@@ -38,22 +38,22 @@
             <!-- 所在地区 -->
             <a-col span="8">
               <a-form-model-item prop="provinceSn">
-                <a-select id="editAddress-provinceSn" @change="getCityList" v-model="form.provinceSn" placeholder="请选择省">
-                  <a-select-option v-for="item in addrProvinceList" :value="item.id" :key="item.id + 'a'">{{ item.name }}</a-select-option>
+                <a-select id="editAddress-provinceSn" allowClear @change="getCityList" v-model="form.provinceSn" 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>
             </a-col>
             <a-col span="8">
               <a-form-model-item prop="citySn">
-                <a-select id="editAddress-citySn" @change="getAreaList" v-model="form.citySn" placeholder="请选择市">
-                  <a-select-option v-for="item in addrCityList" :value="item.id" :key="item.id + 'b'">{{ item.name }}</a-select-option>
+                <a-select id="editAddress-citySn" allowClear @change="getAreaList" v-model="form.citySn" placeholder="请选择市">
+                  <a-select-option v-for="item in addrCityList" :value="item.areaSn" :key="item.areaSn + 'b'">{{ item.name }}</a-select-option>
                 </a-select>
               </a-form-model-item>
             </a-col>
             <a-col span="8">
               <a-form-model-item prop="countySn">
-                <a-select id="editAddress-countySn" @change="areaCharged" v-model="form.countySn" placeholder="请选择区/县">
-                  <a-select-option v-for="item in addrDistrictList" :value="item.id" :key="item.id + 'c'">{{ item.name }}</a-select-option>
+                <a-select id="editAddress-countySn" allowClear @change="areaCharged" v-model="form.countySn" placeholder="请选择区/县">
+                  <a-select-option v-for="item in addrDistrictList" :value="item.areaSn" :key="item.areaSn + 'c'">{{ item.name }}</a-select-option>
                 </a-select>
               </a-form-model-item>
             </a-col>
@@ -161,19 +161,31 @@ export default {
       this.addrDistrictList = []
       this.form.citySn = undefined
       this.form.countySn = undefined
-      this.form.provinceName = this.addrProvinceList.find(item => item.id == val).name
-      this.getArea('city', val)
+      if (val) {
+        this.getArea('city', val)
+        this.form.provinceName = this.addrProvinceList.find(item => item.areaSn == val).name
+      } else {
+        this.form.provinceName = ''
+      }
     },
     // 获取区县列表
     getAreaList (val) {
       this.addrDistrictList = []
       this.form.countySn = undefined
-      this.form.cityName = this.addrCityList.find(item => item.id == val).name
-      this.getArea('district', val)
+      if (val) {
+        this.getArea('district', val)
+        this.form.cityName = this.addrCityList.find(item => item.areaSn == val).name
+      } else {
+        this.form.cityName = ''
+      }
     },
     // 区县变更
     areaCharged (val) {
-      this.form.countyName = this.addrDistrictList.find(item => item.id == val).name
+      if (val) {
+        this.form.countyName = this.addrDistrictList.find(item => item.areaSn == val).name
+      } else {
+        this.form.countyName = ''
+      }
     },
     //  省/市/区
     getArea (leve, sn) {

+ 2 - 2
src/views/purchasingManagement/purchaseOrder/warehousing.vue

@@ -92,11 +92,11 @@ export default {
         { title: '产品编码', dataIndex: 'dealerProductEntity.code', width: 220, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '产品名称', dataIndex: 'dealerProductEntity.name', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '原厂编码', dataIndex: 'dealerProductEntity.origCode', width: 220, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '采购单价', dataIndex: 'price', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '采购单价', dataIndex: 'discountedPrice', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '采购数量', dataIndex: 'qty', width: 100, align: 'center', scopedSlots: { customRender: 'origqty' } },
         { title: '本次发货数量', dataIndex: 'shippedQty', width: 120, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '单位', dataIndex: 'dealerProductEntity.unit', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '本次发货金额', dataIndex: 'totalAmount', width: 120, align: 'center', customRender: function (text) { return ((text || text == 0) ? ('¥' + text) : '--') }, fixed: 'right' },
+        { title: '本次发货金额', dataIndex: 'discountedAmount', width: 120, align: 'center', customRender: function (text) { return ((text || text == 0) ? ('¥' + text) : '--') }, fixed: 'right' },
         { title: '本次入库数量', dataIndex: 'putQty', width: 120, align: 'center', customRender: function (text) { return text || '--' }, fixed: 'right' },
         { title: '仓库仓位', scopedSlots: { customRender: 'warehousePosition' }, width: 250, align: 'center', fixed: 'right' }
       ],

+ 9 - 1
src/views/purchasingManagement/purchaseReturn/edit.vue

@@ -46,6 +46,7 @@
               :rowKey="(record) => record.id"
               :columns="columns"
               :dataSource="loadData"
+              :loading="loading"
               :scroll="{ x: 1320, y: 300 }"
               :pagination="paginationProps"
               bordered>
@@ -74,7 +75,7 @@
           <a-collapse-panel key="1">
             <template slot="header">
               已选产品
-              <a-button size="small" class="import-btn" id="purchaseReturnEdit-import-btn" @click.stop="handleImport">导入明细</a-button>
+              <!-- <a-button size="small" class="import-btn" id="purchaseReturnEdit-import-btn" @click.stop="handleImport">导入明细</a-button> -->
               <a-button
                 size="small"
                 type="primary"
@@ -91,6 +92,7 @@
               :rowKey="(record) => record.id"
               :columns="chooseColumns"
               :dataSource="chooseLoadData"
+              :loading="chooseLoading"
               :scroll="{ x: 1420, y: 300 }"
               :pagination="choosePaginationProps"
               bordered>
@@ -147,6 +149,8 @@ export default {
   data () {
     return {
       spinning: false,
+      loading: false,
+      chooseLoading: false,
       queryParam: {
         purchaseBillNo: '',
         productCode: '',
@@ -337,8 +341,10 @@ export default {
     getPurchaseBillDetailList (pageNo) {
       this.pageNo = this.pageNo || pageNo
       this.disabled = true
+      this.loading = true
       const params = Object.assign({ pageNo: this.pageNo, pageSize: this.pageSize }, this.queryParam)
       purchaseReturnPurchaseBillDetailList(params).then(res => {
+        this.loading = false
         if (res.status == 200) {
           const data = res.data
           this.paginationProps.total = Number(res.data.count) || 0
@@ -375,7 +381,9 @@ export default {
         pageSize: this.choosePageSize,
         purchaseReturnSn: this.$route.params.sn
       }
+      this.chooseLoading = true
       purchaseReturnDetailList(params).then(res => {
+        this.chooseLoading = false
         if (res.status == 200) {
           const data = res.data
           this.choosePaginationProps.total = Number(res.data.count) || 0

+ 10 - 5
src/views/reportData/chainSalesDetailReport/list.vue

@@ -51,21 +51,21 @@
                     <a-col span="7">
                       <a-form-model-item prop="provinceSn" style="margin: 0;">
                         <a-select v-model="queryParam.provinceSn" @change="getCityList" placeholder="请选择省" allowClear>
-                          <a-select-option v-for="item in addrProvinceList" :value="item.id" :key="item.id + 'a'">{{ item.name }}</a-select-option>
+                          <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>
                     </a-col>
                     <a-col span="7" offset="1">
                       <a-form-model-item prop="citySn" style="margin: 0;">
                         <a-select v-model="queryParam.citySn" @change="getAreaList" placeholder="请选择市" allowClear>
-                          <a-select-option v-for="item in addrCityList" :value="item.id" :key="item.id + 'b'">{{ item.name }}</a-select-option>
+                          <a-select-option v-for="item in addrCityList" :value="item.areaSn" :key="item.areaSn + '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="countySn" style="margin: 0;">
                         <a-select v-model="queryParam.countySn" placeholder="请选择区/县" allowClear>
-                          <a-select-option v-for="item in addrDistrictList" :value="item.id" :key="item.id + 'c'">{{ item.name }}</a-select-option>
+                          <a-select-option v-for="item in addrDistrictList" :value="item.areaSn" :key="item.areaSn + 'c'">{{ item.name }}</a-select-option>
                         </a-select>
                       </a-form-model-item>
                     </a-col>
@@ -127,6 +127,7 @@
                     id="chainSalesDetailReportList-warehouseCascade"
                     placeholder="请选择仓库仓位"
                     @change="warehouseCascadeChange"
+                    allowClear
                     style="width: 100%;" />
                 </a-form-model-item>
               </a-col>
@@ -433,13 +434,17 @@ export default {
       this.addrDistrictList = []
       this.queryParam.citySn = undefined
       this.queryParam.countySn = undefined
-      this.getArea('city', val)
+      if (val) {
+        this.getArea('city', val)
+      }
     },
     // 获取区县列表
     getAreaList (val) {
       this.addrDistrictList = []
       this.queryParam.countySn = undefined
-      this.getArea('district', val)
+      if (val) {
+        this.getArea('district', val)
+      }
     },
     //  省/市/区
     getArea (leve, sn) {

+ 12 - 8
src/views/reportData/chainSalesReport/list.vue

@@ -50,22 +50,22 @@
                   <a-form-model-item label="客户所在区" :labelCol="{span: 4}" :wrapperCol="{ span: 20 }">
                     <a-col span="7">
                       <a-form-model-item prop="provinceSn" style="margin: 0;">
-                        <a-select v-model="queryParam.provinceSn" @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 v-model="queryParam.provinceSn" allowClear @change="getCityList" 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>
                     </a-col>
                     <a-col span="7" offset="1">
                       <a-form-model-item prop="citySn" style="margin: 0;">
-                        <a-select v-model="queryParam.citySn" @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 v-model="queryParam.citySn" allowClear @change="getAreaList" placeholder="请选择市">
+                          <a-select-option v-for="item in addrCityList" :value="item.areaSn" :key="item.areaSn + '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="countySn" style="margin: 0;">
-                        <a-select v-model="queryParam.countySn" placeholder="请选择区/县">
-                          <a-select-option v-for="item in addrDistrictList" :value="item.id" :key="item.id + 'c'">{{ item.name }}</a-select-option>
+                        <a-select v-model="queryParam.countySn" allowClear placeholder="请选择区/县">
+                          <a-select-option v-for="item in addrDistrictList" :value="item.areaSn" :key="item.areaSn + 'c'">{{ item.name }}</a-select-option>
                         </a-select>
                       </a-form-model-item>
                     </a-col>
@@ -299,13 +299,17 @@ export default {
       this.addrDistrictList = []
       this.queryParam.citySn = undefined
       this.queryParam.countySn = undefined
-      this.getArea('city', val)
+      if (val) {
+        this.getArea('city', val)
+      }
     },
     // 获取区县列表
     getAreaList (val) {
       this.addrDistrictList = []
       this.queryParam.countySn = undefined
-      this.getArea('district', val)
+      if (val) {
+        this.getArea('district', val)
+      }
     },
     //  省/市/区
     getArea (leve, sn) {

+ 12 - 8
src/views/reportData/customerReport/list.vue

@@ -37,22 +37,22 @@
                   <a-form-model-item label="客户所在区" :labelCol="{span: 4}" :wrapperCol="{ span: 20 }">
                     <a-col span="7">
                       <a-form-model-item prop="provinceSn" style="margin: 0;">
-                        <a-select v-model="queryParam.provinceSn" @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 v-model="queryParam.provinceSn" allowClear @change="getCityList" 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>
                     </a-col>
                     <a-col span="7" offset="1">
                       <a-form-model-item prop="citySn" style="margin: 0;">
-                        <a-select v-model="queryParam.citySn" @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 v-model="queryParam.citySn" allowClear @change="getAreaList" placeholder="请选择市">
+                          <a-select-option v-for="item in addrCityList" :value="item.areaSn" :key="item.areaSn + '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="countySn" style="margin: 0;">
-                        <a-select v-model="queryParam.countySn" placeholder="请选择区/县">
-                          <a-select-option v-for="item in addrDistrictList" :value="item.id" :key="item.id + 'c'">{{ item.name }}</a-select-option>
+                        <a-select v-model="queryParam.countySn" allowClear placeholder="请选择区/县">
+                          <a-select-option v-for="item in addrDistrictList" :value="item.areaSn" :key="item.areaSn + 'c'">{{ item.name }}</a-select-option>
                         </a-select>
                       </a-form-model-item>
                     </a-col>
@@ -245,13 +245,17 @@ export default {
       this.addrDistrictList = []
       this.queryParam.citySn = undefined
       this.queryParam.countySn = undefined
-      this.getArea('city', val)
+      if (val) {
+        this.getArea('city', val)
+      }
     },
     // 获取区县列表
     getAreaList (val) {
       this.addrDistrictList = []
       this.queryParam.countySn = undefined
-      this.getArea('district', val)
+      if (val) {
+        this.getArea('district', val)
+      }
     },
     //  省/市/区
     getArea (leve, sn) {

+ 80 - 47
src/views/salesManagement/salesQuery/chooseCustomModal.vue

@@ -32,36 +32,36 @@
           </a-col>
         </a-row>
         <a-row :gutter="15">
-          <a-col :span="16">
-            <a-form-model-item label="客户地址" required style="margin: 0;" :labelCol="{ span: 4 }" :wrapperCol="{ span: 20 }">
+          <a-col :span="24">
+            <a-form-model-item label="客户地址" required style="margin: 0;" :labelCol="{ span: 2 }" :wrapperCol="{ span: 22 }">
               <a-row :gutter="15">
                 <!-- 客户地址 -->
                 <a-col span="8">
                   <a-form-model-item prop="shippingAddressProvinceSn">
-                    <a-select id="chooseCustom-provinceSn" @change="getCityList" v-model="form.shippingAddressProvinceSn" placeholder="请选择省">
-                      <a-select-option v-for="item in addrProvinceList" :value="item.id" :key="item.id + 'a'">{{ item.name }}</a-select-option>
+                    <a-select id="chooseCustom-provinceSn" allowClear @change="getCityList" v-model="form.shippingAddressProvinceSn" 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>
                 </a-col>
                 <a-col span="8">
                   <a-form-model-item prop="shippingAddressCitySn">
-                    <a-select id="chooseCustom-citySn" @change="getAreaList" v-model="form.shippingAddressCitySn" placeholder="请选择市">
-                      <a-select-option v-for="item in addrCityList" :value="item.id" :key="item.id + 'b'">{{ item.name }}</a-select-option>
+                    <a-select id="chooseCustom-citySn" allowClear @change="getAreaList" v-model="form.shippingAddressCitySn" placeholder="请选择市">
+                      <a-select-option v-for="item in addrCityList" :value="item.areaSn" :key="item.areaSn + 'b'">{{ item.name }}</a-select-option>
                     </a-select>
                   </a-form-model-item>
                 </a-col>
                 <a-col span="8">
                   <a-form-model-item prop="shippingAddressCountySn">
-                    <a-select id="chooseCustom-countySn" @change="areaCharged" v-model="form.shippingAddressCountySn" placeholder="请选择区/县">
-                      <a-select-option v-for="item in addrDistrictList" :value="item.id" :key="item.id + 'c'">{{ item.name }}</a-select-option>
+                    <a-select id="chooseCustom-countySn" allowClear @change="areaCharged" v-model="form.shippingAddressCountySn" placeholder="请选择区/县">
+                      <a-select-option v-for="item in addrDistrictList" :value="item.areaSn" :key="item.areaSn + 'c'">{{ item.name }}</a-select-option>
                     </a-select>
                   </a-form-model-item>
                 </a-col>
               </a-row>
             </a-form-model-item>
           </a-col>
-          <a-col :span="8">
-            <a-form-model-item label="" prop="shippingAddress">
+          <a-col :span="24">
+            <a-form-model-item label="详细地址" prop="shippingAddress" :labelCol="{ span: 2 }" :wrapperCol="{ span: 22 }">
               <a-input
                 id="chooseCustom-shippingAddress"
                 :maxLength="60"
@@ -86,8 +86,18 @@
             <a-form-model-item label="联系电话" prop="consigneeTel">
               <a-input
                 id="chooseCustom-consigneeTel"
-                :maxLength="11"
+                :maxLength="15"
                 v-model="form.consigneeTel"
+                placeholder="请输入联系电话(最多15个字符)"
+                allowClear />
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="8">
+            <a-form-model-item label="联系手机" prop="contactMobile">
+              <a-input
+                id="chooseCustom-contactMobile"
+                :maxLength="11"
+                v-model="form.contactMobile"
                 placeholder="请输入联系电话(最多11个字符)"
                 allowClear />
             </a-form-model-item>
@@ -122,7 +132,7 @@
           </a-col> -->
           <a-col :span="8">
             <a-form-model-item label="收款方式" prop="settleStyleSn">
-              <a-select placeholder="请选择收款方式" v-model="form.settleStyleSn">
+              <a-select placeholder="请选择收款方式" allowClear v-model="form.settleStyleSn">
                 <a-select-option v-for="item in settleStyleList" :key="item.settleStyleSn" :value="item.settleStyleSn">
                   {{ item.name }}
                 </a-select-option>
@@ -138,7 +148,7 @@
         <a-row :gutter="15">
           <a-col :span="8">
             <a-form-model-item label="业务员" prop="salesManSn">
-              <a-select id="chooseCustom-salesManSn" @change="salesManChange" v-model="form.salesManSn" placeholder="请选择业务员">
+              <a-select id="chooseCustom-salesManSn" allowClear @change="salesManChange" v-model="form.salesManSn" placeholder="请选择业务员">
                 <a-select-option v-for="item in userList" :value="item.id" :key="item.id + 'c'">{{ item.name }}</a-select-option>
               </a-select>
             </a-form-model-item>
@@ -208,8 +218,8 @@ export default {
       title: '选择客户',
       confirmLoading: false,
       formItemLayout: {
-        labelCol: { span: 8 },
-        wrapperCol: { span: 16 }
+        labelCol: { span: 6 },
+        wrapperCol: { span: 18 }
       },
       buyerSnBak: '', // 更改前客户sn备份
       priceTypeBak: '', // 更改前客户价格类型备份
@@ -217,6 +227,7 @@ export default {
         buyerName: '', // 客户名称
         buyerSn: undefined, // 客户sn
         consigneeTel: '', //  联系电话
+        contactMobile: '',
         consigneeName: '', //  联系人
         shippingAddressProvinceSn: undefined, //  省
         shippingAddressProvinceName: '',
@@ -229,7 +240,7 @@ export default {
         dispatchType: undefined, //  配送方式
         satelliteFlag: 0, //  是否卫星仓客户
         priceType: undefined, //  价格类型
-        settleStyleSn: '', //  收款方式
+        settleStyleSn: undefined, //  收款方式
         salesManSn: undefined, //  业务员
         salesManName: '',
         distributionFlag: '0', // 铺货出库
@@ -240,7 +251,7 @@ export default {
         buyerSn: [
           { required: true, message: '请选择客户', trigger: ['change', 'blur'] }
         ],
-        consigneeTel: [{ required: true, message: '请输入联系电话', trigger: 'blur' }, { pattern: /^\d{11}$/, message: '请输入正确的手机号' }],
+        contactMobile: [{ required: false, pattern: /^\d{11}$/, message: '请输入正确的手机号', trigger: 'blur' }],
         shippingAddressProvinceSn: [
           { required: true, message: '请选择省', trigger: 'change' }
         ],
@@ -250,9 +261,6 @@ export default {
         shippingAddressCountySn: [
           { required: true, message: '请选择区/县', trigger: 'change' }
         ],
-        shippingAddress: [
-          { required: true, message: '请输入详细地址', trigger: 'blur' }
-        ],
         priceType: [
           { required: true, message: '请选择价格类型', trigger: ['change', 'blur'] }
         ],
@@ -296,33 +304,42 @@ export default {
     },
     // 业务员
     salesManChange (id) {
-      this.form.salesManName = this.userList.find(item => item.id == id).name
+      if (id) {
+        this.form.salesManName = this.userList.find(item => item.id == id).name
+      } else {
+        this.form.salesManName = ''
+      }
     },
     // 客户 change
     custChange (obj) {
       const _this = this
-      const cust = obj.row
-      this.form.buyerSn = cust.customerSn
-      // 编辑
-      if (this.isEdit) {
-        this.$confirm({
-          title: '提示',
-          content: '更换客户后信息需要重新完善,确认要更换吗?',
-          centered: true,
-          onOk () {
-            _this.custId = cust.id
-            _this.form.buyerName = cust.customerName
-            _this.priceTypeDisabled = false
-            _this.getDetail()
-          },
-          onCancel () {
-            _this.form.buyerSn = _this.buyerSnBak
-          }
-        })
+      if (obj && obj.key) {
+        const cust = obj.row
+        this.form.buyerSn = cust.customerSn
+        // 编辑
+        if (this.isEdit) {
+          this.$confirm({
+            title: '提示',
+            content: '更换客户后信息需要重新完善,确认要更换吗?',
+            centered: true,
+            onOk () {
+              _this.custId = cust.id
+              _this.form.buyerName = cust.customerName
+              _this.priceTypeDisabled = false
+              _this.getDetail()
+            },
+            onCancel () {
+              _this.form.buyerSn = _this.buyerSnBak
+            }
+          })
+        } else {
+          _this.custId = cust.id
+          _this.form.buyerName = cust.customerName
+          _this.getDetail()
+        }
       } else {
-        _this.custId = cust.id
-        _this.form.buyerName = cust.customerName
-        _this.getDetail()
+        this.$refs.ruleForm.resetFields()
+        this.$refs.custList.resetForm()
       }
     },
     // 编辑客户信息
@@ -348,6 +365,7 @@ export default {
             buyerName: data.customerName, // 客户名称
             buyerSn: data.customerSn, // 客户sn
             consigneeTel: data.contactTel, //  联系电话
+            contactMobile: data.contactMobile,
             consigneeName: data.contactName, //  联系人
             shippingAddressProvinceSn: data.provinceSn, //  省
             shippingAddressProvinceName: data.provinceName,
@@ -377,6 +395,7 @@ export default {
         customerName: this.form.buyerName,
         customerSn: this.form.buyerSn,
         contactTel: this.form.consigneeTel, //  联系电话
+        contactMobile: this.form.contactMobile,
         contactName: this.form.consigneeName, //  联系人
         provinceSn: this.form.shippingAddressProvinceSn, //  省
         provinceName: this.form.shippingAddressProvinceName,
@@ -405,6 +424,7 @@ export default {
     handleSubmit (e) {
       e.preventDefault()
       const _this = this
+      console.log(_this.form, '------save')
       this.$refs.ruleForm.validate(valid => {
         if (valid) {
           // 如果价格类型改变,提示
@@ -451,6 +471,7 @@ export default {
       this.opened = false
       this.$emit('cancel')
       this.$refs.ruleForm.resetFields()
+      this.$refs.custList.resetForm()
     },
     cancelNewCust () {
       this.isNewCust = false
@@ -475,8 +496,12 @@ export default {
       this.form.shippingAddressCountySn = undefined
       this.form.shippingAddressCountyName = ''
       this.form.shippingAddress = ''
-      this.form.shippingAddressProvinceName = this.addrProvinceList.find(item => item.id == val).name
-      this.getArea('city', val)
+      if (val) {
+        this.getArea('city', val)
+        this.form.shippingAddressProvinceName = this.addrProvinceList.find(item => item.areaSn == val).name
+      } else {
+        this.form.shippingAddressProvinceName = ''
+      }
     },
     // 获取区县列表
     getAreaList (val) {
@@ -484,13 +509,21 @@ export default {
       this.form.shippingAddressCountySn = undefined
       this.form.shippingAddressCountyName = ''
       this.form.shippingAddress = ''
-      this.form.shippingAddressCityName = this.addrCityList.find(item => item.id == val).name
-      this.getArea('district', val)
+      if (val) {
+        this.getArea('district', val)
+        this.form.shippingAddressCityName = this.addrCityList.find(item => item.areaSn == val).name
+      } else {
+        this.form.shippingAddressCityName = ''
+      }
     },
     // 区县变更
     areaCharged (val) {
       this.form.shippingAddress = ''
-      this.form.shippingAddressCountyName = this.addrDistrictList.find(item => item.id == val).name
+      if (val) {
+        this.form.shippingAddressCountyName = this.addrDistrictList.find(item => item.areaSn == val).name
+      } else {
+        this.form.shippingAddressCountyName = ''
+      }
     },
     //  省/市/区
     getArea (leve, sn) {

+ 71 - 45
src/views/salesManagement/salesReturn/chooseCustomModal.vue

@@ -32,36 +32,36 @@
           </a-col> -->
         </a-row>
         <a-row :gutter="15">
-          <a-col :span="16">
-            <a-form-model-item label="客户地址" required style="margin: 0;" :labelCol="{ span: 4 }" :wrapperCol="{ span: 20 }">
+          <a-col :span="24">
+            <a-form-model-item label="客户地址" required style="margin: 0;" :labelCol="{ span: 2 }" :wrapperCol="{ span: 22 }">
               <a-row :gutter="15">
                 <!-- 客户地址 -->
                 <a-col span="8">
                   <a-form-model-item prop="provinceSn">
-                    <a-select id="chooseCustom-provinceSn" @change="getCityList" v-model="form.provinceSn" placeholder="请选择省">
-                      <a-select-option v-for="item in addrProvinceList" :value="item.id" :key="item.id + 'a'">{{ item.name }}</a-select-option>
+                    <a-select id="chooseCustom-provinceSn" allowClear @change="getCityList" v-model="form.provinceSn" 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>
                 </a-col>
                 <a-col span="8">
                   <a-form-model-item prop="citySn">
-                    <a-select id="chooseCustom-citySn" @change="getAreaList" v-model="form.citySn" placeholder="请选择市">
-                      <a-select-option v-for="item in addrCityList" :value="item.id" :key="item.id + 'b'">{{ item.name }}</a-select-option>
+                    <a-select id="chooseCustom-citySn" allowClear @change="getAreaList" v-model="form.citySn" placeholder="请选择市">
+                      <a-select-option v-for="item in addrCityList" :value="item.areaSn" :key="item.areaSn + 'b'">{{ item.name }}</a-select-option>
                     </a-select>
                   </a-form-model-item>
                 </a-col>
                 <a-col span="8">
                   <a-form-model-item prop="countySn">
-                    <a-select id="chooseCustom-countySn" @change="areaCharged" v-model="form.countySn" placeholder="请选择区/县">
-                      <a-select-option v-for="item in addrDistrictList" :value="item.id" :key="item.id + 'c'">{{ item.name }}</a-select-option>
+                    <a-select id="chooseCustom-countySn" allowClear @change="areaCharged" v-model="form.countySn" placeholder="请选择区/县">
+                      <a-select-option v-for="item in addrDistrictList" :value="item.areaSn" :key="item.areaSn + 'c'">{{ item.name }}</a-select-option>
                     </a-select>
                   </a-form-model-item>
                 </a-col>
               </a-row>
             </a-form-model-item>
           </a-col>
-          <a-col :span="8">
-            <a-form-model-item label="" prop="customerAddr">
+          <a-col :span="24">
+            <a-form-model-item label="详细地址" prop="customerAddr" :labelCol="{ span: 2 }" :wrapperCol="{ span: 22 }">
               <a-input
                 id="chooseCustom-customerAddr"
                 :maxLength="60"
@@ -86,9 +86,19 @@
             <a-form-model-item label="联系电话" prop="consigneeTel">
               <a-input
                 id="chooseCustom-consigneeTel"
-                :maxLength="30"
+                :maxLength="15"
                 v-model="form.consigneeTel"
-                placeholder="请输入联系电话(最多30个字符)"
+                placeholder="请输入联系电话(最多15个字符)"
+                allowClear />
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="8">
+            <a-form-model-item label="联系手机" prop="contactMobile">
+              <a-input
+                id="chooseCustom-contactMobile"
+                :maxLength="11"
+                v-model="form.contactMobile"
+                placeholder="请输入联系手机(最多11个字符)"
                 allowClear />
             </a-form-model-item>
           </a-col>
@@ -144,14 +154,15 @@ export default {
       title: '选择客户',
       confirmLoading: false,
       formItemLayout: {
-        labelCol: { span: 8 },
-        wrapperCol: { span: 16 }
+        labelCol: { span: 6 },
+        wrapperCol: { span: 18 }
       },
       buyerSnBak: '', // 更改前客户sn备份
       form: {
         buyerName: '', // 客户名称
         buyerSn: undefined, // 客户sn
         consigneeTel: '', //  联系电话
+        contactMobile: '',
         consigneeName: '', //  联系人
         priceType: '', // 价格类型
         provinceSn: undefined, //  省
@@ -167,9 +178,7 @@ export default {
         buyerSn: [
           { required: true, message: '请选择客户', trigger: ['change', 'blur'] }
         ],
-        consigneeTel: [
-          { required: true, message: '请输入联系电话', trigger: 'blur' }
-        ],
+        contactMobile: [{ required: false, pattern: /^\d{11}$/, message: '请输入正确的手机号', trigger: 'blur' }],
         provinceSn: [
           { required: true, message: '请选择省', trigger: 'change' }
         ],
@@ -179,9 +188,6 @@ export default {
         countySn: [
           { required: true, message: '请选择区/县', trigger: 'change' }
         ],
-        customerAddr: [
-          { required: true, message: '请输入详细地址', trigger: 'blur' }
-        ],
         grabFlag: [
           { required: true, message: '请选择是否铺货出库', trigger: 'change' }
         ]
@@ -218,27 +224,32 @@ export default {
     // 客户 change
     custChange (obj) {
       const _this = this
-      const cust = obj.row
-      this.form.buyerSn = cust.customerSn
-      // 编辑
-      if (this.isEdit) {
-        this.$confirm({
-          title: '提示',
-          content: '更换客户后信息需要重新完善,确认要更换吗?',
-          centered: true,
-          onOk () {
-            _this.custId = cust.id
-            _this.form.buyerName = cust.customerName
-            _this.getDetail()
-          },
-          onCancel () {
-            _this.form.buyerSn = _this.buyerSnBak
-          }
-        })
+      if (obj && obj.key) {
+        const cust = obj.row
+        this.form.buyerSn = cust.customerSn
+        // 编辑
+        if (this.isEdit) {
+          this.$confirm({
+            title: '提示',
+            content: '更换客户后信息需要重新完善,确认要更换吗?',
+            centered: true,
+            onOk () {
+              _this.custId = cust.id
+              _this.form.buyerName = cust.customerName
+              _this.getDetail()
+            },
+            onCancel () {
+              _this.form.buyerSn = _this.buyerSnBak
+            }
+          })
+        } else {
+          _this.custId = cust.id
+          _this.form.buyerName = cust.customerName
+          _this.getDetail()
+        }
       } else {
-        _this.custId = cust.id
-        _this.form.buyerName = cust.customerName
-        _this.getDetail()
+        this.$refs.ruleForm.resetFields()
+        this.$refs.custList.resetForm()
       }
     },
     // 编辑客户信息
@@ -262,6 +273,7 @@ export default {
             buyerName: data.customerName, // 客户名称
             buyerSn: data.customerSn, // 客户sn
             consigneeTel: data.contactTel, //  联系电话
+            contactMobile: data.contactMobile,
             consigneeName: data.contactName, //  联系人
             provinceSn: data.provinceSn, //  省
             provinceName: data.provinceName,
@@ -286,6 +298,7 @@ export default {
         customerName: this.form.buyerName,
         customerSn: this.form.buyerSn,
         contactTel: this.form.consigneeTel, //  联系电话
+        contactMobile: this.form.contactMobile,
         contactName: this.form.consigneeName, //  联系人
         provinceSn: this.form.provinceSn, //  省
         provinceName: this.form.provinceName,
@@ -341,6 +354,7 @@ export default {
     cancel () {
       this.opened = false
       this.$refs.ruleForm.resetFields()
+      this.$refs.custList.resetForm()
       this.$emit('cancel')
     },
     // 获取城市列表
@@ -352,8 +366,12 @@ export default {
       this.form.countySn = undefined
       this.form.countyName = ''
       this.form.customerAddr = ''
-      this.form.countyName = this.addrProvinceList.find(item => item.id == val).name
-      this.getArea('city', val)
+      if (val) {
+        this.getArea('city', val)
+        this.form.provinceName = this.addrProvinceList.find(item => item.areaSn == val).name
+      } else {
+        this.form.provinceName = ''
+      }
     },
     // 获取区县列表
     getAreaList (val) {
@@ -361,13 +379,21 @@ export default {
       this.form.countySn = undefined
       this.form.countyName = ''
       this.form.customerAddr = ''
-      this.form.cityName = this.addrCityList.find(item => item.id == val).name
-      this.getArea('district', val)
+      if (val) {
+        this.getArea('district', val)
+        this.form.cityName = this.addrCityList.find(item => item.areaSn == val).name
+      } else {
+        this.form.cityName = ''
+      }
     },
     // 区县变更
     areaCharged (val) {
       this.form.customerAddr = ''
-      this.form.countyName = this.addrDistrictList.find(item => item.id == val).name
+      if (val) {
+        this.form.countyName = this.addrDistrictList.find(item => item.areaSn == val).name
+      } else {
+        this.form.countyName = ''
+      }
     },
     //  省/市/区
     getArea (leve, sn) {

+ 24 - 21
src/views/supplierManagement/supplierInfo/editModal.vue

@@ -33,22 +33,22 @@
               <!-- 所在地区 -->
               <a-col span="8">
                 <a-form-model-item prop="provinceSn">
-                  <a-select id="supplierInfoEdit-provinceSn" @change="getCityList" v-model="form.provinceSn" placeholder="请选择省">
-                    <a-select-option v-for="item in addrProvinceList" :value="item.id" :key="item.id + 'a'">{{ item.name }}</a-select-option>
+                  <a-select id="supplierInfoEdit-provinceSn" allowClear @change="getCityList" v-model="form.provinceSn" 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>
               </a-col>
               <a-col span="8">
                 <a-form-model-item prop="citySn">
-                  <a-select id="supplierInfoEdit-citySn" @change="getAreaList" v-model="form.citySn" placeholder="请选择市">
-                    <a-select-option v-for="item in addrCityList" :value="item.id" :key="item.id + 'b'">{{ item.name }}</a-select-option>
+                  <a-select id="supplierInfoEdit-citySn" allowClear @change="getAreaList" v-model="form.citySn" placeholder="请选择市">
+                    <a-select-option v-for="item in addrCityList" :value="item.areaSn" :key="item.areaSn + 'b'">{{ item.name }}</a-select-option>
                   </a-select>
                 </a-form-model-item>
               </a-col>
               <a-col span="8">
                 <a-form-model-item prop="countySn">
-                  <a-select id="supplierInfoEdit-countySn" @change="areaCharged" v-model="form.countySn" placeholder="请选择区/县">
-                    <a-select-option v-for="item in addrDistrictList" :value="item.id" :key="item.id + 'c'">{{ item.name }}</a-select-option>
+                  <a-select id="supplierInfoEdit-countySn" allowClear @change="areaCharged" v-model="form.countySn" placeholder="请选择区/县">
+                    <a-select-option v-for="item in addrDistrictList" :value="item.areaSn" :key="item.areaSn + 'c'">{{ item.name }}</a-select-option>
                   </a-select>
                 </a-form-model-item>
               </a-col>
@@ -144,7 +144,7 @@ export default {
         citySn: undefined, // 市
         cityName: '',
         countySn: undefined, // 区
-        districtName: '',
+        countyName: '',
         supplierAddress: '', //  详细地址
         contactPerson: '', //  联系人
         contactTel: '', //  联系电话
@@ -229,35 +229,38 @@ export default {
     },
     // 获取城市列表
     getCityList (val) {
-      const index = this.addrProvinceList.findIndex(item => item.id == val)
-      if (index >= 0) {
-        this.form.provinceName = this.addrProvinceList[index].name
-      }
       this.addrCityList = []
       this.addrDistrictList = []
       this.form.citySn = undefined
       this.form.countySn = undefined
       this.form.supplierAddress = ''
-      this.getArea('city', val)
+      if (val) {
+        this.getArea('city', val)
+        this.form.provinceName = this.addrProvinceList.find(item => item.areaSn == val).name
+      } else {
+        this.form.provinceName = ''
+      }
     },
     // 获取区县列表
     getAreaList (val) {
-      const index = this.addrCityList.findIndex(item => item.id == val)
-      if (index >= 0) {
-        this.form.cityName = this.addrCityList[index].name
-      }
       this.addrDistrictList = []
       this.form.countySn = undefined
       this.form.supplierAddress = ''
-      this.getArea('district', val)
+      if (val) {
+        this.getArea('district', val)
+        this.form.cityName = this.addrCityList.find(item => item.areaSn == val).name
+      } else {
+        this.form.cityName = ''
+      }
     },
     // 区县变更
     areaCharged (val) {
-      const index = this.addrDistrictList.findIndex(item => item.id == val)
-      if (index >= 0) {
-        this.form.countyName = this.addrDistrictList[index].name
-      }
       this.form.supplierAddress = ''
+      if (val) {
+        this.form.countyName = this.addrDistrictList.find(item => item.areaSn == val).name
+      } else {
+        this.form.countyName = ''
+      }
     },
     //  省/市/区
     getArea (leve, sn) {