|
|
|
@ -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)) {
|
|
|
|
|