workCard.vue 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332
  1. <template>
  2. <view class="card_box" @click="handleDetail">
  3. <!-- 卡片头部:单号 + 状态标签 -->
  4. <view class="card-header">
  5. <view class="header-left">
  6. <view class="round" v-if="item.index">{{ item.index }}</view>
  7. <view class="orderId" v-if="item.workOrderType != 2">{{ item.code }}</view>
  8. <view class="orderId" v-if="item.workOrderType == 2">{{ item.outsourceCode }}</view>
  9. </view>
  10. <view class="status-tag" :class="'status-' + item.status">
  11. {{ statusList[item.status] }}
  12. </view>
  13. </view>
  14. <!-- 委外信息(仅委外工单显示) -->
  15. <view class="outsource-section" v-if="item.workOrderType == 2">
  16. <view class="info-row">
  17. <text class="info-label">委外名称</text>
  18. <text class="info-value">{{ item.outsourceName }}</text>
  19. </view>
  20. <view class="info-row">
  21. <text class="info-label">工单来源</text>
  22. <text class="info-value">{{ item.code }}</text>
  23. </view>
  24. </view>
  25. <!-- 卡片内容区域 -->
  26. <view class="card-body">
  27. <view class="info-grid">
  28. <view class="info-row half">
  29. <text class="info-label">产品编码</text>
  30. <text class="info-value text-ellipsis">{{ item.productCode }}</text>
  31. </view>
  32. <view class="info-row half">
  33. <text class="info-label">产品名称</text>
  34. <text class="info-value text-ellipsis">{{ item.productName }}</text>
  35. </view>
  36. </view>
  37. <view class="info-grid">
  38. <view class="info-row half">
  39. <text class="info-label">牌号</text>
  40. <text class="info-value text-ellipsis">{{ item.brandNo }}</text>
  41. </view>
  42. <view class="info-row half">
  43. <text class="info-label">批次号</text>
  44. <text class="info-value highlight text-ellipsis">{{ item.batchNo }}</text>
  45. </view>
  46. </view>
  47. <view class="info-grid">
  48. <view class="info-row half">
  49. <text class="info-label">型号</text>
  50. <text class="info-value text-ellipsis">{{ item.model }}</text>
  51. </view>
  52. <view class="info-row half">
  53. <text class="info-label">规格</text>
  54. <text class="info-value highlight text-ellipsis">{{ item.specification }}</text>
  55. </view>
  56. </view>
  57. <view class="info-grid">
  58. <view class="info-row half">
  59. <text class="info-label">生产数量</text>
  60. <text class="info-value text-ellipsis">{{ item.formingNum }} {{ item.unit }}</text>
  61. </view>
  62. <view class="info-row half">
  63. <text class="info-label">生产重量</text>
  64. <text class="info-value text-ellipsis">{{ item.formingWeight }} {{ item.weightUnit }}</text>
  65. </view>
  66. </view>
  67. <view class="info-grid">
  68. <view class="info-row half">
  69. <text class="info-label">报工类型</text>
  70. <text class="info-value highlight text-ellipsis">{{ item.singleReport == 1 ? "单个报工" : "批量报工" }}</text>
  71. </view>
  72. <view class="info-row half">
  73. <text class="info-label">当前工序</text>
  74. <text class="info-value highlight text-ellipsis">{{ item.taskName }}</text>
  75. </view>
  76. </view>
  77. <view class="info-grid">
  78. <view class="info-row full">
  79. <text class="info-label">工艺路线</text>
  80. <text class="info-value highlight text-ellipsis">{{ item.produceRoutingName }}</text>
  81. </view>
  82. </view>
  83. <view class="info-grid">
  84. <view class="info-row full">
  85. <text class="info-label">生产编号</text>
  86. <text class="info-value highlight text-ellipsis">{{ item.productionCodes }}</text>
  87. </view>
  88. </view>
  89. </view>
  90. <!-- 底部箭头提示 -->
  91. <view class="card-footer">
  92. <text class="footer-tip">查看详情</text>
  93. <image class="arrow-icon" src="/static/pda/arrow_right2.svg" mode="aspectFit"></image>
  94. </view>
  95. </view>
  96. </template>
  97. <script>
  98. export default {
  99. props: {
  100. item: {
  101. type: Object,
  102. default: () => ({}),
  103. },
  104. },
  105. data() {
  106. return {
  107. statusList: {
  108. 4: "待生产",
  109. 5: "生产中",
  110. 6: "已完成",
  111. 7: "已延期",
  112. 8: "待下达",
  113. },
  114. };
  115. },
  116. methods: {
  117. handleDetail() {
  118. console.log('this.item', this.item)
  119. this.$emit("handleDetail", this.item);
  120. },
  121. },
  122. };
  123. </script>
  124. <style lang="scss" scoped>
  125. .card_box {
  126. width: calc(100% - 48rpx);
  127. margin: 20rpx 24rpx 0;
  128. padding: 0;
  129. box-sizing: border-box;
  130. background: #ffffff;
  131. border-radius: 16rpx;
  132. box-shadow: 0 2rpx 12rpx rgba(0, 0, 0, 0.08);
  133. overflow: hidden;
  134. .card-header {
  135. display: flex;
  136. align-items: center;
  137. justify-content: space-between;
  138. padding: 24rpx 28rpx;
  139. background: linear-gradient(135deg, rgba(21, 122, 44, 0.06) 0%, rgba(21, 122, 44, 0.02) 100%);
  140. border-bottom: 1rpx solid #f0f0f0;
  141. .header-left {
  142. display: flex;
  143. align-items: center;
  144. flex: 1;
  145. min-width: 0;
  146. }
  147. .round {
  148. width: 48rpx;
  149. height: 48rpx;
  150. line-height: 48rpx;
  151. border-radius: 50%;
  152. background: $theme-color;
  153. color: #fff;
  154. text-align: center;
  155. font-size: 24rpx;
  156. flex-shrink: 0;
  157. }
  158. .orderId {
  159. color: $uni-text-color;
  160. font-size: 34rpx;
  161. font-weight: 600;
  162. margin-left: 16rpx;
  163. overflow: hidden;
  164. text-overflow: ellipsis;
  165. white-space: nowrap;
  166. }
  167. .status-tag {
  168. flex-shrink: 0;
  169. margin-left: 16rpx;
  170. padding: 6rpx 20rpx;
  171. border-radius: 20rpx;
  172. font-size: 26rpx;
  173. font-weight: 500;
  174. white-space: nowrap;
  175. }
  176. .status-4 {
  177. color: $uni-color-warning;
  178. background: $uni-color-warning-opacity;
  179. }
  180. .status-5 {
  181. color: $uni-color-primary;
  182. background: $uni-color-primary-opacity;
  183. }
  184. .status-6 {
  185. color: $uni-color-success;
  186. background: $uni-color-success-opacity;
  187. }
  188. .status-7 {
  189. color: $uni-color-error;
  190. background: $uni-color-error-opacity;
  191. }
  192. .status-8 {
  193. color: $uni-color-info;
  194. background: rgba(144, 144, 144, 0.15);
  195. }
  196. }
  197. .outsource-section {
  198. padding: 16rpx 28rpx;
  199. background: rgba(64, 158, 255, 0.04);
  200. border-bottom: 1rpx solid #f0f0f0;
  201. .info-row {
  202. display: flex;
  203. align-items: center;
  204. padding: 8rpx 0;
  205. overflow: hidden;
  206. }
  207. .info-label {
  208. color: $uni-text-color-grey;
  209. font-size: 28rpx;
  210. flex-shrink: 0;
  211. white-space: nowrap;
  212. &::after {
  213. content: ':';
  214. }
  215. }
  216. .info-value {
  217. color: $uni-text-color;
  218. font-size: 28rpx;
  219. flex: 1;
  220. overflow: hidden;
  221. text-overflow: ellipsis;
  222. white-space: nowrap;
  223. }
  224. }
  225. .card-body {
  226. padding: 16rpx 28rpx 8rpx;
  227. .info-grid {
  228. display: flex;
  229. flex-wrap: nowrap;
  230. margin-bottom: 4rpx;
  231. }
  232. .info-row {
  233. display: flex;
  234. align-items: center;
  235. padding: 12rpx 0;
  236. box-sizing: border-box;
  237. overflow: hidden;
  238. &.half {
  239. width: 50%;
  240. &:nth-child(odd) {
  241. padding-right: 16rpx;
  242. }
  243. &:nth-child(even) {
  244. padding-left: 16rpx;
  245. }
  246. }
  247. &.full {
  248. width: 100%;
  249. }
  250. }
  251. .info-label {
  252. color: $uni-text-color-grey;
  253. font-size: 28rpx;
  254. flex-shrink: 0;
  255. margin-right: 8rpx;
  256. line-height: 40rpx;
  257. white-space: nowrap;
  258. &::after {
  259. content: ':';
  260. }
  261. }
  262. .info-value {
  263. color: $uni-text-color;
  264. font-size: 28rpx;
  265. flex: 1;
  266. line-height: 40rpx;
  267. min-width: 0;
  268. &.highlight {
  269. color: $theme-color;
  270. }
  271. }
  272. .text-ellipsis {
  273. overflow: hidden;
  274. text-overflow: ellipsis;
  275. white-space: nowrap;
  276. }
  277. }
  278. .card-footer {
  279. display: flex;
  280. align-items: center;
  281. justify-content: flex-end;
  282. padding: 18rpx 28rpx;
  283. border-top: 1rpx solid #f5f5f5;
  284. .footer-tip {
  285. color: $uni-text-color-grey;
  286. font-size: 24rpx;
  287. }
  288. .arrow-icon {
  289. width: 28rpx;
  290. height: 28rpx;
  291. margin-left: 8rpx;
  292. }
  293. }
  294. }
  295. </style>