wangyi
2025-11-27 86d627eecb14597a338ee402eab5a0c05ce1bdeb
src/views/basic/gyEmployee/gyEmployee.vue
@@ -1,5 +1,5 @@
<template>
  <div style="padding: 10px">
  <div style="padding: 10px; position: relative">
    <el-form
      :model="queryParams"
      ref="queryForm"
@@ -32,7 +32,7 @@
          >
            <el-option
              v-for="(item, index) in organizationList"
              :key="item.ID"
              :key="index"
              :label="item.Name"
              :value="item.ID.toString()"
            >
@@ -299,12 +299,12 @@
          >隐藏列设置</el-button
        >
      </el-col>
      <el-col :span="1.5">
      <el-col :span="1.5" class="zy-hidden">
        <el-button type="primary" icon="el-icon-help" size="mini" @click="handleSearch"
          >搜 索</el-button
        >
      </el-col>
      <el-col :span="1.5">
      <el-col :span="1.5" class="zy-hidden">
        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
          >重 置</el-button
        >
@@ -354,8 +354,8 @@
                <el-button
                  type="text"
                  @click="handleEdit(row, (OperationType = 3))"
                  v-else-if="column.property == '单据号'"
                  >{{ row.单据号 }}</el-button
                  v-else-if="column.property == '职员代码'"
                  >{{ row.职员代码 }}</el-button
                >
                <span v-else>{{ row[column.label] }}</span>
              </div>
@@ -499,10 +499,9 @@
import RowSettings from "@/views/component/rowSettings";
import Edit from "@/views/basic/gyEmployee/gyEmployeeEdit";
import gySource from "@/views/basic/gySource";
import { env } from "echarts";
export default {
  name: "GySource",
  name: "GyEmployee",
  components: { RowSettings, Edit, gySource },
  props: {
    openPage: { type: String },
@@ -510,7 +509,7 @@
  data() {
    return {
      activeSeach: "",
      HModName: "Gy_Source",
      HModName: "Gy_EmployeeList",
      editShow: false,
      openEdit: false,
      totalNameList: [],
@@ -518,7 +517,7 @@
      openPrintList: false,
      printListShow: false,
      HClassTag: "ForFilteringSchemes", //过滤条件的class类
      HBillType: "1205",
      HBillType: "Gy_EmployeeList",
      openBtnHide: false,
      btnHideShow: false,
      rowHideShow: false,
@@ -563,11 +562,11 @@
      openData: false, //数据弹窗
      dialogTitle: "",
      zuzhiId: "",
      organizationList: JSON.parse(sessionStorage.getItem("organizationList")), //组织列表
      organizationList: JSON.parse(sessionStorage["organizationList"]), //组织列表
      subDisabled: false, //编辑页面保存按钮是否禁用(true禁用,false可用)
      OperationType: null, //保存类型(新增1修改3)
      HInterID: null,
      baseURL: process.env.VUE_APP_BASE_API || "http://47.96.97.237/API/",
      baseURL: process.env.VUE_APP_BASE_API,
      user: "admin",
      currentRow: [],
      lastSelectedRowIndex: null, // 用于记录上次点击的行索引
@@ -650,6 +649,7 @@
    };
  },
  created() {
    // this.fetchData();
    this.handleQuery();
    this.riqiChange();
  },
@@ -778,18 +778,21 @@
      }
      // this.queryParams.HOrgID = 100038
      this.sWhere += " and HUSEORGID = '" + this.queryParams.HOrgID + "'";
      let OrgName =
        this.organizationList.find((e) => e.ID == this.queryParams.HOrgID)?.Name || "";
      //生产资料列表
      axios
        .get(this.baseURL + "/Gy_Employee/listPage", {
          params: {
            sWhere: this.sWhere,
            user: this.user,
            Organization: "浙江智云迈思",
            user: sessionStorage["HUserName"],
            Organization: OrgName,
            page: this.page,
            size: this.pageSize,
          },
        })
        .then((response) => {
          console.log(response.data.data);
          this.tyResList = response.data.data; //总数据
          let data1 = response.data;
          let option = [];
@@ -873,7 +876,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) => {
@@ -1031,6 +1039,9 @@
      this.selectedRow = row; // 记录当前选中的行
      this.lastSelectedRowIndex = this.tableData.indexOf(row);
      this.$refs.tableData.toggleRowSelection(row);
      if (this.openPage) {
        this.$emit("deptEmit", row, 4);
      }
    },
    //选中行高亮样式
    rowStyle({ row, rowIndex }) {
@@ -1041,16 +1052,32 @@
    //双击行
    handleDblclick(row, column, cell, event) {
      this.OperationType = 3;
      this.handleEdit();
      if (this.openPage) {
        this.$emit("deptEmitDb", row, 4);
      } 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];
        }
      }
    },
    //打开侧边搜索弹窗
@@ -1131,10 +1158,10 @@
        this.sWhere += " and " + this.queryParams.ColName2 + " " + com2;
      }
      if (this.queryParams.HNumber) {
        this.sWhere += " and 职员代码 like '%" + this.queryParams.HNumber + "%'";
        this.sWhere += " and 生产资源代码 like '%" + this.queryParams.HNumber + "%'";
      }
      if (this.queryParams.HName) {
        this.sWhere += " and 职员名称 like '%" + this.queryParams.HName + "%'";
        this.sWhere += " and 生产资源名称 like '%" + this.queryParams.HName + "%'";
      }
      if (this.queryParams.HOrgID) {
        this.sWhere += " and HUSEORGID = '" + this.queryParams.HOrgID + "'";
@@ -1162,7 +1189,7 @@
        .get(this.baseURL + "/Xt_User/getOrgIDListByUser", {
          params: {
            HModName: this.HModName,
            user: this.user,
            user: sessionStorage["HUserName"],
            HOrgID: this.zuzhiId,
          },
        })
@@ -1243,7 +1270,10 @@
          if (!this.rowForm.审核人) {
            axios
              .get(this.baseURL + "DeltetGy_Employee", {
                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) {
@@ -1268,7 +1298,11 @@
      //逻辑审核方法
      axios
        .get(this.baseURL + "/Gy_Employee/AuditGy_Employee", {
          params: { HInterID: InterID, IsAudit: num, CurUserName: this.user },
          params: {
            HInterID: InterID,
            IsAudit: num,
            CurUserName: sessionStorage["HUserName"],
          },
        })
        .then((response) => {
          let result = response.data;
@@ -1289,7 +1323,11 @@
      //逻辑审核方法
      axios
        .get(this.baseURL + "/Gy_Employee/StopGy_Employee", {
          params: { HInterID: InterID, IsStop: num, CurUserName: this.user },
          params: {
            HInterID: InterID,
            IsStop: num,
            CurUserName: sessionStorage["HUserName"],
          },
        })
        .then((response) => {
          let result = response.data;
@@ -1355,7 +1393,7 @@
        }
      }
      var sSubStr = JSON.stringify(num);
      var sMainSub = sSubStr + "&和" + this.user;
      var sMainSub = sSubStr + "&和" + sessionStorage["HUserName"];
      axios({
        method: "post",
        url: this.baseURL + "/Gy_Source/Gy_Source_btnSave",
@@ -1413,4 +1451,7 @@
.xsckdBox .el-date-editor.el-input {
  width: 100%;
}
.zy-hidden {
  display: none;
}
</style>