detail.vue 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. <template>
  2. <view class="wrap">
  3. <uni-section :title="point.pointContent" type="line">
  4. <uni-forms ref="form" :modelValue="formData" :rules="rules" :label-width="300" label-position="top">
  5. <uni-forms-item label="检查结果" name="checkResult" required>
  6. <view class="uni-data-checkbox-wrap">{{checkResult}}</view>
  7. </uni-forms-item>
  8. <uni-forms-item label="备注" name="remark">
  9. <uni-easyinput disabled v-model="formData.remark" type="textarea" :maxlength="-1" autoHeight placeholder="备注" />
  10. </uni-forms-item>
  11. <template v-if="formData.attachList.length>0">
  12. <view class="attach-box" @click="preview(attach,index)" v-for="(attach,index) in formData.attachList" :key="index">
  13. <image class="attach" :src="attach.fileUrl" mode="widthFix"></image>
  14. </view>
  15. </template>
  16. </uni-forms>
  17. </uni-section>
  18. </view>
  19. </template>
  20. <script>
  21. import {upload} from '@/api/system/upload.js'
  22. import {updateChecklistPoint,getPoint} from '@/api/aqpt/checklistPoint.js'
  23. export default {
  24. data() {
  25. return {
  26. checkResults:[
  27. {text:"通过",value:1},
  28. {text:"不通过",value:-1},
  29. ],
  30. checkResult:"",
  31. formData:{
  32. checkResult:1,
  33. remark:"",
  34. attachList:[]
  35. },
  36. rules:{},
  37. point:{}
  38. }
  39. },
  40. onBackPress() {
  41. },
  42. onLoad() {
  43. this.init()
  44. },
  45. methods: {
  46. init(){
  47. let point=uni.getStorageSync('point');
  48. this.point=point;
  49. this.getPoint()
  50. },
  51. getPoint(){
  52. let point=uni.getStorageSync('point');
  53. let checklistId=point.checklistId;
  54. let itemId=point.itemId;
  55. let recordId=point.recordId;
  56. let pointId=point.pointId;
  57. getPoint(checklistId,itemId,recordId,pointId).then((res)=>{
  58. this.formData=res.data
  59. for(let i=0;i<this.checkResults.length;i++){
  60. if(this.checkResults[i].value===res.data.checkResult){
  61. this.checkResult=this.checkResults[i].text
  62. }
  63. }
  64. })
  65. },
  66. preview(attach,index){
  67. uni.previewImage({
  68. urls:[attach.fileUrl],
  69. current:index
  70. })
  71. }
  72. },
  73. onUnload() {
  74. uni.removeStorageSync('point')
  75. }
  76. }
  77. </script>
  78. <style lang="scss" scoped>
  79. .wrap{
  80. padding: 20rpx;
  81. position: relative;
  82. // &::after{
  83. // content: "";
  84. // width: 100%;
  85. // height: 100vh;
  86. // position: fixed;
  87. // left: 0;
  88. // top: 0;
  89. // background-color: rgba(0,0,0,0);
  90. // z-index: 999;
  91. // }
  92. .submit-BT {
  93. width: 750rpx;
  94. color: #4D73FF;
  95. text-align: center;
  96. font-size: 32rpx;
  97. padding-bottom: 68rpx;
  98. background-color: #fff;
  99. position: fixed;
  100. left: 0;
  101. bottom: 0;
  102. z-index: 99;
  103. box-shadow: 0px 0px 12px 0px #0000000A;
  104. border-radius: 8px 8px 0px 0px
  105. }
  106. ::v-deep .uni-forms-item{
  107. .uni-forms-item__content{
  108. .uni-data-checkbox-wrap{
  109. height: 100%;
  110. display: flex;
  111. align-items: center;
  112. }
  113. }
  114. }
  115. .attach-box{
  116. &,.attach{
  117. width: 200rpx;
  118. height: 200rpx;
  119. margin-right: 10rpx;
  120. border: 1px solid #333;
  121. }
  122. }
  123. }
  124. </style>