This commit is contained in:
weipengfei 2024-01-30 18:31:10 +08:00
parent 6997b3aa62
commit 1e157c58bc
19 changed files with 815 additions and 369 deletions

View File

@ -18,3 +18,6 @@ export const animalTypeLists = () => syhttp.get('/common/dict_data_lists_by_type
//饲料类型 //饲料类型
export const feedingTypeLists = () => syhttp.get('/common/dict_data_lists_by_type_value', {type_value: 'feeding_type'}); export const feedingTypeLists = () => syhttp.get('/common/dict_data_lists_by_type_value', {type_value: 'feeding_type'});
//离栏类型
export const leaveFenceHouseTypeLists = () => syhttp.get('/common/dict_data_lists_by_type_value', {type_value: 'leave_fence_house_type'});

View File

@ -14,6 +14,9 @@ export const fenceHouseDetail = (data) => syhttp.get('/fence_house/detail', data
//新增养殖 //新增养殖
export const animalInfoAdd = (data) => syhttp.post('/animal_info/add', data); export const animalInfoAdd = (data) => syhttp.post('/animal_info/add', data);
//养殖详情
export const animalInfoDetail = (data) => syhttp.get('/animal_info/detail', data);
//新增驱虫 //新增驱虫
export const dewormingLogAdd = (data) => syhttp.post('/suyuan_operation.operation_deworming_log/add', data); export const dewormingLogAdd = (data) => syhttp.post('/suyuan_operation.operation_deworming_log/add', data);
@ -29,8 +32,36 @@ export const waterLogAdd = (data) => syhttp.post('/suyuan_operation.operation_wa
//新增打疫苗 //新增打疫苗
export const vaccinumLogAdd = (data) => syhttp.post('/suyuan_operation.operation_vaccinum_log/add', data); export const vaccinumLogAdd = (data) => syhttp.post('/suyuan_operation.operation_vaccinum_log/add', data);
//驱虫列表
export const dewormingLogLists = (data) => syhttp.get('/suyuan_operation.operation_deworming_log/lists', data);
//消毒列表
export const disinfectLogLists = (data) => syhttp.get('/suyuan_operation.operation_disinfect_log/lists', data);
//喂食列表
export const feedingLogLists = (data) => syhttp.get('/suyuan_operation.operation_feeding_log/lists', data);
//喂水列表
export const waterLogLists = (data) => syhttp.get('/suyuan_operation.operation_water_log/lists', data);
//打疫苗列表
export const vaccinumLogLists = (data) => syhttp.get('/suyuan_operation.operation_vaccinum_log/lists', data);
//养殖列表 //养殖列表
export const animalInfoList = (data) => syhttp.get('/animal_info/lists', data); export const animalInfoList = (data) => syhttp.get('/animal_info/lists', data);
//喂养信息列表 //喂养信息列表
export const operationLogIndex = (data) => syhttp.get('/operation_log/index', data); export const operationLogIndex = (data) => syhttp.get('/operation_log/index', data);
//离栏登记
export const fenceHouseLeave = (data) => syhttp.post('/fence_house/leave', data);
//离栏信息列表
export const fenceHouseLeaveList = (data) => syhttp.get('/fence_house/leaveList', data);
//转栏登记
export const fenceHouseExchange = (data) => syhttp.post('/fence_house/exchange', data);
//转栏信息列表
export const fenceHouseExchangeList = (data) => syhttp.get('/fence_house/exchangeList', data);

View File

@ -1,47 +1,48 @@
<template> <template>
<view class="" style="margin-top: 10rpx;"> <view class="" style="margin-top: 10rpx;">
<view class="" style="display: flex;align-items: center;height: 60rpx;"> <view v-if="info.fenceHouseAttr" class="" style="display: flex;align-items: center;height: 60rpx;">
<u-icon name="map"></u-icon> <u-icon name="map"></u-icon>
栏舍一号 {{info.fenceHouseAttr.fence_house_name}}
</view> </view>
<view class="info"> <view class="info">
<view class="info-li" style="background-image: url('/static/main/house/dong_wu_ming_cheng.png');"> <view class="info-li" style="background-image: url('/static/main/house/dong_wu_ming_cheng.png');">
耳号 耳号
<view class=""> <view class="">
黑山羊 {{info.sn}}
</view> </view>
</view> </view>
<view class="info-li" style="background-image: url('/static/main/house/dong_wu_lei_xing.png');"> <view class="info-li" style="background-image: url('/static/main/house/dong_wu_lei_xing.png');">
品类 品类
<view class=""> <view class="">
哺乳动物 {{getAnimalType(info.animal_type)}}
</view> </view>
</view> </view>
<view class="info-li" style="background-image: url('/static/main/house/lan_she_rong_liang.png');"> <view class="info-li" style="background-image: url('/static/main/house/lan_she_rong_liang.png');">
品种 品种
<view class=""> <view class="">
50 {{info.brand}}
</view> </view>
</view> </view>
<view class="info-li" style="background-image: url('/static/main/house/lan_she_fu_ze_ren.png');"> <view class="info-li" style="background-image: url('/static/main/house/lan_she_fu_ze_ren.png');">
生理阶段 生理阶段
<view class=""> <view class="">
赵桑 {{info.physi_stage}}
</view> </view>
</view> </view>
<view class="info-li" style="background-image: url('/static/main/house/dian_hua.png');"> <view class="info-li" style="background-image: url('/static/main/house/dian_hua.png');">
体重 体重
<view class=""> <view class="">
20kg {{info.current_estimation}}kg
</view> </view>
</view> </view>
<view class="info-li" style="background-image: url('/static/main/house/dian_hua.png');"> <view class="info-li-d"></view>
<!-- <view class="info-li" style="background-image: url('/static/main/house/dian_hua.png');">
健康状况 健康状况
<view class=""> <view class="">
健康 健康
</view> </view>
</view> </view> -->
</view> </view>
</view> </view>
@ -50,14 +51,29 @@
<script setup> <script setup>
import { import {
reactive, reactive,
watch watch,
ref
} from "vue"; } from "vue";
import {
animalTypeLists
} from "@/api/dict.js"
const props = defineProps({ const props = defineProps({
info: Object, info: Object,
isDetail: Boolean isDetail: Boolean
}) })
const animal_type_lists = ref([])
const initAnimalTypeLists = ()=>{
animalTypeLists().then(res=>{
animal_type_lists.value = res.data;
})
}
initAnimalTypeLists();
const getAnimalType = (type)=>{
return animal_type_lists.value.find(item=>item.value==type)?.name||'';
}
const perviewFn = (url) => { const perviewFn = (url) => {

View File

@ -9,7 +9,7 @@ let HTTP_REQUEST_URL
let HEADER let HEADER
if (env == 'dev') { if (env == 'dev') {
BASE_URL = 'https://ceshi-suyuan-breed.lihaink.cn/' BASE_URL = 'https://ceshi-suyuan-breed.lihaink.cn/'
// BASE_URL = 'http://192.168.1.25:8084/' // BASE_URL = 'http://192.168.1.24:8084/'
} else if (env = 'prod') { } else if (env = 'prod') {
BASE_URL = 'http://ceshi-suyuan.lihaink.cn/' BASE_URL = 'http://ceshi-suyuan.lihaink.cn/'
} }

View File

@ -6,7 +6,7 @@
<view class="c-title">消毒信息</view> <view class="c-title">消毒信息</view>
<view class="c-box"> <view class="c-box">
<u-form-item label="消毒剂名称" prop="disinfectant_name" borderBottom required> <u-form-item label="消毒剂名称" prop="disinfectant_name" borderBottom required>
<up-input input-align="right" placeholder="请输入消毒剂名称" :disabled="mode=='detail'" type="txt" border="none" <up-input input-align="right" placeholder="请输入消毒剂名称" :disabled="mode=='detail'" border="none"
v-model="formData.disinfectant_name"></up-input> v-model="formData.disinfectant_name"></up-input>
</u-form-item> </u-form-item>
<u-form-item label="消毒剂浓度" prop="concentration" borderBottom required> <u-form-item label="消毒剂浓度" prop="concentration" borderBottom required>
@ -14,7 +14,7 @@
v-model="formData.concentration"></up-input> v-model="formData.concentration"></up-input>
</u-form-item> </u-form-item>
<u-form-item label="消毒方法" prop="disinfectant_method" borderBottom required> <u-form-item label="消毒方法" prop="disinfectant_method" borderBottom required>
<up-input input-align="right" placeholder="请输入消毒方法" :disabled="mode=='detail'" type="number" border="none" <up-input input-align="right" placeholder="请输入消毒方法" :disabled="mode=='detail'" border="none"
v-model="formData.disinfectant_method"></up-input> v-model="formData.disinfectant_method"></up-input>
</u-form-item> </u-form-item>
<up-form-item label="消毒区域" prop="disinfectant_area" borderBottom required @click="showFun=true"> <up-form-item label="消毒区域" prop="disinfectant_area" borderBottom required @click="showFun=true">
@ -22,7 +22,7 @@
suffix-icon-style="color: #b6b6b6;" v-model="formData.disinfectant_area" readonly></up-input> suffix-icon-style="color: #b6b6b6;" v-model="formData.disinfectant_area" readonly></up-input>
</up-form-item> </up-form-item>
<u-form-item label="消毒人员" prop="operator" borderBottom required> <u-form-item label="消毒人员" prop="operator" borderBottom required>
<up-input input-align="right" placeholder="请输入消毒人员姓名" :disabled="mode=='detail'" type="number" border="none" <up-input input-align="right" placeholder="请输入消毒人员姓名" :disabled="mode=='detail'" border="none"
v-model="formData.operator"></up-input> v-model="formData.operator"></up-input>
</u-form-item> </u-form-item>
<!-- <u-form-item label="消毒时间" prop="disinfectant_date" @click="openDate" borderBottom required> <!-- <u-form-item label="消毒时间" prop="disinfectant_date" @click="openDate" borderBottom required>
@ -97,6 +97,9 @@
import { import {
addaction addaction
} from '@/api/api.js' } from '@/api/api.js'
import {
disinfectLogAdd
} from "@/api/manage.js"
const form = ref(null) const form = ref(null)
const task_id = ref(''); const task_id = ref('');
const pic = reactive([]); const pic = reactive([]);
@ -145,8 +148,9 @@
} }
const showFun = ref(false); const showFun = ref(false);
// const disinfectant_area = ref('');
const selectFun = (e)=>{ const selectFun = (e)=>{
formData.deworming_method = e.name; formData.disinfectant_area = e.name;
} }
onReady(() => { onReady(() => {
@ -176,23 +180,16 @@
form.value.validate().then(res => { form.value.validate().then(res => {
console.log(res) console.log(res)
if (res) { if (res) {
formData.pic = pic if (pic.length == 0) {
let data1 = {
plant_id: task_id.value,
type: 5,
detail: JSON.stringify(formData)
};
if (formData.pic.length == 0) {
uni.$u.toast('请上传图片') uni.$u.toast('请上传图片')
return return
} }
console.log('表单通过'); formData.pic = JSON.stringify(pic)
// //
addaction(data1).then((res) => { disinfectLogAdd(formData).then((res) => {
console.log(res) console.log(res)
if (res.code == 1) { if (res.code == 1) {
uni.$u.toast(res.msg) uni.$u.toast(res.msg)

View File

@ -6,28 +6,28 @@
<view class="c-box"> <view class="c-box">
<u-form-item label="驱虫药名称" borderBottom> <u-form-item label="驱虫药名称" borderBottom>
<up-input readonly type="txt" <up-input readonly type="txt"
border="none" v-model="formData.user"></up-input> border="none" v-model="formData.vermifuge_name"></up-input>
</u-form-item> </u-form-item>
<u-form-item label="驱虫方式" borderBottom> <u-form-item label="驱虫方式" borderBottom>
<up-input readonly type="number" <up-input readonly
border="none" v-model="formData.breed"></up-input> border="none" v-model="formData.deworming_method"></up-input>
</u-form-item> </u-form-item>
<u-form-item label="操作人员" borderBottom > <!-- <u-form-item label="操作人员" borderBottom >
<up-input readonly type="number" <up-input readonly
border="none" v-model="formData.breed"></up-input> border="none" v-model="formData.breed"></up-input>
</u-form-item> </u-form-item> -->
<u-form-item label="驱虫时间" borderBottom > <u-form-item label="驱虫时间" borderBottom >
<up-input type="number" readonly <up-input readonly
border="none" v-model="formData.breed"></up-input> border="none" v-model="formData.create_time"></up-input>
</u-form-item> </u-form-item>
<swiper class="swiper" autoplay indicator-dots indicator-active-color="#ffb049" indicator-color="rgba(255,255,255,0.4)"> <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 2" :key="index"> <swiper-item class="swiper-item" v-for="(item, index) in formData.pic" :key="index">
<image class="img" src="https://lihai001.oss-cn-chengdu.aliyuncs.com/def/91fb0202311021455371420.jpg"></image> <image class="img" :src="item"></image>
</swiper-item> </swiper-item>
</swiper> </swiper>
<u-form-item label="备注" borderBottom > <u-form-item label="备注" borderBottom >
<view class=""> <view class="">
{{formData.remark}}
</view> </view>
</u-form-item> </u-form-item>
</view> </view>
@ -40,19 +40,22 @@
<script setup> <script setup>
import { import {
reactive, reactive,
ref ref,
getCurrentInstance
} from "vue"; } from "vue";
import { import {
onLoad, onLoad,
onReady onReady
} from "@dcloudio/uni-app" } from "@dcloudio/uni-app"
const formData = reactive({ const formData = reactive({})
user: "",
remark: "", onLoad(function(options){
pic: [], const eventChannel = getCurrentInstance().proxy.getOpenerEventChannel();
start_date: '', eventChannel.on('setDatasItem', function(data) {
notes: '' console.log(data);
Object.assign(formData, data)
})
}) })
</script> </script>

View File

@ -5,33 +5,33 @@
<view class="c-title">喂食信息</view> <view class="c-title">喂食信息</view>
<view class="c-box"> <view class="c-box">
<u-form-item label="饲料种类" borderBottom> <u-form-item label="饲料种类" borderBottom>
<up-input readonly type="txt" <up-input readonly
border="none" v-model="formData.user"></up-input> border="none" v-model="formData.feed_type_name"></up-input>
</u-form-item> </u-form-item>
<u-form-item label="饲料品牌" borderBottom> <u-form-item label="饲料品牌" borderBottom>
<up-input readonly type="number" <up-input readonly
border="none" v-model="formData.breed"></up-input> border="none" v-model="formData.feed_brand"></up-input>
</u-form-item> </u-form-item>
<u-form-item label="饲料消耗量(kg)" borderBottom > <u-form-item label="饲料消耗量(kg)" borderBottom >
<up-input readonly type="number" <up-input readonly type="number"
border="none" v-model="formData.breed"></up-input> border="none" v-model="formData.feed_consumption"></up-input>
</u-form-item> </u-form-item>
<u-form-item label="喂养人员" borderBottom > <!-- <u-form-item label="喂养人员" borderBottom >
<up-input readonly type="number" <up-input readonly type="number"
border="none" v-model="formData.breed"></up-input> border="none" v-model="formData.breed"></up-input>
</u-form-item> </u-form-item> -->
<u-form-item label="喂食时间" borderBottom > <u-form-item label="喂食时间" borderBottom >
<up-input type="number" readonly <up-input readonly
border="none" v-model="formData.breed"></up-input> border="none" v-model="formData.create_time"></up-input>
</u-form-item> </u-form-item>
<swiper class="swiper" autoplay indicator-dots indicator-active-color="#ffb049" indicator-color="rgba(255,255,255,0.4)"> <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 2" :key="index"> <swiper-item class="swiper-item" v-for="(item, index) in formData.pic" :key="index">
<image class="img" src="https://lihai001.oss-cn-chengdu.aliyuncs.com/def/91fb0202311021455371420.jpg"></image> <image class="img" :src="item"></image>
</swiper-item> </swiper-item>
</swiper> </swiper>
<u-form-item label="备注" borderBottom > <u-form-item label="备注" borderBottom >
<view class=""> <view class="">
{{formData.remark}}
</view> </view>
</u-form-item> </u-form-item>
</view> </view>
@ -44,19 +44,36 @@
<script setup> <script setup>
import { import {
reactive, reactive,
ref ref,
getCurrentInstance
} from "vue"; } from "vue";
import { import {
onLoad, onLoad,
onReady onReady
} from "@dcloudio/uni-app" } from "@dcloudio/uni-app"
import {
feedingTypeLists
} from "@/api/dict.js"
const feedType = ref([]);
const initFeedingTypeLists = ()=>{
feedingTypeLists().then(res=>{
feedType.value = res.data;
formData.feed_type_name = getType(formData.feed_type);
})
}
const getType = (value)=>{
return feedType.value.find(item=>item.value==value)?.name||'';
}
const formData = reactive({ const formData = reactive({})
user: "",
remark: "", onLoad(function(options){
pic: [], const eventChannel = getCurrentInstance().proxy.getOpenerEventChannel();
start_date: '', eventChannel.on('setDatasItem', function(data) {
notes: '' Object.assign(formData, data)
initFeedingTypeLists();
})
}) })
</script> </script>

View File

@ -5,19 +5,19 @@
<view class="c-title">转栏信息</view> <view class="c-title">转栏信息</view>
<view class="c-box"> <view class="c-box">
<u-form-item label="耳号" prop="formData.breed" borderBottom required> <u-form-item label="耳号" prop="animal_sn" borderBottom required>
<up-input input-align="right" placeholder="请输入耳号" :disabled="mode=='detail'" border="none" <up-input input-align="right" placeholder="请输入耳号" :disabled="mode=='detail'" border="none"
v-model="formData.breed"></up-input> v-model="formData.animal_sn"></up-input>
</u-form-item> </u-form-item>
<up-form-item label="转出栏舍" prop="master_name" borderBottom required @click="showFun=true"> <up-form-item label="转出栏舍" prop="old_fence_house_id" borderBottom required @click="showFun=true">
<up-input input-align="right" placeholder="请选择转出栏舍" border="none" suffixIcon="arrow-down" <up-input input-align="right" placeholder="请选择转出栏舍" border="none" suffixIcon="arrow-down"
suffix-icon-style="color: #b6b6b6;" v-model="formData.fun" readonly></up-input> suffix-icon-style="color: #b6b6b6;" v-model="old_fence_house_id" readonly></up-input>
</up-form-item> </up-form-item>
<up-form-item label="转入栏舍" prop="master_name" borderBottom required @click="showPart=true"> <up-form-item label="转入栏舍" prop="new_fence_house_id" borderBottom required @click="showPart=true">
<up-input input-align="right" placeholder="请选择转入栏舍" border="none" suffixIcon="arrow-down" <up-input input-align="right" placeholder="请选择转入栏舍" border="none" suffixIcon="arrow-down"
suffix-icon-style="color: #b6b6b6;" v-model="formData.part" readonly></up-input> suffix-icon-style="color: #b6b6b6;" v-model="new_fence_house_id" readonly></up-input>
</up-form-item> </up-form-item>
<u-form-item label="操作人员" prop="start_date" borderBottom required> <!-- <u-form-item label="操作人员" prop="start_date" borderBottom required>
<up-input input-align="right" placeholder="请输入操作人员姓名" :disabled="mode=='detail'" border="none" <up-input input-align="right" placeholder="请输入操作人员姓名" :disabled="mode=='detail'" border="none"
v-model="formData.breed"></up-input> v-model="formData.breed"></up-input>
</u-form-item> </u-form-item>
@ -25,7 +25,7 @@
<up-input input-align="right" placeholder="请选择时间" suffixIcon="arrow-down" <up-input input-align="right" placeholder="请选择时间" suffixIcon="arrow-down"
suffix-icon-style="color: #b6b6b6;" readonly border="none" v-model="formData.start_date" suffix-icon-style="color: #b6b6b6;" readonly border="none" v-model="formData.start_date"
style="pointer-events: none;"></up-input> style="pointer-events: none;"></up-input>
</u-form-item> </u-form-item> -->
</view> </view>
<view class="c-title">备注信息</view> <view class="c-title">备注信息</view>
@ -35,13 +35,12 @@
</u-form-item> </u-form-item>
</view> </view>
</u--form> </u--form>
<u-button class="btn" v-if="mode=='add'" @click="addFn">完成添加</u-button> <u-button class="btn" v-if="mode=='add'" @click="addFn">完成添加</u-button>
</view> </view>
<u-action-sheet :show="showFun" keyName="name" closeOnClickOverlay :actions="[{name:'栏舍1'}, {name:'栏舍2'}]" title="请选择接种方式" <u-action-sheet :show="showFun" keyName="name" closeOnClickOverlay :actions="house_list" title="请选择转出栏舍"
@close="showFun = false" @select="selectFun"></u-action-sheet> @close="showFun = false" @select="selectFun"></u-action-sheet>
<u-action-sheet :show="showPart" keyName="name" closeOnClickOverlay :actions="[{name:'栏舍1'}, {name:'栏舍2'}]" title="请选择接种部位" <u-action-sheet :show="showPart" keyName="name" closeOnClickOverlay :actions="house_list" title="请选择转入栏舍"
@close="showPart = false" @select="selectPart"></u-action-sheet> @close="showPart = false" @select="selectPart"></u-action-sheet>
<u-datetime-picker :show="show1" :max-date="getNowTime()" v-model="value1" mode="datetime" @confirm="dateConfirmfn" <u-datetime-picker :show="show1" :max-date="getNowTime()" v-model="value1" mode="datetime" @confirm="dateConfirmfn"
:formatter="formatter" @cancel="show1=false"></u-datetime-picker> :formatter="formatter" @cancel="show1=false"></u-datetime-picker>
@ -64,16 +63,20 @@
import { import {
addaction addaction
} from '@/api/api.js' } from '@/api/api.js'
import {
fenceHouseExchange,
fenceHouseList
} from "@/api/manage.js"
const form = ref(null) const form = ref(null)
const task_id = ref(''); const task_id = ref('');
const pic = reactive([]); const pic = reactive([]);
const show1 = ref(false) const show1 = ref(false)
const formData = reactive({ const formData = reactive({
user: "", animal_sn: "",
old_fence_house_id: "",
new_fence_house_id: "",
remark: "", remark: "",
pic: [],
start_date: '',
fun: ''
}) })
const dateConfirmfn = (e) => { const dateConfirmfn = (e) => {
formData.start_date = uni.$u.timeFormat(e.value, 'yyyy-mm-dd hh:MM ') formData.start_date = uni.$u.timeFormat(e.value, 'yyyy-mm-dd hh:MM ')
@ -107,14 +110,52 @@
} }
const showFun = ref(false); const showFun = ref(false);
const old_fence_house_id = ref('');
const selectFun = (e)=>{ const selectFun = (e)=>{
formData.fun = e.name; old_fence_house_id.value = e.name;
formData.old_fence_house_id = e.id;
if(formData.old_fence_house_id==formData.new_fence_house_id && formData.new_fence_house_id){
uni.showToast({
title: '转出栏舍不可与转入栏舍一致',
icon: 'none'
})
new_fence_house_id.value = '';
formData.new_fence_house_id = '';
}
} }
const showPart = ref(false); const showPart = ref(false);
const new_fence_house_id = ref('');
const selectPart = (e)=>{ const selectPart = (e)=>{
formData.part = e.name; new_fence_house_id.value = e.name;
formData.new_fence_house_id = e.id;
if(formData.old_fence_house_id==formData.new_fence_house_id && formData.old_fence_house_id){
uni.showToast({
title: '转出栏舍不可与转入栏舍一致',
icon: 'none'
})
old_fence_house_id.value = '';
formData.old_fence_house_id = '';
}
} }
const house_list = ref([]);
const initFenceHouseList = ()=>{
fenceHouseList({
page_no:1,
page_size: 1000
}).then(res=>{
res.data.lists = res.data.lists.map(item=>{
return {
id: item.id,
name: item.fence_house_name
}
})
house_list.value = res.data.lists||[];
// console.log(house_list.value);
})
}
initFenceHouseList();
onReady(() => { onReady(() => {
form.value.setRules(rules); form.value.setRules(rules);
}); });
@ -142,23 +183,8 @@
form.value.validate().then(res => { form.value.validate().then(res => {
console.log(res) console.log(res)
if (res) { if (res) {
formData.pic = pic
let data1 = {
plant_id: task_id.value,
type: 5,
detail: JSON.stringify(formData)
};
if (formData.pic.length == 0) {
uni.$u.toast('请上传图片')
return
}
console.log('表单通过');
// //
fenceHouseExchange(formData).then((res) => {
addaction(data1).then((res) => {
console.log(res) console.log(res)
if (res.code == 1) { if (res.code == 1) {
uni.$u.toast(res.msg) uni.$u.toast(res.msg)
@ -221,22 +247,7 @@
} }
const mode = ref('add') const mode = ref('add')
onLoad((options) => { onLoad((options) => {
if (options.task) {
let data = options.task ? JSON.parse(decodeURIComponent(options.task)) : null;
// console.log(data, data.detail)
Object.assign(formData, data.detail);
pic.splice(0, pic.length, ...data.detail.pic);
mode.value = 'detail'
uni.setNavigationBarTitle({
title: '收获详情'
})
// formData=data.detail
} else {
task_id.value = options.id
}
}) })

View File

@ -24,7 +24,7 @@
<view class="content"> <view class="content">
<view class="serch"> <view class="serch">
<u-search bgColor="white" :show-action="false" placeholder="请输入耳号" v-model="searchKey" shape="round" <u-search bgColor="white" :show-action="false" placeholder="请输入耳号" v-model="searchKey" shape="round"
:clearabled='false' @change="inputval"></u-search> :clearabled='false'></u-search>
<view class="ser-text" @click="search"> <view class="ser-text" @click="search">
搜索 搜索
</view> </view>
@ -34,27 +34,27 @@
</view> </view>
<view class=""> <view class="">
<block class="" v-if="dataList.length>0"> <block class="" v-if="dataList.length>0">
<view class="thing-card" v-for="(item, index) in dataList" :key="index" @click="navTo('/pages/jump/jumpDetail?id=23')"> <view class="thing-card" v-for="(item, index) in dataList" :key="index" @click="changeItem(item)">
<view class="c-title">耳号</view> <view class="c-title">{{item.animal_sn}}</view>
<view class="c-body"> <view class="c-body">
<view class="c-item"> <view class="c-item">
<view class="flex"> <view class="flex">
<view class="f-title">转出栏舍:</view> <view class="f-title">转出栏舍:</view>
<view>栏舍12号</view> <view>{{item.old_fence_house_name}}</view>
</view> </view>
<view class="flex"> <view class="flex">
<view class="f-title">转入栏舍:</view> <view class="f-title">转入栏舍:</view>
<view>栏舍16号</view> <view>{{item.new_fence_house_name}}</view>
</view> </view>
</view> </view>
<view class="c-item"> <view class="c-item">
<view class="flex"> <view class="flex">
<view class="f-title">转舍时间:</view> <view class="f-title">转舍时间:</view>
<view>2023-12-21</view> <view>{{item.create_time.split(' ')[0]}}</view>
</view> </view>
<view class="flex"> <view class="flex">
<view class="f-title">备注:</view> <view class="f-title">备注:</view>
<view>这是备注栏舍16号栏舍16号栏舍16号栏舍16号</view> <view>{{item.remark}}</view>
</view> </view>
</view> </view>
</view> </view>
@ -87,17 +87,43 @@
reactive, reactive,
onMounted onMounted
} from "vue" } from "vue"
import {
fenceHouseExchangeList
} from "@/api/manage.js"
import Myindex from '@/components/return/index.vue'; import Myindex from '@/components/return/index.vue';
const searchKey = ref(''); const searchKey = ref('');
const dataList = reactive([ const dataList = ref([])
{
id: 1, const where = ref({
}, page_no: 1,
{ page_size: 15,
id: 2, })
} const initfenceHouseExchangeList = (land=false)=>{
]) fenceHouseExchangeList({
keyword: searchKey.value,
page_no: where.value.page_no,
page_size: where.value.page_size
}).then(res=>{
if(land) dataList.value = [...dataList.value, ...res.data.lists];
else dataList.value = res.data.lists;
})
}
initfenceHouseExchangeList();
const changeItem = (item)=>{
uni.navigateTo({
url:'/pages/jump/jumpDetail',
success: (res) => {
res.eventChannel.emit('setDatasItem', item);
}
})
}
const search = ()=>{
where.value.page_no = 1;
initfenceHouseExchangeList();
}
// //
@ -252,4 +278,28 @@
} }
} }
} }
.coneng-detail {
width: 478rpx;
height: 341rpx;
border-radius: 6px 6px 6px 6px;
opacity: 1;
font-size: 25rpx;
font-family: PingFang SC, PingFang SC;
font-weight: 400;
color: #737373;
display: flex;
justify-content: center;
align-items: center;
text-align: center;
margin: 300rpx auto;
image {
width: 280rpx;
height: 142rpx;
margin-bottom: 20rpx;
}
}
</style> </style>

View File

@ -6,27 +6,27 @@
<view class="c-box"> <view class="c-box">
<u-form-item label="耳号" borderBottom> <u-form-item label="耳号" borderBottom>
<up-input readonly type="txt" <up-input readonly type="txt"
border="none" v-model="formData.id"></up-input> border="none" v-model="formData.animal_sn"></up-input>
</u-form-item> </u-form-item>
<u-form-item label="转出栏舍" borderBottom> <u-form-item label="转出栏舍" borderBottom>
<up-input readonly <up-input readonly
border="none" v-model="formData.lanse"></up-input> border="none" v-model="formData.old_fence_house_name"></up-input>
</u-form-item> </u-form-item>
<u-form-item label="转入类型" borderBottom > <u-form-item label="转入类型" borderBottom >
<up-input readonly <up-input readonly
border="none" v-model="formData.type"></up-input> border="none" v-model="formData.new_fence_house_name"></up-input>
</u-form-item> </u-form-item>
<u-form-item label="操作人员" borderBottom > <!-- <u-form-item label="操作人员" borderBottom >
<up-input readonly <up-input readonly
border="none" v-model="formData.user"></up-input> border="none" v-model="formData.user"></up-input>
</u-form-item> </u-form-item> -->
<u-form-item label="转舍时间" borderBottom > <u-form-item label="转舍时间" borderBottom >
<up-input readonly <up-input readonly
border="none" v-model="formData.create_time"></up-input> border="none" v-model="formData.create_time"></up-input>
</u-form-item> </u-form-item>
<u-form-item label="备注" borderBottom > <u-form-item label="备注" borderBottom >
<up-input readonly <up-input readonly
border="none" v-model="formData.notes"></up-input> border="none" v-model="formData.remark"></up-input>
</u-form-item> </u-form-item>
</view> </view>
</u--form> </u--form>
@ -38,21 +38,22 @@
<script setup> <script setup>
import { import {
reactive, reactive,
ref ref,
getCurrentInstance
} from "vue"; } from "vue";
import { import {
onLoad, onLoad,
onReady onReady
} from "@dcloudio/uni-app" } from "@dcloudio/uni-app"
const formData = reactive({ const formData = reactive({})
id: "23",
lanse: "栏舍一号", onLoad(function(options){
type: "生病", const eventChannel = getCurrentInstance().proxy.getOpenerEventChannel();
why: "去治疗", eventChannel.on('setDatasItem', function(data) {
user: "张某某", Object.assign(formData, data)
create_time: "2023-12-22" })
}) })
</script> </script>

View File

@ -5,23 +5,23 @@
<view class="c-title">转栏信息</view> <view class="c-title">转栏信息</view>
<view class="c-box"> <view class="c-box">
<u-form-item label="耳号" prop="formData.breed" borderBottom required> <u-form-item label="耳号" prop="animal_sn" borderBottom required>
<up-input input-align="right" placeholder="请输入耳号" :disabled="mode=='detail'" border="none" <up-input input-align="right" placeholder="请输入耳号" :disabled="mode=='detail'" border="none"
v-model="formData.breed"></up-input> v-model="formData.animal_sn"></up-input>
</u-form-item> </u-form-item>
<up-form-item label="所在栏舍" prop="master_name" borderBottom required @click="showFun=true"> <up-form-item label="所在栏舍" prop="fence_house_id" borderBottom required @click="showFun=true">
<up-input input-align="right" placeholder="请选择所在栏舍" border="none" suffixIcon="arrow-down" <up-input input-align="right" placeholder="请选择所在栏舍" border="none" suffixIcon="arrow-down"
suffix-icon-style="color: #b6b6b6;" v-model="formData.fun" readonly></up-input> suffix-icon-style="color: #b6b6b6;" v-model="fence_house_id" readonly></up-input>
</up-form-item> </up-form-item>
<up-form-item label="离舍类型" prop="master_name" borderBottom required @click="showPart=true"> <up-form-item label="离舍类型" prop="leave_type" borderBottom required @click="showPart=true">
<up-input input-align="right" placeholder="请选择类型" border="none" suffixIcon="arrow-down" <up-input input-align="right" placeholder="请选择类型" border="none" suffixIcon="arrow-down"
suffix-icon-style="color: #b6b6b6;" v-model="formData.part" readonly></up-input> suffix-icon-style="color: #b6b6b6;" v-model="leave_type" readonly></up-input>
</up-form-item> </up-form-item>
<u-form-item label="离舍原因" prop="start_date" borderBottom required> <u-form-item label="离舍原因" prop="reason" borderBottom required>
<up-input input-align="right" placeholder="请输入离舍原因" :disabled="mode=='detail'" border="none" <up-input input-align="right" placeholder="请输入离舍原因" :disabled="mode=='detail'" border="none"
v-model="formData.breed"></up-input> v-model="formData.reason"></up-input>
</u-form-item> </u-form-item>
<u-form-item label="操作人员" prop="start_date" borderBottom required> <!-- <u-form-item label="操作人员" prop="start_date" borderBottom required>
<up-input input-align="right" placeholder="请输入操作人员姓名" :disabled="mode=='detail'" border="none" <up-input input-align="right" placeholder="请输入操作人员姓名" :disabled="mode=='detail'" border="none"
v-model="formData.breed"></up-input> v-model="formData.breed"></up-input>
</u-form-item> </u-form-item>
@ -29,7 +29,7 @@
<up-input input-align="right" placeholder="请选择时间" suffixIcon="arrow-down" <up-input input-align="right" placeholder="请选择时间" suffixIcon="arrow-down"
suffix-icon-style="color: #b6b6b6;" readonly border="none" v-model="formData.start_date" suffix-icon-style="color: #b6b6b6;" readonly border="none" v-model="formData.start_date"
style="pointer-events: none;"></up-input> style="pointer-events: none;"></up-input>
</u-form-item> </u-form-item> -->
</view> </view>
<view class="c-title">备注信息</view> <view class="c-title">备注信息</view>
@ -43,10 +43,10 @@
</u--form> </u--form>
<u-button class="btn" v-if="mode=='add'" @click="addFn">完成添加</u-button> <u-button class="btn" v-if="mode=='add'" @click="addFn">完成添加</u-button>
</view> </view>
<u-action-sheet :show="showFun" keyName="name" closeOnClickOverlay :actions="[{name:'栏舍1'}, {name:'栏舍2'}]" title="请选择接种方式" <u-action-sheet :show="showFun" keyName="fence_house_name" closeOnClickOverlay :actions="house_list" title="请选择所在栏舍"
@close="showFun = false" @select="selectFun"></u-action-sheet> @close="showFun = false" @select="selectFun"></u-action-sheet>
<u-action-sheet :show="showPart" keyName="name" closeOnClickOverlay :actions="[{name:'转卖'}, {name:'生病'}]" title="请选择接种部位" <u-action-sheet :show="showPart" keyName="name" closeOnClickOverlay :actions="leaveTypeList" title="请选择离舍类型"
@close="showPart = false" @select="selectPart"></u-action-sheet> @close="showPart = false" @select="selectPart"></u-action-sheet>
<u-datetime-picker :show="show1" :max-date="getNowTime()" v-model="value1" mode="datetime" @confirm="dateConfirmfn" <u-datetime-picker :show="show1" :max-date="getNowTime()" v-model="value1" mode="datetime" @confirm="dateConfirmfn"
:formatter="formatter" @cancel="show1=false"></u-datetime-picker> :formatter="formatter" @cancel="show1=false"></u-datetime-picker>
</view> </view>
@ -68,16 +68,24 @@
import { import {
addaction addaction
} from '@/api/api.js' } from '@/api/api.js'
import {
fenceHouseLeave,
fenceHouseList
} from "@/api/manage.js"
import {
leaveFenceHouseTypeLists
} from "@/api/dict.js"
const form = ref(null) const form = ref(null)
const task_id = ref(''); const task_id = ref('');
const pic = reactive([]); const pic = reactive([]);
const show1 = ref(false) const show1 = ref(false)
const formData = reactive({ const formData = reactive({
user: "", animal_sn: "",
leave_type: "",
reason: "",
remark: "", remark: "",
pic: [], fence_house_id: ""
start_date: '',
fun: ''
}) })
const dateConfirmfn = (e) => { const dateConfirmfn = (e) => {
formData.start_date = uni.$u.timeFormat(e.value, 'yyyy-mm-dd hh:MM ') formData.start_date = uni.$u.timeFormat(e.value, 'yyyy-mm-dd hh:MM ')
@ -110,14 +118,26 @@
// }, // },
} }
const showFun = ref(false); const showFun = ref(false);
const selectFun = (e)=>{ const fence_house_id = ref('');
formData.fun = e.name; const selectFun = (e)=>{
} fence_house_id.value = e.name;
const showPart = ref(false); formData.fence_house_id = e.id;
const selectPart = (e)=>{ }
formData.part = e.name; const showPart = ref(false);
const leave_type = ref('');
const selectPart = (e)=>{
leave_type.value = e.name;
formData.leave_type = e.id;
}
const leaveTypeList = ref([]);
const initLeaveFenceHouseTypeLists = ()=>{
leaveFenceHouseTypeLists().then(res=>{
leaveTypeList.value = res.data;
})
} }
initLeaveFenceHouseTypeLists();
onReady(() => { onReady(() => {
form.value.setRules(rules); form.value.setRules(rules);
@ -146,23 +166,10 @@
form.value.validate().then(res => { form.value.validate().then(res => {
console.log(res) console.log(res)
if (res) { if (res) {
formData.pic = pic
let data1 = {
plant_id: task_id.value,
type: 5,
detail: JSON.stringify(formData)
};
if (formData.pic.length == 0) {
uni.$u.toast('请上传图片')
return
}
console.log('表单通过');
// //
addaction(data1).then((res) => { fenceHouseLeave(formData).then((res) => {
console.log(res) console.log(res)
if (res.code == 1) { if (res.code == 1) {
uni.$u.toast(res.msg) uni.$u.toast(res.msg)
@ -223,6 +230,25 @@
// let res = await Uploads() // let res = await Uploads()
// data.formData.pic = res.data.image // data.formData.pic = res.data.image
} }
const house_list = ref([]);
const initFenceHouseList = ()=>{
fenceHouseList({
page_no:1,
page_size: 1000
}).then(res=>{
res.data.lists = res.data.lists.map(item=>{
return {
id: item.id,
name: item.fence_house_name
}
})
house_list.value = res.data.lists||[];
// console.log(house_list.value);
})
}
initFenceHouseList();
const mode = ref('add') const mode = ref('add')
onLoad((options) => { onLoad((options) => {
if (options.task) { if (options.task) {

View File

@ -23,7 +23,7 @@
<view class="content"> <view class="content">
<view class="serch"> <view class="serch">
<u-search bgColor="white" :show-action="false" placeholder="请输入耳号" v-model="searchKey" shape="round" <u-search bgColor="white" :show-action="false" placeholder="请输入耳号" v-model="searchKey" shape="round"
:clearabled='false' @change="inputval"></u-search> :clearabled='false'></u-search>
<view class="ser-text" @click="search"> <view class="ser-text" @click="search">
搜索 搜索
</view> </view>
@ -34,33 +34,33 @@
<view class=""> <view class="">
<block class="" v-if="dataList.length>0"> <block class="" v-if="dataList.length>0">
<view class="thing-card" v-for="(item, index) in dataList" :key="index" <view class="thing-card" v-for="(item, index) in dataList" :key="index"
@click="navTo('/pages/leave/leaveDetail?id=23')"> @click="changeItem(item)">
<view class="c-title">耳号</view> <view class="c-title">{{item.animal_sn}}</view>
<view class="c-body"> <view class="c-body">
<view class="c-item"> <view class="c-item">
<view class="flex"> <view class="flex">
<view class="f-title">所在栏舍:</view> <view class="f-title">所在栏舍:</view>
<view>栏舍12号</view> <view>{{item.fence_house_name}}</view>
</view> </view>
<view class="flex"> <view class="flex">
<view class="f-title">离舍原因:</view> <view class="f-title">离舍原因:</view>
<view>太肥了</view> <view>{{item.reason}}</view>
</view> </view>
</view> </view>
<view class="c-item"> <view class="c-item">
<view class="flex"> <view class="flex">
<view class="f-title">离舍类型:</view> <view class="f-title">离舍类型:</view>
<view>生病</view> <view>{{getType(item.leave_type)}}</view>
</view> </view>
<view class="flex"> <view class="flex">
<view class="f-title">离舍时间:</view> <view class="f-title">离舍时间:</view>
<view>2023-12-21</view> <view>{{item.create_time.split(' ')[0]}}</view>
</view> </view>
</view> </view>
</view> </view>
<view class="flex"> <view class="flex">
<view class="f-title">备注:</view> <view class="f-title">备注:</view>
<view>这是备注栏舍16号栏舍16号栏舍16号栏舍16号</view> <view>{{item.remark}}</view>
</view> </view>
</view> </view>
</block> </block>
@ -91,17 +91,58 @@
reactive, reactive,
onMounted onMounted
} from "vue" } from "vue"
import {
fenceHouseLeaveList
} from "@/api/manage.js"
import {
leaveFenceHouseTypeLists
} from "@/api/dict.js"
import Myindex from '@/components/return/index.vue'; import Myindex from '@/components/return/index.vue';
const leaveTypeList = ref([]);
const initLeaveFenceHouseTypeLists = ()=>{
leaveFenceHouseTypeLists().then(res=>{
leaveTypeList.value = res.data;
})
}
initLeaveFenceHouseTypeLists();
const getType = (value)=>{
return leaveTypeList.value.find(item=>item.id==value)?.name||'';
}
const searchKey = ref(''); const searchKey = ref('');
const dataList = reactive([{ const dataList = ref([])
id: 1,
}, const where = ref({
{ page_no: 1,
id: 2, page_size: 15
} })
]) const initfenceHouseLeaveList = ()=>{
fenceHouseLeaveList({
keyword: searchKey.value,
page_no: where.value.page_no,
page_size: where.value.page_size
}).then(res=>{
dataList.value = res.data.lists;
})
}
initfenceHouseLeaveList();
const search = ()=>{
where.value.page_no = 1;
initfenceHouseLeaveList();
}
const changeItem = (item)=>{
uni.navigateTo({
url:'/pages/leave/leaveDetail',
success: (res) => {
item.leave_type_name = getType(item.leave_type);
res.eventChannel.emit('setDatasItem', item);
}
})
}
// //
const navTo = (url) => { const navTo = (url) => {
@ -259,4 +300,28 @@
} }
} }
} }
.coneng-detail {
width: 478rpx;
height: 341rpx;
border-radius: 6px 6px 6px 6px;
opacity: 1;
font-size: 25rpx;
font-family: PingFang SC, PingFang SC;
font-weight: 400;
color: #737373;
display: flex;
justify-content: center;
align-items: center;
text-align: center;
margin: 300rpx auto;
image {
width: 280rpx;
height: 142rpx;
margin-bottom: 20rpx;
}
}
</style> </style>

View File

@ -6,31 +6,31 @@
<view class="c-box"> <view class="c-box">
<u-form-item label="耳号" borderBottom> <u-form-item label="耳号" borderBottom>
<up-input readonly type="txt" <up-input readonly type="txt"
border="none" v-model="formData.id"></up-input> border="none" v-model="formData.animal_sn"></up-input>
</u-form-item> </u-form-item>
<u-form-item label="所在栏舍" borderBottom> <u-form-item label="所在栏舍" borderBottom>
<up-input readonly <up-input readonly
border="none" v-model="formData.lanse"></up-input> border="none" v-model="formData.fence_house_name"></up-input>
</u-form-item> </u-form-item>
<u-form-item label="离舍类型" borderBottom > <u-form-item label="离舍类型" borderBottom >
<up-input readonly <up-input readonly
border="none" v-model="formData.type"></up-input> border="none" v-model="formData.leave_type_name"></up-input>
</u-form-item> </u-form-item>
<u-form-item label="离舍原因" borderBottom > <u-form-item label="离舍原因" borderBottom >
<up-input readonly <up-input readonly
border="none" v-model="formData.why"></up-input> border="none" v-model="formData.reason"></up-input>
</u-form-item> </u-form-item>
<u-form-item label="操作人员" borderBottom > <!-- <u-form-item label="操作人员" borderBottom >
<up-input readonly <up-input readonly
border="none" v-model="formData.user"></up-input> border="none" v-model="formData.user"></up-input>
</u-form-item> </u-form-item> -->
<u-form-item label="离舍时间" borderBottom > <u-form-item label="离舍时间" borderBottom >
<up-input readonly <up-input readonly
border="none" v-model="formData.create_time"></up-input> border="none" v-model="formData.create_time"></up-input>
</u-form-item> </u-form-item>
<u-form-item label="备注" borderBottom > <u-form-item label="备注" borderBottom >
<up-input readonly <up-input readonly
border="none" v-model="formData.notes"></up-input> border="none" v-model="formData.remark"></up-input>
</u-form-item> </u-form-item>
</view> </view>
</u--form> </u--form>
@ -42,21 +42,26 @@
<script setup> <script setup>
import { import {
reactive, reactive,
ref ref,
getCurrentInstance
} from "vue"; } from "vue";
import {
leaveFenceHouseTypeLists
} from "@/api/dict.js"
import { import {
onLoad, onLoad,
onReady onReady
} from "@dcloudio/uni-app" } from "@dcloudio/uni-app"
const formData = reactive({ const formData = reactive({})
id: "23",
lanse: "栏舍一号", onLoad(function(options){
type: "生病", const eventChannel = getCurrentInstance().proxy.getOpenerEventChannel();
why: "去治疗", eventChannel.on('setDatasItem', function(data) {
user: "张某某", Object.assign(formData, data);
create_time: "2023-12-22" })
}) })
</script> </script>

View File

@ -19,7 +19,7 @@
<breedInfo :info='dataobj'></breedInfo> <breedInfo :info='dataobj'></breedInfo>
<view class="add-btn"> <view class="add-btn">
<view class="add-thing" @click="addshowPicke(2)" style="width: 694rpx;"> <view class="add-thing" style="width: 694rpx;" @click="addshowPicke(2)">
新增喂养 新增喂养
</view> </view>
</view> </view>
@ -27,32 +27,36 @@
<view class=""> <view class="">
<view class="tit tit-more" style="margin: 20rpx 0;"> <view class="tit tit-more" style="margin: 20rpx 0;">
<view>喂养信息</view> <view>喂养信息</view>
<view class="more">查看更多 <u-icon name="arrow-right"></u-icon> </view> <view class="more" @click="navTo(`/pages/plantAdmin/moreFeed?id=${typeID}&house_id=${houseID}`)">查看更多 <u-icon name="arrow-right"></u-icon> </view>
</view> </view>
<block class="" v-if="feedDataList.length>0"> <block class="" v-if="feedList.length>0" v-for="(item, index) in feedList" :key="index">
<view class="thing-card" v-for="(item,index) in feedDataList" :key="index"> <view class="thing-card" v-if="item != null">
<view class="card_body"> <view class="card_body">
<view class="left"> <view class="left">
<u--image @click="perviewFn(item.img)" radius='10' :src="item.img" width="200rpx" <u--image v-if="item&&item.pic" @click="perviewFn(item.pic[0])" radius='10' :src="item.pic[0]" width="200rpx"
height="200rpx"></u--image> height="200rpx"></u--image>
</view> </view>
<u--image src="/static/main/house/xia_yi_ji_btn.png" class="next" width="38rpx" height="38rpx"></u--image> <u--image src="/static/main/house/xia_yi_ji_btn.png" class="next" width="38rpx" height="38rpx" @click="navFeed(item, index)"></u--image>
<view class="right" style="color: #7B7B7B;" @click="navtoForm(item,i)"> <view class="right" style="color: #7B7B7B;" @click="navFeed(item, index)">
<view class="r-item"> <view class="r-item">
<view class="item-title">操作类型:</view> <view class="item-title">操作类型:</view>
<view>喂食</view> <view v-if="index==0">{{'驱虫'}}</view>
<view v-else-if="index==1">{{'消毒'}}</view>
<view v-else-if="index==2">{{'喂食'}}</view>
<view v-else-if="index==3">{{'疫苗'}}</view>
<view v-else-if="index==4">{{'喂水'}}</view>
</view> </view>
<view class="r-item"> <view class="r-item">
<view class="item-title">操作人员:</view> <view class="item-title">操作人员:</view>
<view>赵桑</view> <view>{{item.operator}}</view>
</view> </view>
<view class="r-item"> <view class="r-item">
<view class="item-title">操作日期:</view> <view class="item-title">操作日期:</view>
<view>2023-12-20</view> <view>{{item.create_time}}</view>
</view> </view>
<view class="r-item" style="height: 80rpx;"> <view class="r-item" style="height: 80rpx;">
<view class="item-title">备注:</view> <view class="item-title">备注:</view>
<view class="row2">栏舍一号栏舍一号栏舍一号栏舍一号栏舍一号栏舍一号栏舍一号栏舍一号栏舍一号栏舍一号栏舍一号栏舍一号栏舍一号栏舍一号栏舍一号栏舍一号栏舍一号栏舍一号</view> <view class="row2">{{item.remark}}</view>
</view> </view>
</view> </view>
</view> </view>
@ -84,41 +88,24 @@
ref, ref,
reactive reactive
} from "vue" } from "vue"
import { import {
plantlist, plantlist,
landdetail landdetail
} from '@/api/api.js' } from '@/api/api.js'
import { import {
animalTypeLists fenceHouseDetail,
} from "@/api/dict.js" animalInfoList,
operationLogIndex,
animalInfoDetail
} from "@/api/manage.js"
import { import {
onLoad, onLoad,
onShow onShow
} from "@dcloudio/uni-app" } from "@dcloudio/uni-app"
const dataList = reactive([{ import {
name: '栏舍一号', animalTypeLists
img: 'https://lihai001.oss-cn-chengdu.aliyuncs.com/def/91fb0202311021455371420.jpg', } from "@/api/dict.js"
animal_name: '山羊', const dataList = reactive([])
animal_type: '哺乳动物',
capacity: '50只',
create_by: '张三',
create_time: '2023-12-19',
qr_code: 'https://lihai001.oss-cn-chengdu.aliyuncs.com/def/76751202312201347169905.png',
showCode: false
}])
const feedDataList = reactive([{
name: '栏舍一号',
img: 'https://lihai001.oss-cn-chengdu.aliyuncs.com/def/91fb0202311021455371420.jpg',
animal_name: '山羊',
animal_type: '哺乳动物',
capacity: '50只',
create_by: '张三',
create_time: '2023-12-19',
qr_code: 'https://lihai001.oss-cn-chengdu.aliyuncs.com/def/76751202312201347169905.png',
showCode: false
}])
const dataobj = reactive({}) const dataobj = reactive({})
const typeID = ref('') const typeID = ref('')
@ -143,7 +130,7 @@
route: "/pages/husbandryForm/harvest" route: "/pages/husbandryForm/harvest"
}] }]
]); ]);
const animal_type_lists = ref([]); const animal_type_lists = ref([]);
const initAnimalTypeLists = ()=>{ const initAnimalTypeLists = ()=>{
animalTypeLists().then(res=>{ animalTypeLists().then(res=>{
@ -154,37 +141,55 @@
const getAnimalType = (value)=>{ const getAnimalType = (value)=>{
return animal_type_lists.value.find(item=>item.value==value)?.name || '' return animal_type_lists.value.find(item=>item.value==value)?.name || ''
} }
const feedList = ref([])
const initOperationLogIndex = ()=>{
operationLogIndex({
fence_house_id: typeID.value
}).then(res=>{
res.data = res.data.map(item=>{
if(item) item.pic = JSON.parse(item.pic||'[]');
return item ?? null;
})
feedList.value = res.data;
})
}
const houseID = ref('');
onLoad((option) => { onLoad((option) => {
typeID.value = option.id; typeID.value = option.id;
houseID.value = option.house_id;
getFenceHouseDetail();
}); });
onShow(() => { onShow(() => {
// getlist(); getlist();
// getlist1(); initOperationLogIndex();
}) })
const getlist1 = () => { const getFenceHouseDetail = () => {
landdetail({ animalInfoDetail({
land_id: typeID.value id: typeID.value,
}).then((res) => { }).then((res) => {
if (res.code == 1) { if (res.code == 1) {
Object.assign(dataobj, res.data); Object.assign(dataobj, res.data);
console.log(dataobj);
} }
}); });
}; };
const getlist = () => { const getlist = () => {
plantlist({ animalInfoList({
land_id: typeID.value fence_house_id: typeID.value,
page_no: 1,
page_size: 3
}).then((res) => { }).then((res) => {
if (res.code == 1) { if (res.code == 1) {
dataList.splice(0, dataList.length, ...res.data); dataList.splice(0, dataList.length, ...res.data.lists);
dataList.forEach(item => { dataList.forEach(item => {
item.showCode = false item.showCode = false
}) })
console.log(dataList) // console.log(dataList)
} }
}); });
}; };
@ -192,7 +197,7 @@
const show = ref(false); const show = ref(false);
const selectList = ref([]); const selectList = ref([]);
const navType = ref(1); const navType = ref(1);
//
const addshowPicke = (type=1) => { const addshowPicke = (type=1) => {
if(type==1){ if(type==1){
selectList.value = [ selectList.value = [
@ -214,13 +219,13 @@
const selectOne = (e)=>{ const selectOne = (e)=>{
if(navType.value==1){ if(navType.value==1){
navTo(`/pages/plantAdmin/addBreed?name=${e.name}&type=${e.name=='购买'?1:2}`) navTo(`/pages/plantAdmin/addBreed?name=${e.name}&type=${e.name=='购买'?1:2}&id=${dataobj.id}&fence_house_name=${dataobj.fence_house_name}`)
}else { }else {
if(e.name=='喂食') return navTo(`/pages/feed/feed?id=23`); if(e.name=='喂食') return navTo(`/pages/feed/feed?id=${typeID.value}&house_id=${houseID.value}`);
if(e.name=='喂水') return navTo(`/pages/feed/water?id=23`); if(e.name=='喂水') return navTo(`/pages/feed/water?id=${typeID.value}&house_id=${houseID.value}`);
if(e.name=='消毒') return navTo(`/pages/feed/sterilize?id=23`); if(e.name=='消毒') return navTo(`/pages/feed/sterilize?id=${typeID.value}&house_id=${houseID.value}`);
if(e.name=='疫苗') return navTo(`/pages/feed/vaccine?id=23`); if(e.name=='疫苗') return navTo(`/pages/feed/vaccine?id=${typeID.value}&house_id=${houseID.value}`);
if(e.name=='驱虫') return navTo(`/pages/feed/expelling?id=23`); if(e.name=='驱虫') return navTo(`/pages/feed/expelling?id=${typeID.value}&house_id=${houseID.value}`);
} }
} }
@ -230,10 +235,12 @@
url url
}) })
} }
const navtoForm = (item, type) => { const navFeed = (e, index)=>{
uni.navigateTo({ if(index==2) navTo(`/pages/feedDetail/feedDetail?id=${e.id}`)
url: '/pages/landDetail/tudi?data=' + item.id if(index==4) navTo(`/pages/feedDetail/waterDetail?id=${e.id}`)
}) if(index==1) navTo(`/pages/feedDetail/sterilizeDetail?id=${e.id}`)
if(index==3) navTo(`/pages/feedDetail/vaccineDetail?id=${e.id}`)
if(index==0) navTo(`/pages/feedDetail/expellingDetail?id=${e.id}`)
} }
@ -263,9 +270,11 @@
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
page{
background-color: $theme-bg-color;
}
.box { .box {
width: 750rpx; width: 750rpx;
min-height: 100vh;
background-color: $theme-bg-color; background-color: $theme-bg-color;
padding: 0; padding: 0;

View File

@ -22,7 +22,7 @@
<view class="content"> <view class="content">
<view class="serch"> <view class="serch">
<u-search bgColor="white" :show-action="false" placeholder="请输入栏舍名称" v-model="fomData.keyword" shape="round" <u-search bgColor="white" :show-action="false" placeholder="请输入栏舍名称" v-model="fomData.fence_house_name" shape="round"
:clearabled='false' @change="inputval"></u-search> :clearabled='false' @change="inputval"></u-search>
<view class="ser-text" @click="search"> <view class="ser-text" @click="search">
搜索 搜索
@ -118,7 +118,7 @@
const fomData = reactive({ const fomData = reactive({
page_no: 1, page_no: 1,
page_size: 15, page_size: 15,
keyword: '' fence_house_name: ''
}) })
const animal_type_lists = ref([]) const animal_type_lists = ref([])

View File

@ -30,7 +30,7 @@
<view class=""> <view class="">
<view class="tit tit-more" style="margin: 20rpx 0;"> <view class="tit tit-more" style="margin: 20rpx 0;">
<view>养殖信息</view> <view>养殖信息</view>
<view class="more" @click="navTo('/pages/plantAdmin/moreBreed')">查看更多 <u-icon name="arrow-right"></u-icon> </view> <view class="more" @click="navTo(`/pages/plantAdmin/moreBreed?id=${typeID}`)">查看更多 <u-icon name="arrow-right"></u-icon> </view>
</view> </view>
<block class="" v-if="dataList.length>0"> <block class="" v-if="dataList.length>0">
<view class="thing-card" v-for="(item,index) in dataList" :key="index"> <view class="thing-card" v-for="(item,index) in dataList" :key="index">
@ -40,8 +40,8 @@
height="250rpx"></u--image> height="250rpx"></u--image>
<u---image class="qr-code" @click="perviewFn(item.qr_code)" src="/static/main/house/su_yuan_ma_btn.png" width="60rpx" height="60rpx"></u---image> <u---image class="qr-code" @click="perviewFn(item.qr_code)" src="/static/main/house/su_yuan_ma_btn.png" width="60rpx" height="60rpx"></u---image>
</view> </view>
<u--image src="/static/main/house/xia_yi_ji_btn.png" class="next" width="38rpx" height="38rpx" @click="navTo(`/pages/plantAdmin/breedDetail?id=${item.id}`)"></u--image> <u--image src="/static/main/house/xia_yi_ji_btn.png" class="next" width="38rpx" height="38rpx" @click="navTo(`/pages/plantAdmin/breedDetail?id=${item.id}&house_id=${item.fence_house_id}`)"></u--image>
<view class="right" style="color: #7B7B7B;" @click="navTo(`/pages/plantAdmin/breedDetail?id=${item.id}`)"> <view class="right" style="color: #7B7B7B;" @click="navTo(`/pages/plantAdmin/breedDetail?id=${item.id}&house_id=${item.fence_house_id}`)">
<view class="name">{{item.sn}}</view> <view class="name">{{item.sn}}</view>
<view class="r-item"> <view class="r-item">
<view class="item-title">品类:</view> <view class="item-title">品类:</view>
@ -82,32 +82,36 @@
<view class=""> <view class="">
<view class="tit tit-more" style="margin: 20rpx 0;"> <view class="tit tit-more" style="margin: 20rpx 0;">
<view>喂养信息</view> <view>喂养信息</view>
<view class="more" @click="navTo('/pages/plantAdmin/moreFeed')">查看更多 <u-icon name="arrow-right"></u-icon> </view> <view class="more" @click="navTo('/pages/plantAdmin/moreFeed?house_id='+typeID)">查看更多 <u-icon name="arrow-right"></u-icon> </view>
</view> </view>
<block class="" v-if="feedDataList.length>0"> <block class="" v-if="feedList.length>0">
<view class="thing-card" v-for="(item,index) in feedDataList" :key="index"> <view class="thing-card" v-for="(item, index) in feedList" :key="index" v-show="item">
<view class="card_body"> <view class="card_body">
<view class="left"> <view class="left">
<u--image @click="perviewFn('https://lihai001.oss-cn-chengdu.aliyuncs.com/def/91fb0202311021455371420.jpg')" radius='10' src="https://lihai001.oss-cn-chengdu.aliyuncs.com/def/91fb0202311021455371420.jpg" width="200rpx" <u--image @click="perviewFn(item.pic[0])" radius='10' :src="item.pic[0]" width="200rpx"
height="200rpx"></u--image> height="200rpx"></u--image>
</view> </view>
<u--image src="/static/main/house/xia_yi_ji_btn.png" class="next" width="38rpx" height="38rpx" @click="navFeed(item)"></u--image> <u--image src="/static/main/house/xia_yi_ji_btn.png" class="next" width="38rpx" height="38rpx" @click="navFeed(item, index)"></u--image>
<view class="right" style="color: #7B7B7B;" @click="navFeed(item)"> <view class="right" style="color: #7B7B7B;" @click="navFeed(item, index)">
<view class="r-item"> <view class="r-item">
<view class="item-title">操作类型:</view> <view class="item-title">操作类型:</view>
<view>{{item.type_name}}</view> <view v-if="index==0">{{'驱虫'}}</view>
<view v-else-if="index==1">{{'消毒'}}</view>
<view v-else-if="index==2">{{'喂食'}}</view>
<view v-else-if="index==3">{{'疫苗'}}</view>
<view v-else-if="index==4">{{'喂水'}}</view>
</view> </view>
<view class="r-item"> <view class="r-item">
<view class="item-title">操作人员:</view> <view class="item-title">操作人员:</view>
<view>赵桑</view> <view>{{item.operator}}</view>
</view> </view>
<view class="r-item"> <view class="r-item">
<view class="item-title">操作日期:</view> <view class="item-title">操作日期:</view>
<view>2023-12-20</view> <view>{{item.create_time}}</view>
</view> </view>
<view class="r-item" style="height: 80rpx;"> <view class="r-item" style="height: 80rpx;">
<view class="item-title">备注:</view> <view class="item-title">备注:</view>
<view class="row2">栏舍一号栏舍一号栏舍一号栏舍一号栏舍一号栏舍一号栏舍一号栏舍一号栏舍一号栏舍一号栏舍一号栏舍一号栏舍一号栏舍一号栏舍一号栏舍一号栏舍一号栏舍一号</view> <view class="row2">{{item.remark}}</view>
</view> </view>
</view> </view>
</view> </view>
@ -156,13 +160,6 @@
animalTypeLists animalTypeLists
} from "@/api/dict.js" } from "@/api/dict.js"
const dataList = reactive([]) const dataList = reactive([])
const feedDataList = reactive([
{type_name: '喂食'},
{type_name: '喂水'},
{type_name: '消毒'},
{type_name: '疫苗'},
{type_name: '驱虫'},
])
const dataobj = reactive({}) const dataobj = reactive({})
const typeID = ref('') const typeID = ref('')
@ -199,11 +196,16 @@
return animal_type_lists.value.find(item=>item.value==value)?.name || '' return animal_type_lists.value.find(item=>item.value==value)?.name || ''
} }
const feedList = ref([])
const initOperationLogIndex = ()=>{ const initOperationLogIndex = ()=>{
operationLogIndex({ operationLogIndex({
fence_house_id: typeID.value fence_house_id: typeID.value
}).then(res=>{ }).then(res=>{
console.log(res); res.data = res.data.map(item=>{
item.pic = JSON.parse(item.pic);
return item;
})
feedList.value = res.data;
}) })
} }
@ -284,12 +286,37 @@
url url
}) })
} }
const navFeed = (e)=>{ const navFeed = (item, index)=>{
if(e.type_name=='喂食') navTo(`/pages/feedDetail/feedDetail?id=1`) if(index==2) uni.navigateTo({
if(e.type_name=='喂水') navTo(`/pages/feedDetail/waterDetail?id=1`) url: `/pages/feedDetail/feedDetail`,
if(e.type_name=='消毒') navTo(`/pages/feedDetail/sterilizeDetail?id=1`) success: (res) => {
if(e.type_name=='疫苗') navTo(`/pages/feedDetail/vaccineDetail?id=1`) res.eventChannel.emit('setDatasItem', item);
if(e.type_name=='驱虫') navTo(`/pages/feedDetail/expellingDetail?id=1`) }
})
if(index==4) uni.navigateTo({
url: `/pages/feedDetail/waterDetail`,
success: (res) => {
res.eventChannel.emit('setDatasItem', item);
}
})
if(index==1) uni.navigateTo({
url: `/pages/feedDetail/sterilizeDetail`,
success: (res) => {
res.eventChannel.emit('setDatasItem', item);
}
})
if(index==3) uni.navigateTo({
url: `/pages/feedDetail/vaccineDetail`,
success: (res) => {
res.eventChannel.emit('setDatasItem', item);
}
})
if(index==0) uni.navigateTo({
url: `/pages/feedDetail/expellingDetail`,
success: (res) => {
res.eventChannel.emit('setDatasItem', item);
}
})
} }

View File

@ -10,28 +10,28 @@
height="250rpx"></u--image> height="250rpx"></u--image>
<u---image class="qr-code" @click="perviewFn(item.qr_code)" src="/static/main/house/su_yuan_ma_btn.png" width="60rpx" height="60rpx"></u---image> <u---image class="qr-code" @click="perviewFn(item.qr_code)" src="/static/main/house/su_yuan_ma_btn.png" width="60rpx" height="60rpx"></u---image>
</view> </view>
<u--image src="/static/main/house/xia_yi_ji_btn.png" class="next" width="38rpx" height="38rpx" @click="navTo(`/pages/plantAdmin/breedDetail?id=${item.id}`)"></u--image> <u--image src="/static/main/house/xia_yi_ji_btn.png" class="next" width="38rpx" height="38rpx" @click="navTo(`/pages/plantAdmin/breedDetail?id=${item.id}&house_id=${item.fence_house_id}`)"></u--image>
<view class="right" style="color: #7B7B7B;" @click="navTo(`/pages/plantAdmin/breedDetail?id=${item.id}`)"> <view class="right" style="color: #7B7B7B;" @click="navTo(`/pages/plantAdmin/breedDetail?id=${item.id}&house_id=${item.fence_house_id}`)">
<view class="name">耳号</view> <view class="name">{{item.sn}}</view>
<view class="r-item"> <view class="r-item">
<view class="item-title">品类:</view> <view class="item-title">品类:</view>
<view>黑山羊</view> <view>{{getAnimalType(item.animal_type)}}</view>
</view> </view>
<view class="r-item"> <view class="r-item">
<view class="item-title">品种:</view> <view class="item-title">品种:</view>
<view>山羊</view> <view>{{item.brand}}</view>
</view> </view>
<view class="r-item"> <view class="r-item">
<view class="item-title">性别:</view> <view class="item-title">性别:</view>
<view></view> <view>{{item.gender? '':'母'}}</view>
</view> </view>
<view class="r-item"> <view class="r-item">
<view class="item-title">栏舍:</view> <view class="item-title">栏舍:</view>
<view>栏舍一号</view> <view v-if="item.fenceHouseAttr">{{item.fenceHouseAttr.fence_house_name}}</view>
</view> </view>
<view class="r-item"> <view class="r-item">
<view class="item-title">来源:</view> <view class="item-title">来源:</view>
<view>购买</view> <view>{{item.animal_source==1 ? '购买': '自繁'}}</view>
</view> </view>
</view> </view>
</view> </view>
@ -62,20 +62,19 @@
import { import {
onLoad, onLoad,
onShow onShow,
onReachBottom
} from "@dcloudio/uni-app" } from "@dcloudio/uni-app"
const dataList = reactive([{ import {
id: 1, animalInfoList
name: '栏舍一号', } from "@/api/manage.js"
img: 'https://lihai001.oss-cn-chengdu.aliyuncs.com/def/91fb0202311021455371420.jpg', import {
animal_name: '山羊', animalTypeLists
animal_type: '哺乳动物', } from "@/api/dict.js"
capacity: '50只',
create_by: '张三', const dataList = reactive([])
create_time: '2023-12-19',
qr_code: 'https://lihai001.oss-cn-chengdu.aliyuncs.com/def/76751202312201347169905.png', const typeID = ref('')
showCode: false
}])
// //
const navTo = (url) => { const navTo = (url) => {
@ -107,6 +106,46 @@
dataList[i].showCode = !dataList[i].showCode dataList[i].showCode = !dataList[i].showCode
console.log(dataList[i].showCode) console.log(dataList[i].showCode)
} }
const where = ref({
page_no: 1,
page_size: 10
})
const getlist = () => {
animalInfoList({
fence_house_id: typeID.value,
page_no: where.value.page_no,
page_size: where.value.page_size
}).then((res) => {
if (res.code == 1) {
dataList.splice(0, dataList.length, ...res.data.lists);
dataList.forEach(item => {
item.showCode = false
})
// console.log(dataList)
}
});
};
const animal_type_lists = ref([]);
const initAnimalTypeLists = ()=>{
animalTypeLists().then(res=>{
animal_type_lists.value = res.data;
})
}
initAnimalTypeLists();
const getAnimalType = (value)=>{
return animal_type_lists.value.find(item=>item.value==value)?.name || ''
}
onLoad((option) => {
typeID.value = option.id;
getlist();
});
onReachBottom(()=>{
where.value.page_no++;
getlist();
})
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>

View File

@ -1,35 +1,36 @@
<template> <template>
<view class="box"> <view class="box">
<u-tabs :list="list1" lineColor="#feb048" :scrollable="false"></u-tabs> <u-tabs :list="list1" lineColor="#feb048" :current="current" :scrollable="false" @change="changeTabs"></u-tabs>
<view class="content"> <view class="content">
<view class=""> <view class="">
<block class="" v-if="feedDataList.length>0"> <block class="" v-if="feedDataList.length>0">
<view class="thing-card" v-for="(item,index) in feedDataList" :key="index"> <view class="thing-card" v-for="(item, index) in feedDataList" :key="index">
<view class="card_body"> <view class="card_body">
<view class="left"> <view class="left">
<u--image <u--image v-if="item.pic" @click="perviewFn(item.pic[0])" radius='10' :src="item.pic[0]" width="200rpx"
@click="perviewFn('https://lihai001.oss-cn-chengdu.aliyuncs.com/def/91fb0202311021455371420.jpg')" height="200rpx"></u--image>
radius='10' src="https://lihai001.oss-cn-chengdu.aliyuncs.com/def/91fb0202311021455371420.jpg"
width="200rpx" height="200rpx"></u--image>
</view> </view>
<u--image src="/static/main/house/xia_yi_ji_btn.png" class="next" width="38rpx" height="38rpx" <u--image src="/static/main/house/xia_yi_ji_btn.png" class="next" width="38rpx" height="38rpx" @click="navFeed(item, index)"></u--image>
@click="navFeed(item)"></u--image> <view class="right" style="color: #7B7B7B;" @click="navFeed(item, index)">
<view class="right" style="color: #7B7B7B;" @click="navFeed(item)">
<view class="r-item"> <view class="r-item">
<view class="item-title">操作类型:</view> <view class="item-title">操作类型:</view>
<view>{{item.type_name}}</view> <view v-if="current==0">{{'喂食'}}</view>
<view v-else-if="current==1">{{'喂水'}}</view>
<view v-else-if="current==2">{{'消毒'}}</view>
<view v-else-if="current==3">{{'疫苗'}}</view>
<view v-else-if="current==4">{{'驱虫'}}</view>
</view> </view>
<view class="r-item"> <view class="r-item">
<view class="item-title">操作人员:</view> <view class="item-title">操作人员:</view>
<view>赵桑</view> <view>{{item.operator}}</view>
</view> </view>
<view class="r-item"> <view class="r-item">
<view class="item-title">操作日期:</view> <view class="item-title">操作日期:</view>
<view>2023-12-20</view> <view>{{item.create_time}}</view>
</view> </view>
<view class="r-item" style="height: 80rpx;"> <view class="r-item" style="height: 80rpx;">
<view class="item-title">备注:</view> <view class="item-title">备注:</view>
<view class="row2">栏舍一号栏舍一号栏舍一号栏舍一号栏舍一号栏舍一号栏舍一号栏舍一号栏舍一号栏舍一号栏舍一号栏舍一号栏舍一号栏舍一号栏舍一号栏舍一号栏舍一号栏舍一号</view> <view class="row2">{{item.remark}}</view>
</view> </view>
</view> </view>
</view> </view>
@ -59,16 +60,21 @@
import { import {
onLoad, onLoad,
onShow onShow,
onReachBottom
} from "@dcloudio/uni-app" } from "@dcloudio/uni-app"
const feedDataList = reactive([ import {
{ type_name: '喂食' }, dewormingLogLists,
{ type_name: '喂水' }, disinfectLogLists,
{ type_name: '消毒' }, feedingLogLists,
{ type_name: '疫苗' }, waterLogLists,
{ type_name: '驱虫' }, vaccinumLogLists
]) } from "@/api/manage.js"
const feedDataList = ref([])
const current = ref(0);
const list1 = reactive([{ const list1 = reactive([{
name: '喂食', name: '喂食',
}, { }, {
@ -111,9 +117,87 @@
urls: [url] urls: [url]
}) })
} }
const where = ref({
page_no: 1,
page_size: 15,
fence_house_id: '',
animal_info_id: ''
})
const changeTabs = (e)=>{
current.value = e.index;
where.value.page_no = 1;
feedDataList.value = [];
if(e.name=='喂食') getList();
if(e.name=='喂水') getList1();
if(e.name=='消毒') getList2();
if(e.name=='疫苗') getList3();
if(e.name=='驱虫') getList4();
}
const getList = ()=>{
feedingLogLists(where.value).then(res=>{
res.data.lists = res.data.lists.map(item=>{
item.pic = JSON.parse(item.pic||'[]');
return item;
})
feedDataList.value = [...feedDataList.value, ...res.data.lists];
})
}
const getList1 = ()=>{
waterLogLists(where.value).then(res=>{
res.data.lists = res.data.lists.map(item=>{
item.pic = JSON.parse(item.pic||'[]');
return item;
})
feedDataList.value = [...feedDataList.value, ...res.data.lists];
})
}
const getList2 = ()=>{
disinfectLogLists(where.value).then(res=>{
res.data.lists = res.data.lists.map(item=>{
item.pic = JSON.parse(item.pic||'[]');
return item;
})
feedDataList.value = [...feedDataList.value, ...res.data.lists];
})
}
const getList3 = ()=>{
vaccinumLogLists(where.value).then(res=>{
res.data.lists = res.data.lists.map(item=>{
item.pic = JSON.parse(item.pic||'[]');
return item;
})
feedDataList.value = [...feedDataList.value, ...res.data.lists];
})
}
const getList4 = ()=>{
dewormingLogLists(where.value).then(res=>{
res.data.lists = res.data.lists.map(item=>{
item.pic = JSON.parse(item.pic||'[]');
return item;
})
feedDataList.value = [...feedDataList.value, ...res.data.lists];
})
}
onLoad((options)=>{
where.value.animal_info_id = options.id;
where.value.fence_house_id = options.house_id;
getList();
})
onReachBottom(()=>{
where.value.page_no++;
if(current.value==0) getList();
if(current.value==1) getList1();
if(current.value==2) getList2();
if(current.value==3) getList3();
if(current.value==4) getList4();
})
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
page{
background-color: $theme-bg-color;
}
.box { .box {
width: 750rpx; width: 750rpx;
background-color: $theme-bg-color; background-color: $theme-bg-color;

View File

@ -24,7 +24,7 @@
<view class="content"> <view class="content">
<view class="serch"> <view class="serch">
<u-search bgColor="white" :show-action="false" placeholder="请输入耳号" v-model="searchKey" shape="round" <u-search bgColor="white" :show-action="false" placeholder="请输入耳号" v-model="searchKey" shape="round"
:clearabled='false' @change="inputval"></u-search> :clearabled='false'></u-search>
<view class="ser-text" @click="search"> <view class="ser-text" @click="search">
搜索 搜索
</view> </view>
@ -39,32 +39,30 @@
<view class="left"> <view class="left">
<u--image @click="perviewFn(item.img)" radius='10' :src="item.img" width="250rpx" <u--image @click="perviewFn(item.img)" radius='10' :src="item.img" width="250rpx"
height="250rpx"></u--image> height="250rpx"></u--image>
<u---image class="qr-code" @click="perviewFn(item.qr_code)" src="/static/main/house/su_yuan_ma_btn.png" <u---image class="qr-code" @click="perviewFn(item.qr_code)" src="/static/main/house/su_yuan_ma_btn.png" width="60rpx" height="60rpx"></u---image>
width="60rpx" height="60rpx"></u---image>
</view> </view>
<u--image src="/static/main/house/xia_yi_ji_btn.png" class="next" width="38rpx" height="38rpx" <u--image src="/static/main/house/xia_yi_ji_btn.png" class="next" width="38rpx" height="38rpx" @click="navTo(`/pages/plantAdmin/breedDetail?id=${item.id}&house_id=${item.fence_house_id}`)"></u--image>
@click="navTo(`/pages/plantAdmin/breedDetail?id=${item.id}`)"></u--image> <view class="right" style="color: #7B7B7B;" @click="navTo(`/pages/plantAdmin/breedDetail?id=${item.id}&house_id=${item.fence_house_id}`)">
<view class="right" style="color: #7B7B7B;" @click="navTo(`/pages/plantAdmin/breedDetail?id=${item.id}`)"> <view class="name">{{item.sn}}</view>
<view class="name">耳号</view>
<view class="r-item"> <view class="r-item">
<view class="item-title">品类:</view> <view class="item-title">品类:</view>
<view>黑山羊</view> <view>{{getAnimalType(item.animal_type)}}</view>
</view> </view>
<view class="r-item"> <view class="r-item">
<view class="item-title">品种:</view> <view class="item-title">品种:</view>
<view>山羊</view> <view>{{item.brand}}</view>
</view> </view>
<view class="r-item"> <view class="r-item">
<view class="item-title">性别:</view> <view class="item-title">性别:</view>
<view></view> <view>{{item.gender? '':'母'}}</view>
</view> </view>
<view class="r-item"> <view class="r-item">
<view class="item-title">栏舍:</view> <view class="item-title">栏舍:</view>
<view>栏舍一号</view> <view v-if="item.fenceHouseAttr">{{item.fenceHouseAttr.fence_house_name}}</view>
</view> </view>
<view class="r-item"> <view class="r-item">
<view class="item-title">来源:</view> <view class="item-title">来源:</view>
<view>购买</view> <view>{{item.animal_source==1 ? '购买': '自繁'}}</view>
</view> </view>
</view> </view>
</view> </view>
@ -102,21 +100,16 @@
reactive, reactive,
onMounted onMounted
} from "vue" } from "vue"
import {
animalInfoList
} from "@/api/manage.js"
import {
animalTypeLists
} from "@/api/dict.js"
import Myindex from '@/components/return/index.vue'; import Myindex from '@/components/return/index.vue';
const searchKey = ref(''); const searchKey = ref('');
const dataList = reactive([{ const dataList = reactive([])
id: 1,
name: '栏舍一号',
img: 'https://lihai001.oss-cn-chengdu.aliyuncs.com/def/91fb0202311021455371420.jpg',
animal_name: '山羊',
animal_type: '哺乳动物',
capacity: '50只',
create_by: '张三',
create_time: '2023-12-19',
qr_code: 'https://lihai001.oss-cn-chengdu.aliyuncs.com/def/76751202312201347169905.png',
showCode: false
}])
const show = ref(false); const show = ref(false);
const selectList = ref([ const selectList = ref([
@ -161,6 +154,51 @@
dataList[i].showCode = !dataList[i].showCode dataList[i].showCode = !dataList[i].showCode
console.log(dataList[i].showCode) console.log(dataList[i].showCode)
} }
const where = ref({
page_no: 1,
page_size: 10
})
const getlist = () => {
animalInfoList({
keyword: searchKey.value,
page_no: where.value.page_no,
page_size: where.value.page_size
}).then((res) => {
if (res.code == 1) {
dataList.splice(0, dataList.length, ...res.data.lists);
dataList.forEach(item => {
item.showCode = false
})
// console.log(dataList)
}
});
};
const animal_type_lists = ref([]);
const initAnimalTypeLists = ()=>{
animalTypeLists().then(res=>{
animal_type_lists.value = res.data;
})
}
initAnimalTypeLists();
const getAnimalType = (value)=>{
return animal_type_lists.value.find(item=>item.value==value)?.name || ''
}
//
const search = ()=>{
where.value.page_no = 1;
dataList.value = [];
getlist();
}
onLoad(() => {
getlist();
});
onReachBottom(()=>{
where.value.page_no++;
getlist();
})
</script> </script>
<style lang="scss"> <style lang="scss">
@ -333,4 +371,28 @@
} }
} }
} }
.coneng-detail {
width: 478rpx;
height: 341rpx;
border-radius: 6px 6px 6px 6px;
opacity: 1;
font-size: 25rpx;
font-family: PingFang SC, PingFang SC;
font-weight: 400;
color: #737373;
display: flex;
justify-content: center;
align-items: center;
text-align: center;
margin: 300rpx auto;
image {
width: 280rpx;
height: 142rpx;
margin-bottom: 20rpx;
}
}
</style> </style>