item.vue 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. <template>
  2. <view class="box-container">
  3. <!-- <view class="box-head">
  4. {{renderItem(item,'deptName','--')}}
  5. </view> -->
  6. <view class="box-body">
  7. <u-row>
  8. <u-col :span="10">
  9. <view class="item">
  10. <view class="label">车牌号:</view>
  11. <view class="value">{{renderItem(item,'plate','--')}}</view>
  12. </view>
  13. <view class="item">
  14. <view class="label">所属单位:</view>
  15. <view class="value">{{renderItem(item,'deptName','--')}}</view>
  16. </view>
  17. </u-col>
  18. <u-col :span="2" class="disflex-center">
  19. <u-icon name="edit-pen-fill" color="#4573FC" size="22" @click="handleEdit(item)" v-if="$hasPermi('mobile:index:baseMange:vehManage:edit')"></u-icon>
  20. <u-icon name="trash-fill" color="#E44C4C" size="22" @click="handleDelete(item)" v-if="$hasPermi('mobile:index:baseMange:vehManage:remove')"></u-icon>
  21. </u-col>
  22. </u-row>
  23. </view>
  24. <!-- <view class="box-footer" v-if="item.outflowType==1">
  25. <u-row style="justify-content: flex-end;">
  26. <u-col :span="4" style="padding: 20rpx 30rpx;" v-if="item.backSts==0">
  27. <u-button type="info" :custom-style="{
  28. width: '100%',
  29. height: '28px',
  30. }" @click="handleBack(item)">归还
  31. </u-button>
  32. </u-col>
  33. </u-row>
  34. </view> -->
  35. </view>
  36. </template>
  37. <script>
  38. import { renderItem } from '@/utils/gdtq'
  39. import {remove} from '@/api/system/vehicle.js'
  40. export default {
  41. components: {
  42. },
  43. props: {
  44. item: {
  45. type: Object,
  46. default: () => {}
  47. }
  48. },
  49. data() {
  50. return {}
  51. },
  52. methods: {
  53. handleDelete(item) {
  54. uni.showModal({
  55. title: '提示',
  56. content: `确认删除?`,
  57. showCancel:true,
  58. confirmText: '确定',
  59. success: async (res) => {
  60. if (res.confirm) {
  61. const {vehicleId} = item
  62. let {code} = await remove({ids: vehicleId})
  63. if(code == 0) {
  64. this.$emit('getList')
  65. }
  66. }
  67. }
  68. })
  69. },
  70. handleEdit(item){
  71. const {vehicleId} = item
  72. uni.navigateTo({
  73. url: `/pagesBase/vehManage/add?id=${vehicleId}`
  74. })
  75. }
  76. },
  77. }
  78. </script>
  79. <style lang="scss" scoped>
  80. .box-container {
  81. background: #fff;
  82. margin: 20rpx 10rpx;
  83. border-radius: 10rpx;
  84. font-size: 24rpx;
  85. .box-head {
  86. border-bottom: 1px solid #ddd;
  87. padding: 20rpx;
  88. font-weight: 700;
  89. }
  90. .box-body {
  91. padding: 20rpx;
  92. .item {
  93. margin: 4rpx;
  94. display: flex;
  95. .label {
  96. }
  97. .value {
  98. flex: 1;
  99. text-overflow: ellipsis;
  100. overflow: hidden;
  101. white-space: nowrap;
  102. }
  103. }
  104. }
  105. .box-footer {
  106. border-top: 1px solid #ddd;
  107. // padding: 20rpx;
  108. }
  109. }
  110. .primary {
  111. color: $uni-color-primary;
  112. }
  113. .disflex-center {
  114. display: flex;
  115. flex-direction: row !important;
  116. justify-content: space-between !important;
  117. align-items: center !important;
  118. }
  119. </style>