yanjinhui
2 天以前 8cdcf8cb6fecf101bd7dd1db2e44f0cf5ddc0fd4
н¨Îļþ¼Ð/WMS/src/extension/stock/Dt_Inventory_Batch.js
@@ -40,21 +40,41 @@
      }
      let TB = this.buttons.find(x => x.value == 'TB');
      if (TB) {
        TB.onClick = function () {
        TB.onClick = ()=> {
          let rows = this.$refs.table.getSelected();
          if (rows.length == 0) return this.$error("请选择数据!");
          if (rows.length > 1) return this.$error("请选择一条数据!");
          // if (rows.length > 1) return this.$error("请选择一条数据!");
          // èŽ·å–é€‰ä¸­è¡Œçš„æ•°æ®ï¼ˆrows是数组,取第一个元素)
          const selectedRow = rows[0];
          const materielCode = selectedRow.materielCode;
          const batchNo = selectedRow.batchNo;
          const selectedRow = rows.map(item => item.id);
          // const selectedRow = rows.id[0]
          // const materielCode = selectedRow.materielCode;
          // const batchNo = selectedRow.batchNo;
          this.http
            .post(`api/Inventory/GetInventoryList?goods_no=${materielCode}&batch_num=${batchNo}`)
            .post(`api/Inventory/GetInventoryList`,selectedRow)
            .then((x) => {
              if (x.status) {
                this.$Message.success('同步完成');
                this.refresh();
              } else {
                return this.$error(x.message);
              }
            });
        }
      }
      let YW = this.buttons.find(x => x.value == 'YW');  //在Buttons.js中定义的按钮
      if (YW) {
        YW.onClick = function () {
          let rows = this.$refs.table.getSelected();
          if (rows.length == 0) return this.$error("请选择数据!");
          // if (rows.length > 1) return this.$error("请选择一条数据!");
          const allIds = rows.map(item => item.id);
          this.http
            .post("api/Inventory_Batch/TransferInventory", allIds)
            .then((x) => {
              if (x.status) {
                this.$Message.success('移位单创建成功');
                this.refresh();
              } else {
                return this.$error(x.message);
@@ -80,6 +100,7 @@
        }
      })
    },
    searchBefore(param) {
      //界面查询前,可以给param.wheres添加查询参数
      //返回false,则不会执行查询
@@ -111,7 +132,7 @@
      // this.editFormFields.availableQuantity = 1;
      this.editFormOptions.forEach((editForm) => {
        editForm.forEach((x) => {
          if (x.field == "availableQuantity") {
          if (x.field == "availableQuantity") {//除了该字段可以编辑其他的都设置为可读
          } else {
            x.readonly = true