|
@ -1,6 +1,6 @@ |
|
|
<template> |
|
|
<template> |
|
|
<view class=""> |
|
|
<view class=""> |
|
|
<uni-popup ref="popup" :maskClick="false"> |
|
|
<u-popup v-model="show" mode="bottom" :maskClick="false"> |
|
|
<view class="uni-flex uni-column pop_customer"> |
|
|
<view class="uni-flex uni-column pop_customer"> |
|
|
<view class="" style="padding: 10rpx"> |
|
|
<view class="" style="padding: 10rpx"> |
|
|
<view class="uni-flex u-col-center uni-row space-between" style="padding: 10rpx 10rpx 20rpx 10rpx"> |
|
|
<view class="uni-flex u-col-center uni-row space-between" style="padding: 10rpx 10rpx 20rpx 10rpx"> |
|
@ -73,7 +73,7 @@ |
|
|
|
|
|
|
|
|
<view class="title" style="display: flex; align-items: center; padding: 10rpx"> |
|
|
<view class="title" style="display: flex; align-items: center; padding: 10rpx"> |
|
|
<text style="flex-shrink: 0; width: 25%">批次:</text> |
|
|
<text style="flex-shrink: 0; width: 25%">批次:</text> |
|
|
<uni-easyinput v-model="batch"></uni-easyinput> |
|
|
<u-input v-model="batch"></u-input> |
|
|
<view class=""> |
|
|
<view class=""> |
|
|
<image src="" mode="" style="width: 40rpx; height: 40rpx; margin-left: 20rpx" @click="showSelectLine"> </image> |
|
|
<image src="" mode="" style="width: 40rpx; height: 40rpx; margin-left: 20rpx" @click="showSelectLine"> </image> |
|
|
</view> |
|
|
</view> |
|
@ -107,12 +107,12 @@ |
|
|
<button class="btn_edit_big_confirm" hover-class="btn_edit_big_after" @click="confirm()">确认</button> |
|
|
<button class="btn_edit_big_confirm" hover-class="btn_edit_big_after" @click="confirm()">确认</button> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
</uni-popup> |
|
|
</u-popup> |
|
|
<comMessage ref="comMessage"></comMessage> |
|
|
<comMessage ref="comMessage"></comMessage> |
|
|
</view> |
|
|
</view> |
|
|
</template> |
|
|
</template> |
|
|
|
|
|
|
|
|
<script> |
|
|
<script setup lang="ts"> |
|
|
import { getIssueJobByProductionline, getPlaneInfoByproductLine, getPackUnitByItemCode, getProductionlineAndWorkStation } from '@/api/request2.js' |
|
|
import { getIssueJobByProductionline, getPlaneInfoByproductLine, getPackUnitByItemCode, getProductionlineAndWorkStation } from '@/api/request2.js' |
|
|
import { getPackUnitName, getUomInfo } from '@/common/directory.js' |
|
|
import { getPackUnitName, getUomInfo } from '@/common/directory.js' |
|
|
|
|
|
|
|
@ -125,397 +125,390 @@ import packQty from '@/mycomponents/qty/packQty.vue' |
|
|
import balanceStatus from '@/mycomponents/status/balanceStatus.vue' |
|
|
import balanceStatus from '@/mycomponents/status/balanceStatus.vue' |
|
|
import winScanItem from '@/mycomponents/scan/winScanItem.vue' |
|
|
import winScanItem from '@/mycomponents/scan/winScanItem.vue' |
|
|
|
|
|
|
|
|
export default { |
|
|
import { ref, onMounted } from 'vue'; |
|
|
components: { |
|
|
import { onLoad } from '@dcloudio/uni-app'; |
|
|
uom, |
|
|
|
|
|
balanceStatus, |
|
|
const props = defineProps({ |
|
|
winScanItem, |
|
|
|
|
|
packQty |
|
|
|
|
|
}, |
|
|
|
|
|
data() { |
|
|
|
|
|
return { |
|
|
|
|
|
itemCode: '请选择物料信息', |
|
|
|
|
|
uom: '', |
|
|
|
|
|
qty: null, |
|
|
|
|
|
planQty: 0, |
|
|
|
|
|
goodQty: 0, |
|
|
|
|
|
planNumber: '', |
|
|
|
|
|
productLineCode: '', |
|
|
|
|
|
showProductLineSelect: false, |
|
|
|
|
|
productLineList: [], |
|
|
|
|
|
productionLineName: '请选择生产线', |
|
|
|
|
|
productionLineCode: '', |
|
|
|
|
|
batch: '', |
|
|
|
|
|
packUnitName: '请选择包装规格', |
|
|
|
|
|
packUnit: '', |
|
|
|
|
|
packUnitList: [], |
|
|
|
|
|
packQtyHint: '', |
|
|
|
|
|
packQty: 0, |
|
|
|
|
|
showPackUnitSelect: false, |
|
|
|
|
|
itemCodeList: [], |
|
|
|
|
|
showItemCodeSelect: false, |
|
|
|
|
|
workStationCode: '', |
|
|
|
|
|
planDate: '', |
|
|
|
|
|
showDateSelect: false, |
|
|
|
|
|
planDateList: [], |
|
|
|
|
|
fgLocationCode: '', |
|
|
|
|
|
rawLocationCode: '', |
|
|
|
|
|
putAwayRequestSwitch:true, |
|
|
|
|
|
putAwayInspectSwitch:true, |
|
|
|
|
|
EnableQms:true |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
|
|
|
props: { |
|
|
|
|
|
title: { |
|
|
title: { |
|
|
type: String, |
|
|
type: String, |
|
|
default: '开工阶段' |
|
|
default: '开工阶段' |
|
|
}, |
|
|
}, |
|
|
itemCodeTypeList: { |
|
|
itemCodeTypeList: { |
|
|
type: Array, |
|
|
type: Array, |
|
|
default: [] |
|
|
default: () => [] |
|
|
} |
|
|
} |
|
|
}, |
|
|
}); |
|
|
mounted() { |
|
|
const emit = defineEmits(['confirm']) |
|
|
this.EnableQms = getSwitchInfoByCode('EnableQms') |
|
|
|
|
|
console.log(777,this.EnableQms) |
|
|
const itemCode = ref('请选择物料信息'); |
|
|
}, |
|
|
const uom = ref(''); |
|
|
methods: { |
|
|
const qty = ref(null); |
|
|
openRequestPopup() { |
|
|
const planQty = ref(0); |
|
|
this.initData() |
|
|
const goodQty = ref(0); |
|
|
this.planDate = getCurrDate() |
|
|
const planNumber = ref(''); |
|
|
// this.batch = getBatch8() |
|
|
const productLineCode = ref(''); |
|
|
this.batch = this.planDate.replace('-', '').replace('-', ''); |
|
|
const showProductLineSelect = ref(false); |
|
|
this.$refs.popup.open('bottom') |
|
|
const productLineList = ref([]); |
|
|
}, |
|
|
const productionLineName = ref('请选择生产线'); |
|
|
|
|
|
const productionLineCode = ref(''); |
|
|
initData() { |
|
|
const batch = ref(''); |
|
|
this.itemCode = '请选择物料信息' |
|
|
const packUnitName = ref('请选择包装规格'); |
|
|
this.uom = '' |
|
|
const packUnit = ref(''); |
|
|
this.planQty = 0 |
|
|
const packUnitList = ref([]); |
|
|
this.goodQty = 0 |
|
|
const packQtyHint = ref(''); |
|
|
this.packQty = 0 |
|
|
const packQty = ref(0); |
|
|
this.planNumber = '' |
|
|
const showPackUnitSelect = ref(false); |
|
|
this.productLineCode = '' |
|
|
const itemCodeList = ref([]); |
|
|
this.showProductLineSelect = false |
|
|
const showItemCodeSelect = ref(false); |
|
|
this.productLineList = [] |
|
|
const workStationCode = ref(''); |
|
|
this.productionLineName = '请选择生产线' |
|
|
const planDate = ref(''); |
|
|
this.productionLineCode = '' |
|
|
const showDateSelect = ref(false); |
|
|
this.batch = '' |
|
|
const planDateList = ref([]); |
|
|
this.packUnitName = '请选择包装规格' |
|
|
const fgLocationCode = ref(''); |
|
|
;(this.packUnit = ''), (this.packQtyHint = '') |
|
|
const rawLocationCode = ref(''); |
|
|
this.showPackUnitSelect = false |
|
|
const putAwayRequestSwitch = ref(true); |
|
|
// this.packUnitList = [] |
|
|
const putAwayInspectSwitch = ref(true); |
|
|
this.itemCodeList = [] |
|
|
const EnableQms = ref(true); |
|
|
this.showItemCodeSelect = false |
|
|
const show = ref(false) |
|
|
this.workStationCode = '' |
|
|
const itemCodeFocus = ref(false) |
|
|
this.planDate = '' |
|
|
const popup = ref(null); |
|
|
this.showDateSelect = false |
|
|
const comMessage = ref(null); |
|
|
this.planDateList = [] |
|
|
onMounted(() => { |
|
|
this.fgLocationCode = '' |
|
|
EnableQms.value = getSwitchInfoByCode('EnableQms'); |
|
|
this.rawLocationCode = '' |
|
|
console.log(777, EnableQms.value); |
|
|
this.putAwayRequestSwitch=true |
|
|
}); |
|
|
this.putAwayInspectSwitch=true |
|
|
|
|
|
}, |
|
|
const openRequestPopup = () => { |
|
|
|
|
|
initData(); |
|
|
closeRequestPopup() { |
|
|
planDate.value = getCurrDate(); |
|
|
this.$refs.popup.close() |
|
|
batch.value = planDate.value.replace('-', '').replace('-', ''); |
|
|
}, |
|
|
show.value = true |
|
|
|
|
|
}; |
|
|
itemCodeLoseFocus() { |
|
|
|
|
|
this.itemCodeFocus = false |
|
|
const initData = () => { |
|
|
}, |
|
|
itemCode.value = '请选择物料信息'; |
|
|
|
|
|
uom.value = ''; |
|
|
confirm() { |
|
|
planQty.value = 0; |
|
|
if (!this.planDate) { |
|
|
goodQty.value = 0; |
|
|
this.showErrorMessage('请先选择计划日期') |
|
|
packQty.value = 0; |
|
|
return |
|
|
planNumber.value = ''; |
|
|
|
|
|
productLineCode.value = ''; |
|
|
|
|
|
showProductLineSelect.value = false; |
|
|
|
|
|
productLineList.value = []; |
|
|
|
|
|
productionLineName.value = '请选择生产线'; |
|
|
|
|
|
productionLineCode.value = ''; |
|
|
|
|
|
batch.value = ''; |
|
|
|
|
|
packUnitName.value = '请选择包装规格'; |
|
|
|
|
|
packUnit.value = ''; |
|
|
|
|
|
packQtyHint.value = ''; |
|
|
|
|
|
showPackUnitSelect.value = false; |
|
|
|
|
|
itemCodeList.value = []; |
|
|
|
|
|
showItemCodeSelect.value = false; |
|
|
|
|
|
workStationCode.value = ''; |
|
|
|
|
|
planDate.value = ''; |
|
|
|
|
|
showDateSelect.value = false; |
|
|
|
|
|
planDateList.value = []; |
|
|
|
|
|
fgLocationCode.value = ''; |
|
|
|
|
|
rawLocationCode.value = ''; |
|
|
|
|
|
putAwayRequestSwitch.value = true; |
|
|
|
|
|
putAwayInspectSwitch.value = true; |
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
const closeRequestPopup = () => { |
|
|
|
|
|
show.value = false |
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
const itemCodeLoseFocus = () => { |
|
|
|
|
|
itemCodeFocus.value = false; |
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
const confirm = () => { |
|
|
|
|
|
if (!planDate.value) { |
|
|
|
|
|
showErrorMessage('请先选择计划日期'); |
|
|
|
|
|
return; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
if (this.productionLineName == '请选择生产线') { |
|
|
if (productionLineName.value == '请选择生产线') { |
|
|
this.showErrorMessage('请选择生产线') |
|
|
showErrorMessage('请选择生产线'); |
|
|
return |
|
|
return; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
if (!this.batch) { |
|
|
if (!batch.value) { |
|
|
this.showErrorMessage('请输入批次例如:20200101') |
|
|
showErrorMessage('请输入批次例如:20200101'); |
|
|
return |
|
|
return; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
if (this.itemCode == '请选择物料信息') { |
|
|
if (itemCode.value == '请选择物料信息') { |
|
|
this.showErrorMessage('请选择物料信息') |
|
|
showErrorMessage('请选择物料信息'); |
|
|
return |
|
|
return; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
if (this.packUnitName == '请选择包装规格') { |
|
|
if (packUnitName.value == '请选择包装规格') { |
|
|
this.showErrorMessage('请选择包装规格') |
|
|
showErrorMessage('请选择包装规格'); |
|
|
return |
|
|
return; |
|
|
} |
|
|
|
|
|
if (!this.EnableQms) { |
|
|
|
|
|
this.putAwayInspectSwitch = false |
|
|
|
|
|
} |
|
|
} |
|
|
this.callback() |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
callback() { |
|
|
if (!EnableQms.value) { |
|
|
const item = { |
|
|
putAwayInspectSwitch.value = false; |
|
|
productionLineName: this.productionLineName, |
|
|
|
|
|
productionLineCode: this.productionLineCode, // 生产线 |
|
|
|
|
|
itemCode: this.itemCode, |
|
|
|
|
|
uom: this.getUomInfo(this.uom), |
|
|
|
|
|
batch: this.batch, |
|
|
|
|
|
packUnitName: this.packUnitName, |
|
|
|
|
|
packUnit: this.packUnit, |
|
|
|
|
|
packQtyHint: this.packQtyHint, |
|
|
|
|
|
packQty: this.packQty, |
|
|
|
|
|
planQty: this.planQty, |
|
|
|
|
|
goodQty: this.goodQty, |
|
|
|
|
|
planNumber: this.planNumber, |
|
|
|
|
|
workStationCode: this.workStationCode, |
|
|
|
|
|
fgLocationCode: this.fgLocationCode, |
|
|
|
|
|
rawLocationCode: this.rawLocationCode, |
|
|
|
|
|
putAwayRequestSwitch:this.putAwayRequestSwitch, |
|
|
|
|
|
putAwayInspectSwitch:this.putAwayInspectSwitch |
|
|
|
|
|
} |
|
|
} |
|
|
this.closeRequestPopup() |
|
|
|
|
|
this.$emit('confirm', item) |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
showErrorMessage(message, type) { |
|
|
callback(); |
|
|
setTimeout((r) => { |
|
|
}; |
|
|
this.$refs.comMessage.showErrorMessage(message, (res) => {}) |
|
|
|
|
|
}) |
|
|
|
|
|
}, |
|
|
|
|
|
cancel(e) { |
|
|
|
|
|
this.closeRequestPopup() |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
confirmSelectLine(data) { |
|
|
const callback = () => { |
|
|
this.productionLineName = `${data[0].label}—${data[1].label}` |
|
|
const item = { |
|
|
this.productionLineCode = data[0].value |
|
|
productionLineName: productionLineName.value, |
|
|
this.workStationCode = data[1].value |
|
|
productionLineCode: productionLineCode.value, // 生产线 |
|
|
const parent = this.productLineList.filter((res) => res.value == this.productionLineCode) |
|
|
itemCode: itemCode.value, |
|
|
const fgLocation = parent[0].children.filter((children) => children.value == this.workStationCode) |
|
|
uom: getUomInfo(uom.value), |
|
|
this.fgLocationCode = fgLocation[0].fgLocationCode |
|
|
batch: batch.value, |
|
|
// this.clearItemCode() |
|
|
packUnitName: packUnitName.value, |
|
|
// this.clearPackUnit() |
|
|
packUnit: packUnit.value, |
|
|
this.showProductLineSelect = false |
|
|
packQtyHint: packQtyHint.value, |
|
|
this.showSelectItemCode() |
|
|
packQty: packQty.value, |
|
|
}, |
|
|
planQty: planQty.value, |
|
|
|
|
|
goodQty: goodQty.value, |
|
|
clearItemCode() { |
|
|
planNumber: planNumber.value, |
|
|
this.planDate = getCurrDate() |
|
|
workStationCode: workStationCode.value, |
|
|
this.itemCode = '请选择物料信息' |
|
|
fgLocationCode: fgLocationCode.value, |
|
|
this.uom = '' |
|
|
rawLocationCode: rawLocationCode.value, |
|
|
this.planQty = 0 |
|
|
putAwayRequestSwitch: putAwayRequestSwitch.value, |
|
|
this.goodQty = 0 |
|
|
putAwayInspectSwitch: putAwayInspectSwitch.value |
|
|
this.planNumber = '' |
|
|
}; |
|
|
this.packUnit = '' |
|
|
closeRequestPopup(); |
|
|
this.packQty = 0 |
|
|
emit('confirm', item); |
|
|
}, |
|
|
}; |
|
|
|
|
|
|
|
|
confirmSelectDate(data) { |
|
|
const showErrorMessage = (message) => { |
|
|
this.planDate = data[0].label |
|
|
setTimeout(() => { |
|
|
this.batch = this.planDate.replace('-', '').replace('-', '') |
|
|
comMessage.value.showErrorMessage(message, () => {}); |
|
|
this.afterSelectPlanData() |
|
|
}); |
|
|
}, |
|
|
}; |
|
|
|
|
|
|
|
|
showSelectDate() { |
|
|
const cancel = (e) => { |
|
|
this.showDateSelect = true |
|
|
closeRequestPopup(); |
|
|
const list = lastThreeDays(3) |
|
|
}; |
|
|
this.planDateList = [] |
|
|
|
|
|
|
|
|
const confirmSelectLine = (data) => { |
|
|
|
|
|
productionLineName.value = `${data[0].label}—${data[1].label}`; |
|
|
|
|
|
productionLineCode.value = data[0].value; |
|
|
|
|
|
workStationCode.value = data[1].value; |
|
|
|
|
|
const parent = productLineList.value.filter((res) => res.value == productionLineCode.value); |
|
|
|
|
|
const fgLocation = parent[0].children.filter((children) => children.value == workStationCode.value); |
|
|
|
|
|
fgLocationCode.value = fgLocation[0].fgLocationCode; |
|
|
|
|
|
showProductLineSelect.value = false; |
|
|
|
|
|
showSelectItemCode(); |
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
const clearItemCode = () => { |
|
|
|
|
|
planDate.value = getCurrDate(); |
|
|
|
|
|
itemCode.value = '请选择物料信息'; |
|
|
|
|
|
uom.value = ''; |
|
|
|
|
|
planQty.value = 0; |
|
|
|
|
|
goodQty.value = 0; |
|
|
|
|
|
planNumber.value = ''; |
|
|
|
|
|
packUnit.value = ''; |
|
|
|
|
|
packQty.value = 0; |
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
const confirmSelectDate = (data) => { |
|
|
|
|
|
planDate.value = data[0].label; |
|
|
|
|
|
batch.value = planDate.value.replace('-', '').replace('-', ''); |
|
|
|
|
|
afterSelectPlanData(); |
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
const showSelectDate = () => { |
|
|
|
|
|
showDateSelect.value = true; |
|
|
|
|
|
const list = lastThreeDays(3); |
|
|
|
|
|
planDateList.value = []; |
|
|
list.forEach((res) => { |
|
|
list.forEach((res) => { |
|
|
this.planDateList.push({ |
|
|
planDateList.value.push({ |
|
|
label: res, |
|
|
label: res, |
|
|
value: '' |
|
|
value: '' |
|
|
}) |
|
|
}); |
|
|
}) |
|
|
}); |
|
|
}, |
|
|
}; |
|
|
|
|
|
|
|
|
showSelectLine() { |
|
|
const showSelectLine = () => { |
|
|
if (this.productLineList.length == 0) { |
|
|
if (productLineList.value.length == 0) { |
|
|
uni.showLoading({ |
|
|
uni.showLoading({ |
|
|
title: '加载中', |
|
|
title: '加载中', |
|
|
mask: true |
|
|
mask: true |
|
|
}) |
|
|
}); |
|
|
getProductionlineAndWorkStation() |
|
|
getProductionlineAndWorkStation() |
|
|
.then((res) => { |
|
|
.then((res) => { |
|
|
uni.hideLoading() |
|
|
uni.hideLoading(); |
|
|
if (res.data && res.data.length > 0) { |
|
|
if (res.data && res.data.length > 0) { |
|
|
this.productLineList = res.data |
|
|
productLineList.value = res.data; |
|
|
this.showProductLineSelect = true |
|
|
showProductLineSelect.value = true; |
|
|
} else { |
|
|
} else { |
|
|
this.showErrorMessage('未查找到生产线信息') |
|
|
showErrorMessage('未查找到生产线信息'); |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
.catch((error) => { |
|
|
.catch((error) => { |
|
|
uni.hideLoading() |
|
|
uni.hideLoading(); |
|
|
this.showErrorMessage(error) |
|
|
showErrorMessage(error); |
|
|
}) |
|
|
}); |
|
|
} else { |
|
|
} else { |
|
|
this.showProductLineSelect = true |
|
|
showProductLineSelect.value = true; |
|
|
} |
|
|
} |
|
|
}, |
|
|
}; |
|
|
|
|
|
|
|
|
afterSelectPlanData() { |
|
|
const afterSelectPlanData = () => { |
|
|
this.itemCode = '请选择物料信息' |
|
|
itemCode.value = '请选择物料信息'; |
|
|
this.packUnit = '' |
|
|
packUnit.value = ''; |
|
|
this.packQty = 0 |
|
|
packQty.value = 0; |
|
|
this.planQty = 0 |
|
|
planQty.value = 0; |
|
|
this.itemCode = '请选择物料信息' |
|
|
itemCode.value = '请选择物料信息'; |
|
|
this.uom = '' |
|
|
uom.value = ''; |
|
|
this.packUnitName = '请选择包装规格' |
|
|
packUnitName.value = '请选择包装规格'; |
|
|
this.packUnit = '' |
|
|
packUnit.value = ''; |
|
|
this.packQtyHint = '' |
|
|
packQtyHint.value = ''; |
|
|
|
|
|
|
|
|
// this.packUnitList = [] |
|
|
itemCodeList.value = []; |
|
|
this.itemCodeList = [] |
|
|
showSelectItemCode(); |
|
|
this.showSelectItemCode() |
|
|
putAwayRequestSwitch.value = true; |
|
|
this.putAwayRequestSwitch=true |
|
|
putAwayInspectSwitch.value = true; |
|
|
this.putAwayInspectSwitch=true |
|
|
}; |
|
|
}, |
|
|
|
|
|
|
|
|
const showItemList = () => { |
|
|
showItemList() { |
|
|
showItemCodeSelect.value = true; |
|
|
this.showItemCodeSelect = true |
|
|
}; |
|
|
}, |
|
|
|
|
|
|
|
|
const showSelectItemCode = () => { |
|
|
showSelectItemCode() { |
|
|
if (!planDate.value) { |
|
|
if (!this.planDate) { |
|
|
showErrorMessage('请先选择计划日期'); |
|
|
this.showErrorMessage('请先选择计划日期') |
|
|
return; |
|
|
return |
|
|
|
|
|
} |
|
|
} |
|
|
if (!this.productionLineCode) { |
|
|
if (!productionLineCode.value) { |
|
|
this.showErrorMessage('请先选择生产线') |
|
|
showErrorMessage('请先选择生产线'); |
|
|
return |
|
|
return; |
|
|
} |
|
|
} |
|
|
uni.showLoading({ |
|
|
uni.showLoading({ |
|
|
title: '加载中', |
|
|
title: '加载中', |
|
|
mask: true |
|
|
mask: true |
|
|
}) |
|
|
}); |
|
|
getPlaneInfoByproductLine(this.productionLineCode, this.planDate) |
|
|
getPlaneInfoByproductLine(productionLineCode.value, planDate.value) |
|
|
.then((res) => { |
|
|
.then((res) => { |
|
|
uni.hideLoading() |
|
|
uni.hideLoading(); |
|
|
if (res.data && res.data.length > 0) { |
|
|
if (res.data && res.data.length > 0) { |
|
|
res.data.forEach((item) => { |
|
|
res.data.forEach((item) => { |
|
|
item.label = `${item.itemCode}(${item.planQty}${this.getUomInfo(item.uom)})` |
|
|
item.label = `${item.itemCode}(${item.planQty}${getUomInfo(item.uom)})`; |
|
|
item.value = item |
|
|
item.value = item; |
|
|
}) |
|
|
}); |
|
|
this.itemCodeList = res.data |
|
|
itemCodeList.value = res.data; |
|
|
// this.showItemCodeSelect = true |
|
|
if (itemCodeList.value.length == 1) { |
|
|
|
|
|
confirmSelectItem([itemCodeList.value[0]]); |
|
|
if (this.itemCodeList.length == 1) { |
|
|
|
|
|
this.confirmSelectItem([this.itemCodeList[0]]) |
|
|
|
|
|
// this.itemCode = this.itemCodeList[0].itemCode |
|
|
|
|
|
} else { |
|
|
} else { |
|
|
this.showItemCodeSelect = true |
|
|
showItemCodeSelect.value = true; |
|
|
} |
|
|
} |
|
|
} else { |
|
|
} else { |
|
|
this.showErrorMessage(`未查找到该生产线在【${this.planDate}】日期的生产计划`) |
|
|
showErrorMessage(`未查找到该生产线在【${planDate.value}】日期的生产计划`); |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
.catch((error) => { |
|
|
.catch((error) => { |
|
|
uni.hideLoading() |
|
|
uni.hideLoading(); |
|
|
this.showErrorMessage(error) |
|
|
showErrorMessage(error); |
|
|
}) |
|
|
}); |
|
|
}, |
|
|
}; |
|
|
|
|
|
|
|
|
confirmSelectItem(data) { |
|
|
const confirmSelectItem = (data) => { |
|
|
const productionPlan = data[0].value |
|
|
const productionPlan = data[0].value; |
|
|
this.itemCode = productionPlan.itemCode |
|
|
itemCode.value = productionPlan.itemCode; |
|
|
this.uom = productionPlan.uom |
|
|
uom.value = productionPlan.uom; |
|
|
this.planQty = productionPlan.planQty |
|
|
planQty.value = productionPlan.planQty; |
|
|
this.goodQty = productionPlan.goodQty |
|
|
goodQty.value = productionPlan.goodQty; |
|
|
this.planNumber = productionPlan.number |
|
|
planNumber.value = productionPlan.number; |
|
|
|
|
|
|
|
|
// 清除其他数据 |
|
|
clearPackUnit(); |
|
|
this.clearPackUnit() |
|
|
|
|
|
uni.showLoading({ |
|
|
uni.showLoading({ |
|
|
title: '加载中', |
|
|
title: '加载中', |
|
|
mask: true |
|
|
mask: true |
|
|
}) |
|
|
}); |
|
|
getPackUnitByItemCode(this.itemCode) |
|
|
getPackUnitByItemCode(itemCode.value) |
|
|
.then((res) => { |
|
|
.then((res) => { |
|
|
uni.hideLoading() |
|
|
uni.hideLoading(); |
|
|
if (res.data && res.data.list.length > 0) { |
|
|
if (res.data && res.data.list.length > 0) { |
|
|
res.data.list.forEach((item) => { |
|
|
res.data.list.forEach((item) => { |
|
|
item.value = item.packUnit |
|
|
item.value = item.packUnit; |
|
|
item.label = `${getPackUnitName(item.packUnit)}(${item.packQty}${this.getUomInfo(item.uom)})` |
|
|
item.label = `${getPackUnitName(item.packUnit)}(${item.packQty}${getUomInfo(item.uom)})`; |
|
|
}) |
|
|
}); |
|
|
this.packUnitList = res.data.list |
|
|
packUnitList.value = res.data.list; |
|
|
const defaultData = res.data.list.filter((item) => item.defaultPackageunit == 'TRUE') |
|
|
const defaultData = res.data.list.filter((item) => item.defaultPackageunit == 'TRUE'); |
|
|
this.confirmSelectPackUnit(defaultData) |
|
|
confirmSelectPackUnit(defaultData); |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
.catch((error) => { |
|
|
.catch((error) => { |
|
|
uni.hideLoading() |
|
|
uni.hideLoading(); |
|
|
}) |
|
|
}); |
|
|
}, |
|
|
}; |
|
|
|
|
|
|
|
|
clearPackUnit() { |
|
|
const clearPackUnit = () => { |
|
|
this.packUnitName = '请选择包装规格' |
|
|
packUnitName.value = '请选择包装规格'; |
|
|
this.packUnit = '' |
|
|
packUnit.value = ''; |
|
|
const pack = this.packUnitList.filter((r) => r.packUnit == this.packUnit) |
|
|
const pack = packUnitList.value.filter((r) => r.packUnit == packUnit.value); |
|
|
this.packQtyHint = '' |
|
|
packQtyHint.value = ''; |
|
|
this.packQty = 0 |
|
|
packQty.value = 0; |
|
|
}, |
|
|
}; |
|
|
|
|
|
|
|
|
showSelectPackUnit() { |
|
|
const showSelectPackUnit = () => { |
|
|
if (this.itemCode == '请选择物料信息') { |
|
|
if (itemCode.value == '请选择物料信息') { |
|
|
this.showErrorMessage('请先选择物料') |
|
|
showErrorMessage('请先选择物料'); |
|
|
return |
|
|
return; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
uni.showLoading({ |
|
|
uni.showLoading({ |
|
|
title: '加载中', |
|
|
title: '加载中', |
|
|
mask: true |
|
|
mask: true |
|
|
}) |
|
|
}); |
|
|
getPackUnitByItemCode(this.itemCode) |
|
|
getPackUnitByItemCode(itemCode.value) |
|
|
.then((res) => { |
|
|
.then((res) => { |
|
|
uni.hideLoading() |
|
|
uni.hideLoading(); |
|
|
if (res.data && res.data.list.length > 0) { |
|
|
if (res.data && res.data.list.length > 0) { |
|
|
res.data.list.forEach((item) => { |
|
|
res.data.list.forEach((item) => { |
|
|
item.value = item.packUnit |
|
|
item.value = item.packUnit; |
|
|
item.label = `${getPackUnitName(item.packUnit)}(${item.packQty}${this.getUomInfo(item.uom)})` |
|
|
item.label = `${getPackUnitName(item.packUnit)}(${item.packQty}${getUomInfo(item.uom)})`; |
|
|
}) |
|
|
}); |
|
|
this.packUnitList = res.data.list |
|
|
packUnitList.value = res.data.list; |
|
|
this.showPackUnitSelect = true |
|
|
showPackUnitSelect.value = true; |
|
|
} else { |
|
|
} else { |
|
|
this.showErrorMessage('未查找到包装信息') |
|
|
showErrorMessage('未查找到包装信息'); |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
.catch((error) => { |
|
|
.catch((error) => { |
|
|
uni.hideLoading() |
|
|
uni.hideLoading(); |
|
|
this.showErrorMessage(error) |
|
|
showErrorMessage(error); |
|
|
}) |
|
|
}); |
|
|
}, |
|
|
}; |
|
|
|
|
|
|
|
|
confirmSelectPackUnit(data) { |
|
|
const confirmSelectPackUnit = (data) => { |
|
|
this.packUnitName = data[0].label |
|
|
packUnitName.value = data[0].label; |
|
|
this.packUnit = data[0].value |
|
|
packUnit.value = data[0].value; |
|
|
const pack = this.packUnitList.filter((r) => r.packUnit == this.packUnit) |
|
|
const pack = packUnitList.value.filter((r) => r.packUnit == packUnit.value); |
|
|
this.packQtyHint = `${pack[0].packQty}(${this.getUomInfo(pack[0].uom)})` |
|
|
packQtyHint.value = `${pack[0].packQty}(${getUomInfo(pack[0].uom)})`; |
|
|
this.packQty = pack[0].packQty |
|
|
packQty.value = pack[0].packQty; |
|
|
}, |
|
|
}; |
|
|
|
|
|
|
|
|
getUomInfo(uom) { |
|
|
const getUomInfo = (uom) => { |
|
|
const item = getUomInfo(uom) |
|
|
const item = getUomInfo(uom); |
|
|
if (item == '') { |
|
|
if (item == '') { |
|
|
return uom |
|
|
return uom; |
|
|
} |
|
|
} |
|
|
return item.label |
|
|
return item.label; |
|
|
}, |
|
|
}; |
|
|
switchPutAwayRequest(value){ |
|
|
|
|
|
console.log(value) |
|
|
const switchPutAwayRequest = (value) => { |
|
|
console.log("打印"+this.putAwayRequestSwitch) |
|
|
console.log(value); |
|
|
this.putAwayRequestSwitch =value; |
|
|
console.log("打印" + putAwayRequestSwitch.value); |
|
|
}, |
|
|
putAwayRequestSwitch.value = value; |
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
const switchPutAwayInspect = (value) => { |
|
|
|
|
|
console.log(value); |
|
|
|
|
|
putAwayInspectSwitch.value = value; |
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
switchPutAwayInspect(value){ |
|
|
|
|
|
console.log(value) |
|
|
|
|
|
this.putAwayInspectSwitch =value; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
</script> |
|
|
</script> |
|
|
|
|
|
|
|
|
<style lang="scss"> |
|
|
<style lang="scss"> |
|
|