|
@@ -15,7 +15,7 @@
|
|
<uni-easyinput v-if="batchNoList.length > 0" class="inp" suffixIcon="checkmarkempty"
|
|
<uni-easyinput v-if="batchNoList.length > 0" class="inp" suffixIcon="checkmarkempty"
|
|
v-model="inpValue" placeholder="可手动修正批次" @iconClick="iconClick"></uni-easyinput>
|
|
v-model="inpValue" placeholder="可手动修正批次" @iconClick="iconClick"></uni-easyinput>
|
|
<view class="uni-row" style="justify-content: space-between;">
|
|
<view class="uni-row" style="justify-content: space-between;">
|
|
- <view v-if="batchNoList.length > 0" class="scanLotCode" @click="handleDoLastLot">
|
|
|
|
|
|
+ <view v-if="batchNoList.length > 0 && curDept" class="scanLotCode" @click="handleDoLastLot">
|
|
<text>是否加工尾批</text>
|
|
<text>是否加工尾批</text>
|
|
</view>
|
|
</view>
|
|
<view v-if="batchNoList.length > 0" class="scanLotCode" @click="handleConfirmLotCode">
|
|
<view v-if="batchNoList.length > 0" class="scanLotCode" @click="handleConfirmLotCode">
|
|
@@ -46,7 +46,12 @@
|
|
<view class="selectedProcess">
|
|
<view class="selectedProcess">
|
|
<uni-section title="请选择工序" type="square">
|
|
<uni-section title="请选择工序" type="square">
|
|
<uni-data-select v-model="selectedProcess" :localdata="processList" :clear="false"
|
|
<uni-data-select v-model="selectedProcess" :localdata="processList" :clear="false"
|
|
- @change="handleProcessChange"></uni-data-select>
|
|
|
|
|
|
+ @change="handleProcessChange">
|
|
|
|
+ <template v-slot:option="{item }">
|
|
|
|
+ <!-- 自定义下拉框每一项的显示内容 -->
|
|
|
|
+ <span>{{ (item.index) + 1}}</span>
|
|
|
|
+ <span>{{ item.text }}</span>
|
|
|
|
+ </template></uni-data-select>
|
|
</uni-section>
|
|
</uni-section>
|
|
</view>
|
|
</view>
|
|
<view class='middle'>
|
|
<view class='middle'>
|
|
@@ -134,7 +139,9 @@
|
|
onReady
|
|
onReady
|
|
} from '@dcloudio/uni-app'
|
|
} from '@dcloudio/uni-app'
|
|
import {
|
|
import {
|
|
- getLotList
|
|
|
|
|
|
+ getLotList,
|
|
|
|
+ getWasteRecyclingLot,
|
|
|
|
+ getProcessListByLot
|
|
} from "@/api/business/lot.js"
|
|
} from "@/api/business/lot.js"
|
|
import {
|
|
import {
|
|
saveDayWork
|
|
saveDayWork
|
|
@@ -162,10 +169,12 @@
|
|
const vehicleList = ref([])
|
|
const vehicleList = ref([])
|
|
const basicInfo = ref({}) // 基础信息对象
|
|
const basicInfo = ref({}) // 基础信息对象
|
|
const dayWork = ref({})
|
|
const dayWork = ref({})
|
|
|
|
+ const wasteRecyclingList = ref([])//废品回用批次
|
|
const curPlan = ref({})
|
|
const curPlan = ref({})
|
|
const furnaceNumberInfoList = ref([])
|
|
const furnaceNumberInfoList = ref([])
|
|
const emit = defineEmits(['batchReporting-addBatch']);
|
|
const emit = defineEmits(['batchReporting-addBatch']);
|
|
const inpValue = ref('')
|
|
const inpValue = ref('')
|
|
|
|
+ const curDept = ref(false)//判断当前工段是否是该批次的领料部门
|
|
const lotList = ref([])
|
|
const lotList = ref([])
|
|
const selectedProcess = ref(null)
|
|
const selectedProcess = ref(null)
|
|
const processList = ref([])
|
|
const processList = ref([])
|
|
@@ -185,21 +194,66 @@
|
|
function init() {
|
|
function init() {
|
|
let obj = {}
|
|
let obj = {}
|
|
obj.productionPlanDetailId = store.planDetails.id;
|
|
obj.productionPlanDetailId = store.planDetails.id;
|
|
- getLotList(obj).then(res => {
|
|
|
|
- console.log(res)
|
|
|
|
- lotList.value = res.rows;
|
|
|
|
- if (res.rows.length > 0) {
|
|
|
|
- batchNoList.value = [res.rows[0]];
|
|
|
|
- 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;
|
|
|
|
|
|
+ //开始新批次,判断当前工段是否能开始这个批次(领料部门是当前工段的;批次的领料部门是当前工段的)
|
|
|
|
+ //当前计划单的领料部门是当前工段
|
|
|
|
+ if(store.planDetails.requisitionDepartmentId == store.curDeptDetails.deptId) {
|
|
|
|
+ curDept.value= true
|
|
|
|
+ //只查不是废品回用的批次
|
|
|
|
+ getLotList(obj).then(res => {
|
|
|
|
+ console.log(res)
|
|
|
|
+ lotList.value = res.rows;
|
|
|
|
+ if (res.rows.length > 0) {
|
|
|
|
+ batchNoList.value = [res.rows[0]];
|
|
|
|
+ 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])
|
|
|
|
+ } else {
|
|
|
|
+ batchNoList.value = res.rows;
|
|
}
|
|
}
|
|
- } else {
|
|
|
|
- batchNoList.value = res.rows;
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
|
|
+ })
|
|
|
|
+ }else {
|
|
|
|
+ //废品回用的批次(领料部门是当前工段)
|
|
|
|
+ getWasteRecyclingLot({productionPlanDetailId:store.planDetails.id,requisitionDepartmentId :store.curDeptDetails.deptId,flag:true}).then(res => {
|
|
|
|
+ wasteRecyclingList.value = res.rows
|
|
|
|
+ if (res.rows.length > 0) {
|
|
|
|
+ //如果废品回用的批次领料部门是当前计划的领料部门,则加到lotList
|
|
|
|
+ if(wasteRecyclingList.value[0].requisitionDepartmentId == store.planDetails.requisitionDepartmentId) {
|
|
|
|
+ lotList.value.push(wasteRecyclingList.value)
|
|
|
|
+ batchNoList.value = [lotList.rows[0]];
|
|
|
|
+ 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;
|
|
|
|
+ }
|
|
|
|
+ }else {
|
|
|
|
+ lotList.value = res.rows
|
|
|
|
+ batchNoList.value = [res.rows[0]];
|
|
|
|
+ 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].isWasteRecycling == 1) {
|
|
|
|
+ uni.showToast({
|
|
|
|
+ icon: "none",
|
|
|
|
+ title: "该批是废品回用",
|
|
|
|
+ duration: 2000
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ batchNoList.value = res.rows;
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
|
|
// 拉取炉号信息from p2
|
|
// 拉取炉号信息from p2
|
|
let token = 'Bearer ' + getToken();
|
|
let token = 'Bearer ' + getToken();
|
|
@@ -233,34 +287,32 @@
|
|
}
|
|
}
|
|
})
|
|
})
|
|
|
|
|
|
- getProcessList({
|
|
|
|
- deptId: store.curDeptDetails.deptId,
|
|
|
|
- }).then(res => {
|
|
|
|
- if (res.code == 200) {
|
|
|
|
- //过滤出工序交集
|
|
|
|
- let filteredData = store.planDetails.processSequence.filter((item1) =>
|
|
|
|
- res.data.some((item2) => item2.processCode === item1.processCode)
|
|
|
|
- );
|
|
|
|
- // for (let i = 0; i < filteredData.length; i++) {
|
|
|
|
- // processList.value[i] = {
|
|
|
|
- // text: filteredData[i].processAlias,
|
|
|
|
- // // value: filteredData[i].id,
|
|
|
|
- // value: filteredData[i].technologicalProcessDetailId,
|
|
|
|
- // processId: filterData[i].id
|
|
|
|
-
|
|
|
|
- // }
|
|
|
|
- // }
|
|
|
|
- processList.value = filteredData.map(v => ({
|
|
|
|
- text: v.processAlias,
|
|
|
|
- value: v.technologicalProcessDetailId,
|
|
|
|
- processId: v.id
|
|
|
|
- }))
|
|
|
|
- console.log(processList.value)
|
|
|
|
- selectedProcess.value = filteredData[0].technologicalProcessDetailId;
|
|
|
|
- dayWork.value.processId = filteredData[0].id;
|
|
|
|
- dayWork.value.technologicalProcessDetailId = selectedProcess.value
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
|
|
+ // getProcessList({
|
|
|
|
+ // deptId: store.curDeptDetails.deptId,
|
|
|
|
+ // }).then(res => {
|
|
|
|
+ // if (res.code == 200) {
|
|
|
|
+ // //过滤出工序交集
|
|
|
|
+ // //因为废品回用对工序进行单独的修改。所以重新查产品的工艺,如果该批不是废品回用,则查产品工序,如果是,则到
|
|
|
|
+ // //对应表查
|
|
|
|
+ // //通过批次号查
|
|
|
|
+ // console.log(batchNoList.value)
|
|
|
|
+ // getProcessListByLot(batchNoList.value[0]).then(res => {
|
|
|
|
+ // let lotProcessList = res.data
|
|
|
|
+ // let filteredData = lotProcessList.filter((item1) =>
|
|
|
|
+ // res.data.some((item2) => item2.processCode === item1.processCode)
|
|
|
|
+ // );
|
|
|
|
+ // processList.value = filteredData.map(v => ({
|
|
|
|
+ // text: v.processAlias,
|
|
|
|
+ // value: v.technologicalProcessDetailId,
|
|
|
|
+ // processId: v.id
|
|
|
|
+ // }))
|
|
|
|
+ // console.log(processList.value)
|
|
|
|
+ // selectedProcess.value = filteredData[0].technologicalProcessDetailId;
|
|
|
|
+ // dayWork.value.processId = filteredData[0].id;
|
|
|
|
+ // dayWork.value.technologicalProcessDetailId = selectedProcess.value
|
|
|
|
+ // })
|
|
|
|
+ // }
|
|
|
|
+ // })
|
|
}
|
|
}
|
|
|
|
|
|
// function handleCheckBatchNo(item) {
|
|
// function handleCheckBatchNo(item) {
|
|
@@ -285,17 +337,27 @@
|
|
}
|
|
}
|
|
|
|
|
|
function checkLotCode(lotCode) {
|
|
function checkLotCode(lotCode) {
|
|
|
|
+ console.log(lotList.value)
|
|
|
|
+ console.log(lotList.value.some(item => item.lotCode == lotCode))
|
|
if (lotList.value.some(item => item.lotCode == lotCode)) {
|
|
if (lotList.value.some(item => item.lotCode == lotCode)) {
|
|
for (let i = 0; i < lotList.value.length; i++) {
|
|
for (let i = 0; i < lotList.value.length; i++) {
|
|
if (lotList.value[i].lotCode == lotCode) {
|
|
if (lotList.value[i].lotCode == lotCode) {
|
|
batchNoList.value = [lotList.value[i]];
|
|
batchNoList.value = [lotList.value[i]];
|
|
dayWork.value.lotId = lotList.value[i].id;
|
|
dayWork.value.lotId = lotList.value[i].id;
|
|
dayWork.value.lotCode = lotList.value[i].lotCode;
|
|
dayWork.value.lotCode = lotList.value[i].lotCode;
|
|
|
|
+ if(batchNoList.value[0].isWasteRecycling == 1) {
|
|
|
|
+ uni.showToast({
|
|
|
|
+ icon: "none",
|
|
|
|
+ title: "该批次号可用,该批是废品回用",
|
|
|
|
+ duration: 2000
|
|
|
|
+ })
|
|
|
|
+ }else{
|
|
uni.showToast({
|
|
uni.showToast({
|
|
icon: "none",
|
|
icon: "none",
|
|
title: "该批次号可用",
|
|
title: "该批次号可用",
|
|
duration: 2000
|
|
duration: 2000
|
|
})
|
|
})
|
|
|
|
+ }
|
|
return true;
|
|
return true;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -308,7 +370,37 @@
|
|
return false;
|
|
return false;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+ function getProcessInfo(data) {
|
|
|
|
+ getProcessList({
|
|
|
|
+ deptId: store.curDeptDetails.deptId,
|
|
|
|
+ }).then(res => {
|
|
|
|
+ if (res.code == 200) {
|
|
|
|
+ //过滤出工序交集
|
|
|
|
+ //因为废品回用对工序进行单独的修改。所以重新查产品的工艺,如果该批不是废品回用,则查产品工序,如果是,则到
|
|
|
|
+ //对应表查
|
|
|
|
+ //通过批次号查
|
|
|
|
+ console.log(batchNoList.value)
|
|
|
|
+ getProcessListByLot(data).then(response => {
|
|
|
|
+ let lotProcessList = response.data
|
|
|
|
+ console.log(lotProcessList)
|
|
|
|
+ let filteredData = lotProcessList.filter((item1) =>
|
|
|
|
+ res.data.some((item2) => item2.processCode === item1.processCode)
|
|
|
|
+ );
|
|
|
|
+ processList.value = filteredData.map((v,index) => ({
|
|
|
|
+ text: v.processAlias,
|
|
|
|
+ value:v.technologicalProcessDetailId?v.technologicalProcessDetailId:v.id,
|
|
|
|
+ processId: v.processId,
|
|
|
|
+ processStepNumber:v.processStepNumber,
|
|
|
|
+ index:index
|
|
|
|
+ }))
|
|
|
|
+ console.log(processList.value)
|
|
|
|
+ selectedProcess.value = filteredData[0].technologicalProcessDetailId;
|
|
|
|
+ dayWork.value.processId = filteredData[0].id;
|
|
|
|
+ dayWork.value.technologicalProcessDetailId = selectedProcess.value
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ }
|
|
function handleDoLastLot() {
|
|
function handleDoLastLot() {
|
|
uni.showModal({
|
|
uni.showModal({
|
|
title: '提示',
|
|
title: '提示',
|
|
@@ -374,6 +466,7 @@
|
|
function handleProcessChange() {
|
|
function handleProcessChange() {
|
|
dayWork.value.technologicalProcessDetailId = selectedProcess.value;
|
|
dayWork.value.technologicalProcessDetailId = selectedProcess.value;
|
|
dayWork.value.processId = processList.value.findIndex(v => v.value === selectedProcess.value) >= 0 ? processList.value.find(v => v.value === selectedProcess.value).processId : null
|
|
dayWork.value.processId = processList.value.findIndex(v => v.value === selectedProcess.value) >= 0 ? processList.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
|
|
}
|
|
}
|
|
|
|
|
|
// function handleScanCode() {
|
|
// function handleScanCode() {
|
|
@@ -424,6 +517,7 @@
|
|
})
|
|
})
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
|
|
+ dayWork.value.isWasteRecycling = 1
|
|
console.log(dayWork.value)
|
|
console.log(dayWork.value)
|
|
console.log(basicInfo.value)
|
|
console.log(basicInfo.value)
|
|
store.furnaceNumberInfo = basicInfo.value;
|
|
store.furnaceNumberInfo = basicInfo.value;
|