安全工器具预警
This commit is contained in:
parent
0e72577081
commit
4909c0e377
|
|
@ -880,6 +880,12 @@
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "材料员确认"
|
"navigationBarTitleText": "材料员确认"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "pages/materialsStation/index/expiryDateList",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "安全工器具预警"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// 材料站 end
|
// 材料站 end
|
||||||
],
|
],
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,102 @@
|
||||||
|
<template>
|
||||||
|
<div class="content">
|
||||||
|
<div class="query">
|
||||||
|
<uni-easyinput
|
||||||
|
errorMessage
|
||||||
|
v-model="queryParams.keyWord"
|
||||||
|
placeholder="请输入关键字"
|
||||||
|
style="margin: 0 5px"
|
||||||
|
/>
|
||||||
|
<button size="mini" style="background-color: #f0a037; color: #fff" @click="getList">
|
||||||
|
查询
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
<!-- 滚动 -->
|
||||||
|
<scroll-view scroll-y="true" class="scroll-container" @scrolltolower="onScrollTolower">
|
||||||
|
<!-- 列表 -->
|
||||||
|
<uni-table ref="table" border stripe emptyText="暂无更多数据">
|
||||||
|
<uni-tr>
|
||||||
|
<uni-th width="50" align="center">序号</uni-th>
|
||||||
|
<uni-th width="150" align="center">设备类型</uni-th>
|
||||||
|
<uni-th width="150" align="center">规格型号</uni-th>
|
||||||
|
<uni-th width="120" align="center">设备编码</uni-th>
|
||||||
|
<uni-th width="100" align="center">本次检修时间</uni-th>
|
||||||
|
<uni-th width="100" align="center">下次检修时间</uni-th>
|
||||||
|
<uni-th width="100" align="center">再用班组</uni-th>
|
||||||
|
</uni-tr>
|
||||||
|
<uni-tr v-for="(item, index) in tableList" :key="index">
|
||||||
|
<uni-td align="center">{{ index + 1 }}</uni-td>
|
||||||
|
<uni-td align="center">{{ item.typeName }}</uni-td>
|
||||||
|
<uni-td align="center">{{ item.typeModelName }}</uni-td>
|
||||||
|
<uni-td align="center">{{ item.maCode || '-' }}</uni-td>
|
||||||
|
<uni-td align="center">{{ item.thisCheckTime || '-' }}</uni-td>
|
||||||
|
<uni-td align="center">{{ item.nextCheckTime || '-' }}</uni-td>
|
||||||
|
<uni-td align="center">{{ item.teamName || '-' }}</uni-td>
|
||||||
|
</uni-tr>
|
||||||
|
</uni-table>
|
||||||
|
<div style="display: flex; justify-content: center; align-items: center; height: 50px">
|
||||||
|
{{ total == tableList.length ? '没有更多数据了~' : '正在加载...' }}
|
||||||
|
</div>
|
||||||
|
</scroll-view>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup>
|
||||||
|
import { ref, computed } from 'vue'
|
||||||
|
import { getAgreementIdApi, getSafeDetailsListApi } from '@/services/materialsStation'
|
||||||
|
import { onLoad } from '@dcloudio/uni-app'
|
||||||
|
|
||||||
|
const queryParams = ref({
|
||||||
|
pageNum: 1,
|
||||||
|
pageSize: 25,
|
||||||
|
keyWord: '',
|
||||||
|
status: '', // 2:临近检期1个月 1:临近检期3个月
|
||||||
|
})
|
||||||
|
const tableList = ref([])
|
||||||
|
const total = ref(0)
|
||||||
|
|
||||||
|
onLoad((opt) => {
|
||||||
|
console.log('🚀 ~ opt:', opt)
|
||||||
|
const params = opt.params ? JSON.parse(opt.params) : null
|
||||||
|
console.log('🚀 ~ params:', params)
|
||||||
|
queryParams.value.status = params.status || ''
|
||||||
|
getList()
|
||||||
|
})
|
||||||
|
|
||||||
|
const onScrollTolower = () => {
|
||||||
|
console.log('滚动到底部')
|
||||||
|
queryParams.value.pageSize += 10
|
||||||
|
getList()
|
||||||
|
}
|
||||||
|
|
||||||
|
const getList = async () => {
|
||||||
|
try {
|
||||||
|
uni.showLoading({ title: '加载中...', mask: true })
|
||||||
|
const { data: agreementIdList } = await getAgreementIdApi()
|
||||||
|
const res = await getSafeDetailsListApi({ ...queryParams.value, agreementIdList })
|
||||||
|
tableList.value = res.data.rows || []
|
||||||
|
total.value = res.data.total || 0
|
||||||
|
} catch (error) {
|
||||||
|
console.error('获取列表失败:', error)
|
||||||
|
} finally {
|
||||||
|
uni.hideLoading()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.content {
|
||||||
|
padding: 10px;
|
||||||
|
}
|
||||||
|
.query {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
color: #f0a037;
|
||||||
|
margin-bottom: 15px;
|
||||||
|
}
|
||||||
|
.scroll-container {
|
||||||
|
height: calc(100vh - 120px);
|
||||||
|
overflow-y: auto;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
<template>
|
<template>
|
||||||
<div v-if="isIOS" :style="{ height: statusBarHeight}"></div>
|
<div v-if="isIOS" :style="{ height: statusBarHeight }"></div>
|
||||||
<view class="page-bg">
|
<view class="page-bg">
|
||||||
<view class="upper-user">
|
<view class="upper-user">
|
||||||
<view class="user-rig">
|
<view class="user-rig">
|
||||||
|
|
@ -8,15 +8,15 @@
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="sliders">
|
<view class="sliders">
|
||||||
<view>
|
<view @click="handleExpiryDate('')">
|
||||||
<h2>{{ todayDatas.normalNum || 0 }}</h2>
|
<h2>{{ todayDatas.normalNum || 0 }}</h2>
|
||||||
<span>检修期内</span>
|
<span>检修期内</span>
|
||||||
</view>
|
</view>
|
||||||
<view>
|
<view @click="handleExpiryDate(1)">
|
||||||
<h2>{{ todayDatas.threeMonthNum || 0 }}</h2>
|
<h2>{{ todayDatas.threeMonthNum || 0 }}</h2>
|
||||||
<span>临近检期3个月</span>
|
<span>临近检期3个月</span>
|
||||||
</view>
|
</view>
|
||||||
<view>
|
<view @click="handleExpiryDate(2)">
|
||||||
<h2>{{ todayDatas.oneMonthNum || 0 }}</h2>
|
<h2>{{ todayDatas.oneMonthNum || 0 }}</h2>
|
||||||
<span>临近检期1个月</span>
|
<span>临近检期1个月</span>
|
||||||
</view>
|
</view>
|
||||||
|
|
@ -50,6 +50,8 @@ import {
|
||||||
getUserInfoByIdCardApi,
|
getUserInfoByIdCardApi,
|
||||||
getToolsLedgerDetailsListApi,
|
getToolsLedgerDetailsListApi,
|
||||||
getBmTeamList,
|
getBmTeamList,
|
||||||
|
getAgreementIdApi,
|
||||||
|
getSafeNumListApi,
|
||||||
} from '@/services/materialsStation'
|
} from '@/services/materialsStation'
|
||||||
import { useMemberStore } from '@/stores'
|
import { useMemberStore } from '@/stores'
|
||||||
|
|
||||||
|
|
@ -166,7 +168,9 @@ const projectInfoList = async () => {
|
||||||
// 预警统计
|
// 预警统计
|
||||||
const getToolsLedgerDetailsList = async () => {
|
const getToolsLedgerDetailsList = async () => {
|
||||||
try {
|
try {
|
||||||
const res = await getToolsLedgerDetailsListApi()
|
const { data: agreementIdList } = await getAgreementIdApi()
|
||||||
|
// console.log('🚀 ~ getAgreementIdApi ~:', agreementIdList)
|
||||||
|
const res = await getSafeNumListApi({ agreementIdList })
|
||||||
todayDatas.normalNum = res.data.normalNum
|
todayDatas.normalNum = res.data.normalNum
|
||||||
todayDatas.threeMonthNum = res.data.threeMonthNum
|
todayDatas.threeMonthNum = res.data.threeMonthNum
|
||||||
todayDatas.oneMonthNum = res.data.oneMonthNum
|
todayDatas.oneMonthNum = res.data.oneMonthNum
|
||||||
|
|
@ -190,6 +194,17 @@ const getTeamList = async () => {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 临期详情
|
||||||
|
const handleExpiryDate = (status) => {
|
||||||
|
console.log('🚀 ~ handleExpiryDate ~ status:', status)
|
||||||
|
const params = {
|
||||||
|
status,
|
||||||
|
}
|
||||||
|
uni.navigateTo({
|
||||||
|
url: `/pages/materialsStation/index/expiryDateList?params=${JSON.stringify(params)}`,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
// 页面显示时获取数据
|
// 页面显示时获取数据
|
||||||
onShow(async () => {
|
onShow(async () => {
|
||||||
userInfo.value = memberStore.userInfo || {}
|
userInfo.value = memberStore.userInfo || {}
|
||||||
|
|
@ -199,7 +214,10 @@ onShow(async () => {
|
||||||
// 查找item.path 是否 在 urlPermissions.value 中 是 item.isShow = true 否则 item.isShow = false
|
// 查找item.path 是否 在 urlPermissions.value 中 是 item.isShow = true 否则 item.isShow = false
|
||||||
item.isShow = urlPermissions.value.includes(item.path)
|
item.isShow = urlPermissions.value.includes(item.path)
|
||||||
})
|
})
|
||||||
console.log('isUsingList.value:', isUsingList.value.every((item) => !item.isShow))
|
console.log(
|
||||||
|
'isUsingList.value:',
|
||||||
|
isUsingList.value.every((item) => !item.isShow),
|
||||||
|
)
|
||||||
if (isUsingList.value.every((item) => !item.isShow)) return
|
if (isUsingList.value.every((item) => !item.isShow)) return
|
||||||
getToolsLedgerDetailsList()
|
getToolsLedgerDetailsList()
|
||||||
getUserInfoByUserName()
|
getUserInfoByUserName()
|
||||||
|
|
|
||||||
|
|
@ -36,19 +36,14 @@
|
||||||
</view>
|
</view>
|
||||||
<view class="table-list-item">
|
<view class="table-list-item">
|
||||||
<uni-forms :model="codeData" label-width="100" :border="true">
|
<uni-forms :model="codeData" label-width="100" :border="true">
|
||||||
<uni-forms-item label="物资名称:" name="materialType">
|
<uni-forms-item label="设备类型:" name="maName">
|
||||||
<text style="height: 100%; display: flex; align-items: center">{{
|
<text style="height: 100%; display: flex; align-items: center">{{
|
||||||
codeData.materialType
|
codeData.maName
|
||||||
}}</text>
|
}}</text>
|
||||||
</uni-forms-item>
|
</uni-forms-item>
|
||||||
<uni-forms-item label="物资类型:" name="materialName">
|
<uni-forms-item label="规格型号:" name="maModel">
|
||||||
<text style="height: 100%; display: flex; align-items: center">{{
|
<text style="height: 100%; display: flex; align-items: center">{{
|
||||||
codeData.materialName
|
codeData.maModel
|
||||||
}}</text>
|
|
||||||
</uni-forms-item>
|
|
||||||
<uni-forms-item label="规格型号:" name="materialModel">
|
|
||||||
<text style="height: 100%; display: flex; align-items: center">{{
|
|
||||||
codeData.materialModel
|
|
||||||
}}</text>
|
}}</text>
|
||||||
</uni-forms-item>
|
</uni-forms-item>
|
||||||
<uni-forms-item label="设备编码:" name="maCode">
|
<uni-forms-item label="设备编码:" name="maCode">
|
||||||
|
|
@ -58,8 +53,11 @@
|
||||||
</uni-forms-item>
|
</uni-forms-item>
|
||||||
</uni-forms>
|
</uni-forms>
|
||||||
</view>
|
</view>
|
||||||
|
<div style="width: 100%">
|
||||||
|
<ElectronicSeal :maCode="codeData?.maCode" :maId="codeData?.maId" />
|
||||||
|
</div>
|
||||||
|
|
||||||
<button type="primary" @click="addCode">添加编码</button>
|
<button type="primary" style="margin-top: 20px;" @click="addCode">添加编码</button>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- 相机预览页面 -->
|
<!-- 相机预览页面 -->
|
||||||
|
|
@ -108,8 +106,10 @@
|
||||||
<script>
|
<script>
|
||||||
import { decryptWithSM4 } from '@/utils/sm'
|
import { decryptWithSM4 } from '@/utils/sm'
|
||||||
import { getDeviceListAPI } from '@/services/picking/outbound'
|
import { getDeviceListAPI } from '@/services/picking/outbound'
|
||||||
|
import ElectronicSeal from '@/components/ElectronicSeal/index.vue'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
components: { ElectronicSeal },
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
showCamera: false,
|
showCamera: false,
|
||||||
|
|
@ -162,8 +162,8 @@ export default {
|
||||||
const params = {
|
const params = {
|
||||||
maCode: this.codeData.maCode,
|
maCode: this.codeData.maCode,
|
||||||
maId: this.codeData.maId,
|
maId: this.codeData.maId,
|
||||||
materialType: this.codeData.materialType,
|
typeName: this.codeData.maModel,
|
||||||
materialName: this.codeData.materialName,
|
materialName: this.codeData.maName,
|
||||||
typeId: this.codeData.typeId,
|
typeId: this.codeData.typeId,
|
||||||
outType: 4,
|
outType: 4,
|
||||||
}
|
}
|
||||||
|
|
@ -505,7 +505,6 @@ export default {
|
||||||
|
|
||||||
console.log('清理后的纯base64:', cleanBase64)
|
console.log('清理后的纯base64:', cleanBase64)
|
||||||
console.log('开始处理图片...')
|
console.log('开始处理图片...')
|
||||||
|
|
||||||
console.log('图片处理完成,开始OCR识别...')
|
console.log('图片处理完成,开始OCR识别...')
|
||||||
|
|
||||||
uni.request({
|
uni.request({
|
||||||
|
|
@ -711,7 +710,7 @@ export default {
|
||||||
},
|
},
|
||||||
|
|
||||||
// 编码检索
|
// 编码检索
|
||||||
async getCode() {
|
getCode() {
|
||||||
if (!this.queryCodeParams.maCode.trim()) {
|
if (!this.queryCodeParams.maCode.trim()) {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: '请输入设备编码',
|
title: '请输入设备编码',
|
||||||
|
|
@ -723,13 +722,13 @@ export default {
|
||||||
getDeviceListAPI({ maCode: this.queryCodeParams.maCode })
|
getDeviceListAPI({ maCode: this.queryCodeParams.maCode })
|
||||||
.then((response) => {
|
.then((response) => {
|
||||||
console.log('xxxxxxxxxxx', response)
|
console.log('xxxxxxxxxxx', response)
|
||||||
if (response.data && response.data.length !== 0) {
|
if (response.code === 200 && response.data && response.data.length > 0) {
|
||||||
this.optionList = response.data.data.map((option) => ({
|
this.optionList = response.data.map((option) => ({
|
||||||
value: option.maId,
|
value: option.maId,
|
||||||
text: option.maCode,
|
text: option.maCode,
|
||||||
}))
|
}))
|
||||||
if (response.data.data.length === 1) {
|
if (response.data.length === 1) {
|
||||||
this.codeData = response.data.data[0]
|
this.codeData = response.data[0]
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
|
|
@ -743,40 +742,6 @@ export default {
|
||||||
console.error('获取设备信息失败', error)
|
console.error('获取设备信息失败', error)
|
||||||
uni.hideLoading()
|
uni.hideLoading()
|
||||||
})
|
})
|
||||||
|
|
||||||
// const response = await new Promise((resolve, reject)=>
|
|
||||||
// {
|
|
||||||
// uni.request({
|
|
||||||
// url: '/material/ma_machine/getHisByCode',
|
|
||||||
// method: 'GET',
|
|
||||||
// data: {maCode: this.queryCodeParams.maCode},
|
|
||||||
// success: resolve,
|
|
||||||
// fail: reject
|
|
||||||
// });
|
|
||||||
// }
|
|
||||||
// )
|
|
||||||
// ;
|
|
||||||
// let res;
|
|
||||||
// if (!response.data.code) {
|
|
||||||
// res=JSON.parse(decryptWithSM4(res.data))
|
|
||||||
// } else {
|
|
||||||
// res =res.data
|
|
||||||
// }
|
|
||||||
// console.log("res", res);
|
|
||||||
// if (response.data?.data && response.data.data.length > 0) {
|
|
||||||
// this.optionList = response.data.data.map(option => ({
|
|
||||||
// value: option.maId,
|
|
||||||
// text: option.maCode
|
|
||||||
// }));
|
|
||||||
// if (response.data.data.length === 1) {
|
|
||||||
// this.codeData = response.data.data[0];
|
|
||||||
// }
|
|
||||||
// } else {
|
|
||||||
// uni.showToast({
|
|
||||||
// title: '未查询到该编号信息',
|
|
||||||
// icon: 'none'
|
|
||||||
// });
|
|
||||||
// }
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('查询失败:', error)
|
console.error('查询失败:', error)
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
|
|
@ -790,22 +755,9 @@ export default {
|
||||||
async changeTag() {
|
async changeTag() {
|
||||||
if (!this.queryCodeParams.maId) return
|
if (!this.queryCodeParams.maId) return
|
||||||
try {
|
try {
|
||||||
const response = await new Promise((resolve, reject) => {
|
const response = await getDeviceListAPI({ maId: this.queryCodeParams.maId })
|
||||||
uni.request({
|
if (response.data && response.data.length !== 0) {
|
||||||
url: '/material/ma_machine/getHisByCode',
|
this.codeData = response.data[0]
|
||||||
method: 'GET',
|
|
||||||
data: { maId: this.queryCodeParams.maId },
|
|
||||||
success: resolve,
|
|
||||||
fail: reject,
|
|
||||||
})
|
|
||||||
})
|
|
||||||
if (response.data?.data && response.data.data.length > 0) {
|
|
||||||
this.codeData = response.data.data[0]
|
|
||||||
} else {
|
|
||||||
uni.showToast({
|
|
||||||
title: '获取编号信息失败',
|
|
||||||
icon: 'none',
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('获取编号信息失败', error)
|
console.error('获取编号信息失败', error)
|
||||||
|
|
|
||||||
|
|
@ -345,3 +345,30 @@ export const confirmMaterialApi = (data) => {
|
||||||
data,
|
data,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 获取协议id
|
||||||
|
export const getAgreementIdApi = (data) => {
|
||||||
|
return http({
|
||||||
|
method: 'GET',
|
||||||
|
url: '/material/material_maMachine/getAgreementId',
|
||||||
|
data,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 查询安全工机具状态数量
|
||||||
|
export const getSafeNumListApi = (data) => {
|
||||||
|
return http({
|
||||||
|
method: 'GET',
|
||||||
|
url: '/material/material_maMachine/getSafeNumList',
|
||||||
|
data,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 临期详情
|
||||||
|
export const getSafeDetailsListApi = (data) => {
|
||||||
|
return http({
|
||||||
|
method: 'GET',
|
||||||
|
url: '/material/material_maMachine/getSafeDetailsList',
|
||||||
|
data,
|
||||||
|
})
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue