|
@@ -130,6 +130,10 @@
|
|
|
<button class='add' type=primary @click='handleAdd'>添加</button>
|
|
|
</view>
|
|
|
</view>
|
|
|
+ <view
|
|
|
+ style="background-color: #99999999; z-index: 5; position: absolute; left: 0px; right: 0px; top: 0px; bottom: 0px;"
|
|
|
+ v-if="loading">
|
|
|
+ </view>
|
|
|
</template>
|
|
|
<script setup>
|
|
|
import {
|
|
@@ -154,7 +158,9 @@
|
|
|
getCarrierById,
|
|
|
checkCarrier
|
|
|
} from '@/api/business/carrier.js'
|
|
|
- import{isTakeStock} from '@/api/business/taksStackLot.js'
|
|
|
+ import {
|
|
|
+ isTakeStock
|
|
|
+ } from '@/api/business/taksStackLot.js'
|
|
|
import {
|
|
|
getFurnaceNoInfo
|
|
|
} from '@/api/p2/furnaceNoInfo.js'
|
|
@@ -178,6 +184,7 @@
|
|
|
const isWasteRecyclingFlag = ref(true)
|
|
|
const emit = defineEmits(['batchReporting-addBatch']);
|
|
|
const inpValue = ref('')
|
|
|
+ const loading = ref(false)
|
|
|
|
|
|
const curDept = ref(false) //判断当前工段是否是该批次的领料部门
|
|
|
const lotList = ref([])
|
|
@@ -210,8 +217,8 @@
|
|
|
batchNoList.value = [res.rows[0]];
|
|
|
dayWork.value.lotId = batchNoList.value[0].id;
|
|
|
dayWork.value.lotCode = batchNoList.value[0].lotCode;
|
|
|
- dayWork.value.technologicalProcessId = batchNoList.value[0].technologicalProcessId;
|
|
|
- store.planDetails.technologicalProcessId = batchNoList.value[0].technologicalProcessId;
|
|
|
+ dayWork.value.technologicalProcessId = batchNoList.value[0].technologicalProcessId;
|
|
|
+ store.planDetails.technologicalProcessId = batchNoList.value[0].technologicalProcessId;
|
|
|
getProcessInfo(batchNoList.value[0])
|
|
|
getFurnaceInfo(batchNoList.value[0])
|
|
|
} else {
|
|
@@ -231,13 +238,13 @@
|
|
|
lotList.value = res.rows
|
|
|
batchNoList.value = [res.rows[0]];
|
|
|
isWasteRecyclingFlag.value = true
|
|
|
- if(batchNoList.value[0].isWasteRecycling == 0) {
|
|
|
+ if (batchNoList.value[0].isWasteRecycling == 0) {
|
|
|
isWasteRecyclingFlag.value = false
|
|
|
}
|
|
|
dayWork.value.lotId = batchNoList.value[0].id;
|
|
|
dayWork.value.lotCode = batchNoList.value[0].lotCode;
|
|
|
- dayWork.value.technologicalProcessId = batchNoList.value[0].technologicalProcessId;
|
|
|
- store.planDetails.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) {
|
|
@@ -283,7 +290,7 @@
|
|
|
// }
|
|
|
function getFurnaceInfo(data) {
|
|
|
if (data.isWasteRecycling == 0) {
|
|
|
- isWasteRecyclingFlag.value = true
|
|
|
+ isWasteRecyclingFlag.value = true
|
|
|
let token = 'Bearer ' + getToken();
|
|
|
let header = {
|
|
|
Authorization: token
|
|
@@ -390,7 +397,7 @@
|
|
|
duration: 2000
|
|
|
})
|
|
|
return false;
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
uni.showToast({
|
|
|
icon: "none",
|
|
|
title: "该批次号已被使用或不属于该产品",
|
|
@@ -408,7 +415,9 @@
|
|
|
}
|
|
|
})
|
|
|
} else {
|
|
|
- getLotList({productionPlanDetailId: store.planDetails.id}).then(res => {
|
|
|
+ getLotList({
|
|
|
+ productionPlanDetailId: store.planDetails.id
|
|
|
+ }).then(res => {
|
|
|
if (res.rows.length > 0) {
|
|
|
console.log(res.rows)
|
|
|
var normaLotCode = res.rows.map(obj => obj.lotCode)
|
|
@@ -419,7 +428,7 @@
|
|
|
duration: 2000
|
|
|
})
|
|
|
return false;
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
uni.showToast({
|
|
|
icon: "none",
|
|
|
title: "该批次号已被使用或不属于该产品",
|
|
@@ -461,7 +470,7 @@
|
|
|
processId: v.processId,
|
|
|
processStepNumber: v.processStepNumber,
|
|
|
index: index,
|
|
|
- technologicalProcessId:v.technologicalProcessId ? v
|
|
|
+ technologicalProcessId: v.technologicalProcessId ? v
|
|
|
.technologicalProcessId : v.lotTechnologicalProcessId
|
|
|
|
|
|
}))
|
|
@@ -551,47 +560,47 @@
|
|
|
dayWork.value.technologicalProcessId = batchNoList.value[0].technologicalProcessId;
|
|
|
}
|
|
|
|
|
|
-/*
|
|
|
- // function handleScanCode() {
|
|
|
- // uni.scanCode({
|
|
|
- // scanType: ['qrCode'],
|
|
|
- // onlyFromCamera: true, // 只允许相机扫码
|
|
|
- // autoZoom: false,
|
|
|
- // success: function(res) {
|
|
|
- // let vehicleObj = JSON.parse(res.result);
|
|
|
- // if (!vehicleObj.carrierId || vehicleObj.carrierId == "") {
|
|
|
- // uni.showToast({
|
|
|
- // icon: "error",
|
|
|
- // title: "请扫载具码",
|
|
|
- // duration: 1000
|
|
|
- // })
|
|
|
- // return;
|
|
|
- // }
|
|
|
- // for (let i = 0; i < vehicleList.value.length; i++) {
|
|
|
- // if (vehicleList.value[i].carrierId == vehicleObj.carrierId) {
|
|
|
- // uni.showToast({
|
|
|
- // icon: "error",
|
|
|
- // title: "载具已存在",
|
|
|
- // duration: 1000
|
|
|
- // })
|
|
|
- // return;
|
|
|
- // }
|
|
|
- // }
|
|
|
- // checkCarrier(vehicleObj.carrierId).then(response => {
|
|
|
- // if (response.code == 200) {
|
|
|
- // vehicleList.value.push(vehicleObj);
|
|
|
- // } else {
|
|
|
- // uni.showToast({
|
|
|
- // icon: 'none',
|
|
|
- // title: response.msg
|
|
|
- // })
|
|
|
- // return;
|
|
|
- // }
|
|
|
- // })
|
|
|
- // }
|
|
|
- // });
|
|
|
- // }
|
|
|
-*/
|
|
|
+ /*
|
|
|
+ // function handleScanCode() {
|
|
|
+ // uni.scanCode({
|
|
|
+ // scanType: ['qrCode'],
|
|
|
+ // onlyFromCamera: true, // 只允许相机扫码
|
|
|
+ // autoZoom: false,
|
|
|
+ // success: function(res) {
|
|
|
+ // let vehicleObj = JSON.parse(res.result);
|
|
|
+ // if (!vehicleObj.carrierId || vehicleObj.carrierId == "") {
|
|
|
+ // uni.showToast({
|
|
|
+ // icon: "error",
|
|
|
+ // title: "请扫载具码",
|
|
|
+ // duration: 1000
|
|
|
+ // })
|
|
|
+ // return;
|
|
|
+ // }
|
|
|
+ // for (let i = 0; i < vehicleList.value.length; i++) {
|
|
|
+ // if (vehicleList.value[i].carrierId == vehicleObj.carrierId) {
|
|
|
+ // uni.showToast({
|
|
|
+ // icon: "error",
|
|
|
+ // title: "载具已存在",
|
|
|
+ // duration: 1000
|
|
|
+ // })
|
|
|
+ // return;
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // checkCarrier(vehicleObj.carrierId).then(response => {
|
|
|
+ // if (response.code == 200) {
|
|
|
+ // vehicleList.value.push(vehicleObj);
|
|
|
+ // } else {
|
|
|
+ // uni.showToast({
|
|
|
+ // icon: 'none',
|
|
|
+ // title: response.msg
|
|
|
+ // })
|
|
|
+ // return;
|
|
|
+ // }
|
|
|
+ // })
|
|
|
+ // }
|
|
|
+ // });
|
|
|
+ // }
|
|
|
+ */
|
|
|
|
|
|
function handleAdd() {
|
|
|
if (selectedProcess.value == null) {
|
|
@@ -611,40 +620,46 @@
|
|
|
dayWork.value.isWasteRecycling = batchNoList.value[0].isWasteRecycling
|
|
|
dayWork.value.isAmend = batchNoList.value[0].isAmend
|
|
|
dayWork.value.fromId = batchNoList.value[0].fromId
|
|
|
- dayWork.value.isSuperaddition = batchNoList.value[0].isSuperaddition
|
|
|
+ dayWork.value.isSuperaddition = batchNoList.value[0].isSuperaddition
|
|
|
store.furnaceNumberInfo = basicInfo.value;
|
|
|
if (checkLotCode(dayWork.value.lotCode)) {
|
|
|
- isTakeStock().then(response =>{
|
|
|
- if(response.data) {
|
|
|
+ isTakeStock().then(response => {
|
|
|
+ if (response.data) {
|
|
|
uni.showToast({
|
|
|
icon: 'none',
|
|
|
title: '正在盘点,不能开始新批次',
|
|
|
duration: 2000
|
|
|
})
|
|
|
- }else{
|
|
|
- saveDayWork(dayWork.value).then(res => {
|
|
|
- console.log(res)
|
|
|
- if (res.code === 200) {
|
|
|
- uni.showToast({
|
|
|
- icon: 'success',
|
|
|
- title: '添加成功',
|
|
|
- duration: 2000
|
|
|
- });
|
|
|
- // uni.$emit('batchReporting-addBatch');
|
|
|
- // uni.$emit('dayworkItemUpdate');
|
|
|
- uni.navigateBack({
|
|
|
- url: '/pages/batchReporting/index'
|
|
|
- })
|
|
|
} else {
|
|
|
- uni.showToast({
|
|
|
- icon: 'none',
|
|
|
- title: res.msg,
|
|
|
- duration: 2000
|
|
|
+ loading.value = true
|
|
|
+ uni.showLoading({
|
|
|
+ title: '加载中'
|
|
|
});
|
|
|
+ saveDayWork(dayWork.value).then(res => {
|
|
|
+ console.log(res)
|
|
|
+ if (res.code === 200) {
|
|
|
+ uni.showToast({
|
|
|
+ icon: 'success',
|
|
|
+ title: '添加成功',
|
|
|
+ duration: 2000
|
|
|
+ });
|
|
|
+ // uni.$emit('batchReporting-addBatch');
|
|
|
+ // uni.$emit('dayworkItemUpdate');
|
|
|
+ uni.navigateBack({
|
|
|
+ url: '/pages/batchReporting/index'
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ uni.showToast({
|
|
|
+ icon: 'none',
|
|
|
+ title: res.msg,
|
|
|
+ duration: 2000
|
|
|
+ });
|
|
|
+ }
|
|
|
+ loading.value = false
|
|
|
+ uni.hideLoading()
|
|
|
+ })
|
|
|
}
|
|
|
})
|
|
|
- }
|
|
|
- })
|
|
|
} else {
|
|
|
uni.showToast({
|
|
|
icon: "none",
|