outsourcingDetail.vue 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214
  1. <template>
  2. <view class="page-container">
  3. <uni-nav-bar
  4. fixed="true"
  5. statusBar="true"
  6. left-icon="back"
  7. title="委外单详情"
  8. background-color="#157A2C"
  9. color="#fff"
  10. @clickLeft="back"
  11. ></uni-nav-bar>
  12. <!-- 基本信息卡片 -->
  13. <view class="info-card">
  14. <view class="card-header">
  15. <view class="header-line"></view>
  16. <view class="header-title">基本信息</view>
  17. </view>
  18. <view class="info-content">
  19. <view class="info-item" v-for="(infoItem, idx) in infoList" :key="idx">
  20. <view class="info-label">{{ infoItem.label }}</view>
  21. <view
  22. class="info-value"
  23. :class="{ 'status-badge': infoItem.isStatus }"
  24. >
  25. {{ infoItem.value }}
  26. </view>
  27. </view>
  28. </view>
  29. </view>
  30. <!-- 明细列表 -->
  31. <view class="detail-section">
  32. <view class="section-title">委外明细</view>
  33. <u-list key="list">
  34. <u-list-item
  35. v-for="(detailItem, index) in item.detailList"
  36. :key="index"
  37. >
  38. <outsourcingData :item="detailItem" :index="index" />
  39. </u-list-item>
  40. </u-list>
  41. </view>
  42. </view>
  43. </template>
  44. <script>
  45. import outsourcingData from "./outsourcingData.vue";
  46. export default {
  47. components: {
  48. outsourcingData,
  49. },
  50. data() {
  51. return {
  52. item: null,
  53. };
  54. },
  55. computed: {
  56. infoList() {
  57. if (!this.item) return [];
  58. const statusText =
  59. this.item.status == 0
  60. ? "未提交"
  61. : this.item.status == 1
  62. ? "已提交"
  63. : "已发布";
  64. return [
  65. { label: "委外单编码", value: this.item.code || "-" },
  66. { label: "委外单名称", value: this.item.name || "-" },
  67. { label: "委外发起工序", value: this.item.taskName || "-" },
  68. { label: "委外工序", value: this.item.taskNames || "-" },
  69. { label: "工单编码", value: this.item.workOrderCode || "-" },
  70. { label: "预计到货日期", value: this.item.requireDeliveryTime || "-" },
  71. { label: "创建时间", value: this.item.createTime || "-" },
  72. { label: "状态", value: statusText, isStatus: true },
  73. ];
  74. },
  75. },
  76. onLoad(options) {
  77. this.item = JSON.parse(options.item);
  78. },
  79. methods: {
  80. scrolltolower() {},
  81. },
  82. };
  83. </script>
  84. <style lang="scss" scoped>
  85. .page-container {
  86. min-height: 100vh;
  87. background: #f5f7fa;
  88. padding-bottom: 20rpx;
  89. }
  90. // 信息卡片
  91. .info-card {
  92. margin: 20rpx 24rpx;
  93. background: #ffffff;
  94. border-radius: 16rpx;
  95. box-shadow: 0 2rpx 12rpx rgba(0, 0, 0, 0.04);
  96. overflow: hidden;
  97. }
  98. .card-header {
  99. display: flex;
  100. align-items: center;
  101. padding: 28rpx 24rpx 20rpx;
  102. .header-line {
  103. width: 6rpx;
  104. height: 32rpx;
  105. background: linear-gradient(180deg, #157a2c 0%, #1ea03a 100%);
  106. border-radius: 3rpx;
  107. margin-right: 16rpx;
  108. }
  109. .header-title {
  110. font-size: 32rpx;
  111. font-weight: 600;
  112. color: #303133;
  113. }
  114. }
  115. .info-content {
  116. padding: 0 24rpx 24rpx;
  117. }
  118. .info-item {
  119. display: flex;
  120. align-items: flex-start;
  121. padding: 20rpx 0;
  122. border-bottom: 1rpx solid #f0f2f5;
  123. &:last-child {
  124. border-bottom: none;
  125. }
  126. }
  127. .info-label {
  128. flex-shrink: 0;
  129. width: 200rpx;
  130. font-size: 28rpx;
  131. color: #909399;
  132. line-height: 40rpx;
  133. }
  134. .info-value {
  135. flex: 1;
  136. font-size: 28rpx;
  137. color: #303133;
  138. line-height: 40rpx;
  139. word-break: break-all;
  140. &.status-badge {
  141. display: inline-block;
  142. padding: 4rpx 16rpx;
  143. background: linear-gradient(135deg, #e8f5e9 0%, #f1f8f2 100%);
  144. color: #157a2c;
  145. border-radius: 8rpx;
  146. font-weight: 500;
  147. }
  148. }
  149. // 明细列表区域
  150. .detail-section {
  151. margin: 0 24rpx;
  152. .section-title {
  153. font-size: 28rpx;
  154. font-weight: 600;
  155. color: #303133;
  156. padding: 24rpx 0 16rpx;
  157. }
  158. .u-list {
  159. background: transparent;
  160. }
  161. }
  162. // 响应式适配
  163. @media screen and (max-width: 375px) {
  164. .info-label {
  165. width: 180rpx;
  166. font-size: 26rpx;
  167. }
  168. .info-value {
  169. font-size: 26rpx;
  170. }
  171. .card-header .header-title {
  172. font-size: 30rpx;
  173. }
  174. }
  175. @media screen and (min-width: 768px) {
  176. .info-card {
  177. margin: 30rpx auto;
  178. max-width: 1200rpx;
  179. }
  180. .detail-section {
  181. margin: 0 auto;
  182. max-width: 1200rpx;
  183. }
  184. }
  185. </style>