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

This commit is contained in:
2025-05-20 16:07:49 +08:00
parent 933ddab8f3
commit b1d8dec263
299 changed files with 38798 additions and 0 deletions

View File

@@ -0,0 +1,253 @@
<template>
<view class="material-listBox1">
<scroll-view id="scroll-box1" class="scroll-box1" 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>{{ t('receive.wlbm') }}</view>
<view class="zongjian"></view>
<view>{{ item.FVHUBMaterialNumber }}</view>
</view>
<view class="itemBox">
<view>{{ t('public.qty') }}</view>
<view class="zongjian"></view>
<view>{{ item.FVHUBScanQty }}</view>
</view>
<view class="itemBox">
<view>{{ t('index.ck') }}</view>
<view class="zongjian"></view>
<view>{{ item['FVHUBStock.FName'] }}</view>
</view>
<view class="itemBox">
<view>{{ t('receive.ph') }}</view>
<view class="zongjian"></view>
<view>{{ item.FVHUBFlot }}</view>
</view>
<view class="itemBox">
<view>{{ t('public.xxh') }}</view>
<view class="zongjian"></view>
<view>{{ item.FVHUBJSON }}</view>
</view>
</view>
</uni-swipe-action-item>
</uni-swipe-action>
</view>
<view v-if="state.dataList.length==0">
<up-empty mode="list"></up-empty>
</view>
</scroll-view>
</view>
</template>
<script lang="ts" setup>
import { reactive, nextTick, onMounted, ref, computed, watch, defineProps,defineEmits,defineExpose } from 'vue';
import { onLoad, onShow, onReachBottom, } from '@dcloudio/uni-app'
import { useI18n } from 'vue-i18n'
import { parseTime } from '../../utils/tools.js';
import { BarcodePackBillList, BarcodePackBillSave, BarcodePackBillScanData, PRD_MORPTPush, PRD_MORPTScanData, PURReceiveBillScanCheck, PURReceiveBillScanData, PURReceiveBillView, fStockFlexDetailDelete, temporaryScanDraftSave, temporaryScanList } from '../../common/request/api/api';
import scanFrame from '../../components/scan-frame/scan-frame.vue'
import shortcut from '../../components/tools/shortcut.vue'
const emits = defineEmits(['clearOut'])
const inputRef = ref()
const scanFrameRef = ref()
const shortcutRef = ref()
const getI18n = useI18n()
const { t, locale } = getI18n
const props = defineProps({
queryString: {
type: String,
default: () => {
return ''
}
}
})
const state = reactive({
dataList: [],
scrollHeight: 0,
options: []
})
watch(() => props.queryString, () => {
if (props.queryString !== '') getReceiveBillScanData(props.queryString)
})
onShow(() => {
fnDataList()
})
onMounted(() => {
const query = uni.createSelectorQuery().in(this);
query.select(".material-listBox1").boundingClientRect((data : any) => {
state.scrollHeight = data.height
}).exec();
fnDataList()
})
//查询录入
const getReceiveBillScanData = (val : string) => {
PRD_MORPTScanData({
FBarCode: val,
IsPack: "true"
}).then((res : any) => {
emits('clearOut')
if (res.code === 200) {
fnDataList()
}
})
}
//删除数据
const fStockFlexDetailDeleteFun = (item : any) => {
uni.showModal({
title: t('index.ts'), content: t('index.qdysc'), cancelText: t('index.qx'), confirmText: t('index.qd'),
success(res) {
if (res.confirm) {
fStockFlexDetailDelete({ Ids: item.FID + '' }).then((res : any) => {
if (res.code === 200) {
uni.$u.toast(t('index.ysc'))
fnDataList()
}
})
} else if (res.cancel) {
console.log('用户点击取消');
}
}
});
}
/**
* 数据推送
*/
const dataPushNotification = () => {
uni.showModal({
title: '提示', content: '确定要推送此次数据吗', cancelText: '取消', confirmText: '确定',
success(res) {
if (res.confirm) {
let EntryIds : any = []
let ids : any = []
let ScanEntry : any = []
let param = {
FormId: 'PRD_MORPT',
UserId: uni.getStorageSync('userInfo').Context.UserId,
FbillNo: state.FBillNo
};
uni.showLoading({ mask: true });
//获取扫描数据里的所有数据
temporaryScanList(param).then(res => {
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,
Sno: item.FVHUBJSON
})
})
//推送数据
PRD_MORPTPush({
EntryIds: EntryIds.toString(),
TargetFormId: 'PRD_INSTOCK',
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);
uni.$u.toast('操作成功')
}
})
}
})
} else {
uni.$u.toast('暂无扫描数据')
}
}
});
} else if (res.cancel) {
console.log('用户点击取消');
}
}
});
}
/**
* 数据请求
*/
const fnDataList = () => {
uni.showLoading({ mask: true });
temporaryScanList({
FormId: 'PRD_MORPT',
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')
let item = val.find(p => p.Key == (lang_Id == 'cn' ? 2052 : 1033));
if (item != null) {
return item.Value;
}
return val[0].Value;
}
const toPages = (url : string, data : any = {}) => {
uni.$u.route({
url: url,
params: data
})
}
defineExpose({
dataPushNotification
})
</script>
<style lang="scss">
.material-listBox1 {
flex: 1;
.list-box-list {
width: 100%;
.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>

View File

@@ -0,0 +1,149 @@
<template>
<view class="receive-listBox">
<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('index.hbbdh') }}{{item.FBillNo}}</view>
<view class="line-p"></view>
<view class="b-font">{{ t('receive.rq') }}{{item.FDateFormat}}</view>
</view>
</view>
<view v-if="state.dataList.length==0">
<up-empty mode="list"></up-empty>
</view>
</scroll-view>
</view>
</template>
<script lang="ts" setup>
import { reactive, nextTick, onMounted,watch, ref,computed,defineProps } from 'vue';
import { useI18n } from 'vue-i18n'
import { parseTime } from '../../utils/tools.js';
import { PRD_MORPTList, receiveBillList } from '../../common/request/api/api';
import packing from './packing.vue'
const getI18n = useI18n()
const { t, locale } = getI18n
const props = defineProps({
queryString: {
type: String,
default: () => {
return ''
}
}
})
const state = reactive({
queryString: '',
dataList: [],
scrollHeight: 0,
tabsIndex:'1',
page: {
pageIndex: 1,
pageSize: 200,
totalCount: 0
},
})
watch(() => props.queryString, () => {
if (props.queryString !== ''){
state.page.pageIndex = 1
state.queryString = props.queryString
fnDataList()
}
})
onMounted(() => {
initialization()
})
const initialization = () => {
const query = uni.createSelectorQuery().in(this);
query.select(".receive-listBox").boundingClientRect((data:any) => {
state.scrollHeight = data.height
}).exec();
fnDataList()
}
const upTabsItemFun = (e:any) => {
state.tabsIndex = e.type
}
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 fnToUrl = (item : any) => {
toPages('/pages/productionStorage/material',{id:item.FID,fBillNo:item.FBillNo})
}
const fnDataList = () => {
let param = {
queryString: state.queryString,
pageIndex: state.page.pageIndex,
pageSize: state.page.pageSize,
};
if (state.page.pageIndex == 1) {
uni.showLoading({ mask: true });
}
PRD_MORPTList(param).then(res => {
uni.hideLoading();
if (res.code == 200) {
let result = res.data;
let dataArray = result.list;
dataArray.forEach(p => {
p.FDateFormat = parseTime(p.FDate, '{y}-{m}-{d}');
});
if (state.page.pageIndex == 1) {
state.dataList = dataArray;
}
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,
params: data
})
}
</script>
<style lang="scss">
.receive-listBox {
flex: 1;
.list-box-list{
width: 100%;
// margin: 20rpx auto;
.data-item{
border: 1px solid #efeaea;
border-radius: 20rpx;
box-shadow: 0rpx 15rpx 15rpx #efeaea;
padding: 20rpx 20rpx 0;
margin-bottom: 20rpx;
background-color: #ffffff;
.tit{
font-size: 30rpx;
font-weight: bold;
padding: 20rpx 0;
}
.line-p{
border: 1px solid #efeaea;
}
.b-font{
font-size: 25rpx;
padding: 20rpx 0;
}
}
}
}
</style>