dengjunjie
2025-06-06 7e7f17c08a0f18d83eb379ddff1689597fecefde
´úÂë¹ÜÀí/WMS/WIDESEA_WMSClient/src/extension/inbound/inboundOrder.js
@@ -22,6 +22,32 @@
        //框架初始化配置后
        //如果要配置明细表,在此方法操作
        //this.detailOptions.columns.forEach(column=>{ });
      this.detailOptions.columns.forEach(x => {
        if (x.field == 'materielCode') {
          x.onChange = (val, option) => {
            // this.$error(val.materielCode)
            this.http.post("/api/MaterielInfo/GetMaterielInfo?materielCode=" + val.materielCode, {}, true).then(
              source => {
                if (!source.status) return this.$error(source.message);
                val.materielName = source.data.materielName;
                // this.$success(source.data.materielName);
                this.refresh();
              })
            // let locationCodes = this.getOption("locationCode");
            // locationCodes.bind.data.splice(0);
            // this.http.post("/api/LocationInfo/GetLocationCodes", { Extra: val.materielCode }, true).then(
            //   source => {
            //     if (!source.status) return this.$error(source.message);
            //     val.materielName = source.message;
            //     for (let i = 0; i < source.data.length; i++) {
            //       locationCodes.bind.data.push({ key: source.data[i], value: source.data[i] });
            //     }
            //     this.refresh();
            //   })
          }
        }
      });
      },
      searchBefore(param) {
        //界面查询前,可以给param.wheres添加查询参数
@@ -34,7 +60,22 @@
      },
      addBefore(formData) {
        //新建保存前formData为对象,包括明细表,可以给给表单设置值,自己输出看formData的值
        return true;
      let req = true;
      formData.detailData.forEach(x => {
        if (!x.hasOwnProperty('materielCode')) {
          req = false;
          return this.$error("物料编号不能为空")
        }
        if (!x.hasOwnProperty('batchNo')) {
          req = false;
          return this.$error("批次号不能为空")
        }
        if (!x.hasOwnProperty('orderQuantity')) {
          req = false;
          return this.$error("单据数量不能为空")
        }
      })
      return req;
      },
      updateBefore(formData) {
        //编辑保存前formData为对象,包括明细表、删除行的Id
@@ -51,8 +92,12 @@
        //(3)this.editFormFields.字段='xxx';
        //如果需要给下拉框设置默认值,请遍历this.editFormOptions找到字段配置对应data属性的key值
        //看不懂就把输出看:console.log(this.editFormOptions)
      // this.detailOptions.columns.forEach(x => {
      //   if (x.field == 'materielName') {
      //     x.readonly = true
      //   }
      // })
      }
    }
  };
  export default extension;