huangxw 1 månad sedan
förälder
incheckning
a586731911

+ 7 - 2
src/plant/storage/agro-product/detail/index.vue

@@ -38,6 +38,10 @@
                     <span class="c-#666">供应商:</span>
                     <span class="c-#333 f-w-500">{{ form?.supplier }}</span>
                 </view>
+                <view v-if="form?.warehouses?.length" class="pd2-4-0 f-s-28">
+                    <span class="c-#666">存放库房:</span>
+                    <span class="c-#333 f-w-500">{{ getStorageRoomNames(form?.warehouses) || '-' }}</span>
+                </view>
                 <view class="pd2-4-0 f-s-28">
                     <span class="c-#666">入库量:</span>
                     <span class="c-#333 f-w-500">{{ form?.capacity }}{{ form?.unit }}</span>
@@ -146,9 +150,9 @@
                     <span class="c-#666">库房类型:</span>
                     <span class="c-#333 f-w-600">农资库</span>
                 </view>
-                <view class="f-s-30 pd2-16-0 info-border-bottom">
+                <view v-if="form?.warehouses?.length" class="pd2-4-0 f-s-28">
                     <span class="c-#666">存放库房:</span>
-                    <span class="c-#333 f-w-600">{{ selectDictLabel(pt_warehouse_type, form?.warehouseType) || '-' }}</span>
+                    <span class="c-#333 f-w-500">{{ getStorageRoomNames(form?.warehouses) || '-' }}</span>
                 </view>
                 <view class="f-s-30 pd2-16-0 info-border-bottom">
                     <span class="c-#666">入库人:</span>
@@ -178,6 +182,7 @@
 
 <script setup lang="ts">
 import { formItemBtnStyle } from '@/assets/styles/uview-plus';
+import { getStorageRoomNames } from '@/utils/common';
 import { useClientRequest } from '@/utils/request';
 const { proxy } = getCurrentInstance() as ComponentInternalInstance;
 // 使用到的字典:入库类型、库房类型、农资类别、来源、单位、规格单位、是否

+ 5 - 5
src/plant/storage/agro-product/list/index.vue

@@ -33,11 +33,10 @@
                             <span class="c-#666">入库批号:</span>
                             <span class="c-#333 f-w-500">{{ item?.batchCode }}</span>
                         </view>
-                        <!-- <view class="pd2-4-0 f-s-28">
-                            <span class="c-#666">溯源批号:</span>
-                            <span class="c-#333 f-w-500">暂无</span>
-                        </view> -->
-                      
+                        <view v-if="item?.warehouses?.length" class="pd2-4-0 f-s-28">
+                            <span class="c-#666">存放库房:</span>
+                            <span class="c-#333 f-w-500">{{ getStorageRoomNames(item?.warehouses) || '-' }}</span>
+                        </view>
                         <view class="pd2-4-0 f-s-28">
                             <span class="c-#666">供应商:</span>
                             <span class="c-#333 f-w-500">{{ item?.supplier }}</span>
@@ -74,6 +73,7 @@
 <script setup lang="ts">
 import { useClientRequest } from '@/utils/request';
 import AgroBottom from './model/agro-bottom.vue';
+import { getStorageRoomNames } from '@/utils/common';
 const { proxy } = getCurrentInstance() as ComponentInternalInstance;
 const { pt_material_type } = toRefs<any>(proxy?.useDict('pt_material_type'));
 const list = ref<any[]>();

+ 0 - 2
src/plant/storage/loss-register/index.vue

@@ -126,8 +126,6 @@ const { proxy } = getCurrentInstance() as ComponentInternalInstance;
 const { pt_material_type, pt_seed_instore_type, pt_seed_type, pt_fungus_code_type } = toRefs<any>(proxy?.useDict('pt_material_type', 'pt_seed_instore_type', 'pt_seed_type', 'pt_fungus_code_type'));
 const upFormRef = ref();
 const paging = ref();
-const did = ref<string>('');
-const showArea = ref(false);
 
 const form = ref({
     scrapDate: parseTime(new Date(), '{y}-{m}-{d}'),

+ 10 - 5
src/plant/storage/seed-source/detail/index.vue

@@ -37,6 +37,10 @@
                     <span class="c-#666">供应商:</span>
                     <span class="c-#333 f-w-500">{{ form?.supplier }}</span>
                 </view>
+                <view v-if="form?.warehouses?.length" class="pd2-4-0 f-s-28">
+                    <span class="c-#666">存放库房:</span>
+                    <span class="c-#333 f-w-500">{{ getStorageRoomNames(form?.warehouses) || '-' }}</span>
+                </view>
                 <view class="pd2-4-0 f-s-28">
                     <span class="c-#666">入库量:</span>
                     <span class="c-#333 f-w-500">{{ form?.capacity }}{{ form?.unit }}</span>
@@ -236,9 +240,9 @@
                     <span class="c-#666">库房类型:</span>
                     <span class="c-#333 f-w-600">种源库</span>
                 </view>
-                <view class="f-s-30 pd2-16-0 info-border-bottom">
+                <view v-if="form?.warehouses?.length" class="pd2-4-0 f-s-28">
                     <span class="c-#666">存放库房:</span>
-                    <span class="c-#333 f-w-600">{{ selectDictLabel(pt_warehouse_type, form?.warehouseType) || '-' }}</span>
+                    <span class="c-#333 f-w-500">{{ getStorageRoomNames(form?.warehouses) || '-' }}</span>
                 </view>
                 <view class="f-s-30 pd2-16-0 info-border-bottom">
                     <span class="c-#666">入库人:</span>
@@ -268,6 +272,7 @@
 
 <script setup lang="ts">
 import { formItemBtnStyle } from '@/assets/styles/uview-plus';
+import { getStorageRoomNames } from '@/utils/common';
 import { useClientRequest } from '@/utils/request';
 import { selectDictListClass } from '@/utils/ruoyi';
 const { proxy } = getCurrentInstance() as ComponentInternalInstance;
@@ -297,7 +302,7 @@ const navigateToInOutRecords = () => {
         url: '/plant/storage/stock-list/index',
         params: {
             id: did.value,
-            stockType: '2'
+            stockType: '2',
         },
     });
 };
@@ -309,10 +314,10 @@ const navigateToInventoryLoss = () => {
     });
     uni.navigateTo({
         url: '/plant/storage/loss-register/index',
-        success: (res)=> {
+        success: (res) => {
             res.eventChannel.emit('storage-data', {
                 stockType: '2',
-                ...form.value
+                ...form.value,
             });
         },
     });

+ 5 - 0
src/plant/storage/seed-source/list/index.vue

@@ -57,6 +57,10 @@
                             <span class="c-#666">供应商:</span>
                             <span class="c-#333 f-w-500">{{ item?.supplierInfo?.cusName || '-' }}</span>
                         </view>
+                        <view v-if="item?.warehouses?.length" class="pd2-4-0 f-s-28">
+                            <span class="c-#666">存放库房:</span>
+                            <span class="c-#333 f-w-500">{{ getStorageRoomNames(item?.warehouses) || '-' }}</span>
+                        </view>
                         <view class="pd2-4-0 f-s-28">
                             <span class="c-#666">入库量:</span>
                             <span class="c-#333 f-w-500">{{ item?.capacity }}{{ item?.unit }}</span>
@@ -90,6 +94,7 @@
 import { useClientRequest } from '@/utils/request';
 import SourceBottom from './model/source-bottom.vue';
 import { selectDictListClass } from '@/utils/ruoyi';
+import { getStorageRoomNames } from '@/utils/common';
 const { proxy } = getCurrentInstance() as ComponentInternalInstance;
 const { pt_seed_instore_type, pt_warehouse_type, pt_seed_type, pt_seed_source, pt_materail_unit, pt_mother_father_flag, pt_op_method, pt_seed_unit, pt_fungus_code_type, pt_breeding_materials, yes_no, pt_cus_type, pt_cpy_type, pt_gen_unit } = toRefs<any>(proxy?.useDict('pt_seed_instore_type', 'pt_warehouse_type', 'pt_seed_type', 'pt_seed_source', 'pt_materail_unit', 'pt_mother_father_flag', 'pt_op_method', 'pt_seed_unit', 'pt_fungus_code_type', 'pt_breeding_materials', 'yes_no', 'pt_cus_type', 'pt_cpy_type', 'pt_gen_unit'));
 const list = ref<any[]>();

+ 9 - 1
src/utils/common.ts

@@ -417,4 +417,12 @@ export const getRect = (selector: string, all: boolean = false): Promise<UniApp.
             }).exec();
         }
     });
-};
+};
+
+// 根据传入存放库房数组返回文字
+export const getStorageRoomNames = (rooms: Array<{ warehouseName?: string, shelvesName?: string, shelfId?: string, warehouseId?: string }>): string => {
+    if (!rooms || rooms.length === 0) {
+        return '';
+    }
+    return rooms.map(room => (room.warehouseName || '') +  (room.shelvesName ? '-' : '') + (room.shelvesName || '')).join(',');
+}