huangxw 1 week ago
parent
commit
c84732c240
3 changed files with 122 additions and 70 deletions
  1. 15 2
      src/plant/models/batch-info.vue
  2. 84 0
      src/plant/models/pack-card.vue
  3. 23 68
      src/plant/packaging/list/index.vue

+ 15 - 2
src/plant/models/batch-info.vue

@@ -4,13 +4,26 @@
             <span class="c-#666">品名:</span>
             <span class="c-#333">{{ info?.proName || '-' }}</span>
         </view>
+        <view class="f-s-30 pd2-16-0 info-border-bottom">
+            <view class="c-#666 mb-10">基原:<span v-if="!info?.varietyInfo" class="c-#333">-</span></view>
+            <view v-if="info?.varietyInfo" class="bg-#FBFDFB card-info-block pd-24 p-rtv">
+                <view class="mb-10">
+                    <span class="f-s-34 c-#333 f-w-5 mr-16">{{ info?.varietyInfo?.varietyName }}</span>
+                    <span class="f-s-24 c-#666">{{ info?.varietyInfo?.latinName }}</span>
+                </view>
+                <view>
+                    <span class="f-s-28 c-#333 f-w-5 mr-16">{{ info?.varietyInfo?.genusName }}</span>
+                    <span class="f-s-24 c-#666">{{ info?.varietyInfo?.genusLatinName }}</span>
+                </view>
+            </view>
+        </view>
         <view class="f-s-30 pd2-16-0 info-border-bottom">
             <span class="c-#666">批号:</span>
             <span class="c-#333">{{ info?.batchSn || '-' }}</span>
         </view>
         <view class="f-s-30 pd2-16-0 info-border-bottom">
             <span class="c-#666">规格等级:</span>
-            <span class="c-#333">{{ info?.proSpecn || '-' }}</span>
+            <span class="c-#333">{{ info?.proLevel || '-' }}</span>
         </view>
         <view class="f-s-30 pd2-16-0 info-border-bottom">
             <span class="c-#666">产地:</span>
@@ -22,7 +35,7 @@
         </view>
         <view class="f-s-30 pd2-16-0 info-border-bottom">
             <span class="c-#666">采收日期:</span>
-            <span class="c-#333">{{ getDateRangeFrt(info?.harvestDate, info?.harvestDateEnd)}}</span>
+            <span class="c-#333">{{ getDateRangeFrt(info?.harvestDate, info?.harvestDateEnd) }}</span>
         </view>
         <view class="f-s-30 pd2-16-0 info-border-bottom">
             <span class="c-#666">包装日期:</span>

+ 84 - 0
src/plant/models/pack-card.vue

@@ -0,0 +1,84 @@
+<template>
+    <view v-if="item" @click="emit('click')">
+        <view class="d-flex j-sb a-c pr-24">
+            <view class="f-s-20 f-w-5 item-left-tag" :class="{[`bg-pack-${ item?.refType }`]: true }">{{ selectDictLabel(pt_pack_ref_type, item?.refType) }}</view>
+            <view class="f-s-22 c-#666">
+                {{ getDateRangeFrt(item?.packagingDateStart, item?.packagingDateStart) }}
+                <span>包装</span>
+            </view>
+        </view>
+        <view class="pd-20">
+            <view class="d-flex a-c">
+                <view class="flex1 ov-hd">
+                    <span class="f-s-34 c-#333 f-w-5 mr-10">{{ item?.proName || '-' }}</span>
+                    <span class="f-s-24 c-#666">{{ item?.proLevel || '-' }}</span>
+                </view>
+                <up-icon v-if="isArrow" name="arrow-right" color="#999" size="24rpx"></up-icon>
+            </view>
+            <view class="f-s-24 c-#666">{{ item?.proSpenc }}</view>
+            <view class="pd-6"></view>
+            <view class="f-s-28 pd2-4-0">
+                <span class="c-#666">成品批号:</span>
+                <span class="c-#333 f-w-5">{{ item?.batchSn }}</span>
+            </view>
+            <view class="f-s-28 pd2-4-0">
+                <span class="c-#666">包装批号:</span>
+                <span class="c-#333 f-w-5">{{ item?.packSn }}</span>
+            </view>
+            <view class="d-flex flex-wrap">
+                <view class="f-s-28 pd2-4-0 hcol-15">
+                    <span class="c-#666">包装规格:</span>
+                    <span class="c-#333 f-w-5">{{ item?.capacity }}{{ item?.storageUseUnit }}/{{ item?.unit }}</span>
+                </view>
+                <view class="f-s-28 pd2-4-0 hcol-15">
+                    <span class="c-#666">包装总总量:</span>
+                    <span class="c-#333 f-w-5">{{ item?.storageUseAmount }}{{ item?.storageUseUnit }}</span>
+                </view>
+                <view class="f-s-28 pd2-4-0 hcol-15">
+                    <span class="c-#666">分包数量:</span>
+                    <span class="c-#333 f-w-5">{{ item?.planCount }}{{ item?.unit }}</span>
+                </view>
+                <view v-if="item.refType == '1'" class="f-s-28 pd2-4-0 hcol-15">
+                    <span class="c-#666">待关联数量:</span>
+                    <span class="c-#333 f-w-5">{{ item?.planCount - item?.actualCount }}{{ item?.unit }}</span>
+                </view>
+                <view v-if="item.refType == '2'" class="f-s-28 pd2-4-0 hcol-15">
+                    <span class="c-#666">待打印数量:</span>
+                    <span class="c-#333 f-w-5">{{ item?.actualCount - item?.printCount }}{{ item?.unit }}</span>
+                </view>
+            </view>
+            <slot></slot>
+        </view>
+    </view>
+</template>
+<script lang="ts" setup>
+const props = defineProps({
+    item: {
+        type: Object,
+        default: () => null,
+    },
+    dict: {
+        type: Object,
+        default: () => null,
+    },
+    isArrow: {
+        type: Boolean,
+        default: false,
+    },
+});
+const { pt_pack_ref_type } = toRefs(props?.dict);
+const emit = defineEmits(['click']);
+</script>
+<style lang="scss" scoped>
+.item-left-tag {
+   padding: 6rpx 18rpx;
+   border-radius: 0 0 18rpx 0;
+   color: #fff;
+}
+.bg-pack-1 {
+    background-color: #2289E0;
+}
+.bg-pack-2 {
+    background-color: #37A954;
+}
+</style>

+ 23 - 68
src/plant/packaging/list/index.vue

@@ -24,76 +24,30 @@
         <view class="pd-24 bg-#f7f7f7">
             <up-swipe-action>
                 <up-swipe-action-item v-for="(item, index) in list" :key="index" :name="item?.id" :options="optionsActionTemp" @click="clickTempSwipe" class="mb-20 b-radius">
-                    <view class="b-radius bg-#fff pd-20 p-rtv">
-                        <view class="d-flex j-sb a-c mb-20">
-                            <view class="f-s-20 f-w-5">{{ selectDictLabel(pt_pack_ref_type, item.refType) }}</view>
-                            <view class="f-s-22 c-#666">
-                                {{ getDateRangeFrt(item?.packagingDateStart, item?.packagingDateStart) }}
-                                <span>包装</span>
-                            </view>
-                        </view>
-                        <view>
-                            <view class="d-flex a-c">
-                                <view class="flex1 ov-hd">
-                                    <span></span>
-                                    <span></span>
+                    <view @click="$u.route({ url: '/plant/packaging/detail/index', params: { id: item?.id } })" class="b-radius bg-#fff p-rtv">
+                        <pack-card :item="item" :dict="{ pt_pack_ref_type }" isArrow>
+                            <view class="h-1 bg-#F7F7F7 mg2-10-0"></view>
+                            <view class="pt-10 d-flex">
+                                <view class="flex1"></view>
+                                <view class="d-flex a-c" @click.stop>
+                                    <up-button
+                                        @click="
+                                            rowId = item.id;
+                                            showBatchInfo = true;
+                                        "
+                                        color="#18BECA"
+                                        >查看批次信息</up-button>
+                                    <template v-if="item.refType == '2'">
+                                        <up-button v-if="+item?.actualCount - item?.printCount" @click.stop="$u.route({ url: '/plant/print/print-self/index', params: { packId: item?.id, autoRelationId: item?.autoRelationId, unit: item?.unit, printedCount: item?.actualCount - item?.printCount } })" class="ml-10" color="#37A954">立即打印</up-button>
+                                        <up-button v-if="+item?.printCount" class="ml-10" color="#37A954">查看打印记录</up-button>
+                                    </template>
+                                    <template v-if="item.refType == '1'">
+                                        <up-button v-if="+item?.planCount - item?.actualCount" class="ml-10" color="#91C747">批量关联</up-button>
+                                        <up-button v-if="+item?.actualCount" class="ml-10" color="#91C747">查看关联记录</up-button>
+                                    </template>
                                 </view>
-                                <up-icon name="arrow-right"></up-icon>
-                            </view>
-                            <view class="pd-6"></view>
-                            <view class="f-s-28 pd2-4-0">
-                                <span class="c-#666">成品批号:</span>
-                                <span class="c-#333 f-w-5">{{ item?.batchSn }}</span>
-                            </view>
-                            <view class="f-s-28 pd2-4-0">
-                                <span class="c-#666">包装批号:</span>
-                                <span class="c-#333 f-w-5">{{ item?.packSn }}</span>
                             </view>
-                            <view class="d-flex flex-wrap">
-                                <view class="f-s-28 pd2-4-0 hcol-15">
-                                    <span class="c-#666">包装规格:</span>
-                                    <span class="c-#333 f-w-5">{{ item?.capacity }}{{ item?.storageUseUnit }}/{{ item?.unit }}</span>
-                                </view>
-                                <view class="f-s-28 pd2-4-0 hcol-15">
-                                    <span class="c-#666">包装总总量:</span>
-                                    <span class="c-#333 f-w-5">{{ item?.storageUseAmount }}{{ item?.storageUseUnit }}</span>
-                                </view>
-                                <view class="f-s-28 pd2-4-0 hcol-15">
-                                    <span class="c-#666">分包数量:</span>
-                                    <span class="c-#333 f-w-5">{{ item?.planCount }}{{ item?.unit }}</span>
-                                </view>
-                                <view v-if="item.refType == '1'" class="f-s-28 pd2-4-0 hcol-15">
-                                    <span class="c-#666">待关联数量:</span>
-                                    <span class="c-#333 f-w-5">{{ item?.planCount - item?.actualCount }}{{ item?.unit }}</span>
-                                </view>
-                                <view v-if="item.refType == '2'" class="f-s-28 pd2-4-0 hcol-15">
-                                    <span class="c-#666">待打印数量:</span>
-                                    <span class="c-#333 f-w-5">{{ item?.actualCount - item?.printCount }}{{ item?.unit }}</span>
-                                </view>
-                            </view>
-                        </view>
-                        <view class="h-1 bg-#F7F7F7 mg2-10-0"></view>
-                        <view class="pt-10 d-flex">
-                            <view class="flex1"></view>
-                            <view class="d-flex a-c">
-                                <up-button
-                                    @click="
-                                        rowId = item.id;
-                                        showBatchInfo = true;
-                                    "
-                                    color="#18BECA"
-                                    >查看批次信息</up-button
-                                >
-                                <template v-if="item.refType == '2'">
-                                    <up-button v-if="+item?.actualCount - item?.printCount" @click="$u.route({ url: '/plant/print/print-self/index', params: { packId: item?.id, autoRelationId: item?.autoRelationId, unit: item?.unit, printedCount: item?.actualCount - item?.printCount } })" class="ml-10" color="#37A954">立即打印</up-button>
-                                    <up-button v-if="+item?.printCount" class="ml-10" color="#37A954">查看打印记录</up-button>
-                                </template>
-                                <template v-if="item.refType == '1'">
-                                    <up-button v-if="+item?.planCount - item?.actualCount" class="ml-10" color="#91C747">批量关联</up-button>
-                                    <up-button v-if="+item?.actualCount" class="ml-10" color="#91C747">查看关联记录</up-button>
-                                </template>
-                            </view>
-                        </view>
+                        </pack-card>
                     </view>
                 </up-swipe-action-item>
             </up-swipe-action>
@@ -111,6 +65,7 @@
 <script setup lang="ts">
 import { useClientRequest } from '@/utils/request';
 import batchInfoPopup from '../../models/batch-info-popup.vue';
+import PackCard from '@/plant/models/pack-card.vue';
 const { proxy } = getCurrentInstance() as ComponentInternalInstance;
 const { pt_pack_ref_type } = toRefs<any>(proxy?.useDict('pt_pack_ref_type'));
 const list = ref<any[]>();