lshcom 1.0.2 → 1.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lshcom",
3
- "version": "1.0.2",
3
+ "version": "1.0.4",
4
4
  "files": [
5
5
  "src/assets/*",
6
6
  "src/common/common.js",
@@ -389,7 +389,7 @@ export default {
389
389
  props: {
390
390
  custVo: {
391
391
  type: Object,
392
- default: {},
392
+ default: () => { return {} },
393
393
  },
394
394
  bindFlag: {
395
395
  type: Boolean,
@@ -488,6 +488,20 @@ export default {
488
488
  },
489
489
 
490
490
  methods: {
491
+ handleInit(params) {
492
+ const { mobilePhone } = params
493
+ console.log(params, mobilePhone)
494
+ mobilePhone && this.querySearch(mobilePhone, (nouse, res) => {
495
+ if (Array.isArray(res) && res.length) {
496
+ console.log('res ===>>', res)
497
+
498
+ this.queryParams = res[0]
499
+ console.log('queryParams ===>>', this.queryParams)
500
+ } else {
501
+ Object.assign(this.queryParams, params)
502
+ }
503
+ })
504
+ },
491
505
  ...mapActions({
492
506
  saveScvId: "customerPortrayal/getScvIdSave",
493
507
  savePhoneNo: "customerPortrayal/getCustomerPhoneNo",
@@ -522,8 +536,8 @@ export default {
522
536
  index: index,
523
537
  };
524
538
  });
525
- cb(list);
526
539
  this.chooseList = res.data.obj;
540
+ cb(list, this.chooseList);
527
541
  // 回显
528
542
  // this.queryParams = res.data.obj[0]
529
543
  } else {
@@ -583,13 +597,13 @@ export default {
583
597
  this.queryParams.addressRegion = direect[0].label;
584
598
  }
585
599
  }
586
- const {
587
- annualIncome, company, customerTrade, drivableType, wxNo,
588
- driveLicenceEnd, driveLicenceStart, interest, interestedVas,
589
- maritalStatus, post, qqNo, remark, scvId, storeCode
590
- } = this.custVo;
591
600
  let params = {}
592
601
  if(this.isSaveOther) {
602
+ const {
603
+ annualIncome, company, customerTrade, drivableType, wxNo,
604
+ driveLicenceEnd, driveLicenceStart, interest, interestedVas,
605
+ maritalStatus, post, qqNo, remark, scvId, storeCode
606
+ } = this.custVo;
593
607
  params = {
594
608
  saveFrom: 0,
595
609
  custVo: {
@@ -608,12 +622,24 @@ export default {
608
622
  api.liApi.custVehcile.setCustVehicle(params, (res) => {
609
623
  console.log(params,"paramsxxx");
610
624
  if (res && res.data.code === "success") {
611
- this.$refs.EleDialog.visible = false
612
- this.$emit("preserve", res.data.obj.custVo);
613
- this.$message({
614
- message: "保存成功",
615
- type: "success",
616
- });
625
+ const { custVo } = res.data.obj || {}
626
+ if(this.global.prefix == '/sflivecs'){
627
+ this.chooseList[0].customType=this.chooseList[0].custType
628
+ api.liApi.custVehcile.insertOrUpdateCustomInfoSF({
629
+ ...this.chooseList[0],
630
+ dealerCode:this.global.userInfo.userAvailableInfo.storeInfoVo.dealerCode,
631
+ }, res => {
632
+ if (res && res.data.code === 'success') {
633
+ this.$refs.EleDialog.visible = false
634
+ this.$emit("preserve", custVo);
635
+ this.$message.success('保存成功')
636
+ }
637
+ })
638
+ } else {
639
+ this.$refs.EleDialog.visible = false
640
+ this.$emit("preserve", custVo);
641
+ this.$message.success('保存成功')
642
+ }
617
643
 
618
644
  // 解决保存后 loading一直转圈的问题
619
645
  // setTimeout(function(){
@@ -358,7 +358,7 @@ export default {
358
358
  props: {
359
359
  vehicleVo: {
360
360
  type: Object,
361
- default: {},
361
+ default: () => { return {} },
362
362
  },
363
363
  isAdd: {
364
364
  type: Boolean,
@@ -277,7 +277,40 @@ export default {
277
277
  }
278
278
  api.liApi.custVehcile.pushSapCarInfoByVinNo({frameNo: this.selCont.frameNo, scvId: this.selCont.scvId}, res => {
279
279
  if (res && res.data.code === 'success') {
280
- this.$emit('comfirm', this.selCont)
280
+ if(this.global.prefix == '/sflivecs'){
281
+ api.liApi.custVehcile.getCustByPhoneName({contactPhoneNo:this.selCont.contactPhoneNo, pageStart: 1, pageNums: 1000}, res => {
282
+ if (res && res.data.code === 'success') {
283
+ let list = res.data.obj.map((item, index) => {
284
+ return {
285
+ value: `${item.contactPhoneNo} ${item.customerName}`,
286
+ label: item.contactPhoneNo,
287
+ index: index,
288
+ ...item
289
+ }
290
+ })
291
+ this.custPhoneList = res.data.obj
292
+ let selPhoneindex=''
293
+ this.custPhoneList.map((item,index)=>{
294
+ if(item.customerName==this.selCont.customerName) {
295
+ selPhoneindex=index
296
+ }
297
+ })
298
+ console.log(list,'***',this.custPhoneList,selPhoneindex);
299
+ this.$set(this.custPhoneList[selPhoneindex],'customType',this.custPhoneList[selPhoneindex].custType)
300
+ api.liApi.custVehcile.insertOrUpdateCustomInfoSF({
301
+ ...this.custPhoneList[selPhoneindex],
302
+ vehicleList: [this.selCont],
303
+ dealerCode:this.global.userInfo.userAvailableInfo.storeInfoVo.dealerCode,
304
+ }, res => {
305
+ if (res && res.data.code === 'success') {
306
+ this.$emit('comfirm', this.selCont)
307
+ }
308
+ })
309
+ }
310
+ })
311
+ }else{
312
+ this.$emit('comfirm', this.selCont)
313
+ }
281
314
  }
282
315
  })
283
316
  },
@@ -240,7 +240,7 @@
240
240
  props: {
241
241
  custVo: {
242
242
  type: Object,
243
- default: {}
243
+ default: () => { return {} },
244
244
  },
245
245
  bindFlag: {
246
246
  type: Boolean,
@@ -490,9 +490,23 @@
490
490
  }
491
491
  api.liApi.custVehcile.setCustVehicle(params, res => {
492
492
  if (res && res.data.code === 'success') {
493
- this.$message.success('保存成功')
494
- this.$refs.EleDialog.visible = false
495
- this.$emit('preserve', this.queryParams)
493
+ const { custVo } = res.data.obj || {}
494
+ if(this.global.prefix == '/sflivecs'){
495
+ this.chooseList[0].customType=this.chooseList[0].custType
496
+ api.liApi.custVehcile.insertOrUpdateCustomInfoSF({...this.chooseList[0],
497
+ dealerCode:this.global.userInfo.userAvailableInfo.storeInfoVo.dealerCode,
498
+ }, res => {
499
+ if (res && res.data.code === 'success') {
500
+ this.$message.success('保存成功')
501
+ this.$refs.EleDialog.visible = false
502
+ this.$emit('preserve', custVo)
503
+ }
504
+ })
505
+ } else {
506
+ this.$message.success('保存成功')
507
+ this.$refs.EleDialog.visible = false
508
+ this.$emit('preserve', custVo)
509
+ }
496
510
  }
497
511
  if(res && res.data.code === 'carIsBind'){
498
512
  this.$refs.EleDialog.visible = false