detail.vue 3.0 KB

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