Explorar o código

鲜货库逻辑

huangxw hai 3 semanas
pai
achega
17a7cbae01

+ 4 - 0
src/plant/storage/agro-product/info-update/index.vue

@@ -365,6 +365,10 @@ const getDetailById = async (id: string) => {
         form.value = {
         form.value = {
             ...form.value,
             ...form.value,
             ...res.data,
             ...res.data,
+            instoreBizInfo: {
+                ...form.value.instoreBizInfo,
+                ...res.data.instoreBizInfo,
+            },
         };
         };
         if (mode.value === 'copy') {
         if (mode.value === 'copy') {
             form.value.batchCode = '';
             form.value.batchCode = '';

+ 54 - 16
src/plant/storage/fresh-goods/detail/index.vue

@@ -25,14 +25,28 @@
                     <span class="f-s-34 c-#333 f-w-500 mr-10">{{ form?.variety }}</span>
                     <span class="f-s-34 c-#333 f-w-500 mr-10">{{ form?.variety }}</span>
                     <span v-if="form?.partName" class="f-s-24 c-#666">{{ form?.partName }}</span>
                     <span v-if="form?.partName" class="f-s-24 c-#666">{{ form?.partName }}</span>
                 </view>
                 </view>
-                <view class="pd2-4-0 f-s-28">
-                    <span class="c-#666">入库批号:</span>
-                    <span class="c-#333 f-w-500">{{ form?.batchCode }}</span>
-                </view>
-                <view v-if="form?.supplierId" class="pd2-4-0 f-s-28">
-                    <span class="c-#666">供应商:</span>
-                    <span class="c-#333 f-w-500">{{ form?.supplierInfo?.cusName || '-' }}</span>
-                </view>
+                <template v-if="form?.instoreType == '2'">
+                    <view class="pd2-4-0 f-s-28">
+                        <span class="c-#666">入库批号:</span>
+                        <span class="c-#333 f-w-500">{{ form?.batchCode || '-' }}</span>
+                    </view>
+                    <view v-if="form?.supplierId" class="pd2-4-0 f-s-28">
+                        <span class="c-#666">供应商:</span>
+                        <span class="c-#333 f-w-500">{{ form?.supplierInfo?.cusName || '-' }}</span>
+                    </view>
+                </template>
+                <template v-if="form?.instoreType == '3'">
+                    <view class="pd2-4-0 f-s-28">
+                        <span class="c-#666">采收批号:</span>
+                        <span class="c-#333 f-w-500">{{ form?.harvestInfo?.harvestCode || '-' }}</span>
+                    </view>
+                    <view class="pd2-4-0 f-s-28">
+                        <span class="c-#666">采收基地:</span>
+                        <span class="c-#333 f-w-500">
+                            {{ form?.harvestInfo?.baseInfo?.baseName || '-' }}
+                        </span>
+                    </view>
+                </template>
                 <view v-if="form?.warehouses?.length" class="pd2-4-0 f-s-28">
                 <view v-if="form?.warehouses?.length" class="pd2-4-0 f-s-28">
                     <span class="c-#666">存放库房:</span>
                     <span class="c-#666">存放库房:</span>
                     <span class="c-#333 f-w-500">{{ getStorageRoomNames(form?.warehouses) || '-' }}</span>
                     <span class="c-#333 f-w-500">{{ getStorageRoomNames(form?.warehouses) || '-' }}</span>
@@ -55,6 +69,28 @@
                     <up-button @click="navigateToInventoryLoss" type="warning" plain :customStyle="{ background: '#FFF9EF', borderColor: '#F9D9A3' }">库存有消耗?库存损耗登记{{ '>' }}</up-button>
                     <up-button @click="navigateToInventoryLoss" type="warning" plain :customStyle="{ background: '#FFF9EF', borderColor: '#F9D9A3' }">库存有消耗?库存损耗登记{{ '>' }}</up-button>
                 </view>
                 </view>
             </view>
             </view>
+            <view class="pd-24">
+                <view class="startline-title">采收信息</view>
+            </view>
+            <view class="bg-#fff pd-24" v-if="form?.harvestInfo">
+                <view class="f-s-30 pd2-16-0 info-border-bottom">
+                    <span class="c-#666">采收日期:</span>
+                    <span class="c-#333 f-w-600">{{ form?.harvestInfo?.harvestDate || '-' }}至{{ form?.harvestInfo?.harvestDateEnd || '-' }}</span>
+                </view>
+                <view class="f-s-30 pd2-16-0 info-border-bottom">
+                    <span class="c-#666">采收批号:</span>
+                    <span class="c-#333 f-w-600">
+                        {{ form?.harvestInfo?.harvestCode || '-' }}
+                    </span>
+                </view>
+                <!-- 基地挖坑 -->
+                <view class="f-s-30 pd2-16-0 info-border-bottom">
+                    <span class="c-#666">种源加工处理工艺:</span>
+                    <span class="c-#333 f-w-600">
+                        {{ form?.harvestInfo?.ptech ? form?.harvestInfo?.ptech.replace(/,/g, '→') : '-' }}
+                    </span>
+                </view>
+            </view>
             <view class="pd-24">
             <view class="pd-24">
                 <view class="startline-title">鲜货信息</view>
                 <view class="startline-title">鲜货信息</view>
             </view>
             </view>
@@ -141,14 +177,16 @@
                     <span class="c-#666">入库类型:</span>
                     <span class="c-#666">入库类型:</span>
                     <span class="c-#333 f-w-600">{{ selectDictLabel(pt_seed_instore_type, form?.instoreType) || '-' }}</span>
                     <span class="c-#333 f-w-600">{{ selectDictLabel(pt_seed_instore_type, form?.instoreType) || '-' }}</span>
                 </view>
                 </view>
-                <view class="f-s-30 pd2-16-0 info-border-bottom">
-                    <span class="c-#666">入库日期:</span>
-                    <span class="c-#333 f-w-600">{{ form?.instoreBizInfo?.instoreDate || '-' }}</span>
-                </view>
-                <view class="f-s-30 pd2-16-0 info-border-bottom">
-                    <span class="c-#666">入库批号:</span>
-                    <span class="c-#333 f-w-600">{{ form?.batchCode || '-' }}</span>
-                </view>
+                <template v-if="form.instoreType == '2'">
+                    <view class="f-s-30 pd2-16-0 info-border-bottom">
+                        <span class="c-#666">入库日期:</span>
+                        <span class="c-#333 f-w-600">{{ form?.instoreBizInfo?.instoreDate || '-' }}</span>
+                    </view>
+                    <view class="f-s-30 pd2-16-0 info-border-bottom">
+                        <span class="c-#666">入库批号:</span>
+                        <span class="c-#333 f-w-600">{{ form?.batchCode || '-' }}</span>
+                    </view>
+                </template>
                 <view class="f-s-30 pd2-16-0 info-border-bottom">
                 <view class="f-s-30 pd2-16-0 info-border-bottom">
                     <span class="c-#666">库房类型:</span>
                     <span class="c-#666">库房类型:</span>
                     <span class="c-#333 f-w-600">鲜货库</span>
                     <span class="c-#333 f-w-600">鲜货库</span>

+ 5 - 26
src/plant/storage/fresh-goods/info-update/index.vue

@@ -238,32 +238,7 @@ const selectVarietyId = () => {
         },
         },
     });
     });
 };
 };
-const selectFatherVarietyId = () => {
-    uni.$once('updateBiologicalname', function (data) {
-        form.value.instoreBizInfo.fatherVarietyId = data.msg.id;
-        form.value.instoreBizInfo.fatherVarietyInfo = data.msg;
-    });
-    uni.$u.route({
-        type: 'navigateTo',
-        url: '/tools/por-torganism/index',
-        params: {
-            title: '选择父本品种',
-        },
-    });
-};
-const selectMotherVarietyId = () => {
-    uni.$once('updateBiologicalname', function (data) {
-        form.value.instoreBizInfo.motherVarietyId = data.msg.id;
-        form.value.instoreBizInfo.motherVarietyInfo = data.msg;
-    });
-    uni.$u.route({
-        type: 'navigateTo',
-        url: '/tools/por-torganism/index',
-        params: {
-            title: '选择母本品种',
-        },
-    });
-};
+
 const did = ref('');
 const did = ref('');
 // 获取详情(仓库信息)
 // 获取详情(仓库信息)
 const getDetailById = async (id: string) => {
 const getDetailById = async (id: string) => {
@@ -273,6 +248,10 @@ const getDetailById = async (id: string) => {
         form.value = {
         form.value = {
             ...form.value,
             ...form.value,
             ...res.data,
             ...res.data,
+            instoreBizInfo: {
+                ...form.value.instoreBizInfo,
+                ...res.data.instoreBizInfo,
+            },
         };
         };
     }
     }
 };
 };

+ 23 - 9
src/plant/storage/fresh-goods/list/index.vue

@@ -41,14 +41,29 @@
                                 <view v-else class="tag-span c-danger bg-#F9ECEA">未检验</view>
                                 <view v-else class="tag-span c-danger bg-#F9ECEA">未检验</view>
                             </view>
                             </view>
                         </view>
                         </view>
-                        <view class="pd2-4-0 f-s-28">
-                            <span class="c-#666">入库批号:</span>
-                            <span class="c-#333 f-w-500">{{ item?.batchCode || '-' }}</span>
-                        </view>
-                        <view v-if="item?.supplierId" class="pd2-4-0 f-s-28">
-                            <span class="c-#666">供应商:</span>
-                            <span class="c-#333 f-w-500">{{ item?.supplierInfo?.cusName || '-' }}</span>
-                        </view>
+                        <template v-if="item?.instoreType == '2'">
+                            <view class="pd2-4-0 f-s-28">
+                                <span class="c-#666">入库批号:</span>
+                                <span class="c-#333 f-w-500">{{ item?.batchCode || '-' }}</span>
+                            </view>
+                            <view v-if="item?.supplierId" class="pd2-4-0 f-s-28">
+                                <span class="c-#666">供应商:</span>
+                                <span class="c-#333 f-w-500">{{ item?.supplierInfo?.cusName || '-' }}</span>
+                            </view>
+                        </template>
+                        <template v-if="item?.instoreType == '3'">
+                            <view class="pd2-4-0 f-s-28">
+                                <span class="c-#666">采收批号:</span>
+                                <span class="c-#333 f-w-500">{{ item?.harvestInfo?.harvestCode || '-' }}</span>
+                            </view>
+                            <view class="pd2-4-0 f-s-28">
+                                <span class="c-#666">采收基地:</span>
+                                <span class="c-#333 f-w-500">
+                                    {{ item?.harvestInfo?.baseInfo?.baseName || '-' }}
+                                </span>
+                            </view>
+                        </template>
+
                         <view v-if="item?.warehouses?.length" class="pd2-4-0 f-s-28">
                         <view v-if="item?.warehouses?.length" class="pd2-4-0 f-s-28">
                             <span class="c-#666">存放库房:</span>
                             <span class="c-#666">存放库房:</span>
                             <span class="c-#333 f-w-500">{{ getStorageRoomNames(item?.warehouses) || '-' }}</span>
                             <span class="c-#333 f-w-500">{{ getStorageRoomNames(item?.warehouses) || '-' }}</span>
@@ -153,7 +168,6 @@ const onRefresh = () => {
     paging.value.reload();
     paging.value.reload();
 };
 };
 onMounted(() => {
 onMounted(() => {
-
     uni.$on('refreshStorageRoomList', () => {
     uni.$on('refreshStorageRoomList', () => {
         onRefresh();
         onRefresh();
     });
     });

+ 4 - 18
src/plant/storage/seed-source/info-update/index.vue

@@ -666,24 +666,6 @@ const submitForm = async () => {
         true,
         true,
     );
     );
 };
 };
-// 点击随机生成服务端生成唯一的批号(与 add 一致)
-const generateBatchCode = async () => {
-    uni.showLoading({
-        title: '生成中...',
-    });
-    const res = await useClientRequest.post('/plt-api/app/plantationTask/getBatchCode', {
-        plType: 'S',
-        linkType: 'I',
-    });
-    if (res && res.code === 200) {
-        uni.hideLoading();
-        form.value.batchCode = res.data;
-        uni.showToast({
-            title: '批号生成成功',
-            icon: 'success',
-        });
-    }
-};
 
 
 // 选择物种、父母本逻辑保持与 info-edit 一致
 // 选择物种、父母本逻辑保持与 info-edit 一致
 const selectVarietyId = () => {
 const selectVarietyId = () => {
@@ -734,6 +716,10 @@ const getDetailById = async (id: string) => {
         form.value = {
         form.value = {
             ...form.value,
             ...form.value,
             ...res.data,
             ...res.data,
+            instoreBizInfo: {
+                ...form.value.instoreBizInfo,
+                ...res.data.instoreBizInfo,
+            },
         };
         };
     }
     }
 };
 };