Browse Source

仓库增加行政区域划分

test
kilo 2 years ago
parent
commit
419224f21e
  1. 222
      src/option/basicdata/basicdataWarehouse1.js
  2. 704
      src/views/basicdata/warehouse/warehouse/basicdataWarehouse1.vue

222
src/option/basicdata/basicdataWarehouse1.js

@ -0,0 +1,222 @@
export default {
expand: false,
index: true,
border: true,
selection: true,
column: [
{
label: "租户号",
prop: "tenantId",
display: false,
hide: true,
},
{
label: "创建人",
prop: "createUser",
display: false,
hide: true,
},
{
label: "创建时间",
prop: "createTime",
display: false,
hide: true,
},
{
label: "更新人",
prop: "updateUser",
display: false,
hide: true,
},
{
label: "更新时间",
prop: "updateTime",
display: false,
hide: true,
},
{
label: "状态",
prop: "status",
display: false,
hide: true,
},
{
label: "是否已删除",
prop: "isDeleted",
display: false,
hide: true,
},
{
label: "创建部门",
prop: "createDept",
display: false,
hide: true,
},
{
label: "主键",
prop: "id",
display: false,
hide: true,
},
// {
// label: "预留1",
// prop: "reserve1",
// },
// {
// label: "预留2",
// prop: "reserve2",
// },
// {
// label: "预留3",
// prop: "reserve3",
// },
// {
// label: "预留4",
// prop: "reserve4",
// },
// {
// label: "预留5",
// prop: "reserve5",
// },
{
label: "仓库名称",
prop: "name",
width:"100px"
},
{
label: "仓库代码",
prop: "code",
width:"100px"
},
{
label: "仓库简称",
prop: "abbreviation",
width:"100px"
},
{
label: "联系人",
prop: "linkman",
width:"100px"
},
{
label: "联系人电话",
prop: "contactNumber",
width:"100px"
},
{
label: "管理区域",
prop: "administrativeAreas",
width:"100px"
},
{
label: "配送商场",
prop: "distributionMall",
width:"100px"
},
{
label: "事业线",
prop: "businessLine",
width:"100px"
},
{
label: "基地仓",
prop: "depotBase",
width:"100px"
},
{
label: "收款码",
prop: "moneyReceivingCode",
width:"100px"
},
{
label: "备注",
prop: "remarks",
width:"100px"
},
{
label: "仓库地址",
prop: "warehouseAddress",
width:"100px"
},
{
label: "经度",
prop: "longitude",
width:"100px"
},
{
label: "纬度",
prop: "latitude",
width:"100px"
},
{
label: "所属部门",
prop: "department",
width:"100px"
},
{
label: "仓库类型",
prop: "warehouseType",
width:"100px"
},
{
label: "消防等级",
prop: "fireGrade",
width:"100px"
},
{
label: "是否有消防等级",
prop: "fireRatingNot",
width:"100px"
},
{
label: "商家仓",
prop: "merchantFactory",
},
{
label: "仓库结构",
prop: "warehouseStructure",
width:"100px"
},
{
label: "是否高架",
prop: "elevatedNot",
width:"100px"
},
{
label: "仓库层高",
prop: "storeyHeight",
width:"100px"
},
{
label: "电力类型",
prop: "powerCondition",
width:"100px"
},
{
label: "面积",
prop: "acreage",
width:"100px"
},
{
label: "单价",
prop: "unitPrice",
width:"100px"
},
{
label: "管理费",
prop: "administrativeFee",
width:"100px"
},
{
label: "库位数",
prop: "seating",
width:"100px"
},
{
label: "仓库等级",
prop: "grade",
width:"100px"
},
]
}

704
src/views/basicdata/warehouse/warehouse/basicdataWarehouse1.vue

@ -0,0 +1,704 @@
<template>
<basic-container>
<div class="avue-crud">
<el-row :hidden="!search" style="padding:6px 18px">
<!-- 查询模块 -->
<el-form :inline="true" :model="query">
<!-- 查询按钮 -->
<el-form-item>
<el-col>
<el-form-item label="仓库名称:">
<el-input v-model="query.name" placeholder="请输入仓库名称"></el-input>
</el-form-item>
<el-form-item label="仓库代码:">
<el-input v-model="query.code" placeholder="请输入仓库代码"></el-input>
</el-form-item>
<el-form-item label="仓库地址:">
<el-input v-model="query.address" placeholder="请输入仓库地址"></el-input>
</el-form-item>
<el-form-item label="仓库类型:">
<el-select v-model="query.warehouseType" clearable placeholder="请选择仓库类型" style="width: 88%;">
<el-option
v-for="item in warehouseType"
:key="item.dictKey"
:label="item.dictValue"
:value="item.dictKey">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="电力类型:" >
<el-select v-model="query.powerCondition" clearable placeholder="请选择电力类型" style="width: 88%;">
<el-option
v-for="item in powerCondition"
:key="item.dictKey"
:label="item.dictValue"
:value="item.dictKey">
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col>
<el-form-item label="仓库简称:">
<el-input v-model="query.abbreviation" placeholder="请输入仓库简称"></el-input>
</el-form-item>
<el-form-item label="联系人:" label-width="70px">
<el-input v-model="query.linkman" placeholder="请输入联系人"></el-input>
</el-form-item>
<el-form-item label="联系电话:">
<el-input v-model="query.contactNumber" placeholder="请输入联系电话"></el-input>
</el-form-item>
<el-form-item label="管理区域:">
<el-input v-model="query.administrativeAreas" placeholder="请输入管理区域"></el-input>
</el-form-item>
<el-form-item label="配送商场:" label-width="94px">
<el-select v-model="query.warehouseType" clearable placeholder="请选择电力类型" style="width: 88%;">
<el-option
v-for="item in powerCondition"
:key="item.dictKey"
:label="item.dictValue"
:value="item.dictKey">
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col>
<el-form-item label="事业线:" label-width="70px">
<el-input v-model="query.businessLine" placeholder="请输入事业线"></el-input>
</el-form-item>
<el-form-item label="部门:" label-width="70px">
<el-input v-model="query.department" placeholder="请输入部门"></el-input>
</el-form-item>
<el-form-item label="消防等级:">
<el-input v-model="query.fireGrade" placeholder="请输入消防等级"></el-input>
</el-form-item>
<el-form-item label="是否高架:">
<el-select v-model="query.elevatedNot" clearable placeholder="请选择是否高架" style="width: 90%;">
<el-option
v-for="item in elevatedNotData"
:key="item.dictKey"
:label="item.dictValue"
:value="item.dictKey">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="仓库等级:" >
<el-select v-model="query.grade" clearable placeholder="请选择仓库等级" style="width: 90%;">
<el-option
v-for="item in warehouseGrade"
:key="item.dictKey"
:label="item.dictValue"
:value="item.dictKey">
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col span="12">
<el-button type="primary" icon="el-icon-search" @click="searchChange"> </el-button>
<el-button icon="el-icon-delete" @click="searchReset()"> </el-button>
</el-col>
</el-form-item>
</el-form>
</el-row>
<el-row>
<div class="avue-crud__header">
<!-- 头部左侧按钮模块 -->
<div class="avue-crud__left">
<el-button type="primary" icon="el-icon-plus" @click="handleAdd"> </el-button>
<el-button type="danger" icon="el-icon-delete" @click="handleDelete" plain> </el-button>
</div>
<!-- 头部右侧按钮模块 -->
<div class="avue-crud__right">
<el-button icon="el-icon-refresh" @click="searchChange" circle></el-button>
<el-button icon="el-icon-search" @click="searchHide" circle></el-button>
</div>
</div>
</el-row>
<el-row>
<!-- 列表模块 -->
<el-table ref="table" v-loading="loading"
@selection-change="selectionChange"
:data="data"
:height="height"
style="width: 100%"
:border="option.border">
<el-table-column type="selection" v-if="option.selection" width="55" align="center"></el-table-column>
<el-table-column type="expand" v-if="option.expand" align="center"></el-table-column>
<el-table-column v-if="option.index" label="序号" type="index" width="80" align="center">
</el-table-column>
<template v-for="(item,index) in option.column">
<!-- table字段 -->
<el-table-column v-if="item.hide!==true"
:prop="item.prop"
:label="item.label"
:width="item.width"
:key="index"
align="center">
</el-table-column>
</template>
<!-- 操作栏模块 -->
<el-table-column prop="menu" label="操作" :width="220" align="center">
<template #="{row}">
<el-button type="primary" text icon="el-icon-view" @click="handleView(row)">查看</el-button>
<el-button type="primary" text icon="el-icon-edit" @click="handleEdit(row)">编辑</el-button>
<el-button type="primary" text icon="el-icon-delete" @click="rowDel(row)">删除</el-button>
</template>
</el-table-column>
</el-table>
</el-row>
<el-row>
<div class="avue-crud__pagination" style="width:100%">
<!-- 分页模块 -->
<el-pagination align="right"
background
@size-change="sizeChange"
@current-change="currentChange"
:current-page="page.currentPage"
:page-sizes="[10, 20, 30, 40, 50, 100]"
:page-size="page.pageSize"
layout="total, sizes, prev, pager, next, jumper"
:total="page.total">
</el-pagination>
</div>
</el-row>
<!-- 表单模块 -->
<el-dialog :title="title"
v-model="box"
width="50%"
:before-close="beforeClose"
append-to-body>
<el-form :disabled="view" ref="form" :model="form" :rules="validatorRules" label-width="120px">
<!-- 表单字段 -->
<!-- <el-form-item label="预留1" prop="reserve1">-->
<!-- <el-input v-model="form.reserve1" placeholder="请输入预留1"/>-->
<!-- </el-form-item>-->
<!-- <el-form-item label="预留2" prop="reserve2">-->
<!-- <el-input v-model="form.reserve2" placeholder="请输入预留2"/>-->
<!-- </el-form-item>-->
<!-- <el-form-item label="预留3" prop="reserve3">-->
<!-- <el-input v-model="form.reserve3" placeholder="请输入预留3"/>-->
<!-- </el-form-item>-->
<!-- <el-form-item label="预留4" prop="reserve4">-->
<!-- <el-input v-model="form.reserve4" placeholder="请输入预留4"/>-->
<!-- </el-form-item>-->
<!-- <el-form-item label="预留5" prop="reserve5">-->
<!-- <el-input v-model="form.reserve5" placeholder="请输入预留5"/>-->
<!-- </el-form-item>-->
<el-row >
<el-col :span="12">
<el-form-item label="仓库名称:" prop="name">
<el-input v-model="form.name" placeholder="请输入仓库名称"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="仓库代码:" prop="code">
<el-input v-model="form.code" placeholder="请输入仓库代码"/>
</el-form-item>
</el-col>
</el-row>
<el-row >
<el-col :span="12">
<el-form-item label="仓库简称:" prop="abbreviation">
<el-input v-model="form.abbreviation" placeholder="请输入仓库简称"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="联系人:" prop="linkman">
<el-input v-model="form.linkman" placeholder="请输入联系人"/>
</el-form-item>
</el-col>
</el-row>
<el-row >
<el-col :span="12">
<el-form-item label="联系人电话:" prop="contactNumber">
<el-input v-model="form.contactNumber" placeholder="请输入联系人电话"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="管理区域:" prop="administrativeAreas">
<el-input v-model="form.administrativeAreas" placeholder="请输入管理区域"/>
</el-form-item>
</el-col>
</el-row>
<el-row >
<el-col :span="12">
<el-form-item label="配送商场" prop="distributionMall">
<el-input v-model="form.distributionMall" placeholder="请输入配送商场"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="事业线" prop="businessLine">
<el-input v-model="form.businessLine" placeholder="请输入事业线"/>
</el-form-item>
</el-col>
</el-row>
<el-row >
<el-col :span="12">
<el-form-item label="基地仓" prop="depotBase">
<el-input v-model="form.depotBase" placeholder="请输入基地仓"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="收款码" prop="moneyReceivingCode">
<el-input v-model="form.moneyReceivingCode" placeholder="请输入收款码"/>
</el-form-item>
</el-col>
</el-row>
<el-row >
<el-col :span="12">
<el-form-item label="经度" prop="longitude">
<el-input v-model="form.longitude" placeholder="请输入经度"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="纬度" prop="latitude">
<el-input v-model="form.latitude" placeholder="请输入纬度"/>
</el-form-item>
</el-col>
</el-row>
<el-row >
<el-col :span="12">
<el-form-item label="仓库地址" prop="warehouseAddress">
<el-input v-model="form.warehouseAddress" placeholder="请输入仓库地址"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="管理费" prop="administrativeFee">
<el-input v-model="form.administrativeFee" placeholder="请输入管理费"/>
</el-form-item>
</el-col>
</el-row>
<el-row >
<el-col :span="12">
<el-form-item label="所属部门" prop="department">
<el-input v-model="form.department" placeholder="请输入所属部门"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="仓库类型:" prop="warehouseType">
<el-select v-model="form.warehouseType" placeholder="仓库类型" style="width: 100%;">
<el-option
v-for="item in warehouseType"
:key="item.dictKey"
:label="item.dictValue"
:value="item.dictKey">
</el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row >
<el-col :span="12">
<el-form-item label="是否有消防等级:" prop="fireRatingNot">
<el-select v-model="form.fireRatingNot" placeholder="是否有消防等级" style="width: 100%;">
<el-option
v-for="item in fireRatingNotData"
:key="item.dictKey"
:label="item.dictValue"
:value="item.dictKey">
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="消防等级" prop="fireGrade">
<el-input v-model="form.fireGrade" placeholder="请输入消防等级"/>
</el-form-item>
</el-col>
</el-row>
<el-row >
<el-col :span="12">
<el-form-item label="商家仓" prop="merchantFactory">
<el-input v-model="form.merchantFactory" placeholder="请输入商家仓"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="电力类型:" prop="powerCondition">
<el-select v-model="form.powerCondition" placeholder="电力类型" style="width: 100%;">
<el-option
v-for="item in powerCondition"
:key="item.dictKey"
:label="item.dictValue"
:value="item.dictKey">
</el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row >
<el-col :span="12">
<el-form-item label="仓库层高" prop="storeyHeight">
<el-input v-model="form.storeyHeight" placeholder="请输入仓库层高"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="是否高架:" prop="elevatedNot">
<el-select v-model="form.elevatedNot" placeholder="是否高架" style="width: 100%;">
<el-option
v-for="item in elevatedNotData"
:key="item.dictKey"
:label="item.dictValue"
:value="item.dictKey">
</el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row >
<el-col :span="12">
<el-form-item label="面积" prop="acreage">
<el-input v-model="form.acreage" placeholder="请输入面积"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="库位数" prop="seating">
<el-input v-model="form.seating" placeholder="请输入库位数"/>
</el-form-item>
</el-col>
</el-row>
<el-row >
<el-col :span="12">
<el-form-item label="仓库等级:" prop="grade">
<el-select v-model="form.grade" placeholder="仓库等级" style="width: 100%;">
<el-option
v-for="item in warehouseGrade"
:key="item.dictKey"
:label="item.dictValue"
:value="item.dictKey">
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="仓库结构:" prop="warehouseStructure">
<!-- <el-input v-model="form.warehouseStructure" placeholder="请输入仓库结构;1钢混,2钢架,3混凝土"/>-->
<el-select v-model="form.warehouseStructure" placeholder="仓库结构" style="width: 100%;">
<el-option
v-for="item in warehouseStructure"
:key="item.dictKey"
:label="item.dictValue"
:value="item.dictKey">
</el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row >
<el-col :span="12">
<el-form-item label="单价" prop="unitPrice">
<el-input v-model="form.unitPrice" placeholder="请输入单价"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="备注" prop="remarks">
<el-input v-model="form.remarks" placeholder="请输入备注"/>
</el-form-item>
</el-col>
</el-row>
</el-form>
<!-- 表单按钮 -->
<template #footer>
<span v-if="!view" class="dialog-footer">
<el-button type="primary" icon="el-icon-circle-check" @click="handleSubmit"> </el-button>
<el-button icon="el-icon-circle-close" @click="box = false"> </el-button>
</span>
</template>
</el-dialog>
</div>
</basic-container>
</template>
<script>
import { getList, getDetail, add, update, remove } from "@/api/basicdata/basicdataWarehouse";
import option from "@/option/basicdata/basicdataWarehouse1";
import { mapGetters } from "vuex";
import {getDictionaryBiz} from '@/api/system/dict';
export default {
data () {
return {
height: 0,
//
title: '',
//
box: false,
//
search: true,
//
loading: true,
//
view: false,
//
query: {},
//
page: {
currentPage: 1,
pageSize: 10,
total: 40
},
//
form: {},
//
selectionList: [],
//
option: option,
//
data: [],
//
fireRatingNotData: [],
//
merchantFactoryData: [],
//
elevatedNotData: [],
// ---
warehouseGrade:[],
// 1 - 2 - 3 -
warehouseStructure:[],
// 1 - 2 -
warehouseType:[],
// 1 - 2 -
powerCondition:[],
//
validatorRules:{
name: [
{ required: true, message: '请填写仓库名称!',trigger: 'blur'}
],
code:[
{required: true, message: '请填仓库代码!',trigger: 'blur'}
],
linkman:[
{required: true, message: '请填联系人!',trigger: 'blur'}
],
contactNumber:[
{required: true, message: '请填联系人号码!',trigger: 'blur'}
],
warehouseStructure:[
{required: true, message: '请选择仓库结构!',trigger: 'change'}
],
warehouseType:[
{required: true, message: '请选择仓库类型!',trigger: 'change'}
],
powerCondition:[
{required: true, message: '请选择电力类型!',trigger: 'change'}
],
warehouseGrade:[
{required: true, message: '请选择仓库等级!',trigger: 'change'}
],
warehouseAddress:[
{required: true, message: '请输入仓库地址!',trigger: 'blur'}
],
},
}
},
created() {
},
mounted () {
this.init();
this.onLoad(this.page);
},
computed: {
...mapGetters(["permission"]),
ids () {
let ids = [];
this.selectionList.forEach(ele => {
ids.push(ele.id);
});
return ids.join(",");
}
},
methods: {
init () {
this.height = this.setPx(document.body.clientHeight - 340);
getDictionaryBiz( 'yes_no').then(res => {
this.fireRatingNotData = res.data.data;
});
getDictionaryBiz('yes_no').then(res => {
this.merchantFactoryData = res.data.data;
});
getDictionaryBiz('yes_no').then(res => {
this.elevatedNotData = res.data.data;
console.log(this.elevatedNotData);
});
//
getDictionaryBiz('warehouse_grade').then(res => {
this.warehouseGrade = res.data.data;
});
//
getDictionaryBiz('warehouse_type').then(res => {
this.warehouseType = res.data.data;
});
//
getDictionaryBiz('power_condition').then(res => {
this.powerCondition = res.data.data;
});
//
getDictionaryBiz('warehouse_structure').then(res => {
this.warehouseStructure = res.data.data;
});
},
searchHide () {
this.search = !this.search;
},
searchChange () {
this.onLoad(this.page);
},
searchReset () {
this.query = {};
this.page.currentPage = 1;
this.onLoad(this.page);
},
handleSubmit () {
//
this.$refs.form.validate(valid=>{
if (valid) {
if (!this.form.id) {
add(this.form).then(() => {
this.box = false;
this.onLoad(this.page);
this.$message({
type: "success",
message: "操作成功!"
});
});
} else {
update(this.form).then(() => {
this.box = false;
this.onLoad(this.page);
this.$message({
type: "success",
message: "操作成功!"
});
});
}
}else {
console.log('error submit!!');
return false;
}
})
},
handleAdd () {
this.title = '新增'
this.form = {};
this.box = true;
this.$refs['form'].resetFields();
},
handleEdit (row) {
this.title = '编辑'
this.box = true
this.$refs['form'].resetFields();
getDetail(row.id).then(res => {
this.form = res.data.data;
this.form.fireRatingNot = this.form.fireRatingNot.toString();
this.form.merchantFactory = this.form.merchantFactory.toString();
this.form.elevatedNot = this.form.elevatedNot.toString();
});
},
handleView (row) {
this.title = '查看'
this.view = true;
this.box = true;
getDetail(row.id).then(res => {
this.form = res.data.data;
});
},
handleDelete () {
if (this.selectionList.length === 0) {
this.$message.warning("请选择至少一条数据");
return;
}
this.$confirm("确定将选择数据删除?", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
})
.then(() => {
return remove(this.ids);
})
.then(() => {
this.selectionClear();
this.onLoad(this.page);
this.$message({
type: "success",
message: "操作成功!"
});
});
},
rowDel (row) {
this.$confirm("确定将选择数据删除?", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
})
.then(() => {
return remove(row.id);
})
.then(() => {
this.onLoad(this.page);
this.$message({
type: "success",
message: "操作成功!"
});
});
},
beforeClose (done) {
done()
this.form = {};
this.view = false;
},
selectionChange (list) {
this.selectionList = list;
},
selectionClear () {
this.selectionList = [];
this.$refs.table.clearSelection();
},
currentChange (currentPage) {
this.page.currentPage = currentPage;
this.onLoad(this.page);
},
sizeChange (pageSize) {
this.page.pageSize = pageSize;
this.onLoad(this.page);
},
onLoad (page, params = {}) {
this.loading = true;
getList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => {
const data = res.data.data;
this.page.total = data.total;
this.data = data.records;
this.loading = false;
this.selectionClear();
});
}
}
};
</script>
Loading…
Cancel
Save