Browse Source

海安pda生产发料和退料

dev
shenzhouyu 3 months ago
parent
commit
133fe29837
  1. 24
      src/views/modules/production-issue/directIssue.vue
  2. 6
      src/views/modules/production-issue/directIssueDetail.vue
  3. 30
      src/views/modules/production-issue/directIssueNoMaterial.vue
  4. 6
      src/views/modules/production-issue/directIssueNoMaterialDetail.vue
  5. 61
      src/views/modules/production-issue/production.vue
  6. 62
      src/views/modules/production-return/production.vue
  7. 7
      src/views/modules/production-return/productionReturnIssueList.vue
  8. 20
      src/views/modules/production-return/productionReturnPicking.vue
  9. 14
      src/views/modules/production-return/productionReturnPickingDetail.vue

24
src/views/modules/production-issue/directIssue.vue

@ -138,6 +138,7 @@ import {
getWorkOrderMaterials,
getShopOrderLine,
} from "@/api/production/production-issue";
import { filterRowsByAuthorizedSubSite, getAuthorizedSubSiteCodeList } from "@/utils/subSiteAuth.js";
import moment from "moment";
export default {
@ -229,7 +230,7 @@ export default {
workOrderNo: this.workOrderNo.trim(),
releaseNo: (this.releaseNo || "*").trim() || "*",
sequenceNo: (this.sequenceNo || "*").trim() || "*",
site: localStorage.getItem('site'),
site: localStorage.getItem('site')+'%',
};
getWorkOrderInfo(params)
@ -277,7 +278,7 @@ export default {
this.loading = true;
const params = {
workOrderNo: this.workOrderNo.trim(),
site: localStorage.getItem('site'),
site: localStorage.getItem('site')+'%',
};
getShopOrderLine(params)
@ -285,17 +286,19 @@ export default {
this.loading = false;
console.log("工单信息", data);
if (
data.workOrders &&
data.workOrders.length > 0 &&
data.code === 0
) {
this.workOrderList = data.workOrders;
if (data.code === 0) {
const sourceRows = data.workOrders || [];
const authorizedSubSiteCodeList = getAuthorizedSubSiteCodeList(this.$store.state.user.subSiteCodeList);
// 接口按site前缀查询会返回同前缀下的所有子site,这里按当前用户授权子site做二次过滤
this.workOrderList = filterRowsByAuthorizedSubSite(sourceRows, authorizedSubSiteCodeList, ['contract']);
this.selectedWorkOrder = null;
this.materialList = [];
this.showOnlySelected = false;
if (this.workOrderList.length === 0) {
this.$message.error(data.msg || "未找到该工单信息");
}
} else {
this.$message.error(data.msg ||"未找到该工单信息");
this.$message.error(data.msg || "未找到该工单信息");
this.workOrderList = [];
this.selectedWorkOrder = null;
this.materialList = [];
@ -347,7 +350,7 @@ export default {
const params = {
workOrderNo: this.selectedWorkOrder.orderNo,
site: localStorage.getItem('site'),
site: this.selectedWorkOrder.contract,
releaseNo: (this.selectedWorkOrder.releaseNo || "*").trim() || "*",
sequenceNo: (this.selectedWorkOrder.sequenceNo || "*").trim() || "*",
};
@ -392,6 +395,7 @@ export default {
requiredQty: material.qtyRequired,
issuedQty: material.qtyIssued || 0,
partDesc: material.componentPartDesc,
site: this.selectedWorkOrder.contract,
}
});
},

6
src/views/modules/production-issue/directIssueDetail.vue

@ -176,6 +176,7 @@ export default {
requiredQty: 0,
issuedQty: 0,
itemNo: '',
site: '',
loading: false,
issueInfo: {},
quantityDialogVisible: false,
@ -210,7 +211,7 @@ export default {
scannedLabel: labelCode,
workOrderNo: this.workOrderNo,
componentPartNo: this.componentPartNo,
site: localStorage.getItem('site'),
site: this.site,
}
scanMaterialLabelIssue(params)
.then(({ data }) => {
@ -298,7 +299,7 @@ export default {
}
const params = {
site: localStorage.getItem('site'),
site: this.site,
workOrderNo: this.workOrderNo,
componentPartNo: this.componentPartNo,
operatorName: localStorage.getItem('userName'),
@ -345,6 +346,7 @@ export default {
this.requiredQty = Number(this.$route.query.requiredQty || 0)
this.issuedQty = Number(this.$route.query.issuedQty || 0)
this.itemNo = this.$route.query.itemNo || ''
this.site = this.$route.query.site || ''
this.issueInfo = {
releaseNo: this.$route.query.releaseNo,
sequenceNo: this.$route.query.sequenceNo,

30
src/views/modules/production-issue/directIssueNoMaterial.vue

@ -92,6 +92,7 @@ import {
getWorkOrderMaterials,
getShopOrderLine,
} from '@/api/production/production-issue-no-material'
import { filterRowsByAuthorizedSubSite, getAuthorizedSubSiteCodeList } from '@/utils/subSiteAuth.js'
import moment from 'moment'
export default {
@ -196,24 +197,29 @@ export default {
this.loading = true
const params = {
workOrderNo: this.workOrderNo.trim(),
site: localStorage.getItem('site'),
site: localStorage.getItem('site')+'%',
}
getShopOrderLine(params)
.then(({ data }) => {
this.loading = false
if (
data.workOrders &&
data.workOrders.length > 0 &&
data.code === 0
) {
this.workOrderList = data.workOrders
if (data.code === 0) {
const sourceRows = data.workOrders || []
const authorizedSubSiteCodeList = getAuthorizedSubSiteCodeList(this.$store.state.user.subSiteCodeList)
// 接口按site前缀查询会返回同前缀下的所有子site,这里按当前用户授权子site做二次过滤
this.workOrderList = filterRowsByAuthorizedSubSite(sourceRows, authorizedSubSiteCodeList, ['contract'])
this.selectedWorkOrder = null
this.materialList = []
this.showOnlySelected = false
if (this.workOrderList.length === 0) {
this.$message.error(data.msg || '未找到该工单信息')
}
} else {
this.$message.error(data.msg || '未找到该工单信息')
this.workOrderList = []
this.selectedWorkOrder = null
this.materialList = []
this.showOnlySelected = false
}
this.selectedWorkOrder = null
this.materialList = []
this.showOnlySelected = false
})
.catch((error) => {
this.loading = false
@ -250,7 +256,7 @@ export default {
this.loading = true
const params = {
workOrderNo: this.selectedWorkOrder.orderNo,
site: localStorage.getItem('site'),
site: this.selectedWorkOrder.contract,
releaseNo: (this.selectedWorkOrder.releaseNo || '*').trim() || '*',
sequenceNo: (this.selectedWorkOrder.sequenceNo || '*').trim() || '*',
}
@ -286,6 +292,7 @@ export default {
requiredQty: 0,
issuedQty: 0,
partDesc: '物料详情',
site: this.selectedWorkOrder.contract,
},
})
}
@ -353,6 +360,7 @@ export default {
requiredQty: material.qtyRequired,
issuedQty: material.qtyIssued || 0,
partDesc: material.componentPartDesc,
site: this.selectedWorkOrder.contract,
},
})
},

6
src/views/modules/production-issue/directIssueNoMaterialDetail.vue

@ -268,6 +268,7 @@ export default {
requiredQty: 0,
issuedQty: 0,
itemNo: "",
site: "",
loading: false,
issueInfo: {},
quantityDialogVisible: false,
@ -300,7 +301,7 @@ export default {
const params = {
scannedLabel: labelCode,
workOrderNo: this.workOrderNo,
site: localStorage.getItem("site"),
site: this.site,
}
scanMaterialLabelNoPartNo(params)
.then(({ data }) => {
@ -472,7 +473,7 @@ export default {
}
const params = {
site: localStorage.getItem("site"),
site: this.site,
workOrderNo: this.workOrderNo,
componentPartNo: this.componentPartNo,
operatorName: localStorage.getItem("userName"),
@ -523,6 +524,7 @@ export default {
this.requiredQty = Number(this.$route.query.requiredQty || 0);
this.issuedQty = Number(this.$route.query.issuedQty || 0);
this.itemNo = this.$route.query.itemNo || "";
this.site = this.$route.query.site || "";
this.issueInfo = {
releaseNo: this.$route.query.releaseNo,
sequenceNo: this.$route.query.sequenceNo,

61
src/views/modules/production-issue/production.vue

@ -14,6 +14,7 @@
class="menu-item"
v-for="(btn, index) in buttons"
:key="index"
v-site-auth="btn.siteAuth || '*'"
:class="{ disabled: btn.disabled }"
@click="handleButtonClick(btn)"
>
@ -37,6 +38,7 @@ export default {
iconClass: "purchase",
to: "directIssue",
disabled: false,
siteAuth: "*",
},
{
icon: "scan",
@ -44,6 +46,7 @@ export default {
iconClass: "purchase",
to: "directIssueNoMaterial",
disabled: false,
siteAuth: "*",
},
{
icon: "records",
@ -51,6 +54,7 @@ export default {
iconClass: "qualified",
to: "productionPicking",
disabled: false,
siteAuth: "55",
},
/* {
icon: "records",
@ -61,7 +65,64 @@ export default {
],
};
},
directives: {
// 与 main.vue 的 v-site-auth 一致:* 或命中当前 site 才显示
siteAuth: {
inserted(el, binding, vnode) {
if (vnode.context && vnode.context.applySiteAuthForElement) {
vnode.context.applySiteAuthForElement(el, binding);
}
},
componentUpdated(el, binding, vnode) {
if (vnode.context && vnode.context.applySiteAuthForElement) {
vnode.context.applySiteAuthForElement(el, binding);
}
},
},
},
computed: {
currentSite() {
const storeSite = this.$store.state.user.site;
const normalizedStoreSite =
storeSite === null || storeSite === undefined
? ""
: String(storeSite).trim();
if (normalizedStoreSite && normalizedStoreSite !== "0") {
return normalizedStoreSite;
}
return (localStorage.getItem("site") || "").trim();
},
},
methods: {
normalizeMenuSiteAuthValue(siteAuthValue) {
const rawValue =
siteAuthValue === null || siteAuthValue === undefined
? "*"
: String(siteAuthValue).trim();
return rawValue === "" ? "*" : rawValue;
},
isMenuVisibleForCurrentSite(siteAuthValue) {
const normalizedAuthValue = this.normalizeMenuSiteAuthValue(siteAuthValue);
if (normalizedAuthValue === "*") {
return true;
}
const currentSite = this.currentSite;
if (!currentSite) {
return false;
}
const authSiteList = normalizedAuthValue
.split(",")
.map((item) => item.trim())
.filter((item) => item !== "");
return (
authSiteList.includes("*") ||
authSiteList.includes(String(currentSite).trim())
);
},
applySiteAuthForElement(el, binding) {
const isVisible = this.isMenuVisibleForCurrentSite(binding.value);
el.style.display = isVisible ? "" : "none";
},
handleButtonClick(btn) {
if (btn.disabled) {
this.$message.warning("正在开发中,敬请期待...");

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

@ -14,6 +14,7 @@
class="menu-item"
v-for="(btn, index) in buttons"
:key="index"
v-site-auth="btn.siteAuth || '*'"
:class="{ 'disabled': btn.disabled }"
@click="handleButtonClick(btn)"
>
@ -31,12 +32,69 @@ export default {
data() {
return {
buttons: [
{ icon: 'scan', label: '直接退料', iconClass: 'direct', to: 'productionReturnPicking', disabled: false },
{ icon: 'records', label: '申请单退料', iconClass: 'request', to: 'productionReturnPDA', disabled: false },
{ icon: 'scan', label: '直接退料', iconClass: 'direct', to: 'productionReturnPicking', disabled: false, siteAuth: '*' },
{ icon: 'records', label: '申请单退料', iconClass: 'request', to: 'productionReturnPDA', disabled: false, siteAuth: '55' },
]
}
},
directives: {
// 与 main.vue 的 v-site-auth 一致:* 或命中当前 site 才显示
siteAuth: {
inserted(el, binding, vnode) {
if (vnode.context && vnode.context.applySiteAuthForElement) {
vnode.context.applySiteAuthForElement(el, binding);
}
},
componentUpdated(el, binding, vnode) {
if (vnode.context && vnode.context.applySiteAuthForElement) {
vnode.context.applySiteAuthForElement(el, binding);
}
},
},
},
computed: {
currentSite() {
const storeSite = this.$store.state.user.site;
const normalizedStoreSite =
storeSite === null || storeSite === undefined
? ''
: String(storeSite).trim();
if (normalizedStoreSite && normalizedStoreSite !== '0') {
return normalizedStoreSite;
}
return (localStorage.getItem('site') || '').trim();
},
},
methods: {
normalizeMenuSiteAuthValue(siteAuthValue) {
const rawValue =
siteAuthValue === null || siteAuthValue === undefined
? '*'
: String(siteAuthValue).trim();
return rawValue === '' ? '*' : rawValue;
},
isMenuVisibleForCurrentSite(siteAuthValue) {
const normalizedAuthValue = this.normalizeMenuSiteAuthValue(siteAuthValue);
if (normalizedAuthValue === '*') {
return true;
}
const currentSite = this.currentSite;
if (!currentSite) {
return false;
}
const authSiteList = normalizedAuthValue
.split(',')
.map((item) => item.trim())
.filter((item) => item !== '');
return (
authSiteList.includes('*') ||
authSiteList.includes(String(currentSite).trim())
);
},
applySiteAuthForElement(el, binding) {
const isVisible = this.isMenuVisibleForCurrentSite(binding.value);
el.style.display = isVisible ? '' : 'none';
},
handleButtonClick(btn) {
if (btn.disabled) {
this.$message.warning('正在开发中,敬请期待...');

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

@ -84,7 +84,8 @@ export default {
lineItemNo: '',
releaseNo: '',
sequenceNo: '',
umId:''
umId: '',
site: '',
};
},
methods: {
@ -95,7 +96,7 @@ export default {
this.loading = true;
const params = {
workOrderNo: this.workOrderNo,
site: localStorage.getItem('site'),
site: this.site,
componentPartNo: this.componentPartNo,
releaseNo: this.releaseNo || '*',
sequenceNo: this.sequenceNo || '*',
@ -139,6 +140,7 @@ export default {
wdrNo: item.WAIV_DEV_REJ_NO ,
engChgLevel: item.ENG_CHG_LEVEL || '1',
umId: this.umId,
site: this.site,
},
});
},
@ -153,6 +155,7 @@ export default {
this.releaseNo = this.$route.query.releaseNo;
this.sequenceNo = this.$route.query.sequenceNo;
this.umId = this.$route.query.uom;
this.site = this.$route.query.site || '';
this.loadIssueList();
},
};

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

@ -138,6 +138,7 @@
<script>
import { getWorkOrderMaterials, getShopOrderLine } from '@/api/production/production-issue';
import { getReturnWorkOrderInfo } from '@/api/production/production-return';
import { filterRowsByAuthorizedSubSite, getAuthorizedSubSiteCodeList } from '@/utils/subSiteAuth.js';
import moment from 'moment';
export default {
@ -269,7 +270,7 @@ export default {
this.loading = true;
const params = {
workOrderNo: this.workOrderNo.trim(),
site: localStorage.getItem('site'),
site: localStorage.getItem('site')+'%',
};
getShopOrderLine(params)
@ -277,15 +278,17 @@ export default {
this.loading = false;
console.log("工单信息", data);
if (
data.workOrders &&
data.workOrders.length > 0 &&
data.code === 0
) {
this.workOrderList = data.workOrders;
if (data.code === 0) {
const sourceRows = data.workOrders || [];
const authorizedSubSiteCodeList = getAuthorizedSubSiteCodeList(this.$store.state.user.subSiteCodeList);
// 接口按site前缀查询会返回同前缀下的所有子site,这里按当前用户授权子site做二次过滤
this.workOrderList = filterRowsByAuthorizedSubSite(sourceRows, authorizedSubSiteCodeList, ['contract']);
this.selectedWorkOrder = null;
this.materialList = [];
this.showOnlySelected = false;
if (this.workOrderList.length === 0) {
this.$message.error(data.msg || "未找到该工单信息");
}
} else {
this.$message.error(data.msg || "未找到该工单信息");
this.workOrderList = [];
@ -333,7 +336,7 @@ export default {
workOrderNo: this.selectedWorkOrder.orderNo,
releaseNo: (this.selectedWorkOrder.releaseNo || this.releaseNo || "*").trim() || "*",
sequenceNo: (this.selectedWorkOrder.sequenceNo || this.sequenceNo || "*").trim() || "*",
site: localStorage.getItem('site'),
site: this.selectedWorkOrder.contract,
};
getWorkOrderMaterials(params)
@ -371,6 +374,7 @@ export default {
componentPartDesc: material.componentPartDesc,
lineItemNo: material.lineItemNo,
uom: material.uom,
site: this.selectedWorkOrder.contract,
},
});
},

14
src/views/modules/production-return/productionReturnPickingDetail.vue

@ -327,6 +327,7 @@ export default {
releaseNo: '',
sequenceNo: '',
wdrNo: '',
site: '',
engChgLevel: '',
enablePrint: true, // 是否打印标签,默认勾选
umId: '',
@ -406,6 +407,7 @@ export default {
componentPartDesc: this.componentPartDesc,
releaseNo: this.releaseNo,
sequenceNo: this.sequenceNo,
site: this.site,
}
sessionStorage.setItem(
'productionReturnPickingDetail_state_manual',
@ -453,6 +455,7 @@ export default {
state.componentPartDesc || this.componentPartDesc
this.releaseNo = state.releaseNo || this.releaseNo
this.sequenceNo = state.sequenceNo || this.sequenceNo
this.site = state.site || this.site
}
} catch (error) {
console.warn('恢复生产退料手动页面状态失败', error)
@ -468,7 +471,7 @@ export default {
scannedLabel: labelCode,
orderNo: this.orderNo,
orderType: this.orderType,
site: localStorage.getItem('site'),
site: this.site,
batchNo: this.batchNo,
componentPartNo: this.componentPartNo,
}
@ -691,7 +694,7 @@ export default {
}
const returnParams = {
site: localStorage.getItem('site'),
site: this.site,
workOrderNo: this.orderNo,
orderType: this.orderType,
batchNo: this.batchNo,
@ -758,7 +761,7 @@ export default {
const printRequest = {
userId: localStorage.getItem('userName'),
username: localStorage.getItem('userName'),
site: localStorage.getItem('site'),
site: this.site,
unitIds: unitIds,
labelType: 'BIL标签',
}
@ -847,7 +850,7 @@ export default {
const paramdetail = {
workOrderNo: this.orderNo,
batchNo: this.batchNo,
site: localStorage.getItem('site'),
site: this.site,
partNo: this.componentPartNo,
quantity: this.quantity,
}
@ -867,7 +870,7 @@ export default {
return
}
let newLabel = {
site: localStorage.getItem('site'),
site: this.site,
partNo: this.printData.materialCode1,
quantity: this.printData.materialCode2,
batchNo: this.batchNo,
@ -922,6 +925,7 @@ export default {
this.wdrNo = this.$route.query.wdrNo
this.engChgLevel = this.$route.query.engChgLevel
this.umId = this.$route.query.umId
this.site = this.$route.query.site || ''
console.log(
'订单号:',
this.orderNo,

Loading…
Cancel
Save