historyConstruction.vue 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271
  1. <template>
  2. <view>
  3. <view class="title-text" style="margin-top: 80rpx;">
  4. 历史施工
  5. </view>
  6. <view :class="(kgName == '展开搜索') ? 'hei_vie2':'hei_vie'">
  7. <view class="justify-content select">
  8. <view class="thirsty gray border" v-for="item in type" :key="item.value"
  9. :class="{active: show === item.value}" @click="active(item),getListAll()">
  10. {{item.name}}
  11. </view>
  12. </view>
  13. <!-- <u-search placeholder="请输入搜索内容" v-model="nameValue" :action-style="{'font-size':'40rpx'}" @custom="getListAll()"></u-search> -->
  14. <view class="inp_vie">
  15. <input type="text" value="" placeholder="小区名称搜索" class="search-text" v-model="areaName"/>
  16. <input type="text" value="" placeholder="楼栋名称搜索" class="search-text" v-model="buildingName"/>
  17. <input type="text" value="" placeholder="单元名称搜索" class="search-text" v-model="unitName"/>
  18. <input type="text" value="" placeholder="房间名称搜索" class="search-text" v-model="houseName"/>
  19. <button @click="getListAll()" class="btn_vie">搜索</button>
  20. </view>
  21. </view>
  22. <view>
  23. <button class="p_zk" @click="p_zk()">{{kgName}}</button>
  24. </view>
  25. <view class="font-forty total">
  26. 合计: <text class="font-fifty-six SourceHanSansCN red">{{total}}</text>
  27. </view>
  28. <view v-for="(item,index) in list" :key="index">
  29. <view @click="gotopage(`/pages/historyConstruction/historyDetail?id=${item.id}`)">
  30. <view class="type">
  31. <view class="justify-content">
  32. <view class="font-forty blue" v-if="item.serviceType != '004'">
  33. 类别:{{item.serviceType}}
  34. </view>
  35. <view class="font-forty blue" v-else>
  36. 类别:安检
  37. </view>
  38. <view class="font-twenty-eight gray">
  39. {{item.time}}
  40. </view>
  41. </view>
  42. <view class="font-thirty-six black" style="margin: 30rpx 0;" v-if="show === '002' || item.serviceType=='正常施工'">
  43. 状态:{{item.status}}
  44. </view>
  45. <view class="font-thirty-six black" style="margin: 30rpx 0;" v-if="show === '002' || item.serviceType=='正常施工'">
  46. 审核意见:
  47. <text class="" v-if="item.reason != null || item.reason != undefined">
  48. {{item.reason}}
  49. </text>
  50. <text class="" v-else>
  51. </text>
  52. </view>
  53. <view class="font-thirty-six black" style="margin: 30rpx 0;">
  54. {{item.house}}
  55. </view>
  56. <button v-if="show === '002' && item.status == '待审核'" style="background-color: #007AFF; color: #FFFFFF;" @click.stop="gotoUpdate(item)">修改</button>
  57. </view>
  58. </view>
  59. </view>
  60. </view>
  61. </template>
  62. <script>
  63. import service from '@/api/index.js'
  64. export default {
  65. data() {
  66. return {
  67. show: '001',
  68. index: 0,
  69. list: [],
  70. type: [],
  71. areaName: '',
  72. buildingName: '',
  73. unitName: '',
  74. houseName: '',
  75. pop: false,
  76. kgName: '展开搜索',
  77. params: {
  78. pageNum: 1,
  79. pageSize: 10,
  80. },
  81. total:0
  82. }
  83. },
  84. onShow() {
  85. // this.show = '001';
  86. this.getListAll();
  87. this.select();
  88. },
  89. onReachBottom() {
  90. this.getNextListFn()
  91. },
  92. onPullDownRefresh() {
  93. this.getListAll();
  94. setTimeout(function () {
  95. uni.stopPullDownRefresh();
  96. }, 1000);
  97. },
  98. methods: {
  99. getListAll() {
  100. service.getListAll({serviceType: this.show,
  101. areaName:this.areaName,
  102. buildingName:this.buildingName,
  103. unitName:this.unitName,
  104. houseName:this.houseName,
  105. pageSize: 10,
  106. pageNum: 1,
  107. }).then(res => {
  108. this.list = res.records;
  109. this.total = res.total || 0;
  110. this.params.pageNum = res.current + 1;
  111. })
  112. },
  113. getNextListFn(){
  114. if (this.list.length < this.total) {
  115. service.getListAll({serviceType: this.show,
  116. areaName:this.areaName,
  117. buildingName:this.buildingName,
  118. unitName:this.unitName,
  119. houseName:this.houseName,
  120. pageSize: this.params.pageSize,
  121. pageNum: this.params.pageNum,
  122. }).then(response => {
  123. this.params.pageNum = response.current + 1
  124. response.records.forEach(item =>{
  125. this.list.push(item)
  126. })
  127. })
  128. }
  129. },
  130. gotopage(url) {
  131. uni.navigateTo({
  132. url
  133. })
  134. },
  135. select() {
  136. service.getDic({dicType: 'service_type'}).then(res => {
  137. // console.log('service_type', res)
  138. const shenhe = {};
  139. shenhe.value='es002';
  140. shenhe.name='不合格';
  141. res.push(shenhe);
  142. this.type = res;
  143. })
  144. },
  145. active(item) {
  146. this.show = item.value;
  147. },
  148. gotoUpdate(item){
  149. uni.navigateTo({
  150. url:`/pages/historyConstruction/updateInfo?id=${item.id}&&house=${item.house}`,
  151. })
  152. },
  153. p_zk(){
  154. if(this.kgName == '收起搜索'){
  155. this.kgName = '展开搜索';
  156. }else{
  157. this.kgName = '收起搜索';
  158. }
  159. }
  160. }
  161. }
  162. </script>
  163. <style lang="scss" scoped>
  164. .select {
  165. margin: 50rpx 20rpx 0;
  166. height: 105px;
  167. display: block;
  168. .border {
  169. width: 48%;
  170. text-align: center;
  171. padding: 20rpx 10rpx;
  172. border-radius: 48rpx;
  173. display: block;
  174. float: left;
  175. border: 2rpx solid #9dc9ff;
  176. margin: 1%;
  177. background: #f5f7ff;
  178. }
  179. }
  180. .active {
  181. background: #3857F3!important;
  182. color: #FFFFFF;
  183. }
  184. .type {
  185. margin: 20rpx;
  186. padding: 20rpx;
  187. background: #FFFFFF;
  188. box-shadow: 0rpx 8rpx 17rpx 0rpx rgba(0, 0, 0, 0.04);
  189. border-radius: 10rpx;
  190. }
  191. .text {
  192. border-left: 15rpx solid #3857F3;
  193. padding-left: 20rpx;
  194. }
  195. .total {
  196. width: 100%;
  197. padding: 40rpx 30rpx;
  198. border: 1rpx solid #727272;
  199. background: #FFFFFF;
  200. }
  201. .active {
  202. background: #3857F3;
  203. color: #FFFFFF;
  204. }
  205. .choose {
  206. text-align: center;
  207. padding: 20rpx;
  208. margin: 30rpx;
  209. color: #FFFFFF;
  210. background: #43CEB1;
  211. border-radius: 64rpx;
  212. }
  213. .search-text{
  214. float: left;
  215. border-style:solid;
  216. border-width: 1rpx;
  217. height: 50rpx;
  218. width: 90%;
  219. border-radius: 24rpx;
  220. }
  221. .inp_vie{
  222. padding: 1% 3.5%;
  223. }
  224. .inp_vie input{
  225. float: none;
  226. width: 98%;
  227. padding-left: 1.5%;
  228. height: 40px;
  229. margin-bottom: 1.5%;
  230. /* border-bottom: 1px solid #ccc!important; */
  231. border: 1px solid #c7c7c7;
  232. border-radius: 5px;
  233. }
  234. .btn_vie{
  235. background: #3857F3;
  236. color: #fff;
  237. }
  238. .btn_vie:active{
  239. background: #0925b3;
  240. }
  241. .p_zk{
  242. height: 40px;
  243. line-height: 40px;
  244. text-align: center;
  245. // background: #eee;
  246. margin: 1% auto;
  247. width: 93%;
  248. font-size: 15px;
  249. }
  250. .hei_vie{
  251. height: 350px;
  252. }
  253. .hei_vie2{
  254. height: 130px!important;
  255. overflow: hidden;
  256. }
  257. </style>