Ver código fonte

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

huangxw 3 semanas atrás
pai
commit
65ce03ea8e

+ 119 - 42
src/pages/plant/processing/index.vue

@@ -1,5 +1,5 @@
 <template>
-    <z-paging ref="paging" v-model="list" bgColor="#f7f7f7" @query="query" safe-area-inset-bottom>
+    <z-paging ref="paging" v-model="list" bgColor="#f7f7f7" @query="query" safe-area-inset-bottom hide-no-more-inside>
         <template #top>
             <up-navbar title="加工及包装赋码任务" :fixed="false"> </up-navbar>
         </template>
@@ -23,59 +23,128 @@
                 </view>
             </view>
             <view class="pd-24">
-                <view class="bg-#fff b-radius pd-24">
-                    <view class="mb-10">
-                        <span class="f-s-34 c-#333 f-w-500 mr-10">三七</span>
-                        <span class="f-s-24 c-#666">种子</span>
-                    </view>
-                    <view class="pd2-4-0 f-s-28">
-                        <span class="c-#666">加工批号:</span>
-                        <span class="c-#333 f-w-500">1231312312312312</span>
-                    </view>
-                    <view class="pd2-4-0 f-s-28">
-                        <span class="c-#666">执行标准:</span>
-                        <span class="c-#333 f-w-500"></span>
-                    </view>
-                    <view class="pd2-4-0 f-s-28">
-                        <span class="c-#666">加工工艺:</span>
-                        <span class="c-#333 f-w-500"></span>
-                    </view>
-                    <view class="pd2-4-0 f-s-28">
-                        <span class="c-#666">加工负责人:</span>
-                        <span class="c-#333 f-w-500"></span>
-                    </view>
-                    <view class="radius-10 bg-#f7f7f7 d-flex">
-                        <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>
+                <template v-for="(item, index) in list" :key="index">
+                    <view class="bg-#fff b-radius pd-24 p-rtv">
+                        <view v-if="+item?.processType == 1 && +item?.stockType == 1" class="bg-#91C747 c-#fff f-w-5 pl-10 pr-10 f-s-20" style="border-radius: 16rpx 0 16rpx 0; width: max-content; position: relative; top: -24rpx; left: -24rpx">种子初加工</view>
+                        <view v-if="+item?.processType == 1 && +item?.stockType == 2" class="bg-#C7A262 c-#fff f-w-5 pl-10 pr-10 f-s-20" style="border-radius: 16rpx 0 16rpx 0; width: max-content; position: relative; top: -24rpx; left: -24rpx">药材初加工</view>
+                        <view v-if="+item?.processType == 2" class="bg-#37A954 c-#fff f-w-5 pl-10 pr-10 f-s-20" style="border-radius: 16rpx 0 16rpx 0; width: max-content; position: relative; top: -24rpx; left: -24rpx">趁鲜切制</view>
+                        <view class="mb-10">
+                            <span class="f-s-34 c-#333 f-w-500 mr-10">{{ item?.variety }}</span>
+                            <span class="f-s-24 c-#666" v-if="+item?.stockType == 1">{{ selectDictLabel(pt_stock_type, item?.stockType) }}</span>
+                        </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 class="bg-#F5FBF7 flex1 d-flex a-c">
-                            <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">
-                                    <view>去关联</view>
-                                    <up-icon name="arrow-right" size="26rpx"></up-icon>
+                        <view 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 class="pd2-4-0 f-s-28">
+                            <span class="c-#666">加工工艺:</span>
+                            <template v-for="(items, indexs) in item?.ptech?.split(',')" :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>
+                        </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>
+                        <view class="radius-10 bg-#f7f7f7 d-flex">
+                            <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">
+                                <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">
+                                        <view>去关联</view>
+                                        <up-icon name="arrow-right" size="26rpx"></up-icon>
+                                    </view>
                                 </view>
                             </view>
                         </view>
+                        <Output />
                     </view>
-                    <Output />
-                </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 } = toRefs<any>(proxy?.useDict('pt_process_type'));
+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/port/port-create/index', params: { taskType: basetype.value } });
+};
 const paging = ref();
-const list = ref([]);
+const list = ref<any[]>([]);
 const tabs = [
     {
         label: '加工',
@@ -86,12 +155,20 @@ const tabs = [
         value: '1',
     },
 ];
-const form = reactive({
+const form = ref({
     restFlag: '0',
 });
-const query = async (page: number, size: number) => {
-    // const res = await getList(page, size);
-    // return res;
+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 onRefresh = () => {
     paging.value?.complete();

+ 21 - 10
src/pages/plant/processing/models/output.vue

@@ -1,6 +1,6 @@
 <template>
     <view class="radius-10 bg-#f7f7f7 d-flex">
-        <view class="bg-#EBF4FD w-50 h-110 d-flex flex-cln a-c j-c c-#2289E0 f-w-5 f-s-24">
+        <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>
@@ -14,17 +14,28 @@
                 </view>
             </view>
         </view>
-        <view class="bg-#F6FAFE flex1" v-else>
+        <view class="bg-#F6FAFE flex1 f-s-22 pd-24" v-else>
             <ut-row gap="10rpx">
-                <view class="" :span="2">01</view>
-                <view class="d-flex flex-cln" :span="10">
-                    <span>统货</span>
-                    <span>1mm极薄片</span>
-                </view>
-                <view class="" :span="10"> 19999kg </view>
-                <view class="" :span="2">未检</view>
-                <view class="" :span="5">已入药材库</view>
+                <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>

+ 27 - 2
src/plant/port/port-harvest-create/index.vue

@@ -51,8 +51,31 @@
                             </up-form-item>
                         </ut-action-sheet>
                         <!-- 菌种/菌株编号 -->
-                        <up-form-item v-if="form?.seedType == 'A4' || form?.seedType == 'A8'" borderBottom label="菌种/菌株编号" required prop="fungusCode" id="fungusCodeppppp">
+                        <!-- <up-form-item v-if="form?.seedType == 'A4' || form?.seedType == 'A8'" borderBottom label="菌种/菌株编号" required prop="fungusCode" id="fungusCodeppppp">
                             <up-input v-model="form.fungusCode" placeholder="请输入菌种/菌株编号" border="none"></up-input>
+                        </up-form-item> -->
+                        <up-form-item required v-if="['A4', 'A8'].includes(form.seedType as string)" :label="`${selectDictLabel(pt_seed_type, form.seedType as string)}编号`" class="form-item-bottom-padding-0">
+                            <view class="d-flex flex1">
+                                <view class="flex1">
+                                    <ut-action-sheet v-model="form.fungusCodeType" :tabs="pt_fungus_code_type" mode="custom" title="选择单位">
+                                        <up-form-item prop="fungusCodeType" border-bottom class="form-item-top-padding-0">
+                                            <view class="flex1" style="line-height: 24px">
+                                                <view v-if="form.fungusCodeType" class="f-s-30 c-333 f-w-5">{{ selectDictLabel(pt_fungus_code_type, form.fungusCodeType) }}</view>
+                                                <view v-else class="f-s-30 c-ccc f-w-4">选择编号类型</view>
+                                            </view>
+                                            <template #right>
+                                                <up-icon class="pr-20" size="22rpx" color="#2A6D52" name="arrow-down-fill"></up-icon>
+                                            </template>
+                                        </up-form-item>
+                                    </ut-action-sheet>
+                                </view>
+                                <view class="pd-5"></view>
+                                <view class="flex1">
+                                    <up-form-item prop="fungusCode" border-bottom class="form-item-top-padding-0">
+                                        <up-input v-model="form.fungusCode" placeholder="输入数字小数点" border="none" clearable></up-input>
+                                    </up-form-item>
+                                </view>
+                            </view>
                         </up-form-item>
                     </template>
                     <!-- 采收日期 -->
@@ -230,7 +253,7 @@ import Drawer from './models/drawer.vue';
 import Individualinfo from './models/individualinfo.vue';
 import SelectMedicinalPart from '@/models/select-medicinal-part/select-medicinal-part.vue';
 const { proxy } = getCurrentInstance() as ComponentInternalInstance;
-const { pt_output_type, pt_seed_type, pt_seed_unit, pt_harvest_type } = toRefs<any>(proxy?.useDict('pt_output_type', 'pt_seed_type', 'pt_seed_unit', 'pt_harvest_type'));
+const { pt_output_type, pt_seed_type, pt_seed_unit, pt_harvest_type, pt_fungus_code_type } = toRefs<any>(proxy?.useDict('pt_output_type', 'pt_seed_type', 'pt_seed_unit', 'pt_harvest_type', 'pt_fungus_code_type'));
 const deawerData = ref();
 const infoStore = useInfoStore();
 const pageTitle = ref('新增采收入库');
@@ -273,6 +296,7 @@ const form = ref({
     harvestPart: null as string | any,
     //采收部位名称
     harvestPartName: null as string | any,
+    fungusCodeType: null as string | any,
 });
 const baseType = ref();
 // 自定义校验函数 - 采收量必须大于0
@@ -330,6 +354,7 @@ const rules = reactive({
     outputType: [{ required: true, message: '请选择采收类型' }],
     seedType: [{ required: !!(form?.value?.outputType == '1'), message: '请选择种源类型' }],
     fungusCode: [{ required: !!(form?.value?.seedType == 'A4' || form?.value?.seedType == 'A8'), message: '请输入菌种/菌株编号' }],
+    fungusCodeType: [{ required: !!(form?.value?.seedType == 'A4' || form?.value?.seedType == 'A8'), message: '请选择菌种/菌株编号类型' }],
     harvestDate: [{ required: true, message: '请选择采收开始时间' }],
     harvestDateEnd: [
         { required: true, message: '请选择采收结束时间' },

+ 1 - 1
src/plant/port/port-harvest-detail/index.vue

@@ -17,7 +17,7 @@
                     </view>
                     <view v-if="form?.seedType == 'A4' || form?.seedType == 'A8'" class="pt-16 pb-16 info-border-bottom">
                         <text class="c-#666 f-s-30">菌种/菌株编号:</text>
-                        <text class="c-#333 f-s-30 f-w-5">{{ form?.fungusCode || '-' }}</text>
+                        <text class="c-#333 f-s-30 f-w-5">{{ selectDictLabel(pt_fungus_code_type, form?.fungusCodeType) }}/{{ form?.fungusCode }}</text>
                     </view>
                 </template>
                 <view class="pt-16 pb-16 info-border-bottom">

+ 3 - 3
src/plant/port/port-harvest/index.vue

@@ -60,12 +60,12 @@
                             <view class="c-#666 f-s-28 w-s-no">种源处理工艺:</view>
                             <view class="c-#333 f-s-28 f-w-5 w-s-no tx-ov ov-hd">{{ item?.ptech?.split(',').join('、') || '-' }}</view>
                         </view>
-                        <view class="d-flex">
-                            <view class="pd2-4-0 f-s-28 w-40%">
+                        <view class="d-flex gap-16">
+                            <view class="pd2-4-0 f-s-28 w-50%">
                                 <span class="c-#666">采收方式:</span>
                                 <span class="c-#333 f-w-5">{{ selectDictLabel(pt_harvest_type, item?.harvestType) || '-' }}</span>
                             </view>
-                            <view class="pd2-4-0 f-s-28 flex1">
+                            <view class="pd2-4-0 f-s-28 w-50%">
                                 <span class="c-#666">采收负责人:</span>
                                 <span class="c-#333 f-w-5">{{ item?.mgrName }}</span>
                             </view>