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

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