unprocessDetail.vue 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190
  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)">非 误 报 </button>
  53. </view>
  54. </form>
  55. </view>
  56. </view>
  57. <!-- 处理内容end -->
  58. </view>
  59. </view>
  60. </template>
  61. <script>
  62. export default {
  63. data() {
  64. return {
  65. modalName: null,
  66. reason: '',
  67. type: 1,
  68. msg: '',
  69. getData: {},
  70. radioOne: 0,
  71. }
  72. },
  73. onLoad: function(option) {
  74. this.type = option.type;
  75. this.getDetailData({
  76. "type": option.type,
  77. "id": option.id
  78. })
  79. },
  80. methods: {
  81. async getDetailData(params = {}) {
  82. const res = await this.$myRequest({
  83. url: 'ComprehensiveAlarm/getAlarmDetails',
  84. data: params,
  85. showLoading: true
  86. })
  87. this.getData = res.data.data[0];
  88. console.log(this.getData)
  89. },
  90. async powerSubmitRes(params = {}) {
  91. const res = await this.$myRequest({
  92. url: 'ComprehensiveAlarm/setAlarmHandling',
  93. data: params
  94. })
  95. if (res.data.flag) {
  96. uni.showToast({
  97. title: "提交成功",
  98. });
  99. setTimeout(() => {
  100. uni.navigateTo({
  101. url: '/pages/processList/processList?type=' + this.type,
  102. });
  103. }, 1000);
  104. }
  105. },
  106. //拼接公共搜索条件
  107. // getSearchParamObj() {
  108. // let queryParam = {};
  109. // queryParam.id=this.getData.id;
  110. // return queryParam;
  111. // },
  112. alarmSubmit(query) {
  113. if (!this.msg) {
  114. uni.showToast({
  115. title: "请输入处理内容",
  116. icon: "none"
  117. });
  118. } else {
  119. let queryParam = {};
  120. queryParam.id=this.getData.id;
  121. queryParam.type=this.getData.dwtype;
  122. queryParam.device_code=this.getData.device_code;
  123. queryParam.if_batch=this.radioOne;
  124. queryParam.clwb=query;
  125. queryParam.ncmb=this.getData.ncmd;
  126. queryParam.clnr=this.msg;
  127. if (this.getData.dwtype == 1) {
  128. queryParam.data3=this.getData.data3;
  129. queryParam.data5=this.getData.data5;
  130. this.powerSubmitRes(queryParam)
  131. }
  132. if (this.getData.dwtype == 2||this.getData.dwtype == 7) {
  133. queryParam.data1=this.getData.data1;
  134. this.powerSubmitRes(queryParam)
  135. }
  136. if (this.getData.dwtype == 3) {
  137. queryParam.data2=this.getData.data2;
  138. this.powerSubmitRes(queryParam)
  139. }
  140. if (this.getData.dwtype == 6) {
  141. queryParam.data2=this.getData.data2;
  142. queryParam.data4=this.getData.data4;
  143. this.powerSubmitRes(queryParam)
  144. }
  145. if (this.getData.dwtype == 2) {
  146. queryParam.data1=this.getData.data1;
  147. this.powerSubmitRes(queryParam)
  148. }
  149. if (this.getData.dwtype == 2) {
  150. queryParam.data1=this.getData.data1;
  151. this.powerSubmitRes(queryParam)
  152. }
  153. }
  154. },
  155. RadioChange(e) {
  156. this.radioOne = e.detail.value;
  157. console.log(this.radioOne)
  158. },
  159. textareaAInput(e) {
  160. this.textareaAValue = e.detail.value
  161. },
  162. inputReason(e) {
  163. this.reason = e.detail.value;
  164. }
  165. }
  166. }
  167. </script>
  168. <style lang="scss">
  169. </style>