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