11
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<view class="app status-bar-gap">
|
||||
<view class="page">
|
||||
<l-header :title="state.FBillNo" sticky #right>
|
||||
<l-header title="生成装箱" sticky #right>
|
||||
<view style="margin-right: 32rpx;" @click="dataPushNotification">{{ t('receive.tj') }}</view>
|
||||
</l-header>
|
||||
<view class="material-listBox">
|
||||
@@ -9,7 +9,7 @@
|
||||
: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'}]"
|
||||
:style="[{'background-color':'#ffffff'},{'margin-bottom':index + 1 === state.dataList.length ? '80px' : '20px'}]"
|
||||
:key="index">
|
||||
<view class="text" style="margin-bottom: 20px;display: flex;">
|
||||
<view>{{ item.MaterialName }}</view>
|
||||
@@ -52,12 +52,19 @@
|
||||
</view>
|
||||
<view style="text-align: center;color: #F5F5F5;height: 20px;"></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>
|
||||
</view>
|
||||
</view>
|
||||
<listPopup ref="listPopupRef" @toViewPopupData="toViewPopupDataFun"/>
|
||||
<viewPopup ref="viewPopupRef" @listPopupData="getReceiveBillScanData"/>
|
||||
<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 ref="toolsRef" type="encasement" @defaultPopup="defaultPopupFun" @scanRecord="scanRecordFun" @alternativeDocument="alternativeDocumentFun"/>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
@@ -65,85 +72,52 @@
|
||||
import { reactive, nextTick, onMounted, ref, computed, watch } from 'vue';
|
||||
import { onLoad, onShow, onReachBottom, } from '@dcloudio/uni-app'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
import { parseTime } from '../../utils/tools.js';
|
||||
import { PRD_MORPTPush, PRD_MORPTScanData, PRD_MORPTView, SAL_DELIVERYNOTICEPush, SAL_DELIVERYNOTICEScanData, SAL_DELIVERYNOTICEView, fStockFlexDetailDelete, temporaryScanDraftSave, temporaryScanList } from '../../common/request/api/api';
|
||||
import { SAL_DELIVERYNOTICEPush, temporaryScanList, fStockFlexDetailDelete, PRD_MORPTScanData, temporaryScanDraftSave } from '../../common/request/api/api';
|
||||
import scanFrame from '../../components/scan-frame/scan-frame.vue'
|
||||
import tools from '../../components/tools/tools.vue'
|
||||
import shortcut from '../../components/tools/shortcut.vue'
|
||||
import { sqlite } from '../../stores/sqlite'
|
||||
const DB = sqlite()
|
||||
const inputRef = ref()
|
||||
import listPopup from './listPopup.vue'
|
||||
import viewPopup from './viewPopup.vue'
|
||||
import { encasement } from '../../stores/encasement'
|
||||
const DBEncasement = encasement()
|
||||
const scanFrameRef = ref()
|
||||
const shortcutRef = ref()
|
||||
const listPopupRef = ref()
|
||||
const viewPopupRef = ref()
|
||||
const getI18n = useI18n()
|
||||
const { t, locale } = getI18n
|
||||
const state = reactive({
|
||||
queryString: '',
|
||||
dataList: [],
|
||||
scrollHeight: 0,
|
||||
page: {
|
||||
pageIndex: 1,
|
||||
pageSize: 200,
|
||||
totalCount: 0
|
||||
},
|
||||
FBillNo: '',
|
||||
materialId: '',
|
||||
supplierName: '',
|
||||
inputFocus: true,
|
||||
listPopupShow: true,
|
||||
scanFrameDataFeedback: {},
|
||||
shortcutDataFeedback: {},
|
||||
})
|
||||
onLoad((pageData : any) => {
|
||||
console.log(pageData);
|
||||
state.materialId = pageData.id
|
||||
state.FBillNo = pageData.fBillNo
|
||||
fnDataList(state.materialId);
|
||||
})
|
||||
onShow(() => {
|
||||
if(state.materialId){
|
||||
fnDataList(state.materialId);
|
||||
}
|
||||
onLoad(() => { })
|
||||
onShow(() => {
|
||||
// DBEncasement.injectEncasementMaterialList('132132')
|
||||
})
|
||||
onMounted(() => {
|
||||
const query = uni.createSelectorQuery().in(this);
|
||||
query.select(".material-listBox").boundingClientRect((data) => {
|
||||
state.scrollHeight = data.height
|
||||
}).exec();
|
||||
// scanFrameRef.value.stateShow(true)
|
||||
|
||||
})
|
||||
/**
|
||||
* 数据逻辑
|
||||
*/
|
||||
const interpolation = (item : any) => {
|
||||
if (item.CheckJoinQty === 0 && item.CheckJoinQty + item.NoCheckQty === item.CheckQty) {
|
||||
return '#ffffff'
|
||||
}
|
||||
if (item.CheckJoinQty !== 0 && item.NoCheckQty !== 0 && item.CheckJoinQty + item.NoCheckQty === item.CheckQty) {
|
||||
return 'rgb(254 227 87)'
|
||||
}
|
||||
if (item.CheckJoinQty === item.CheckQty) {
|
||||
return 'rgb(87 191 254)'
|
||||
}
|
||||
}
|
||||
//防抖输入
|
||||
const debounceTimer = ref()
|
||||
const changeFun = (e : any) => {
|
||||
if (debounceTimer.value !== null) clearTimeout(debounceTimer.value)
|
||||
debounceTimer.value = setTimeout(() => {
|
||||
state.queryString = e
|
||||
if (state.queryString !== '') getReceiveBillScanData(e)
|
||||
}, 500)
|
||||
}
|
||||
|
||||
//查询录入
|
||||
const getReceiveBillScanData = (val : string) => {
|
||||
SAL_DELIVERYNOTICEScanData({
|
||||
PRD_MORPTScanData({
|
||||
FBarCode: val,
|
||||
FBillNo: state.FBillNo,
|
||||
IsPack: 'true'
|
||||
}).then((res : any) => {
|
||||
if (res.data !== null) {
|
||||
console.log(res);
|
||||
scanFrameRef.value.getreceiveBillScanData({ ...res.data, queryString: state.queryString, scanFrameShowSate: state.shortcutDataFeedback.scanFrameShowSate })
|
||||
console.log(res,val);
|
||||
debugger
|
||||
scanFrameRef.value.getreceiveBillScanData({ ...res.data, queryString: val, scanFrameShowSate: state.shortcutDataFeedback.scanFrameShowSate, stashVerify: true })
|
||||
if (Object.keys(state.shortcutDataFeedback).length) {
|
||||
if (state.shortcutDataFeedback.scanFrameShowSate) {
|
||||
scanFrameRef.value.stateShow(true)
|
||||
@@ -159,11 +133,6 @@
|
||||
}
|
||||
})
|
||||
}
|
||||
//固定弹窗数据传输
|
||||
const scanFrameCnfirmation = (row : any) => {
|
||||
state.scanFrameDataFeedback = row
|
||||
postTemporaryScanDraftSaveFun(state.scanFrameDataFeedback)
|
||||
}
|
||||
//数据记录暂存
|
||||
const postTemporaryScanDraftSaveFun = (item : any) => {
|
||||
const obj = {};
|
||||
@@ -181,6 +150,7 @@
|
||||
FVHUBScanQty: item.quantityStr + '', //扫描数量
|
||||
FVHUBEntryId: scanFrameRef.value.state.receiveBillScanData.Id, //物料ID
|
||||
FVHUBFlot: item.batchNumberStr, //批号
|
||||
FType: "pack",
|
||||
FVHUBStock: {
|
||||
FNUMBER: item.warehouseData.FNUMBER //仓库编号
|
||||
},
|
||||
@@ -192,21 +162,32 @@
|
||||
console.log(res);
|
||||
state.queryString = ''
|
||||
if (res.data.IsSuccess) {
|
||||
fnDataList(state.materialId);
|
||||
uni.$u.toast('成功')
|
||||
scanFrameRef.value.stateShow(false)
|
||||
}
|
||||
})
|
||||
}
|
||||
//默认值传递
|
||||
|
||||
/**
|
||||
* 弹窗逻辑
|
||||
*/
|
||||
const scanFrameCnfirmation = (row : any) => {
|
||||
//固定弹窗数据传输
|
||||
state.scanFrameDataFeedback = row
|
||||
}
|
||||
const dataToscanFrameFun = (res : object) => {
|
||||
//默认值传递
|
||||
state.shortcutDataFeedback = res
|
||||
scanFrameRef.value.getComponentsData(res)
|
||||
shortcutRef.value.stateShow(false)
|
||||
shortcutRef.value.stateShow(false,'encasement')
|
||||
}
|
||||
//唤起默认值弹窗
|
||||
const defaultPopupFun = () => {
|
||||
shortcutRef.value.stateShow(true)
|
||||
//唤起默认值弹窗
|
||||
shortcutRef.value.stateShow(true,'encasement')
|
||||
}
|
||||
const scanFrameErrFun = () => {
|
||||
//异常弹出
|
||||
scanFrameRef.value.stateShow(true)
|
||||
}
|
||||
const scanRecordFun = () => {
|
||||
toPages('/pages/records/index', {
|
||||
@@ -214,10 +195,22 @@
|
||||
FbillNo: state.FBillNo
|
||||
})
|
||||
}
|
||||
const alternativeDocumentFun = () => {
|
||||
//唤起选单弹窗
|
||||
listPopupRef.value.openFun()
|
||||
}
|
||||
const toViewPopupDataFun = (row:any) => {
|
||||
//唤起物料弹窗
|
||||
state.FBillNo = row.FBillNo
|
||||
listPopupRef.value.close()
|
||||
viewPopupRef.value.openFun(row)
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 数据推送
|
||||
*/
|
||||
|
||||
const dataPushNotification = () => {
|
||||
uni.showModal({
|
||||
title: '提示', content: '确定要推送此次数据吗', cancelText: '取消', confirmText: '确定',
|
||||
@@ -229,7 +222,8 @@
|
||||
let param = {
|
||||
FormId: 'SAL_DELIVERYNOTICE',
|
||||
UserId: uni.getStorageSync('userInfo').Context.UserId,
|
||||
FbillNo: state.FBillNo
|
||||
FbillNo: state.FBillNo,
|
||||
FType: "pack",
|
||||
};
|
||||
uni.showLoading({ mask: true });
|
||||
//获取扫描数据里的所有数据
|
||||
@@ -250,22 +244,21 @@
|
||||
//推送数据
|
||||
SAL_DELIVERYNOTICEPush({
|
||||
EntryIds: EntryIds.toString(),
|
||||
TargetFormId: 'SAL_OUTSTOCK',
|
||||
TargetFormId: 'VHUB_BarcodePackBill',
|
||||
IsEnableDefaultRule: 'true',
|
||||
CustomParams: {
|
||||
AutoAudit: 'true',
|
||||
ScanEntry: ScanEntry
|
||||
}
|
||||
}).then((res : any) => {
|
||||
if(res.code === 200){
|
||||
fStockFlexDetailDelete({Ids:ids.toString()}).then((res:any) => {
|
||||
if(res.code === 200) {
|
||||
fnDataList(state.materialId);
|
||||
if (res.code === 200) {
|
||||
fStockFlexDetailDelete({ Ids: ids.toString() }).then((res : any) => {
|
||||
if (res.code === 200) {
|
||||
uni.$u.toast('操作成功')
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
})
|
||||
} else {
|
||||
uni.$u.toast('暂无扫描数据')
|
||||
@@ -280,38 +273,6 @@
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 数据请求
|
||||
*/
|
||||
const fnDataList = (FBillNo : any, statesItem : boolean = false) => {
|
||||
let param = {
|
||||
id: FBillNo,
|
||||
};
|
||||
uni.showLoading({ mask: true });
|
||||
SAL_DELIVERYNOTICEView(param).then(res => {
|
||||
uni.hideLoading();
|
||||
if (res.code == 200) {
|
||||
state.dataList = []
|
||||
let dataListArray = res.data.Entry;
|
||||
if (dataListArray.length > 0) {
|
||||
dataListArray.forEach((p : any) => {
|
||||
let item = {
|
||||
Id: p.Id,
|
||||
MaterialNo: p.MaterialNumber, //物料编码
|
||||
MaterialName: formatLangTextValue(p.MaterialName), //物料名称
|
||||
Lot: p.FLot_Text, //批号
|
||||
CheckQty: p.Qty, //应扫数量
|
||||
CheckJoinQty: p.ScanedQty, //已扫数量
|
||||
NoCheckQty: p.UnScanQty, //未扫数量
|
||||
MultiLanguageText:Object.keys(p.StockId).length ? formatLangTextValue(p.StockId.Name) : '暂无仓库'
|
||||
};
|
||||
state.dataList.push(item);
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
//中英切换
|
||||
const formatLangTextValue = (val : any) => {
|
||||
let lang_Id = uni.getStorageSync('locale')
|
||||
|
||||
Reference in New Issue
Block a user