unprocessDetail.vue 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276
  1. <template>
  2. <view>
  3. <view class="timeBox flex justify-between align-center padding-lr-sm">
  4. <view class="time">{{getData.time}}</view>
  5. <button class="cu-btn radius bg-red sm">未处理</button>
  6. </view>
  7. <view>
  8. <view class="basic-info">
  9. <view class="info-tit margin-left-xs">
  10. <text class="cuIcon-titles margin-right-xs"></text>
  11. 基本信息
  12. </view>
  13. <view class="info-content">
  14. <view class="info-one-info ">
  15. <text>设备名称:</text>
  16. <text>{{getData.device_name}}</text>
  17. </view>
  18. <view class="info-one-info ">
  19. <text>设备地址:</text>
  20. <text>{{getData.unitinfo}}</text>
  21. </view>
  22. <view class="info-one-info ">
  23. <text>告警信息:</text>
  24. <text>{{getData.alarm_information}}</text>
  25. </view>
  26. </view>
  27. </view>
  28. <!-- 处理内容start -->
  29. <view class="processStatus">
  30. <view class="info-tit margin-left-xs">
  31. <text class="cuIcon-titles margin-right-xs"></text>
  32. 处理内容
  33. </view>
  34. <view class="padding-lr padding-bottom-lg">
  35. <form action="">
  36. <radio-group name="gender" class="" @change="RadioChange">
  37. <label class="margin-right">
  38. <radio value="0" checked /><text>单个处理</text>
  39. </label>
  40. <label>
  41. <radio value="1" /><text>批量处理</text>
  42. </label>
  43. </radio-group>
  44. <view class="cu-form-group">
  45. <textarea class="JTxtArea lg" :maxlength="50" :data-maxnum="reason.length+'/50'"
  46. placeholder="备注信息,最多可输入50个字..." auto-height v-model="textareaMsg" @input="inputReason"
  47. :name="reason"></textarea>
  48. </view>
  49. <view class="btn-area">
  50. <button class="bg-orange round missReport margin-top" @click="$noMultipleClicks(alarmSubmit1)">误 报
  51. </button>
  52. <button class="bg-blue round missReport margin-top " @click="$noMultipleClicks(alarmSubmit0)">非 误 报
  53. </button>
  54. </view>
  55. </form>
  56. </view>
  57. </view>
  58. <!-- 处理内容end -->
  59. </view>
  60. </view>
  61. </template>
  62. <script>
  63. export default {
  64. data() {
  65. return {
  66. noClick:true,
  67. modalName: null,
  68. reason: '',
  69. type: 1,
  70. textareaMsg: '',
  71. getData: {},
  72. radioOne: 0,
  73. }
  74. },
  75. onLoad: function(option) {
  76. this.type = option.type;
  77. this.getDetailData({
  78. "type": option.type,
  79. "id": option.id
  80. });
  81. let url = "";
  82. switch (parseInt(option.type)) {
  83. case 1:
  84. url = "报警主机"
  85. break;
  86. case 2:
  87. url = "水系统"
  88. break;
  89. case 4:
  90. url = "消防栓监测"
  91. break;
  92. case 6:
  93. url = "RTU测控终端"
  94. break;
  95. case 7:
  96. url = "电气火灾"
  97. break;
  98. case 16:
  99. url = "视频告警"
  100. break;
  101. case 17:
  102. url = "电梯报警"
  103. break;
  104. case 128:
  105. url = "井盖监测"
  106. break;
  107. case 129:
  108. url = "地磁"
  109. break;
  110. case 130:
  111. url = "门磁"
  112. break;
  113. case 131:
  114. url = "可燃气体"
  115. break;
  116. default:
  117. break;
  118. }
  119. uni.setNavigationBarTitle({
  120. title: url+'(未处理)'
  121. });
  122. },
  123. methods: {
  124. async getDetailData(params = {}) {
  125. const res = await this.$myRequest({
  126. url: 'ComprehensiveAlarm/getAlarmDetails',
  127. data: params,
  128. showLoading: true
  129. })
  130. this.getData = res.data.data[0];
  131. console.log(this.getData)
  132. },
  133. async powerSubmitRes(params = {}) {
  134. const res = await this.$myRequest({
  135. url: 'ComprehensiveAlarm/setAlarmHandling',
  136. data: params
  137. })
  138. if (res.data.flag) {
  139. uni.showToast({
  140. title: "提交成功",
  141. });
  142. setTimeout(() => {
  143. uni.navigateTo({
  144. url: '/pages/processList/processList?type=' + this.type,
  145. });
  146. }, 1000);
  147. }
  148. },
  149. //误报
  150. alarmSubmit1() {
  151. if (!this.textareaMsg.replace(/^\s*/g,'')) {
  152. uni.showToast({
  153. title: "请输入处理内容",
  154. icon: "none"
  155. });
  156. } else {
  157. let queryParam = {};
  158. queryParam.id = this.getData.id;
  159. queryParam.type = this.getData.dwtype;
  160. queryParam.device_code = this.getData.device_code;
  161. queryParam.if_batch = this.radioOne;
  162. queryParam.clwb = 1;
  163. queryParam.ncmd = this.getData.ncmd;
  164. queryParam.clnr = this.textareaMsg;
  165. if (this.getData.dwtype == 1) {
  166. queryParam.data3 = this.getData.data3;
  167. queryParam.data5 = this.getData.data5;
  168. this.powerSubmitRes(queryParam);
  169. return;
  170. }
  171. if (this.getData.dwtype == 2) {
  172. queryParam.data1 = this.getData.data1;
  173. this.powerSubmitRes(queryParam);
  174. return;
  175. }
  176. if (this.getData.dwtype == 7) {
  177. queryParam.data1 = this.getData.data1;
  178. this.powerSubmitRes(queryParam);
  179. return;
  180. }
  181. if (this.getData.dwtype == 3) {
  182. queryParam.data2=this.getData.data2;
  183. this.powerSubmitRes(queryParam);
  184. return;
  185. }
  186. if (this.getData.dwtype == 6) {
  187. queryParam.data2=this.getData.data2;
  188. queryParam.data4=this.getData.data4;
  189. this.powerSubmitRes(queryParam);
  190. return;
  191. }
  192. this.powerSubmitRes(queryParam)
  193. }
  194. },
  195. //非误报
  196. //误报
  197. alarmSubmit0() {
  198. if (!this.textareaMsg.replace(/^\s*/g,'')) {
  199. uni.showToast({
  200. title: "请输入处理内容",
  201. icon: "none"
  202. });
  203. } else {
  204. let queryParam = {};
  205. queryParam.id = this.getData.id;
  206. queryParam.type = this.getData.dwtype;
  207. queryParam.device_code = this.getData.device_code;
  208. queryParam.if_batch = this.radioOne;
  209. queryParam.clwb = 0;
  210. queryParam.ncmd = this.getData.ncmd;
  211. queryParam.clnr = this.textareaMsg;
  212. if (this.getData.dwtype == 1) {
  213. queryParam.data3 = this.getData.data3;
  214. queryParam.data5 = this.getData.data5;
  215. this.powerSubmitRes(queryParam);
  216. return;
  217. }
  218. if (this.getData.dwtype == 2) {
  219. queryParam.data1 = this.getData.data1;
  220. this.powerSubmitRes(queryParam);
  221. return;
  222. }
  223. if (this.getData.dwtype == 7) {
  224. queryParam.data1 = this.getData.data1;
  225. this.powerSubmitRes(queryParam);
  226. return;
  227. }
  228. if (this.getData.dwtype == 3) {
  229. queryParam.data2=this.getData.data2;
  230. this.powerSubmitRes(queryParam);
  231. return;
  232. }
  233. if (this.getData.dwtype == 6) {
  234. queryParam.data2=this.getData.data2;
  235. queryParam.data4=this.getData.data4;
  236. this.powerSubmitRes(queryParam);
  237. return;
  238. }
  239. this.powerSubmitRes(queryParam)
  240. }
  241. },
  242. RadioChange(e) {
  243. this.radioOne = e.detail.value;
  244. console.log(this.radioOne)
  245. },
  246. textareaAInput(e) {
  247. this.textareaAValue = e.detail.value
  248. },
  249. inputReason(e) {
  250. this.reason = e.detail.value;
  251. }
  252. }
  253. }
  254. </script>
  255. <style lang="scss">
  256. </style>