移动端
Du kannst nicht mehr als 25 Themen auswählen Themen müssen entweder mit einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.
 
 

424 Zeilen
14 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://img.yzcdn.cn/vant/leaf.jpg"
  14. />
  15. </van-col>
  16. <van-col span="14">
  17. <p style="margin-top: 10px;" v-if="businessLevel=='1'">调查员.采集员</p>
  18. <p style="margin-top: 10px;" v-if="businessLevel=='2'">审核员</p>
  19. <p>{{nickName}}</p>
  20. </van-col>
  21. <van-col span="2" style="text-align:center;">
  22. <van-icon name="setting-o" style="margin-top:10px" @click="gotoLink" size="30"/>
  23. </van-col>
  24. </van-row>
  25. </div>
  26. <div style="background:#F5F5F5; padding-top:10px;">
  27. <van-row style="text-align:center;margin:20px;background:#fff;padding:15px;border-radius:15px;">
  28. <van-col span="8">
  29. <van-badge :content="total">
  30. <img
  31. width="50"
  32. height="50"
  33. :src="require('../../assets/images/housesteadSurvey/task1.png')"
  34. @click="active=1,getList()"
  35. />
  36. </van-badge>
  37. <p id="basetext" :style="{color:(active==1?'#7AC943':'#000')}">全部任务</p>
  38. </van-col>
  39. <van-col span="8">
  40. <van-badge :content="done">
  41. <img
  42. width="50"
  43. height="50"
  44. :src="require('../../assets/images/housesteadSurvey/task2.png')"
  45. @click="active=2,getList()"
  46. />
  47. </van-badge>
  48. <p :style="{color:(active==2?'#7AC943':'#000')}">已完成</p>
  49. </van-col>
  50. <van-col span="8" >
  51. <van-badge :content="todo">
  52. <img
  53. width="50"
  54. height="50"
  55. :src="require('../../assets/images/housesteadSurvey/task3.png')"
  56. @click="active=3,getList()"
  57. />
  58. </van-badge>
  59. <p :style="{color:(active==3?'#7AC943':'#000')}">待调查</p>
  60. </van-col>
  61. </van-row>
  62. <div style="margin:20px;">
  63. <p class="title" style="position:relative;padding-left:20px;line-height:32px;">任务列表</p>
  64. </div>
  65. </div>
  66. <div v-if="active==1" style="height:calc( 100vh - 350px);overflow-y:auto;">
  67. <van-pull-refresh v-model="isLoadingtask" @refresh="onRefreshtask" :immediate-check="false">
  68. <van-cell v-for="(item,index) in totalList" :key="item.id" size="small" @click.native="setCookies(item)" style="border-radius: 16px;
  69. box-shadow: 0px 3px 5px 0px rgba(0,0,0,0.16); width:calc( 100% - 40px);margin:20px">
  70. <template #title>
  71. <div>{{item.deptName}}
  72. <p style="float:right">
  73. {{item.confirmZjdzdNumber}}/{{item.reportZjdzdNumber}}
  74. </p>
  75. </div>
  76. </template>
  77. <template #default>
  78. <van-circle
  79. v-model="item.reportZrzNumber"
  80. :rate="item.reportNhNumber"
  81. :stroke-width="100"
  82. :speed="100"
  83. size="100%"
  84. layer-color="#ebedf0"
  85. :color="chooseColor(item)"
  86. :text="item.reportZjdzdNumber!=null?(((item.confirmZjdzdNumber/item.reportZjdzdNumber)*100).toFixed())+'%':0+'%'"
  87. />
  88. </template>
  89. <template #label>
  90. {{item.planBeginTime}}~{{item.planEndTime}}
  91. <br/>
  92. {{taskExecutorChange(item)}}
  93. </template>
  94. <template #icon>
  95. <van-icon name="clock" color="#22b7f2" style="margin-top:10px;margin-right:10px;"/>
  96. </template>
  97. </van-cell>
  98. </van-pull-refresh>
  99. </div>
  100. <div v-if="active==2" style="height:calc( 100vh - 350px);overflow-y:auto;">
  101. <van-pull-refresh v-model="isLoadingtask" @refresh="onRefreshtask">
  102. <van-cell v-for="(item,index) in doneList" :key="item.id" size="small" @click.native="setCookies(item)" style="border-radius: 16px;
  103. box-shadow: 0px 3px 5px 0px rgba(0,0,0,0.16); width:calc( 100% - 40px);margin:20px">
  104. <template #title>
  105. <p style="float:right">{{item.deptName}}
  106. {{item.confirmZjdzdNumber}}/{{item.reportZjdzdNumber}}
  107. </p>
  108. </template>
  109. <template #default>
  110. <van-circle
  111. v-model="item.reportZrzNumber"
  112. :rate="item.reportNhNumber"
  113. :stroke-width="100"
  114. :speed="100"
  115. size="100%"
  116. layer-color="#ebedf0"
  117. :color="chooseColor(item)"
  118. :text="item.reportZjdzdNumber!=null?(((item.confirmZjdzdNumber/item.reportZjdzdNumber)*100).toFixed())+'%':0+'%'"
  119. />
  120. </template>
  121. <template #label>
  122. {{item.planBeginTime}}~{{item.planEndTime}}
  123. <br/>
  124. {{taskExecutorChange(item)}}
  125. </template>
  126. <template #icon>
  127. <van-icon name="clock" color="#22b7f2" style="margin-top:10px;margin-right:10px;"/>
  128. </template>
  129. </van-cell>
  130. </van-pull-refresh>
  131. </div>
  132. <div v-if="active==3" style="height:calc( 100vh - 350px);overflow-y:auto;">
  133. <van-pull-refresh v-model="isLoadingtask" @refresh="onRefreshtask">
  134. <van-cell v-for="(item,index) in todoList" :key="item.id" size="small" @click.native="setCookies(item)" style="border-radius: 16px;
  135. box-shadow: 0px 3px 5px 0px rgba(0,0,0,0.16); width:calc( 100% - 40px);margin:20px">
  136. <template #title>
  137. <div>{{item.deptName}}
  138. <p style="float:right">
  139. {{item.confirmZjdzdNumber}}/{{item.reportZjdzdNumber}}
  140. </p>
  141. </div>
  142. </template>
  143. <template #default>
  144. <van-circle
  145. v-model="item.reportZrzNumber"
  146. :rate="item.reportNhNumber"
  147. :stroke-width="100"
  148. :speed="100"
  149. size="100%"
  150. layer-color="#ebedf0"
  151. :color="chooseColor(item)"
  152. :text="item.reportZjdzdNumber!=null?(((item.confirmZjdzdNumber/item.reportZjdzdNumber)*100).toFixed())+'%':0+'%'"
  153. />
  154. </template>
  155. <template #label>
  156. {{item.planBeginTime}}~{{item.planEndTime}}
  157. <br/>
  158. {{taskExecutorChange(item)}}
  159. </template>
  160. <template #icon>
  161. <van-icon name="clock" color="#22b7f2" style="margin-top:10px;margin-right:10px;"/>
  162. </template>
  163. </van-cell>
  164. </van-pull-refresh>
  165. </div>
  166. </div>
  167. </template>
  168. <script>
  169. import {addTask, complete, delTask, exportTask, getTask, listTask, publish, updateTask, userList} from "@/api/homesteadSurvey/index";
  170. import {getInfo} from "../../api/login";
  171. import CircleProccess from "@/components/circleProccess.vue";
  172. import {updateUserPwd} from "../../api/onlineHome/my";
  173. import {Dialog} from "vant";
  174. import {sysConfig} from "../../api/homesteadSurvey";
  175. import axios from "axios";
  176. export default {
  177. name: "homesteadIndex",
  178. components: {
  179. CircleProccess
  180. },
  181. data() {
  182. return {
  183. currentRate1:0,
  184. currentRate2:0,
  185. currentRate3:0,
  186. active: 1,
  187. show: false,
  188. loading: false,
  189. finished: false,
  190. height:200,
  191. phone:null,
  192. activeKey:0,
  193. currentRate: 0,
  194. total:0,
  195. totalList:[],
  196. done:0,
  197. doneList:[],
  198. todo:0,
  199. todoList:[],
  200. gradientColor:{
  201. },
  202. // 查询参数
  203. queryParams: {
  204. taskStatus: null,
  205. taskPublishStatus:"PUBLISHED",
  206. taskExecutor:null
  207. },
  208. nickName:"",
  209. text:0,
  210. isLoadingtask:false,
  211. countqb:0,
  212. countyhc:0,
  213. countwhc:0,
  214. //宅调人员列表
  215. taskExecutortions:[],
  216. //当前用户级别
  217. businessLevel:1,
  218. // 字典列表json
  219. dictTypeList:null,
  220. };
  221. },
  222. created(){
  223. userList().then(response => {
  224. this.taskExecutortions = response.data
  225. })
  226. getInfo().then(response => {
  227. this.nickName = response.user.nickName
  228. this.businessLevel = response.user.businessLevel
  229. this.$cookies.set("businessLevel",this.businessLevel)
  230. this.queryParams.taskExecutor = response.user.userName
  231. this.getList();
  232. });
  233. axios.get('../static/dictyType.json').then(res => {
  234. this.dictTypeList = res.data
  235. })
  236. },
  237. mounted(){
  238. // 监听屏幕方向
  239. let self = this;
  240. window.addEventListener(
  241. "onorientationchange" in window ? "orientationchange" : "resize",
  242. function() {
  243. if (window.orientation === 90 || window.orientation === -90) {
  244. // 横屏
  245. }
  246. },
  247. false
  248. );
  249. if(this.$cookies.get("url")==null||this.$cookies.get("url")==""){
  250. this.getBaseUrl()
  251. }
  252. },
  253. methods: {
  254. getBaseUrl(){
  255. let params={
  256. configKey: "system.attachment.url"}
  257. sysConfig(params).then(response => {
  258. this.$cookies.set("url",response.rows[0].configValue)
  259. })
  260. },
  261. chooseValue(item){
  262. let a = ((item.confirmZjdzdNumber/item.reportZjdzdNumber)*100).toFixed()
  263. return a
  264. },
  265. chooseColor(item){
  266. let a = ((item.confirmZjdzdNumber/item.reportZjdzdNumber)*100).toFixed()
  267. if(a < 50){
  268. return '#FA5353'
  269. }else if(a < 100){
  270. return '#22B7F2'
  271. }else{
  272. return '#85d824'
  273. }
  274. return '#FA5353'
  275. },
  276. taskExecutorChange(row){
  277. if(row.taskExecutor!=null&&row.taskExecutor!=""&&row.taskExecutor.length>1){
  278. var actions = [];
  279. row.taskExecutor.map(res => {
  280. for(let i = 0;i<this.taskExecutortions.length;i++){
  281. if(res == this.taskExecutortions[i].userName){
  282. actions.push(this.taskExecutortions[i].nickName)
  283. }
  284. }
  285. })
  286. return actions.join(',');
  287. }else{
  288. var actions = [];
  289. Object.keys(this.taskExecutortions).some((key) => {
  290. if (this.taskExecutortions[key].userName == ('' + row.taskExecutor)) {
  291. actions.push(this.taskExecutortions[key].nickName);
  292. return true;
  293. }
  294. })
  295. return actions.join(',');
  296. }
  297. },
  298. onRefreshtask(){
  299. this.isLoadingtask = false;
  300. let _this = this
  301. if(this.active==1){
  302. let params = {
  303. "taskStatus": "FINISHED",
  304. "taskPublishStatus":"PUBLISHED",
  305. "pageNum": this.countyhc+1,
  306. "pageSize":10,
  307. }
  308. listTask(params).then((response) => {
  309. if(response.rows.length>0&&this.doneList.length<response.total){
  310. response.rows.map(res => {
  311. this.doneList.unshift(res)
  312. })
  313. this.countyhc++
  314. }
  315. });
  316. }else if(this.active==2){
  317. let params = {
  318. "taskStatus": "UNFINISHED",
  319. "taskPublishStatus":"PUBLISHED",
  320. "pageNum": this.countwhc+1,
  321. "pageSize":10,
  322. }
  323. listTask(params).then((response) => {
  324. if(response.rows.lenght>0&&this.todoList.length<response.total){
  325. response.rows.map(res => {
  326. this.todoList.unshift(res)
  327. })
  328. this.countwhc++
  329. }
  330. });
  331. }else{
  332. let params = {
  333. "taskPublishStatus":"PUBLISHED",
  334. "pageNum": this.countqb+1,
  335. "pageSize":10,
  336. }
  337. listTask(params).then((response) => {
  338. if(response.rows.length>0&&this.totalList.length<response.total){
  339. response.rows.map(res => {
  340. this.totalList.unshift(res)
  341. })
  342. this.countqb++
  343. }
  344. });
  345. }
  346. },
  347. setCookies(item){
  348. /* if(this.$cookies.get("upload")==null||this.$cookies.get("upload")==0){
  349. Dialog.confirm({
  350. title: '提示',
  351. message: '当前未选择批量上传,可能会由于网络原因上传图片缓慢,是否继续?',
  352. })
  353. .then(() => {
  354. // on confirm
  355. this.$router.push({name:'homesteadList'})
  356. this.$cookies.set("item",JSON.stringify(item));
  357. })
  358. .catch(() => {
  359. // on cancel
  360. });
  361. }else{
  362. this.$router.push({name:'homesteadList'})
  363. this.$cookies.set("item",JSON.stringify(item));
  364. }*/
  365. this.$cookies.set("item","");
  366. this.$cookies.set("item",JSON.stringify(item));
  367. this.$router.push({name:'homesteadList'})
  368. },
  369. getList() {
  370. this.totalList = []
  371. this.doneList = [];
  372. this.todoList = [];
  373. listTask(this.queryParams).then(response => {
  374. this.total = response.total
  375. this.done = 0;
  376. this.todo = 0;
  377. response.rows.map(res => {
  378. if(res.taskStatus == "FINISHED"){
  379. this.done+=1
  380. this.doneList.push(res);
  381. }else{
  382. this.todo+=1
  383. this.todoList.push(res);
  384. }
  385. if(res.taskExecutor!=null&&res.taskExecutor!=''){
  386. res.taskExecutor = res.taskExecutor.split(',')
  387. }
  388. })
  389. this.totalList = response.rows
  390. });
  391. },
  392. gotoLink(){
  393. this.$router.push('/homesteadSurvey/settle')
  394. },
  395. },
  396. }
  397. </script>
  398. <style scoped>
  399. >>> .van-cell__title{
  400. flex:3
  401. }
  402. >>> .sss {
  403. display: flex;
  404. }
  405. >>> .title:before
  406. {
  407. content:"";
  408. width: 6px;
  409. height: 32px;
  410. background: #7ac943;
  411. border-radius: 3px;
  412. position:absolute;
  413. left:0;
  414. bottom:0;
  415. }
  416. </style>