|
|
@@ -10,7 +10,7 @@
|
|
|
<view class="b-radius bg-#EBF6EE c-primary f-s-24 pd-24 pb-16"> 注意:关联时请确保已添加到地块;关联时必须选到地块/圈舍/组培架。</view>
|
|
|
</view>
|
|
|
<view class="bg-#fff pd-24 mb-20 pt-0">
|
|
|
- <up-form-item :borderBottom="false" label="种养殖所在基地" required prop="deawerData">
|
|
|
+ <up-form-item :borderBottom="false" label="种养殖所在基地" required prop="baseId">
|
|
|
<view v-if="!deawerData" class="w-100% d-flex a-c j-c pd-24 b-radius bg-#FBFDFB border-#AFDDBB" @click="openDrawer">
|
|
|
<view class=""></view>
|
|
|
<view class="f-s-34 c-primary">请选择种养殖所在的基地</view>
|
|
|
@@ -22,45 +22,63 @@
|
|
|
</view>
|
|
|
<view class="startline-title pl-24 ml-24 mb-16">种养殖信息</view>
|
|
|
<view class="bg-#fff pd-24 mb-20">
|
|
|
- <ut-action-sheet v-model="form.queryType" :tabs="pt_task_type" title="选择任务类型">
|
|
|
+ <ut-action-sheet v-model="form.taskType" :tabs="pt_task_type" title="选择任务类型">
|
|
|
<up-form-item borderBottom label="任务类型" required prop="taskType">
|
|
|
<view class="f-s-30 c-333 f-w-5 flex1">{{ selectDictLabel(pt_task_type, form.taskType) }}</view>
|
|
|
</up-form-item>
|
|
|
</ut-action-sheet>
|
|
|
- <ut-action-sheet v-model="form.mgMethod" :tabs="pt_org_type" title="选择溯源级别">
|
|
|
- <up-form-item borderBottom label="溯源级别" required prop="orgType">
|
|
|
- <view v-if="form.mgMethod" class="f-s-30 c-333 f-w-5 flex1">{{ selectDictLabel(pt_org_type, form.mgMethod) }}</view>
|
|
|
+ <ut-action-sheet v-model="form.mgMethod" :tabs="mg_method" title="选择溯源级别">
|
|
|
+ <up-form-item borderBottom label="溯源级别" required prop="mgMethod">
|
|
|
+ <view v-if="form.mgMethod" class="f-s-30 c-333 f-w-5 flex1">{{ selectDictLabel(mg_method, form.mgMethod) }}</view>
|
|
|
<view v-else class="f-s-30 c-ccc f-w-4 flex1">请选择溯源级别</view>
|
|
|
<template #right>
|
|
|
<up-icon size="22rpx" color="#2A6D52" name="arrow-down-fill"></up-icon>
|
|
|
</template>
|
|
|
</up-form-item>
|
|
|
</ut-action-sheet>
|
|
|
- <up-form-item borderBottom label="符合要求" required prop="gapFlag">
|
|
|
- <view v-if="form.queryType2" class="f-s-30 c-333 f-w-5 flex1">{{ selectDictLabel(pt_org_type, form.queryType1) }}</view>
|
|
|
- <view v-else class="f-s-30 c-ccc f-w-4 flex1">请选择符合要求</view>
|
|
|
- <template #right>
|
|
|
- <up-icon size="22rpx" color="#2A6D52" name="arrow-down-fill"></up-icon>
|
|
|
- </template>
|
|
|
- </up-form-item>
|
|
|
- <up-form-item borderBottom label="动物名称" required prop="plantBase">
|
|
|
- <view class="w-100% d-flex a-c j-c pd-24 b-radius bg-#FBFDFB border-#AFDDBB">
|
|
|
+ <ut-action-sheet v-model="form.gapFlag" :tabs="task_gap_flag" title="选择符合要求">
|
|
|
+ <up-form-item borderBottom label="符合要求" required prop="gapFlag">
|
|
|
+ <view v-if="form.gapFlag" class="f-s-30 c-333 f-w-5 flex1">{{ selectDictLabel(task_gap_flag, form.gapFlag) }}</view>
|
|
|
+ <view v-else class="f-s-30 c-ccc f-w-4 flex1">请选择符合要求</view>
|
|
|
+ <template #right>
|
|
|
+ <up-icon size="22rpx" color="#2A6D52" name="arrow-down-fill"></up-icon>
|
|
|
+ </template>
|
|
|
+ </up-form-item>
|
|
|
+ </ut-action-sheet>
|
|
|
+ <up-form-item borderBottom label="动物名称" required prop="varietyId">
|
|
|
+ <view v-if="!Biological" @click="$u.route({ type: 'navigateTo', url: '/plant/port/por-torganism/index' })" class="w-100% d-flex a-c j-c pd-24 b-radius bg-#FBFDFB border-#AFDDBB">
|
|
|
<view class=""></view>
|
|
|
<view class="f-s-34 c-primary">请选择养植的动物名称</view>
|
|
|
</view>
|
|
|
+ <view v-if="Biological" class="pd-30 d-flex flex-cln bg-#FBFDFB border-#37A954 b-radius mb-20 w-100% p-rtv">
|
|
|
+ <up-icon @click="Biological = null" size="26rpx" color="red" name="close" style="position: absolute; right: 10rpx; top: 10rpx"></up-icon>
|
|
|
+ <view class="mb-20">
|
|
|
+ <text class="c-#333 f-s-34 f-w-5 mr-5">{{ Biological?.varietyName }}</text>
|
|
|
+ <text class="c-#666 f-s-24">{{ Biological?.latinName }}</text>
|
|
|
+ </view>
|
|
|
+ <view class="mb-20">
|
|
|
+ <text class="c-#333 f-s-28 f-w-5 mr-5">{{ Biological?.genusName }}</text>
|
|
|
+ <text class="c-#666 f-s-24">{{ Biological?.genusLatinName }}</text>
|
|
|
+ </view>
|
|
|
+ <view class="">
|
|
|
+ <text class="c-#666 f-s-24">产出:</text>
|
|
|
+ <text class="c-#666 f-s-24">{{ Biological?.medicineName }}</text>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
</up-form-item>
|
|
|
- <up-form-item borderBottom label="养殖批号" required prop="plantBase">
|
|
|
+ <up-form-item borderBottom label="养殖批号" required prop="plantationCode">
|
|
|
<view class="d-flex a-c j-sb w-100%">
|
|
|
- <up-input v-model="form.queryType3" placeholder="请输入养殖批号" border="none"></up-input>
|
|
|
- <up-button class="c-#fff" type="primary" style="height: 50rpx; width: 130rpx">随机生成</up-button>
|
|
|
+ <view class="flex1 c-#999">请生成养殖批号</view>
|
|
|
+ <view class="flex1 c-#333">{{ form.plantationCode }}</view>
|
|
|
+ <up-button @click="randomCode" class="c-#fff" type="primary" style="height: 50rpx; width: 130rpx">随机生成</up-button>
|
|
|
</view>
|
|
|
</up-form-item>
|
|
|
- <up-form-item label="请选择养殖技术规程文件" prop="environmentInfo.report" borderBottom>
|
|
|
- <ut-upload v-model="form.queryType4" :max-count="9" valueType="array" accept="file"></ut-upload>
|
|
|
+ <up-form-item label="请选择养殖技术规程文件" prop="technicalFile" borderBottom>
|
|
|
+ <ut-upload v-model="form.technicalFile" :max-count="9" valueType="array" accept="file"></ut-upload>
|
|
|
</up-form-item>
|
|
|
- <ut-action-sheet v-model="form.queryType5" :tabs="pt_task_type" title="选择任务类型">
|
|
|
- <up-form-item borderBottom label="任务类型" required prop="baseType">
|
|
|
- <view v-if="form.queryType1" class="f-s-30 c-333 f-w-5 flex1">{{ selectDictLabel(pt_org_type, form.baseType) }}</view>
|
|
|
+ <ut-action-sheet v-model="form.plantationMethod" :tabs="feeding_method" title="选择养殖方式">
|
|
|
+ <up-form-item borderBottom label="养殖方式" required prop="plantationMethod">
|
|
|
+ <view v-if="form.plantationMethod" class="f-s-30 c-333 f-w-5 flex1">{{ selectDictLabel(feeding_method, form.plantationMethod) }}</view>
|
|
|
<view v-else class="f-s-30 c-ccc f-w-4 flex1">请选择养殖方式</view>
|
|
|
<template #right>
|
|
|
<up-icon size="22rpx" color="#2A6D52" name="arrow-down-fill"></up-icon>
|
|
|
@@ -68,47 +86,53 @@
|
|
|
</up-form-item>
|
|
|
</ut-action-sheet>
|
|
|
<up-form-item :borderBottom="false" label="养殖时间" required prop="queryType6">
|
|
|
- <ut-datetime-picker v-model="form.queryType6.startDate" mode="date" dateFields="month">
|
|
|
+ <ut-datetime-picker v-model="form.queryType6.plannedStartDate" mode="date" dateFields="month">
|
|
|
<view class="d-flex mr-20">
|
|
|
- <up-input v-model="form.queryType6.startDate" placeholder="请选择养殖开始时间" border="bottom" :customStyle="{ paddingLeft: '0rpx' }"></up-input>
|
|
|
+ <up-input v-model="form.queryType6.plannedStartDate" placeholder="请选择养殖开始时间" border="bottom" :customStyle="{ paddingLeft: '0rpx' }"></up-input>
|
|
|
<up-icon size="22rpx" color="#2A6D52" name="arrow-down-fill" style="margin-left: -20rpx"></up-icon>
|
|
|
</view>
|
|
|
</ut-datetime-picker>
|
|
|
- <ut-datetime-picker v-model="form.queryType6.endDate" mode="date" dateFields="month">
|
|
|
+ <ut-datetime-picker v-model="form.queryType6.plannedEndDate" mode="date" dateFields="month">
|
|
|
<view class="d-flex">
|
|
|
- <up-input v-model="form.queryType6.endDate" placeholder="请选择养殖结束时间" border="bottom" :customStyle="{ paddingLeft: '0rpx' }"></up-input>
|
|
|
+ <up-input v-model="form.queryType6.plannedEndDate" placeholder="请选择养殖结束时间" border="bottom" :customStyle="{ paddingLeft: '0rpx' }"></up-input>
|
|
|
<up-icon size="22rpx" color="#2A6D52" name="arrow-down-fill" style="margin-left: -20rpx"></up-icon>
|
|
|
</view>
|
|
|
</ut-datetime-picker>
|
|
|
</up-form-item>
|
|
|
- <up-form-item borderBottom label="养殖面积" required prop="plantBaseArea">
|
|
|
+ <up-form-item borderBottom label="养殖面积" required prop="plantingAmount">
|
|
|
<view class="d-flex a-c j-sb w-100%">
|
|
|
- <up-input style="padding-left: 0" v-model="form.plantBaseArea" placeholder="请输入养殖批号" border="none"></up-input>
|
|
|
+ <up-input style="padding-left: 0" v-model="form.plantingAmount" placeholder="请输入养殖面积" border="none"></up-input>
|
|
|
<view class="c-#333 f-s-32 f-w-5">平方米</view>
|
|
|
</view>
|
|
|
</up-form-item>
|
|
|
- <up-form-item borderBottom label="养殖区域" required prop="BreedingArea">
|
|
|
+ <up-form-item borderBottom label="养殖区域" required prop="breedScale">
|
|
|
<view class="d-flex a-c j-sb w-100%">
|
|
|
- <up-input v-model="form.BreedingArea" placeholder="请输入养殖区域" border="none"></up-input>
|
|
|
+ <up-input v-model="form.breedScale" placeholder="请输入养殖区域" border="none"></up-input>
|
|
|
<view class="c-#333 f-s-32 f-w-5">个</view>
|
|
|
</view>
|
|
|
</up-form-item>
|
|
|
- <up-form-item borderBottom label="养殖量" required prop="orgType">
|
|
|
- <up-input v-model="form.breedingVolume" placeholder="请输入养殖区域" border="none"></up-input>
|
|
|
- <ut-action-sheet v-model="form.breedingVolume" :tabs="pt_org_type" title="选择单位">
|
|
|
+ <up-form-item borderBottom label="养殖量" required prop="plant">
|
|
|
+ <up-input v-model="form.plant.plantingMgAmount" placeholder="请输入养殖量" border="none"></up-input>
|
|
|
+ <ut-action-sheet v-model="form.plant.plantingMgUnit" :tabs="scale_unit" title="选择单位">
|
|
|
<view class="d-flex a-c">
|
|
|
- <view v-if="form.queryType1" class="f-s-30 c-333 f-w-5 w-100">{{ selectDictLabel(pt_org_type, form.queryType1) }}</view>
|
|
|
+ <view v-if="form.plant?.plantingMgUnit" class="f-s-30 c-333 f-w-5 w-100">{{ selectDictLabel(scale_unit, form.plant?.plantingMgUnit) }}</view>
|
|
|
<view v-else class="f-s-30 c-ccc f-w-4 w-100">单位</view>
|
|
|
<up-icon size="22rpx" color="#2A6D52" name="arrow-down-fill"></up-icon>
|
|
|
</view>
|
|
|
</ut-action-sheet>
|
|
|
</up-form-item>
|
|
|
- <up-form-item borderBottom label="备注" required prop="BreedingArea">
|
|
|
- <up-input v-model="form.BreedingArea" placeholder="请输入备注" border="none"></up-input>
|
|
|
+ <up-form-item borderBottom label="备注" required prop="remark">
|
|
|
+ <up-input v-model="form.remark" placeholder="请输入备注" border="none"></up-input>
|
|
|
</up-form-item>
|
|
|
</view>
|
|
|
</up-form>
|
|
|
</view>
|
|
|
+ <template #bottom>
|
|
|
+ <view class="pd-24 d-flex j-c gap-20 base-bottom-wrap">
|
|
|
+ <up-button type="primary" @click="navigateBackOrHome()">暂存</up-button>
|
|
|
+ <up-button type="primary" @click="save()">提交</up-button>
|
|
|
+ </view>
|
|
|
+ </template>
|
|
|
</z-paging>
|
|
|
|
|
|
<!-- 添加drawer组件 -->
|
|
|
@@ -119,30 +143,57 @@
|
|
|
import { ref } from 'vue';
|
|
|
import Drawer from './models/drawer.vue';
|
|
|
import Baseinfo from './models/baseinfo.vue';
|
|
|
+import { useClientRequest } from '@/utils/request';
|
|
|
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
|
|
-const { pt_task_type, pt_org_type, yes_no } = toRefs<any>(proxy?.useDict('pt_task_type', 'pt_org_type', 'yes_no'));
|
|
|
+const { scale_unit, feeding_method, mg_method, task_gap_flag, pt_task_type, pt_org_type, yes_no } = toRefs<any>(proxy?.useDict('scale_unit', 'feeding_method', 'mg_method', 'task_gap_flag', 'pt_task_type', 'pt_org_type', 'yes_no'));
|
|
|
const form = ref({
|
|
|
deawerData: null,
|
|
|
baseId: '',
|
|
|
taskType: '',
|
|
|
+ gapFlag: '',
|
|
|
mgMethod: '',
|
|
|
- queryType: '',
|
|
|
- queryType1: '',
|
|
|
- queryType2: '',
|
|
|
- queryType3: '',
|
|
|
- queryType4: '',
|
|
|
- queryType5: '',
|
|
|
+ varietyId: '',
|
|
|
+ plantationCode: '',
|
|
|
+ plantationMethod: '',
|
|
|
+
|
|
|
+ technicalFile: '',
|
|
|
+ plantingUnit: '平方米',
|
|
|
+ breedScale: '',
|
|
|
queryType6: {
|
|
|
- startDate: '',
|
|
|
- endDate: '',
|
|
|
+ plannedStartDate: '',
|
|
|
+ plannedEndDate: '',
|
|
|
+ },
|
|
|
+ plant: {
|
|
|
+ plantingMgAmount: '',
|
|
|
+ plantingMgUnit: '',
|
|
|
},
|
|
|
- plantBaseArea: '',
|
|
|
+ plantingAmount: '',
|
|
|
BreedingArea: '',
|
|
|
breedingVolume: '',
|
|
|
+ remark: '',
|
|
|
+});
|
|
|
+const rules = reactive({
|
|
|
+ baseId: [{ required: true, message: '请选择种养殖所在的基地' }],
|
|
|
+ taskType: [{ required: true, message: '请选择任务类型' }],
|
|
|
+ mgMethod: [{ required: true, message: '请选择溯源级别' }],
|
|
|
+ gapFlag: [{ required: true, message: '请选择符合要求' }],
|
|
|
+ varietyId: [{ required: true, message: '请选择养植的动物名称' }],
|
|
|
+ plantationCode: [{ required: true, message: '请输入养殖批号' }],
|
|
|
+ technicalFile: [{ required: true, message: '请选择养殖技术规程文件' }],
|
|
|
+ plantationMethod: [{ required: true, message: '请选择养殖方式' }],
|
|
|
+ 'queryType6.plannedStartDate': [{ required: true, message: '请选择养殖开始时间' }],
|
|
|
+ 'queryType6.plannedEndDate': [{ required: true, message: '请选择养殖结束时间' }],
|
|
|
+ plantingAmount: [{ required: true, message: '请输入养殖面积' }],
|
|
|
+ breedScale: [{ required: true, message: '请输入养殖区域' }],
|
|
|
+ 'plant.plantingMgAmount': [{ required: true, message: '请输入养殖量' }],
|
|
|
+ 'plant.plantingMgUnit': [{ required: true, message: '请选择养殖量单位' }],
|
|
|
+ remark: [{ required: true, message: '请输入备注' }],
|
|
|
});
|
|
|
const paging = ref<unknown>('paging');
|
|
|
const list = ref<unknown>([]);
|
|
|
-
|
|
|
+setTimeout(() => {
|
|
|
+ console.log(form.value?.technicalFile, 'technicalFile');
|
|
|
+}, 10000);
|
|
|
// 控制抽屉显示状态
|
|
|
const drawerVisible = ref(false);
|
|
|
|
|
|
@@ -171,6 +222,7 @@ const deawerData = ref<any>(null);
|
|
|
function onDrawerConfirm(data: any) {
|
|
|
console.log('收到基地选择数据:', data);
|
|
|
deawerData.value = data;
|
|
|
+ form.value.baseId = data.data?.baseId;
|
|
|
// 这里可以将数据赋值给表单的相应字段
|
|
|
// 例如:form.value.plantBase = data.baseName;
|
|
|
// 可以根据需要添加其他处理逻辑
|
|
|
@@ -179,8 +231,32 @@ function onDrawerConfirm(data: any) {
|
|
|
function handleBaseinfoClose() {
|
|
|
deawerData.value = null;
|
|
|
}
|
|
|
-
|
|
|
+const Biological = ref<any>(null);
|
|
|
+//随机生成
|
|
|
+const randomCode = () => {
|
|
|
+ let plType = '';
|
|
|
+ if (+form.value.taskType == 1) {
|
|
|
+ plType = 'P';
|
|
|
+ } else if (+form.value.taskType == 2) {
|
|
|
+ plType = 'F';
|
|
|
+ } else {
|
|
|
+ plType = 'C';
|
|
|
+ }
|
|
|
+ const code = useClientRequest.post('/plt-api/app/plantationTask/getBatchCode', { plType: plType, linkType: plType });
|
|
|
+ form.value.plantationCode = code.data;
|
|
|
+};
|
|
|
+//完成提交表单
|
|
|
+const save = () => {
|
|
|
+ console.log(form.value);
|
|
|
+};
|
|
|
onLoad((options) => {
|
|
|
form.value.taskType = options?.taskType;
|
|
|
});
|
|
|
+onMounted(() => {
|
|
|
+ //更新动植物名称
|
|
|
+ uni.$on('updateBiologicalname', function (data) {
|
|
|
+ Biological.value = data.msg;
|
|
|
+ form.value.varietyId = data.msg.id;
|
|
|
+ });
|
|
|
+});
|
|
|
</script>
|