1.修改盘点单据页面

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

@ -47,3 +47,11 @@ export function deleteCountOrderDetail(data) {
data: data
});
}
export function addCountOrderDetail(data) {
return axios({
url: "/invCount/order/detail/addCountOrderDetail",
method: "post",
data: data
});
}

@ -66,7 +66,6 @@
</el-form-item>
</el-col>
<el-col :span="3">
<div class="ao-text">
<span>当前分库</span>
@ -91,7 +90,6 @@
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="3">
<div class="ao-text">
@ -103,6 +101,7 @@
>
<el-select v-model="formData.invSpaceCode" placeholder="当前货位信息"
:disabled="codeArray.length>0"
@change="invSpaceChange"
clearable>
<el-option
v-for="item in spaceList"
@ -293,7 +292,12 @@ import {isBlank} from "@/utils/strUtil";
import {filterAllByUser} from "@/api/basic/invWarehouse";
import {getSpaceCodeList} from "@/api/inventory/invSpace";
import {filterProducts} from "@/api/inventory/InvProducts";
import {saveCountOrder, getCountOrderDetailList, deleteCountOrderDetail} from "@/api/inventory/invCountOrder";
import {
saveCountOrder,
getCountOrderDetailList,
deleteCountOrderDetail,
addCountOrderDetail
} from "@/api/inventory/invCountOrder";
import {getCountCodesList, deleteCode} from "@/api/inventory/invCountCodes";
@ -351,11 +355,17 @@ export default {
},
productList: [],
scanText: "扫码录入:",
codesList: []
codesList: [],
detailQuery: {
orderId: null,
page: 1,
limit: 10
},
detailTotal: 0
};
},
methods: {
saveOrder() {
saveOrder(type) {
this.$refs['dataForm'].validate((valid) => {
if (valid) {
if (this.codeArray.length === 0) {
@ -363,25 +373,37 @@ export default {
return;
}
let invProductList = [];
this.codeArray.forEach(product => {
invProductList.push(product);
});
let orderData = {
invCountOrder: {
createTime: this.formData.billDate,
invStorageCode: this.formData.locStorageCode,
invWarehouseCode: this.formData.invWarehouseCode,
invSpaceCode: this.formData.invSpaceCode
},
invProductList: invProductList
}
};
saveCountOrder(orderData).then((res) => {
if (res.code === 20000) {
this.formData.orderId = res.data;
this.$message.success("保存成功");
this.closeDialog();
if (type != null) {
//
let product = this.codeArray[0];
let detailData = {
orderIdFk: this.formData.orderId,
product: product.id,
batchNo: product.batchNo,
produceDate: product.produceDate,
expireDate: product.expireDate
};
addCountOrderDetail(detailData).then((result) => {
if (result.code === 20000) {
this.getCountOrderDetail();
}
});
} else {
this.closeDialog();
}
} else {
this.$message.error(res.data.message);
}
@ -414,6 +436,9 @@ export default {
this.spaceList = res.data || [];
});
},
invSpaceChange() {
this.$forceUpdate();
},
selectProductFunction() {
if (isBlank(this.formData.locStorageCode) || isBlank(this.formData.invWarehouseCode)) {
this.$message.warning("请先选择当前仓库货位信息");
@ -458,20 +483,10 @@ export default {
this.$message.warning("请选择产品");
return;
}
selection.forEach(product => {
let data = {
productName: product.cpmctymc,
relIdFk: product.relIdFk,
spce: product.ggxh,
batchNo: product.batchNo,
productDate: product.productionDate,
expireDate: product.expireDate,
zczbhhzbapzbh: null,
ylqxzcrbarmc: null,
invCount: product.inCount - product.outCount
};
this.codeArray.push(data);
});
if (this.codeArray === 0) {
//
this.saveOrder(1);
}
this.selectInvProductVisible = false;
},
deleteOrderDetail(index, row) {
@ -489,7 +504,7 @@ export default {
}
getCountOrderDetailList(detailParam).then((result) => {
this.codeArray = result.data.list || [];
})
});
} else {
this.$message.error(res.data);
}
@ -502,9 +517,21 @@ export default {
productId: row.productId
};
getCountCodesList(params).then((res) => {
this.codesList = res.data.list;
this.codesList = res.data.list || [];
});
},
getInputFocus(event) {
event.currentTarget.select();
},
getCountOrderDetail() {
this.detailQuery.orderId = this.formData.orderId;
getCountOrderDetailList(this.detailQuery).then((res) => {
if (res.code === 20000) {
this.codeArray = res.data.list || [];
this.detailTotal = res.data.total || 0;
}
})
}
},
created() {
this.getStorage();

Loading…
Cancel
Save