mymechants.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618
  1. <template>
  2. <div class="mymechants">
  3. <div style="display: flex; padding-top: 20rpx; padding-bottom: 20rpx">
  4. <div
  5. style="margin-left: auto; margin-right: 40rpx"
  6. class="addyixiang"
  7. @click="addyixiang()"
  8. >
  9. +&nbsp;&nbsp;新增项目
  10. </div>
  11. </div>
  12. <div class="form">
  13. <div style="display: flex; align-items: center">
  14. <div class="yuanqu_label">项目/企业名称</div>
  15. <input
  16. confirm-type="search"
  17. @confirm="firstfindCompanyInfoList"
  18. type="text"
  19. v-model="form.projectName"
  20. placeholder="请输入"
  21. style="
  22. display: block;
  23. border: 1px solid #ccc;
  24. padding: 5rpx 2rpx;
  25. width: 420rpx;
  26. font-size: 24rpx;
  27. "
  28. />
  29. </div>
  30. <div style="display: flex; align-items: center; margin-top: 5rpx">
  31. <div class="yuanqu_label">招商负责人</div>
  32. <input
  33. confirm-type="search"
  34. @confirm="firstfindCompanyInfoList"
  35. type="text"
  36. v-model="form.truename"
  37. placeholder="请输入"
  38. style="
  39. display: block;
  40. border: 1px solid #ccc;
  41. padding: 5rpx 2rpx;
  42. width: 420rpx;
  43. font-size: 24rpx;
  44. "
  45. />
  46. </div>
  47. </div>
  48. <div class="list">
  49. <van-tabs
  50. v-if="loudongTabsStatus"
  51. :active="acitvy"
  52. @change="onChange"
  53. refs="tabsloudong"
  54. title-active-color="#1D18BC"
  55. >
  56. <van-tab title="全部" name="全部"></van-tab>
  57. <van-tab
  58. v-for="item in dic_SelectList.project_status"
  59. :title="item.label"
  60. :key="item.id"
  61. :name="item.value"
  62. ></van-tab>
  63. </van-tabs>
  64. <div
  65. class="list-row"
  66. v-if="companyList.length != 0"
  67. v-for="(item, index) in companyList"
  68. :key="index"
  69. >
  70. <div class="cell_1">
  71. <div class="width100 height44rpx" style="margin-bottom: 14rpx">
  72. <div class="first_title" @click="junmpMyMechantsDetails(item)">
  73. {{ item.projectName }}
  74. </div>
  75. </div>
  76. <div
  77. class="width100 height40rpx"
  78. style="display: flex; align-items: center"
  79. >
  80. <div class="second_title" @click="junmpMyMechantsDetails(item)">
  81. 企业联系人:{{ item.projectManager }}
  82. </div>
  83. </div>
  84. <div class="second_title_1" @click="fuckCall(item.managerPhone)">
  85. 联系电话:{{ item.managerPhone }}
  86. </div>
  87. <div class="call_icon" @click="fuckCall(item.managerPhone)">
  88. <van-icon
  89. name="phone"
  90. color="#2527AA"
  91. size="40rpx"
  92. style="line-height: 40rpx"
  93. />
  94. </div>
  95. <div
  96. style="
  97. width: 100%;
  98. display: flex;
  99. justify-content: flex-end;
  100. align-items: center;
  101. "
  102. >
  103. <div class="width100" style="display: flex; align-items: center">
  104. <div class="second_title" @click="junmpMyMechantsDetails(item)">
  105. 招商负责人:{{ item.truename }}
  106. </div>
  107. </div>
  108. <div class="second_title_2"></div>
  109. </div>
  110. <div>
  111. <picker
  112. @change="bindPickerChange"
  113. :range="dic_SelectList.project_status"
  114. range-key="label"
  115. >
  116. <!-- {{ created_by + "," + item.created_by }} -->
  117. <div
  118. v-if="created_by == 1 || created_by == item.created_by"
  119. @click="changeProjecStatus(item)"
  120. style="
  121. border: 1px solid #2527aa;
  122. height: 28px;
  123. width: 120rpx;
  124. font-size: 24rpx;
  125. text-align: center;
  126. line-height: 28px;
  127. background: #2527aa;
  128. color: white;
  129. border-radius: 0.5rem;
  130. "
  131. >
  132. 项目状态
  133. </div>
  134. <div
  135. v-else
  136. style="
  137. border: 1px solid #cccccc;
  138. height: 28px;
  139. width: 120rpx;
  140. font-size: 24rpx;
  141. text-align: center;
  142. line-height: 28px;
  143. background: #cccccc;
  144. color: white;
  145. border-radius: 0.5rem;
  146. "
  147. >
  148. 项目状态
  149. </div>
  150. </picker>
  151. </div>
  152. </div>
  153. <div class="cell_2" @click="junmpMyMechantsDetails(item)">
  154. <img src="../../../../static/mine/youjiantou.png" alt="" />
  155. </div>
  156. </div>
  157. <div class="list-row" v-if="companyList.length == 0">
  158. <van-empty
  159. class="disblock marginauto"
  160. style="background: white"
  161. description="暂无数据"
  162. />
  163. </div>
  164. </div>
  165. </div>
  166. </template>
  167. <script>
  168. import vanTab from "../../../../wxcomponents/weapp/dist/tab/index";
  169. import vanTabs from "../../../../wxcomponents/weapp/dist/tabs/index";
  170. import vanEmpty from "../../../../wxcomponents/weapp/dist/empty/index";
  171. import {
  172. findLongPanList,
  173. findYuanQuList,
  174. findCompanyInfoList,
  175. changeProjectStatus,
  176. getByCodes,
  177. findRoomByCondition,
  178. getUserLocalStorageInfo,
  179. } from "@/js_sdk/http";
  180. const form = {
  181. pageNum: 1,
  182. pageSize: 10,
  183. total: 0,
  184. projectStatus: "",
  185. };
  186. export default {
  187. components: {
  188. vanTab,
  189. vanTabs,
  190. },
  191. data() {
  192. return {
  193. dic_key: ["project_status"],
  194. dic_SelectList: {},
  195. rowId: "",
  196. // created_by: getUserLocalStorageInfo().user.id,
  197. projectStatusList: [
  198. { name: "跟进中", value: 1 },
  199. { name: "已确认", value: 2 },
  200. { name: "已签约", value: 3 },
  201. { name: "关闭", value: 4 },
  202. ],
  203. yuanqu_loacldata: [],
  204. loudongTabsStatus: false,
  205. acitvy: 0,
  206. form: {
  207. ...form,
  208. truename: "",
  209. },
  210. active: 0,
  211. formData: {},
  212. value: 0,
  213. companyList: [],
  214. range: [
  215. {
  216. value: 0,
  217. text: "全部",
  218. },
  219. {
  220. value: 1,
  221. text: "科教园",
  222. },
  223. {
  224. value: 2,
  225. text: "红沙湾",
  226. },
  227. {
  228. value: 3,
  229. text: "胡埭",
  230. },
  231. ],
  232. loupanList: [
  233. {
  234. value: 0,
  235. text: "一期",
  236. },
  237. {
  238. value: 1,
  239. text: "二期",
  240. },
  241. {
  242. value: 2,
  243. text: "三期",
  244. },
  245. {
  246. value: 3,
  247. text: "四期",
  248. },
  249. {
  250. value: 4,
  251. text: "五期",
  252. },
  253. {
  254. value: 5,
  255. text: "六期",
  256. },
  257. {
  258. value: 6,
  259. text: "七期",
  260. },
  261. {
  262. value: 7,
  263. text: "八期",
  264. },
  265. {
  266. value: 8,
  267. text: "九期",
  268. },
  269. ],
  270. statusList: [
  271. {
  272. value: 0,
  273. text: "空置",
  274. },
  275. {
  276. value: 1,
  277. text: "锁定",
  278. },
  279. {
  280. value: 2,
  281. text: "办公",
  282. },
  283. {
  284. value: 3,
  285. text: "已租",
  286. },
  287. {
  288. value: 4,
  289. text: "司法",
  290. },
  291. {
  292. value: 5,
  293. text: "维修",
  294. },
  295. ],
  296. fangxiangList: [
  297. {
  298. value: 0,
  299. text: "东",
  300. },
  301. {
  302. value: 1,
  303. text: "南",
  304. },
  305. {
  306. value: 2,
  307. text: "西",
  308. },
  309. {
  310. value: 3,
  311. text: "北",
  312. },
  313. ],
  314. xinzhiList: [
  315. {
  316. value: 1,
  317. text: "自有物业",
  318. },
  319. {
  320. value: 2,
  321. text: "社会物业",
  322. },
  323. ],
  324. };
  325. },
  326. onLoad() {},
  327. mounted() {
  328. // this.form.truename = getUserLocalStorageInfo().user.truename;
  329. this.findYuanQuList();
  330. this.getByCodes();
  331. this.firstfindCompanyInfoList();
  332. },
  333. methods: {
  334. async getByCodes() {
  335. let data = await getByCodes(JSON.stringify(this.dic_key));
  336. console.log(data);
  337. this.dic_SelectList = this.$common.handleDicList(data);
  338. console.log("this.dic_SelectList.project_status", this.dic_SelectList);
  339. this.projectStatusList = this.$common.handleDicList(data).map((e) => {
  340. return {
  341. name: e.label,
  342. value: e.value,
  343. };
  344. });
  345. },
  346. async bindPickerChange(e) {
  347. console.log(e);
  348. console.log(this.projectStatusList[e.detail.value].value);
  349. let data = await changeProjectStatus({
  350. id: this.rowId,
  351. projectStatus: this.projectStatusList[e.detail.value].value,
  352. });
  353. console.log("你改好了吗", data);
  354. if (data.code == 200) {
  355. this.$showToast("状态修改成功");
  356. this.firstfindCompanyInfoList();
  357. }
  358. console.log(data);
  359. },
  360. changeProjecStatus(item) {
  361. this.rowId = item.id;
  362. console.log(item);
  363. },
  364. junmpMyMechantsDetails(item) {
  365. uni.navigateTo({
  366. url:
  367. "/pages/subPackages/merchants/components/mymechantsdetails?id=" +
  368. item.id,
  369. });
  370. },
  371. fuckCall(phoneNumber) {
  372. uni.makePhoneCall({
  373. phoneNumber: phoneNumber, //仅为示例
  374. });
  375. },
  376. onChange(e) {
  377. console.log(e);
  378. this.form.projectStatus = e.detail.name == "全部" ? "" : e.detail.index;
  379. this.firstfindCompanyInfoList();
  380. },
  381. getSelectedYuanqu() {
  382. this.firstfindCompanyInfoList();
  383. },
  384. async firstfindCompanyInfoList() {
  385. console.log(this.form);
  386. this.form.pageNum = 1;
  387. let data = await findCompanyInfoList({
  388. ...this.form,
  389. });
  390. this.companyList = data.rows;
  391. },
  392. async findCompanyInfoList() {
  393. let data = await findCompanyInfoList(this.form);
  394. this.companyList = data.rows;
  395. },
  396. getasd() {},
  397. async getMoreList() {
  398. this.form.pageNum += 1;
  399. let data = await findCompanyInfoList(this.form);
  400. if (this.companyList.length == data.total) {
  401. this.$showToast("没有更多数据");
  402. return;
  403. }
  404. this.companyList = [...this.companyList, ...data.rows];
  405. this.$forceUpdate();
  406. console.log(this.companyList.length);
  407. },
  408. async findYuanQuList() {
  409. findYuanQuList().then((data) => {
  410. let all = {
  411. id: "",
  412. groupName: "全部",
  413. };
  414. let yuanqu_list = [all, ...data];
  415. let yuanqu_loacldata = yuanqu_list.map((e) => {
  416. return {
  417. value: e.id,
  418. text: e.groupName,
  419. };
  420. });
  421. this.yuanqu_loacldata = yuanqu_loacldata;
  422. });
  423. // console.log(yuanqu_loacldata)
  424. },
  425. addyixiang() {
  426. uni.navigateTo({
  427. url: "/pages/subPackages/addintention/addintention",
  428. });
  429. },
  430. resize() {
  431. this.loudongTabsStatus = true;
  432. },
  433. onLoadMore() {},
  434. getChaoxiang() {},
  435. getStatus() {},
  436. },
  437. onPullDownRefresh: function () {
  438. // 加载数据
  439. },
  440. onReachBottom() {
  441. console.log("滑动到距离底部100px的时候触发,可以放 。。业务逻辑");
  442. }, //下拉执行的时候触发 (下拉刷新)
  443. };
  444. </script>
  445. <style lang="scss">
  446. .yuanqu-checkbox {
  447. label {
  448. margin-right: 20rpx !important;
  449. margin-top: 0 !important;
  450. padding: 6rpx 16rpx !important;
  451. }
  452. }
  453. .mymechants {
  454. .yuanqu_label {
  455. font-size: 28rpx;
  456. width: 200rpx;
  457. }
  458. .uni-data-checklist {
  459. margin-top: 0rpx !important;
  460. }
  461. .addyixiang {
  462. color: #3f3fb4;
  463. background: #eaeaf2;
  464. width: 170rpx;
  465. height: 50rpx;
  466. text-align: center;
  467. line-height: 50rpx;
  468. font-size: 26rpx;
  469. border: 2rpx #a6a6a9 dashed;
  470. }
  471. .list-row {
  472. width: calc(100% - 64rpx);
  473. padding: 16rpx 32rpx 18rpx 32rpx;
  474. background: #ffffff;
  475. margin-bottom: 16rpx;
  476. display: flex;
  477. //height: 278rpx;
  478. border-radius: 8rpx 8rpx 8rpx 8rpx;
  479. }
  480. .icon_phone {
  481. }
  482. .list-row {
  483. width: calc(100% - 64rpx);
  484. padding: 32rpx 32rpx 38rpx 32rpx;
  485. background: #ffffff;
  486. margin-bottom: 16rpx;
  487. display: flex;
  488. //height: 278rpx;
  489. border-radius: 8rpx 8rpx 8rpx 8rpx;
  490. }
  491. .mb32rpx {
  492. margin-bottom: 32rpx;
  493. }
  494. .second_title {
  495. float: left;
  496. width: 100%;
  497. font-size: 28rpx;
  498. font-family: PingFang SC-Medium, PingFang SC;
  499. font-weight: 500;
  500. overflow: hidden;
  501. margin-bottom: 14rpx;
  502. color: #777777;
  503. }
  504. .second_title_1 {
  505. float: left;
  506. width: 66%;
  507. font-size: 28rpx;
  508. margin-bottom: 14rpx;
  509. font-family: PingFang SC-Medium, PingFang SC;
  510. font-weight: 500;
  511. color: #777777;
  512. }
  513. .call_icon {
  514. height: 40rpx;
  515. width: 40rpx;
  516. margin-top: -5rpx;
  517. margin-left: 15rpx;
  518. float: left;
  519. }
  520. .second_title_2 {
  521. float: left;
  522. width: 35%;
  523. font-size: 28rpx;
  524. font-family: PingFang SC-Medium, PingFang SC;
  525. font-weight: 500;
  526. text-align: right;
  527. color: #777777;
  528. }
  529. .cell_1 {
  530. float: left;
  531. width: 100%;
  532. }
  533. .cell_2 {
  534. float: left;
  535. width: 20%;
  536. img {
  537. height: 60rpx;
  538. width: 60rpx;
  539. float: right;
  540. margin: 96rpx 0rpx 94rpx 0;
  541. }
  542. }
  543. .list {
  544. width: calc(100% - 64rpx);
  545. margin: 32rpx;
  546. }
  547. .form {
  548. width: calc(100% - 128rpx);
  549. margin: 32rpx;
  550. margin-top: 0px;
  551. background: #ffffff;
  552. padding: 32rpx;
  553. .uni-data-checklist {
  554. margin: 0rpx !important;
  555. }
  556. .label {
  557. height: 53rpx;
  558. line-height: 53rpx;
  559. }
  560. }
  561. .checklist-box {
  562. margin: 0 !important;
  563. margin-right: 16rpx !important;
  564. }
  565. .labelcolmt26 {
  566. .van-cell {
  567. padding: 0 0 0 28rpx !important;
  568. }
  569. .van-col {
  570. margin-top: 26rpx !important;
  571. }
  572. label {
  573. color: #333333;
  574. font-size: 30rpx;
  575. margin-top: 10rpx !important;
  576. }
  577. .uni-data-checklist {
  578. margin-top: -10rpx !important;
  579. margin-top: 0rpx !important;
  580. }
  581. }
  582. .status {
  583. .uni-data-checklist {
  584. margin-top: 0rpx !important;
  585. }
  586. label {
  587. color: #333333;
  588. font-size: 30rpx;
  589. padding-right: 0rpx !important;
  590. }
  591. }
  592. }
  593. </style>