1.修复盘点功能bug

prod
x_z 2 years ago
parent 931da9df29
commit 1816cb6fd5

@ -81,3 +81,11 @@ export function printOrder(data) {
responseType: 'arraybuffer', //一定要设置响应类型否则页面会是空白pdf
});
}
export function batchAddDetail(data) {
return axios({
url: "/inv/count/order/detail/batchAddDetail",
method: "post",
data: data
});
}

@ -125,6 +125,7 @@
<el-table-column label="部门" prop="deptName" width="180"></el-table-column>
<el-table-column label="仓库" prop="invName" width="180"></el-table-column>
<el-table-column label="设备名称" prop="deviceName" width="200"></el-table-column>
<el-table-column label="物资编码" prop="code" width="180"></el-table-column>
<el-table-column label="规格型号" prop="ggxh" width="200" show-overflow-tooltip></el-table-column>
<el-table-column label="批次号" prop="batchNo" width="150"></el-table-column>
<el-table-column label="生产日期" prop="productionDate" width="150"></el-table-column>

@ -11,6 +11,7 @@
>开始盘点
</el-button>
<el-button
v-if="countType != 2"
type="primary"
:disabled="this.codeArray.length > 0"
@click.native="startCount()"
@ -235,7 +236,8 @@ import {
saveCountOrder,
getCountOrderDetailList,
deleteCountOrderDetail,
addCountOrderDetail
addCountOrderDetail,
batchAddDetail
} from "@/api/inventory/invCountOrder";
import {addCode} from "@/api/inventory/invCountCodes";
import {getCountInvProductProduct} from "@/api/inventory/invPorduct";
@ -298,6 +300,7 @@ export default {
},
detailTotal: 0,
countProductList: [],
productTotal: 0,
codesNum: 0,
codeQuery: {
relId: null,
@ -316,13 +319,13 @@ export default {
if (res.code === 20000) {
this.invList = res.data || [];
if (!isBlank(this.countOrder.invSpaceCode)) {
this.getSpaceList();
this.formData.invCode = this.countOrder.invCode;
this.invList.forEach((item) => {
if (item.code === this.formData.invCode) {
this.formData.deptCode = item.parentId;
}
})
this.invChange();
}
}
});
@ -335,6 +338,9 @@ export default {
}
});
this.formData.invSpaceCode = null;
this.getSpaceList();
},
getSpaceList() {
this.spaceList = [];
let params = {invWarehouseCode: this.formData.invCode, status: 1};
getInvSpaceList(params).then((res) => {
@ -363,6 +369,7 @@ export default {
this.$message.success("保存成功");
if (type != null) {
//
let orderDetails = [];
this.countProductList.forEach(product => {
let detailData = {
orderIdFk: this.formData.orderId,
@ -374,12 +381,17 @@ export default {
invCode: this.formData.invCode,
invSpaceCode: this.formData.invSpaceCode
};
addCountOrderDetail(detailData).then((result) => {
if (result.code === 20000) {
this.getList();
this.getCountOrderList();
}
});
orderDetails.push(detailData);
});
let params = {
orderId: this.formData.orderId,
countOrderDetailList: orderDetails
}
batchAddDetail(params).then((res) => {
if (res.code === 20000) {
this.getList();
this.getCountOrderList();
}
})
} else {
this.closeDialog();
@ -515,7 +527,7 @@ export default {
},
startCount(val) {
this.countProductList = [];
if (this.countType === 0) {
if (this.countType === 0 && val === 1) {
if (isBlank(this.formData.invCode)) {
this.$message.warning("请先选择盘点仓库");
return;
@ -534,6 +546,14 @@ export default {
this.saveOrder(1);
}
});
} else if (this.countType === 0) {
if (isBlank(this.formData.invCode)) {
this.$message.warning("请先选择盘点仓库");
return;
}
this.productList = [];
this.selectInvProductVisible = true;
this.queryInvProducts();
} else if (this.countType === 1) {
if (isBlank(this.formData.invCode) || isBlank(this.formData.invSpaceCode)) {
this.$message.warning("请先选择盘点仓库和货位");
@ -556,6 +576,7 @@ export default {
} else {
this.productList = [];
this.selectInvProductVisible = true;
this.queryInvProducts();
}
} else if (this.countType === 2) {
if (isBlank(this.formData.invCode)) {

Loading…
Cancel
Save