proceDetailEle1.vue 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281
  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 sm" :class="[clzt=='1'?'bg-green':'bg-red']" >{{clzt=='1'?'已处理':'未处理'}}</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 " v-if="type==1">
  23. <text>点位地址:</text>
  24. <text>{{getData.data4}}</text>
  25. </view>
  26. <view class="info-one-info ">
  27. <text>告警信息:</text>
  28. <text>{{getData.alarm_information}}</text>
  29. </view>
  30. </view>
  31. </view>
  32. <!-- 处理内容start -->
  33. <view class="processStatus" v-if="clzt==0">
  34. <view class="info-tit margin-left-xs">
  35. <text class="cuIcon-titles margin-right-xs"></text>
  36. 处理内容
  37. </view>
  38. <view class="padding-lr padding-bottom-lg">
  39. <form action="">
  40. <radio-group name="gender" class="" @change="RadioChange">
  41. <label class="margin-right">
  42. <radio value="0" checked /><text>单个处理</text>
  43. </label>
  44. <label>
  45. <radio value="1" /><text>批量处理</text>
  46. </label>
  47. </radio-group>
  48. <view class="cu-form-group">
  49. <textarea class="JTxtArea lg" :maxlength="50" :data-maxnum="reason.length+'/50'"
  50. placeholder="备注信息,最多可输入50个字..." auto-height v-model="textareaMsg" @input="inputReason"
  51. :name="reason"></textarea>
  52. </view>
  53. <view class="btn-area">
  54. <button class="bg-orange round missReport margin-top"
  55. @click="$noMultipleClicks(alarmSubmit,1)">误 报
  56. </button>
  57. <button class="bg-blue round missReport margin-top "
  58. @click="$noMultipleClicks(alarmSubmit,0)">非 误 报
  59. </button>
  60. </view>
  61. </form>
  62. </view>
  63. </view>
  64. <!-- 处理内容end -->
  65. <!-- 处理信息start -->
  66. <view class="processStatus" v-else>
  67. <view class="info-tit margin-left-xs">
  68. <text class="cuIcon-titles margin-right-xs"></text>
  69. 处理信息
  70. </view>
  71. <view class="info-content">
  72. <view class="info-one-info ">
  73. <text>是否误报:</text>
  74. <text>{{getData.clwb!='0'?'是':'否'}}</text>
  75. </view>
  76. <view>
  77. <text>处理人:</text>
  78. <text>{{getData.clr}}</text>
  79. </view>
  80. <view>
  81. <text>处理时间:</text>
  82. <text>{{getData.clsj}}</text>
  83. </view>
  84. <view>
  85. <text>处理内容:</text>
  86. <text>{{getData.clnr}}</text>
  87. </view>
  88. </view>
  89. </view>
  90. <!-- 处理状态end -->
  91. </view>
  92. </view>
  93. </template>
  94. <script>
  95. export default {
  96. data() {
  97. return {
  98. noClick: true,
  99. modalName: null,
  100. reason: '',
  101. type: 1,
  102. textareaMsg: '',
  103. getData: {},
  104. radioOne: 0,
  105. clzt: 0,
  106. url:''
  107. }
  108. },
  109. onLoad: function(option) {
  110. this.type = option.type;
  111. this.getDetailData({
  112. "type": option.type,
  113. "id": option.id
  114. });
  115. // let url = "";
  116. switch (parseInt(option.type)) {
  117. case 1:
  118. this.url = "报警主机"
  119. break;
  120. case 2:
  121. this.url = "水系统"
  122. break;
  123. case 4:
  124. this.url = "消防栓监测"
  125. break;
  126. case 6:
  127. this.url = "RTU测控终端"
  128. break;
  129. case 7:
  130. this.url = "电气火灾"
  131. break;
  132. case 16:
  133. this.url = "视频告警"
  134. break;
  135. case 17:
  136. this.url = "电梯报警"
  137. break;
  138. case 128:
  139. this.url = "井盖监测"
  140. break;
  141. case 129:
  142. this.url = "地磁"
  143. break;
  144. case 130:
  145. this.url = "门磁"
  146. break;
  147. case 131:
  148. this.url = "可燃气体"
  149. break;
  150. default:
  151. break;
  152. }
  153. // uni.setNavigationBarTitle({
  154. // title: this.url + '(未处理)'
  155. // });
  156. },
  157. mounted(){
  158. document.querySelector('.uni-page-head-hd').style.display = 'none'
  159. },
  160. methods: {
  161. async getDetailData(params = {}) {
  162. const res = await this.$myRequest({
  163. url: 'ComprehensiveAlarm/getAlarmDetails',
  164. data: params,
  165. showLoading: true
  166. })
  167. this.getData = res.data.data[0];
  168. this.clzt=this.getData.clzt;
  169. if (this.clzt!=0) {
  170. uni.setNavigationBarTitle({
  171. title: this.url+'(已处理)'
  172. });
  173. } else {
  174. uni.setNavigationBarTitle({
  175. title: this.url+'(未处理)'
  176. });
  177. }
  178. console.log(this.getData)
  179. },
  180. async powerSubmitRes(params = {}) {
  181. const res = await this.$myRequest({
  182. url: 'ComprehensiveAlarm/setAlarmHandling',
  183. data: params
  184. })
  185. if (res.data.flag) {
  186. uni.showToast({
  187. title: "提交成功",
  188. });
  189. setTimeout(() => {
  190. uni.navigateTo({
  191. url: '/pages/processList/processList?type=' + this.type,
  192. });
  193. }, 1000);
  194. }
  195. },
  196. //误报 非误报
  197. alarmSubmit(params) {
  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 = params;
  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>