diff --git a/apps/hand-factory/components/panels/code/apart.vue b/apps/hand-factory/components/panels/code/apart.vue
index 211a6e6..cec66d6 100644
--- a/apps/hand-factory/components/panels/code/apart.vue
+++ b/apps/hand-factory/components/panels/code/apart.vue
@@ -32,9 +32,18 @@
+
+
+
+ ⚠️
+
+ 历史二维码
+ 此二维码已失效,不允许进行分卷操作
+
+
-
+
分卷配置
@@ -215,7 +224,8 @@ export default {
warehouseSearchKeyword: '',
filteredWarehousesInPicker: [],
currentPickerItemIndex: -1,
- loading: false
+ loading: false,
+ qrcodeStatus: 1 // 二维码状态:0=历史码,1=当前有效码
}
},
@@ -348,6 +358,19 @@ export default {
const enterCoilNo = content.enter_coil_no;
const currentCoilNo = content.current_coil_no;
+ // 保存二维码状态
+ this.qrcodeStatus = qrcodeRecord.status || 1;
+
+ // 如果是历史码,直接拒绝
+ if (this.qrcodeStatus === 0) {
+ uni.showModal({
+ title: '历史二维码',
+ content: '此二维码已失效,不允许进行分卷操作,请使用最新二维码',
+ showCancel: false
+ });
+ return;
+ }
+
if (!enterCoilNo) {
throw new Error('二维码中未包含有效的入场钢卷号');
}
@@ -478,6 +501,16 @@ export default {
// 提交分卷
handleConfirm() {
+ // 历史二维码不允许分卷
+ if (this.qrcodeStatus === 0) {
+ uni.showModal({
+ title: '历史二维码',
+ content: '此二维码已失效,不允许进行分卷操作,请使用最新二维码',
+ showCancel: false
+ });
+ return;
+ }
+
// 验证所有分卷都有钢卷号和班组
for (let i = 0; i < this.splitCoils.length; i++) {
if (!this.splitCoils[i].currentCoilNo) {
diff --git a/apps/hand-factory/components/panels/code/merge.vue b/apps/hand-factory/components/panels/code/merge.vue
index 7c6ba18..7688f59 100644
--- a/apps/hand-factory/components/panels/code/merge.vue
+++ b/apps/hand-factory/components/panels/code/merge.vue
@@ -11,6 +11,15 @@
+
+
+ ⚠️
+
+ 包含历史二维码
+ 列表中包含已失效的二维码,不允许进行合卷操作,请移除后重试
+
+
+
@@ -20,11 +29,12 @@
- {{ index + 1 }}
+ {{ index + 1 }}
入场钢卷号:
{{ coil.enterCoilNo }}
+ 历史码
当前钢卷号:
@@ -184,6 +194,13 @@ export default {
}
},
+ computed: {
+ // 是否包含历史二维码
+ hasHistoryQrcode() {
+ return this.scannedCoils.some(coil => coil.qrcodeStatus === 0);
+ }
+ },
+
onLoad() {
this.loadWarehouses();
},
@@ -299,6 +316,17 @@ export default {
const content = JSON.parse(qrcodeRecord.content);
const enterCoilNo = content.enter_coil_no;
const currentCoilNo = content.current_coil_no;
+ const qrcodeStatus = qrcodeRecord.status || 1;
+
+ // 如果是历史码,提示用户
+ if (qrcodeStatus === 0) {
+ uni.showModal({
+ title: '历史二维码',
+ content: '此二维码已失效,不允许进行合卷操作,请使用最新二维码',
+ showCancel: false
+ });
+ return;
+ }
if (!enterCoilNo) {
throw new Error('二维码中未包含有效的入场钢卷号');
@@ -341,6 +369,10 @@ export default {
});
return;
}
+
+ // 保存二维码状态到钢卷数据中
+ coilData.qrcodeStatus = qrcodeStatus;
+
this.scannedCoils.push(coilData);
console.log('钢卷详情:', coilData);
@@ -403,6 +435,16 @@ export default {
// 提交合卷
handleConfirm() {
+ // 检查是否包含历史二维码
+ if (this.hasHistoryQrcode) {
+ uni.showModal({
+ title: '包含历史二维码',
+ content: '列表中包含已失效的二维码,不允许进行合卷操作,请移除后重试',
+ showCancel: false
+ });
+ return;
+ }
+
// 验证
if (this.scannedCoils.length < 2) {
uni.showToast({
@@ -592,6 +634,10 @@ export default {
font-size: 24rpx;
font-weight: bold;
flex-shrink: 0;
+
+ &.index-history {
+ background: #999;
+ }
}
.coil-info {
@@ -599,6 +645,7 @@ export default {
.coil-row {
display: flex;
+ align-items: center;
margin-bottom: 8rpx;
&:last-child {
@@ -616,6 +663,15 @@ export default {
color: #333;
font-weight: 500;
}
+
+ .history-tag {
+ font-size: 20rpx;
+ padding: 2rpx 10rpx;
+ background: #f8d7da;
+ color: #721c24;
+ border-radius: 8rpx;
+ margin-left: 10rpx;
+ }
}
}
}
diff --git a/apps/hand-factory/components/panels/code/typing.vue b/apps/hand-factory/components/panels/code/typing.vue
index b9011a3..dcee7c4 100644
--- a/apps/hand-factory/components/panels/code/typing.vue
+++ b/apps/hand-factory/components/panels/code/typing.vue
@@ -44,8 +44,17 @@
+
+
+ ⚠️
+
+ 历史二维码
+ 此二维码已失效,已为您加载最新物料信息,仅可查看,无法修改
+
+
+
-
+
⚠️
历史数据
@@ -67,8 +76,8 @@
v-model="form.currentCoilNo"
placeholder="请输入当前钢卷号"
class="form-input"
- :disabled="coilDetail.dataType === 0"
- :class="{ 'form-input-disabled': coilDetail.dataType === 0 }"
+ :disabled="coilDetail.dataType === 0 || qrcodeStatus === 0"
+ :class="{ 'form-input-disabled': coilDetail.dataType === 0 || qrcodeStatus === 0 }"
/>
@@ -79,8 +88,8 @@
v-model="form.team"
placeholder="请输入班组名称"
class="form-input"
- :disabled="coilDetail.dataType === 0"
- :class="{ 'form-input-disabled': coilDetail.dataType === 0 }"
+ :disabled="coilDetail.dataType === 0 || qrcodeStatus === 0"
+ :class="{ 'form-input-disabled': coilDetail.dataType === 0 || qrcodeStatus === 0 }"
/>
@@ -89,13 +98,13 @@
目标库区
{{ currentWarehouseName || '请选择目标库区' }}
- ▼
+ ▼
@@ -107,8 +116,8 @@
type="digit"
placeholder="请输入毛重(选填)"
class="form-input"
- :disabled="coilDetail.dataType === 0"
- :class="{ 'form-input-disabled': coilDetail.dataType === 0 }"
+ :disabled="coilDetail.dataType === 0 || qrcodeStatus === 0"
+ :class="{ 'form-input-disabled': coilDetail.dataType === 0 || qrcodeStatus === 0 }"
/>
@@ -120,8 +129,8 @@
type="digit"
placeholder="请输入净重(选填)"
class="form-input"
- :disabled="coilDetail.dataType === 0"
- :class="{ 'form-input-disabled': coilDetail.dataType === 0 }"
+ :disabled="coilDetail.dataType === 0 || qrcodeStatus === 0"
+ :class="{ 'form-input-disabled': coilDetail.dataType === 0 || qrcodeStatus === 0 }"
/>
@@ -135,7 +144,7 @@