|
@@ -63,11 +63,10 @@
|
|
|
<text class='title' style="margin-bottom: 40rpx;">基础信息</text>
|
|
|
<view class="uni-row info" style="align-items: center;">
|
|
|
<label for="HeatNo">炉号:</label>
|
|
|
- <uni-data-select v-if="isWasteRecyclingFlag" id="incomingInfo" class="uni-input data-select" v-model="basicInfo"
|
|
|
- :localdata="furnaceNumberInfoList" :clear="false"
|
|
|
+ <uni-data-select v-if="isWasteRecyclingFlag" id="incomingInfo" class="uni-input data-select"
|
|
|
+ v-model="basicInfo" :localdata="furnaceNumberInfoList" :clear="false"
|
|
|
@change="handleFurnaceNumberChange"></uni-data-select>
|
|
|
- <text id="incomingInfo" v-else
|
|
|
- class="uni-input">废品回用</text>
|
|
|
+ <text id="incomingInfo" v-else class="uni-input">废品回用</text>
|
|
|
</view>
|
|
|
<!-- <view class='segment' style="width: 90%;margin: 20rpx auto;"></view> -->
|
|
|
<view class="uni-row info">
|
|
@@ -201,7 +200,7 @@
|
|
|
obj.productionPlanDetailId = store.planDetails.id;
|
|
|
//开始新批次,判断当前工段是否能开始这个批次(领料部门是当前工段的;批次的领料部门是当前工段的)
|
|
|
//当前计划单的领料部门是当前工段
|
|
|
- if (store.normalStatus ) {
|
|
|
+ if (store.normalStatus) {
|
|
|
curDept.value = true
|
|
|
//只查不是废品回用的批次
|
|
|
getLotList(obj).then(res => {
|
|
@@ -230,16 +229,16 @@
|
|
|
wasteRecyclingList.value = res.rows
|
|
|
if (res.rows.length > 0) {
|
|
|
//如果废品回用的批次领料部门是当前计划的领料部门,则加到lotList
|
|
|
- lotList.value = res.rows
|
|
|
- batchNoList.value = [res.rows[0]];
|
|
|
- isWasteRecyclingFlag.value = false
|
|
|
- dayWork.value.lotId = batchNoList.value[0].id;
|
|
|
- dayWork.value.lotCode = batchNoList.value[0].lotCode;
|
|
|
- if (dayWork.value.technologicalProcessId != batchNoList.value[0].technologicalProcessId) {
|
|
|
- dayWork.value.technologicalProcessId = batchNoList.value[0].technologicalProcessId;
|
|
|
- store.planDetails.technologicalProcessId = batchNoList.value[0].technologicalProcessId;
|
|
|
- }
|
|
|
- getProcessInfo(batchNoList.value[0])
|
|
|
+ lotList.value = res.rows
|
|
|
+ batchNoList.value = [res.rows[0]];
|
|
|
+ isWasteRecyclingFlag.value = false
|
|
|
+ dayWork.value.lotId = batchNoList.value[0].id;
|
|
|
+ dayWork.value.lotCode = batchNoList.value[0].lotCode;
|
|
|
+ if (dayWork.value.technologicalProcessId != batchNoList.value[0].technologicalProcessId) {
|
|
|
+ dayWork.value.technologicalProcessId = batchNoList.value[0].technologicalProcessId;
|
|
|
+ store.planDetails.technologicalProcessId = batchNoList.value[0].technologicalProcessId;
|
|
|
+ }
|
|
|
+ getProcessInfo(batchNoList.value[0])
|
|
|
//提示当前批次是废品回用
|
|
|
if (batchNoList.value[0].isAmend == 1) {
|
|
|
uni.showToast({
|
|
@@ -247,8 +246,7 @@
|
|
|
title: "该批是单批单改",
|
|
|
duration: 2000
|
|
|
})
|
|
|
- }
|
|
|
- else if (batchNoList.value[0].isWasteRecycling == 1) {
|
|
|
+ } else if (batchNoList.value[0].isWasteRecycling == 1) {
|
|
|
uni.showToast({
|
|
|
icon: "none",
|
|
|
title: "该批是废品回用",
|
|
@@ -285,7 +283,7 @@
|
|
|
// }
|
|
|
function getFurnaceInfo(data) {
|
|
|
console.log(data)
|
|
|
- if(data.isWasteRecycling==0) {
|
|
|
+ if (data.isWasteRecycling == 0) {
|
|
|
let token = 'Bearer ' + getToken();
|
|
|
let header = {
|
|
|
Authorization: token
|
|
@@ -308,31 +306,31 @@
|
|
|
value: res.data.data[i]
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
// basicInfo.value = res.data.data[0];
|
|
|
// dayWork.value.furnaceNoInfo = basicInfo.value;
|
|
|
- }
|
|
|
- },
|
|
|
- fail: (err) => {
|
|
|
- console.log(err)
|
|
|
- }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ fail: (err) => {
|
|
|
+ console.log(err)
|
|
|
+ }
|
|
|
})
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
furnaceInfo.value.furnaceNumber = "废品回用"
|
|
|
dayWork.value.furnaceNoInfo = furnaceInfo.value
|
|
|
basicInfo.value = dayWork.value.furnaceNoInfo
|
|
|
}
|
|
|
console.log(basicInfo.value)
|
|
|
}
|
|
|
+
|
|
|
function iconClick() {
|
|
|
checkLotCode(inpValue.value);
|
|
|
}
|
|
|
|
|
|
function checkLotCode(lotCode) {
|
|
|
- //var lotCode = lotList.value[0].map(obj =>obj.lotCode)
|
|
|
- console.log(lotList.value)
|
|
|
- console.log(lotList.value.map(obj =>obj.lotCode))
|
|
|
- if (lotCode.includes(lotCode)) {
|
|
|
+ var lotCodes = lotList.value.map(obj => obj.lotCode)
|
|
|
+ if (lotCodes.includes(lotCode)) {
|
|
|
+ console.log("444")
|
|
|
for (let i = 0; i < lotList.value.length; i++) {
|
|
|
if (lotList.value[i].lotCode == lotCode) {
|
|
|
batchNoList.value = [lotList.value[i]];
|
|
@@ -346,11 +344,14 @@
|
|
|
duration: 2000
|
|
|
})
|
|
|
} else if (batchNoList.value[0].isAmend == 1) {
|
|
|
+ isWasteRecyclingFlag.value = true
|
|
|
+ getFurnaceInfo(batchNoList.value[0])
|
|
|
uni.showToast({
|
|
|
icon: "none",
|
|
|
title: "该批次号可用,该批是单批单改",
|
|
|
duration: 2000
|
|
|
})
|
|
|
+
|
|
|
} else {
|
|
|
uni.showToast({
|
|
|
icon: "none",
|
|
@@ -362,14 +363,61 @@
|
|
|
}
|
|
|
}
|
|
|
} else {
|
|
|
- uni.showToast({
|
|
|
- icon: "none",
|
|
|
- title: "该批次号已被使用或不属于该产品",
|
|
|
- duration: 2000
|
|
|
+ getAbnormalList(lotCode);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ function getAbnormalList(lotCode) {
|
|
|
+ if (store.normalStatus) {
|
|
|
+ getAbnormalityLot({
|
|
|
+ productionPlanDetailId: store.planDetails.id,
|
|
|
+ requisitionDepartmentId: store.curDeptDetails.deptId,
|
|
|
+ flag: true
|
|
|
+ }).then(res => {
|
|
|
+ if (res.rows.length > 0) {
|
|
|
+ var abNormaLotCode = res.rows.map(obj => obj.lotCode)
|
|
|
+ console.log(abNormaLotCode.includes(lotCode))
|
|
|
+ if (abNormaLotCode.includes(lotCode)) {
|
|
|
+ uni.showToast({
|
|
|
+ icon: "none",
|
|
|
+ title: "该批次号是废品回用或单批单改",
|
|
|
+ duration: 2000
|
|
|
+ })
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ uni.showToast({
|
|
|
+ icon: "none",
|
|
|
+ title: "该批次号已被使用或不属于该产品",
|
|
|
+ duration: 2000
|
|
|
+ })
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ getLotList({productionPlanDetailId: store.planDetails.id}).then(res => {
|
|
|
+ if (res.rows.length > 0) {
|
|
|
+ console.log(res.rows)
|
|
|
+ var normaLotCode = res.rows.map(obj => obj.lotCode)
|
|
|
+ if (normaLotCode.includes(lotCode)) {
|
|
|
+ uni.showToast({
|
|
|
+ icon: "none",
|
|
|
+ title: "该批次号是正常批",
|
|
|
+ duration: 2000
|
|
|
+ })
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ uni.showToast({
|
|
|
+ icon: "none",
|
|
|
+ title: "该批次号已被使用或不属于该产品",
|
|
|
+ duration: 2000
|
|
|
+ })
|
|
|
+ return false;
|
|
|
+ }
|
|
|
})
|
|
|
- return false;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
}
|
|
|
|
|
|
function getProcessInfo(data) {
|
|
@@ -398,8 +446,10 @@
|
|
|
selectedProcess.value = processList.value[0].value;
|
|
|
dayWork.value.processId = processList.value[0].processId;
|
|
|
dayWork.value.technologicalProcessDetailId = selectedProcess.value
|
|
|
- dayWork.value.processStepNumber = processList.value.findIndex(v => v.value === selectedProcess.value) >= 0 ?
|
|
|
- processList.value.find(v => v.value === selectedProcess.value).processStepNumber : null
|
|
|
+ dayWork.value.processStepNumber = processList.value.findIndex(v => v.value ===
|
|
|
+ selectedProcess.value) >= 0 ?
|
|
|
+ processList.value.find(v => v.value === selectedProcess.value).processStepNumber :
|
|
|
+ null
|
|
|
})
|
|
|
}
|
|
|
})
|
|
@@ -465,7 +515,7 @@
|
|
|
}
|
|
|
|
|
|
function handleFurnaceNumberChange() {
|
|
|
-
|
|
|
+
|
|
|
dayWork.value.furnaceNoInfo = basicInfo.value;
|
|
|
}
|
|
|
|
|
@@ -475,7 +525,7 @@
|
|
|
.value.find(v => v.value === selectedProcess.value).processId : null
|
|
|
dayWork.value.processStepNumber = processList.value.findIndex(v => v.value === selectedProcess.value) >= 0 ?
|
|
|
processList.value.find(v => v.value === selectedProcess.value).processStepNumber : null
|
|
|
- dayWork.value.technologicalProcessId = batchNoList.value[0].technologicalProcessId;
|
|
|
+ dayWork.value.technologicalProcessId = batchNoList.value[0].technologicalProcessId;
|
|
|
}
|
|
|
|
|
|
// function handleScanCode() {
|
|
@@ -527,16 +577,16 @@
|
|
|
return;
|
|
|
}
|
|
|
console.log(basicInfo.value)
|
|
|
- if(dayWork.value.furnaceNoInfo == null) {
|
|
|
+ if (dayWork.value.furnaceNoInfo == null) {
|
|
|
uni.showToast({
|
|
|
icon: 'none',
|
|
|
title: '请选择炉号再开始批次'
|
|
|
})
|
|
|
return;
|
|
|
}
|
|
|
- dayWork.value.isWasteRecycling = batchNoList.value[0].isWasteRecycling
|
|
|
- dayWork.value.isAmend = batchNoList.value[0].isAmend
|
|
|
-
|
|
|
+ dayWork.value.isWasteRecycling = batchNoList.value[0].isWasteRecycling
|
|
|
+ dayWork.value.isAmend = batchNoList.value[0].isAmend
|
|
|
+
|
|
|
store.furnaceNumberInfo = basicInfo.value;
|
|
|
if (checkLotCode(dayWork.value.lotCode)) {
|
|
|
saveDayWork(dayWork.value).then(res => {
|
|
@@ -738,4 +788,4 @@
|
|
|
width: 88%;
|
|
|
margin: 20rpx auto 40rpx;
|
|
|
}
|
|
|
-</style>
|
|
|
+</style>
|