mymechants.vue 14 KB

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