Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.
 
 
 

517 wiersze
14 KiB

  1. <template>
  2. <div class="box-center">
  3. <div class="head">
  4. <div>智控管家管理系统</div>
  5. <div class="callback" @click="goback" style="cursor: pointer">返回</div>
  6. </div>
  7. <div class="hid">
  8. 选择后台|{{
  9. flag == 1 ? "选择代理商" : flag == 2 ? "选择公司" : "选择楼盘"
  10. }}
  11. </div>
  12. <div class="content" v-if="flag == 1">
  13. <div class="search">
  14. <el-input
  15. placeholder="请输入内容"
  16. style="width: 200px; margin-left: 40px; margin-right: 30px"
  17. v-model="agentName"
  18. clearable
  19. >
  20. </el-input>
  21. <el-button
  22. style="height: 32px; line-height: 13px"
  23. type="primary"
  24. size="medium"
  25. @click="screengetAgentList"
  26. >搜索</el-button
  27. >
  28. </div>
  29. <div class="con">
  30. <div
  31. v-for="item in list"
  32. :key="item.id"
  33. class="tab"
  34. @click="chose(item)"
  35. >
  36. <div class="text-1">{{ item.agentName }}</div>
  37. <div class="text-2">
  38. 服务状态:
  39. <span
  40. style="font-size: 12px"
  41. :style="item.residueTime > 0 ? 'color:green;' : 'color:red;'"
  42. >{{ item.residueTime > 0 ? "服务中" : "已过期" }}</span
  43. >
  44. </div>
  45. <div class="text-3">{{ (item.provinceName||'-')+'-'+(item.cityName|| "-") }}</div>
  46. </div>
  47. </div>
  48. </div>
  49. <!-- <div class="content">
  50. <div class="search">
  51. <el-input
  52. placeholder="请输入内容"
  53. style="width: 200px; margin-left: 40px; margin-right: 30px"
  54. v-model="agentName"
  55. clearable
  56. >
  57. </el-input>
  58. <el-button
  59. style="height: 32px; line-height: 13px"
  60. type="primary"
  61. size="medium"
  62. @click="getAgentList"
  63. >搜索</el-button
  64. >
  65. </div>
  66. <el-row :gutter="20">
  67. <el-col class="tab" v-for="item in list" :key="item.id">
  68. <div>
  69. <div>{{ item.agentName }}</div>
  70. <div>服务状态{{ item.residueTime > 0 ? "未过期" : "已过期" }}</div>
  71. <div>{{ item.address }}</div>
  72. </div>
  73. </el-col>
  74. </el-row>
  75. </div> -->
  76. <div class="content" v-if="flag == 2">
  77. <div class="search">
  78. <el-input
  79. placeholder="请输入内容"
  80. style="width: 200px; margin-left: 40px; margin-right: 30px"
  81. v-model="companyName"
  82. clearable
  83. >
  84. </el-input>
  85. <el-button
  86. style="height: 32px; line-height: 13px"
  87. type="primary"
  88. size="medium"
  89. @click="screengetCompanyList"
  90. >搜索</el-button
  91. >
  92. </div>
  93. <div class="con">
  94. <div
  95. v-for="item in list"
  96. :key="item.id"
  97. class="tab"
  98. style="height: 78px"
  99. @click="chose(item)"
  100. >
  101. <div class="text-1">{{ item.name }}</div>
  102. <!-- <div class="text-2">
  103. 服务状态:
  104. <span
  105. style="font-size: 12px"
  106. :style="item.residueTime > 0 ? 'color:green;' : 'color:red;'"
  107. >{{ item.residueTime > 0 ? "服务中" : "已过期" }}</span
  108. >
  109. </div> -->
  110. <div class="text-3">区域位置:{{ (item.provinceName||'-')+'-'+(item.cityName|| "-") }}</div>
  111. </div>
  112. </div>
  113. </div>
  114. <div class="content" v-if="flag == 3">
  115. <div class="search">
  116. <span style="line-height: 32px; margin-right: 20px">地区:</span>
  117. <el-cascader
  118. :props="props"
  119. v-if="info.selectHouseType == 1"
  120. @change="locationsChange"
  121. placeholder="省/市"
  122. size="small"
  123. separator="/"
  124. v-model="provice"
  125. clearable
  126. ></el-cascader>
  127. <el-select
  128. v-model="area"
  129. v-if="info.selectHouseType == 2"
  130. clearable
  131. filterable
  132. placeholder="请选择"
  133. class="div-inp"
  134. >
  135. <el-option
  136. v-for="item in options"
  137. :key="item.id"
  138. :label="item.areaName"
  139. :value="item.id"
  140. >
  141. </el-option>
  142. </el-select>
  143. <el-input
  144. v-if="info.selectHouseType == 1"
  145. placeholder="请输入楼盘名称"
  146. style="width: 200px; margin-left: 40px; margin-right: 30px"
  147. v-model="propertyName"
  148. clearable
  149. >
  150. </el-input>
  151. <el-button
  152. style="height: 32px; line-height: 13px;margin-left:10px;"
  153. type="primary"
  154. size="medium"
  155. @click="screenzkhousePage"
  156. >搜索</el-button
  157. >
  158. </div>
  159. <div class="con">
  160. <div
  161. v-for="item in list"
  162. :key="item.id"
  163. class="tab"
  164. style="width:220px;height:130px;"
  165. @click="chose(item)"
  166. >
  167. <div class="text-1">{{ item.propertyName }}</div>
  168. <div class="text-2">楼盘类型:{{ item.houseType==0?'正式':item.houseType==1?'试用':item.houseType==2?'演示':'测试' }}</div>
  169. <div class="text-2">
  170. 服务状态:
  171. <span
  172. style="font-size: 12px"
  173. :style="item.residueTime > 0 ? 'color:green;' : 'color:red;'"
  174. >{{ item.residueTime > 0 ? "服务中" : "已过期" }}</span
  175. >
  176. </div>
  177. <div class="text-3">{{ (item.provinceName||'-')+'-'+(item.cityName|| "-") }}</div>
  178. </div>
  179. </div>
  180. </div>
  181. <el-pagination
  182. style="margin: 20px auto"
  183. class="page"
  184. @size-change="handleSizeChange"
  185. @current-change="handleCurrentChange"
  186. :current-page="currentPage"
  187. :page-size="10"
  188. :total="total"
  189. layout="total, sizes, prev, pager, next, jumper"
  190. hide-on-single-page
  191. >
  192. </el-pagination>
  193. </div>
  194. </template>
  195. <script>
  196. import { getAreaList } from "@/api/modules/api";
  197. import { getStore, setStore } from "@/util/store";
  198. export default {
  199. data() {
  200. return {
  201. props: {
  202. lazy: true,
  203. checkStrictly: true,
  204. expandTrigger:'hover',
  205. async lazyLoad(node, resolve) {
  206. const { level } = node;
  207. if (level == 0) {
  208. // console.log(23);
  209. const { data } = await getAreaList({ parentId: 0 }); //获取省接口
  210. var nodes = data.map((item) => {
  211. return {
  212. value: item.id,
  213. label: item.name,
  214. leaf: false,
  215. };
  216. });
  217. resolve(nodes);
  218. } else if (level == 1) {
  219. const { data } = await getAreaList({ parentId: node.data.value }); //获取市接口
  220. var nodes = data.map((item) => {
  221. return {
  222. value: item.id,
  223. label: item.name,
  224. leaf: true,
  225. };
  226. });
  227. resolve(nodes);
  228. }
  229. },
  230. },
  231. flag: 1,
  232. provice: [],
  233. area: "",
  234. provinceId: "", //省id
  235. cityId: "", //市id
  236. currentPage: 1,
  237. propertyName: "",
  238. agentName: "", //代理商名称
  239. companyName: "",
  240. total: 20,
  241. list: [],
  242. options: [],
  243. info: {},
  244. };
  245. },
  246. mounted() {
  247. // console.log(this.$route.query)
  248. // 给定一个标志做判断显隐
  249. this.flag = this.$route.query.flag;
  250. // 获取用户信息
  251. this.info = getStore({ name: "userInfo" });
  252. // this.info.selectHouseType=1
  253. // 获取数据
  254. if (this.flag == 1) {
  255. // 获取代理商
  256. // return
  257. this.getAgentList();
  258. } else if (this.flag == 2) {
  259. // 获取公司
  260. this.getCompanyList();
  261. } else {
  262. this.findByUserName();
  263. }
  264. },
  265. computed: {},
  266. methods: {
  267. // 获取代理商
  268. getAgentList() {
  269. this.$api.api
  270. .zkagentPage({
  271. current: this.currentPage,
  272. pageSize: 10,
  273. agentName: this.agentName,
  274. })
  275. .then((res) => {
  276. console.log(res);
  277. this.list = res.data.records;
  278. this.total = res.data.total;
  279. });
  280. },
  281. screengetAgentList(){
  282. this.currentPage=1
  283. this.getAgentList()
  284. },
  285. screengetCompanyList(){
  286. this.currentPage=1
  287. this.getCompanyList()
  288. },
  289. findByUserName() {
  290. this.$api.api
  291. .findByUserName({
  292. username: this.info.username,
  293. })
  294. .then((res) => {
  295. // console.log(res);
  296. this.info.selectHouseType=res.selectHouseType
  297. // 获取楼盘
  298. this.zkhousePage();
  299. // 获取区域列表
  300. this.findArea();
  301. });
  302. },
  303. screenzkhousePage(){
  304. this.currentPage=1
  305. this.zkhousePage();
  306. },
  307. getCompanyList() {
  308. this.$api.api
  309. .zkorg({
  310. current: this.currentPage,
  311. size: 10,
  312. name: this.companyName,
  313. orgType: localStorage.getItem("orgType"),
  314. })
  315. .then((res) => {
  316. console.log(res);
  317. this.list = res.data.records;
  318. this.total = res.data.total;
  319. });
  320. },
  321. findArea() {
  322. this.$api.api.findArea().then((res) => {
  323. console.log(res);
  324. this.options = res.data;
  325. });
  326. },
  327. zkhousePage() {
  328. let obj = {
  329. current: this.currentPage,
  330. size: this.size,
  331. orgType: localStorage.getItem("orgType"),
  332. };
  333. if (this.info.selectHouseType == 1) {
  334. this.$api.api.zkhousePage({
  335. propertyName: this.propertyName,
  336. provinceId :this.provinceId ,
  337. cityId:this.cityId,
  338. sortBy:1,
  339. ...obj
  340. }).then((res) => {
  341. // console.log(res)
  342. this.list = res.data.records;
  343. this.total = res.data.total;
  344. });
  345. }
  346. if (this.info.selectHouseType == 2) {
  347. this.$api.api
  348. .findHouseByArea({
  349. id: this.area,
  350. ...obj
  351. })
  352. .then((res) => {
  353. // console.log(res)
  354. this.list = res.data.records;
  355. this.total = res.data.total;
  356. });
  357. }
  358. },
  359. chose(item) {
  360. console.log(item);
  361. if(item.lockFlag!=0){
  362. this.$message.warning('您已经被禁用')
  363. return
  364. }
  365. // if(item.residueTime<=0){
  366. // this.$message.warning('您已过期')
  367. // return
  368. // }
  369. if (this.flag == 1) {
  370. localStorage.setItem("agentId", item.id);
  371. localStorage.setItem("orgCode", '');
  372. localStorage.setItem("topName", item.agentName);
  373. localStorage.setItem("houseId", '');
  374. }
  375. if (this.flag == 2) {
  376. localStorage.setItem("agentId", '');
  377. localStorage.setItem("orgCode", item.orgCode);
  378. localStorage.setItem("topName", item.name);
  379. localStorage.setItem("houseId", '');
  380. }
  381. if (this.flag == 3) {
  382. localStorage.setItem("orgCode", item.orgCode);
  383. localStorage.setItem("agentId", '');
  384. localStorage.setItem("topName", item.propertyName);
  385. localStorage.setItem("houseId", item.id);
  386. }
  387. this.$router.push({ path: "/wel" });
  388. localStorage.setItem('allClose',true)
  389. },
  390. goback() {
  391. this.$router.back();
  392. localStorage.setItem('allClose',false)
  393. },
  394. handleSizeChange(val) {
  395. console.log(`每页 ${val} 条`);
  396. },
  397. handleCurrentChange(val) {
  398. console.log(`当前页: ${val}`);
  399. this.currentPage = val;
  400. // if (this.flag == 1) {
  401. // // 获取代理商
  402. // this.getAgentList();
  403. // } else if (this.flag == 2) {
  404. // // 获取公司
  405. // this.getCompanyList();
  406. // } else {
  407. // // 获取楼盘
  408. // }
  409. if (this.flag == 1) {
  410. // 获取代理商
  411. // return
  412. this.getAgentList();
  413. } else if (this.flag == 2) {
  414. // 获取公司
  415. this.getCompanyList();
  416. } else {
  417. this.findByUserName();
  418. }
  419. },
  420. locationsChange(e) {
  421. console.log(e);
  422. if (!e) return;
  423. this.provinceId = e[0];
  424. this.cityId = e[1];
  425. },
  426. },
  427. };
  428. </script>
  429. <style lang="scss" scoped >
  430. .box-center {
  431. min-width: 1200px;
  432. height: 100vh;
  433. background: #ffffff;
  434. }
  435. .head {
  436. height: 64px;
  437. background: #409eff;
  438. display: flex;
  439. padding: 0 20%;
  440. box-sizing: border-box;
  441. justify-content: space-between;
  442. line-height: 64px;
  443. color: #fff;
  444. font-size: 24px;
  445. .callback {
  446. font-size: 14px;
  447. }
  448. }
  449. .hid {
  450. margin-top: 25px;
  451. height: 50px;
  452. background: #f8f8f8;
  453. border-radius: 4px;
  454. text-align: center;
  455. line-height: 50px;
  456. font-size: 18px;
  457. color: #32363d;
  458. }
  459. .content {
  460. margin-top: 30px;
  461. padding: 0 20%;
  462. // height: 680px;
  463. min-height: 500px;
  464. .con {
  465. display: flex;
  466. flex-wrap: wrap;
  467. }
  468. .search {
  469. display: flex;
  470. }
  471. .tab {
  472. width: 200px;
  473. height: 98px;
  474. border-radius: 4px;
  475. border: 1px solid #e0e0e0;
  476. box-sizing: border-box;
  477. padding-left: 20px;
  478. margin-left: 40px;
  479. margin-top: 20px;
  480. cursor: pointer;
  481. .text-1 {
  482. font-size: 16px;
  483. line-height: 30px;
  484. margin-top: 10px;
  485. white-space: nowrap;
  486. overflow:hidden; /*超出部分省略号显示*/
  487. text-overflow:ellipsis; /*省略号显示*/
  488. }
  489. .text-2 {
  490. font-size: 14px;
  491. line-height: 30px;
  492. }
  493. .text-3 {
  494. font-size: 14px;
  495. line-height: 20px;
  496. margin-bottom: 10px;
  497. white-space: nowrap;
  498. overflow:hidden; /*超出部分省略号显示*/
  499. text-overflow:ellipsis; /*省略号显示*/
  500. }
  501. }
  502. .tab:hover{
  503. // color: white;
  504. // background: #ccc;
  505. border: 1px solid #409eff;
  506. }
  507. }
  508. .page {
  509. // position: absolute;
  510. // bottom: 0;
  511. // left: 30%;
  512. text-align: center;
  513. }
  514. </style>