CheckCard.vue 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181
  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" @input="inputChange($event, item)" />
  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. inputChange(obj, item) {
  99. if (obj.target.value.length > 0) {
  100. item.status = -1
  101. } else {
  102. item.status = 0
  103. }
  104. },
  105. changeStatus(item, it) {
  106. item.status = it.status
  107. }
  108. }
  109. }
  110. </script>
  111. <style lang="scss" scoped>
  112. $border-color: #f2f2f2;
  113. .kd-check-card {
  114. font-size: 28rpx;
  115. border: 1rpx solid $border-color;
  116. .label {
  117. display: inline-block;
  118. width: 80rpx;
  119. text-align: center;
  120. border-right: 1px solid $border-color;
  121. justify-content: center;
  122. }
  123. .title {
  124. line-height: 72rpx;
  125. font-weight: bold;
  126. background-color: #f2f2f2;
  127. }
  128. .card-cell {
  129. min-height: 72rpx;
  130. display: flex;
  131. align-items: stretch;
  132. border: 1px solid $border-color;
  133. text {
  134. display: flex;
  135. align-items: center;
  136. }
  137. }
  138. .cell-content {
  139. flex: 1;
  140. .content-status {
  141. width: 100%;
  142. height: 50rpx;
  143. line-height: 50rpx;
  144. text-indent: 10rpx;
  145. border-bottom: 1rpx solid #f2f2f2;
  146. }
  147. }
  148. .radio-wrapper {
  149. padding: 10rpx 20rpx;
  150. border-bottom: 1px solid $border-color;
  151. margin-left: -8rpx;
  152. }
  153. /deep/uni-textarea {
  154. width: 100%;
  155. box-sizing: border-box;
  156. }
  157. .result-text {
  158. min-height: 100rpx;
  159. padding: 10rpx;
  160. }
  161. .cell-content {
  162. padding-left: 8rpx;
  163. }
  164. .radio-wrapper {
  165. display: flex;
  166. align-items: center;
  167. justify-content: space-around;
  168. }
  169. .wrapper-box {
  170. width: 45%;
  171. height: 80rpx;
  172. line-height: 80rpx;
  173. text-align: center;
  174. border: 1rpx solid #000;
  175. color: #000;
  176. border-radius: 15rpx;
  177. }
  178. }
  179. </style>