qualityInspection.vue 9.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303
  1. <template>
  2. <scroll-view scroll-y class="nav hc-qualityInspection-view" @scrolltolower="getList" style="height: 100vh;">
  3. <cu-custom bgColor="bg-blue1" :isBack="true">
  4. <block slot="backText"></block>
  5. <block slot="content">质量巡检</block>
  6. </cu-custom>
  7. <view class="page-bg-bar"/>
  8. <view class="cu-bar hc-search-bar">
  9. <view class="action">
  10. <uni-data-select class="action-data-select" v-model="searchForm.engineeringType" :localdata="typeData"/>
  11. </view>
  12. <view class="action">
  13. <uni-datetime-picker class="action-date-picker" v-model="pickerRange" type="daterange" @change="searchDateChange"/>
  14. </view>
  15. <view class="action">
  16. <button class="cu-btn bg-white">搜索</button>
  17. </view>
  18. </view>
  19. <!--列表-->
  20. <view class="hc-content-zindex">
  21. <view class="hc-data-card" @click="itemInfoTap">
  22. <view class="title-box">
  23. <view class="title">工程名称</view>
  24. <view class="date">2023-07-12</view>
  25. </view>
  26. <view class="name-bar">长安互通左幅1号桥</view>
  27. <view class="content-box">
  28. <view class="title">分部工程类别:</view>
  29. <view class="name">下部结构</view>
  30. <view class="right-icons">
  31. <uni-icons type="right" size="22" color="#858585"/>
  32. </view>
  33. <view class="tag-text">
  34. <view class="text-bar">
  35. <text class="type">病害类型:</text>
  36. <text class="text">模板未清理</text>
  37. </view>
  38. <view class="text-bar">
  39. <text class="type">严重程度:</text>
  40. <text class="text">轻微</text>
  41. </view>
  42. </view>
  43. </view>
  44. <view class="action">
  45. <button class="cu-btn bg-grey">已撤</button>
  46. </view>
  47. </view>
  48. <view class="hc-data-card">
  49. <view class="title-box">
  50. <view class="title">工程名称</view>
  51. <view class="date">2023-07-12</view>
  52. </view>
  53. <view class="name-bar">长安互通左幅1号桥</view>
  54. <view class="content-box">
  55. <view class="title">分部工程类别:</view>
  56. <view class="name">下部结构</view>
  57. <view class="right-icons">
  58. <uni-icons type="right" size="22" color="#858585"/>
  59. </view>
  60. <view class="tag-text">
  61. <view class="text-bar">
  62. <text class="type">病害类型:</text>
  63. <text class="text">模板未清理</text>
  64. </view>
  65. <view class="text-bar">
  66. <text class="type">严重程度:</text>
  67. <text class="text">轻微</text>
  68. </view>
  69. </view>
  70. </view>
  71. <view class="action">
  72. <button class="cu-btn bg-blue1" @click.stop="revocationTap">撤回</button>
  73. </view>
  74. </view>
  75. </view>
  76. <!--底部按钮-->
  77. <view style="height: 174rpx;"/>
  78. <view class="fixed-bottom">
  79. <button type="primary" @click="newRecordTap">新增记录</button>
  80. </view>
  81. </scroll-view>
  82. </template>
  83. <script>
  84. export default {
  85. data() {
  86. return {
  87. title: "质量巡检",
  88. searchForm: {
  89. engineeringType: 1,
  90. startDate: '',
  91. endDate: '',
  92. diseaseType: '',
  93. severity: '',
  94. defectType: '',
  95. type: '',
  96. status: '',
  97. cs:1,
  98. pageSize:15,
  99. },
  100. page: 0,
  101. totalPage: 999,
  102. userid: null,
  103. project: null,
  104. qualityModifyInfoID: '',
  105. engineeringType: 1,
  106. pickerRange: [],
  107. typeData: [
  108. {value: 1, text: '隧道工程'},
  109. {value: 2, text: '桥梁工程'}
  110. ],
  111. }
  112. },
  113. onLoad() {
  114. const {id} = uni.getStorageSync("userInfo")
  115. this.project = uni.getStorageSync(`porject_${id}`);
  116. this.userid = id;
  117. },
  118. onShow() {
  119. this.resetPage();
  120. this.getList();
  121. this.getListNums();
  122. },
  123. methods: {
  124. searchDateChange(val) {
  125. if (val.length > 1) {
  126. this.searchForm.startDate = val[0];
  127. this.searchForm.endDate = val[1];
  128. } else {
  129. this.searchForm.startDate = '';
  130. this.searchForm.endDate = '';
  131. }
  132. },
  133. resetPage(){
  134. this.page = 0;
  135. this.totalPage = 999;
  136. this.taskList = [];
  137. },
  138. getList() {
  139. if(this.page >= this.totalPage){
  140. return;
  141. }
  142. this.page++;
  143. let form = this.searchForm
  144. this.http.request("/app/qualityModifyInfo/page",{
  145. ...form,
  146. page: this.page,
  147. projectId:this.project.id,
  148. contractId:this.project.contractId,
  149. }).then((json)=>{
  150. if(json.result == 1){
  151. this.taskList = this.taskList.concat(json.datas);
  152. this.totalPage = json.totalPage;
  153. }
  154. })
  155. },
  156. getListNums(){
  157. },
  158. //查看详情
  159. itemInfoTap(item) {
  160. uni.navigateTo({
  161. url: '/pages/qualityInspection_fj/qualityInfo'
  162. })
  163. },
  164. //撤回
  165. revocationTap() {
  166. },
  167. //新增记录
  168. newRecordTap() {
  169. uni.navigateTo({
  170. url: '/pages/qualityInspection_fj/addInspection'
  171. })
  172. },
  173. },
  174. filters: {
  175. timeStamp: function(value) {
  176. if (!value) return '';
  177. let now = new Date(value);
  178. let year = now.getFullYear();
  179. let month = now.getMonth() + 1;
  180. if (month < 10) {
  181. month = '0' + month
  182. }
  183. let date = now.getDate();
  184. if (date < 10) {
  185. date = '0' + date
  186. }
  187. return year + "-" + month + "-" + date
  188. },
  189. },
  190. }
  191. </script>
  192. <style lang="scss">
  193. page {
  194. background-color: #EFEFEF;
  195. }
  196. .hc-qualityInspection-view {
  197. .page-bg-bar {
  198. position: fixed;
  199. left: 0;
  200. top: 0;
  201. width: 100%;
  202. height: 340rpx;
  203. border-radius: 0 0 160rpx 160rpx;
  204. background-color: rgba(47, 165, 255, 1);
  205. z-index: 1;
  206. }
  207. .hc-search-bar {
  208. position: sticky;
  209. top: 0;
  210. border: 2rpx solid rgba(255, 255, 255, .20);
  211. border-left: 0;
  212. border-right: 0;
  213. z-index: 222;
  214. .action {
  215. .action-data-select {
  216. width: 182rpx;
  217. flex: 182rpx;
  218. }
  219. .cu-btn {
  220. height: 54rpx;
  221. padding: 0 22rpx;
  222. font-size: 24rpx;
  223. border-radius: 6rpx;
  224. }
  225. }
  226. }
  227. .hc-content-zindex {
  228. position: relative;
  229. padding: 26rpx;
  230. z-index: 2;
  231. }
  232. .hc-data-card {
  233. .title-box {
  234. position: relative;
  235. padding: 10px;
  236. display: flex;
  237. align-items: center;
  238. justify-content: space-between;
  239. .title {
  240. font-weight: bold;
  241. }
  242. }
  243. .name-bar {
  244. padding: 0 10px 10px;
  245. position: relative;
  246. border-bottom: 1px solid #eee;
  247. }
  248. .content-box {
  249. position: relative;
  250. padding: 10px;
  251. .title {
  252. color: #858585;
  253. }
  254. .name {
  255. position: relative;
  256. padding: 12px 24px 12px 0;
  257. }
  258. .right-icons {
  259. position: absolute;
  260. right: 10px;
  261. bottom: 48%;
  262. }
  263. .tag-text {
  264. position: relative;
  265. display: flex;
  266. align-items: center;
  267. font-size: 14px;
  268. margin-top: 16px;
  269. .text-bar .type {
  270. color: #858585;
  271. }
  272. .text-bar + .text-bar {
  273. margin-left: 14px;
  274. }
  275. }
  276. }
  277. .action {
  278. position: absolute;
  279. right: 5px;
  280. bottom: 5px;
  281. .cu-btn {
  282. width: 40px;
  283. height: 40px;
  284. border-radius: 50%;
  285. font-size: 14px;
  286. }
  287. }
  288. }
  289. .fixed-bottom {
  290. position: fixed;
  291. bottom: 0;
  292. width: 100%;
  293. background-color: #fff;
  294. padding: 34rpx 34rpx calc(var(--window-bottom) + 38rpx);
  295. box-shadow: 0 -12rpx 10rpx -12rpx rgba(215, 224, 253, 100);
  296. }
  297. }
  298. </style>