Browse Source

2025-11-03

pda属性变动优化
master
fengyuan_yang 2 months ago
parent
commit
a4fdc08918
  1. 53
      src/views/modules/property-change/propertyChange.vue

53
src/views/modules/property-change/propertyChange.vue

@ -34,6 +34,16 @@
<span class="info-value">{{ stockInfo.qtyOnHand || '' }}</span>
</div>
<div class="info-row">
<span class="info-label">物料编码</span>
<span class="info-value">{{ stockInfo.partNo || '' }}</span>
</div>
<div class="info-row">
<span class="info-label">物料名称</span>
<span class="info-value">{{ stockInfo.partDesc || '' }}</span>
</div>
<div class="info-row">
<span class="info-label">所在仓库</span>
<span class="info-value">{{ stockInfo.warehouseName || '' }}</span>
@ -53,7 +63,16 @@
<div class="info-row">
<span class="info-label">标签状态</span>
<span class="info-value" :class="stockInfo.status === '冻结' ? 'status-frozen' : 'status-normal'">{{ stockInfo.status || '' }}</span>
<div class="input-wrapper">
<el-select
v-model="newStatus"
placeholder="请选择状态"
class="status-select"
>
<el-option label="在库" value="在库"></el-option>
<el-option label="冻结" value="冻结"></el-option>
</el-select>
</div>
</div>
<div class="info-row">
@ -123,6 +142,7 @@ export default {
scanCode: '',
stockInfo: {},
newLocationId: '',
newStatus: '',
newProductionDate: '',
newExpiryDate: ''
};
@ -149,9 +169,10 @@ export default {
this.stockInfo = data.data;
//
this.newLocationId = this.stockInfo.locationId || '';
this.newStatus = this.stockInfo.status || '';
this.newProductionDate = this.stockInfo.productionDate ? moment(this.stockInfo.productionDate).format('YYYY-MM-DD') : '';
this.newExpiryDate = this.stockInfo.expiryDate ? moment(this.stockInfo.expiryDate).format('YYYY-MM-DD') : '';
this.$message.success('获取标签信息成功');
this.$message.success('操作成功!');
} else {
this.$message.error(data.msg || '未找到该标签的库存信息');
this.stockInfo = {};
@ -175,6 +196,15 @@ export default {
return;
}
// """"
const oldStatus = this.stockInfo.status || '';
const hasStatusChange = this.newStatus !== oldStatus;
if (hasStatusChange && oldStatus !== '在库' && oldStatus !== '冻结') {
this.$message.error(`该标签状态为"${oldStatus}",不允许修改`);
return;
}
//
const oldLocationId = this.stockInfo.locationId || '';
const oldProductionDate = this.stockInfo.productionDate ? moment(this.stockInfo.productionDate).format('YYYY-MM-DD') : '';
@ -184,7 +214,7 @@ export default {
const hasProductionDateChange = this.newProductionDate !== oldProductionDate;
const hasExpiryDateChange = this.newExpiryDate !== oldExpiryDate;
if (!hasLocationChange && !hasProductionDateChange && !hasExpiryDateChange) {
if (!hasLocationChange && !hasProductionDateChange && !hasExpiryDateChange && !hasStatusChange) {
this.$message.warning('没有检测到属性变动,请修改后再提交');
return;
}
@ -200,6 +230,8 @@ export default {
quantity: this.stockInfo.qtyOnHand,
oldLocationId: oldLocationId,
newLocationId: this.newLocationId,
oldStatus: oldStatus,
newStatus: this.newStatus,
oldProductionDate: oldProductionDate,
newProductionDate: this.newProductionDate,
oldExpiryDate: oldExpiryDate,
@ -211,6 +243,9 @@ export default {
if (hasLocationChange) {
changeMsg += `库位: ${oldLocationId}${this.newLocationId}\n`;
}
if (hasStatusChange) {
changeMsg += `状态: ${oldStatus}${this.newStatus}\n`;
}
if (hasProductionDateChange) {
changeMsg += `生产日期: ${oldProductionDate}${this.newProductionDate}\n`;
}
@ -267,6 +302,7 @@ export default {
resetForm() {
this.stockInfo = {};
this.newLocationId = '';
this.newStatus = '';
this.newProductionDate = '';
this.newExpiryDate = '';
@ -410,6 +446,17 @@ export default {
padding: 8px 12px;
}
.status-select {
width: 100%;
}
.status-select ::v-deep .el-input__inner {
border: 1px solid #17B3A3;
border-radius: 4px;
font-size: 14px;
padding: 8px 12px;
}
/* 底部操作按钮 */
.bottom-actions {
display: flex;

Loading…
Cancel
Save