剩余模块:生产退料

This commit is contained in:
2025-05-26 16:57:56 +08:00
parent b1d8dec263
commit eb2c8d2d7a
161 changed files with 18754 additions and 6607 deletions

View File

@@ -15,8 +15,8 @@
</view>
</view>
<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" v-for="(item, index) in state.dataList" :key="index" @click="toPrintFun(item)">
<view class="tit">{{ t('index.zxddh') }}{{item.FBillNo}}</view>
@@ -24,7 +24,7 @@
<view class="b-font">{{ t('receive.rq') }}{{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>
@@ -54,19 +54,19 @@
})
onShow(() => {
fnDataList()
})
onMounted(() => {
const query = uni.createSelectorQuery().in(this);
query.select(".receive-listBox").boundingClientRect((data:any) => {
query.select(".receive-listBox").boundingClientRect((data : any) => {
state.scrollHeight = data.height
}).exec();
fnDataList()
})
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) {
state.page.pageIndex ++;
state.page.pageIndex++;
uni.showLoading({ mask: true });
setTimeout(() => {
fnDataList();
@@ -76,9 +76,9 @@
const fnToUrl = () => {
toPages('/pages/encasement/material')
}
const toPrintFun = (row:any) => {
const toPrintFun = (row : any) => {
console.log(row);
toPages('/pages/encasement/print',{...row})
toPages('/pages/encasement/print', { ...row })
}
const debounceTimer = ref()
const changeFun = (e : any) => {
@@ -171,25 +171,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 +202,4 @@
}
}
}
</style>

View File

@@ -44,9 +44,9 @@
<view>{{ item['FVHUBStock.FName'] }}</view>
</view>
<view class="itemBox">
<view>{{ t('receive.ph') }}</view>
<view>{{ t('public.xxh') }}</view>
<view class="zongjian"></view>
<view>{{ item.FVHUBFlot }}</view>
<view>{{ item.FVHUBJSON }}</view>
</view>
</view>
</uni-swipe-action-item>
@@ -142,6 +142,7 @@
FVHUBScanQty: item.BarCodeQty + '', //扫描数量
FVHUBEntryId: item.Id, //行ID
FVHUBFlot: item.FLot_Text, //批号
FVHUBJSON:item.MaxcessSNo, //序列号
FVHUBStock: {
FNUMBER: item.StockId.Number //仓库编号
},
@@ -151,10 +152,15 @@
}).then((res : any) => {
console.log(res);
state.queryString = ''
if (res.data.IsSuccess) {
fnDataList();
uni.$u.toast(t('public.cg'))
if(res.code === 200) {
if (res.data.IsSuccess) {
fnDataList();
uni.$u.toast(t('public.cg'))
}
} else {
uni.$u.toast(res.msg)
}
})
}
//删除数据
@@ -210,15 +216,18 @@
if (FDRes.code === 200) {
fnDataList();
uni.$u.toast(t('public.cg'))
console.log('===================================================',BPRes.data.SuccessEntitys);
toPages('/pages/encasement/print',{
type:'Arr',
list:JSON.stringify(BPRes.data.SuccessEntitys)
})
}
})
}
})
} else {
uni.$u.toast(t('public.noDataMessage'))
}
}
});
}

View File

@@ -34,7 +34,7 @@
<script setup lang="ts">
import { reactive, nextTick, onMounted, ref, computed, watch } from 'vue';
import { onLoad, onShow, onReachBottom, } from '@dcloudio/uni-app'
import { onLoad, onShow, onReachBottom, onBackPress } from '@dcloudio/uni-app'
import tkiQrcode from '@/components/tki-qrcode/tki-qrcode.vue'
import { PRD_MOEnterIntoPro, UHIK_BD_BarCodeMainFileSave, getPrintData } from '../../common/request/api/api';
import { timeFormat } from '@/uni_modules/uview-plus';
@@ -58,12 +58,20 @@
},
bluetoothList: [],
sendData: '',
printDataList:[]
printDataList: []
})
onLoad((pageData : any) => {
state.pageData = pageData
console.log(pageData);
getPrintDataFun()
if(pageData.type === 'Arr'){
state.pageData.FBillNo = JSON.parse(pageData.list)[0].Number
console.log('========================================',state.pageData);
console.log('========================================',JSON.parse(pageData.list));
getPrintDataFun()
} else {
state.pageData = pageData
console.log(pageData);
getPrintDataFun()
}
})
onShow(() => {
uni.getLocation({
@@ -71,24 +79,40 @@
success(res) {
console.log('开启定位权限', res)
},
fail: (err) => {
// uni.showToast({
// title: '请先打开定位功能:' + err,
// duration: 1500
// });
}
});
// #ifdef APP-PLUS
hasPermission()
// #endif
})
const getPrintDataFun = () => {
getPrintData({queryString:state.pageData.FBillNo}).then((res:any) => {
getPrintData({ queryString: state.pageData.FBillNo }).then((res : any) => {
state.printDataList = res.data
})
}
//获取蓝牙权限并打开蓝牙
const hasPermission = () => {
console.log(uni.getStorageSync('printInfo'));
blueModule.checkConnect({
mac: uni.getStorageSync('printInfo').address,
uuid: '00001101-0000-1000-8000-00805f9b34fb'
}, (ret : any) => {
console.log(ret);
if (!ret.success) {
uni.setStorageSync('printInfo', {})
state.printingMachine = {
name: '',
address: ''
}
setTimeout(() => {
uni.showToast({
icon: 'none',
mask: true,
title: t('index.ljydk'),
})
}, 500)
}
});
blueModule.hasPermission((res : any) => {
if (res.success) {
blueModule.isOpen((isOpenRes : any) => {
@@ -97,7 +121,7 @@
state.printingMachine.name = uni.getStorageSync('printInfo').name
state.printingMachine.address = uni.getStorageSync('printInfo').address
} else {
uni.setStorageSync('printInfo',{})
uni.setStorageSync('printInfo', {})
state.printingMachine.name = ''
state.printingMachine.address = ''
blueModule.openBT((openBTRes : any) => {
@@ -129,6 +153,9 @@
}
const getAddressFun = (row : any) => {
blueModule.disconnectAll((ret) => {
console.log(ret);
});
blueModule.connect({
MACAddress: row.address,
uuid: '00001101-0000-1000-8000-00805f9b34fb',
@@ -141,16 +168,14 @@
state.printingMachine.name = row.name
state.printingMachine.address = row.address
bluetoothListRef.value.close()
uni.setStorageSync('printInfo',{name:row.name,address:row.address})
uni.setStorageSync('printInfo', { name: row.name, address: row.address })
} else {
uni.$u.toast(t('index.ljsb'))
}
}, (data : any) => {
//接收的数据回调
console.log(data)
})
}
const createLabel = () => {
var command = tsc.default.createNew()
command.setSize(100, 50)
@@ -158,7 +183,7 @@
command.setCls()
command.setText(50, 30, "TSS24.BF2", 1, 1, state.printDataList[0].fBillNo)
command.setQR(50, 65, "L", 8, "A", state.printDataList[0].fBillNo)
state.printDataList.forEach((item,index) => {
state.printDataList.forEach((item, index) => {
command.setText(260, 64 + index * 40, "TSS24.BF2", 1, 1, `${item.fMaterialId} / ${item.fQty} / ${item.fSalOrderNo}`)
})
command.setPagePrint()
@@ -166,25 +191,31 @@
}
const UHIK_BD_BarCodeMainFileSaveFun = () => {
let arr = []
state.printDataList.forEach((item:any) => {
state.printDataList.forEach((item : any) => {
arr.push({
FBarCodeRule:'03',
FBarCode:item.fBillNo,
FBillCode:item.fBillNo
FBarCodeRule: '03',
FBarCode: item.fBillNo,
FBillCode: item.fBillNo
})
})
UHIK_BD_BarCodeMainFileSave({
Key:'qwe123!@#',
Items:arr
}).then((res:any) => {
console.log('=====================================',res);
Key: 'qwe123!@#',
Items: arr
}, true).then((res : any) => {
console.log('=====================================', res);
let str = JSON.stringify(res)
if (str.indexOf('违反字段唯一性要求') !== -1 || str.indexOf('is already been used') !== -1) {
} else {
uni.$u.toast(t('index.cjbqsb'))
}
})
}
const sendHexStr = () => {
createLabel()
UHIK_BD_BarCodeMainFileSaveFun()
if (state.sendData == null) {
// uni.$u.toast('请先生成指令')
return
}
let hexStr = ''
@@ -216,6 +247,15 @@
//结果
console.log('发送结果')
console.log(result)
if (!result.success) {
uni.$u.toast(t('index.ljydk'))
uni.setStorageSync('printInfo', {})
state.printingMachine = {
name: '',
address: ''
}
return
}
if (result.success) {
realWriteData(sendloop, i + 1);
}

View File

@@ -28,6 +28,9 @@
<view class="type-item type-item-hl" @tap="toPages('/pages/supplement/index')">
<view class="type-item-text">{{ t('home.scbl') }}</view>
</view>
<view class="type-item type-item-hl" @tap="toPages('/pages/returnMaterials/index')">
<view class="type-item-text">{{ t('home.sctl') }}</view>
</view>
<view class="type-item type-item-hl" @tap="toPages('/pages/ruleClaim/index')">
<view class="type-item-text">{{ t('index.ctll') }}</view>
</view>

View File

@@ -18,7 +18,7 @@
<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.scdd') }}{{item.FBillNo}}</view>
<view class="tit">{{ t('index.scdd') }}{{item.FMOBillNO}}</view>
<view class="line-p"></view>
<view class="b-font">{{ t('receive.rq') }}{{item.FDateFormat}}</view>
</view>
@@ -74,7 +74,7 @@
}
}
const fnToUrl = (item : any) => {
toPages('/pages/material/material',{id:item.FID,fBillNo:item.FBillNo})
toPages('/pages/material/material',{id:item.FID,fBillNo:item.FMOBillNO})
}
const debounceTimer = ref()
const changeFun = (e : any) => {
@@ -91,6 +91,7 @@
queryString: state.queryString,
pageIndex: state.page.pageIndex,
pageSize: state.page.pageSize,
FType:'Pick'
};
if (state.page.pageIndex == 1) {
uni.showLoading({ mask: true });

View File

@@ -97,6 +97,7 @@
totalCount: 0
},
FBillNo: '',
BillNo: '',
materialId: '',
supplierName: '',
inputFocus: true,
@@ -149,12 +150,14 @@
const getReceiveBillScanData = (val : string) => {
PRDPPBOMScanData({
FBarCode: val,
FBillNo: state.FBillNo,
IsFeed: 'true'
FBillNo: state.BillNo,
IsFeed: 'false'
}).then((res : any) => {
if (res.data !== null) {
console.log(res);
scanFrameRef.value.getreceiveBillScanData({ ...res.data, queryString: state.queryString, scanFrameShowSate: state.shortcutDataFeedback.scanFrameShowSate })
const scanData = res.data
if( scanData.UnScanQty > scanData.BarCodeQty ) scanData.UnScanQty = scanData.BarCodeQty
scanFrameRef.value.getreceiveBillScanData({ ...scanData, queryString: state.queryString, scanFrameShowSate: state.shortcutDataFeedback.scanFrameShowSate })
if (Object.keys(state.shortcutDataFeedback).length) {
if (state.shortcutDataFeedback.scanFrameShowSate) {
scanFrameRef.value.stateShow(true)
@@ -189,7 +192,7 @@
console.log(item);
temporaryScanDraftSave({
FVHUBFormId: "PRD_PPBOM", //数据类型
FVHUBFBillNo: state.FBillNo, //单据编号
FVHUBFBillNo: state.BillNo, //单据编号
FVHUBScanNumber: state.queryString, //条码
FVHUBMaterialNumber: item.articlesStr, //物料编码
FVHUBScanQty: item.quantityStr + '', //扫描数量
@@ -201,6 +204,7 @@
FVHUBMaterial: {
FNUMBER: item.articlesStr
},
FType: "Picking",
...JSON.parse(str),
}).then((res : any) => {
console.log(res);
@@ -225,7 +229,7 @@
const scanRecordFun = () => {
toPages('/pages/records/index', {
FormId: 'PRD_PPBOM',
FbillNo: state.FBillNo
FbillNo: state.BillNo
})
}
/**
@@ -301,11 +305,13 @@
const fnDataList = (FBillNo : any, statesItem : boolean = false) => {
let param = {
id: FBillNo,
IsFeed:'false'
};
uni.showLoading({ mask: true });
PRDPPBOMView(param).then(res => {
uni.hideLoading();
if (res.code == 200) {
state.BillNo = res.data.BillNo
state.dataList = []
let dataListArray = res.data.Entry;
if (dataListArray.length > 0) {

View File

@@ -124,7 +124,7 @@
*/
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 = []
@@ -166,14 +166,14 @@
fStockFlexDetailDelete({ Ids: ids.toString() }).then((res : any) => {
if (res.code === 200) {
fnDataList(state.materialId);
uni.$u.toast('操作成功')
uni.$u.toast(t('public.cg'))
}
})
}
})
} else {
uni.$u.toast('暂无扫描数据')
uni.$u.toast(t('index.zwsmsj'))
}
}
@@ -225,7 +225,13 @@
.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;

View File

@@ -256,8 +256,8 @@
const dataPushNotification = () => {
uni.showModal({
title: t('public.ts'), content: t('public.tjMessage'), cancelText: t('public.cancel'), confirmText: t('public.confirm'),
success(res) {
if (res.confirm) {
success(resShow) {
if (resShow.confirm) {
let EntryIds : any = []
let ids : any = []
let ScanEntry : any = []
@@ -268,10 +268,10 @@
};
uni.showLoading({ mask: true });
//获取扫描数据里的所有数据
temporaryScanList(param).then(res => {
if (res.code == 200) {
if (res.data.list.length != 0) {
res.data.list.forEach((item : any) => {
temporaryScanList(param).then(resScan => {
if (resScan.code == 200) {
if (resScan.data.list.length != 0) {
resScan.data.list.forEach((item : any) => {
EntryIds.push(item.FVHUBEntryId)
ids.push(item.FID)
ScanEntry.push({
@@ -291,15 +291,18 @@
AutoAudit: 'true',
ScanEntry: ScanEntry
}
}).then((res : any) => {
}).then((resPush : any) => {
console.log();
if (res.code === 200) {
if (resPush.code === 200) {
fStockFlexDetailDelete({ Ids: ids.toString() }).then((res : any) => {
if (res.code === 200) {
fnDataList(state.materialId);
uni.$u.toast(t('public.cg'))
}
})
} else {
console.log('==========================================', resPush);
uni.$u.toast(resPush.msg)
}
})

View File

@@ -19,7 +19,7 @@
<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" v-for="(item, index) in state.dataList" :key="index">
<view class="data-item" v-for="(item, index) in state.dataList" :key="index" @click="clickPRD_MOViewIntoPro(item)">
<view class="tit">{{ t('index.scddbh') }}{{item.FBillNo}}</view>
<view class="line-p"></view>
<view class="b-font">{{ t('receive.rq') }}{{item.FDateFormat}}</view>
@@ -80,7 +80,6 @@
const fnScrollBottom = () => {
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++;
uni.showLoading({ mask: true });
setTimeout(() => {
@@ -98,16 +97,31 @@
fnDataList(true)
}, 500)
}
const viewIntoProFun = (item : object) => {
const viewIntoProFun = (item : object,typeVertical:string = 'details') => {
PRD_MOViewIntoPro({
Number: state.queryString
}).then((res : any) => {
if (res.code === 200) {
pageDataInfoCom.putInProdPageData({ ...res.data, ...item, time: new Date().getTime(), type: state.type })
route({ url: '/pages/putInProd/details' })
if(typeVertical === 'details'){
pageDataInfoCom.putInProdPageData({ ...res.data, ...item, time: new Date().getTime(), type: state.type })
route({ url: '/pages/putInProd/details' })
}
if(typeVertical === 'item'){
if(state.type === '2'){
toPages('/pages/putInProd/print',{...res.data})
}
}
}
})
}
const clickPRD_MOViewIntoPro = (item:any) => {
PRD_MOViewIntoPro({
Number: item.FBillNo
}).then((res : any) => {
if(state.type === '2'){
toPages('/pages/putInProd/print',{...res.data})
}
})
}
const fnDataList = (scanData : boolean = false) => {
let param = {

View File

@@ -16,18 +16,6 @@
</view>
</view>
<!-- <view class="data-item" :style="[{'background-color':'#ffffff'}]" style="margin-top: 32rpx;">
<view class="dataText" style="display: flex;align-items: center;">
<tki-qrcode cid="qrcode1" ref="qrcode" val="val" :size="160" unit="upx" :loadMake="true"
:usingComponents="true" />
<view style="margin-left: 32rpx;">
<view>Date:{{ state.pageData.FBillNo }}</view>
<view>MO No:{{ state.pageData.MaterialNo }}</view>
<view>P/No:{{ state.pageData.CheckQty }}</view>
<view>Serial No:{{ state.pageData.Lot }}</view>
</view>
</view>
</view> -->
<view class="input-box" @click="printingMachineSelectFun">
<view class="input-item">
<up-input :placeholder="t('index.qxzdyj')" border="none" clearable inputAlign="left" v-model="state.printingMachine.name"
@@ -110,6 +98,28 @@
//获取蓝牙权限并打开蓝牙
const hasPermission = () => {
console.log(uni.getStorageSync('printInfo'));
blueModule.checkConnect({
mac: uni.getStorageSync('printInfo').address,
uuid: '00001101-0000-1000-8000-00805f9b34fb'
}, (ret : any) => {
console.log(ret);
if (!ret.success) {
uni.setStorageSync('printInfo', {})
state.printingMachine = {
name: '',
address: ''
}
setTimeout(() => {
uni.showToast({
icon: 'none',
mask: true,
title: t('index.ljydk'),
})
}, 500)
}
});
blueModule.hasPermission((res : any) => {
if (res.success) {
blueModule.isOpen((isOpenRes : any) => {
@@ -203,7 +213,7 @@
UHIK_BD_BarCodeMainFileSave({
Key: 'qwe123!@#',
Items: arr
}).then((res : any) => {
},true).then((res : any) => {
console.log(res);
if (res.code == 200) {
let i : number = 0;
@@ -277,6 +287,15 @@
//结果
console.log('发送结果')
console.log(result)
if (!result.success) {
uni.$u.toast(t('index.ljydk'))
uni.setStorageSync('printInfo', {})
state.printingMachine = {
name: '',
address: ''
}
return
}
if (result.success) {
realWriteData(sendloop, i + 1);
}

View File

@@ -0,0 +1,206 @@
<template>
<view class="app status-bar-gap">
<view class="page">
<l-header :title="t('home.sctl')" sticky></l-header>
<view class="input-box">
<view class="input-item">
<up-input :placeholder="t('index.scdd')" 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>
<view class="receive-listBox" ref="listBoxRef">
<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.scdd') }}{{item.FMOBillNO}}</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>
</view>
</view>
</template>
<script lang="ts" setup>
import { reactive, nextTick, onMounted, ref } from 'vue';
import { onLoad, onShow, onReachBottom } from '@dcloudio/uni-app'
import { useI18n } from 'vue-i18n'
import { parseTime } from '../../utils/tools.js';
import { PRDPPBOMList } from '../../common/request/api/api';
const listBoxRef = ref(null)
const getI18n = useI18n()
const { t, locale } = getI18n
const state = reactive({
queryString: '',
dataList: [],
scrollHeight: 0,
page: {
pageIndex: 1,
pageSize: 200,
totalCount: 0
}
})
onShow(() => {
})
onMounted(() => {
const query = uni.createSelectorQuery().in(this);
query.select(".receive-listBox").boundingClientRect((data) => {
state.scrollHeight = data.height
}).exec();
fnDataList()
})
const fnScrollBottom = () => {
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 ++;
uni.showLoading({ mask: true });
setTimeout(() => {
fnDataList();
}, 500);
}
}
const fnToUrl = (item : any) => {
toPages('/pages/returnMaterials/material',{id:item.FID,fBillNo:item.FMOBillNO})
}
const debounceTimer = ref()
const changeFun = (e : any) => {
if (debounceTimer.value !== null) clearTimeout(debounceTimer.value)
debounceTimer.value = setTimeout(() => {
state.queryString = e
state.page.pageIndex = 1
state.dataList = []
fnDataList()
}, 500)
}
const fnDataList = () => {
let param = {
queryString: state.queryString,
pageIndex: state.page.pageIndex,
pageSize: state.page.pageSize,
FType:'Return'
};
if (state.page.pageIndex == 1) {
uni.showLoading({ mask: true });
}
PRDPPBOMList(param).then(res => {
uni.hideLoading();
if (res.code == 200) {
let result = res.data;
let dataArray = result.list;
dataArray.forEach(p => {
p.FDateFormat = parseTime(p.FCREATEDATE, '{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">
.app {
background-color: #F5F5F5;
.page {
padding: 18px 32rpx;
display: flex;
flex-direction: column;
height: 100%;
flex: 1;
.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;
}
}
}
.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>

View File

@@ -0,0 +1,428 @@
<template>
<view class="app status-bar-gap">
<view class="page">
<l-header :title="state.FBillNo" sticky #right>
<view style="margin-right: 32rpx;" @click="dataPushNotification">{{ t('receive.tj') }}</view>
</l-header>
<view class="input-box">
<view class="input-item">
<up-input :placeholder="t('receive.code')" 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>
<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':interpolation(item)},{'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>{{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>
</view>
<view v-if="state.dataList.length==0">
<up-empty mode="list"></up-empty>
</view>
</scroll-view>
</view>
</view>
</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 ref="toolsRef" @defaultPopup="defaultPopupFun" @scanRecord="scanRecordFun" />
</template>
<script lang="ts" setup>
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 { PRDPPBOMPush, PRDPPBOMScanData, PRDPPBOMView, 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 { sqlite } from '../../stores/sqlite'
const DB = sqlite()
const inputRef = ref()
const scanFrameRef = ref()
const shortcutRef = ref()
const getI18n = useI18n()
const { t, locale } = getI18n
const state = reactive({
queryString: '',
dataList: [],
scrollHeight: 0,
page: {
pageIndex: 1,
pageSize: 200,
totalCount: 0
},
FBillNo: '',
BillNo: '',
materialId: '',
supplierName: '',
inputFocus: 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);
}
})
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) => {
PRDPPBOMScanData({
FBarCode: val,
FBillNo: state.BillNo,
IsFeed: 'other'
}).then((res : any) => {
if (res.data !== null) {
console.log(res);
const scanData = res.data
if( scanData.UnScanQty > scanData.BarCodeQty ) scanData.UnScanQty = scanData.BarCodeQty
scanFrameRef.value.getreceiveBillScanData({ ...scanData, queryString: state.queryString, scanFrameShowSate: state.shortcutDataFeedback.scanFrameShowSate })
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(t('index.bmygtsj'))
state.queryString = ''
}
})
}
//固定弹窗数据传输
const scanFrameCnfirmation = (row : any) => {
state.scanFrameDataFeedback = row
postTemporaryScanDraftSaveFun(state.scanFrameDataFeedback)
}
const scanFrameErrFun = () => {
scanFrameRef.value.stateShow(true)
}
//数据记录暂存
const postTemporaryScanDraftSaveFun = (item : any) => {
const obj = {};
if (item.warehouseData.FIsOpenLocation && Object.keys(item.locationData).length != 0) {
const key = `FVHUBSTOCKFLEX__FF${item.locationData.FID}`; //仓位Id
obj[key] = { FNumber: item.locationData.FlexEntryId.Number }; //仓位编码
}
const str = JSON.stringify(obj);
console.log(item);
temporaryScanDraftSave({
FVHUBFormId: "PRD_PPBOM", //数据类型
FVHUBFBillNo: state.BillNo, //单据编号
FVHUBScanNumber: state.queryString, //条码
FVHUBMaterialNumber: item.articlesStr, //物料编码
FVHUBScanQty: item.quantityStr + '', //扫描数量
FVHUBEntryId: scanFrameRef.value.state.receiveBillScanData.Id, //物料ID
FVHUBFlot: item.batchNumberStr, //批号
FVHUBStock: {
FNUMBER: item.warehouseData.FNUMBER //仓库编号
},
FVHUBMaterial: {
FNUMBER: item.articlesStr
},
FType: "Return",
...JSON.parse(str),
}).then((res : any) => {
console.log(res);
state.queryString = ''
if (res.data.IsSuccess) {
fnDataList(state.materialId);
uni.$u.toast(t('public.cg'))
scanFrameRef.value.stateShow(false)
}
})
}
//默认值传递
const dataToscanFrameFun = (res : object) => {
state.shortcutDataFeedback = res
scanFrameRef.value.getComponentsData(res)
shortcutRef.value.stateShow(false)
}
//唤起默认值弹窗
const defaultPopupFun = () => {
shortcutRef.value.stateShow(true)
}
const scanRecordFun = () => {
toPages('/pages/records/index', {
FormId: 'PRD_PPBOM',
FbillNo: state.BillNo
})
}
/**
* 数据推送
*/
const dataPushNotification = () => {
uni.showModal({
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 param = {
FormId: 'PRD_PPBOM',
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
})
})
//推送数据
PRDPPBOMPush({
EntryIds: EntryIds.toString(),
TargetFormId: 'PRD_ReturnMtrl',
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(t('public.cg'))
}
})
}
})
} else {
uni.$u.toast(t('public.noDataMessage'))
}
}
});
} else if (res.cancel) {
console.log('用户点击取消');
}
}
});
}
/**
* 数据请求
*/
const fnDataList = (FBillNo : any, statesItem : boolean = false) => {
let param = {
id: FBillNo,
IsFeed:'other'
};
uni.showLoading({ mask: true });
PRDPPBOMView(param).then(res => {
uni.hideLoading();
if (res.code == 200) {
state.BillNo = res.data.BillNo
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')
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
})
}
</script>
<style lang="scss">
.app {
background-color: #F5F5F5;
.page {
padding: 18px 32rpx;
display: flex;
flex-direction: column;
height: 100%;
flex: 1;
.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;
}
}
}
.material-listBox {
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

@@ -91,6 +91,7 @@
queryString: state.queryString,
pageIndex: state.page.pageIndex,
pageSize: state.page.pageSize,
FType:'Feed'
};
if (state.page.pageIndex == 1) {
uni.showLoading({ mask: true });

View File

@@ -6,17 +6,29 @@
</l-header>
<view class="input-box">
<view class="input-item">
<up-input :placeholder="t('receive.code')" border="none" clearable inputAlign="left" inputmode="none"
:focus="state.inputFocus" v-model="state.queryString" @change="changeFun" ref="inputRef">
<up-input :placeholder="t('receive.code')" border="none" clearable inputAlign="left" :focus="state.inputFocus"
v-model="state.queryString" @change="changeFun" ref="inputRef">
<template #prefix>
<up-icon name="scan" color="#2979ff" size="24"></up-icon>
</template>
<template #suffix>
<up-icon name="edit-pen" color="#2979ff" size="24" @click="() => {state.manualShow = !state.manualShow}"></up-icon>
</template>
</up-input>
</view>
</view>
<view class="input-box" v-show="state.manualShow">
<view class="input-item">
<up-input :placeholder="t('receive.code')" border="none" clearable inputAlign="left" :focus="state.inputFocus"
v-model="state.manualQueryString" @confirm="confirmFun" ref="inputRef">
<template #prefix>
<up-icon name="search" 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'}">
<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'}]"
@@ -89,6 +101,8 @@
const { t, locale } = getI18n
const state = reactive({
queryString: '',
manualQueryString: '',
manualShow: false,
dataList: [],
scrollHeight: 0,
page: {
@@ -97,6 +111,7 @@
totalCount: 0
},
FBillNo: '',
BillNo: '',
materialId: '',
supplierName: '',
inputFocus: true,
@@ -145,21 +160,25 @@
if (state.queryString !== '') getReceiveBillScanData(e)
}, 500)
}
const confirmFun = (e:any) => {
getReceiveBillScanData(e)
}
//查询录入
const getReceiveBillScanData = (val : string) => {
PRDPPBOMScanData({
FBarCode: val,
FBillNo: state.FBillNo,
FBillNo: state.BillNo,
IsFeed: 'true'
}).then((res : any) => {
if (res.data !== null) {
console.log(res);
const scanData = res.data
if( scanData.UnScanQty > scanData.BarCodeQty ) scanData.UnScanQty = scanData.BarCodeQty
scanFrameRef.value.getreceiveBillScanData({
...res.data,
queryString: state.queryString,
scanFrameShowSate: state.shortcutDataFeedback.scanFrameShowSate,
quantityStateSup:'0',
quantityStateSup: '0',
})
if (Object.keys(state.shortcutDataFeedback).length) {
if (state.shortcutDataFeedback.scanFrameShowSate) {
@@ -187,7 +206,7 @@
//数据记录暂存
const postTemporaryScanDraftSaveFun = (item : any) => {
const obj = {};
if (item.warehouseData.FIsOpenLocation && Object.keys(item.locationData).length != 0) {
if (item.warehouseData.FIsOpenLocation && Object.keys(item.locationData).length != 0) {
const key = `FVHUBSTOCKFLEX__FF${item.locationData.FID}`; //仓位Id
obj[key] = { FNumber: item.locationData.FlexEntryId.Number }; //仓位编码
}
@@ -195,7 +214,7 @@
console.log(item);
temporaryScanDraftSave({
FVHUBFormId: "PRD_PPBOM", //数据类型
FVHUBFBillNo: state.FBillNo, //单据编号
FVHUBFBillNo: state.BillNo, //单据编号
FVHUBScanNumber: state.queryString, //条码
FVHUBMaterialNumber: item.articlesStr, //物料编码
FVHUBScanQty: item.quantityStr + '', //扫描数量
@@ -207,6 +226,7 @@
FVHUBMaterial: {
FNUMBER: item.articlesStr
},
FType: "Feed",
...JSON.parse(str),
}).then((res : any) => {
console.log(res);
@@ -231,7 +251,7 @@
const scanRecordFun = () => {
toPages('/pages/records/index', {
FormId: 'PRD_PPBOM',
FbillNo: state.FBillNo
FbillNo: state.BillNo
})
}
/**
@@ -305,13 +325,14 @@
*/
const fnDataList = (FBillNo : any, statesItem : boolean = false) => {
let param = {
id: FBillNo,
IsInStock: 'true'
Id: FBillNo,
IsFeed: 'true',
};
uni.showLoading({ mask: true });
PRDPPBOMView(param).then(res => {
uni.hideLoading();
if (res.code == 200) {
state.BillNo = res.data.BillNo
state.dataList = []
let dataListArray = res.data.Entry;
if (dataListArray.length > 0) {

View File

@@ -4,7 +4,7 @@
<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"
<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>