Bladeren bron

修改包装批号

huangxw 1 week geleden
bovenliggende
commit
18d9d0cbec

+ 7 - 0
src/pages.json

@@ -379,6 +379,13 @@
                         "navigationBarTitleText": "药材库"
                     }
                 },
+                // 药材使用记录
+                {
+                    "path": "medicine/use-record/index",
+                    "style": {
+                        "navigationBarTitleText": "药材使用记录"
+                    }
+                },
                 //成品库
                 {
                     "path": "finished-product/list/index",

+ 11 - 7
src/plant/models/warehouseCard/medicine-card.vue

@@ -1,30 +1,34 @@
 <template>
     <view class="d-flex j-sb a-c li-item-head">
-        <view class="li-left-tag" :class="{ [`bg-instore-${item?.instoreBizInfo?.processType}`]: true }">{{ item?.seedLevel || '' }}{{ selectDictLabel(st_medicine_process_type, item?.instoreBizInfo?.processType) }}</view>
-        <view v-if="isInstoreDate" class="f-s-22 c-#666">{{ item?.instoreBizInfo?.instoreDate }}</view>
+        <view class="li-left-tag" :class="{ [`bg-instore-${item?.instoreBizInfo?.processType}`]: true }">{{ selectDictLabel(st_medicine_process_type, item?.instoreBizInfo?.processType) }}</view>
+        <view v-if="isInstoreDate" class="f-s-22 c-#666"> 
+            {{ getDateRangeFrt(item?.instoreBizInfo?.processingDate, item?.instoreBizInfo?.processingDateEnd) }}
+            <span>包装</span>
+        </view>
     </view>
     <view class="pd-20">
-        <view class="d-flex flex1 mb-10">
+        <view class="d-flex flex1">
             <view class="flex1">
-                <span class="f-s-34 c-#333 f-w-500 mr-10">{{ item?.variety }}</span>
-                <span v-if="item?.partName" class="f-s-24 c-#666">{{ item?.partName }}</span>
+                <span class="f-s-34 c-#333 f-w-500 mr-10">{{ item?.instoreBizInfo?.proName }}</span>
+                <span v-if="item?.instoreBizInfo?.proLevel" class="f-s-24 c-#666">{{ item?.instoreBizInfo?.proLevel }}</span>
             </view>
             <view>
                 <view v-if="item?.examinReport?.length" class="tag-span c-primary bg-#EBF6EE">已检验</view>
                 <view v-else class="tag-span c-danger bg-#F9ECEA">未检验</view>
             </view>
         </view>
+        <view v-if="item?.instoreBizInfo?.proSpecn" class="f-s-24 c-#666">{{ item?.instoreBizInfo?.proSpecn }}</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 class="pd2-4-0 f-s-28">
             <span class="c-#666">执行标准:</span>
-            <span class="c-#333 f-w-500">{{ item?.supplierInfo?.cusName || '-' }}</span>
+            <span class="c-#333 f-w-500">{{ item?.instoreBizInfo?.standardName || '-' }}</span>
         </view>
         <view class="pd2-4-0 f-s-28">
             <span class="c-#666">加工工艺:</span>
-            <span class="c-#333 f-w-500">{{ item?.supplierInfo?.cusName || '-' }}</span>
+            <span class="c-#333 f-w-500">{{ item?.instoreBizInfo?.ptech || '-' }}</span>
         </view>
         <view class="pd2-4-0 f-s-28">
             <span class="c-#666">入库量:</span>

+ 13 - 43
src/plant/storage/medicine/list/index.vue

@@ -27,13 +27,18 @@
             </view>
         </view>
         <view class="pd-24 bg-#f7f7f7">
-            <up-swipe-action>
-                <up-swipe-action-item v-for="(item, index) in list" :key="index" :name="item?.id" :options="optionsActionTemp" @click="clickTempSwipe" class="mb-20 b-radius">
-                    <view class="b-radius bg-#fff p-rtv">
-                       <MedicineCard :item="item" :dict="{ st_medicine_process_type }"></MedicineCard>
-                    </view>
-                </up-swipe-action-item>
-            </up-swipe-action>
+            <template v-for="(item, index) in list" :key="index">
+                <view class="b-radius bg-#fff p-rtv mb-20">
+                    <MedicineCard :item="item" :dict="{ st_medicine_process_type }">
+                        <view class="d-flex j-ed">
+                            <view class="d-flex a-c pt-10" @click.stop="$u.route({ url: '/plant/storage/medicine/use-record/index', params: { id: item?.id, stockType: '5' } })">
+                                <span class="f-s-24 c-#999">查看使用记录</span>
+                                <up-icon name="arrow-right" size="26rpx" color="#999"></up-icon>
+                            </view>
+                        </view>
+                    </MedicineCard>
+                </view>
+            </template>
         </view>
 
         <template #empty>
@@ -71,42 +76,7 @@ const query = async (pageNum: number, pageSize: number) => {
         paging.value.complete(rows);
     }
 };
-// 暂存项左滑删除配置
-const optionsActionTemp = reactive([
-    {
-        text: '删除',
-        style: {
-            backgroundColor: '#F74C30',
-        },
-    },
-]);
-// 暂存项删除点击(本地移除)
-const clickTempSwipe = async (event: object) => {
-    const { name, index } = event as any;
-    if (index === 0) {
-        try {
-            const res = await uni.showModal({
-                title: '删除提示',
-                content: '确定删除药材信息吗?',
-                confirmColor: '#F74C30',
-            });
-            if (!res.confirm) return;
-            await uni.showLoading({
-                title: '删除中...',
-                mask: true,
-            });
-            await useClientRequest.get(`/plt-api/app/storage/removeById/${name}`);
-            uni.hideLoading();
-            uni.showToast({
-                title: '删除成功',
-                icon: 'success',
-            });
-            paging.value?.reload();
-        } catch (error) {
-            console.error('删除暂存药材信息失败:', error);
-        }
-    }
-};
+
 
 const onRefresh = () => {
     paging.value.reload();

+ 104 - 0
src/plant/storage/medicine/use-record/index.vue

@@ -0,0 +1,104 @@
+<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">
+                <view class="pd-10"></view>
+                <ut-search ref="searchRef" v-model="form.packSn" @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">用于包装</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?.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?.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({
+    packSn: '',
+    operationType: '2'
+});
+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/stock-list/index.vue

@@ -54,7 +54,7 @@
         <!-- 空数据处理 -->
 
         <template #empty>
-            <ut-empty class="mg-at" size="28rpx" color="#999" padding="10rpx">暂未设置库房,点击+号新增库房吧</ut-empty>
+            <ut-empty class="mg-at" size="28rpx" color="#999" padding="10rpx">暂无出入库记录</ut-empty>
         </template>
     </z-paging>
 </template>