Ver código fonte

Merge branch 'master' of http://git.yujin.shuziyunyao.com/yujin/forestry-wx

lisy 1 semana atrás
pai
commit
b39b71f74c

+ 1 - 1
src/components/ut-navbar/ut-navbar.vue

@@ -18,7 +18,7 @@
                 </slot>
             </template>
         </up-navbar>
-        <view v-if="breadcrumb" class="bg-#EBF6EE pd2-10-24 f-s-24 c-#3FAD5B">
+        <view v-if="breadcrumb" class="bg-#EBF6EE pd2-10-24 f-s-24 c-#3FAD5B up-line-1">
             <slot name="breadcrumb">
                 <template v-for="(item, index) in breads" :key="index">{{ index ? ' > ' : '' }}{{ item.title }}</template>
             </slot>

+ 1 - 1
src/components/ut-tabar/ut-tabar.vue

@@ -21,7 +21,7 @@
                         </view>
                     </up-grid-item>
                     <up-grid-item>
-                        <view class="pd2-10-0 d-flex flex-cln a-c j-c">
+                        <view class="pd2-10-0 d-flex flex-cln a-c j-c" @click="showStorage = false;$u.route({ url: '/plant/storage/seed-source/list/index' })">
                             <view class="w-109 h-109 bg-#fff radius-50% d-flex a-c j-c mb-10">
                                 <image class="w-72 h-72" src="@/static/images/plant/storage/nav_zyk_icon.png" mode="widthFix" />
                             </view>

+ 23 - 4
src/components/ut-tabs/ut-tabs.vue

@@ -40,6 +40,17 @@
             </view>
         </view>
     </template>
+    <template v-if="mode == 'subsection'">
+        <view class="tabs-subsection-wrap d-flex">
+            <template v-for="(item, idx) in tabs" :key="idx">
+                <view class="flex1 subsection-item d-flex p-rtv j-c a-c" :class="{ active: idx === activeIndex }">
+                    <slot :name="item.value">
+                        <text class="f-s-32 c-999">{{ item.label }}</text>
+                    </slot>
+                </view>
+            </template>
+        </view>
+    </template>
 </template>
 
 <script setup lang="ts">
@@ -67,10 +78,10 @@ const props = defineProps({
     },
     mode: {
         type: String,
-        default: 'scroll-x' // btw
+        default: 'scroll-x' // btw subsection
     }
 })
-const SCROLL_OFFSET = ref(-uni.$u?.getPx('200rpx'));
+const SCROLL_OFFSET = ref(-(uni as any).$u?.getPx('200rpx'));
 const emit = defineEmits(['update:modelValue', 'change'])
 
 const activeIndex = ref(0)
@@ -79,8 +90,6 @@ const scrollViewRef = ref(null)
 const tabRefs = ref([])
 
 watch(() => props.modelValue, (val: any) => {
-    console.log(val);
-    
     const idx = props.tabs.findIndex(tab => tab.value === val)
     if (idx !== -1) {
         activeIndex.value = idx
@@ -165,4 +174,14 @@ const scrollToTab = (idx: number) => {
         z-index: 1;
     }
 }
+.tabs-subsection-wrap {
+    height: 88rpx;
+    border-radius: 10rpx;
+    background-color: #fff;
+    overflow: hidden;
+
+    &.active .subsection-item {
+        background-color: #f0f9f4;
+    }
+}
 </style>

+ 14 - 0
src/pages.json

@@ -158,6 +158,20 @@
                     "style": {
                         "navigationBarTitleText": "库房详情"
                     }
+                },
+                // 种源库
+                {
+                    "path": "seed-source/list/index",
+                    "style": {
+                        "navigationBarTitleText": "种源库"
+                    }
+                },
+                // 种源库详情
+                {
+                    "path": "seed-source/detail/index",
+                    "style": {
+                        "navigationBarTitleText": "种源详情"
+                    }
                 }
             ]
         },

+ 1 - 1
src/plant/base/base-detail/index.vue

@@ -319,7 +319,7 @@
                             </view>
                         </up-button>
                     </template>
-                    <up-button @click="$u.route({ type: 'navigateTo', url: '/plant/base/base-edit/index', params: { id: did } })" type="primary">修改</up-button>
+                    <up-button @click="$u.route({ type: 'navigateTo', url: '/plant/base/base-edit/index', params: { id: did } })" type="primary">修改</up-button>
                 </view>
             </template>
         </z-paging>

+ 2 - 2
src/plant/base/base-edit/index.vue

@@ -1,7 +1,7 @@
 <template>
     <z-paging ref="paging" bgColor="#F7F7F7" safe-area-inset-bottom paging-class="paging-btm-shadow" scroll-with-animation>
         <template #top>
-            <ut-navbar :title="(did && !+form?.baseInfo?.gapFlag ? '编辑基地' : '添加基地')" :fixed="false" border></ut-navbar>
+            <ut-navbar :title="(did && !+form?.baseInfo?.tempFlag ? '编辑基地' : '添加基地')" :fixed="false" border></ut-navbar>
             <view class="bg-fff mb-20">
                 <view class="pd-5"></view>
                 <ut-tabs v-model="activeTab" :tabs="tabs" mode="btw" @change="changeActiveTab"></ut-tabs>
@@ -680,7 +680,7 @@ const submitForm = async () => {
                 title: '提交中...',
             });
             try {
-                const res = did.value && !+form.value?.baseInfo?.gapFlag ? await useClientRequest.post('/plt-api//app/base/update', form.value) : await useClientRequest.post('/plt-api/app/base/add', form.value);
+                const res = did.value && !+form.value?.baseInfo?.tempFlag ? await useClientRequest.post('/plt-api//app/base/update', form.value) : await useClientRequest.post('/plt-api/app/base/add', form.value);
                 uni.hideLoading();
                 if (!res || res.code !== 200) return;
                 uni.hideLoading();

+ 3 - 0
src/plant/storage/seed-source/detail/index.vue

@@ -0,0 +1,3 @@
+<template>
+    <view>xx</view>
+</template>

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

@@ -0,0 +1,77 @@
+<template>
+    <z-paging ref="paging" v-model="list" bgColor="#f7f7f7" @query="query" safe-area-inset-bottom>
+        <template #top>
+            <ut-navbar title="种源库" :fixed="false"></ut-navbar>
+        </template>
+
+        <view class="pd3-24-24-0">
+            <view class="mb-20">
+                <ut-tabs mode="subsection" :tabs="tabs" v-model="form.queryType"></ut-tabs>
+            </view>
+            <view class="d-flex a-c bg-#f7f7f7">
+                <view class="min-w-170 flex1">
+                    <ut-action-sheet v-model="form.queryType" :tabs="[{ label: '全部', value: '' }]" @change="onRefresh" title="选择原料类型">
+                        <view class="d-flex search-select-item a-c">
+                            <view class="flex1 ov-hd f-s-28 c-333 text-center f-w-5 w-s-no">{{ '全部' }} </view>
+                            <up-icon size="24rpx" color="#333" name="arrow-down-fill" class="mr-5"></up-icon>
+                        </view>
+                    </ut-action-sheet>
+                </view>
+                <view class="h-86 pl-20 w-100%">
+                    <ut-search ref="searchRef" v-model="form.keyword" @search="changeSeach" margin="0" :border="false" placeholder="搜名称、批号、库房、供应商" bgColor="#fff" height="86rpx" borderRadius="10rpx"></ut-search>
+                </view>
+            </view>
+            <view></view>
+        </view>
+        <view class="pd-24 bg-#f7f7f7"> </view>
+
+        <template #empty>
+            <view class="d-flex flex-cln a-c" style="margin-top: -200rpx">
+                <ut-empty class="mg-at" color="#ccc" size="28rpx">暂无种源信息,点击下方+号新增吧</ut-empty>
+            </view>
+        </template>
+    </z-paging>
+</template>
+<script setup lang="ts">
+import { useClientRequest } from '@/utils/request';
+import { onShareAppMessage } from '@dcloudio/uni-app';
+const { proxy } = getCurrentInstance() as ComponentInternalInstance;
+const { pt_task_type } = toRefs<any>(proxy?.useDict('pt_task_type'));
+const list = ref<unknown[]>();
+const form = ref({ queryType: 'seed', keyword: '' });
+const paging = ref();
+const tabs = ref([
+    { label: '有库存', value: 'seed' },
+    { label: '无库存', value: 'seedling' },
+    { label: '种球', value: 'bulb' },
+]);
+
+const changeSeach = () => {
+    paging.value.reload();
+};
+const query = async (pageNum: number, pageSize: number) => {
+    const params = {
+        pageNum,
+        pageSize,
+        ...form.value,
+    };
+    const res = await useClientRequest.get('/plt-api/app/plantationTask/list', params);
+    if (res) {
+        const { rows } = res;
+        paging.value.complete(rows);
+    }
+};
+
+const onRefresh = () => {
+    paging.value.reload();
+};
+</script>
+<style lang="scss" scoped>
+.search-select-item {
+    height: 86rpx;
+    background-color: #fff;
+    border-radius: 10rpx;
+    box-sizing: border-box;
+    padding: 12rpx;
+}
+</style>