index.vue 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195
  1. <template>
  2. <view class="kd-card">
  3. <view class="card-title">
  4. <view class="">
  5. <text v-if="orderTitle" class="orderTitle">{{ orderTitle }}</text>
  6. <text class="fs_fw">{{ title }}</text>
  7. </view>
  8. <text v-if="status" class="status" :class="statusList[item.status && item.status.descp]">
  9. {{ item.status && item.status.descp }}
  10. </text>
  11. </view>
  12. <view @click="handleDetail">
  13. <view class="card-body fs_fw">
  14. <view class="card-col" v-for="itm in colOptions">
  15. <text class="label">{{ itm.label }}:</text>
  16. <text class="content" v-if="itm.formatter">{{ itm.formatter(item[itm.key]) }}</text>
  17. <text class="content" v-else>{{ item[itm.key] }}</text>
  18. </view>
  19. <view class="asset" v-if="type == 'check'" :style="dictOpt.asset[item.assetDict]">
  20. {{ getDictValue('物品类型', item.assetDict) }}
  21. </view>
  22. </view>
  23. <view class="card-footer fs_fw" style="float: right;">
  24. 查看详情
  25. <u-icon name="arrow-right"></u-icon>
  26. </view>
  27. </view>
  28. </view>
  29. </template>
  30. <script>
  31. import itemConfig from './config.js'
  32. // import dictMixins from '@/mixins/dictMixins'
  33. export default {
  34. // mixinexportctMixins],
  35. props: {
  36. title: String,
  37. orderTitle: String,
  38. item: {
  39. type: Object,
  40. default: () => ({})
  41. },
  42. type: {
  43. type: String,
  44. required: true
  45. },
  46. status: {
  47. type: Boolean,
  48. default: false
  49. }
  50. },
  51. data() {
  52. return {
  53. statusList: {
  54. 待接收: 'text-danger',
  55. 待执行: 'text-danger',
  56. 执行中: 'text-warning',
  57. 未修复: 'text-normal'
  58. },
  59. dictOpt: {
  60. asset: {
  61. 1: {
  62. color: '#027DB4',
  63. backgroundColor: '#def5ff'
  64. },
  65. 2: {
  66. color: '#B8741A',
  67. backgroundColor: '#fef1e8'
  68. },
  69. 3: {
  70. color: '#A30014',
  71. backgroundColor: '#f9e5e7'
  72. },
  73. 4: {
  74. color: 'green',
  75. backgroundColor: '#67C23A'
  76. },
  77. 5: {
  78. color: '#a30014',
  79. backgroundColor: '#F56C6C'
  80. },
  81. 6: {
  82. color: '#f56c6c',
  83. backgroundColor: '#fbc4c4'
  84. },
  85. 7: {
  86. color: '#e6a23c',
  87. backgroundColor: '#fdf6ec'
  88. }
  89. }
  90. }
  91. }
  92. },
  93. // created () {
  94. // this.requestDict('物品类型')
  95. // },
  96. computed: {
  97. colOptions() {
  98. return (
  99. itemConfig[this.item.workOrderType?.code == 10 ? 'planWx' : this.type] || [{
  100. label: '单号',
  101. key: 'workOrderCode'
  102. },
  103. {
  104. label: '申请人',
  105. key: 'applicantName'
  106. },
  107. {
  108. label: '申请时间',
  109. key: 'createTime'
  110. }
  111. ]
  112. )
  113. }
  114. },
  115. methods: {
  116. handleDetail() {
  117. this.$emit('handleDetail', this.item)
  118. }
  119. }
  120. }
  121. </script>
  122. <style lang="scss" scoped>
  123. .kd-card {
  124. font-size: 34rpx;
  125. color: #333;
  126. background-color: #fff;
  127. border-radius: 8rpx;
  128. word-break: break-all;
  129. .status {
  130. font-weight: normal;
  131. }
  132. .card-title {
  133. font-weight: bold;
  134. }
  135. .card-footer,
  136. .card-title {
  137. display: flex;
  138. justify-content: space-between;
  139. padding: 12rpx 28rpx;
  140. }
  141. .card-body {
  142. padding: 0 28rpx;
  143. border-top: 1rpx solid #f2f2f2;
  144. border-bottom: 1rpx solid #f2f2f2;
  145. position: relative;
  146. .asset {
  147. position: absolute;
  148. top: 10rpx;
  149. right: 20rpx;
  150. padding: 4rpx 8rpx;
  151. }
  152. .card-col {
  153. margin-top: 10rpx;
  154. display: flex;
  155. .label {
  156. // text-align: right;
  157. width: 30%;
  158. font-size: 28rpx;
  159. font-style: normal;
  160. font-weight: 400;
  161. line-height: 38rpx;
  162. word-wrap: break-word;
  163. }
  164. .content {
  165. flex: 1;
  166. width: 70%;
  167. }
  168. }
  169. }
  170. }
  171. .orderTitle {
  172. color: #4b7902;
  173. margin-right: 10rpx;
  174. }
  175. .fs_fw {
  176. font-size: 28rpx;
  177. line-height: 38rpx;
  178. }
  179. </style>