2025-04-09 18:55:14 +08:00
|
|
|
<template>
|
|
|
|
<view class="app status-bar-gap">
|
|
|
|
<view class="page">
|
2025-05-20 14:40:44 +08:00
|
|
|
<l-header :title="t('public.smjl')" sticky #right>
|
|
|
|
<view style="margin-right: 32rpx;" @click="fStockFlexDetailMultiDeleteFun()">{{ t('index.qbsc') }}</view>
|
2025-04-09 18:55:14 +08:00
|
|
|
</l-header>
|
|
|
|
<view class="input-box">
|
|
|
|
<view class="input-item">
|
|
|
|
<up-input :placeholder="t('receive.code')" border="none" clearable inputAlign="left"
|
|
|
|
v-model="state.queryString" @change="changeFun" ref="inputRef">
|
|
|
|
<template #prefix>
|
|
|
|
<up-icon name="search" color="#2979ff" size="24"></up-icon>
|
|
|
|
</template>
|
|
|
|
</up-input>
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
<view class="records-listBox">
|
2025-05-20 14:40:44 +08:00
|
|
|
<scroll-view id="scroll-box" class="scroll-box" scroll-y="true" :style="{'height':state.scrollHeight+'px'}"
|
|
|
|
@scrolltolower="fnScrollBottom()">
|
2025-04-09 18:55:14 +08:00
|
|
|
<view class="list-box-list">
|
|
|
|
<uni-swipe-action>
|
|
|
|
<uni-swipe-action-item :right-options="state.options" @click="onClick"
|
|
|
|
@change="swipeChange($event, index)" v-for="(item, index) in state.dataList">
|
|
|
|
<template #right>
|
|
|
|
<view class="itemRight" @click="fStockFlexDetailDeleteFun(item)">
|
|
|
|
<up-icon name="trash" color="#ffffff" size="28"></up-icon>
|
|
|
|
</view>
|
|
|
|
</template>
|
2025-05-20 14:40:44 +08:00
|
|
|
<view class="data-item" :style="[{'background-color':'#ffffff'}]" :key="index">
|
2025-04-09 18:55:14 +08:00
|
|
|
<view class="text" style="margin-bottom: 20px;display: flex;">
|
|
|
|
<view>{{ item['FVHUBMaterial.FName'] }}</view>
|
|
|
|
</view>
|
|
|
|
<view class="itemBox">
|
2025-05-20 14:40:44 +08:00
|
|
|
<view>{{ t('receive.djbh') }}</view>
|
2025-04-09 18:55:14 +08:00
|
|
|
<view class="zongjian"></view>
|
|
|
|
<view>{{ item.FVHUBFBillNo }}</view>
|
|
|
|
</view>
|
|
|
|
<view class="itemBox">
|
2025-05-20 14:40:44 +08:00
|
|
|
<view>{{ t('public.wlbm') }}</view>
|
2025-04-09 18:55:14 +08:00
|
|
|
<view class="zongjian"></view>
|
|
|
|
<view>{{ item.FVHUBMaterialNumber }}</view>
|
|
|
|
</view>
|
|
|
|
<view class="itemBox">
|
2025-05-20 14:40:44 +08:00
|
|
|
<view>{{ t('public.qty') }}</view>
|
2025-04-09 18:55:14 +08:00
|
|
|
<view class="zongjian"></view>
|
|
|
|
<view>{{ item.FVHUBScanQty }}</view>
|
|
|
|
</view>
|
|
|
|
<view class="itemBox">
|
2025-05-20 14:40:44 +08:00
|
|
|
<view>{{ t('receive.rq') }}</view>
|
2025-04-09 18:55:14 +08:00
|
|
|
<view class="zongjian"></view>
|
|
|
|
<view>{{ parseTime(item.FVHUBCreateDate, '{y}-{m}-{d} {h}:{i}') }}</view>
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
</uni-swipe-action-item>
|
|
|
|
</uni-swipe-action>
|
|
|
|
</view>
|
2025-05-20 14:40:44 +08:00
|
|
|
<view v-if="state.dataList.length==0">
|
2025-04-09 18:55:14 +08:00
|
|
|
<up-empty mode="list"></up-empty>
|
|
|
|
</view>
|
|
|
|
</scroll-view>
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts" setup>
|
|
|
|
import { reactive, nextTick, onMounted, ref, computed, watch } from 'vue';
|
|
|
|
import { onLoad, onShow, onReachBottom, } from '@dcloudio/uni-app'
|
2025-05-20 14:40:44 +08:00
|
|
|
|
2025-04-09 18:55:14 +08:00
|
|
|
import { parseTime } from '../../utils/tools.js';
|
|
|
|
// parseTime(p.FDate, '{y}-{m}-{d}');
|
|
|
|
import { fStockFlexDetailDelete, fStockFlexDetailMultiDelete, receiveBillList, temporaryScanList } from '../../common/request/api/api';
|
|
|
|
import { sqlite } from '../../stores/sqlite'
|
2025-05-20 14:40:44 +08:00
|
|
|
import { useI18n } from 'vue-i18n'
|
2025-04-09 18:55:14 +08:00
|
|
|
const getI18n = useI18n()
|
|
|
|
const { t, locale } = getI18n
|
2025-05-20 14:40:44 +08:00
|
|
|
const DB = sqlite()
|
|
|
|
const inputRef = ref()
|
|
|
|
|
2025-04-09 18:55:14 +08:00
|
|
|
const state = reactive({
|
|
|
|
queryString: '',
|
|
|
|
dataList: [],
|
|
|
|
scrollHeight: 0,
|
|
|
|
page: {
|
|
|
|
pageIndex: 1,
|
|
|
|
pageSize: 20,
|
|
|
|
totalCount: 0
|
|
|
|
},
|
|
|
|
options: [
|
|
|
|
{
|
|
|
|
text: '取消',
|
|
|
|
style: {
|
|
|
|
backgroundColor: '#007aff'
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
|
|
|
text: '确认',
|
|
|
|
style: {
|
|
|
|
backgroundColor: '#dd524d'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
],
|
|
|
|
navIndex: 0,
|
|
|
|
FormId: '',
|
|
|
|
FbillNo: '',
|
|
|
|
userId: ''
|
|
|
|
})
|
|
|
|
onLoad((pageData : any) => {
|
|
|
|
state.FormId = pageData.FormId
|
|
|
|
state.FbillNo = pageData.FbillNo
|
|
|
|
state.userId = uni.getStorageSync('userInfo').Context.UserId
|
|
|
|
fnDataList()
|
|
|
|
})
|
|
|
|
onMounted(() => {
|
|
|
|
const query = uni.createSelectorQuery().in(this);
|
|
|
|
query.select(".records-listBox").boundingClientRect((data) => {
|
|
|
|
state.scrollHeight = data.height
|
|
|
|
}).exec();
|
|
|
|
})
|
|
|
|
//防抖输入
|
|
|
|
const debounceTimer = ref()
|
|
|
|
const changeFun = (e : any) => {
|
|
|
|
if (debounceTimer.value !== null) clearTimeout(debounceTimer.value)
|
|
|
|
debounceTimer.value = setTimeout(() => {
|
|
|
|
state.queryString = e
|
|
|
|
if (state.queryString !== '') { }
|
|
|
|
}, 500)
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
const navClick = (index : any) => { state.navIndex = index }
|
2025-05-20 14:40:44 +08:00
|
|
|
const onClick = (e : any) => { }
|
|
|
|
const swipeChange = (e : any, index : any) => { }
|
|
|
|
|
|
|
|
const fStockFlexDetailDeleteFun = (item : any) => {
|
2025-04-09 18:55:14 +08:00
|
|
|
uni.showModal({
|
2025-05-20 14:40:44 +08:00
|
|
|
title: t('index.ts'), content: t('index.qdysc'), cancelText: t('public.cancel'), confirmText: t('public.confirm'),
|
|
|
|
success(res) {
|
2025-04-09 18:55:14 +08:00
|
|
|
if (res.confirm) {
|
2025-05-20 14:40:44 +08:00
|
|
|
fStockFlexDetailDelete({ Ids: item.FID + '' }).then((res : any) => {
|
|
|
|
if (res.code === 200) {
|
|
|
|
uni.$u.toast(t('index.ysc'))
|
2025-04-09 18:55:14 +08:00
|
|
|
state.page.pageIndex = 1
|
|
|
|
fnDataList()
|
|
|
|
}
|
|
|
|
})
|
|
|
|
} else if (res.cancel) {
|
|
|
|
console.log('用户点击取消');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
const fStockFlexDetailMultiDeleteFun = () => {
|
|
|
|
uni.showModal({
|
2025-05-20 14:40:44 +08:00
|
|
|
title: t('index.ts'), content: t('index.qdyqbsc'), cancelText: t('public.cancel'), confirmText: t('public.confirm'),
|
|
|
|
success(res) {
|
2025-04-09 18:55:14 +08:00
|
|
|
if (res.confirm) {
|
2025-05-20 14:40:44 +08:00
|
|
|
fStockFlexDetailMultiDelete({ FVHUBFormId: state.FormId }).then((res : any) => {
|
|
|
|
if (res.code === 200) {
|
|
|
|
uni.$u.toast(t('index.tqbsc'))
|
2025-04-09 18:55:14 +08:00
|
|
|
state.page.pageIndex = 1
|
|
|
|
fnDataList()
|
|
|
|
}
|
|
|
|
})
|
|
|
|
} else if (res.cancel) {
|
|
|
|
console.log('用户点击取消');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
const fnScrollBottom = () => {
|
|
|
|
console.log(state.page.pageIndex * state.page.pageSize, state.page.totalCount);
|
|
|
|
if (state.page.pageIndex * state.page.pageSize <= state.page.totalCount) {
|
|
|
|
state.page.pageIndex++;
|
|
|
|
uni.showLoading({ mask: true });
|
|
|
|
setTimeout(() => {
|
|
|
|
fnDataList();
|
|
|
|
}, 500);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 数据请求
|
|
|
|
*/
|
|
|
|
const fnDataList = () => {
|
|
|
|
let param = {
|
|
|
|
pageSize: state.page.pageSize,
|
|
|
|
pageIndex: state.page.pageIndex,
|
|
|
|
FormId: state.FormId,
|
|
|
|
UserId: state.userId,
|
|
|
|
FbillNo: state.FbillNo
|
|
|
|
};
|
|
|
|
uni.showLoading({ mask: true });
|
|
|
|
temporaryScanList(param).then(res => {
|
|
|
|
if (res.code == 200) {
|
|
|
|
if (state.page.pageIndex == 1) {
|
|
|
|
state.dataList = res.data.list;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
state.dataList = state.dataList.concat(res.data.list);
|
|
|
|
}
|
|
|
|
state.page.totalCount = res.data.total;
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
//中英切换
|
|
|
|
const formatLangTextValue = (val : any) => {
|
|
|
|
let lang_Id = uni.getStorageSync('locale')
|
|
|
|
let item = val.find(p => p.Key == (lang_Id == 'cn' ? 2052 : 1033));
|
|
|
|
if (item != null) {
|
|
|
|
return item.Value;
|
|
|
|
}
|
|
|
|
return val[0].Value;
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="scss">
|
|
|
|
:deep(.button-group--right) {
|
|
|
|
height: calc(100% - 16rpx) !important;
|
|
|
|
}
|
|
|
|
|
|
|
|
.app {
|
|
|
|
background-color: #F5F5F5;
|
|
|
|
|
|
|
|
.page {
|
|
|
|
padding: 18px 32rpx;
|
|
|
|
display: flex;
|
|
|
|
flex-direction: column;
|
|
|
|
height: 100%;
|
|
|
|
flex: 1;
|
2025-05-20 14:40:44 +08:00
|
|
|
|
2025-04-09 18:55:14 +08:00
|
|
|
.input-box {
|
|
|
|
background-color: white;
|
|
|
|
box-sizing: border-box;
|
|
|
|
padding: 0 16rpx;
|
|
|
|
border-radius: 24rpx;
|
|
|
|
margin: 0 0 32rpx 0;
|
|
|
|
|
|
|
|
.u-textarea {
|
|
|
|
padding: 0 !important;
|
|
|
|
font-size: 24rpx !important;
|
|
|
|
color: #999999 !important;
|
|
|
|
}
|
|
|
|
|
|
|
|
.input-item {
|
|
|
|
box-sizing: border-box;
|
|
|
|
padding: 16rpx 0;
|
|
|
|
color: #222222;
|
|
|
|
font-size: 28rpx;
|
|
|
|
font-weight: 400;
|
|
|
|
|
|
|
|
.item-title {
|
|
|
|
//font-weight: 500;
|
|
|
|
font-size: 32rpx;
|
|
|
|
color: #333333;
|
|
|
|
}
|
|
|
|
|
|
|
|
.item-text {
|
|
|
|
font-weight: 400;
|
|
|
|
font-size: 27rpx;
|
|
|
|
color: #999999;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2025-05-20 14:40:44 +08:00
|
|
|
|
2025-04-09 18:55:14 +08:00
|
|
|
.records-listBox {
|
|
|
|
flex: 1;
|
|
|
|
|
|
|
|
.list-box-list {
|
|
|
|
width: 100%;
|
2025-05-20 14:40:44 +08:00
|
|
|
|
2025-04-09 18:55:14 +08:00
|
|
|
.itemRight {
|
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
padding: 34rpx;
|
|
|
|
background-color: #ff5a5d;
|
|
|
|
border-top-right-radius: 20rpx;
|
|
|
|
border-bottom-right-radius: 20rpx;
|
|
|
|
}
|
|
|
|
|
|
|
|
.data-item {
|
|
|
|
border: 1px solid #efeaea;
|
|
|
|
border-radius: 20rpx;
|
|
|
|
box-shadow: 0rpx 15rpx 15rpx #efeaea;
|
|
|
|
padding: 20rpx 22rpx;
|
|
|
|
margin-bottom: 16rpx;
|
|
|
|
background-color: #ffffff;
|
|
|
|
|
|
|
|
.itemBox {
|
|
|
|
line-height: 50rpx;
|
|
|
|
display: flex;
|
|
|
|
justify-content: space-between;
|
|
|
|
align-items: center;
|
|
|
|
|
|
|
|
.zongjian {
|
|
|
|
height: 1px;
|
|
|
|
flex: 1;
|
|
|
|
background-color: #f0f0f0;
|
|
|
|
margin: 0 16rpx;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</style>
|