陈婷婷
2025-11-24 ff3e3dcb4b1a85bbf530c017fe3add8c0c2d5fa7
src/views/basic/gyStockPlace/gyStockPlace.vue
@@ -1,5 +1,5 @@
<template>
  <div style="padding: 10px">
  <div style="padding: 10px;position: relative">
    <el-form
      :model="queryParams"
      ref="queryForm"
@@ -488,7 +488,6 @@
      OperationType: null, //保存类型(新增1修改3)
      HInterID: null,
      baseURL: process.env.VUE_APP_BASE_API,
      user: "admin",
      currentRow: [],
      lastSelectedRowIndex: null, // 用于记录上次点击的行索引
      lastSelectedRow: null, // 上一次选中的行
@@ -709,37 +708,6 @@
      this.dbEmitData(this.deptform, this.dialogTypeNum);
      this.deptform = {};
    },
    fetchData() {
      //登录用户信息
      axios
        .get(
          "http://47.96.97.237/API/Web/GetUser?UserName=001&PassWord=123456&HOrgName=100038"
        )
        .then((response) => {
          let data = response.data.data[0];
          this.zuzhiId = data.HUSEORGID; //根据登录用户获取默认的组织ID
          this.queryParams.HOrgID = data.HUSEORGID;
          this.user = data.Czymc;
          axios
            .get(this.baseURL + "/Web/GetOrganizations", {})
            .then((response) => {
              if (response.data.count == 1) {
                this.organizationList = response.data.data; //组织列表
                this.queryParams.HOrgName = response.data.data.find(
                  (e) => e.ID == data.HUSEORGID
                )?.Name;
              }
              this.getList();
            })
            .catch((error) => {
              this.$modal.msgError("接口请求失败!");
            });
        })
        .catch((error) => {
          this.$modal.msgError("接口请求失败!");
        });
    },
    getList() {
      this.tableShow = false;
      this.loading = true;
@@ -753,7 +721,7 @@
        .get(this.baseURL + "/Gy_StockPlace/list2Page", {
          params: {
            sWhere: `${this.sWhere}`,
            user: this.user,
            user: sessionStorage["HUserName"],
            page: this.page,
            size: this.pageSize,
          },
@@ -842,7 +810,12 @@
              }
            }
            option.data = result;
            this.DisPlay_HideColumn(this.HModName, this.user, option, this.dataList);
            this.DisPlay_HideColumn(
              this.HModName,
              sessionStorage["HUserName"],
              option,
              this.dataList
            );
          }
        })
        .catch((error) => {
@@ -1000,6 +973,9 @@
      this.selectedRow = row; // 记录当前选中的行
      this.lastSelectedRowIndex = this.tableData.indexOf(row);
      this.$refs.tableData.toggleRowSelection(row);
      if (this.openPage) {
        this.$emit("deptEmit", row, 9);
      }
    },
    //选中行高亮样式
    rowStyle({ row, rowIndex }) {
@@ -1010,16 +986,32 @@
    //双击行
    handleDblclick(row, column, cell, event) {
      this.OperationType = 3;
      this.handleEdit();
      if (this.openPage) {
        this.$emit("deptEmitDb", row, 9);
      } else {
        this.handleEdit();
      }
    },
    // 多选框选中数据
    handleSelectionChange(selection) {
      // this.rowForm = {}
      this.ids = selection.map((item) => item.HItemID);
      this.single = selection.length != 1;
      this.multiple = !selection.length;
      if (!this.single) {
      if (this.openPage) {
        //列表单选
        if (selection.length > 1) {
          const del_row = selection.shift();
          this.$refs.tableData.toggleRowSelection(del_row, false); //设置这一行取消选中
        }
        this.rowForm = {};
        this.ids = selection.map((item) => item.HItemID);
        this.rowForm = selection[0];
      } else {
        //多选
        this.ids = selection.map((item) => item.HItemID);
        this.single = selection.length != 1;
        this.multiple = !selection.length;
        if (!this.single) {
          this.rowForm = selection[0];
        }
      }
    },
    //打开侧边搜索弹窗
@@ -1133,7 +1125,7 @@
        .get(this.baseURL + "/Xt_User/getOrgIDListByUser", {
          params: {
            HModName: this.HModName,
            user: this.user,
            user: sessionStorage["HUserName"],
            HOrgID: this.zuzhiId,
          },
        })
@@ -1216,7 +1208,10 @@
          if (!this.rowForm.审核人) {
            axios
              .get(this.baseURL + "Deltet_Gy_StockPlace", {
                params: { HItemID: this.rowForm.HItemID.toString(), user: this.user },
                params: {
                  HItemID: this.rowForm.HItemID.toString(),
                  user: sessionStorage["HUserName"],
                },
              })
              .then((response) => {
                if (response.data.count == 1) {
@@ -1286,7 +1281,7 @@
        }
      }
      var sSubStr = JSON.stringify(num);
      var sMainSub = sSubStr + "&和" + this.user;
      var sMainSub = sSubStr + "&和" + sessionStorage["HUserName"];
      axios({
        method: "post",
        url: this.baseURL + "/Gy_Warehouse/Gy_Process_Excel",