CheckCard.vue 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174
  1. <template>
  2. <view class="kd-check-card">
  3. <view class="title">
  4. <text class="label">{{ index + 1 }}</text>
  5. <text>{{ item.name }}</text>
  6. </view>
  7. <view class="card-cell">
  8. <text class="label">内容</text>
  9. <text class="cell-content">{{ item.content }}</text>
  10. </view>
  11. <view class="card-cell">
  12. <text class="label">标准</text>
  13. <text class="cell-content">{{ item.norm }}</text>
  14. </view>
  15. <view class="card-cell">
  16. <text class="label">工具</text>
  17. <view class="cell-content" v-if="item.operationGuide && item.operationGuide.toolList.length > 0">
  18. <view v-for="(item, index) in item.operationGuide.toolList">{{ index + 1 }}、{{ item.categoryLevelName }}</view>
  19. </view>
  20. <view class="cell-content" v-else>无</view>
  21. </view>
  22. <view class="card-cell">
  23. <text class="label">指导</text>
  24. <view class="cell-content" v-if="item.operationGuide && item.operationGuide.procedureList.length > 0">
  25. <view v-for="(item, index) in item.operationGuide.procedureList">{{ index + 1 }}、{{ item.content }}</view>
  26. </view>
  27. <view class="cell-content" v-else>无</view>
  28. </view>
  29. <view class="card-cell">
  30. <text class="label">结果</text>
  31. <view class="cell-content">
  32. <view class="content-status" v-if="type == 'view'">
  33. <!-- {{ item.isNormal?'正常':'异常' }} -->
  34. <div v-if="item.status == 0" style="color: green">正常</div>
  35. <div v-else-if="item.status == -1" style="color: red">异常</div>
  36. </view>
  37. <textarea v-if="type !== 'view'" placeholder="请输入" v-model="item.result" />
  38. <view class="result-text" v-else>{{ item.result }}</view>
  39. <view class="radio-wrapper" v-if="type !== 'view'">
  40. <div
  41. v-for="(it, ind) in statusList"
  42. :key="ind"
  43. class="wrapper-box"
  44. @click="changeStatus(item, it)"
  45. :style="item.status == it.status && item.status == -1 ? 'color:red;border: 1rpx solid red' : item.status == it.status && item.status == 0 ? 'color:green;border: 1rpx solid green' : ''">
  46. {{ it.label }}
  47. </div>
  48. <!-- <u-radio-group
  49. v-model="item.isNormal"
  50. placement="row"
  51. v-if="type !== 'view'"
  52. :size="28"
  53. >
  54. <u-radio
  55. :customStyle="{ marginRight: '20px' }"
  56. :labelSize="30"
  57. label="正常"
  58. :name="1"
  59. >
  60. </u-radio>
  61. <u-radio :customStyle="{}" :labelSize="30" label="异常" :name="0">
  62. </u-radio>
  63. </u-radio-group>
  64. <view
  65. :class="item.isNormal === 0 ? 'text-danger' : ''"
  66. v-else
  67. style="min-height: 1em"
  68. >
  69. {{ ['异常', '正常'][item.isNormal] }}
  70. </view> -->
  71. </view>
  72. </view>
  73. </view>
  74. </view>
  75. </template>
  76. <script>
  77. export default {
  78. props: {
  79. item: {
  80. type: Object,
  81. default: () => ({})
  82. },
  83. index: Number,
  84. type: {
  85. type: String,
  86. default: 'edit'
  87. }
  88. },
  89. data() {
  90. return {
  91. statusList: [
  92. { label: '正常', status: 0 },
  93. { label: '异常', status: -1 }
  94. ]
  95. }
  96. },
  97. methods: {
  98. changeStatus(item, it) {
  99. item.status = it.status
  100. }
  101. }
  102. }
  103. </script>
  104. <style lang="scss" scoped>
  105. $border-color: #f2f2f2;
  106. .kd-check-card {
  107. font-size: 28rpx;
  108. border: 1rpx solid $border-color;
  109. .label {
  110. display: inline-block;
  111. width: 80rpx;
  112. text-align: center;
  113. border-right: 1px solid $border-color;
  114. justify-content: center;
  115. }
  116. .title {
  117. line-height: 72rpx;
  118. font-weight: bold;
  119. background-color: #f2f2f2;
  120. }
  121. .card-cell {
  122. min-height: 72rpx;
  123. display: flex;
  124. align-items: stretch;
  125. border: 1px solid $border-color;
  126. text {
  127. display: flex;
  128. align-items: center;
  129. }
  130. }
  131. .cell-content {
  132. flex: 1;
  133. .content-status {
  134. width: 100%;
  135. height: 50rpx;
  136. line-height: 50rpx;
  137. text-indent: 10rpx;
  138. border-bottom: 1rpx solid #f2f2f2;
  139. }
  140. }
  141. .radio-wrapper {
  142. padding: 10rpx 20rpx;
  143. border-bottom: 1px solid $border-color;
  144. margin-left: -8rpx;
  145. }
  146. /deep/uni-textarea {
  147. width: 100%;
  148. box-sizing: border-box;
  149. }
  150. .result-text {
  151. min-height: 100rpx;
  152. padding: 10rpx;
  153. }
  154. .cell-content {
  155. padding-left: 8rpx;
  156. }
  157. .radio-wrapper {
  158. display: flex;
  159. align-items: center;
  160. justify-content: space-around;
  161. }
  162. .wrapper-box {
  163. width: 45%;
  164. height: 80rpx;
  165. line-height: 80rpx;
  166. text-align: center;
  167. border: 1rpx solid #000;
  168. color: #000;
  169. border-radius: 15rpx;
  170. }
  171. }
  172. </style>