wangyi
2026-01-19 7fb0a8f0ab16c149484bf043754cd10cfa94de2f
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"
@@ -8,7 +8,7 @@
      class="searchBox"
    >
      <el-row>
        <el-form-item label="职员代码" prop="HNumber">
        <el-form-item label="职员代码" prop="HNumber" style="padding-left: 100px">
          <el-input
            v-model="queryParams.HNumber"
            placeholder="请输入职员代码"
@@ -34,7 +34,7 @@
              v-for="(item, index) in organizationList"
              :key="index"
              :label="item.Name"
              :value="item.ID"
              :value="item.ID.toString()"
            >
            </el-option>
          </el-select>
@@ -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
        >
@@ -353,9 +353,9 @@
                }}</span>
                <el-button
                  type="text"
                  @click="handleEdit(row, (OperationType = 3))"
                  v-else-if="column.property == '单据号'"
                  >{{ row.单据号 }}</el-button
                  @click.stop="handleEdit(row, (OperationType = 3))"
                  v-else-if="column.property == '职员代码'"
                  >{{ row.职员代码 }}</el-button
                >
                <span v-else>{{ row[column.label] }}</span>
              </div>
@@ -499,17 +499,17 @@
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 },
  },
  data() {
    return {
      HModName: "Gy_Source",
      activeSeach: "",
      HModName: "Gy_EmployeeList",
      editShow: false,
      openEdit: false,
      totalNameList: [],
@@ -517,7 +517,7 @@
      openPrintList: false,
      printListShow: false,
      HClassTag: "ForFilteringSchemes", //过滤条件的class类
      HBillType: "1205",
      HBillType: "Gy_EmployeeList",
      openBtnHide: false,
      btnHideShow: false,
      rowHideShow: false,
@@ -562,11 +562,11 @@
      openData: false, //数据弹窗
      dialogTitle: "",
      zuzhiId: "",
      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, // 用于记录上次点击的行索引
@@ -586,7 +586,7 @@
      dateRange: [],
      // 查询参数
      queryParams: {
        HOrgID: null,
        HOrgID: sessionStorage["OrganizationID"],
        HName: null,
        HNumber: null,
        Comparator1: "",
@@ -649,7 +649,8 @@
    };
  },
  created() {
    this.fetchData();
    // this.fetchData();
    this.handleQuery();
    this.riqiChange();
  },
  methods: {
@@ -684,7 +685,7 @@
    defaintOperationByCompanyName() {
      var result = false;
      axios
        .get(this.baseURL + "/Xt_getInfo/getCompanyName")
        .get(this.$baseUrl + "/Xt_getInfo/getCompanyName")
        .then((response) => {
          var data1 = response.data;
          if (data1.count == 1) {
@@ -769,33 +770,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.getList();
            })
            .catch((error) => {
              this.$modal.msgError("接口请求失败!");
            });
        })
        .catch((error) => {
          this.$modal.msgError("接口请求失败!");
        });
    },
    getList() {
      this.tableShow = false;
      this.loading = true;
@@ -804,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", {
        .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 = [];
@@ -899,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) => {
@@ -909,7 +891,7 @@
    DisPlay_HideColumn(HModName, user, option, dataOption) {
      this.totalNameList = [];
      axios
        .get(this.baseURL + "/Xt_grdAlignment_WMES/grdAlignmentWMESList", {
        .get(this.$baseUrl + "/Xt_grdAlignment_WMES/grdAlignmentWMESList", {
          params: {
            HModName: HModName,
            user: user,
@@ -1057,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 }) {
@@ -1067,16 +1052,32 @@
    //双击行
    handleDblclick(row, column, cell, event) {
      this.OperationType = 3;
      this.handleEdit();
      if (this.openPage) {
        this.$emit("deptEmitDb", row, 4);
      } else {
        this.handleEdit(row);
      }
    },
    // 多选框选中数据
    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];
        }
      }
    },
    //打开侧边搜索弹窗
@@ -1185,10 +1186,10 @@
    getOrgIDByUser() {
      var res = "";
      axios
        .get(this.baseURL + "/Xt_User/getOrgIDListByUser", {
        .get(this.$baseUrl + "/Xt_User/getOrgIDListByUser", {
          params: {
            HModName: this.HModName,
            user: this.user,
            user: sessionStorage["HUserName"],
            HOrgID: this.zuzhiId,
          },
        })
@@ -1249,7 +1250,8 @@
      });
    },
    //打开修改组件弹窗
    handleEdit() {
    handleEdit(row) {
      this.rowForm = row
      this.$nextTick(() => {
        this.openEdit = true;
        this.editShow = true;
@@ -1268,8 +1270,11 @@
        .then(() => {
          if (!this.rowForm.审核人) {
            axios
              .get(this.baseURL + "DeltetGy_Employee", {
                params: { HItemID: this.rowForm.HItemID.toString(), user: this.user },
              .get(this.$baseUrl + "DeltetGy_Employee", {
                params: {
                  HItemID: this.rowForm.HItemID.toString(),
                  user: sessionStorage["HUserName"],
                },
              })
              .then((response) => {
                if (response.data.count == 1) {
@@ -1293,8 +1298,12 @@
      var InterID = form.HItemID || form.HInterID;
      //逻辑审核方法
      axios
        .get(this.baseURL + "/Gy_Employee/AuditGy_Employee", {
          params: { HInterID: InterID, IsAudit: num, CurUserName: this.user },
        .get(this.$baseUrl + "/Gy_Employee/AuditGy_Employee", {
          params: {
            HInterID: InterID,
            IsAudit: num,
            CurUserName: sessionStorage["HUserName"],
          },
        })
        .then((response) => {
          let result = response.data;
@@ -1314,8 +1323,12 @@
      var InterID = form.HItemID || form.HInterID;
      //逻辑审核方法
      axios
        .get(this.baseURL + "/Gy_Employee/StopGy_Employee", {
          params: { HInterID: InterID, IsStop: num, CurUserName: this.user },
        .get(this.$baseUrl + "/Gy_Employee/StopGy_Employee", {
          params: {
            HInterID: InterID,
            IsStop: num,
            CurUserName: sessionStorage["HUserName"],
          },
        })
        .then((response) => {
          let result = response.data;
@@ -1381,10 +1394,10 @@
        }
      }
      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",
        url: this.$baseUrl + "/Gy_Source/Gy_Source_btnSave",
        data: {
          sMainSub: sMainSub,
        },
@@ -1439,4 +1452,7 @@
.xsckdBox .el-date-editor.el-input {
  width: 100%;
}
.zy-hidden {
  display: none;
}
</style>