|
|
@@ -161,7 +161,7 @@
|
|
|
</div>
|
|
|
<el-form-item label-width="82px" class="form-item" prop="usageMode" label="施用方式">
|
|
|
<el-select
|
|
|
- v-model="dynamicValidateForm.usageMode"
|
|
|
+ v-model="dynamicValidateForm.prescription.usageMode"
|
|
|
placeholder="请选择施用方式"
|
|
|
style="width: 100%"
|
|
|
>
|
|
|
@@ -173,7 +173,7 @@
|
|
|
/>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
- <el-form-item v-if="dynamicValidateForm.usageMode === '叶面施'" label-width="82px" class="form-item" prop="executeStyle" label="执行方式">
|
|
|
+ <el-form-item v-if="dynamicValidateForm.prescription.usageMode === '叶面施'" label-width="82px" class="form-item" prop="executeStyle" label="执行方式">
|
|
|
<el-select
|
|
|
class="select-item"
|
|
|
v-model="dynamicValidateForm.executeStyle"
|
|
|
@@ -189,11 +189,11 @@
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
|
|
|
- <el-form-item v-if="dynamicValidateForm.usageMode === '根部施'" label-width="82px" class="form-item" prop="executeStyle" label="执行方式">
|
|
|
+ <el-form-item v-if="dynamicValidateForm.prescription.usageMode === '根部施'" label-width="82px" class="form-item" prop="executeStyle" label="执行方式">
|
|
|
<div class="info-text">人工</div>
|
|
|
</el-form-item>
|
|
|
|
|
|
- <div v-if="dynamicValidateForm.usageMode !== '人工农事'">
|
|
|
+ <div v-if="dynamicValidateForm.prescription.usageMode !== '人工农事'">
|
|
|
<el-form-item
|
|
|
v-for="(domain, index) in dynamicValidateForm.prescription.pesticideFertilizerList"
|
|
|
:key="index"
|
|
|
@@ -361,71 +361,6 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
|
- <!-- <div
|
|
|
- v-if="dynamicValidateForm.usageMode !== '人工农事'"
|
|
|
- class="farm-card prescription-content common-inputs"
|
|
|
- >
|
|
|
- <div class="card-title">处方报价</div>
|
|
|
- <div class="medicine-wrap">
|
|
|
- <template
|
|
|
- v-for="(pesticide, mIndex) in dynamicValidateForm.prescription.pesticideFertilizerList"
|
|
|
- :key="mIndex"
|
|
|
- >
|
|
|
- <div
|
|
|
- class="medicine-box"
|
|
|
- :data-price-index="mIndex"
|
|
|
- >
|
|
|
- <div class="form-index">药肥{{ mIndex + 1 }}</div>
|
|
|
- <div class="box-wrap">
|
|
|
- <div class="medicine-item">
|
|
|
- <div class="item-name">药肥名称</div>
|
|
|
- <div class="item-val">{{ pesticide.name }}</div>
|
|
|
- </div>
|
|
|
- <div class="medicine-item">
|
|
|
- <div class="item-name">药肥品牌</div>
|
|
|
- <div class="item-val">
|
|
|
- <el-input
|
|
|
- v-model="pesticide.brand"
|
|
|
- placeholder="药肥品牌"
|
|
|
- style="width: 150px"
|
|
|
- />
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- <div class="medicine-item mt-8">
|
|
|
- <div class="item-name">药肥单价</div>
|
|
|
- <div class="item-val">
|
|
|
- <el-input
|
|
|
- style="width: 150px"
|
|
|
- v-model="pesticide.price"
|
|
|
- type="number"
|
|
|
- step="0.01"
|
|
|
- placeholder="单价"
|
|
|
- >
|
|
|
- <template #append>元/{{ pesticide.unit }}</template>
|
|
|
- </el-input>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- <div class="medicine-item">
|
|
|
- <div class="item-name">单亩用量</div>
|
|
|
- <div class="item-val">{{ pesticide.dosage }}{{ pesticide.unit }}</div>
|
|
|
- </div>
|
|
|
- <div class="medicine-item">
|
|
|
- <div class="item-name">服务亩数</div>
|
|
|
- <div class="item-val">{{ detailData?.farm?.mianji ? formatArea(detailData?.farm?.mianji) + "亩": "" }}</div>
|
|
|
- </div>
|
|
|
- <div class="medicine-item">
|
|
|
- <div class="item-total">总计:</div>
|
|
|
- <div class="item-price">
|
|
|
- {{ getPesticideTotal(pesticide) }}<span class="item-unit">元</span>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </template>
|
|
|
-
|
|
|
- </div>
|
|
|
- </div> -->
|
|
|
-
|
|
|
<div class="submit-btn" :class="{ 'center-btn': onlyPrice }">
|
|
|
<div v-if="!onlyPrice" class="btn second" @click.prevent="cancelEdit">取消编辑</div>
|
|
|
<div class="btn" @click.prevent="submitForm(formRef)">保存</div>
|
|
|
@@ -438,7 +373,7 @@
|
|
|
<div class="table-item">
|
|
|
<div class="form-item">
|
|
|
<div class="item-name">施用方式</div>
|
|
|
- <div class="item-text">{{ dynamicValidateForm?.usageMode }}</div>
|
|
|
+ <div class="item-text">{{ dynamicValidateForm?.prescription?.usageMode }}</div>
|
|
|
</div>
|
|
|
<div class="form-item">
|
|
|
<div class="item-name">执行方式</div>
|
|
|
@@ -447,7 +382,7 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <div class="new-wrap">
|
|
|
+ <div class="new-wrap" v-if="detailData?.prescription?.pesticideFertilizerList?.length">
|
|
|
<div class="new-title">
|
|
|
<div class="title-1"><div class="table-name">使用功效</div></div>
|
|
|
<div class="title-2"><div class="table-name">药肥名称</div></div>
|
|
|
@@ -473,8 +408,8 @@
|
|
|
</div>
|
|
|
<div class="line-r">
|
|
|
<div class="line-3">
|
|
|
- <div class="sub-line title-4">{{ subP.ratio }}倍</div>
|
|
|
- <div class="sub-line title-5">{{ subP.dosage }}{{ subP.unit }}</div>
|
|
|
+ <div class="sub-line title-4">{{ subP.ratio ? (subP.ratio + '倍') : '--' }}</div>
|
|
|
+ <div class="sub-line title-5">{{ subP.dosage ? (subP.dosage + subP.unit) : '--' }}</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
@@ -487,7 +422,7 @@
|
|
|
<div class="farm-card prescription-content">
|
|
|
<div class="card-title">处方报价</div>
|
|
|
|
|
|
- <div class="price-bottom pb-8" v-if="!noPrice">
|
|
|
+ <div class="price-bottom" v-if="!noPrice">
|
|
|
<div class="info-title-wrap">
|
|
|
<div class="sub-title font-bold">药肥费用</div>
|
|
|
<div class="info-more">
|
|
|
@@ -495,7 +430,7 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <div class="info-content-wrap">
|
|
|
+ <div class="info-content-wrap pt-8">
|
|
|
<price-table :prescriptionData="dynamicValidateForm.prescription" :area="detailData?.farm?.mianji">
|
|
|
<template #bottomContent>
|
|
|
<div class="price-bottom">
|
|
|
@@ -715,7 +650,7 @@ const getDetail = async () => {
|
|
|
if(code === 0) {
|
|
|
detailData.value = data;
|
|
|
dynamicValidateForm.executeDate = data.executeDate;
|
|
|
- dynamicValidateForm.usageMode = data?.prescription?.usageMode === '其他' ? '根部施' : data?.prescription?.usageMode;
|
|
|
+ dynamicValidateForm.prescription.usageMode = data?.prescription?.usageMode === '其他' ? '根部施' : data?.prescription?.usageMode;
|
|
|
// 从 prescription 获取数据
|
|
|
dynamicValidateForm.prescription = data.prescription || {
|
|
|
usageMode: "",
|
|
|
@@ -723,10 +658,16 @@ const getDetail = async () => {
|
|
|
};
|
|
|
dynamicValidateForm.executeStyle = data?.prescription?.pesticideFertilizerList[0]?.executeStyle;
|
|
|
servicePricePerMu.value = detailData.value.serviceMuPrice || null;
|
|
|
- if (isDoingComplete.value) {
|
|
|
+ if (isDoingComplete.value && !isDefault.value) {
|
|
|
data?.prescription?.pesticideFertilizerList.forEach(item => {
|
|
|
item.placeholderRatio = item.ratio || '';
|
|
|
item.placeholderDosage = item.dosage || '';
|
|
|
+ if (isNaN(item.ratio)) {
|
|
|
+ item.ratio = null;
|
|
|
+ }
|
|
|
+ if (isNaN(item.dosage)) {
|
|
|
+ item.dosage = null;
|
|
|
+ }
|
|
|
});
|
|
|
}
|
|
|
const pesticideFertilizerCodes = data?.prescription?.pesticideFertilizerList.map(item => item.code);
|
|
|
@@ -922,7 +863,6 @@ const clearData = () => {
|
|
|
dynamicValidateForm.conditionRate = "";
|
|
|
dynamicValidateForm.purpose = "";
|
|
|
dynamicValidateForm.executeDate = dayjs().format("YYYY-MM-DD");
|
|
|
- dynamicValidateForm.usageMode = "";
|
|
|
dynamicValidateForm.prescription = {
|
|
|
id: "",
|
|
|
usageMode: "",
|
|
|
@@ -1158,7 +1098,7 @@ const pesticideCostTotal = computed(() => {
|
|
|
const totalCost = computed(() => {
|
|
|
const pesticide = Number(pesticideCostTotal.value || 0);
|
|
|
const service = Number(serviceCostTotal.value || 0);
|
|
|
- if (!pesticide || !service) return '--';
|
|
|
+ if (!pesticide && !service) return '--';
|
|
|
return Number((pesticide + service).toFixed(2));
|
|
|
});
|
|
|
|
|
|
@@ -1173,7 +1113,7 @@ const submitForm = (formEl) => {
|
|
|
if (!onlyPrice.value && !validateInteractForm()) return false;
|
|
|
|
|
|
// 校验药肥的亩兑水量和单亩用量是否填写
|
|
|
- if (!onlyPrice.value && !validatePesticideDosage()) return;
|
|
|
+ if (!validatePesticideDosage()) return;
|
|
|
|
|
|
// 保存报价信息前先校验是否填写完整
|
|
|
if (!validatePriceInfos()) return;
|
|
|
@@ -1296,7 +1236,26 @@ const submit = () => {
|
|
|
window.scrollTo(0, 0);
|
|
|
}
|
|
|
});
|
|
|
+ } else {
|
|
|
+ // 不需要处方报价信息的农事
|
|
|
+ if (priceList.pesticideFertilizerInfos.length === 0) {
|
|
|
+ if (onlyPrice.value) {
|
|
|
+ // router.push(`/task_condition?noReload=true`);
|
|
|
+ router.back();
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ isEdit.value = false;
|
|
|
+ getDetail();
|
|
|
+ nextTick(() => {
|
|
|
+ if (pageRef.value) {
|
|
|
+ pageRef.value.scrollTop = 0;
|
|
|
+ } else {
|
|
|
+ window.scrollTo(0, 0);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
}
|
|
|
+ }).catch(() => {
|
|
|
});
|
|
|
|
|
|
// 切换标记
|
|
|
@@ -1827,6 +1786,9 @@ const handleDeleteInteract = () => {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ .pt-8 {
|
|
|
+ padding-top: 8px;
|
|
|
+ }
|
|
|
.pb-8 {
|
|
|
padding-bottom: 8px;
|
|
|
}
|