144 lines
3.5 KiB
Vue
144 lines
3.5 KiB
Vue
<template>
|
|
<uni-nav-bar
|
|
dark
|
|
:fixed="true"
|
|
shadow
|
|
background-color="#4AA4EA"
|
|
status-bar
|
|
left-icon="left"
|
|
left-text="返回"
|
|
title="工器具出库"
|
|
@clickLeft="back"
|
|
/>
|
|
<div class="content">
|
|
<div class="df">
|
|
<uni-easyinput
|
|
v-model="queryParams.keyword"
|
|
placeholder="请输入内容"
|
|
style="margin-right: 5px"
|
|
/>
|
|
<button size="mini" style="background-color: #f0a037; color: #fff" @click="getDetailsById">
|
|
查询
|
|
</button>
|
|
</div>
|
|
<div class="df-btn">
|
|
<button class="btn" size="mini" type="primary" @click="">新增数量出库</button>
|
|
<button class="btn" size="mini" type="primary" @click="">新增编码出库</button>
|
|
</div>
|
|
<div
|
|
class="table-box"
|
|
v-for="(item, index) in tableList"
|
|
:key="index"
|
|
@click="handleItem(item)"
|
|
>
|
|
<div style="margin-right: 6px">{{ index + 1 }}.</div>
|
|
<div>
|
|
<div>
|
|
工器具名称:<span style="color: red">{{ item.maTypeName }}</span>
|
|
</div>
|
|
<div>规格型号:{{ item.typeName }}</div>
|
|
<div>预领数量:{{ item.preNum }}</div>
|
|
<div>已领数量:{{ item.alNum }}</div>
|
|
<div>
|
|
待领数量:<span style="color: red">{{ item.outNum }}</span>
|
|
</div>
|
|
<div>单位:{{ item.unitName }}</div>
|
|
<div>管理模式:{{ item.manageType == 0 ? '编码' : '数量' }}</div>
|
|
<div>
|
|
状态:<span v-if="item.status == 0" style="color: red">未完成</span>
|
|
<span v-else style="color: #67c23a">已完成</span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div style="display: flex; justify-content: center; align-items: center; height: 50px">
|
|
{{ '没有更多数据了~' }}
|
|
</div>
|
|
</div>
|
|
</template>
|
|
|
|
<script setup>
|
|
import { onLoad, onShow } from '@dcloudio/uni-app'
|
|
import { ref, reactive, computed } from 'vue'
|
|
import { getOutNum } from '@/services/back.js'
|
|
|
|
const opts = ref({})
|
|
const queryParams = reactive({
|
|
id: '',
|
|
keyword: '',
|
|
})
|
|
const tableList = ref([])
|
|
// 获取详情
|
|
const getDetailsById = async () => {
|
|
try {
|
|
const res = await getOutNum(queryParams)
|
|
tableList.value = res.data
|
|
console.log('🚀 ~ getDetailsById ~ tableList.value:', tableList.value)
|
|
} catch (error) {
|
|
console.log('🚀 ~ getDetailsById ~ error:', error)
|
|
}
|
|
}
|
|
// 出库
|
|
const handleItem = (item) => {
|
|
console.log('🚀 ~ handleItem ~ item:', item.manageType)
|
|
if (item.status != '0') {
|
|
uni.showToast({
|
|
title: '已完成出库',
|
|
icon: 'none',
|
|
})
|
|
return
|
|
}
|
|
item = Object.assign(opts.value, item)
|
|
if (item.manageType == 1) {
|
|
uni.navigateTo({
|
|
url: '/pages/toolsLease/numOut?params=' + JSON.stringify(item),
|
|
})
|
|
} else {
|
|
uni.navigateTo({
|
|
url: '/pages/toolsLease/codeOut?params=' + JSON.stringify(item),
|
|
})
|
|
}
|
|
}
|
|
const back = () => {
|
|
uni.navigateBack({
|
|
delta: 1,
|
|
})
|
|
}
|
|
onLoad((opt) => {
|
|
console.log('🚀 ~ onLoad ~ 出库:', opt)
|
|
opts.value = opt.params ? JSON.parse(opt.params) : {}
|
|
console.log('🚀 ~ onLoad ~ opts.value:', opts.value)
|
|
queryParams.id = opts.value.id
|
|
})
|
|
onShow(() => {
|
|
setTimeout(() => {
|
|
getDetailsById()
|
|
}, 300)
|
|
})
|
|
</script>
|
|
|
|
<style lang="scss" scoped>
|
|
.content {
|
|
padding: 10px;
|
|
}
|
|
.df {
|
|
display: flex;
|
|
align-items: center;
|
|
}
|
|
.df-btn {
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: space-between;
|
|
.btn {
|
|
width: 40%;
|
|
margin: 10px 0;
|
|
}
|
|
}
|
|
.table-box {
|
|
padding: 8px;
|
|
display: flex;
|
|
background-color: #fafafa;
|
|
margin-bottom: 10px;
|
|
border-radius: 6px;
|
|
}
|
|
</style>
|