您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
 
 
 

271 行
6.5 KiB

  1. <template>
  2. <div>
  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="getAgentList"
  26. >搜索</el-button
  27. >
  28. </div>
  29. <div class="con">
  30. <div v-for="item in list" :key="item.id" class="tab" @click="chose(item)">
  31. <div class="text-1">{{ item.agentName }}</div>
  32. <div class="text-2">
  33. 服务状态:
  34. <span
  35. style="font-size: 12px"
  36. :style="item.residueTime > 0 ? 'color:green;' : 'color:red;'"
  37. >{{ item.residueTime > 0 ? "服务中" : "已过期" }}</span
  38. >
  39. </div>
  40. <div class="text-3">{{ item.address }}</div>
  41. </div>
  42. </div>
  43. </div>
  44. <!-- <div class="content">
  45. <div class="search">
  46. <el-input
  47. placeholder="请输入内容"
  48. style="width: 200px; margin-left: 40px; margin-right: 30px"
  49. v-model="agentName"
  50. clearable
  51. >
  52. </el-input>
  53. <el-button
  54. style="height: 32px; line-height: 13px"
  55. type="primary"
  56. size="medium"
  57. @click="getAgentList"
  58. >搜索</el-button
  59. >
  60. </div>
  61. <el-row :gutter="20">
  62. <el-col class="tab" v-for="item in list" :key="item.id">
  63. <div>
  64. <div>{{ item.agentName }}</div>
  65. <div>服务状态{{ item.residueTime > 0 ? "未过期" : "已过期" }}</div>
  66. <div>{{ item.address }}</div>
  67. </div>
  68. </el-col>
  69. </el-row>
  70. </div> -->
  71. <div class="content" v-if="flag == 2">
  72. <div class="search">
  73. <el-input
  74. placeholder="请输入内容"
  75. style="width: 200px; margin-left: 40px; margin-right: 30px"
  76. v-model="companyName"
  77. clearable
  78. >
  79. </el-input>
  80. <el-button
  81. style="height: 32px; line-height: 13px"
  82. type="primary"
  83. size="medium"
  84. @click="getCompanyList"
  85. >搜索</el-button
  86. >
  87. </div>
  88. <div class="con">
  89. <div v-for="item in list" :key="item.id" class="tab" @click="chose(item)">
  90. <div class="text-1">{{ item.agentName }}</div>
  91. <!-- <div class="text-2">
  92. 服务状态:
  93. <span
  94. style="font-size: 12px"
  95. :style="item.residueTime > 0 ? 'color:green;' : 'color:red;'"
  96. >{{ item.residueTime > 0 ? "服务中" : "已过期" }}</span
  97. >
  98. </div> -->
  99. <div class="text-3">{{ item.address }}</div>
  100. </div>
  101. </div>
  102. </div>
  103. <div class="content" v-if="flag == 3">这是楼盘</div>
  104. <el-pagination
  105. style="margin: 20px auto"
  106. class="page"
  107. @size-change="handleSizeChange"
  108. @current-change="handleCurrentChange"
  109. :current-page="currentPage"
  110. :page-size="10"
  111. layout="total, sizes, prev, pager, next, jumper"
  112. :total="total"
  113. >
  114. </el-pagination>
  115. </div>
  116. </template>
  117. <script>
  118. export default {
  119. data() {
  120. return {
  121. flag: 1,
  122. currentPage: 1,
  123. agentName: "", //代理商名称
  124. companyName:'',
  125. total:20,
  126. list: [],
  127. };
  128. },
  129. mounted() {
  130. // console.log(this.$route.query)
  131. // 给定一个标志做判断显隐
  132. this.flag = this.$route.query.flag;
  133. // 获取数据
  134. if (this.flag == 1) {
  135. // 获取代理商
  136. // return
  137. this.getAgentList();
  138. } else if (this.flag == 2) {
  139. // 获取公司
  140. this.getCompanyList()
  141. } else {
  142. // 获取楼盘
  143. }
  144. },
  145. computed: {},
  146. methods: {
  147. // 获取代理商
  148. getAgentList() {
  149. this.$api.api
  150. .zkagentPage({
  151. current: this.currentPage,
  152. pageSize: 10,
  153. agentName: this.agentName,
  154. })
  155. .then((res) => {
  156. console.log(res);
  157. this.list = res.data.records;
  158. this.total=res.data.total
  159. });
  160. },
  161. getCompanyList() {
  162. this.$api.api
  163. .zkorg({
  164. current: this.currentPage,
  165. pageSize: 10,
  166. name: this.companyName,
  167. orgType:localStorage.getItem('orgType')
  168. })
  169. .then((res) => {
  170. console.log(res);
  171. this.list = res.data.records;
  172. this.total=res.data.total
  173. });
  174. },
  175. chose(item) {
  176. console.log(item)
  177. this.$router.push({ path: "/wel" });
  178. },
  179. goback() {
  180. this.$router.back();
  181. },
  182. handleSizeChange(val) {
  183. console.log(`每页 ${val} 条`);
  184. },
  185. handleCurrentChange(val) {
  186. console.log(`当前页: ${val}`);
  187. this.currentPage = val;
  188. if (this.flag == 1) {
  189. // 获取代理商
  190. this.getAgentList();
  191. } else if (this.flag == 2) {
  192. // 获取公司
  193. } else {
  194. // 获取楼盘
  195. }
  196. },
  197. },
  198. };
  199. </script>
  200. <style lang="scss" scoped >
  201. .head {
  202. height: 64px;
  203. background: #409eff;
  204. display: flex;
  205. padding: 0 20%;
  206. box-sizing: border-box;
  207. justify-content: space-between;
  208. line-height: 64px;
  209. color: #fff;
  210. font-size: 24px;
  211. .callback {
  212. font-size: 14px;
  213. }
  214. }
  215. .hid {
  216. margin-top: 25px;
  217. height: 50px;
  218. background: #f8f8f8;
  219. border-radius: 4px;
  220. text-align: center;
  221. line-height: 50px;
  222. font-size: 18px;
  223. color: #32363d;
  224. }
  225. .content {
  226. margin-top: 30px;
  227. padding: 0 20%;
  228. // height: 680px;
  229. min-height: 500px;
  230. .con {
  231. display: flex;
  232. flex-wrap: wrap;
  233. }
  234. .search {
  235. display: flex;
  236. }
  237. .tab {
  238. width: 200px;
  239. height: 98px;
  240. border-radius: 4px;
  241. border: 1px solid #e0e0e0;
  242. box-sizing: border-box;
  243. padding-left: 20px;
  244. margin-left: 40px;
  245. margin-top: 20px;
  246. cursor: pointer;
  247. .text-1 {
  248. font-size: 16px;
  249. line-height: 30px;
  250. margin-top: 10px;
  251. }
  252. .text-2 {
  253. font-size: 14px;
  254. line-height: 30px;
  255. }
  256. .text-3 {
  257. font-size: 14px;
  258. line-height: 20px;
  259. margin-bottom: 10px;
  260. }
  261. }
  262. }
  263. .page {
  264. position: absolute;
  265. bottom: 0;
  266. left: 30%;
  267. }
  268. </style>