|
@@ -27,18 +27,18 @@
|
|
|
/>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <div class="sub-title">
|
|
|
- 报价处方
|
|
|
- </div>
|
|
|
+ <div class="usage-mode">
|
|
|
+ 施用方式:<span>{{ serviceData.usageMode }}</span>
|
|
|
+ </div>
|
|
|
<div class="recipe-item">
|
|
|
<div class="recipe-form">
|
|
|
<el-form ref="formRef" style="max-width: 600px" class="demo-dynamic">
|
|
|
<el-form-item
|
|
|
- v-for="(domain, index) in dynamicValidateForm"
|
|
|
- :key="domain.id"
|
|
|
+ v-for="(prescriptionItem, index) in prescriptionList"
|
|
|
+ :key="index"
|
|
|
:prop="'domains.' + index + '.value'"
|
|
|
>
|
|
|
- <div class="form-box">
|
|
|
+ <div class="form-box" v-for="(domain, index) in prescriptionItem.pesticideFertilizerList" :key="'sub' + index">
|
|
|
<div class="form-index">{{ formatIndex(index) }}</div>
|
|
|
<div class="box-item">
|
|
|
<div class="form-l">肥药名称</div>
|
|
@@ -57,7 +57,7 @@
|
|
|
style="width: 140px"
|
|
|
>
|
|
|
<el-option label="人工" :value="1" />
|
|
|
- <el-option label="无人机" :value="2" />
|
|
|
+ <el-option v-if="serviceData.usageMode === '叶面施'" label="无人机" :value="2" />
|
|
|
</el-select>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -95,14 +95,14 @@
|
|
|
</el-input>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <div class="action-btn btn-group">
|
|
|
+ <!-- <div class="action-btn btn-group">
|
|
|
<el-button class="btn delete-btn" @click.prevent="removeDomain(domain)">
|
|
|
删除
|
|
|
</el-button>
|
|
|
<el-button type="primary" class="btn" @click.prevent="resetItemForm(index)">
|
|
|
重置
|
|
|
</el-button>
|
|
|
- </div>
|
|
|
+ </div> -->
|
|
|
</div>
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
@@ -113,7 +113,7 @@
|
|
|
<div class="sub-title">
|
|
|
<div class="sub-name">选择农户</div>
|
|
|
</div>
|
|
|
- <div class="bottom-map" ref="areaRef" :id="'areaMap' + boxId"></div>
|
|
|
+ <!-- <div class="bottom-map" ref="areaRef" :id="'areaMap' + boxId"></div> -->
|
|
|
<template v-for="(item, index) in displayedItems" :key="index">
|
|
|
<div class="service-item">
|
|
|
<div class="service-l">
|
|
@@ -180,7 +180,7 @@
|
|
|
</div>
|
|
|
<div class="item-table">
|
|
|
<el-table
|
|
|
- :data="pesticideFertilizers"
|
|
|
+ :data="tableData"
|
|
|
style="width: 100%"
|
|
|
:header-cell-style="{ background: '#F5F5F5' }"
|
|
|
>
|
|
@@ -252,6 +252,10 @@ const props = defineProps({
|
|
|
type: Number,
|
|
|
required: false,
|
|
|
},
|
|
|
+ prescriptionList: {
|
|
|
+ type: Array,
|
|
|
+ required: true,
|
|
|
+ },
|
|
|
pesticideFertilizers: {
|
|
|
type: Array,
|
|
|
required: true,
|
|
@@ -268,103 +272,48 @@ const props = defineProps({
|
|
|
type: String,
|
|
|
required: false,
|
|
|
},
|
|
|
+ serviceData: {
|
|
|
+ type: Object,
|
|
|
+ required: false,
|
|
|
+ },
|
|
|
});
|
|
|
-const removeDomain = (item) => {
|
|
|
- const index = dynamicValidateForm.value.indexOf(item);
|
|
|
- if (index !== -1) {
|
|
|
- dynamicValidateForm.value.splice(index, 1);
|
|
|
- }
|
|
|
-};
|
|
|
|
|
|
-const resetItemForm = (index) => {
|
|
|
- dynamicValidateForm.value[index] = props.pesticideFertilizers[index];
|
|
|
-};
|
|
|
|
|
|
let pickerTime = ref(props.executeDate);
|
|
|
|
|
|
-let pesticideFertilizersOptions = ref([
|
|
|
- {
|
|
|
- id: 'null',
|
|
|
- name: "芸苔素内酯 15000倍",
|
|
|
- typeName: "30",
|
|
|
- defaultRatio: null,
|
|
|
- unit: 0,
|
|
|
- defaultName: "调节",
|
|
|
- },
|
|
|
-]);
|
|
|
-// VE_API.order.pesticideFertilizers().then(({ data }) => {
|
|
|
-// pesticideFertilizersOptions.value = data;
|
|
|
-// });
|
|
|
-
|
|
|
// 表单
|
|
|
const formRef = ref();
|
|
|
-const dataModel = () => {
|
|
|
- return {
|
|
|
- id: null,
|
|
|
- orderId: null, //订单id
|
|
|
- pesticideFertilizerId: null, //农药id
|
|
|
- pesticideFertilizerName: null, //农药名称
|
|
|
- typeName: null, //功效类型名称
|
|
|
- brand: null, //品牌
|
|
|
- price: null, //单价
|
|
|
- unit: null, //单位
|
|
|
- executeStyle: null, //执行方式
|
|
|
- muUsage: null, //亩用量
|
|
|
- muPrice: null, //单亩价格
|
|
|
- defaultRatio: null, //默认配比
|
|
|
- ratio: null, //配比
|
|
|
- defaultName: null, //默认名称
|
|
|
- };
|
|
|
-};
|
|
|
+
|
|
|
const dynamicValidateForm = ref([]);
|
|
|
|
|
|
const formatIndex = (index) => {
|
|
|
return String(index + 1).padStart(2, "0");
|
|
|
};
|
|
|
-const settingData = () => {
|
|
|
- for (let i = 0; i < props.pesticideFertilizers.length; i++) {
|
|
|
- dynamicValidateForm.value.push(deepClone(props.pesticideFertilizers[i]));
|
|
|
- }
|
|
|
-};
|
|
|
-
|
|
|
-/**
|
|
|
- * 选择药肥的时候修改订单中药肥pesticideFertilizerId 以外其他数据
|
|
|
- * @param index
|
|
|
- */
|
|
|
-const handlePesticideFertilizerChange = (index) => {
|
|
|
- let obj = pesticideFertilizersOptions.value.filter(
|
|
|
- (item) => dynamicValidateForm.value[index].pesticideFertilizerId === item.id
|
|
|
- )[0];
|
|
|
- dynamicValidateForm.value[index] = {
|
|
|
- ...dynamicValidateForm.value[index],
|
|
|
- typeName: obj.typeName,
|
|
|
- unit: obj.unit,
|
|
|
- defaultRatio: obj.defaultRatio,
|
|
|
- ratio: obj.defaultRatio,
|
|
|
- defaultName: obj.defaultName,
|
|
|
- pesticideFertilizerName: obj.name,
|
|
|
- };
|
|
|
- console.log(dynamicValidateForm.value);
|
|
|
-};
|
|
|
-
|
|
|
const handleUsersCheckChange = (index) => {
|
|
|
console.log(props.users);
|
|
|
};
|
|
|
|
|
|
+function flattenDomains(data) {
|
|
|
+ return data.reduce((acc, item) => {
|
|
|
+ return acc.concat(item.pesticideFertilizerList);
|
|
|
+ }, []);
|
|
|
+}
|
|
|
+
|
|
|
const submit = () => {
|
|
|
const data = {
|
|
|
orderId: dynamicValidateForm.value[0].orderId,
|
|
|
orderStatus: 2,
|
|
|
- pesticideFertilizers: dynamicValidateForm.value,
|
|
|
+ prescriptionList: props.prescriptionList,
|
|
|
users: props.users,
|
|
|
executeDate: pickerTime.value,
|
|
|
};
|
|
|
- VE_API.order.confirm(data).then(({ code }) => {
|
|
|
- if (code == 0) {
|
|
|
- console.log('订单确认成功');
|
|
|
- eventBus.emit('discover:submitForm')
|
|
|
- }
|
|
|
- });
|
|
|
+ console.log('data', data);
|
|
|
+ // VE_API.order.confirm(data).then(({ code }) => {
|
|
|
+ // if (code == 0) {
|
|
|
+ // console.log('订单确认成功');
|
|
|
+ // eventBus.emit('discover:submitForm')
|
|
|
+ // }
|
|
|
+ // });
|
|
|
};
|
|
|
|
|
|
const areaRef = ref();
|
|
@@ -372,16 +321,20 @@ let farmArr = ref([])
|
|
|
let serviceArr = ref([])
|
|
|
onMounted(() => {
|
|
|
if (props.progress === 1 && ROLETYPE == '2') {
|
|
|
- const dom = document.getElementById(`areaMap${props.boxId}`)
|
|
|
- let areMap = new AreMap();
|
|
|
- areMap.initMap("POINT(113.1093017627431 22.574540836684672)", dom);
|
|
|
- areMap.setPoints(props.users.filter((item) => item.userType === 1).map((item) => item.point));
|
|
|
- settingData();
|
|
|
+ // const dom = document.getElementById(`areaMap${props.boxId}`)
|
|
|
+ // let areMap = new AreMap();
|
|
|
+ // areMap.initMap("POINT(113.1093017627431 22.574540836684672)", dom);
|
|
|
+ // areMap.setPoints(props.users.filter((item) => item.userType === 1).map((item) => item.point));
|
|
|
+ // settingData();
|
|
|
}
|
|
|
farmArr.value = props.users.filter(item => item.userType === 1)
|
|
|
serviceArr.value = props.users.filter(item => item.userType === 2)
|
|
|
-
|
|
|
+ if (ROLETYPE != '2') {
|
|
|
+ console.log('rrrr');
|
|
|
+ tableData.value = flattenDomains(props.prescriptionList)
|
|
|
+ }
|
|
|
});
|
|
|
+const tableData = ref([])
|
|
|
|
|
|
// 控制是否展开更多列表项的布尔值
|
|
|
const isMoreVisible = ref(false);
|
|
@@ -422,23 +375,34 @@ const toggleMore2 = () => {
|
|
|
.service-time {
|
|
|
display: flex;
|
|
|
align-items: center;
|
|
|
- color: rgba(0, 0, 0, 0.2);
|
|
|
+ color: #727272;
|
|
|
.time-picker {
|
|
|
padding-left: 10px;
|
|
|
::v-deep {
|
|
|
.el-input__wrapper {
|
|
|
- background: #f0f8fd;
|
|
|
- box-shadow: 0 0 0 1px #2199f8 inset;
|
|
|
+ background: none;
|
|
|
+ box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.6) inset;
|
|
|
.el-input__prefix {
|
|
|
- color: #2199f8;
|
|
|
+ color: rgba(255, 255, 255, 0.6);
|
|
|
}
|
|
|
.el-input__inner {
|
|
|
- color: #2199f8;
|
|
|
+ color: #fff;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+.usage-mode {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ font-size: 16px;
|
|
|
+ color: #727272;
|
|
|
+ padding: 12px 0 12px 0;
|
|
|
+ span {
|
|
|
+ color: #fff;
|
|
|
+ }
|
|
|
+}
|
|
|
.service-name {
|
|
|
padding-top: 12px;
|
|
|
color: #2199F8;
|