Merge branch 'dev-sy-11-18'
This commit is contained in:
commit
dc234efd1e
|
|
@ -37,13 +37,20 @@
|
|||
"navigationBarTitleText": "新购验收"
|
||||
}
|
||||
},
|
||||
// 绑定
|
||||
// 新购绑定
|
||||
{
|
||||
"path": "pages/new-purchase/bind/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "新购绑定"
|
||||
}
|
||||
},
|
||||
// 详情
|
||||
{
|
||||
"path": "pages/new-purchase/bind/details",
|
||||
"style": {
|
||||
"navigationBarTitleText": "新购绑定详情"
|
||||
}
|
||||
},
|
||||
// 入库
|
||||
{
|
||||
"path": "pages/new-purchase/entry/index",
|
||||
|
|
|
|||
|
|
@ -40,7 +40,6 @@ const loginForm = reactive({
|
|||
// 登录按钮
|
||||
const onHandleLogin = async () => {
|
||||
const res = await appLoginAPI(loginForm)
|
||||
console.log(res)
|
||||
if (res.code === 200) {
|
||||
// 1. 获取 token 并存储
|
||||
memberStore.setToken(res.data.access_token)
|
||||
|
|
|
|||
|
|
@ -0,0 +1,254 @@
|
|||
<template>
|
||||
<!-- 领料出库详情 -->
|
||||
<view class="page-container">
|
||||
<uni-row :gutter="24" class="search-form">
|
||||
<uni-col :span="12">
|
||||
<view>
|
||||
<uni-easyinput placeholder="请输入内容" />
|
||||
</view>
|
||||
</uni-col>
|
||||
<uni-col :span="4">
|
||||
<view class="search">查询</view>
|
||||
</uni-col>
|
||||
</uni-row>
|
||||
|
||||
<scroll-view scroll-y class="scroll-container">
|
||||
<view
|
||||
v-for="(item, index) in detailsList"
|
||||
:key="index"
|
||||
class="table-list-item"
|
||||
@tap="onCodingItem(item)"
|
||||
>
|
||||
<view class="line"></view>
|
||||
<uni-row :gutter="24">
|
||||
<uni-col :span="2">{{ index + 1 }}</uni-col>
|
||||
<uni-col :span="6">物资名称:</uni-col>
|
||||
<uni-col :span="16">
|
||||
<view class="cont">{{ item.maTypeName }}</view>
|
||||
</uni-col>
|
||||
</uni-row>
|
||||
<uni-row :gutter="24">
|
||||
<uni-col :span="2" style="color: transparent">{{ index + 1 }}</uni-col>
|
||||
<uni-col :span="6">规格型号:</uni-col>
|
||||
<uni-col :span="16">
|
||||
<view class="cont">{{ item.typeName }}</view>
|
||||
</uni-col>
|
||||
</uni-row>
|
||||
<uni-row :gutter="24">
|
||||
<uni-col :span="2" style="color: transparent">{{ index + 1 }}</uni-col>
|
||||
<uni-col :span="6">物资数量:</uni-col>
|
||||
<uni-col :span="16">
|
||||
<view class="cont">{{ item.purchaseNum }}</view>
|
||||
</uni-col>
|
||||
</uni-row>
|
||||
<uni-row :gutter="24">
|
||||
<uni-col :span="2" style="color: transparent">{{ index + 1 }}</uni-col>
|
||||
<uni-col :span="6">已绑数量:</uni-col>
|
||||
<uni-col :span="16">
|
||||
<view class="cont">{{ item.bindNum }}</view>
|
||||
</uni-col>
|
||||
</uni-row>
|
||||
<uni-row :gutter="24">
|
||||
<uni-col :span="2" style="color: transparent">{{ index + 1 }}</uni-col>
|
||||
<uni-col :span="6">待绑数量:</uni-col>
|
||||
<uni-col :span="16">
|
||||
<view class="cont">{{ item.checkNum - item.bindNum }}</view>
|
||||
</uni-col>
|
||||
</uni-row>
|
||||
<uni-row :gutter="24">
|
||||
<uni-col :span="2" style="color: transparent">{{ index + 1 }}</uni-col>
|
||||
<uni-col :span="6">管理模式:</uni-col>
|
||||
<uni-col :span="16">
|
||||
<uni-tag
|
||||
text="编码"
|
||||
type="warning"
|
||||
v-if="item.manageType === 0"
|
||||
size="small"
|
||||
/>
|
||||
<uni-tag
|
||||
text="数量"
|
||||
type="success"
|
||||
v-if="item.manageType === 1"
|
||||
size="small"
|
||||
/>
|
||||
</uni-col>
|
||||
</uni-row>
|
||||
<uni-row :gutter="24">
|
||||
<uni-col :span="2" style="color: transparent">{{ index + 1 }}</uni-col>
|
||||
<uni-col :span="6">状态:</uni-col>
|
||||
<uni-col :span="16">
|
||||
<uni-tag
|
||||
text="未完成"
|
||||
type="warning"
|
||||
size="small"
|
||||
v-if="item.status == 3"
|
||||
/>
|
||||
<uni-tag
|
||||
text="已完成"
|
||||
type="success"
|
||||
size="small"
|
||||
v-if="item.status == 2"
|
||||
/>
|
||||
</uni-col>
|
||||
</uni-row>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, onUnmounted } from 'vue'
|
||||
import { getPurchaseBindDetailsAPI } from '@/services/new-purchase/bind.js'
|
||||
import { onLoad } from '@dcloudio/uni-app'
|
||||
const detailsList = ref([])
|
||||
const query = defineProps() // 获取上级页面传递的路由参数
|
||||
|
||||
// 查询参数
|
||||
const queryParams = ref({
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
taskId: query.taskId,
|
||||
id: query.id,
|
||||
statusList: [3, 13],
|
||||
})
|
||||
|
||||
// 领料单位,参数等信息
|
||||
const leaseApplyInfo = ref({
|
||||
leaseUnit: '', // 领料单位
|
||||
leaseProject: '', // 领料工程
|
||||
maTypeName: '', // 物资类型
|
||||
typeName: '', // 规格型号
|
||||
unitName: '', // 单位
|
||||
storageNum: '', // 库存数量
|
||||
preNum: '', // 预领数量
|
||||
parentId: query.id, // 出库时所需参数 取列表 id
|
||||
id: '', // 出库时所需参数 取详情接口 id
|
||||
typeId: '', // 出库时所需参数 取详情接口 typeId
|
||||
manageType: '', // 出库时所需参数 取详情接口 manageType
|
||||
})
|
||||
|
||||
// 获取列表详情
|
||||
const getOutboundDetailsData = async () => {
|
||||
console.log('queryParams参数', queryParams.value)
|
||||
const { data: res } = await getPurchaseBindDetailsAPI(queryParams.value)
|
||||
// console.log('res详情', res)
|
||||
detailsList.value = res.purchaseCheckDetailsList
|
||||
// leaseApplyInfo.value.leaseUnit = res.leaseApplyInfo.leaseUnit
|
||||
// leaseApplyInfo.value.leaseProject = res.leaseApplyInfo.leaseProject
|
||||
// console.log('详情数据', res)
|
||||
}
|
||||
|
||||
// 点击跳转出库页面
|
||||
const onCodingItem = (item) => {
|
||||
// 解构所需要的数据
|
||||
const {
|
||||
status,
|
||||
manageType,
|
||||
maTypeName,
|
||||
typeName,
|
||||
storageNum,
|
||||
preNum,
|
||||
alNum,
|
||||
unitName,
|
||||
id,
|
||||
typeId,
|
||||
} = item
|
||||
|
||||
leaseApplyInfo.value.maTypeName = maTypeName
|
||||
leaseApplyInfo.value.typeName = typeName
|
||||
leaseApplyInfo.value.unitName = unitName
|
||||
leaseApplyInfo.value.storageNum = storageNum
|
||||
leaseApplyInfo.value.preNum = preNum
|
||||
leaseApplyInfo.value.alNum = alNum
|
||||
leaseApplyInfo.value.id = id
|
||||
leaseApplyInfo.value.typeId = typeId
|
||||
leaseApplyInfo.value.manageType = manageType
|
||||
|
||||
if (status == 2) {
|
||||
uni.showToast({ title: '该物资已完成出库!', icon: 'none' })
|
||||
return
|
||||
}
|
||||
let codingUrl = ''
|
||||
if (manageType === 0) {
|
||||
codingUrl = '/pages/picking/outbound/code-outbound' // 编码出库
|
||||
}
|
||||
if (manageType == 1) {
|
||||
codingUrl = '/pages/picking/outbound/num-outbound' // 数量出库
|
||||
}
|
||||
|
||||
// 把 leaseApplyInfo 领料信息转成 json 传递到下个页面
|
||||
uni.navigateTo({ url: `${codingUrl}?queryParams=${JSON.stringify(leaseApplyInfo.value)}` })
|
||||
}
|
||||
|
||||
// 页面加载完毕
|
||||
onLoad(() => {
|
||||
getOutboundDetailsData()
|
||||
|
||||
// 监听出库完成事件 刷新列表
|
||||
uni.$on('onUpdate', () => {
|
||||
// console.log('监听事件')
|
||||
// 刷新列表
|
||||
getOutboundDetailsData()
|
||||
})
|
||||
})
|
||||
|
||||
// 页面销毁时移除事件监听
|
||||
onUnmounted(() => {
|
||||
uni.$off('onUpdate') // 移除事件监听
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.page-container {
|
||||
display: flex;
|
||||
height: 100%;
|
||||
padding: 0 15rpx;
|
||||
flex-direction: column;
|
||||
background-color: #e8f5fb;
|
||||
|
||||
.search-form {
|
||||
margin: 10rpx 0;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
box-sizing: content-box;
|
||||
}
|
||||
|
||||
.search {
|
||||
height: 60rpx;
|
||||
background-color: #3784fb;
|
||||
text-align: center;
|
||||
line-height: 60rpx;
|
||||
color: #fff;
|
||||
border-radius: 10rpx;
|
||||
}
|
||||
|
||||
.scroll-container {
|
||||
.table-list-item {
|
||||
margin-bottom: 20rpx;
|
||||
padding: 20rpx;
|
||||
background-color: #fff;
|
||||
min-height: 300rpx;
|
||||
border-radius: 10rpx;
|
||||
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
|
||||
.title {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.line {
|
||||
margin: 20rpx 0;
|
||||
height: 1px;
|
||||
background-color: #e8e8e8;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// 加载提示文字
|
||||
.loading-text {
|
||||
text-align: center;
|
||||
font-size: 28rpx;
|
||||
color: #666;
|
||||
padding: 20rpx 0;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
<template>
|
||||
<!-- 新购验收 -->
|
||||
<view class="accept page-common">
|
||||
<!-- 新购绑定 -->
|
||||
<view class="page-container">
|
||||
<view class="complete-btn">
|
||||
<view class="btn" @click="changeTab(1)">
|
||||
<span>已完成</span>
|
||||
|
|
@ -12,93 +12,178 @@
|
|||
</view>
|
||||
</view>
|
||||
<uni-row :gutter="24" class="search-form">
|
||||
<uni-col :span="10">
|
||||
<uni-col :span="12">
|
||||
<view>
|
||||
<uni-datetime-picker
|
||||
type="date"
|
||||
placeholder="请选择日期"
|
||||
:clear-icon="false"
|
||||
v-model="dateArray"
|
||||
type="daterange"
|
||||
@maskClick="maskClick"
|
||||
@change="onChangeDate"
|
||||
placeholder="选择日期范围"
|
||||
/>
|
||||
</view>
|
||||
</uni-col>
|
||||
<uni-col :span="10">
|
||||
<uni-col :span="8">
|
||||
<view>
|
||||
<uni-easyinput placeholder="请输入项目名称" />
|
||||
<uni-easyinput placeholder="请输入内容" v-model="queryParams.keyWord" />
|
||||
</view>
|
||||
</uni-col>
|
||||
<uni-col :span="4">
|
||||
<view class="search">搜索</view>
|
||||
<view class="search" @click="getTableList()">搜索</view>
|
||||
</uni-col>
|
||||
</uni-row>
|
||||
|
||||
<div class="table-list-item" v-for="(item, index) in tableList" :key="index">
|
||||
<div class="title">
|
||||
<span style="font-size: 15px; font-weight: 800">新购绑定</span>
|
||||
<span :style="{ color: item.status == 1 ? '#3784fb' : '#ff4d4f' }">{{
|
||||
item.status == 1 ? '已完成' : '未完成'
|
||||
}}</span>
|
||||
</div>
|
||||
<div class="line"></div>
|
||||
<uni-row :gutter="24">
|
||||
<uni-col :span="6">到货时间:</uni-col>
|
||||
<uni-col :span="18"><div class="cont">{{ item.arrivalTime }}</div></uni-col>
|
||||
</uni-row>
|
||||
<uni-row :gutter="24">
|
||||
<uni-col :span="6">采购单号:</uni-col>
|
||||
<uni-col :span="18"><div class="cont">{{ item.purchaseNumber }}</div></uni-col>
|
||||
</uni-row>
|
||||
<uni-row :gutter="24">
|
||||
<uni-col :span="6">采购物资:</uni-col>
|
||||
<uni-col :span="18"><div class="cont">{{ item.purchaseMaterial }}</div></uni-col>
|
||||
</uni-row>
|
||||
<uni-row :gutter="24">
|
||||
<uni-col :span="6">物资数量:</uni-col>
|
||||
<uni-col :span="18"><div class="cont">{{ item.arrivalQuantity }}</div></uni-col>
|
||||
</uni-row>
|
||||
<uni-row :gutter="24">
|
||||
<uni-col :span="6">绑定数量:</uni-col>
|
||||
<uni-col :span="18"><div class="cont">{{ item.acceptQuantity }}</div></uni-col>
|
||||
</uni-row>
|
||||
</div>
|
||||
<scroll-view scroll-y @scrolltolower="onScrollTolower" class="scroll-container">
|
||||
<view
|
||||
class="table-list-item"
|
||||
:key="index"
|
||||
@click="handleItem(item)"
|
||||
v-for="(item, index) in tableList"
|
||||
>
|
||||
<div class="line"></div>
|
||||
<uni-row :gutter="24">
|
||||
<uni-col :span="6">到货时间:</uni-col>
|
||||
<uni-col :span="18"
|
||||
><div class="cont">{{ item.createTime }}</div></uni-col
|
||||
>
|
||||
</uni-row>
|
||||
<uni-row :gutter="24">
|
||||
<uni-col :span="6">采购单号:</uni-col>
|
||||
<uni-col :span="18"
|
||||
><div class="cont">{{ item.code }}</div></uni-col
|
||||
>
|
||||
</uni-row>
|
||||
<uni-row :gutter="24">
|
||||
<uni-col :span="6">采购物资:</uni-col>
|
||||
<uni-col :span="18">
|
||||
<div class="cont">{{ item.purchaseMaTypeName }}</div>
|
||||
</uni-col>
|
||||
</uni-row>
|
||||
<uni-row :gutter="24">
|
||||
<uni-col :span="6">物资数量:</uni-col>
|
||||
<uni-col :span="18">
|
||||
<div class="cont">{{ item.purchaseMaNumber }}</div>
|
||||
</uni-col>
|
||||
</uni-row>
|
||||
<!-- <uni-row :gutter="24">
|
||||
<uni-col :span="6">绑定数量:</uni-col>
|
||||
<uni-col :span="18">
|
||||
<div class="cont">{{ item.leaseProject }}</div>
|
||||
</uni-col>
|
||||
</uni-row> -->
|
||||
<uni-row :gutter="24">
|
||||
<uni-col :span="6">状态:</uni-col>
|
||||
<uni-col :span="18">
|
||||
<div class="cont">
|
||||
<uni-tag text="未完成" type="warning" v-if="item.taskStatus === 21" />
|
||||
<uni-tag text="已完成" type="success" v-if="item.taskStatus === 22" />
|
||||
</div>
|
||||
</uni-col>
|
||||
</uni-row>
|
||||
</view>
|
||||
<view class="loading-text">
|
||||
{{ finish ? '没有更多数据了~' : '正在加载...' }}
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, reactive } from 'vue'
|
||||
import { ref, computed } from 'vue'
|
||||
import { getPurchaseBindListAPI } from '@/services/new-purchase/bind.js'
|
||||
import { onLoad, onShow } from '@dcloudio/uni-app'
|
||||
import { debounce } from 'lodash-es'
|
||||
|
||||
const active = ref(1)
|
||||
const tableList = reactive([
|
||||
{
|
||||
status: '1', // 状态
|
||||
arrivalTime: '2021-08-01 12:12:12', // 到货时间
|
||||
purchaseNumber: '123', // 采购单号
|
||||
// 采购物资
|
||||
purchaseMaterial: '物资1、物资2、物资3、物资4、物资5、物资6、物资7、物资8、物资9、物资10',
|
||||
arrivalQuantity: '100', // 到货数量
|
||||
acceptQuantity: '100', // 验收数量
|
||||
},
|
||||
{
|
||||
status: '0', // 状态
|
||||
arrivalTime: '2021-08-01 12:12:12', // 到货时间
|
||||
purchaseNumber: '123456', // 采购单号
|
||||
// 采购物资
|
||||
purchaseMaterial: 'fdhsajfkldsajfkldjsaklgjdklsahjgldjsafkljdsklajfdklsajfkdsajfkldsjfkldas',
|
||||
arrivalQuantity: '100', // 到货数量
|
||||
acceptQuantity: '100', // 验收数量
|
||||
},
|
||||
])
|
||||
const total = ref(0) // 数据总量
|
||||
const active = ref(1) // tap索引
|
||||
const tableList = ref([]) // 列表数据源
|
||||
const dateArray = ref([]) // 日期范围
|
||||
// 查询参数
|
||||
const queryParams = ref({
|
||||
startTime: '', // 开始时间
|
||||
endTime: '', // 结束时间
|
||||
keyWord: '', // 关键字
|
||||
statusList: [3, 13], // 状态
|
||||
pageNum: 1,
|
||||
pageSize: 3,
|
||||
})
|
||||
|
||||
// 日期 change 事件
|
||||
const onChangeDate = (val) => {
|
||||
const [val_1, val_2] = val
|
||||
queryParams.value.startTime = val_1
|
||||
queryParams.value.endTime = val_2
|
||||
}
|
||||
|
||||
// 获取列表数据
|
||||
const getTableList = async (isTap = false) => {
|
||||
// console.log('queryParams.value查询参数', queryParams.value)
|
||||
const { data: res } = await getPurchaseBindListAPI(queryParams.value)
|
||||
console.log('res列表数据', res)
|
||||
total.value = res.total
|
||||
if (isTap) {
|
||||
tableList.value = res.rows
|
||||
} else {
|
||||
if (res.rows.length == 0) {
|
||||
tableList.value = []
|
||||
} else {
|
||||
tableList.value.push(...res.rows)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// // 页面加载完毕
|
||||
// onLoad(() => {
|
||||
// getTableList()
|
||||
// })
|
||||
|
||||
onShow(() => {
|
||||
tableList.value = []
|
||||
total.value = 0
|
||||
getTableList()
|
||||
})
|
||||
|
||||
// 滚动触底事件
|
||||
const onScrollTolower = debounce(() => {
|
||||
console.log('触底事件')
|
||||
if (total.value > tableList.value.length) {
|
||||
queryParams.value.pageNum++
|
||||
getTableList()
|
||||
}
|
||||
}, 500)
|
||||
|
||||
// tap 栏切换
|
||||
const changeTab = (index) => {
|
||||
active.value = index
|
||||
if (index == 1) {
|
||||
queryParams.value.statusList = [22] // 查已完成的
|
||||
} else if (index == 2) {
|
||||
queryParams.value.statusList = [21] // 查未完成的
|
||||
}
|
||||
|
||||
queryParams.value.pageNum = 1
|
||||
getTableList(true)
|
||||
}
|
||||
// 点击跳转详情
|
||||
const handleItem = (item) => {
|
||||
uni.navigateTo({ url: `/pages/new-purchase/bind/details?id=${item.id}&taskId=${item.taskId}` })
|
||||
}
|
||||
|
||||
// 判断数据是否加载完毕
|
||||
const finish = computed(() => {
|
||||
if (total.value === tableList.value.length) return true
|
||||
})
|
||||
|
||||
const maskClick = () => {}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.accept {
|
||||
.page-container {
|
||||
display: flex;
|
||||
height: 100%;
|
||||
word-break: break-all;
|
||||
padding: 0 15rpx;
|
||||
flex-direction: column;
|
||||
|
||||
.complete-btn {
|
||||
display: flex;
|
||||
padding: 20rpx;
|
||||
|
|
@ -123,33 +208,43 @@ const maskClick = () => {}
|
|||
}
|
||||
|
||||
.search {
|
||||
height: 70rpx;
|
||||
height: 65rpx;
|
||||
background-color: #3784fb;
|
||||
text-align: center;
|
||||
line-height: 70rpx;
|
||||
line-height: 65rpx;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.scroll-container {
|
||||
.table-list-item {
|
||||
margin: 20rpx 0;
|
||||
padding: 20rpx;
|
||||
background-color: #fff;
|
||||
min-height: 300rpx;
|
||||
border-radius: 10rpx;
|
||||
.title {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
.cont {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
line-height: 1.9;
|
||||
}
|
||||
.line {
|
||||
margin: 20rpx 0;
|
||||
height: 1px;
|
||||
background-color: #e8e8e8;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.table-list-item {
|
||||
margin: 20rpx 0;
|
||||
padding: 40rpx;
|
||||
background-color: #fff;
|
||||
min-height: 300rpx;
|
||||
border-radius: 10rpx;
|
||||
.title {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
.cont {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
line-height: 1.9;
|
||||
}
|
||||
.line {
|
||||
margin: 20rpx 0;
|
||||
height: 1px;
|
||||
background-color: #e8e8e8;
|
||||
}
|
||||
// 加载提示文字
|
||||
.loading-text {
|
||||
text-align: center;
|
||||
font-size: 28rpx;
|
||||
color: #666;
|
||||
padding: 20rpx 0;
|
||||
}
|
||||
</style>
|
||||
|
|
|
|||
|
|
@ -3,26 +3,26 @@
|
|||
<view class="page-container">
|
||||
<view class="table-list-item">
|
||||
<uni-row :gutter="24">
|
||||
<uni-col :span="6">领料单位:</uni-col>
|
||||
<uni-col :span="18">
|
||||
<uni-col :span="8">领料单位:</uni-col>
|
||||
<uni-col :span="16">
|
||||
<view class="cont">{{ queryParams.leaseUnit }}</view>
|
||||
</uni-col>
|
||||
</uni-row>
|
||||
<uni-row :gutter="24">
|
||||
<uni-col :span="6">领料工程:</uni-col>
|
||||
<uni-col :span="18">
|
||||
<uni-col :span="8">领料工程:</uni-col>
|
||||
<uni-col :span="16">
|
||||
<view class="cont">{{ queryParams.leaseProject }}</view>
|
||||
</uni-col>
|
||||
</uni-row>
|
||||
<uni-row :gutter="24">
|
||||
<uni-col :span="6">当前出库物资:</uni-col>
|
||||
<uni-col :span="18"
|
||||
<uni-col :span="8">当前出库物资:</uni-col>
|
||||
<uni-col :span="16"
|
||||
><view class="cont">{{ queryParams.maTypeName }}</view>
|
||||
</uni-col>
|
||||
</uni-row>
|
||||
<uni-row :gutter="24">
|
||||
<uni-col :span="6">待出库数量:</uni-col>
|
||||
<uni-col :span="18">
|
||||
<uni-col :span="8">待出库数量:</uni-col>
|
||||
<uni-col :span="16">
|
||||
<view class="cont">{{ maxNum }}</view>
|
||||
</uni-col>
|
||||
</uni-row>
|
||||
|
|
@ -32,13 +32,13 @@
|
|||
<uni-row :gutter="24">
|
||||
<uni-col :span="6">出库方式:</uni-col>
|
||||
<uni-col :span="6">
|
||||
<view class="coding-btn">编码识别</view>
|
||||
<view class="coding-btn" @tap="onCodeIdentify">编码识别</view>
|
||||
</uni-col>
|
||||
<uni-col :span="6">
|
||||
<view class="coding-btn">编码识别</view>
|
||||
<view class="coding-btn" @tap="onCodeIdentify">编码识别</view>
|
||||
</uni-col>
|
||||
<uni-col :span="6">
|
||||
<view class="coding-btn">二维码识别</view>
|
||||
<view class="coding-btn" @tap="onCodeIdentify">二维码识别</view>
|
||||
</uni-col>
|
||||
</uni-row>
|
||||
</view>
|
||||
|
|
@ -50,7 +50,7 @@
|
|||
</uni-col>
|
||||
<uni-col :span="12">
|
||||
<view>
|
||||
<uni-easyinput placeholder="请输入内容" />
|
||||
<uni-easyinput v-model="queryCodeParams.maCode" placeholder="请输入内容" />
|
||||
</view>
|
||||
</uni-col>
|
||||
<uni-col :span="6">
|
||||
|
|
@ -72,8 +72,8 @@
|
|||
<scroll-view scroll-y @scrolltolower="onScrollTolower" style="padding-bottom: 85rpx">
|
||||
<view class="table-list-item" v-for="item in codeDeviceList" :key="item.maId">
|
||||
<uni-row :gutter="24">
|
||||
<uni-col :span="5">物资类型:</uni-col>
|
||||
<uni-col :span="15">
|
||||
<uni-col :span="8">物资类型:</uni-col>
|
||||
<uni-col :span="12">
|
||||
<view class="cont">{{ item.materialName }}</view>
|
||||
</uni-col>
|
||||
<uni-col :span="4">
|
||||
|
|
@ -92,20 +92,26 @@
|
|||
</uni-col>
|
||||
</uni-row>
|
||||
<uni-row :gutter="24">
|
||||
<uni-col :span="5">规格型号:</uni-col>
|
||||
<uni-col :span="18">
|
||||
<uni-col :span="8">规格型号:</uni-col>
|
||||
<uni-col :span="12">
|
||||
<view class="cont">{{ item.materialModel }}</view>
|
||||
</uni-col>
|
||||
</uni-row>
|
||||
<uni-row :gutter="24">
|
||||
<uni-col :span="5">设备状态:</uni-col>
|
||||
<uni-col :span="18">
|
||||
<uni-col :span="8">设备编码:</uni-col>
|
||||
<uni-col :span="12">
|
||||
<view class="cont">{{ item.maCode }}</view>
|
||||
</uni-col>
|
||||
</uni-row>
|
||||
<uni-row :gutter="24">
|
||||
<uni-col :span="8">设备状态:</uni-col>
|
||||
<uni-col :span="12">
|
||||
<view class="cont">{{ item.statusName }}</view>
|
||||
</uni-col>
|
||||
</uni-row>
|
||||
<uni-row :gutter="24">
|
||||
<uni-col :span="5">设备数量:</uni-col>
|
||||
<uni-col :span="18">
|
||||
<uni-col :span="8">设备数量:</uni-col>
|
||||
<uni-col :span="12">
|
||||
<view class="cont">1</view>
|
||||
</uni-col>
|
||||
</uni-row>
|
||||
|
|
@ -124,6 +130,7 @@
|
|||
import { ref, computed } from 'vue'
|
||||
import { getCodeDeviceListAPI, setOutboundNumAPI } from '@/services/picking/outbound.js'
|
||||
import { onBackPress } from '@dcloudio/uni-app'
|
||||
import { debounce } from 'lodash-es'
|
||||
const query = defineProps() // 获取上级页面传递的路由参数
|
||||
const queryParams = JSON.parse(query.queryParams)
|
||||
const codeDeviceList = ref([])
|
||||
|
|
@ -135,6 +142,7 @@ const queryCodeParams = ref({
|
|||
pageSize: 10,
|
||||
typeId: queryParams.typeId,
|
||||
maStatus: 1,
|
||||
maCode: '',
|
||||
})
|
||||
|
||||
// 计算出库最大数量
|
||||
|
|
@ -148,7 +156,7 @@ const maxNum = computed(() => {
|
|||
|
||||
// 获取编码列表
|
||||
const getCodeDeviceListData = async () => {
|
||||
// console.log('queryCodeParams', queryCodeParams)
|
||||
console.log('queryCodeParams', queryCodeParams.value)
|
||||
const res = await getCodeDeviceListAPI(queryCodeParams.value)
|
||||
codeDeviceList.value.push(...res.rows)
|
||||
|
||||
|
|
@ -161,20 +169,36 @@ const getCodeDeviceListData = async () => {
|
|||
}
|
||||
getCodeDeviceListData()
|
||||
|
||||
// 编码识别按钮
|
||||
const onCodeIdentify = () => {
|
||||
console.log('编码识别--')
|
||||
|
||||
// 只允许通过相机扫码
|
||||
uni.scanCode({
|
||||
onlyFromCamera: true,
|
||||
scanType: ['qrCode', 'pdf417'],
|
||||
success: function (res) {
|
||||
console.log('条码类型:' + res.scanType)
|
||||
console.log('条码内容:' + res.result)
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
// 编码搜索按钮
|
||||
const onCodeSearch = () => {
|
||||
queryCodeParams.value.pageNum = 1
|
||||
codeDeviceList.value = []
|
||||
getCodeDeviceListData()
|
||||
}
|
||||
|
||||
// 滚动触底事件
|
||||
const onScrollTolower = () => {
|
||||
console.log('滚动触底--')
|
||||
const onScrollTolower = debounce(() => {
|
||||
// console.log('滚动触底--')
|
||||
if (total.value > codeDeviceList.value.length) {
|
||||
queryCodeParams.value.pageNum++
|
||||
getCodeDeviceListData()
|
||||
}
|
||||
}
|
||||
}, 500)
|
||||
|
||||
// 判断数据是否加载完毕
|
||||
const finish = computed(() => {
|
||||
|
|
|
|||
|
|
@ -156,23 +156,25 @@ const getTableList = async (isTap = false) => {
|
|||
}
|
||||
}
|
||||
|
||||
// 页面加载完毕
|
||||
onLoad(() => {
|
||||
getTableList()
|
||||
})
|
||||
// // 页面加载完毕
|
||||
// onLoad(() => {
|
||||
// getTableList()
|
||||
// })
|
||||
|
||||
onShow(() => {
|
||||
tableList.value = []
|
||||
total.value = 0
|
||||
getTableList()
|
||||
})
|
||||
|
||||
// 滚动触底事件
|
||||
const onScrollTolower = debounce(() => {
|
||||
console.log('触底事件')
|
||||
if (total.value > tableList.value.length) {
|
||||
queryParams.value.pageNum++
|
||||
getTableList()
|
||||
}
|
||||
})
|
||||
}, 500)
|
||||
|
||||
// tap 栏切换
|
||||
const changeTab = (index) => {
|
||||
|
|
|
|||
|
|
@ -4,7 +4,6 @@ import { http } from '@/utils/http'
|
|||
* 登录接口
|
||||
*/
|
||||
export const appLoginAPI = (data) => {
|
||||
console.log('999')
|
||||
return http({
|
||||
method: 'POST',
|
||||
url: '/auth/login',
|
||||
|
|
|
|||
|
|
@ -0,0 +1,22 @@
|
|||
import { http } from '@/utils/http'
|
||||
|
||||
/**
|
||||
* 新购绑定 ---- 列表查询
|
||||
*/
|
||||
export const getPurchaseBindListAPI = (data) => {
|
||||
return http({
|
||||
method: 'GET',
|
||||
url: '/material/purchase_check_info/list',
|
||||
data,
|
||||
})
|
||||
}
|
||||
/**
|
||||
* 新购绑定 ---- 列表查询
|
||||
*/
|
||||
export const getPurchaseBindDetailsAPI = (data) => {
|
||||
return http({
|
||||
method: 'GET',
|
||||
url: '/material/purchase_check_info/getInfo',
|
||||
data,
|
||||
})
|
||||
}
|
||||
|
|
@ -121,5 +121,5 @@ a:hover {
|
|||
|
||||
page {
|
||||
/* height: 100%; */
|
||||
font-size: 16px;
|
||||
font-size: 28rpx;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue