chenhaozhe
2025-11-21 f64e48947d3472aae4903d3be61d449b0f5d8490
src/views/purchase/cgPoInStockBill/cgPoInStockBill.vue
@@ -9,15 +9,27 @@
      class="searchBox"
    >
      <el-row>
        <el-form-item label="日期" style="margin-left: 100px">
        <el-form-item label="开始日期" style="margin-left: 100px">
          <el-date-picker
            v-model="dateRange"
            v-model="sTime"
            type="date"
            placeholder="开始日期"
            style="width: 150px"
            :disabled="queryParams.HInitTimeCycle != -1"
            value-format="yyyy-MM-dd"
            type="daterange"
            range-separator="-"
            start-placeholder="开始日期"
            end-placeholder="结束日期"
          ></el-date-picker>
          >
          </el-date-picker>
        </el-form-item>
        <el-form-item label="结束日期">
          <el-date-picker
            v-model="eTime"
            type="date"
            placeholder="结束日期"
            style="width: 150px"
            :disabled="queryParams.HInitTimeCycle != -1"
            value-format="yyyy-MM-dd"
          >
          </el-date-picker>
        </el-form-item>
        <el-form-item label="日期间隔">
          <el-select
@@ -482,14 +494,14 @@
      </el-dialog>
      <!-- 编辑 -->
      <el-dialog
        title="编辑职员"
        title="编辑收料通知单"
        :visible.sync="openEdit"
        width="1480px"
        append-to-body
        class="xsckdBox"
        :before-close="close"
      >
        <edit
        <!-- <edit
          :OperationType="OperationType"
          :linterid="this.rowForm.HItemID"
          :HSouceBillType="this.rowForm.HSourceBillType"
@@ -497,7 +509,10 @@
          :copyType="copyType"
          @editCloseGy="editGyClose"
          v-if="editShow"
        />
        /> -->
        <div style="height: 80vh" v-if="openEdit">
          <iframe :src="iframeUrl" frameborder="0" width="100%" height="100%"></iframe>
        </div>
      </el-dialog>
      <el-dialog
        :title="upload.title"
@@ -597,16 +612,17 @@
import dayjs from "dayjs";
export default {
  name: "GySource",
  name: "cgPoInStockBill",
  components: { RowSettings, gySource },
  props: {
    openPage: { type: String },
  },
  data() {
    return {
      iframeUrl: "",
      activeSeach: "",
      dateRange: [],
      HModName: "Cg_POOrderBillList",
      HModName: "cgPoInStockBill",
      editShow: false,
      openEdit: false,
      totalNameList: [],
@@ -614,7 +630,7 @@
      openPrintList: false,
      printListShow: false,
      HClassTag: "ForFilteringSchemes", //过滤条件的class类
      HBillType: "1202",
      HBillType: "1103",
      openBtnHide: false,
      btnHideShow: false,
      rowHideShow: false,
@@ -646,6 +662,7 @@
        { label: "近30天", value: 29 },
        { label: "近半年", value: 180 },
        { label: "近一年", value: 365 },
        { label: "任意间隔", value: -1 },
      ],
      hPriceTypeList: ["成本价", "结算价"],
      addBtnShow: false,
@@ -664,7 +681,6 @@
      OperationType: null, //保存类型(新增1修改3)
      HInterID: null,
      baseURL: process.env.VUE_APP_BASE_API || "http://47.96.97.237/API/",
      user: "admin",
      currentRow: [],
      lastSelectedRowIndex: null, // 用于记录上次点击的行索引
      lastSelectedRow: null, // 上一次选中的行
@@ -759,10 +775,18 @@
  },
  mounted() {
    this.queryParams.HOrgID = sessionStorage["Organization"];
    window.editGyClose = () => {
      this.editGyClose(); // 组件内的方法绑定到windows
    };
  },
  created() {
    this.riqiChange();
    this.getList();
    // this.getList();
    this.handleQuery();
  },
  beforeDestroy() {
    // 组件销毁时清理全局方法,避免内存泄漏
    delete window.editGyClose;
  },
  methods: {
    onDateScanOptionChangerHandler(e) {
@@ -840,6 +864,9 @@
      this.getList();
    },
    riqiChange() {
      if (this.queryParams.HInitTimeCycle == -1) {
        return;
      }
      const end = new Date();
      const start = new Date();
      start.setTime(start.getTime() - 3600 * 1000 * 24 * this.queryParams.HInitTimeCycle);
@@ -851,7 +878,6 @@
      const ddE = String(end.getDate()).padStart(2, "0");
      this.sTime = yyyyS + "-" + mmS + "-" + ddS;
      this.eTime = yyyyE + "-" + mmE + "-" + ddE;
      this.dateRange = [this.sTime, this.eTime];
    },
    organizationChange(val) {
      // let options=undefined
@@ -897,17 +923,15 @@
        this.pageSize = 50;
      }
      if (this.dateRange.length > 0) {
        this.sWhere +=
          " and CONVERT(varchar(100),日期, 23) >= '" + this.dateRange[0] + "'";
        this.sWhere +=
          " and CONVERT(varchar(100),日期, 23) <= '" + this.dateRange[1] + "'";
      if (this.sTime && this.eTime) {
        this.sWhere += " and CONVERT(varchar(100),日期, 23) >= '" + this.sTime + "'";
        this.sWhere += " and CONVERT(varchar(100),日期, 23) <= '" + this.eTime + "'";
      }
      try {
        let res = await axios.get(this.baseURL + "Cg_POInStockBill/page", {
          params: {
            sWhere: this.sWhere,
            user: this.user,
            user: sessionStorage["HUserName"],
            page: this.page,
            size: this.pageSize,
          },
@@ -995,7 +1019,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 (err) {
        this.$modal.msgError(`获取收料通知单错误: ${err}`);
@@ -1282,7 +1311,7 @@
        .get(this.baseURL + "/Xt_User/getOrgIDListByUser", {
          params: {
            HModName: this.HModName,
            user: this.user,
            user: sessionStorage["HUserName"],
            HOrgID: this.zuzhiId,
          },
        })
@@ -1337,7 +1366,7 @@
    //打开新增组件弹窗
    handleAddEdit() {
      this.rowForm.HItemID = 0;
      this.iframeUrl = `/iframe/XsSeOutStockBackBillEdit?HInterID=${0}&OperationType=${1}&copyType=${-1}`;
      this.iframeUrl = `/iframe/CgPoInStockBillEdit?HInterID=${0}&OperationType=${1}&copyType=${-1}`;
      this.$nextTick(() => {
        this.openEdit = true;
        this.editShow = true;
@@ -1345,7 +1374,7 @@
    },
    //打开修改组件弹窗
    handleEdit(row, OperationType, copyType) {
      this.iframeUrl = `/iframe/XsSeOutStockBackBillEdit?HInterID=${row.hmainid}&OperationType=${OperationType}&copyType=${copyType}`;
      this.iframeUrl = `/iframe/CgPoInStockBillEdit?HInterID=${row.hmainid}&OperationType=${OperationType}&copyType=${copyType}`;
      this.$nextTick(() => {
        this.openEdit = true;
        this.editShow = true;
@@ -1371,7 +1400,7 @@
                  HQty: this.rowForm.HQty,
                  HSourceInterID: this.rowForm.HSourceInterID,
                  HSourceEntryID: this.rowForm.HSourceEntryID,
                  user: this.user,
                  user: sessionStorage["HUserName"],
                },
              })
              .then((res) => {
@@ -1397,7 +1426,11 @@
      //逻辑审核方法
      axios
        .get(this.baseURL + "/Cg_POInStockBill/AuditCg_POInStockBill", {
          params: { HInterID: InterID, IsAudit: num, CurUserName: this.user },
          params: {
            HInterID: InterID,
            IsAudit: num,
            CurUserName: sessionStorage["HUserName"],
          },
        })
        .then((res) => {
          let result = res.data;
@@ -1422,7 +1455,7 @@
            params: {
              HInterID: HInterID,
              Type: num,
              user: this.user,
              user: sessionStorage["HUserName"],
            },
          }
        );
@@ -1450,7 +1483,7 @@
              HInterID: HInterID,
              HEntryID: HEntryID,
              ISAudit: num,
              CurUserName: this.user,
              CurUserName: sessionStorage["HUserName"],
            },
          }
        );
@@ -1476,7 +1509,7 @@
            params: {
              HInterID: HInterID,
              Type: num,
              user: this.user,
              user: sessionStorage["HUserName"],
            },
          }
        );
@@ -1498,7 +1531,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((res) => {
          let result = res.data;
@@ -1564,7 +1601,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",