1.修改盘点单据页面,调整交互逻辑

feature-order-fix
x_z 2 years ago
parent c29997d220
commit 5b30d5aeb7

@ -15,3 +15,19 @@ export function deleteCode(data) {
data: data
});
}
export function addCode(data) {
return axios({
url: "/invCount/codes/addCode",
method: "post",
data: data
});
}
export function getCodesNum(params) {
return axios({
url: "/invCount/codes/getCountOrderCodesNum",
method: "get",
params: params
});
}

@ -29,15 +29,7 @@
</el-col>
<el-col :span="7">
<el-form-item prop="billDate">
<el-date-picker
v-model="formData.billDate"
type="datetime"
placeholder="选择日期"
style="width: 100%"
:clearable="false"
value-format="yyyy-MM-dd HH:mm:ss"
>
</el-date-picker>
<el-input v-model="formData.billDate" auto-complete="off" :disabled="true"></el-input>
</el-form-item>
</el-col>
</el-row>
@ -50,8 +42,8 @@
</el-col>
<el-col :span="7">
<el-form-item prop="locStorageCode">
<el-select v-model="formData.locStorageCode" placeholder="当前仓库信息"
<el-form-item prop="invStorageCode">
<el-select v-model="formData.invStorageCode" placeholder="当前仓库信息"
@change="locInChange"
:disabled="codeArray.length>0"
clearable>
@ -164,7 +156,7 @@
</el-col>
<el-col :span="3">
<div class="text item" style="margin-left: 30px"> 条码数量{{ codeArray.length }}
<div class="text item" style="margin-left: 30px"> 条码数量{{ codesNum }}
</div>
</el-col>
</el-row>
@ -179,16 +171,16 @@
></el-table-column>
<el-table-column width="150"
label="规格型号"
prop="spec"
prop="ggxh"
show-overflow-tooltip
></el-table-column>
<el-table-column width="150" label="批次号" prop="batchNo">
</el-table-column>
<el-table-column width="150" label="库存数量" prop="invCount"
<el-table-column width="150" label="库存数量" prop="invNum"
show-overflow-tooltip></el-table-column>
<el-table-column width="150" label="盘点数量" prop="countNum"
show-overflow-tooltip></el-table-column>
<el-table-column width="180" label="生产日期(yyMMdd)" prop="productDate">
<el-table-column width="180" label="生产日期(yyMMdd)" prop="produceDate">
</el-table-column>
<el-table-column width="180" label="失效日期(yyMMdd)" prop="expireDate" show-overflow-tooltip>
</el-table-column>
@ -298,7 +290,8 @@ import {
deleteCountOrderDetail,
addCountOrderDetail
} from "@/api/inventory/invCountOrder";
import {getCountCodesList, deleteCode} from "@/api/inventory/invCountCodes";
import {getCountCodesList, deleteCode, addCode, getCodesNum} from "@/api/inventory/invCountCodes";
import {enterCodeWeb} from "@/api/inout/order";
export default {
@ -316,17 +309,15 @@ export default {
data() {
return {
formData: {
code: null,
orderId: null,
billDate: null,
locStorageCode: null,
invStorageCode: null,
invWarehouseCode: null,
invSpaceCode: null
},
formRules: {
billDate: [
{required: true, message: "请选择单据日期", trigger: "blur"}
],
locStorageCode: [
invStorageCode: [
{required: true, message: "请选择当前仓库", trigger: "blur"}
],
invWarehouseCode: [
@ -357,43 +348,40 @@ export default {
scanText: "扫码录入:",
codesList: [],
detailQuery: {
orderId: null,
orderIdFk: null,
page: 1,
limit: 10
},
detailTotal: 0
detailTotal: 0,
countProductList: [],
codesNum: 0
};
},
methods: {
saveOrder(type) {
this.$refs['dataForm'].validate((valid) => {
if (valid) {
if (this.codeArray.length === 0) {
this.$message.error("请选择盘点产品");
return;
}
let orderData = {
invCountOrder: {
createTime: this.formData.billDate,
invStorageCode: this.formData.locStorageCode,
invWarehouseCode: this.formData.invWarehouseCode,
invSpaceCode: this.formData.invSpaceCode
}
orderId: this.formData.orderId,
createTime: this.formData.billDate,
invStorageCode: this.formData.invStorageCode,
invWarehouseCode: this.formData.invWarehouseCode,
invSpaceCode: this.formData.invSpaceCode
};
saveCountOrder(orderData).then((res) => {
if (res.code === 20000) {
this.formData.orderId = res.data;
this.formData.orderId = res.data.orderId;
this.formData.billDate = res.data.createTime;
this.$message.success("保存成功");
if (type != null) {
//
let product = this.codeArray[0];
let product = this.countProductList[0];
let detailData = {
orderIdFk: this.formData.orderId,
product: product.id,
productId: product.relIdFk,
batchNo: product.batchNo,
produceDate: product.produceDate,
produceDate: product.productionDate,
expireDate: product.expireDate
};
addCountOrderDetail(detailData).then((result) => {
@ -420,7 +408,10 @@ export default {
this.formData.invWarehouseCode = null;
this.formData.invSpaceCode = null;
//
let params = {pcode: this.formData.locStorageCode}
this.getSubInvList();
},
getSubInvList() {
let params = {pcode: this.formData.invStorageCode}
filterSubByInv(params).then((res) => {
this.subInvList = res.data || [];
});
@ -428,8 +419,11 @@ export default {
subStorageChange() {
this.formData.invSpaceCode = null;
//
this.getInvSpaceList();
},
getInvSpaceList() {
let params = {
invStorageCode: this.formData.locStorageCode,
invStorageCode: this.formData.invStorageCode,
invWarehouseCode: this.formData.invWarehouseCode
};
getSpaceCodeList(params).then((res) => {
@ -440,7 +434,7 @@ export default {
this.$forceUpdate();
},
selectProductFunction() {
if (isBlank(this.formData.locStorageCode) || isBlank(this.formData.invWarehouseCode)) {
if (isBlank(this.formData.invStorageCode) || isBlank(this.formData.invWarehouseCode)) {
this.$message.warning("请先选择当前仓库货位信息");
return;
}
@ -449,7 +443,7 @@ export default {
this.getInvProducts();
},
getInvProducts() {
this.filterQuery.invStorageCode = this.formData.locStorageCode;
this.filterQuery.invStorageCode = this.formData.invStorageCode;
this.filterQuery.invWarehouseCode = this.formData.invWarehouseCode;
filterProducts(this.filterQuery).then((res) => {
if (res.code === 20000) {
@ -463,7 +457,12 @@ export default {
if (res.code === 20000) {
this.storageList = res.data || [];
}
})
});
if (this.countOrder.orderId != null) {
this.getSubInvList();
this.getInvSpaceList();
}
},
onReset() {
this.filterQuery = {
@ -475,6 +474,7 @@ export default {
page: 1,
limit: 10
};
this.countProductList = [];
this.getInvProducts();
},
combine() {
@ -483,7 +483,10 @@ export default {
this.$message.warning("请选择产品");
return;
}
if (this.codeArray === 0) {
selection.forEach(product => {
this.countProductList.push(product);
})
if (this.codeArray.length === 0) {
//
this.saveOrder(1);
}
@ -500,7 +503,7 @@ export default {
if (res.code === 20000) {
this.$message.success("删除成功");
let detailParam = {
orderId: this.formData.orderId
orderIdFk: this.formData.orderId
}
getCountOrderDetailList(detailParam).then((result) => {
this.codeArray = result.data.list || [];
@ -513,9 +516,10 @@ export default {
},
showCodes(row) {
let params = {
orderId: this.formData.orderId,
orderIdFk: this.formData.orderId,
productId: row.productId
};
getCountCodesList(params).then((res) => {
this.codesList = res.data.list || [];
});
@ -523,28 +527,60 @@ export default {
getInputFocus(event) {
event.currentTarget.select();
},
enterKey(event) {
if (this.codeArray.length === 0) {
this.$message.error("请先录入盘点产品!");
return;
}
this.addCode();
},
getCountOrderDetail() {
this.detailQuery.orderId = this.formData.orderId;
this.detailQuery.orderIdFk = this.formData.orderId;
getCountOrderDetailList(this.detailQuery).then((res) => {
if (res.code === 20000) {
this.codeArray = res.data.list || [];
this.detailTotal = res.data.total || 0;
}
})
}
},
addCode() {
this.formData.code.trim();
let params = {
orderIdFk: this.formData.orderId,
code: this.formData.code
};
addCode(params).then((res) => {
if (res.code === 20000) {
this.getCountOrderCodesNum();
this.getCountOrderDetail();
}
})
},
getCountOrderCodesNum() {
if (isBlank(this.formData.orderId)) {
this.codesNum = 0;
} else {
let params = {orderIdFk: this.formData.orderId}
getCodesNum(params).then((res) => {
this.codesNum = res.data;
});
}
},
},
created() {
this.getStorage();
this.formData = this.countOrder;
this.formData.billDate = this.countOrder.createTime;
if (!isBlank(this.formData.orderId)) {
//
let params = {orderId: this.formData.orderId};
let params = {orderIdFk: this.formData.orderId};
getCountOrderDetailList(params).then((res) => {
if (res.code === 20000) {
this.productList = res.data.list || [];
this.codeArray = res.data.list || [];
this.total = res.data.total || 0;
}
})
});
this.getCountOrderCodesNum();
}
},
};

@ -107,7 +107,7 @@
></el-pagination>
<el-dialog
title="新增盘点单"
:title="formMap[formName]"
:visible.sync="addCountOrderVisible"
width="70%"
:close-on-click-modal="false"
@ -158,7 +158,12 @@ export default {
2: "已审核"
},
addCountOrderVisible: false,
countOrder: null
countOrder: null,
formName: null,
formMap: {
add: "新增盘点单",
edit: "编辑盘点单"
}
};
},
methods: {
@ -272,6 +277,7 @@ export default {
addCountOrder() {
this.addCountOrderVisible = true;
this.countOrder = {};
this.formName = 'add';
},
closeAddDialog() {
this.addCountOrderVisible = false;
@ -280,6 +286,7 @@ export default {
editOrder(row) {
this.addCountOrderVisible = true;
this.countOrder = row;
this.formName = 'edit';
},
},
components: {

Loading…
Cancel
Save