mymechants.vue 14 KB

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