workCard.vue 8.3 KB

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