123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205 |
- import { getCommercialEngineeringDetail, getPositionProject } from '@/api/frock'
- import { getDictList, getSalesmanList } from '@/api/common'
- import { getDealerListV2 } from '@/api/basic_data/dealer'
- import {
- getFirstPartyCustomerManagementList
- } from '@/api/basic_data/partya'
- export default {
- props: {
- detailId: {
- type: String,
- default: ''
- },
- module: {
- type: String,
- default: 'add'
- }
- },
- data() {
- return {
- resetData: {},
- formData: {
- address: '',
- adminCompanyId: '',
- adminUserId: '',
- adminWebsitId: '',
- applyUpdateBy: '',
- applyUpdateCompanyId: '',
- applyUpdateCompanyName: '',
- applyUpdateName: '',
- areaId: '',
- cityId: '',
- commonFollowProject: '',
- confirmBy: '',
- confirmName: '',
- confirmTime: '',
- customerAddress: '',
- customerId: '',
- customerLinkMobile: '',
- customerLinkName: '',
- customerName: '',
- customerNumber: '',
- del: null,
- drawUpload: '',
- enginLinkMobile: '',
- enginLinkName: '',
- examineNote: '',
- tradeName: '',
- tradeParentName: '',
- extent: '',
- files: [],
- followCustomer: '',
- followCustomerMobile: '',
- homeProjectNameArea: '',
- homeProjectNameNumber: '',
- homeProjectNameRadio: '',
- homeProjectNameSeat: '',
- id: '',
- isApplyUpdate: null,
- isSpan: null,
- items: [],
- lat: '',
- lnt: '',
- loginStatus: '',
- machineType: '',
- note: '',
- orderStatus: '',
- orderType: '',
- otherInfo: '',
- partyA: '',
- partyAId: '',
- positionAddress: '',
- preDeviceAmount: 0,
- preSignDate: '',
- projectArea: '',
- projectCategory: '',
- projectMent: '',
- projectName: '',
- projectNo: '',
- provinceId: '',
- refCustomerId: '',
- remark: '',
- salesCompanyName: '',
- serviceId: '',
- serviceName: '',
- status: '',
- streetId: '',
- submitBy: '',
- submitName: '',
- submitTime: '',
- successLoginProject: '',
- successRate: '',
- tradeId: '',
- tradeParentId: '',
- type: '',
- useExtent: ''
- },
- commonData: {
- dict: {
- TRADE_LOGIN_CATEGORY: [], // 项目类别
- TRADE_LOGIN_TYPE: [], // 类型
- SUCCESS_RATE: [], // 成功机率
- FOLLOW_STATUS: [], // 工程跟进状态
- MACHINE_TYPE: [], // 机组类型
- TRADE_EXAMINE_NOTE: [], // 审核备注
- TRADE_PROJECT_AREA: [] // 项目所在区域
- },
- salesmanList: [],
- customerList: [],
- PartyAList: [],
- vicinityMarkers: []
- }
- }
- },
- created() {
- this.resetData = {
- ...this.formData
- }
- this.getDictList()
- this.getDealerListV2()
- this.getSalesmanList()
- this.getFirstPartyCustomerManagementList()
- if (this.detailId) {
- this.getCommercialEngineeringDetail()
- this.getPositionProject()
- }
- },
- methods: {
- getDictList() {
- Object.keys(this.commonData.dict).forEach(async k => {
- const { data } = await getDictList({ sysDictEnum: k })
- this.commonData.dict[k] = data.map(l => {
- return {
- label: l.dictValue,
- value: l.dictCode
- }
- })
- })
- },
- getSalesmanList() {
- getSalesmanList({
- pageNum: 1,
- pageSize: -1,
- isCustomer: 0,
- status: true
- }).then(res => {
- this.commonData.salesmanList = res.data.records.map(k => {
- return {
- label: k.nickName,
- value: k.adminUserId
- }
- })
- })
- },
- getFirstPartyCustomerManagementList() {
- getFirstPartyCustomerManagementList({ pageNum: 1,
- pageSize: -1 }).then(res => {
- this.commonData.PartyAList = res.data.records.map(k => {
- return {
- label: k.name,
- value: k.id
- }
- })
- })
- },
- getDealerListV2() {
- getDealerListV2({
- pageNum: 1,
- pageSize: -1,
- params: [
- {
- param: 'a.jiaxian_type',
- compare: '=',
- value: 'KING'
- }
- ]
- }).then(res => {
- this.commonData.customerList = res.data.records.map(k => {
- return {
- number: k.number,
- label: k.name,
- value: k.id
- }
- })
- })
- },
- getCommercialEngineeringDetail() {
- getCommercialEngineeringDetail({ id: this.detailId }).then(res => {
- this.formData = {
- ...res.data
- }
- })
- },
- getPositionProject() {
- getPositionProject({ id: this.detailId }).then(res => {
- this.commonData.vicinityMarkers = res.data
- })
- },
- onReset() {
- this.formData = {
- ...this.resetData,
- id: this.detailId
- }
- }
- }
- }
|