cultivationApp/pages/landDetail/results.vue

502 lines
13 KiB
Vue
Raw Normal View History

<template>
<view class="content">
<view class="banner">
<u-swiper :list="dataobj.pic" width="100%" height="484rpx"></u-swiper>
</view>
<view class="content-con-a" v-if="Object.keys(dataobj).length>0">
<view class="shop_detail">
2023-12-17 19:34:37 +08:00
<view class="tit">
2024-02-01 18:01:18 +08:00
动物信息
</view>
<view class="shop_detail-botm">
<view class="detail">
<view class="detaila">
2024-02-01 18:01:18 +08:00
耳号
</view>
<view class="detailb">
2024-02-01 18:01:18 +08:00
{{dataobj.sn}}
</view>
</view>
2023-12-07 09:34:25 +08:00
<view class="detail">
<view class="detaila">
2024-02-01 18:01:18 +08:00
品种
2023-12-07 09:34:25 +08:00
</view>
<view class="detailb">
2024-02-01 18:01:18 +08:00
{{dataobj.brand}}
2023-12-07 09:34:25 +08:00
</view>
2023-12-02 18:37:08 +08:00
</view>
2023-12-07 09:34:25 +08:00
<view class="detail">
<view class="detaila">
2024-02-01 18:01:18 +08:00
性别
2023-12-07 09:34:25 +08:00
</view>
<view class="detailb">
2024-02-01 18:01:18 +08:00
{{dataobj.gender==1?'公':'母'}}
2023-12-07 09:34:25 +08:00
</view>
2023-12-02 18:37:08 +08:00
</view>
</view>
</view>
<view class="shop_action">
</view>
</view>
2023-12-07 09:34:25 +08:00
2024-02-01 18:01:18 +08:00
<view class="card-d" v-for="(item, index) in dataList" :key="index">
<u--form labelWidth='130' :model="item" ref="form" v-if="item.type==2">
<view class="c-title">驱虫信息</view>
<view class="c-box">
<u-form-item label="驱虫药名称" borderBottom>
<up-input readonly type="txt"
border="none" v-model="item.vermifuge_name"></up-input>
</u-form-item>
<u-form-item label="驱虫方式" borderBottom>
<up-input readonly
border="none" v-model="item.deworming_method"></up-input>
</u-form-item>
<u-form-item label="驱虫时间" borderBottom >
<up-input readonly
border="none" v-model="item.create_time"></up-input>
</u-form-item>
<swiper class="swiper" autoplay indicator-dots indicator-active-color="#ffb049" indicator-color="rgba(255,255,255,0.4)">
<swiper-item class="swiper-item" v-for="(t, index) in item.pic" :key="index">
<image class="img" :src="t"></image>
</swiper-item>
</swiper>
<u-form-item label="备注" borderBottom >
<view class="">
{{item.remark}}
</view>
</u-form-item>
</view>
</u--form>
<u--form labelWidth='130' :model="item" ref="form" v-if="item.type==3">
<view class="c-title">喂食信息</view>
<view class="c-box">
<u-form-item label="饲料种类" borderBottom>
<view style="font-weight: 600;">{{getFeedType(item.feed_type)}}</view>
</u-form-item>
<u-form-item label="饲料品牌" borderBottom>
<up-input readonly
border="none" v-model="item.feed_brand"></up-input>
</u-form-item>
<u-form-item label="饲料消耗量(kg)" borderBottom >
<up-input readonly type="number"
border="none" v-model="item.feed_consumption"></up-input>
</u-form-item>
<u-form-item label="喂食时间" borderBottom >
<up-input readonly
border="none" v-model="item.create_time"></up-input>
</u-form-item>
<swiper class="swiper" autoplay indicator-dots indicator-active-color="#ffb049" indicator-color="rgba(255,255,255,0.4)">
<swiper-item class="swiper-item" v-for="(t, index) in item.pic" :key="index">
<image class="img" :src="t"></image>
</swiper-item>
</swiper>
<u-form-item label="备注" borderBottom >
<view class="">
{{item.remark}}
</view>
</u-form-item>
</view>
</u--form>
2024-02-03 10:46:08 +08:00
<u--form labelWidth='130' :model="item" ref="form" v-if="item.type==1">
<view class="c-title">消毒信息</view>
<view class="c-box">
<u-form-item label="消毒剂名称" borderBottom>
<up-input readonly
border="none" v-model="item.disinfectant_name"></up-input>
</u-form-item>
<u-form-item label="消毒剂浓度" borderBottom>
<up-input readonly
border="none" v-model="item.concentration"></up-input>
</u-form-item>
<u-form-item label="消毒方法" borderBottom>
<up-input readonly
border="none" v-model="item.disinfectant_method"></up-input>
</u-form-item>
<u-form-item label="消毒区域" borderBottom>
<up-input readonly
border="none" v-model="item.disinfectant_area"></up-input>
</u-form-item>
<u-form-item label="消毒人员" borderBottom >
<up-input readonly
border="none" v-model="item.operator"></up-input>
</u-form-item>
<u-form-item label="消毒时间" borderBottom >
<up-input readonly
border="none" v-model="item.create_time"></up-input>
</u-form-item>
<swiper class="swiper" autoplay indicator-dots indicator-active-color="#ffb049" indicator-color="rgba(255,255,255,0.4)">
<swiper-item class="swiper-item" v-for="(item, index) in item.pic" :key="index">
<image class="img" :src="item"></image>
</swiper-item>
</swiper>
<u-form-item label="备注" borderBottom >
<view class="">
{{item.remark}}
</view>
</u-form-item>
</view>
</u--form>
<u--form labelWidth='130' :model="item" ref="form" v-if="item.type==4">
<view class="c-title">疫苗信息</view>
<view class="c-box">
<u-form-item label="疫苗名称" borderBottom>
<up-input readonly
border="none" v-model="item.vaccine_name"></up-input>
</u-form-item>
<u-form-item label="疫苗厂家" borderBottom>
<up-input readonly
border="none" v-model="item.vaccine_manufacturers"></up-input>
</u-form-item>
<u-form-item label="疫苗批次号" borderBottom>
<up-input readonly
border="none" v-model="item.vaccine_batch"></up-input>
</u-form-item>
<u-form-item label="接种方式" borderBottom >
<up-input readonly
border="none" v-model="item.vaccination_method"></up-input>
</u-form-item>
<u-form-item label="接种部位" borderBottom>
<up-input readonly
border="none" v-model="item.vaccination_site"></up-input>
</u-form-item>
<u-form-item label="免疫有限期" borderBottom >
<up-input readonly
border="none" v-model="item.immune_validity_period"></up-input>
</u-form-item>
<u-form-item label="注射人员" borderBottom >
<up-input readonly
border="none" v-model="item.operator"></up-input>
</u-form-item>
<u-form-item label="接种时间" borderBottom >
<up-input readonly
border="none" v-model="item.create_time"></up-input>
</u-form-item>
<swiper class="swiper" autoplay indicator-dots indicator-active-color="#ffb049" indicator-color="rgba(255,255,255,0.4)">
<swiper-item class="swiper-item" v-for="(item, index) in item.pic" :key="index">
<image class="img" :src="item"></image>
</swiper-item>
</swiper>
<u-form-item label="备注" borderBottom >
<view class="">
{{item.remark}}
</view>
</u-form-item>
</view>
</u--form>
<u--form labelWidth='130' :model="item" ref="form" v-if="item.type==5">
<view class="c-title">喂水信息</view>
<view class="c-box">
<u-form-item label="喂水量(L)" borderBottom>
<up-input readonly
border="none" v-model="item.water_consumption"></up-input>
</u-form-item>
<u-form-item label="喂水人员" borderBottom >
<up-input readonly
border="none" v-model="item.operator"></up-input>
</u-form-item>
<u-form-item label="喂水时间" borderBottom >
<up-input readonly
border="none" v-model="item.create_time"></up-input>
</u-form-item>
<swiper class="swiper" autoplay indicator-dots indicator-active-color="#ffb049" indicator-color="rgba(255,255,255,0.4)">
<swiper-item class="swiper-item" v-for="(item, index) in item.pic" :key="index">
<image class="img" :src="item"></image>
</swiper-item>
</swiper>
<u-form-item label="备注" borderBottom >
<view class="">
{{item.remark}}
</view>
</u-form-item>
</view>
</u--form>
2024-02-01 18:01:18 +08:00
</view>
2023-12-07 09:34:25 +08:00
</view>
</template>
<script setup>
import {
ref,
reactive
} from "vue"
2024-02-01 18:01:18 +08:00
import {
feedingTypeLists
} from "@/api/dict.js"
import {
onLoad,
2024-02-03 10:46:08 +08:00
onReady,
onReachBottom
} from "@dcloudio/uni-app"
2024-02-01 18:01:18 +08:00
import {
fenceHouseDetail,
animalInfoList,
operationLogIndex,
animalInfoDetail
} from "@/api/manage.js"
import {
suYuanData
} from "@/api/index.js"
const task_id = ref('');
2024-02-01 18:01:18 +08:00
const sn = ref('');
const dataobj = reactive({})
const daysDiff = ref('');
2023-12-07 09:34:25 +08:00
onLoad((options) => {
2024-02-03 11:32:32 +08:00
sn.value = options.sn;
2024-02-22 15:20:36 +08:00
where.value.animal_sn = sn.value;
2024-02-03 11:32:32 +08:00
// sn.value = 8;
2024-02-01 18:01:18 +08:00
getFenceHouseDetail();
getSuYuanData();
})
2024-02-03 10:46:08 +08:00
onReachBottom(()=>{
where.value.page_no++;
getSuYuanData();
})
//获取详情
2024-02-01 18:01:18 +08:00
const getFenceHouseDetail = () => {
animalInfoDetail({
2024-02-03 11:32:32 +08:00
sn: sn.value,
2024-02-01 18:01:18 +08:00
}).then((res) => {
if (res.code == 1) {
res.data.pic = JSON.parse(res.data.pic||'[]');
Object.assign(dataobj, res.data);
}
});
};
2024-02-01 18:01:18 +08:00
const feedType = ref([]);
const initFeedingTypeLists = ()=>{
feedingTypeLists().then(res=>{
feedType.value = res.data;
})
}
const getFeedType = (value)=>{
return feedType.value.find(item=>item.value==value)?.name||'';
}
initFeedingTypeLists();
const where = ref({
2024-02-22 15:20:36 +08:00
animal_sn: '',
2024-02-01 18:01:18 +08:00
page_no: 1,
page_size: 10
})
const dataList = ref([]);
// 操作列表
const getSuYuanData = ()=>{
suYuanData(where.value).then(res=>{
if(res.data.lists.length<=0) return ;
res.data.lists = res.data.lists.map(item=>{
item = {
...item,
...item.detail,
};
if(item.pic) item.pic = JSON.parse(item.pic);
return item;
})
dataList.value = [...dataList.value, ...res.data.lists];
})
}
//查看图片
const perviewFn = (url) => {
uni.previewImage({
2023-12-07 09:34:25 +08:00
urls: url
})
}
2024-02-01 18:01:18 +08:00
</script>
<style lang="scss">
page {
background-color: $theme-bg-color;
}
.content {
padding-top: 30rpx;
padding-bottom: 30rpx;
.banner {
width: 694rpx;
height: 484rpx;
margin: 0 auto;
}
.content-con-a {
padding: 0 32rpx;
margin-top: 30rpx;
2024-02-01 18:01:18 +08:00
.tit {
position: relative;
padding-left: 20rpx;
font-weight: bold;
margin-bottom: 20rpx;
}
.tit::before {
content: "";
position: absolute;
top: 50%;
transform: translateY(-50%);
left: 0;
width: 3px;
/* 左边框的宽度 */
height: 30rpx;
background-color: #FFB049;
}
.shop_detail {
.shop_detail-top {
margin-bottom: 28rpx;
}
.shop_detail-botm {
width: 694rpx;
padding: 35rpx 0;
2023-12-17 19:34:37 +08:00
background: white;
border-radius: 21rpx 21rpx;
2023-12-17 19:34:37 +08:00
box-shadow: 1rpx 1rpx 10rpx 1rpx rgba(0, 0, 0, 0.1);
.detail {
display: flex;
margin-bottom: 35rpx;
margin-left: 35rpx;
.detaila {
width: 200rpx;
}
.detailb {
width: 500rpx;
}
}
}
}
.shop_action {
margin-top: 42rpx;
.shop_action-title {
font-size: 33rpx;
font-family: PingFang SC, PingFang SC;
font-weight: 500;
color: #333333;
margin-bottom: 28rpx;
}
.shop_action-detail {
width: 694rpx;
padding: 35rpx 0;
background: #FFFFFF;
border-radius: 21rpx 21rpx;
margin-bottom: 30rpx;
2023-12-17 19:34:37 +08:00
box-shadow: 1rpx 1rpx 10rpx 1rpx rgba(0, 0, 0, 0.1);
.action-detail {
display: flex;
padding-left: 35rpx;
margin-bottom: 25rpx;
.title {
width: 200rpx;
}
.detail {
width: 500rpx
}
}
.action-detail-img {
padding-left: 35rpx;
margin-bottom: 30rpx;
.title {
margin-bottom: 30rpx;
}
.detail-img {
width: 627rpx;
2023-12-17 19:34:37 +08:00
// height: 529rpx;
2023-12-07 09:34:25 +08:00
image {
width: 100%;
height: 100%;
}
}
}
}
}
}
}
2023-12-17 19:34:37 +08:00
2024-02-01 18:01:18 +08:00
.card-d {
background-color: #fffcf5;
.c-title {
font-weight: bold;
display: flex;
align-items: center;
padding: 30rpx;
padding-bottom: 15rpx;
&:before {
content: '';
display: inline-block;
height: 0.8rem;
width: 6rpx;
margin-top: 0.2rem;
margin-right: 10rpx;
background-color: #feb048;
border-radius: 6rpx;
}
}
.c-box {
background-color: #fff;
padding: 20rpx;
margin: 28rpx;
margin-top: 0;
border-radius: 14rpx;
box-shadow: 0px 2px 8px rgba(0, 0, 0, 0.1);
}
.c-box-p {
padding: 20rpx;
}
.btn {
margin: 20rpx auto;
width: 694rpx;
height: 80rpx;
border-radius: 80rpx;
background-color: #feb048;
color: #fff;
}
}
.swiper{
width: 654rpx;
height: 400rpx;
margin: 20rpx 0;
border-radius: 14rpx;
overflow: hidden;
.img{
width: 100%;
height: 100%;
}
}
:deep(.u-form-item__body){
padding: 5rpx 0 !important;
}
</style>