detail.vue 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176
  1. <template>
  2. <view class="detail-wrap warning">
  3. <view class="handle-wrap">
  4. <button v-if="item.status==0 || item.status==1"
  5. class="custom-button primary"
  6. @click="handleWarn">处理</button>
  7. <button v-if="item.isFixed!=1"
  8. class="custom-button warn"
  9. @click="delWarn(item.alertId)">删除</button>
  10. </view>
  11. <view class="detail-list">
  12. <view class="head">
  13. <text>基本信息</text>
  14. </view>
  15. <view class="table-cont" >
  16.   <view class="row">
  17. <text>标题:{{item.alertTitle}}</text>
  18. </view>
  19.   <view class="row">
  20. <text>风险点:{{item.riskPointTitle}}</text>
  21. </view>
  22.   <view class="row">
  23. <text>发生时间:{{item.alertTime}}</text>
  24. </view>
  25.   <view class="row">
  26. <text>等级:{{item.alertLevel|alertLevelFilter}}</text>
  27. </view>
  28. <uni-collapse accordion>
  29. <uni-collapse-item title="详情">
  30.   <view class="row">
  31. <text>当前处理部门:{{item.taskInsGroupName}}</text>
  32. </view>
  33.   <view class="row" v-if="item.taskInsAccountId">
  34. <text>当前处理人员:{{item.taskInsAccountName}}</text>
  35. </view>
  36.   <view class="row">
  37. <text>状态:{{item.status | alertStatusFilter}}</text>
  38. </view>
  39.   <view class="row">
  40. <text>描述:{{item.alertDesc}}</text>
  41. </view>
  42. </uni-collapse-item>
  43. </uni-collapse>
  44. </view>
  45. </view>
  46. </view>
  47. </template>
  48. <script>
  49. import { alertLevel ,alertStatus} from '@/libs/enum';
  50. export default {
  51. data() {
  52. return {
  53. item:{}
  54. }
  55. },
  56. filters:{
  57. alertLevelFilter(value){
  58. return alertLevel(value);
  59. },
  60. alertStatusFilter(value){
  61. return alertStatus(value);
  62. }
  63. },
  64. methods: {
  65. init(){
  66. let warnInfo=uni.getStorageSync('warnInfo');
  67. this.item={...warnInfo};
  68. },
  69. handleWarn(){
  70. uni.navigateTo({
  71. url:'/views/warning/manage/manage'
  72. })
  73. },
  74. delWarn(id){
  75. uni.showModal({
  76. title:"提示!",
  77. content:"是否要删除?!",
  78. success: (res) => {
  79. if (res.confirm) {
  80. deleteAlertById(id).then((res)=>{
  81. uni.showToast({
  82. title:'删除成功',
  83. icon:"none",
  84. duration:2000,
  85. complete:()=>{
  86. uni.hideToast();
  87. uni.navigateBack()
  88. }
  89. })
  90. })
  91. }
  92. }
  93. })
  94. }
  95. },
  96. onShow(){
  97. this.init();
  98. },
  99. destroyed() {
  100. uni.removeStorageSync("warnInfo");
  101. }
  102. }
  103. </script>
  104. <style lang="scss" scoped>
  105. .detail-wrap{
  106. &.warning{
  107. padding: 20upx 0 120upx 0;
  108. background-color: #fff;
  109. }
  110. .detail-list{
  111. .head{
  112. width: 300upx;
  113. height: 58upx;
  114. line-height: 58upx;
  115. color: #FFFFFF;
  116. background: #00A0FF;
  117. border-radius:0 16upx 16upx 0;
  118. padding: 0 20upx;
  119. }
  120. .table-cont {
  121. padding: 0 26upx;
  122. .row {
  123. height: 78upx;
  124. line-height: 78upx;
  125. border-bottom: 2upx solid #EDE1D9;
  126. padding-left: 10upx;
  127. &.desc{
  128. height: auto;
  129. line-height: 1.5;
  130. min-height: 78upx;
  131. border-bottom: none;
  132. padding-top: 16upx;
  133. display: flex;
  134. justify-content: flex-start;
  135. .desc-txt{
  136. width: 600upx;
  137. word-break: break-word;
  138. }
  139. }
  140. }
  141. }
  142. }
  143. .handle-wrap{
  144. width:710upx;
  145. display: flex;
  146. justify-content: space-around;
  147. padding: 20upx;
  148. position: fixed;
  149. bottom: 0;
  150. left: 0;
  151. z-index: 99;
  152. background-color: rgba(255,255,255,0.6);
  153. .custom-button{
  154. width: 200upx;
  155. line-height: 2;
  156. margin: 0;
  157. margin-right: 20upx;
  158. padding: 15upx 0;
  159. &.warn{
  160. background: #ff4949 ;
  161. color: #fff;
  162. }
  163. &.success{
  164. background:#1aad19;
  165. color: #fff;
  166. }
  167. &.primary{
  168. background: #1890ff;
  169. color: #fff;
  170. }
  171. }
  172. }
  173. }
  174. </style>