You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

business-processie.vue 3.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  1. <template>
  2. <view class="content">
  3. <view class="card">
  4. <text>请选择具体业务:</text>
  5. <uni-data-select v-model="state.businessTypeVal" :localdata="state.businessRange" @change="changeBusiness"
  6. :clear="false"></uni-data-select>
  7. </view>
  8. <view class="example-body">
  9. <uni-datetime-picker v-model="state.range" type="daterange" />
  10. <button size="mini" style="color: #ffffff;
  11. backgroundColor: rgb(118, 200, 77);
  12. borderColor: rgb(118, 200, 77);
  13. font-size: 26rpx;
  14. flex-shrink: 0;margin-left: 20rpx;" @click="search(1)">搜索</button>
  15. </view>
  16. <view class="uni-container">
  17. <uni-table ref="table" border stripe emptyText="暂无更多数据">
  18. <uni-tr>
  19. <uni-th width="140" align="center">业务类型</uni-th>
  20. <uni-th width="150" align="center">操作时间</uni-th>
  21. <uni-th width="170" align="center">日志记录时间</uni-th>
  22. </uni-tr>
  23. <uni-tr v-for="(item,index) in state.listData" :key="index">
  24. <uni-td align="center">{{item.serviceType}}</uni-td>
  25. <uni-td align="center">{{item.operateTime}}</uni-td>
  26. <uni-td align="center">{{item.insertTime}}</uni-td>
  27. </uni-tr>
  28. </uni-table>
  29. </view>
  30. <!-- <view class="uni-pagination-box"><uni-pagination show-icon :page-size="state.pageSize" :current="state.pageNo"
  31. :total="state.total" @change="change" /></view> -->
  32. </view>
  33. </template>
  34. <script setup lang="ts">
  35. import { reactive } from "vue";
  36. import {
  37. businessType
  38. } from "@/datas/businessType.js"
  39. import { onLoad } from "@dcloudio/uni-app";
  40. import { businessApi } from "@/utils/network/api.js";
  41. import { stringToJson } from "@/utils/network/encryption";
  42. import { request } from "@/utils/network/request.js";
  43. import { getItem, StorageKeys } from "@/utils/storage";
  44. const state = reactive({
  45. startTime: Date.now(), //日期
  46. businessTypeVal: "",
  47. businessRange: [],
  48. listDataTitle: ["业务类型", "操作时间", "日志记录时间"],
  49. listData: [],
  50. range: ['', ''],
  51. pageSize: 10, //每页数据量
  52. pageNo: 1, // 当前页
  53. total: 0, // 数据总量
  54. })
  55. onLoad((option) => {
  56. state.businessRange = businessType;
  57. search(0)
  58. })
  59. const changeBusiness = (e) => {
  60. state.businessTypeVal = e
  61. console.log(e)
  62. }
  63. //业务完成日志
  64. const search = (val) => {
  65. if (val == 1) {
  66. var data = {
  67. opId: getItem(StorageKeys.OpenId),
  68. serviceType: state.businessTypeVal,
  69. startDate: state.range[0],
  70. endDate: state.range[1],
  71. // pageNo: state.pageNo,
  72. // pageSize: state.pageSize,
  73. };
  74. } else {
  75. var data = {
  76. opId: getItem(StorageKeys.OpenId),
  77. // pageNo: state.pageNo,
  78. // pageSize: state.pageSize,
  79. };
  80. }
  81. const options = {
  82. type: 2,
  83. data: data,
  84. method: "POST",
  85. showLoading: true,
  86. };
  87. request(businessApi, options).then((res) => {
  88. const data = stringToJson(res.bizContent);
  89. state.listData = [];
  90. state.listData = data.data
  91. state.total = data.data.length
  92. console.log("业务完成日志", data.data)
  93. });
  94. }
  95. const change = (e) => {
  96. console.log("e", e)
  97. state.pageNo = e.current
  98. search(1)
  99. }
  100. </script>
  101. <style scoped>
  102. .content {
  103. font-size: 32rpx;
  104. padding: 20rpx 30rpx;
  105. }
  106. .card {
  107. display: flex;
  108. margin: 0 20rpx;
  109. align-items: center;
  110. }
  111. .title {
  112. margin-bottom: 20rpx;
  113. }
  114. .uni-container {
  115. margin: 50rpx 0;
  116. }
  117. /deep/.uni-table-th,
  118. /deep/.uni-table-td {
  119. padding: 0 !important;
  120. font-size: 12px !important;
  121. }
  122. /deep/.uni-date__x-input,
  123. /deep/.uni-select {
  124. font-size: 13px;
  125. height: 30px;
  126. line-height: 30px;
  127. }
  128. /deep/.uni-stat__select {
  129. width: 360rpx;
  130. }
  131. /deep/.uni-select__selector-empty,
  132. /deep/.uni-select__selector-item {
  133. font-size: 13px !important;
  134. }
  135. /deep/.uni-date {
  136. width: 73% !important;
  137. }
  138. .example-body {
  139. display: flex;
  140. align-items: center;
  141. margin-top: 20rpx;
  142. }
  143. /deep/.uni-date-x {
  144. height: 76rpx !important;
  145. }
  146. </style>