Browse Source

2025-08-26 pda销售退货优化

master
fengyuan_yang 5 months ago
parent
commit
6398668391
  1. 4
      src/router/index.js
  2. 2
      src/views/modules/production/productionInboundStorage.vue
  3. 3
      src/views/modules/purchase-inbound/inboundStorage.vue
  4. 2
      src/views/modules/sales-return/salesReturnList.vue
  5. 67
      src/views/modules/sales-return/salesReturnStorage.vue

4
src/router/index.js

@ -36,7 +36,7 @@ const globalRoutes = [
{ path: "/salesReturn", name: "salesReturn", component: resolve => require(["@/views/modules/sales-return/sales-return.vue"], resolve), meta: { transition: 'instant', preload: true, keepAlive: true } }, { path: "/salesReturn", name: "salesReturn", component: resolve => require(["@/views/modules/sales-return/sales-return.vue"], resolve), meta: { transition: 'instant', preload: true, keepAlive: true } },
{ path: "/salesReturnList", name: "salesReturnList", component: resolve => require(["@/views/modules/sales-return/salesReturnList.vue"], resolve), meta: { transition: 'instant', preload: true, keepAlive: true } }, { path: "/salesReturnList", name: "salesReturnList", component: resolve => require(["@/views/modules/sales-return/salesReturnList.vue"], resolve), meta: { transition: 'instant', preload: true, keepAlive: true } },
{ {
path: "/salesReturnStorage/:returnNo/:partNo/:buNo", name: "SalesReturnStorage",
path: "/salesReturnStorage/:returnNo/:buNo", name: "SalesReturnStorage",
component: resolve => require(["@/views/modules/sales-return/salesReturnStorage.vue"], resolve), meta: { transition: 'instant', preload: true, keepAlive: true } component: resolve => require(["@/views/modules/sales-return/salesReturnStorage.vue"], resolve), meta: { transition: 'instant', preload: true, keepAlive: true }
}, },
@ -44,7 +44,7 @@ const globalRoutes = [
{ path: "/productionissue", name: "productionissue", component: resolve => require(["@/views/modules/production-issue/productionIssuePda.vue"], resolve), meta: { transition: 'instant', preload: true, keepAlive: true } }, { path: "/productionissue", name: "productionissue", component: resolve => require(["@/views/modules/production-issue/productionIssuePda.vue"], resolve), meta: { transition: 'instant', preload: true, keepAlive: true } },
// 生产领料 // 生产领料
{ path: "/production", name: "salesReturn", component: resolve => require(["@/views/modules/production-pick/production.vue"], resolve), meta: { transition: 'instant', preload: true, keepAlive: true } },
{ path: "/production", name: "production", component: resolve => require(["@/views/modules/production-pick/production.vue"], resolve), meta: { transition: 'instant', preload: true, keepAlive: true } },
{ path: "/productionPicking", name: "productionPicking", component: resolve => require(["@/views/modules/production-pick/productionPicking.vue"], resolve), meta: { transition: 'instant', preload: true, keepAlive: true } }, { path: "/productionPicking", name: "productionPicking", component: resolve => require(["@/views/modules/production-pick/productionPicking.vue"], resolve), meta: { transition: 'instant', preload: true, keepAlive: true } },
{ path: "/productionPickingDetail/:buNo/:outboundNo", name: "productionPickingDetail", component: resolve => require(["@/views/modules/production-pick/productionPickingDetail.vue"], resolve), meta: { transition: 'instant', preload: true, keepAlive: true } }, { path: "/productionPickingDetail/:buNo/:outboundNo", name: "productionPickingDetail", component: resolve => require(["@/views/modules/production-pick/productionPickingDetail.vue"], resolve), meta: { transition: 'instant', preload: true, keepAlive: true } },

2
src/views/modules/production/productionInboundStorage.vue

@ -321,12 +321,10 @@ export default {
this.$message.warning('请输入库位号'); this.$message.warning('请输入库位号');
return; return;
} }
const params = { const params = {
site: this.materialInfo.site, site: this.materialInfo.site,
buNo: this.materialInfo.buNo, buNo: this.materialInfo.buNo,
inboundNo: this.inboundNo, inboundNo: this.inboundNo,
warehouseId: getCurrentWarehouse(),
locationCode: this.locationCode.trim(), locationCode: this.locationCode.trim(),
labels: this.labelList.map(label => ({ labels: this.labelList.map(label => ({
labelCode: label.labelCode, labelCode: label.labelCode,

3
src/views/modules/purchase-inbound/inboundStorage.vue

@ -323,10 +323,9 @@ export default {
return; return;
} }
const params = { const params = {
site:this.materialInfo.site,
site: this.materialInfo.site,
buNo: this.materialInfo.buNo, buNo: this.materialInfo.buNo,
inboundNo: this.inboundNo, inboundNo: this.inboundNo,
warehouseId: getCurrentWarehouse(),
locationCode: this.locationCode.trim(), locationCode: this.locationCode.trim(),
labels: this.labelList.map(label => ({ labels: this.labelList.map(label => ({
labelCode: label.labelCode, labelCode: label.labelCode,

2
src/views/modules/sales-return/salesReturnList.vue

@ -164,12 +164,12 @@ export default {
// 退 // 退
goToReturnDetail(item) { goToReturnDetail(item) {
console.log(item)
this.$router.push({ this.$router.push({
name: 'SalesReturnStorage', name: 'SalesReturnStorage',
params: { params: {
buNo: item.buNo, buNo: item.buNo,
returnNo: item.inboundNo, returnNo: item.inboundNo,
partNo: item.partNo
} }
}); });
} }

67
src/views/modules/sales-return/salesReturnStorage.vue

@ -33,7 +33,7 @@
</div> </div>
<!-- 物料信息卡片 --> <!-- 物料信息卡片 -->
<div class="material-info-card" v-if="materialInfo.partNo">
<div class="material-info-card" v-if="materialInfo.inboundNo">
<div class="card-title"> <div class="card-title">
<span class="title-label">退货单号</span> <span class="title-label">退货单号</span>
<span class="title-value">{{ materialInfo.inboundNo }}</span> <span class="title-value">{{ materialInfo.inboundNo }}</span>
@ -240,27 +240,28 @@ export default {
const params = { const params = {
labelCode: labelCode, labelCode: labelCode,
site: localStorage.getItem('site'), site: localStorage.getItem('site'),
buNo: this.materialInfo.buNo
}; };
validateLabelWithSalesReturn(params).then(({ data }) => { validateLabelWithSalesReturn(params).then(({ data }) => {
if (data && data.code === 0) { if (data && data.code === 0) {
const resultList = data.data;
// //
const exists = this.labelList.find(item => item.labelCode === labelCode); const exists = this.labelList.find(item => item.labelCode === labelCode);
if (exists) { if (exists) {
this.$message.warning('该标签已扫描,请勿重复扫描'); this.$message.warning('该标签已扫描,请勿重复扫描');
return; return;
} }
//
this.labelList.push({
id: Date.now(),
labelCode: labelCode,
partNo: data.data.partNo,
quantity: data.data.quantity,
batchNo: data.data.batchNo
//
resultList.forEach(result => {
this.labelList.push({
id: Date.now() + Math.random(), // ID
labelCode: result.labelCode,
partNo: result.partNo,
quantity: result.quantity,
batchNo: result.batchNo
});
}); });
this.$message.success('标签验证成功');
this.$message.success(`标签验证成功,共添加 ${resultList.length} 条记录`);
} else { } else {
this.$message.error(data.msg || '该标签不符合退货条件,请检查'); this.$message.error(data.msg || '该标签不符合退货条件,请检查');
} }
@ -312,40 +313,29 @@ export default {
this.$message.warning('请输入库位号'); this.$message.warning('请输入库位号');
return; return;
} }
const params = { const params = {
site:this.materialInfo.site, site:this.materialInfo.site,
buNo: this.materialInfo.buNo, buNo: this.materialInfo.buNo,
returnNo: this.returnNo, returnNo: this.returnNo,
partNo: this.partNo,
warehouseId: getCurrentWarehouse(),
locationCode: this.locationCode.trim(), locationCode: this.locationCode.trim(),
labels: this.labelList.map(label => ({ labels: this.labelList.map(label => ({
labelCode: label.labelCode, labelCode: label.labelCode,
quantity: label.quantity, quantity: label.quantity,
batchNo: label.batchNo
batchNo: label.batchNo,
partNo: label.partNo,
})) }))
}; };
this.$confirm(`确定将标签退货到库位 ${this.locationCode} 吗?`, '确认退货', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'info'
}).then(() => {
confirmSalesReturnStorage(params).then(({ data }) => {
if (data && data.code === 0) {
this.$message.success('退货成功');
this.showLocationDialog = false;
this.$router.back();
} else {
this.$message.error(data.msg || '退货失败');
}
}).catch(error => {
console.error('退货失败:', error);
this.$message.error('退货失败');
});
}).catch(() => {
//
confirmSalesReturnStorage(params).then(({ data }) => {
if (data && data.code === 0) {
this.$message.success('退货成功');
this.showLocationDialog = false;
this.$router.back();
} else {
this.$message.error(data.msg || '退货失败');
}
}).catch(error => {
console.error('退货失败:', error);
this.$message.error('退货失败');
}); });
}, },
@ -421,12 +411,10 @@ export default {
loadReturnDetails() { loadReturnDetails() {
const params = { const params = {
returnNo: this.returnNo, returnNo: this.returnNo,
partNo: this.partNo,
buNo: this.buNo, buNo: this.buNo,
warehouseId: getCurrentWarehouse(), warehouseId: getCurrentWarehouse(),
site:localStorage.getItem('site'), site:localStorage.getItem('site'),
}; };
getSalesReturnDetails(params).then(({ data }) => { getSalesReturnDetails(params).then(({ data }) => {
if (data && data.code === 0) { if (data && data.code === 0) {
this.materialInfo = data.data; this.materialInfo = data.data;
@ -445,8 +433,7 @@ export default {
this.returnNo = this.$route.params.returnNo; this.returnNo = this.$route.params.returnNo;
this.partNo = this.$route.params.partNo; this.partNo = this.$route.params.partNo;
this.buNo = this.$route.params.buNo; this.buNo = this.$route.params.buNo;
if (!this.returnNo || !this.partNo) {
this.$message.error('参数错误');
if (!this.returnNo ) {
this.$router.back(); this.$router.back();
return; return;
} }

Loading…
Cancel
Save