|
|
@@ -107,15 +107,28 @@
|
|
|
</view>
|
|
|
</up-form-item>
|
|
|
<view class="h-1" id="plantpppp"></view>
|
|
|
- <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="pt_planting_mg_unit" title="选择单位">
|
|
|
- <view class="d-flex a-c">
|
|
|
- <view v-if="form.plant?.plantingMgUnit" class="f-s-30 c-333 f-w-5 w-100">{{ selectDictLabel(pt_planting_mg_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 label="养殖量" required class="form-item-bottom-padding-0">
|
|
|
+ <div class="flex1 d-flex">
|
|
|
+ <div class="flex1 ov-hd">
|
|
|
+ <up-form-item prop="plantingMgAmount" border-bottom class="form-item-top-padding-0">
|
|
|
+ <up-input v-model="form.plantingMgAmount" placeholder="请输入养殖量" border="none" clearable></up-input>
|
|
|
+ </up-form-item>
|
|
|
+ </div>
|
|
|
+ <div class="pd-5"></div>
|
|
|
+ <div class="min-w-200">
|
|
|
+ <ut-action-sheet v-model="form.plantingMgUnit" :tabs="pt_planting_mg_unit" title="选择单位">
|
|
|
+ <up-form-item prop="unit" border-bottom class="form-item-top-padding-0">
|
|
|
+ <view class="flex1" style="line-height: 24px">
|
|
|
+ <view v-if="form.plantingMgUnit" class="f-s-30 c-333 f-w-5 text-center">{{ selectDictLabel(pt_planting_mg_unit, form.plantingMgUnit) }}</view>
|
|
|
+ <view v-else class="f-s-30 c-ccc f-w-4 text-center">单位</view>
|
|
|
+ </view>
|
|
|
+ <template #right>
|
|
|
+ <up-icon size="22rpx" color="#2A6D52" name="arrow-down-fill"></up-icon>
|
|
|
+ </template>
|
|
|
+ </up-form-item>
|
|
|
+ </ut-action-sheet>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
</up-form-item>
|
|
|
<up-form-item borderBottom label="备注" prop="remark" id="remarkpppp">
|
|
|
<up-input v-model="form.remark" placeholder="请输入备注" border="none"></up-input>
|
|
|
@@ -148,21 +161,6 @@
|
|
|
<up-radio :customStyle="{ marginRight: '60rpx' }" v-for="(item, index) in yes_no" :key="index" :label="item.label" :name="item.value"></up-radio>
|
|
|
</up-radio-group>
|
|
|
</up-form-item>
|
|
|
- <!-- <up-form-item borderBottom label="委托企业" required prop="delegateInfo" id="delegateInfopppp">
|
|
|
- <view v-if="!Enterprise" @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="Enterprise" class="pd-24 d-flex flex-cln bg-#FBFDFB border-#37A954 b-radius mb-20 w-100% p-rtv">
|
|
|
- <up-icon @click="Enterprise = null" size="26rpx" color="red" name="close" style="position: absolute; right: 10rpx; top: 10rpx"></up-icon>
|
|
|
- <view class="">
|
|
|
- <text class="c-#333 f-s-34 f-w-5 mr-5">{{ form?.delegateInfo?.cusName }}</text>
|
|
|
- </view>
|
|
|
- <view class="mb-20">
|
|
|
- <text class="c-#666 f-s-24">{{ form?.delegateInfo?.crediteCode }}</text>
|
|
|
- </view>
|
|
|
- </view>
|
|
|
- </up-form-item> -->
|
|
|
<up-form-item v-if="+(form?.delegateFlag ?? 0)" borderBottom label="委托企业" prop="delegateInfo">
|
|
|
<view class="flex1">
|
|
|
<ContactUnitInput v-model="form.delegateInfo.cpyid" v-model:info="form.delegate" :params="{ cpyType: '1' }" title="选择委托企业" placeholder="请选择委托企业信息"></ContactUnitInput>
|
|
|
@@ -242,15 +240,28 @@
|
|
|
</view>
|
|
|
</up-form-item>
|
|
|
<view class="h-1" id="plantpppp"></view>
|
|
|
- <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="pt_planting_mg_unit" title="选择单位">
|
|
|
- <view class="d-flex a-c">
|
|
|
- <view v-if="form.plant?.plantingMgUnit" class="f-s-30 c-333 f-w-5 w-100">{{ selectDictLabel(pt_planting_mg_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 label="养殖量" required class="form-item-bottom-padding-0">
|
|
|
+ <div class="flex1 d-flex">
|
|
|
+ <div class="flex1 ov-hd" id="plantingMgAmountpppp">
|
|
|
+ <up-form-item prop="plantingMgAmount" border-bottom class="form-item-top-padding-0">
|
|
|
+ <up-input v-model="form.plantingMgAmount" placeholder="请输入养殖量" border="none" clearable></up-input>
|
|
|
+ </up-form-item>
|
|
|
+ </div>
|
|
|
+ <div class="pd-5" id="plantingMgUnitpppp"></div>
|
|
|
+ <div class="min-w-200">
|
|
|
+ <ut-action-sheet v-model="form.plantingMgUnit" :tabs="pt_planting_mg_unit" title="选择单位">
|
|
|
+ <up-form-item prop="plantingMgUnit" border-bottom class="form-item-top-padding-0">
|
|
|
+ <view class="flex1" style="line-height: 24px">
|
|
|
+ <view v-if="form.plantingMgUnit" class="f-s-30 c-333 f-w-5 text-center">{{ selectDictLabel(pt_planting_mg_unit, form.plantingMgUnit) }}</view>
|
|
|
+ <view v-else class="f-s-30 c-ccc f-w-4 text-center">单位</view>
|
|
|
+ </view>
|
|
|
+ <template #right>
|
|
|
+ <up-icon size="22rpx" color="#2A6D52" name="arrow-down-fill"></up-icon>
|
|
|
+ </template>
|
|
|
+ </up-form-item>
|
|
|
+ </ut-action-sheet>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
</up-form-item>
|
|
|
<up-form-item borderBottom label="备注" prop="remark" id="remarkpppp">
|
|
|
<up-input v-model="form.remark" placeholder="请输入备注" border="none"></up-input>
|
|
|
@@ -330,16 +341,28 @@
|
|
|
<view class="c-#333 f-s-32 f-w-5">亩</view>
|
|
|
</view>
|
|
|
</up-form-item>
|
|
|
- <view class="h-1" id="plantpppp"></view>
|
|
|
- <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="pt_scale_unit" title="选择单位">
|
|
|
- <view class="d-flex a-c">
|
|
|
- <view v-if="form.plant?.plantingMgUnit" class="f-s-30 c-333 f-w-5 w-100">{{ selectDictLabel(pt_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 label="种植量" required class="form-item-bottom-padding-0">
|
|
|
+ <div class="flex1 d-flex">
|
|
|
+ <div class="flex1 ov-hd" id="plantingMgAmountpppp">
|
|
|
+ <up-form-item prop="plantingMgAmount" border-bottom class="form-item-top-padding-0">
|
|
|
+ <up-input v-model="form.plantingMgAmount" placeholder="请输入种植量" border="none" clearable></up-input>
|
|
|
+ </up-form-item>
|
|
|
+ </div>
|
|
|
+ <div class="pd-5" id="plantingMgUnitpppp"></div>
|
|
|
+ <div class="min-w-200">
|
|
|
+ <ut-action-sheet v-model="form.plantingMgUnit" :tabs="pt_area_unit" title="选择单位">
|
|
|
+ <up-form-item prop="unit" border-bottom class="form-item-top-padding-0">
|
|
|
+ <view class="flex1" style="line-height: 24px">
|
|
|
+ <view v-if="form.plantingMgUnit" class="f-s-30 c-333 f-w-5 text-center">{{ selectDictLabel(pt_area_unit, form.plantingMgUnit) }}</view>
|
|
|
+ <view v-else class="f-s-30 c-ccc f-w-4 text-center">单位</view>
|
|
|
+ </view>
|
|
|
+ <template #right>
|
|
|
+ <up-icon size="22rpx" color="#2A6D52" name="arrow-down-fill"></up-icon>
|
|
|
+ </template>
|
|
|
+ </up-form-item>
|
|
|
+ </ut-action-sheet>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
</up-form-item>
|
|
|
<view class="h-1" id="queryType6pppp"></view>
|
|
|
<up-form-item :borderBottom="false" label="种植时间" required prop="queryType6">
|
|
|
@@ -534,31 +557,63 @@
|
|
|
<view class="c-#333 f-s-32 f-w-5">{{ form.plantingUnit }}</view>
|
|
|
</view>
|
|
|
</up-form-item>
|
|
|
- <up-form-item v-if="+deawerData?.data[0]?.landType == 3" borderBottom label="接种数量" required prop="inoculation.inoculationAmount" id="inoculationpppp">
|
|
|
- <view class="d-flex a-c j-sb w-100%">
|
|
|
- <up-input style="padding-left: 0" v-model="form.inoculation.inoculationAmount" placeholder="请输入接种数量" border="none"></up-input>
|
|
|
- <ut-action-sheet v-model="form.inoculation.inoculationUnit" :tabs="pt_inoculation_unit" title="选择单位">
|
|
|
- <view class="d-flex a-c">
|
|
|
- <view v-if="form.inoculation?.inoculationUnit" class="f-s-30 c-333 f-w-5 w-100">{{ selectDictLabel(pt_inoculation_unit, form.inoculation?.inoculationUnit) }}</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>
|
|
|
- </view>
|
|
|
+ <up-form-item v-if="+deawerData?.data[0]?.landType == 3" label="接种数量" required class="form-item-bottom-padding-0">
|
|
|
+ <div class="flex1 d-flex">
|
|
|
+ <div class="flex1 ov-hd" id="plantingMgAmountpppp">
|
|
|
+ <up-form-item prop="inoculationAmount" border-bottom class="form-item-top-padding-0">
|
|
|
+ <up-input v-model="form.inoculationAmount" placeholder="请输入接种数量" border="none" clearable></up-input>
|
|
|
+ </up-form-item>
|
|
|
+ </div>
|
|
|
+ <div class="pd-5" id="plantingMgUnitpppp"></div>
|
|
|
+ <div class="min-w-200">
|
|
|
+ <ut-action-sheet v-model="form.inoculationUnit" :tabs="pt_inoculation_unit" title="选择单位">
|
|
|
+ <up-form-item prop="unit" border-bottom class="form-item-top-padding-0">
|
|
|
+ <view class="flex1" style="line-height: 24px">
|
|
|
+ <view v-if="form.inoculationUnit" class="f-s-30 c-333 f-w-5 text-center">{{ selectDictLabel(pt_inoculation_unit, form.inoculationUnit) }}</view>
|
|
|
+ <view v-else class="f-s-30 c-ccc f-w-4 text-center">单位</view>
|
|
|
+ </view>
|
|
|
+ <template #right>
|
|
|
+ <up-icon size="22rpx" color="#2A6D52" name="arrow-down-fill"></up-icon>
|
|
|
+ </template>
|
|
|
+ </up-form-item>
|
|
|
+ </ut-action-sheet>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
</up-form-item>
|
|
|
- <up-form-item v-if="+deawerData?.data[0]?.landType == 3" borderBottom label="接种剂量" required prop="inoculation.inoculationDosage" id="inoculationpppp">
|
|
|
- <view class="d-flex a-c j-sb w-100%">
|
|
|
- <up-input style="padding-left: 0" v-model="form.inoculation.inoculationDosage" placeholder="请输入接种剂量" border="none"></up-input>
|
|
|
- <ut-action-sheet v-model="form.inoculation.inoculationDosageUnit" :tabs="pt_inoculation_dosage_unit" title="选择单位">
|
|
|
- <view class="d-flex a-c">
|
|
|
- <view v-if="form.inoculation?.inoculationDosageUnit" class="f-s-30 c-333 f-w-5 w-100">{{ selectDictLabel(pt_inoculation_dosage_unit, form.inoculation?.inoculationDosageUnit) }}</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>
|
|
|
- <view v-if="form.inoculation?.inoculationUnit">/</view>
|
|
|
- <view v-if="form.inoculation?.inoculationUnit" class="f-s-30 c-333 f-w-5 w-100" style="text-align: right">{{ selectDictLabel(pt_inoculation_unit, form.inoculation?.inoculationUnit) }}</view>
|
|
|
- </view>
|
|
|
+ <up-form-item v-if="+deawerData?.data[0]?.landType == 3" label="接种剂量" required class="form-item-bottom-padding-0">
|
|
|
+ <div class="flex1 d-flex">
|
|
|
+ <div class="flex1 ov-hd">
|
|
|
+ <up-form-item prop="inoculationDosage" border-bottom class="form-item-top-padding-0">
|
|
|
+ <up-input v-model="form.inoculationDosage" placeholder="请输入接种剂量" border="none" clearable></up-input>
|
|
|
+ </up-form-item>
|
|
|
+ </div>
|
|
|
+ <div class="pd-5"></div>
|
|
|
+ <div class="min-w-200">
|
|
|
+ <ut-action-sheet v-model="form.inoculationDosageUnit" :tabs="pt_inoculation_dosage_unit" title="选择单位">
|
|
|
+ <up-form-item prop="specUnit" border-bottom class="form-item-top-padding-0">
|
|
|
+ <view class="flex1" style="line-height: 24px">
|
|
|
+ <view v-if="form.inoculationDosageUnit" class="f-s-30 c-333 f-w-5 text-center">{{ selectDictLabel(pt_inoculation_dosage_unit, form.inoculationDosageUnit) }}</view>
|
|
|
+ <view v-else class="f-s-30 c-ccc f-w-4 text-center">单位</view>
|
|
|
+ </view>
|
|
|
+ <template #right>
|
|
|
+ <up-icon class="mr-10" size="22rpx" color="#2A6D52" name="arrow-down-fill"></up-icon>
|
|
|
+ </template>
|
|
|
+ </up-form-item>
|
|
|
+ </ut-action-sheet>
|
|
|
+ </div>
|
|
|
+ <div class="pd2-0-10 c-#ccc d-flex d-c a-c">/</div>
|
|
|
+ <div class="min-w-200">
|
|
|
+ <up-form-item prop="unit" border-bottom class="form-item-top-padding-0">
|
|
|
+ <view class="flex1" style="line-height: 24px">
|
|
|
+ <view v-if="form.inoculationUnit" class="f-s-30 c-333 f-w-5 text-center">{{ selectDictLabel(pt_inoculation_unit, form.inoculationUnit) }}</view>
|
|
|
+ <view v-else class="f-s-30 c-ccc f-w-4 text-center">单位</view>
|
|
|
+ </view>
|
|
|
+ <template #right>
|
|
|
+ <up-icon size="22rpx" color="#fff" name="arrow-down-fill"></up-icon>
|
|
|
+ </template>
|
|
|
+ </up-form-item>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
</up-form-item>
|
|
|
<view class="h-1" id="plantpppp"></view>
|
|
|
<up-form-item v-if="+deawerData?.data[0]?.landType == 3" borderBottom label="繁育量" prop="plant">
|
|
|
@@ -567,7 +622,7 @@
|
|
|
<view v-if="plantingMgUnit" class="f-s-30 c-333 f-w-5 w-100">{{ selectDictLabel(pt_inoculation_dosage_unit, plantingMgUnit) }}</view>
|
|
|
</view>
|
|
|
</up-form-item>
|
|
|
- <up-form-item v-else borderBottom label="繁育量" required prop="plant">
|
|
|
+ <!-- <up-form-item v-else 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="pt_feed_amount_unit" title="选择单位">
|
|
|
<view class="d-flex a-c">
|
|
|
@@ -576,6 +631,29 @@
|
|
|
<up-icon size="22rpx" color="#2A6D52" name="arrow-down-fill"></up-icon>
|
|
|
</view>
|
|
|
</ut-action-sheet>
|
|
|
+ </up-form-item> -->
|
|
|
+ <up-form-item v-else label="繁育量" required class="form-item-bottom-padding-0">
|
|
|
+ <div class="flex1 d-flex">
|
|
|
+ <div class="flex1 ov-hd" id="plantingMgAmountpppp">
|
|
|
+ <up-form-item prop="plantingMgAmount" border-bottom class="form-item-top-padding-0">
|
|
|
+ <up-input v-model="form.plantingMgAmount" placeholder="请输入繁育量" border="none" clearable></up-input>
|
|
|
+ </up-form-item>
|
|
|
+ </div>
|
|
|
+ <div class="pd-5" id="plantingMgUnitpppp"></div>
|
|
|
+ <div class="min-w-200">
|
|
|
+ <ut-action-sheet v-model="form.plantingMgUnit" :tabs="pt_feed_amount_unit" title="选择单位">
|
|
|
+ <up-form-item prop="plantingMgUnit" border-bottom class="form-item-top-padding-0">
|
|
|
+ <view class="flex1" style="line-height: 24px">
|
|
|
+ <view v-if="form.plantingMgUnit" class="f-s-30 c-333 f-w-5 text-center">{{ selectDictLabel(pt_feed_amount_unit, form.plantingMgUnit) }}</view>
|
|
|
+ <view v-else class="f-s-30 c-ccc f-w-4 text-center">单位</view>
|
|
|
+ </view>
|
|
|
+ <template #right>
|
|
|
+ <up-icon size="22rpx" color="#2A6D52" name="arrow-down-fill"></up-icon>
|
|
|
+ </template>
|
|
|
+ </up-form-item>
|
|
|
+ </ut-action-sheet>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
</up-form-item>
|
|
|
<up-form-item borderBottom label="培养基配方" prop="cultureMediumFormula" id="cultureMediumFormulapppp">
|
|
|
<Go_button v-if="!Biological" @click="gotoTorganism(1)" title="请选择培养基配方" style="flex: 1" />
|
|
|
@@ -734,10 +812,8 @@ const form = ref<PlantationTaskForm>({
|
|
|
plannedStartDate: null,
|
|
|
plannedEndDate: null,
|
|
|
},
|
|
|
- plant: {
|
|
|
- plantingMgAmount: null,
|
|
|
- plantingMgUnit: null,
|
|
|
- },
|
|
|
+ plantingMgAmount: null,
|
|
|
+ plantingMgUnit: null,
|
|
|
plantingAmount: '',
|
|
|
remark: null,
|
|
|
delegateFlag: '0',
|
|
|
@@ -747,12 +823,10 @@ const form = ref<PlantationTaskForm>({
|
|
|
sowingMethod: null,
|
|
|
transplantMethod: null,
|
|
|
preCropId: null,
|
|
|
- inoculation: {
|
|
|
- inoculationAmount: null,
|
|
|
- inoculationUnit: null,
|
|
|
- inoculationDosage: null,
|
|
|
- inoculationDosageUnit: null,
|
|
|
- },
|
|
|
+ inoculationAmount: null,
|
|
|
+ inoculationUnit: null,
|
|
|
+ inoculationDosage: null,
|
|
|
+ inoculationDosageUnit: null,
|
|
|
cultureMediumFormula: null,
|
|
|
});
|
|
|
const changeStartTime = () => {
|
|
|
@@ -876,17 +950,22 @@ 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) {
|
|
|
- if (!value || value.trim() === '') {
|
|
|
- callback(new Error('请输入接种数量'));
|
|
|
- return;
|
|
|
- }
|
|
|
- // 检查单位是否选择
|
|
|
- if (!form.value.inoculation?.inoculationUnit) {
|
|
|
+ console.log(form.value, 'form.value');
|
|
|
+
|
|
|
+ if (!form.value?.inoculationUnit) {
|
|
|
+ console.log(form.value?.inoculationUnit, 'form.value?.inoculationUnit');
|
|
|
+
|
|
|
callback(new Error('请选择接种数量单位'));
|
|
|
return;
|
|
|
}
|
|
|
+ if (!form.value?.inoculationAmount || form.value?.inoculationAmount.trim() === '') {
|
|
|
+ console.log(form.value?.inoculationAmount, 'form.value?.inoculationAmount');
|
|
|
|
|
|
+ callback(new Error('请输入接种数量'));
|
|
|
+ return;
|
|
|
+ }
|
|
|
callback();
|
|
|
} else {
|
|
|
callback();
|
|
|
@@ -895,13 +974,17 @@ const validateinoculation = (rule: any, value: any, callback: any) => {
|
|
|
const validateInoculationDosage = (rule: any, value: any, callback: any) => {
|
|
|
if (+deawerData.value?.data[0]?.landType == 3) {
|
|
|
// value 就是 form.inoculation.inoculationDosage 的值
|
|
|
- if (!value || value.trim() === '') {
|
|
|
+ if (!form.value?.inoculationDosage || form.value?.inoculationDosage.trim() === '') {
|
|
|
+ console.log(form.value?.inoculationDosage, 'form.value?.inoculationDosage');
|
|
|
+
|
|
|
callback(new Error('请输入接种剂量'));
|
|
|
return;
|
|
|
}
|
|
|
+ console.log(form.value);
|
|
|
|
|
|
// 检查单位是否选择
|
|
|
- if (!form.value.inoculation?.inoculationDosageUnit) {
|
|
|
+ if (!form.value?.inoculationDosageUnit) {
|
|
|
+ console.log(form.value?.inoculationDosageUnit, 'form.value?.inoculationDosageUnit');
|
|
|
callback(new Error('请选择接种剂量单位'));
|
|
|
return;
|
|
|
}
|
|
|
@@ -935,7 +1018,8 @@ const rules = reactive({
|
|
|
queryType6: [{ validator: validateBreedingTime, trigger: 'blur' }],
|
|
|
plantingAmount: [{ required: true, message: '请输入养殖面积' }],
|
|
|
breedScale: [{ required: true, message: '请输入养殖区域' }],
|
|
|
- plant: [{ validator: validateBreedingAmount, trigger: 'blur' }],
|
|
|
+ plantingMgUnit: [{ required: true, message: '请选择养殖单位' }],
|
|
|
+ plantingMgAmount: [{ required: true, message: '请输入养殖量' }],
|
|
|
remark: [{ required: false, message: '请输入备注' }],
|
|
|
});
|
|
|
const rules1 = reactive({
|
|
|
@@ -951,7 +1035,8 @@ const rules1 = reactive({
|
|
|
queryType6: [{ validator: validateBreedingTime, trigger: 'blur' }],
|
|
|
plantingAmount: [{ required: true, message: '请输入养殖面积' }],
|
|
|
breedScale: [{ required: true, message: '请输入养殖区域' }],
|
|
|
- plant: [{ validator: validateBreedingAmount, trigger: 'blur' }],
|
|
|
+ plantingMgUnit: [{ required: true, message: '请选择养殖单位' }],
|
|
|
+ plantingMgAmount: [{ required: true, message: '请输入养殖量' }],
|
|
|
remark: [{ required: false, message: '请输入备注' }],
|
|
|
});
|
|
|
const rules2 = reactive({
|
|
|
@@ -964,7 +1049,8 @@ const rules2 = reactive({
|
|
|
plantationMethod: [{ required: false, message: '请选择种植方式' }],
|
|
|
queryType6: [{ validator: validateBreedingTime, trigger: 'blur' }],
|
|
|
plantingAmount: [{ required: true, message: '请输入种植面积' }],
|
|
|
- plant: [{ validator: validateBreedingAmount, trigger: 'blur' }],
|
|
|
+ plantingMgUnit: [{ required: true, message: '请选择种植单位' }],
|
|
|
+ plantingMgAmount: [{ required: true, message: '请输入种植量' }],
|
|
|
remark: [{ required: false, message: '请输入备注' }],
|
|
|
preCropId: [{ required: false, message: '请选择前茬植物' }],
|
|
|
reproductionType: [{ required: true, message: '请选择选择繁殖方式' }],
|
|
|
@@ -981,9 +1067,12 @@ const rules3 = reactive({
|
|
|
plantationMethod: [{ required: false, message: '请选择繁育方式' }],
|
|
|
queryType6: [{ validator: validateBreedingTime, trigger: 'blur' }],
|
|
|
plantingAmount: [{ validator: validatePlantingAmount, trigger: 'blur' }],
|
|
|
- plant: [{ validator: validateBreedingAmount, trigger: 'blur' }],
|
|
|
- 'inoculation.inoculationAmount': [{ validator: validateinoculation, trigger: 'blur' }],
|
|
|
- 'inoculation.inoculationDosage': [{ validator: validateInoculationDosage, trigger: 'blur' }],
|
|
|
+ plantingMgUnit: [{ required: true, message: '请选择繁育单位' }],
|
|
|
+ plantingMgAmount: [{ required: true, message: '请输入繁育数量' }],
|
|
|
+ inoculationAmount: [{ validator: validateinoculation }],
|
|
|
+ inoculationUnit: [{ validator: validateinoculation }],
|
|
|
+ inoculationDosage: [{ validator: validateInoculationDosage }],
|
|
|
+ inoculationDosageUnit: [{ validator: validateInoculationDosage }],
|
|
|
remark: [{ required: false, message: '请输入备注' }],
|
|
|
preCropId: [{ required: false, message: '请选择前茬植物' }],
|
|
|
reproductionType: [{ required: true, message: '请选择选择繁殖方式' }],
|
|
|
@@ -1072,12 +1161,10 @@ const save = () => {
|
|
|
form.value.delegateInfo = null as any;
|
|
|
form.value.delegate = null as any;
|
|
|
}
|
|
|
- console.log(form.value.plant, 'form.value.plant');
|
|
|
|
|
|
const params = {
|
|
|
...form.value,
|
|
|
...form.value.queryType6,
|
|
|
- ...form.value.plant,
|
|
|
...form.value.inoculation,
|
|
|
animalIds: animalIds.value,
|
|
|
};
|
|
|
@@ -1116,8 +1203,6 @@ const saveDraft = () => {
|
|
|
const params = {
|
|
|
...form.value,
|
|
|
...form.value.queryType6,
|
|
|
- ...form.value.plant,
|
|
|
- ...form.value.inoculation,
|
|
|
animalIds: animalIds.value,
|
|
|
};
|
|
|
if (form.value?.delegate?.cusCode) {
|
|
|
@@ -1195,8 +1280,8 @@ const plantingMgAmount = computed(() => {
|
|
|
return '';
|
|
|
}
|
|
|
|
|
|
- const inoculationAmount = Number(form.value?.inoculation?.inoculationAmount);
|
|
|
- const inoculationDosage = Number(form.value?.inoculation?.inoculationDosage);
|
|
|
+ const inoculationAmount = Number(form.value?.inoculationAmount);
|
|
|
+ const inoculationDosage = Number(form.value?.inoculationDosage);
|
|
|
|
|
|
// 如果任一值为无效数字,返回空字符串
|
|
|
if (!inoculationAmount || !inoculationDosage || isNaN(inoculationAmount) || isNaN(inoculationDosage)) {
|
|
|
@@ -1204,15 +1289,15 @@ const plantingMgAmount = computed(() => {
|
|
|
}
|
|
|
|
|
|
const result = inoculationAmount * inoculationDosage;
|
|
|
- form.value.plant.plantingMgAmount = result;
|
|
|
+ form.value.plantingMgAmount = result;
|
|
|
// 返回计算结果,保持数字类型或空字符串
|
|
|
return isNaN(result) ? '' : result;
|
|
|
});
|
|
|
// 如果是组培实验室的话,繁育量单位是一个计算属性
|
|
|
const plantingMgUnit = computed(() => {
|
|
|
if (Number(deawerData.value?.data?.[0]?.landType) == 3) {
|
|
|
- form.value.plant.plantingMgUnit = form.value.inoculation?.inoculationDosageUnit || null;
|
|
|
- return form.value.plant.plantingMgUnit;
|
|
|
+ form.value.plantingMgUnit = form.value?.inoculationDosageUnit || null;
|
|
|
+ return form.value.plantingMgUnit;
|
|
|
}
|
|
|
return null;
|
|
|
});
|
|
|
@@ -1281,21 +1366,11 @@ const getCache = async (taskType: TaskType | null) => {
|
|
|
plannedStartDate: res.data.plannedStartDate,
|
|
|
plannedEndDate: res.data.plannedEndDate,
|
|
|
};
|
|
|
- form.value.inoculation = {
|
|
|
- inoculationAmount: res.data.inoculationAmount,
|
|
|
- inoculationDosage: res.data.inoculationDosage,
|
|
|
- inoculationUnit: res.data.inoculationUnit,
|
|
|
- inoculationDosageUnit: res.data.inoculationDosageUnit,
|
|
|
- };
|
|
|
- form.value.plant = {
|
|
|
- plantingMgAmount: res.data.plantingMgAmount,
|
|
|
- plantingMgUnit: res.data.plantingMgUnit,
|
|
|
- };
|
|
|
+
|
|
|
form.value.delegate = {
|
|
|
cusCode: form.value.delegateInfo?.cusCode,
|
|
|
cusName: form.value.delegateInfo?.cusName,
|
|
|
};
|
|
|
- console.log(form.value.delegate);
|
|
|
|
|
|
if (res.data.animalIds) {
|
|
|
animalIds.value = res.data.animalIds;
|
|
|
@@ -1341,21 +1416,10 @@ const getInfo = async (taskId: any) => {
|
|
|
const res = await useClientRequest.get<any>(`/plt-api/app/plantationTask/getInfo/${taskId}`);
|
|
|
if (!res.data) return;
|
|
|
form.value = res.data;
|
|
|
-
|
|
|
form.value.queryType6 = {
|
|
|
plannedStartDate: res.data.plannedStartDate,
|
|
|
plannedEndDate: res.data.plannedEndDate,
|
|
|
};
|
|
|
- form.value.inoculation = {
|
|
|
- inoculationAmount: res.data.inoculationAmount,
|
|
|
- inoculationDosage: res.data.inoculationDosage,
|
|
|
- inoculationUnit: res.data.inoculationUnit,
|
|
|
- inoculationDosageUnit: res.data.inoculationDosageUnit,
|
|
|
- };
|
|
|
- form.value.plant = {
|
|
|
- plantingMgAmount: res.data.plantingMgAmount,
|
|
|
- plantingMgUnit: res.data.plantingMgUnit,
|
|
|
- };
|
|
|
form.value.delegate = {
|
|
|
cusCode: form.value.delegateInfo?.cusCode,
|
|
|
cusName: form.value.delegateInfo?.cusName,
|
|
|
@@ -1407,3 +1471,16 @@ onMounted(() => {
|
|
|
}
|
|
|
});
|
|
|
</script>
|
|
|
+<style lang="scss">
|
|
|
+:deep(.form-item-top-padding-0) {
|
|
|
+ > .u-form-item__body {
|
|
|
+ padding-top: 0rpx;
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+:deep(.form-item-bottom-padding-0) {
|
|
|
+ > .u-form-item__body {
|
|
|
+ padding-bottom: 0rpx;
|
|
|
+ }
|
|
|
+}
|
|
|
+</style>
|