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

534 lines
19 KiB

  1. <template>
  2. <div class="app-container">
  3. <div style="width: 100%;color:#fff;padding:15px 0;background: linear-gradient(134deg,#7ac943 1%, #22b7f2);">
  4. <div style="width: 95%;margin: 0 auto;display: flex;align-items: center;">
  5. <van-image
  6. width="60"
  7. height="60"
  8. round
  9. src="https://img.yzcdn.cn/vant/leaf.jpg"
  10. />
  11. <div style="margin-left: 15px;">
  12. <p style="margin-top: 10px;font-size: 16px;">{{nickName}}
  13. <span style="font-size: 16px;" v-if="businessLevel=='1'">·调查员</span>
  14. <span style="font-size: 16px;" v-if="businessLevel=='2'">·审核员</span>
  15. </p>
  16. </div>
  17. <van-icon name="setting-o" style="margin-left: auto;" @click="gotoLink" size="25"/>
  18. </div>
  19. </div>
  20. <div style="background:#F5F5F5;width: 95%;margin: 20px auto 0;border-radius: 15px;overflow: hidden;">
  21. <van-grid :column-num="3" :border="false">
  22. <van-grid-item>
  23. <van-badge :content="total">
  24. <img
  25. width="50"
  26. height="50"
  27. :src="require('../../assets/images/housesteadSurvey/task1.png')"
  28. @click="active=1,checkBadge()"
  29. />
  30. </van-badge>
  31. <p id="basetext" :style="{color:(active==1?'#7AC943':'#000'),fontSize:'14px',marginTop:'5px'}">全部任务</p>
  32. </van-grid-item>
  33. <van-grid-item>
  34. <van-badge :content="done">
  35. <img
  36. width="50"
  37. height="50"
  38. :src="require('../../assets/images/housesteadSurvey/task2.png')"
  39. @click="active=2,checkBadge()"
  40. />
  41. </van-badge>
  42. <p :style="{color:(active==2?'#7AC943':'#000'),fontSize:'14px',marginTop:'5px'}">已完成</p>
  43. </van-grid-item>
  44. <van-grid-item>
  45. <van-badge :content="todo">
  46. <img
  47. width="50"
  48. height="50"
  49. :src="require('../../assets/images/housesteadSurvey/task3.png')"
  50. @click="active=3,checkBadge()"
  51. />
  52. </van-badge>
  53. <p :style="{color:(active==3?'#7AC943':'#000'),fontSize:'14px',marginTop:'5px'}">待调查</p>
  54. </van-grid-item>
  55. </van-grid>
  56. </div>
  57. <div style="margin:20px;">
  58. <div style="float:left;font-size: 16px;">任务列表</div>
  59. <div style="float:left;font-size: 16px;margin-left: 25%;">
  60. <span @click="queryAllxz()">{{deptName}}</span>
  61. <div id="dropList" v-if="showDropList" style="width: 28vw; position: absolute; z-index: 99; left: 55%; margin-left: -16vw; border: 1px solid #E2E0E0;" >
  62. <van-cell id="vanCell" v-for="(item, index) in xzList" :key="index" @click="xzChange(item)" style="position: relative; z-index: 999;">
  63. {{item.deptName}}
  64. </van-cell>
  65. </div>
  66. </div>
  67. <div style="float:right;font-size: 16px;">
  68. <van-checkbox v-model="checked" @change="checkChange">仅我</van-checkbox>
  69. </div>
  70. </div>
  71. <div v-if="active==1" style="height:calc( 100vh - 350px);margin-top: 14%;overflow-y:auto;">
  72. <van-list
  73. v-model:loading="loading"
  74. :finished="finished"
  75. finished-text="没有更多了"
  76. :immediate-check="false"
  77. @load="onRefreshtask"
  78. >
  79. <van-cell v-for="(item,index) in totalList" :key="item.id" size="small" @click.native="setCookies(item)" style="border-radius: 16px;
  80. box-shadow: 0px 3px 5px 0px rgba(0,0,0,0.16); width:95%;margin:0px auto 20px;height: 110px;">
  81. <template #title>
  82. <div>{{item.rwmc}} <span :style="{'color':chooseColor(item),'background':chooseColor2(item),'display':'inline-block','padding':'4px 2px','line-height':'1','border-radius':'5px'}">{{item.zjdwcsl}}/{{item.zjdsl}}</span></div>
  83. </template>
  84. <template #default>
  85. <van-circle
  86. v-model="item.reportZrzNumber"
  87. :rate="item.reportNhNumber"
  88. :stroke-width="100"
  89. :speed="100"
  90. size="70%"
  91. layer-color="#ebedf0"
  92. :color="chooseColor(item)"
  93. :text="item.zjdwcsl!=0?(item.zjdwcsl == item.zjdsl?100+'%':(((item.zjdwcsl/item.zjdsl)*100).toFixed(2))+'%'):0+'%'"
  94. />
  95. </template>
  96. <template #label>
  97. <p style="display: flex;align-items: center;margin-top: 5px;"><van-icon name="clock" color="#22b7f2" style="margin-right:5px;"/>{{item.jhkssj}}~{{item.jhjssj}}</p>
  98. <p style="display: flex;align-items: center;margin-top: 5px;"><van-icon name="manager" color="#22b7f2" style="margin-right:5px;"/>{{item.rwzxr}}</p>
  99. </template>
  100. </van-cell>
  101. </van-list>
  102. </div>
  103. <div v-if="active==2" style="height:calc( 100vh - 350px);margin-top: 14%;overflow-y:auto;">
  104. <van-list
  105. v-model:loading="loading"
  106. :finished="finished"
  107. finished-text="没有更多了"
  108. :immediate-check="false"
  109. @load="onRefreshtask"
  110. >
  111. <van-cell v-for="(item,index) in doneList" :key="item.id" size="small" @click.native="setCookies(item)" style="border-radius: 16px;
  112. box-shadow: 0px 3px 5px 0px rgba(0,0,0,0.16); width:95%;margin:0px auto 20px;height: 110px;">
  113. <template #title>
  114. <div>{{item.rwmc}} <span :style="{'color':chooseColor(item),'background':chooseColor2(item),'display':'inline-block','padding':'4px 2px','line-height':'1','border-radius':'5px'}">{{item.zjdwcsl}}/{{item.zjdsl}}</span></div>
  115. </template>
  116. <template #default>
  117. <van-circle
  118. v-model="item.reportZrzNumber"
  119. :rate="item.reportNhNumber"
  120. :stroke-width="100"
  121. :speed="100"
  122. size="70%"
  123. layer-color="#ebedf0"
  124. :color="chooseColor(item)"
  125. :text="item.zjdwcsl!=0?(item.zjdwcsl == item.zjdsl?100+'%':(((item.zjdwcsl/item.zjdsl)*100).toFixed(2))+'%'):0+'%'"
  126. />
  127. </template>
  128. <template #label>
  129. <p style="display: flex;align-items: center;margin-top: 5px;"><van-icon name="clock" color="#22b7f2" style="margin-right:5px;"/>{{item.jhkssj}}~{{item.jhjssj}}</p>
  130. <p style="display: flex;align-items: center;margin-top: 5px;"><van-icon name="manager" color="#22b7f2" style="margin-right:5px;"/>{{item.rwzxr}}</p>
  131. </template>
  132. </van-cell>
  133. </van-list>
  134. </div>
  135. <div v-if="active==3" style="height:calc( 100vh - 350px);margin-top: 14%;overflow-y:auto;">
  136. <van-list
  137. v-model:loading="loading"
  138. :finished="finished"
  139. finished-text="没有更多了"
  140. :immediate-check="false"
  141. @load="onRefreshtask"
  142. >
  143. <van-cell v-for="(item,index) in todoList" :key="item.id" size="small" @click.native="setCookies(item)" style="border-radius: 16px;
  144. box-shadow: 0px 3px 5px 0px rgba(0,0,0,0.16); width:95%;margin:0px auto 20px;height: 110px;">
  145. <template #title>
  146. <div>{{item.rwmc}} <span :style="{'color':chooseColor(item),'background':chooseColor2(item),'display':'inline-block','padding':'4px 2px','line-height':'1','border-radius':'5px'}">{{item.zjdwcsl}}/{{item.zjdsl}}</span></div>
  147. </template>
  148. <template #default>
  149. <van-circle
  150. v-model="item.reportZrzNumber"
  151. :rate="item.reportNhNumber"
  152. :stroke-width="100"
  153. :speed="100"
  154. size="70%"
  155. layer-color="#ebedf0"
  156. :color="chooseColor(item)"
  157. :text="item.zjdwcsl!=0?(item.zjdwcsl == item.zjdsl?100+'%':(((item.zjdwcsl/item.zjdsl)*100).toFixed(2))+'%'):0+'%'"
  158. />
  159. </template>
  160. <template #label>
  161. <p style="display: flex;align-items: center;margin-top: 5px;"><van-icon name="clock" color="#22b7f2" style="margin-right:5px;"/>{{item.jhkssj}}~{{item.jhjssj}}</p>
  162. <p style="display: flex;align-items: center;margin-top: 5px;"><van-icon name="manager" color="#22b7f2" style="margin-right:5px;"/>{{item.rwzxr}}</p>
  163. </template>
  164. </van-cell>
  165. </van-list>
  166. </div>
  167. </div>
  168. </template>
  169. <script>
  170. import {listTask,mobileList,getTownInfo, publish, updateTask, userList} from "@/api/homesteadSurvey/index";
  171. import {changeDept} from "@/api/homesteadSurvey/zjdzd";
  172. import {getInfo} from "../../api/login";
  173. import CircleProccess from "@/components/circleProccess.vue";
  174. import {updateUserPwd} from "../../api/onlineHome/my";
  175. import {Dialog} from "vant";
  176. import {sysConfig} from "../../api/homesteadSurvey";
  177. import axios from "axios";
  178. export default {
  179. name: "homesteadIndex",
  180. components: {
  181. CircleProccess
  182. },
  183. data() {
  184. return {
  185. currentRate1:0,
  186. currentRate2:0,
  187. currentRate3:0,
  188. active: 1,
  189. show: false,
  190. loading: false,
  191. finished: false,
  192. checked:true,
  193. height:200,
  194. phone:null,
  195. activeKey:0,
  196. currentRate: 0,
  197. deptName:"全部乡镇",
  198. showDropList:false,
  199. total:0,
  200. totalList:[],
  201. xzList:[],
  202. done:0,
  203. doneList:[],
  204. todo:0,
  205. todoList:[],
  206. gradientColor:{
  207. },
  208. // 查询参数
  209. queryParams: {
  210. rwwczt: null,
  211. rwfbzt:"PUBLISHED",
  212. rwzxr:null
  213. },
  214. nickName:"",
  215. text:0,
  216. isLoadingtask:false,
  217. countqb:1,
  218. countyhc:1,
  219. countwhc:1,
  220. //当前用户级别
  221. businessLevel:1,
  222. // 字典列表json
  223. dictTypeList:null,
  224. };
  225. },
  226. created(){
  227. if(this.checked){
  228. setTimeout(() => {
  229. let userId = this.$store.state.user.userId;
  230. console.info(userId);
  231. this.nickName = this.$store.state.user.nickName;
  232. this.$set(this.queryParams, "rwzxr", userId);
  233. this.$set(this.queryParams, "params", {deptId:100});
  234. this.getList();
  235. },1000)
  236. }else{
  237. this.$set(this.queryParams, "rwzxr", null);
  238. this.getList();
  239. }
  240. getTownInfo(100).then(response => {
  241. this.xzList = response.data
  242. let qbxz = {deptId:100,deptName:"全部乡镇"}
  243. this.xzList.unshift(qbxz);
  244. })
  245. axios.get('../static/dictyType.json').then(res => {
  246. this.dictTypeList = res.data
  247. })
  248. },
  249. mounted(){
  250. // 监听屏幕方向
  251. let self = this;
  252. window.addEventListener(
  253. "onorientationchange" in window ? "orientationchange" : "resize",
  254. function() {
  255. if (window.orientation === 90 || window.orientation === -90) {
  256. // 横屏
  257. }
  258. },
  259. false
  260. );
  261. if(this.$cookies.get("url")==null||this.$cookies.get("url")==""){
  262. this.getBaseUrl()
  263. }
  264. },
  265. methods: {
  266. getBaseUrl(){
  267. let params={
  268. configKey: "system.attachment.url"}
  269. sysConfig(params).then(response => {
  270. this.$cookies.set("url",response.rows[0].configValue)
  271. })
  272. },
  273. qiehuan(deptId){
  274. changeDept(deptId).then(response => {
  275. this.$router.push({name:'homesteadList'})
  276. });
  277. },
  278. chooseValue(item){
  279. let a = ((item.confirmZjdzdNumber/item.reportZjdzdNumber)*100).toFixed()
  280. return a
  281. },
  282. chooseColor(item){
  283. let a = ((item.confirmZjdzdNumber/item.reportZjdzdNumber)*100).toFixed()
  284. if(a < 50){
  285. return '#FA5353'
  286. }else if(a < 100){
  287. return '#22B7F2'
  288. }else{
  289. return '#85d824'
  290. }
  291. return '#FA5353'
  292. },
  293. chooseColor2(item){
  294. let a = ((item.confirmZjdzdNumber/item.reportZjdzdNumber)*100).toFixed()
  295. if(a < 50){
  296. return 'rgba(250,83,83,0.22)'
  297. }else if(a < 100){
  298. return 'rgba(34,183,242,0.22)'
  299. }else{
  300. return 'rgba(122,201,67,0.22)'
  301. }
  302. return '#FA5353'
  303. },
  304. onRefreshtask(){
  305. this.isLoadingtask = false;
  306. let _this = this
  307. if(this.active==1 && this.loading ){
  308. let params = {
  309. "rwfbzt":"PUBLISHED",
  310. "params":this.queryParams.params,
  311. "parentId":this.queryParams.parentId,
  312. "pageNum": this.countyhc+1,
  313. "pageSize":4,
  314. }
  315. if(this.queryParams.rwzxr != null){
  316. params.rwzxr = this.queryParams.rwzxr;
  317. }
  318. listTask(params).then((response) => {
  319. if(response.rows.length>0&&this.totalList.length<response.total){
  320. response.rows.map(res => {
  321. this.totalList.push(res)
  322. })
  323. this.countyhc++
  324. this.loading = false;
  325. }else{
  326. this.finished = true;
  327. }
  328. });
  329. }else if(this.active==2 && this.loading){
  330. let params = {
  331. "rwwczt": "PUBLISHED",
  332. "rwfbzt":"PUBLISHED",
  333. "params":this.queryParams.params,
  334. "parentId":this.queryParams.parentId,
  335. "pageNum": this.countwhc+1,
  336. "pageSize":4,
  337. }
  338. if(this.queryParams.rwzxr != null){
  339. params.rwzxr = this.queryParams.rwzxr;
  340. }
  341. listTask(params).then((response) => {
  342. if(response.rows.lenght>0&&this.doneList.length<response.total){
  343. response.rows.map(res => {
  344. this.doneList.push(res)
  345. })
  346. this.countwhc++
  347. this.loading = false;
  348. }else{
  349. this.finished = true;
  350. }
  351. });
  352. }else if(this.active==3 && this.loading){
  353. let params = {
  354. "rwwczt": "UNFINISHED",
  355. "rwfbzt":"PUBLISHED",
  356. "params":this.queryParams.params,
  357. "parentId":this.queryParams.parentId,
  358. "pageNum": this.countqb+1,
  359. "pageSize":4,
  360. }
  361. if(this.queryParams.rwzxr != null){
  362. params.rwzxr = this.queryParams.rwzxr;
  363. }
  364. listTask(params).then((response) => {
  365. if(response.rows.length>0&&this.todoList.length<response.total){
  366. response.rows.map(res => {
  367. this.todoList.push(res)
  368. })
  369. this.countqb++
  370. this.loading = false;
  371. }else{
  372. this.finished = true
  373. }
  374. });
  375. }
  376. },
  377. checkChange(e){
  378. if(e){
  379. let userId = this.$store.state.user.userId;
  380. this.$set(this.queryParams, "rwzxr", userId);
  381. this.getList();
  382. }else{
  383. this.$set(this.queryParams, "rwzxr", null);
  384. this.getList();
  385. }
  386. },
  387. setCookies(item){
  388. /* if(this.$cookies.get("upload")==null||this.$cookies.get("upload")==0){
  389. Dialog.confirm({
  390. title: '提示',
  391. message: '当前未选择批量上传,可能会由于网络原因上传图片缓慢,是否继续?',
  392. })
  393. .then(() => {
  394. // on confirm
  395. this.$router.push({name:'homesteadList'})
  396. this.$cookies.set("item",JSON.stringify(item));
  397. })
  398. .catch(() => {
  399. // on cancel
  400. });
  401. }else{
  402. this.$router.push({name:'homesteadList'})
  403. this.$cookies.set("item",JSON.stringify(item));
  404. }*/
  405. let userId = this.$store.state.user.userId;
  406. // let businessLevel = this.$store.getters.businessLevel;
  407. let status = false;
  408. if(item.rwzxrIds != null && item.rwzxrIds !== ""){
  409. let ids = item.rwzxrIds.split(",");
  410. ids.forEach(function(id){
  411. if(userId === parseInt(id)){
  412. status = true;
  413. }
  414. });
  415. }
  416. if(status){
  417. localStorage.setItem("surveyItem",JSON.stringify(item));
  418. this.qiehuan(item.deptId);
  419. }else{
  420. this.$dialog.alert({
  421. message: "没有该任务的调查权限!",
  422. });
  423. }
  424. },
  425. queryAllxz(){
  426. if (this.showDropList) {
  427. this.showDropList = false; // div显示会阻挡下边的选择框和输入框,showDropList控制下拉框是否显示
  428. } else {
  429. this.showDropList = true;
  430. }
  431. },
  432. xzChange(val){
  433. this.deptName = val.deptName;
  434. this.showDropList = false;
  435. this.$set(this.queryParams, "deptId", null);
  436. if(val.deptId != 100){
  437. this.$set(this.queryParams, "parentId", val.deptId);
  438. this.$set(this.queryParams, "params", {deptId:null});
  439. }else{
  440. this.$set(this.queryParams, "parentId", null);
  441. this.$set(this.queryParams, "params", {deptId:val.deptId});
  442. }
  443. this.getList();
  444. },
  445. checkBadge(){
  446. this.finished = false;
  447. this.loading = false;
  448. this.totalList = []
  449. this.doneList = [];
  450. this.todoList = [];
  451. this.getList();
  452. },
  453. getList() {
  454. this.totalList = []
  455. this.doneList = [];
  456. this.todoList = [];
  457. this.countqb = 1;
  458. this.countyhc = 1;
  459. this.countwhc = 1;
  460. this.finished = false;
  461. this.loading = false;
  462. if(this.active==1) {
  463. this.$set(this.queryParams, "rwfbzt", "PUBLISHED");
  464. this.$set(this.queryParams, "rwwczt", null);
  465. this.$set(this.queryParams, "pageNum", this.countyhc);
  466. this.$set(this.queryParams, "pageSize", 4);
  467. mobileList(this.queryParams).then(response => {
  468. this.done = response.wcs;
  469. this.todo = response.dcs;
  470. this.total = response.tableDataInfo.total;
  471. this.totalList = response.tableDataInfo.rows;
  472. });
  473. }else if(this.active==2) {
  474. this.$set(this.queryParams, "rwwczt", "FINISHED");
  475. this.$set(this.queryParams, "rwfbzt", "PUBLISHED");
  476. this.$set(this.queryParams, "pageNum", this.countwhc);
  477. mobileList(this.queryParams).then(response => {
  478. this.total = response.wcs;
  479. this.todo = response.dcs;
  480. this.done = response.tableDataInfo.total;
  481. this.doneList = response.tableDataInfo.rows;
  482. });
  483. }else{
  484. this.$set(this.queryParams, "rwwczt", "UNFINISHED");
  485. this.$set(this.queryParams, "rwfbzt", "PUBLISHED");
  486. this.$set(this.queryParams, "pageNum", this.countqb);
  487. mobileList(this.queryParams).then(response => {
  488. this.total = response.wcs;
  489. this.done = response.dcs;
  490. this.todo = response.tableDataInfo.total;
  491. this.todoList = response.tableDataInfo.rows;
  492. });
  493. }
  494. },
  495. gotoLink(){
  496. this.$router.push('/homesteadSurvey/settle')
  497. },
  498. },
  499. }
  500. </script>
  501. <style scoped>
  502. >>> .van-cell__title{
  503. flex:3
  504. }
  505. >>> .sss {
  506. display: flex;
  507. }
  508. >>> .title:before
  509. {
  510. content:"";
  511. width: 6px;
  512. height: 20PX;
  513. background: #7ac943;
  514. border-radius: 3px;
  515. position:absolute;
  516. left:0;
  517. bottom:0;
  518. }
  519. </style>