chenrui 4 rokov pred
rodič
commit
8678d95992

+ 11 - 1
src/api/customer.js

@@ -1,6 +1,6 @@
 import { axios } from '@/utils/request'
 
-//  客户列表
+//  客户列表  分页
 export const custList = (params) => {
   let url = `/cust/findPage/${params.pageNo}/${params.pageSize}`
   delete params.pageNo
@@ -12,6 +12,16 @@ export const custList = (params) => {
   })
 }
 
+//  客户列表  无分页
+export const custFindAll = (params) => {
+  let url = `/cust/findAll`
+  return axios({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}
+
 // 新增/编辑客户
 export const custSave = params => {
   return axios({

+ 2 - 2
src/components/Select/index.js

@@ -29,7 +29,7 @@ export default {
   }),
   created () {
     const _this = this
-    console.log(_this.code, '_this.code')
+    // console.log(_this.code, '_this.code')
     Promise.all([listLookUp({ code: '' }), getLookUpData({
       pageNo: 1,
       pageSize: 1000,
@@ -40,7 +40,7 @@ export default {
       if (_all.status + '' === '200' && _data.status + '' === '200') {
         _this.dataList = _data.data.list
         const a = _.find(_all.data, ['code', _this.code])
-        console.log(a)
+        // console.log(a)
         _this.placeholderText = '请选择' + (a != undefined ? a.name : '')
       }
     })

+ 2 - 2
src/components/Table/index.js

@@ -155,11 +155,11 @@ export default {
       // eslint-disable-next-line
       if ((typeof result === 'object' || typeof result === 'function') && typeof result.then === 'function') {
         result.then(r => {
-          let list = r.list || r.data || r
+          const list = r.list || r.data || r
           console.log(r,'rrrrrrrrrr')
           this.localPagination = this.showPagination && Object.assign({}, this.localPagination, {
             current: r.pageNo, // 返回结果中的当前分页数
-            total: r.count, // 返回结果中的总记录数
+            total: Number(r.count), // 返回结果中的总记录数
             showSizeChanger: this.showSizeChanger,
             pageSize: (pagination && pagination.pageSize) ||
               this.localPagination.pageSize

+ 1 - 1
src/utils/request.js

@@ -47,7 +47,7 @@ service.interceptors.request.use(config => {
 
 // response interceptor
 service.interceptors.response.use((response) => {
-  console.log(response, 'response.data.status')
+  // console.log(response, 'response.data.status')
   const et = sessionStorage.getItem('errorTips')
   if (response.data.status == '1001' && !et) {
     sessionStorage.setItem('errorTips', 1)

+ 6 - 12
src/views/basicData/customerTypeManagement/list.vue

@@ -49,14 +49,13 @@ export default {
   data () {
     return {
       queryParam: { //  查询条件
-        bundleName: '', //  品牌名称
-        state: undefined,  //  状态
+        name: '', //  客户类型名称
       },
       disabled: false, //  查询、重置按钮是否可操作
       columns: [
         { title: '序号', dataIndex: 'no', width: 70, align: 'center' },
-        { title: '客户类型名称', dataIndex: 'productName', align: 'center', ellipsis: true },
-        { title: '创建时间', dataIndex: 'inventoryMoney', width: 180, align: 'center' },
+        { title: '客户类型名称', dataIndex: 'name', align: 'center', ellipsis: true },
+        { title: '创建时间', dataIndex: 'creatDate', width: 180, align: 'center' },
         { title: '操作', scopedSlots: { customRender: 'action' }, width: 240, align: 'center' }
       ],
       // 加载数据方法 必须为 Promise 对象
@@ -65,8 +64,8 @@ export default {
         return custTypeFindAll( this.queryParam ).then(res => {
           const data = res.data
           // const no = (data.pageNo - 1) * data.pageSize
-          // for (var i = 0; i < data.list.length; i++) {
-          //   data.list[i].no = no + i + 1
+          // for (var i = 0; i < data.length; i++) {
+          //   data[i].no = i + 1
           // }
           this.disabled = false
           return data
@@ -80,12 +79,7 @@ export default {
   methods: {
     //  重置
     resetSearchForm () {
-      this.queryParam.orderBundleNo = ''
-      this.queryParam.orderBundle.custMobile = ''
-      this.queryParam.bundleName = ''
-      this.queryParam.itemName = ''
-      this.oldTime = undefined
-      this.newTime = undefined
+      this.queryParam.name = ''
       this.$refs.table.refresh(true)
     },
     //  新增/编辑

+ 61 - 47
src/views/salesManagement/customerManagement/edit.vue

@@ -27,21 +27,21 @@
             </a-form-model-item>
           </a-col>
           <a-col :span="8">
-            <a-form-model-item label="联系手机" prop="address">
+            <a-form-model-item label="联系手机" prop="mobile">
               <a-input
-                id="customerManagementEdit-address"
+                id="customerManagementEdit-mobile"
                 :maxLength="11"
-                v-model="form.address"
+                v-model="form.mobile"
                 placeholder="请输入联系手机(最多11个字符)"
                 allowClear />
             </a-form-model-item>
           </a-col>
           <a-col :span="8">
-            <a-form-model-item label="联系人" prop="address">
+            <a-form-model-item label="联系人" prop="contact">
               <a-input
-                id="customerManagementEdit-address"
+                id="customerManagementEdit-contact"
                 :maxLength="30"
-                v-model="form.address"
+                v-model="form.contact"
                 placeholder="请输入联系人(最多30个字符)"
                 allowClear />
             </a-form-model-item>
@@ -53,22 +53,22 @@
               <a-row :gutter="15">
                 <!-- 客户地址 -->
                 <a-col span="8">
-                  <a-form-model-item prop="provinceCode">
-                    <a-select id="customerManagementEdit-provinceCode" @change="getCityList" v-model="form.provinceCode" placeholder="请选择省">
+                  <a-form-model-item prop="province">
+                    <a-select id="customerManagementEdit-province" @change="getCityList" v-model="form.province" placeholder="请选择省">
                       <a-select-option v-for="item in addrProvinceList" :value="item.id" :key="item.id + 'a'">{{ item.name }}</a-select-option>
                     </a-select>
                   </a-form-model-item>
                 </a-col>
                 <a-col span="8">
-                  <a-form-model-item prop="cityCode">
-                    <a-select id="customerManagementEdit-cityCode" @change="getAreaList" v-model="form.cityCode" placeholder="请选择市">
+                  <a-form-model-item prop="city">
+                    <a-select id="customerManagementEdit-city" @change="getAreaList" v-model="form.city" placeholder="请选择市">
                       <a-select-option v-for="item in addrCityList" :value="item.id" :key="item.id + 'b'">{{ item.name }}</a-select-option>
                     </a-select>
                   </a-form-model-item>
                 </a-col>
                 <a-col span="8">
-                  <a-form-model-item prop="districtCode">
-                    <a-select id="customerManagementEdit-districtCode" @change="areaCharged" v-model="form.districtCode" placeholder="请选择区/县">
+                  <a-form-model-item prop="district">
+                    <a-select id="customerManagementEdit-district" @change="areaCharged" v-model="form.district" placeholder="请选择区/县">
                       <a-select-option v-for="item in addrDistrictList" :value="item.id" :key="item.id + 'c'">{{ item.name }}</a-select-option>
                     </a-select>
                   </a-form-model-item>
@@ -89,18 +89,18 @@
         </a-row>
         <a-row :gutter="15">
           <a-col :span="8">
-            <a-form-model-item label="客户传真" prop="contactName">
+            <a-form-model-item label="客户传真" prop="fax">
               <a-input
-                id="customerManagementEdit-contactName"
+                id="customerManagementEdit-fax"
                 :maxLength="30"
-                v-model="form.contactName"
+                v-model="form.fax"
                 placeholder="请输入客户传真(最多30个字符)"
                 allowClear />
             </a-form-model-item>
           </a-col>
           <a-col :span="8">
-            <a-form-model-item label="配送方式" prop="contactPhone">
-              <v-select code="DISPATCH_FASHION" id="customerManagementEdit-dispatchFashion" v-model="form.dispatchFashion" allowClear placeholder="请选择配送方式"></v-select>
+            <a-form-model-item label="配送方式" prop="distributionType">
+              <v-select code="DISPATCH_FASHION" id="customerManagementEdit-distributionType" v-model="form.distributionType" allowClear placeholder="请选择配送方式"></v-select>
             </a-form-model-item>
           </a-col>
           <a-col :span="8">
@@ -113,28 +113,35 @@
         </a-row>
         <a-row :gutter="15">
           <a-col :span="8">
-            <a-form-model-item label="价格类型" prop="contactPhone">
-              <v-select code="PRICE_TYPE" id="customerManagementEdit-priceType" v-model="form.priceType" allowClear placeholder="请选择价格类型"></v-select>
+            <a-form-model-item label="客户类型" prop="custType">
+              <a-select id="customerManagementEdit-custType" v-model="form.custType" allowClear placeholder="请选择客户类型">
+                <a-select-option v-for="item in addrDistrictList" :value="item.id" :key="item.id">{{ item.name }}</a-select-option>
+              </a-select>
             </a-form-model-item>
           </a-col>
           <a-col :span="8">
-            <a-form-model-item label="支付方式" prop="contactPhone">
-              <v-select code="PAY_FASHION" id="customerManagementEdit-payFashion" v-model="form.payFashion" allowClear placeholder="请选择支付方式"></v-select>
+            <a-form-model-item label="价格类型" prop="priceType">
+              <v-select code="PRICE_TYPE" id="customerManagementEdit-priceType" v-model="form.priceType" allowClear placeholder="请选择价格类型"></v-select>
             </a-form-model-item>
           </a-col>
           <a-col :span="8">
-            <a-form-model-item label="收款方式" prop="contactPhone">
-              <v-select code="RECEIPT_PAYMENT" id="customerManagementEdit-receiptPayment" v-model="form.receiptPayment" allowClear placeholder="请选择收款方式"></v-select>
+            <a-form-model-item label="支付方式" prop="payType">
+              <v-select code="PAY_FASHION" id="customerManagementEdit-payType" v-model="form.payType" allowClear placeholder="请选择支付方式"></v-select>
             </a-form-model-item>
           </a-col>
         </a-row>
         <a-row :gutter="15">
           <a-col :span="8">
-            <a-form-model-item label="联系电话" prop="address">
+            <a-form-model-item label="收款方式" prop="paymentType">
+              <v-select code="RECEIPT_PAYMENT" id="customerManagementEdit-paymentType" v-model="form.paymentType" allowClear placeholder="请选择收款方式"></v-select>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="8">
+            <a-form-model-item label="联系电话" prop="contactTel">
               <a-input
-                id="customerManagementEdit-address"
+                id="customerManagementEdit-contactTel"
                 :maxLength="20"
-                v-model="form.address"
+                v-model="form.contactTel"
                 placeholder="请输入联系电话(最多20个字符)"
                 allowClear />
             </a-form-model-item>
@@ -150,6 +157,7 @@
 
 <script>
 import { STable, VSelect } from '@/components'
+import { getProvince, getCityByPro, getDistrictByCity } from '@/api/data'
 import { custSave } from '@/api/customer'
 import { custTypeFindAll } from '@/api/custType'
 export default {
@@ -162,43 +170,49 @@ export default {
         wrapperCol: { span: 16 }
       },
       form: {
-        name: '', // 供应商名称
-        provinceCode: undefined, //  省
+        name: '', // 客户名称
+        mobile: '',  //  联系手机
+        contact: '',  //  联系人
+        province: undefined, //  省
         provinceName: '',
-        cityCode: undefined, // 市
+        city: undefined, // 市
         cityName: '',
-        districtCode: undefined, // 区
+        district: undefined, // 区
         districtName: '',
         address: '', //  详细地址
-        contactName: '',  //  联系人
-        contactPhone: '',  //  联系电话
-        remarks: '',  //  主营内容
-        state: 0  //  启禁用
+        fax: '',  //  客户传真
+        distributionType: '',  //  配送方式
+        remarks: '',  //  是否卫星仓客户
+        custType: '',  //  客户类型
+        priceType: '',  //  价格类型
+        payType: '',  //  支付方式
+        paymentType: '',  //  收款方式
+        contactTel: '',  //  联系电话
       },
       rules: {
         name: [
-          { required: true, message: '请输入供应商名称', trigger: 'blur' }
+          { required: true, message: '请输入客户名称', trigger: 'blur' }
+        ],
+        mobile: [
+          { required: true, message: '请输入联系手机', trigger: 'blur' }
         ],
-        provinceCode: [
+        province: [
           { required: true, message: '请选择省', trigger: 'change' }
         ],
-        cityCode: [
+        city: [
           { required: true, message: '请选择市', trigger: 'change' }
         ],
-        districtCode: [
+        district: [
           { required: true, message: '请选择区/县', trigger: 'change' }
         ],
-        address: [
-          { required: true, message: '请输入详细地址', trigger: 'blur' }
-        ],
-        contactName: [
-          { required: true, message: '请输入联系人', trigger: 'blur' }
+        priceType: [
+          { required: true, message: '请选择价格类型', trigger: 'change' }
         ],
-        contactPhone: [
-          { required: true, message: '请输入联系人电话', trigger: 'blur' }
+        payType: [
+          { required: true, message: '请选择支付方式', trigger: 'change' }
         ],
-        state: [
-          { required: true, message: '请选择状态', trigger: 'change' }
+        paymentType: [
+          { required: true, message: '请选择收款方式', trigger: 'change' }
         ]
       },
       addrProvinceList: [], //  省下拉

+ 24 - 23
src/views/salesManagement/customerManagement/list.vue

@@ -18,14 +18,14 @@
           </a-col>
           <a-col :md="6" :sm="24">
             <a-form-item label="客户名称">
-            	<a-select placeholder="请选择" allowClear v-model="queryParam.dataSourceNo" :showSearch="true" option-filter-prop="children" :filter-option="filterOption">
-            		<a-select-option v-for="item in brandData" :key="item.salesChannelNo" :value="item.salesChannelNo">{{ item.salesChannelName }}</a-select-option>
+            	<a-select placeholder="请选择" allowClear v-model="queryParam.name" :showSearch="true" option-filter-prop="children" :filter-option="filterOption">
+            		<a-select-option v-for="item in custData" :key="item.id" :value="item.id">{{ item.name }}</a-select-option>
             	</a-select>
             </a-form-item>
           </a-col>
           <a-col :md="6" :sm="24">
             <a-form-item label="联系人">
-              <a-input id="customerManagementList-bundleName" v-model.trim="queryParam.bundleName" allowClear placeholder="请输入联系人"/>
+              <a-input id="customerManagementList-contact" v-model.trim="queryParam.contact" allowClear placeholder="请输入联系人"/>
             </a-form-item>
           </a-col>
           <template v-if="advanced">
@@ -33,9 +33,9 @@
               <a-form-item label="最后销售时间">
                 <a-range-picker
                     style="width:100%"
-                    id="customerManagementList-creatTime"
+                    id="customerManagementList-salesTime"
                     :disabledDate="disabledDate"
-                    v-model="creatTime"
+                    v-model="salesTime"
                     :format="dateFormat"
                     :placeholder="['开始时间', '结束时间']" />
                 </a-form-item>
@@ -128,26 +128,26 @@ export default {
     return {
       advanced: false,  // 高级搜索 展开/关闭
       queryParam: { //  查询条件
-        // orderBundleNo: '', //  客户名称
-        // bundleName: '', //  联系人
-        // provinceCode: undefined,  //  省
-        // cityCode: undefined,  //  市
-        // districtCode: undefined,  //  区
+        name: '', //  客户名称
+        contact: '', //  联系人
+        province: undefined,  //  省
+        city: undefined,  //  市
+        district: undefined,  //  区
         // itemName: '', //  是否卫星仓客户
       },
       exportLoading: false, // 导出loading
       disabled: false, //  查询、重置按钮是否可操作
-      brandData: [],  //  产品品牌下拉数据
-      typeData: [],  //  产品类别下拉数据
+      custData: [],  //  客户 下拉数据
       dateFormat: 'YYYY-MM-DD',
       creatTime: [],  //  创建时间
+      salesTime: [],  //  最后销售时间
       columns: [
         { title: '序号', dataIndex: 'no', width: 70, align: 'center' },
-        { title: '创建时间', dataIndex: 'inventoryMoney', width: 180, align: 'center' },
-        { title: '客户名称', dataIndex: 'productName', width: 200, align: 'center', ellipsis: true, customRender: function (text) { return text || '--' } },
-        { title: '联系人', dataIndex: 'productBrand', width: 200, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '联系手机', dataIndex: 'productOldNum', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '联系电话', dataIndex: 'productType', width: 200, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '创建时间', dataIndex: 'createDate', width: 180, align: 'center' },
+        { title: '客户名称', dataIndex: 'name', width: 200, align: 'center', ellipsis: true, customRender: function (text) { return text || '--' } },
+        { title: '联系人', dataIndex: 'contact', width: 200, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '联系手机', dataIndex: 'mobile', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '联系电话', dataIndex: 'contactTel', width: 200, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '最后销售时间', dataIndex: 'inventoryNumss', width: 180, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '是否卫星仓', dataIndex: 'inventoryNum', width: 120, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '操作', scopedSlots: { customRender: 'action' }, width: 270, align: 'center' }
@@ -179,12 +179,13 @@ export default {
     },
     //  重置
     resetSearchForm () {
-      this.queryParam.orderBundleNo = ''
-      this.queryParam.orderBundle.custMobile = ''
-      this.queryParam.bundleName = ''
-      this.queryParam.itemName = ''
-      this.oldTime = undefined
-      this.newTime = undefined
+      this.queryParam.name = ''
+      this.queryParam.contact = ''
+      this.queryParam.province = undefined
+      this.queryParam.city = undefined
+      this.queryParam.district = undefined
+      this.creatTime = []
+      this.salesTime = []
       this.$refs.table.refresh(true)
     },
     //  新增/编辑