base.vue 41 KB

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