src/views/tms/modules/GoodsShelvesForm.vue
@@ -38,6 +38,11 @@
              <a-input v-model="model.columnNumber" placeholder="请输入列数"  ></a-input>
            </a-form-model-item>
          </a-col>
           <a-col :span="12">
            <a-form-model-item label="格数" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="cellsNum">
              <a-input v-model="model.cellsNum" placeholder="请输入格数"  ></a-input>
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
            <a-form-model-item label="库位号" :labelCol="labelCol" :wrapperCol="wrapperCol">
              <a-input v-model="model.locationCode"  placeholder="请输入库位号"  ></a-input>
@@ -84,6 +89,7 @@
          storey: '',
          arrange: '',
          columnNumber: '',
          cellsNum:'',
          locationCode: '',
          remark: ''
        },
@@ -110,6 +116,7 @@
           ],
          shelfNumber: [
              { required: true, message: '请输入货架号!'},
              { validator: this.validateShelfNumber },
          ],
          shelfName: [
              { required: true, message: '请输入货架名称!'},
@@ -118,8 +125,10 @@
        url: {
          add: "/tms/goodsShelves/add",
          edit: "/tms/goodsShelves/edit",
          queryById: "/tms/goodsShelves/queryById"
        }
          queryById: "/tms/goodsShelves/queryById",
          checkShelfNum:"/tms/goodsShelves/checkShelfNum"
        },
        warehouseId:''
      }
    },
    computed: {
@@ -128,9 +137,9 @@
      },
      //拼接库位号
      autoGeneratedLocationCode() {
        const { shelfNumber, storey, arrange, columnNumber } = this.model;
        if (shelfNumber || storey || arrange || columnNumber) {
          return `${shelfNumber}${storey}${arrange}${columnNumber}`;
        const { shelfNumber, storey, arrange, columnNumber, cellsNum } = this.model;
        if (shelfNumber || storey || arrange || columnNumber || cellsNum) {
          return `${shelfNumber}${storey}${arrange}${columnNumber}${cellsNum}`;
        }
        return '';
      }
@@ -152,6 +161,7 @@
      edit (record) {
        this.model = Object.assign({}, record);
        this.visible = true;
        this.warehouseId = record.warehouseId
      },
      submitForm () {
        const that = this;
@@ -182,6 +192,20 @@
        })
      },
      //验证 货架号
    validateShelfNumber(rule, value, callback) {
      var params = {
        warehouseId: this.warehouseId,
        shelfNumber: value,
      };
      getAction(this.url.checkShelfNum,params).then((res) => {
        if (res.success) {
          callback();
        } else {
          callback("货架编号已存在!");
        }
      })
    },
    },
    watch: {
      autoGeneratedLocationCode(newVal) {