index.js 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205
  1. import { getCommercialEngineeringDetail, getPositionProject } from '@/api/frock'
  2. import { getDictList, getSalesmanList } from '@/api/common'
  3. import { getDealerListV2 } from '@/api/basic_data/dealer'
  4. import {
  5. getFirstPartyCustomerManagementList
  6. } from '@/api/basic_data/partya'
  7. export default {
  8. props: {
  9. detailId: {
  10. type: String,
  11. default: ''
  12. },
  13. module: {
  14. type: String,
  15. default: 'add'
  16. }
  17. },
  18. data() {
  19. return {
  20. resetData: {},
  21. formData: {
  22. address: '',
  23. adminCompanyId: '',
  24. adminUserId: '',
  25. adminWebsitId: '',
  26. applyUpdateBy: '',
  27. applyUpdateCompanyId: '',
  28. applyUpdateCompanyName: '',
  29. applyUpdateName: '',
  30. areaId: '',
  31. cityId: '',
  32. commonFollowProject: '',
  33. confirmBy: '',
  34. confirmName: '',
  35. confirmTime: '',
  36. customerAddress: '',
  37. customerId: '',
  38. customerLinkMobile: '',
  39. customerLinkName: '',
  40. customerName: '',
  41. customerNumber: '',
  42. del: null,
  43. drawUpload: '',
  44. enginLinkMobile: '',
  45. enginLinkName: '',
  46. examineNote: '',
  47. tradeName: '',
  48. tradeParentName: '',
  49. extent: '',
  50. files: [],
  51. followCustomer: '',
  52. followCustomerMobile: '',
  53. homeProjectNameArea: '',
  54. homeProjectNameNumber: '',
  55. homeProjectNameRadio: '',
  56. homeProjectNameSeat: '',
  57. id: '',
  58. isApplyUpdate: null,
  59. isSpan: null,
  60. items: [],
  61. lat: '',
  62. lnt: '',
  63. loginStatus: '',
  64. machineType: '',
  65. note: '',
  66. orderStatus: '',
  67. orderType: '',
  68. otherInfo: '',
  69. partyA: '',
  70. partyAId: '',
  71. positionAddress: '',
  72. preDeviceAmount: 0,
  73. preSignDate: '',
  74. projectArea: '',
  75. projectCategory: '',
  76. projectMent: '',
  77. projectName: '',
  78. projectNo: '',
  79. provinceId: '',
  80. refCustomerId: '',
  81. remark: '',
  82. salesCompanyName: '',
  83. serviceId: '',
  84. serviceName: '',
  85. status: '',
  86. streetId: '',
  87. submitBy: '',
  88. submitName: '',
  89. submitTime: '',
  90. successLoginProject: '',
  91. successRate: '',
  92. tradeId: '',
  93. tradeParentId: '',
  94. type: '',
  95. useExtent: ''
  96. },
  97. commonData: {
  98. dict: {
  99. TRADE_LOGIN_CATEGORY: [], // 项目类别
  100. TRADE_LOGIN_TYPE: [], // 类型
  101. SUCCESS_RATE: [], // 成功机率
  102. FOLLOW_STATUS: [], // 工程跟进状态
  103. MACHINE_TYPE: [], // 机组类型
  104. TRADE_EXAMINE_NOTE: [], // 审核备注
  105. TRADE_PROJECT_AREA: [] // 项目所在区域
  106. },
  107. salesmanList: [],
  108. customerList: [],
  109. PartyAList: [],
  110. vicinityMarkers: []
  111. }
  112. }
  113. },
  114. created() {
  115. this.resetData = {
  116. ...this.formData
  117. }
  118. this.getDictList()
  119. this.getDealerListV2()
  120. this.getSalesmanList()
  121. this.getFirstPartyCustomerManagementList()
  122. if (this.detailId) {
  123. this.getCommercialEngineeringDetail()
  124. this.getPositionProject()
  125. }
  126. },
  127. methods: {
  128. getDictList() {
  129. Object.keys(this.commonData.dict).forEach(async k => {
  130. const { data } = await getDictList({ sysDictEnum: k })
  131. this.commonData.dict[k] = data.map(l => {
  132. return {
  133. label: l.dictValue,
  134. value: l.dictCode
  135. }
  136. })
  137. })
  138. },
  139. getSalesmanList() {
  140. getSalesmanList({
  141. pageNum: 1,
  142. pageSize: -1,
  143. isCustomer: 0,
  144. status: true
  145. }).then(res => {
  146. this.commonData.salesmanList = res.data.records.map(k => {
  147. return {
  148. label: k.nickName,
  149. value: k.adminUserId
  150. }
  151. })
  152. })
  153. },
  154. getFirstPartyCustomerManagementList() {
  155. getFirstPartyCustomerManagementList({ pageNum: 1,
  156. pageSize: -1 }).then(res => {
  157. this.commonData.PartyAList = res.data.records.map(k => {
  158. return {
  159. label: k.name,
  160. value: k.id
  161. }
  162. })
  163. })
  164. },
  165. getDealerListV2() {
  166. getDealerListV2({
  167. pageNum: 1,
  168. pageSize: -1,
  169. params: [
  170. {
  171. param: 'a.jiaxian_type',
  172. compare: '=',
  173. value: 'KING'
  174. }
  175. ]
  176. }).then(res => {
  177. this.commonData.customerList = res.data.records.map(k => {
  178. return {
  179. number: k.number,
  180. label: k.name,
  181. value: k.id
  182. }
  183. })
  184. })
  185. },
  186. getCommercialEngineeringDetail() {
  187. getCommercialEngineeringDetail({ id: this.detailId }).then(res => {
  188. this.formData = {
  189. ...res.data
  190. }
  191. })
  192. },
  193. getPositionProject() {
  194. getPositionProject({ id: this.detailId }).then(res => {
  195. this.commonData.vicinityMarkers = res.data
  196. })
  197. },
  198. onReset() {
  199. this.formData = {
  200. ...this.resetData,
  201. id: this.detailId
  202. }
  203. }
  204. }
  205. }