base.vue 42 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169
  1. <!-- eslint-disable vue/valid-v-on -->
  2. <template>
  3. <div>
  4. <h3 class="title">
  5. <div>{{ title }}</div>
  6. <div class="title-right">格力商用空调登录表提示:带*的为必填项</div>
  7. </h3>
  8. <el-divider />
  9. <div class="diy-table-1">
  10. <el-row :gutter="0">
  11. <el-col v-if="['cross'].includes(pageType)" :xs="24" :sm="24" :lg="24" class="item">
  12. <div class="label">项目性质*:</div>
  13. <div class="value">
  14. <el-radio-group v-model="formData.orderType" style="width: 100%" @change="initTradeData">
  15. <el-radio
  16. v-for="item in [
  17. { label: '工装', value: 'WORK' },
  18. { label: '家装', value: 'HOME' }
  19. ]"
  20. :key="item.value"
  21. :label="item.value"
  22. >
  23. {{ item.label }}
  24. </el-radio>
  25. </el-radio-group>
  26. </div>
  27. </el-col>
  28. <el-col :xs="24" :sm="['add'].includes(module) ? 12 : 24" :lg="['add'].includes(module) ? 12 : 24" class="item">
  29. <div class="label">销售公司名称:</div>
  30. <div class="value">
  31. <el-input v-model="formData.salesCompanyName" disabled placeholder="请填写" clearable />
  32. <CopyButton v-if="module !== 'add'" :copyText="formData.salesCompanyName" />
  33. </div>
  34. </el-col>
  35. <template v-if="!['add'].includes(module)">
  36. <el-col :xs="24" :sm="12" :lg="8" class="item">
  37. <div class="label">工程登录类型:</div>
  38. <div class="value">
  39. <el-input :value="formData.orderType === 'WORK' ? '工装' : '家装'" placeholder="请填写" clearable />
  40. <CopyButton v-if="module !== 'add'" :copyText="formData.orderType" />
  41. </div>
  42. </el-col>
  43. <el-col :xs="24" :sm="12" :lg="8" class="item">
  44. <div class="label">项目编号:</div>
  45. <div class="value">
  46. <el-input v-model="formData.projectNo" placeholder="请填写" clearable />
  47. <CopyButton v-if="module !== 'add'" :copyText="formData.projectNo" />
  48. </div>
  49. </el-col>
  50. <el-col :xs="24" :sm="12" :lg="8" class="item">
  51. <div class="label">登录时间:</div>
  52. <div class="value">
  53. <el-input v-model="formData.createTime" placeholder="请填写" clearable />
  54. <CopyButton v-if="module !== 'add'" :copyText="formData.createTime" />
  55. </div>
  56. </el-col>
  57. </template>
  58. <el-col :xs="24" :sm="12" :lg="12" class="item">
  59. <div class="label">{{ ['cross'].includes(pageType) ? '业务所在区域' : '项目所在区域' }}*:</div>
  60. <div class="value">
  61. <el-select
  62. v-model="formData.projectArea"
  63. placeholder="请选择"
  64. clearable
  65. filterable
  66. @change="handleProjectArea"
  67. >
  68. <el-option
  69. v-for="item in commonData.dict['TRADE_PROJECT_AREA']"
  70. :key="item.value"
  71. :label="item.label"
  72. :value="item.value"
  73. />
  74. </el-select>
  75. <CopyButton
  76. v-if="module !== 'add'"
  77. :copyText="getCopyText(commonData.dict['TRADE_PROJECT_AREA'], formData.projectArea)"
  78. />
  79. </div>
  80. </el-col>
  81. <el-col :xs="24" :sm="12" :lg="12" class="item">
  82. <div class="label">跟进业务*:</div>
  83. <div class="value">
  84. <el-select v-model="formData.serviceId" placeholder="请选择" clearable filterable @change="handleService">
  85. <el-option
  86. v-for="item in commonData.salesmanList"
  87. :key="item.value"
  88. :label="item.label"
  89. :value="item.value"
  90. />
  91. </el-select>
  92. <CopyButton v-if="module !== 'add'" :copyText="getCopyText(commonData.salesmanList, formData.serviceId)" />
  93. </div>
  94. </el-col>
  95. <el-col
  96. v-if="pageType === 'frock' || (pageType === 'cross' && formData.orderType === 'WORK')"
  97. :xs="24"
  98. :sm="!['add', 'edit'].includes(module) ? 24 : 12"
  99. :lg="!['add', 'edit'].includes(module) ? 24 : 12"
  100. class="item"
  101. >
  102. <div class="label">甲方名称*:</div>
  103. <div class="value">
  104. <div style="flex: 1; cursor: pointer" @click="dialogVisible = true" v-if="formData.partyA">
  105. {{ formData.partyA }}
  106. </div>
  107. <div style="flex: 1; cursor: pointer; opacity: 0.6" @click="dialogVisible = true" v-else>请选择</div>
  108. <!-- <el-select v-model="formData.partyAId" placeholder="请选择" clearable filterable @change="handlePartyA">
  109. <el-option
  110. v-for="item in commonData.PartyAList"
  111. :key="item.value"
  112. :label="item.label"
  113. :value="item.value"
  114. />
  115. </el-select> -->
  116. <CopyButton v-if="module !== 'add'" :copyText="formData.partyA" />
  117. <!-- dialogVisible -->
  118. </div>
  119. </el-col>
  120. <el-col
  121. v-if="['add', 'edit'].includes(module) && (pageType === 'home' || formData.orderType === 'HOME')"
  122. :xs="24"
  123. :sm="12"
  124. :lg="12"
  125. class="item"
  126. >
  127. <div class="label" />
  128. <div class="value" />
  129. </el-col>
  130. <el-col :xs="24" :sm="12" :lg="module === 'edit' ? 12 : 8" class="item">
  131. <div class="label">经销商*:</div>
  132. <div class="value">
  133. <el-input v-if="isCustomer" v-model="formData.customerName" disabled placeholder="请填写" clearable />
  134. <el-input
  135. v-if="!isCustomer && !isTradeExaminer"
  136. v-model="formData.customerName"
  137. disabled
  138. placeholder="请填写"
  139. clearable
  140. />
  141. <el-select
  142. v-if="isTradeExaminer"
  143. v-model="formData.customerId"
  144. placeholder="请选择"
  145. clearable
  146. filterable
  147. remote
  148. reserve-keyword
  149. :remote-method="remoteMethod"
  150. :loading="loading"
  151. @change="handleCustomer"
  152. >
  153. <el-option
  154. v-for="item in commonData.customerList"
  155. :key="item.value"
  156. :label="item.label"
  157. :value="item.value"
  158. />
  159. </el-select>
  160. <CopyButton
  161. v-if="module !== 'add' && isTradeExaminer"
  162. :copyText="getCopyText(commonData.customerList, formData.customerId)"
  163. />
  164. <CopyButton v-if="module !== 'add' && !isTradeExaminer" :copyText="formData.customerName" />
  165. </div>
  166. </el-col>
  167. <el-col :xs="24" :sm="12" :lg="8" class="item">
  168. <div class="label">经销商联系人*:</div>
  169. <div class="value">
  170. <el-input v-model="formData.customerLinkName" placeholder="请填写" clearable />
  171. <CopyButton v-if="module !== 'add'" :copyText="formData.customerLinkName" />
  172. </div>
  173. </el-col>
  174. <el-col :xs="24" :sm="12" :lg="8" class="item">
  175. <div class="label">经销商联系电话*:</div>
  176. <div class="value">
  177. <el-input v-model="formData.customerLinkMobile" maxlength="11" placeholder="请填写" clearable />
  178. <CopyButton v-if="module !== 'add'" :copyText="formData.customerLinkMobile" />
  179. </div>
  180. </el-col>
  181. <el-col :xs="24" :sm="12" :lg="8" class="item">
  182. <div class="label">经销商办公地址*:</div>
  183. <div class="value">
  184. <el-input v-model="formData.customerAddress" placeholder="请填写" clearable />
  185. <CopyButton v-if="module !== 'add'" :copyText="formData.customerAddress" />
  186. </div>
  187. </el-col>
  188. <el-col :xs="24" :sm="12" :lg="8" class="item">
  189. <div class="label">跟进经销商*:</div>
  190. <div class="value">
  191. <el-input v-model="formData.followCustomer" placeholder="请填写" clearable />
  192. <CopyButton v-if="module !== 'add'" :copyText="formData.followCustomer" />
  193. </div>
  194. </el-col>
  195. <el-col :xs="24" :sm="12" :lg="8" class="item">
  196. <div class="label">跟进经销商电话*:</div>
  197. <div class="value">
  198. <el-input v-model="formData.followCustomerMobile" placeholder="请填写" clearable />
  199. <CopyButton v-if="module !== 'add'" :copyText="formData.followCustomerMobile" />
  200. </div>
  201. </el-col>
  202. <el-col
  203. v-if="['frock', 'cross'].includes(pageType) && formData.orderType !== 'HOME'"
  204. :xs="24"
  205. :sm="24"
  206. :lg="8"
  207. class="item"
  208. >
  209. <div class="label">工程项目名称*:</div>
  210. <div class="value">
  211. <el-input v-model="formData.projectName" placeholder="请填写" clearable />
  212. <CopyButton v-if="module !== 'add'" :copyText="formData.projectName" />
  213. </div>
  214. </el-col>
  215. <el-col
  216. :xs="24"
  217. :sm="12"
  218. :lg="['home'].includes(pageType) || module === 'edit' || formData.orderType === 'HOME' ? 12 : 8"
  219. class="item"
  220. >
  221. <div class="label">工程联系人*:</div>
  222. <div class="value">
  223. <el-input v-model="formData.enginLinkName" placeholder="请填写" clearable />
  224. <CopyButton v-if="module !== 'add'" :copyText="formData.enginLinkName" />
  225. </div>
  226. </el-col>
  227. <el-col
  228. :xs="24"
  229. :sm="12"
  230. :lg="['home'].includes(pageType) || module === 'edit' || formData.orderType === 'HOME' ? 12 : 8"
  231. class="item"
  232. >
  233. <div class="label">电话*:</div>
  234. <div class="value">
  235. <el-input v-model="formData.enginLinkMobile" placeholder="请填写" clearable />
  236. <CopyButton v-if="module !== 'add'" :copyText="formData.enginLinkMobile" />
  237. </div>
  238. </el-col>
  239. <el-col
  240. v-if="['home'].includes(pageType) || formData.orderType === 'HOME'"
  241. :xs="24"
  242. :sm="24"
  243. :lg="24"
  244. class="item"
  245. >
  246. <div class="label" style="height: auto">工程项目名称*:</div>
  247. <div class="value my-center" style="height: 100%">
  248. <el-radio-group v-model="formData.homeProjectNameRadio">
  249. <el-radio label="AREA">
  250. <el-input v-model="formData.homeProjectNameArea" class="my-width" placeholder="请填写" clearable />小区
  251. <el-input v-model="formData.homeProjectNameSeat" class="my-width" placeholder="请填写" clearable />座
  252. <el-input v-model="formData.homeProjectNameNumber" class="my-width" placeholder="请填写" clearable />号
  253. <CopyButton
  254. v-if="module !== 'add'"
  255. :copyText="
  256. formData.homeProjectNameArea +
  257. '小区' +
  258. formData.homeProjectNameSeat +
  259. '座' +
  260. formData.homeProjectNameNumber +
  261. '号'
  262. "
  263. />
  264. </el-radio>
  265. <el-radio label="SELF">
  266. <el-input
  267. v-model="formData.homeProjectNameArea2"
  268. class="my-width"
  269. placeholder="请填写"
  270. clearable
  271. />(业主名称)自建房
  272. <CopyButton v-if="module !== 'add'" :copyText="formData.homeProjectNameArea2 + '(业主名称)自建房'" />
  273. </el-radio>
  274. <el-radio label="VILLA">
  275. <el-input v-model="formData.homeProjectNameArea3" class="my-width" placeholder="请填写" clearable />小区
  276. <el-input
  277. v-model="formData.homeProjectNameNumber3"
  278. class="my-width"
  279. placeholder="请填写"
  280. clearable
  281. />号别墅
  282. <CopyButton
  283. v-if="module !== 'add'"
  284. :copyText="formData.homeProjectNameArea3 + '小区' + formData.homeProjectNameNumber3 + '号'"
  285. />
  286. </el-radio>
  287. </el-radio-group>
  288. </div>
  289. </el-col>
  290. <el-col
  291. v-if="
  292. (['home'].includes(pageType) || formData.orderType === 'HOME') &&
  293. !['add', 'edit'].includes(module) &&
  294. formData.isOld == true
  295. "
  296. :xs="24"
  297. :sm="24"
  298. :lg="24"
  299. class="item"
  300. >
  301. <div class="label" style="height: auto">旧单工程项目名称*:</div>
  302. <div class="value" style="height: 100%">
  303. <el-input v-model="formData.projectName" placeholder="请填写" clearable />
  304. <CopyButton v-if="module !== 'add'" :copyText="formData.projectName" />
  305. </div>
  306. </el-col>
  307. <el-col :xs="24" :sm="24" :lg="24" class="item">
  308. <div class="label">工程(建筑)地址*:</div>
  309. <div class="value">
  310. <el-select v-model="formData.provinceId" placeholder="请选择省" class="my-width" @change="changeProvince">
  311. <el-option v-for="item in provinceList" :key="item.lbsId" :label="item.name" :value="item.lbsId" />
  312. </el-select>
  313. <el-select v-model="formData.cityId" placeholder="请选择市" class="my-width" @change="changeCity">
  314. <el-option v-for="item in cityList" :key="item.lbsId" :label="item.name" :value="item.lbsId" />
  315. </el-select>
  316. <el-select v-model="formData.areaId" placeholder="请选择区" class="my-width" @change="changeArea">
  317. <el-option v-for="item in areaList" :key="item.lbsId" :label="item.name" :value="item.lbsId" />
  318. </el-select>
  319. <el-select v-model="formData.streetId" placeholder="请选择街道" class="my-width" @change="changeStreet">
  320. <el-option v-for="item in streetList" :key="item.lbsId" :label="item.name" :value="item.lbsId" />
  321. </el-select>
  322. </div>
  323. </el-col>
  324. <el-col :xs="24" :sm="24" :lg="24" class="item">
  325. <div class="label">详细地址*:</div>
  326. <div class="value">
  327. <!-- <el-input v-model="formData.positionAddress" placeholder="定位地址" clearable disabled /> -->
  328. <!-- <geographicalPosi
  329. style="margin: 0 20px 0 0"
  330. v-if="module !== 'detail' && !['cross'].includes(pageType)"
  331. :form-data="formData"
  332. @selectPosi="handleSelectPosi"
  333. /> -->
  334. <el-input v-model="formData.address" placeholder="请填写详细地址" clearable />
  335. <CopyButton v-if="module !== 'add'" :copyText="formData.address" />
  336. <i
  337. v-if="formData.positionAddress && !['cross'].includes(pageType)"
  338. class="el-icon-s-promotion"
  339. style="color: #409eff; font-size: 16px"
  340. />
  341. </div>
  342. </el-col>
  343. <!-- <template>
  344. <el-col v-if="module !== 'add'" :xs="24" :sm="24" :lg="24" class="item" style="height: 400px">
  345. <div class="label" style="height: auto">地图位置</div>
  346. <div class="value" style="height: auto; padding: 0">
  347. <zj-amap-polygon
  348. eid="bMap"
  349. :zoom="zoom"
  350. :center="center"
  351. :isWheel="true"
  352. :markers="markers"
  353. :electronic-fence="electronicFence"
  354. @getPolygons="getPolygons"
  355. >
  356. <template #marker="{ marker }">
  357. <i class="el-icon-location-outline IP_font" />
  358. <div class="IP">
  359. <div>项目编号:{{ marker.no }}</div>
  360. <div>工程项目名称:{{ marker.name }}</div>
  361. <div>地址:{{ marker.address }}</div>
  362. </div>
  363. </template>
  364. </zj-amap-polygon>
  365. </div>
  366. </el-col>
  367. </template> -->
  368. <el-col :xs="24" :sm="24" :lg="24" class="item">
  369. <div class="label">项目类别*:</div>
  370. <div class="value">
  371. <el-radio-group v-model="formData.projectCategory">
  372. <el-radio v-for="item in commonData.dict['TRADE_LOGIN_CATEGORY']" :key="item.value" :label="item.value">
  373. {{ item.label }}
  374. </el-radio>
  375. </el-radio-group>
  376. </div>
  377. </el-col>
  378. <el-col :xs="24" :sm="12" :lg="12" class="item">
  379. <div class="label">图纸上传:</div>
  380. <div class="value" style="justify-content: flex-end; position: relative; overflow: hidden">
  381. <FileUpload
  382. v-if="module !== 'detail' && module !== 'examine'"
  383. :file-list="formData.fileList"
  384. :limit="2"
  385. class="file"
  386. />
  387. <el-link
  388. v-if="(module == 'detail' || module == 'examine') && formData.fileList && formData.fileList.length"
  389. style="position: absolute; left: 5px"
  390. type="primary"
  391. :underline="false"
  392. @click="openPdf(formData.fileList[0])"
  393. >{{ formData.fileList[0].fileName }}</el-link
  394. >
  395. <!-- <el-input v-model="formData.drawUpload" clearable /> -->
  396. </div>
  397. </el-col>
  398. <el-col :xs="24" :sm="12" :lg="12" class="item">
  399. <div class="label">类型</div>
  400. <div class="value">
  401. <el-radio-group v-model="formData.type">
  402. <el-radio v-for="item in commonData.dict['TRADE_LOGIN_TYPE']" :key="item.value" :label="item.value">
  403. {{ item.label }}
  404. </el-radio>
  405. </el-radio-group>
  406. </div>
  407. </el-col>
  408. <el-col :xs="24" :sm="12" :lg="12" class="item">
  409. <div class="label">建筑面积㎡*:</div>
  410. <div class="value">
  411. <el-input v-model="formData.extent" placeholder="请填写" clearable />
  412. <CopyButton v-if="module !== 'add'" :copyText="formData.extent" />
  413. </div>
  414. </el-col>
  415. <el-col :xs="24" :sm="12" :lg="12" class="item">
  416. <div class="label">空调使用面积㎡*:</div>
  417. <div class="value">
  418. <el-input v-model="formData.useExtent" placeholder="请填写" clearable />
  419. <CopyButton v-if="module !== 'add'" :copyText="formData.useExtent" />
  420. </div>
  421. </el-col>
  422. <el-col :xs="24" :sm="12" :lg="12" class="item">
  423. <div class="label">项目所在行业分类*:</div>
  424. <div class="value">
  425. <el-select
  426. v-model="formData.tradeParentId"
  427. placeholder="请选择"
  428. clearable
  429. filterable
  430. :disabled="pageType === 'home' || formData.orderType === 'HOME'"
  431. @change="handleTradeParent"
  432. >
  433. <el-option v-for="item in tradeParentList" :key="item.id" :label="item.name" :value="item.id" />
  434. </el-select>
  435. <CopyButton v-if="module !== 'add'" :copyText="formData.tradeParentName" />
  436. </div>
  437. </el-col>
  438. <el-col :xs="24" :sm="12" :lg="12" class="item">
  439. <div class="label">行业细分*:</div>
  440. <div class="value">
  441. <el-select
  442. v-model="formData.tradeId"
  443. :disabled="pageType === 'home' || formData.orderType === 'HOME'"
  444. placeholder="请选择"
  445. clearable
  446. filterable
  447. @change="handleTrade"
  448. >
  449. <el-option v-for="item in tradeList" :key="item.id" :label="item.name" :value="item.id" />
  450. </el-select>
  451. <CopyButton v-if="module !== 'add'" :copyText="formData.tradeName" />
  452. </div>
  453. </el-col>
  454. <el-col v-if="['frock', 'home'].includes(pageType)" :xs="24" :sm="24" :lg="24" class="item">
  455. <div class="label">项目性质*:</div>
  456. <div class="value">
  457. {{ pageType === 'frock' ? '工程' : '家装' }}
  458. <CopyButton v-if="module !== 'add'" :copyText="pageType === 'frock' ? '工程' : '家装'" />
  459. </div>
  460. </el-col>
  461. <el-col :xs="24" :sm="24" :lg="24" class="item">
  462. <div class="label">机组类型*:</div>
  463. <div class="value">
  464. <el-select v-model="formData.machineType" placeholder="请选择" clearable filterable>
  465. <el-option
  466. v-for="item in commonData.dict['LOGIN_MACHINE_TYPE']"
  467. :key="item.value"
  468. :label="item.label"
  469. :value="item.value"
  470. />
  471. </el-select>
  472. <CopyButton
  473. v-if="module !== 'add'"
  474. :copyText="getCopyText(commonData.dict['LOGIN_MACHINE_TYPE'], formData.machineType)"
  475. />
  476. </div>
  477. </el-col>
  478. <el-col :xs="24" :sm="24" :lg="24" class="item">
  479. <div class="label">成功机率*:</div>
  480. <div class="value">
  481. <el-radio-group v-model="formData.successRate">
  482. <el-radio v-for="item in commonData.dict['SUCCESS_RATE']" :key="item.value" :label="item.value">
  483. {{ item.label }}
  484. </el-radio>
  485. </el-radio-group>
  486. </div>
  487. </el-col>
  488. <el-col :xs="24" :sm="12" :lg="12" class="item">
  489. <div class="label">预计签定合同日期*:</div>
  490. <div class="value">
  491. <el-date-picker
  492. v-model="formData.preSignDate"
  493. class="date"
  494. value-format="yyyy-MM-dd HH:mm:ss"
  495. default-time="00:00:00"
  496. style="width: 100%"
  497. placeholder="选择日期"
  498. />
  499. <CopyButton v-if="module !== 'add'" :copyText="formData.preSignDate" />
  500. </div>
  501. </el-col>
  502. <el-col :xs="24" :sm="12" :lg="12" class="item">
  503. <div class="label">预计设备金额*:</div>
  504. <div class="value">
  505. <el-input type="number" v-model.number="formData.preDeviceAmount" placeholder="请填写" clearable />万
  506. </div>
  507. </el-col>
  508. <el-col :xs="24" :sm="24" :lg="24" class="item">
  509. <div class="label">工程跟进状态*:</div>
  510. <div class="value">
  511. <el-radio-group v-model="formData.status">
  512. <el-radio v-for="item in commonData.dict['FOLLOW_STATUS']" :key="item.value" :label="item.value">
  513. {{ item.label }}
  514. </el-radio>
  515. </el-radio-group>
  516. </div>
  517. </el-col>
  518. <el-col v-if="['detail', 'examine'].includes(module)" :xs="24" :sm="24" :lg="24" class="item">
  519. <div class="label">订单状态:</div>
  520. <div class="value">
  521. <el-input :value="orderTypeEume[formData.orderStatus]" placeholder="请填写" clearable />
  522. <CopyButton v-if="module !== 'add'" :copyText="orderTypeEume[formData.orderStatus]" />
  523. </div>
  524. </el-col>
  525. <el-col :xs="24" :sm="24" :lg="24" class="item">
  526. <div class="label" style="height: auto">备注:</div>
  527. <div class="value" style="height: 100%">
  528. <el-input
  529. v-model="formData.remark"
  530. style="margin: 5px 0"
  531. type="textarea"
  532. :rows="4"
  533. placeholder="请输入备注"
  534. />
  535. <CopyButton v-if="module !== 'add'" :copyText="formData.remark" />
  536. </div>
  537. </el-col>
  538. <el-col :xs="24" :sm="24" :lg="24" class="item">
  539. <div class="label" style="height: auto">
  540. 工程概况及此工程相关的社会关系以及其他相关信息{{ ['cross'].includes(pageType) ? '*' : '' }}:
  541. </div>
  542. <div class="value" style="height: 100%">
  543. <el-input
  544. v-model="formData.otherInfo"
  545. style="margin: 5px 0"
  546. type="textarea"
  547. :rows="3"
  548. placeholder="请输入内容"
  549. />
  550. <CopyButton v-if="module !== 'add'" :copyText="formData.otherInfo" />
  551. </div>
  552. </el-col>
  553. </el-row>
  554. <el-dialog
  555. title="选择甲方"
  556. :visible.sync="dialogVisible"
  557. width="1000px"
  558. :before-close="handleClose"
  559. v-if="dialogVisible"
  560. :append-to-body="true"
  561. >
  562. <div style="height: 600px">
  563. <template-page ref="pageRef__" :get-list="getList" :operation="operation()"> </template-page>
  564. </div>
  565. </el-dialog>
  566. </div>
  567. </div>
  568. </template>
  569. <script>
  570. import { findElem } from '@/utils/util'
  571. import { getAutonaviRegion } from '@/api/common'
  572. import { getTradeConfigList } from '@/api/basic_data/sectorAllocation'
  573. import GeographicalPosi from './geographicalPosi.vue'
  574. import FileUpload from '@/components/Common/file-upload.vue'
  575. import { mapGetters } from 'vuex'
  576. import { getPositionProject, getHistory } from '@/api/frock'
  577. import { getDealerListV3 } from '@/api/basic_data/dealer'
  578. import TemplatePage from '@/components/template/template-page-1.vue'
  579. import { getFirstPartyCustomerManagementList } from '@/api/basic_data/partya'
  580. export default {
  581. components: {
  582. FileUpload,
  583. GeographicalPosi,
  584. TemplatePage
  585. },
  586. props: {
  587. // 标题
  588. title: {
  589. type: String,
  590. default: '登录信息'
  591. },
  592. // 数据源
  593. formData: {
  594. type: Object,
  595. default: () => ({})
  596. },
  597. // 页面类型
  598. pageType: {
  599. type: String,
  600. default: 'frock'
  601. },
  602. // 功能类型
  603. module: {
  604. type: String,
  605. default: 'add'
  606. },
  607. commonData: {
  608. type: Object,
  609. default: () => {}
  610. }
  611. },
  612. data() {
  613. return {
  614. fileList: [],
  615. // 地图缩放比例
  616. zoom: 16,
  617. // 地图默认中心
  618. center: [113.36242, 23.1368425],
  619. markers: [],
  620. // 是否启用电子围栏
  621. electronicFence: false,
  622. provinceList: [],
  623. cityList: [],
  624. areaList: [],
  625. streetList: [],
  626. tradeParentList: [],
  627. tradeList: [],
  628. orderTypeEume: {
  629. SAVE: '保存',
  630. WAIT: '待审核',
  631. OK: '登录成功',
  632. FAIL: '登录不成功',
  633. RETURN: '返回'
  634. },
  635. region: {
  636. G: ['广州市', '清远市', '韶关市'],
  637. F: ['佛山市', '肇庆市', '云浮市']
  638. },
  639. // 特殊处理市区
  640. specialCity: {
  641. '1608754035946549250': '东莞市',
  642. '1608754032574328834': '中山市',
  643. '1608756901402767362': '儋州市',
  644. '1608756898412228610': '三沙市',
  645. '1608757977963163649': '嘉峪关市'
  646. },
  647. loading: false,
  648. dialogVisible: false
  649. }
  650. },
  651. computed: {
  652. ...mapGetters(['isTradeExaminer', 'isCustomer', 'customerNumber', 'customerId', 'customerName']),
  653. getCopyText() {
  654. return (arr = [], id = '') => {
  655. if (id && arr.length) {
  656. return String(arr.find(k => k.value === id)?.label || id)
  657. }
  658. return String(id)
  659. }
  660. }
  661. },
  662. watch: {
  663. async 'formData.id'(newValue, oldValue) {
  664. if (newValue) {
  665. if (this.isTradeExaminer) {
  666. // this.getPositionProject()
  667. } else {
  668. this.markers = [
  669. {
  670. name: this.formData.projectName,
  671. center: [this.formData.lnt, this.formData.lat],
  672. address: this.formData.address,
  673. no: this.formData.projectNo
  674. }
  675. ]
  676. }
  677. this.center = [this.formData.lnt, this.formData.lat]
  678. if (this.module === 'examine' && !this.formData.loginStatus) {
  679. this.formData.loginStatus = 'OK'
  680. }
  681. if (this.module === 'examine' && this.formData.files.length) {
  682. const item = this.formData.files
  683. this.formData.files = item.map(k => {
  684. return {
  685. ...k,
  686. name: k.fileName,
  687. url: k.fileUrl,
  688. hover: true
  689. }
  690. })
  691. }
  692. if (this.formData.homeProjectNameRadio === 'SELF') {
  693. this.formData.homeProjectNameArea2 = this.formData.homeProjectNameArea
  694. }
  695. if (this.formData.homeProjectNameRadio === 'VILLA') {
  696. this.formData.homeProjectNameNumber3 = this.formData.homeProjectNameNumber
  697. this.formData.homeProjectNameArea3 = this.formData.homeProjectNameArea
  698. }
  699. if (this.formData.homeProjectNameRadio === 'SELF' || this.formData.homeProjectNameRadio === 'VILLA') {
  700. this.formData.homeProjectNameArea = ''
  701. this.formData.homeProjectNameSeat = ''
  702. this.formData.homeProjectNameNumber = ''
  703. }
  704. await this.getCallbackPosition(null, this.formData.provinceId, 'province', 'lbsId')
  705. await this.getCallbackPosition(this.formData.provinceId, this.formData.cityId, 'city', 'lbsId')
  706. await this.getCallbackPosition(this.formData.cityId, this.formData.areaId, 'area', 'lbsId')
  707. const temp = this.areaList.find(k => this.formData.cityId == k.value)
  708. if (!temp && !temp?.parentLbsId && !Object.keys(this.specialCity).includes(temp?.parentLbsId)) {
  709. await this.getCallbackPosition(this.formData.areaId, this.formData.streetId, 'street', 'lbsId')
  710. }
  711. if (this.module !== 'add' && this.isTradeExaminer && this.formData.customerId && this.formData.customerName) {
  712. this.getDealerListV3(this.formData.customerName)
  713. }
  714. }
  715. }
  716. },
  717. mounted() {
  718. if (this.module === 'add') {
  719. this.getAutonaviRegion()
  720. if (this.isCustomer) {
  721. this.formData.customerId = this.customerId
  722. this.formData.customerNumber = this.customerNumber
  723. this.formData.customerName = this.customerName
  724. }
  725. if (!this.isCustomer && !this.isTradeExaminer) {
  726. this.formData.customerId = '269184'
  727. this.formData.customerNumber = '100503'
  728. this.formData.customerName = '韶关弘格贸易有限公司'
  729. }
  730. if (!this.isTradeExaminer) {
  731. this.getHistory(this.formData.customerId)
  732. }
  733. }
  734. if (this.pageType === 'home' || this.formData.orderType === 'HOME') {
  735. this.initTradeData('HOME')
  736. } else {
  737. this.getTradeConfigList()
  738. }
  739. },
  740. methods: {
  741. getList: getFirstPartyCustomerManagementList,
  742. handleClose() {
  743. this.dialogVisible = false
  744. },
  745. operation() {
  746. return (h, { row, index, column }) => {
  747. return (
  748. <div class="operation-btns">
  749. <el-button
  750. size="mini"
  751. type="text"
  752. onClick={() => {
  753. this.formData.partyA = row.name
  754. this.formData.partyAId = row.id
  755. this.dialogVisible = false
  756. }}
  757. >
  758. 确定选中
  759. </el-button>
  760. </div>
  761. )
  762. }
  763. },
  764. initTradeData(e) {
  765. if (e === 'HOME') {
  766. this.getTradeConfigList()
  767. this.formData.tradeParentId = '1689529426267607042'
  768. this.formData.tradeId = '1689529478943870978'
  769. } else {
  770. this.formData.tradeParentId = ''
  771. this.formData.tradeId = ''
  772. }
  773. },
  774. // 获取省市区街道
  775. getAutonaviRegion(level = 0, id = null) {
  776. getAutonaviRegion({ parentLbsId: id }).then(res => {
  777. if (level === 0) {
  778. if (['frock', 'home'].includes(this.pageType)) {
  779. this.provinceList = res.data.filter(k => {
  780. return k.name === '广东省'
  781. })
  782. this.getPosition(this.provinceList, 'provinceId', 'province')
  783. } else {
  784. this.provinceList = res.data
  785. }
  786. } else if (level === 1) {
  787. if (this.formData.province === '广东省' && ['frock', 'home'].includes(this.pageType)) {
  788. this.cityList = res.data.filter(k => {
  789. if (this.formData.projectArea) {
  790. return this.region[this.formData.projectArea].includes(k.name)
  791. }
  792. return k
  793. })
  794. } else {
  795. this.cityList = res.data
  796. }
  797. } else if (level === 2) {
  798. this.areaList = res.data
  799. } else if (level === 3) {
  800. this.streetList = res.data
  801. }
  802. })
  803. },
  804. handleProjectArea(e) {
  805. if (
  806. ['frock', 'home'].includes(this.pageType) &&
  807. this.formData.provinceId &&
  808. this.formData.province === '广东省'
  809. ) {
  810. this.getAutonaviRegion(1, this.formData.provinceId)
  811. }
  812. },
  813. getPosition(data, id, name) {
  814. if (this.module === 'add') {
  815. const item = data.find(k => k.name === this.$IpAdd[name])
  816. this.formData[id] = item.lbsId
  817. this.formData[name] = item.name
  818. // if (name === 'province') {
  819. this.getAutonaviRegion(1, item.lbsId)
  820. // }
  821. // else {
  822. // this.getAutonaviRegion(2, item.lbsId)
  823. // }
  824. }
  825. },
  826. getPositionProject() {
  827. getPositionProject({ id: this.formData.id }).then(res => {
  828. this.commonData.vicinityMarkers = res.data
  829. this.markers = this.commonData.vicinityMarkers.map(k => {
  830. return {
  831. id: '',
  832. name: k.projectName,
  833. center: [k.lnt, k.lat],
  834. address: k.address,
  835. no: k.projectNo
  836. }
  837. })
  838. this.markers.push({
  839. name: this.formData.projectName,
  840. center: [this.formData.lnt, this.formData.lat],
  841. address: this.formData.address,
  842. no: this.formData.projectNo
  843. })
  844. })
  845. },
  846. handleArea(value, type) {
  847. this.formData[type] = this[type + 'List'].find(k => k.lbsId === value).name
  848. },
  849. // 切换省
  850. changeProvince(value) {
  851. this.formData.cityId = ''
  852. this.formData.areaId = ''
  853. this.formData.streetId = ''
  854. this.cityList = []
  855. this.areaList = []
  856. this.streetList = []
  857. this.getAutonaviRegion(1, value)
  858. this.handleArea(value, 'province')
  859. },
  860. // 切换市
  861. changeCity(value) {
  862. this.formData.areaId = ''
  863. this.formData.streetId = ''
  864. this.areaList = []
  865. this.streetList = []
  866. this.getAutonaviRegion(2, value)
  867. this.handleArea(value, 'city')
  868. },
  869. // 切换区
  870. changeArea(value) {
  871. this.areaValue = value
  872. this.formData.streetId = ''
  873. this.streetList = []
  874. // 特殊处理市
  875. const temps = this.areaList.filter(k => {
  876. return k.lbsId === value
  877. })
  878. if (
  879. value &&
  880. this.areaList.length &&
  881. temps.length &&
  882. temps[0]?.parentLbsId &&
  883. Object.keys(this.specialCity).includes(temps[0]?.parentLbsId)
  884. ) {
  885. this.streetList = temps
  886. this.formData.streetId = value
  887. this.handleArea(value, 'street')
  888. return
  889. }
  890. this.getAutonaviRegion(3, value)
  891. this.handleArea(value, 'area')
  892. },
  893. // 切换街道
  894. changeStreet(value) {
  895. this.getAutonaviRegion(3, this.areaValue)
  896. this.handleArea(value, 'street')
  897. },
  898. // 初始化省市区街道
  899. initRegion(level, item, id = 0) {
  900. const { province, city, area, street } = item
  901. let nextId = null
  902. getAutonaviRegion({ pid: id }).then(res => {
  903. if (level === 0) {
  904. this.provinceList = res.data
  905. nextId = this.formData.provinceId = this.provinceList[findElem(this.provinceList, 'name', province)].id
  906. } else if (level === 1) {
  907. this.cityList = res.data
  908. nextId = this.formData.cityId = this.cityList[findElem(this.cityList, 'name', city)].id
  909. } else if (level === 2) {
  910. this.areaList = res.data
  911. nextId = this.formData.areaId = this.areaList[findElem(this.areaList, 'name', area)].id
  912. } else if (level === 3) {
  913. this.streetList = res.data
  914. nextId = this.formData.streetId = this.streetList[findElem(this.streetList, 'name', street)].id
  915. }
  916. if (level < 3) {
  917. level = level + 1
  918. this.initRegion(level, item, nextId)
  919. }
  920. })
  921. },
  922. handleTradeParent(e) {
  923. if (e) {
  924. const item = this.tradeParentList.find(k => k.id === e)
  925. this.formData.tradeParentName = item.name
  926. this.tradeList = item.childList
  927. return
  928. }
  929. this.formData.tradeId = ''
  930. },
  931. handleTrade(e) {
  932. if (e) {
  933. const item = this.tradeList.find(k => k.id === e)
  934. this.formData.tradeName = item.name
  935. } else {
  936. this.formData.tradeId = ''
  937. this.formData.tradeName = ''
  938. }
  939. },
  940. getTradeConfigList(parentId = '') {
  941. getTradeConfigList({
  942. pageNum: 1,
  943. pageSize: -1,
  944. parentId: parentId
  945. }).then(res => {
  946. if (parentId) {
  947. this.tradeList = res.data
  948. return
  949. }
  950. this.tradeParentList = res.data
  951. const item = this.tradeParentList.find(k => k.id === this.formData.tradeParentId)
  952. if (item && item.childList) {
  953. this.tradeList = item.childList
  954. }
  955. })
  956. },
  957. handleService(e) {
  958. if (e) {
  959. const item = this.commonData.salesmanList.find(k => k.value === e)
  960. this.formData.serviceNumber = item.userName
  961. this.formData.serviceName = item.label
  962. } else {
  963. this.formData.serviceName = ''
  964. this.formData.serviceNumber = ''
  965. }
  966. },
  967. handlePartyA(e) {
  968. if (e) {
  969. const item = this.commonData.PartyAList.find(k => k.value === e)
  970. this.formData.partyA = item.label
  971. } else {
  972. this.formData.partyA = ''
  973. }
  974. },
  975. handleCustomer(e) {
  976. if (e) {
  977. const item = this.commonData.customerList.find(k => k.value === e)
  978. this.formData.customerName = item.label
  979. this.formData.customerNumber = item.number
  980. this.getHistory(this.formData.customerId)
  981. } else {
  982. this.formData.customerName = ''
  983. this.formData.customerNumber = ''
  984. this.formData.customerLinkName = ''
  985. this.formData.customerLinkMobile = ''
  986. this.formData.customerAddress = ''
  987. }
  988. },
  989. onSbumit() {},
  990. getPolygons(data) {
  991. console.log(data)
  992. },
  993. async handleSelectPosi(data) {
  994. this.formData.lnt = data.center[0]
  995. this.formData.lat = data.center[1]
  996. this.formData.positionAddress = data.name
  997. // this.formData.address = data.name
  998. var { province, city, district, township } = data.data.addressComponent
  999. console.log(province, city, district, township)
  1000. const area = district
  1001. const street = township
  1002. await this.getCallbackPosition(null, province, 'province')
  1003. await this.getCallbackPosition(this.formData.provinceId, city, 'city')
  1004. await this.getCallbackPosition(this.formData.cityId, area, 'area')
  1005. const temp = this.areaList.find(k => this.formData.cityId == k.value)
  1006. if (!temp && !temp?.parentLbsId && !Object.keys(this.specialCity).includes(temp?.parentLbsId)) {
  1007. await this.getCallbackPosition(this.formData.areaId, street, 'street')
  1008. }
  1009. },
  1010. /**
  1011. * @param {*} id // 父级id
  1012. * @param {*} value // 值
  1013. * @param {*} name // 字段名称
  1014. * @param {*} way // 筛选属性,默认name
  1015. */
  1016. async getCallbackPosition(id = 0, value = '', name, way = 'name') {
  1017. const { data } = await getAutonaviRegion({ parentLbsId: id })
  1018. this[name + 'List'] = data
  1019. const temp = data.find(k => k[way] == value)
  1020. // 特殊处理市
  1021. if (name === 'area' && Object.keys(this.specialCity).includes(temp.parentLbsId)) {
  1022. this.streetList = [temp]
  1023. this.formData.streetId = temp.lbsId
  1024. this.handleArea(temp.lbsId, 'street')
  1025. return
  1026. }
  1027. this.formData[name] = temp && temp.name
  1028. this.formData[name + 'Id'] = temp && temp.lbsId
  1029. },
  1030. openPdf(item) {
  1031. const link = document.createElement('a')
  1032. link.style.display = 'none'
  1033. link.href = this.$imageUrl + item.url
  1034. link.download = item.name
  1035. document.body.appendChild(link)
  1036. link.click()
  1037. document.body.removeChild(link)
  1038. },
  1039. getHistory(id) {
  1040. getHistory({ customerId: id }).then(res => {
  1041. this.formData.customerLinkName = res.data.linkName || ''
  1042. this.formData.customerLinkMobile = res.data.linkMobile || ''
  1043. this.formData.customerAddress = res.data.address || ''
  1044. })
  1045. },
  1046. remoteMethod(e) {
  1047. this.loading = false
  1048. this.getDealerListV3(e)
  1049. },
  1050. getDealerListV3(e) {
  1051. getDealerListV3({
  1052. pageNum: 1,
  1053. pageSize: 100,
  1054. params: [
  1055. {
  1056. param: 'a.name',
  1057. compare: 'like',
  1058. value: e
  1059. }
  1060. ]
  1061. })
  1062. .then(res => {
  1063. this.commonData.customerList = res.data.records.map(k => {
  1064. return {
  1065. number: k.number,
  1066. label: k.name,
  1067. value: k.id
  1068. }
  1069. })
  1070. })
  1071. .finally(() => {
  1072. this.loading = false
  1073. })
  1074. }
  1075. }
  1076. }
  1077. </script>
  1078. <style lang="scss" scoped>
  1079. .diy-table-1 {
  1080. border: 1px solid #cccc;
  1081. border-right: none;
  1082. border-bottom: none;
  1083. }
  1084. .diy-table-1 .item {
  1085. border-bottom: 1px solid #ccc;
  1086. }
  1087. .diy-table-1 .item .label {
  1088. width: 180px;
  1089. padding: 10px;
  1090. border-right: 1px solid #ccc;
  1091. }
  1092. .diy-table-1 .item .value {
  1093. border-right: 1px solid #ccc;
  1094. justify-content: space-between;
  1095. }
  1096. ::v-deep .el-select {
  1097. width: 100% !important;
  1098. }
  1099. ::v-deep .date .el-input__icon,
  1100. ::v-deep .date .el-input__prefix {
  1101. right: 50px !important;
  1102. left: auto;
  1103. }
  1104. ::v-deep .el-textarea__inner {
  1105. padding: 0;
  1106. border: none;
  1107. }
  1108. ::v-deep .file:first-child > div {
  1109. display: flex !important;
  1110. align-items: center;
  1111. flex-direction: row-reverse;
  1112. }
  1113. ::v-deep .file .is-success {
  1114. margin-top: 0;
  1115. }
  1116. .my-width {
  1117. width: 150px;
  1118. }
  1119. .title {
  1120. display: flex;
  1121. justify-content: space-between;
  1122. .title-right {
  1123. font-size: 16px;
  1124. font-weight: 300;
  1125. }
  1126. }
  1127. ::v-deep .my-center {
  1128. input {
  1129. text-align: center !important;
  1130. }
  1131. }
  1132. ::v-deep .el-upload-list__item-name {
  1133. width: 200px !important;
  1134. }
  1135. .IP_font {
  1136. font-size: 28px;
  1137. color: #409eff;
  1138. position: absolute;
  1139. left: -13px;
  1140. top: -25px;
  1141. }
  1142. .IP {
  1143. width: 15vw;
  1144. background-color: #fff;
  1145. padding: 6px 0 6px 6px;
  1146. }
  1147. ::v-deep .el-radio__inner {
  1148. border: 2px solid #ccc;
  1149. border-radius: 100%;
  1150. width: 14px;
  1151. height: 14px;
  1152. background-color: #fff;
  1153. cursor: pointer;
  1154. -webkit-box-sizing: border-box;
  1155. box-sizing: border-box;
  1156. }
  1157. </style>