|
@@ -68,10 +68,10 @@
|
|
<template #default="scope">
|
|
<template #default="scope">
|
|
<!-- 这里放置操作按钮 -->
|
|
<!-- 这里放置操作按钮 -->
|
|
<div class="button-group">
|
|
<div class="button-group">
|
|
- <el-button type="primary" @click="edit(scope.row)" icon="el-icon-edit" circle>编辑</el-button>
|
|
|
|
- <el-button type="primary" @click="view(scope.row)" icon="el-icon-edit" circle>查看</el-button>
|
|
|
|
- <el-button type="danger" @click="orderDelete(scope.row)" icon="el-icon-delete" circle>删除</el-button>
|
|
|
|
- <el-button type="primary" @click="toDo(scope.row)" icon="el-icon-check" circle>执行</el-button>
|
|
|
|
|
|
+ <el-button type="primary" @click="edit(scope.row)" icon="el-icon-edit" >编辑</el-button>
|
|
|
|
+ <!--<el-button type="primary" @click="view(scope.row)" icon="el-icon-edit" >查看</el-button>-->
|
|
|
|
+ <el-button type="danger" @click="orderDelete(scope.row)" icon="el-icon-delete" >删除</el-button>
|
|
|
|
+ <el-button type="primary" @click="toDo(scope.row.id)" icon="el-icon-check" >执行</el-button>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
@@ -114,6 +114,7 @@
|
|
highlight-current-row max-height="500" style="width: 100%;"
|
|
highlight-current-row max-height="500" style="width: 100%;"
|
|
:default-sort="{prop: 'createDate', order: 'descending'}"
|
|
:default-sort="{prop: 'createDate', order: 'descending'}"
|
|
@selection-change="handleSelectionChange" :disabled="isViewMode">
|
|
@selection-change="handleSelectionChange" :disabled="isViewMode">
|
|
|
|
+
|
|
<el-table-column prop="materialCode" label="物料编码" :show-overflow-tooltip="true"></el-table-column>
|
|
<el-table-column prop="materialCode" label="物料编码" :show-overflow-tooltip="true"></el-table-column>
|
|
<el-table-column prop="materialName" label="物料名称" :show-overflow-tooltip="true"></el-table-column>
|
|
<el-table-column prop="materialName" label="物料名称" :show-overflow-tooltip="true"></el-table-column>
|
|
<el-table-column prop="planAmount" label="计划出库数量" :show-overflow-tooltip="true">
|
|
<el-table-column prop="planAmount" label="计划出库数量" :show-overflow-tooltip="true">
|
|
@@ -175,6 +176,14 @@
|
|
<el-table-column prop="materialCode" label="物料编码" :show-overflow-tooltip="true"></el-table-column>
|
|
<el-table-column prop="materialCode" label="物料编码" :show-overflow-tooltip="true"></el-table-column>
|
|
<el-table-column prop="materialName" label="物料名称" :show-overflow-tooltip="true"></el-table-column>
|
|
<el-table-column prop="materialName" label="物料名称" :show-overflow-tooltip="true"></el-table-column>
|
|
<el-table-column prop="planAmount" label="计划出库数量" :show-overflow-tooltip="true"></el-table-column>
|
|
<el-table-column prop="planAmount" label="计划出库数量" :show-overflow-tooltip="true"></el-table-column>
|
|
|
|
+ <el-table-column prop="realAmount" label="已入库数量" :show-overflow-tooltip="true"></el-table-column>
|
|
|
|
+ <el-table-column prop="status" label="状态" :show-overflow-tooltip="true">
|
|
|
|
+ <template slot-scope="{ row }">
|
|
|
|
+ <el-tag >
|
|
|
|
+ {{ getTypeText(row.status) }}
|
|
|
|
+ </el-tag>
|
|
|
|
+ </template>
|
|
|
|
+ </el-table-column>
|
|
</el-table>
|
|
</el-table>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
@@ -183,8 +192,8 @@
|
|
<el-table ref="singleTable" :data="detailListTask" v-loading="loading" :border=true label="库存明细"
|
|
<el-table ref="singleTable" :data="detailListTask" v-loading="loading" :border=true label="库存明细"
|
|
tooltip-effect="dark"
|
|
tooltip-effect="dark"
|
|
highlight-current-row max-height="500" style="width: 100%;"
|
|
highlight-current-row max-height="500" style="width: 100%;"
|
|
- :default-sort="{prop: 'createDate', order: 'descending'}"
|
|
|
|
- ><!--@row-click="rowClick"-->
|
|
|
|
|
|
+ :default-sort="{prop: 'createDate', order: 'descending'}" @row-click="rowClick"
|
|
|
|
+ ><!---->
|
|
<el-table-column prop="materialCode" label="物料编码" :show-overflow-tooltip="true"></el-table-column>
|
|
<el-table-column prop="materialCode" label="物料编码" :show-overflow-tooltip="true"></el-table-column>
|
|
<el-table-column prop="storageLocationCode" label="库位编码" :show-overflow-tooltip="true"></el-table-column>
|
|
<el-table-column prop="storageLocationCode" label="库位编码" :show-overflow-tooltip="true"></el-table-column>
|
|
<el-table-column label="托盘" :show-overflow-tooltip="true">
|
|
<el-table-column label="托盘" :show-overflow-tooltip="true">
|
|
@@ -337,11 +346,11 @@
|
|
this.currentPageSize = pageSize;
|
|
this.currentPageSize = pageSize;
|
|
this.queryClick();
|
|
this.queryClick();
|
|
},
|
|
},
|
|
- initOrder(){
|
|
|
|
- return{
|
|
|
|
- orderName:'',
|
|
|
|
- orderCode:'',
|
|
|
|
- detailType:''
|
|
|
|
|
|
+ initOrder() {
|
|
|
|
+ return {
|
|
|
|
+ orderName: '',
|
|
|
|
+ orderCode: '',
|
|
|
|
+ detailType: ''
|
|
}
|
|
}
|
|
},
|
|
},
|
|
handleCurrentChange(page) {
|
|
handleCurrentChange(page) {
|
|
@@ -378,10 +387,10 @@
|
|
this.loading = true;
|
|
this.loading = true;
|
|
|
|
|
|
axios.get('/order/inList', {
|
|
axios.get('/order/inList', {
|
|
- params:{
|
|
|
|
|
|
+ params: {
|
|
page: this.currentPage,
|
|
page: this.currentPage,
|
|
size: this.currentPageSize,
|
|
size: this.currentPageSize,
|
|
- inOutType:1,
|
|
|
|
|
|
+ inOutType: 1,
|
|
}
|
|
}
|
|
})
|
|
})
|
|
.then(response => {
|
|
.then(response => {
|
|
@@ -421,43 +430,39 @@
|
|
|
|
|
|
}, getDetailTypeText(status) {
|
|
}, getDetailTypeText(status) {
|
|
switch (status) {
|
|
switch (status) {
|
|
- case 0:
|
|
|
|
- return "采购入库";
|
|
|
|
case 1:
|
|
case 1:
|
|
- return "退货入库";
|
|
|
|
|
|
+ return "订单出库";
|
|
case 2:
|
|
case 2:
|
|
- return "生产入库";
|
|
|
|
|
|
+ return "生产出库";
|
|
case 3:
|
|
case 3:
|
|
- return "调拨入库";
|
|
|
|
|
|
+ return "调拨出库";
|
|
case 4:
|
|
case 4:
|
|
- return "加工入库";
|
|
|
|
- case 5:
|
|
|
|
- return "盘盈入库";
|
|
|
|
- case 6:
|
|
|
|
- return "其他入库";
|
|
|
|
|
|
+ return "其他类型出库";
|
|
default:
|
|
default:
|
|
return "";
|
|
return "";
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
- },add(){
|
|
|
|
- this.dialogVisible=true;
|
|
|
|
- this.isViewMode=false;
|
|
|
|
|
|
+ }, add() {
|
|
|
|
+ this.dialogVisible = true;
|
|
|
|
+ this.isViewMode = false;
|
|
this.clearForm();
|
|
this.clearForm();
|
|
- },edit(row){
|
|
|
|
- this.dialogVisible=true;
|
|
|
|
- axios.get('/order/getOrderById/'+row.id, {
|
|
|
|
- })
|
|
|
|
|
|
+ }, edit(row) {
|
|
|
|
+ this.dialogVisible = true;
|
|
|
|
+ axios.get('/order/getOrderById/' + row.id, {})
|
|
.then(response => {
|
|
.then(response => {
|
|
console.log(response)
|
|
console.log(response)
|
|
- if(response.data.success){
|
|
|
|
- const res=response.data.data;
|
|
|
|
- this.orderId=res.id;
|
|
|
|
- this.order.orderName=res.orderName;
|
|
|
|
- this.order.orderCode=res.orderCode;
|
|
|
|
- this.order.detailType=res.detailType.toString();
|
|
|
|
-
|
|
|
|
- this.detailList=res.detailList;
|
|
|
|
|
|
+ if (response.data.success) {
|
|
|
|
+ const res = response.data.data;
|
|
|
|
+ this.orderId = res.id;
|
|
|
|
+ this.order.orderName = res.orderName;
|
|
|
|
+ this.order.orderCode = res.orderCode;
|
|
|
|
+ this.order.detailType = res.detailType.toString();
|
|
|
|
+
|
|
|
|
+ this.detailList = res.detailList;
|
|
|
|
+ if(res.status===1 || res.status===2){
|
|
|
|
+ this.isViewMode=true;
|
|
|
|
+ }
|
|
/*res.detailList.forEach(item=>{
|
|
/*res.detailList.forEach(item=>{
|
|
this.addOutPalletCode(item.materialCode)
|
|
this.addOutPalletCode(item.materialCode)
|
|
})*/
|
|
})*/
|
|
@@ -468,16 +473,15 @@
|
|
});
|
|
});
|
|
|
|
|
|
|
|
|
|
- },view(row){
|
|
|
|
- this.isViewMode=true;
|
|
|
|
|
|
+ }, view(row) {
|
|
|
|
+ this.isViewMode = true;
|
|
this.edit(row);
|
|
this.edit(row);
|
|
- },orderDelete(row){
|
|
|
|
|
|
+ }, orderDelete(row) {
|
|
this.$confirm('确认删除?')
|
|
this.$confirm('确认删除?')
|
|
.then(_ => {
|
|
.then(_ => {
|
|
- axios.get('/order/delete/'+row.id, {
|
|
|
|
- })
|
|
|
|
|
|
+ axios.get('/order/delete/' + row.id, {})
|
|
.then(response => {
|
|
.then(response => {
|
|
- if(response.data.success){
|
|
|
|
|
|
+ if (response.data.success) {
|
|
this.$message({
|
|
this.$message({
|
|
message: '删除成功',
|
|
message: '删除成功',
|
|
type: "success"
|
|
type: "success"
|
|
@@ -490,96 +494,100 @@
|
|
});
|
|
});
|
|
done();
|
|
done();
|
|
})
|
|
})
|
|
- .catch(_ => {});
|
|
|
|
|
|
+ .catch(_ => {
|
|
|
|
+ });
|
|
|
|
|
|
- },handleSelectionChange(selection) {
|
|
|
|
|
|
+ }, handleSelectionChange(selection) {
|
|
this.selection = selection
|
|
this.selection = selection
|
|
- },addNewRow() {
|
|
|
|
|
|
+ }, addNewRow() {
|
|
// Define your new row object
|
|
// Define your new row object
|
|
/*if(this.entryPoint === ''){
|
|
/*if(this.entryPoint === ''){
|
|
this.$message.error('请选择当前入库口');
|
|
this.$message.error('请选择当前入库口');
|
|
return
|
|
return
|
|
}*/
|
|
}*/
|
|
|
|
|
|
- console.log( this.inputCode)
|
|
|
|
- const code= this.inputCode
|
|
|
|
|
|
+ console.log(this.inputCode)
|
|
|
|
+ const code = this.inputCode
|
|
//判断输入的是托盘编码 料箱编码 物料编码
|
|
//判断输入的是托盘编码 料箱编码 物料编码
|
|
- axios.get('/wMaterial/'+code, {
|
|
|
|
- })
|
|
|
|
|
|
+ axios.get('/wMaterial/' + code, {})
|
|
.then(response => {
|
|
.then(response => {
|
|
console.log(response)
|
|
console.log(response)
|
|
- const verify=response.data.data;
|
|
|
|
- if(verify === null){
|
|
|
|
- this.$message.error('无法识别'+code);
|
|
|
|
- this.inputCode='';
|
|
|
|
|
|
+ const verify = response.data.data;
|
|
|
|
+ if (verify === null) {
|
|
|
|
+ this.$message.error('无法识别' + code);
|
|
|
|
+ this.inputCode = '';
|
|
return
|
|
return
|
|
}
|
|
}
|
|
- this.verifCode(code,verify);
|
|
|
|
|
|
+ this.verifCode(code, verify);
|
|
})
|
|
})
|
|
.catch(error => {
|
|
.catch(error => {
|
|
// 处理错误
|
|
// 处理错误
|
|
});
|
|
});
|
|
- },verifCode(code,verify){
|
|
|
|
|
|
+ }, verifCode(code, verify) {
|
|
//0 物料编码 1 托盘编码 2 料盒编码
|
|
//0 物料编码 1 托盘编码 2 料盒编码
|
|
- const newRow = {
|
|
|
|
- materialCode: code,
|
|
|
|
- materialName: verify.materialName,
|
|
|
|
- planAmount: 1,
|
|
|
|
- };
|
|
|
|
- this.inputCode='';
|
|
|
|
- if(this.detailList.length === 0){
|
|
|
|
- // Push the new row to migrationResultList
|
|
|
|
|
|
+ const newRow = {
|
|
|
|
+ materialCode: code,
|
|
|
|
+ materialName: verify.materialName,
|
|
|
|
+ planAmount: 1,
|
|
|
|
+ };
|
|
|
|
+ this.inputCode = '';
|
|
|
|
+ if (this.detailList.length === 0) {
|
|
|
|
+ // Push the new row to migrationResultList
|
|
|
|
+ this.detailList.push(newRow);
|
|
|
|
+ this.addOutPalletCode(code);
|
|
|
|
+ } else {
|
|
|
|
+ let flag = true;
|
|
|
|
+ this.detailList.forEach(item => {
|
|
|
|
+ if (item.materialCode === code) {
|
|
|
|
+ item.planAmount = parseInt(item.planAmount) + 1;
|
|
|
|
+ flag = false;
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ if (flag) {
|
|
this.detailList.push(newRow);
|
|
this.detailList.push(newRow);
|
|
this.addOutPalletCode(code);
|
|
this.addOutPalletCode(code);
|
|
- }else{
|
|
|
|
- let flag = true;
|
|
|
|
- this.detailList.forEach(item => {
|
|
|
|
- if (item.materialCode === code) {
|
|
|
|
- item.planAmount=parseInt(item.planAmount)+1;
|
|
|
|
- flag=false;
|
|
|
|
- }
|
|
|
|
- });
|
|
|
|
- if(flag){
|
|
|
|
- this.detailList.push(newRow);
|
|
|
|
- this.addOutPalletCode(code);
|
|
|
|
- }
|
|
|
|
}
|
|
}
|
|
|
|
+ }
|
|
|
|
|
|
|
|
|
|
-
|
|
|
|
- },handleClose(done) {
|
|
|
|
|
|
+ }, handleClose(done) {
|
|
this.clearForm();
|
|
this.clearForm();
|
|
done();
|
|
done();
|
|
- /* this.$confirm('确认关闭?')
|
|
|
|
|
|
+ /* this.$confirm('确认关闭?')
|
|
.then(_ => {
|
|
.then(_ => {
|
|
|
|
|
|
|
|
|
|
})
|
|
})
|
|
.catch(_ => {});*/
|
|
.catch(_ => {});*/
|
|
- },handleDelete(row) {
|
|
|
|
|
|
+ }, handleDelete(row) {
|
|
// 从 migrationResultList 中删除当前行
|
|
// 从 migrationResultList 中删除当前行
|
|
const index = this.detailList.indexOf(row);
|
|
const index = this.detailList.indexOf(row);
|
|
if (index !== -1) {
|
|
if (index !== -1) {
|
|
this.detailList.splice(index, 1);
|
|
this.detailList.splice(index, 1);
|
|
}
|
|
}
|
|
- },submit(){
|
|
|
|
|
|
+ }, submit() {
|
|
|
|
+ this.detailList.forEach(item=>{
|
|
|
|
+ item.amount='';
|
|
|
|
+ })
|
|
|
|
+
|
|
|
|
+
|
|
axios.post('/order/addOut', {
|
|
axios.post('/order/addOut', {
|
|
- "orderType":2,
|
|
|
|
- "id":this.orderId,
|
|
|
|
- "inOutType":1,
|
|
|
|
- "orderName":this.order.orderName,
|
|
|
|
- "orderCode":this.order.orderCode,
|
|
|
|
- "detailType":this.order.detailType,
|
|
|
|
- "status":0,
|
|
|
|
- "operation":this.orderId === ''?"add":"edit",
|
|
|
|
- "detailList":this.detailList
|
|
|
|
|
|
+ "orderType": 2,
|
|
|
|
+ "id": this.orderId,
|
|
|
|
+ "inOutType": 1,
|
|
|
|
+ "orderName": this.order.orderName,
|
|
|
|
+ "orderCode": this.order.orderCode,
|
|
|
|
+ "detailType": this.order.detailType,
|
|
|
|
+ "status": 0,
|
|
|
|
+ "operation": this.orderId === '' ? "add" : "edit",
|
|
|
|
+ "detailList": this.detailList
|
|
}).then(response => {
|
|
}).then(response => {
|
|
- if(response.data.success){
|
|
|
|
|
|
+ if (response.data.success) {
|
|
this.$message({
|
|
this.$message({
|
|
- message: this.orderId === ''?'保存成功':'修改成功',
|
|
|
|
|
|
+ message: this.orderId === '' ? '保存成功' : '修改成功',
|
|
type: "success"
|
|
type: "success"
|
|
})
|
|
})
|
|
- this.dialogVisible=false;
|
|
|
|
|
|
+ this.dialogVisible = false;
|
|
this.queryClick();
|
|
this.queryClick();
|
|
|
|
|
|
|
|
|
|
@@ -589,101 +597,102 @@
|
|
// 处理错误
|
|
// 处理错误
|
|
});
|
|
});
|
|
|
|
|
|
- },clearForm(){
|
|
|
|
- this.orderId='';
|
|
|
|
- this.order.orderName='';
|
|
|
|
- this.order.orderCode='';
|
|
|
|
- this.order.detailType='';
|
|
|
|
- this.detailList=[];
|
|
|
|
- },toDo(row){
|
|
|
|
- this.dialogVisibleTask=true;
|
|
|
|
- this.wInventoryTransactionOrdersId=row.id;
|
|
|
|
- axios.get('/order/getOrderById/'+row.id, {
|
|
|
|
- })
|
|
|
|
|
|
+ }, clearForm() {
|
|
|
|
+ //this.orderId = '';
|
|
|
|
+ this.order.orderName = '';
|
|
|
|
+ this.order.orderCode = '';
|
|
|
|
+ this.order.detailType = '';
|
|
|
|
+ this.detailList = [];
|
|
|
|
+ }, toDo(id) {
|
|
|
|
+ this.dialogVisibleTask = true;
|
|
|
|
+ this.orderId = id;
|
|
|
|
+ this.wInventoryTransactionOrdersId = id;
|
|
|
|
+ axios.get('/order/getOrderById/' + id, {})
|
|
.then(response => {
|
|
.then(response => {
|
|
console.log(response)
|
|
console.log(response)
|
|
- if(response.data.success){
|
|
|
|
- const res=response.data.data;
|
|
|
|
- this.detailListTask=res.detailList;
|
|
|
|
|
|
+ if (response.data.success) {
|
|
|
|
+ const res = response.data.data;
|
|
|
|
+ this.detailListTask = res.detailList;
|
|
}
|
|
}
|
|
})
|
|
})
|
|
.catch(error => {
|
|
.catch(error => {
|
|
// 处理错误
|
|
// 处理错误
|
|
});
|
|
});
|
|
|
|
|
|
- },handleCloseTask(){
|
|
|
|
- this.dialogVisibleTask=false;
|
|
|
|
- this.detailListPallet=[];
|
|
|
|
- this.inputCode='';
|
|
|
|
- this.palletCode='';
|
|
|
|
- },handleSelectChange(row){
|
|
|
|
|
|
+ }, handleCloseTask() {
|
|
|
|
+ this.dialogVisibleTask = false;
|
|
|
|
+ this.detailListPallet = [];
|
|
|
|
+ this.detailListOut = [];
|
|
|
|
+ this.inputCode = '';
|
|
|
|
+ this.palletCode = '';
|
|
|
|
+ this.entryPoint='';
|
|
|
|
+ }, handleSelectChange(row) {
|
|
console.log(row)
|
|
console.log(row)
|
|
- row.inventoryManagementList.forEach(item=>{
|
|
|
|
- if(row.outPalletCode === item.palletCode){
|
|
|
|
- row.storageLocationCode=item.storageLocationCode;
|
|
|
|
- row.amount=item.amount;
|
|
|
|
|
|
+ row.inventoryManagementList.forEach(item => {
|
|
|
|
+ if (row.outPalletCode === item.palletCode) {
|
|
|
|
+ row.storageLocationCode = item.storageLocationCode;
|
|
|
|
+ row.amount = item.amount;
|
|
return
|
|
return
|
|
}
|
|
}
|
|
})
|
|
})
|
|
},
|
|
},
|
|
- rowClick(row, column, event){
|
|
|
|
|
|
+ rowClick(row, column, event) {
|
|
// 处理行点击事件
|
|
// 处理行点击事件
|
|
console.log('Row clicked:', row);
|
|
console.log('Row clicked:', row);
|
|
- console.log('Column clicked:', column);
|
|
|
|
- console.log('Event:', event);
|
|
|
|
- axios.get('/wInventoryManagement/'+row.storageLocationCode, {
|
|
|
|
- })
|
|
|
|
- .then(response => {
|
|
|
|
- console.log(response)
|
|
|
|
- if(response.data.success){
|
|
|
|
- const res=response.data.data;
|
|
|
|
- this.detailListPallet=res;
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
- .catch(error => {
|
|
|
|
- // 处理错误
|
|
|
|
- });
|
|
|
|
- },handleScan(){
|
|
|
|
|
|
+ if(row.planAmount > row.realAmount){
|
|
|
|
+ axios.get('/wInventoryManagement/' + row.storageLocationCode, {})
|
|
|
|
+ .then(response => {
|
|
|
|
+ console.log(response)
|
|
|
|
+ if (response.data.success) {
|
|
|
|
+ const res = response.data.data;
|
|
|
|
+ this.detailListPallet = res;
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ .catch(error => {
|
|
|
|
+ // 处理错误
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ }, handleScan() {
|
|
console.log(this.inputCode)
|
|
console.log(this.inputCode)
|
|
- axios.get('/order/verifyCode/'+this.inputCode, {
|
|
|
|
- })
|
|
|
|
|
|
+ axios.get('/order/verifyCode/' + this.inputCode, {})
|
|
.then(response => {
|
|
.then(response => {
|
|
- const verify=response.data.data;
|
|
|
|
- if(verify === null){
|
|
|
|
- this.$message.error('无法识别'+this.inputCode);
|
|
|
|
- this.inputCode='';
|
|
|
|
|
|
+ const verify = response.data.data;
|
|
|
|
+ if (verify === null) {
|
|
|
|
+ this.$message.error('无法识别' + this.inputCode);
|
|
|
|
+ this.inputCode = '';
|
|
return
|
|
return
|
|
}
|
|
}
|
|
|
|
|
|
- if(verify === 0){
|
|
|
|
- const needFlag=this.detailListTask.some(vo=>{
|
|
|
|
- if(vo.materialCode === this.inputCode){
|
|
|
|
|
|
+ if (verify === 0) {
|
|
|
|
+ const needFlag = this.detailListTask.some(vo => {
|
|
|
|
+ if (vo.materialCode === this.inputCode) {
|
|
return true;
|
|
return true;
|
|
}
|
|
}
|
|
return false;
|
|
return false;
|
|
})
|
|
})
|
|
- if(!needFlag){
|
|
|
|
- this.$message.error('需求明细无法识别'+this.inputCode);
|
|
|
|
- this.inputCode='';
|
|
|
|
|
|
+ if (!needFlag) {
|
|
|
|
+ this.$message.error('需求明细无法识别' + this.inputCode);
|
|
|
|
+ this.inputCode = '';
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
- const flag =this.detailListPallet.some(vo=>{
|
|
|
|
- if(vo.materialCode === this.inputCode){
|
|
|
|
- const flag1=this.detailListOut.some(item =>{
|
|
|
|
- if(item.materialCode === this.inputCode){
|
|
|
|
- item.amount=parseInt(item.amount)+1;
|
|
|
|
|
|
+ const flag = this.detailListPallet.some(vo => {
|
|
|
|
+ if (vo.materialCode === this.inputCode) {
|
|
|
|
+ const flag1 = this.detailListOut.some(item => {
|
|
|
|
+ if (item.materialCode === this.inputCode) {
|
|
|
|
+ item.amount = parseInt(item.amount) + 1;
|
|
return true;
|
|
return true;
|
|
}
|
|
}
|
|
return false;
|
|
return false;
|
|
|
|
|
|
})
|
|
})
|
|
- if(!flag1){
|
|
|
|
|
|
+ if (!flag1) {
|
|
const newRow = {
|
|
const newRow = {
|
|
- "materialCode":this.inputCode,
|
|
|
|
- "materialName":vo.materialName,
|
|
|
|
- "amount":1
|
|
|
|
|
|
+ "materialCode": this.inputCode,
|
|
|
|
+ "materialName": vo.materialName,
|
|
|
|
+ "amount": 1
|
|
}
|
|
}
|
|
this.detailListOut.push(newRow);
|
|
this.detailListOut.push(newRow);
|
|
}
|
|
}
|
|
@@ -693,15 +702,15 @@
|
|
return false;
|
|
return false;
|
|
})
|
|
})
|
|
|
|
|
|
- if(!flag){
|
|
|
|
- this.$message.error('托盘明细中无法识别'+this.inputCode);
|
|
|
|
|
|
+ if (!flag) {
|
|
|
|
+ this.$message.error('托盘明细中无法识别' + this.inputCode);
|
|
}
|
|
}
|
|
- }else if(verify === 1){
|
|
|
|
|
|
+ } else if (verify === 1) {
|
|
console.log(this.detailListTask)
|
|
console.log(this.detailListTask)
|
|
const allMaterials = this.detailListTask.reduce((accumulator, currentObject) => {
|
|
const allMaterials = this.detailListTask.reduce((accumulator, currentObject) => {
|
|
return accumulator.concat(currentObject.inventoryManagementList);
|
|
return accumulator.concat(currentObject.inventoryManagementList);
|
|
}, []);
|
|
}, []);
|
|
- let locationCode1='';
|
|
|
|
|
|
+ let locationCode1 = '';
|
|
const hasMatchingCode = allMaterials.some(task => {
|
|
const hasMatchingCode = allMaterials.some(task => {
|
|
if (task.palletCode === this.inputCode) {
|
|
if (task.palletCode === this.inputCode) {
|
|
locationCode1 = task.storageLocationCode;
|
|
locationCode1 = task.storageLocationCode;
|
|
@@ -709,35 +718,34 @@
|
|
}
|
|
}
|
|
return false;
|
|
return false;
|
|
});
|
|
});
|
|
- if(!hasMatchingCode){
|
|
|
|
|
|
+ if (!hasMatchingCode) {
|
|
this.$message.error("库存明细中无法识别到 " + this.inputCode);
|
|
this.$message.error("库存明细中无法识别到 " + this.inputCode);
|
|
- this.inputCode='';
|
|
|
|
|
|
+ this.inputCode = '';
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
- axios.get('/wInventoryManagement/'+locationCode1, {
|
|
|
|
- })
|
|
|
|
|
|
+ axios.get('/wInventoryManagement/' + locationCode1, {})
|
|
.then(response => {
|
|
.then(response => {
|
|
console.log(response)
|
|
console.log(response)
|
|
- if(response.data.success){
|
|
|
|
- const res=response.data.data;
|
|
|
|
- this.detailListPallet=res;
|
|
|
|
|
|
+ if (response.data.success) {
|
|
|
|
+ const res = response.data.data;
|
|
|
|
+ this.detailListPallet = res;
|
|
}
|
|
}
|
|
})
|
|
})
|
|
.catch(error => {
|
|
.catch(error => {
|
|
// 处理错误
|
|
// 处理错误
|
|
});
|
|
});
|
|
- this.palletCode=this.inputCode;
|
|
|
|
|
|
+ this.palletCode = this.inputCode;
|
|
}
|
|
}
|
|
- this.inputCode='';
|
|
|
|
|
|
+ this.inputCode = '';
|
|
})
|
|
})
|
|
.catch(error => {
|
|
.catch(error => {
|
|
// 处理错误
|
|
// 处理错误
|
|
});
|
|
});
|
|
|
|
|
|
|
|
|
|
- },handleSelectionChange(selection) {
|
|
|
|
|
|
+ }, handleSelectionChange(selection) {
|
|
this.selection = selection
|
|
this.selection = selection
|
|
- },outSubmit(){
|
|
|
|
|
|
+ }, outSubmit() {
|
|
if (!this.selection.length) {
|
|
if (!this.selection.length) {
|
|
this.$message({
|
|
this.$message({
|
|
message: '至少勾选一行数据',
|
|
message: '至少勾选一行数据',
|
|
@@ -745,8 +753,8 @@
|
|
})
|
|
})
|
|
return
|
|
return
|
|
}
|
|
}
|
|
- this.selection.forEach(item=>{
|
|
|
|
- if(item.amount === '' || item.amount <= 0){
|
|
|
|
|
|
+ this.selection.forEach(item => {
|
|
|
|
+ if (item.amount === '' || item.amount <= 0) {
|
|
this.$message({
|
|
this.$message({
|
|
message: '本次出库数量不能为空或小于等于0',
|
|
message: '本次出库数量不能为空或小于等于0',
|
|
type: "error"
|
|
type: "error"
|
|
@@ -755,38 +763,94 @@
|
|
}
|
|
}
|
|
})
|
|
})
|
|
|
|
|
|
- if(this.entryPoint ===''){
|
|
|
|
|
|
+ if (this.entryPoint === '') {
|
|
this.$message({
|
|
this.$message({
|
|
message: '入库口不能为空',
|
|
message: '入库口不能为空',
|
|
type: "error"
|
|
type: "error"
|
|
})
|
|
})
|
|
return
|
|
return
|
|
}
|
|
}
|
|
- axios.post('/wStorageLocationManagement', {
|
|
|
|
- 'startPosition':this.entryPoint,
|
|
|
|
- 'wInventoryTransactionOrdersId':this.wInventoryTransactionOrdersId,
|
|
|
|
- 'vectorCode':this.palletCode,
|
|
|
|
- 'status':0,
|
|
|
|
- 'taskType':2,//代表实际的出入库操作
|
|
|
|
- 'detailList':this.selection
|
|
|
|
|
|
+ console.log(this.selection)
|
|
|
|
+ this.selection.forEach(item=>{
|
|
|
|
+ const de=this.detailListTask.filter(detail => detail.materialCode === item.materialCode);
|
|
|
|
+ item.id=de[0].id;
|
|
|
|
+ })
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ axios.post('/order/add', {
|
|
|
|
+ 'id':this.orderId,
|
|
|
|
+ 'startPosition': this.entryPoint,
|
|
|
|
+ 'wInventoryTransactionOrdersId': this.wInventoryTransactionOrdersId,
|
|
|
|
+ 'vectorCode': this.palletCode,
|
|
|
|
+ 'status': 0,
|
|
|
|
+ 'taskType': 2,//代表实际的出入库操作
|
|
|
|
+ 'detailList': this.selection
|
|
|
|
+
|
|
|
|
+ })
|
|
|
|
+ .then(response => {
|
|
|
|
+ if (response.data.success) {
|
|
|
|
+ this.palletCode='';
|
|
|
|
+ this.entryPoint='';
|
|
|
|
+ this.detailListPallet=[];
|
|
|
|
+ this.detailListOut=[];
|
|
|
|
+ this.toDo(this.orderId)
|
|
|
|
+
|
|
|
|
+ } else {
|
|
|
|
+ this.$message.error(response.data.data);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ })
|
|
|
|
+ .catch(error => {
|
|
|
|
+ // 处理错误
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+ }, getOutPalletCode(row) {
|
|
|
|
+ //入库口 即空托盘出库的目的地
|
|
|
|
+ const inCode = row.storageLocationCode;
|
|
|
|
+ if (this.entryPoint === '') {
|
|
|
|
+ this.$message({
|
|
|
|
+ message: '请选择入库口',
|
|
|
|
+ type: 'error'
|
|
|
|
+ });
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ this.getPalletCodeCon(inCode, this.entryPoint)
|
|
|
|
|
|
|
|
+ }, getPalletCodeCon(startPosition, endPosition) {
|
|
|
|
+ axios.get('/wStorageLocationManagement/getPalletCode', {
|
|
|
|
+ params: {
|
|
|
|
+ startPosition: startPosition,
|
|
|
|
+ endPosition: endPosition
|
|
|
|
+ }
|
|
})
|
|
})
|
|
.then(response => {
|
|
.then(response => {
|
|
- if(response.data.success){
|
|
|
|
- const code=response.data.data;
|
|
|
|
|
|
+ if (response.data.success) {
|
|
|
|
+ const code = response.data.msg;
|
|
this.$message({
|
|
this.$message({
|
|
- message: '空托盘 '+code +' 已出库',
|
|
|
|
|
|
+ message: '托盘 ' + code + ' 已出库',
|
|
type: 'success'
|
|
type: 'success'
|
|
});
|
|
});
|
|
- }else{
|
|
|
|
- this.$message.error(response.data.data);
|
|
|
|
|
|
+ } else {
|
|
|
|
+ this.$message.error(response.data.msg);
|
|
}
|
|
}
|
|
|
|
|
|
})
|
|
})
|
|
.catch(error => {
|
|
.catch(error => {
|
|
// 处理错误
|
|
// 处理错误
|
|
});
|
|
});
|
|
-
|
|
|
|
|
|
+ }, getTypeText(status) {
|
|
|
|
+ switch (status) {
|
|
|
|
+ case 0:
|
|
|
|
+ return "未出库"; // 第二种类型的文本
|
|
|
|
+ case 1:
|
|
|
|
+ return '出库中'; // 第三种类型的文本
|
|
|
|
+ case 2:
|
|
|
|
+ return '出库完成'; // 第四种类型的文本
|
|
|
|
+ case 4:
|
|
|
|
+ return '出库异常'; // 第四种类型的文本
|
|
|
|
+ default:
|
|
|
|
+ return ""
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|