混凝土运输管理微信小程序、替班
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.

271 lines
6.0 KiB

2 weeks ago
  1. <template>
  2. <view class="content">
  3. <navbar title="关于我们" leftClick @leftClick="$utils.navigateBack" />
  4. <view class="mt40">
  5. <view v-for="(item, index) in applicationList" :key="index" class="re-card-p32">
  6. <view v-if="isEmpty" class="re-empty">
  7. <view>暂无数据</view>
  8. </view>
  9. <view class="flex-sb">
  10. <view class="flex">
  11. <image class="re-from-car" src="/static/icons/icon11.png"></image>
  12. <text>{{ item.name }}</text>
  13. </view>
  14. <view v-if="item.isReviewing" class="re-card-show">
  15. <text style="color:limegreen">系统审核中</text>
  16. </view>
  17. <view v-if="item.isRejected" class="re-card-show">
  18. <text style="color:#F40000">未通过审核</text>
  19. </view>
  20. </view>
  21. <!-- 轴数选择 -->
  22. <view class="flex-sb re-card-select mt20" @click="selectAxleCount(item)">
  23. <view>轴数</view>
  24. <view class="flex" style="color:#9E9E9E">
  25. <text v-if="item.showAxlePlaceholder">请选择</text>
  26. <view v-if="item.showAxleValue" style="color:#0d0d0d">{{ item.axleCount }}</view>
  27. <uv-icon v-if="item.showAxleIcon" name="arrow-right" size="16" color="#999"></uv-icon>
  28. </view>
  29. </view>
  30. <!-- 上传证件 -->
  31. <view class="flex-sb re-card-select" @click="handleDocuments(item)">
  32. <view>上传证件</view>
  33. <view v-if="item.showUploadPlaceholder" class="flex" style="color:#9E9E9E">
  34. <text>未上传</text>
  35. <uv-icon name="arrow-right" size="16" color="#999"></uv-icon>
  36. </view>
  37. <view v-if="item.showDocumentInfo" class="flex" style="color:#0d0d0d">
  38. <text>查看证件信息</text>
  39. <uv-icon name="arrow-right" size="16" color="#999"></uv-icon>
  40. </view>
  41. </view>
  42. <!-- 操作按钮 -->
  43. <view class="action-buttons mt20">
  44. <button class="btn-edit" @click="editApplication(item)">编辑</button>
  45. <button class="btn-delete" @click="deleteApplication(item)">删除</button>
  46. </view>
  47. </view>
  48. <!-- 添加申请按钮 -->
  49. <view class="add-application-btn" @click="addApplication">
  50. <uv-icon name="plus" size="24" color="#007AFF"></uv-icon>
  51. <text>新增申请</text>
  52. </view>
  53. </view>
  54. </view>
  55. </template>
  56. <script>
  57. import navbar from '@/components/base/navbar.vue'
  58. export default {
  59. components: {
  60. navbar
  61. },
  62. name: 'BaseShen',
  63. data() {
  64. return {
  65. isEmpty: false,
  66. applicationList: [
  67. {
  68. id: 1,
  69. name: '湘A12345',
  70. isReviewing: true,
  71. isRejected: false,
  72. showAxlePlaceholder: false,
  73. showAxleValue: true,
  74. showAxleIcon: true,
  75. axleCount: '4轴',
  76. showUploadPlaceholder: false,
  77. showDocumentInfo: true
  78. },
  79. {
  80. id: 2,
  81. name: '湘A67890',
  82. isReviewing: false,
  83. isRejected: true,
  84. showAxlePlaceholder: false,
  85. showAxleValue: true,
  86. showAxleIcon: true,
  87. axleCount: '3轴',
  88. showUploadPlaceholder: true,
  89. showDocumentInfo: false
  90. }
  91. ]
  92. }
  93. },
  94. onLoad() {
  95. uni.setNavigationBarTitle({
  96. title: '申请管理'
  97. });
  98. },
  99. methods: {
  100. selectAxleCount(item) {
  101. uni.showActionSheet({
  102. itemList: ['2轴', '3轴', '4轴', '5轴', '6轴'],
  103. success: (res) => {
  104. const axles = ['2轴', '3轴', '4轴', '5轴', '6轴'];
  105. item.axleCount = axles[res.tapIndex];
  106. item.showAxlePlaceholder = false;
  107. item.showAxleValue = true;
  108. }
  109. });
  110. },
  111. handleDocuments(item) {
  112. if (item.showUploadPlaceholder) {
  113. // 上传证件
  114. uni.chooseImage({
  115. count: 3,
  116. sizeType: ['compressed'],
  117. sourceType: ['camera', 'album'],
  118. success: (res) => {
  119. uni.showToast({
  120. title: '上传成功',
  121. icon: 'success'
  122. });
  123. item.showUploadPlaceholder = false;
  124. item.showDocumentInfo = true;
  125. }
  126. });
  127. } else {
  128. // 查看证件信息
  129. uni.navigateTo({
  130. url: `/pages_order/base/showcar?id=${item.id}`
  131. });
  132. }
  133. },
  134. editApplication(item) {
  135. uni.navigateTo({
  136. url: `/pages_order/base/yuan?id=${item.id}&mode=edit`
  137. });
  138. },
  139. deleteApplication(item) {
  140. uni.showModal({
  141. title: '确认删除',
  142. content: `确定要删除申请 ${item.name} 吗?`,
  143. success: (res) => {
  144. if (res.confirm) {
  145. const index = this.applicationList.findIndex(app => app.id === item.id);
  146. if (index > -1) {
  147. this.applicationList.splice(index, 1);
  148. uni.showToast({
  149. title: '删除成功',
  150. icon: 'success'
  151. });
  152. }
  153. }
  154. }
  155. });
  156. },
  157. addApplication() {
  158. uni.navigateTo({
  159. url: '/pages_order/base/yuan?mode=add'
  160. });
  161. }
  162. }
  163. }
  164. </script>
  165. <style scoped lang="scss">
  166. .content {
  167. padding: 20rpx;
  168. min-height: 100vh;
  169. background-color: #f5f5f5;
  170. }
  171. .mt40 {
  172. margin-top: 40rpx;
  173. }
  174. .mt20 {
  175. margin-top: 20rpx;
  176. }
  177. .re-card-p32 {
  178. background-color: #fff;
  179. border-radius: 10rpx;
  180. padding: 32rpx;
  181. margin-bottom: 20rpx;
  182. box-shadow: 0 2rpx 10rpx rgba(0, 0, 0, 0.1);
  183. }
  184. .re-empty {
  185. text-align: center;
  186. padding: 100rpx 0;
  187. color: #999;
  188. font-size: 28rpx;
  189. }
  190. .flex {
  191. display: flex;
  192. align-items: center;
  193. gap: 10rpx;
  194. }
  195. .flex-sb {
  196. display: flex;
  197. justify-content: space-between;
  198. align-items: center;
  199. }
  200. .re-from-car {
  201. width: 40rpx;
  202. height: 40rpx;
  203. }
  204. .re-card-show {
  205. padding: 8rpx 16rpx;
  206. border-radius: 20rpx;
  207. background-color: #f0f0f0;
  208. font-size: 24rpx;
  209. }
  210. .re-card-select {
  211. padding: 25rpx 0;
  212. border-bottom: 1rpx solid #f0f0f0;
  213. font-size: 28rpx;
  214. &:last-child {
  215. border-bottom: none;
  216. }
  217. }
  218. .action-buttons {
  219. display: flex;
  220. gap: 20rpx;
  221. justify-content: flex-end;
  222. button {
  223. padding: 15rpx 25rpx;
  224. border-radius: 25rpx;
  225. font-size: 26rpx;
  226. border: none;
  227. &.btn-edit {
  228. background-color: #007AFF;
  229. color: #fff;
  230. }
  231. &.btn-delete {
  232. background-color: #ff3b30;
  233. color: #fff;
  234. }
  235. }
  236. }
  237. .add-application-btn {
  238. display: flex;
  239. align-items: center;
  240. justify-content: center;
  241. gap: 10rpx;
  242. background-color: #fff;
  243. border: 2rpx dashed #007AFF;
  244. border-radius: 10rpx;
  245. padding: 60rpx;
  246. margin-top: 20rpx;
  247. color: #007AFF;
  248. font-size: 28rpx;
  249. }
  250. </style>