剩余模块:生产退料
This commit is contained in:
@@ -2,19 +2,10 @@
|
||||
<view class="app status-bar-gap">
|
||||
<view class="page">
|
||||
<l-header :title="t('home.llyz')" sticky></l-header>
|
||||
<view class="input-box">
|
||||
<view class="input-item">
|
||||
<up-input :placeholder="t('verify.grn')" border="none" clearable inputAlign="left"
|
||||
v-model="state.queryString" @change="changeFun">
|
||||
<template #prefix>
|
||||
<up-icon name="search" color="#2979ff" size="24"></up-icon>
|
||||
</template>
|
||||
</up-input>
|
||||
</view>
|
||||
</view>
|
||||
<architecture ref="architectureRef" :dataType="t('home.llyz')" :placeholder="t('verify.grn')" @scanConfirm="scanConfirmFun" @inputConfirm="changeFun" />
|
||||
<view class="receive-listBox" ref="listBoxRef">
|
||||
<scroll-view id="scroll-box" class="scroll-box" scroll-y="true"
|
||||
:style="{'height':state.scrollHeight+'px'}" @scrolltolower="fnScrollBottom()">
|
||||
<scroll-view id="scroll-box" class="scroll-box" scroll-y="true" :style="{'height':state.scrollHeight+'px'}"
|
||||
@scrolltolower="fnScrollBottom()">
|
||||
<view class="list-box-list" v-if="state.dataList.length > 0">
|
||||
<view class="data-item" @click.stop="fnToUrl(item)" v-for="(item, index) in state.dataList" :key="index">
|
||||
<view class="tit">{{ t('verify.grn') }}:{{item.FBillNo}}</view>
|
||||
@@ -22,7 +13,7 @@
|
||||
<view class="b-font">{{ t('verify.date') }}:{{item.FDateFormat}}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="state.dataList.length==0">
|
||||
<view v-if="state.dataList.length==0">
|
||||
<up-empty mode="list"></up-empty>
|
||||
</view>
|
||||
</scroll-view>
|
||||
@@ -40,6 +31,7 @@
|
||||
const listBoxRef = ref(null)
|
||||
const getI18n = useI18n()
|
||||
const { t, locale } = getI18n
|
||||
const architectureRef = ref()
|
||||
const state = reactive({
|
||||
queryString: '',
|
||||
dataList: [],
|
||||
@@ -50,20 +42,31 @@
|
||||
totalCount: 0
|
||||
}
|
||||
})
|
||||
|
||||
onShow(() => { })
|
||||
onMounted(() => {
|
||||
const query = uni.createSelectorQuery().in(this);
|
||||
query.select(".receive-listBox").boundingClientRect((data) => {
|
||||
state.scrollHeight = data.height
|
||||
}).exec();
|
||||
listInit()
|
||||
fnDataList()
|
||||
})
|
||||
const listInit = () => {
|
||||
nextTick(() => {
|
||||
const query = uni.createSelectorQuery().in(this);
|
||||
query.select(".receive-listBox").boundingClientRect((data) => {
|
||||
state.scrollHeight = data.height
|
||||
}).exec();
|
||||
})
|
||||
}
|
||||
const scanConfirmFun = (e : any) => {
|
||||
state.queryString = e
|
||||
state.page.pageIndex = 1
|
||||
state.dataList = []
|
||||
listInit()
|
||||
fnDataList()
|
||||
architectureRef.value.closeFun()
|
||||
}
|
||||
const fnScrollBottom = () => {
|
||||
console.log(state.page.pageIndex * state.page.pageSize,state.page.totalCount);
|
||||
console.log(state.page.pageIndex * state.page.pageSize, state.page.totalCount);
|
||||
if (state.page.pageIndex * state.page.pageSize <= state.page.totalCount) {
|
||||
debugger
|
||||
state.page.pageIndex ++;
|
||||
state.page.pageIndex++;
|
||||
uni.showLoading({ mask: true });
|
||||
setTimeout(() => {
|
||||
fnDataList();
|
||||
@@ -71,7 +74,7 @@
|
||||
}
|
||||
}
|
||||
const fnToUrl = (item : any) => {
|
||||
toPages('/pages/verifyTa/material',{id:item.FID,fBillNo:item.FBillNo})
|
||||
toPages('/pages/verifyTa/material', { id: item.FID, fBillNo: item.FBillNo })
|
||||
}
|
||||
const debounceTimer = ref()
|
||||
const changeFun = (e : any) => {
|
||||
@@ -81,7 +84,8 @@
|
||||
state.page.pageIndex = 1
|
||||
state.dataList = []
|
||||
fnDataList()
|
||||
}, 500)
|
||||
})
|
||||
|
||||
}
|
||||
const fnDataList = () => {
|
||||
let param = {
|
||||
@@ -103,18 +107,15 @@
|
||||
|
||||
if (state.page.pageIndex == 1) {
|
||||
state.dataList = dataArray;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
state.dataList = state.dataList.concat(dataArray);
|
||||
}
|
||||
state.page.totalCount = result.total;
|
||||
|
||||
if (state.dataList.length == state.page.totalCount) {
|
||||
// more_status.value = 'nomore';
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
const toPages = (url : string, data : any = {}) => {
|
||||
uni.$u.route({
|
||||
url: url,
|
||||
@@ -171,25 +172,29 @@
|
||||
.receive-listBox {
|
||||
flex: 1;
|
||||
|
||||
.list-box-list{
|
||||
.list-box-list {
|
||||
width: 100%;
|
||||
|
||||
// margin: 20rpx auto;
|
||||
.data-item{
|
||||
.data-item {
|
||||
border: 1px solid #efeaea;
|
||||
border-radius: 20rpx;
|
||||
box-shadow: 0rpx 15rpx 15rpx #efeaea;
|
||||
box-shadow: 0rpx 15rpx 15rpx #efeaea;
|
||||
padding: 20rpx 20rpx 0;
|
||||
margin-bottom: 20rpx;
|
||||
background-color: #ffffff;
|
||||
.tit{
|
||||
|
||||
.tit {
|
||||
font-size: 30rpx;
|
||||
font-weight: bold;
|
||||
padding: 20rpx 0;
|
||||
}
|
||||
.line-p{
|
||||
|
||||
.line-p {
|
||||
border: 1px solid #efeaea;
|
||||
}
|
||||
.b-font{
|
||||
|
||||
.b-font {
|
||||
font-size: 25rpx;
|
||||
padding: 20rpx 0;
|
||||
}
|
||||
@@ -198,5 +203,4 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
</style>
|
||||
@@ -4,19 +4,11 @@
|
||||
<l-header :title="state.FBillNo" sticky #right>
|
||||
<view style="margin-right: 32rpx;" @click="dataPushNotification">{{ t('verify.tj') }}</view>
|
||||
</l-header>
|
||||
<view class="input-box">
|
||||
<view class="input-item">
|
||||
<up-input :placeholder="t('verify.tm')" border="none" clearable inputAlign="left" inputmode="none"
|
||||
v-model="state.queryString" @change="changeFun" ref="inputRef">
|
||||
<template #prefix>
|
||||
<up-icon name="scan" color="#2979ff" size="24"></up-icon>
|
||||
</template>
|
||||
</up-input>
|
||||
</view>
|
||||
</view>
|
||||
<architecture ref="architectureRef" :dataType="t('home.llyz')" icon="scan" :placeholder="t('verify.tm')"
|
||||
@scanConfirm="scanConfirmFun" @inputConfirm="changeFun"
|
||||
:fence="[state.scanFrameRefShow,state.shortcutRefShow]" />
|
||||
<view class="material-listBox">
|
||||
<scroll-view id="scroll-box" class="scroll-box" scroll-y="true"
|
||||
:style="{'height':state.scrollHeight+'px'}">
|
||||
<scroll-view id="scroll-box" class="scroll-box" scroll-y="true" :style="{'height':state.scrollHeight+'px'}">
|
||||
<view class="list-box-list" v-if="state.dataList.length > 0">
|
||||
<view class="data-item" v-for="(item, index) in state.dataList"
|
||||
:style="[{'background-color':interpolation(item)},{'margin-bottom':index + 1 === state.dataList.length ? '80px' : '20px'}]"
|
||||
@@ -71,9 +63,10 @@
|
||||
</view>
|
||||
<scanFrame ref="scanFrameRef" @confirmation="scanFrameCnfirmation"
|
||||
@scanFrameDataFeedback="(res:object)=>{state.scanFrameDataFeedback = res}"
|
||||
@fast="(row:any)=>{state.scanFrameDataFeedback = row}" @err="scanFrameErrFun" />
|
||||
<shortcut ref="shortcutRef" @dataToscanFrame="dataToscanFrameFun" />
|
||||
<tools :type="['scanRecord','defaultPopup']" ref="toolsRef" @defaultPopup="defaultPopupFun" @scanRecord="scanRecordFun" />
|
||||
@fast="(row:any)=>{state.scanFrameDataFeedback = row}" @err="scanFrameErrFun" @boxShow="scanFrameBoxShowShow" />
|
||||
<shortcut ref="shortcutRef" @dataToscanFrame="dataToscanFrameFun" @boxShow="shortcutBoxShowShow" />
|
||||
<tools :type="['scanRecord','defaultPopup']" ref="toolsRef" @defaultPopup="defaultPopupFun"
|
||||
@scanRecord="scanRecordFun" />
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
@@ -85,12 +78,17 @@
|
||||
import scanFrame from '../../components/scan-frame/scan-frame.vue'
|
||||
import tools from '../../components/tools/tools.vue'
|
||||
import shortcut from '../../components/tools/shortcut.vue'
|
||||
const architectureRef = ref()
|
||||
const inputRef = ref()
|
||||
const scanFrameRef = ref()
|
||||
const shortcutRef = ref()
|
||||
const getI18n = useI18n()
|
||||
const { t, locale } = getI18n
|
||||
const state = reactive({
|
||||
scanFrameRefShow: false,
|
||||
shortcutRefShow: false,
|
||||
|
||||
|
||||
queryString: '',
|
||||
dataList: [],
|
||||
scrollHeight: 0,
|
||||
@@ -122,9 +120,19 @@
|
||||
query.select(".material-listBox").boundingClientRect((data) => {
|
||||
state.scrollHeight = data.height
|
||||
}).exec();
|
||||
|
||||
|
||||
})
|
||||
const scanConfirmFun = (e : any) => {
|
||||
getReceiveBillScanData(e)
|
||||
}
|
||||
const shortcutBoxShowShow = (val : boolean) => {
|
||||
state.shortcutRefShow = val
|
||||
console.log('=============================================',state.shortcutRefShow);
|
||||
}
|
||||
const scanFrameBoxShowShow = (val : boolean) => {
|
||||
state.scanFrameRefShow = val
|
||||
console.log('=============================================',state.scanFrameRefShow);
|
||||
}
|
||||
/**
|
||||
* 数据逻辑
|
||||
*/
|
||||
@@ -146,7 +154,7 @@
|
||||
debounceTimer.value = setTimeout(() => {
|
||||
state.queryString = e
|
||||
if (state.queryString !== '') getReceiveBillScanData(e)
|
||||
}, 500)
|
||||
})
|
||||
}
|
||||
//查询录入
|
||||
const getReceiveBillScanData = (val : string) => {
|
||||
@@ -157,7 +165,7 @@
|
||||
}).then((res : any) => {
|
||||
if (res.code == 200) {
|
||||
console.log(res);
|
||||
scanFrameRef.value.getreceiveBillScanData({ ...res.data, queryString: state.queryString, scanFrameShowSate: state.shortcutDataFeedback.scanFrameShowSate,stashVerify:true })
|
||||
scanFrameRef.value.getreceiveBillScanData({ ...res.data, queryString: state.queryString, scanFrameShowSate: state.shortcutDataFeedback.scanFrameShowSate, stashVerify: true })
|
||||
if (Object.keys(state.shortcutDataFeedback).length) {
|
||||
if (state.shortcutDataFeedback.scanFrameShowSate) {
|
||||
scanFrameRef.value.stateShow(true)
|
||||
@@ -171,6 +179,7 @@
|
||||
uni.$u.toast(t('index.bmygtsj'))
|
||||
state.queryString = ''
|
||||
}
|
||||
architectureRef.value.closeFun()
|
||||
})
|
||||
}
|
||||
//固定弹窗数据传输
|
||||
@@ -250,7 +259,7 @@
|
||||
};
|
||||
uni.showLoading({ mask: true });
|
||||
//获取扫描数据里的所有数据
|
||||
temporaryScanList(param).then((resLIst:any) => {
|
||||
temporaryScanList(param).then((resLIst : any) => {
|
||||
if (resLIst.code == 200) {
|
||||
if (resLIst.data.list.length != 0) {
|
||||
resLIst.data.list.forEach((item : any) => {
|
||||
|
||||
Reference in New Issue
Block a user