| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327 |
- <template>
- <el-dialog v-model="winDialogVisible" lock-scroll modal-class="album-detail-modal" :showClose="false" width="86%" align-center @close="closeDialog">
- <div class="detail-log">
- <div class="congratulation-wrap">
- <div class="congratulation-box">
- <div class="win-des">
- <!-- <img src="@/assets/img/weather_index/box-top.png" class="win-icon" /> -->
- </div>
- <div class="album-detail-box">
- <div class="detail-title">{{ dialogData.farmWorkName }}</div>
- <div class="detail-desc-box">
- <!-- <div class="desc-item" v-if="dialogData?.conditionList && dialogData.conditionList.length">
- <span class="item-name">{{ $t('触发条件') }}</span>
- {{ dialogData.condition || dialogData.conditionList[0].name + dialogData.conditionList[0].value }}
- </div> -->
- <div class="desc-item">
- <span class="item-name">{{ $t('农事编号') }}</span>
- {{ dialogData.code }}
- </div>
- <div class="desc-item">
- <span class="item-name">{{ $t('推荐时间') }}</span>
- {{ dialogData.executeDate }}
- </div>
- <!-- <div class="desc-item">
- <span class="item-name">{{ $t('农事宗旨') }}</span>
- {{ dialogData.purpose || dialogData.condition }}
- </div> -->
- <div class="desc-item">
- <div class="item-name">{{ $t('药物处方') }}</div>
- <div class="item-table">
- <el-table :data="pesticideFertilizers" style="width: 100%" :header-cell-style="{background: '#F5F5F5'}">
- <el-table-column prop="pesticideFertilizerCode" :label="$t('类型')" width="62">
- <template #default="scope">
- {{scope.row.typeName}}
- </template>
- </el-table-column>
- <el-table-column prop="defaultName" :label="$t('名称')" />
- <!-- <el-table-column prop="ratio" :label="$t('配比')" width="50">
- <template #default="scope">
- {{scope.row.ratio ? scope.row.ratio : "--"}}
- </template>
- </el-table-column> -->
- <el-table-column prop="ratio" :label="$t('方式')" width="62">
- <template #default="scope">
- {{scope.row.executeStyle ? (scope.row.executeStyle === 2 ? "无人机" : "人工") : "--"}}
- </template>
- </el-table-column>
- </el-table>
- </div>
- </div>
- <div class="card-link">
- <img :src="dialogData.expertIcon || dialogData.expertUserIcon" />
- <div class="expert-name">
- {{ dialogData.expertUserName || dialogData.expertName }}
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- <div class="close-btn" v-show="dialogData.isBtn" @click.stop="winDialogVisible=false">
- <!-- <el-icon size="32" color="#fff"><CircleCloseFilled /></el-icon> -->
- <el-button v-show="dialogData.typeStr === 'export'" type="primary" class="one-btn" @click.stop="toPage">{{ $t('邀请专家诊断') }}</el-button>
- <el-button v-show="dialogData.typeStr === 'activate'" type="primary" class="one-btn" @click.stop="handleAct">{{ $t('立即激活专家农事') }}</el-button>
- <!-- <el-button type="primary" class="one-btn" @click.stop="toShare">{{ $t('立即分享') }}</el-button> -->
- </div>
- </div>
- <template #footer>
- <div class="dialog-footer">
- <div class="close-btn">
- <!-- <el-icon size="32" color="#fff"><CircleCloseFilled /></el-icon> -->
- <!-- <el-button type="primary" class="one-btn" @click="toShare">{{ $t('立即分享') }}</el-button> -->
- </div>
- </div>
- </template>
- </el-dialog>
- </template>
- <script setup>
- import { onActivated, onDeactivated, onMounted, ref } from "vue";
- import eventBus from "@/api/eventBus";
- import wx from "weixin-js-sdk";
- import { useRoute, useRouter } from "vue-router";
- const props = defineProps({
- initReload: {
- type: Boolean,
- default: false
- }
- })
- const winDialogVisible = ref(false);
- const route = useRoute();
- const router = useRouter();
- const sampleId = route.query.sampleId
- const farmId = route.query.farmId;
- const dialogData = ref({});
- const currentCard = ref({});
- const showDialog = (pageParams) => {
- dialogData.value = pageParams.card;
- currentCard.value = {
- activeIndex: pageParams.activeIndex,
- farmWorkName: dialogData.value.farmWorkName,
- farmId: farmId,
- sampleId: sampleId,
- };
- settingData()
- winDialogVisible.value = true;
- };
- onMounted(() => {
- if (props.initReload) {
- eventBus.on("detailDialog:showDialog", showDialog);
- }
- })
- onActivated(()=>{
- eventBus.on("detailDialog:showDialog", showDialog);
- })
- onDeactivated(()=>{
- eventBus.off("detailDialog:showDialog", showDialog);
- })
- //邀请专家诊断
- const toPage = () =>{
- router.push('/prescription')
- }
- //立即激活
- const handleAct = () =>{
- winDialogVisible.value = false
- eventBus.emit("uploadUopup:show",{gardenIdVal:dialogData.value.farmId,orderIdVal:dialogData.value.orderId,textVal:dialogData.value.consequenceText});
- }
- // 弹窗关闭
- eventBus.on("detailDialog:toCloseDialog", closeDialog);
- const pesticideFertilizers = ref([])
- const settingData = () => {
- pesticideFertilizers.value = flattenDomains(dialogData.value.prescriptionList)
- };
- function flattenDomains(data) {
- return data.reduce((acc, item) => {
- return acc.concat(item.pesticideFertilizerList);
- }, []);
- }
- function closeDialog() {
- winDialogVisible.value = false
- eventBus.emit("detailDialog:closeDialog")
- }
- const toShare = () => {
- wx.miniProgram.navigateTo({
- url: `/pages/subPages/share_page/index?pageParams=${JSON.stringify(currentCard.value)}&type=album`,
- });
- }
- </script>
- <style lang="less" scoped>
- .congratulation-wrap {
- border-radius: 12px;
- background: #f4f5f4;
- width: 100%;
- }
- .detail-log {
- width: 100%;
- }
- .close-btn {
- text-align: center;
- margin-top: 20px;
- }
- .congratulation-box {
- border-radius: 12px;
- background: url("@/assets/img/weather_index/box-top.png") no-repeat top center /contain;
- .el-message-box__message {
- padding: 12px 0 24px 0;
- }
- .win-title {
- color: #1d1e1f;
- font-family: "PangMenZhengDao", sans-serif; /* 使用自定义字体 */
- text-align: center;
- font-size: 24px;
- line-height: 32px;
- }
- .win-detail {
- text-align: center;
- color: #252525;
- padding-top: 6px;
- font-size: 16px;
- span {
- font-size: 22px;
- color: #2199f8;
- padding: 0 6px;
- font-weight: bold;
- }
- }
- .win-des {
- height: 180px;
- text-align: center;
- }
- .win-icon {
- width: 100%;
- border-radius: 12px 12px 0 0;
- }
- }
- .album-detail-box {
- padding: 0 10px 16px 10px;
- color: #000;
- position: relative;
- // top: -58px;
- .detail-title {
- font-size: 24px;
- font-weight: bold;
- padding-bottom: 8px;
- letter-spacing: 1.6px;
- }
- .detail-desc-box {
- position: relative;
- .desc-item {
- font-size: 14px;
- .item-name {
- color: #999999;
- margin-right: 12px;
- }
- .item-table {
- margin-top: 8px;
- border: 1px solid rgba(255, 255, 255, 0.6);
- border-radius: 4px;
- ::v-deep {
- .el-table th.el-table__cell {
- padding: 6px 0;
- }
- .el-table--default .el-table__cell {
- padding: 6px 0;
- }
- .el-table--default .cell {
- padding: 0px 6px;
- }
- }
- }
- }
- .desc-item + .desc-item {
- padding-top: 8px;
- }
- .card-link {
- display: flex;
- flex-direction: column;
- align-items: center;
- justify-content: center;
- color: #2199f8;
- font-size: 12px;
- position: absolute;
- right: 6px;
- top: 0px;
- .expert-name {
- background: #d3e8ff;
- border-radius: 4px;
- padding: 1px 12px;
- margin-top: 4px;
- display: flex;
- align-items: center;
- }
- img {
- width: 62px;
- height: 62px;
- border-radius: 50%;
- object-fit: cover;
- }
- .icon {
- padding-right: 2px;
- }
- }
- }
- }
- .dialog-footer {
- position: relative;
- .close-btn {
- position: absolute;
- bottom: -58px;
- left: 0;
- right: 0;
- margin: 0 auto;
- text-align: center;
- }
- }
- </style>
- <style lang="less">
- .album-detail-modal {
- .el-overlay-dialog {
- .el-dialog {
- padding: 0;
- border-radius: 12px;
- background: none;
- box-shadow: none;
- margin-bottom: 70px;
- margin-top: 10px;
- overflow: auto;
- scrollbar-width: none;
- display: flex;
- flex-direction: column;
- align-items: center;
- justify-content: center;
- pointer-events: none;
- .el-dialog__header {
- padding: 0;
- }
- .el-dialog__body {
- pointer-events: all;
- width: 100%;
- }
- }
- .one-btn {
- width: 210px;
- height: 40px;
- line-height: 40px;
- }
- }
- }
- </style>
|