This commit is contained in:
bb_pan 2025-06-13 09:02:28 +08:00
parent b3263d44b4
commit a06e1b6fd5
32 changed files with 1085 additions and 294 deletions

View File

@ -2,6 +2,7 @@
export default {
onLaunch: function () {
console.log('App Launch')
plus.screen.lockOrientation('portrait-primary')
},
onShow: function () {
console.log('App Show')

View File

@ -208,7 +208,7 @@
/* 下拉容器样式 外层 */
.ep-picker-content-wrap {
max-height: 30vh;
max-height: 48vh;
width: 100%;
position: absolute;
top: 88rpx;
@ -224,7 +224,7 @@
padding: 3px 0;
box-shadow: 0 0 20rpx 5rpx rgb(0 0 0 / 30%);
border-radius: 5px;
max-height: 281px;
max-height: 46vh;
}
/* 下拉项通用样式 */

View File

@ -1,5 +1,5 @@
{
"name" : "材料站管理",
"name" : "智慧材料站管理系统",
"appid" : "__UNI__AEEB2B7",
"description" : "",
"versionName" : "1.0.1",

View File

@ -134,6 +134,34 @@
"navigationStyle": "custom"
}
},
//
{
"path": "pages/teamLeaseRecord/teamLeaseRecord",
"style": {
"navigationStyle": "custom"
}
},
// 退
{
"path": "pages/teamLeaseRecord/equipmentDetails",
"style": {
"navigationStyle": "custom"
}
},
// 退
{
"path": "pages/teamBackRecord/teamBackRecord",
"style": {
"navigationStyle": "custom"
}
},
//
{
"path": "pages/teamWarning/teamWarning",
"style": {
"navigationStyle": "custom"
}
},
/* */
//
{
@ -654,7 +682,8 @@
"selectedColor": "#1296db",
"borderStyle": "black",
"backgroundColor": "#FFFFFF",
"iconWidth": "24px",
"iconWidth": "28px",
"fontSize": "14px",
"list": [
{
"pagePath": "pages/index/index",

View File

@ -1,172 +1,71 @@
<template>
<view class="page-bg">
<view class="upper-user">
<view class="user-lef">
<!-- <view class="user-lef">
<image src="/src/static/bg1.jpg" mode="" />
</view>
</view> -->
<view class="user-rig">
<view>你好{{ username }}</view>
<view>欢迎使用材料站管理系统</view>
<view>你好</view>
<view>欢迎使用智慧材料站管理系统</view>
</view>
</view>
<view class="sliders">
<view>
<h2>{{ todayDatas.dayLeaseNum || 0 }}</h2>
<span>当日领料</span>
<h2>{{ todayDatas.normalNum || 0 }}</h2>
<span>检修期内</span>
</view>
<view>
<h2>{{ todayDatas.dayBackNum || 0 }}</h2>
<span>当日退料</span>
<h2>{{ todayDatas.threeMonthNum || 0 }}</h2>
<span>临近检期3个月</span>
</view>
<view>
<h2>{{ todayDatas.dayInputNum || 0 }}</h2>
<span>当日入库</span>
</view>
<view>
<h2>{{ todayDatas.dayOutNum || 0 }}</h2>
<span>当日出库</span>
<h2>{{ todayDatas.oneMonthNum || 0 }}</h2>
<span>临近检期1个月</span>
</view>
</view>
<view class="sections">
<view v-for="(part, index) in isUsingList" :key="index" @click="jumpUrl(part.iconMark)">
<!-- <view v-for="(part, index) in isUsingList" :key="index" @click="jumpUrl(part.iconMark)">
<image :src="`../../static/${part.iconMark}.png`" mode="" />
<span>{{ part.iconName }}</span>
</view>
</view>
<h4 style="width: 90%; margin: 3vh auto">业务统计</h4>
<view class="wait-do">
<view class="llsp">
<h4>{{ waitList.leaseNum || 0 }}</h4>
<h5>工器具领料</h5>
</view>
<view class="tlsp">
<h4>{{ waitList.backNum || 0 }}</h4>
<h5>工器具退料</h5>
</view>
<view class="bfsh">
<h4>{{ waitList.scrapNum || 0 }}</h4>
<h5>材料退料</h5>
</view>
<view class="sysh">
<h4>{{ waitList.trialNum || 0 }}</h4>
<h5>材料领料</h5>
</view>
</view>
<!-- <h4
style="
width: 90%;
margin: 3vh auto;
display: flex;
justify-content: space-between;
align-items: center;
"
>
<span>通知公告</span>
<text @click="seeMore" style="color: #5297ff; font-weight: normal; font-size: 12px"
>查看更多>></text
</view> -->
<div
class="item"
v-for="(item, index) in isUsingList"
:key="index"
@click="jumpUrl(item.path)"
>
</h4>
<view
class="single-notice"
v-for="(notice, index) in noticeList"
:key="index"
@click="noticeDetail(notice.noticeId)"
>
<view class="notice-lef">
<image src="/src/static/notice.png" mode="" />
</view>
<view class="notice-rig">
<h4>{{ notice.noticeTitle }}</h4>
<h5>{{ notice.createTime }}</h5>
</view>
<image class="item-icon" :src="`../../static/home/${item.src}.png`" mode="" />
</div>
</view>
<uni-popup ref="popup" type="center" :mask-click="false">
<view class="popup">
<view class="pop-top">
<h4>公告({{ unreadIndex.value + 1 }}/{{ unreadList.value.length }})</h4>
<uni-icons
style="color: #aaaaaa; font-weight: bold"
type="closeempty"
@click="closePopup"
/>
</view>
<view
class="unread-notice"
v-for="(list, index) in unreadList"
:key="index"
v-show="index == unreadIndex"
>
<view class="tit">
{{ list.noticeTitle }}
</view>
<view class="info">
<view>发布人{{ list.createBy }}</view>
<view>发布时间{{ list.createTime }}</view>
<view>公告内容{{ list.noticeContent }}</view>
</view>
<view
class="read-one"
v-show="unreadIndex.value < unreadList.value.length - 1"
@click="readOneNotice(list.noticeId)"
>
我知道了
</view>
</view>
</view>
</uni-popup> -->
</view>
</template>
<script setup>
import { ref, reactive, getCurrentInstance, onMounted } from 'vue'
import { onShow, onNavigationBarButtonTap } from '@dcloudio/uni-app'
import { onLoad } from '@dcloudio/uni-app'
import {
getProjectInfoApi,
getUserInfoByUserNameApi,
getUserInfoByIdCardApi,
updateTeamProjectApi,
getToolsLedgerDetailsListApi,
} from '@/services/index'
const { proxy } = getCurrentInstance()
const popup = ref(null)
const showLoading = ref(false)
const username = ref(uni.getStorageSync('userInfo').username)
const noticeList = ref([])
const todayDatas = reactive({
dayLeaseNum: '',
dayBackNum: '',
dayInputNum: '',
dayBackNum: '',
dayOutNum: '',
})
const waitList = reactive({
lldsp: '',
tldsp: '',
bfdsh: '',
sydsh: '',
leaseNum: '',
backNum: '',
scrapNum: '',
trialNum: '',
normalNum: '', //
threeMonthNum: '', //
oneMonthNum: '', //
})
const isUsingList = ref([
// { iconMark: 'materialsLease', iconName: '' },
// { iconMark: 'materialsBack', iconName: '退' },
{ iconMark: 'toolsLease', iconName: '工器具领料' },
{ iconMark: 'toolsOut', iconName: '工器具出库' },
{ iconMark: 'toolsBack', iconName: '工器具退料' },
{ iconMark: 'toolsLedger', iconName: '工器具台账' },
{ path: 'toolsLease', src: 'lease', isShow: true },
{ path: 'toolsOut', src: 'outStore', isShow: true },
{ path: 'toolsBack', src: 'back', isShow: true },
{ path: 'toolsLedger', src: 'ledger', isShow: true },
{ path: 'teamLeaseRecord', src: 'teamLease', isShow: true },
{ path: 'teamBackRecord', src: 'teamBack', isShow: true },
{ path: 'teamStore', src: 'teamStore', isShow: true },
{ path: 'teamWarning', src: 'teamWarning', isShow: true },
])
const percent = ref('')
const unreadList = ref([])
const unreadIndex = ref(0)
const store = ref([])
function seeMore() {
uni.navigateTo({
url: '/pages/moreNotice/moreNotice',
})
}
function noticeDetail(id) {
uni.navigateTo({
url: `/pages/noticeDetail/noticeDetail?noticeId=${id}`,
})
}
function jumpUrl(path) {
if (path == 'toolsOut') {
const params = {
@ -176,60 +75,83 @@ function jumpUrl(path) {
uni.navigateTo({
url: '/pages/toolsLease/toolsLease?params=' + JSON.stringify(params),
})
} else if (path == 'teamStore') {
const params = {
isTeam: true,
}
uni.navigateTo({
url: '/pages/toolsLedger/toolsLedger?params=' + JSON.stringify(params),
})
} else {
uni.navigateTo({
url: `/pages/${path}/${path}`,
})
}
}
function extractTextFromHTML(htmlString) {
return htmlString.replace(/<[^>]*>/g, '')
const idCard = ref('')
const projectIds = ref([])
const getUserInfoByIdCard = async () => {
const params = {
idCard: idCard.value,
projectIds: projectIds.value,
}
try {
const res = await getUserInfoByIdCardApi(params)
console.log('🚀 ~ getUserInfoByIdCard ~ res:', res)
if (res.code === 200 && res.data && res.data.length > 0) {
const params = {
teamList: res.data,
}
const res2 = await updateTeamProjectApi(params)
console.log('🚀 ~ getUserInfoByIdCard ~ res2:', res2)
}
} catch (error) {
console.log('🚀 ~ getUserInfoByIdCard ~ error:', error)
}
}
function openPopup() {
popup.value && popup.value.open()
const getUserInfoByUserName = async () => {
try {
const userName = uni.getStorageSync('username')
console.log('🚀 ~ getUserInfoByUserName ~ userName:', userName)
const res = await getUserInfoByUserNameApi({ userName })
idCard.value = res.data.idCard
console.log('🚀 ~ getUserInfoByUserName ~ idCard.value:', idCard.value)
} catch (error) {
console.log('🚀 ~ getUserInfoByUserName ~ error:', error)
}
}
function closePopup() {
const noticeArr = unreadList.value.map((item) => item.noticeId)
uploadUnNotice(noticeArr)
popup.value && popup.value.close()
const projectInfoList = async () => {
try {
const res = await getProjectInfoApi({ unitId: null, isApp: true })
if (res.data && res.data.length > 0) {
projectIds.value = res.data.map((item) => item.projectId)
}
} catch (error) {
console.log('🚀 ~ projectInfoList ~ error:', error)
}
}
function readOneNotice(noticeId) {
uploadUnNotice([noticeId])
unreadIndex.value++
}
function uploadUnNotice(arr) {
proxy.$api.index
.uploadNotice({
noticeId: arr,
userId: uni.getStorageSync('userInfo').userid,
})
.then((res) => {
//
})
.catch((err) => {
//
})
//
const getToolsLedgerDetailsList = async () => {
try {
const res = await getToolsLedgerDetailsListApi()
// console.log('🚀 ~ getToolsLedgerDetailsList ~ res:', res)
todayDatas.normalNum = res.data.normalNum
todayDatas.threeMonthNum = res.data.threeMonthNum
todayDatas.oneMonthNum = res.data.oneMonthNum
} catch (error) {
console.log('🚀 ~ getToolsLedgerDetailsList ~ error:', error)
}
}
//
onShow(() => {})
//
onNavigationBarButtonTap((e) => {
if (e.text == '权限') {
uni.navigateTo({
url: '/pages/authManage/authManage',
})
} else if (e.text == '扫一扫') {
uni.scanCode({
success: (res) => {
const fixedRes = res.result.split('=')[1]
uni.navigateTo({
url: `/pages/indexScan/indexScan?scan=${fixedRes}`,
})
},
})
}
onLoad(async () => {
getToolsLedgerDetailsList()
await Promise.all([getUserInfoByUserName(), projectInfoList()])
getUserInfoByIdCard()
})
</script>
@ -246,8 +168,15 @@ onNavigationBarButtonTap((e) => {
margin-bottom: 0;
box-sizing: border-box;
padding: 15rpx;
padding-top: 8vh;
display: flex;
// 768px padding-top
@media (min-width: 768px) {
padding-top: 13%;
}
// 768px padding-top
@media (max-width: 767px) {
padding-top: 7%;
}
.user-lef {
width: 60px;
height: 60px;
@ -271,16 +200,21 @@ onNavigationBarButtonTap((e) => {
}
view:first-child {
font-size: 20px;
@media (min-width: 768px) {
font-size: 24px;
}
}
view:last-child {
font-size: 14px;
letter-spacing: 6rpx;
@media (min-width: 768px) {
font-size: 20px;
}
}
}
}
.sliders {
width: 85%;
/* height: 5vh; */
margin: 4vh auto;
margin-bottom: 2vh;
border-radius: 15rpx 15rpx 0 0;
@ -290,7 +224,7 @@ onNavigationBarButtonTap((e) => {
padding: 1.3vh 0;
display: flex;
view {
width: 25%;
width: 33.3%;
height: 50px;
border-right: 1px solid #cde2ff;
display: flex;
@ -310,25 +244,24 @@ onNavigationBarButtonTap((e) => {
}
}
.sections {
width: 90%;
margin: 15rpx auto;
display: flex;
justify-content: space-around;
flex-wrap: wrap;
box-sizing: border-box;
padding-top: 2vh;
view {
padding-top: 6%;
.item {
width: 25%;
display: flex;
flex-direction: column;
align-items: center;
margin-bottom: 2vh;
image {
width: 70px;
height: 70px;
margin-bottom: 10rpx;
}
span {
font-size: 20rpx;
justify-content: center;
margin-bottom: 1rem;
.item-icon {
width: 68px;
height: 68px;
@media (min-width: 768px) {
width: 120px;
height: 120px;
}
}
}
}

View File

@ -4,7 +4,7 @@
<!-- 如果是h5时则显示登录页面 -->
/*#ifdef H5 */
<view class="login" v-if="origin.indexOf('ticket') == -1">
<view class="login" >
<uni-forms :modelValue="loginForm" label-position="top" class="login-form">
<h1>用户登录</h1>
<uni-forms-item required label="用户名">
@ -20,8 +20,8 @@
/* #endif */
<!-- 如果是app时则显示登录页面 -->
/* #ifdef APP-PLUS */
<view class="login">
<view class="login" v-if="isDev">
<uni-forms :modelValue="loginForm" label-position="top" class="login-form">
<h1>用户登录</h1>
<uni-forms-item required label="用户名">
@ -34,10 +34,11 @@
<view class="login-btn" @tap="onHandleLogin">登录</view>
</uni-forms>
</view>
/* #endif */
</template>
<script setup>
import { onLoad } from '@dcloudio/uni-app'
import { onMounted, reactive, ref } from 'vue'
import { appLoginAPI, getUserInfoAPI, iwsLoginAPI } from '@/services/index.js'
import { useMemberStore } from '@/stores'
@ -45,9 +46,10 @@ const memberStore = useMemberStore()
// h5origin
/* #ifdef H5 */
const origin = window.location.href
// const origin = window.location.href
/* #endif */
const isDev = process.env.NODE_ENV === 'development'
const ticket = ref('')
//
const loginForm = reactive({
username: uni.getStorageSync('username'),
@ -60,21 +62,25 @@ const loginForm = reactive({
})
onMounted(async () => {
const val = JSON.parse(plus.runtime.arguments)
// uni.showToast({
// title: origin,
// icon: 'none',
// duration: 5000,
// title: val.ticket,
// icon: 'none',
// duration: 10000,
// })
// h5origin
/* #ifdef H5 */
console.log('🚀 ~ onMounted ~ origin:', origin)
if (origin.indexOf('ticket') != -1) {
if (val && val.ticket) {
ticket.value = val.ticket
} else {
ticket.value = ''
}
console.log('🚀 ~ onMounted ~ origin:', val)
if (val.ticket) {
try {
uni.showLoading({ title: '登录中' })
const { data: result } = await iwsLoginAPI({
ticket: origin.split('ticket=')[1].split('#/')[0],
ticket: val.ticket,
sysType: 1,
})
@ -82,10 +88,12 @@ onMounted(async () => {
memberStore.setToken(result.access_token)
// 2 .
const res = await getUserInfoAPI()
console.log('🚀 ~ getUserInfoAPI ~ res:', res)
uni.hideLoading()
memberStore.setUserInfo(res.user)
uni.showToast({ title: '登录成功!', icon: 'none' })
uni.setStorageSync('username', loginForm.username)
uni.setStorageSync('password', loginForm.password)
uni.setStorageSync('username', res.user.username)
uni.setStorageSync('password', res.user.password)
uni.setStorageSync('id', res.user.userId)
setTimeout(() => {
uni.switchTab({
@ -98,7 +106,6 @@ onMounted(async () => {
showToast('登录失败')
}
}
/* #endif */
})
//
@ -112,6 +119,7 @@ const onHandleLogin = async () => {
memberStore.setToken(res.data.access_token)
// 2 .
const result = await getUserInfoAPI()
console.log('🚀 ~ getUserInfoAPI ~ result:', result)
memberStore.setUserInfo(result.user)
uni.showToast({ title: '登录成功!', icon: 'none' })
uni.setStorageSync('username', loginForm.username)

View File

@ -0,0 +1,166 @@
<template>
<uni-nav-bar dark :fixed="true" shadow background-color="#4AA4EA" status-bar title="退料记录">
<template v-slot:left>
<view style="font-size: 18px; display: flex; align-items: center" @click="back">
<!-- 图标 -->
<uni-icons type="left" size="20" color="#fff"></uni-icons>
<!-- 文本 -->
<text>返回</text>
</view>
</template>
</uni-nav-bar>
<div class="content">
<div class="query">
<uni-datetime-picker
v-model="queryParams.range"
type="daterange"
start-placeholder="开始时间"
end-placeholder="结束时间"
/>
<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 @scrolltolower="onScrollTolower">
<uni-swipe-action>
<uni-swipe-action-item
v-for="(item, index) in tableList"
:right-options="item.options"
:key="index"
>
<div class="list" @click="handleItem(item)">
<div style="margin-right: 8px">{{ index + 1 }}.</div>
<div class="item">
<div>退料时间: {{ item.createTime }}</div>
<div>退料单号: {{ item.code }}</div>
<div>退料工器具: {{ item.typeName }}</div>
<div>退料班组: {{ item.teamName }}</div>
<div>退料工程: {{ item.proName }}</div>
<div>班组长: {{ item.backPerson }}</div>
<div>已退数量: {{ item.backNum || 0 }}</div>
<div style="line-height: 1.8; display: flex; align-items: center">
<span style="margin-right: 5px">是否签名:</span>
<uni-tag
:text="item.isElectronicSign == 1 ? '未签名' : '已签名'"
:inverted="true"
:type="item.isElectronicSign == 1 ? 'error' : 'success'"
/>
</div>
</div>
</div>
</uni-swipe-action-item>
</uni-swipe-action>
<div style="display: flex; justify-content: center; align-items: center; height: 50px">
{{ finish ? '没有更多数据了~' : '正在加载...' }}
</div>
</scroll-view>
</div>
</template>
<script setup>
import { onLoad, onShow } from '@dcloudio/uni-app'
import { ref, reactive, computed } from 'vue'
import { getBackListAPI } from '@/services/picking/outbound.js'
const queryParams = reactive({
pageNum: 1,
pageSize: 10,
range: [],
keyWord: '',
taskStatus: 1,
})
const tableList = ref([])
const total = ref(0)
const finish = computed(() => {
if (total.value === tableList.value.length) return true
})
const back = () => {
uni.navigateBack({
delta: 1,
})
}
const getList = async () => {
const params = {
pageNum: queryParams.pageNum,
pageSize: queryParams.pageSize,
startTime: queryParams.range && queryParams.range[0],
endTime: queryParams.range && queryParams.range[1],
keyWord: queryParams.keyWord,
appTaskStatus: 1,
}
console.log('🚀 ~ getList ~ params:', params)
try {
const res = await getBackListAPI(params)
console.log('🚀 ~ getList ~ res:', res)
if (res.code == 200) {
tableList.value = res.data.rows
total.value = res.data.total
}
} catch (error) {
console.log('🚀 ~ getList ~ error:', error)
tableList.value = []
total.value = 0
}
}
//
const onScrollTolower = () => {
console.log('🚀 ~ onScrollTolower ~ onScrollTolower:')
if (total.value > tableList.value.length) {
queryParams.pageSize += 10
getList()
}
}
const handleItem = async (item) => {
console.log('🚀 ~ handleItem ~ item:', item)
uni.navigateTo({
url: `/pages/teamLeaseRecord/equipmentDetails?id=${item.id}&isBack=${true}`,
})
}
onLoad((opt) => {
console.log('🚀 ~ onLoad ~ opt:', opt)
})
onShow(() => {
setTimeout(() => {
getList()
}, 300)
})
</script>
<style lang="scss" scoped>
.content {
padding: 10px;
height: calc(100vh - 150px);
.query {
display: flex;
justify-content: space-between;
align-items: center;
padding: 10px;
background: #fff;
margin-bottom: 10px;
border-radius: 8px;
}
.list {
min-height: 120px;
margin-top: 10px;
background: #fafafa;
border-radius: 6px;
padding: 8px;
display: flex;
}
}
</style>

View File

@ -0,0 +1,117 @@
<template>
<uni-nav-bar dark :fixed="true" shadow background-color="#4AA4EA" status-bar title="详情">
<template v-slot:left>
<view style="font-size: 18px; display: flex; align-items: center" @click="back">
<!-- 图标 -->
<uni-icons type="left" size="20" color="#fff"></uni-icons>
<!-- 文本 -->
<text>返回</text>
</view>
</template>
</uni-nav-bar>
<div class="content" v-for="(item, index) in tableList" :key="index">
<div class="list" @click="handleItem(item)">
<div style="margin-right: 8px">{{ index + 1 }}.</div>
<div class="item">
<div>类型名称: {{ isBack ? item.materialName : item.maTypeName }}</div>
<div>规格型号: {{ item.typeName }}</div>
<div>单位: {{ item.unitName }}</div>
<div>管理模式: {{ item.manageType == 0 ? '编码管理' : '数量管理' }}</div>
<div>已领数量: {{ item.preNum || 0 }}</div>
</div>
</div>
</div>
<div
style="display: flex; justify-content: center; align-items: center; height: 50px; margin: 20px"
>
{{ '没有更多数据了~' }}
</div>
<uni-popup ref="popup" type="center" border-radius="6px 6px 6px 6px" background-color="#fff">
<div style="padding: 20px">
<div>编码详情</div>
<div class="code-list">
<div v-for="(item, index) in popupRow" :key="index">
<span>{{ item.maCode }}</span>
</div>
</div>
</div>
</uni-popup>
</template>
<script setup>
import { ref } from 'vue'
import { onLoad } from '@dcloudio/uni-app'
import { detailsLeaseTask, detailsBackTask } from '@/services/back.js'
const teamId = ref('')
const isBack = ref(false)
const tableList = ref([])
const popup = ref()
const popupRow = ref([])
onLoad((opt) => {
console.log('🚀 ~ onLoad ~ opt:', opt)
teamId.value = opt.id
isBack.value = opt.isBack ? true : false
console.log('🚀 ~ onLoad ~ isBack.value:', isBack.value)
if (isBack.value) {
getBackDetailsById()
} else {
getDetailsById()
}
})
const back = () => {
uni.navigateBack({
delta: 1,
})
}
//
const getDetailsById = async () => {
try {
const res = await detailsLeaseTask(teamId.value)
console.log('🚀 ~ getDetailsById ~ res:', res)
tableList.value = res.data.leaseOutDetailsList
} catch (error) {
console.log('🚀 ~ getDetailsById ~ error:', error)
}
}
// 退
const getBackDetailsById = async () => {
try {
const res = await detailsBackTask(teamId.value)
console.log('🚀 ~ getBackDetailsById ~ res:', res)
tableList.value = res.data.backApplyDetailsList
} catch (error) {
console.log('🚀 ~ getBackDetailsById ~ error:', error)
}
}
const handleItem = (item) => {
console.log('🚀 ~ handleItem ~ item:', item)
popupRow.value = []
if (item.manageType == 0) {
//
popupRow.value = item.maCodeList
popup.value.open()
}
}
</script>
<style lang="scss" scoped>
.content {
padding: 10px;
.list {
min-height: 120px;
margin-top: 10px;
background: #fafafa;
border-radius: 6px;
padding: 8px;
display: flex;
}
}
</style>

View File

@ -0,0 +1,166 @@
<template>
<uni-nav-bar dark :fixed="true" shadow background-color="#4AA4EA" status-bar title="领料记录">
<template v-slot:left>
<view style="font-size: 18px; display: flex; align-items: center" @click="back">
<!-- 图标 -->
<uni-icons type="left" size="20" color="#fff"></uni-icons>
<!-- 文本 -->
<text>返回</text>
</view>
</template>
</uni-nav-bar>
<div class="content">
<div class="query">
<uni-datetime-picker
v-model="queryParams.range"
type="daterange"
start-placeholder="开始时间"
end-placeholder="结束时间"
/>
<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 @scrolltolower="onScrollTolower">
<uni-swipe-action>
<uni-swipe-action-item
v-for="(item, index) in tableList"
:right-options="item.options"
:key="index"
>
<div class="list" @click="handleItem(item)">
<div style="margin-right: 8px">{{ index + 1 }}.</div>
<div class="item">
<div>申请时间: {{ item.createTime }}</div>
<div>领料单号: {{ item.code }}</div>
<div>领料工器具: {{ item.maTypeNames }}</div>
<div>领料班组: {{ item.teamName }}</div>
<div>领料工程: {{ item.projectName }}</div>
<div>班组长: {{ item.leasePerson }}</div>
<div>已领数量: {{ item.alNum || 0 }}</div>
<div style="line-height: 1.8; display: flex; align-items: center">
<span style="margin-right: 5px">是否签名:</span>
<uni-tag
:text="item.isElectronicSign == 1 ? '未签名' : '已签名'"
:inverted="true"
:type="item.isElectronicSign == 1 ? 'error' : 'success'"
/>
</div>
</div>
</div>
</uni-swipe-action-item>
</uni-swipe-action>
<div style="display: flex; justify-content: center; align-items: center; height: 50px">
{{ finish ? '没有更多数据了~' : '正在加载...' }}
</div>
</scroll-view>
</div>
</template>
<script setup>
import { onLoad, onShow } from '@dcloudio/uni-app'
import { ref, reactive, computed } from 'vue'
import { getPickingOutboundListAPI } from '@/services/picking/outbound.js'
const queryParams = reactive({
pageNum: 1,
pageSize: 10,
range: [],
keyWord: '',
taskStatus: 1,
})
const tableList = ref([])
const total = ref(0)
const finish = computed(() => {
if (total.value === tableList.value.length) return true
})
const back = () => {
uni.navigateBack({
delta: 1,
})
}
const getList = async () => {
const params = {
pageNum: queryParams.pageNum,
pageSize: queryParams.pageSize,
startTime: queryParams.range && queryParams.range[0],
endTime: queryParams.range && queryParams.range[1],
keyWord: queryParams.keyWord,
statusList: [4],
}
console.log('🚀 ~ getList ~ params:', params)
try {
const res = await getPickingOutboundListAPI(params)
console.log('🚀 ~ getList ~ res:', res)
if (res.code == 200) {
tableList.value = res.data.rows
total.value = res.data.total
}
} catch (error) {
console.log('🚀 ~ getList ~ error:', error)
tableList.value = []
total.value = 0
}
}
//
const onScrollTolower = () => {
console.log('🚀 ~ onScrollTolower ~ onScrollTolower:')
if (total.value > tableList.value.length) {
queryParams.pageSize += 10
getList()
}
}
const handleItem = async (item) => {
console.log('🚀 ~ handleItem ~ item:', item)
uni.navigateTo({
url: `/pages/teamLeaseRecord/equipmentDetails?id=${item.id}`,
})
}
onLoad((opt) => {
console.log('🚀 ~ onLoad ~ opt:', opt)
})
onShow(() => {
setTimeout(() => {
getList()
}, 300)
})
</script>
<style lang="scss" scoped>
.content {
padding: 10px;
height: calc(100vh - 150px);
.query {
display: flex;
justify-content: space-between;
align-items: center;
padding: 10px;
background: #fff;
margin-bottom: 10px;
border-radius: 8px;
}
.list {
min-height: 120px;
margin-top: 10px;
background: #fafafa;
border-radius: 6px;
padding: 8px;
display: flex;
}
}
</style>

View File

@ -0,0 +1,153 @@
<template>
<uni-nav-bar dark :fixed="true" shadow background-color="#4AA4EA" status-bar title="班组预警">
<template v-slot:left>
<view style="font-size: 18px; display: flex; align-items: center" @click="back">
<!-- 图标 -->
<uni-icons type="left" size="20" color="#fff"></uni-icons>
<!-- 文本 -->
<text>返回</text>
</view>
</template>
</uni-nav-bar>
<div class="content">
<div class="query">
<uni-data-select
v-model="queryParams.teamId"
:localdata="teamList"
filterable
:clear="false"
@change="getList"
style="margin-right: 10px"
></uni-data-select>
<uni-data-select
v-model="queryParams.status"
:localdata="statusList"
filterable
@change="getList"
style="margin-right: 10px"
></uni-data-select>
</div>
<!-- 列表 -->
<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="60" 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">{{ getStatusText(item.status) }}</uni-td>
</uni-tr>
</uni-table>
</div>
</template>
<script setup>
import { onLoad } from '@dcloudio/uni-app'
import { ref, reactive, computed } from 'vue'
import { getBmTeamList } from '@/services/back.js'
import { getTeamWarnDetailsListApi } from '@/services/index.js'
const queryParams = reactive({
teamId: '',
status: '',
})
const teamList = ref([])
const statusList = ref([
{ value: 0, text: '正常' },
{ value: 1, text: '临近检期3个月' },
{ value: 2, text: '临近检期1个月' },
{ value: 3, text: '超期' },
])
const tableList = ref([])
// 0 1\2 3 使computed
const getStatusText = (status) => {
if (status == 0) {
return '正常'
} else if (status == 1 || status == 2) {
return '临检'
} else if (status == 3) {
return '超期'
}
return '-'
}
onLoad(() => {
console.log('🚀 ~ onLoad ~ opt:')
getTeamList()
})
const back = () => {
uni.navigateBack({
delta: 1,
})
}
//
const getTeamList = async () => {
try {
const res = await getBmTeamList({ isAll: 0 })
if (res.data.length > 0) {
teamList.value = res.data.map((item) => {
return {
...item,
value: item.id,
text: item.teamName,
}
})
queryParams.teamId = res.data[0].id
}
getList()
} catch (error) {
console.log('🚀 ~ getTeamList ~ error:', error)
}
}
const getList = async () => {
console.log('🚀 ~ getList ~ queryParams:', queryParams)
const params = {
teamId: queryParams.teamId,
status: queryParams.status,
}
try {
const res = await getTeamWarnDetailsListApi(params)
console.log('🚀 ~ getList ~ res:', res)
tableList.value = res.data
} catch (error) {
console.log('🚀 ~ getList ~ error:', error)
}
}
</script>
<style scoped lang="scss">
.content {
padding: 10px;
height: calc(100vh - 150px);
.query {
display: flex;
justify-content: space-between;
align-items: center;
padding: 10px;
background: #fff;
margin-bottom: 10px;
border-radius: 8px;
}
.list {
min-height: 120px;
margin-top: 10px;
background: #fafafa;
border-radius: 6px;
padding: 8px;
display: flex;
}
}
</style>

View File

@ -20,15 +20,31 @@
<uni-forms ref="form" :rules="rules" :model="formData" label-width="80px">
<uni-forms-item label="退料班组" required name="teamId">
<uni-data-select
v-if="!opts.isEdit"
v-model="formData.teamId"
:localdata="teamRange"
:clear="false"
filterable
:disabled="opts.isEdit"
@change="changeTeamd"
></uni-data-select>
<uni-easyinput
v-else
v-model="formData.teamName"
disabled
></uni-easyinput>
</uni-forms-item>
<uni-forms-item label="工程名称" required name="projectId">
<eselect
<uni-data-select
v-if="!opts.isEdit"
v-model="formData.projectId"
:localdata="prodRange"
:clear="false"
filterable
:disabled="opts.isEdit || !formData.teamId"
@change="changeProd"
></uni-data-select>
<!-- <eselect
v-if="!opts.isEdit"
style="width: 100%; height: 45rpx"
v-model="formData.projectId"
@ -41,11 +57,11 @@
formData.projectId = ''
}
"
></eselect>
></eselect> -->
<uni-easyinput v-else v-model="formData.proName" disabled></uni-easyinput>
</uni-forms-item>
<uni-forms-item label="退料人员" required name="backPerson">
<uni-easyinput v-model="formData.backPerson" placeholder="请输入内容"></uni-easyinput>
<uni-easyinput v-model="formData.backPerson" placeholder="请输入内容" disabled></uni-easyinput>
</uni-forms-item>
<uni-forms-item label="联系电话" name="phone">
<uni-easyinput
@ -210,6 +226,7 @@ const getTeamList = async () => {
text: item.teamName,
}
})
getProjectListApi()
}
} catch (error) {
console.log('🚀 ~ getTeamList ~ error:', error)
@ -219,8 +236,16 @@ const getTeamList = async () => {
const getProjectListApi = async () => {
console.log('🚀 ~ 工程')
try {
const res = await getProjectList()
prodRange.value = res.data
const res = await getProjectList({ unitId: null, isApp: true, teamName: formData.teamName })
if (!res.data || !res.data.length) return
console.log('🚀 ~ getProjectListApi ~ res:', res)
prodRange.value = res.data.map((item) => {
return {
...item,
value: item.proId,
text: item.proName,
}
})
} catch (error) {
console.log('🚀 ~ getProjectListApi ~ error:', error)
}
@ -315,18 +340,21 @@ const checkPerNum = (item) => {
//
const changeTeamd = (e) => {
console.log('🚀 ~ changeTeamd ~ e:', e)
const team = teamRange.value.find((item) => item.id === e)
console.log('🚀 ~ changeTeamd ~ team:', team)
formData.projectId = null
formData.teamName = team ? team.teamName : ''
formData.backPerson = team ? team.relName : ''
formData.teamId = e
if (formData.teamId && formData.teamId.length > 0) {
getAgreement()
}
getProjectListApi()
}
//
const changeProd = (e) => {
console.log('🚀 ~ changeProd ~ e:', e)
formData.projectId = e.id
if (formData.projectId && formData.projectId.length > 0) {
getAgreement()
}
formData.projectId = e
getAgreement()
// if (formData.projectId && formData.projectId.length > 0) {
// }
}
//
const changeEquipment = (e) => {
@ -496,11 +524,12 @@ onLoad((opt) => {
console.log('onLoad', opt)
opts.value = opt.params ? JSON.parse(opt.params) : {}
title.value = opts.value.isEdit ? '编辑工器具退料' : '新增工器具退料'
getTeamList()
getProjectListApi()
// getProjectListApi()
// getEquipmentList()
if (opts.value.isEdit) {
getDetailsById()
} else {
getTeamList()
}
})
onShow(() => {

View File

@ -19,13 +19,12 @@
<uni-datetime-picker
v-model="queryParams.range"
type="daterange"
start-placeholder="开始"
end-placeholder="结束"
start-placeholder="开始时间"
end-placeholder="结束时间"
/>
<uni-easyinput
errorMessage
v-model="queryParams.keyWord"
focus
placeholder="请输入内容"
style="margin: 0 5px"
/>

View File

@ -48,9 +48,9 @@
<text>{{ isSelectNum }} / {{ codeDeviceList.length }} 条已选</text>
</checkbox-group>
</uni-forms-item>
<uni-forms-item label="" name="">
<uni-forms-item label="" name="" v-if="codeDeviceList.length > 0">
<div
style="display: flex; align-items: center; flex-wrap: wrap"
style="display: flex; align-items: center; flex-wrap: wrap; max-height: 249px;overflow-y: auto;"
>
<div
v-for="(item, index) in codeDeviceList"
@ -93,13 +93,13 @@
</uni-col>
-->
<uni-col :span="6">
<button style="width: 100px" type="primary" @click="scanStart">二维码出库</button>
<button class="item-btn" type="primary" @click="scanStart">二维码出库</button>
</uni-col>
<uni-col :span="6">
<button style="width: 100px" type="primary" @click="handleRfid">RFID识别</button>
<button class="item-btn" type="primary" @click="handleRfid">RFID识别</button>
</uni-col>
<uni-col :span="6">
<button style="width: 100px" type="primary" @click="ocrClick">OCR识别</button>
<button class="item-btn" type="primary" @click="ocrClick">OCR识别</button>
</uni-col>
</uni-row>
</view>
@ -636,12 +636,13 @@ const scanStart = () => {
console.log('🚀 ~ success: ~ res:', res)
if (res.code === 200) {
if (res.data && res.data.recordList.length > 0) {
codeDeviceList.value.push(...res.data.recordList)
codeDeviceList.value.unshift(...res.data.recordList)
//
if (codeDeviceList.value.length > 0) {
const seen = new Set()
codeDeviceList.value = codeDeviceList.value.filter((item) => {
if (!item.maCode || seen.has(item.maCode)) {
uni.showToast({ title: '设备已添加', icon: 'none' })
return false
}
seen.add(item.maCode)
@ -652,8 +653,9 @@ const scanStart = () => {
item.materialName = item.typeName
item.materialModel = item.typeModelName
item.outType = 2 //
item.checked = false //
item.checked = true //
})
allChecked.value = codeDeviceList.value.every((e) => e.checked)
}
} else {
uni.showToast({ title: res.data.msg, icon: 'none', duration: 1500 })
@ -796,6 +798,17 @@ const ocrClick = () => {
border-radius: 20rpx;
box-shadow: 0 4rpx 16rpx rgba(0, 0, 0, 0.06);
margin-bottom: 24rpx;
.item-btn {
@media (min-width: 768px) {
width: 100px;
font-size: 15px;
}
// 768px padding-top
@media (max-width: 767px) {
width: 80px;
font-size: 14px;
}
}
//
:deep(.uni-forms) {

View File

@ -64,16 +64,16 @@
<div>预领数量: {{ item.preCountNum || 0 }}</div>
<div>已领数量: {{ item.alNum || 0 }}</div>
<div>待领数量: {{ item.waitCountNum || 0 }}</div>
<div>
状态:
<div style="line-height: 1.8; display: flex; align-items: center">
<span style="margin-right: 5px;">状态:</span>
<uni-tag
:text="item.taskStatusName"
:inverted="true"
:type="item.taskStatus == 4 ? 'success' : 'error'"
/>
</div>
<div>
是否签名:
<div style="line-height: 1.8; display: flex; align-items: center">
<span style="margin-right: 5px;">是否签名:</span>
<uni-tag
:text="item.isElectronicSign == 1 ? '未签名' : '已签名'"
:inverted="true"
@ -160,6 +160,9 @@ const getList = async () => {
{ text: '编辑', style: { backgroundColor: '#2f8cf0' } },
{ text: '删除', style: { backgroundColor: '#ff4949' } },
]
if (opts.value.isOut) {
options[1].text = '出库'
}
console.log('🚀 ~ tableList.value=res.data.rows.map ~ item.taskStatus:', item.taskStatus)
// if (!opts.value.isOut && item.taskStatus != 4) {
// options = options.filter((option) => option.text !== '')
@ -310,7 +313,7 @@ const onClickSwipe = async (e, item) => {
icon: 'none',
})
}
} else if (e.content.text == '编辑') {
} else if (e.content.text == '出库' || e.content.text == '编辑') {
//
const params = JSON.stringify({
id: item.id,

View File

@ -20,15 +20,22 @@
<uni-forms ref="form" :rules="rules" :model="formData" label-width="80px">
<uni-forms-item label="领料班组" required name="teamId">
<uni-data-select
v-if="!opts.isEdit"
v-model="formData.teamId"
:localdata="teamRange"
filterable
:clear="false"
:disabled="opts.isEdit"
@change="changeTeamd"
></uni-data-select>
<uni-easyinput
v-else
v-model="formData.teamName"
disabled
></uni-easyinput>
</uni-forms-item>
<uni-forms-item label="领用工程" required name="projectId">
<eselect
<!-- <eselect
v-if="!opts.isEdit"
style="width: 100%; height: 45rpx"
v-model="formData.projectId"
@ -41,11 +48,24 @@
formData.projectId = ''
}
"
></eselect>
></eselect> -->
<uni-data-select
v-if="!opts.isEdit"
v-model="formData.projectId"
:localdata="prodRange"
:clear="false"
filterable
:disabled="opts.isEdit || !formData.teamId"
@change="changeProd"
></uni-data-select>
<uni-easyinput v-else v-model="formData.projectName" disabled></uni-easyinput>
</uni-forms-item>
<uni-forms-item label="班组长" required name="leasePerson">
<uni-easyinput v-model="formData.leasePerson" placeholder="请输入内容"></uni-easyinput>
<uni-easyinput
v-model="formData.leasePerson"
placeholder="请输入内容"
disabled
></uni-easyinput>
</uni-forms-item>
<uni-forms-item label="联系电话" name="phone">
<uni-easyinput
@ -80,6 +100,7 @@
<uni-th width="180" align="center">规格型号</uni-th>
<uni-th width="80" align="center">在库数</uni-th>
<uni-th width="80" align="center">在用数</uni-th>
<uni-th width="80" align="center">预领数</uni-th>
<uni-th width="100" align="center">{{ opts.isOut ? '出库数' : '领用数' }}</uni-th>
<uni-th width="100" align="center">操作</uni-th>
</uni-tr>
@ -91,9 +112,10 @@
</uni-td>
<uni-td align="center">{{ item.storageNum }}</uni-td>
<uni-td align="center">{{ item.useNum }}</uni-td>
<uni-td align="center">{{ item.preNum }}</uni-td>
<uni-td align="center"
><uni-easyinput
v-if="item.manageType == 1"
v-if="item.manageType == 1 || !opts.isOut"
v-model="item.preNum"
placeholder="请输入数量"
type="number"
@ -101,11 +123,11 @@
></uni-easyinput>
<!-- 编码 -->
<span v-else style="color: #409eff" @click="getCode(item)">{{
item.maCodeList.length == 0 ? '选择编码' : item.maCodeList.length
!item.maCodeList || item.maCodeList.length == 0 ? '选择编码' : item.maCodeList.length
}}</span>
</uni-td>
<uni-td align="center">
<view>
<view style="display: flex;align-items: center; justify-content: center; flex-direction: column;">
<button
class="uni-button"
size="mini"
@ -119,10 +141,11 @@
删除
</button>
<button
v-if="item.manageType == 0"
v-if="item.manageType == 0 && !item.maCodeList"
class="uni-button"
size="mini"
@click="handleDetail(item)"
style="margin-top: 5px;"
>
详情
</button>
@ -225,6 +248,10 @@ const getTeamList = async () => {
text: item.teamName,
}
})
formData.teamId = res.data[0].id
formData.teamName = res.data[0].teamName
formData.leasePerson = res.data[0].relName
getProjectListApi()
}
} catch (error) {
console.log('🚀 ~ getTeamList ~ error:', error)
@ -233,8 +260,16 @@ const getTeamList = async () => {
//
const getProjectListApi = async () => {
try {
const res = await getProjectList()
prodRange.value = res.data
const res = await getProjectList({ unitId: null, isApp: true, teamName: formData.teamName })
if (!res.data || !res.data.length) return
console.log('🚀 ~ getProjectListApi ~ res:', res)
prodRange.value = res.data.map((item) => {
return {
...item,
value: item.proId,
text: item.proName,
}
})
} catch (error) {
console.log('🚀 ~ getProjectListApi ~ error:', error)
}
@ -329,20 +364,28 @@ const checkPerNum = (item) => {
}
//
const changeTeamd = () => {
const changeTeamd = (e) => {
console.log('🚀 ~ changeTeamd ~ e:', e)
const team = teamRange.value.find((item) => item.id === e)
console.log('🚀 ~ changeTeamd ~ team:', team)
formData.projectId = null
formData.teamName = team ? team.teamName : ''
formData.leasePerson = team ? team.relName : ''
equipmentList.value = []
if (formData.teamId && formData.projectId) {
getAgreementInfoById()
}
getProjectListApi()
// if (formData.teamId && formData.projectId) {
// getAgreementInfoById()
// }
}
//
const changeProd = (e) => {
console.log('🚀 ~ changeProd ~ e:', e)
formData.projectId = e.id
formData.projectId = e
equipmentList.value = []
if (formData.teamId && formData.projectId) {
getAgreementInfoById()
}
getAgreementInfoById()
// if (formData.teamId && formData.projectId) {
// }
}
//
const changeEquipment = (e) => {
@ -400,7 +443,7 @@ const handleDetail = (item) => {
//
const getCode = (item) => {
console.log('🚀 ~ getCode ~ item:', item)
if (item.maCodeList.length > 0) {
if (item.maCodeList && item.maCodeList.length > 0) {
item.maCodeList.forEach((code) => {
code.checked = true
})
@ -428,23 +471,24 @@ const submit = (isOut) => {
})
return
}
// tableData.value preNum 0, 0
if (opts.value.isOut) {
for (let i = 0; i < tableData.value.length; i++) {
console.log('🚀 ~ .then ~ tableData.value[i].preNum:', tableData.value[i].preNum)
if (tableData.value[i].preNum < 1) {
await uni.showToast({
title: `${i + 1}行出库数量不能为0`,
icon: 'none',
duration: 1000,
})
return
}
}
}
tableData.value.forEach((item) => {
if (item.manageType == 0 && opts.value.isOut) {
item.preNum = item.maCodeList ? item.maCodeList.length : 0
}
item.outNum = item.preNum
})
// tableData.value preNum 0, 0
for (let i = 0; i < tableData.value.length; i++) {
console.log('🚀 ~ .then ~ tableData.value[i].preNum:', tableData.value[i].preNum)
if (tableData.value[i].preNum < 1) {
await uni.showToast({
title: `${i + 1}行出库数量不能为0`,
icon: 'none',
duration: 1000,
})
return
}
}
const params = {
leaseApplyDetailsList: tableData.value,
@ -559,11 +603,13 @@ onLoad((opt) => {
// formData.projectName = opts.value.projectName
// rules.value = {}
// }
getTeamList()
getProjectListApi()
// getProjectListApi()
// getEquipmentList()
if (opts.value.isEdit) {
getDetailsById()
} else {
getTeamList()
}
})
onShow(() => {

View File

@ -10,12 +10,24 @@
<div class="content">
<div class="search-box">
<uni-data-select
v-if="isTeam"
v-model="queryParams.teamId"
:localdata="teamList"
filterable
:clear="false"
@change="getList"
style="margin-right: 10px;"
></uni-data-select>
<uni-easyinput
v-model="searchText"
v-model="queryParams.keyWord"
placeholder="搜索物资名称、规格型号"
prefixIcon="search"
clearable
/>
<button size="mini" style="background-color: #f0a037; color: #fff; margin-left: 10px;" @click="getList">
查询
</button>
</div>
<scroll-view scroll-y class="scroll-container">
@ -50,21 +62,33 @@
<div class="equipment-info">
<div class="equipment-name">{{ category.name }}</div>
<div class="equipment-spec">{{ spec.model }}</div>
<div class="equipment-spec" v-if="isTeam">{{ spec.maCode }}</div>
</div>
<div class="equipment-quantity">在库数量{{ spec.quantity }}</div>
<div class="equipment-quantity"><span>{{ isTeam ? '在用数量:' : '在库数量:' }}</span>{{ isTeam ? spec.usNum : spec.quantity }}</div>
</div>
</div>
</div>
</div>
<div style="display: flex; justify-content: center; align-items: center; height: 50px; margin: 10px 0;">
{{ '没有更多数据了~' }}
</div>
</scroll-view>
</div>
</template>
<script setup>
import { onMounted, ref, computed } from 'vue'
import { getToolsLedgerList } from "../../services/ledger";
import { onLoad } from '@dcloudio/uni-app';
import { onMounted, ref, reactive, computed } from 'vue'
import { getToolsLedgerList, getTeamUseNumList } from "../../services/ledger";
import { getBmTeamList } from '@/services/back.js'
const searchText = ref('')
const isTeam = ref(false)
const teamList = ref([])
const queryParams = reactive({
teamId: '',
keyWord: '',
})
const back = () => {
uni.navigateBack({
delta: 1,
@ -74,10 +98,41 @@ const back = () => {
//
const equipmentCategories = ref([])
onMounted(() => {
getList()
onLoad((opt) => {
console.log('🚀 ~ onLoad ~ opt:', opt)
isTeam.value = opt.params ? JSON.parse(opt.params).isTeam : false
if (isTeam.value) {
getTeamList()
} else {
getList()
}
})
onMounted(() => {
// getList()
})
//
const getTeamList = async () => {
try {
const res = await getBmTeamList({ isAll: 0 })
if (res.data.length > 0) {
teamList.value = res.data.map((item) => {
return {
...item,
value: item.id,
text: item.teamName,
}
})
queryParams.teamId = res.data[0].id
// queryParams.teamName = res.data[0].teamName
}
getList()
} catch (error) {
console.log('🚀 ~ getTeamList ~ error:', error)
}
}
const filteredEquipmentCategories = computed(() => {
if (!searchText.value) return equipmentCategories.value;
@ -117,28 +172,37 @@ const toggleCategory = (categoryIndex) => {
//
const getList = async () => {
const params = {
keyWord: ''
keyWord: queryParams.keyWord,
teamId: queryParams.teamId,
teamName: queryParams.teamName,
}
console.log('🚀 ~ getList ~ params:', params)
try {
const res = await getToolsLedgerList(params)
let res = null
if (isTeam.value) {
res = await getTeamUseNumList(params)
} else {
res = await getToolsLedgerList(params)
}
console.log('获取设备列表数据:', res)
if (res.code === 200) {
if (res.code === 200 && res.data) {
// API
const formattedData = res.data.map(item => {
return {
name: item.typeName,
expanded: false, //
thirdTypeId: item.thirdTypeId,
specs: item.modelList.map(model => {
specs: item.modelList ? item.modelList.map(model => {
return {
...model,
model: model.typeModelName,
quantity: model.storeNum || 0,
manageType: model.manageType,
buyPrice: model.buyPrice,
typeId: model.typeId
typeId: model.typeId,
}
})
}) : [],
}
})
@ -156,6 +220,7 @@ const getList = async () => {
}
const showDetail = (categoryName, spec) => {
if (isTeam.value) return
console.log('查看详情:', spec.typeId, spec.manageType);
const qty = parseFloat(spec.quantity);
@ -184,6 +249,8 @@ const showDetail = (categoryName, spec) => {
background: #fff;
margin-bottom: 10px;
border-radius: 8px;
display: flex;
align-items: center;
}
.equipment-list {

View File

@ -36,4 +36,56 @@ export const iwsLoginAPI = (data) => {
url: '/auth/iwsLogin',
data,
})
}
// 根据用户名查询用户信息
export function getUserInfoByUserNameApi(data) {
return http({
url: '/material/app/iwsTeamUser/selectUserInfoByUserName',
method: 'get',
data
})
}
// 根据身份证号查询用户信息
export function getUserInfoByIdCardApi(data) {
return http({
url: '/material/app/iwsTeamUser/selectProjectTeamInfoByIdCard',
method: 'get',
data
})
}
// 更新班组工程信息
export function updateTeamProjectApi(data) {
return http({
url: '/material/app/iwsTeamUser/updateTeamProject',
method: 'post',
data
})
}
// 获取工程ids
export function getProjectInfoApi(data) {
return http({
url: '/material/select/getProjectInfo',
method: 'post',
data
})
}
// 预警统计
export function getToolsLedgerDetailsListApi(data) {
return http({
url: '/material/complex_query/getToolsLedgerDetailsList',
method: 'get',
data
})
}
// 班组预警
export function getTeamWarnDetailsListApi(data) {
return http({
url: '/material/complex_query/getTeamWarnDetailsList',
method: 'get',
data
})
}

View File

@ -20,4 +20,13 @@ export const getToolsLedgerDetailsList = (data) => {
url: '/material/complex_query/getToolsDetailsList',
data,
})
}
// 班组库存
export const getTeamUseNumList = (data) => {
return http({
method: 'GET',
url: '/material/complex_query/getTeamUseNumList',
data,
})
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 161 KiB

After

Width:  |  Height:  |  Size: 48 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.4 KiB

After

Width:  |  Height:  |  Size: 837 B

BIN
src/static/home/back.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

BIN
src/static/home/lease.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

BIN
src/static/home/ledger.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.5 KiB

After

Width:  |  Height:  |  Size: 705 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.7 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.8 KiB

After

Width:  |  Height:  |  Size: 784 B

Binary file not shown.