소스 검색

修改bug

huangxw 1 개월 전
부모
커밋
ab07f073f8

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

@@ -163,7 +163,7 @@ const scrollToTab = (idx: number) => {
     display: inline-flex;
     align-items: center;
     justify-content: center;
-    height: 78rpx;
+    height: 70rpx;
     font-weight: 500;
     color: #666;
     cursor: pointer;

+ 4 - 18
src/pages.json

@@ -263,20 +263,6 @@
                         "navigationBarTitleText": "修改种源信息"
                     }
                 },
-                // 种源出入库清单
-                {
-                    "path": "seed-source/stock-list/index",
-                    "style": {
-                        "navigationBarTitleText": "种源出入库清单"
-                    }
-                },
-                // 库存耗损登记
-                {
-                    "path": "seed-source/loss-register/index",
-                    "style": {
-                        "navigationBarTitleText": "库存损耗登记"
-                    }
-                },
                 // 农资库
                 {
                     "path": "agro-product/list/index",
@@ -312,16 +298,16 @@
                         "navigationBarTitleText": "修改农资信息"
                     }
                 },
-                // 农资出入库清单
+                // 出入库清单
                 {
-                    "path": "agro-product/stock-list/index",
+                    "path": "stock-list/index",
                     "style": {
                         "navigationBarTitleText": "农资出入库清单"
                     }
                 },
-                // 农资库存耗损登记
+                // 库存耗损登记
                 {
-                    "path": "agro-product/loss-register/index",
+                    "path": "loss-register/index",
                     "style": {
                         "navigationBarTitleText": "农资库存损耗登记"
                     }

+ 12 - 1
src/plant/storage/agro-product/detail/index.vue

@@ -10,7 +10,8 @@
                     <view class="startline-title">库存信息</view>
                 </view>
                 <view>
-                    <up-button type="primary" :customStyle="formItemBtnStyle">
+                    <up-button @click="navigateToInOutRecords" type="primary" :customStyle="formItemBtnStyle">
+                        <image class="w-30 h-30 mr-10" src="@/static/images/plant/storage/ckcrkjl_icon.png" mode="widthFix" />
                         <span>查看出入库记录</span>
                     </up-button>
                 </view>
@@ -213,6 +214,16 @@ const clickEdit = () => {
         },
     });
 };
+const navigateToInOutRecords = () => {
+    uni.$u.route({
+        type: 'navigateTo',
+        url: '/plant/storage/stock-list/index',
+        params: {
+            id: did.value,
+            stockType: '1'
+        },
+    });
+};
 // 页面入参解析并加载
 onLoad((options: any) => {
     did.value = options?.id || '';

+ 0 - 3
src/plant/storage/agro-product/stock-list/index.vue

@@ -1,3 +0,0 @@
-<template>
-    <view>出入库清单</view>
-</template>

+ 0 - 0
src/plant/storage/agro-product/loss-register/index.vue → src/plant/storage/loss-register/index.vue


+ 12 - 2
src/plant/storage/seed-source/detail/index.vue

@@ -10,7 +10,8 @@
                     <view class="startline-title">库存信息</view>
                 </view>
                 <view>
-                    <up-button type="primary" :customStyle="formItemBtnStyle">
+                    <up-button @click="navigateToInOutRecords" type="primary" :customStyle="formItemBtnStyle">
+                        <image class="w-30 h-30 mr-10" src="@/static/images/plant/storage/ckcrkjl_icon.png" mode="widthFix" />
                         <span>查看出入库记录</span>
                     </up-button>
                 </view>
@@ -291,7 +292,16 @@ const getDetailById = async (id: string) => {
         form.value = res.data || {};
     }
 };
-
+const navigateToInOutRecords = () => {
+    uni.$u.route({
+        type: 'navigateTo',
+        url: '/plant/storage/stock-list/index',
+        params: {
+            id: did.value,
+            stockType: '2'
+        },
+    });
+};
 const onRefresh = () => {
     getDetailById(did.value);
     paging.value?.complete();

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

@@ -1,3 +0,0 @@
-<template>
-    <view>损耗登记</view>
-</template>

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

@@ -1,3 +0,0 @@
-<template>
-    <view>出入库清单</view>
-</template>

+ 115 - 0
src/plant/storage/stock-list/index.vue

@@ -0,0 +1,115 @@
+<template>
+    <z-paging ref="paging" v-model="list" bgColor="#f7f7f7" @query="query" safe-area-inset-bottom>
+        <template #top>
+            <ut-navbar title="出入库记录" :fixed="false" border></ut-navbar>
+            <view class="pd2-12-24">
+                <ut-tabs v-model="form.operationType" :tabs="tabs" @change="onRefresh"></ut-tabs>
+                <view class="pd-10"></view>
+                <ut-search ref="searchRef" v-model="form.keyword" @search="onRefresh" margin="0" :border="false" :placeholder="placeholder" bgColor="#fff" height="86rpx" borderRadius="10rpx"></ut-search>
+            </view>
+        </template>
+        <template>
+            <view class="pd2-12-24">
+                <template v-for="item in list" :name="item?.id" :key="item?.id">
+                    <view class="b-radius bg-#fff pd-20 p-rtv mb-20">
+                        <view class="d-flex">
+                            <view class="flex1 ov-hd mr-20 f-s-34 c-#333 f-w-500">{{ selectDictLabel(pt_operation_type, item?.operationType) }}</view>
+                            <view class="f-s-24 c-#666">{{ item?.relationBizInfo?.storageDate }}</view>
+                        </view>
+                        <view class="f-s-28 pd2-5-0">
+                            <span class="c-#666">出入库批号:</span>
+                            <span class="c-#333 f-w-600">{{ item?.batchCode }}</span>
+                        </view>
+                        <view class="f-s-28 pd2-5-0">
+                            <span class="c-#666">记录批号:</span>
+                            <span class="c-#333 f-w-600">{{ item?.recordNumber || '-' }}</span>
+                        </view>
+                        <view class="f-s-28 pd2-5-0">
+                            <span class="c-#666">出入库量:</span>
+                            <span class="c-#333 f-w-600">{{ item?.operationType == '1' ? '+' : '-' }}{{ item?.quantity || '-' }}{{ item?.unit }}</span>
+                        </view>
+                        <view class="f-s-28 pd2-5-0">
+                            <span class="c-#666">用途/来源:</span>
+                            <span class="c-#333 f-w-600">{{ item?.relationBizInfo?.purpose || '-' }}</span>
+                            <span v-if="item?.relationBizInfo?.batchTypeStr && item?.relationBizInfo?.batchCode" class="c-#333 f-w-600 f-s-22">({{ item?.relationBizInfo?.batchTypeStr || '-' }}:{{ item?.relationBizInfo?.batchCode || '-' }})</span>
+                        </view>
+                        <view class="f-s-28 pd2-5-0">
+                            <span class="c-#666">备注:</span>
+                            <span class="c-#333 f-w-600">{{ item?.remark || '-' }}</span>
+                        </view>
+                        <view class="d-flex">
+                            <view class="flex1 f-s-24 pd2-5-0">
+                                <span class="c-#666">操作人:</span>
+                                <span class="c-#666">{{ item?.createByName || '-' }}</span>
+                            </view>
+                            <view class="f-s-24 pd2-5-0">
+                                <span class="c-#666">操作时间:</span>
+                                <span class="c-#666">{{ item?.createTime || '-' }}</span>
+                            </view>
+                        </view>
+                    </view>
+                </template>
+            </view>
+        </template>
+        <!-- 空数据处理 -->
+
+        <template #empty>
+            <ut-empty class="mg-at" size="28rpx" color="#999" padding="10rpx">暂未设置库房,点击+号新增库房吧</ut-empty>
+        </template>
+    </z-paging>
+</template>
+<script setup lang="ts">
+import { useClientRequest } from '@/utils/request';
+const { proxy } = getCurrentInstance() as ComponentInternalInstance;
+const { pt_warehouse_type, pt_operation_type } = toRefs<any>(proxy?.useDict('pt_warehouse_type', 'pt_operation_type'));
+const paging = ref();
+const list = ref<any[]>([]);
+const placeholder = ref('搜出入库批号、用途、来源');
+
+const form = ref({
+    keyword: '',
+    operationType: ''
+});
+const tabs = reactive([
+    { label: '全部', value: '' },
+    { label: '入库记录', value: '1' },
+    { label: '出库记录', value: '2' },
+])
+const query = async (pageNum: number, pageSize: number) => {
+    const params = {
+        pageNum,
+        pageSize,
+        ...form.value,
+        storageId: paramOptions.value.id,
+        stockType: paramOptions.value.stockType,
+    };
+    const res = await useClientRequest.get<any>('/plt-api/app/storageRecord/list', params);
+    if (!res || res.code !== 200) return;
+    const { rows } = res;
+    paging.value.complete(rows);
+};
+const onRefresh = () => {
+    try {
+        paging.value?.reload();
+    } catch (e) {
+        console.error(e);
+    }
+};
+const paramOptions = ref<Record<string, any>>({});
+onLoad((options) => {
+    paramOptions.value = options || {};
+});
+</script>
+<style lang="scss" scoped>
+
+.search-select-item {
+    height: 86rpx;
+    background-color: #fff;
+    border-radius: 10rpx;
+    box-sizing: border-box;
+    padding-left: 16rpx;
+    padding-right: 16rpx;
+    padding-top: 14rpx;
+    padding-bottom: 14rpx;
+}
+</style>

+ 1 - 1
src/plant/storage/storage-room/list/index.vue

@@ -18,7 +18,7 @@
         </template>
 
         <template>
-            <view class="pl-25 pr-25">
+            <view class="pl-24 pr-24">
                 <up-swipe-action>
                     <up-swipe-action-item v-for="item in list" :name="item?.id" :key="item?.id" :disabled="item?.storeCount" :options="optionsAction" @click="clickSwipe" class="mb-20 b-radius">
                         <view @click.stop="clickItem(item)" class="b-radius bg-#fff pd-20 p-rtv">

+ 0 - 0
src/static/images/plant/storage/查看出入库记录.png → src/static/images/plant/storage/ckcrkjl_icon.png