|
@@ -89,7 +89,7 @@
|
|
|
</ut-action-sheet>
|
|
</ut-action-sheet>
|
|
|
<view class="h-1" id="queryType6pppp"></view>
|
|
<view class="h-1" id="queryType6pppp"></view>
|
|
|
<up-form-item :borderBottom="false" label="养殖时间" required prop="queryType6">
|
|
<up-form-item :borderBottom="false" label="养殖时间" required prop="queryType6">
|
|
|
- <ut-datetime-picker v-model="form.queryType6.plannedStartDate" mode="date" dateFields="day">
|
|
|
|
|
|
|
+ <ut-datetime-picker v-model="form.queryType6.plannedStartDate" mode="date" dateFields="day" @change="changeStartTime">
|
|
|
<view class="d-flex mr-20">
|
|
<view class="d-flex mr-20">
|
|
|
<up-input v-model="form.queryType6.plannedStartDate" 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>
|
|
<up-icon size="22rpx" color="#2A6D52" name="arrow-down-fill" style="margin-left: -20rpx"></up-icon>
|
|
@@ -161,7 +161,7 @@
|
|
|
<up-radio :customStyle="{ marginRight: '60rpx' }" v-for="(item, index) in yes_no" :key="index" :label="item.label" :name="item.value"></up-radio>
|
|
<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-radio-group>
|
|
|
</up-form-item>
|
|
</up-form-item>
|
|
|
- <up-form-item borderBottom label="委托企业" required prop="delegateInfo" id="delegateInfopppp">
|
|
|
|
|
|
|
+ <!-- <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 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=""></view>
|
|
|
<view class="f-s-34 c-primary">请选择委托企业</view>
|
|
<view class="f-s-34 c-primary">请选择委托企业</view>
|
|
@@ -175,6 +175,11 @@
|
|
|
<text class="c-#666 f-s-24">{{ form?.delegateInfo?.crediteCode }}</text>
|
|
<text class="c-#666 f-s-24">{{ form?.delegateInfo?.crediteCode }}</text>
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
|
|
+ </up-form-item> -->
|
|
|
|
|
+ <up-form-item borderBottom label="供应商" prop="delegateInfo">
|
|
|
|
|
+ <view class="flex1">
|
|
|
|
|
+ <ContactUnitInput v-model="form.delegateInfo.cpyid" v-model:info="form.delegate" :params="{ cpyType: '4' }" title="选择供应商" placeholder="请选择供应商信息"></ContactUnitInput>
|
|
|
|
|
+ </view>
|
|
|
</up-form-item>
|
|
</up-form-item>
|
|
|
<ut-action-sheet v-model="form.mgMethod" :tabs="pt_mg_method" title="选择溯源级别">
|
|
<ut-action-sheet v-model="form.mgMethod" :tabs="pt_mg_method" title="选择溯源级别">
|
|
|
<up-form-item borderBottom label="溯源级别" required prop="mgMethod" id="mgMethodpppp">
|
|
<up-form-item borderBottom label="溯源级别" required prop="mgMethod" id="mgMethodpppp">
|
|
@@ -227,7 +232,7 @@
|
|
|
</ut-action-sheet>
|
|
</ut-action-sheet>
|
|
|
<view class="h-1" id="queryType6pppp"></view>
|
|
<view class="h-1" id="queryType6pppp"></view>
|
|
|
<up-form-item :borderBottom="false" label="养殖时间" required prop="queryType6">
|
|
<up-form-item :borderBottom="false" label="养殖时间" required prop="queryType6">
|
|
|
- <ut-datetime-picker v-model="form.queryType6.plannedStartDate" mode="date" dateFields="day">
|
|
|
|
|
|
|
+ <ut-datetime-picker v-model="form.queryType6.plannedStartDate" mode="date" dateFields="day" @change="changeStartTime">
|
|
|
<view class="d-flex mr-20">
|
|
<view class="d-flex mr-20">
|
|
|
<up-input v-model="form.queryType6.plannedStartDate" 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>
|
|
<up-icon size="22rpx" color="#2A6D52" name="arrow-down-fill" style="margin-left: -20rpx"></up-icon>
|
|
@@ -362,7 +367,7 @@
|
|
|
</up-form-item>
|
|
</up-form-item>
|
|
|
<view class="h-1" id="queryType6pppp"></view>
|
|
<view class="h-1" id="queryType6pppp"></view>
|
|
|
<up-form-item :borderBottom="false" label="种植时间" required prop="queryType6">
|
|
<up-form-item :borderBottom="false" label="种植时间" required prop="queryType6">
|
|
|
- <ut-datetime-picker v-model="form.queryType6.plannedStartDate" mode="date" dateFields="day">
|
|
|
|
|
|
|
+ <ut-datetime-picker v-model="form.queryType6.plannedStartDate" mode="date" dateFields="day" @change="changeStartTime">
|
|
|
<view class="d-flex mr-20">
|
|
<view class="d-flex mr-20">
|
|
|
<up-input v-model="form.queryType6.plannedStartDate" 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>
|
|
<up-icon size="22rpx" color="#2A6D52" name="arrow-down-fill" style="margin-left: -20rpx"></up-icon>
|
|
@@ -477,7 +482,7 @@
|
|
|
<up-radio :customStyle="{ marginRight: '60rpx' }" v-for="(item, index) in yes_no" :key="index" :label="item.label" :name="item.value"></up-radio>
|
|
<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-radio-group>
|
|
|
</up-form-item>
|
|
</up-form-item>
|
|
|
- <up-form-item borderBottom label="委托企业" required prop="delegateInfo" id="delegateInfopppp">
|
|
|
|
|
|
|
+ <!-- <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 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=""></view>
|
|
|
<view class="f-s-34 c-primary">请选择委托企业</view>
|
|
<view class="f-s-34 c-primary">请选择委托企业</view>
|
|
@@ -491,6 +496,11 @@
|
|
|
<text class="c-#666 f-s-24">{{ form?.delegateInfo?.crediteCode }}</text>
|
|
<text class="c-#666 f-s-24">{{ form?.delegateInfo?.crediteCode }}</text>
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
|
|
+ </up-form-item> -->
|
|
|
|
|
+ <up-form-item borderBottom label="供应商" prop="delegateInfo">
|
|
|
|
|
+ <view class="flex1">
|
|
|
|
|
+ <ContactUnitInput v-model="form.delegateInfo.cpyid" v-model:info="form.delegate" :params="{ cpyType: '4' }" title="选择供应商" placeholder="请选择供应商信息"></ContactUnitInput>
|
|
|
|
|
+ </view>
|
|
|
</up-form-item>
|
|
</up-form-item>
|
|
|
<ut-action-sheet v-if="+deawerData?.data[0]?.landType == 3" v-model="form.mgMethod" :tabs="pt_mg_method" title="选择溯源级别">
|
|
<ut-action-sheet v-if="+deawerData?.data[0]?.landType == 3" v-model="form.mgMethod" :tabs="pt_mg_method" title="选择溯源级别">
|
|
|
<up-form-item borderBottom label="溯源级别" required prop="mgMethod" id="mgMethodpppp">
|
|
<up-form-item borderBottom label="溯源级别" required prop="mgMethod" id="mgMethodpppp">
|
|
@@ -543,7 +553,7 @@
|
|
|
</ut-action-sheet>
|
|
</ut-action-sheet>
|
|
|
<view class="h-1" id="queryType6pppp"></view>
|
|
<view class="h-1" id="queryType6pppp"></view>
|
|
|
<up-form-item :borderBottom="false" label="繁育日期" required prop="queryType6">
|
|
<up-form-item :borderBottom="false" label="繁育日期" required prop="queryType6">
|
|
|
- <ut-datetime-picker v-model="form.queryType6.plannedStartDate" mode="date" dateFields="day">
|
|
|
|
|
|
|
+ <ut-datetime-picker v-model="form.queryType6.plannedStartDate" mode="date" dateFields="day" @change="changeStartTime">
|
|
|
<view class="d-flex mr-20">
|
|
<view class="d-flex mr-20">
|
|
|
<up-input v-model="form.queryType6.plannedStartDate" 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>
|
|
<up-icon size="22rpx" color="#2A6D52" name="arrow-down-fill" style="margin-left: -20rpx"></up-icon>
|
|
@@ -743,6 +753,7 @@ import Baseinfo from './models/baseinfo.vue';
|
|
|
import { useClientRequest } from '@/utils/request';
|
|
import { useClientRequest } from '@/utils/request';
|
|
|
import type { TaskType, YesNoType, TimeRange, PlantInfo, DelegateInfo, InoculationInfo, LandInfo, BaseSelectData, PlantationTaskForm, FormRuleItem, FormRules } from './models/types';
|
|
import type { TaskType, YesNoType, TimeRange, PlantInfo, DelegateInfo, InoculationInfo, LandInfo, BaseSelectData, PlantationTaskForm, FormRuleItem, FormRules } from './models/types';
|
|
|
import Drawer_laboratory from './models/drawer_laboratory.vue';
|
|
import Drawer_laboratory from './models/drawer_laboratory.vue';
|
|
|
|
|
+import ContactUnitInput from '@/models/contact-unit-input/contact-unit-input.vue';
|
|
|
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
|
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
|
|
const { pt_feed_amount_unit, pt_planting_mg_unit, pt_inoculation_unit, pt_inoculation_dosage_unit, pt_transplant_method, pt_plantation_type, pt_sowing_method, pt_area_unit, pt_plantation_method, pt_reproduction_type, pt_scale_unit, pt_feeding_method, pt_mg_method, pt_task_gap_flag, pt_task_type, pt_org_type, yes_no } = toRefs<any>(
|
|
const { pt_feed_amount_unit, pt_planting_mg_unit, pt_inoculation_unit, pt_inoculation_dosage_unit, pt_transplant_method, pt_plantation_type, pt_sowing_method, pt_area_unit, pt_plantation_method, pt_reproduction_type, pt_scale_unit, pt_feeding_method, pt_mg_method, pt_task_gap_flag, pt_task_type, pt_org_type, yes_no } = toRefs<any>(
|
|
|
proxy?.useDict('pt_feed_amount_unit', 'pt_planting_mg_unit', 'pt_inoculation_unit', 'pt_inoculation_dosage_unit', 'pt_transplant_method', 'pt_plantation_type', 'pt_sowing_method', 'pt_area_unit', 'pt_plantation_method', 'pt_reproduction_type', 'pt_scale_unit', 'pt_feeding_method', 'pt_mg_method', 'pt_task_gap_flag', 'pt_task_type', 'pt_org_type', 'yes_no'),
|
|
proxy?.useDict('pt_feed_amount_unit', 'pt_planting_mg_unit', 'pt_inoculation_unit', 'pt_inoculation_dosage_unit', 'pt_transplant_method', 'pt_plantation_type', 'pt_sowing_method', 'pt_area_unit', 'pt_plantation_method', 'pt_reproduction_type', 'pt_scale_unit', 'pt_feeding_method', 'pt_mg_method', 'pt_task_gap_flag', 'pt_task_type', 'pt_org_type', 'yes_no'),
|
|
@@ -772,7 +783,8 @@ const form = ref<PlantationTaskForm>({
|
|
|
plantingAmount: '',
|
|
plantingAmount: '',
|
|
|
remark: null,
|
|
remark: null,
|
|
|
delegateFlag: '0',
|
|
delegateFlag: '0',
|
|
|
- delegateInfo: { cusId: '1795009980763025410', crediteCode: '91530102MACA96MJ9H', cusName: '演示企业' },
|
|
|
|
|
|
|
+ delegateInfo: { cpyid: '', cusCode: '', cusName: '' },
|
|
|
|
|
+ delegate: {},
|
|
|
plantationType: null,
|
|
plantationType: null,
|
|
|
sowingMethod: null,
|
|
sowingMethod: null,
|
|
|
transplantMethod: null,
|
|
transplantMethod: null,
|
|
@@ -785,6 +797,11 @@ const form = ref<PlantationTaskForm>({
|
|
|
},
|
|
},
|
|
|
cultureMediumFormula: null,
|
|
cultureMediumFormula: null,
|
|
|
});
|
|
});
|
|
|
|
|
+const changeStartTime = () => {
|
|
|
|
|
+ if (!form.value?.queryType6?.plannedEndDate) {
|
|
|
|
|
+ form.value.queryType6.plannedEndDate = form.value.queryType6.plannedStartDate;
|
|
|
|
|
+ }
|
|
|
|
|
+};
|
|
|
//单个溯源都数组
|
|
//单个溯源都数组
|
|
|
const animalIds = ref<any>([]);
|
|
const animalIds = ref<any>([]);
|
|
|
const animalId = ref();
|
|
const animalId = ref();
|
|
@@ -838,7 +855,7 @@ const validateBreedingTime = (rule: any, value: any, callback: any) => {
|
|
|
}
|
|
}
|
|
|
const startDate = new Date(plannedStartDate);
|
|
const startDate = new Date(plannedStartDate);
|
|
|
const endDate = new Date(plannedEndDate);
|
|
const endDate = new Date(plannedEndDate);
|
|
|
- if (endDate <= startDate) {
|
|
|
|
|
|
|
+ if (endDate < startDate) {
|
|
|
callback(new Error('养殖结束时间必须晚于开始时间'));
|
|
callback(new Error('养殖结束时间必须晚于开始时间'));
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
@@ -874,16 +891,8 @@ const validateDelegateInfo = (rule: any, value: any, callback: any) => {
|
|
|
callback(new Error('请选择委托企业'));
|
|
callback(new Error('请选择委托企业'));
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
- const { cusId, crediteCode, cusName } = value;
|
|
|
|
|
- if (!cusId) {
|
|
|
|
|
- callback(new Error('请选择委托企业'));
|
|
|
|
|
- return;
|
|
|
|
|
- }
|
|
|
|
|
- if (!crediteCode) {
|
|
|
|
|
- callback(new Error('请选择委托企业'));
|
|
|
|
|
- return;
|
|
|
|
|
- }
|
|
|
|
|
- if (!cusName) {
|
|
|
|
|
|
|
+ const { cpyid, crediteCode, cusName } = value;
|
|
|
|
|
+ if (!cpyid) {
|
|
|
callback(new Error('请选择委托企业'));
|
|
callback(new Error('请选择委托企业'));
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
@@ -1094,6 +1103,8 @@ const save = () => {
|
|
|
console.log('开始提交');
|
|
console.log('开始提交');
|
|
|
await upFormRef.value?.validate();
|
|
await upFormRef.value?.validate();
|
|
|
console.log('校验完成');
|
|
console.log('校验完成');
|
|
|
|
|
+ form.value.delegateInfo.cusName = form.value?.delegate.cusName;
|
|
|
|
|
+ form.value.delegateInfo.cusCode = form.value?.delegate.cusCode;
|
|
|
const params = {
|
|
const params = {
|
|
|
...form.value,
|
|
...form.value,
|
|
|
...form.value.queryType6,
|
|
...form.value.queryType6,
|
|
@@ -1101,7 +1112,6 @@ const save = () => {
|
|
|
...form.value.inoculation,
|
|
...form.value.inoculation,
|
|
|
animalIds: animalIds.value,
|
|
animalIds: animalIds.value,
|
|
|
};
|
|
};
|
|
|
- console.log(params);
|
|
|
|
|
|
|
|
|
|
const res = await useClientRequest.post('/plt-api/app/plantationTask/saveTask', params);
|
|
const res = await useClientRequest.post('/plt-api/app/plantationTask/saveTask', params);
|
|
|
if (res.code == 200) {
|
|
if (res.code == 200) {
|
|
@@ -1135,6 +1145,11 @@ const saveDraft = () => {
|
|
|
...form.value.inoculation,
|
|
...form.value.inoculation,
|
|
|
animalIds: animalIds.value,
|
|
animalIds: animalIds.value,
|
|
|
};
|
|
};
|
|
|
|
|
+ if (form.value?.delegate?.cusCode) {
|
|
|
|
|
+ form.value.delegateInfo.cusName = form.value?.delegate?.cusName;
|
|
|
|
|
+ form.value.delegateInfo.cusCode = form.value?.delegate?.cusCode;
|
|
|
|
|
+ }
|
|
|
|
|
+ console.log('暂存参数:', params);
|
|
|
const res = await useClientRequest.post('/plt-api/app/plantationTask/draftTask', params);
|
|
const res = await useClientRequest.post('/plt-api/app/plantationTask/draftTask', params);
|
|
|
if (res.code == 200) {
|
|
if (res.code == 200) {
|
|
|
uni.showToast({
|
|
uni.showToast({
|
|
@@ -1146,7 +1161,9 @@ const saveDraft = () => {
|
|
|
uni.navigateBack();
|
|
uni.navigateBack();
|
|
|
}, 1000);
|
|
}, 1000);
|
|
|
}
|
|
}
|
|
|
- } catch (error: any) {}
|
|
|
|
|
|
|
+ } catch (error: any) {
|
|
|
|
|
+ console.log(error, 'error');
|
|
|
|
|
+ }
|
|
|
});
|
|
});
|
|
|
};
|
|
};
|
|
|
//确认添加个体
|
|
//确认添加个体
|
|
@@ -1295,6 +1312,12 @@ const getCache = async (taskType: TaskType | null) => {
|
|
|
plantingMgAmount: res.data.plantingMgAmount,
|
|
plantingMgAmount: res.data.plantingMgAmount,
|
|
|
plantingMgUnit: res.data.plantingMgUnit,
|
|
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) {
|
|
if (res.data.animalIds) {
|
|
|
animalIds.value = res.data.animalIds;
|
|
animalIds.value = res.data.animalIds;
|
|
|
}
|
|
}
|
|
@@ -1354,6 +1377,10 @@ const getInfo = async (taskId: any) => {
|
|
|
plantingMgAmount: res.data.plantingMgAmount,
|
|
plantingMgAmount: res.data.plantingMgAmount,
|
|
|
plantingMgUnit: res.data.plantingMgUnit,
|
|
plantingMgUnit: res.data.plantingMgUnit,
|
|
|
};
|
|
};
|
|
|
|
|
+ form.value.delegate = {
|
|
|
|
|
+ cusCode: form.value.delegateInfo?.cusCode,
|
|
|
|
|
+ cusName: form.value.delegateInfo?.cusName,
|
|
|
|
|
+ };
|
|
|
if (res.data.animalIds) {
|
|
if (res.data.animalIds) {
|
|
|
animalIds.value = res.data.animalIds;
|
|
animalIds.value = res.data.animalIds;
|
|
|
}
|
|
}
|