wangyi
2026-02-28 fd9d75b6d9c8ce5b36afd46c2751164259af24ee
增加了容器及时库存
6个文件已修改
566 ■■■■■ 已修改文件
src/views/scMould/warehouse/Sc_MouldInRequestBillEdit.vue 90 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/scMould/warehouse/Sc_MouldMoveStockRequestBillEdit.vue 92 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/scMould/warehouse/Sc_MouldOutRequestBillEdit.vue 107 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/scMould/warehouse/Sc_MouldProdBackBillEdit.vue 91 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/scMould/warehouse/Sc_MouldProdMoveBillEdit.vue 91 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/scMould/warehouse/Sc_MouldProdOutBillEdit.vue 95 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/scMould/warehouse/Sc_MouldInRequestBillEdit.vue
@@ -185,6 +185,7 @@
            <el-button type="success" plain icon="el-icon-arrow-down" @click="handleMoveRowDown(zbSelForm)"
              size="mini">下移</el-button>
            <el-button type="success" plain icon="el-icon-printer" @click="get_ICInventoryMould(zbSelForm)">容器库存</el-button>
            <el-button type="success" plain icon="el-icon-printer" @click="get_ContainerInstantStock(zbSelForm)">容器即时库存</el-button>
          </div>
          <el-table :data="editData" style="width: 100%" height="300" width="100%" ref="zbTable"
            @selection-change="handleTableZbEdit" :row-class-name="rowSysZbIndex" show-summary border>
@@ -214,6 +215,11 @@
            <el-table-column align="center" label="计量单位名称" width="120">
              <template slot-scope="scope">
                <span>{{ scope.row.HUnitName }}</span>
              </template>
            </el-table-column>
               <el-table-column align="center" label="库存数量" width="120">
            <template slot-scope="scope">
                {{ scope.row.KuHQty || 0 }}
              </template>
            </el-table-column>
            <el-table-column align="center" label="数量" width="120">
@@ -646,6 +652,90 @@
        this.formLoading = false
      })
    },
    //#region 查看容器即时库存
  async get_ContainerInstantStock(zbSelForm) {
    if (!this.zbIndex) {
      this.$modal.msgError("请选择一行数据");
      return;
    }
    var index = zbSelForm.index - 1;
    const rowData = this.editData[index];
    if (rowData.HMaterID==0) {
      this.$modal.msgError("请先选择容器");
      return;
    }
    const whId = rowData.HWHID || this.form.HWHID;
    if (!whId || whId == 0) {
      this.$modal.msgError("请先选择有效的仓库");
      return;
    }
    try {
      this.$modal.loading("正在查询库存...");
      // 获取仓库名称
      const whResponse = await axios.get(this.$baseUrl + "/CommonModel/searchMethod", {
        params: {
          "sql": `select HName from Gy_Warehouse where HItemID = ${whId}`,
          "user": sessionStorage["HUserName"],
          "ModRightNameCheck": ""
        }
      });
      const whName = whResponse.data.data[0]?.HName;
      if (!whName) {
        this.$modal.closeLoading();
        this.$modal.msgError("未找到仓库信息");
        return;
      }
      // 获取所有库存数据
      var sql = "exec h_p_Kf_ICInventory_Mould ''";
      const response = await axios.get(this.$baseUrl + "/CommonModel/searchMethod", {
        params: {
          "sql": sql,
          "user": sessionStorage["HUserName"],
          "ModRightNameCheck": ""
        }
      });
      let totalQty = 0;
      if (response.data.count == 1 && response.data.data) {
        // 基础过滤:容器ID + 仓库名称
        let filteredData = response.data.data.filter(item =>
          item['HMaterID'] == rowData.HMaterID && item['仓库'] === whName
        );
        // 如果有库位,按库位过滤
        if (rowData.HSPName) {
          filteredData = filteredData.filter(item => item['仓位'] === rowData.HSPName);
        }
        // 计算总库存
        filteredData.forEach(item => {
          totalQty += Number(item['库存数量'] || 0);
        });
      }
      // 更新当前行的库存数量
      this.$set(this.editData, index, {
        ...rowData,
        KuHQty: totalQty
      });
      this.$modal.closeLoading();
      this.$modal.msgSuccess(`库存查询成功,当前库存:${totalQty}`);
    } catch (error) {
      this.$modal.closeLoading();
      this.$modal.msgError("查询库存失败");
    }
  },
  //#endregion
    getHBillNo() {
      axios.get(this.$baseUrl + "/WEBSController/GetMaxBillNo_Json", {
        params: {
src/views/scMould/warehouse/Sc_MouldMoveStockRequestBillEdit.vue
@@ -202,6 +202,8 @@
            <el-button type="success" plain icon="el-icon-arrow-down" @click="handleMoveRowDown(zbSelForm)"
              size="mini">下移</el-button>
            <el-button type="success" plain icon="el-icon-printer" @click="get_ICInventoryMould(zbSelForm)">容器库存</el-button>
            <el-button type="success" plain icon="el-icon-printer" @click="get_ContainerInstantStock(zbSelForm)">容器即时库存</el-button>
          </div>
          <el-table :data="editData" style="width: 100%" height="300" width="100%" ref="zbTable"
            @selection-change="handleTableZbEdit" :row-class-name="rowSysZbIndex" show-summary border>
@@ -231,6 +233,11 @@
            <el-table-column align="center" label="计量单位" width="120">
              <template slot-scope="scope">
                <span>{{ scope.row.HUnitName }}</span>
              </template>
            </el-table-column>
              <el-table-column align="center" label="库存数量" width="120">
            <template slot-scope="scope">
                {{ scope.row.KuHQty || 0 }}
              </template>
            </el-table-column>
            <el-table-column align="center" label="数量" width="120">
@@ -732,6 +739,91 @@
      });
    },
    /** 修改按钮操作 */
      //#region 查看容器即时库存
  async get_ContainerInstantStock(zbSelForm) {
    if (!this.zbIndex) {
      this.$modal.msgError("请选择一行数据");
      return;
    }
    var index = zbSelForm.index - 1;
    const rowData = this.editData[index];
    if (rowData.HMaterID==0) {
      this.$modal.msgError("请先选择容器");
      return;
    }
    const whId = rowData.HWHID || this.form.HWHID;
    if (!whId || whId == 0) {
      this.$modal.msgError("请先选择有效的仓库");
      return;
    }
    try {
      this.$modal.loading("正在查询库存...");
      // 获取仓库名称
      const whResponse = await axios.get(this.$baseUrl + "/CommonModel/searchMethod", {
        params: {
          "sql": `select HName from Gy_Warehouse where HItemID = ${whId}`,
          "user": sessionStorage["HUserName"],
          "ModRightNameCheck": ""
        }
      });
      const whName = whResponse.data.data[0]?.HName;
      if (!whName) {
        this.$modal.closeLoading();
        this.$modal.msgError("未找到仓库信息");
        return;
      }
      // 获取所有库存数据
      var sql = "exec h_p_Kf_ICInventory_Mould ''";
      const response = await axios.get(this.$baseUrl + "/CommonModel/searchMethod", {
        params: {
          "sql": sql,
          "user": sessionStorage["HUserName"],
          "ModRightNameCheck": ""
        }
      });
      let totalQty = 0;
      if (response.data.count == 1 && response.data.data) {
        // 基础过滤:容器ID + 仓库名称
        let filteredData = response.data.data.filter(item =>
          item['HMaterID'] == rowData.HMaterID && item['仓库'] === whName
        );
        // 如果有库位,按库位过滤
        if (rowData.HSPName) {
          filteredData = filteredData.filter(item => item['仓位'] === rowData.HSPName);
        }
        // 计算总库存
        filteredData.forEach(item => {
          totalQty += Number(item['库存数量'] || 0);
        });
      }
      // 更新当前行的库存数量
      this.$set(this.editData, index, {
        ...rowData,
        KuHQty: totalQty
      });
      this.$modal.closeLoading();
      this.$modal.msgSuccess(`库存查询成功,当前库存:${totalQty}`);
    } catch (error) {
      this.$modal.closeLoading();
      this.$modal.msgError("查询库存失败");
    }
  },
  //#endregion
    handleUpdate() {
      this.reset()
      let rowHmainid = this.linterid
src/views/scMould/warehouse/Sc_MouldOutRequestBillEdit.vue
@@ -202,6 +202,8 @@
            <el-button type="success" plain icon="el-icon-arrow-down" @click="handleMoveRowDown(zbSelForm)"
              size="mini">下移</el-button>
            <el-button type="success" plain icon="el-icon-printer" @click="get_ICInventoryMould(zbSelForm)">容器库存</el-button>
            <el-button type="success" plain icon="el-icon-printer" @click="get_ContainerInstantStock(zbSelForm)">容器即时库存</el-button>
          </div>
          <el-table :data="editData" style="width: 100%" height="300" width="100%" ref="zbTable"
            @selection-change="handleTableZbEdit" :row-class-name="rowSysZbIndex" show-summary border>
@@ -231,6 +233,11 @@
            <el-table-column align="center" label="计量单位名称" width="120">
              <template slot-scope="scope">
                <span>{{ scope.row.HUnitName }}</span>
              </template>
            </el-table-column>
               <el-table-column align="center" label="库存数量" width="120">
            <template slot-scope="scope">
                {{ scope.row.KuHQty || 0 }}
              </template>
            </el-table-column>
            <el-table-column align="center" label="数量" width="120">
@@ -710,6 +717,91 @@
        this.$emit('editClose', false)
      }
    },
        //#region 查看容器即时库存
    async get_ContainerInstantStock(zbSelForm) {
      if (!this.zbIndex) {
        this.$modal.msgError("请选择一行数据");
        return;
      }
      var index = zbSelForm.index - 1;
      const rowData = this.editData[index];
      if (rowData.HMaterID==0) {
        this.$modal.msgError("请先选择容器");
        return;
      }
      const whId = rowData.HWHID || this.form.HWHID;
      if (!whId || whId == 0) {
        this.$modal.msgError("请先选择有效的仓库");
        return;
      }
      try {
        this.$modal.loading("正在查询库存...");
        // 获取仓库名称
        const whResponse = await axios.get(this.$baseUrl + "/CommonModel/searchMethod", {
          params: {
            "sql": `select HName from Gy_Warehouse where HItemID = ${whId}`,
            "user": sessionStorage["HUserName"],
            "ModRightNameCheck": ""
          }
        });
        const whName = whResponse.data.data[0]?.HName;
        if (!whName) {
          this.$modal.closeLoading();
          this.$modal.msgError("未找到仓库信息");
          return;
        }
        // 获取所有库存数据
        var sql = "exec h_p_Kf_ICInventory_Mould ''";
        const response = await axios.get(this.$baseUrl + "/CommonModel/searchMethod", {
          params: {
            "sql": sql,
            "user": sessionStorage["HUserName"],
            "ModRightNameCheck": ""
          }
        });
        let totalQty = 0;
        if (response.data.count == 1 && response.data.data) {
          // 基础过滤:容器ID + 仓库名称
          let filteredData = response.data.data.filter(item =>
            item['HMaterID'] == rowData.HMaterID && item['仓库'] === whName
          );
          // 如果有库位,按库位过滤
          if (rowData.HSPName) {
            filteredData = filteredData.filter(item => item['仓位'] === rowData.HSPName);
          }
          // 计算总库存
          filteredData.forEach(item => {
            totalQty += Number(item['库存数量'] || 0);
          });
        }
        // 更新当前行的库存数量
        this.$set(this.editData, index, {
          ...rowData,
          KuHQty: totalQty
        });
        this.$modal.closeLoading();
        this.$modal.msgSuccess(`库存查询成功,当前库存:${totalQty}`);
      } catch (error) {
        this.$modal.closeLoading();
        this.$modal.msgError("查询库存失败");
      }
    },
    //#endregion
    //根据用户获取对应职员、部门、销售主管
    getCzyglByUser() {
      axios.get(this.$baseUrl + '/Xs_SeOrderBill/getCzyglByUser', {
@@ -937,6 +1029,8 @@
        this.editData.push(copyRow);
      }
    },
    handleMoveRowUp(zbSelForm) {
      if (!this.zbIndex) {
        this.$modal.msgError("请选择一行数据")
@@ -988,19 +1082,6 @@
      }
    },
    
    //#region 查看容器库存
    get_ICInventoryMould(zbSelForm) {
      if (!this.zbIndex) {
        this.$modal.msgError("请选择一行数据")
      } else {
        var index = zbSelForm.index-1;
        this.ICInventoryMouldShow = true
        this.$nextTick(() => {
          this.$refs.ICInventoryMould.open(this.editData[index]);
        })
      }
    },
    //#endregion
    
    // 编辑提交保存
    submitForm() {
src/views/scMould/warehouse/Sc_MouldProdBackBillEdit.vue
@@ -207,6 +207,7 @@
            <el-button type="success" plain icon="el-icon-arrow-down" @click="handleMoveRowDown(zbSelForm)"
              size="mini">下移</el-button>
            <el-button type="success" plain icon="el-icon-printer" @click="get_ICInventoryMould(zbSelForm)">容器库存</el-button>
             <el-button type="success" plain icon="el-icon-printer" @click="get_ContainerInstantStock(zbSelForm)">容器即时库存</el-button>
          </div>
          <el-table :data="editData" style="width: 100%" height="300" width="100%" ref="zbTable"
            @selection-change="handleTableZbEdit" :row-class-name="rowSysZbIndex" show-summary border>
@@ -236,6 +237,11 @@
            <el-table-column align="center" label="计量单位" width="120">
              <template slot-scope="scope">
                <span>{{ scope.row.HUnitName }}</span>
              </template>
            </el-table-column>
            <el-table-column align="center" label="库存数量" width="120">
            <template slot-scope="scope">
                {{ scope.row.KuHQty || 0 }}
              </template>
            </el-table-column>
            <el-table-column align="center" label="应收数量" width="120">
@@ -882,6 +888,91 @@
        this.formLoading = false
      })
    },
      //#region 查看容器即时库存
  async get_ContainerInstantStock(zbSelForm) {
    if (!this.zbIndex) {
      this.$modal.msgError("请选择一行数据");
      return;
    }
    var index = zbSelForm.index - 1;
    const rowData = this.editData[index];
    if (rowData.HMaterID==0) {
      this.$modal.msgError("请先选择容器");
      return;
    }
    const whId = rowData.HWHID || this.form.HWHID;
    if (!whId || whId == 0) {
      this.$modal.msgError("请先选择有效的仓库");
      return;
    }
    try {
      this.$modal.loading("正在查询库存...");
      // 获取仓库名称
      const whResponse = await axios.get(this.$baseUrl + "/CommonModel/searchMethod", {
        params: {
          "sql": `select HName from Gy_Warehouse where HItemID = ${whId}`,
          "user": sessionStorage["HUserName"],
          "ModRightNameCheck": ""
        }
      });
      const whName = whResponse.data.data[0]?.HName;
      if (!whName) {
        this.$modal.closeLoading();
        this.$modal.msgError("未找到仓库信息");
        return;
      }
      // 获取所有库存数据
      var sql = "exec h_p_Kf_ICInventory_Mould ''";
      const response = await axios.get(this.$baseUrl + "/CommonModel/searchMethod", {
        params: {
          "sql": sql,
          "user": sessionStorage["HUserName"],
          "ModRightNameCheck": ""
        }
      });
      let totalQty = 0;
      if (response.data.count == 1 && response.data.data) {
        // 基础过滤:容器ID + 仓库名称
        let filteredData = response.data.data.filter(item =>
          item['HMaterID'] == rowData.HMaterID && item['仓库'] === whName
        );
        // 如果有库位,按库位过滤
        if (rowData.HSPName) {
          filteredData = filteredData.filter(item => item['仓位'] === rowData.HSPName);
        }
        // 计算总库存
        filteredData.forEach(item => {
          totalQty += Number(item['库存数量'] || 0);
        });
      }
      // 更新当前行的库存数量
      this.$set(this.editData, index, {
        ...rowData,
        KuHQty: totalQty
      });
      this.$modal.closeLoading();
      this.$modal.msgSuccess(`库存查询成功,当前库存:${totalQty}`);
    } catch (error) {
      this.$modal.closeLoading();
      this.$modal.msgError("查询库存失败");
    }
  },
  //#endregion
    getHBillNo() {
      axios.get(this.$baseUrl + "/WEBSController/GetMaxBillNo_Json", {
        params: {
src/views/scMould/warehouse/Sc_MouldProdMoveBillEdit.vue
@@ -224,6 +224,7 @@
            <el-button type="success" plain icon="el-icon-arrow-down" @click="handleMoveRowDown(zbSelForm)"
              size="mini">下移</el-button>
            <el-button type="success" plain icon="el-icon-printer" @click="get_ICInventoryMould(zbSelForm)">容器库存</el-button>
              <el-button type="success" plain icon="el-icon-printer" @click="get_ContainerInstantStock(zbSelForm)">容器即时库存</el-button>
          </div>
          <el-table :data="editData" style="width: 100%" height="300" width="100%" ref="zbTable"
            @selection-change="handleTableZbEdit" :row-class-name="rowSysZbIndex" show-summary border>
@@ -253,6 +254,11 @@
            <el-table-column align="center" label="计量单位" width="120">
              <template slot-scope="scope">
                <span>{{ scope.row.HUnitName }}</span>
              </template>
            </el-table-column>
             <el-table-column align="center" label="库存数量" width="120">
            <template slot-scope="scope">
                {{ scope.row.KuHQty }}
              </template>
            </el-table-column>
            <el-table-column align="center" label="应发数量" width="120">
@@ -721,6 +727,91 @@
      this.editData = rowdata
    },
    //弹窗赋值
        //#region 查看容器即时库存
  async get_ContainerInstantStock(zbSelForm) {
    if (!this.zbIndex) {
      this.$modal.msgError("请选择一行数据");
      return;
    }
    var index = zbSelForm.index - 1;
    const rowData = this.editData[index];
    if (rowData.HMaterID==0) {
      this.$modal.msgError("请先选择容器");
      return;
    }
    const whId = rowData.HWHID || this.form.HWHID;
    if (!whId || whId == 0) {
      this.$modal.msgError("请先选择有效的仓库");
      return;
    }
    try {
      this.$modal.loading("正在查询库存...");
      // 获取仓库名称
      const whResponse = await axios.get(this.$baseUrl + "/CommonModel/searchMethod", {
        params: {
          "sql": `select HName from Gy_Warehouse where HItemID = ${whId}`,
          "user": sessionStorage["HUserName"],
          "ModRightNameCheck": ""
        }
      });
      const whName = whResponse.data.data[0]?.HName;
      if (!whName) {
        this.$modal.closeLoading();
        this.$modal.msgError("未找到仓库信息");
        return;
      }
      // 获取所有库存数据
      var sql = "exec h_p_Kf_ICInventory_Mould ''";
      const response = await axios.get(this.$baseUrl + "/CommonModel/searchMethod", {
        params: {
          "sql": sql,
          "user": sessionStorage["HUserName"],
          "ModRightNameCheck": ""
        }
      });
      let totalQty = 0;
      if (response.data.count == 1 && response.data.data) {
        // 基础过滤:容器ID + 仓库名称
        let filteredData = response.data.data.filter(item =>
          item['HMaterID'] == rowData.HMaterID && item['仓库'] === whName
        );
        // 如果有库位,按库位过滤
        if (rowData.HSPName) {
          filteredData = filteredData.filter(item => item['仓位'] === rowData.HSPName);
        }
        // 计算总库存
        filteredData.forEach(item => {
          totalQty += Number(item['库存数量'] || 0);
        });
      }
      // 更新当前行的库存数量
      this.$set(this.editData, index, {
        ...rowData,
        KuHQty: totalQty
      });
      this.$modal.closeLoading();
      this.$modal.msgSuccess(`库存查询成功,当前库存:${totalQty}`);
    } catch (error) {
      this.$modal.closeLoading();
      this.$modal.msgError("查询库存失败");
    }
  },
  //#endregion
    dbEmitData(deptRow, num) {
      // num=1部门 num=2仓库
      console.log(33,deptRow)
src/views/scMould/warehouse/Sc_MouldProdOutBillEdit.vue
@@ -207,6 +207,9 @@
            <el-button type="success" plain icon="el-icon-arrow-down" @click="handleMoveRowDown(zbSelForm)"
              size="mini">下移</el-button>
            <el-button type="success" plain icon="el-icon-printer" @click="get_ICInventoryMould(zbSelForm)">容器库存</el-button>
            <el-button type="success" plain icon="el-icon-printer" @click="get_ContainerInstantStock(zbSelForm)">容器即时库存</el-button>
          </div>
          <el-table :data="editData" style="width: 100%" height="300" width="100%" ref="zbTable"
            @selection-change="handleTableZbEdit" :row-class-name="rowSysZbIndex" show-summary border>
@@ -236,6 +239,13 @@
            <el-table-column align="center" label="计量单位" width="120">
              <template slot-scope="scope">
                <span>{{ scope.row.HUnitName }}</span>
              </template>
            </el-table-column>
         <el-table-column align="center" label="库存数量" width="120">
            <template slot-scope="scope">
                {{ scope.row.KuHQty || 0 }}
              </template>
            </el-table-column>
            <el-table-column align="center" label="应发数量" width="120">
@@ -1152,7 +1162,90 @@
    },
    //#endregion
    
    // 编辑提交保存
    //#region 查看容器即时库存
  async get_ContainerInstantStock(zbSelForm) {
    if (!this.zbIndex) {
      this.$modal.msgError("请选择一行数据");
      return;
    }
    var index = zbSelForm.index - 1;
    const rowData = this.editData[index];
    if (rowData.HMaterID==0) {
      this.$modal.msgError("请先选择容器");
      return;
    }
    const whId = rowData.HWHID || this.form.HWHID;
    if (!whId || whId == 0) {
      this.$modal.msgError("请先选择有效的仓库");
      return;
    }
    try {
      this.$modal.loading("正在查询库存...");
      // 获取仓库名称
      const whResponse = await axios.get(this.$baseUrl + "/CommonModel/searchMethod", {
        params: {
          "sql": `select HName from Gy_Warehouse where HItemID = ${whId}`,
          "user": sessionStorage["HUserName"],
          "ModRightNameCheck": ""
        }
      });
      const whName = whResponse.data.data[0]?.HName;
      if (!whName) {
        this.$modal.closeLoading();
        this.$modal.msgError("未找到仓库信息");
        return;
      }
      // 获取所有库存数据
      var sql = "exec h_p_Kf_ICInventory_Mould ''";
      const response = await axios.get(this.$baseUrl + "/CommonModel/searchMethod", {
        params: {
          "sql": sql,
          "user": sessionStorage["HUserName"],
          "ModRightNameCheck": ""
        }
      });
      let totalQty = 0;
      if (response.data.count == 1 && response.data.data) {
        // 基础过滤:容器ID + 仓库名称
        let filteredData = response.data.data.filter(item =>
          item['HMaterID'] == rowData.HMaterID && item['仓库'] === whName
        );
        // 如果有库位,按库位过滤
        if (rowData.HSPName) {
          filteredData = filteredData.filter(item => item['仓位'] === rowData.HSPName);
        }
        // 计算总库存
        filteredData.forEach(item => {
          totalQty += Number(item['库存数量'] || 0);
        });
      }
      // 更新当前行的库存数量
      this.$set(this.editData, index, {
        ...rowData,
        KuHQty: totalQty
      });
      this.$modal.closeLoading();
      this.$modal.msgSuccess(`库存查询成功,当前库存:${totalQty}`);
    } catch (error) {
      this.$modal.closeLoading();
      this.$modal.msgError("查询库存失败");
    }
  },
  //#endregion
    submitForm() {
      this.$refs["form"].validate(valid => {
        if (valid) {