瀏覽代碼

修改 bug

xsh 1 年之前
父節點
當前提交
755eef17c3

+ 9 - 2
src/views/biz/ai/device/index.vue

@@ -103,7 +103,7 @@
 			</template>
 		</s-table>
 	</a-card>
-	<Form ref="formRef" @successful="table.refresh(true)" />
+	<Form ref="formRef" @successful="refresh" />
 </template>
 
 <script setup name="aiDevice">
@@ -237,6 +237,7 @@
 	const deleteBatchDevice = (params) => {
 		bizAiPollingApi.delDevice(params).then(() => {
 			table.value.clearRefreshSelected()
+			initCount()
 		})
 	}
 
@@ -248,12 +249,18 @@
 		]
 		bizAiPollingApi.delDevice(params).then(() => {
 			table.value.refresh(true)
+			initCount()
 		})
 	}
 
+	const refresh = () => {
+		table.refresh(true)
+		initCount()
+	}
+
 	onMounted(() => {
 		initCount()
-		initType()
+		// initType()
 		initHouse()
 	})
 </script>

+ 8 - 1
src/views/biz/device/index.vue

@@ -103,7 +103,7 @@
 			</template>
 		</s-table>
 	</a-card>
-	<Form ref="formRef" @successful="table.refresh(true)" />
+	<Form ref="formRef" @successful="refresh" />
 </template>
 
 <script setup name="device">
@@ -237,6 +237,7 @@
 	const deleteBatchDevice = (params) => {
 		bizDeviceApi.delDevice(params).then(() => {
 			table.value.clearRefreshSelected()
+			initCount()
 		})
 	}
 
@@ -248,9 +249,15 @@
 		]
 		bizDeviceApi.delDevice(params).then(() => {
 			table.value.refresh(true)
+			initCount()
 		})
 	}
 
+	const refresh = () => {
+		table.refresh(true)
+		initCount()
+	}
+
 	onMounted(() => {
 		initCount()
 		initType()

+ 18 - 4
src/views/biz/energy/count/index.vue

@@ -93,7 +93,7 @@
 					<a-form-item>
 						<a-space>
 							<a-button type="primary" @click="searchWater">查询</a-button>
-							<a-button @click="searchFormState.pigpenId = ''">重置</a-button>
+							<a-button @click="resetWater">重置</a-button>
 						</a-space>
 					</a-form-item>
 				</a-col>
@@ -172,7 +172,7 @@
 					<a-form-item>
 						<a-space>
 							<a-button type="primary" @click="searchEle">查询</a-button>
-							<a-button @click="searchFormEle.pigpenId = ''">重置</a-button>
+							<a-button @click="resetEle">重置</a-button>
 						</a-space>
 					</a-form-item>
 				</a-col>
@@ -258,8 +258,8 @@
 		initElePie()
 	}
 
-	const activeWater = ref(0)
-	const activeEle = ref(0)
+	const activeWater = ref(1)
+	const activeEle = ref(1)
 	const date = ref([])
 	const time = ref([])
 	const cutWater = (val) => {
@@ -359,12 +359,26 @@
 		initWaterChart()
 		initWaterRank()
 	}
+	const resetWater = () => {
+		searchFormState.pigpenId = ''
+		activeWater.value = 0
+		date.value = []
+		initWaterChart()
+		initWaterRank()
+	}
 
 	const searchEle = () => {
 		initEleChart()
 		initEleRank()
 	}
 
+	const resetEle = () => {
+		searchFormEle.pigpenId = ''
+		activeEle.value = 0
+		time.value = []
+		searchEle()
+	}
+
 	const treeData = ref([])
 	const initHouse = async () => {
 		bizHouseApi.basePigpenTree().then((res) => {

+ 8 - 1
src/views/biz/energy/device/index.vue

@@ -103,7 +103,7 @@
 			</template>
 		</s-table>
 	</a-card>
-	<Form ref="formRef" @successful="table.refresh(true)" />
+	<Form ref="formRef" @successful="refresh" />
 </template>
 
 <script setup name="energyDevice">
@@ -221,6 +221,7 @@
 	const deleteBatchDevice = (params) => {
 		bizEnergyDeviceApi.delEnergyDevice(params).then(() => {
 			table.value.clearRefreshSelected()
+			initCount()
 		})
 	}
 
@@ -232,9 +233,15 @@
 		]
 		bizEnergyDeviceApi.delEnergyDevice(params).then(() => {
 			table.value.refresh(true)
+			initCount()
 		})
 	}
 
+	const refresh = () => {
+		table.refresh(true)
+		initCount()
+	}
+
 	onMounted(() => {
 		initCount()
 		initType()

+ 2 - 2
src/views/biz/energy/threshold/index.vue

@@ -219,10 +219,10 @@
 			let params = {
 				firstManagerId: formData.value.firstId,
 				secondManagerId: formData.value.twoId,
-				type: 0,
+				type: 1,
 				warningUpgradeTime: formData.value.warningUpgradeTime
 			}
-			bizEnergyThresholdApi.saveThreshold(params).then(() => {
+			bizWarnApi.saveWarnPerson(params).then(() => {
 				message.success('保存成功')
 			})
 		})

+ 8 - 1
src/views/biz/feed/device/index.vue

@@ -105,7 +105,7 @@
 			</template>
 		</s-table>
 	</a-card>
-	<Form ref="formRef" @successful="table.refresh(true)" />
+	<Form ref="formRef" @successful="refresh" />
 </template>
 
 <script setup name="feedDevice">
@@ -237,6 +237,7 @@
 	const deleteBatchDevice = (params) => {
 		bizFeedDeviceApi.delDevice(params).then(() => {
 			table.value.clearRefreshSelected()
+			initCount()
 		})
 	}
 
@@ -248,9 +249,15 @@
 		]
 		bizFeedDeviceApi.delDevice(params).then(() => {
 			table.value.refresh(true)
+			initCount()
 		})
 	}
 
+	const refresh = () => {
+		table.refresh(true)
+		initCount()
+	}
+
 	const treeData = ref([])
 	const initHouse = () => {
 		bizHouseApi.basePigpenTree().then((res) => {

+ 17 - 5
src/views/biz/feed/pig/index.vue

@@ -13,25 +13,25 @@
 			<a-col :span="4">
 				<div class="pig_box">
 					<div class="box_title">今日总采食量</div>
-					<div class="box_num">{{info.todayFeed}}</div>
+					<div class="box_num">{{info.todayFeed}}kg</div>
 				</div>
 			</a-col>
 			<a-col :span="4">
 				<div class="pig_box">
 					<div class="box_title">今日总饮水量</div>
-					<div class="box_num">{{info.todayWater}}</div>
+					<div class="box_num">{{info.todayWater}}kg</div>
 				</div>
 			</a-col>
 			<a-col :span="4">
 				<div class="pig_box">
 					<div class="box_title">昨日总采食量</div>
-					<div class="box_num">{{info.yesterdayFeed}}</div>
+					<div class="box_num">{{info.yesterdayFeed}}kg</div>
 				</div>
 			</a-col>
 			<a-col :span="4">
 				<div class="pig_box">
 					<div class="box_title">昨日总饮水量</div>
-					<div class="box_num">{{info.yesterdayWater}}</div>
+					<div class="box_num">{{info.yesterdayWater}}kg</div>
 				</div>
 			</a-col>
 		</a-row>
@@ -70,6 +70,18 @@
 			}"
 		>
 			<template #bodyCell="{ column, record }">
+				<template v-if="column.dataIndex === 'todayFeed'">
+					<span>{{record.todayFeed}}kg</span>
+				</template>
+				<template v-if="column.dataIndex === 'yesterdayFeed'">
+					<span>{{record.yesterdayFeed}}kg</span>
+				</template>
+				<template v-if="column.dataIndex === 'yesterdayWater'">
+					<span>{{record.yesterdayWater}}kg</span>
+				</template>
+				<template v-if="column.dataIndex === 'todayWater'">
+					<span>{{record.yesterdayWater}}kg</span>
+				</template>
 				<template v-if="column.dataIndex === 'action'">
 					<a-button type="link" @click="jump(record)">详情</a-button>
 				</template>
@@ -224,7 +236,7 @@
 
 	onMounted(async () => {
 		await initDevice()
-		await initData()
+		// await initData()
 	})
 </script>
 

+ 7 - 0
src/views/biz/feed/pigDetail/index.vue

@@ -1,5 +1,8 @@
 <template>
 	<a-card title="母猪信息" style="margin-bottom: 10px">
+		<template #extra>
+			<a-button type="primary" @click="back">返回</a-button>
+		</template>
 		<a-row :gutter="20">
 			<a-col :span="8">
 				耳标号:{{id}}
@@ -127,6 +130,10 @@
 	const dayAge = ref('')
 	const unitName = ref('')
 
+	const back = () => {
+		router.back()
+	}
+
 	const active = ref(1)
 	const cut = (val) => {
 		if (active.value === val) {

+ 3 - 2
src/views/biz/feed/stark/index.vue

@@ -58,7 +58,7 @@
 							<template #icon><SearchOutlined /></template>
 							查询
 						</a-button>
-						<a-button @click="reset">重置</a-button>
+<!--						<a-button @click="reset">重置</a-button>-->
 					</a-space>
 				</a-col>
 			</a-row>
@@ -122,7 +122,8 @@
 	})
 
 	const reset = () => {
-		searchFormRef.value.resetFields()
+		// searchFormRef.value.resetFields()
+
 		table.value.refresh(true)
 	}
 

+ 12 - 2
src/views/biz/monitor/index.vue

@@ -130,11 +130,21 @@
 	const search = async () => {
 		await bizMonitorApi.getMonitorList(searchFormState.value).then((res) => {
 			tabList.value = res
-			activeKey.value = res[0].pigpenId
+			activeKey.value = res[0]?.pigpenId
 		})
-		searchChart()
+		if(activeKey.value) {
+			searchChart()
+		} else {
+			chartData.value.list = []
+		}
 	}
 
+	watch(activeKey, (val) => {
+		if (val) {
+			searchChart()
+		}
+	})
+
 	const chartData = ref({
 		location: '',
 		list: []

+ 24 - 0
src/views/biz/wash/account/index.vue

@@ -61,6 +61,9 @@
 					<a-tag v-if="record.status" color="#87d068">在线</a-tag>
 					<a-tag v-else color="red">离线</a-tag>
 				</template>
+				<template v-if="column.dataIndex === 'job'">
+					<span>{{getJobName(record.jobs)}}</span>
+				</template>
 				<template v-if="column.dataIndex === 'action'">
 					<a @click="formRef.onOpen(record, searchFormState)">编辑</a>
 					<a-divider type="vertical" />
@@ -209,6 +212,27 @@
 		})
 	}
 
+	const getJobName = (val) => {
+		let arr = [
+			{ id: 1, name: '场长' },
+			{ id: 2, name: '紧急入场管理员' },
+			{ id: 3, name: '生物安全负责人' },
+			{ id: 4, name: 'PCR检测人员' },
+			{ id: 5, name: '洗消站点工作人员' }
+		]
+		let ids = val.split(',').map(Number)
+		let sub = []
+		arr.forEach(item => {
+			ids.forEach(id => {
+				if(item.id === id) {
+					sub.push(item.name)
+				}
+			})
+		})
+		return sub.join(',')
+
+	}
+
 	const initLocation = () => {
 		washEntranceApi.getPersonLocation().then(res => {
 			locationList.value = res

+ 14 - 6
src/views/biz/wash/drying/index.vue

@@ -28,19 +28,19 @@
 			<a-col :span="6">
 				<div class="box">
 					<div class="box_num" style="color: #698DF7">{{whole.rank}}%</div>
-					<div class="box_title">洗消合格率</div>
+					<div class="box_title">烘干合格率</div>
 				</div>
 			</a-col>
 		</a-row>
-		<a-card title="洗消数量曲线" style="margin-bottom: 10px">
+		<a-card title="烘干数量曲线" style="margin-bottom: 10px">
 			<template #extra>
 				<div class="pcrForm">
 					<a-form>
 						<a-row :gutter="16" align="middle">
 							<a-col :span="12">
 								<a-form-item label="类型">
-									<a-select v-model:value="personType">
-										<a-select-option v-for="item in personList" :key="item.id" :value="item.id">{{item.text}}</a-select-option>
+									<a-select v-model:value="personType" allow-clear>
+										<a-select-option v-for="item in personList" :key="item.value" :value="item.value">{{item.text}}</a-select-option>
 									</a-select>
 								</a-form-item>
 							</a-col>
@@ -84,7 +84,7 @@
 					</a-col>
 					<a-col :span="4">
 						<a-space>
-							<a-button type="primary" @click="search">查询</a-button>
+							<a-button type="primary" @click="table.refresh(true)">查询</a-button>
 							<a-button @click="reset">重置</a-button>
 <!--							<a-button type="primary" @click="derive">导出</a-button>-->
 						</a-space>
@@ -127,6 +127,12 @@
 						<a-tag v-else-if="record.billStatus === 2" color="#f50">烘干异常</a-tag>
 						<a-tag v-else-if="record.billStatus === 3" color="#87d068">审核通过</a-tag>
 					</template>
+					<template v-if="column.dataIndex === 'dryTime'">
+						<span>{{record.dryTime}}分钟</span>
+					</template>
+					<template v-if="column.dataIndex === 'dryTem'">
+						<span>{{record.dryTem}}℃</span>
+					</template>
 					<template v-if="column.dataIndex === 'action'">
 						<a-popconfirm title="删除此消息吗?" @confirm="del(record)">
 							<a-button type="link" danger size="small">删除</a-button>
@@ -182,7 +188,7 @@
 			text: '物资'
 		}
 	])
-	const type = ref('')
+	const type = ref(2)
 	const typeList = ref([
 		{
 			id: 1,
@@ -225,6 +231,7 @@
 		comeId.value = ''
 		destId.value = ''
 		dateTime.value = []
+		table.value.refresh(true)
 	}
 
 
@@ -344,6 +351,7 @@
 	const loadData = (parameter) => {
 		let params = {
 			type: comeId.value,
+			destId: destId.value,
 			startTime: dateTime.value.length ? dateTime.value[0] : '',
 			endTime: dateTime.value.length ? dateTime.value[1] : '',
 			dataType: 2

+ 1 - 1
src/views/biz/wash/entrance/index.vue

@@ -64,7 +64,7 @@
 				</a-col>
 				<a-col :span="8">
 					<a-space>
-						<a-button type="primary" @click="search">
+						<a-button type="primary" @click="table.refresh(true)">
 							<template #icon><SearchOutlined /></template>
 							查询
 						</a-button>

+ 2 - 1
src/views/biz/wash/good/index.vue

@@ -20,7 +20,7 @@
 				</a-col>
 				<a-col :span="4">
 					<a-space>
-						<a-button type="primary" @click="search">查询</a-button>
+						<a-button type="primary" @click="table.refresh(true)">查询</a-button>
 						<a-button @click="reset">重置</a-button>
 						<!--							<a-button type="primary" @click="derive">导出</a-button>-->
 					</a-space>
@@ -102,6 +102,7 @@
 
 	const reset = () => {
 		dateTime.value = []
+		table.value.refresh(true)
 	}
 	const table = ref()
 

+ 2 - 1
src/views/biz/wash/isolation/index.vue

@@ -54,7 +54,7 @@
 				</a-col>
 				<a-col :span="4">
 					<a-space>
-						<a-button type="primary" @click="search">查询</a-button>
+						<a-button type="primary" @click="table.refresh(true)">查询</a-button>
 						<a-button @click="reset">重置</a-button>
 <!--						<a-button type="primary" @click="derive">导出</a-button>-->
 					</a-space>
@@ -178,6 +178,7 @@
 		isolationType.value = ''
 		locationId.value = ''
 		dateTime.value = []
+		table.value.refresh(true)
 	}
 
 	// const derive = () => {}

+ 2 - 1
src/views/biz/wash/luggage/index.vue

@@ -25,7 +25,7 @@
 				</a-col>
 				<a-col :span="4">
 					<a-space>
-						<a-button type="primary" @click="search">查询</a-button>
+						<a-button type="primary" @click="table.refresh(true)">查询</a-button>
 						<a-button @click="reset">重置</a-button>
 <!--						<a-button type="primary" @click="derive">导出</a-button>-->
 					</a-space>
@@ -119,6 +119,7 @@
 	const reset = () => {
 		name.value = ''
 		dateTime.value = []
+		table.value.refresh(true)
 	}
 
 	const derive = () => {}

+ 6 - 3
src/views/biz/wash/pcr/index.vue

@@ -65,8 +65,8 @@
 						<a-row :gutter="16" align="middle">
 							<a-col :span="12">
 								<a-form-item label="类型">
-									<a-select v-model:value="personType">
-										<a-select-option v-for="item in personList" :key="item.id" :value="item.id">{{item.text}}</a-select-option>
+									<a-select v-model:value="personType" allowClear>
+										<a-select-option v-for="item in personList" :key="item.value" :value="item.value">{{item.text}}</a-select-option>
 									</a-select>
 								</a-form-item>
 							</a-col>
@@ -110,7 +110,7 @@
 					</a-col>
 					<a-col :span="4">
 						<a-space>
-							<a-button type="primary" @click="search">查询</a-button>
+							<a-button type="primary" @click="table.refresh(true)">查询</a-button>
 							<a-button @click="reset">重置</a-button>
 <!--							<a-button type="primary" @click="derive">导出</a-button>-->
 						</a-space>
@@ -207,6 +207,9 @@
 	const list = ref([])
 	const type = ref(2)
 
+	watch(type, () => {
+		initChart()
+	})
 	// 检测类型占比
 	const moldChart = ref([])
 	const addressChart = ref([])

+ 1 - 1
src/views/biz/wash/person/index.vue

@@ -47,7 +47,7 @@
 				<a-col :span="4">
 					<a-form-item label="工作地点">
 						<a-select v-model:value="workLocationType">
-							<a-select-option v-for="item in locationList" :key="item.id" :value="item.id">{{item.locationName}}</a-select-option>
+							<a-select-option v-for="item in locationList" :key="item.locationName" :value="item.locationType">{{item.locationName}}</a-select-option>
 						</a-select>
 					</a-form-item>
 				</a-col>

+ 5 - 4
src/views/biz/wash/washing/index.vue

@@ -39,8 +39,8 @@
 						<a-row :gutter="16" align="middle">
 							<a-col :span="12">
 								<a-form-item label="类型">
-									<a-select v-model:value="personType">
-										<a-select-option v-for="item in personList" :key="item.id" :value="item.id">{{item.text}}</a-select-option>
+									<a-select v-model:value="personType" allow-clear>
+										<a-select-option v-for="item in personList" :key="item.value" :value="item.value">{{item.text}}</a-select-option>
 									</a-select>
 								</a-form-item>
 							</a-col>
@@ -84,7 +84,7 @@
 					</a-col>
 					<a-col :span="4">
 						<a-space>
-							<a-button type="primary" @click="search">查询</a-button>
+							<a-button type="primary" @click="table.refresh(true)">查询</a-button>
 							<a-button @click="reset">重置</a-button>
 <!--							<a-button type="primary" @click="derive">导出</a-button>-->
 						</a-space>
@@ -186,7 +186,7 @@
 			text: '物资'
 		},
 	])
-	const type = ref('')
+	const type = ref(2)
 	const typeList = ref([
 		{
 			id: 1,
@@ -331,6 +331,7 @@
 	const loadData = (parameter) => {
 		let params = {
 			type: comeId.value,
+			destId: destId.value,
 			startTime: dateTime.value.length ? dateTime.value[0] : '',
 			endTime: dateTime.value.length ? dateTime.value[1] : '',
 			dataType: 1