index.vue 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245
  1. <template>
  2. <scroll-view class="scroll-height" :scroll-y="true" :data-theme="'theme-' + proxy.$settingStore.themeColor.name">
  3. <view class="alarmDetails-container">
  4. <view class="flex bg-white p15 mb15">
  5. <image style="width: 40px; height: 40px; margin: auto 15px auto 0" :src="dataArray.typeImg ? dataArray.typeImg : '/static/images/404.png'" mode="aspectFill"></image>
  6. <view style="margin: auto auto auto 0">
  7. <view style="font-size: 15px"> {{ dataArray.timestamp ? dataArray.timestamp.replace("T", " ") : "" }} </view>
  8. </view>
  9. <view style="margin: auto 0 auto 0">
  10. <view style="font-size: 15px" :style="`color:${dataArray.handleStatus == 1 ? '#16bf00' : 'red'}`">
  11. {{ dataArray.handleStatus == 1 ? "已处理" : dataArray.handleStatus == 0 ? "未处理" : "" }}
  12. </view>
  13. </view>
  14. </view>
  15. <view class="bg-white p15 mb15">
  16. <uni-section class="block mb10" title="基本信息" type="line"></uni-section>
  17. <view class="tableType3 p0">
  18. <u-row v-for="da in dataList" :key="da">
  19. <u-col span="4">
  20. <view style="text-align: right; padding: 0px 5px 0px 5px">{{ da.title }}</view>
  21. </u-col>
  22. <u-col span="8">
  23. <view style="text-align: left; padding: 0px 5px 0px 5px">{{ da.value }}</view>
  24. </u-col>
  25. </u-row>
  26. </view>
  27. </view>
  28. <view class="bg-white p15 mb15" v-if="dataArray.handleStatus == 1">
  29. <uni-section class="block mb10" title="处理信息" type="line"></uni-section>
  30. <view class="tableType3 p0">
  31. <u-row v-for="da in dataList2" :key="da">
  32. <u-col span="4">
  33. <view style="text-align: right; padding: 0px 5px 0px 5px">{{ da.title }}</view>
  34. </u-col>
  35. <u-col span="8">
  36. <view style="text-align: left; padding: 0px 5px 0px 5px">{{ da.value }}</view>
  37. </u-col>
  38. </u-row>
  39. </view>
  40. </view>
  41. <view class="bg-white p15 mb15">
  42. <uni-section class="block mb10" title="处理内容" type="line"></uni-section>
  43. <view>
  44. <u-radio-group v-model="handleRange" placement="row" v-if="dataArray.handleStatus != 1">
  45. <u-radio
  46. v-for="han in handleRangeList"
  47. :key="han"
  48. :activeColor="proxy.$settingStore.themeColor.color"
  49. :label="han.label"
  50. :name="han.value"
  51. style="margin: 0 15px 15px 0"
  52. :labelSize="13"
  53. :iconSize="10"
  54. ></u-radio>
  55. </u-radio-group>
  56. <u--textarea
  57. v-model="dataArray.handleContent"
  58. placeholder="备注信息,最多可输入50个字"
  59. :count="true"
  60. maxlength="50"
  61. style="margin: 0 0 15px 0"
  62. :disabled="dataArray.handleStatus == 1"
  63. ></u--textarea>
  64. </view>
  65. <view class="flex" v-if="dataArray.handleStatus != 1">
  66. <u-button
  67. type="primary"
  68. text="提交"
  69. shape="circle"
  70. :customStyle="{
  71. width: '80px',
  72. height: '30px',
  73. marginRight: '15px',
  74. }"
  75. @click="handleSubmit(1)"
  76. ></u-button>
  77. </view>
  78. </view>
  79. </view>
  80. </scroll-view>
  81. </template>
  82. <script setup>
  83. import { onLoad, onShow, onReady, onHide, onLaunch, onNavigationBarButtonTap, onPageScroll } from "@dcloudio/uni-app";
  84. import { ref, reactive, computed, getCurrentInstance, toRefs, inject } from "vue";
  85. import { eleInspectList, dealPutEle, persInspectList, dealPutPer } from "@/api/business/zhxf/fireInspect/index.js";
  86. const { proxy } = getCurrentInstance();
  87. const dataArray = ref({});
  88. const dataList = ref([
  89. { title: "督察单编号", value: "" },
  90. { title: "督察单内容", value: "" },
  91. ]);
  92. const dataList2 = ref([
  93. { title: "处理账号/电话", value: "" },
  94. { title: "处理时间", value: "" },
  95. // {
  96. // title: "处理内容",
  97. // value: "",
  98. // },
  99. ]);
  100. const deviceName = ref("");
  101. const alarmTime = ref("");
  102. const id = ref("");
  103. const productName = ref("");
  104. const pageSize = ref(20);
  105. const current = ref(1);
  106. const total = ref(0);
  107. const handleRange = ref(1);
  108. const handleRangeList = ref([
  109. { label: "单个处理", value: 1 },
  110. { label: "批量处理", value: 0 },
  111. ]);
  112. /**
  113. * @页面初始化
  114. */
  115. function init() {
  116. selectListApi();
  117. }
  118. /**
  119. * @列表查询
  120. * @api接口查询
  121. */
  122. function selectListApi() {
  123. if (productName.value == "电子督察单") {
  124. getDetail(eleInspectList, "电子");
  125. // eleInspectList({
  126. // id: id.value,
  127. // pageNum: current.value,
  128. // pageSize: pageSize.value,
  129. // }).then((requset) => {
  130. // if (requset.status === "SUCCESS") {
  131. // dataArray.value = requset.data.records[0];
  132. // dataList.value[0].value = requset.data.records[0].superviseCode;
  133. // dataList.value[1].value = requset.data.records[0].content;
  134. // dataList2.value[0].value = requset.data.records[0].handlePhone;
  135. // dataList2.value[1].value = requset.data.records[0].handleTime;
  136. // total.value = requset.data.total;
  137. // }
  138. // });
  139. } else {
  140. getDetail(persInspectList, "人工");
  141. // persInspectList({
  142. // id: id.value,
  143. // pageNum: current.value,
  144. // pageSize: pageSize.value,
  145. // }).then((requset) => {
  146. // if (requset.status === "SUCCESS") {
  147. // dataArray.value = requset.data.records[0];
  148. // dataList.value[0].value = requset.data.records[0].artificialCode;
  149. // dataList.value[1].value = requset.data.records[0].content;
  150. // dataList2.value[0].value = requset.data.records[0].handlePhone;
  151. // dataList2.value[1].value = requset.data.records[0].handleTime;
  152. // total.value = requset.data.total;
  153. // }
  154. // });
  155. }
  156. function getDetail(param, param2) {
  157. param({
  158. id: id.value,
  159. pageNum: current.value,
  160. pageSize: pageSize.value,
  161. }).then((requset) => {
  162. if (requset.status === "SUCCESS") {
  163. dataArray.value = requset.data.records[0];
  164. dataList.value[0].value = param2 == "电子" ? requset.data.records[0].superviseCode : requset.data.records[0].artificialCode;
  165. dataList.value[1].value = requset.data.records[0].content;
  166. dataList2.value[0].value = requset.data.records[0].handlePhone;
  167. dataList2.value[1].value = requset.data.records[0].handleTime;
  168. total.value = requset.data.total;
  169. }
  170. });
  171. }
  172. }
  173. /**
  174. * @提交
  175. */
  176. function handleSubmit() {
  177. if (productName.value == "电子督察单") {
  178. dealPutEle({
  179. id: dataArray.value.id,
  180. handleContent: dataArray.value.handleContent,
  181. handleRange: handleRange.value,
  182. }).then((requset) => {
  183. if (requset.status === "SUCCESS") {
  184. proxy.$tab.navigateTo(`/pages/common/success/index?codeName=提交成功`);
  185. }
  186. });
  187. } else {
  188. dealPutPer({
  189. id: dataArray.value.id,
  190. handleContent: dataArray.value.handleContent,
  191. handleRange: handleRange.value,
  192. }).then((requset) => {
  193. if (requset.status === "SUCCESS") {
  194. proxy.$tab.navigateTo(`/pages/common/success/index?codeName=提交成功`);
  195. }
  196. });
  197. }
  198. }
  199. onReady(() => {});
  200. onShow(() => {
  201. //调用系统主题颜色
  202. proxy.$settingStore.systemThemeColor([1]);
  203. });
  204. onLoad((options) => {
  205. if ("deviceName" in options) {
  206. deviceName.value = options.deviceName;
  207. }
  208. if ("alarmTime" in options) {
  209. alarmTime.value = options.alarmTime;
  210. }
  211. if ("id" in options) {
  212. id.value = options.id;
  213. }
  214. if ("productName" in options) {
  215. productName.value = options.productName;
  216. }
  217. init();
  218. });
  219. </script>
  220. <style lang="scss" scoped>
  221. :deep(.u-textarea__field) {
  222. font-size: 13px;
  223. }
  224. </style>