addintention.vue 30 KB

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