inspectionRecords.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394
  1. <!--检查记录-->
  2. <template>
  3. <view id="safetyInspect" style="display: flex;flex-direction: column;flex: 1;">
  4. <view class="top-button-box">
  5. <view class="left-title">检查状态</view>
  6. <picker @change="bindPickerChange" :value="pickerIndex" :range="pickerArray" class="right-button-big-box">
  7. <view class="right-button-box">
  8. <view class="uni-input">{{pickerArray[pickerIndex]}}</view>
  9. <img src="@/images/icon_06.png">
  10. </view>
  11. </picker>
  12. </view>
  13. <scroll-view scroll-y @scrolltolower="scrollGet" class="scroll-box">
  14. <view class="for-big-box" v-for="(item,index) in dataList" :key="index">
  15. <view class="for-time-p">{{item.createTime}}</view>
  16. <img class="for-back-img" src="@/images/Version2.2/for_min_bg.png">
  17. <view class="for-list-box" @click="goInfo(minItem.id)"
  18. v-for="(minItem,indexTwo) in item.recordList" :key="indexTwo">
  19. <view class="min-for-title-box">
  20. <view class="min-for-type-p viewColor1" v-if="minItem.isYuqi">逾期</view>
  21. <view class="min-for-type-p" v-if="!minItem.isYuqi" :class="minItem.zgStatus==5?'viewColor1':(minItem.zgStatus==0?'viewColor2':(minItem.zgStatus==1?'viewColor3':(minItem.zgStatus==2?'viewColor4':(minItem.zgStatus==3?'viewColor5':(minItem.zgStatus==4?'viewColor6':'')))))">{{minItem.zgStatus==5?'逾期':(minItem.zgStatus==0?'待整改':(minItem.zgStatus==1?'待复核':(minItem.zgStatus==2?'驳回':(minItem.zgStatus==3?'整改中':(minItem.zgStatus==4?'已完成':'')))))}}</view>
  22. <view class="min-for-name-p">{{minItem.laboratoryName}}</view>
  23. <view class="min-for-zd-p" v-if="minItem.zgType == 1">(重大)</view>
  24. <view class="min-for-timee-p">{{minItem.createTime}}</view>
  25. </view>
  26. <view class="min-for-info-box">
  27. <view class="min-for-info-min-box">
  28. <img src="@/images/Version2.2/icon_jcjl_xm.png">
  29. <view>{{minItem.fzrName}}</view>
  30. </view>
  31. <view class="min-for-info-min-box">
  32. <img src="@/images/Version2.2/icon_jcjl_dh.png">
  33. <view>{{minItem.fzrLxfs}}</view>
  34. </view>
  35. </view>
  36. </view>
  37. </view>
  38. </scroll-view>
  39. <view class="bottom-button-p" @click="startButton">开始安全检查</view>
  40. <view class="position-box" @click="goPage">
  41. <img src="@/images/Version2.2/icon_wtj.png">
  42. </view>
  43. </view>
  44. </template>
  45. <script>
  46. import { listOrderByYyyymmdd } from '@/api/index.js'
  47. import { rectifyList } from '@/pages_manage/workbench/problemRectification/rectifyList.vue'
  48. export default {
  49. components: {
  50. rectifyList,
  51. },
  52. name: "inspectionRecords",
  53. data() {
  54. return {
  55. pageType:0,
  56. //列表请求参数
  57. getData:{
  58. pageNum:1,
  59. pageSize:20,
  60. isCg:0,
  61. zgStatus:"",
  62. getType:true,
  63. nullDataType:true,
  64. },
  65. curTab:0,
  66. tabText:['检查记录','问题整改',],
  67. pickerIndex:0,
  68. pickerArray:['全部','待整改','待复核','驳回','已完成','逾期'],
  69. dataList:[]
  70. }
  71. },
  72. onLoad() {
  73. },
  74. onShow() {
  75. this.dataList=[];
  76. },
  77. mounted(){
  78. let First = uni.getStorageSync('First')
  79. if(First){//非第一次进入
  80. console.log(1111)
  81. this.getList();
  82. }else{//第一次进入
  83. console.log(2222)
  84. uni.setStorageSync('First', 'true')//设置关键字和其值
  85. }
  86. },
  87. methods: {
  88. //顶部tab点击
  89. tabClick(index) {
  90. this.curTab = index;
  91. this.pageType=index;
  92. },
  93. //开始检查
  94. startButton(){
  95. uni.navigateTo({
  96. url: '/pages_manage/workbench/securityCheck/startChecking',//开始安全检查
  97. });
  98. },
  99. //跳转
  100. goPage(){
  101. uni.navigateTo({
  102. url: '/pages_manage/workbench/securityCheck/unsubmittedList',//未提交列表
  103. });
  104. },
  105. //去详情
  106. goInfo(id){
  107. uni.navigateTo({
  108. url: '/pages_manage/workbench/securityCheck/recordDetails?id='+id,//未提交列表
  109. });
  110. },
  111. //下啦选择
  112. bindPickerChange(e){
  113. if(e.target.value == 0){
  114. this.getData.zgStatus = "";
  115. this.getData.isYuqi = "";
  116. }else if(e.target.value == 1){
  117. this.getData.zgStatus = 0;
  118. this.getData.isYuqi = "";
  119. }else if(e.target.value == 2){
  120. this.getData.zgStatus = 1;
  121. this.getData.isYuqi = "";
  122. }else if(e.target.value == 3){
  123. this.getData.zgStatus = 2;
  124. this.getData.isYuqi = "";
  125. }/* else if(e.target.value == 4){
  126. this.getData.zgStatus = 3;
  127. this.getData.isYuqi = "";
  128. } */else if(e.target.value == 4){
  129. this.getData.zgStatus = 4;
  130. this.getData.isYuqi = "";
  131. }else if(e.target.value == 5){
  132. this.getData.zgStatus = 5;
  133. this.getData.isYuqi = "";
  134. }
  135. this.pickerIndex = e.target.value;
  136. this.getData.pageNum = 1;
  137. this.getData.getType = true;
  138. this.getData.nullDataType = true;
  139. this.dataList = [];
  140. this.getList();
  141. },
  142. //滚动加载事件
  143. scrollGet(){
  144. if(this.getData.getType){
  145. this.getData.pageNum += 1;
  146. this.getList();
  147. }
  148. },
  149. //获取列表数据
  150. async getList(){
  151. let self = this;
  152. self.dataList=[];
  153. let obj = {
  154. pageNum : this.getData.pageNum,
  155. pageSize : this.getData.pageSize,
  156. isYuqi:this.getData.isYuqi,
  157. zgStatus : this.getData.zgStatus,
  158. isCg : this.getData.isCg,
  159. }
  160. const {data} = await listOrderByYyyymmdd(obj);
  161. if(data.code==200){
  162. let self = this;
  163. for(let i=0;i<data.rows.length;i++){
  164. data.rows[i].createTime = data.rows[i].createTime.split(' ')[0];
  165. for(let o=0;o<data.rows[i].recordList.length;o++){
  166. data.rows[i].recordList[o].createTime = data.rows[i].recordList[o].createTime.split(' ')[1];
  167. let timeList = data.rows[i].recordList[o].createTime.split(':');
  168. data.rows[i].recordList[o].createTime = timeList[0]+':'+timeList[1]
  169. }
  170. }
  171. if(self.pageNum==1){
  172. if(data.rows.length > 0 && data.rows.length == self.getData.pageSize){
  173. self.dataList = data.rows;
  174. }else if(data.rows.length > 0 && data.rows.length != self.getData.pageSize){
  175. self.dataList = data.rows;
  176. self.getData.getType = false;
  177. self.getData.nullDataType = true;
  178. }else{
  179. self.getData.getType = false;
  180. self.getData.nullDataType = true;
  181. }
  182. }else{
  183. if(data.rows.length > 0 && data.rows.length == self.getData.pageSize){
  184. self.dataList = self.dataList.concat(data.rows)
  185. }else if(data.rows.length > 0 && data.rows.length != self.getData.pageSize){
  186. self.dataList = self.dataList.concat(data.rows);
  187. self.getData.getType = false;
  188. self.getData.nullDataType = true;
  189. }else{
  190. self.getData.getType = false;
  191. self.getData.nullDataType = true;
  192. }
  193. }
  194. }
  195. },
  196. }
  197. }
  198. </script>
  199. <style lang="stylus" scoped>
  200. #safetyInspect{
  201. height: 100%;
  202. width: 100%;
  203. display flex;
  204. flex-direction column;
  205. .top-button-box{
  206. height:150rpx;
  207. margin-bottom:20rpx;
  208. display flex
  209. padding:0 20rpx;
  210. background #fff
  211. .left-title{
  212. line-height:150rpx;
  213. margin-right:15rpx;
  214. font-size:28rpx;
  215. color:#333;
  216. }
  217. .right-button-big-box{
  218. flex:1;
  219. .right-button-box{
  220. margin:34rpx 0;
  221. border:1rpx solid #A2A2A2;
  222. border-radius:10rpx;
  223. height:80rpx;
  224. display flex
  225. flex:1;
  226. view{
  227. flex:1;
  228. line-height:80rpx;
  229. margin-left:20rpx;
  230. color: #999999;
  231. font-size:28rpx;
  232. }
  233. img{
  234. width:24rpx;
  235. height:12rpx;
  236. margin:35rpx 22rpx;
  237. }
  238. }
  239. }
  240. }
  241. .scroll-box{
  242. // flex:1;
  243. overflow-y scroll;
  244. .for-big-box:last-child{
  245. margin-bottom:180rpx;
  246. }
  247. .for-big-box{
  248. margin:0 20rpx 20rpx;
  249. overflow hidden
  250. border-bottom-left-radius :20rpx;
  251. border-bottom-right-radius :20rpx;
  252. .for-time-p{
  253. background #fff
  254. line-height:87rpx;
  255. font-size:30rpx;
  256. padding:0 22rpx;
  257. border-top-left-radius:20rpx;
  258. border-top-right-radius:20rpx;
  259. }
  260. .for-back-img{
  261. height:30rpx;
  262. width:710rpx;
  263. }
  264. .for-list-box:nth-child(3){
  265. .min-for-title-box{
  266. border:none;
  267. }
  268. }
  269. .for-list-box{
  270. background #fff
  271. padding:6rpx 0;
  272. .min-for-title-box{
  273. display flex
  274. margin:0 20rpx;
  275. border-top:1rpx solid #e0e0e0;
  276. view{
  277. line-height:35rpx;
  278. height:35rpx;
  279. margin:15rpx 0;
  280. }
  281. .min-for-type-p{
  282. border-radius:6rpx;
  283. font-size:22rpx;
  284. width:100rpx;
  285. text-align center
  286. margin-right:20rpx;
  287. }
  288. .min-for-name-p{
  289. flex:1;
  290. font-size:28rpx;
  291. display:block;
  292. overflow:hidden;
  293. text-overflow:ellipsis;
  294. white-space:nowrap;
  295. }
  296. .min-for-zd-p{
  297. font-size:26rpx;
  298. color:#D80000;
  299. margin-right:10rpx;
  300. }
  301. .min-for-timee-p{
  302. font-size:26rpx;
  303. color:#999;
  304. }
  305. .viewColor1{
  306. background #ffe6e6;
  307. color:#ff5555;
  308. }
  309. .viewColor2{
  310. background #fef2dd;
  311. color:#f6a71d;
  312. }
  313. .viewColor3{
  314. background #e0f1e2;
  315. color:#30a23d;
  316. }
  317. .viewColor4{
  318. background #f2dddd;
  319. color:#a51919;
  320. }
  321. .viewColor5{
  322. background #e2f6f8;
  323. color:#3ac3d3;
  324. }
  325. .viewColor6{
  326. background #d9edfe;
  327. color:#0183fa;
  328. }
  329. }
  330. .min-for-info-box{
  331. display flex
  332. margin:0 20rpx;
  333. .min-for-info-min-box:nth-child(1){
  334. view{
  335. min-width:200rpx;
  336. }
  337. }
  338. .min-for-info-min-box{
  339. display flex
  340. height:28rpx;
  341. margin:14rpx 0;
  342. img{
  343. width:28rpx;
  344. height:28rpx;
  345. margin-right:10rpx;
  346. }
  347. view{
  348. font-size:26rpx;
  349. line-height:28rpx;
  350. }
  351. }
  352. }
  353. }
  354. }
  355. }
  356. .bottom-button-p{
  357. position fixed
  358. bottom:20rpx;
  359. left:50rpx;
  360. width:650rpx;
  361. height:100rpx;
  362. line-height:100rpx;
  363. text-align center;
  364. background #0183FA;
  365. color:#fff;
  366. font-size:28rpx;
  367. border-radius: 20rpx
  368. }
  369. .position-box{
  370. position fixed
  371. bottom:240rpx;
  372. right:30rpx;
  373. img{
  374. width:152rpx;
  375. height:152rpx;
  376. }
  377. }
  378. }
  379. </style>