handled.vue 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260
  1. <template>
  2. <view class="container">
  3. <Search ref="searchRef" @reset="reset" @confirm="query"></Search>
  4. <view class="none-data" v-if="dataList.length == 0">
  5. <text>没有 已完结 数据</text>
  6. <image src="/static/image/no-data.png"></image>
  7. </view>
  8. <scroll-view scroll-y="true" @scroll="scroll" :scroll-top="scrollTop" style="height: 540px">
  9. <u-swipe-action>
  10. <view v-if="dataList.length > 0">
  11. <view v-for="(item, index) in dataList" :key="index">
  12. <view class="alarm-box">
  13. <u-swipe-action-item :options="swipeOption" :name="index" @click="viewDetail(item)">
  14. <view class="box-header">
  15. <view class="box-title">{{ item.company_name }}</view>
  16. </view>
  17. </u-swipe-action-item>
  18. <view class="box-body">
  19. <view class="body-item">
  20. <view class="left">公司名称:</view>
  21. <view class="right">{{ item.company_name }}</view>
  22. </view>
  23. <view class="body-item">
  24. <view class="left">区域:</view>
  25. <view class="right">{{ item.org_name }}</view>
  26. </view>
  27. <view class="body-item">
  28. <view class="left">告警类型:</view>
  29. <view class="right">{{ item.warn_type_name }}</view>
  30. </view>
  31. <view class="body-item">
  32. <view class="left">创建时间:</view>
  33. <view class="right">{{ item.work_order_start_time }}</view>
  34. </view>
  35. <view class="body-item">
  36. <view class="left">完结时间:</view>
  37. <view class="right">{{ item.work_order_end_time }}</view>
  38. </view>
  39. <view class="body-item">
  40. <view class="left">流程耗时:</view>
  41. <view class="right">{{ (item.work_order_continue_time / 60).toFixed(2) }} 时</view>
  42. </view>
  43. </view>
  44. </view>
  45. </view>
  46. </view>
  47. </u-swipe-action>
  48. </scroll-view>
  49. <u-modal v-model="modalDetailInfo" :show="modalDetailShow" :title="modalDetailTitle" :showCancelButton="true" @cancel="modalDetailShow = false" :showConfirmButton="showEditBtn" @confirm="confirmSubmite">
  50. <!-- <view class="slot-content"><rich-text :nodes="content"></rich-text></view> -->
  51. <view class="slot-content" style="width: 100%;">
  52. <scroll-view scroll-y="true" style="height: 230px;">
  53. <view class="modal-item">
  54. <view class="left">公司名称:</view>
  55. <view class="right">{{ modalDetailInfo.warnDetail.company_name }}</view>
  56. </view>
  57. <view class="modal-item">
  58. <view class="left">告警设备:</view>
  59. <view class="right">{{ modalDetailInfo.warnDetail.device_name }}</view>
  60. </view>
  61. <view class="modal-item">
  62. <view class="left">告警类型:</view>
  63. <view class="right">{{ modalDetailInfo.warnDetail.warn_type_name }}</view>
  64. </view>
  65. <view class="modal-item">
  66. <view class="left">告警时间:</view>
  67. <view class="right">{{ modalDetailInfo.warnDetail.warn_start_time }}</view>
  68. </view>
  69. <view v-for="(item2, index2) in modalDetailInfo.processInfoList" :key="index2" style="margin: 10px 0;border-top: 1px solid #333;">
  70. <view class="modal-item">
  71. <view class="left" v-if="item2.work_order_type == 0 || item2.work_order_type == 1">发起人:</view>
  72. <view class="left" v-if="item2.work_order_type == 2">督查审核:</view>
  73. <view class="left" v-if="item2.work_order_type == 3">督查转交:</view>
  74. <view class="left" v-if="item2.work_order_type == 4">现场督查:</view>
  75. <view class="left" v-if="item2.work_order_type == 5">企业上传:</view>
  76. <view class="right" v-if="item2.work_order_type == 0 || item2.work_order_type == 2 || item2.work_order_type == 3 || item2.work_order_type == 4">督查部门</view>
  77. <view class="right" v-if="item2.work_order_type == 1 || item2.work_order_type == 5">企业用户</view>
  78. </view>
  79. <view class="modal-item">
  80. <view class="left">时间:</view>
  81. <view class="right">{{ item2.work_order_process_time }}</view>
  82. </view>
  83. <view class="modal-item">
  84. <view class="left" v-if="item2.work_order_type == 0">催办内容:</view>
  85. <view class="left" v-if="item2.work_order_type == 1">上报备注::</view>
  86. <view class="left" v-if="item2.work_order_type == 2">审核意见:</view>
  87. <view class="left" v-if="item2.work_order_type == 3">备注:</view>
  88. <view class="left" v-if="item2.work_order_type == 4">上报备注:</view>
  89. <view class="left" v-if="item2.work_order_type == 5">上报备注:</view>
  90. <view class="right" v-if="item2.work_order_type == 2">{{ item2.audit_state_name }}</view>
  91. <view class="right" v-if="item2.work_order_type != 2">{{ item2.content }}</view>
  92. </view>
  93. <view class="modal-item" v-if="item2.work_order_type == 2">
  94. <view class="left">备注:</view>
  95. <view class="right">{{ item2.content }}</view>
  96. </view>
  97. <view v-if="item2.picture_url" class="modal-item">
  98. <view class="left" v-if="item2.work_order_type == 1 || item2.work_order_type == 4 || item2.work_order_type == 5">上报文件:</view>
  99. <view class="right"><u--image :showLoading="true" :src="item2.picture_url"></u--image></view>
  100. </view>
  101. </view>
  102. </scroll-view>
  103. </view>
  104. </u-modal>
  105. </view>
  106. </template>
  107. <script>
  108. import config from "@/common/config";
  109. import { log } from "@/utils/base.js";
  110. import api from "@/common/api.js";
  111. import Search from "./search.vue";
  112. export default {
  113. name: "handling",
  114. components: {
  115. Search,
  116. },
  117. data() {
  118. return {
  119. needQuery: true,
  120. isQuerying: false,
  121. dataList: [],
  122. fileList: [],
  123. search: {
  124. pageIndex: 1,
  125. pageSize: 10,
  126. params: {
  127. company_name: "",
  128. warn_type: "",
  129. },
  130. },
  131. swipeOption: [
  132. {
  133. text: "查看",
  134. style: {
  135. backgroundColor: "#f9ae3d",
  136. },
  137. },
  138. ],
  139. scrollTop: 0,
  140. oldScrollTop: 0,
  141. modalDetailShow: false,
  142. modalDetailInfo: {
  143. warnDetail: {},
  144. processInfoList: [],
  145. },
  146. showEditBtn: false,
  147. modalDetailTitle: "查看详情",
  148. textContent: "",
  149. workOrderId: "",
  150. };
  151. },
  152. mounted() {
  153. this.reset();
  154. },
  155. options: { styleIsolation: "shared" },
  156. methods: {
  157. query(nextPage) {
  158. if (this.needQuery || !nextPage) {
  159. this.search.params.company_name = this.$refs.searchRef.searchInfo.company_name;
  160. this.search.params.warn_type = this.$refs.searchRef.searchInfo.warn_type;
  161. var search = JSON.parse(JSON.stringify(this.search));
  162. if (!search.params.company_name) {
  163. delete search.params.company_name;
  164. }
  165. if (!search.params.warn_type) {
  166. delete search.params.warn_type;
  167. }
  168. if (!nextPage) {
  169. this.dataList = [];
  170. this.needQuery = true;
  171. this.goTop();
  172. }
  173. api.getFinishedWorkOrderByOrgLaw(search).then(({ total, rows }) => {
  174. if ((this.search.pageIndex - 1) * this.search.pageSize < total) {
  175. this.dataList.push(...rows);
  176. this.isQuerying = false;
  177. } else {
  178. this.needQuery = false;
  179. }
  180. log("getFinishedWorkOrderByOrgLaw", search, rows, this.dataList);
  181. });
  182. }
  183. },
  184. scroll(e) {
  185. this.oldScrollTop = e.detail.scrollTop;
  186. if (e.detail.scrollHeight - e.detail.scrollTop <= 400 && !this.isQuerying) {
  187. //console.log("到达底部");
  188. this.isQuerying = true;
  189. this.search.pageIndex++;
  190. this.query(true);
  191. }
  192. },
  193. goTop() {
  194. this.scrollTop = this.oldScrollTop;
  195. this.$nextTick(() => {
  196. this.scrollTop = 0;
  197. });
  198. },
  199. reset() {
  200. this.search.pageIndex = 1;
  201. this.needQuery = true;
  202. this.isQuerying = false;
  203. this.query();
  204. },
  205. viewDetail(item) {
  206. this.workOrderId = item.work_order_id;
  207. api.getWorkOrderDetailByOrgLaw(item.work_order_id).then(({ data }) => {
  208. log("getWorkOrderDetailByOrgLaw====>", data);
  209. this.modalDetailInfo = data;
  210. this.modalDetailShow = true;
  211. });
  212. },
  213. hideDetailModal() {
  214. this.modalDetailShow = false;
  215. },
  216. },
  217. };
  218. </script>
  219. <style lang="scss">
  220. .container {
  221. padding: 10px 5px;
  222. font-size: 14px;
  223. line-height: 24px;
  224. }
  225. .btn-search-group {
  226. display: flex;
  227. justify-content: space-between;
  228. margin-top: 15px;
  229. }
  230. .none-data {
  231. margin-top: 10%;
  232. display: flex;
  233. flex-direction: column;
  234. justify-content: center;
  235. align-items: center;
  236. font-size: 20px;
  237. color: $uni-color-primary;
  238. }
  239. /deep/ .u-modal {
  240. &__title {
  241. padding-top: 15px;
  242. }
  243. &__content {
  244. padding: 10px;
  245. }
  246. }
  247. .modal-item {
  248. margin: 0;
  249. width: 100%;
  250. display: flex;
  251. flex: 1;
  252. .left {
  253. font-weight: 600;
  254. padding-right: 5px;
  255. white-space: nowrap;
  256. }
  257. }
  258. </style>