您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

query-company-list.vue 5.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302
  1. <!-- 单位查询列表 -->
  2. <template>
  3. <view class="as-layout-horizontal as-gravity-center top">
  4. <view class="search-box as-layout-horizontal">
  5. <image :src="`${$imgUrl}service/icon-search.png`" class="icon"></image>
  6. <input class="search" placeholder="请输入单位名称" v-model="state.searchInput" @input="inputHandle" />
  7. </view>
  8. <view class="search-btn" @click="doSearch">搜索</view>
  9. </view>
  10. <!-- 列表 -->
  11. <view class="list" v-if="state.list.length >0">
  12. <view class="item" v-for="(item,index) in state.list" :key="index">
  13. <view class="head">
  14. <view class="name">
  15. <text class="title">申请时间 {{item.createTime}}</text>
  16. </view>
  17. <view class="status" :class="item.userApplyStatus === 1 ? 'text-orange' : 'text-green'">
  18. {{item.userApplyStatus === 1 ? '审核中' : '审核通过'}}
  19. </view>
  20. </view>
  21. <view class="detail">
  22. <view class="order-text">
  23. <text class="type">单位名称:</text>
  24. <text class="value">{{item.deptName}}</text>
  25. </view>
  26. </view>
  27. <view class="btns" v-if="item.status !== 1">
  28. <view class="btn btn-primary as-gravity-center"
  29. @click="$util.navTo('/subpackage/personal-center/car-submit-record?deptId='+item.deptID)">车辆提交记录
  30. </view>
  31. </view>
  32. </view>
  33. </view>
  34. <view class="blank" v-if="state.list.length==0 && state.keyupStatus">
  35. <view class="as-layout-horizontal as-gravity-center content">没有找到您查询的<text
  36. class="text-error">{{state.searchInput}}</text>信息</view>
  37. </view>
  38. </template>
  39. <script setup lang="ts">
  40. import {
  41. reactive
  42. } from "vue";
  43. import {
  44. onLoad
  45. } from "@dcloudio/uni-app";
  46. import {
  47. msg,
  48. navTo
  49. } from '@/utils/utils';
  50. import {
  51. request
  52. } from "@/utils/network/request.js";
  53. import {
  54. gongWuCheDanWeiChaXun
  55. } from "@/utils/network/api.js";
  56. import {
  57. stringToJson
  58. } from "@/utils/network/encryption";
  59. onLoad((option) => {
  60. state.searchInput = option.deptShortName ? option.deptShortName : "";
  61. console.log(option);
  62. if (state.searchInput != "") {
  63. doSearch()
  64. }
  65. })
  66. const state = reactive({
  67. //搜索关键字
  68. searchInput: '',
  69. keyupStatus: false,
  70. //申请列表 status:1-审核中 2-审核通过
  71. list: []
  72. })
  73. /* 输入 */
  74. const inputHandle = (event : any) => {
  75. // console.log(event);
  76. state.searchInput = event.target.value;
  77. state.keyupStatus = false;
  78. }
  79. /* 搜索 */
  80. const doSearch = () => {
  81. if (!state.searchInput) {
  82. msg("请输入搜索关键字");
  83. return
  84. }
  85. const options = {
  86. type: 2,
  87. data: {
  88. companyName: state.searchInput,
  89. },
  90. method: "POST",
  91. showLoading: true,
  92. };
  93. request(gongWuCheDanWeiChaXun, options).then((res) => {
  94. const result = stringToJson(res.bizContent)
  95. if (result.companys.length > 0) {
  96. state.list = result.companys
  97. } else {
  98. state.list = [];
  99. state.keyupStatus = true;
  100. }
  101. })
  102. }
  103. </script>
  104. <style>
  105. page {
  106. background-color: #EEF7F7;
  107. }
  108. </style>
  109. <style lang="scss" scoped>
  110. .top {
  111. padding: 30rpx 30rpx 0px;
  112. }
  113. .search-box {
  114. margin-right: 20rpx;
  115. height: 82rpx;
  116. border-radius: 40rpx;
  117. background: #ffffff;
  118. display: flex;
  119. justify-content: center;
  120. align-items: center;
  121. border: 1px solid #dcdcdc;
  122. box-sizing: border-box;
  123. }
  124. .search-box .icon {
  125. width: 38rpx;
  126. height: 38rpx;
  127. margin: 0 28rpx;
  128. }
  129. .search-box .search {
  130. flex: 1;
  131. height: 100%;
  132. font-size: 28rpx;
  133. color: #333333;
  134. }
  135. .search-btn {
  136. color: white;
  137. background-color: #00B38B;
  138. width: 140rpx;
  139. height: 80rpx;
  140. line-height: 80rpx;
  141. font-size: 32rpx;
  142. border-radius: 40rpx;
  143. text-align: center;
  144. }
  145. .add-btn {
  146. padding: 30rpx 40rpx;
  147. position: fixed;
  148. bottom: 0;
  149. width: 100%;
  150. background-color: #EEF7F7;
  151. box-sizing: border-box;
  152. }
  153. .list {
  154. padding: 30rpx 30rpx 140rpx;
  155. display: flex;
  156. flex-direction: column;
  157. }
  158. .list .item {
  159. background: #ffffff;
  160. box-shadow: 0rpx 2rpx 6rpx 0rpx rgba(223, 223, 223, 0.8);
  161. border-radius: 20rpx;
  162. box-sizing: border-box;
  163. display: flex;
  164. flex-direction: column;
  165. margin-bottom: 30rpx;
  166. }
  167. .list .item .head {
  168. display: flex;
  169. justify-content: space-between;
  170. align-items: center;
  171. padding: 20rpx 28rpx;
  172. border-bottom: 1px solid #dcdcdc;
  173. }
  174. .list .item .head .icon {
  175. width: 48rpx;
  176. height: 48rpx;
  177. }
  178. .list .item .head .name {
  179. display: flex;
  180. align-items: center;
  181. }
  182. .list .text-green {
  183. font-size: 26rpx;
  184. color: #00b38b;
  185. }
  186. .list .text-orange {
  187. font-size: 26rpx;
  188. color: #ff8000;
  189. }
  190. .list .title {
  191. font-size: 30rpx;
  192. color: #333;
  193. }
  194. .list .detail {
  195. display: flex;
  196. justify-content: space-between;
  197. align-items: center;
  198. padding: 30rpx 32rpx;
  199. }
  200. .list .detail .type {
  201. font-size: 26rpx;
  202. color: #999;
  203. }
  204. .list .detail .value {
  205. font-size: 26rpx;
  206. color: #333;
  207. }
  208. .list .finished .detail .value {
  209. color: #999;
  210. }
  211. .list .detail .odd {
  212. margin: 20rpx 0;
  213. }
  214. .list .cny {
  215. font-size: 26rpx;
  216. color: #333;
  217. }
  218. .list .finished .cny {
  219. color: #999;
  220. }
  221. .list .amount {
  222. font-size: 40rpx;
  223. font-weight: bold;
  224. }
  225. .list .finished .amount {
  226. color: #999;
  227. }
  228. .list .btns {
  229. display: flex;
  230. align-items: center;
  231. justify-content: flex-end;
  232. border-top: 1px solid #dcdcdc;
  233. margin: 0 30rpx;
  234. padding: 20rpx 0;
  235. }
  236. .list .btn {
  237. height: 60rpx;
  238. // line-height: 60rpx;
  239. border-radius: 30rpx;
  240. padding: 0 24rpx;
  241. font-size: 26rpx;
  242. box-sizing: border-box;
  243. margin-right: 20rpx;
  244. }
  245. .list .btns .btn:last-child {
  246. margin: 0;
  247. }
  248. .list .btn-primary {
  249. border: 1px solid #00b38b;
  250. color: #00b38b;
  251. }
  252. .list .btn-normal {
  253. border: 1px solid #dcdcdc;
  254. color: #333;
  255. }
  256. .blank .content {
  257. font-size: 32rpx;
  258. padding-top: 50rpx;
  259. }
  260. .blank .content .text-error {
  261. font-weight: bold;
  262. font-size: 30rpx;
  263. }
  264. </style>