This commit is contained in:
2023-11-02 13:35:49 +08:00
parent 60c6131cfe
commit f68efe6a96
18 changed files with 154 additions and 88 deletions

View File

@@ -45,9 +45,7 @@
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item
label="选择起点位置"
prop="startInfo">
<el-form-item label="选择起点位置" prop="startInfo">
<el-select
v-model="dataForm.startInfo"
style="width: 100%"
@@ -57,7 +55,9 @@
v-for="item in potArr"
:key="item.id"
:label="item.lineEdgeLibraryCode"
:value="item.lineEdgeLibraryCode+'-'+item.agvGroundCode" />
:value="
item.lineEdgeLibraryCode + '-' + item.agvGroundCode
" />
</el-select>
</el-form-item>
</el-col>
@@ -256,7 +256,7 @@ export default {
this.dataForm.warehouseStorehouseCode = val.warehouseStorehouseCode;
this.dataForm.process = val.process;
this.dataForm.trayCode = val.trayCode;
this.dataForm.startInfo = ''
this.dataForm.startInfo = '';
this.initData();
this.visible = true;
getLineList().then((response) => {
@@ -326,31 +326,37 @@ export default {
},
// 表单提交
dataFormSubmit() {
let tableValid = false;
this.productAttributeList.forEach((item) => {
item.id = '';
item.warehouseStorehouseId = this.dataForm.id;
item.warehouseId = '';
});
this.updata.process = this.dataForm.process;
this.updata.trayCode = this.dataForm.trayCode;
this.updata.lineEdgeLibraryCode =
this.dataForm.startInfo.split('-')[0];
this.updata.agvGroundCode =
this.dataForm.startInfo.split('-')[1];
this.$refs['dataForm'].validate((valid) => {
if (valid) {
// 修改的提交
this.updata.list = this.productAttributeList;
if (this.dataForm.id) {
inWarehouseStorehouse(this.updata).then((response) => {
this.$modal.msgSuccess('修改成功');
this.visible = false;
this.$emit('refreshDataList');
});
return;
}
if (!item.number) {
tableValid = true;
}
});
if (!tableValid) {
this.updata.process = this.dataForm.process;
this.updata.trayCode = this.dataForm.trayCode;
this.updata.lineEdgeLibraryCode = this.dataForm.startInfo.split('-')[0];
this.updata.agvGroundCode = this.dataForm.startInfo.split('-')[1];
this.$refs['dataForm'].validate((valid) => {
if (valid) {
// 修改的提交
this.updata.list = this.productAttributeList;
if (this.dataForm.id) {
inWarehouseStorehouse(this.updata).then((response) => {
this.$modal.msgSuccess('修改成功');
this.visible = false;
this.$emit('refreshDataList');
});
return;
}
}
});
} else {
this.$modal.msgWarning('产品信息的数量为必填数据!');
}
},
// 新增 / 修改
addNew(index) {

View File

@@ -2,7 +2,7 @@
* @Author: zwq
* @Date: 2021-11-18 14:16:25
* @LastEditors: zwq
* @LastEditTime: 2023-10-20 15:36:19
* @LastEditTime: 2023-11-02 11:15:57
* @Description:
-->
<template>
@@ -34,8 +34,11 @@ import basicAdd from '../mixins/basic-add';
import {
getWarehouseStorehouseList,
moveStorehouse,
outWarehouseStorehouse,
getLineList,
getWarehouseStorehouse,
} from '@/api/asrs/warehouseStorehouse';
import { getWarehouseStorehouseGoodsSpecificationPage } from '@/api/asrs/warehouseStorehouseGoodsSpecification';
export default {
mixins: [basicAdd],
@@ -46,6 +49,9 @@ export default {
sourceId: undefined,
targetId: undefined,
},
wareInfo: {
list:[]
},
potArr: [],
type: 0,
dataRule: {
@@ -56,14 +62,14 @@ export default {
};
},
methods: {
init(id, type,wId) {
init(id, type, wId) {
this.dataForm.sourceId = id || '';
this.type = type;
this.visible = true;
this.$nextTick(() => {
this.$refs['dataForm'].resetFields();
if (this.type) {
getWarehouseStorehouseList({warehouseId:wId}).then((response) => {
getWarehouseStorehouseList({ warehouseId: wId,warehouseStorehouseState:0 }).then((response) => {
this.potArr = response.data;
});
return;
@@ -71,6 +77,18 @@ export default {
getLineList().then((response) => {
this.potArr = response.data;
});
getWarehouseStorehouse(id).then((response) => {
this.wareInfo = response.data;
});
const par = {
pageSize: 100,
pageNo: 1,
total: 1,
warehouseStorehouseId: id,
};
getWarehouseStorehouseGoodsSpecificationPage(par).then((response) => {
this.wareInfo.list = response.data.list;
});
});
},
// 表单提交
@@ -82,13 +100,28 @@ export default {
if (this.type) {
moveStorehouse(this.dataForm.sourceId, this.dataForm.targetId).then(
(response) => {
this.$modal.msgSuccess('修改成功');
this.$modal.msgSuccess('移库成功');
this.visible = false;
this.$emit('refreshDataList');
}
);
return;
}
const pos = this.potArr.find((item) => {
return item.id === this.dataForm.targetId;
});
this.wareInfo.agvGroundCode = pos.agvGroundCode;
this.wareInfo.lineEdgeLibraryCode = pos.lineEdgeLibraryCode;
// const data = {
// id: this.dataForm.sourceId,
// agvGroundCode: position.agvGroundCode,
// lineEdgeLibraryCode: position.lineEdgeLibraryCode,
// };
outWarehouseStorehouse(this.wareInfo).then((response) => {
this.$modal.msgSuccess('出库成功');
this.visible = false;
this.$emit('refreshDataList');
});
});
},
},