lilei 2 лет назад
Родитель
Сommit
b211904877

+ 1 - 1
public/version.json

@@ -1,5 +1,5 @@
 {
   "message": "发现有新版本发布,确定更新系统?",
   "vendorJsVersion": "",
-  "version": 1676422014382
+  "version": 1676606305734
 }

+ 21 - 0
src/api/customer.js

@@ -71,3 +71,24 @@ export const updateEnableStatus = params => {
     method: 'get'
   })
 }
+
+// 客户合并
+export const custMerge = params => {
+  return axios({
+    url: '/cust/merge',
+    data: params,
+    method: 'post'
+  })
+}
+
+// 合并记录分页
+export const custMergeLogList = (params) => {
+  const url = `/cust/queryMergeLogPage/${params.pageNo}/${params.pageSize}`
+  delete params.pageNo
+  delete params.pageSize
+  return axios({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}

+ 1 - 1
src/views/common/custList.vue

@@ -89,8 +89,8 @@ export default {
         data: [],
         fetching: false
       })
-      this.$emit('change', value && value.key || undefined, value && value.row || undefined)
       this.$emit('input', value && value.key || undefined)
+      this.$emit('change', value && value.key || undefined, value && value.row || undefined)
     },
     resetForm () {
       this.dealerName = undefined

+ 44 - 3
src/views/customerManagement/customerInfo/detailModal.vue

@@ -19,11 +19,27 @@
           <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>
-          <a-descriptions-item label="是否为下级:">{{ detailData&&detailData.satelliteFlagDictValue || '--' }}</a-descriptions-item>
+          <a-descriptions-item label="是否为下级:">{{ detailData&&detailData.mainFlagDictValue || '--' }}</a-descriptions-item>
           <a-descriptions-item label="价格类型:">{{ detailData&&detailData.priceTypeDictValue || '--' }}</a-descriptions-item>
           <a-descriptions-item label="收款方式:">{{ detailData&&detailData.settleStyleSnDictValue || '--' }}</a-descriptions-item>
           <a-descriptions-item label="客户类型:">{{ detailData&&detailData.customerTypeName || '--' }}</a-descriptions-item>
         </a-descriptions>
+        <div>
+          <div style="padding:10px 0;border-bottom: 1px solid #eee;margin: 10px 0;">被合并的客户记录</div>
+          <div>
+            <s-table
+            class="sTable"
+            ref="table"
+            size="small"
+            :rowKey="(record) => record.id"
+            :columns="columns"
+            :data="loadData"
+            :defaultLoadData="false"
+            :scroll="{ y: 240 }"
+            bordered>
+            </s-table>
+          </div>
+        </div>
       </a-spin>
       <div class="btn-cont"><a-button id="customer-management-detail-modal-back" @click="isShow = false">返回列表</a-button></div>
     </div>
@@ -32,7 +48,7 @@
 
 <script>
 import { STable } from '@/components'
-import { custFindById } from '@/api/customer'
+import { custFindById, custMergeLogList } from '@/api/customer'
 export default {
   name: 'CustomerManagementDetailModal',
   components: { STable },
@@ -60,7 +76,31 @@ export default {
   data () {
     return {
       isShow: this.openModal, //  是否打开弹框
-      detailData: null //  网点数据
+      detailData: null, //  网点数据
+      columns: [
+        { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
+        { title: '合并时间', dataIndex: 'createDate', width: '12%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '被合并客户名称', dataIndex: 'customerName', width: '42%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '主体客户名称', dataIndex: 'contactName', width: '42%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+      ],
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        this.disabled = true
+        this.spinning = true
+        return custMergeLogList(Object.assign(parameter, {customerSnMain:this.detailData.customerSn})).then(res => {
+          let data
+          if (res.status == 200) {
+            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
+            }
+            this.disabled = false
+          }
+          this.spinning = false
+          return data
+        })
+      },
     }
   },
   methods: {
@@ -69,6 +109,7 @@ export default {
       custFindById({ id: this.itemId }).then(res => {
         if (res.status == 200) {
           this.detailData = res.data
+          this.$refs.table.refresh()
         } else {
           this.detailData = null
         }

+ 18 - 20
src/views/customerManagement/customerInfo/list.vue

@@ -23,7 +23,7 @@
             <template v-if="advanced">
               <a-col :md="6" :sm="24">
                 <a-form-item label="是否为下级">
-                  <v-select code="FLAG" id="customerManagementList-satelliteFlag" v-model="queryParam.satelliteFlag" allowClear placeholder="请选择"></v-select>
+                  <v-select code="FLAG" id="customerManagementList-mainFlag" v-model="queryParam.mainFlag" allowClear placeholder="请选择"></v-select>
                 </a-form-item>
               </a-col>
               <a-col :md="12" :sm="24">
@@ -127,7 +127,7 @@
     <!-- 客户详情 -->
     <customer-management-detail-modal :openModal="openModal" :itemId="itemId" @close="closeModal" />
     <!-- 合并用户 -->
-    <merge-customer-modal :openModal="openMergeModal" :mainCustomerName="customerName" @close="closeMergeModal" />
+    <merge-customer-modal :openModal="openMergeModal" :params="customerTemp" @close="closeMergeModal" />
   </a-card>
 </template>
 
@@ -157,7 +157,7 @@ export default {
         provinceSn: undefined, //  省
         citySn: undefined, //  市
         countySn: undefined, //  区
-        satelliteFlag: undefined, //  是否卫星仓客户
+        mainFlag: undefined, //  是否卫星仓客户
         customerTypeSn: undefined //  客户类型
       },
       disabled: false, //  查询、重置按钮是否可操作
@@ -169,7 +169,7 @@ export default {
         { title: '联系手机', dataIndex: 'contactMobile', width: '9%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '创建时间', dataIndex: 'createDate', width: '11%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '最后销售时间', dataIndex: 'lastSaleTime', width: '11%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '是否为下级', dataIndex: 'satelliteFlagDictValue', width: '7%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '是否为下级', dataIndex: 'mainFlagDictValue', width: '7%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '启用禁用', scopedSlots: { customRender: 'enableAction' }, width: '8%', align: 'center' },
         { title: '操作', scopedSlots: { customRender: 'action' }, width: '10%', align: 'center' }
       ],
@@ -198,7 +198,7 @@ export default {
       openModal: false, //  查看客户详情  弹框
       itemId: '', //  当前客户id
       openMergeModal: false, // 合并用户名称
-      customerName: ''// 主题客户名称
+      customerTemp: {}// 临时客户数据
     }
   },
   methods: {
@@ -217,7 +217,7 @@ export default {
       this.queryParam.provinceSn = undefined
       this.queryParam.citySn = undefined
       this.queryParam.countySn = undefined
-      this.queryParam.satelliteFlag = undefined
+      this.queryParam.mainFlag = undefined
       this.queryParam.customerTypeSn = undefined
       this.addrCityList = []
       this.addrDistrictList = []
@@ -270,22 +270,28 @@ export default {
         }
       })
     },
-    //  客户合并
-    handleMerge () {},
     //  客户信息详情
     handleDetail (row) {
       this.itemId = row.id
       this.openModal = true
     },
+    // 合并客户
+    mergeCustomer (row) {
+      this.customerTemp = row
+      this.openMergeModal = true
+    },
+    closeMergeModal (flag) {
+      this.customerTemp = ''
+      this.openMergeModal = false
+      if(flag){
+        this.$refs.table.refresh()
+      }
+    },
     //  关闭弹框
     closeModal () {
       this.itemId = ''
       this.openModal = false
     },
-    closeMergeModal () {
-      this.customerName = ''
-      this.openMergeModal = false
-    },
     filterOption (input, option) {
       return (
         option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
@@ -347,14 +353,6 @@ export default {
     setTableH () {
       const tableSearchH = this.$refs.tableSearch.offsetHeight
       this.tableHeight = window.innerHeight - tableSearchH - 255
-    },
-    // 合并客户
-    mergeCustomer (con) {
-      this.customerName = con.customerName
-      const _this = this
-      this.$nextTick(() => {
-        _this.openMergeModal = true
-      })
     }
   },
   watch: {

+ 26 - 15
src/views/customerManagement/customerInfo/mergeCustomerModal.vue

@@ -18,10 +18,10 @@
         :label-col="formItemLayout.labelCol"
         :wrapper-col="formItemLayout.wrapperCol"
       >
-        <a-form-model-item label="主体客户:" prop="mainName">
+        <a-form-model-item label="主体客户:">
           <div>{{ mainCustomerName }}</div>
         </a-form-model-item>
-        <a-form-model-item label="被合并的客户名称:" prop="buyerSn">
+        <a-form-model-item label="被合并的客户名称:" prop="customerSnSource">
           <custList ref="custList" @change="custChange" placeholder="输入客户名称搜索"></custList>
         </a-form-model-item>
       </a-form-model>
@@ -35,6 +35,7 @@
 
 <script>
 import { commonMixin } from '@/utils/mixin'
+import { custMerge } from '@/api/customer'
 import custList from '@/views/common/custList.vue'
 export default {
   name: 'SalesRecordModal',
@@ -45,9 +46,11 @@ export default {
       type: Boolean,
       default: false
     },
-    mainCustomerName: {
-      type: [Number, String],
-      default: ''
+    params: {
+      type: Object,
+      default(){
+        return {}
+      }
     }
   },
   data () {
@@ -58,11 +61,12 @@ export default {
         wrapperCol: { span: 16 }
       },
       form: {
-        buyerSn: '', // 被合并客户sn
-        buyerName: '' // 被合并客户名称
+        customerSnTarget: '', // 主体客户sn 
+        customerSnSource: '', // 被合并客户sn
       },
+      mainCustomerName: '', // 主体客户名称
       rules: {
-        buyerSn: [
+        customerSnSource: [
           { required: true, message: '输入客户名称搜索', trigger: 'blur' }
         ]
       }
@@ -72,11 +76,9 @@ export default {
     // 客户 change
     custChange (obj, row) {
       if (row) {
-        this.form.buyerSn = row && row.customerSn || undefined
-        this.form.buyerName = undefined
+        this.form.customerSnSource = row && row.customerSn || undefined
       } else {
-        this.form.buyerName = obj || undefined
-        this.form.buyerSn = undefined
+        this.form.customerSnSource = undefined
       }
     },
     handleSave () {
@@ -99,7 +101,12 @@ export default {
         okType: 'danger',
         cancelText: '取消',
         onOk () {
-          _this.$emit('close')
+          custMerge(_this.form).then(res => {
+            if(res.status == 200){
+              _this.$message.info(res.message)
+              _this.$emit('close',true)
+            }
+          })
         },
         onCancel () {
           console.log('Cancel')
@@ -116,9 +123,13 @@ export default {
     isShow (newValue, oldValue) {
       if (!newValue) {
         this.$emit('close')
-        this.form.buyerSn = undefined
-        this.form.buyerName = undefined
+        this.form.customerSnSource = undefined
+        this.form.customerSnTarget = undefined
+        this.mainCustomerName = undefined
         this.$refs.custList.setData(undefined)
+      }else{
+        this.mainCustomerName = this.params.customerName
+        this.form.customerSnTarget = this.params.customerSn
       }
     }
   }

+ 37 - 37
vue.config.js

@@ -2,11 +2,11 @@ const fs = require('fs');
 const path = require('path')
 const webpack = require('webpack')
 const createThemeColorReplacerPlugin = require('./config/plugin.config')
-// gzip 压
+// gzip 压锟斤拷
 const compressionWebpackPlugin = require('compression-webpack-plugin');
-// js,css 压
+// js,css 压锟斤拷
 const TerserPlugin = require('terser-webpack-plugin');
-// 版本自动生成
+// 锟芥本锟皆讹拷锟斤拷锟斤拷
 const WebpackVersionPlugin = require('webpack-version-plugin');
 const versionConfig = require(resolve('public/version.json'));
 
@@ -22,13 +22,13 @@ function isProd () {
   return process.env.NODE_ENV === 'production'
 }
 
-// 项目部署基础
-// 默认情况下,我们假设你的应用将被部署在域的根目录下,
-// 例如:https://www.my-app.com/
-// 默认:'/'
-// 如果您的应用程序部署在子路径中,则需要在这指定子路径
-// 例如:https://www.foobar.com/my-app/
-// 需要将它改为'/my-app/'
+// 锟斤拷目锟斤拷锟斤拷锟斤拷锟�
+// 默锟斤拷锟斤拷锟斤拷拢锟斤拷锟斤拷羌锟斤拷锟斤拷锟斤拷应锟矫斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷母锟侥柯硷拷锟�,
+// 锟斤拷锟界:https://www.my-app.com/
+// 默锟较o拷'/'
+// 锟斤拷锟斤拷锟斤拷锟接︼拷贸锟斤拷锟斤拷锟斤拷锟斤拷锟铰凤拷锟斤拷校锟斤拷锟斤拷锟揭�拷锟斤拷锟街革拷锟斤拷锟铰凤拷锟�
+// 锟斤拷锟界:https://www.foobar.com/my-app/
+// 锟斤拷要锟斤拷锟斤拷锟斤拷为'/my-app/'
 const BASE_URL = isProd ? '/' : '/'
 
 const assetsCDN = {
@@ -61,21 +61,21 @@ const prodExternals = {
 
 // vue.config.js
 const vueConfig = {
-  runtimeCompiler: true, // 动态编译组件
+  runtimeCompiler: true, // 锟斤拷态锟斤拷锟斤拷锟斤拷锟�
   publicPath: BASE_URL,
   configureWebpack: {
     optimization: isProd() ? {
           minimize: true,
           minimizer: [new TerserPlugin({
-              test: /\.js(\?.*)?$/i,    //匹配参与压缩的文件
-              parallel: true,    //使用多进程并发运行
-              terserOptions: {    //Terser 压缩配置
+              test: /\.js(\?.*)?$/i,    //匹锟斤拷锟斤拷锟窖癸拷锟斤拷锟斤拷募锟�
+              parallel: true,    //使锟矫讹拷锟斤拷滩锟斤拷锟斤拷锟斤拷锟�
+              terserOptions: {    //Terser 压锟斤拷锟斤拷锟斤拷
                   output:{comments: false},
-                  compress: {//console删
+                  compress: {//console删锟斤拷
                       pure_funcs: ["console.log"]
                   }
               },
-              extractComments: true,    //将注释剥离到单独的文件中
+              extractComments: true,    //锟斤拷注锟酵帮拷锟诫到锟斤拷锟斤拷锟斤拷锟侥硷拷锟斤拷
           })],
       }:{},
     // webpack plugins
@@ -83,15 +83,15 @@ const vueConfig = {
       // Ignore all locale files of moment.js
       new webpack.IgnorePlugin(/^\.\/locale$/, /moment$/),
       new compressionWebpackPlugin({
-          //[file] 会被替换成原始资源。[path] 会被替换成原始资源的路径, [query] 会被替换成查询字符串。默认值是 "[path].gz[query]"。
-          filename: '[path].gz[query]', // 提示compression-webpack-plugin@3.0.0的话asset改为filename
-          //可以是 function(buf, callback) 或者字符串。对于字符串来说依照 zlib 的算法(或者 zopfli 的算法)。默认值是 "gzip"。
+          //[file] 锟结被锟芥换锟斤拷原始锟斤拷源锟斤拷[path] 锟结被锟芥换锟斤拷原始锟斤拷源锟斤拷路锟斤拷锟斤拷 [query] 锟结被锟芥换锟缴诧拷询锟街凤拷锟斤拷锟斤拷默锟斤拷值锟斤拷 "[path].gz[query]"锟斤拷
+          filename: '[path].gz[query]', // 锟斤拷示compression-webpack-plugin@3.0.0锟侥伙拷asset锟斤拷为filename
+          //锟斤拷锟斤拷锟斤拷 function(buf, callback) 锟斤拷锟斤拷锟街凤拷锟斤拷锟斤拷锟斤拷锟斤拷锟街凤拷锟斤拷锟斤拷说锟斤拷锟斤拷 zlib 锟斤拷锟姐法(锟斤拷锟斤拷 zopfli 锟斤拷锟姐法)锟斤拷默锟斤拷值锟斤拷 "gzip"锟斤拷
           algorithm: 'gzip',
-          //所有匹配该正则的资源都会被处理。默认值是全部资源。
+          //锟斤拷锟斤拷匹锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷源锟斤拷锟结被锟斤拷锟斤拷锟斤拷默锟斤拷值锟斤拷全锟斤拷锟斤拷源锟斤拷
           test: new RegExp('\\.(' + ['js', 'css'].join('|') + ')$'),
-          //只有大小大于该值的资源会被处理。单位是 bytes。默认值是 0。
+          //只锟叫达拷小锟斤拷锟节革拷值锟斤拷锟斤拷源锟结被锟斤拷锟斤拷锟斤拷锟斤拷位锟斤拷 bytes锟斤拷默锟斤拷值锟斤拷 0锟斤拷
           threshold: 10240,
-          //只有压缩率小于这个值的资源才会被处理。默认值是 0.8。
+          //只锟斤拷压锟斤拷锟斤拷小锟斤拷锟斤拷锟街碉拷锟斤拷锟皆达拷呕岜伙拷锟斤拷锟斤拷锟侥�拷锟街碉拷锟� 0.8锟斤拷
           minRatio: 0.8
         }),
       new WebpackVersionPlugin({
@@ -137,17 +137,17 @@ const vueConfig = {
     }
     
     config.optimization && config.optimization.splitChunks({
-        // 拆包配置 
-        chunks: 'all', //三选一:"initial" 初始化,"all"(默认就是all),"async"(动态加载) 
-        minSize: 30000, // 形成一个新代码块最小的体积,只有 >= minSize 的bundle会被拆分出来 30000
-        maxSize: 0, //拆分之前最大的数值,默认为0,即不做限制
-        minChunks: 1, //引入次数,如果为2 那么一个资源最少被引用两次才可以被拆分出来
-        maxAsyncRequests: 5, // 按需加载的最大并行请求数
-        maxInitialRequests: 4, // 一个入口最大并行请求数
-        automaticNameDelimiter: '~', // 文件名的连接符
+        // 锟斤拷锟斤拷锟斤拷锟� 
+        chunks: 'all', //锟斤拷选一锟斤拷"initial" 锟斤拷始锟斤拷锟斤拷"all"(默锟较撅拷锟斤拷all)锟斤拷"async"锟斤拷锟斤拷态锟斤拷锟截o拷 
+        minSize: 30000, // 锟轿筹拷一锟斤拷锟铰达拷锟斤拷锟斤拷锟叫★拷锟斤拷锟斤拷,只锟斤拷 >= minSize 锟斤拷bundle锟结被锟斤拷殖锟斤拷锟� 30000
+        maxSize: 0, //锟斤拷锟街�帮拷锟斤拷锟斤拷锟街碉拷锟侥�拷锟轿�0锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷
+        minChunks: 1, //锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷为2 锟斤拷么一锟斤拷锟斤拷源锟斤拷锟劫憋拷锟斤拷锟斤拷锟斤拷锟轿才匡拷锟皆憋拷锟斤拷殖锟斤拷锟�
+        maxAsyncRequests: 5, // 锟斤拷锟斤拷锟斤拷氐锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷
+        maxInitialRequests: 4, // 一锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷
+        automaticNameDelimiter: '~', // 锟侥硷拷锟斤拷锟斤拷锟斤拷锟接凤拷
         name: true,
         cacheGroups: {
-        // node_modules模块包
+        // node_modules模锟斤拷锟�
         vendors: {
           test: /[\\/]node_modules[\\/]/,
           name: 'chunk-vendors',
@@ -158,7 +158,7 @@ const vueConfig = {
           chunks: 'all',
           priority: -10,
         },
-        // UI库单独拆包
+        // UI锟解单锟斤拷锟斤拷锟�
         antDesign: {
           name: 'chunk-antDesign',
           priority: 19, //  the weight needs to be larger than libs and app or it will be packaged into libs or app
@@ -169,18 +169,18 @@ const vueConfig = {
           priority: 20, //  the weight needs to be larger than libs and app or it will be packaged into libs or app
           test: /[\\/]node_modules[\\/]_?ant-design-vue(.*)/
         },
-        // 共享模块
+        // 锟斤拷锟斤拷模锟斤拷
         common: {
           name: 'chunk-common',
           minChunks: 2,
-          maxSize: 1024, //拆分之前最大的数值,默认为0,即不做限制
+          maxSize: 1024, //锟斤拷锟街�帮拷锟斤拷锟斤拷锟街碉拷锟侥�拷锟轿�0锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷
           priority: -20,
           reuseExistingChunk: true
         }
         }
     });
     
-    // 分析打包大小
+    // 锟斤拷锟斤拷锟斤拷锟斤拷锟叫�
     if (process.env.npm_config_report) {
       config.plugin('webpack-bundle-analyzer')
       .use(require('webpack-bundle-analyzer').BundleAnalyzerPlugin)
@@ -211,8 +211,8 @@ const vueConfig = {
     // If you want to turn on the proxy, please remove the mockjs /src/main.jsL11
     proxy: {
       '/api': {
-        // target: 'http://192.168.0.183:8503/qpls-md',
-        target: 'http://p.iscm.360arrow.com/qpls-md',
+        target: 'http://192.168.0.183:8503/qpls-md',
+        // target: 'http://p.iscm.360arrow.com/qpls-md',
         // ws: false,
         ws: true,
         changeOrigin: true,