detection_details.vue 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. <template>
  2. <view class=" uni-container" v-if="formData.id">
  3. <view class="example container" :style="'height: ' + (screenHeight - wheight - 75) + 'px'">
  4. <!-- 自定义表单校验 1-->
  5. <u--form ref="customForm" :model="formData" labelPosition="top" labelWidth="150" labelAlign="left">
  6. <u-form-item label="检测项目" prop="detinspect" :required="true">
  7. <u-input v-model="formData.detinspect" disabled placeholder="请输入检测项目" />
  8. </u-form-item>
  9. <u-form-item label="预计检测时间" prop="detdate">
  10. <uni-datetime-picker v-model="formData.detdate" type="datetime"
  11. closeOnClickOverlay disabled></uni-datetime-picker>
  12. </u-form-item>
  13. <u-form-item label="检测维保结果" prop="detresult" >
  14. <u-input v-model="formData.detresult" disabled placeholder="请输入检测维保结果" />
  15. </u-form-item>
  16. <u-form-item label="所属单位" prop="orgName" :required="true">
  17. <u-input v-model="formData.orgName" disabled placeholder="" />
  18. </u-form-item>
  19. <u-form-item label="附件">
  20. <view class="buju">
  21. <text v-if="formData.att == '' || formData.att == null">无</text>
  22. <!-- #ifdef MP-WEIXIN -->
  23. <text v-else style="color:#00a3f4;cursor: pointer;"
  24. @click.native="down(formData.att)">点击预览文件</text>
  25. <!-- #endif -->
  26. <!-- #ifdef H5 -->
  27. <a v-else style="color:#00a3f4;cursor: pointer;" @click="down(formData.att)">点击预览文件</a>
  28. <!-- #endif -->
  29. </view>
  30. </u-form-item>
  31. </u--form>
  32. </view>
  33. <uni-row class="heigthButton">
  34. <u-button @click="gotoEditDetection(formData)" shape="circle" size="large" color="#4cb2b6" style="width: 60%;"
  35. text="修改信息"></u-button>
  36. </uni-row>
  37. </view>
  38. </template>
  39. <script>
  40. var that = null;
  41. import {
  42. downSee
  43. } from '@/utils/common'
  44. export default {
  45. data() {
  46. return {
  47. formData: {
  48. orgName: ''
  49. },
  50. screenHeight: this.$screenHeight,
  51. wheight: '',
  52. };
  53. },
  54. mounted() {
  55. uni.createSelectorQuery().in(this).select('.heigthButton').boundingClientRect(data => {
  56. this.wheight = data.height
  57. }).exec()
  58. },
  59. onLoad: function(option) {
  60. that = this
  61. var data = option.id;
  62. // 接收来自上个页面传递的参数
  63. const navData = JSON.parse(option.navData)
  64. that.formData = navData;
  65. // const eventChannel = this.getOpenerEventChannel();
  66. // eventChannel.on('acceptDataFromOpenerPage', function(val) {
  67. // that.formData = val;
  68. // console.log('val+++++++++++++++++++', that.formData);
  69. // });
  70. // this.formData.orgName = option.orgName
  71. console.log("option: ", that.formData);
  72. },
  73. methods: {
  74. // 下载附件
  75. down(attId) {
  76. console.log(attId, 'sdf');
  77. downSee(attId)
  78. },
  79. // 传递当前页面数据到 ‘修改信息’
  80. gotoEditDetection(val) {
  81. // console.log('val',val);
  82. const navData = JSON.stringify(this.formData)
  83. uni.navigateTo({
  84. url: '/pagesA/fire/fpd_detection/edit_detection/edit_detection?id=' + val.id+'&navData='+navData,
  85. });
  86. }
  87. }
  88. };
  89. </script>
  90. <style lang="scss" scoped>
  91. page {
  92. background-color: #F5F7F9;
  93. }
  94. .container {
  95. position: relative;
  96. // height: 220vh;
  97. background-color: rgb(245, 247, 249);
  98. overflow: auto;
  99. .buju {
  100. margin: 40rpx;
  101. }
  102. }
  103. .cont {}
  104. .weiwan {
  105. color: #d51a52;
  106. background: rgba(213, 26, 82, 0.2);
  107. padding: 5rpx 20rpx;
  108. border-radius: 2px;
  109. border: 1px solid #d51a52;
  110. }
  111. .yiwan {
  112. color: #4cb2b6;
  113. background: rgba(76, 178, 182, 0.2);
  114. padding: 5rpx 20rpx;
  115. border-radius: 2px;
  116. border: 1px solid #4cb2b6;
  117. }
  118. .miaoshu {
  119. margin-right: 20rpx;
  120. color: #274647;
  121. font-weight: 600;
  122. }
  123. </style>