lisy il y a 3 semaines
Parent
commit
b4623d73d8

+ 35 - 41
src/components/ut-row/ut-row.vue

@@ -1,60 +1,55 @@
 <template>
-	<view
-		class="ut-row"
-		:class="{ 'ut-row--wrap': wrap }"
-		:style="rowStyle"
-	>
-		<slot />
-	</view>
+    <view class="ut-row" :class="{ 'ut-row--wrap': wrap }" :style="rowStyle">
+        <slot />
+    </view>
 </template>
 
 <script setup lang="ts">
-
 interface UtRowProps {
-	/** 总栅格份数,默认 30 */
-	columns?: number;
-	/** 列间距,字符串形式,可为数值字符串,内部转为 px */
-	gap?: string | number;
-	/** 是否允许换行 */
-	wrap?: boolean;
+    /** 总栅格份数,默认 30 */
+    columns?: number;
+    /** 列间距,字符串形式,可为数值字符串,内部转为 px */
+    gap?: string | number;
+    /** 是否允许换行 */
+    wrap?: boolean;
 }
 
 const props = withDefaults(defineProps<UtRowProps>(), {
-	columns: 30,
-	gap: '16rpx',
-	wrap: true,
+    columns: 30,
+    gap: '16rpx',
+    wrap: true,
 });
 
 const ROW_INJECT_KEY = 'ut-row-context';
 // 将 gap 统一转成 px 数值
 const gapPx = computed(() => {
-	const val = props.gap;
-	if (val === '' || val == null) return 0;
-	// 使用 uView 提供的 px 转换,兼容 rpx / rpx 字符串 / 数值字符串
-	// @ts-ignore
-	const fn = uni?.$u?.getPx;
-	if (typeof fn === 'function') return fn(val as any) || 0;
-	const n = Number(val);
-	return Number.isFinite(n) ? n : 0;
+    const val = props.gap;
+    if (val === '' || val == null) return 0;
+    // 使用 uView 提供的 px 转换,兼容 rpx / rpx 字符串 / 数值字符串
+    // @ts-ignore
+    const fn = uni?.$u?.getPx;
+    if (typeof fn === 'function') return fn(val as any) || 0;
+    const n = Number(val);
+    return Number.isFinite(n) ? n : 0;
 });
 
 // 提供给 ut-col 使用的上下文
 provide(ROW_INJECT_KEY, {
-	columns: computed(() => props.columns),
-	gap: gapPx,
+    columns: computed(() => props.columns),
+    gap: gapPx,
 });
 
 // 外层行样式:用负 margin 抵消子项 padding,实现水平 / 垂直间距
 const rowStyle = computed(() => {
-	const g = gapPx.value;
-	if (!g) return '';
-	const half = `${g / 2}px`;
-	return {
-		marginLeft: `-${half}`,
-		marginRight: `-${half}`,
-		marginTop: `-${half}`,
-		marginBottom: `-${half}`,
-	} as any;
+    const g = gapPx.value;
+    if (!g) return '';
+    const half = `${g / 2}px`;
+    return {
+        marginLeft: `-${half}`,
+        marginRight: `-${half}`,
+        marginTop: `-${half}`,
+        marginBottom: `-${half}`,
+    } as any;
 });
 
 defineExpose({ ROW_INJECT_KEY });
@@ -62,13 +57,12 @@ defineExpose({ ROW_INJECT_KEY });
 
 <style scoped lang="scss">
 .ut-row {
-	display: flex;
-	flex-direction: row;
-	flex-wrap: wrap;
+    display: flex;
+    flex-direction: row;
+    flex-wrap: wrap;
 }
 
 .ut-row--wrap {
-	flex-wrap: wrap;
+    flex-wrap: wrap;
 }
 </style>
-

+ 9 - 9
src/pages/plant/port/models/task.vue

@@ -25,8 +25,8 @@
             <view class="d-flex a-c f-s-28 pd-16 pt-8 pb-8" @click="$emit('click')">
                 <view class="c-#666 w-s-no">基地:</view>
                 <view class="c-#333 f-w-5 tx-ov w-s-no ov-hd d-flex a-c">
-                    {{ data?.baseRef?.baseInfo?.address }}基地
-                    <text v-if="data?.landIds.length == 0">全部地块</text>
+                    {{ data?.baseRef?.baseName }}
+                    <text v-if="+data?.landFlag">全部地块</text>
                     <view v-else>
                         <text v-for="(item, index) in data?.baseRef?.baseInfo?.landList" :key="index"><text v-if="index != 0">、</text> {{ item?.landName }}</text>
                     </view>
@@ -94,8 +94,8 @@
             <view class="d-flex a-c f-s-28 pd-16 pt-8 pb-8">
                 <view class="c-#666 w-s-no">基地:</view>
                 <view class="c-#333 f-w-5 tx-ov w-s-no ov-hd d-flex a-c">
-                    {{ data?.baseRef?.baseInfo?.address }}基地
-                    <text v-if="data?.landIds.length == 0">全部地块</text>
+                    {{ data?.baseRef?.baseName }}
+                    <text v-if="+data?.landFlag">全部地块</text>
                     <view v-else>
                         <text v-for="(item, index) in data?.baseRef?.baseInfo?.landList" :key="index"><text v-if="index != 0">、</text> {{ item?.landName }}</text>
                     </view>
@@ -173,8 +173,8 @@
             <view class="d-flex a-c f-s-28 pd-16 pt-8 pb-8">
                 <view class="c-#666 w-s-no">基地:</view>
                 <view class="c-#333 f-w-5 tx-ov w-s-no ov-hd d-flex a-c">
-                    {{ data?.baseRef?.baseInfo?.address }}基地
-                    <text v-if="data?.landIds.length == 0">全部地块</text>
+                    {{ data?.baseRef?.baseName }}
+                    <text v-if="+data?.landFlag">全部地块</text>
                     <view v-else>
                         <text v-for="(item, index) in data?.baseRef?.baseInfo?.landList" :key="index"><text v-if="index != 0">、</text> {{ item?.landName }}</text>
                     </view>
@@ -242,10 +242,10 @@
             <view class="d-flex a-c f-s-28 pd-16 pt-8 pb-8">
                 <view class="c-#666 w-s-no">基地:</view>
                 <view class="c-#333 f-w-5 tx-ov w-s-no ov-hd d-flex a-c">
-                    {{ data?.baseRef?.baseInfo?.address }}基地
-                    <text v-if="data?.landIds.length == 0">全部地块</text>
+                    {{ data?.baseRef?.baseName }}
+                    <text v-if="+data?.landFlag">全部地块</text>
                     <view v-else>
-                        <text v-for="(item, index) in data?.baseRef?.baseInfo?.landList" :key="index"><text v-if="index != 0">、</text> {{ item?.landName }}</text>
+                        <text v-for="(item, index) in data?.baseRef?.baseInfo?.landList" :key="index"> <text v-if="index != 0">、</text> {{ item?.landName }}</text>
                     </view>
                 </view>
                 <view class="flex1 d-flex j-ed"><up-icon name="arrow-right" size="34rpx"></up-icon></view>

+ 107 - 2
src/pages/plant/processing/index.vue

@@ -1,3 +1,108 @@
 <template>
-    <view>加工与包装</view>
-</template>
+    <z-paging ref="paging" v-model="list" bgColor="#f7f7f7" @query="query" safe-area-inset-bottom>
+        <template #top>
+            <up-navbar title="加工及包装赋码任务" :fixed="false"> </up-navbar>
+        </template>
+        <template>
+            <view class="pd3-24-24-0">
+                <view class="mb-20">
+                    <ut-tabs mode="subsection" v-model="form.restFlag" :tabs="tabs" @change="onRefresh"></ut-tabs>
+                </view>
+            </view>
+            <view class="d-flex a-c pd-24 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">
+                <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>
+                        </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>
+            </view>
+        </template>
+        <template #bottom>
+            <ut-tabar activeTab="processing"></ut-tabar>
+        </template>
+    </z-paging>
+</template>
+<script setup lang="ts">
+import Output from './models/output.vue';
+
+const { proxy } = getCurrentInstance() as ComponentInternalInstance;
+const { pt_process_type } = toRefs<any>(proxy?.useDict('pt_process_type'));
+const paging = ref();
+const list = ref([]);
+const tabs = [
+    {
+        label: '加工',
+        value: '0',
+    },
+    {
+        label: '包装赋码',
+        value: '1',
+    },
+];
+const form = reactive({
+    restFlag: '0',
+});
+const query = async (page: number, size: number) => {
+    // const res = await getList(page, size);
+    // return res;
+};
+const onRefresh = () => {
+    paging.value?.complete();
+};
+</script>
+<style scoped lang="scss">
+.search-select-item {
+    height: 86rpx;
+    background-color: #fff;
+    border-radius: 10rpx;
+    box-sizing: border-box;
+    padding: 12rpx;
+}
+</style>

+ 35 - 0
src/pages/plant/processing/models/output.vue

@@ -0,0 +1,35 @@
+<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="">产</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" v-else>
+            <ut-row gap="10rpx">
+                <view class="">01</view>
+                <view class="d-flex flex-cln" :span="10">
+                    <span>统货</span>
+                    <span>1mm极薄片</span>
+                </view>
+                <view class=""> 19999kg </view>
+                <view class="">未检</view>
+                <view class="">已入药材库</view>
+            </ut-row>
+        </view>
+    </view>
+</template>
+<script setup lang="ts">
+const props = defineProps<{
+    data: Array<any>;
+}>();
+</script>

+ 6 - 4
src/plant/port/port-create/index.vue

@@ -828,6 +828,7 @@ const form = ref<PlantationTaskForm>({
     inoculationDosage: null,
     inoculationDosageUnit: null,
     cultureMediumFormula: null,
+    landFlag: null,
 });
 const changeStartTime = () => {
     if (!form.value?.queryType6?.plannedEndDate) {
@@ -950,7 +951,6 @@ const validatePlantingAmount = (rule: any, value: any, callback: any) => {
 };
 // 判断是否要填接种数量
 const validateinoculation = (rule: any, value: any, callback: any) => {
-    console.log(deawerData.value?.data[0]?.landType, 'deawerData.value?.data[0]?.landType');
     if (+deawerData.value?.data[0]?.landType == 3) {
         console.log(form.value, 'form.value');
 
@@ -1120,9 +1120,11 @@ function onDrawerConfirm(data: any) {
     //确认养殖区域的个数
     form.value.breedScale = data.data?.length;
     if (data?.aloneChecked) {
-        form.value.landIds = [];
+        form.value.landFlag = 1;
+        form.value.landIds = data?.checkBox;
     } else {
         form.value.landIds = data?.checkBox;
+        form.value.landFlag = 0;
     }
 }
 // 处理Baseinfo组件的关闭事件
@@ -1394,7 +1396,7 @@ const getCache = async (taskType: TaskType | null) => {
         deawerData.value.address = res.data.baseRef.baseInfo.address;
         // adcodeName
         deawerData.value.adcodeName = res.data.baseRef.baseInfo.adcodeName;
-        if (res.data.landIds.length == 0) {
+        if (+res.data.landFlag) {
             deawerData.value.aloneChecked = true;
             const landIds = await useClientRequest.get('/plt-api/app/baseLandInfo/pageList', { baseId: res.data.baseId });
             deawerData.value.data = landIds.rows;
@@ -1446,7 +1448,7 @@ const getInfo = async (taskId: any) => {
         deawerData.value.address = res.data.baseRef.baseInfo.address;
         // adcodeName
         deawerData.value.adcodeName = res.data.baseRef.baseInfo.adcodeName;
-        if (res.data.landIds.length == 0) {
+        if (+res.data.landFlag) {
             deawerData.value.aloneChecked = true;
             const landIds = await useClientRequest.get('/plt-api/app/baseLandInfo/pageList', { baseId: res.data.baseId });
             deawerData.value.data = landIds.rows;

+ 1 - 0
src/plant/port/port-create/models/types.ts

@@ -117,6 +117,7 @@ export interface PlantationTaskForm {
     inoculationDosage: any;
     inoculationDosageUnit: any;
     cultureMediumFormula?: string | null; // 仅种苗繁育
+    landFlag: any;
 }
 
 /**

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

@@ -446,7 +446,7 @@ const getInfo = async () => {
         deawerData.value.address = res.data.baseRef.baseInfo.address;
         // adcodeName
         deawerData.value.adcodeName = res.data.baseRef.baseInfo.adcodeName;
-        if (res.data.landIds.length == 0) {
+        if (+res.data.landFlag) {
             deawerData.value.aloneChecked = true;
             const landIds = await useClientRequest.get('/plt-api/app/baseLandInfo/pageList', { baseId: res.data.baseId });
             deawerData.value.data = landIds.rows;

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

@@ -75,8 +75,8 @@
                         </up-form-item>
                     </up-form-item>
                     <!-- 采收部位 -->
-                    <up-form-item borderBottom label="药用部位/对象" prop="harvestPart" required>
-                        <SelectMedicinalPart v-if="+form?.outputType == 2" v-model="form.harvestPart" v-model:value-name="form.harvestPartName" title="选择采收部位">
+                    <up-form-item v-if="+form?.outputType == 2" borderBottom label="药用部位/对象" prop="harvestPart" required>
+                        <SelectMedicinalPart v-model="form.harvestPart" v-model:value-name="form.harvestPartName" title="选择采收部位">
                             <up-input v-model="form.harvestPartName" placeholder="请选择药用部位/对象" border="none" readonly clearable></up-input>
                         </SelectMedicinalPart>
                     </up-form-item>
@@ -388,11 +388,9 @@ const goIndividual = () => {
         data?.checkBox.forEach((item: any) => {
             //判断有没有重复的值,如果有这个就不添加,没有就添加
             if (individualLandIds.value.checkBox.some((item2: any) => item2 === item)) {
-                console.log('????', item);
                 flag = true;
             } else {
                 individualLandIds.value.checkBox.push(item);
-                console.log('????', form.value);
                 form.value.animalIds.push(item);
             }
         });
@@ -421,14 +419,11 @@ const save = () => {
                 console.log('开始提交采收入库记录');
                 await upFormRef.value?.validate();
                 console.log('校验完成');
-
                 const params = {
                     ...form.value,
                     landFlag: deawerData?.value?.aloneChecked ? '1' : '0',
                 };
-
                 console.log('提交参数:', params);
-
                 // 这里需要根据实际 API 进行调整
                 const res = await useClientRequest.post('/plt-api/app/harvestRecord/save', params);
                 if (res.code == 200) {