将coilId的存储模式改成string
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<view class="apart-container">
|
||||
<!-- 扫码按钮 -->
|
||||
<!-- 扫码按钮 -->
|
||||
<view class="scan-section" v-if="!form.coilId">
|
||||
<view class="scan-btn-wrapper" @click="handleScan">
|
||||
<view class="scan-icon">
|
||||
@@ -15,8 +15,8 @@
|
||||
<view class="card-title">
|
||||
<text class="title-dot"></text>
|
||||
<text class="title-text">原钢卷信息</text>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
|
||||
<view class="info-grid">
|
||||
<view class="info-item">
|
||||
<text class="item-label">入场钢卷号</text>
|
||||
@@ -31,8 +31,8 @@
|
||||
<text class="item-value">{{ (coilDetail.warehouse && coilDetail.warehouse.warehouseName) || '未分配' }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
|
||||
<!-- 分卷列表 -->
|
||||
<view class="form-card" v-if="form.coilId" @click="closeWarehouseList">
|
||||
<view class="card-title">
|
||||
@@ -75,7 +75,7 @@
|
||||
<view class="split-body">
|
||||
<view class="split-field">
|
||||
<text class="field-label">新钢卷号</text>
|
||||
<input
|
||||
<input
|
||||
v-model="item.currentCoilNo"
|
||||
placeholder="请输入新钢卷号"
|
||||
class="field-input"
|
||||
@@ -83,7 +83,7 @@
|
||||
</view>
|
||||
<view class="split-field">
|
||||
<text class="field-label">班组</text>
|
||||
<input
|
||||
<input
|
||||
v-model="item.team"
|
||||
placeholder="请输入班组名称"
|
||||
class="field-input"
|
||||
@@ -103,7 +103,7 @@
|
||||
</view>
|
||||
<view class="split-field">
|
||||
<text class="field-label-optional">毛重 (kg)</text>
|
||||
<input
|
||||
<input
|
||||
v-model="item.grossWeight"
|
||||
type="digit"
|
||||
placeholder="请输入毛重(选填)"
|
||||
@@ -112,7 +112,7 @@
|
||||
</view>
|
||||
<view class="split-field">
|
||||
<text class="field-label-optional">净重 (kg)</text>
|
||||
<input
|
||||
<input
|
||||
v-model="item.netWeight"
|
||||
type="digit"
|
||||
placeholder="请输入净重(选填)"
|
||||
@@ -127,14 +127,14 @@
|
||||
<view class="operator-info">
|
||||
<text class="operator-label">操作人:</text>
|
||||
<text class="operator-name">{{ operatorName }}</text>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
|
||||
<!-- 操作按钮 -->
|
||||
<view class="action-buttons">
|
||||
<button class="btn btn-secondary" @click="handleReset">重新扫码</button>
|
||||
<button class="btn btn-primary" @click="handleConfirm" :disabled="loading">
|
||||
{{ loading ? '提交中...' : '确认分卷' }}
|
||||
</button>
|
||||
</button>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
@@ -169,7 +169,7 @@
|
||||
</scroll-view>
|
||||
</view>
|
||||
</uni-popup>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
@@ -178,10 +178,10 @@ import { updateMaterialCoil, getMaterialCoil, getMaterialCoilTrace } from '@/api
|
||||
import { listWarehouse } from '@/api/wms/warehouse.js'
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
form: {
|
||||
coilId: undefined,
|
||||
data() {
|
||||
return {
|
||||
form: {
|
||||
coilId: undefined,
|
||||
hasMergeSplit: 1 // 1表示分卷
|
||||
},
|
||||
coilDetail: {},
|
||||
@@ -202,7 +202,7 @@ export default {
|
||||
currentCoilNo: '',
|
||||
team: '',
|
||||
hasMergeSplit: 1,
|
||||
warehouseId: undefined,
|
||||
warehouseId: undefined,
|
||||
warehouseName: '',
|
||||
warehouseKeyword: '',
|
||||
filteredWarehouses: [],
|
||||
@@ -389,18 +389,18 @@ export default {
|
||||
});
|
||||
} catch (err) {
|
||||
console.error('扫码处理失败:', err);
|
||||
uni.showToast({
|
||||
uni.showToast({
|
||||
title: err.message || '扫码信息解析失败',
|
||||
icon: 'none',
|
||||
duration: 2000
|
||||
});
|
||||
}
|
||||
},
|
||||
fail: (err) => {
|
||||
},
|
||||
fail: (err) => {
|
||||
console.error('扫码失败:', err);
|
||||
uni.showToast({
|
||||
title: '扫码失败,请重试',
|
||||
icon: 'none'
|
||||
uni.showToast({
|
||||
title: '扫码失败,请重试',
|
||||
icon: 'none'
|
||||
});
|
||||
}
|
||||
});
|
||||
@@ -419,7 +419,7 @@ export default {
|
||||
currentCoilNo: '',
|
||||
team: '',
|
||||
hasMergeSplit: 1,
|
||||
warehouseId: undefined,
|
||||
warehouseId: undefined,
|
||||
warehouseName: '',
|
||||
warehouseKeyword: '',
|
||||
filteredWarehouses: this.warehouses,
|
||||
@@ -435,11 +435,11 @@ export default {
|
||||
|
||||
// 重新扫码
|
||||
handleReset() {
|
||||
uni.showModal({
|
||||
uni.showModal({
|
||||
title: '确认重新扫码',
|
||||
content: '是否要清空当前数据并重新扫码?',
|
||||
success: (res) => {
|
||||
if (res.confirm) {
|
||||
success: (res) => {
|
||||
if (res.confirm) {
|
||||
this.form = {
|
||||
coilId: undefined,
|
||||
hasMergeSplit: 1
|
||||
@@ -477,20 +477,20 @@ export default {
|
||||
},
|
||||
|
||||
// 提交分卷
|
||||
handleConfirm() {
|
||||
handleConfirm() {
|
||||
// 验证所有分卷都有钢卷号和班组
|
||||
for (let i = 0; i < this.splitCoils.length; i++) {
|
||||
if (!this.splitCoils[i].currentCoilNo) {
|
||||
uni.showToast({
|
||||
uni.showToast({
|
||||
title: `请输入分卷 ${i + 1} 的钢卷号`,
|
||||
icon: 'none'
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (!this.splitCoils[i].team) {
|
||||
uni.showToast({
|
||||
uni.showToast({
|
||||
title: `请输入分卷 ${i + 1} 的班组`,
|
||||
icon: 'none'
|
||||
icon: 'none'
|
||||
});
|
||||
return;
|
||||
}
|
||||
@@ -508,7 +508,7 @@ export default {
|
||||
newCoils: this.splitCoils.map(item => ({
|
||||
currentCoilNo: item.currentCoilNo,
|
||||
team: item.team,
|
||||
hasMergeSplit: 1,
|
||||
hasMergeSplit: 1,
|
||||
itemType: this.coilDetail.itemType,
|
||||
itemId: this.coilDetail.itemId,
|
||||
warehouseId: item.warehouseId || this.coilDetail.warehouseId, // 使用分卷的库区或原库区
|
||||
@@ -541,8 +541,8 @@ export default {
|
||||
}).finally(() => {
|
||||
this.loading = false;
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -602,8 +602,8 @@ export default {
|
||||
}
|
||||
|
||||
.card-title {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-bottom: 25rpx;
|
||||
padding-bottom: 20rpx;
|
||||
border-bottom: 1rpx solid #f0f0f0;
|
||||
@@ -618,7 +618,7 @@ export default {
|
||||
|
||||
.title-text {
|
||||
flex: 1;
|
||||
font-size: 32rpx;
|
||||
font-size: 32rpx;
|
||||
font-weight: 600;
|
||||
color: #333;
|
||||
}
|
||||
@@ -647,9 +647,9 @@ export default {
|
||||
.item-value {
|
||||
display: block;
|
||||
font-size: 28rpx;
|
||||
color: #333;
|
||||
font-weight: 500;
|
||||
}
|
||||
color: #333;
|
||||
font-weight: 500;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -659,7 +659,7 @@ export default {
|
||||
|
||||
.form-label {
|
||||
display: block;
|
||||
font-size: 28rpx;
|
||||
font-size: 28rpx;
|
||||
color: #333;
|
||||
margin-bottom: 15rpx;
|
||||
font-weight: 500;
|
||||
@@ -727,7 +727,7 @@ export default {
|
||||
}
|
||||
|
||||
.split-header {
|
||||
margin-bottom: 20rpx;
|
||||
margin-bottom: 20rpx;
|
||||
|
||||
.split-title {
|
||||
font-size: 28rpx;
|
||||
@@ -738,7 +738,7 @@ export default {
|
||||
|
||||
.split-body {
|
||||
.split-field {
|
||||
margin-bottom: 20rpx;
|
||||
margin-bottom: 20rpx;
|
||||
|
||||
&:last-child {
|
||||
margin-bottom: 0;
|
||||
@@ -753,7 +753,7 @@ export default {
|
||||
|
||||
.field-label-optional {
|
||||
display: block;
|
||||
font-size: 26rpx;
|
||||
font-size: 26rpx;
|
||||
color: #666;
|
||||
margin-bottom: 12rpx;
|
||||
}
|
||||
@@ -775,13 +775,13 @@ export default {
|
||||
}
|
||||
|
||||
.picker-input {
|
||||
width: 100%;
|
||||
height: 80rpx;
|
||||
padding: 0 20rpx;
|
||||
width: 100%;
|
||||
height: 80rpx;
|
||||
padding: 0 20rpx;
|
||||
background: #fff;
|
||||
border: 2rpx solid #e8e8e8;
|
||||
border-radius: 10rpx;
|
||||
box-sizing: border-box;
|
||||
box-sizing: border-box;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
@@ -883,7 +883,7 @@ export default {
|
||||
border-bottom: 1rpx solid #f0f0f0;
|
||||
|
||||
.popup-title {
|
||||
font-size: 32rpx;
|
||||
font-size: 32rpx;
|
||||
color: #333;
|
||||
font-weight: 600;
|
||||
}
|
||||
@@ -904,12 +904,12 @@ export default {
|
||||
border-bottom: 1rpx solid #f0f0f0;
|
||||
|
||||
.search-input {
|
||||
width: 100%;
|
||||
width: 100%;
|
||||
height: 80rpx;
|
||||
padding: 0 20rpx;
|
||||
background: #f8f9fa;
|
||||
border: 2rpx solid #e8e8e8;
|
||||
border-radius: 10rpx;
|
||||
border-radius: 10rpx;
|
||||
font-size: 28rpx;
|
||||
color: #333;
|
||||
box-sizing: border-box;
|
||||
|
||||
@@ -208,21 +208,21 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getGenerateRecord } from '@/api/wms/code.js'
|
||||
import { getGenerateRecord } from '@/api/wms/code.js'
|
||||
import { updateMaterialCoil, getMaterialCoil, getMaterialCoilTrace } from '@/api/wms/coil.js'
|
||||
import { listWarehouse } from '@/api/wms/warehouse.js'
|
||||
import { getRawMaterial } from '@/api/wms/rawMaterial.js'
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
form: {
|
||||
coilId: undefined,
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
form: {
|
||||
coilId: undefined,
|
||||
itemType: '',
|
||||
itemId: undefined,
|
||||
itemId: undefined,
|
||||
team: '',
|
||||
currentCoilNo: '',
|
||||
warehouseId: undefined,
|
||||
warehouseId: undefined,
|
||||
warehouseName: '',
|
||||
grossWeight: '',
|
||||
netWeight: ''
|
||||
@@ -337,8 +337,8 @@ export default {
|
||||
},
|
||||
|
||||
// 扫码
|
||||
handleScan() {
|
||||
uni.scanCode({
|
||||
handleScan() {
|
||||
uni.scanCode({
|
||||
success: async (res) => {
|
||||
console.log('扫码结果:', res.result);
|
||||
try {
|
||||
@@ -421,7 +421,7 @@ export default {
|
||||
}
|
||||
|
||||
console.log('钢卷详情:', coilData);
|
||||
uni.showToast({
|
||||
uni.showToast({
|
||||
title: '扫码成功',
|
||||
icon: 'success'
|
||||
});
|
||||
@@ -436,9 +436,9 @@ export default {
|
||||
},
|
||||
fail: (err) => {
|
||||
console.error('扫码失败:', err);
|
||||
uni.showToast({
|
||||
title: '扫码失败,请重试',
|
||||
icon: 'none'
|
||||
uni.showToast({
|
||||
title: '扫码失败,请重试',
|
||||
icon: 'none'
|
||||
});
|
||||
}
|
||||
});
|
||||
@@ -489,7 +489,7 @@ export default {
|
||||
},
|
||||
|
||||
// 提交
|
||||
handleConfirm() {
|
||||
handleConfirm() {
|
||||
// 历史数据不允许修改
|
||||
if (this.coilDetail.dataType === 0) {
|
||||
uni.showToast({ title: '历史数据不允许修改', icon: 'none' });
|
||||
@@ -522,9 +522,9 @@ export default {
|
||||
|
||||
updateMaterialCoil(submitData).then(res => {
|
||||
if (res.code === 200) {
|
||||
uni.showToast({
|
||||
uni.showToast({
|
||||
title: '保存成功',
|
||||
icon: 'success'
|
||||
icon: 'success'
|
||||
});
|
||||
setTimeout(() => {
|
||||
this.handleReset();
|
||||
@@ -535,18 +535,18 @@ export default {
|
||||
icon: 'none'
|
||||
});
|
||||
}
|
||||
}).catch(err => {
|
||||
}).catch(err => {
|
||||
console.error('提交失败:', err);
|
||||
uni.showToast({
|
||||
uni.showToast({
|
||||
title: '保存失败,请重试',
|
||||
icon: 'none'
|
||||
icon: 'none'
|
||||
});
|
||||
}).finally(() => {
|
||||
this.loading = false;
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
@@ -868,7 +868,7 @@ export default {
|
||||
border-bottom: 1rpx solid #f0f0f0;
|
||||
|
||||
.popup-title {
|
||||
font-size: 32rpx;
|
||||
font-size: 32rpx;
|
||||
color: #333;
|
||||
font-weight: 600;
|
||||
}
|
||||
@@ -889,7 +889,7 @@ export default {
|
||||
border-bottom: 1rpx solid #f0f0f0;
|
||||
|
||||
.search-input {
|
||||
width: 100%;
|
||||
width: 100%;
|
||||
height: 80rpx;
|
||||
padding: 0 20rpx;
|
||||
background: #f8f9fa;
|
||||
@@ -931,7 +931,7 @@ export default {
|
||||
}
|
||||
|
||||
.warehouse-check {
|
||||
font-size: 32rpx;
|
||||
font-size: 32rpx;
|
||||
color: #007aff;
|
||||
font-weight: bold;
|
||||
}
|
||||
@@ -970,7 +970,7 @@ export default {
|
||||
.action-buttons {
|
||||
display: flex;
|
||||
gap: 20rpx;
|
||||
margin-top: 30rpx;
|
||||
margin-top: 30rpx;
|
||||
|
||||
.btn {
|
||||
flex: 1;
|
||||
@@ -1095,5 +1095,5 @@ export default {
|
||||
font-size: 28rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user