fpd_detection.vue 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307
  1. <template>
  2. <view class="uni-container uni-container-bg">
  3. <!-- 搜索框 -->
  4. <uni-row class="demo-uni-row padding-tb-sm" :gutter="20" width="100%">
  5. <uni-col :span="24">
  6. <view class="u-page__tag-item">
  7. <u-search placeholder="请输入培训演练名称" bgColor="#edf6f9" borderColor="#4cb2b6" v-model="keyword"
  8. :show-action="true" @custom="search"></u-search>
  9. </view>
  10. </uni-col>
  11. </uni-row>
  12. <!-- 下拉框 -->
  13. <view class="u-page__tag-item"
  14. style="margin-bottom: 26upx;width: 700upx;border-bottom: 2px solid #55cbbf;background-color: #f5f7fa;">
  15. <u-form>
  16. <u-form-item prop="orgName" @click="
  17. showOrg = true;
  18. hideKeyboard();
  19. " label="单位选择:" labelWidth="100px">
  20. <!-- <u-picker :show="showOrg" :columns="actions"></u-picker> -->
  21. <u--input border="none" disabled v-model="formData.orgName" placeholder="请选择所属单位"></u--input>
  22. <u-icon slot="right" name="arrow-down"></u-icon>
  23. </u-form-item>
  24. </u-form>
  25. </view>
  26. <!-- 卡片栏 -->
  27. <view v-if="tableData.length>0 && isLoaded">
  28. <view v-for="(item, index) in tableData" :key="index"
  29. v-if="formData.orgName == item.orgName || formData.orgId == item.orgId">
  30. <uni-card>
  31. <!-- 标题 -->
  32. <view class="titles">{{ item.detinspect }}</view>
  33. <!-- 简要内容 -->
  34. <view style="display: flex;margin-bottom: 15rpx; color: #728f90;">
  35. <text class="name-align-drill">检测项目:</text>
  36. <text class="conts">{{ item.detinspect }}</text>
  37. </view>
  38. <view style="display: flex;margin-bottom: 15rpx; color: #728f90;">
  39. <text class="name-align-drill">所属单位:</text>
  40. <text class="conts">{{ item.orgId }}</text>
  41. </view>
  42. <view style="display: flex;margin-bottom: 15rpx; color: #728f90;">
  43. <text class="name-align-drill"> 检测维保结果:</text>
  44. <text class="conts max-width">{{ item.detresult }}</text>
  45. </view>
  46. <!-- 删除按钮 -->
  47. <view class="an-niu" @click.native="showModal(item)">
  48. <view class="detailDel">删除</view>
  49. </view>
  50. <view class="an-niu" @click.native="onClick(item,formData.orgName)" link><text
  51. class="detail">查看详情</text></view>
  52. </uni-card>
  53. </view>
  54. </view>
  55. <!-- tableData为空时显示 -->
  56. <view v-else-if="tableData.length==0 && isLoaded" style="text-align: center;">
  57. <view class="text-gray" style="padding-top: 20px;" v-if="tableData.length == 0">
  58. <img :src="tan90" alt="暂无数据" />
  59. </view>
  60. </view>
  61. <view>
  62. <image :src="Group" @click="addClick" class="tiantupian"></image>
  63. </view>
  64. <u-action-sheet :show="showOrg" :actions="actions" title="请选择单位" @close="showOrg = false"
  65. @select="sexSelect"></u-action-sheet>
  66. <u-modal :show="show" @confirm="confirm" @cancel="cancel" @close="close" asyncClose closeOnClickOverlay
  67. showCancelButton confirmColor="red" :title="title" :content="content" ref="uModal"></u-modal>
  68. <!-- 加载中 -->
  69. <isLodingModel></isLodingModel>
  70. </view>
  71. </template>
  72. <script>
  73. var that = '';
  74. import {
  75. createFpdDetection, //创建消防设备维护和检测台账
  76. updateFpdDetection, //更新消防设备维护和检测台账
  77. deleteFpdDetection, //删除消防设备维护和检测台账
  78. getFpdDetection, //获得消防设备维护和检测台账
  79. getFpdDetectionPage, //获得消防设备维护和检测台账分页
  80. exportFpdDetectionExcel, //导出消防设备维护和检测台账 Excel
  81. } from '@/api/fpdDetection/index.js';
  82. import config from '@/config'
  83. const baseUrlImg = config.baseUrlImg
  84. export default {
  85. data() {
  86. return {
  87. isLoaded: false,
  88. Group: `${baseUrlImg}/checkActive/Group.png`,
  89. showOrg: false,
  90. actions: [],
  91. // 数据
  92. tableData: [],
  93. title: '是否删除该数据项?',
  94. content: '确认删除?',
  95. id: '',
  96. tan90: `${baseUrlImg}/tan90.png`,
  97. // 每页数据量
  98. pageSize: 10,
  99. // 当前页
  100. pageNo: 1,
  101. // 数据总量
  102. total: 0,
  103. // tableData数据加载中
  104. loading: false,
  105. // 初始化时搜索框的值
  106. keyword: '',
  107. // 存放orgid,orgname
  108. formData: {
  109. orgName: ''
  110. },
  111. show: false,
  112. showtimeStart: false,
  113. showtimeEnd: false,
  114. // 查询参数
  115. queryParams: {
  116. pageNo: 1,
  117. pageSize: 10,
  118. detdate: [],
  119. detinspect: null,
  120. detresult: null,
  121. },
  122. }
  123. },
  124. methods: {
  125. //新增
  126. addClick() {
  127. this.isLoaded = false
  128. uni.navigateTo({
  129. url: '/pagesA/fire/fpd_detection/add_detection/add_detection'
  130. });
  131. },
  132. },
  133. watch: {
  134. loading: {
  135. handler(newLength, oldLength) {
  136. this.$modal.isLoadingModel(this.loading)
  137. },
  138. immediate: true
  139. }
  140. },
  141. onShow() {
  142. // 执行查询
  143. this.loading = true;
  144. getFpdDetectionPage(this.queryParams).then(response => {
  145. this.tableData = response.data.list;
  146. this.isLoaded = true
  147. this.loading = false;
  148. });
  149. }
  150. }
  151. </script>
  152. <style lang="scss" scoped>
  153. body {
  154. background-color: #f5f7f9;
  155. }
  156. page {
  157. background-color: #f5f7f9;
  158. }
  159. /deep/ .u-tabs__wrapper[data-v-0de61367],
  160. /deep/ .u-tabs__wrapper.data-v-0de61367,
  161. /deep/ .u-tabs__wrapper {
  162. width: 99%;
  163. }
  164. /deep/.u-tabs__wrapper__nav__item[data-v-0de61367],
  165. /deep/.u-tabs__wrapper__nav__item.data-v-0de61367,
  166. /deep/.u-tabs__wrapper__nav__item {
  167. padding: 0 60rpx;
  168. }
  169. .uni-container {
  170. height: 100vh;
  171. padding-right: 20upx;
  172. }
  173. .addInsp {
  174. width: 40px;
  175. position: fixed;
  176. right: 4px;
  177. z-index: 99999;
  178. }
  179. ::v-deep .u-icon__icon {
  180. margin-right: 0px !important;
  181. }
  182. .an-niu {
  183. float: right;
  184. font-size: 10px;
  185. text-align: center;
  186. display: flex;
  187. margin-top: -64upx;
  188. padding-bottom: 30rpx;
  189. // margin-top: 50rpx;
  190. color: #fff;
  191. .detail {
  192. width: 60px;
  193. height: 60rpx;
  194. padding: 0 20rpx;
  195. border-radius: 30px;
  196. background-color: #f7c41e;
  197. margin-right: 20rpx;
  198. text-align: center;
  199. line-height: 60rpx;
  200. font-size: 27upx;
  201. }
  202. .detailDel {
  203. width: 60px;
  204. height: 60rpx;
  205. padding: 0 20rpx;
  206. border-radius: 30px;
  207. background-color: #ff2e31;
  208. color: white;
  209. margin-right: 20rpx;
  210. text-align: center;
  211. line-height: 60rpx;
  212. font-size: 30upx;
  213. }
  214. .solve {
  215. width: 62px;
  216. height: 60rpx;
  217. margin-right: 20rpx;
  218. border-radius: 30px;
  219. background-color: #4cb2b6;
  220. line-height: 60rpx;
  221. }
  222. /deep/ .padding-tb-sm {
  223. padding-top: 0px;
  224. padding-bottom: 10px;
  225. }
  226. .deletes {
  227. width: 62px;
  228. height: 60rpx;
  229. border-radius: 60rpx;
  230. background-color: red;
  231. color: #fff;
  232. line-height: 60rpx;
  233. }
  234. }
  235. /deep/.segmented-control__item--button {
  236. background-color: rgb(76, 178, 182) !important;
  237. }
  238. /deep/.segmented-control__item--button--active {
  239. background-color: #ffffff !important;
  240. }
  241. /deep/.uni-card {
  242. box-shadow: 0px 0px 3px 0px rgba(86, 165, 168, 0.63) !important;
  243. border-radius: 30rpx;
  244. }
  245. .tiantupian {
  246. width: 110rpx;
  247. height: 110rpx;
  248. position: fixed;
  249. right: 15px;
  250. bottom: 80rpx;
  251. }
  252. //列表样式
  253. .titles {
  254. font-weight: 600;
  255. margin-bottom: 10rpx;
  256. color: black;
  257. font-size: 32rpx;
  258. }
  259. .conts {
  260. max-width: 470rpx;
  261. display: -webkit-box;
  262. /*弹性伸缩盒子模型显示*/
  263. -webkit-box-orient: vertical;
  264. /*排列方式*/
  265. -webkit-line-clamp: 1;
  266. /*显示文本行数*/
  267. overflow: hidden;
  268. /*溢出隐藏*/
  269. color: #274647;
  270. text-overflow: ellipsis;
  271. /*不知道干嘛的*/
  272. .conts-title {
  273. margin-right: 10rpx;
  274. color: #728f90;
  275. }
  276. }
  277. .max-width {
  278. max-width: 180upx;
  279. }
  280. /deep/ .u-form-item__body__left__content__label {
  281. font-size: 28upx !important;
  282. }
  283. </style>