Merge branch 'master' of http://14.103.246.124:16000/bonus/bonus-material-app
This commit is contained in:
commit
7b3bd9f619
|
|
@ -211,7 +211,7 @@
|
|||
{
|
||||
"path": "pages/back/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "退料任务"
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
|
|
|
|||
|
|
@ -58,7 +58,13 @@
|
|||
<view class="addBtn" @click="goAdd()">新增</view>
|
||||
</uni-col>
|
||||
</uni-row>
|
||||
<scroll-view scroll-y @scrolltolower="onScrollTolower" class="scroll-container">
|
||||
<scroll-view
|
||||
scroll-y
|
||||
:scroll-top="scrollTop"
|
||||
@scroll="onScroll"
|
||||
@scrolltolower="onScrollTolower"
|
||||
class="scroll-container"
|
||||
>
|
||||
<div
|
||||
class="table-list-item"
|
||||
v-for="(item, index) in tableList"
|
||||
|
|
@ -178,6 +184,8 @@ import { ref, computed } from 'vue'
|
|||
import { getBackList, submitBackApply, backApplyRemove } from '../../services/back.js'
|
||||
import { onShow } from '@dcloudio/uni-app'
|
||||
import { debounce } from 'lodash-es'
|
||||
|
||||
const scrollTop = ref(0)
|
||||
const total = ref(0) // 数据总量
|
||||
const active = ref(1) // tap索引
|
||||
const tableList = ref([]) // 列表数据源
|
||||
|
|
@ -335,6 +343,10 @@ const getTableList = async (isTap = false) => {
|
|||
console.log('queryParams.value查询参数', queryParams.value)
|
||||
const res = await getBackList(queryParams.value)
|
||||
console.log('res列表数据', res)
|
||||
setTimeout(() => {
|
||||
scrollTop.value = uni.getStorageSync('scrollTop') || 0
|
||||
console.log('🚀 ~ scrollTop.value:', scrollTop.value)
|
||||
}, 400)
|
||||
total.value = res.data.total
|
||||
if (isTap) {
|
||||
tableList.value = res.data.rows
|
||||
|
|
@ -371,9 +383,20 @@ const onScrollTolower = debounce(() => {
|
|||
getTableList()
|
||||
}
|
||||
})
|
||||
|
||||
let timer = null
|
||||
const onScroll = (e) => {
|
||||
if (timer) clearTimeout(timer)
|
||||
timer = setTimeout(() => {
|
||||
uni.setStorageSync('scrollTop', e.detail.scrollTop)
|
||||
uni.setStorageSync('queryParams', JSON.stringify(queryParams.value))
|
||||
}, 500)
|
||||
}
|
||||
//切换tab
|
||||
const changeTab = (index) => {
|
||||
active.value = index
|
||||
uni.setStorageSync('scrollTop', 0)
|
||||
uni.setStorageSync('activeTab', index)
|
||||
if (index == 1) {
|
||||
queryParams.value.appTaskStatus = 0
|
||||
} else if (index == 2) {
|
||||
|
|
@ -413,6 +436,10 @@ const leftClick = () => {
|
|||
onShow(() => {
|
||||
tableList.value = []
|
||||
total.value = 0
|
||||
if (uni.getStorageSync('queryParams')) {
|
||||
queryParams.value = JSON.parse(uni.getStorageSync('queryParams'))
|
||||
}
|
||||
active.value = uni.getStorageSync('activeTab') || 1
|
||||
getTableList(true)
|
||||
})
|
||||
|
||||
|
|
|
|||
|
|
@ -154,10 +154,10 @@
|
|||
</uni-table>
|
||||
|
||||
<button v-if="opts.isOut" style="width: 100%; margin: 50px 0" type="primary" @click="submit(1)">
|
||||
出 库
|
||||
提 交
|
||||
</button>
|
||||
<button v-else style="width: 100%; margin: 50px 0" type="primary" @click="submit(0)">
|
||||
保 存
|
||||
提 交
|
||||
</button>
|
||||
</div>
|
||||
|
||||
|
|
@ -262,6 +262,7 @@ const getDetailsById = async () => {
|
|||
Object.assign(formData, res.data.leaseApplyInfo)
|
||||
formData.projectId = res.data.leaseApplyInfo.proId
|
||||
formData.proId = res.data.leaseApplyInfo.proId
|
||||
formData.relPhone = res.data.leaseApplyInfo.phone || res.data.leaseApplyInfo.relPhone || ''
|
||||
getAgreementInfoById()
|
||||
} catch (error) {
|
||||
console.log('🚀 ~ getDetailsById ~ error:', error)
|
||||
|
|
@ -527,6 +528,7 @@ const submit = (isOut) => {
|
|||
.validate()
|
||||
.then(async (valid) => {
|
||||
formData.isOut = isOut
|
||||
formData.phone = formData.relPhone
|
||||
formData.createBy = uni.getStorageSync('username') || ''
|
||||
console.log('🚀 ~ form.value.validate.then ~ valid:', valid)
|
||||
if (tableData.value.length === 0) {
|
||||
|
|
@ -561,15 +563,17 @@ const submit = (isOut) => {
|
|||
leaseApplyInfo: formData,
|
||||
}
|
||||
console.log('🚀 ~ .then ~ params:', params)
|
||||
if (isOut != 0) {
|
||||
// 弹框确定
|
||||
const res = await uni.showModal({
|
||||
const resp = await uni.showModal({
|
||||
title: '提示',
|
||||
content: '是否确认提交?',
|
||||
confirmText: isOut == 0 ? '暂存' : '出库',
|
||||
confirmText: '提交',
|
||||
cancelText: '取消',
|
||||
})
|
||||
console.log('🚀 ~ .then ~ res:', res)
|
||||
if (!res.confirm) return
|
||||
console.log('🚀 ~ .confirm ~ resp:', resp)
|
||||
if (!resp.confirm) return
|
||||
}
|
||||
uni.showLoading({
|
||||
title: '提交中...',
|
||||
mask: true, // 遮罩层
|
||||
|
|
|
|||
|
|
@ -214,7 +214,7 @@ const getTableList = async (isTap = false, isSearch = false) => {
|
|||
setTimeout(() => {
|
||||
scrollTop.value = uni.getStorageSync('scrollTop') || 0
|
||||
console.log('🚀 ~ scrollTop.value:', scrollTop.value)
|
||||
}, 300)
|
||||
}, 400)
|
||||
console.log('res列表数据', res)
|
||||
total.value = res.data.total
|
||||
if (isTap) {
|
||||
|
|
@ -255,6 +255,7 @@ onShow(() => {
|
|||
if (uni.getStorageSync('queryParams')) {
|
||||
queryParams.value = JSON.parse(uni.getStorageSync('queryParams'))
|
||||
}
|
||||
active.value = uni.getStorageSync('activeTab') || 0
|
||||
getTableList()
|
||||
})
|
||||
|
||||
|
|
@ -285,8 +286,8 @@ const onScroll = (e) => {
|
|||
|
||||
// tap 栏切换
|
||||
const changeTab = (index) => {
|
||||
uni.removeStorageSync('scrollTop')
|
||||
uni.removeStorageSync('queryParams')
|
||||
uni.setStorageSync('scrollTop', 0)
|
||||
uni.setStorageSync('activeTab', index)
|
||||
active.value = index
|
||||
console.log('index', index)
|
||||
if (index == 2) {
|
||||
|
|
|
|||
|
|
@ -104,7 +104,7 @@
|
|||
</view>
|
||||
</scroll-view>
|
||||
|
||||
<scroll-view scroll-y @scrolltolower="onScrollTolower" class="scroll-container" v-else>
|
||||
<scroll-view scroll-y :scroll-top="scrollTop" @scroll="onScroll" @scrolltolower="onScrollTolower" class="scroll-container" v-else>
|
||||
<view
|
||||
class="table-list-item"
|
||||
:key="index"
|
||||
|
|
@ -192,6 +192,7 @@ import { onLoad, onShow } from '@dcloudio/uni-app'
|
|||
import { debounce } from 'lodash-es'
|
||||
import { onBackPress } from '@dcloudio/uni-app'
|
||||
|
||||
const scrollTop = ref(0)
|
||||
const opts = ref(null)
|
||||
const total = ref(0) // 数据总量
|
||||
const active = ref(1) // tap索引
|
||||
|
|
@ -270,6 +271,10 @@ const getTableList = async (isTap = false, isSearch = false) => {
|
|||
} else {
|
||||
res = await getPickingOutboundListAPI(queryParams.value)
|
||||
}
|
||||
setTimeout(() => {
|
||||
scrollTop.value = uni.getStorageSync('scrollTop') || 0
|
||||
console.log('🚀 ~ scrollTop.value:', scrollTop.value)
|
||||
}, 400)
|
||||
console.log('res列表数据', res)
|
||||
total.value = res.data.total
|
||||
if (isTap) {
|
||||
|
|
@ -311,6 +316,9 @@ onShow(() => {
|
|||
queryParams.value.pageNum = 1
|
||||
tableList.value = []
|
||||
total.value = 0
|
||||
if (uni.getStorageSync('queryParams')) {
|
||||
queryParams.value = JSON.parse(uni.getStorageSync('queryParams'))
|
||||
}
|
||||
if (opts.value) {
|
||||
getTableList()
|
||||
} else {
|
||||
|
|
@ -327,6 +335,15 @@ const onScrollTolower = debounce(() => {
|
|||
}
|
||||
}, 500)
|
||||
|
||||
let timer = null
|
||||
const onScroll = (e) => {
|
||||
if (timer) clearTimeout(timer)
|
||||
timer = setTimeout(() => {
|
||||
uni.setStorageSync('scrollTop', e.detail.scrollTop)
|
||||
uni.setStorageSync('queryParams', JSON.stringify(queryParams.value))
|
||||
}, 500)
|
||||
}
|
||||
|
||||
// tap 栏切换
|
||||
const changeTab = (index) => {
|
||||
active.value = index
|
||||
|
|
|
|||
|
|
@ -11,11 +11,11 @@
|
|||
<uni-forms-item label="规格型号:" name=" typeName">
|
||||
<span style="height: 100%;display: flex;align-items: center;">{{ formData.typeName||"" }}</span>
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="入库人:" name="createBy">
|
||||
<span style="height: 100%;display: flex;align-items: center;">{{ formData.createBy||"" }}</span>
|
||||
<uni-forms-item label="入库人:" name="auditBy">
|
||||
<span style="height: 100%;display: flex;align-items: center;">{{ formData.auditBy||"" }}</span>
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="入库时间:" name="createTime">
|
||||
<span style="height: 100%;display: flex;align-items: center;">{{ formData.createTime||"" }}</span>
|
||||
<uni-forms-item label="入库时间:" name="auditTime">
|
||||
<span style="height: 100%;display: flex;align-items: center;">{{ formData.auditTime||"" }}</span>
|
||||
</uni-forms-item>
|
||||
</uni-forms>
|
||||
</view>
|
||||
|
|
@ -84,8 +84,8 @@ onLoad((options) => {
|
|||
if(queryParams.value.manageType==1){
|
||||
formData.value.maTypeName = queryParams.value.typeName
|
||||
formData.value.typeName = queryParams.value.typeModelName
|
||||
formData.value.createBy = queryParams.value.createBy
|
||||
formData.value.createTime = queryParams.value.createTime
|
||||
formData.value.auditBy = queryParams.value.auditBy
|
||||
formData.value.auditTime = queryParams.value.auditTime
|
||||
}
|
||||
})
|
||||
|
||||
|
|
|
|||
|
|
@ -292,7 +292,7 @@ onLoad((options) => {
|
|||
console.log(taskInfo.value)
|
||||
taskId.value = taskInfo.value.taskId
|
||||
console.log(taskId.value)
|
||||
getDetailsData()
|
||||
// getDetailsData()
|
||||
// 监听出库完成事件 刷新列表
|
||||
uni.$on('onUpdate', () => {
|
||||
// console.log('监听事件')
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@
|
|||
</uni-col>
|
||||
</uni-row>
|
||||
|
||||
<scroll-view scroll-y @scrolltolower="onScrollTolower" class="scroll-container">
|
||||
<scroll-view scroll-y :scroll-top="scrollTop" @scroll="onScroll" @scrolltolower="onScrollTolower" class="scroll-container">
|
||||
<view
|
||||
class="table-list-item"
|
||||
:key="index"
|
||||
|
|
@ -157,6 +157,7 @@ import { getRepairedList } from '@/services/repair/testedInBound.js'
|
|||
import { onShow, onLoad } from '@dcloudio/uni-app'
|
||||
import { debounce } from 'lodash-es'
|
||||
|
||||
const scrollTop = ref(0)
|
||||
const total = ref(0) // 数据总量
|
||||
const active = ref(1) // tap索引
|
||||
const tableList = ref([]) // 列表数据源
|
||||
|
|
@ -242,6 +243,10 @@ const getTableList = async (isTap = false) => {
|
|||
mask: true
|
||||
})
|
||||
const res = await getRepairedList(queryParams.value)
|
||||
setTimeout(() => {
|
||||
scrollTop.value = uni.getStorageSync('scrollTop') || 0
|
||||
console.log('🚀 ~ scrollTop.value:', scrollTop.value)
|
||||
}, 400)
|
||||
total.value = res.data.total
|
||||
if (isTap) {
|
||||
tableList.value = res.data.rows
|
||||
|
|
@ -271,30 +276,38 @@ const getTableList = async (isTap = false) => {
|
|||
}
|
||||
|
||||
// 页面加载完毕
|
||||
onLoad(() => {
|
||||
// tableList.value = []
|
||||
// total.value = 0
|
||||
onShow(() => {
|
||||
tableList.value = []
|
||||
total.value = 0
|
||||
if (uni.getStorageSync('queryParams')) {
|
||||
queryParams.value = JSON.parse(uni.getStorageSync('queryParams'))
|
||||
}
|
||||
active.value = uni.getStorageSync('activeTab') || 1
|
||||
getTableList()
|
||||
})
|
||||
|
||||
// onShow(() => {
|
||||
// tableList.value = []
|
||||
// total.value = 0
|
||||
// getTableList()
|
||||
// })
|
||||
|
||||
// 滚动触底事件
|
||||
const onScrollTolower = debounce(() => {
|
||||
console.log('触底事件')
|
||||
if (total.value > tableList.value.length) {
|
||||
queryParams.value.pageSize += 5
|
||||
queryParams.value.pageSize += 10
|
||||
getTableList()
|
||||
}
|
||||
}, 500)
|
||||
|
||||
let timer = null
|
||||
const onScroll = (e) => {
|
||||
if (timer) clearTimeout(timer)
|
||||
timer = setTimeout(() => {
|
||||
uni.setStorageSync('scrollTop', e.detail.scrollTop)
|
||||
uni.setStorageSync('queryParams', JSON.stringify(queryParams.value))
|
||||
}, 500)
|
||||
}
|
||||
// tap 栏切换
|
||||
const changeTab = (index) => {
|
||||
active.value = index
|
||||
uni.setStorageSync('scrollTop', 0)
|
||||
uni.setStorageSync('activeTab', index)
|
||||
if (index == 1) {
|
||||
queryParams.value.appTaskStatus = 0 // 查未完成的
|
||||
queryParams.value.pageNum = 1
|
||||
|
|
|
|||
|
|
@ -153,6 +153,7 @@ import { onShow,onLoad } from '@dcloudio/uni-app'
|
|||
const urlPermissions = ref([])
|
||||
onShow((options) => {
|
||||
urlPermissions.value = uni.getStorageSync('urlPermissions')
|
||||
uni.removeStorageSync('activeTab')
|
||||
uni.removeStorageSync('scrollTop')
|
||||
uni.removeStorageSync('queryParams')
|
||||
})
|
||||
|
|
|
|||
Loading…
Reference in New Issue