剩余模块:生产入库,销售出库

This commit is contained in:
2025-05-12 09:31:38 +08:00
parent bf88fcb395
commit 14a5fa371b
410 changed files with 11041 additions and 6820 deletions

View File

@@ -1,7 +1,9 @@
<template>
<view class="app status-bar-gap">
<view class="page">
<l-header title="生产装箱" sticky></l-header>
<l-header title="生产装箱" sticky #right>
<view style="margin-right: 32rpx;" @click="fnToUrl()">添加</view>
</l-header>
<view class="input-box">
<view class="input-item">
<up-input :placeholder="t('receive.djbh')" border="none" clearable inputAlign="left"
@@ -16,9 +18,8 @@
<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('receive.djbh') }}{{item.FBillNo}}</view>
<view class="data-item" v-for="(item, index) in state.dataList" :key="index">
<view class="tit">装箱单单号{{item.FBillNo}}</view>
<view class="line-p"></view>
<view class="b-font">{{ t('receive.rq') }}{{item.FDateFormat}}</view>
</view>
@@ -37,7 +38,7 @@
import { onLoad, onShow, onReachBottom } from '@dcloudio/uni-app'
import { useI18n } from 'vue-i18n'
import { parseTime } from '../../utils/tools.js';
import { PRD_MORPTList, SAL_DELIVERYNOTICEList, receiveBillList } from '../../common/request/api/api';
import { BarcodePackBillList, PRD_MORPTList, SAL_DELIVERYNOTICEList, receiveBillList } from '../../common/request/api/api';
const listBoxRef = ref(null)
const getI18n = useI18n()
const { t, locale } = getI18n
@@ -72,8 +73,8 @@
}, 500);
}
}
const fnToUrl = (item : any) => {
toPages('/pages/encasement/material',{id:item.FID,fBillNo:item.FBillNo})
const fnToUrl = () => {
toPages('/pages/encasement/material')
}
const debounceTimer = ref()
const changeFun = (e : any) => {

View File

@@ -4,53 +4,56 @@
<l-header title="生成装箱" sticky #right>
<view style="margin-right: 32rpx;" @click="dataPushNotification">{{ t('receive.tj') }}</view>
</l-header>
<view class="input-box">
<up-tabs :scrollable="false" :list="state.tabsList"></up-tabs>
</view>
<view class="input-box">
<view class="input-item">
<up-input placeholder="生产订单编号" border="none" clearable inputAlign="left" 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>
<view class="material-listBox">
<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':'#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>
</view>
<view class="itemBox">
<view>{{t('receive.djbh')}}</view>
<view class="zongjian"></view>
<view>{{ state.FBillNo }}</view>
</view>
<view class="itemBox">
<view>{{t('receive.wlbm')}}</view>
<view class="zongjian"></view>
<view>{{ item.MaterialNo }}</view>
</view>
<view class="itemBox">
<view>{{t('receive.ph')}}</view>
<view class="zongjian"></view>
<view>{{ item.Lot }}</view>
</view>
<view class="itemBox">
<view>仓库</view>
<view class="zongjian"></view>
<view>{{ item.MultiLanguageText }}</view>
</view>
<view class="itemBox">
<view>{{t('receive.ys')}}</view>
<view class="zongjian"></view>
<view>{{ item.CheckJoinQty }}</view>
</view>
<view class="itemBox">
<view>{{t('receive.ws')}}</view>
<view class="zongjian"></view>
<view>{{ item.NoCheckQty }}</view>
</view>
<view class="itemBox">
<view>{{t('receive.yss')}}</view>
<view class="zongjian"></view>
<view>{{ item.CheckQty }}</view>
</view>
</view>
<view style="text-align: center;color: #F5F5F5;height: 20px;"></view>
<scroll-view id="scroll-box" class="scroll-box" scroll-y="true" :style="{'height':state.scrollHeight+'px'}">
<view class="list-box-list">
<uni-swipe-action>
<uni-swipe-action-item :right-options="state.options" 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>
<view class="data-item" :style="[{'background-color':'#ffffff'}]" :key="index">
<view class="text" style="margin-bottom: 20px;display: flex;">
<view>{{ item['FVHUBMaterial.FName'] }}</view>
</view>
<view class="itemBox">
<view>物料编码</view>
<view class="zongjian"></view>
<view>{{ item.FVHUBMaterialNumber }}</view>
</view>
<view class="itemBox">
<view>数量</view>
<view class="zongjian"></view>
<view>{{ item.FVHUBScanQty }}</view>
</view>
<view class="itemBox">
<view>仓库</view>
<view class="zongjian"></view>
<view>{{ item['FVHUBStock.FName'] }}</view>
</view>
<view class="itemBox">
<view>批号</view>
<view class="zongjian"></view>
<view>{{ item.FVHUBFlot }}</view>
</view>
</view>
</uni-swipe-action-item>
</uni-swipe-action>
</view>
<view v-if="state.dataList.length==0">
<up-empty mode="list"></up-empty>
@@ -58,13 +61,6 @@
</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>
@@ -72,33 +68,33 @@
import { reactive, nextTick, onMounted, ref, computed, watch } from 'vue';
import { onLoad, onShow, onReachBottom, } from '@dcloudio/uni-app'
import { useI18n } from 'vue-i18n'
import { SAL_DELIVERYNOTICEPush, temporaryScanList, fStockFlexDetailDelete, PRD_MORPTScanData, temporaryScanDraftSave } from '../../common/request/api/api';
import { parseTime } from '../../utils/tools.js';
import { BarcodePackBillList, BarcodePackBillSave, BarcodePackBillScanData, PURReceiveBillScanCheck, PURReceiveBillScanData, PURReceiveBillView, fStockFlexDetailDelete, temporaryScanDraftSave, temporaryScanList } 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 listPopup from './listPopup.vue'
import viewPopup from './viewPopup.vue'
import { encasement } from '../../stores/encasement'
const DBEncasement = encasement()
const inputRef = ref()
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,
FBillNo: '',
materialId: '',
supplierName: '',
inputFocus: true,
listPopupShow: true,
scanFrameDataFeedback: {},
shortcutDataFeedback: {},
scanFrameDataFeedback: {}, //传回的扫描弹框数据
shortcutDataFeedback: {}, //传回的默认值数据
tabsList: [
{ name: computed(() => '包装'), type: '1' },
{ name: computed(() => '单独物料'), type: '2' },
],
options: []
})
onLoad(() => { })
onShow(() => {
// DBEncasement.injectEncasementMaterialList('132132')
onShow(() => {
fnDataList()
})
onMounted(() => {
const query = uni.createSelectorQuery().in(this);
@@ -106,173 +102,148 @@
state.scrollHeight = data.height
}).exec();
})
/**
* 数据逻辑
*/
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) => {
PRD_MORPTScanData({
BarcodePackBillScanData({
FBarCode: val,
FBillNo: state.FBillNo,
IsPack: 'true'
}).then((res : any) => {
if (res.data !== null) {
console.log(res,val);
if (res.code === 200) {
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)
} else {
postTemporaryScanDraftSaveFun(state.scanFrameDataFeedback)
}
} else {
scanFrameRef.value.stateShow(true)
}
} else {
uni.$u.toast('并没有该条数据')
state.queryString = ''
postTemporaryScanDraftSaveFun(res.data.Entry[0])
}
})
}
//数据记录暂存
const postTemporaryScanDraftSaveFun = (item : any) => {
const obj = {};
if (item.warehouseData.FIsOpenLocation) {
const key = `FVHUBSTOCKFLEX__FF${item.warehouseData.FFlexId}`; //仓位Id
obj[key] = { FNumber: item.locationData.FlexEntryId.Number }; //仓位编码
}
const str = JSON.stringify(obj);
console.log(item);
temporaryScanDraftSave({
FVHUBFormId: "SAL_DELIVERYNOTICE", //数据类型
FVHUBFBillNo: state.FBillNo, //单据编号
FVHUBScanNumber: state.queryString, //条
FVHUBMaterialNumber: item.articlesStr, //物料编码
FVHUBScanQty: item.quantityStr + '', //扫描数量
FVHUBEntryId: scanFrameRef.value.state.receiveBillScanData.Id, //物料ID
FVHUBFlot: item.batchNumberStr, //批号
FType: "pack",
FVHUBFormId: "VHUB_BarcodePackBill", //数据类型
FVHUBScanNumber: state.queryString, //条码
FVHUBMaterialNumber: item.MaterialNumber, //物料编
FVHUBScanQty: item.BarCodeQty + '', //扫描数量
FVHUBEntryId: item.Id, //行ID
FVHUBFlot: item.FLot_Text, //批号
FVHUBStock: {
FNUMBER: item.warehouseData.FNUMBER //仓库编号
FNUMBER: item.StockId.Number //仓库编号
},
FVHUBMaterial: {
FNUMBER: item.articlesStr
FNUMBER: item.MaterialNumber, //物料编码
},
...JSON.parse(str),
}).then((res : any) => {
console.log(res);
state.queryString = ''
if (res.data.IsSuccess) {
uni.$u.toast('成功')
scanFrameRef.value.stateShow(false)
fnDataList();
uni.$u.toast(t('public.cg'))
}
})
}
/**
* 弹窗逻辑
*/
const scanFrameCnfirmation = (row : any) => {
//固定弹窗数据传输
state.scanFrameDataFeedback = row
//删除数据
const fStockFlexDetailDeleteFun = (item : any) => {
uni.showModal({
title: '提示', content: '确定要删除该条数据吗?', cancelText: '取消', confirmText: '确定',
success(res) {
if (res.confirm) {
fStockFlexDetailDelete({ Ids: item.FID + '' }).then((res : any) => {
if (res.code === 200) {
uni.$u.toast('已删除')
fnDataList()
}
})
} else if (res.cancel) {
console.log('用户点击取消');
}
}
});
}
const dataToscanFrameFun = (res : object) => {
//默认值传递
state.shortcutDataFeedback = res
scanFrameRef.value.getComponentsData(res)
shortcutRef.value.stateShow(false,'encasement')
}
const defaultPopupFun = () => {
//唤起默认值弹窗
shortcutRef.value.stateShow(true,'encasement')
}
const scanFrameErrFun = () => {
//异常弹出
scanFrameRef.value.stateShow(true)
}
const scanRecordFun = () => {
toPages('/pages/records/index', {
FormId: 'SAL_DELIVERYNOTICE',
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: '确定',
title: t('public.ts'), content: t('public.tjMessage'), cancelText: t('public.cancel'), confirmText: t('public.confirm'),
success(res) {
if (res.confirm) {
let EntryIds : any = []
let ids : any = []
let ScanEntry : any = []
let items : any = []
let param = {
FormId: 'SAL_DELIVERYNOTICE',
FormId: 'VHUB_BarcodePackBill',
UserId: uni.getStorageSync('userInfo').Context.UserId,
FbillNo: state.FBillNo,
FType: "pack",
};
uni.showLoading({ mask: true });
//获取扫描数据里的所有数据
temporaryScanList(param).then(res => {
temporaryScanList(param).then((res:any) => {
if (res.code == 200) {
if (res.data.list.length != 0) {
res.data.list.forEach((item : any) => {
EntryIds.push(item.FVHUBEntryId)
ids.push(item.FID)
ScanEntry.push({
FENTRYID: item.FVHUBEntryId,
Qty: item.FVHUBScanQty,
Flot: item.FVHUBFlot,
StockId: item.FVHUBStock,
StockFlex: item.FVHUBStockFlex
items.push({
Ids:item.FVHUBEntryId,
FBarCode:item.FVHUBScanNumber,
FQty:item.FVHUBScanQty
})
ids.push(item.FID)
})
//推送数据
SAL_DELIVERYNOTICEPush({
EntryIds: EntryIds.toString(),
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) {
uni.$u.toast('操作成功')
BarcodePackBillSave({
Items:items
}).then((BPRes : any) => {
if (BPRes.code === 200) {
fStockFlexDetailDelete({ Ids: ids.toString() }).then((FDRes : any) => {
if (FDRes.code === 200) {
fnDataList();
uni.$u.toast(t('public.cg'))
}
})
}
})
} else {
uni.$u.toast('暂无扫描数据')
uni.$u.toast(t('public.noDataMessage'))
}
}
});
} else if (res.cancel) {
console.log('用户点击取消');
}
}
});
}
/**
* 数据请求
*/
const fnDataList = () => {
uni.showLoading({ mask: true });
temporaryScanList({
FormId: 'VHUB_BarcodePackBill',
UserId: uni.getStorageSync('userInfo').Context.UserId,
}).then((res : any) => {
if (res.code == 200) {
state.dataList = res.data.list
}
});
}
//中英切换
const formatLangTextValue = (val : any) => {
let lang_Id = uni.getStorageSync('locale')
@@ -291,6 +262,10 @@
</script>
<style lang="scss">
:deep(.button-group--right) {
height: calc(100% - 16rpx) !important;
}
.app {
background-color: #F5F5F5;
@@ -341,6 +316,14 @@
.list-box-list {
width: 100%;
.itemRight {
display: flex;
align-items: center;
padding: 34rpx;
background-color: #ff5a5d;
border-radius: 20rpx;
}
.data-item {
border: 1px solid #efeaea;
border-radius: 20rpx;