移动端
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.
 
 

221 wiersze
6.9 KiB

  1. <template>
  2. <div class="app-container">
  3. <div style="width: 100%;
  4. color:#fff;
  5. padding:20px;
  6. background: linear-gradient(134deg,#7ac943 1%, #22b7f2);">
  7. <van-row>
  8. <van-col span="6">
  9. <van-image
  10. width="60"
  11. height="60"
  12. round
  13. src="https://img01.yzcdn.cn/vant/cat.jpeg"
  14. />
  15. </van-col>
  16. <van-col span="14">
  17. <p style="margin-top: 10px;">调查员.采集员</p>
  18. <p>{{nickName}}</p>
  19. </van-col>
  20. <van-col span="2" style="text-align:center;">
  21. <van-icon name="setting-o" style="margin-top:10px" @click="gotoLink" size="30"/>
  22. </van-col>
  23. </van-row>
  24. </div>
  25. <div style="background:#F5F5F5; padding-top:10px;">
  26. <van-row style="text-align:center;margin:20px;background:#fff;padding:15px;border-radius:15px;">
  27. <van-col span="8">
  28. <van-badge :content="total">
  29. <img
  30. width="50"
  31. height="50"
  32. :src="require('../../assets/images/housesteadSurvey/task1.png')"
  33. @click="active=1"
  34. />
  35. </van-badge>
  36. <p>全部任务</p>
  37. </van-col>
  38. <van-col span="8">
  39. <van-badge :content="done">
  40. <img
  41. width="50"
  42. height="50"
  43. :src="require('../../assets/images/housesteadSurvey/task2.png')"
  44. @click="active=2"
  45. />
  46. </van-badge>
  47. <p>已完成</p>
  48. </van-col>
  49. <van-col span="8" >
  50. <van-badge :content="todo">
  51. <img
  52. width="50"
  53. height="50"
  54. :src="require('../../assets/images/housesteadSurvey/task3.png')"
  55. @click="active=3"
  56. />
  57. </van-badge>
  58. <p>待调查</p>
  59. </van-col>
  60. </van-row>
  61. <div style="margin:20px;">
  62. <p class="title" style="position:relative;padding-left:20px;line-height:32px;">任务列表</p>
  63. </div>
  64. </div>
  65. <div v-if="active==1" style="height:calc( 100vh - 350px);overflow-y:auto;">
  66. <van-cell v-for="(item,index) in totalList" :key="index" :title="item.deptName" size="small" @click.native="setCookies(item)" :to="{name:'homesteadList'}"style="border-radius: 16px;
  67. box-shadow: 0px 3px 5px 0px rgba(0,0,0,0.16); width:calc( 100% - 40px);margin:20px">
  68. <template #default>
  69. </template>
  70. <template #label>
  71. 开始时间:{{item.planBeginTime}} 结束时间:{{item.planEndTime}}
  72. </template>
  73. <template #icon>
  74. <van-icon name="clock" color="#22b7f2" style="margin-top:10px;margin-right:10px;"/>
  75. </template>
  76. </van-cell>
  77. </div>
  78. <div v-if="active==2" style="height:calc( 100vh - 350px);overflow-y:auto;">
  79. <van-cell v-for=" (item,index) in doneList" :key="index" :title="item.deptName" size="small" :to="{name:'homesteadList',params:{item:item}}" style="border-radius: 16px;
  80. box-shadow: 0px 3px 5px 0px rgba(0,0,0,0.16); width:calc( 100% - 40px);margin:20px">
  81. <template #default>
  82. </template>
  83. <template #label>
  84. 开始时间:{{item.planBeginTime}}
  85. </template>
  86. <template #icon>
  87. <van-icon name="clock" color="#22b7f2" style="margin-top:10px;margin-right:10px;"/>
  88. </template>
  89. </van-cell>
  90. </div>
  91. <div v-if="active==3" style="height:calc( 100vh - 350px);overflow-y:auto;">
  92. <van-cell v-for=" (item,index) in todoList" :key="index" :title="item.deptName" size="small" :to="{name:'homesteadList',params:{item:item}}" style="border-radius: 16px;
  93. box-shadow: 0px 3px 5px 0px rgba(0,0,0,0.16); width:calc( 100% - 40px);margin:20px">
  94. <template #default>
  95. </template>
  96. <template #label>
  97. 开始时间:{{item.planBeginTime}}
  98. </template>
  99. <template #icon>
  100. <van-icon name="clock" color="#22b7f2" style="margin-top:10px;margin-right:10px;"/>
  101. </template>
  102. </van-cell>
  103. </div>
  104. </div>
  105. </template>
  106. <script>
  107. import {addTask, complete, delTask, exportTask, getTask, listTask, publish, updateTask} from "@/api/homesteadSurvey/index";
  108. import {getInfo} from "../../api/login";
  109. // import circleProccess from "@/components/circleProccess.vue";
  110. export default {
  111. name: "homesteadIndex",
  112. components: {
  113. // circleProccess
  114. },
  115. data() {
  116. return {
  117. active: 1,
  118. show: false,
  119. loading: false,
  120. finished: false,
  121. height:200,
  122. phone:null,
  123. activeKey:0,
  124. currentRate: 0,
  125. total:0,
  126. totalList:[],
  127. done:0,
  128. doneList:[],
  129. todo:0,
  130. todoList:[],
  131. // 查询参数
  132. queryParams: {
  133. // 分页
  134. pageNum: 1,
  135. pageSize: 10,
  136. // 查询排序
  137. orderByColumn: "id",
  138. isAsc: "desc",
  139. deptId: null,
  140. deptName: null,
  141. title: null,
  142. createUserId: null,
  143. updateUserId: null,
  144. taskStatus: null,
  145. taskPublishStatus:"PUBLISHED",
  146. },
  147. nickName:"",
  148. text:0,
  149. };
  150. },
  151. mounted(){
  152. // 监听屏幕方向
  153. let self = this;
  154. window.addEventListener(
  155. "onorientationchange" in window ? "orientationchange" : "resize",
  156. function() {
  157. if (window.orientation === 90 || window.orientation === -90) {
  158. // 横屏
  159. }
  160. },
  161. false
  162. );
  163. getInfo().then(response => {
  164. this.nickName = response.user.nickName
  165. });
  166. this.getList();
  167. },
  168. methods: {
  169. setCookies(item){
  170. this.$cookies.set("item",JSON.stringify(item));
  171. },
  172. getList() {
  173. listTask(this.queryParams).then(response => {
  174. this.total = response.total
  175. this.totalList = response.rows
  176. this.done = 0;
  177. this.doneList = [];
  178. this.todo = 0;
  179. this.todoList = [];
  180. response.rows.map(res => {
  181. if(res.taskStatus == "FINISHED"){
  182. this.done+=1
  183. this.doneList.push(res);
  184. }else{
  185. this.todo+=1
  186. this.todoList.push(res);
  187. }
  188. })
  189. });
  190. },
  191. gotoLink(){
  192. this.$router.push('/homesteadSurvey/settle')
  193. },
  194. _isMobile() {
  195. this.phone = navigator.userAgent.match(/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i)
  196. },
  197. },
  198. }
  199. </script>
  200. <style scoped>
  201. >>> .sss {
  202. display: flex;
  203. }
  204. >>> .title:before
  205. {
  206. content:"";
  207. width: 6px;
  208. height: 32px;
  209. background: #7ac943;
  210. border-radius: 3px;
  211. position:absolute;
  212. left:0;
  213. bottom:0;
  214. }
  215. </style>