2/8 扫码数量校验 生成一维码1.0

20240912_adapter
wangwei 5 months ago
parent 1e58bbc832
commit 3be83cce4f

@ -147,6 +147,46 @@
</el-col> </el-col>
</el-row> </el-row>
</el-collapse-item> </el-collapse-item>
<el-collapse-item name="4">
<template slot="title">
<p class="form-title">扫码设置</p>
</template>
<el-row :gutter="20">
<el-col :span="8" class="el-col">
<el-form-item label="网页扫码数量设置:" prop="scanMaxCount" style="margin-bottom: 0">
<el-input
style="width: 90%"
size="small"
type='number'
splaceholder="请输入内容"
v-model="formData.scanMaxCount"
></el-input>
</el-form-item>
</el-col>
<el-col :span="8" class="el-col">
<el-form-item label="PAD扫码数量设置:" prop="pdaMaxCount" style="margin-bottom: 0">
<el-input
style="width: 90%"
size="small"
type='number'
splaceholder="请输入内容"
v-model="formData.pdaMaxCount"
></el-input>
</el-form-item>
</el-col>
<el-col :span="8" class="el-col">
<el-form-item label="工控扫码数量设置:" prop="ipcMaxCount" style="margin-bottom: 0">
<el-input
style="width: 90%"
size="small"
type='number'
splaceholder="请输入内容"
v-model="formData.ipcMaxCount"
></el-input>
</el-form-item>
</el-col>
</el-row>
</el-collapse-item>
</el-collapse> </el-collapse>
@ -175,6 +215,7 @@
import {getSet, updateSet} from "@/api/collect/collectSet"; import {getSet, updateSet} from "@/api/collect/collectSet";
import ShelfDisplay from "@/components/ShelfDisplay"; import ShelfDisplay from "@/components/ShelfDisplay";
import { isBlank } from '@/utils/strUtil'
export default { export default {
name: 'timerSetting', name: 'timerSetting',
@ -251,12 +292,15 @@ export default {
] ]
}, },
], ],
activeNames: ['0', '1', '2', '3'], activeNames: ['0', '1', '2', '3','4'],
formData: { formData: {
startDownloadTime: null, startDownloadTime: null,
lastCodeSplit: true, lastCodeSplit: true,
isScanCodeCheck: true, isScanCodeCheck: true,
getSplitConfirm: false, getSplitConfirm: false,
scanMaxCount:null,
pdaMaxCount: null,
ipcMaxCount: null,
}, },
systemParam: null, systemParam: null,
@ -282,6 +326,16 @@ export default {
this.ShelfDisplayFlag = true this.ShelfDisplayFlag = true
}, },
save() { save() {
if (isBlank(this.formData.scanMaxCount)){
this.formData.scanMaxCount = 0
}
if (isBlank(this.formData.pdaMaxCount)){
this.formData.pdaMaxCount = 0
}
if (isBlank(this.formData.ipcMaxCount)){
this.formData.ipcMaxCount = 0
}
updateSet(this.formData) updateSet(this.formData)
.then((response) => { .then((response) => {
if (response.code != 20000) { if (response.code != 20000) {

@ -237,8 +237,15 @@
</div> </div>
<el-descriptions title="单据信息" :column="4" border style="margin-top: 15px"> <el-descriptions title="单据信息" :column="4" border style="margin-top: 15px" class="custom-descriptions">
<el-descriptions-item label="业务单号">{{ formData.billNo }}</el-descriptions-item> <!--{{ formData.billNo }}-->
<el-descriptions-item label="业务单号">
<!--<svg ref="barcodeContainer" ></svg>-->
<div class="barcode-wrapper" >
<svg ref="barcodeContainer" v-show="formData.billNo != null"></svg>
<!--<span>{{ formData.billNo }}</span>-->
</div>
</el-descriptions-item>
<el-descriptions-item label="发货方">{{ formData.shipperName }}</el-descriptions-item> <el-descriptions-item label="发货方">{{ formData.shipperName }}</el-descriptions-item>
<el-descriptions-item label="收货方">{{ formData.fromCorpName }}</el-descriptions-item> <el-descriptions-item label="收货方">{{ formData.fromCorpName }}</el-descriptions-item>
<el-descriptions-item label="单据类型">{{ formData.busTypeName }}</el-descriptions-item> <el-descriptions-item label="单据类型">{{ formData.busTypeName }}</el-descriptions-item>
@ -246,6 +253,8 @@
<el-descriptions-item label="单据时间">{{ formData.billTime }}</el-descriptions-item> <el-descriptions-item label="单据时间">{{ formData.billTime }}</el-descriptions-item>
<el-descriptions-item label="单据备注">{{ formData.remark }}</el-descriptions-item> <el-descriptions-item label="单据备注">{{ formData.remark }}</el-descriptions-item>
</el-descriptions> </el-descriptions>
<!--<div id="qrcode-container" ref="barcodeContainer" style="margin-right: 38px;padding-bottom: 30px"></div>-->
<!--<svg ref="barcodeContainer"></svg>-->
</el-card> </el-card>
<el-tabs type="border-card" style="margin: 15px" v-model="editableTabsValue"> <el-tabs type="border-card" style="margin: 15px" v-model="editableTabsValue">
@ -424,6 +433,7 @@ import {getInvListByUser} from "@/api/system/invWarehouse";
import {orderbatchAddCode} from "@/api/inout/splitCode"; import {orderbatchAddCode} from "@/api/inout/splitCode";
import {isBlank} from "@/utils/strUtil"; import {isBlank} from "@/utils/strUtil";
import JsBarcode from 'jsbarcode';
export default { export default {
/** /**
* 处理处方 * 处理处方
@ -553,7 +563,23 @@ export default {
} }
}, },
methods: { methods: {
generateBarcode() {
const barcodeData = this.formData.billNo;
//
const barcodeContainer = this.$refs.barcodeContainer;
// 使JsBarcode
JsBarcode(barcodeContainer, barcodeData, {
format: 'CODE128',
displayValue: true,
fontSize: 8, //
textColor: '#000',
lineColor: '#000',
width: 1.2, //
height: 15, //
margin: 1 //
});
},
getBillNo(billNo) { getBillNo(billNo) {
let post = { let post = {
billNo: billNo, billNo: billNo,
@ -565,6 +591,7 @@ export default {
if (res.code == 20000) { if (res.code == 20000) {
if (res.data.billNo != null) { if (res.data.billNo != null) {
this.formData = res.data this.formData = res.data
this.generateBarcode()
this.scanCode = ""; this.scanCode = "";
this.formData.workPlaceCode = this.workplaceId this.formData.workPlaceCode = this.workplaceId
this.checked = false this.checked = false
@ -971,7 +998,6 @@ export default {
this.filterQuery.code = response.data.code; this.filterQuery.code = response.data.code;
this.scanCode = "" this.scanCode = ""
this.originCode = "" this.originCode = ""
this.addCode(); this.addCode();
} else { } else {
if (response.code == 502) { if (response.code == 502) {
@ -1252,6 +1278,7 @@ export default {
this.formData = row; this.formData = row;
this.formData.workPlaceCode = this.workplaceId; this.formData.workPlaceCode = this.workplaceId;
this.startDeal(); this.startDeal();
this.generateBarcode()
}, },
startDeal() { startDeal() {
@ -1451,6 +1478,7 @@ export default {
}, },
reset() { reset() {
this.formData = { this.formData = {
billNo: null,
tagStatus: -1, tagStatus: -1,
workPlaceCode: this.formData.workPlaceCode, workPlaceCode: this.formData.workPlaceCode,
busType: this.formData.busType, busType: this.formData.busType,
@ -1809,4 +1837,21 @@ export default {
.el-icon-arrow-down { .el-icon-arrow-down {
font-size: 12px; font-size: 12px;
} }
.custom-descriptions {
position: relative; /* 设置相对定位,为绝对定位的边框线提供参考 */
}
.barcode-wrapper {
display: flex;
flex-direction: column;
align-items: center; /* 水平居中 */
justify-content: center; /* 垂直居中 */
}
.custom-descriptions .el-descriptions__cell svg {
vertical-align: middle;
margin-left: 20px;
margin-right: 10px;
}
</style> </style>

@ -351,6 +351,7 @@ import {getWorkBindBusTypes} from '@/api/basic/workPlace/sysWorkplaceDocuments'
import {filterWorkOptimize} from '@/api/basic/workPlace/sysWorkplaceManage' import {filterWorkOptimize} from '@/api/basic/workPlace/sysWorkplaceManage'
import {getByCode} from "@/api/basic/workPlace/SysWorkplaceQueue"; import {getByCode} from "@/api/basic/workPlace/SysWorkplaceQueue";
import { getCodeList } from '@/api/inout/splitInv' import { getCodeList } from '@/api/inout/splitInv'
import { getSet } from '@/api/collect/collectSet'
// //
const SCAN_TIMEOUT = 1000 const SCAN_TIMEOUT = 1000
@ -633,7 +634,8 @@ export default {
redMesgOld: false, redMesgOld: false,
productName: null, productName: null,
orderStatus: false,// orderStatus: false,//
workPlaceQueueCode:"" workPlaceQueueCode:"",
collectSet: {}
} }
}, },
components: { components: {
@ -714,6 +716,7 @@ export default {
this.scanReCount = 0 this.scanReCount = 0
this.$refs.newCreateCodeDetail.codeCount = 0 this.$refs.newCreateCodeDetail.codeCount = 0
this.refreshCodesPanel() this.refreshCodesPanel()
this.selectSysParam()
}, },
// //
findInvListByUser() { findInvListByUser() {
@ -1124,6 +1127,7 @@ export default {
} }
if (this.codeFormData.code.includes(';')) { if (this.codeFormData.code.includes(';')) {
const codeArray = this.codeFormData.code.split(';') const codeArray = this.codeFormData.code.split(';')
this.verifyScanCount(codeArray)
let params = { let params = {
codeList: codeArray codeList: codeArray
} }
@ -1778,6 +1782,7 @@ export default {
this.codeFormData.code = this.scanCode.trim() this.codeFormData.code = this.scanCode.trim()
if (this.codeFormData.code.includes(';')) { if (this.codeFormData.code.includes(';')) {
const codeArray = this.codeFormData.code.split(';') const codeArray = this.codeFormData.code.split(';')
this.verifyScanCount(codeArray)
let params = { let params = {
codeList: codeArray codeList: codeArray
} }
@ -1860,6 +1865,18 @@ export default {
} }
}, },
verifyScanCount(codeArray){
//
if (this.collectSet.scanMaxCount != null && this.collectSet.scanMaxCount != 0) {
if (this.collectSet.scanMaxCount > codeArray.length) {
this.scanCode = ''
return this.$message.error("扫码数量少于设置扫码数量");
} else if (this.collectSet.scanMaxCount < codeArray.length) {
this.scanCode = ''
return this.$message.error("扫码数量超出");
}
}
},
removeCodesTemp(query) { removeCodesTemp(query) {
//todo this.codeArray id deleteCodesTempById //todo this.codeArray id deleteCodesTempById
deleteCodesTempByCodes(query).then(res => { deleteCodesTempByCodes(query).then(res => {
@ -2071,6 +2088,7 @@ export default {
init() { init() {
// //
this.selectSysParam()
this.findAllWorkPlaces() this.findAllWorkPlaces()
this.codeFormData.code = '' this.codeFormData.code = ''
if (this.splitType == 'search') { if (this.splitType == 'search') {
@ -2117,9 +2135,17 @@ export default {
this.showSearch = true this.showSearch = true
} }
}, },
selectSysParam() {
getSet().then((response) => {
if (response.code == 20000) {
this.collectSet = response.data
}
})
},
// //
handleRecCodesEvent(event) { handleRecCodesEvent(event) {
console.log('接收 recCodes event:', event.detail.recCodes) console.log('接收 recCodes event:', event.detail.recCodes)
this.verifyScanCount(event.detail.recCodes)
let params = { let params = {
codeList: event.detail.recCodes codeList: event.detail.recCodes
} }
@ -2403,6 +2429,7 @@ export default {
created() { created() {
// this.splitType = this.$route.query.splitType; // this.splitType = this.$route.query.splitType;
// if (this.splitType == null) // if (this.splitType == null)
this.splitType = this.fromSplitType this.splitType = this.fromSplitType
this.init() this.init()
if (this.$route.query.workplaceId != null) { if (this.$route.query.workplaceId != null) {

Loading…
Cancel
Save