剩余模块:生产退料

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);
}