mymechantsdetails.vue 32 KB

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