Showing
1 changed file
with
32 additions
and
2 deletions
| @@ -70,8 +70,12 @@ | @@ -70,8 +70,12 @@ | ||
| 70 | <view><u--textarea border="none" height="96" placeholder="请输入处理结果" v-model="formModel.result" count></u--textarea></view> | 70 | <view><u--textarea border="none" height="96" placeholder="请输入处理结果" v-model="formModel.result" count></u--textarea></view> |
| 71 | </view> | 71 | </view> |
| 72 | <!-- #endif --> | 72 | <!-- #endif --> |
| 73 | - <view v-if="list.status !== 'CLEARED_ACK'" style="margin-top: 44rpx;display: flex;align-items: center;justify-content: center;"> | ||
| 74 | - <view class="u-flex" style="width: 400rpx"><u-button @click="handleSubmit" type="primary" shape="circle" text="处理"></u-button></view> | 73 | + <view style="margin-top: 44rpx;display: flex;align-items: center;justify-content: space-between;"> |
| 74 | + <view v-if="list.status !== 'CLEARED_ACK' && list.status !== 'ACTIVE_ACK'" class="u-flex" style="width: 260rpx"> | ||
| 75 | + <u-button @click="handleSubmit" type="primary" shape="circle" text="处理"></u-button> | ||
| 76 | + </view> | ||
| 77 | + <view style="width: 30rpx;"></view> | ||
| 78 | + <view v-if="list.status == 'ACTIVE_ACK'" class="u-flex" style="width: 260rpx"><u-button @click="handleRemove" type="error" shape="circle" text="清除"></u-button></view> | ||
| 75 | </view> | 79 | </view> |
| 76 | </view> | 80 | </view> |
| 77 | </template> | 81 | </template> |
| @@ -95,6 +99,7 @@ export default { | @@ -95,6 +99,7 @@ export default { | ||
| 95 | uni.hideTabBar(); | 99 | uni.hideTabBar(); |
| 96 | }, | 100 | }, |
| 97 | methods: { | 101 | methods: { |
| 102 | + //处理 | ||
| 98 | handleSubmit() { | 103 | handleSubmit() { |
| 99 | if (this.formModel.result == '') return uni.$u.toast('请输入处理结果'); | 104 | if (this.formModel.result == '') return uni.$u.toast('请输入处理结果'); |
| 100 | else | 105 | else |
| @@ -121,6 +126,31 @@ export default { | @@ -121,6 +126,31 @@ export default { | ||
| 121 | uni.$u.toast(e.data?.message); | 126 | uni.$u.toast(e.data?.message); |
| 122 | }); | 127 | }); |
| 123 | }, | 128 | }, |
| 129 | + //清除 | ||
| 130 | + handleRemove() { | ||
| 131 | + uni.$u.http | ||
| 132 | + .post(`/alarm/${this.list.id}/clear`) | ||
| 133 | + .then(res => { | ||
| 134 | + if (res == '') { | ||
| 135 | + uni.showToast({ | ||
| 136 | + title: '清除成功~', | ||
| 137 | + icon: 'none' | ||
| 138 | + }); | ||
| 139 | + let pages = getCurrentPages(); //获取所有页面栈实例列表 | ||
| 140 | + let nowPage = pages[pages.length - 1]; //当前页页面实例 | ||
| 141 | + let prevPage = pages[pages.length - 2]; //上一页页面实例 | ||
| 142 | + prevPage.$vm.detailStatus = true; | ||
| 143 | + setTimeout(() => { | ||
| 144 | + uni.navigateBack({ | ||
| 145 | + delta: 1 | ||
| 146 | + }); | ||
| 147 | + }, 500); | ||
| 148 | + } | ||
| 149 | + }) | ||
| 150 | + .catch(e => { | ||
| 151 | + uni.$u.toast(e.data?.message); | ||
| 152 | + }); | ||
| 153 | + }, | ||
| 124 | formatDetailText(e) { | 154 | formatDetailText(e) { |
| 125 | //去除字符串双引号 | 155 | //去除字符串双引号 |
| 126 | const jsonStr = JSON.stringify(e); | 156 | const jsonStr = JSON.stringify(e); |