展品维保小程序前端代码接口
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.

336 lines
8.4 KiB

  1. <template>
  2. <view class="maintain-container">
  3. <!-- 顶部选择器区域 -->
  4. <view class="selector-section">
  5. <!-- 紧急程度选择器 -->
  6. <view class="selector-item" @click="openUrgencyPicker">
  7. <text class="selector-label" :class="{ active: selectedUrgency !== '紧急程度' }">{{ selectedUrgency }}</text>
  8. <uv-icon name="arrow-down-fill" size="14" :color="selectedUrgency !== '紧急程度' ? '#C70019' : '#000'"></uv-icon>
  9. </view>
  10. <!-- 维修状态选择器 -->
  11. <view class="selector-item" @click="openStatusPicker">
  12. <text class="selector-label" :class="{ active: selectedStatus !== '维修状态' }">{{ selectedStatus }}</text>
  13. <uv-icon name="arrow-down-fill" size="14" :color="selectedStatus !== '维修状态' ? '#C70019' : '#000'"></uv-icon>
  14. </view>
  15. </view>
  16. <!-- 产品列表 -->
  17. <view class="product-list">
  18. <view class="product-item" v-for="(item, index) in list" :key="index" @click="navigateToDetail(item)">
  19. <!-- 产品ID和状态标签 -->
  20. <view class="item-header">
  21. <view >
  22. <text class="item-id">{{ item.id }}</text>
  23. <img src="@/static/copy.png" alt="复制图标" class="item-icon">
  24. </view>
  25. <view class="status-tag" :class="[getStatusClass(item.status)]">
  26. <text class="status-text">{{ item.status_dictText }}</text>
  27. </view>
  28. </view>
  29. <!-- 中间那条下划线 -->
  30. <view class="item-border" />
  31. <!-- 产品标题 -->
  32. <view class="item-title">
  33. <text class="title-text">{{ item.showpieceId_dictText }}</text>
  34. </view>
  35. <!-- 产品详情 -->
  36. <view class="item-details">
  37. <view class="detail-row">
  38. <view class="detail-item">
  39. <text class="detail-label">展品编号</text>
  40. <text class="detail-value">{{ item.showpieceId }}</text>
  41. </view>
  42. <view class="detail-item">
  43. <text class="detail-label">紧急程度</text>
  44. <text class="detail-value">{{ item.urgency_dictText }}</text>
  45. </view>
  46. </view>
  47. <view class="detail-row">
  48. <view class="detail-item">
  49. <text class="detail-label">展品位置</text>
  50. <text class="detail-value">{{ item.position }}</text>
  51. </view>
  52. </view>
  53. <view class="detail-row">
  54. <view class="detail-item">
  55. <text class="detail-label">报修人</text>
  56. <text class="detail-value">{{ item.reporterName }}</text>
  57. </view>
  58. <view class="detail-item">
  59. <text class="detail-label">报修日期</text>
  60. <text class="detail-value">{{ item.firstDate }}</text>
  61. </view>
  62. </view>
  63. <view class="detail-row">
  64. <view class="detail-item full-width">
  65. <text class="detail-label">故障描述</text>
  66. <text class="detail-value">{{ item.malfunctionDesc }}</text>
  67. </view>
  68. </view>
  69. </view>
  70. <!-- 操作按钮 -->
  71. <view class="item-actions">
  72. <button class="item-actions-button">立即维修</button>
  73. </view>
  74. </view>
  75. </view>
  76. <!-- 紧急程度选择器 -->
  77. <uv-picker
  78. ref="urgencyPicker"
  79. v-model="urgencyShow"
  80. :columns="urgencyColumns"
  81. mode="selector"
  82. @confirm="onUrgencyConfirm"
  83. confirmColor="#C70019"
  84. ></uv-picker>
  85. <!-- 维修状态选择器 -->
  86. <uv-picker
  87. ref="statusPicker"
  88. v-model="statusShow"
  89. :columns="statusColumns"
  90. mode="selector"
  91. @confirm="onStatusConfirm"
  92. confirmColor="#C70019"
  93. ></uv-picker>
  94. </view>
  95. </template>
  96. <script>
  97. import ListMixin from '@/mixins/list'
  98. export default {
  99. mixins: [ListMixin],
  100. data() {
  101. return {
  102. selectedUrgency: '紧急程度',
  103. selectedStatus: '维修状态',
  104. urgencyShow: false,
  105. statusShow: false,
  106. mixinListApi: 'exhibit.queryMalfunctionList',
  107. urgencyColumns: [
  108. [
  109. '一般',
  110. '紧急',
  111. '非常紧急'
  112. ]
  113. ],
  114. statusColumns: [
  115. [
  116. '维护中',
  117. '故障中',
  118. '已解决'
  119. ]
  120. ],
  121. }
  122. },
  123. methods: {
  124. navigateToDetail(item) {
  125. uni.navigateTo({
  126. url: '/subPages/repair/maintainSubmit?id=' + item.id
  127. })
  128. },
  129. openUrgencyPicker() {
  130. this.$refs.urgencyPicker.open()
  131. },
  132. openStatusPicker() {
  133. this.$refs.statusPicker.open()
  134. },
  135. onUrgencyConfirm(e) {
  136. this.selectedUrgency = e.value[0]
  137. console.log('选择紧急程度:', e)
  138. // TODO: 根据紧急程度筛选
  139. },
  140. onStatusConfirm(e) {
  141. this.selectedStatus = e.value[0]
  142. console.log('选择维修状态:', e)
  143. // TODO: 根据状态筛选
  144. },
  145. getStatusClass(status) {
  146. switch(status) {
  147. case '维修中':
  148. return 'status-repairing'
  149. case '故障中':
  150. return 'status-fault'
  151. case '已解决':
  152. return 'status-resolved'
  153. default:
  154. return ''
  155. }
  156. },
  157. handleRepair(item) {
  158. console.log('立即维修:', item)
  159. // TODO: 处理维修逻辑
  160. }
  161. }
  162. }
  163. </script>
  164. <style lang="scss" scoped>
  165. .maintain-container {
  166. background-color: #fff;
  167. min-height: 100vh;
  168. }
  169. .selector-section {
  170. display: flex;
  171. padding: 34rpx 41rpx;
  172. // background-color: #fff;
  173. gap: 58rpx;
  174. .selector-item {
  175. display: flex;
  176. align-items: center;
  177. gap: 9rpx;
  178. cursor: pointer;
  179. .selector-label {
  180. font-size: 28rpx;
  181. color: #000;
  182. &.active {
  183. color: $primary-color;
  184. }
  185. }
  186. }
  187. }
  188. .product-list {
  189. padding: 20rpx 32rpx;
  190. .product-item {
  191. background-color: #fff;
  192. border-radius: 15rpx;
  193. padding: 30rpx 30rpx 20rpx;
  194. margin-bottom: 24rpx;
  195. box-shadow: 0rpx 3rpx 6rpx 0rpx rgba(0,0,0,0.16);
  196. .item-header {
  197. display: flex;
  198. align-items: center;
  199. justify-content: space-between;
  200. margin-bottom: 13.5rpx;
  201. .item-icon {
  202. width: 25.5rpx;
  203. height: 25.5rpx;
  204. }
  205. .item-id {
  206. font-size: 28rpx;
  207. margin-right: 20rpx;
  208. color: $secondary-text-color;
  209. }
  210. .status-tag {
  211. border-radius: 15rpx;
  212. width: 135rpx;
  213. height: 57rpx;
  214. display: flex;
  215. align-items: center;
  216. justify-content: center;
  217. .status-text {
  218. font-size: 28rpx;
  219. }
  220. &.status-repairing {
  221. background-color: #ffffca;
  222. color: #CE7C62;
  223. }
  224. &.status-fault {
  225. background-color: #fccec7;
  226. color: #b82222;
  227. }
  228. &.status-resolved {
  229. background-color: #cfffca;
  230. color: #528828;
  231. }
  232. }
  233. }
  234. .item-border {
  235. border-bottom: 1rpx solid $secondary-text-color;
  236. // background-color: #E5E5E5;
  237. margin-bottom: 26.5rpx;
  238. opacity: 0.22;
  239. }
  240. .item-title {
  241. margin-bottom: 37rpx;
  242. .title-text {
  243. font-size: 30rpx;
  244. color: $primary-text-color;
  245. font-weight: bold;
  246. }
  247. }
  248. .item-details {
  249. margin-bottom: 52rpx;
  250. .detail-row {
  251. display: flex;
  252. margin-bottom: 25rpx;
  253. &:last-child {
  254. margin-bottom: 0;
  255. }
  256. .detail-item {
  257. flex: 1;
  258. display: flex;
  259. align-items: flex-start;
  260. margin-right: 35rpx;
  261. &.full-width {
  262. flex: 1 1 100%;
  263. margin-right: 0;
  264. }
  265. &:last-child {
  266. margin-right: 0;
  267. margin-bottom: 0;
  268. }
  269. .detail-label {
  270. font-size: 22rpx;
  271. color: $secondary-text-color;
  272. margin-right: 19rpx;
  273. flex-shrink: 0;
  274. min-width: 95rpx;
  275. }
  276. .detail-value {
  277. font-size: 22rpx;
  278. color: $primary-text-color;
  279. flex: 1;
  280. }
  281. }
  282. }
  283. }
  284. .item-actions {
  285. display: flex;
  286. justify-content: center;
  287. .item-actions-button {
  288. width: 378rpx;
  289. height: 78rpx;
  290. background-color: $primary-color;
  291. color: #fff;
  292. font-size: 28rpx;
  293. border-radius: 39rpx;
  294. }
  295. }
  296. }
  297. }
  298. </style>