Selaa lähdekoodia

bug修复。客户关键词查询、地址为空时--

chenrui 3 vuotta sitten
vanhempi
commit
4add899260

+ 8 - 33
src/views/allocationManagement/storeTransferOut/basicInfoModal.vue

@@ -23,17 +23,7 @@
           </a-radio-group>
         </a-form-model-item>
         <a-form-model-item label="调往对象名称" :prop="isCustomer ? 'putPersonSn' : 'putPersonName'">
-          <a-select
-            v-if="isCustomer"
-            v-model="form.putPersonSn"
-            placeholder="请选择"
-            allowClear
-            :showSearch="true"
-            option-filter-prop="children"
-            :filter-option="filterOption"
-            @change="putPersonChange">
-            <a-select-option v-for="item in custData" :key="item.customerSn" :value="item.customerSn">{{ item.customerName }}</a-select-option>
-          </a-select>
+          <custList ref="custList" v-if="isCustomer" @change="custChange" v-model="form.putPersonSn"></custList>
           <a-input v-if="!isCustomer" v-model="form.putPersonName" placeholder="请输入调往对象名称(最多30个字符)" allowClear :maxLength="30" />
         </a-form-model-item>
         <a-form-model-item label="调拨类型" prop="callOutType">
@@ -56,12 +46,12 @@
 <script>
 import { VSelect } from '@/components'
 import { storeCallOutSave } from '@/api/storeCallOut'
-import { custAllList } from '@/api/customer'
 import { getLookUpData } from '@/api/data'
+import custList from '@/views/common/custList.vue'
 import { storeCallOutTypeAllList } from '@/api/storeCallOutType'
 export default {
   name: 'StoreTransferOutBasicInfoModal',
-  components: { VSelect },
+  components: { VSelect, custList },
   props: {
     openModal: {
       //  弹框显示状态
@@ -90,7 +80,6 @@ export default {
         putPersonName: [{ required: true, message: '请输入调往对象名称', trigger: 'blur' }],
         callOutType: [{ required: true, message: '请选择调拨类型', trigger: 'change' }]
       },
-      custData: [], //  调往对象  下拉数据
       putPersonTypeList: [], //  调往对象类型
       storeCallOutTypeList: [] //  调拨类型
     }
@@ -127,6 +116,11 @@ export default {
         }
       })
     },
+    // 调往对象名称 change
+    custChange (obj) {
+      this.form.putPersonSn = obj.key || undefined
+      this.form.putPersonName = obj.row.customerName
+    },
     // 调往对象  change
     putPersonTypeChange (e) {
       this.$refs.ruleForm.resetFields()
@@ -134,21 +128,6 @@ export default {
       this.form.putPersonName = ''
       this.form.putPersonType = e.target.value
     },
-    // 调往对象名称  change
-    putPersonChange (val) {
-      const ind = this.custData.findIndex(item => item.customerSn == val)
-      this.form.putPersonName = this.custData[ind].customerName
-    },
-    // 调往对象列表
-    getCustAllList () {
-      custAllList().then(res => {
-        if (res.status == 200) {
-          this.custData = res.data
-        } else {
-          this.custData = []
-        }
-      })
-    },
     // 调往对象类型
     getPutPersonTypeList () {
       const _this = this
@@ -173,9 +152,6 @@ export default {
           this.storeCallOutTypeList = []
         }
       })
-    },
-    filterOption (input, option) {
-      return option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
     }
   },
   watch: {
@@ -189,7 +165,6 @@ export default {
         this.$emit('close')
         this.$refs.ruleForm.resetFields()
       } else {
-        this.getCustAllList()
         this.getPutPersonTypeList()
         this.getStoreCallOutTypeAllList()
       }

+ 7 - 4
src/views/bulkManagement/bulkWarehousingOrder/detail.vue

@@ -41,10 +41,13 @@
                 <span v-if="basicInfoData&&basicInfoData.supplierContactTel">({{ basicInfoData.supplierContactTel }})</span>
               </a-descriptions-item>
               <a-descriptions-item label="联系地址">
-                {{ (basicInfoData&&basicInfoData.supplierProvinceName) || '' }}
-                {{ (basicInfoData&&basicInfoData.supplierCityName) || '' }}
-                {{ (basicInfoData&&basicInfoData.supplierCountyName) || '' }}
-                {{ (basicInfoData&&basicInfoData.supplierAddress) || '' }}
+                <div v-if="basicInfoData&&(basicInfoData.supplierProvinceName || basicInfoData.supplierCityName || basicInfoData.supplierCountyName || basicInfoData.supplierAddress)">
+                  {{ (basicInfoData&&basicInfoData.supplierProvinceName) || '' }}
+                  {{ (basicInfoData&&basicInfoData.supplierCityName) || '' }}
+                  {{ (basicInfoData&&basicInfoData.supplierCountyName) || '' }}
+                  {{ (basicInfoData&&basicInfoData.supplierAddress) || '' }}
+                </div>
+                <span v-else>--</span>
               </a-descriptions-item>
             </a-descriptions>
           </a-collapse-panel>

+ 75 - 0
src/views/common/custList.vue

@@ -0,0 +1,75 @@
+<template>
+  <a-select
+    show-search
+    label-in-value
+    :value="dealerName"
+    placeholder="请输入名称搜索"
+    style="width: 100%"
+    :filter-option="false"
+    :not-found-content="fetching ? undefined : null"
+    @search="fetchUser"
+    @change="handleChange"
+    allowClear
+  >
+    <a-spin v-if="fetching" slot="notFoundContent" size="small" />
+    <a-select-option v-for="item in data" :key="item.customerSn" :value="item.customerSn">
+      {{ item.customerName }}
+    </a-select-option>
+  </a-select>
+</template>
+<script>
+import debounce from 'lodash/debounce'
+import { custList } from '@/api/customer'
+export default {
+  props: {
+  },
+  data () {
+    this.lastFetchId = 0
+    this.fetchUser = debounce(this.fetchUser, 800)
+    return {
+      data: [],
+      dealerName: undefined,
+      fetching: false
+    }
+  },
+  methods: {
+    fetchUser (dealerName) {
+      console.log('fetching user', dealerName)
+      if (dealerName == '') return
+      this.lastFetchId += 1
+      const fetchId = this.lastFetchId
+      this.data = []
+      this.fetching = true
+      custList({ 'customerName': dealerName, pageNo: 1, pageSize: 20 }).then(res => {
+        if (fetchId !== this.lastFetchId) {
+          return
+        }
+        this.data = res.data && res.data.list ? res.data.list : []
+        this.fetching = false
+      })
+    },
+    handleChange (value) {
+      if (value && value.key) {
+        const ind = this.data.findIndex(item => item.customerSn == value.key)
+        value.row = ind != -1 ? this.data[ind] : undefined
+      }
+      Object.assign(this, {
+        dealerName: value,
+        data: [],
+        fetching: false
+      })
+      this.$emit('change', value || { key: undefined })
+    },
+    resetForm () {
+      this.dealerName = undefined
+    },
+    setData (value) {
+      Object.assign(this, {
+        dealerName: value,
+        data: [],
+        fetching: false
+      })
+    }
+  }
+}
+</script>

+ 7 - 4
src/views/purchasingManagement/purchaseOrder/detail.vue

@@ -29,10 +29,13 @@
               <a-descriptions-item label="采购员工">{{ detail&&detail.operatorName || '--' }}</a-descriptions-item>
               <a-descriptions-item label="收货人">{{ detail&&detail.consigneeName || '--' }}<span v-if="detail&&detail.consigneeTel">({{ detail&&detail.consigneeTel }})</span></a-descriptions-item>
               <a-descriptions-item label="收货地址">
-                {{ detail&&detail.shippingAddressProvinceName || '' }}
-                {{ detail&&detail.shippingAddressCityName || '' }}
-                {{ detail&&detail.shippingAddressCountyName || '' }}
-                {{ detail&&detail.shippingAddress || '' }}
+                <div v-if="detail&&(detail.shippingAddressProvinceName || detail.shippingAddressCityName || detail.shippingAddressCountyName || detail.shippingAddress)">
+                  {{ detail&&detail.shippingAddressProvinceName || '' }}
+                  {{ detail&&detail.shippingAddressCityName || '' }}
+                  {{ detail&&detail.shippingAddressCountyName || '' }}
+                  {{ detail&&detail.shippingAddress || '' }}
+                </div>
+                <span v-else>--</span>
               </a-descriptions-item>
             </a-descriptions>
           </a-collapse-panel>

+ 7 - 4
src/views/purchasingManagement/purchaseOrder/edit.vue

@@ -37,10 +37,13 @@
               <a-descriptions-item label="支付方式">{{ detail&&detail.settleStyleEntity&&detail.settleStyleEntity.name || '--' }}</a-descriptions-item>
               <a-descriptions-item label="收货人">{{ detail&&detail.consigneeName || '--' }}({{ detail&&detail.consigneeTel || '--' }})</a-descriptions-item>
               <a-descriptions-item label="收货地址">
-                {{ detail&&detail.shippingAddressProvinceName || '' }}
-                {{ detail&&detail.shippingAddressCityName || '' }}
-                {{ detail&&detail.shippingAddressCountyName || '' }}
-                {{ detail&&detail.shippingAddress || '' }}
+                <div v-if="detail&&(detail.shippingAddressProvinceName || detail.shippingAddressCityName || detail.shippingAddressCountyName || detail.shippingAddress)">
+                  {{ detail&&detail.shippingAddressProvinceName || '' }}
+                  {{ detail&&detail.shippingAddressCityName || '' }}
+                  {{ detail&&detail.shippingAddressCountyName || '' }}
+                  {{ detail&&detail.shippingAddress || '' }}
+                </div>
+                <span v-else>--</span>
               </a-descriptions-item>
             </a-descriptions>
           </a-collapse-panel>

+ 12 - 33
src/views/salesManagement/giftRecord/list.vue

@@ -27,16 +27,7 @@
             </a-col>
             <a-col :md="6" :sm="24">
               <a-form-item label="赠送客户">
-                <a-select
-                  id="giftRecordList-customerSn"
-                  placeholder="请选择"
-                  allowClear
-                  v-model="queryParam.customerSn"
-                  :showSearch="true"
-                  option-filter-prop="children"
-                  :filter-option="filterOption">
-                  <a-select-option v-for="item in custAllList" :key="item.customerSn" :value="item.customerSn">{{ item.customerName }}</a-select-option>
-                </a-select>
+                <custList ref="custList" @change="custChange" v-model="queryParam.customerSn"></custList>
               </a-form-item>
             </a-col>
           </template>
@@ -66,12 +57,12 @@
 </template>
 
 <script>
-import { custAllList } from '@/api/customer'
-import { giftsDetailList } from '@/api/dealerProduct'
 import { STable, VSelect } from '@/components'
+import custList from '@/views/common/custList.vue'
 import rangeDate from '@/views/common/rangeDate.vue'
+import { giftsDetailList } from '@/api/dealerProduct'
 export default {
-  components: { STable, VSelect, rangeDate },
+  components: { STable, VSelect, rangeDate, custList },
   data () {
     return {
       tableHeight: 0,
@@ -112,8 +103,7 @@ export default {
           this.disabled = false
           return data
         })
-      },
-      custAllList: [] //  客户下拉数据
+      }
     }
   },
   methods: {
@@ -122,21 +112,9 @@ export default {
       this.queryParam.beginDate = date[0]
       this.queryParam.endDate = date[1]
     },
-    // 客户无分页列表数据
-    getCustAllList () {
-      const _this = this
-      custAllList().then(res => {
-        if (res.status == 200) {
-          _this.custAllList = res.data || []
-        } else {
-          _this.custAllList = []
-        }
-      })
-    },
-    filterOption (input, option) {
-      return (
-        option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
-      )
+    // 客户 change
+    custChange (obj) {
+      this.queryParam.customerSn = obj.key || undefined
     },
     //  重置
     resetSearchForm () {
@@ -147,13 +125,14 @@ export default {
       this.queryParam.productOrigCode = ''
       this.queryParam.salesBillNo = ''
       this.queryParam.customerSn = undefined
+      if (this.advanced) {
+        this.$refs.custList.resetForm()
+      }
       this.$refs.table.refresh(true)
     }
   },
   beforeRouteEnter (to, from, next) {
-    next(vm => {
-      vm.getCustAllList()
-    })
+    next(vm => {})
   }
 }
 </script>

+ 9 - 44
src/views/salesManagement/salesQuery/chooseCustomModal.vue

@@ -21,15 +21,7 @@
         <a-row :gutter="15">
           <a-col :span="8">
             <a-form-model-item label="客户名称" prop="buyerSn">
-              <a-select
-                id="chooseCustom-buyerSn"
-                show-search
-                placeholder="请选择客户"
-                v-model="form.buyerSn"
-                :filter-option="filterOption"
-                @change="custChange">
-                <a-select-option v-for="item in custAllList" :key="item.id" :value="item.customerSn">{{ item.customerName }}</a-select-option>
-              </a-select>
+              <custList ref="custList" id="chooseCustom-buyerSn" @change="custChange" v-model="form.buyerSn"></custList>
             </a-form-model-item>
           </a-col>
           <a-col :span="16" v-if="$hasPermissions('B_customer_customerInfo_add')">
@@ -196,15 +188,16 @@
 
 <script>
 import { getArea } from '@/api/data'
-import { custAllList, custFindById, custSave, updateByCustomerSn } from '@/api/customer'
+import { custFindById, updateByCustomerSn } from '@/api/customer'
 import { salesSave } from '@/api/sales'
 import { getUserAllList } from '@/api/power-user'
 import { settleStyleQueryAll } from '@/api/settleStyle'
 import { VSelect } from '@/components'
+import custList from '@/views/common/custList.vue'
 import CustomerManagementEdit from '@/views/customerManagement/customerInfo/edit.vue'
 export default {
   name: 'ChooseCustomModal',
-  components: { VSelect, CustomerManagementEdit },
+  components: { VSelect, CustomerManagementEdit, custList },
   props: {
     show: [Boolean]
   },
@@ -273,7 +266,6 @@ export default {
         //   { required: true, message: '请选择业务员', trigger: 'change' }
         // ]
       },
-      custAllList: [], //  客户 下拉数据
       addrProvinceList: [], //  省下拉
       addrCityList: [], //  市下拉
       addrDistrictList: [], //  区下拉
@@ -299,20 +291,18 @@ export default {
       console.log(data, this.isEdit)
       this.isNewCust = false
       // 更新客户信息
-      this.custAllList.unshift(data)
-      setTimeout(() => {
-        this.custChange(data.customerSn)
-      }, 300)
+      this.$refs.custList.setData({ key: data.customerSn, label: data.customerName, row: data })
+      this.custChange({ key: data.customerSn, label: data.customerName, row: data })
     },
     // 业务员
     salesManChange (id) {
       this.form.salesManName = this.userList.find(item => item.id == id).name
     },
     // 客户 change
-    custChange (val) {
-      console.log(val, 'custChange')
+    custChange (obj) {
       const _this = this
-      const cust = this.custAllList.find(item => item.customerSn == val)
+      const cust = obj.row
+      this.form.buyerSn = cust.customerSn
       // 编辑
       if (this.isEdit) {
         this.$confirm({
@@ -426,19 +416,11 @@ export default {
               onOk () {
                 // 保存客户信息
                 _this.handleSaveCust()
-                // // 保存销售单
-                // if (_this.form.buyerSn) {
-                //   _this.salesSaveFun()
-                // }
               }
             })
           } else {
             // 保存客户信息
             _this.handleSaveCust()
-            // // 保存销售单
-            // if (_this.form.buyerSn) {
-            //   _this.salesSaveFun()
-            // }
           }
         } else {
           console.log('error submit!!')
@@ -474,17 +456,6 @@ export default {
       this.isNewCust = false
       this.$refs.newCust.getBaseData()
     },
-    // 客户无分页列表数据
-    getCustAllList () {
-      const _this = this
-      custAllList().then(res => {
-        if (res.status == 200) {
-          _this.custAllList = res.data || []
-        } else {
-          _this.custAllList = []
-        }
-      })
-    },
     // 获取业务员列表数据
     getUserAllList () {
       getUserAllList({ loginFlag: 1 }).then(res => {
@@ -549,11 +520,6 @@ export default {
         }
       })
     },
-    filterOption (input, option) {
-      return (
-        option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
-      )
-    },
     // 获取收款方式
     getSettleStyle () {
       settleStyleQueryAll().then(res => {
@@ -568,7 +534,6 @@ export default {
       this.opened = newValue
       if (newValue) {
         this.getArea('province')
-        this.getCustAllList()
         this.getUserAllList()
         this.getSettleStyle()
       }

+ 7 - 4
src/views/salesManagement/salesQuery/detail.vue

@@ -37,10 +37,13 @@
             <a-descriptions size="small" :column="3">
               <a-descriptions-item label="客户名称">{{ detailData&&detailData.buyerName || '--' }}</a-descriptions-item>
               <a-descriptions-item label="客户地址">
-                {{ detailData&&detailData.shippingAddressProvinceName || '' }}
-                {{ detailData&&detailData.shippingAddressCityName || '' }}
-                {{ detailData&&detailData.shippingAddressCountyName || '' }}
-                {{ detailData&&detailData.shippingAddress || '' }}
+                <div v-if="detailData&&(detailData.shippingAddressProvinceName || detailData.shippingAddressCityName || detailData.shippingAddressCountyName || detailData.shippingAddress)">
+                  {{ detailData&&detailData.shippingAddressProvinceName || '' }}
+                  {{ detailData&&detailData.shippingAddressCityName || '' }}
+                  {{ detailData&&detailData.shippingAddressCountyName || '' }}
+                  {{ detailData&&detailData.shippingAddress || '' }}
+                </div>
+                <span v-else>--</span>
               </a-descriptions-item>
               <a-descriptions-item label="收款方式">{{ detailData&&detailData.settleStyleEntity&&detailData.settleStyleEntity.name || '--' }}</a-descriptions-item>
               <a-descriptions-item label="联系电话">{{ detailData&&detailData.consigneeTel || '--' }}</a-descriptions-item>

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

@@ -12,16 +12,7 @@
             </a-col>
             <a-col :md="6" :sm="24">
               <a-form-item label="客户名称" :label-col="{ span:7 }" :wrapper-col="{ span:17}">
-                <a-select
-                  id="salesManagementList-buyerName"
-                  placeholder="请选择客户"
-                  allowClear
-                  v-model="queryParam.buyerName"
-                  :showSearch="true"
-                  option-filter-prop="children"
-                  :filter-option="filterOption">
-                  <a-select-option v-for="item in custAllList" :key="item.customerSn" :value="item.customerName">{{ item.customerName }}</a-select-option>
-                </a-select>
+                <custList ref="custList" @change="custChange" v-model="queryParam.buyerSn"></custList>
               </a-form-item>
             </a-col>
             <a-col :md="6" :sm="24">
@@ -183,13 +174,13 @@
 import { STable, VSelect } from '@/components'
 import chooseCustomModal from './chooseCustomModal.vue'
 import auditModal from '@/views/common/auditModal.vue'
-import { custAllList } from '@/api/customer'
 import { salesList, salesDel, salesWriteAudit, salesWriteStockOut, salesCount } from '@/api/sales'
 import { settleStyleQueryAll } from '@/api/settleStyle'
 import rangeDate from '@/views/common/rangeDate.vue'
+import custList from '@/views/common/custList.vue'
 export default {
   name: 'TableList',
-  components: { STable, VSelect, chooseCustomModal, rangeDate, auditModal },
+  components: { STable, VSelect, chooseCustomModal, rangeDate, auditModal, custList },
   data () {
     return {
       spinning: false,
@@ -197,13 +188,12 @@ export default {
       advanced: false, // 高级搜索 展开/关闭
       disabled: false, //  查询、重置按钮是否可操作
       openModal: false, // 选择客户弹框是否显示
-      custAllList: [], //  客户 下拉数据
       settleStyleList: [], // 收款方式
       // 查询参数
       queryParam: {
         beginDate: '',
         endDate: '',
-        buyerName: undefined, //  客户名称
+        buyerSn: undefined, //  客户名称
         salesBillNo: '', //  销售单号
         purchaseBillNo: '', //  采购单号
         payType: undefined, //  支付方式
@@ -353,36 +343,25 @@ export default {
         }
       })
     },
-    // 客户无分页列表数据
-    getCustAllList () {
-      const _this = this
-      custAllList().then(res => {
-        if (res.status == 200) {
-          _this.custAllList = res.data || []
-        } else {
-          _this.custAllList = []
-        }
-      })
+    // 客户 change
+    custChange (obj) {
+      this.queryParam.buyerSn = obj.key || undefined
     },
     // 重置
     resetSearchForm () {
       this.$refs.rangeDate.resetDate()
       this.queryParam.beginDate = ''
       this.queryParam.endDate = ''
-      this.queryParam.buyerName = undefined
+      this.queryParam.buyerSn = undefined
       this.queryParam.salesBillNo = ''
       this.queryParam.purchaseBillNo = ''
       this.queryParam.payType = undefined
       this.queryParam.settleStyleSn = undefined
       this.queryParam.billStatus = undefined
       this.queryParam.financialStatus = undefined
+      this.$refs.custList.resetForm()
       this.$refs.table.refresh(true)
     },
-    filterOption (input, option) {
-      return (
-        option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
-      )
-    },
     // 获取收款方式
     getSettleStyle () {
       settleStyleQueryAll().then(res => {
@@ -394,7 +373,6 @@ export default {
   },
   beforeRouteEnter (to, from, next) {
     next(vm => {
-      vm.getCustAllList()
       vm.getSettleStyle()
     })
   }

+ 9 - 40
src/views/salesManagement/salesReturn/chooseCustomModal.vue

@@ -21,15 +21,7 @@
         <a-row :gutter="15">
           <a-col :span="8">
             <a-form-model-item label="客户名称" prop="buyerSn">
-              <a-select
-                id="chooseCustom-buyerSn"
-                show-search
-                placeholder="请选择客户"
-                v-model="form.buyerSn"
-                :filter-option="filterOption"
-                @change="custChange">
-                <a-select-option v-for="item in custAllList" :key="item.id" :value="item.customerSn">{{ item.customerName }}</a-select-option>
-              </a-select>
+              <custList ref="custList" @change="custChange" v-model="form.buyerSn"></custList>
             </a-form-model-item>
           </a-col>
           <!-- <a-col :span="16">
@@ -134,13 +126,14 @@
 
 <script>
 import { getArea } from '@/api/data'
-import { custAllList, custFindById, updateByCustomerSn } from '@/api/customer'
+import { custFindById, updateByCustomerSn } from '@/api/customer'
 import { salesReturnSave } from '@/api/salesReturn'
 import { VSelect } from '@/components'
+import custList from '@/views/common/custList.vue'
 import CustomerManagementEdit from '@/views/customerManagement/customerInfo/edit.vue'
 export default {
   name: 'ChooseCustomModal',
-  components: { VSelect, CustomerManagementEdit },
+  components: { VSelect, CustomerManagementEdit, custList },
   props: {
     show: [Boolean]
   },
@@ -193,7 +186,6 @@ export default {
           { required: true, message: '请选择是否铺货出库', trigger: 'change' }
         ]
       },
-      custAllList: [], //  客户 下拉数据
       addrProvinceList: [], //  省下拉
       addrCityList: [], //  市下拉
       addrDistrictList: [], //  区下拉
@@ -216,20 +208,18 @@ export default {
       console.log(data, this.isEdit)
       this.isNewCust = false
       // 更新客户信息
-      this.custAllList.unshift(data)
-      setTimeout(() => {
-        this.custChange(data.customerSn)
-      }, 300)
+      this.$refs.custList.setData({ key: data.customerSn, label: data.customerName, row: data })
+      this.custChange({ key: data.customerSn, label: data.customerName, row: data })
     },
     cancelNewCust () {
       this.isNewCust = false
       this.$refs.newCust.getBaseData()
     },
     // 客户 change
-    custChange (val) {
-      console.log(val, 'custChange')
+    custChange (obj) {
       const _this = this
-      const cust = this.custAllList.find(item => item.customerSn == val)
+      const cust = obj.row
+      this.form.buyerSn = cust.customerSn
       // 编辑
       if (this.isEdit) {
         this.$confirm({
@@ -326,10 +316,6 @@ export default {
         if (valid) {
           // 保存客户信息
           _this.handleSaveCust()
-          // // 保存销售单
-          // if (_this.form.buyerSn) {
-          //   _this.salesSaveFun()
-          // }
         } else {
           console.log('error submit!!')
           return false
@@ -357,17 +343,6 @@ export default {
       this.$refs.ruleForm.resetFields()
       this.$emit('cancel')
     },
-    // 客户无分页列表数据
-    getCustAllList () {
-      const _this = this
-      custAllList().then(res => {
-        if (res.status == 200) {
-          _this.custAllList = res.data || []
-        } else {
-          _this.custAllList = []
-        }
-      })
-    },
     // 获取城市列表
     getCityList (val) {
       this.addrCityList = []
@@ -421,11 +396,6 @@ export default {
           }
         }
       })
-    },
-    filterOption (input, option) {
-      return (
-        option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
-      )
     }
   },
   watch: {
@@ -433,7 +403,6 @@ export default {
       this.opened = newValue
       if (newValue) {
         this.getArea('province')
-        this.getCustAllList()
       }
     }
   }

+ 7 - 4
src/views/salesManagement/salesReturn/detail.vue

@@ -21,10 +21,13 @@
             <a-descriptions size="small" :column="3">
               <a-descriptions-item label="客户名称">{{ detailData&&detailData.buyerName || '--' }}</a-descriptions-item>
               <a-descriptions-item label="客户地址">
-                {{ detailData&&detailData.provinceName || '' }}
-                {{ detailData&&detailData.cityName || '' }}
-                {{ detailData&&detailData.countyName || '' }}
-                {{ detailData&&detailData.customerAddr || '' }}
+                <div v-if="detailData&&(detailData.provinceName || detailData.cityName || detailData.countyName || detailData.customerAddr)">
+                  {{ detailData&&detailData.provinceName || '' }}
+                  {{ detailData&&detailData.cityName || '' }}
+                  {{ detailData&&detailData.countyName || '' }}
+                  {{ detailData&&detailData.customerAddr || '' }}
+                </div>
+                <span v-else>--</span>
               </a-descriptions-item>
               <a-descriptions-item label="联系电话">{{ detailData&&detailData.contactTel || '--' }}</a-descriptions-item>
               <a-descriptions-item label="备注">{{ detailData&&detailData.remarks || '--' }}</a-descriptions-item>

+ 9 - 31
src/views/salesManagement/salesReturn/list.vue

@@ -17,16 +17,7 @@
             </a-col>
             <a-col :md="6" :sm="24">
               <a-form-item label="客户名称" :label-col="{ span:7 }" :wrapper-col="{ span:17}">
-                <a-select
-                  id="salesReturn-buyerSn"
-                  placeholder="请选择客户"
-                  allowClear
-                  v-model="queryParam.buyerSn"
-                  :showSearch="true"
-                  option-filter-prop="children"
-                  :filter-option="filterOption">
-                  <a-select-option v-for="item in custAllList" :key="item.customerSn" :value="item.customerSn">{{ item.customerName }}</a-select-option>
-                </a-select>
+                <custList ref="custList" @change="custChange" v-model="queryParam.buyerSn"></custList>
               </a-form-item>
             </a-col>
             <template v-if="advanced">
@@ -128,7 +119,7 @@
 import { STable, VSelect } from '@/components'
 import rangeDate from '@/views/common/rangeDate.vue'
 import chooseCustomModal from './chooseCustomModal.vue'
-import { custAllList } from '@/api/customer'
+import custList from '@/views/common/custList.vue'
 import { salesReturnList, salesReturnCount, salesReturnAudit, salesReturnDel } from '@/api/salesReturn'
 export default {
   name: 'TableList',
@@ -136,7 +127,8 @@ export default {
     STable,
     VSelect,
     chooseCustomModal,
-    rangeDate
+    rangeDate,
+    custList
   },
   data () {
     return {
@@ -146,7 +138,6 @@ export default {
       advanced: false,
       disabled: false, //  查询、重置按钮是否可操作
       openModal: false, // 选择客户弹框是否显示
-      custAllList: [], //  客户下拉数据
       // 查询参数
       queryParam: {
         beginDate: '',
@@ -272,29 +263,16 @@ export default {
       this.queryParam.buyerSn = undefined
       this.queryParam.salesReturnNo = ''
       this.queryParam.state = ''
+      this.$refs.custList.resetForm()
       this.$refs.table.refresh(true)
     },
-    // 客户无分页列表数据
-    getCustAllList () {
-      const _this = this
-      custAllList().then(res => {
-        if (res.status == 200) {
-          _this.custAllList = res.data || []
-        } else {
-          _this.custAllList = []
-        }
-      })
-    },
-    filterOption (input, option) {
-      return (
-        option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
-      )
+    // 客户 change
+    custChange (obj) {
+      this.queryParam.buyerSn = obj.key || undefined
     }
   },
   beforeRouteEnter (to, from, next) {
-    next(vm => {
-      vm.getCustAllList()
-    })
+    next(vm => {})
   }
 }
 </script>

+ 9 - 1
src/views/salesManagement/urgentItemsOffset/detail.vue

@@ -20,7 +20,15 @@
           <a-collapse-panel key="1" header="基础信息">
             <a-descriptions :column="3">
               <a-descriptions-item label="客户名称">{{ (detailData&&detailData.buyerName) || '--' }}</a-descriptions-item>
-              <a-descriptions-item label="客户地址">{{ (detailData&&detailData.shippingAddressProvinceName) || '' }}{{ (detailData&&detailData.shippingAddressCityName) || '' }}{{ (detailData&&detailData.shippingAddressCountyName) || '' }}{{ (detailData&&detailData.shippingAddress) || '' }}</a-descriptions-item>
+              <a-descriptions-item label="客户地址">
+                <div v-if="detailData&&(detailData.shippingAddressProvinceName || detailData.shippingAddressCityName || detailData.shippingAddressCountyName || detailData.shippingAddress)">
+                  {{ (detailData&&detailData.shippingAddressProvinceName) || '' }}
+                  {{ (detailData&&detailData.shippingAddressCityName) || '' }}
+                  {{ (detailData&&detailData.shippingAddressCountyName) || '' }}
+                  {{ (detailData&&detailData.shippingAddress) || '' }}
+                </div>
+                <span v-else>--</span>
+              </a-descriptions-item>
               <a-descriptions-item label="联系电话">{{ detailData&&detailData.consigneeTel || '--' }}</a-descriptions-item>
               <a-descriptions-item label="收款方式">{{ (detailData&&detailData.settleStyleEntity&&detailData.settleStyleEntity.name) || '--' }}</a-descriptions-item>
               <a-descriptions-item label="急件单号">{{ (detailData&&detailData.urgentBillNo) || '--' }}</a-descriptions-item>

+ 8 - 31
src/views/salesManagement/urgentItemsOffset/list.vue

@@ -11,16 +11,7 @@
           </a-col>
           <a-col :md="6" :sm="24">
             <a-form-item label="客户名称">
-              <a-select
-                id="urgentItemsOffsetList-buyerSn"
-                placeholder="请选择"
-                allowClear
-                v-model="queryParam.buyerSn"
-                :showSearch="true"
-                option-filter-prop="children"
-                :filter-option="filterOption">
-                <a-select-option v-for="item in custAllList" :key="item.customerSn" :value="item.customerSn">{{ item.customerName }}</a-select-option>
-              </a-select>
+              <custList ref="custList" @change="custChange" v-model="queryParam.buyerSn"></custList>
             </a-form-item>
           </a-col>
           <a-col :md="6" :sm="24">
@@ -77,12 +68,12 @@
 </template>
 
 <script>
-import { custAllList } from '@/api/customer'
 import { urgentList } from '@/api/urgent'
 import { STable, VSelect } from '@/components'
 import rangeDate from '@/views/common/rangeDate.vue'
+import custList from '@/views/common/custList.vue'
 export default {
-  components: { STable, VSelect, rangeDate },
+  components: { STable, VSelect, rangeDate, custList },
   data () {
     return {
       tableHeight: 0,
@@ -96,7 +87,6 @@ export default {
         status: undefined //  状态
       },
       disabled: false, //  查询、重置按钮是否可操作
-      custAllList: [], //  客户下拉数据
       columns: [
         { title: '序号', dataIndex: 'no', width: 80, align: 'center' },
         { title: '急件单号', scopedSlots: { customRender: 'urgentBillNo' }, width: 220, align: 'center' },
@@ -132,11 +122,6 @@ export default {
       this.queryParam.beginDate = date[0]
       this.queryParam.endDate = date[1]
     },
-    filterOption (input, option) {
-      return (
-        option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
-      )
-    },
     //  重置
     resetSearchForm () {
       this.$refs.rangeDate.resetDate()
@@ -146,28 +131,20 @@ export default {
       this.queryParam.salesBillNo = ''
       this.queryParam.urgentBillNo = ''
       this.queryParam.status = undefined
+      this.$refs.custList.resetForm()
       this.$refs.table.refresh(true)
     },
     //  详情
     handleDetail (row) {
       this.$router.push({ path: `/salesManagement/urgentItemsOffset/detail/${row.urgentBillSn}` })
     },
-    // 客户无分页列表数据
-    getCustAllList () {
-      const _this = this
-      custAllList().then(res => {
-        if (res.status == 200) {
-          _this.custAllList = res.data || []
-        } else {
-          _this.custAllList = []
-        }
-      })
+    // 客户 change
+    custChange (obj) {
+      this.queryParam.buyerSn = obj.key || undefined
     }
   },
   beforeRouteEnter (to, from, next) {
-    next(vm => {
-      vm.getCustAllList()
-    })
+    next(vm => {})
   }
 }
 </script>