mymechantsdetails.vue 29 KB

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