|
|
|
@ -31,7 +31,7 @@
|
|
|
|
|
<el-button-group style="margin-left: 10px;display:flex;">
|
|
|
|
|
<el-button type="primary" icon="el-icon-refresh" @click="onReset">重置</el-button>
|
|
|
|
|
<el-button type="primary" icon="el-icon-search" @click="onSubmit">查询</el-button>
|
|
|
|
|
<el-button type="primary" icon="el-icon-box" @click="onSubmit">摆放</el-button>
|
|
|
|
|
<el-button type="primary" icon="el-icon-box" @click="invPlace">摆放</el-button>
|
|
|
|
|
</el-button-group>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-form>
|
|
|
|
@ -61,8 +61,112 @@
|
|
|
|
|
></pagination>
|
|
|
|
|
</el-card>
|
|
|
|
|
|
|
|
|
|
<el-dialog
|
|
|
|
|
title="库存摆放"
|
|
|
|
|
:visible.sync="placeDialogVisible"
|
|
|
|
|
:close-on-click-modal="false"
|
|
|
|
|
:close-on-press-escape="false"
|
|
|
|
|
width="60%"
|
|
|
|
|
v-if="placeDialogVisible"
|
|
|
|
|
>
|
|
|
|
|
<el-card style="margin: 5px;margin-top: -20px">
|
|
|
|
|
<el-form :model="formData" label-width="100px" style="margin-bottom: -15px">
|
|
|
|
|
<el-button-group style="display: flex;margin: 0px 0 10px 80%; height: 35px">
|
|
|
|
|
<el-button
|
|
|
|
|
size="mini"
|
|
|
|
|
type="primary"
|
|
|
|
|
@click.native="saveData()"
|
|
|
|
|
>提交
|
|
|
|
|
</el-button
|
|
|
|
|
>
|
|
|
|
|
</el-button-group>
|
|
|
|
|
<el-row>
|
|
|
|
|
<el-col :span="10">
|
|
|
|
|
<el-form-item prop="invWarehouseCode" label="当前仓库:">
|
|
|
|
|
<el-select v-model="formData.invCode"
|
|
|
|
|
placeholder="当前仓库信息"
|
|
|
|
|
:disabled="codeArray.length>0"
|
|
|
|
|
@change="formInvChange"
|
|
|
|
|
style="width: 90%"
|
|
|
|
|
clearable>
|
|
|
|
|
<el-option
|
|
|
|
|
v-for="item in invList"
|
|
|
|
|
: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="10">
|
|
|
|
|
<el-form-item class="query-form-item" label="当前货位:">
|
|
|
|
|
<el-select v-model="formData.invSpaceCode"
|
|
|
|
|
placeholder="当前货位信息"
|
|
|
|
|
:disabled="codeArray.length>0"
|
|
|
|
|
style="width: 90%"
|
|
|
|
|
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>
|
|
|
|
|
<el-col :span="18">
|
|
|
|
|
<el-form-item class="query-form-item" label="扫码录入:">
|
|
|
|
|
<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="mini"
|
|
|
|
|
@click.native.stop="addCode()"
|
|
|
|
|
style="margin-left: 15px"
|
|
|
|
|
>添加
|
|
|
|
|
</el-button
|
|
|
|
|
>
|
|
|
|
|
</el-col>
|
|
|
|
|
</el-row>
|
|
|
|
|
|
|
|
|
|
<el-table v-loading="codeTableLoading" :data="codeArray" style="width: 100%;margin-top: 20px;"
|
|
|
|
|
highlight-current-row
|
|
|
|
|
border max-height="300" height="300">
|
|
|
|
|
<el-table-column label="序号" type="index" width="50"></el-table-column>
|
|
|
|
|
<el-table-column 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-card>
|
|
|
|
|
</el-dialog>
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
@ -70,8 +174,7 @@
|
|
|
|
|
<script>
|
|
|
|
|
import {getInvListByUser} from "@/api/system/invWarehouse";
|
|
|
|
|
import {getInvSpaceList} from "@/api/inventory/invSpace";
|
|
|
|
|
import {getInvProduct, deleteInvProduct} from "@/api/inventory/invPorduct";
|
|
|
|
|
import {getBasicUnitMaintains} from "@/api/basic/basicUnitMaintain";
|
|
|
|
|
import {getPlaceDetailList, bindInvSpace, checkCodeSpace} from "@/api/inventory/invPlace";
|
|
|
|
|
import {isBlank} from "@/utils/strUtil";
|
|
|
|
|
|
|
|
|
|
export default {
|
|
|
|
@ -82,33 +185,25 @@ export default {
|
|
|
|
|
invCode: this.$store.getters.locInvCode,
|
|
|
|
|
invSpaceCode: null,
|
|
|
|
|
page: 1,
|
|
|
|
|
limit: 10,
|
|
|
|
|
limit: 20,
|
|
|
|
|
},
|
|
|
|
|
list: [],
|
|
|
|
|
total: 0,
|
|
|
|
|
invList: [],
|
|
|
|
|
spaceList: [],
|
|
|
|
|
loading: false,
|
|
|
|
|
deleteData: {
|
|
|
|
|
id: "",
|
|
|
|
|
status: 10,
|
|
|
|
|
},
|
|
|
|
|
corpLoading: false,
|
|
|
|
|
dialogVisible: false,
|
|
|
|
|
fromOptions: [],
|
|
|
|
|
showSup: false,
|
|
|
|
|
detailDialogVisible: false,
|
|
|
|
|
inputQuery: {
|
|
|
|
|
cpmctymc: null,
|
|
|
|
|
nameCode: null,
|
|
|
|
|
batchNo: null,
|
|
|
|
|
ggxh: null,
|
|
|
|
|
productionDate: null,
|
|
|
|
|
expireDate: null,
|
|
|
|
|
supId: null,
|
|
|
|
|
deptCode: null,
|
|
|
|
|
invCode: null
|
|
|
|
|
}
|
|
|
|
|
formData: {
|
|
|
|
|
invCode: null,
|
|
|
|
|
invSpaceCode: null,
|
|
|
|
|
code: null,
|
|
|
|
|
codeArray: []
|
|
|
|
|
},
|
|
|
|
|
placeDialogVisible: false,
|
|
|
|
|
codeTableLoading: false,
|
|
|
|
|
codeArray: [],
|
|
|
|
|
formInvList: [],
|
|
|
|
|
formSpaceList: []
|
|
|
|
|
};
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
@ -117,16 +212,10 @@ export default {
|
|
|
|
|
path: "",
|
|
|
|
|
});
|
|
|
|
|
this.filterQuery = {
|
|
|
|
|
nameCode: null,
|
|
|
|
|
cpmctymc: null,
|
|
|
|
|
ggxh: null,
|
|
|
|
|
batchNo: null,
|
|
|
|
|
supId: null,
|
|
|
|
|
zczbhhzbapzbh: null,
|
|
|
|
|
ylqxzcrbarmc: null,
|
|
|
|
|
invCode: this.$store.getters.locInvCode,
|
|
|
|
|
invSpaceCode: null,
|
|
|
|
|
page: 1,
|
|
|
|
|
limit: 10,
|
|
|
|
|
limit: 20,
|
|
|
|
|
};
|
|
|
|
|
this.getList();
|
|
|
|
|
},
|
|
|
|
@ -134,17 +223,9 @@ export default {
|
|
|
|
|
this.filterQuery.page = 1;
|
|
|
|
|
this.getList();
|
|
|
|
|
},
|
|
|
|
|
handleSizeChange(val) {
|
|
|
|
|
this.filterQuery.limit = val;
|
|
|
|
|
this.getList();
|
|
|
|
|
},
|
|
|
|
|
handleCurrentChange(val) {
|
|
|
|
|
this.filterQuery.page = val;
|
|
|
|
|
this.getList();
|
|
|
|
|
},
|
|
|
|
|
getList() {
|
|
|
|
|
this.loading = true;
|
|
|
|
|
getInvProduct(this.filterQuery).then((res) => {
|
|
|
|
|
getPlaceDetailList(this.filterQuery).then((res) => {
|
|
|
|
|
this.loading = false;
|
|
|
|
|
if (res.code === 20000) {
|
|
|
|
|
this.list = res.data.list || [];
|
|
|
|
@ -163,88 +244,136 @@ export default {
|
|
|
|
|
},
|
|
|
|
|
invChange() {
|
|
|
|
|
this.spaceList = [];
|
|
|
|
|
this.getSpaceList();
|
|
|
|
|
this.getList();
|
|
|
|
|
},
|
|
|
|
|
getInvList() {
|
|
|
|
|
getInvListByUser()
|
|
|
|
|
.then((response) => {
|
|
|
|
|
this.invList = response.data || [];
|
|
|
|
|
this.getSpaceList();
|
|
|
|
|
this.getList();
|
|
|
|
|
})
|
|
|
|
|
.catch(() => {
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
getSpaceList() {
|
|
|
|
|
let params = {};
|
|
|
|
|
let params = {invWarehouseCode: this.filterQuery.invCode};
|
|
|
|
|
getInvSpaceList(params).then((res) => {
|
|
|
|
|
this.spaceList = res.data || [];
|
|
|
|
|
this.spaceList = res.data.list || [];
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
findMethod(key) {
|
|
|
|
|
this.corpLoading = true;
|
|
|
|
|
this.fromOptions = [];
|
|
|
|
|
let params = {
|
|
|
|
|
key: key,
|
|
|
|
|
corpType: 2,
|
|
|
|
|
page: 1,
|
|
|
|
|
limit: 20
|
|
|
|
|
};
|
|
|
|
|
getBasicUnitMaintains(params).then((res) => {
|
|
|
|
|
this.corpLoading = false;
|
|
|
|
|
this.fromOptions = res.data.list || [];
|
|
|
|
|
}).catch(() => {
|
|
|
|
|
this.corpLoading = false;
|
|
|
|
|
formInvChange() {
|
|
|
|
|
this.formData.invSpaceCode = null;
|
|
|
|
|
let params = {invWarehouseCode: this.formData.invCode}
|
|
|
|
|
getInvSpaceList(params).then((res) => {
|
|
|
|
|
this.formSpaceList = res.data.list || [];
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
corpChange(value) {
|
|
|
|
|
if (!isBlank(value)) {
|
|
|
|
|
this.findMethod(value);
|
|
|
|
|
invPlace() {
|
|
|
|
|
this.placeDialogVisible = true;
|
|
|
|
|
this.formData = {
|
|
|
|
|
invCode: null,
|
|
|
|
|
invSpaceCode: null,
|
|
|
|
|
code: null,
|
|
|
|
|
codeArray: []
|
|
|
|
|
};
|
|
|
|
|
this.codeArray = [];
|
|
|
|
|
},
|
|
|
|
|
deleteCodeArray(index, row) {
|
|
|
|
|
for (let i = 0; i < this.codeArray.length; i++) {
|
|
|
|
|
if (this.codeArray[i] === row) {
|
|
|
|
|
this.codeArray.splice(i, 1);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
detailDialog(row) {
|
|
|
|
|
this.detailDialogVisible = true;
|
|
|
|
|
this.inputQuery = {
|
|
|
|
|
relId: row.relIdFk,
|
|
|
|
|
cpmctymc: row.cpmctymc,
|
|
|
|
|
nameCode: row.nameCode,
|
|
|
|
|
batchNo: row.batchNo,
|
|
|
|
|
ggxh: row.ggxh,
|
|
|
|
|
productionDate: row.productionDate,
|
|
|
|
|
expireDate: row.expireDate,
|
|
|
|
|
supId: row.supId,
|
|
|
|
|
deptCode: row.deptCode,
|
|
|
|
|
invCode: row.invCode
|
|
|
|
|
addCode(event) {
|
|
|
|
|
if (event != null) {
|
|
|
|
|
event.target.select();
|
|
|
|
|
}
|
|
|
|
|
this.$refs.inputRef.select();
|
|
|
|
|
if (isBlank(this.formData.invCode)) {
|
|
|
|
|
this.$message.error('当前仓库不能为空');
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (isBlank(this.formData.invSpaceCode)) {
|
|
|
|
|
this.$message.error('当前货位不能为空');
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
this.formData.code = this.formData.code.trim();
|
|
|
|
|
if (this.$isBlank(this.formData.code)) return;
|
|
|
|
|
let tQuery = Object.assign(JSON.parse(JSON.stringify(this.formData)));
|
|
|
|
|
this.checkCode(tQuery);
|
|
|
|
|
this.$refs.inputRef.select();
|
|
|
|
|
},
|
|
|
|
|
getInputFocus(event) {
|
|
|
|
|
event.currentTarget.select();
|
|
|
|
|
},
|
|
|
|
|
closeDetailDialog() {
|
|
|
|
|
this.detailDialogVisible = false;
|
|
|
|
|
enterKey(event) {
|
|
|
|
|
this.checkSuccess = true;
|
|
|
|
|
this.addCode(event);
|
|
|
|
|
this.$refs.inputRef.focus();
|
|
|
|
|
this.$refs.inputRef.select();
|
|
|
|
|
},
|
|
|
|
|
deleteDialog(id) {
|
|
|
|
|
this.$confirm("此操作将永久删除此库存信息,是否继续?", "提示", {
|
|
|
|
|
confirmButtonText: "确定",
|
|
|
|
|
cancelButtonText: "取消",
|
|
|
|
|
type: "warning"
|
|
|
|
|
}).then(() => {
|
|
|
|
|
this.deleteInvProduct(id);
|
|
|
|
|
}).catch(() => {
|
|
|
|
|
checkCode(tQuery) {
|
|
|
|
|
//检验是否重复添加
|
|
|
|
|
let flag = false;
|
|
|
|
|
this.codeArray.forEach(item => {
|
|
|
|
|
if (item.code === this.formData.code) {
|
|
|
|
|
this.$message.error("重复条码!");
|
|
|
|
|
flag = true;
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
if (flag) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
//校验此条码是否已经被绑定到其他货位,如已被绑定,则提示,点击确定之后,重置此库存数据的仓库和分库数据
|
|
|
|
|
checkCodeSpace(tQuery).then((res) => {
|
|
|
|
|
if (res.code === 20000) {
|
|
|
|
|
this.codeArray.push({code: this.formData.code});
|
|
|
|
|
} else if (res.code === 8) {
|
|
|
|
|
this.loading = false;
|
|
|
|
|
this.$message.error(res.message);
|
|
|
|
|
} else if (res.code === 7) {
|
|
|
|
|
this.$confirm(res.message, '提示', {
|
|
|
|
|
confirmButtonText: '确定',
|
|
|
|
|
cancelButtonText: '取消',
|
|
|
|
|
type: 'warning'
|
|
|
|
|
}).then(() => {
|
|
|
|
|
this.codeArray.push({code: this.formData.code});
|
|
|
|
|
}).catch(() => {
|
|
|
|
|
this.loading = false;
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
deleteInvProduct(id) {
|
|
|
|
|
let params = {id: id};
|
|
|
|
|
deleteInvProduct(params).then((res) => {
|
|
|
|
|
saveData() {
|
|
|
|
|
if (isBlank(this.formData.invCode) || isBlank(this.formData.invSpaceCode)) {
|
|
|
|
|
this.$message.warning("请选择仓库和货位信息");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
if (this.codeArray.length === 0) {
|
|
|
|
|
this.$message.warning("请扫描需要摆放的货物");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
this.formData.codeArray = [];
|
|
|
|
|
this.codeArray.forEach(item => {
|
|
|
|
|
this.formData.codeArray.push(item.code);
|
|
|
|
|
});
|
|
|
|
|
bindInvSpace(this.formData).then((res) => {
|
|
|
|
|
if (res.code === 20000) {
|
|
|
|
|
this.$message.success("删除成功!");
|
|
|
|
|
this.$message.success("绑定成功");
|
|
|
|
|
this.placeDialogVisible = false;
|
|
|
|
|
this.getList();
|
|
|
|
|
} else {
|
|
|
|
|
this.$message.error(res.message);
|
|
|
|
|
this.$message.error("绑定失败");
|
|
|
|
|
}
|
|
|
|
|
}).catch((error) => {
|
|
|
|
|
this.$message.error(error.message);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
components: {
|
|
|
|
|
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
mounted() {
|
|
|
|
|
document.body.ondrop = function (event) {
|
|
|
|
@ -253,9 +382,7 @@ export default {
|
|
|
|
|
};
|
|
|
|
|
},
|
|
|
|
|
created() {
|
|
|
|
|
this.findMethod();
|
|
|
|
|
this.getInvList();
|
|
|
|
|
this.getList();
|
|
|
|
|
},
|
|
|
|
|
};
|
|
|
|
|
</script>
|
|
|
|
|