listProject.vue 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425
  1. <template>
  2. <view>
  3. <image src="https://cczdsz.cn/app/images//background.png" mode="" class="background"></image>
  4. <view class="" style="padding-top: 0rpx;">
  5. <!-- <back></back> -->
  6. </view>
  7. <view >
  8. <u-grid :col="3" style="font-size: 12px;">
  9. <u-grid-item @click="getProjectList(index1)" v-for="(item, index1) in viewList" :bg-color="index1==index ? '#6aabff':''" :index="index1">
  10. <image :src="item.src" mode="" style="height: 80rpx;width: 80rpx;"></image>
  11. <view class="grid-text">{{item.name}}</view>
  12. </u-grid-item>
  13. </u-grid>
  14. <view>
  15. <u-search placeholder="请输入搜索内容" v-model="value1" shape="square" :show-action="false" :action-style="{'font-size':'40rpx'}" @search="gethosList()"></u-search>
  16. </view>
  17. <view v-for="(item,index) in list" :key="index" >
  18. <view class="project-content" @click="gotoindex(item)">
  19. <view>
  20. <view class="font-forty-eight blue">
  21. 项目名称:{{item.name}}
  22. </view>
  23. <view class="font-forty-eight blue">
  24. 审核状态: {{item.processStatus == '0' ? '队长审批通过,处事未审批' : (item.processStatus == '1' ? '通过' : (item.processStatus == '2' ? '不通过' : '未审批' ) ) }}
  25. </view>
  26. <view class="font-forty-eight blue">
  27. 项目时间:{{item.time || item.createTime}}
  28. </view>
  29. </view>
  30. </view>
  31. </view>
  32. </view>
  33. </view>
  34. </template>
  35. <script>
  36. import service from '@/api/index.js'
  37. export default {
  38. data() {
  39. return {
  40. list:[],
  41. value:'',
  42. value1:'',
  43. nameValue:'',
  44. civilPower:'',
  45. userId:'',
  46. index:-1,
  47. ReachBottom:true,
  48. page:1,
  49. viewList:[
  50. {name:'抢险维修',src:'https://cczdsz.cn/app/images/qxwx.png'},
  51. {name:'调压箱管理',src:'https://cczdsz.cn/app/images/xxdy.png'},
  52. {name:'庭院管网',src:'https://cczdsz.cn/app/images/tywg.png'},
  53. {name:'路段巡查',src:'https://cczdsz.cn/app/images/luduan.png'},
  54. {name:'阀井巡查',src:'https://cczdsz.cn/app/images/fajing.png'},
  55. {name:'输配站',src:'https://cczdsz.cn/app/images/spzxc.png'},
  56. {name:'巡检车队',src:'https://cczdsz.cn/app/images/xjcd.png'},
  57. {name:'调压箱维护',src:'https://cczdsz.cn/app/images/xxdy.png'},
  58. {name:'非居民巡查',src:'https://cczdsz.cn/app/images/fjm.png'}]
  59. }
  60. },
  61. onLoad(e) {
  62. console.log(e)
  63. this.nameValue = e.nameValue
  64. //this.getProjectList();
  65. this.getUserName();
  66. uni.setNavigationBarTitle({
  67. title: '历史记录',
  68. });
  69. uni.setNavigationBarColor({
  70. frontColor: '#ffffff',
  71. backgroundColor: '#2d95f4',
  72. })
  73. },
  74. onTabItemTap(e)
  75. {
  76. console.log(e)
  77. uni.removeStorageSync('type')
  78. },
  79. onReachBottom(){
  80. console.log('触底')
  81. this.getReachBottom()
  82. },
  83. onPullDownRefresh()
  84. {
  85. console.log('下拉刷新')
  86. this.getvalueproject()
  87. },
  88. methods: {
  89. getReachBottom()
  90. {
  91. if (this.ReachBottom) {
  92. this.page+=1
  93. this.getvalueproject()
  94. }else
  95. {
  96. this.page=1
  97. this.ReachBottom=false
  98. }
  99. },
  100. gotoindex(item){
  101. console.log(item)
  102. if(this.index==1)
  103. {//调压箱
  104. console.log(item)
  105. uni.navigateTo({
  106. url: `/pages/noLogin/PressureRegulatingBox/PressureRegulatingBox?type=1&id=${item.id}`
  107. })
  108. }else if(this.index==2)
  109. {//庭院管理
  110. uni.navigateTo({
  111. url: `/pages/noLogin/CourtyardNetworkManagement/CourtyardNetworkManagement?type=1&id=${item.id}`
  112. })
  113. }else if(this.index==0)
  114. {//抢险维修
  115. uni.navigateTo({
  116. url: `/pages/noLogin/emergencyRepairOrder/emergencyRepairOrder?type=1&id=${item.id}`
  117. })
  118. }else if(this.index==3)
  119. {//路段
  120. console.log(item)
  121. let url1= `/pages/noLogin/roadSection/roadSection?type=1&id=${item.id}`
  122. uni.navigateTo({
  123. url: url1
  124. })
  125. }
  126. else if(this.index==4)
  127. {//阀井巡查
  128. console.log(item)
  129. let url1= `/pages/noLogin/valveWellInspection/valveWellInspection?type=1&id=${item.id}`
  130. uni.navigateTo({
  131. url: url1
  132. })
  133. }else if(this.index==5)
  134. {//输配站
  135. console.log(item)
  136. let url1= `/pages/noLogin/LNGStation/LNGStation?type=1&id=${item.id}`
  137. uni.navigateTo({
  138. url: url1
  139. })
  140. }
  141. else if(this.index==6)
  142. {//巡检车队
  143. console.log(item)
  144. let url1= `/pages/noLogin/patrolFleet/patrolFleet?type=1&id=${item.id}&name=${item.name}`
  145. uni.navigateTo({
  146. url: url1
  147. })
  148. }
  149. else if(this.index==7)
  150. {//调压箱维护
  151. console.log(item)
  152. let url1= `/pages/noLogin/GRegulatingBoxMaintenance/GRegulatingBoxMaintenance?type=1&id=${item.id}`
  153. uni.navigateTo({
  154. url: url1
  155. })
  156. }
  157. else if(this.index==8)
  158. {//非居民巡查
  159. console.log(item)
  160. let url1= `/pages/noLogin/PipelineGasUser/PipelineGasUser?type=1&id=${item.id}`
  161. uni.navigateTo({
  162. url: url1
  163. })
  164. }
  165. // uni.switchTab({
  166. // url:'/pages/index/index'
  167. // })
  168. },
  169. topage(url){
  170. uni.navigateTo({
  171. url
  172. })
  173. },
  174. getvalueproject()
  175. {
  176. service.getSearch({type:this.index,userId:this.userId,page:this.page,size:10,value:this.value1}).then(res=>{
  177. console.log('getProjectType', res)
  178. if(null==res){
  179. //this.$UTILS.showPrompt('暂无历史记录!')
  180. return
  181. }
  182. let list1=[]
  183. list1=res
  184. this.list.push(...list1)
  185. // list1.forEach(item=>{
  186. // this.list.push(item)
  187. // })
  188. //this.list = res;
  189. })
  190. },
  191. gethosList()
  192. {
  193. service.getSearch({type:this.index,userId:this.userId,page:this.page,size:10,value:this.value1}).then(res=>{
  194. console.log('getProjectType', res)
  195. if(res.length == 0){
  196. this.list=[]
  197. this.$UTILS.showPrompt('暂无历史记录!')
  198. return
  199. }
  200. let list1=[]
  201. list1=res
  202. list1.forEach(item=>{
  203. this.list.push(item)
  204. })
  205. this.list = res;
  206. })
  207. },
  208. getProjectList(val) {
  209. this.page=1
  210. this.value1=''
  211. this.ReachBottom=true
  212. console.log(val,'11111111')
  213. if(val==this.index)
  214. {
  215. this.index=-1
  216. return
  217. }
  218. this.index=val
  219. this.list=[]
  220. if(val==3)
  221. {
  222. service.getroadSectionInspectionList({discoverProblems:this.value1,userId:this.userId,createBy:this.userId}).then(res=>{
  223. console.log('getProjectType', res)
  224. if(res.length == 0){
  225. this.$UTILS.showPrompt('暂无历史记录!')
  226. return
  227. }
  228. let list1=[]
  229. list1=res
  230. list1.forEach(item=>{
  231. item.type=3
  232. item.name=item.sectionName
  233. item.time=item.findTime
  234. this.list.push(item)
  235. })
  236. })
  237. }else if(val==4)
  238. {
  239. service.getvalveWellPositionList({discoverProblems:this.value1,userId:this.userId,createBy:this.userId,pageNum:this.page,pageSize:10}).then(res=>{
  240. console.log('getProjectType', res)
  241. if(res.length == 0){
  242. this.$UTILS.showPrompt('暂无历史记录!')
  243. return
  244. }
  245. let list1=[]
  246. list1=res
  247. list1.forEach(item=>{
  248. item.type=4
  249. item.name=item.valveWellName
  250. item.time=item.createTime
  251. this.list.push(item)
  252. })
  253. })
  254. }
  255. else if(val==5)
  256. {
  257. service.gettransmissionStationList({name:this.value1,userId:this.userId,createBy:this.userId}).then(res=>{
  258. console.log('getProjectType', res)
  259. if(res.length == 0){
  260. this.$UTILS.showPrompt('暂无历史记录!')
  261. return
  262. }
  263. let list1=[]
  264. list1=res.rows
  265. list1.forEach(item=>{
  266. item.type=5
  267. item.name=item.name
  268. item.time=item.createTime
  269. this.list.push(item)
  270. })
  271. })
  272. }else if(val==6)
  273. {
  274. service.getpatrolTeamList({name:this.value1,userId:this.userId,createBy:this.userId}).then(res=>{
  275. console.log('getProjectType', res)
  276. if(res.length == 0){
  277. this.$UTILS.showPrompt('暂无历史记录!')
  278. return
  279. }
  280. let list1=[]
  281. list1=res.rows
  282. service.getDictInfoList({
  283. type: ['team']
  284. }).then(res2 => {
  285. let teamName=[]
  286. teamName=res2.team
  287. list1.forEach(item=>{
  288. item.type=6
  289. item.name=teamName.filter(item2=>item2.dictValue==item.team)[0].dictLabel
  290. item.time=item.createTime
  291. this.list.push(item)
  292. })
  293. })
  294. })
  295. }
  296. else if(val==7)
  297. {
  298. service.getregulatingBoxMaintenanceList({name:this.value1,userId:this.userId,createBy:this.userId}).then(res=>{
  299. console.log('getProjectType', res)
  300. if(res.length == 0){
  301. this.$UTILS.showPrompt('暂无历史记录!')
  302. return
  303. }
  304. let list1=[]
  305. list1=res.rows
  306. list1.forEach(item=>{
  307. item.type=7
  308. item.name=item.name
  309. item.time=item.createTime
  310. this.list.push(item)
  311. })
  312. })
  313. }
  314. else if(val==8)
  315. {
  316. service.getpipelineGasUserList({name:this.value1,userId:this.userId,createBy:this.userId}).then(res=>{
  317. console.log('getProjectType', res)
  318. if(res.length == 0){
  319. this.$UTILS.showPrompt('暂无历史记录!')
  320. return
  321. }
  322. let list1=[]
  323. list1=res.rows
  324. list1.forEach(item=>{
  325. item.type=8
  326. item.name=item.userName
  327. item.time=item.securityCheckTime
  328. this.list.push(item)
  329. })
  330. })
  331. }
  332. else
  333. {
  334. service.getSearch({type:val,userId:this.userId,page:this.page,size:10,value:this.value1}).then(res=>{
  335. console.log('getProjectType', res)
  336. if(res.length == 0){
  337. this.$UTILS.showPrompt('暂无历史记录!')
  338. return
  339. }
  340. let list1=[]
  341. list1=res
  342. list1.forEach(item=>{
  343. if(item.type==1)
  344. {
  345. item.typeValue='调压箱'
  346. }else if(item.type==2)
  347. {
  348. item.typeValue='庭院管网'
  349. }
  350. else if(item.type==3)
  351. {
  352. item.typeValue='抢险维修'
  353. }else if(item.type==4)
  354. {
  355. item.typeValue='警示桩'
  356. }
  357. this.list.push(item)
  358. })
  359. //this.list = res;
  360. })
  361. }
  362. },
  363. getUserName(){
  364. service.getUserName().then(res=>{
  365. this.userId=res.id
  366. this.civilPower = res.civilPower;
  367. })
  368. },
  369. },
  370. }
  371. </script>
  372. <style lang="scss" scoped>
  373. .background {
  374. z-index: -1;
  375. position: fixed;
  376. width: 100%;
  377. height: 100%;
  378. background-size: 100% 100%;
  379. }
  380. .project {
  381. border-radius: 72rpx;
  382. padding: 25rpx 0;
  383. text-align: center;
  384. margin: 170rpx 55rpx 0;
  385. }
  386. .project-content {
  387. border: 4rpx solid #3857F3;
  388. margin: 40rpx 55rpx 0;
  389. padding: 30rpx 20rpx;
  390. border-radius: 48rpx;
  391. }
  392. .position{
  393. position: absolute;
  394. bottom: 100rpx;
  395. right: 50rpx;
  396. .arrow{
  397. width: 152rpx;
  398. height: 152rpx;
  399. border-radius: 50%;
  400. padding: 25rpx;
  401. margin-left: 20rpx;
  402. }
  403. }
  404. </style>