Bläddra i källkod

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

huangxw 2 veckor sedan
förälder
incheckning
cae2fc3673

+ 7 - 0
src/pages.json

@@ -397,6 +397,13 @@
                     "style": {
                         "navigationBarTitleText": "加工任务详情"
                     }
+                },
+                //加工任务首页
+                {
+                    "path": "processing-index/index",
+                    "style": {
+                        "navigationBarTitleText": "加工任务首页"
+                    }
                 }
             ]
         },

+ 196 - 0
src/plant/processing/processing-index/index.vue

@@ -0,0 +1,196 @@
+<template>
+    <z-paging ref="paging" v-model="list" bgColor="#f7f7f7" @query="query" hide-no-more-inside>
+        <template #top>
+            <up-navbar title="加工及包装赋码任务" :fixed="false"> </up-navbar>
+        </template>
+        <template>
+            <view class="pd3-24-24-0">
+                <view class="">
+                    <ut-tabs mode="subsection" v-model="form.restFlag" :tabs="tabs" @change="onRefresh"></ut-tabs>
+                </view>
+            </view>
+            <view class="d-flex a-c pd-24 pb-0 bg-#f7f7f7">
+                <view class="min-w-170 flex1">
+                    <ut-action-sheet v-model="form.taskType" :tabs="[{ label: '全部', value: '' }, ...pt_process_type]" @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">{{ selectDictLabel(pt_process_type, form.taskType) || '全部' }}</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" @change="changeSeach" margin="0" :border="false" placeholder="搜药材名、批号" bgColor="#fff" height="86rpx" borderRadius="10rpx"></ut-search>
+                </view>
+            </view>
+            <view class="pd-24">
+                <template v-for="(item, index) in list" :key="index">
+                    <view class="bg-#fff b-radius pd-24 p-rtv mb-16">
+                        <view v-if="+item?.processType == 1 && +item?.processMedType == 1" class="bg-#91C747 c-#fff f-w-5 pd-10 pt-4 pb-4 f-s-20" style="border-radius: 16rpx 0 16rpx 0; width: max-content; position: absolute; top: 0rpx; left: 0rpx">种子初加工</view>
+                        <view v-if="+item?.processType == 1 && +item?.processMedType == 2" class="bg-#C7A262 c-#fff f-w-5 pd-10 pt-4 pb-4 f-s-20" style="border-radius: 16rpx 0 16rpx 0; width: max-content; position: absolute; top: 0rpx; left: 0rpx">药材初加工</view>
+                        <view v-if="+item?.processType == 2" class="bg-#37A954 c-#fff f-w-5 pd-10 pt-4 pb-4 f-s-20" style="border-radius: 16rpx 0 16rpx 0; width: max-content; position: absolute; top: 0rpx; left: 0rpx">趁鲜切制</view>
+                        <view v-if="item?.processingDate || item?.processingDateEnd" class="d-flex a-c j-ed">
+                            <view class="c-#999 f-s-24">{{ item?.processingDate }} 至 {{ item?.processingDateEnd }}</view>
+                        </view>
+                        <view class="mb-10 d-flex a-c" @click="gotodetaillist(item)">
+                            <view class="">
+                                <span v-if="item?.variety" class="f-s-34 c-#333 f-w-500 mr-10">{{ item?.variety }}</span>
+                                <span v-else class="f-s-34 c-#333 f-w-500 mr-10">{{ item?.medicineName }}(鲜制)</span>
+                                <span class="f-s-24 c-#666" v-if="+item?.processMedType == 1">{{ selectDictLabel(pt_stock_type, item?.processMedType) }}</span>
+                            </view>
+                            <view class="flex1"></view>
+                            <up-icon name="arrow-right" size="26rpx"></up-icon>
+                        </view>
+                        <view class="pd2-4-0 f-s-28">
+                            <span class="c-#666">加工批号:</span>
+                            <span class="c-#333 f-w-500">{{ item?.processCode }}</span>
+                        </view>
+                        <view v-if="+item?.processType == 1" class="pd2-4-0 f-s-28">
+                            <span class="c-#666">执行标准:</span>
+                            <span class="c-#333 f-w-500">{{ selectDictLabel(pt_standard_type, item?.standardType) }}</span>
+                            <span class="c-#666" v-if="item?.standardDetailName">({{ item?.standardDetailName }})</span>
+                        </view>
+                        <view v-else class="pd2-4-0 f-s-28">
+                            <span class="c-#666">执行标准:</span>
+                            <span class="c-#666" v-if="item?.standardDetailName">{{ item?.standardDetailName }}</span>
+                        </view>
+                        <view class="pd2-4-0 f-s-28">
+                            <span class="c-#666">加工工艺:</span>
+                            <template v-for="(items, indexs) in item?.ptech?.split(',')" v-if="item?.ptech" :key="indexs">
+                                <span v-if="indexs !== 0" class="c-#999 f-s-32 ml-10 mr-10">→ </span>
+                                <span class="f-s-32">{{ items }}</span>
+                            </template>
+                            <template v-else>
+                                <span class="c-#999 f-s-32">-</span>
+                            </template>
+                        </view>
+                        <view class="pd2-4-0 f-s-28">
+                            <span class="c-#666">加工负责人:</span>
+                            <span class="c-#333 f-w-500">{{ item?.contactName }}</span>
+                        </view>
+                        <Output :data="item" />
+                    </view>
+                </template>
+            </view>
+        </template>
+        <view class="h-210" v-if="list?.length"></view>
+        <view v-if="list?.length" :style="{ height: `${safeAreaBottom}px` }"></view>
+        <template #empty>
+            <view class="d-flex flex-cln a-c">
+                <ut-empty class="mg-at" color="#ccc" size="28rpx" image="https://ta.zycpzs.cn/oss-file/smart-trace/szyy/images-plt/plant/noEmptyBase.png">暂无加工任务</ut-empty>
+                <text class="c-#ccc f-s-28">点击下方按钮去添加吧~</text>
+            </view>
+        </template>
+        <template #bottom>
+            <ut-tabar activeTab="processing"></ut-tabar>
+        </template>
+    </z-paging>
+    <ut-suspension v-if="sus?.left" :imageWidth="60" :imageHeight="60" :x="sus?.left" :y="sus?.bottom" :inertia="false" :snap-threshold="40">
+        <image src="https://ta.zycpzs.cn/oss-file/smart-trace/szyy/images-plt/common/btn_add_logo.png" mode="widthFix" class="w-120 h-120" @click="showDeleteDialog = true"></image>
+    </ut-suspension>
+    <ut-confirm-dialog v-model:show="showDeleteDialog" width="80vw" title="请选择要创建的任务类型" :confirmText="'确认选择'" :cancelText="'取消'" @confirm="handlechoseConfirm" @cancel="handleDeleteCancel">
+        <view class="" v-for="item in pt_process_type" :key="item?.value">
+            <view style="border: 1rpx solid" :style="{ backgroundColor: item?.value == basetype ? '#EBF6EE' : '#f7f7f7', borderColor: item?.value == basetype ? '#37A954' : 'transparent' }" class="pr-30 d-flex a-c mb-20 radius-100" @click="handlechose(item.value)">
+                <view class="radius-50% mg-8 bg-#F0F0F0" v-if="item?.value == '1'">
+                    <up-avatar size="90rpx" src="https://ta.zycpzs.cn/oss-file/smart-trace/szyy/images-plt/plant/port/TaskType_plant.png"></up-avatar>
+                </view>
+                <view class="radius-50% mg-8 bg-#F0F0F0" v-if="item?.value == '2'">
+                    <up-avatar size="90rpx" src="https://ta.zycpzs.cn/oss-file/smart-trace/szyy/images-plt/plant/port/TaskType_breeding.png"></up-avatar>
+                </view>
+                <view class="c-#333 f-s-34">
+                    {{ item?.label }}
+                </view>
+                <view class="flex1"></view>
+                <view class="d-flex">
+                    <img v-if="basetype === item.value" class="w-30 h-30" src="https://ta.zycpzs.cn/oss-file/smart-trace/szyy/images-plt/plant/chooseSuccessfully.png" mode="widthFix" alt="" />
+                </view>
+            </view>
+        </view>
+    </ut-confirm-dialog>
+</template>
+<script setup lang="ts">
+import { useClientRequest } from '@/utils/request';
+import Output from './models/output.vue';
+const { proxy } = getCurrentInstance() as ComponentInternalInstance;
+const { pt_process_type, pt_stock_type, pt_standard_type } = toRefs<any>(proxy?.useDict('pt_process_type', 'pt_stock_type', 'pt_standard_type'));
+const sus = ref({
+    left: 0,
+    bottom: 0,
+});
+const systemInfo = uni.getSystemInfoSync();
+const windowInfo = uni.getWindowInfo();
+const safeAreaBottom = windowInfo.safeAreaInsets.bottom;
+sus.value.left = systemInfo.windowWidth - 10;
+sus.value.bottom = systemInfo.windowHeight - 200;
+const showDeleteDialog = ref(false);
+const basetype = ref();
+const handlechose = (item: string) => {
+    basetype.value = item;
+};
+// 处理取消
+const handleDeleteCancel = () => {
+    showDeleteDialog.value = false;
+    basetype.value = '';
+};
+const handlechoseConfirm = () => {
+    if (!basetype.value) {
+        uni.showToast({
+            title: '请选择要创建的任务类型',
+            icon: 'none',
+            duration: 2000,
+        });
+        return;
+    }
+    uni.$u.route({ type: 'navigateTo', url: '/plant/processing/processing-create/index', params: { taskType: basetype.value } });
+};
+const paging = ref();
+const list = ref<any[]>([]);
+const tabs = [
+    {
+        label: '加工',
+        value: '0',
+    },
+    {
+        label: '包装赋码',
+        value: '1',
+    },
+];
+const form = ref({
+    storageType: '4',
+});
+const query = async (pageNum: number, pageSize: number) => {
+    const params = {
+        pageNum,
+        pageSize,
+        ...form.value,
+    };
+    const res = await useClientRequest.get('/plt-api/app/processe/pageList', params);
+    if (res) {
+        const { rows } = res;
+        paging.value.complete(rows);
+    }
+};
+const gotodetaillist = (item: any) => {
+    uni.$u.route({
+        type: 'navigateTo',
+        url: '/plant/processing/processing-detail-list/index',
+        params: { id: item?.id },
+    });
+};
+const onRefresh = () => {
+    paging.value?.reload();
+};
+onMounted(() => {
+    uni.$on('updateprocesstasklist', function () {
+        paging.value?.reload();
+    });
+});
+</script>
+<style scoped lang="scss">
+.search-select-item {
+    height: 86rpx;
+    background-color: #fff;
+    border-radius: 10rpx;
+    box-sizing: border-box;
+    padding: 12rpx;
+}
+</style>

+ 114 - 0
src/plant/processing/processing-index/models/output.vue

@@ -0,0 +1,114 @@
+<template>
+    <view class="radius-10 bg-#f7f7f7 d-flex mb-10 mt-10">
+        <view class="bg-#EDF7F0 w-50 h-110 d-flex flex-cln a-c j-c c-primary f-w-5 f-s-24">
+            <view class="">原</view>
+            <view class="">料</view>
+        </view>
+        <view class="bg-#F5FBF7 flex1 d-flex a-c" v-if="Object.keys(inputList || {}).length === 0">
+            <view class="d-flex flex1 f-s-26">
+                <view class="c-#999 ml-16"> 暂无关联原料信息 </view>
+                <view class="flex1"></view>
+                <view class="c-primary d-flex a-c" @click="goAssociate">
+                    <view>去关联</view>
+                    <up-icon name="arrow-right" size="26rpx"></up-icon>
+                </view>
+            </view>
+        </view>
+        <view class="bg-#F6FAFE flex1 f-s-22 d-flex a-c pd-16" v-else>
+            <ut-row gap="10rpx" class="w-100%">
+                <ut-col class="d-flex flex-cln j-c" :span="15">
+                    <view class="d-flex a-c">
+                        <span class="c-#666 f-s-26">{{ inputList?.materialName }}</span>
+                        <span class="c-#999 f-s-22 ml-10">{{ inputList?.storageInfo?.partName }}</span>
+                    </view>
+                    <view class="d-flex">
+                        <span class="c-#999 f-s-22">{{ inputList?.storageInfo?.batchCode }}</span>
+                    </view>
+                </ut-col>
+                <ut-col class="d-flex a-c c-#666" :span="10">{{ inputList?.quantity }}{{ inputList?.unit }}</ut-col>
+                <ut-col class="d-flex a-c j-ed" :span="5" @click.stop="withdraw">
+                    <span class="c-#666">撤回</span>
+                    <up-icon name="arrow-right" size="26rpx"></up-icon>
+                </ut-col>
+            </ut-row>
+        </view>
+    </view>
+    <view class="radius-10 bg-#f7f7f7 d-flex">
+        <view class="bg-#EBF4FD w-50 d-flex flex-cln a-c j-c c-#2289E0 f-w-5 f-s-24">
+            <view class="">产</view>
+            <view class="">出</view>
+        </view>
+        <view class="bg-#F6FAFE flex1 d-flex a-c" v-if="data?.length === 0">
+            <view class="d-flex flex1 f-s-26">
+                <view class="c-#999 ml-16"> 暂无产出信息 </view>
+                <view class="flex1"></view>
+                <view class="c-#2289E0 d-flex a-c">
+                    <view>添加产出</view>
+                    <up-icon name="arrow-right" size="26rpx"></up-icon>
+                </view>
+            </view>
+        </view>
+        <view class="bg-#F6FAFE flex1 f-s-22 pd-16" v-else>
+            <ut-row gap="10rpx">
+                <ut-col class="d-flex a-c c-#666" :span="2">01</ut-col>
+                <ut-col class="d-flex flex-cln j-c" :span="8">
+                    <span class="c-#666">统货2</span>
+                    <span class="c-#999">1mm极薄片</span>
+                </ut-col>
+                <ut-col class="d-flex a-c c-#666" :span="8">19999kg</ut-col>
+                <ut-col class="d-flex a-c" :span="3">
+                    <span class="c-#F74C30">未检</span>
+                    <span class="c-primary">已检</span>
+                </ut-col>
+                <ut-col class="d-flex a-c j-ed" :span="9">
+                    <span class="c-#666">已入药材库</span>
+                    <span class="c-#666">未入库</span>
+                    <up-icon name="arrow-right" size="26rpx"></up-icon>
+                </ut-col>
+            </ut-row>
+            <view class="d-flex a-c j-c pd-16 radius-10" style="border: 1rpx dashed #2289e0">
+                <up-icon name="plus" size="26rpx" color="#2289E0"></up-icon>
+                <span class="c-#2289E0 f-s-26">添加产出物</span>
+            </view>
+        </view>
+    </view>
+</template>
+<script setup lang="ts">
+import { useClientRequest } from '@/utils/request';
+const props = defineProps<{
+    data: any;
+}>();
+watch(
+    () => props.data,
+    (val) => {
+        inputList.value = val?.inputList[0] || {};
+    },
+);
+const inputList = ref<any>(props?.data?.inputList[0] || {});
+const goAssociate = () => {
+    uni.$u.route({
+        type: 'navigateTo',
+        url: '/tools/species-info-process/index',
+        params: { id: props?.data?.id, processMedType: props?.data?.processMedType },
+    });
+};
+uni.$on(`updatesupervise-${props?.data?.id}`, function (data) {
+    inputList.value = data;
+});
+const withdraw = async () => {
+    // 删除
+    const res = await uni.showModal({
+        title: '撤回提示',
+        content: '撤回后不可恢复,请谨慎操作!',
+        confirmColor: '#F74C30',
+    });
+    console.log(res);
+    if (res.confirm) {
+        const delRes = await useClientRequest.get(`/plt-api/app/processInputMaterial/callbackInput/${inputList?.value?.id}`);
+        if (delRes && delRes.code === 200) {
+            uni.showToast({ title: '删除成功', icon: 'none' });
+            inputList.value = {};
+        }
+    }
+};
+</script>