listProject.vue 10 KB

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