You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

222 rivejä
5.0 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">这是公司</div>
  72. <div class="content" v-if="flag == 3">这是楼盘</div>
  73. <el-pagination
  74. style="margin: 20px auto"
  75. class="page"
  76. @size-change="handleSizeChange"
  77. @current-change="handleCurrentChange"
  78. :current-page="currentPage"
  79. :page-size="10"
  80. layout="total, sizes, prev, pager, next, jumper"
  81. :total="40"
  82. >
  83. </el-pagination>
  84. </div>
  85. </template>
  86. <script>
  87. export default {
  88. data() {
  89. return {
  90. flag: 1,
  91. currentPage: 1,
  92. agentName: "", //代理商名称
  93. list: [],
  94. };
  95. },
  96. mounted() {
  97. // console.log(this.$route.query)
  98. // 给定一个标志做判断显隐
  99. this.flag = this.$route.query.flag;
  100. // 获取数据
  101. if (this.flag == 1) {
  102. // 获取代理商
  103. // return
  104. this.getAgentList();
  105. } else if (this.flag == 2) {
  106. // 获取公司
  107. } else {
  108. // 获取楼盘
  109. }
  110. },
  111. computed: {},
  112. methods: {
  113. // 获取代理商
  114. getAgentList() {
  115. this.$api.api
  116. .zkagentPage({
  117. pageNum: this.currentPage,
  118. pageSize: 10,
  119. agentName: this.agentName,
  120. })
  121. .then((res) => {
  122. console.log(res);
  123. this.list = res.data.records;
  124. });
  125. },
  126. chose(item) {
  127. console.log(item)
  128. this.$router.push({ path: "/wel" });
  129. },
  130. goback() {
  131. this.$router.back();
  132. },
  133. handleSizeChange(val) {
  134. console.log(`每页 ${val} 条`);
  135. },
  136. handleCurrentChange(val) {
  137. console.log(`当前页: ${val}`);
  138. this.currentPage = val;
  139. if (this.flag == 1) {
  140. // 获取代理商
  141. this.getAgentList();
  142. } else if (this.flag == 2) {
  143. // 获取公司
  144. } else {
  145. // 获取楼盘
  146. }
  147. },
  148. },
  149. };
  150. </script>
  151. <style lang="scss" scoped >
  152. .head {
  153. height: 64px;
  154. background: #409eff;
  155. display: flex;
  156. padding: 0 20%;
  157. box-sizing: border-box;
  158. justify-content: space-between;
  159. line-height: 64px;
  160. color: #fff;
  161. font-size: 24px;
  162. .callback {
  163. font-size: 14px;
  164. }
  165. }
  166. .hid {
  167. margin-top: 25px;
  168. height: 50px;
  169. background: #f8f8f8;
  170. border-radius: 4px;
  171. text-align: center;
  172. line-height: 50px;
  173. font-size: 18px;
  174. color: #32363d;
  175. }
  176. .content {
  177. margin-top: 30px;
  178. padding: 0 20%;
  179. // height: 680px;
  180. min-height: 500px;
  181. .con {
  182. display: flex;
  183. flex-wrap: wrap;
  184. }
  185. .search {
  186. display: flex;
  187. }
  188. .tab {
  189. width: 200px;
  190. height: 98px;
  191. border-radius: 4px;
  192. border: 1px solid #e0e0e0;
  193. box-sizing: border-box;
  194. padding-left: 20px;
  195. margin-left: 40px;
  196. margin-top: 20px;
  197. cursor: pointer;
  198. .text-1 {
  199. font-size: 16px;
  200. line-height: 30px;
  201. margin-top: 10px;
  202. }
  203. .text-2 {
  204. font-size: 14px;
  205. line-height: 30px;
  206. }
  207. .text-3 {
  208. font-size: 14px;
  209. line-height: 20px;
  210. margin-bottom: 10px;
  211. }
  212. }
  213. }
  214. .page {
  215. position: absolute;
  216. bottom: 0;
  217. left: 30%;
  218. }
  219. </style>