1.完成货位管理页面

feature-order-fix
x_z 2 years ago
parent 6675843652
commit 45e474eeff

@ -47,22 +47,21 @@
</el-form>
<el-table v-loading="loading" :data="list" style="width: 100%">
<el-table-column label="序号" type="index"></el-table-column>
<el-table-column label="货位号" prop="code" width="120"></el-table-column>
<el-table-column label="货位名称" prop="name" width="180">
</el-table-column>
<el-table-column label="所属仓库" prop="invStorageName"
show-overflow-tooltip width="120"></el-table-column>
<el-table-column label="货位号" prop="code" width="150"></el-table-column>
<el-table-column label="货位名称" prop="name" width="200"></el-table-column>
<el-table-column label="所属仓库" prop="invStorageName" width="200"
show-overflow-tooltip></el-table-column>
<el-table-column label="所属分库" prop="invSubStorageName"
show-overflow-tooltip width="120"></el-table-column>
<el-table-column label="状态" prop="status"
show-overflow-tooltip width="120">
show-overflow-tooltip width="150">
<template slot-scope="scope">
<el-tag>
{{ statusMap[scope.row.status] }}
</el-tag>
</template>
</el-table-column>
<el-table-column label="操作" width="120" fixed="right">
<el-table-column label="操作" width="150" fixed="right">
<template slot-scope="scope">
<el-button
type="text"
@ -90,12 +89,12 @@
<el-dialog
:title="formMap[formName]"
:visible.sync="modifySpaceVisible"
width="50%"
width="70%"
:close-on-click-modal="false"
:close-on-press-escape="false"
v-if="modifySpaceVisible"
>
<el-form :model="formData" ref="formData">
<el-form :model="formData" :rules="rules" ref="formData">
<el-row :gutter="20">
<el-col :span="2">
<span>货位编码</span>
@ -124,7 +123,17 @@
</el-col>
<el-col :span="10">
<el-form-item prop="invStorageCode">
<el-select v-model="formData.invStorageCode"
placeholder="请选择"
@change="changeStorage"
>
<el-option
v-for="item in storageList"
:key="item.name"
:label="item.name"
:value="item.code">
</el-option>
</el-select>
</el-form-item>
</el-col>
@ -133,7 +142,15 @@
</el-col>
<el-col :span="10">
<el-form-item prop="invWarehouseCode">
<el-select v-model="formData.invWarehouseCode" :disabled="modifyWarehouseDisable" placeholder="请选择">
<el-option
v-for="item in modifySubInvList"
:key="item.name"
:label="item.name"
:value="item.code"
>
</el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
@ -143,7 +160,7 @@
<span>备注</span>
</el-col>
<el-col :span="10">
<el-form-item prop="invStorageCode">
<el-form-item prop="remark">
<el-input v-model="formData.remark" auto-complete="off"
placeholder="请输入备注内容"></el-input>
</el-form-item>
@ -159,6 +176,17 @@
</el-form-item>
</el-col>
</el-row>
<div style="text-align: center">
<el-button type="primary" size="small" icon="search" @click="saveSpace"
>提交
</el-button
>
<el-button type="primary" size="small" icon="search" @click="modifySpaceVisible = false"
>取消
</el-button
>
</div>
</el-form>
</el-dialog>
</div>
@ -171,6 +199,7 @@ import {filterSubByInv} from "@/api/basic/invSubWarehouse";
import {userInfo} from "@/api/auth/login";
import {isBlank} from "@/utils/strUtil";
import {getInvSpaceList, saveSpace, deleteSpace} from "@/api/inventory/invSpace";
import ThrInvProducts from "@/views/thrsys/ThrInvProducts";
export default {
data() {
@ -192,11 +221,6 @@ export default {
index: null,
dialogTableVisible: false,
invWarehouseDisabled: true,
formLoading: false,
dialogVisible: false,
deleteLoading: false,
idQuery: null,
fromOptions: [],
statusMap: {
0: "禁用",
1: "启用"
@ -206,6 +230,7 @@ export default {
edit: "编辑货位"
},
formName: null,
modifyWarehouseDisable: true,
modifySpaceVisible: false,
formData: {
id: null,
@ -215,7 +240,22 @@ export default {
invWarehouseCode: null,
status: 1,
remark: null
}
},
rules: {
code: [
{required: true, message: "请输入货位编码", trigger: "blur"}
],
name: [
{required: true, message: "请输入货位名称", trigger: "blur"}
],
invStorageCode: [
{required: true, message: "请选择所属仓库", trigger: "blur"}
],
invWarehouseCode: [
{required: true, message: "请选择所属分库", trigger: "blur"}
]
},
modifySubInvList: []
};
},
methods: {
@ -238,25 +278,10 @@ export default {
this.filterQuery.page = 1;
this.getList();
},
handleSizeChange(val) {
this.filterQuery.limit = val;
this.getList();
},
handleCurrentChange(val) {
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.loading = true;
this.filterQuery.customerId = store.getters.customerId;
@ -318,7 +343,15 @@ export default {
this.invWarehouseDisabled = true;
}
},
resetForm() {
if (this.$refs["formData"]) {
//
this.$refs["formData"].clearValidate();
this.getList();
}
},
editSpace(row) {
this.resetForm();
this.modifySpaceVisible = true;
this.formName = "edit";
this.formData = row;
@ -326,6 +359,7 @@ export default {
addSpace() {
this.modifySpaceVisible = true;
this.formName = "add";
this.resetForm();
this.formData = {
id: null,
code: null,
@ -336,6 +370,34 @@ export default {
remark: null
}
},
saveSpace() {
this.$refs['formData'].validate((valid) => {
if (valid) {
saveSpace(this.formData, this.formName).then((res) => {
if (res.code === 20000) {
this.$message.success("新增成功");
this.getList();
this.modifySpaceVisible = false;
} else {
this.$message.error(res.data.message);
}
})
}
})
},
changeStorage() {
this.formData.invWarehouseCode = null;
this.modifyWarehouseDisable = false;
let query = {
pcode: this.formData.invStorageCode
};
filterSubByInv(query)
.then((response) => {
this.modifySubInvList = response.data || [];
})
.catch(() => {
});
},
},
mounted() {
document.body.ondrop = function (event) {

Loading…
Cancel
Save