Browse Source

直接退料修改

master
shenzhouyu 2 months ago
parent
commit
1d31ac1779
  1. 6
      src/api/production/production-return.js
  2. 2
      src/router/index.js
  3. 2
      src/views/modules/production-return/production.vue
  4. 52
      src/views/modules/production-return/productionReturnIssueList.vue
  5. 4
      src/views/modules/production-return/productionReturnPDA.vue
  6. 40
      src/views/modules/production-return/productionReturnPDAIssueList.vue
  7. 69
      src/views/modules/production-return/productionReturnPicking.vue
  8. 927
      src/views/modules/production-return/productionReturnPickingDetail.vue

6
src/api/production/production-return.js

@ -1,6 +1,7 @@
import { createAPI } from "@/utils/httpRequest.js";
//直接退料接口
export const productionReturnConfirm = data => createAPI(`/pda/production/return/productionReturnConfirm`,'post',data)
// 获取工单信息
export const getReturnWorkOrderInfo = data => createAPI(`/pda/production/return/getReturnWorkOrderInfo`,'post',data)
@ -24,4 +25,7 @@ export const getUnissueMatericalForShopOrder = data => createAPI(`/pda/productio
export const scanMaterialLabel = data => createAPI(`/pda/production/return/scanMaterialLabel`,'post',data)
export const productionReturnUnissueConfirm = data => createAPI(`/pda/production/return/productionReturnUnissueConfirm`,'post',data)
export const printLabelInfo = data => createAPI('/label/setting/printLabel','post',data)
export const printLabelInfo = data => createAPI('/label/setting/printLabel','post',data)
// 打印标签
export const printLabelCommon = data => createAPI('/label/setting/printLabelCommon','post',data)

2
src/router/index.js

@ -56,7 +56,7 @@ const globalRoutes = [
{path: "/productionreturn",name: "productionreturn", component: resolve => require(["@/views/modules/production-return/production.vue"], resolve), meta: { transition: 'instant' ,preload: true,keepAlive: true}},
{path: "/productionReturnPicking", name: "productionReturnPicking", component: resolve => require(["@/views/modules/production-return/productionReturnPicking.vue"], resolve), meta: { transition: 'instant', preload: true, keepAlive: true } },
{path: "/productionReturnIssueList", name: "productionReturnIssueList", component: resolve => require(["@/views/modules/production-return/productionReturnIssueList.vue"], resolve), meta: { transition: 'instant', preload: true, keepAlive: true } },
{path: "/productionReturnPickingDetail/:orderNo/:orderType/:partNo/:transactionId/:quantity/:batchNo", name: "productionReturnPickingDetail", component: resolve => require(["@/views/modules/production-return/productionReturnPickingDetail.vue"], resolve), meta: { transition: 'instant', preload: true, keepAlive: true } },
{path: "/productionReturnPickingDetail", name: "productionReturnPickingDetail", component: resolve => require(["@/views/modules/production-return/productionReturnPickingDetail.vue"], resolve), meta: { transition: 'instant', preload: true, keepAlive: true } },
{path: "/productionReturnPDA", name: "productionReturnPDA", component: resolve => require(["@/views/modules/production-return/productionReturnPDA.vue"], resolve), meta: { transition: 'instant', preload: true, keepAlive: false } },
{path: "/productionReturnPDAList", name: "productionReturnPDAList", component: resolve => require(["@/views/modules/production-return/productionReturnPDAList.vue"], resolve), meta: { transition: 'instant', preload: true, keepAlive: true } },
{path: "/productionReturnPDAIssueList", name: "productionReturnPDAIssueList", component: resolve => require(["@/views/modules/production-return/productionReturnPDAIssueList.vue"], resolve), meta: { transition: 'instant', preload: true, keepAlive: true } },

2
src/views/modules/production-return/production.vue

@ -31,7 +31,7 @@ export default {
data() {
return {
buttons: [
{ icon: 'scan', label: '直接退料', iconClass: 'direct', to: 'productionReturnPicking', disabled: true },
{ icon: 'scan', label: '直接退料', iconClass: 'direct', to: 'productionReturnPicking', disabled: false },
{ icon: 'records', label: '申请单退料', iconClass: 'request', to: 'productionReturnPDA', disabled: false },
{ icon: 'logistics', label: '移库退料', iconClass: 'move', to: 'productionReturnPicking', disabled: true },
{ icon: 'revoke', label: '退料撤销', iconClass: 'cancel', to: 'productionReturnPicking', disabled: true },

52
src/views/modules/production-return/productionReturnIssueList.vue

@ -2,12 +2,26 @@
<div class="pda-container">
<!-- 头部栏 -->
<div class="header-bar">
<div class="header-left" @click="$router.back()">
<div class="header-left" @click="handleBack">
<i class="el-icon-arrow-left"></i>
<span>退 - 领料记录</span>
<span>退 - 领料记录</span>
</div>
<div class="header-right" @click="$router.push({ path: '/' })">首页</div>
</div>
<div class="search-container">
<div class="card-title">
<label class="title-label">工单号:{{ workOrderNo }}</label>
</div>
<div class="card-title">
<label class="title-label">行号:{{ lineItemNo }}</label>
</div>
<div class="card-title">
<label class="title-label">物料编码:{{ componentPartNo }}</label>
</div>
<!-- <div class="card-title">
<label class="title-label">退料数量:{{ unissureQty }}</label>
</div> -->
</div>
<div class="content-area">
<div class="work-order-list" v-if="issueList.length > 0">
@ -19,7 +33,7 @@
>
<div class="card-title">
<span class="title-label">
物料编码{{ partNo }} &nbsp;&nbsp; 领料号{{ item.TRANSACTION_ID }}
物料编码{{ item.PART_NO }} &nbsp;&nbsp; 领料号{{ item.TRANSACTION_ID }}
</span>
</div>
<div class="part-desc-row">
@ -63,20 +77,23 @@ export default {
return {
workOrderNo: '',
partNo: '',
componentPartNo: '',
loading: false,
issueList: [],
componentPartDesc: '',
lineItemNo: '',
};
},
methods: {
loadIssueList() {
if (!this.workOrderNo || !this.partNo) {
if (!this.workOrderNo) {
return;
}
this.loading = true;
const params = {
workOrderNo: this.workOrderNo,
site: localStorage.getItem('site'),
partNo: this.partNo,
componentPartNo: this.componentPartNo,
};
getIssueForShopOrder(params)
.then(({ data }) => {
@ -93,23 +110,36 @@ export default {
this.$message.error('获取领料记录失败');
});
},
handleBack() {
// productionReturnPicking
sessionStorage.setItem('productionReturnPicking_shouldRestore', 'true');
this.$router.back();
},
goDetail(item) {
this.$router.push({
name: 'productionReturnPickingDetail',
params: {
query: {
orderNo: this.workOrderNo,
orderType: 'workOrder',
partNo: this.partNo,
componentPartNo: this.componentPartNo,
transactionId: item.TRANSACTION_ID,
accountingId: item.ACCOUNTING_ID,
quantity: item.QUANTITY,
qtyReversed: item.QTY_REVERSED,
batchNo: item.LOT_BATCH_NO,
lineItemNo: this.lineItemNo,
componentPartDesc: this.componentPartDesc,
},
});
},
},
mounted() {
this.workOrderNo = this.$route.params.workOrderNo;
this.partNo = this.$route.params.partNo;
console.log("lineItemNo",this.$route.query);
this.workOrderNo = this.$route.query.workOrderNo;
this.componentPartNo = this.$route.query.componentPartNo;
this.componentPartDesc = this.$route.query.componentPartDesc;
this.lineItemNo = this.$route.query.lineItemNo;
this.loadIssueList();
},
};
@ -121,8 +151,8 @@ export default {
.header-left { display: flex; align-items: center; cursor: pointer; font-size: 16px; font-weight: 500; }
.header-left i { margin-right: 8px; font-size: 18px; }
.header-right { cursor: pointer; font-size: 16px; font-weight: 500; }
.content-area { flex: 1; overflow-y: auto; padding: 12px 16px; }
.work-order-list { overflow-y: auto; padding: 12px 16px; }
.content-area { flex: 1; overflow-y: auto; }
.work-order-list { overflow-y: auto;}
.material-card { background: white; border-radius: 8px; margin-bottom: 12px; padding: 16px; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); cursor: pointer; transition: all 0.2s ease; border: 2px solid transparent; }
.material-card:hover { box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15); transform: translateY(-1px); }
.material-card:active { transform: translateY(0); }

4
src/views/modules/production-return/productionReturnPDA.vue

@ -11,7 +11,7 @@
<!-- 申请单输入 -->
<div class="search-container">
<el-input clearable v-model="requestReturnForm.requestNo" placeholder="请输入退料申请单号" prefix-icon="el-icon-search"
<el-input clearable v-model="requestReturnForm.requestNo" placeholder="请输入单号" prefix-icon="el-icon-search"
@keyup.enter.native="loadReturnRequestMaterials" ref="requestNoInput" />
</div>
@ -178,7 +178,7 @@ export default {
getUnissueNotifyHeaderInfo({
site: localStorage.getItem('site'),
notifyNo: this.requestReturnForm.requestNo,
orderNo: this.requestReturnForm.requestNo,
}).then(({ data }) => {
if (data.code === 0) {
console.log(data)

40
src/views/modules/production-return/productionReturnPDAIssueList.vue

@ -4,7 +4,7 @@
<div class="header-bar">
<div class="header-left" @click="$router.back()">
<i class="el-icon-arrow-left"></i>
<span>生产退料成功</span>
<span>生产申请单退料</span>
</div>
<div class="header-right" @click="$router.push({ path: '/' })">首页</div>
</div>
@ -553,10 +553,11 @@ export default {
.then(({ data }) => {
if (data.code === 0 && data) {
this.$message.success('生产退料成功')
this.printViaServer()
this.$router.push({
name: 'productionReturnPDA',
})
const unitIds = data.unitIds || [];
if (unitIds.length > 0) {
this.printViaServer(unitIds);
}
this.$router.back()
this.loading = false
} else {
this.$message.error(data.message || '操作失败')
@ -570,6 +571,35 @@ export default {
})
},
async printViaServer(unitIds) {
if (!unitIds || unitIds.length === 0) {
console.warn('没有可打印的标签');
return;
}
this.$emit('print-start')
try {
const printRequest = {
userId: localStorage.getItem('userName'),
username: localStorage.getItem('userName'),
site: localStorage.getItem('site'),
unitIds: unitIds,
labelType: "BIL标签"
}
console.log('打印请求:', printRequest);
const { data } = await printLabelCommon(printRequest)
if (data.code === 200 || data.code === 0) {
this.$message.success(`打印任务已发送!共${unitIds.length}个标签`)
} else {
this.$message.error(data.msg || '打印失败')
}
} catch (error) {
console.error('服务器打印失败:', error)
this.$message.error(`打印失败: ${error.message || error}`)
}
},
async printViaServer(unitId) {
try {
const printRequest = {

69
src/views/modules/production-return/productionReturnPicking.vue

@ -4,7 +4,7 @@
<div class="header-bar">
<div class="header-left" @click="$router.back()">
<i class="el-icon-arrow-left"></i>
<span>生产退料</span>
<span>直接退料</span>
</div>
<div class="header-right" @click="$router.push({ path: '/' })">
首页
@ -24,7 +24,7 @@
</div>
<!-- 工单信息卡片列表 -->
<div class="work-order-list" v-if="workOrderList.length > 0">
<!-- <div class="work-order-list" v-if="workOrderList.length > 0">
<div
v-for="(workOrder, index) in workOrderList"
:key="index"
@ -38,8 +38,6 @@
<div class="part-desc-row">
<span class="title-value">{{ workOrder.partNo }}</span>
</div>
<!-- 物料描述单独一行 -->
<div class="part-desc-row">
<span class="desc-text">{{ workOrder.partDesc }}</span>
</div>
@ -59,7 +57,7 @@
</div>
</div>
</div>
</div>
</div> -->
<!-- 材料列表新增仿 directIssue.vue -->
<div
@ -72,10 +70,14 @@
class="material-card"
@click="openIssueList(material)"
>
<div class="card-title">
<span class="title-label">工单号{{ material.orderNo }}</span>
</div>
<div class="card-title">
<span class="title-label"
>物料编码{{ material.componentPartNo }} &nbsp;&nbsp; 行号{{
material.lineNo || index + 1
material.lineItemNo
}}</span
>
</div>
@ -121,7 +123,7 @@
<script>
import { getWorkOrderMaterials } from '@/api/production/production-issue';
import { getReturnWorkOrderInfo,getIssueForShopOrder } from '@/api/production/production-return';
import { getReturnWorkOrderInfo } from '@/api/production/production-return';
import moment from 'moment';
export default {
@ -139,6 +141,37 @@ export default {
formatDate(date) {
return date ? moment(date).format('YYYY-MM-DD') : '';
},
// sessionStorage
savePageStateForIssueList() {
const state = {
workOrderNo: this.workOrderNo,
workOrderList: this.workOrderList,
selectedWorkOrder: this.selectedWorkOrder,
materialList: this.materialList,
};
sessionStorage.setItem('productionReturnPicking_state_fromIssueList', JSON.stringify(state));
},
// sessionStorage
restorePageStateFromIssueList() {
try {
const shouldRestore = sessionStorage.getItem('productionReturnPicking_shouldRestore');
const savedState = sessionStorage.getItem('productionReturnPicking_state_fromIssueList');
if (shouldRestore === 'true' && savedState) {
const state = JSON.parse(savedState);
this.workOrderNo = state.workOrderNo || "";
this.workOrderList = state.workOrderList || [];
this.selectedWorkOrder = state.selectedWorkOrder || null;
this.materialList = state.materialList || [];
//
sessionStorage.removeItem('productionReturnPicking_shouldRestore');
sessionStorage.removeItem('productionReturnPicking_state_fromIssueList');
}
} catch (e) {
//
sessionStorage.removeItem('productionReturnPicking_shouldRestore');
sessionStorage.removeItem('productionReturnPicking_state_fromIssueList');
}
},
//
handleSearchWorkOrder() {
if (!this.workOrderNo.trim()) {
@ -161,11 +194,14 @@ export default {
data.workOrders.length > 0 &&
data.code === 0
) {
this.workOrderList = data.workOrders;
this.selectedWorkOrder = null;
//
const firstWorkOrder = data.workOrders[0];
this.selectedWorkOrder = firstWorkOrder;
this.workOrderList = [];
this.materialList = [];
this.loadMaterialList();
} else {
this.$message.error("未找到该工单信息");
this.$message.error(data.msg);
this.workOrderList = [];
this.selectedWorkOrder = null;
this.materialList = [];
@ -173,8 +209,7 @@ export default {
})
.catch((error) => {
this.loading = false;
console.error("查询工单信息失败:", error);
this.$message.error("查询工单信息失败");
this.$message.error(error.msg);
});
},
@ -216,11 +251,15 @@ export default {
//
openIssueList(material) {
//
this.savePageStateForIssueList();
this.$router.push({
name: 'productionReturnIssueList',
params: {
query: {
workOrderNo: this.selectedWorkOrder.orderNo,
partNo: material.componentPartNo,
componentPartNo: material.componentPartNo,
componentPartDesc: material.componentPartDesc,
lineItemNo: material.lineItemNo,
},
});
},
@ -228,6 +267,8 @@ export default {
},
mounted() {
//
this.restorePageStateFromIssueList();
//
this.$nextTick(() => {
if (this.$refs.workOrderInput) {

927
src/views/modules/production-return/productionReturnPickingDetail.vue
File diff suppressed because it is too large
View File

Loading…
Cancel
Save