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

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