fix(自动拆包机托盘上料):AGV原料粒子人工呼叫

This commit is contained in:
liaohechuan 2025-05-28 14:19:50 +08:00
parent 91c2586580
commit bea5ec5139
3 changed files with 72 additions and 4 deletions

View File

@ -39,3 +39,11 @@ export function getMaterialLotByResource (query) {
params: query
})
}
export function getItemByMaterialLot (query) {
return request({
url: iep('/z-task-detail/getItemByMaterialLot'),
method: 'get',
params: query
})
}

View File

@ -62,6 +62,14 @@ export function agvReelingManualCall(data) {
})
}
export function agvMaterialCall(data) {
return request({
url: iep('/jm-auto-reeling/agv-material-call'),
method: 'post',
data: data
})
}
export function nextStep(query) {
return request({
url: iep('/router-step/next/step'),

View File

@ -49,7 +49,7 @@
</el-col>
<el-col :span="12">
<el-form-item label="托盘号/条码号" prop="carrierOrInventory">
<el-input v-model="mainForm.carrierOrInventory">
<el-input v-model="mainForm.carrierOrInventory" @change="carrierOrInventoryBlur">
<i v-if="showCarrierOrInventoryInput === 'Y'"
slot="suffix"
class="el-input__icon el-icon-copy-document"
@ -117,8 +117,8 @@
<script>
import {clearValidate} from '@/util/util'
import {showLoading, hideLoading} from '@/const/loading'
import {agvReelingManualCall} from '@/api/mes/wip-nalinv/jm-auto-reeling';
import {subResource, getMaterialLotByResource} from "@/api/mes/smd/eqp-combine";
import {agvMaterialCall} from '@/api/mes/wip-nalinv/jm-auto-reeling';
import {subResource, getMaterialLotByResource, getItemByMaterialLot} from "@/api/mes/smd/eqp-combine";
import {subResourceDialogObj, carrierOrInventoryDialogObj} from "@/views/mes/wip/resource-feeding-extension/init";
import {isBlank} from "@/util/string";
import {fetchCustomFieldsByResrce} from "@/api/mes/prd/operation-out";
@ -160,6 +160,7 @@ export default {
this.mainForm = this.form
this.mainForm.subResource = ''
this.mainForm.carrierOrInventory = ''
this.mainForm = Object.assign({}, this.mainForm)
this.showCarrierOrInventoryInput = 'N'
this.processTaskTypeList()
this.handleTaskTypeChange(this.form.taskType, true)
@ -176,6 +177,33 @@ export default {
},
},
methods: {
// 条码号失去焦点
carrierOrInventoryBlur() {
if (!this.mainForm.carrierOrInventory) {
return this.$message.warning("请先输入或扫描托盘号/条码号!");
}
showLoading();
getItemByMaterialLot({
materialLot: this.mainForm.carrierOrInventory
}).then((response) => {
hideLoading();
if (response.data.code !== 0) {
this.$message.error(response.data.message);
} else {
if (!response.data.data) {
this.$message.error(`条码号[${this.mainForm.carrierOrInventory}]不存在!`);
this.mainForm.carrierOrInventory = '';
} else {
this.mainForm.item = response.data.data.item;
this.mainForm.itemDesc = response.data.data.itemDesc;
this.mainForm.qtyOnHand = response.data.data.qtyOnHand;
}
this.mainForm = Object.assign({}, this.mainForm)
}
}).catch(() => {
hideLoading();
});
},
// 開窗
showDialog(key) {
let me = this;
@ -203,13 +231,36 @@ export default {
let me = this;
me.mainForm.subResource = row.resrce;
me.mainForm.carrierOrInventory = '';
this.mainForm.item = '';
this.mainForm.itemDesc = '';
this.mainForm.qtyOnHand = '';
me.getCustomFieldsByResrce(me.site, row.resrce, "IS_CACHE_LOCATION");
// 调用查询条码
showLoading();
getMaterialLotByResource({
subResource: me.mainForm.subResource
}).then((response) => {
hideLoading();
if (response.data.code !== 0) {
this.$message.error(response.data.message);
} else {
if (response.data.data.length === 1) {
me.mainForm.carrierOrInventory = response.data.data[0].materialLot;
// 调用获取物料信息
this.carrierOrInventoryBlur();
}
}
}).catch(() => {
hideLoading();
});
},
// 托盘号/条码号選擇開窗資料
carrierOrInventorySelected(row) {
let me = this;
me.mainForm.carrierOrInventory = row.materialLot;
this.mainForm = Object.assign({}, this.mainForm)
// 调用获取物料信息
this.carrierOrInventoryBlur();
},
// 获取设备自定义字段
getCustomFieldsByResrce(site, resrce, fieldName) {
@ -281,8 +332,9 @@ export default {
let me = this;
let params = Object.assign({}, me.mainForm);
params.resrce = params.resource;
params.lotNo = params.carrierOrInventory;
showLoading();
agvReelingManualCall(params).then(res => {
agvMaterialCall(params).then(res => {
hideLoading();
if (res.data.code !== 0) {
return this.$message.error(res.data.msg);