unprocessDetail.vue 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224
  1. <template>
  2. <view>
  3. <view class="timeBox flex justify-between align-center padding-lr-sm">
  4. <view class="time">2021-01-18 15:16:45</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>
  19. <text>设备地址:</text>
  20. <text>{{getData.unitinfo}}</text>
  21. </view>
  22. <view>
  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="msg" @input="inputReason"
  47. :value="reason"></textarea>
  48. </view>
  49. <view class="btn-area">
  50. <button class="bg-orange round missReport margin-top" @click="alarmSubmit(1)">误 报
  51. </button>
  52. <button class="bg-blue round missReport margin-top " @click="alarmSubmit(0)">非 误 报
  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. modalName: null,
  67. reason: '',
  68. type: 1,
  69. msg: '',
  70. getData: {},
  71. radioOne: 0,
  72. }
  73. },
  74. onLoad: function(option) {
  75. this.type = option.type;
  76. this.getDetailData({
  77. "type": option.type,
  78. "id": option.id
  79. });
  80. let url = "";
  81. switch (parseInt(option.type)) {
  82. case 1:
  83. url = "报警主机"
  84. break;
  85. case 2:
  86. url = "水系统"
  87. break;
  88. case 4:
  89. url = "消防栓监测"
  90. break;
  91. case 6:
  92. url = "RTU测控终端"
  93. break;
  94. case 7:
  95. url = "电气火灾"
  96. break;
  97. case 16:
  98. url = "视频告警"
  99. break;
  100. case 17:
  101. url = "电梯报警"
  102. break;
  103. case 128:
  104. url = "井盖监测"
  105. break;
  106. case 129:
  107. url = "地磁"
  108. break;
  109. case 130:
  110. url = "门磁"
  111. break;
  112. case 131:
  113. url = "可燃气体"
  114. break;
  115. default:
  116. break;
  117. }
  118. uni.setNavigationBarTitle({
  119. title: url+'(未处理)'
  120. });
  121. },
  122. methods: {
  123. async getDetailData(params = {}) {
  124. const res = await this.$myRequest({
  125. url: 'ComprehensiveAlarm/getAlarmDetails',
  126. data: params,
  127. showLoading: true
  128. })
  129. this.getData = res.data.data[0];
  130. console.log(this.getData)
  131. },
  132. async powerSubmitRes(params = {}) {
  133. const res = await this.$myRequest({
  134. url: 'ComprehensiveAlarm/setAlarmHandling',
  135. data: params
  136. })
  137. if (res.data.flag) {
  138. uni.showToast({
  139. title: "提交成功",
  140. });
  141. setTimeout(() => {
  142. uni.navigateTo({
  143. url: '/pages/processList/processList?type=' + this.type,
  144. });
  145. }, 1000);
  146. }
  147. },
  148. alarmSubmit(query) {
  149. if (!this.msg) {
  150. uni.showToast({
  151. title: "请输入处理内容",
  152. icon: "none"
  153. });
  154. } else {
  155. let queryParam = {};
  156. queryParam.id = this.getData.id;
  157. queryParam.type = this.getData.dwtype;
  158. queryParam.device_code = this.getData.device_code;
  159. queryParam.if_batch = this.radioOne;
  160. queryParam.clwb = query;
  161. queryParam.ncmd = this.getData.ncmd;
  162. queryParam.clnr = this.msg;
  163. alert(this.getData.dwtype)
  164. if (this.getData.dwtype == 1) {
  165. queryParam.data3 = this.getData.data3;
  166. queryParam.data5 = this.getData.data5;
  167. this.powerSubmitRes(queryParam);
  168. return;
  169. }
  170. if (this.getData.dwtype == 2) {
  171. queryParam.data1 = this.getData.data1;
  172. this.powerSubmitRes(queryParam);
  173. return;
  174. }
  175. if (this.getData.dwtype == 7) {
  176. queryParam.data1 = this.getData.data1;
  177. this.powerSubmitRes(queryParam);
  178. return;
  179. }
  180. if (this.getData.dwtype == 3) {
  181. queryParam.data2=this.getData.data2;
  182. this.powerSubmitRes(queryParam);
  183. return;
  184. }
  185. if (this.getData.dwtype == 6) {
  186. queryParam.data2=this.getData.data2;
  187. queryParam.data4=this.getData.data4;
  188. this.powerSubmitRes(queryParam);
  189. return;
  190. }
  191. this.powerSubmitRes(queryParam)
  192. }
  193. },
  194. RadioChange(e) {
  195. this.radioOne = e.detail.value;
  196. console.log(this.radioOne)
  197. },
  198. textareaAInput(e) {
  199. this.textareaAValue = e.detail.value
  200. },
  201. inputReason(e) {
  202. this.reason = e.detail.value;
  203. }
  204. }
  205. }
  206. </script>
  207. <style lang="scss">
  208. </style>