1.添加库存摆放功能页面,去除库存统计页面的详情按钮

prod
x_z 2 years ago
parent 0d5813714f
commit 30cb048a8c

@ -0,0 +1,25 @@
import axios from "../../utils/request";
export function getPlaceDetailList(params) {
return axios({
url: "/spms/inv/product/getPlaceDetailList",
method: "get",
params: params
});
}
export function bindInvSpace(data) {
return axios({
url: "/spms/inv/product/bindInvSpace",
method: "post",
data: data
});
}
export function checkCodeSpace(data) {
return axios({
url: "/spms/inv/product/checkCodeSpace",
method: "post",
data: data
});
}

@ -31,7 +31,7 @@
<el-button-group style="margin-left: 10px;display:flex;"> <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-refresh" @click="onReset"></el-button>
<el-button type="primary" icon="el-icon-search" @click="onSubmit"></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-button-group>
</el-form-item> </el-form-item>
</el-form> </el-form>
@ -61,8 +61,112 @@
></pagination> ></pagination>
</el-card> </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> </div>
</template> </template>
@ -70,8 +174,7 @@
<script> <script>
import {getInvListByUser} from "@/api/system/invWarehouse"; import {getInvListByUser} from "@/api/system/invWarehouse";
import {getInvSpaceList} from "@/api/inventory/invSpace"; import {getInvSpaceList} from "@/api/inventory/invSpace";
import {getInvProduct, deleteInvProduct} from "@/api/inventory/invPorduct"; import {getPlaceDetailList, bindInvSpace, checkCodeSpace} from "@/api/inventory/invPlace";
import {getBasicUnitMaintains} from "@/api/basic/basicUnitMaintain";
import {isBlank} from "@/utils/strUtil"; import {isBlank} from "@/utils/strUtil";
export default { export default {
@ -82,33 +185,25 @@ export default {
invCode: this.$store.getters.locInvCode, invCode: this.$store.getters.locInvCode,
invSpaceCode: null, invSpaceCode: null,
page: 1, page: 1,
limit: 10, limit: 20,
}, },
list: [], list: [],
total: 0, total: 0,
invList: [], invList: [],
spaceList: [], spaceList: [],
loading: false, loading: false,
deleteData: {
id: "",
status: 10,
},
corpLoading: false,
dialogVisible: false,
fromOptions: [], fromOptions: [],
showSup: false, formData: {
detailDialogVisible: false, invCode: null,
inputQuery: { invSpaceCode: null,
cpmctymc: null, code: null,
nameCode: null, codeArray: []
batchNo: null, },
ggxh: null, placeDialogVisible: false,
productionDate: null, codeTableLoading: false,
expireDate: null, codeArray: [],
supId: null, formInvList: [],
deptCode: null, formSpaceList: []
invCode: null
}
}; };
}, },
methods: { methods: {
@ -117,16 +212,10 @@ export default {
path: "", path: "",
}); });
this.filterQuery = { this.filterQuery = {
nameCode: null,
cpmctymc: null,
ggxh: null,
batchNo: null,
supId: null,
zczbhhzbapzbh: null,
ylqxzcrbarmc: null,
invCode: this.$store.getters.locInvCode, invCode: this.$store.getters.locInvCode,
invSpaceCode: null,
page: 1, page: 1,
limit: 10, limit: 20,
}; };
this.getList(); this.getList();
}, },
@ -134,17 +223,9 @@ export default {
this.filterQuery.page = 1; this.filterQuery.page = 1;
this.getList(); this.getList();
}, },
handleSizeChange(val) {
this.filterQuery.limit = val;
this.getList();
},
handleCurrentChange(val) {
this.filterQuery.page = val;
this.getList();
},
getList() { getList() {
this.loading = true; this.loading = true;
getInvProduct(this.filterQuery).then((res) => { getPlaceDetailList(this.filterQuery).then((res) => {
this.loading = false; this.loading = false;
if (res.code === 20000) { if (res.code === 20000) {
this.list = res.data.list || []; this.list = res.data.list || [];
@ -163,88 +244,136 @@ export default {
}, },
invChange() { invChange() {
this.spaceList = []; this.spaceList = [];
this.getSpaceList();
this.getList(); this.getList();
}, },
getInvList() { getInvList() {
getInvListByUser() getInvListByUser()
.then((response) => { .then((response) => {
this.invList = response.data || []; this.invList = response.data || [];
this.getSpaceList();
this.getList(); this.getList();
}) })
.catch(() => { .catch(() => {
}); });
}, },
getSpaceList() { getSpaceList() {
let params = {}; let params = {invWarehouseCode: this.filterQuery.invCode};
getInvSpaceList(params).then((res) => { getInvSpaceList(params).then((res) => {
this.spaceList = res.data || []; this.spaceList = res.data.list || [];
}) })
}, },
findMethod(key) { formInvChange() {
this.corpLoading = true; this.formData.invSpaceCode = null;
this.fromOptions = []; let params = {invWarehouseCode: this.formData.invCode}
let params = { getInvSpaceList(params).then((res) => {
key: key, this.formSpaceList = res.data.list || [];
corpType: 2,
page: 1,
limit: 20
};
getBasicUnitMaintains(params).then((res) => {
this.corpLoading = false;
this.fromOptions = res.data.list || [];
}).catch(() => {
this.corpLoading = false;
}) })
}, },
corpChange(value) { invPlace() {
if (!isBlank(value)) { this.placeDialogVisible = true;
this.findMethod(value); 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) { addCode(event) {
this.detailDialogVisible = true; if (event != null) {
this.inputQuery = { event.target.select();
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
} }
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();
}, },
closeDetailDialog() { getInputFocus(event) {
this.detailDialogVisible = false; event.currentTarget.select();
}, },
deleteDialog(id) { enterKey(event) {
this.$confirm("此操作将永久删除此库存信息,是否继续?", "提示", { this.checkSuccess = true;
confirmButtonText: "确定", this.addCode(event);
cancelButtonText: "取消", this.$refs.inputRef.focus();
type: "warning" this.$refs.inputRef.select();
},
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(() => { }).then(() => {
this.deleteInvProduct(id); this.codeArray.push({code: this.formData.code});
}).catch(() => { }).catch(() => {
this.loading = false;
});
}
}); });
}, },
deleteInvProduct(id) { saveData() {
let params = {id: id}; if (isBlank(this.formData.invCode) || isBlank(this.formData.invSpaceCode)) {
deleteInvProduct(params).then((res) => { 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) { if (res.code === 20000) {
this.$message.success("删除成功!"); this.$message.success("绑定成功");
this.placeDialogVisible = false;
this.getList(); this.getList();
} else { } else {
this.$message.error(res.message); this.$message.error("绑定失败");
}
}).catch((error) => {
this.$message.error(error.message);
});
} }
})
}, },
components: {
}, },
mounted() { mounted() {
document.body.ondrop = function (event) { document.body.ondrop = function (event) {
@ -253,9 +382,7 @@ export default {
}; };
}, },
created() { created() {
this.findMethod();
this.getInvList(); this.getInvList();
this.getList();
}, },
}; };
</script> </script>

@ -127,17 +127,6 @@
show-overflow-tooltip width="120"></el-table-column> show-overflow-tooltip width="120"></el-table-column>
<el-table-column label="仓库" prop="invName" v-if="showSup" <el-table-column label="仓库" prop="invName" v-if="showSup"
show-overflow-tooltip width="120"></el-table-column> show-overflow-tooltip width="120"></el-table-column>
<el-table-column label="操作" width="150">
<template slot-scope="scope">
<el-button
type="text"
size="small"
@click.native.stop="detailDialog(scope.row)"
>详情
</el-button
>
</template>
</el-table-column>
</el-table> </el-table>
<pagination <pagination
v-show="total>0" v-show="total>0"
@ -147,21 +136,6 @@
@pagination="getList" @pagination="getList"
></pagination> ></pagination>
</el-card> </el-card>
<el-dialog
title="库存详情"
:visible.sync="detailDialogVisible"
:close-on-click-modal="false"
:close-on-press-escape="false"
width="85%"
v-if="detailDialogVisible"
>
<invProductsDetail
:inputQuery="inputQuery"
v-on:closeDetailDialog="closeDetailDialog"
></invProductsDetail>
</el-dialog>
</div> </div>
</template> </template>
@ -173,7 +147,7 @@ import {isBlank} from "@/utils/strUtil";
import invProductsDetail from "@/views/inventory/InvProductsDetail.vue"; import invProductsDetail from "@/views/inventory/InvProductsDetail.vue";
export default { export default {
name: "InvProducts", name: "InvStatistics",
data() { data() {
return { return {
showSearch: true, showSearch: true,
@ -193,26 +167,9 @@ export default {
total: 0, total: 0,
invList: [], invList: [],
loading: false, loading: false,
deleteData: {
id: "",
status: 10,
},
corpLoading: false, corpLoading: false,
dialogVisible: false,
fromOptions: [], fromOptions: [],
showSup: false, showSup: false,
detailDialogVisible: false,
inputQuery: {
cpmctymc: null,
nameCode: null,
batchNo: null,
ggxh: null,
productionDate: null,
expireDate: null,
supId: null,
deptCode: null,
invCode: null
}
}; };
}, },
methods: { methods: {
@ -308,27 +265,8 @@ export default {
this.findMethod(value); this.findMethod(value);
} }
}, },
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
}
},
closeDetailDialog() {
this.detailDialogVisible = false;
},
}, },
components: { components: {
invProductsDetail
}, },
mounted() { mounted() {
document.body.ondrop = function (event) { document.body.ondrop = function (event) {

Loading…
Cancel
Save