|
@@ -5,7 +5,7 @@
|
|
|
<div class="item-name">{{ itemData?.farmWorkName }}</div>
|
|
<div class="item-name">{{ itemData?.farmWorkName }}</div>
|
|
|
<div class="item-time">{{ itemData?.executeDate }}</div>
|
|
<div class="item-time">{{ itemData?.executeDate }}</div>
|
|
|
</div>
|
|
</div>
|
|
|
- <div class="top-r">{{ status === 0 ? "查看处方" : "查看详情" }}</div>
|
|
|
|
|
|
|
+ <div class="top-r" @click="toDetail(status, itemData.id)">{{ status === 0 ? "查看处方" : "查看详情" }}</div>
|
|
|
</div>
|
|
</div>
|
|
|
<div class="item-box" v-if="status === 0">
|
|
<div class="item-box" v-if="status === 0">
|
|
|
<!-- <div class="title-wrap">
|
|
<!-- <div class="title-wrap">
|
|
@@ -52,7 +52,7 @@
|
|
|
<div class="farm-info">
|
|
<div class="farm-info">
|
|
|
{{ itemData?.farmName }}
|
|
{{ itemData?.farmName }}
|
|
|
<div class="info-tag-wrap">
|
|
<div class="info-tag-wrap">
|
|
|
- <div class="tag-item second" v-if="itemData?.farmArea">{{ itemData?.farmArea }}亩</div>
|
|
|
|
|
|
|
+ <div class="tag-item second" v-if="itemData?.farmArea">{{ formatArea(itemData?.farmArea) }}亩</div>
|
|
|
<div class="tag-item primary">{{ itemData?.typeName }}</div>
|
|
<div class="tag-item primary">{{ itemData?.typeName }}</div>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
@@ -68,7 +68,7 @@
|
|
|
<div class="desc-info">
|
|
<div class="desc-info">
|
|
|
<div class="desc-info-item">
|
|
<div class="desc-info-item">
|
|
|
<span>药物处方:</span>
|
|
<span>药物处方:</span>
|
|
|
- <span class="value">1000倍国光乙烯利</span>
|
|
|
|
|
|
|
+ <span class="value">{{ prescriptionText }}</span>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
<div class="desc-info two-text" v-if="!expiredDay">
|
|
<div class="desc-info two-text" v-if="!expiredDay">
|
|
@@ -85,12 +85,15 @@
|
|
|
alt=""
|
|
alt=""
|
|
|
/>
|
|
/>
|
|
|
</div>
|
|
</div>
|
|
|
- <div class="review-image-item">
|
|
|
|
|
|
|
+ <div class="review-image-item" v-if="detailItem?.executeEvidence?.length">
|
|
|
<div class="review-image-item-title">农事后</div>
|
|
<div class="review-image-item-title">农事后</div>
|
|
|
- <img
|
|
|
|
|
- src="@/assets/img/monitor/aaa.png"
|
|
|
|
|
- alt=""
|
|
|
|
|
- />
|
|
|
|
|
|
|
+ <photo-provider :photo-closable="true">
|
|
|
|
|
+ <photo-consumer v-for="src in [detailItem.executeEvidence[detailItem.executeEvidence.length - 1]]" intro="执行照片" :key="src" :src="base_img_url2 + src">
|
|
|
|
|
+ <div class="img-item">
|
|
|
|
|
+ <img :src="base_img_url2 + src" class="view-box">
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </photo-consumer>
|
|
|
|
|
+ </photo-provider>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
@@ -112,13 +115,30 @@
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
<slot name="footer"></slot>
|
|
<slot name="footer"></slot>
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ <div class="item-footer" v-if="status === 1">
|
|
|
|
|
+ <div class="footer-l farm-name-text">
|
|
|
|
|
+ 来自<span class="name-text">{{ itemData.farmName || '未知农场' }}</span>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="footer-r">
|
|
|
|
|
+ <div class="btn warning" @click="shareResult">
|
|
|
|
|
+ 分享成果
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <!-- <div class="btn secondary-text">
|
|
|
|
|
+ 提醒用户拍照
|
|
|
|
|
+ </div> -->
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script setup>
|
|
<script setup>
|
|
|
-import { ref } from 'vue';
|
|
|
|
|
|
|
+import { onMounted, ref } from 'vue';
|
|
|
import { useRouter } from "vue-router";
|
|
import { useRouter } from "vue-router";
|
|
|
|
|
+import { base_img_url2 } from "@/api/config";
|
|
|
|
|
+import wx from 'weixin-js-sdk';
|
|
|
|
|
|
|
|
const props = defineProps({
|
|
const props = defineProps({
|
|
|
status: {
|
|
status: {
|
|
@@ -141,6 +161,67 @@ const router = useRouter();
|
|
|
const toPage = () => {
|
|
const toPage = () => {
|
|
|
router.push("/report_detail")
|
|
router.push("/report_detail")
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+const shareResult = () => {
|
|
|
|
|
+ if (detailItem.value?.executeEvidence?.length) {
|
|
|
|
|
+ wx.miniProgram.navigateTo({
|
|
|
|
|
+ url: `/pages/subPages/share_page/index?pageParams=${JSON.stringify({ shareText: "向您分享了农事执行成果", id: detailItem.value.id })}&type=reviewWork`,
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+onMounted(async () => {
|
|
|
|
|
+ // 若已带处方列表,直接生成;否则在需要时拉取详情后生成
|
|
|
|
|
+ if (props.itemData && Array.isArray(props.itemData.prescriptionList)) {
|
|
|
|
|
+ prescriptionText.value = buildPrescriptionText(props.itemData.prescriptionList);
|
|
|
|
|
+ } else if (props.status === 1 && props.itemData?.id) {
|
|
|
|
|
+ await getItemDetail(props.itemData.id);
|
|
|
|
|
+ if (Array.isArray(detailItem.value?.prescriptionList)) {
|
|
|
|
|
+ prescriptionText.value = buildPrescriptionText(detailItem.value.prescriptionList);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+})
|
|
|
|
|
+
|
|
|
|
|
+const detailItem = ref({});
|
|
|
|
|
+const prescriptionText = ref('');
|
|
|
|
|
+function buildPrescriptionText(list) {
|
|
|
|
|
+ try {
|
|
|
|
|
+ return list
|
|
|
|
|
+ .map(group => (group.pesticideFertilizerList || [])
|
|
|
|
|
+ .map(p => p.defaultName || p.pesticideFertilizerName || '')
|
|
|
|
|
+ .filter(Boolean)
|
|
|
|
|
+ .join('+')
|
|
|
|
|
+ )
|
|
|
|
|
+ .filter(Boolean)
|
|
|
|
|
+ .join('+');
|
|
|
|
|
+ } catch {
|
|
|
|
|
+ return '';
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
+async function getItemDetail(id) {
|
|
|
|
|
+ const { data } = await VE_API.z_farm_work_record.getDetail({ id });
|
|
|
|
|
+ detailItem.value = data[0];
|
|
|
|
|
+ console.log('dddd', detailItem.value)
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+// 保留方法名以兼容,但同步返回已生成的文案
|
|
|
|
|
+const getPrescriptionInfo = () => prescriptionText.value;
|
|
|
|
|
+
|
|
|
|
|
+function formatArea(val) {
|
|
|
|
|
+ const num = typeof val === 'number' ? val : parseFloat(val);
|
|
|
|
|
+ if (Number.isNaN(num)) return val;
|
|
|
|
|
+ return Number.isInteger(num) ? num : num.toFixed(2);
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+const toDetail = (status, id) => {
|
|
|
|
|
+ if (status === 1) {
|
|
|
|
|
+ // 复核成效
|
|
|
|
|
+ router.push({
|
|
|
|
|
+ path: "/review_work",
|
|
|
|
|
+ query: { json: JSON.stringify({ id }) }
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
</script>
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
<style lang="scss" scoped>
|
|
@@ -203,7 +284,81 @@ const toPage = () => {
|
|
|
border: 1px solid rgba(183, 183, 183, 0.1);
|
|
border: 1px solid rgba(183, 183, 183, 0.1);
|
|
|
padding: 10px 12px;
|
|
padding: 10px 12px;
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+.item-footer {
|
|
|
|
|
+ margin-top: 10px;
|
|
|
|
|
+ padding-top: 11px;
|
|
|
|
|
+ border-top: 1px solid rgba(0, 0, 0, 0.1);
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ align-items: center;
|
|
|
|
|
+ justify-content: space-between;
|
|
|
|
|
+ font-size: 12px;
|
|
|
|
|
+ .footer-l {
|
|
|
|
|
+ color: #8B8B8B;
|
|
|
|
|
+ font-size: 12px;
|
|
|
|
|
+ &.primary-btn {
|
|
|
|
|
+ display: inline-flex;
|
|
|
|
|
+ align-items: center;
|
|
|
|
|
+ border: 1px solid #2199F8;
|
|
|
|
|
+ background: rgba(33, 153, 248, 0.1);
|
|
|
|
|
+ padding: 0 12px;
|
|
|
|
|
+ height: 32px;
|
|
|
|
|
+ box-sizing: border-box;
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ align-items: center;
|
|
|
|
|
+ border-radius: 20px;
|
|
|
|
|
+ color: #2199F8;
|
|
|
|
|
+ .share-icon {
|
|
|
|
|
+ width: 12px;
|
|
|
|
|
+ padding-right: 4px;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ &.farm-name-text {
|
|
|
|
|
+ font-size: 14px;
|
|
|
|
|
+ color: #6F7274;
|
|
|
|
|
+ .name-text {
|
|
|
|
|
+ padding-left: 4px;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ .footer-r {
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ align-items: center;
|
|
|
|
|
+ .btn {
|
|
|
|
|
+ height: 32px;
|
|
|
|
|
+ line-height: 32px;
|
|
|
|
|
+ padding: 0 12px;
|
|
|
|
|
+ border-radius: 20px;
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ align-items: center;
|
|
|
|
|
+ box-sizing: border-box;
|
|
|
|
|
+ &.second {
|
|
|
|
|
+ // border: 1px solid #8B8B8B;
|
|
|
|
|
+ // color: #8B8B8B;
|
|
|
|
|
+ color: #2199F8;
|
|
|
|
|
+ background: rgba(33, 153, 248, 0.1);
|
|
|
|
|
+ }
|
|
|
|
|
+ &.primary {
|
|
|
|
|
+ background: #2199F8;
|
|
|
|
|
+ color: #fff;
|
|
|
|
|
+ }
|
|
|
|
|
+ .btn-icon {
|
|
|
|
|
+ padding-right: 4px;
|
|
|
|
|
+ }
|
|
|
|
|
+ &.warning {
|
|
|
|
|
+ color: #FF953D;
|
|
|
|
|
+ background: #fff;
|
|
|
|
|
+ border: 1px solid #FF953D;
|
|
|
|
|
+ }
|
|
|
|
|
+ &.secondary-text {
|
|
|
|
|
+ color: #2199F8;
|
|
|
|
|
+ border: 1px solid #2199F8;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ .btn + .btn {
|
|
|
|
|
+ margin-left: 8px;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
.farm-text {
|
|
.farm-text {
|
|
|
margin-bottom: 10px;
|
|
margin-bottom: 10px;
|
|
|
background: rgba(183, 183, 183, 0.1);
|
|
background: rgba(183, 183, 183, 0.1);
|
|
@@ -367,6 +522,12 @@ const toPage = () => {
|
|
|
font-size: 12px;
|
|
font-size: 12px;
|
|
|
color: #fff;
|
|
color: #fff;
|
|
|
}
|
|
}
|
|
|
|
|
+ ::v-deep {
|
|
|
|
|
+ .PhotoConsumer {
|
|
|
|
|
+ width: 100%;
|
|
|
|
|
+ height: 100%;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
img {
|
|
img {
|
|
|
width: 100%;
|
|
width: 100%;
|