|
|
@@ -1,48 +1,44 @@
|
|
|
<template>
|
|
|
<view class="bg-#fff b-radius-16 pd-24 mb-16 p-rtv b-radius">
|
|
|
<!-- 状态标签 -->
|
|
|
- <view class="d-flex a-c j-ed " style="position: absolute;right: 0;top: 0;">
|
|
|
- <view class="bg-#FAECE9 c-#F74C30 f-w-5 pd-10 pt-4 pb-4 f-s-20" style="border-radius: 0 16rpx 0 16rpx ;"
|
|
|
- v-if="item.status === '0'">追溯码生成中...</view>
|
|
|
- <view class="bg-#EBF6EE c-primary f-w-5 pd-10 pt-4 pb-4 f-s-20" style="border-radius: 0 16rpx 0 16rpx ;"
|
|
|
- v-else-if="item.downloadFlag === '0' && item.status !== '0'">未下载</view>
|
|
|
- <view class="bg-#E8F0F7 c-#2289E0 f-w-5 pd-10 pt-4 pb-4 f-s-20" style="border-radius: 0 16rpx 0 16rpx ;"
|
|
|
- v-else-if="item.downloadFlag === '1' && item.status !== '0'">已下载</view>
|
|
|
+ <view class="d-flex a-c j-ed" style="position: absolute; right: 0; top: 0">
|
|
|
+ <view class="bg-#FAECE9 c-#F74C30 f-w-5 pd-10 pt-4 pb-4 f-s-20" style="border-radius: 0 16rpx 0 16rpx" v-if="item.status === '0'">追溯码生成中...</view>
|
|
|
+ <view class="bg-#EBF6EE c-primary f-w-5 pd-10 pt-4 pb-4 f-s-20" style="border-radius: 0 16rpx 0 16rpx" v-else-if="item.downloadFlag === '0' && item.status !== '0'">未下载</view>
|
|
|
+ <view class="bg-#E8F0F7 c-#2289E0 f-w-5 pd-10 pt-4 pb-4 f-s-20" style="border-radius: 0 16rpx 0 16rpx" v-else-if="item.downloadFlag === '1' && item.status !== '0'">已下载</view>
|
|
|
</view>
|
|
|
<!-- 主要内容 -->
|
|
|
<view class="" @click="handleItemClick">
|
|
|
- <view class=" d-flex a-c pb-10">
|
|
|
- <span class="f-s-28 c-#666 ">生成批号:</span>
|
|
|
+ <view class="d-flex a-c pb-10">
|
|
|
+ <span class="f-s-28 c-#666">生成批号:</span>
|
|
|
<span class="f-s-28 c-#333 f-w-500">{{ item.batchSn || '-' }}</span>
|
|
|
</view>
|
|
|
- <view class=" d-flex a-c pb-10">
|
|
|
- <span class="f-s-28 c-#666 ">码段:</span>
|
|
|
+ <view class="d-flex pb-10">
|
|
|
+ <span class="f-s-28 c-#666">码段:</span>
|
|
|
<span class="f-s-28 c-#333 f-w-500 flex1">{{ formatCodeRange }}</span>
|
|
|
<up-icon v-if="showButtons" name="arrow-right" size="26rpx" color="#999"></up-icon>
|
|
|
</view>
|
|
|
- <view class=" d-flex a-c pb-10">
|
|
|
+ <view class="d-flex a-c pb-10">
|
|
|
<view class="w-50%">
|
|
|
- <span class="f-s-28 c-#666 ">生成数量:</span>
|
|
|
+ <span class="f-s-28 c-#666">生成数量:</span>
|
|
|
<span class="f-s-28 c-#333 f-w-500">{{ item.sumCount }}个</span>
|
|
|
</view>
|
|
|
<view class="w-50%">
|
|
|
- <span class="f-s-28 c-#666 ">剩余数量:</span>
|
|
|
+ <span class="f-s-28 c-#666">剩余数量:</span>
|
|
|
<span class="f-s-28 c-#333 f-w-500">{{ getRemainingCount }}个</span>
|
|
|
</view>
|
|
|
</view>
|
|
|
- <view class=" d-flex a-c pb-10">
|
|
|
- <span class="f-s-28 c-#666 ">备注:</span>
|
|
|
+ <view class="d-flex a-c pb-10">
|
|
|
+ <span class="f-s-28 c-#666">备注:</span>
|
|
|
<span class="f-s-28 c-#333 f-w-500">{{ item.remark || '-' }}</span>
|
|
|
</view>
|
|
|
- <view class="d-flex a-c pb-20" style="flex-wrap: nowrap;border-bottom: 1rpx solid #f7f7f7;">
|
|
|
- <view class="flex1 ov-hd d-flex a-c" style="min-width: 0;">
|
|
|
+ <view class="d-flex a-c pb-20" style="flex-wrap: nowrap; border-bottom: 1rpx solid #f7f7f7">
|
|
|
+ <view class="flex1 ov-hd d-flex a-c" style="min-width: 0">
|
|
|
<span class="f-s-24 c-#666 w-s-no">操作人:</span>
|
|
|
- <span class="f-s-24 c-#333 f-w-500 ov-hd w-s-no tx-ov" style=" display: inline-block">{{
|
|
|
- operatorName }}</span>
|
|
|
+ <span class="f-s-24 c-#999 f-w-500 ov-hd w-s-no tx-ov" style="display: inline-block">{{ item?.createByName }}</span>
|
|
|
</view>
|
|
|
- <view class="ml-20" style="flex-shrink: 0;">
|
|
|
+ <view class="ml-20" style="flex-shrink: 0">
|
|
|
<span class="f-s-24 c-#666 w-s-no">生成时间:</span>
|
|
|
- <span class="f-s-24 c-#333 f-w-500" style="white-space: nowrap;">{{ formatTime }}</span>
|
|
|
+ <span class="f-s-24 c-#999 f-w-500" style="white-space: nowrap">{{ parseTime(item?.createTime) }}</span>
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
@@ -51,11 +47,7 @@
|
|
|
<view class="d-flex a-c j-ed mt-24" v-if="showButtons">
|
|
|
<!-- 追溯码生成中状态 -->
|
|
|
<template v-if="item.status === '0'">
|
|
|
- <up-button type="primary"
|
|
|
- customStyle="height: 64rpx; font-size: 28rpx; border-radius: 8rpx; background-color: #37A954; color: #fff;width: 160rpx;"
|
|
|
- @click="handleRefresh">
|
|
|
- 刷新
|
|
|
- </up-button>
|
|
|
+ <up-button type="primary" customStyle="height: 64rpx; font-size: 28rpx; border-radius: 8rpx; background-color: #37A954; color: #fff;width: 160rpx;" @click="handleRefresh"> 刷新 </up-button>
|
|
|
</template>
|
|
|
<!-- 未下载状态 -->
|
|
|
<view class="d-flex j-ed a-c" v-else-if="item.downloadFlag === '0' && item.status !== '0'">
|
|
|
@@ -64,11 +56,7 @@
|
|
|
@click="handleFindAgent">
|
|
|
找人代制作
|
|
|
</up-button> -->
|
|
|
- <up-button type="primary"
|
|
|
- customStyle="height: 64rpx; font-size: 28rpx; border-radius: 8rpx; background-color: #37A954; color: #fff; width: 160rpx;"
|
|
|
- @click="handleDownload">
|
|
|
- 下载
|
|
|
- </up-button>
|
|
|
+ <up-button type="primary" customStyle="height: 64rpx; font-size: 28rpx; border-radius: 8rpx; background-color: #37A954; color: #fff; width: 160rpx;" @click="handleDownload"> 下载 </up-button>
|
|
|
</view>
|
|
|
<!-- 已下载状态 -->
|
|
|
<view v-else-if="item.downloadFlag === '1' && item.status !== '0'" class="d-flex j-ed a-c">
|
|
|
@@ -77,17 +65,15 @@
|
|
|
@click="handleViewOrder">
|
|
|
查看代做订单
|
|
|
</up-button> -->
|
|
|
- <up-button
|
|
|
- customStyle="height: 64rpx; font-size: 28rpx; border-radius: 8rpx; background-color: #91C747; color: #fff;"
|
|
|
- @click="handleReDownload">
|
|
|
- 重新下载
|
|
|
- </up-button>
|
|
|
+ <up-button customStyle="height: 64rpx; font-size: 28rpx; border-radius: 8rpx; background-color: #91C747; color: #fff;" @click="handleReDownload"> 重新下载 </up-button>
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
</template>
|
|
|
|
|
|
<script setup lang="ts">
|
|
|
+import { parseTime } from '@/utils/ruoyi';
|
|
|
+
|
|
|
const props = withDefaults(
|
|
|
defineProps<{
|
|
|
item: any;
|
|
|
@@ -96,9 +82,8 @@ const props = withDefaults(
|
|
|
{
|
|
|
item: () => ({}),
|
|
|
showButtons: true,
|
|
|
- }
|
|
|
+ },
|
|
|
);
|
|
|
-
|
|
|
const emit = defineEmits<{
|
|
|
refresh: [id: number];
|
|
|
download: [item: any];
|
|
|
@@ -127,29 +112,7 @@ const getRemainingCount = computed(() => {
|
|
|
return sum - use - voidCount;
|
|
|
});
|
|
|
|
|
|
-// 格式化操作人名称
|
|
|
-const operatorName = computed(() => {
|
|
|
- // 根据实际情况,可能需要从其他地方获取操作人名称
|
|
|
- // 这里暂时使用 remark 或其他字段代替,或者显示为"手机用户"
|
|
|
- return '手机用户' + String(props.item?.appid || '').slice(-4) || '-';
|
|
|
-});
|
|
|
-
|
|
|
// 格式化时间
|
|
|
-const formatTime = computed(() => {
|
|
|
- if (!props.item.dateStr) return '-';
|
|
|
- // dateStr 可能是时间戳或日期字符串,需要根据实际情况格式化
|
|
|
- const date = new Date(props.item.dateStr);
|
|
|
- if (isNaN(date.getTime())) {
|
|
|
- return String(props.item.dateStr);
|
|
|
- }
|
|
|
- const year = date.getFullYear();
|
|
|
- const month = String(date.getMonth() + 1).padStart(2, '0');
|
|
|
- const day = String(date.getDate()).padStart(2, '0');
|
|
|
- const hours = String(date.getHours()).padStart(2, '0');
|
|
|
- const minutes = String(date.getMinutes()).padStart(2, '0');
|
|
|
- const seconds = String(date.getSeconds()).padStart(2, '0');
|
|
|
- return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
|
|
|
-});
|
|
|
|
|
|
// 处理刷新按钮点击
|
|
|
const handleRefresh = () => {
|
|
|
@@ -184,7 +147,7 @@ const handleItemClick = () => {
|
|
|
uni.$u.route({
|
|
|
type: 'navigateTo',
|
|
|
url: '/plant/code/code-detail-list/index',
|
|
|
- params: { id: props.item.id }
|
|
|
+ params: { id: props.item.id },
|
|
|
});
|
|
|
emit('itemClick', props.item);
|
|
|
};
|
|
|
@@ -196,7 +159,7 @@ watch(
|
|
|
// 可以在这里处理 item 变化后的逻辑
|
|
|
console.log('item 变化:', newVal);
|
|
|
},
|
|
|
- { deep: true }
|
|
|
+ { deep: true },
|
|
|
);
|
|
|
</script>
|
|
|
|