Ver Fonte

客户关系

chenrui há 9 meses atrás
pai
commit
5a4c13b408

+ 12 - 0
src/api/customer.js

@@ -119,3 +119,15 @@ export const custMergeLogList = (params) => {
     }
   })
 }
+
+// 关联经销商
+export const queryCanRelevancyDealer = params => {
+  return axios({
+    url: '/cust/queryCanRelevancyDealer',
+    data: params,
+    method: 'post',
+    headers: {
+      'module': encodeURIComponent('关联经销商列表')
+    }
+  })
+}

+ 485 - 12
src/views/allocationManagement/chainTransferOut/list.vue

@@ -1,3 +1,482 @@
+ jianguan-web / qpls-md-html
+
+list.vue 20 KB
+
+1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+392
+393
+394
+395
+396
+397
+398
+399
+400
+401
+402
+403
+404
+405
+406
+407
+408
+409
+410
+411
+412
+413
+414
+415
+416
+417
+418
+419
+420
+421
+422
+423
+424
+425
+426
+427
+428
+429
+430
+431
+432
+433
+434
+435
+436
+437
+438
+439
+440
+441
+442
+443
+444
+445
+446
+447
+448
+449
+450
+451
+452
+453
+454
+455
+456
+457
+458
+459
+460
+461
+462
+463
+464
+465
+466
+467
+468
+469
+470
+471
+472
+473
+474
+475
 <template>
   <a-card size="small" :bordered="false" class="chainTransferOutList-wrap">
     <a-spin :spinning="spinning" tip="Loading...">
@@ -20,12 +499,12 @@
                 <rangeDate ref="outWareRangeDate" v-model="outWareTime" @change="outWareDateChange" />
               </a-form-item>
             </a-col>
+            <a-col :md="6" :sm="24">
+              <a-form-item label="连锁调出单号">
+                <a-input id="chainTransferOutList-allocationLinkageOutNo" v-model.trim="queryParam.allocationLinkageOutNo" allowClear placeholder="请输入连锁调出单号"/>
+              </a-form-item>
+            </a-col>
             <template v-if="advanced">
-              <a-col :md="6" :sm="24">
-                <a-form-item label="连锁调出单号">
-                  <a-input id="chainTransferOutList-allocationLinkageOutNo" v-model.trim="queryParam.allocationLinkageOutNo" allowClear placeholder="请输入连锁调出单号"/>
-                </a-form-item>
-              </a-col>
               <a-col :md="6" :sm="24">
                 <a-form-item label="调往对象">
                   <getTenantList id="chainTransferOutList-putTenantSn" type="out" placeholder="请选择调往对象" v-model="queryParam.putTenantSn"></getTenantList>
@@ -64,13 +543,8 @@
                     allowClear></v-select>
                 </a-form-item>
               </a-col>
-              <a-col :md="6" :sm="24">
-                <a-form-model-item label="客户关系">
-                  <v-select code="CUSTOMER_RELATION_TYPE" id="chainTransferOutList-relationType" v-model="queryParam.relationType" allowClear placeholder="请选择客户关系"></v-select>
-                </a-form-model-item>
-              </a-col>
             </template>
-            <a-col :md="6" :sm="24">
+            <a-col :md="24" :sm="24" style="margin-bottom: 10px;text-align: center;">
               <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="chainTransferOutList-refresh">查询</a-button>
               <a-button style="margin-left: 8px" @click="resetSearchForm" :disabled="disabled" id="chainTransferOutList-reset">重置</a-button>
               <a-button
@@ -244,7 +718,6 @@ export default {
         { title: '创建时间', dataIndex: 'createDate', width: '11%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '连锁调出单号', scopedSlots: { customRender: 'allocationLinkageOutNo' }, width: '16%', align: 'center' },
         { title: '调往对象', dataIndex: 'putTenantName', width: '17%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '客户关系', dataIndex: 'relationTypeDictValue', align: 'center', width: '9%', customRender: function (text) { return text || '--' } },
         { title: '总款数', dataIndex: 'productTotalCategory', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '总数量', dataIndex: 'productTotalQty', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         // { title: '总成本', dataIndex: 'productTotalCost', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },

+ 477 - 12
src/views/allocationManagement/storeTransferOut/list.vue

@@ -1,3 +1,474 @@
+ jianguan-web / qpls-md-html
+
+list.vue 19 KB
+
+1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+392
+393
+394
+395
+396
+397
+398
+399
+400
+401
+402
+403
+404
+405
+406
+407
+408
+409
+410
+411
+412
+413
+414
+415
+416
+417
+418
+419
+420
+421
+422
+423
+424
+425
+426
+427
+428
+429
+430
+431
+432
+433
+434
+435
+436
+437
+438
+439
+440
+441
+442
+443
+444
+445
+446
+447
+448
+449
+450
+451
+452
+453
+454
+455
+456
+457
+458
+459
+460
+461
+462
+463
+464
+465
+466
+467
 <template>
   <a-card size="small" :bordered="false" class="storeTransferOutList-wrap">
     <a-spin :spinning="spinning" tip="Loading...">
@@ -20,12 +491,12 @@
                 <rangeDate ref="outWareRangeDate" :value="outWareTime" @change="outWareDateChange" />
               </a-form-item>
             </a-col>
+            <a-col :md="6" :sm="24">
+              <a-form-item label="店内调出单号">
+                <a-input id="storeTransferOutList-storeCallOutNo" v-model.trim="queryParam.storeCallOutNo" allowClear placeholder="请输入店内调出单号"/>
+              </a-form-item>
+            </a-col>
             <template v-if="advanced">
-              <a-col :md="6" :sm="24">
-                <a-form-item label="店内调出单号">
-                  <a-input id="storeTransferOutList-storeCallOutNo" v-model.trim="queryParam.storeCallOutNo" allowClear placeholder="请输入店内调出单号"/>
-                </a-form-item>
-              </a-col>
               <a-col :md="6" :sm="24">
                 <a-form-item label="调往对象名称">
                   <custList id="storeTransferOutList-putPersonName" ref="custList" @change="custChange"></custList>
@@ -62,13 +533,8 @@
                   ></v-select>
                 </a-form-item>
               </a-col>
-              <a-col :md="6" :sm="24">
-                <a-form-model-item label="客户关系">
-                  <v-select code="CUSTOMER_RELATION_TYPE" id="storeTransferOutList-relationType" v-model="queryParam.relationType" allowClear placeholder="请选择客户关系"></v-select>
-                </a-form-model-item>
-              </a-col>
             </template>
-            <a-col :md="6" :sm="24">
+            <a-col :md="24" :sm="24" style="margin-bottom: 10px;text-align: center;">
               <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="storeTransferOutList-refresh">查询</a-button>
               <a-button style="margin-left: 8px" @click="resetSearchForm" :disabled="disabled" id="storeTransferOutList-reset">重置</a-button>
               <a @click="advanced=!advanced" style="margin-left: 8px">
@@ -235,7 +701,6 @@ export default {
         { title: '创建时间', dataIndex: 'createDate', width: '11%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '店内调出单号', scopedSlots: { customRender: 'storeCallOutNo' }, width: '14%', align: 'center' },
         { title: '调往对象名称', width: '16%', align: 'center', customRender: function (text, record) { return (record.putPersonType == 'CUSTOMER' ? record.customerNameCurrent : record.putPersonName) || '--' }, ellipsis: true },
-        { title: '客户关系', dataIndex: 'relationTypeDictValue', align: 'center', width: '9%', customRender: function (text) { return text || '--' } },
         { title: '调拨类型', dataIndex: 'callOutTypeName', width: '7%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '总款数', dataIndex: 'productTotalCategory', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '总数量', dataIndex: 'productTotalQty', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },

+ 126 - 0
src/views/common/dealerList.vue

@@ -0,0 +1,126 @@
+<template>
+  <a-select
+    show-search
+    label-in-value
+    :size="size"
+    :value="dealerName"
+    mode="combobox"
+    placeholder="请输入经销商名称搜索"
+    style="width: 100%"
+    :filter-option="false"
+    :not-found-content="fetching ? undefined : null"
+    :dropdownMatchSelectWidth="false"
+    :defaultActiveFirstOption="false"
+    @search="fetchUser"
+    @change="handleChange"
+    allowClear
+  >
+    <a-spin v-if="fetching" slot="notFoundContent" size="small" />
+    <a-select-option v-for="item in data" :key="item.dealerSn" :value="item.dealerName">
+      {{ item.dealerName }}
+    </a-select-option>
+  </a-select>
+</template>
+<script>
+import debounce from 'lodash/debounce'
+import { queryCanRelevancyDealer } from '@/api/customer'
+export default {
+  props: {
+    isValidateEnabled: {
+      type: Boolean,
+      default: false
+    },
+    size: {
+      type: String,
+      default: 'default'
+    },
+    itemSn: {
+      type: String || Number,
+      default: undefined
+    },
+    notSn: {
+      type: String || Number,
+      default: ''
+    },
+    isEnabled: { // 是否只查启用状态
+      type: Boolean,
+      default: false
+    },
+    mainFlag: {
+      type: Boolean,
+      default: true
+    },
+    satelliteFlag: {
+      type: Boolean,
+      default: false
+    },
+    dealerDisabled: {
+      type: Boolean,
+      default: false
+    },
+    dealerFlag: { // 0不含下级,1 只是下级,all是全部
+      type: [String, Number],
+      default: 'all'
+    }
+  },
+  data () {
+    this.lastFetchId = 0
+    this.fetchUser = debounce(this.fetchUser, 800)
+    return {
+      data: [],
+      dealerName: undefined,
+      fetching: false
+    }
+  },
+  methods: {
+    fetchUser (dealerName) {
+      if (dealerName == '') return
+      this.lastFetchId += 1
+      const fetchId = this.lastFetchId
+      this.data = []
+      this.fetching = true
+      const params = {}
+      params.queryWord = dealerName.trim()
+      queryCanRelevancyDealer({}).then(res => {
+        if (fetchId !== this.lastFetchId) {
+          return
+        }
+        this.data = res.data || []
+        this.fetching = false
+      })
+    },
+    handleChange (value) {
+      if (value && value.key) {
+        value.key = value.key.trim()
+        const ind = this.data.findIndex(item => item.dealerName == value.key)
+        value.row = ind != -1 ? this.data[ind] : undefined
+      }
+
+      Object.assign(this, {
+        dealerName: value,
+        data: [],
+        fetching: false
+      })
+      this.$emit('input', value && value.key || undefined)
+      this.$emit('change', value && value.key || undefined, value && value.row || undefined)
+    },
+    resetForm () {
+      this.dealerName = undefined
+      this.setData(undefined)
+    },
+    setData (value) {
+      Object.assign(this, {
+        dealerName: value,
+        data: [],
+        fetching: false
+      })
+    }
+  },
+  mounted () {
+    if (this.itemSn) {
+      this.fetchUser(this.itemSn)
+      this.setData({ key: this.itemSn })
+    }
+  }
+}
+</script>

+ 16 - 10
src/views/customerManagement/customerInfo/edit.vue

@@ -28,15 +28,9 @@
                   allowClear />
               </a-form-model-item>
             </a-col>
-            <a-col :span="12">
+            <a-col :span="12" v-if="form.relationType==='customer'">
               <a-form-model-item label="关联经销商" :labelCol="{ span: 6}" :wrapperCol="{ span: 16 }">
-                <a-input
-                  id="customerManagementEdit-customerName"
-                  :maxLength="30"
-                  v-model.trim="form.customerName"
-                  @change="filterEmpty"
-                  placeholder="请输入关联经销商"
-                  allowClear />
+                <dealerList id="customerManagementEdit-putPersonName" ref="dealerList" @change="dealerChange"></dealerList>
               </a-form-model-item>
             </a-col>
             <a-col :span="12">
@@ -123,10 +117,11 @@ import { commonMixin } from '@/utils/mixin'
 import { STable, VSelect } from '@/components'
 import custType from '@/views/common/custType.js'
 import AreaList from '@/views/common/areaList.js'
+import dealerList from '@/views/common/dealerList'
 import { custSave, custFindById, settleStyleFindAllList } from '@/api/customer'
 export default {
   name: 'CustomerManagementEdit',
-  components: { STable, VSelect, custType, AreaList },
+  components: { STable, VSelect, custType, AreaList, dealerList },
   mixins: [commonMixin],
   props: {
     model: {
@@ -160,8 +155,10 @@ export default {
         relationTypeDictValue: undefined, // 客户关系
         customerTypeSn: undefined, //  客户类型
         priceType: '', //  价格类型
-        settleStyleSn: undefined //  收款方式
+        settleStyleSn: undefined, //  收款方式
+        dealerSn: undefined // 关联经销商
       },
+      dealerName: undefined, // 关联经销商名称
       areaVal: [],
       rules: {
         customerName: [{ required: true, message: '请输入客户名称', trigger: 'blur' }],
@@ -177,6 +174,15 @@ export default {
     }
   },
   methods: {
+    dealerChange (v, row) {
+      if (row && row.dealerSn) {
+        this.form.dealerSn = row.dealerSn
+        this.dealerName = undefined
+      } else {
+        this.dealerName = v
+        this.form.dealerSn = undefined
+      }
+    },
     filterEmpty () {
       let str = this.form.customerName
       str = str.replace(/\ +/g, '')