addintention.vue 28 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058
  1. <template>
  2. <div class="addintention">
  3. <div class="form">
  4. <uni-forms ref="baseForm" :modelValue="form" label-width="100%">
  5. <uni-forms-item label="企业名称:">
  6. <!-- <uni-easyinput v-model="form.name" placeholder="请输入"/>-->
  7. <uni-easyinput v-model="form.companyId" placeholder="请输入" />
  8. </uni-forms-item>
  9. <uni-forms-item label="招商负责人:">
  10. <uni-easyinput v-model="form.projectManager" placeholder="请输入" />
  11. </uni-forms-item>
  12. <uni-forms-item label="联系电话:">
  13. <uni-easyinput v-model="form.managerPhone" placeholder="请输入" />
  14. </uni-forms-item>
  15. </uni-forms>
  16. </div>
  17. <div class="list">
  18. <div class="project-column pdt32 pdl32 pdr32 border_bottom_ccc">
  19. <div
  20. class="pdb16 height50rpx chuzuborder lh50rpx disflex align_items_center"
  21. >
  22. <div class="lh50rpx">关联房源</div>
  23. <van-icon
  24. name="add"
  25. class="ml16"
  26. size="50rpx"
  27. color="#2527AA"
  28. @click="jumpChosseHouse('房源')"
  29. />
  30. </div>
  31. </div>
  32. <div
  33. class="list-row"
  34. v-if="fangyuanList.length != 0"
  35. v-for="(item, index) in fangyuanList"
  36. :key="item.id"
  37. >
  38. <div class="cell_1">
  39. <div class="width100 height50rpx mgb20">
  40. <div class="first_title float_left">
  41. {{ item.roomString }}
  42. </div>
  43. <div
  44. class="status_label txt_center width20 float_left"
  45. v-if="item.reservationStatus == 1"
  46. >
  47. 意向
  48. </div>
  49. <div
  50. class="status_label txt_center width20 float_left"
  51. v-if="item.reservationStatus == 2"
  52. >
  53. 锁定
  54. </div>
  55. <div
  56. class="status_label txt_center width20 float_left"
  57. v-if="item.reservationStatus == 3"
  58. >
  59. 预约
  60. </div>
  61. <div
  62. class="status_label txt_center width20 float_left"
  63. v-if="item.reservationStatus == 4"
  64. >
  65. 到期时间
  66. </div>
  67. <div
  68. class="status_label txt_center width20 float_left"
  69. v-if="item.reservationStatus == 5"
  70. >
  71. 签约
  72. </div>
  73. <div
  74. class="status_label txt_center width20 float_left"
  75. v-if="item.reservationStatus == 6"
  76. >
  77. 签约合同
  78. </div>
  79. <div
  80. class="status_label txt_center width20 float_left"
  81. v-if="item.reservationStatus == 7"
  82. >
  83. 锁定到期
  84. </div>
  85. </div>
  86. <div class="width100 height40rpx pdb16 border_bottom_ccc">
  87. <div class="second_title height40rpx">
  88. 到期日期:{{ !item.endTime ? "暂无" : item.endTime }}
  89. </div>
  90. </div>
  91. <div class="button_list pdb20 pdt20">
  92. <div class="bottom_cell">
  93. <div class="button_row" @click="fangyuanListSplice(index)">
  94. 解绑
  95. </div>
  96. <div class="button_row" @click="yuyueChooseTime(index, 2)">
  97. 锁定
  98. </div>
  99. <div class="button_row" @click="yuyueChooseTime(index, 3)">
  100. 预约
  101. </div>
  102. <div class="button_row" @click="signing(index)">签约</div>
  103. </div>
  104. </div>
  105. </div>
  106. </div>
  107. </div>
  108. <div class="form">
  109. <uni-forms ref="baseForm" :modelValue="form" label-width="100%">
  110. <uni-forms-item label="项目名称:">
  111. <uni-easyinput v-model="form.projectName" placeholder="请输入" />
  112. </uni-forms-item>
  113. <uni-forms-item label="项目简介:">
  114. <uni-easyinput
  115. type="textarea"
  116. class="bgcF9F9F9 height218rpx"
  117. v-model="form.projectInfo"
  118. placeholder="请输入"
  119. />
  120. </uni-forms-item>
  121. <uni-forms-item label="租赁需求:">
  122. <uni-easyinput
  123. type="textarea"
  124. class="bgcF9F9F9 height218rpx"
  125. v-model="form.leaseRequirements"
  126. placeholder="请输入"
  127. />
  128. </uni-forms-item>
  129. </uni-forms>
  130. </div>
  131. <div class="form">
  132. <div
  133. class="form_row pdt32 pdb32 border_bottom_ccc width100"
  134. @click="getSelectDeptTwo('selectGenzongDep')"
  135. >
  136. <div class="float_left width30 first_title height50rpx">跟踪部门</div>
  137. <div
  138. class="float_left width60 whitespacenowrap first_title height50rpx font28rpx color292d98"
  139. >
  140. {{ form.genzongbumen }}
  141. </div>
  142. <img
  143. class="height40rpx width40rpx float_right"
  144. src="../../../static/mine/youjiantou.png"
  145. alt=""
  146. />
  147. </div>
  148. <div
  149. class="form_row pdt32 pdb32 border_bottom_ccc width100"
  150. @click="chosseAboutCompany()"
  151. >
  152. <div class="float_left width30 first_title height50rpx">相关部门</div>
  153. <div
  154. class="float_left width60 whitespacenowrap first_title height50rpx font28rpx color292d98"
  155. >
  156. {{ form.xiangguanbumen }}
  157. </div>
  158. <img
  159. class="height40rpx width40rpx float_right"
  160. src="../../../static/mine/youjiantou.png"
  161. alt=""
  162. />
  163. </div>
  164. <div
  165. class="form_row pdt32 pdb32 border_bottom_ccc width100"
  166. @click="getSelectUserTwo('tkitreerefs')"
  167. >
  168. <div class="float_left width30 first_title height50rpx">相关人</div>
  169. <div
  170. class="float_left width60 whitespacenowrap first_title height50rpx font28rpx color292d98"
  171. >
  172. {{ form.xiangguanren }}
  173. </div>
  174. <img
  175. class="height40rpx width40rpx float_right"
  176. src="../../../static/mine/youjiantou.png"
  177. alt=""
  178. />
  179. </div>
  180. <div
  181. class="form_row pdt32 pdb32 border_bottom_ccc width100"
  182. @click="getSelectUserTwo('selectDengjiyuan')"
  183. >
  184. <div class="float_left width30 first_title height50rpx">信息登记员</div>
  185. <div
  186. class="float_left width60 whitespacenowrap first_title height50rpx font28rpx color292d98"
  187. >
  188. {{ form.xinxidengji }}
  189. </div>
  190. <img
  191. class="height40rpx width40rpx float_right"
  192. src="../../../static/mine/youjiantou.png"
  193. alt=""
  194. />
  195. </div>
  196. <!-- <div
  197. class="form_row pdt32 pdb32 border_bottom_ccc width100"
  198. @click="getSelectUserTwo('selectXiangmanger')"
  199. >
  200. <div class="float_left width30 first_title height50rpx">项目登记人</div>
  201. <div
  202. class="float_left width60 whitespacenowrap first_title height50rpx font28rpx color292d98"
  203. >
  204. {{ form.xiangmudengji }}
  205. </div>
  206. <img
  207. class="height40rpx width40rpx float_right"
  208. src="../../../static/mine/youjiantou.png"
  209. alt=""
  210. />
  211. </div> -->
  212. </div>
  213. <div class="form" style="padding-bottom: 192rpx">
  214. <uni-forms ref="baseForm" :modelValue="form" label-width="100%">
  215. <uni-forms-item label="目前阶段:">
  216. <uni-data-checkbox
  217. style="padding: 8rpx 0 8rpx 0"
  218. v-model="form.projectStatus"
  219. mode="tag"
  220. :localdata="muqianjieduan"
  221. selectedTextColor="#1D18BC"
  222. selectedColor="rgba(29,24,188,0.05);"
  223. @change="getjieduan"
  224. />
  225. </uni-forms-item>
  226. <uni-forms-item label="备注:">
  227. <uni-easyinput
  228. type="textarea"
  229. class="bgcF9F9F9 height218rpx"
  230. v-model="form.name"
  231. placeholder="请输入"
  232. />
  233. </uni-forms-item>
  234. <uni-forms-item
  235. label="签约日期:"
  236. required
  237. v-if="form.projectStatus == 3"
  238. >
  239. <uni-datetime-picker
  240. type="date"
  241. :clear-icon="false"
  242. v-model="form.successTime"
  243. />
  244. </uni-forms-item>
  245. <uni-forms-item
  246. label="签约载体:"
  247. required
  248. v-if="form.projectStatus == 3"
  249. >
  250. <van-icon
  251. @click="jumpChosseHouse('载体')"
  252. name="add"
  253. class="marginl8"
  254. size="40rpx"
  255. color="#2527AA"
  256. style="position: absolute; top: -28px; left: 68px"
  257. />
  258. <div class="zaiti_list">
  259. <div
  260. v-for="(item, index) in zaitiList"
  261. :key="index"
  262. style="display: flex"
  263. >
  264. <div class="pdb8 zaiti ml16 float_left">
  265. {{ item.roomString }}#
  266. </div>
  267. <van-icon
  268. class="ml8 float_left"
  269. name="clear"
  270. size="50rpx"
  271. color="#777777"
  272. @click="zaitiListSplice(index)"
  273. />
  274. </div>
  275. </div>
  276. </uni-forms-item>
  277. <uni-forms-item
  278. label="签约附件(支持图片,最多12张):"
  279. required
  280. :eletable="true"
  281. >
  282. <van-uploader
  283. :max-count="12"
  284. @delete="deleteFileList"
  285. :file-list="fileList"
  286. @after-read="afterRead"
  287. :show-upload="true"
  288. />
  289. </uni-forms-item>
  290. </uni-forms>
  291. </div>
  292. <tki-tree
  293. ref="tkitreerefs"
  294. :multiple="true"
  295. :range="range"
  296. :selectParent="true"
  297. :foldAll="true"
  298. rangeKey="name"
  299. idKey="id"
  300. @confirm="userSelectorConfirm"
  301. />
  302. <select-dengjiyuan
  303. ref="selectDengjiyuan"
  304. :multiple="false"
  305. :range="range"
  306. :selectParent="false"
  307. :foldAll="true"
  308. rangeKey="name"
  309. idKey="id"
  310. @selectDengjiyuan="selectDengjiyuan"
  311. >
  312. </select-dengjiyuan>
  313. <select-dengjiren
  314. ref="selectXiangmanger"
  315. :multiple="true"
  316. :range="range"
  317. :selectParent="true"
  318. :foldAll="true"
  319. rangeKey="name"
  320. idKey="id"
  321. @xiangmudengji="xiangmudengji"
  322. >
  323. </select-dengjiren>
  324. <select-genzongdep
  325. ref="selectGenzongDep"
  326. :multiple="false"
  327. :range="range"
  328. :selectParent="false"
  329. :foldAll="true"
  330. rangeKey="name"
  331. idKey="id"
  332. @selectGenzongDep="selectGenzongDep"
  333. />
  334. <select-xiangguandep
  335. ref="selectXiangguanDep"
  336. :multiple="true"
  337. :range="range"
  338. :selectParent="true"
  339. :foldAll="true"
  340. rangeKey="name"
  341. idKey="id"
  342. @selectXiangguanDep="selectXiangguanDep"
  343. />
  344. <multiple-select
  345. v-model="show"
  346. :data="aboutDept"
  347. :default-selected="defaultSelected"
  348. @confirm="confirm"
  349. ></multiple-select>
  350. <choose-time @getEndTime="getEndTime()" ref="chooseTime"></choose-time>
  351. <view class="‘btn-view‘">
  352. <button class="btn" @click="addyixiang()">添加</button>
  353. </view>
  354. </div>
  355. </template>
  356. <script>
  357. import tkiTree from "../../subPackages/components/tkitree/tkitree.vue";
  358. import selectDengjiyuan from "../../subPackages/components/select_dengjiyuan/tkitree.vue";
  359. import selectDengjiren from "../../subPackages/components/select_dengjiren/tkitree.vue";
  360. import selectGenzongdep from "../../subPackages/components/selectGenzongDep/tkitree.vue";
  361. import selectXiangguandep from "../../subPackages/components/selectXiangguanDep/tkitree.vue";
  362. import tools from "../../subPackages/components/tkitree/tools.js";
  363. import vantUploader from "../../../wxcomponents/weapp/dist/uploader";
  364. import chooseTime from "./chooseTime.vue";
  365. import multipleSelect from "../../subPackages/components/momo-multipleSelect/momo-multipleSelect";
  366. import {
  367. getSelectUserTwo,
  368. getSelectDeptTwo,
  369. findRoomInfoListByIds,
  370. findCompanyList,
  371. addyixiang,
  372. findDeptList,
  373. } from "@/js_sdk/http";
  374. import vanPicker from "../../../wxcomponents/weapp/dist/picker";
  375. export default {
  376. name: "addintention",
  377. components: {
  378. tkiTree,
  379. multipleSelect,
  380. chooseTime,
  381. selectDengjiyuan,
  382. selectDengjiren,
  383. vantUploader,
  384. vanPicker,
  385. selectGenzongdep,
  386. selectXiangguandep,
  387. },
  388. data() {
  389. return {
  390. show: false,
  391. aboutDept: [],
  392. defaultSelected: [],
  393. companyList_index: 0,
  394. companyList: [],
  395. range: [],
  396. fileList: [],
  397. fangyuanList: [],
  398. zaitiList: [],
  399. form: {
  400. createdBy: "",
  401. projectType: 1,
  402. successTime: "",
  403. companyId: null,
  404. xiangguanren: "",
  405. xinxidengji: "",
  406. xiangmudengji: "",
  407. relevantUserId: "",
  408. manageMessengerId: "",
  409. xiangmudengjiIds: "",
  410. genzongbumen: "",
  411. manageTrackingDepId: "",
  412. xiangguanbumen: "",
  413. relevantDepId: "",
  414. fangyuanlistIds: "",
  415. successSaleRoomList: "",
  416. projectManager: "",
  417. managerPhone: "",
  418. projectName: "",
  419. projectInfo: "",
  420. leaseRequirements: "",
  421. },
  422. currentDate: new Date().getTime(),
  423. minDate: new Date().getTime(),
  424. formatter(type, value) {
  425. if (type === "year") {
  426. return `${value}年`;
  427. }
  428. if (type === "month") {
  429. return `${value}月`;
  430. }
  431. return value;
  432. },
  433. value: null,
  434. rules: {
  435. // 对name字段进行必填验证
  436. name: {
  437. rules: [
  438. {
  439. required: true,
  440. errorMessage: "请输入",
  441. },
  442. {
  443. minLength: 3,
  444. maxLength: 5,
  445. errorMessage: "姓名长度在 {minLength} 到 {maxLength} 个字符",
  446. },
  447. ],
  448. },
  449. // 对email字段进行必填验证
  450. email: {
  451. rules: [
  452. {
  453. format: "email",
  454. errorMessage: "请输入正确的邮箱地址",
  455. },
  456. ],
  457. },
  458. },
  459. muqianjieduan: [
  460. { text: "跟进中", value: 1 },
  461. { text: "已确认", value: 2 },
  462. { text: "已签约", value: 3 },
  463. { text: "关闭", value: 4 },
  464. ],
  465. };
  466. },
  467. onLoad(option) {
  468. let that = this;
  469. if (option.ids != "null" && option.id) {
  470. findRoomInfoListByIds(option.ids).then((data) => {
  471. // that.fangyuanList = [];
  472. data.forEach((a) => {
  473. that.fangyuanList.push(a);
  474. });
  475. that.form.fangyuanlist = that.fangyuanList;
  476. for (let i = 0; i < that.form.fangyuanlist.length; i++) {
  477. for (let j = i + 1; j < that.form.fangyuanlist.length; j++) {
  478. if (that.form.fangyuanlist[i].id == that.form.fangyuanlist[j].id) {
  479. if (!that.form.fangyuanlist[i].endTime) {
  480. that.form.fangyuanlist.splice(i, 1);
  481. } else if (!that.form.fangyuanlist[j].endTime) {
  482. that.form.fangyuanlist.splice(j, 1);
  483. } else {
  484. that.form.fangyuanlist.splice(j, 1);
  485. }
  486. }
  487. }
  488. }
  489. that.form.fangyuanlistIds = "";
  490. that.form.fangyuanlistIds = e.result.join(",");
  491. });
  492. }
  493. that.findCompanyList();
  494. that.form.createdBy = JSON.parse(
  495. uni.getStorageSync("laocui_user_info")
  496. ).user.id;
  497. that.findDeptList();
  498. },
  499. onShow() {
  500. let that = this;
  501. uni.$on("getuser", function (e) {
  502. console.log(e);
  503. findRoomInfoListByIds(e.result.join(",")).then((data) => {
  504. if (e.type == "房源") {
  505. // that.fangyuanList = [];
  506. data.forEach((a) => {
  507. that.fangyuanList.push(a);
  508. });
  509. that.form.fangyuanlist = that.fangyuanList;
  510. for (let i = 0; i < that.form.fangyuanlist.length; i++) {
  511. for (let j = i + 1; j < that.form.fangyuanlist.length; j++) {
  512. if (
  513. that.form.fangyuanlist[i].id == that.form.fangyuanlist[j].id
  514. ) {
  515. if (!that.form.fangyuanlist[i].endTime) {
  516. that.form.fangyuanlist.splice(i, 1);
  517. } else if (!that.form.fangyuanlist[j].endTime) {
  518. that.form.fangyuanlist.splice(j, 1);
  519. } else {
  520. that.form.fangyuanlist.splice(j, 1);
  521. }
  522. }
  523. }
  524. }
  525. that.form.fangyuanlistIds = "";
  526. that.form.fangyuanlistIds = e.result.join(",");
  527. }
  528. if (e.type == "载体") {
  529. let all = [...that.zaitiList, ...data];
  530. // for (let i = 0; i < all.length; i++) {
  531. // for (let j = 1; j < all.length; j++) {
  532. // if (all[i] == all[j]) {
  533. // all.splice(i, 1);
  534. // }
  535. // }
  536. // }
  537. for (let i = 0; i < all.sort().length; i++) {
  538. for (let j = i + 1; j < all.sort().length; j++) {
  539. if (all[i].id == all[j].id) {
  540. all.splice(i, 1);
  541. j--;
  542. }
  543. }
  544. }
  545. that.zaitiList = all;
  546. // that.form.successSaleRoomList = "";
  547. // that.form.successSaleRoomList = e.result.join(",");
  548. }
  549. });
  550. });
  551. },
  552. methods: {
  553. async findDeptList() {
  554. let aboutDept = await findDeptList();
  555. this.aboutDept = aboutDept.map((e) => {
  556. return {
  557. label: e.deptName,
  558. value: e.id,
  559. };
  560. });
  561. },
  562. confirm(e) {
  563. var xiangguanbumen = [];
  564. var relevantDepId = [];
  565. for (var p in e) {
  566. xiangguanbumen.push(e[p].label);
  567. relevantDepId.push(e[p].value);
  568. }
  569. this.form.xiangguanbumen = xiangguanbumen.join(",");
  570. this.form.relevantDepId = relevantDepId.join(",");
  571. },
  572. chosseAboutCompany() {
  573. this.show = true;
  574. },
  575. signing(i) {
  576. let that = this;
  577. if (that.zaitiList.length > 0) {
  578. let isReport = false;
  579. for (let index = 0; index < that.zaitiList.length; index++) {
  580. if (that.zaitiList[index].id === that.fangyuanList[i].id) {
  581. that.$showToast("该载体已存在与签约载体列表内");
  582. isReport = true;
  583. return;
  584. }
  585. }
  586. if (!isReport) {
  587. that.zaitiList.push(this.fangyuanList[i]);
  588. }
  589. } else {
  590. that.zaitiList.push(this.fangyuanList[i]);
  591. }
  592. },
  593. getEndTime(i, time, type) {
  594. this.fangyuanList[i].endTime = "";
  595. this.fangyuanList[i].reservationStatus = "";
  596. this.fangyuanList[i].reservationStatus = type;
  597. this.fangyuanList[i].endTime = time;
  598. this.$forceUpdate();
  599. },
  600. yuyueChooseTime(i, type) {
  601. this.$refs.chooseTime.onOpen(i, type);
  602. },
  603. fangyuanListSplice(i) {
  604. let that = this;
  605. uni.showModal({
  606. title: "提示",
  607. content: "解绑后该房源将从项目绑定记录中删除,是否确认?",
  608. cancelText: "取消", // 取消按钮的文字
  609. confirmText: "确认", // 确认按钮的文字
  610. showCancel: true, // 是否显示取消按钮,默认为 true
  611. success: (res) => {
  612. if (res.confirm) {
  613. that.fangyuanList.splice(i, 1);
  614. this.$showToast("已删除");
  615. } else {
  616. }
  617. },
  618. });
  619. },
  620. getjieduan(e) {},
  621. deleteFileList(event) {
  622. this.fileList.splice(event.detail.index, 1);
  623. },
  624. async addyixiang() {
  625. let that = this;
  626. let saleRoomList;
  627. if (that.form.fangyuanlist && that.form.fangyuanlist.length > 0) {
  628. saleRoomList = that.form.fangyuanlist.map((e) => {
  629. return {
  630. remark: !e.roomString ? null : e.roomString,
  631. reservationStatus: !e.reservationStatus ? 1 : e.reservationStatus,
  632. parkRoomId: e.id,
  633. endTime: !e.endTime ? null : e.endTime,
  634. successStatus: null,
  635. };
  636. });
  637. } else {
  638. saleRoomList = [];
  639. }
  640. let successSaleRoomList;
  641. if (that.zaitiList && that.zaitiList.length > 0) {
  642. successSaleRoomList = that.zaitiList.map((e) => {
  643. return {
  644. remark: !e.roomString ? "" : e.roomString,
  645. reservationStatus: !e.reservationStatus ? 1 : e.reservationStatus,
  646. parkRoomId: e.id,
  647. endTime: !e.endTime ? null : e.endTime,
  648. successStatus: null,
  649. };
  650. });
  651. } else {
  652. successSaleRoomList = [];
  653. }
  654. let successPictureAddress = [];
  655. if (that.fileList.length > 0) {
  656. successPictureAddress = that.fileList.map((e) => {
  657. return {
  658. name: e.name,
  659. size: e.size,
  660. url: e.imgUrl,
  661. };
  662. });
  663. }
  664. let data = await addyixiang({
  665. ...that.form,
  666. saleRoomList: JSON.stringify(saleRoomList),
  667. successPictureAddress: JSON.stringify(successPictureAddress),
  668. successSaleRoomList: JSON.stringify(successSaleRoomList),
  669. successRoom: this.zaitiList
  670. .map((e) => {
  671. return e.roomString;
  672. })
  673. .join(","),
  674. });
  675. console.log(JSON.stringify(successPictureAddress));
  676. console.log(successPictureAddress);
  677. if (data.code == 200) {
  678. uni.navigateBack({});
  679. } else {
  680. that.$showToast(data.msg);
  681. }
  682. },
  683. getQymc(index) {
  684. let that = this;
  685. that.form.companyId = that.companyList[index].id;
  686. return that.companyList[index].qymc;
  687. },
  688. bindPickerChange(e) {
  689. let that = this;
  690. that.companyList_index = e.detail.value;
  691. },
  692. async findCompanyList() {
  693. let data = await findCompanyList();
  694. this.companyList = data;
  695. this.companyList[0].id;
  696. },
  697. zaitiListSplice(index) {
  698. this.zaitiList.splice(index, 1);
  699. },
  700. // /wx/SaleController/findRoomInfoListByIds
  701. async findRoomInfoListByIds() {
  702. let data = await findRoomInfoListByIds(ids);
  703. return data;
  704. },
  705. xiangmudengji(e) {
  706. var names = [];
  707. var ids = [];
  708. for (var p in e) {
  709. if (e[p].type == "u") {
  710. names.push(e[p].name);
  711. ids.push(e[p].id);
  712. }
  713. }
  714. this.form.xiangmudengji = names.join(",");
  715. this.form.xiangmudengjiIds = ids.join(",");
  716. },
  717. selectGenzongDep(e) {
  718. var names = [];
  719. var ids = [];
  720. for (var p in e) {
  721. names.push(e[p].name);
  722. ids.push(e[p].id);
  723. }
  724. this.form.genzongbumen = names[names.length - 1];
  725. this.form.manageTrackingDepId = ids[ids.length - 1];
  726. },
  727. selectXiangguanDep(e) {
  728. var names = [];
  729. var ids = [];
  730. for (var p in e) {
  731. names.push(e[p].name);
  732. ids.push(e[p].id);
  733. }
  734. this.form.xiangguanbumen = names.join(",");
  735. this.form.relevantDepId = ids.join(",");
  736. },
  737. selectDengjiyuan(e) {
  738. var names = [];
  739. var ids = [];
  740. for (var p in e) {
  741. if (e[p].type == "u") {
  742. names.push(e[p].name);
  743. ids.push(e[p].id);
  744. }
  745. }
  746. this.form.xinxidengji = names.join(",");
  747. this.form.manageMessengerId = ids.join(",");
  748. },
  749. userSelectorConfirm(e) {
  750. var names = [];
  751. var ids = [];
  752. for (var p in e) {
  753. if (e[p].type == "u") {
  754. names.push(e[p].name);
  755. ids.push(e[p].id);
  756. }
  757. }
  758. this.form.xiangguanren = names.join(",");
  759. this.form.relevantUserId = ids.join(",");
  760. },
  761. // 取消回调事件
  762. treeCancel(e) {},
  763. async getSelectUserTwo(key) {
  764. let that = this;
  765. let departmentList = await getSelectUserTwo("");
  766. that.range = tools.transData(
  767. departmentList.data,
  768. "id",
  769. "parentid",
  770. "children"
  771. );
  772. that.$refs[key]._show();
  773. },
  774. async getSelectDeptTwo(key) {
  775. let that = this;
  776. let departmentList = await getSelectDeptTwo("");
  777. that.range = tools.transData(
  778. departmentList.data,
  779. "id",
  780. "parentid",
  781. "children"
  782. );
  783. that.$refs[key]._show();
  784. },
  785. jumpChosseHouse(e) {
  786. uni.navigateTo({
  787. url: "/pages/subPackages/chosseHouse/chosseHouse?type=" + e,
  788. });
  789. },
  790. afterRead(event) {
  791. let that = this;
  792. const { file } = event.detail;
  793. uni.uploadFile({
  794. url: that.$constant.BASE_URI + "/wx/fileController/upload2",
  795. filePath: file.url,
  796. name: "file",
  797. formData: { user: "test" },
  798. success(res) {
  799. // 上传完成需要更新 fileList
  800. let data = JSON.parse(res.data);
  801. that.fileList.push({
  802. name: JSON.parse(data.data[0]).name,
  803. size: JSON.parse(data.data[0]).size,
  804. imgUrl: "/FileController/download/" + data.data[1],
  805. url:
  806. that.$constant.BASE_URI +
  807. "/FileController/download/" +
  808. data.data[1],
  809. isImage: true,
  810. });
  811. },
  812. fail(res) {},
  813. });
  814. },
  815. beforeRead(event) {
  816. const { file, callback } = event.detail;
  817. callback(file.type === "image");
  818. },
  819. binddata() {},
  820. submit() {},
  821. },
  822. };
  823. </script>
  824. <style lang="scss">
  825. .form_row {
  826. height: 40rpx;
  827. font-weight: 400;
  828. font-size: 24rpx;
  829. }
  830. .addintention {
  831. .btn-view {
  832. width: 100%;
  833. height: 100rpx;
  834. padding: 20rpx 10%;
  835. background-color: #ffffff;
  836. position: fixed;
  837. bottom: 0;
  838. left: 0;
  839. }
  840. .btn {
  841. width: 80%;
  842. height: 90rpx;
  843. border-radius: 50rpx 50rpx 50rpx 50rpx;
  844. background: #1d18bc;
  845. line-height: 90rpx;
  846. color: white;
  847. }
  848. .uni-forms-item__label {
  849. text {
  850. font-size: 28rpx;
  851. font-weight: 500;
  852. //color: #333333;
  853. }
  854. }
  855. .zaiti_list {
  856. width: 100%;
  857. min-height: 50rpx;
  858. line-height: 50rpx;
  859. }
  860. .zaiti {
  861. color: #777777;
  862. }
  863. .zaiti:first-child {
  864. margin: 0 !important;
  865. }
  866. .bottom_cell {
  867. float: right;
  868. width: 460rpx;
  869. height: 42rpx;
  870. }
  871. .button_row {
  872. color: #1d18bc;
  873. width: 96rpx;
  874. height: 42rpx;
  875. border-radius: 60rpx 60rpx 60rpx 60rpx;
  876. opacity: 1;
  877. margin-left: 16rpx;
  878. float: left;
  879. text-align: center;
  880. line-height: 42rpx;
  881. font-size: 24rpx;
  882. border: 2rpx solid #1d18bc;
  883. }
  884. .project-column {
  885. border-radius: 8rpx 8rpx 0rpx 0rpx;
  886. //height: 44rpx;
  887. font-size: 32rpx;
  888. font-family: PingFang SC-Medium, PingFang SC;
  889. font-weight: 500;
  890. color: #333333;
  891. background: #ffffff;
  892. }
  893. .status_label {
  894. width: 96rpx;
  895. height: 50rpx;
  896. line-height: 50rpx;
  897. background: rgba(29, 24, 188, 0.05);
  898. color: #1d18bc;
  899. font-weight: 500;
  900. font-size: 24rpx;
  901. border-radius: 8rpx 8rpx 8rpx 8rpx;
  902. }
  903. .first_title {
  904. line-height: 50rpx;
  905. font-weight: 500;
  906. }
  907. .uni-forms-item {
  908. display: block !important;
  909. margin: 0;
  910. }
  911. .addyixiang {
  912. color: #3f3fb4;
  913. background: #eaeaf2;
  914. width: 170rpx;
  915. height: 50rpx;
  916. text-align: center;
  917. line-height: 50rpx;
  918. border: 2rpx #a6a6a9 dashed;
  919. }
  920. .list-row {
  921. width: calc(100% - 64rpx);
  922. padding: 16rpx 32rpx 18rpx 32rpx;
  923. background: #ffffff;
  924. margin-bottom: 16rpx;
  925. display: flex;
  926. //height: 278rpx;
  927. border-radius: 8rpx 8rpx 8rpx 8rpx;
  928. }
  929. .icon_phone {
  930. }
  931. .list-row {
  932. width: calc(100% - 64rpx);
  933. padding: 32rpx 32rpx 38rpx 32rpx;
  934. background: #ffffff;
  935. margin-bottom: 16rpx;
  936. display: flex;
  937. //height: 278rpx;
  938. border-radius: 8rpx 8rpx 8rpx 8rpx;
  939. }
  940. .mb32rpx {
  941. margin-bottom: 32rpx;
  942. }
  943. .second_title {
  944. float: left;
  945. font-size: 28rpx;
  946. font-family: PingFang SC-Medium, PingFang SC;
  947. font-weight: 500;
  948. color: #777777;
  949. width: 100%;
  950. }
  951. .call_icon {
  952. height: 40rpx;
  953. width: 40rpx;
  954. margin-top: -5rpx;
  955. margin-left: 5rpx;
  956. float: left;
  957. }
  958. .second_title_2 {
  959. float: left;
  960. width: 38%;
  961. font-size: 28rpx;
  962. font-family: PingFang SC-Medium, PingFang SC;
  963. font-weight: 500;
  964. text-align: right;
  965. color: #777777;
  966. }
  967. .list {
  968. width: calc(100% - 64rpx);
  969. margin: 32rpx;
  970. }
  971. .form {
  972. width: calc(100% - 128rpx);
  973. margin: 32rpx;
  974. background: #ffffff;
  975. padding: 32rpx;
  976. .label {
  977. height: 53rpx;
  978. line-height: 53rpx;
  979. }
  980. }
  981. .checklist-box {
  982. margin: 0 !important;
  983. margin-right: 16rpx !important;
  984. }
  985. .labelcolmt26 {
  986. .van-cell {
  987. padding: 0 0 0 28rpx !important;
  988. }
  989. .van-col {
  990. margin-top: 26rpx !important;
  991. }
  992. label {
  993. color: #333333;
  994. font-size: 30rpx;
  995. margin-top: 10rpx !important;
  996. }
  997. .uni-data-checklist {
  998. margin-top: -10rpx !important;
  999. }
  1000. }
  1001. .status {
  1002. .uni-data-checklist {
  1003. margin-top: 0rpx !important;
  1004. }
  1005. label {
  1006. color: #333333;
  1007. font-size: 30rpx;
  1008. padding-right: 0rpx !important;
  1009. }
  1010. }
  1011. }
  1012. </style>