print-info-page.vue 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  1. <template>
  2. <z-paging
  3. ref="paging"
  4. bgcolor="#F7F7F7"
  5. v-model="list"
  6. @query="query"
  7. safe-area-inset-bottom
  8. scroll-with-animation
  9. >
  10. <template #top>
  11. <ut-navbar title="包装任务详情" :fixed="false" border></ut-navbar>
  12. </template>
  13. <view class="d-flex a-c pd3-30-24-0 f-s-30 f-w-5">
  14. <view
  15. class="pd2-20-36 card-item-box mr-10 active"
  16. >{{ form?.refType == '2' ? '打印详情' : '关联详情' }}</view>
  17. <view @click="changeTebs" class="pd2-20-36 card-item-box">包装任务信息</view>
  18. </view>
  19. <view class="bg-fff pd-24">
  20. <view class="detail-info-card ov-hd p-rtv mb-40">
  21. <pack-card :item="form" :dict="dict"></pack-card>
  22. <view>
  23. <view class></view>
  24. <view></view>
  25. <view></view>
  26. </view>
  27. </view>
  28. <view
  29. class="d-flex a-c pd2-10-0 j-ed"
  30. @click="$u.route({ url: '/tools/view-html/index', params: { url: 'https://ta.zycpzs.cn/oss-file/smart-trace/szyy/template/pack_code_type.html', title: '赋码方式区别' } })"
  31. >
  32. <up-icon size="28rpx" name="question-circle" color="#999"></up-icon>
  33. <span class="c-#999 f-s-24">三种打印方式的区别?怎么选择?</span>
  34. </view>
  35. <view class="mb-20">
  36. <ut-tabs v-model="printType" :tabs="tabs" @change="onRefresh"></ut-tabs>
  37. </view>
  38. <view>
  39. <template v-for="(item, index) in list" :key="index">
  40. <template v-if="item?.printType == '1'">
  41. <view class="mb-20 pd-20 bg-#F7F7F7 b-radius">
  42. <view class="f-s-28 pd2-4-0">
  43. <span class="c-#666">打印数量:</span>
  44. <span class="c-#333 f-w-5">{{ item?.printCount }}</span>
  45. </view>
  46. <view class="f-s-28 pd2-4-0 d-flex">
  47. <span class="c-#666">打印码值:</span>
  48. <view class="flex1 ov-hd c-#333 f-w-5">
  49. <view>{{ item?.traceCodeStart }} 至</view>
  50. <view>{{ item?.traceCodeEnd }}</view>
  51. </view>
  52. </view>
  53. <view class="d-flex f-s-24 c-#666">
  54. <view class="flex1 ov-hd">打印人:{{ item?.createByName || '-' }}</view>
  55. <view class="pr-100">打印时间:{{ item?.createTime || '-' }}</view>
  56. </view>
  57. <view class="pt-20 d-flex">
  58. <view class="flex1"></view>
  59. <view class="d-flex a-c">
  60. <up-button :customStyle="formItemBtnListStyle" class="ml-20" color="#18BECA">全部打印</up-button>
  61. <up-button @click="$u.route({ url: '/plant/print/print-range/index', params: item })" :customStyle="formItemBtnListStyle" class="ml-20" color="#37A954">区间打印</up-button>
  62. </view>
  63. </view>
  64. </view>
  65. </template>
  66. <template></template>
  67. <template></template>
  68. </template>
  69. </view>
  70. </view>
  71. </z-paging>
  72. </template>
  73. <script setup lang="ts">
  74. import { useClientRequest } from "@/utils/request";
  75. import PackCard from "@/plant/models/pack-card.vue";
  76. import { formItemBtnListStyle } from "@/assets/styles/uview-plus";
  77. const paging = ref(null);
  78. const props = defineProps({
  79. packId: {
  80. type: String,
  81. default: ""
  82. },
  83. form: {
  84. type: Object,
  85. default: () => null
  86. },
  87. dict: {
  88. type: Object,
  89. default: () => null
  90. }
  91. });
  92. const printType = ref("1");
  93. const { pt_pack_ref_type } = toRefs(props?.dict);
  94. const emit = defineEmits(["changeTebs"]);
  95. const tabs = reactive([
  96. { label: "打印记录", value: "1" },
  97. { label: "导出记录", value: "2" },
  98. { label: "找人代打记录", value: "3" }
  99. ]);
  100. const changeTebs = () => {
  101. emit("changeTebs", "pack");
  102. };
  103. const list = ref([]);
  104. const query = async (pageNum: number, pageSize: number) => {
  105. const params = {
  106. pageNum,
  107. pageSize,
  108. packId: props.packId,
  109. printType: printType.value
  110. };
  111. const res = await useClientRequest.get(
  112. "/plt-api/app/printLog/list",
  113. params
  114. );
  115. if (res && res?.rows) {
  116. const { rows } = res;
  117. paging.value.complete(rows);
  118. }
  119. };
  120. const onRefresh = () => {
  121. try {
  122. paging.value?.reload();
  123. } catch (error) {
  124. console.error("刷新列表失败:", error);
  125. }
  126. };
  127. </script>
  128. <style lang="scss" scoped>
  129. .card-item-box {
  130. color: #999;
  131. border-radius: 10rpx 10rpx 0 0;
  132. &.active {
  133. color: $u-primary;
  134. background-color: #fff;
  135. }
  136. }
  137. .detail-info-card {
  138. border-radius: 16rpx;
  139. border: 1rpx solid #9dd5ab;
  140. }
  141. </style>