|
|
@@ -0,0 +1,210 @@
|
|
|
+<template>
|
|
|
+ <ele-modal :visible.sync="visible" append-to-body title="干燥区新增" width="75%" @close="cancel">
|
|
|
+
|
|
|
+
|
|
|
+ <div class="area">
|
|
|
+ <div class="mt20 reservoirArea">
|
|
|
+ <span>库区</span>
|
|
|
+ <el-button type="primary" icon="el-icon-plus" size="small" @click="addArea">添加库区
|
|
|
+ </el-button>
|
|
|
+ </div>
|
|
|
+ <div class="mt10">
|
|
|
+ <el-form :model="areaForm" ref="areaFormName" class="areaForm" :rules="areaRules">
|
|
|
+ <el-table ref="multipleTable" :data="areaForm.warehouseAreasSaveList" tooltip-effect="dark"
|
|
|
+ style="width: 100%" stripe :header-cell-style="{ background: '#EEEEEE', border: 'none' }">
|
|
|
+ <el-table-column label="干燥区名称" prop="name">
|
|
|
+ <template slot-scope="{ row, $index }">
|
|
|
+ <el-form-item :prop="'warehouseAreasSaveList.' + $index + '.name'" :rules="areaRules.name">
|
|
|
+ <el-input placeholder="请输入" clearable v-model="row.name"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+
|
|
|
+ <el-table-column label="干燥区编码" prop="code">
|
|
|
+ <template slot-scope="{ row, $index }">
|
|
|
+ <el-form-item :prop="'warehouseAreasSaveList.' + $index + '.code'" :rules="areaRules.code">
|
|
|
+ <el-input placeholder="请输入" clearable v-model="row.code"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+
|
|
|
+ <el-table-column label="长度(cm)" prop="length">
|
|
|
+ <template slot-scope="{ row, $index }">
|
|
|
+ <el-form-item :prop="'warehouseAreasSaveList.' + $index + '.length'"
|
|
|
+ :rules="areaRules.length">
|
|
|
+ <el-input placeholder="请输入" clearable v-model="row.length"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ <el-table-column label="宽度(cm)" prop="breadth">
|
|
|
+ <template slot-scope="{ row, $index }">
|
|
|
+ <el-form-item :prop="'warehouseAreasSaveList.' + $index + '.breadth'"
|
|
|
+ :rules="areaRules.breadth">
|
|
|
+ <el-input placeholder="请输入" clearable v-model="row.breadth"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+
|
|
|
+ <el-table-column label="位置" prop="region" min-width="120">
|
|
|
+ <template slot-scope="{ row, $index }">
|
|
|
+ <el-form-item :prop="'warehouseAreasSaveList.' + $index + '.region'"
|
|
|
+ :rules="areaRules.region">
|
|
|
+ <el-input placeholder="请输入" clearable v-model="row.region"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ <el-table-column label="车位数量">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-form-item :prop="'warehouseAreasSaveList.' + scope.$index + '.quantity'
|
|
|
+ " :rules="areaRules.quantity">
|
|
|
+ <el-input placeholder="请输入" type="number" @mousewheel.native.prevent @input="(value) =>
|
|
|
+ (scope.row.quantity = value.replace(
|
|
|
+ /^(0+)|[^\d]+/g,
|
|
|
+ ''
|
|
|
+ ))
|
|
|
+ " v-model.number="scope.row.quantity" clearable></el-input>
|
|
|
+ </el-form-item>
|
|
|
+
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+
|
|
|
+
|
|
|
+ <el-table-column label="操作" fixed="right" width="150">
|
|
|
+ <template slot-scope="{ row, $index }">
|
|
|
+ <el-button type="text" v-if="row.isEdit" @click="saveArea($index)">保存</el-button>
|
|
|
+ <el-button type="text" v-else @click="addShelf(row, $index)">添加货架</el-button>
|
|
|
+ <el-button type="text" @click="remove1($index, row)">删除库区</el-button>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+ </el-form>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ </ele-modal>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+
|
|
|
+export default {
|
|
|
+
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ visible: false,
|
|
|
+ areaForm: {
|
|
|
+ warehouseAreasSaveList: [], //库区
|
|
|
+ areaGoodsshelvesList: [], //货架
|
|
|
+
|
|
|
+ },
|
|
|
+
|
|
|
+ areaRules: {
|
|
|
+ code: { required: true, message: '请输入库区编号', trigger: 'blur' },
|
|
|
+ }
|
|
|
+ };
|
|
|
+ },
|
|
|
+ created() {
|
|
|
+
|
|
|
+ },
|
|
|
+
|
|
|
+ methods: {
|
|
|
+ open() {
|
|
|
+ this.visible = true;
|
|
|
+
|
|
|
+ },
|
|
|
+ cancel() {
|
|
|
+ this.visible = false;
|
|
|
+ },
|
|
|
+
|
|
|
+
|
|
|
+ addArea() {
|
|
|
+
|
|
|
+ this.areaForm.warehouseAreasSaveList.push({
|
|
|
+ code: '',
|
|
|
+ name: '',
|
|
|
+ isEdit: true
|
|
|
+
|
|
|
+ });
|
|
|
+ },
|
|
|
+
|
|
|
+ saveArea(index) {
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+};
|
|
|
+</script>
|
|
|
+
|
|
|
+<style lang="scss" scoped>
|
|
|
+.p20 {
|
|
|
+ padding: 20px;
|
|
|
+}
|
|
|
+
|
|
|
+.mt20 {
|
|
|
+ margin-top: 20px;
|
|
|
+}
|
|
|
+
|
|
|
+.mt10 {
|
|
|
+ margin-top: 10px;
|
|
|
+}
|
|
|
+
|
|
|
+::v-deep .el-select {
|
|
|
+ width: 100%;
|
|
|
+}
|
|
|
+
|
|
|
+.el-form-item {
|
|
|
+ margin-bottom: 22px;
|
|
|
+}
|
|
|
+
|
|
|
+.areaForm {
|
|
|
+ .el-form-item {
|
|
|
+ margin-bottom: 0;
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+.warehouseAdd {
|
|
|
+ .el-row {
|
|
|
+ display: block;
|
|
|
+ }
|
|
|
+
|
|
|
+ header {
|
|
|
+ display: flex;
|
|
|
+ justify-content: space-between;
|
|
|
+
|
|
|
+ .title {
|
|
|
+ font-size: 20px;
|
|
|
+ color: #333;
|
|
|
+ font-weight: bold;
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+.reservoirArea {
|
|
|
+ display: flex;
|
|
|
+ justify-content: space-between;
|
|
|
+
|
|
|
+ span {
|
|
|
+ font-size: 14px;
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+.center {
|
|
|
+ text-align: center;
|
|
|
+}
|
|
|
+
|
|
|
+.el-select {
|
|
|
+ display: block;
|
|
|
+}
|
|
|
+
|
|
|
+::v-deep input::-webkit-inner-spin-button {
|
|
|
+ -webkit-appearance: none;
|
|
|
+}</style>
|
|
|
+
|
|
|
+
|