cuilei
2025-06-03 f43aeaa3b3960e7b886023a41bd799fce7232ce5
工具管理-仓库、库位页面交互优化
已修改4个文件
40 ■■■■ 文件已修改
src/views/tms/WarehouseList.vue 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/tms/modules/GoodsShelvesForm.vue 25 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/tms/modules/WarehouseForm.vue 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/tms/modules/WarehouseModal.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/tms/WarehouseList.vue
@@ -267,6 +267,12 @@
      this.$bus.$off('getCurrSelected', this.handleGetCurrSelected);
    },
    methods: {
      handleAdd: function () {
        const nextSeq = Number(this.dataSource[this.dataSource.length - 1].seq) + 1
        this.$refs.modalForm.add(nextSeq);
        this.$refs.modalForm.title = "新增";
        this.$refs.modalForm.disableSubmit = false;
      },
      handleStatus(record) {
        getAction(this.url.list, { parentId: record.id }).then((res) => {
          if (res.success) {
src/views/tms/modules/GoodsShelvesForm.vue
@@ -40,7 +40,7 @@
          </a-col>
          <a-col :span="12">
            <a-form-model-item label="库位号" :labelCol="labelCol" :wrapperCol="wrapperCol">
              <a-input :disabled="true" :value="locationCode"  placeholder="请输入库位号"  ></a-input>
              <a-input v-model="model.locationCode"  placeholder="请输入库位号"  ></a-input>
            </a-form-model-item>
          </a-col>
        </a-row>
@@ -87,6 +87,8 @@
          locationCode: '',
          remark: ''
        },
        autoLocationCode: '', // 自动拼接的库位号
        userEditedLocationCode: false,
        labelCol: {
          xs: { span: 24 },
          sm: { span: 5 },
@@ -125,7 +127,7 @@
        return this.disabled
      },
      //拼接库位号
      locationCode() {
      autoGeneratedLocationCode() {
        const { shelfNumber, storey, arrange, columnNumber } = this.model;
        if (shelfNumber || storey || arrange || columnNumber) {
          return `${shelfNumber}${storey}${arrange}${columnNumber}`;
@@ -182,10 +184,21 @@
      },
    },
    watch: {
      'model.shelfNumber': 'updateLocationCode',
      'model.storey': 'updateLocationCode',
      'model.arrange': 'updateLocationCode',
      'model.columnNumber': 'updateLocationCode'
      autoGeneratedLocationCode(newVal) {
        // 只有当用户没有手动输入时才自动填充
        if (!this.userEditedLocationCode) {
          this.model.locationCode = newVal;
        }
        this.autoLocationCode = newVal;
      },
      'model.locationCode'(newVal) {
        // 如果用户手动输入,则标记为已编辑
        if (newVal !== this.autoLocationCode) {
          this.userEditedLocationCode = true;
        } else {
          this.userEditedLocationCode = false;
        }
      }
    }
  }
</script>
src/views/tms/modules/WarehouseForm.vue
@@ -25,7 +25,7 @@
          </a-col>
          <a-col :span="12">
            <a-form-model-item label="叶子节点标识" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="leafFlag">
              <a-radio-group :disabled="leafDisableFlag" v-model="model.leafFlag" placeholder="请选择是否叶子节点">
              <a-radio-group :default-value="'2'" :disabled="leafDisableFlag" v-model="model.leafFlag" placeholder="请选择是否叶子节点">
                <a-radio :value="'2'">有子节点</a-radio>
                <a-radio :value="'1'">是叶子节点</a-radio>
              </a-radio-group>
@@ -125,10 +125,11 @@
          console.error(e);
        }
      },
      add (treeSelected) {
      add (treeSelected, nextSeq) {
        this.modelDefault.parentId = treeSelected.key
        this.modelDefault.parentWarehouseId = treeSelected.entity.warehouseId
        this.modelDefault.parentWarehouseName = treeSelected.entity.warehouseName
        this.modelDefault.seq = nextSeq
        this.edit(this.modelDefault);
      },
      edit (record) {
src/views/tms/modules/WarehouseModal.vue
@@ -35,10 +35,10 @@
      }
    },
    methods: {
      add () {
      add (nextSeq) {
        this.visible=true
        this.$nextTick(()=>{
          this.$refs.realForm.add(this.treeSelected);
          this.$refs.realForm.add(this.treeSelected, nextSeq);
        })
      },
      edit (record) {