chore: 保存盘点开发前改动

This commit is contained in:
zgw
2026-06-25 17:42:39 +08:00
parent 1af5b3cbd3
commit 4b8bc03343
114 changed files with 10005 additions and 1392 deletions

View File

@@ -18,19 +18,20 @@
</view>
</picker>
</view>
<view class="form-item">
<text class="form-label">入库点位</text>
<picker class="form-picker" mode="selector" :range="stationPointOptions" range-key="pointName"
:value="stationPointIndex" :disabled="bindSuccess || !warehouseId || !trayCode" @change="handleStationPointChange">
<view class="picker-value" :class="{ placeholder: !stationPointId }">
{{ selectedStationPointName || '请选择入库点位' }}
</view>
</picker>
</view>
<view class="form-item">
<text class="form-label">托盘号</text>
<input class="form-input" v-model="trayCode" placeholder="请扫描托盘号" />
</view>
<view class="form-tip" v-if="!warehouseId || !trayCode">请先选择仓库和扫描托盘号</view>
<view class="form-item" v-else>
<text class="form-label">入库点位</text>
<picker class="form-picker" mode="selector" :range="stationPointOptions" range-key="pointName"
:value="stationPointIndex" :disabled="bindSuccess" @change="handleStationPointChange">
<view class="picker-value" :class="{ placeholder: !stationPointId }">
{{ selectedStationPointName || '请扫描入库点位' }}
</view>
</picker>
</view>
</view>
<!-- 绑盘状态提示 -->
@@ -551,18 +552,28 @@
return submitBindTrayAndAddInJob(data)
}).then(function(res) {
that.$modal.msgSuccess(res.msg || '绑盘并生成入库作业成功')
that.bindSuccess = true
that.resetBindPayload()
if (that.stockinId) {
that.loadDetailList()
}
that.barcode = ''
that.currentMaterial = null
that.currentRemainQty = 0
that.currentQty = ''
that.showQuantityPopup = false
}).catch(function() {})
},
resetBindPayload() {
this.stationPointId = ''
this.stationPointName = ''
this.stationPointIndex = 0
this.stationPointOptions = []
this.trayCode = ''
this.barcode = ''
this.currentMaterial = null
this.currentRemainQty = 0
this.currentQty = ''
this.showQuantityPopup = false
this.bindSuccess = false
this.items = []
},
// 全部重置
resetAll() {
this.stockinId = ''
@@ -697,6 +708,13 @@
padding: 16rpx 0;
}
.form-tip {
padding: 8rpx 0 16rpx 160rpx;
font-size: 24rpx;
color: #909399;
line-height: 1.4;
}
.form-label {
font-size: 28rpx;
color: #666;

View File

@@ -0,0 +1,298 @@
<template>
<view class="page-container">
<view class="form-section">
<text class="form-title">空托盘入库</text>
<view class="form-item">
<text class="form-label">仓库</text>
<picker class="form-picker" mode="selector" :range="warehouseOptions" range-key="warehouseName"
:value="warehouseIndex" @change="handleWarehouseChange">
<view class="picker-value" :class="{ placeholder: !warehouseId }">
{{ selectedWarehouseName || '请选择仓库' }}
</view>
</picker>
</view>
<view class="form-item">
<text class="form-label">托盘号</text>
<input class="form-input" v-model="trayCode" placeholder="请扫描托盘号" />
</view>
<view class="form-tip" v-if="!warehouseId || !trayCode">请先选择仓库和扫描托盘号</view>
<template v-else>
<view class="form-item">
<text class="form-label">入库点位</text>
<picker class="form-picker" mode="selector" :range="stationPointOptions" range-key="pointName"
:value="stationPointIndex" @change="handleStationPointChange">
<view class="picker-value" :class="{ placeholder: !stationPointId }">
{{ selectedStationPointName || '请选择入库点位' }}
</view>
</picker>
</view>
</template>
</view>
<view class="summary-section">
<view class="summary-row">
<text class="summary-label">作业类型</text>
<text class="summary-value">空容器入库</text>
</view>
<view class="summary-row">
<text class="summary-label">绑定物料</text>
<text class="summary-value muted">无需绑定</text>
</view>
</view>
<view class="btn-section">
<button class="btn btn-primary" :disabled="!canSubmit || submitting" @click="submitEmptyTray">
{{ submitting ? '提交中...' : '确认生成空托入库作业' }}
</button>
<button class="btn btn-default" @click="resetPayload">重置</button>
</view>
</view>
</template>
<script>
import { getInboundStationPointOptions, getWarehouseOptions, submitEmptyTrayInbound } from '@/api/warehouse/inbound'
export default {
data() {
return {
warehouseOptions: [],
warehouseIndex: 0,
warehouseId: '',
warehouseName: '',
trayCode: '',
stationPointOptions: [],
stationPointIndex: 0,
stationPointId: '',
stationPointName: '',
submitting: false
}
},
computed: {
selectedWarehouseName() {
if (this.warehouseName) return this.warehouseName
var selected = this.warehouseOptions[this.warehouseIndex]
return selected && selected.warehouseId === this.warehouseId ? selected.warehouseName : ''
},
selectedStationPointName() {
if (this.stationPointName) return this.stationPointName
var selected = this.stationPointOptions[this.stationPointIndex]
return selected && selected.pointId === this.stationPointId ? (selected.pointName || selected.pointId) : ''
},
canSubmit() {
return !!(this.warehouseId && this.trayCode && this.stationPointId)
}
},
watch: {
trayCode: function() {
this.resetStationPoint()
this.loadStationPointOptions()
}
},
onLoad() {
this.loadWarehouseOptions()
},
methods: {
loadWarehouseOptions() {
var that = this
getWarehouseOptions().then(function(res) {
that.warehouseOptions = res.data || res.rows || []
}).catch(function() {
that.warehouseOptions = []
})
},
handleWarehouseChange(e) {
var index = Number(e.detail.value)
var selected = this.warehouseOptions[index]
if (!selected) return
this.warehouseIndex = index
this.warehouseId = selected.warehouseId
this.warehouseName = selected.warehouseName
this.resetStationPoint()
this.loadStationPointOptions()
},
loadStationPointOptions() {
var that = this
if (!this.warehouseId || !this.trayCode) {
this.stationPointOptions = []
return
}
getInboundStationPointOptions(this.warehouseId, this.trayCode).then(function(res) {
that.stationPointOptions = res.data || res.rows || []
if (that.stationPointOptions.length === 1) {
that.stationPointIndex = 0
that.stationPointId = that.stationPointOptions[0].pointId
that.stationPointName = that.stationPointOptions[0].pointName || that.stationPointOptions[0].pointId
}
}).catch(function() {
that.resetStationPoint()
that.stationPointOptions = []
})
},
handleStationPointChange(e) {
var index = Number(e.detail.value)
var selected = this.stationPointOptions[index]
if (!selected) return
this.stationPointIndex = index
this.stationPointId = selected.pointId
this.stationPointName = selected.pointName || selected.pointId
},
resetStationPoint() {
this.stationPointIndex = 0
this.stationPointId = ''
this.stationPointName = ''
this.stationPointOptions = []
},
submitEmptyTray() {
if (!this.canSubmit) {
this.$modal.msg('请补全仓库、托盘号和入库点位')
return
}
var data = {
warehouseId: this.warehouseId,
trayCode: this.trayCode,
stationPointId: this.stationPointId
}
var that = this
this.$modal.confirm('是否确认生成空托入库作业?').then(function() {
that.submitting = true
return submitEmptyTrayInbound(data)
}).then(function(res) {
that.$modal.msgSuccess(res.msg || '空托入库作业生成成功')
that.resetPayload()
}).catch(function() {}).finally(function() {
that.submitting = false
})
},
resetPayload() {
this.trayCode = ''
this.stationPointOptions = []
this.resetStationPoint()
}
}
}
</script>
<style lang="scss" scoped>
page {
background-color: #f5f7fa;
min-height: 100%;
}
.page-container {
padding: 24rpx;
padding-bottom: 60rpx;
}
.form-section,
.summary-section {
background: #fff;
border-radius: 16rpx;
padding: 28rpx;
margin-bottom: 24rpx;
box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.04);
}
.form-title {
display: block;
font-size: 30rpx;
font-weight: 500;
color: #333;
margin-bottom: 24rpx;
padding-bottom: 16rpx;
border-bottom: 1rpx solid #f0f0f0;
}
.form-item {
display: flex;
align-items: center;
padding: 16rpx 0;
}
.form-label {
width: 160rpx;
flex-shrink: 0;
font-size: 28rpx;
color: #666;
}
.form-input,
.form-picker {
flex: 1;
width: 0;
min-width: 0;
box-sizing: border-box;
}
.form-input,
.picker-value {
width: 100%;
min-height: 72rpx;
padding: 16rpx;
border: 1rpx solid #e8e8e8;
border-radius: 8rpx;
background: #fff;
font-size: 28rpx;
color: #333;
box-sizing: border-box;
}
.picker-value.placeholder {
color: #c0c4cc;
}
.form-tip {
padding: 8rpx 0 16rpx 160rpx;
font-size: 24rpx;
color: #909399;
line-height: 1.4;
}
.summary-row {
display: flex;
justify-content: space-between;
padding: 12rpx 0;
}
.summary-label {
font-size: 26rpx;
color: #999;
}
.summary-value {
font-size: 26rpx;
color: #333;
}
.summary-value.muted {
color: #52c41a;
}
.btn-section {
padding: 8rpx 0 24rpx;
}
.btn {
font-size: 30rpx;
border-radius: 12rpx;
margin-bottom: 20rpx;
}
.btn-primary {
background: #1890ff;
color: #fff;
}
.btn-primary[disabled] {
background: #b0d4f5;
color: #fff;
}
.btn-default {
background: #fff;
color: #666;
border: 1rpx solid #d9d9d9;
}
</style>

View File

@@ -15,14 +15,14 @@
<uni-icons type="right" size="18" color="#ccc"></uni-icons>
</view>
<view class="menu-card" @click="navigateTo('/pages/warehouse/inbound/supply')">
<view class="menu-card" @click="navigateTo('/pages/warehouse/inbound/emptyTray')">
<view class="card-left">
<view class="card-icon green">
<uni-icons type="plus" size="24" color="#fff"></uni-icons>
<view class="card-icon cyan">
<uni-icons type="paperplane" size="24" color="#fff"></uni-icons>
</view>
<view class="card-info">
<text class="card-title">补料入库</text>
<text class="card-desc">产线补料申请入库操作</text>
<text class="card-title">空托盘入库</text>
<text class="card-desc">选择仓库、扫描托盘并选择入库点位</text>
</view>
</view>
<uni-icons type="right" size="18" color="#ccc"></uni-icons>
@@ -118,10 +118,6 @@
return item.documentDat || item.createDate || item.createDat || '-'
},
handleTask(item) {
if (item.type === 'supply') {
this.$tab.navigateTo('/pages/warehouse/inbound/supply?taskNo=' + (item.taskNo || ''))
return
}
var params = []
if (item.stockinId) params.push('stockinId=' + encodeURIComponent(item.stockinId))
if (item.warehouseId) params.push('warehouseId=' + encodeURIComponent(item.warehouseId))
@@ -178,8 +174,8 @@
background: linear-gradient(135deg, #1890ff, #40a9ff);
}
.card-icon.green {
background: linear-gradient(135deg, #52c41a, #73d13d);
.card-icon.cyan {
background: linear-gradient(135deg, #13c2c2, #36cfc9);
}
.card-info {

View File

@@ -1,318 +0,0 @@
<template>
<view class="page-container">
<!-- 任务信息 -->
<view class="task-info" v-if="taskNo">
<text class="task-label">任务编号</text>
<text class="task-value">{{ taskNo }}</text>
</view>
<!-- 扫码区域 -->
<view class="scan-section">
<view class="scan-header">
<text class="scan-title">扫描物料条码</text>
<view class="scan-btn" @click="startScan">
<uni-icons type="scan" size="18" color="#52c41a"></uni-icons>
<text class="scan-btn-text green">扫码</text>
</view>
</view>
<view class="input-wrap">
<input class="scan-input" v-model="barcode" placeholder="请输入或扫描物料条码"
@confirm="handleBarcode" focus />
</view>
</view>
<!-- 补料信息 -->
<view class="form-section">
<text class="form-title">补料信息</text>
<view class="form-item">
<text class="form-label">产线</text>
<input class="form-input" v-model="form.lineCode" placeholder="请输入产线编码" />
</view>
<view class="form-item">
<text class="form-label">工位</text>
<input class="form-input" v-model="form.stationCode" placeholder="请输入工位编码" />
</view>
<view class="form-item">
<text class="form-label">补料数量</text>
<input class="form-input" v-model="form.quantity" type="number" placeholder="请输入补料数量" />
</view>
<view class="form-item">
<text class="form-label">补料原因</text>
<input class="form-input" v-model="form.reason" placeholder="请输入补料原因" />
</view>
</view>
<!-- 物料信息 -->
<view class="form-section" v-if="materialInfo">
<text class="form-title">物料信息</text>
<view class="info-row">
<text class="info-label">物料编码</text>
<text class="info-value">{{ materialInfo.materialCode }}</text>
</view>
<view class="info-row">
<text class="info-label">物料名称</text>
<text class="info-value">{{ materialInfo.materialName }}</text>
</view>
<view class="info-row">
<text class="info-label">规格型号</text>
<text class="info-value">{{ materialInfo.spec }}</text>
</view>
<view class="info-row">
<text class="info-label">当前库存</text>
<text class="info-value">{{ materialInfo.stock }}</text>
</view>
</view>
<!-- 操作按钮 -->
<view class="btn-section">
<button class="btn btn-success" @click="submitSupply">确认补料入库</button>
<button class="btn btn-default" @click="resetForm">重置</button>
</view>
</view>
</template>
<script>
import { getMaterialByBarcode, submitSupplyInbound } from '@/api/warehouse/inbound'
export default {
data() {
return {
taskNo: '',
barcode: '',
materialInfo: null,
form: {
lineCode: '',
stationCode: '',
quantity: '',
reason: ''
}
}
},
onLoad(options) {
if (options.taskNo) {
this.taskNo = options.taskNo
}
},
methods: {
startScan() {
var that = this
uni.scanCode({
onlyFromCamera: false,
scanType: ['barCode', 'qrCode'],
success: function(res) {
that.barcode = res.result
that.handleBarcode()
}
})
},
handleBarcode() {
if (!this.barcode) {
this.$modal.msg('请输入物料条码')
return
}
var that = this
getMaterialByBarcode(this.barcode).then(function(res) {
that.materialInfo = res.data
that.$modal.msgSuccess('物料信息获取成功')
}).catch(function() {
that.materialInfo = null
})
},
submitSupply() {
if (!this.barcode) {
this.$modal.msg('请输入物料条码')
return
}
if (!this.form.lineCode) {
this.$modal.msg('请输入产线编码')
return
}
if (!this.form.quantity) {
this.$modal.msg('请输入补料数量')
return
}
var data = {
taskNo: this.taskNo,
barcode: this.barcode,
lineCode: this.form.lineCode,
stationCode: this.form.stationCode,
quantity: this.form.quantity,
reason: this.form.reason
}
var that = this
submitSupplyInbound(data).then(function() {
that.$modal.msgSuccess('补料入库成功')
that.resetForm()
})
},
resetForm() {
this.barcode = ''
this.materialInfo = null
this.form = {
lineCode: '',
stationCode: '',
quantity: '',
reason: ''
}
}
}
}
</script>
<style lang="scss" scoped>
page {
background-color: #f5f7fa;
min-height: 100%;
}
.page-container {
padding: 24rpx;
}
.task-info {
background: #f6ffed;
border-radius: 12rpx;
padding: 20rpx 24rpx;
margin-bottom: 24rpx;
display: flex;
justify-content: space-between;
align-items: center;
}
.task-label {
font-size: 26rpx;
color: #52c41a;
}
.task-value {
font-size: 26rpx;
color: #333;
font-weight: 500;
}
.scan-section {
background: #fff;
border-radius: 16rpx;
padding: 28rpx;
margin-bottom: 24rpx;
box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.04);
}
.scan-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 20rpx;
}
.scan-title {
font-size: 30rpx;
font-weight: 500;
color: #333;
}
.scan-btn {
display: flex;
align-items: center;
padding: 8rpx 20rpx;
border: 1rpx solid #52c41a;
border-radius: 8rpx;
}
.scan-btn-text {
font-size: 24rpx;
color: #1890ff;
margin-left: 8rpx;
}
.scan-btn-text.green {
color: #52c41a;
}
.input-wrap {
border: 1rpx solid #e8e8e8;
border-radius: 8rpx;
padding: 4rpx;
}
.scan-input {
font-size: 28rpx;
padding: 16rpx;
}
.form-section {
background: #fff;
border-radius: 16rpx;
padding: 28rpx;
margin-bottom: 24rpx;
box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.04);
}
.form-title {
font-size: 30rpx;
font-weight: 500;
color: #333;
margin-bottom: 24rpx;
padding-bottom: 16rpx;
border-bottom: 1rpx solid #f0f0f0;
}
.form-item {
display: flex;
align-items: center;
padding: 16rpx 0;
}
.form-label {
font-size: 28rpx;
color: #666;
width: 160rpx;
flex-shrink: 0;
}
.form-input {
flex: 1;
font-size: 28rpx;
border: 1rpx solid #e8e8e8;
border-radius: 8rpx;
padding: 16rpx;
}
.info-row {
display: flex;
justify-content: space-between;
padding: 16rpx 0;
border-bottom: 1rpx solid #f5f5f5;
}
.info-label {
font-size: 28rpx;
color: #999;
}
.info-value {
font-size: 28rpx;
color: #333;
}
.btn-section {
padding: 24rpx 0;
}
.btn {
font-size: 30rpx;
border-radius: 12rpx;
margin-bottom: 20rpx;
}
.btn-success {
background: #52c41a;
color: #fff;
}
.btn-default {
background: #fff;
color: #666;
border: 1rpx solid #d9d9d9;
}
</style>