소스 검색

feat: 新增经销商历史记录

zh 2 년 전
부모
커밋
f91cdb009b
2개의 변경된 파일21개의 추가작업 그리고 1개의 파일을 삭제
  1. 9 0
      src/api/frock.js
  2. 12 1
      src/views/commercialEngineering/components/base.vue

+ 9 - 0
src/api/frock.js

@@ -125,3 +125,12 @@ export function getPositionProject(params) {
     params
   })
 }
+
+// 商用工程登录单-经销商填写历史
+export function getHistory(params) {
+  return request({
+    url: `/trade/login/order/customer/history`,
+    method: 'post',
+    params
+  })
+}

+ 12 - 1
src/views/commercialEngineering/components/base.vue

@@ -444,7 +444,7 @@ import { getTradeConfigList } from '@/api/basic_data/sectorAllocation'
 import GeographicalPosi from './geographicalPosi.vue'
 import FileUpload from '@/components/Common/file-upload.vue'
 import { mapGetters } from 'vuex'
-import { getPositionProject } from '@/api/frock'
+import { getPositionProject, getHistory } from '@/api/frock'
 
 export default {
   components: {
@@ -566,6 +566,9 @@ export default {
         this.formData.customerNumber = '100503'
         this.formData.customerName = '韶关弘格贸易有限公司'
       }
+      if (!this.isTradeExaminer) {
+        this.getHistory(this.formData.customerId)
+      }
     }
   },
   methods: {
@@ -748,6 +751,7 @@ export default {
         const item = this.commonData.customerList.find(k => k.value === e)
         this.formData.customerName = item.label
         this.formData.customerNumber = item.number
+        this.getHistory(this.formData.customerId)
       } else {
         this.formData.customerName = ''
         this.formData.customerNumber = ''
@@ -792,6 +796,13 @@ export default {
       document.body.appendChild(link)
       link.click()
       document.body.removeChild(link)
+    },
+    getHistory(id) {
+      getHistory({ customerId: id }).then(res => {
+        this.formData.customerLinkName = res.data.linkName
+        this.formData.customerLinkMobile = res.data.linkMobile
+        this.formData.customerAddress = res.data.address
+      })
     }
   }
 }