1.添加盘点相关接口

feature-order-fix
x_z 2 years ago
parent ef574c117e
commit 1baccb1175

@ -7,3 +7,11 @@ export function getCountCodesList(params) {
params: params params: params
}); });
} }
export function deleteCode(data) {
return axios({
url: "/invCount/codes/deleteCode",
method: "post",
data: data
});
}

@ -39,3 +39,11 @@ export function submitAudit(params) {
params: params params: params
}); });
} }
export function deleteCountOrderDetail(data) {
return axios({
url: "/invCount/codes/deleteCode",
method: "post",
data: data
});
}

@ -199,11 +199,17 @@
show-overflow-tooltip></el-table-column> show-overflow-tooltip></el-table-column>
<el-table-column label="操作" fixed="right" width="150"> <el-table-column label="操作" fixed="right" width="150">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button
type="text"
size="small"
@click.native.stop="showCodes(scope.row)"
>码详情
</el-button>
<el-button <el-button
type="text" type="text"
size="small" size="small"
@click.stop="true" @click.stop="true"
@click.native="deleteCodeArray(scope.$index, scope.row)" @click.native="deleteOrderDetail(scope.$index, scope.row)"
>删除 >删除
</el-button </el-button
> >
@ -287,19 +293,21 @@ import {isBlank} from "@/utils/strUtil";
import {filterAllByUser} from "@/api/basic/invWarehouse"; import {filterAllByUser} from "@/api/basic/invWarehouse";
import {getSpaceCodeList} from "@/api/inventory/invSpace"; import {getSpaceCodeList} from "@/api/inventory/invSpace";
import {filterProducts} from "@/api/inventory/InvProducts"; import {filterProducts} from "@/api/inventory/InvProducts";
import {saveCountOrder} from "@/api/inventory/invCountOrder"; import {saveCountOrder, getCountOrderDetailList, deleteCountOrderDetail} from "@/api/inventory/invCountOrder";
import {getCountCodesList, deleteCode} from "@/api/inventory/invCountCodes";
export default { export default {
name: "closeDialog", name: "closeDialog",
props: { props: {
data: {
type: Object,
required: true,
},
closeDialog: { closeDialog: {
type: Function, type: Function,
required: true, required: true,
}, },
countOrder: {
type: Object,
required: true,
}
}, },
data() { data() {
return { return {
@ -343,6 +351,7 @@ export default {
}, },
productList: [], productList: [],
scanText: "扫码录入:", scanText: "扫码录入:",
codesList: []
}; };
}, },
methods: { methods: {
@ -386,15 +395,16 @@ export default {
this.getInvProducts(); this.getInvProducts();
}, },
locInChange() { locInChange() {
this.formData.invWarehouseCode = null;
this.formData.invSpaceCode = null;
// //
let params = {pcode: this.formData.locStorageCode} let params = {pcode: this.formData.locStorageCode}
filterSubByInv(params).then((res) => { filterSubByInv(params).then((res) => {
this.subInvList = res.data || []; this.subInvList = res.data || [];
}); });
this.formData.invWarehouseCode = null;
this.formData.invSpaceCode = null;
}, },
subStorageChange() { subStorageChange() {
this.formData.invSpaceCode = null;
// //
let params = { let params = {
invStorageCode: this.formData.locStorageCode, invStorageCode: this.formData.locStorageCode,
@ -403,11 +413,10 @@ export default {
getSpaceCodeList(params).then((res) => { getSpaceCodeList(params).then((res) => {
this.spaceList = res.data || []; this.spaceList = res.data || [];
}); });
this.formData.invSpaceCode = null;
}, },
selectProductFunction() { selectProductFunction() {
if (isBlank(this.formData.locStorageCode) || isBlank(this.formData.invWarehouseCode)) { if (isBlank(this.formData.locStorageCode) || isBlank(this.formData.invWarehouseCode)) {
this.$message.warning("请先选择当前仓库和分库"); this.$message.warning("请先选择当前仓库货位信息");
return; return;
} }
this.selectInvProductVisible = true; this.selectInvProductVisible = true;
@ -465,17 +474,51 @@ export default {
}); });
this.selectInvProductVisible = false; this.selectInvProductVisible = false;
}, },
deleteCodeArray(index, row) { deleteOrderDetail(index, row) {
for (let i = 0; i < this.codeArray.length; i++) { if (isBlank(row.id)) {
if (this.codeArray[i] === row) { //
this.codeArray.splice(i, 1); this.codeArray.splice(index, 1);
return; } else {
} //
let params = {id: row.id}
deleteCountOrderDetail(params).then((res) => {
if (res.code === 20000) {
this.$message.success("删除成功");
let detailParam = {
orderId: this.formData.orderId
}
getCountOrderDetailList(detailParam).then((result) => {
this.codeArray = result.data.list || [];
})
} else {
this.$message.error(res.data);
}
})
} }
}, },
showCodes(row) {
let params = {
orderId: this.formData.orderId,
productId: row.productId
};
getCountCodesList(params).then((res) => {
this.codesList = res.data.list;
});
},
}, },
created() { created() {
this.getStorage(); this.getStorage();
this.formData = this.countOrder;
if (!isBlank(this.formData.orderId)) {
//
let params = {orderId: this.formData.orderId};
getCountOrderDetailList(params).then((res) => {
if (res.code === 20000) {
this.productList = res.data.list || [];
this.total = res.data.total || 0;
}
})
}
}, },
}; };
</script> </script>

@ -116,6 +116,7 @@
> >
<addCountOrder <addCountOrder
:closeDialog="closeAddDialog" :closeDialog="closeAddDialog"
:countOrder="countOrder"
></addCountOrder> ></addCountOrder>
</el-dialog> </el-dialog>
@ -157,7 +158,7 @@ export default {
2: "已审核" 2: "已审核"
}, },
addCountOrderVisible: false, addCountOrderVisible: false,
countOrder: null
}; };
}, },
methods: { methods: {
@ -270,13 +271,15 @@ export default {
}, },
addCountOrder() { addCountOrder() {
this.addCountOrderVisible = true; this.addCountOrderVisible = true;
this.countOrder = {};
}, },
closeAddDialog() { closeAddDialog() {
this.addCountOrderVisible = false; this.addCountOrderVisible = false;
this.getList(); this.getList();
}, },
editOrder() { editOrder(row) {
this.addCountOrderVisible = true;
this.countOrder = row;
}, },
}, },
components: { components: {

Loading…
Cancel
Save