huangxw 2 hafta önce
ebeveyn
işleme
c781328069

+ 18 - 3
src/plant/packaging/create/index.vue

@@ -7,7 +7,15 @@
             <view class="pd-24 bg-#fff mb-10">
                 <view class="h-1" id="inputStorageIdpppp"></view>
                 <up-form-item borderBottom label="选择包装对象" prop="inputStorageId" required>
-                     
+                       <view class="flex1">
+                        <up-button v-if="!form.inputStorageId" @click="selectStorage" type="primary" plain>
+                            <image class="w-36 h-36 mr-10" src="https://ta.zycpzs.cn/oss-file/smart-trace/szyy/images-plt/common/select_push_icon.png" mode="widthFix" />
+                            <span>请选择您要包装的对象</span>
+                        </up-button>
+                        <view v-else class="bg-#FBFDFB card-info-block pd-24 p-rtv">
+                           
+                        </view>
+                    </view>
                 </up-form-item>
                 <view class="h-1" id="storageUseAmountpppp"></view>
                 <up-form-item borderBottom label="本次包装用量" prop="storageUseAmount" required>
@@ -247,8 +255,15 @@ const generateBatchCode = async () => {
         });
     }
 };
-const confirmArea = (area: any) => {
-    form.value.adcdCodeName = area.fullName;
+// 去选择包装对象页选择包装对象,选择后返回并赋值
+const selectStorage = () => {
+    uni.$on('selectStorage', (data: any) => {
+        console.log(data, '---');
+        uni.$off('selectStorage');
+    });
+    uni.navigateTo({
+        url: '/plant/packaging/select-object/index',
+    });
 };
 
 onLoad((options: any) => {});

+ 64 - 2
src/plant/packaging/select-object/index.vue

@@ -1,3 +1,65 @@
 <template>
-    <view>xx</view>
-</template>
+    <z-paging-swiper>
+        <!-- 需要固定在顶部不滚动的view放在slot="top"的view中 -->
+        <!-- 注意!此处的z-tabs为独立的组件,可替换为第三方的tabs,若需要使用z-tabs,请在插件市场搜索z-tabs并引入,否则会报插件找不到的错误 -->
+        <template #top>
+            
+        </template>
+
+        <view class="swiper-content d-flex flex-cln">
+            <template>
+                <up-navbar :fixed="false" bg-color="transparent">
+                    <template #left><span></span></template>
+                </up-navbar>
+                <view class="pd2-16-24">
+                    <view class="d-flex">
+                        <view class="pd-10 d-flex a-c p-rtv flex1 ov-hd">
+                            <span class="mr-10 f-s-32 c-#333 f-w-500">Hi,{{ name }}</span>
+                            <span class="f-s-24 c-#ccc">{{ setCipByNum(phone ?? null, 3, 4) }}</span>
+                        </view>
+                        <view>
+                            <image class="w-254 h-151" src="https://ta.zycpzs.cn/oss-file/smart-trace/szyy/images-plt/audit/plant/base_index_logo_right.png" mode="widthFix" />
+                        </view>
+                    </view>
+                    <ut-tabs :tabs="tabs" v-model="viewType"></ut-tabs>
+                </view>
+            </template>
+            <!-- swiper必须设置height:100%,因为swiper有默认的高度,只有设置高度100%才可以铺满页面  -->
+            <swiper class="flex1 ov-hd" :current="viewType" @transition="swiperTransition" @animationfinish="swiperAnimationfinish">
+                <swiper-item class="swiper-item">
+                    <!-- 这里的swiper-list-item为demo中为演示用定义的组件,列表及分页代码在swiper-list-item组件内 -->
+                    <!-- 请注意,swiper-list-item非z-paging内置组件,在自己的项目中必须自己创建,若未创建则会报组件不存在的错误 -->
+                    
+                </swiper-item>
+                <swiper-item class="swiper-item">
+                    <!-- 这里的swiper-list-item为demo中为演示用定义的组件,列表及分页代码在swiper-list-item组件内 -->
+                    <!-- 请注意,swiper-list-item非z-paging内置组件,在自己的项目中必须自己创建,若未创建则会报组件不存在的错误 -->
+                  
+                </swiper-item>
+            </swiper>
+        </view>
+    </z-paging-swiper>
+</template>
+<script setup lang="ts">
+import { setCipByNum } from '@/utils/public';
+const { proxy } = getCurrentInstance() as ComponentInternalInstance;
+// 证书文件类型
+const tabs = ref([
+    { label: '从药材库选择', value: '0' },
+    { label: '从鲜货库选择', value: '1' },
+    { label: '从种源库选择', value: '2' },
+]);
+
+const viewType = ref('0');
+const swiperTransition = (e: any) => {};
+const swiperAnimationfinish = (e: any) => {
+    viewType.value = e.detail.current.toString();
+};
+onMounted(() => {});
+</script>
+<style lang="scss" scoped>
+.swiper-content {
+    height: 100vh;
+    overflow: hidden;
+}
+</style>