1.添加货物摆放页面及对应接口

feature-order-fix
x_z 2 years ago
parent f85312d3b4
commit 2a491bb851

@ -26,3 +26,27 @@ export function deleteProducts(query) {
}
)
}
export function getPlacementDetailList(params) {
return axios({
url: "spms/inv/products/getPlacementDetailList",
method: "get",
params: params
});
}
export function bindInvSpace(data) {
return axios({
url: "spms/inv/products/bindInvSpace",
method: "post",
data: data
});
}
export function checkCodeSpace(data) {
return axios({
url: "spms/inv/products/checkCodeSpace",
method: "post",
data: data
});
}

@ -17,7 +17,7 @@
</el-form-item>
<el-form-item class="query-form-item">
<el-select v-model="filterQuery.invWarehouseCode" placeholder="请选择当前分库" clearable="true"
size="mini">
@change="invWarehouseChange" size="mini">
<el-option
v-for="item in subInvList"
:key="item.name"
@ -27,6 +27,18 @@
</el-option>
</el-select>
</el-form-item>
<el-form-item class="query-form-item">
<el-select v-model="filterQuery.invSpaceCode" placeholder="请选择当前货位" clearable="true"
size="mini">
<el-option
v-for="item in spaceCodeList"
:key="item.name"
:label="item.name"
:value="item.code">
<span style="float: left">{{ item.name }}</span>
</el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-button-group>
<el-button
@ -38,6 +50,10 @@
>查询
</el-button
>
<el-button type="primary" icon="search" @click="goodsPlacement"
>摆放
</el-button
>
</el-button-group>
</el-form-item>
</el-row>
@ -53,17 +69,12 @@
<el-table-column label="批次号" prop="batchNo" width="120"></el-table-column>
<el-table-column label="生产日期" prop="productionDate" width="120"></el-table-column>
<el-table-column label="失效日期" prop="expireDate" width="120"></el-table-column>
<el-table-column label="入库数量" prop="inCount" width="120"></el-table-column>
<el-table-column label="出库数量" prop="outCount" width="120"></el-table-column>
<el-table-column label="结余数量" prop="reCount" width="120">
<template slot-scope="scope">
{{ (scope.row.inCount - scope.row.outCount) }}
</template>
</el-table-column>
<el-table-column label="生产厂家" prop="ylqxzcrbarmc" v-if="showSup" show-overflow-tooltip
<el-table-column label="仓库" prop="lo" width="120"></el-table-column>
<el-table-column label="分库" prop="expireDate" width="120"></el-table-column>
<el-table-column label="货位" prop="expireDate" width="120"></el-table-column>
<el-table-column label="批准文号" prop="zczbhhzbapzbh" v-if="showSup" show-overflow-tooltip
width="120"></el-table-column>
<el-table-column label="供应商" prop="companyName" v-if="showSup" show-overflow-tooltip
<el-table-column label="生产厂家" prop="ylqxzcrbarmc" v-if="showSup" show-overflow-tooltip
width="120"></el-table-column>
</el-table>
</el-card>
@ -74,15 +85,173 @@
layout="prev, pager, next"
:total="total"
></el-pagination>
<el-dialog
title="货物摆放"
:visible.sync="placeDialogVisible"
width="70%"
:close-on-click-modal="false"
:close-on-press-escape="false"
v-if="placeDialogVisible"
>
<el-form :model="formData" :rules="formRules" ref="dataForm">
<el-button-group style="display: flex;margin: -50px 0 10px 80%; height: 35px">
<el-button
type="primary"
@click.native="saveData()"
>提交
</el-button
>
</el-button-group>
<el-row :gutter="20" style="margin-top: 0px">
<el-col :span="3">
<div class="ao-text">
<span>当前仓库</span>
</div>
</el-col>
<el-col :span="7">
<el-form-item prop="locStorageCode">
<el-select v-model="formData.invStorageCode" placeholder="当前仓库信息"
@change="locInChange"
:disabled="codeArray.length>0"
clearable>
<el-option
v-for="item in storageList"
:key="item.name"
:label="item.name"
:value="item.code">
<span style="float: left">{{ item.name }}</span>
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="3">
<div class="ao-text">
<span>当前分库</span>
</div>
</el-col>
<el-col :span="7">
<el-form-item prop="invWarehouseCode">
<el-select v-model="formData.invWarehouseCode" placeholder="当前分库信息"
:disabled="codeArray.length>0"
@change="subStorageChange"
clearable>
<el-option
v-for="item in formSubInvList"
:key="item.name"
:label="item.name"
:value="item.code">
<span style="float: left">{{ item.name }}</span>
</el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="3">
<div class="ao-text">
<span>当前货位</span>
</div>
</el-col>
<el-col :span="7">
<el-form-item class="query-form-item" prop="invSpaceCode"
>
<el-select v-model="formData.invSpaceCode" placeholder="当前货位信息"
:disabled="codeArray.length>0"
clearable>
<el-option
v-for="item in formSpaceList"
:key="item.name"
:label="item.name"
:value="item.code">
<span style="float: left">{{ item.name }}</span>
</el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20" style="margin-top: 12px">
<el-col :span="2">
<div class="ao-text">
<el-link
target="_blank">{{ scanText }}
</el-link>
</div>
</el-col>
<el-col :span="16">
<el-form-item prop="code">
<el-input
id="inputer"
@focus="getInputFocus($event)"
@keypress.enter.native="enterKey($event)"
ref='inputRef'
style="ime-mode:disabled"
type="tel"
v-model="formData.code"
></el-input>
</el-form-item>
</el-col>
<el-col :span="2">
<el-button
type="primary"
size="small"
@click.native.stop="addCode()"
style="height: 31px; margin-left: 20px"
>添加
</el-button
>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="14" style="margin-left: 40px">
</el-col>
<el-col :span="3">
<div class="text item" style="margin-left: 30px"> 条码数量{{ codeArray.length }}
</div>
</el-col>
</el-row>
<el-table v-loading="loading" :data="codeArray" style="width: 100%;margin-top: 20px;"
max-height="300" height="300" ref="multipleTable">
<el-table-column label="序号" type="index" width="50"></el-table-column>
<el-table-column width="300" label="条码" prop="code" show-overflow-tooltip>
</el-table-column>
<el-table-column label="操作" fixed="right" width="150">
<template slot-scope="scope">
<el-button
type="text"
size="small"
@click.stop="true"
@click.native="deleteCodeArray(scope.$index, scope.row)"
>删除
</el-button
>
</template>
</el-table-column>
</el-table>
</el-form>
</el-dialog>
</div>
</template>
<script>
import draggable from "vuedraggable";
import codeDetail from "./InvProductsDetail";
import store from "../../store";
import {filterUplLocInv} from "@/api/basic/invWarehouse";
import {filterSubByInv} from "@/api/basic/invSubWarehouse";
import {getSpaceCodeList} from "@/api/inventory/invSpace";
import {getPlacementDetailList, bindInvSpace, checkCodeSpace} from "@/api/inventory/InvProducts";
import {isBlank} from "@/utils/strUtil";
import {enterCodeWeb} from "@/api/inout/order";
export default {
@ -92,8 +261,8 @@ export default {
invWarehouseCode: null,
page: 1,
limit: 20,
customerId: null,
invStorageCode: null,
invSpaceCode: null,
},
detailQuery: {
code: null,
@ -102,7 +271,6 @@ export default {
limit: 20,
},
list: [],
codeDetailVisible: false,
total: 0,
loading: false,
index: null,
@ -116,11 +284,24 @@ export default {
storageOptions: [],
storageList: [],
subInvList: [],
spaceCodeList: [],
formSubInvList: [],
formSpaceList: [],
placeDialogVisible: false,
formData: {
invStorageCode: null,
invWarehouseCode: null,
invSpaceCode: null,
code: null,
},
formRules: [],
codeArray: [],
scanText: "扫码录入:",
originCode: null,
};
},
components: {
draggable,
codeDetail,
},
methods: {
onReset() {
@ -129,7 +310,8 @@ export default {
});
this.filterQuery = {
invStorageCode: null,
customerId: null,
invWarehouseCode: null,
invSpaceCode: null,
page: 1,
limit: 20,
};
@ -146,25 +328,25 @@ export default {
this.filterQuery.page = val;
this.getList();
},
handleUnitClick(row) {
this.curIndex = row.id;
this.dialogTableVisible = true;
},
closeDetailDialog(val) {
this.codeDetailVisible = false;
},
closeDialog() {
this.getList();
},
getList() {
this.filterQuery.customerId = store.getters.customerId;
},
intentDetail(row) {
this.idQuery = row;
this.idQuery.customerId = null;
this.codeDetailVisible = true;
this.loading = true
getPlacementDetailList(this.filterQuery).then((res) => {
this.loading = false;
if (res.code === 20000) {
this.list = res.data.list || [];
this.total = res.data.total || 0;
} else {
this.list = [];
this.total = 0;
}
}).catch((error) => {
this.loading = false;
this.list = [];
this.total = 0;
});
},
getStorage() {
this.storageList = [];
@ -176,8 +358,10 @@ export default {
});
},
invChange() {
this.filterQuery.invWarehouseCode = "";
this.filterQuery.invWarehouseCode = null;
this.filterQuery.invSpaceCode = null;
this.subInvList = [];
this.spaceCodeList = [];
let query = {
pcode: this.filterQuery.invStorageCode
};
@ -188,6 +372,151 @@ export default {
.catch(() => {
});
},
invWarehouseChange() {
this.filterQuery.invSpaceCode = null;
this.spaceCodeList = [];
let params = {
invStorageCode: this.filterQuery.invStorageCode,
invWarehouseCode: this.filterQuery.invWarehouseCode
};
getSpaceCodeList(params).then((res) => {
this.spaceCodeList = res.data || [];
})
},
goodsPlacement() {
this.placeDialogVisible = true;
this.formData = {
code: null,
invStorageCode: null,
invWarehouseCode: null,
invSpaceCode: null
};
this.codeArray = [];
},
saveData() {
if (isBlank(this.filterQuery.invStorageCode) || isBlank(this.filterQuery.invWarehouseCode)
|| isBlank(this.filterQuery.invSpaceCode)) {
this.$message.warning("请选择仓库和货位信息");
return;
}
if (this.codeArray.length === 0) {
this.$message.warning("请扫描需要摆放的货物");
return;
}
this.formData.codeArray = this.codeArray;
bindInvSpace(this.formData).then((res) => {
if (res.code === 20000) {
this.$message.success("绑定成功");
this.getList();
} else {
this.$message.error("绑定失败");
}
})
},
deleteCodeArray(index, row) {
for (let i = 0; i < this.codeArray.length; i++) {
if (this.codeArray[i] === row) {
this.codeArray.splice(i, 1);
return;
}
}
},
getInputFocus(event) {
event.currentTarget.select();
},
enterKey(event) {
this.checkSuccess = true;
let tQuery = {
code: this.formData.code.trim(),
invStorageCode: this.formData.invStorageCode,
invWarehouseCode: this.formData.invWarehouseCode,
invSpaceCode: this.formData.invSpaceCode
}
this.checkCode(tQuery);
this.$refs.inputRef.focus();
this.$refs.inputRef.select();
},
addCode(event) {
this.originCode = "";
if (event != null) {
event.target.select();
}
this.actionEnable = true;
this.$refs.inputRef.select();
if (this.$isBlank(this.formData.invStorageCode)) {
this.$message.error('当前仓库不能为空');
return;
}
if (this.formData.invWarehouseCode == null || this.formData.invWarehouseCode == '') {
this.$message.error('当前分库不能为空');
return;
}
if (this.$isBlank(this.formData.invSpaceCode)) {
this.$message.error('当前货位不能为空');
return;
}
this.formData.code = this.formData.code.trim();
if (this.$isBlank(this.formData.code)) return;
this.loading = true;
let tQuery = Object.assign(JSON.parse(JSON.stringify(this.formData)));
this.checkCode(tQuery);
this.$refs.inputRef.select();
},
locInChange() {
this.formData.invWarehouseCode = null;
this.formData.invSpaceCode = null;
this.formSubInvList = [];
this.formSpaceList = [];
let params = {pcode: this.formData.invStorageCode};
filterSubByInv(params).then((res) => {
this.formSubInvList = res.data || [];
})
},
subStorageChange() {
this.formData.invSpaceCode = null;
this.formSpaceList = [];
let params = {
invStorageCode: this.formData.invStorageCode,
invWarehouseCode: this.formData.invWarehouseCode
};
getSpaceCodeList(params).then((res) => {
this.formSpaceList = res.data || [];
})
},
checkCode(tQuery) {
//
this.codeArray.forEach(code => {
if (code === this.formData.code) {
this.$message.error("重复条码!");
return;
}
})
//
checkCodeSpace(tQuery).then((res) => {
if (res.code === 20000) {
this.codeArray.push(this.formData.code);
} else if (res.code === 8){
this.$message.error(res.data);
} else if (res.code === 7) {
this.$confirm(res.data, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.codeArray.push(this.formData.code);
}).catch(() => {
this.$message({
type: 'info',
message: '已取消'
});
});
}
})
},
},
created() {
this.getList();

@ -119,7 +119,6 @@
></addCountOrder>
</el-dialog>
</div>
</template>

Loading…
Cancel
Save