llj
2025-11-19 b5fdf81af1e5eb7c2f22296c4097d1c681f85fcf
src/views/sell/xsSeOrderBill/xsSeOrderBill.vue
@@ -9,15 +9,23 @@
      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"
            value-format="yyyy-MM-dd"
            type="daterange"
            range-separator="-"
            start-placeholder="开始日期"
            end-placeholder="结束日期"
          ></el-date-picker>
            v-model="sTime"
            type="date"
            placeholder="开始日期"
            style="width: 150px"
          >
          </el-date-picker>
        </el-form-item>
        <el-form-item label="结束日期">
          <el-date-picker
            v-model="eTime"
            type="date"
            placeholder="结束日期"
            style="width: 150px"
          >
          </el-date-picker>
        </el-form-item>
        <el-form-item label="日期间隔">
          <el-select
@@ -60,6 +68,27 @@
      <el-collapse v-model="activeSeach">
        <el-collapse-item title="更多" name="1">
          <el-form-item label="客户" prop="HCusID">
            <el-input
              v-model="queryParams.HCusID"
              placeholder="请输入客户"
              @keyup.enter.native="handleQuery"
            />
          </el-form-item>
          <el-form-item label="物料代码" prop="HMaterNumber">
            <el-input
              v-model="queryParams.HMaterNumber"
              placeholder="请输入物料代码"
              @keyup.enter.native="handleQuery"
            />
          </el-form-item>
          <el-form-item label="物料名称" prop="HMaterName">
            <el-input
              v-model="queryParams.HMaterName"
              placeholder="请输入物料名称"
              @keyup.enter.native="handleQuery"
            />
          </el-form-item>
          <el-card class="box-card">
            <div slot="header" class="clearfix"><span>过滤</span></div>
            <div>
@@ -436,7 +465,7 @@
                }}</span>
                <el-button
                  type="text"
                  @click="handleEdit(row, (OperationType = 3))"
                  @click="handleEdit(row, (OperationType = 3), (copyType = 1))"
                  v-else-if="column.property == '单据号'"
                  >{{ row.单据号 }}</el-button
                >
@@ -469,22 +498,25 @@
      </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"
          :linterid="this.rowForm.hmainid"
          :HSouceBillType="this.rowForm.HSourceBillType"
          :HOrgID="this.queryParams.HOrgID"
          :copyType="copyType"
          @editCloseGy="editGyClose"
          v-if="editShow"
        />
        /> -->
        <div style="height: 80vh">
          <iframe :src="iframeUrl" frameborder="0" width="100%" height="100%"></iframe>
        </div>
      </el-dialog>
      <el-dialog
        :title="upload.title"
@@ -581,6 +613,8 @@
import axios from "axios";
import RowSettings from "@/views/component/rowSettings";
import dayjs from "dayjs";
import { computed } from "vue";
import { watch } from "vue";
export default {
  name: "GySource",
@@ -590,7 +624,8 @@
  },
  data() {
    return {
      activeSeach: '',
      iframeUrl: "",
      activeSeach: "",
      HModName: "Cg_POOrderBillList",
      editShow: false,
      openEdit: false,
@@ -669,7 +704,7 @@
      dateRange: [],
      // 查询参数
      queryParams: {
        HOrgID: null,
        HOrgID: sessionStorage["Organization"],
        HName: null,
        HNumber: null,
        Comparator1: "",
@@ -678,7 +713,7 @@
        ColContent1: "",
        ColContent2: "",
        ColContent: "",
        timeSpan: 29,
        HInitTimeCycle: 29,
        HBeginDate: dayjs(new Date()).subtract(29, "d").format("YYYY-MM-DDTHH:mm:ss"),
        HEndDate: dayjs(new Date()).format("YYYY-MM-DDTHH:mm:ss"),
      },
@@ -699,7 +734,14 @@
      btResList: [],
      tableData: [], //收料通知单列表(分页显示)
      dataList: [],
      titleData: ["HItemID", "Hprocid", "HUSEORGID", "HCREATEORGID", "HParentID"], //不需要显示的字段 可扩展
      titleData: [
        "HItemID",
        "hmainid",
        "Hprocid",
        "HUSEORGID",
        "HCREATEORGID",
        "HParentID",
      ], //不需要显示的字段 可扩展
      pageSizes: [50, 100, 500, 5000, 50000],
      page: 1,
      pageSize: 50,
@@ -736,7 +778,17 @@
      uploadTotal: 0,
    };
  },
  mounted() {},
  mounted() {
    window.editGyClose = () => {
      this.editGyClose(); // 组件内的方法绑定到windows
    };
    this.queryParams.HOrgID = sessionStorage["Organization"];
  },
  beforeDestroy() {
    // 组件销毁时清理全局方法,避免内存泄漏
    delete window.editGyClose;
  },
  created() {
    this.riqiChange();
    this.getList();
@@ -905,17 +957,16 @@
      // this.queryParams.HOrgID = 100038
      // this.sWhere += ` and CONVERT(varchar(100),日期, 23) >= '2020-01-01' and CONVERT(varchar(100),日期, 23) <= '2030-01-01'`;
      // 收料通知单列表
      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.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", {
        let res = await axios.get(this.baseURL + "Xs_SeOrderBill/list_ByPage", {
          params: {
            sWhere: this.sWhere,
            user: this.user,
            Organization: sessionStorage["Organization"],
            page: this.page,
            size: this.pageSize,
          },
@@ -1163,19 +1214,19 @@
    },
    //选中行高亮样式
    rowStyle({ row, rowIndex }) {
      if (this.ids.includes(row.HItemID)) {
      if (this.ids.includes(row.hmainid)) {
        return { background: "#ecf5ff" };
      }
    },
    //双击行
    handleDblclick(row, column, cell, event) {
      this.OperationType = 3;
      this.handleEdit();
      this.handleEdit(row, this.OperationType, 1);
    },
    // 多选框选中数据
    handleSelectionChange(selection) {
      // this.rowForm = {}
      this.ids = selection.map((item) => item.HItemID);
      this.ids = selection.map((item) => item.hmainid);
      this.single = selection.length != 1;
      this.multiple = !selection.length;
      if (!this.single) {
@@ -1259,20 +1310,27 @@
        }
        this.sWhere += " and " + this.queryParams.ColName2 + " " + com2;
      }
      if (this.queryParams.HNumber) {
        this.sWhere += " and 生产资源代码 like '%" + this.queryParams.HNumber + "%'";
      }
      if (this.queryParams.HName) {
        this.sWhere += " and 生产资源名称 like '%" + this.queryParams.HName + "%'";
      if (this.queryParams.HBillNo) {
        this.sWhere += " and 单据号 like '%" + this.queryParams.HBillNo + "%'";
      }
      if (this.queryParams.HBeginDate && this.queryParams.HEndDate) {
        console.log(this.queryParams.HBeginDate, this.queryParams.HEndDate);
        this.sWhere += `  and CONVERT(varchar(100),日期, 23) >= '${this.queryParams.HBeginDate}' and CONVERT(varchar(100),日期, 23) <= '${this.queryParams.HEndDate}'`;
      if (this.queryParams.HCusID) {
        this.sWhere += " and 客户 like ''%" + this.queryParams.HCusID + "%''";
      }
      if (this.queryParams.HOrgID) {
        this.sWhere += " and HOrgID = '" + this.queryParams.HOrgID + "'";
      if (this.queryParams.HMaterNumber) {
        this.sWhere += " and 物料代码 like ''%" + this.queryParams.HMaterNumber + "%''";
      }
      if (this.queryParams.HMaterName) {
        this.sWhere += " and 物料名称 like ''%" + this.queryParams.HMaterName + "%''";
      }
      // if (this.queryParams.HBeginDate && this.queryParams.HEndDate) {
      //   this.sWhere += `  and CONVERT(varchar(100),日期, 23) >= '${this.queryParams.HBeginDate}' and CONVERT(varchar(100),日期, 23) <= '${this.queryParams.HEndDate}'`;
      // }
      // if (this.queryParams.HOrgID) {
      //   this.sWhere += " and HOrgID = '" + this.queryParams.HOrgID + "'";
      // }
      this.sWhere += this.addSWhereByOpenType();
      // this.sWhere += this.getOrgIDByUser();
      this.searchOpen = false;
@@ -1357,7 +1415,8 @@
      });
    },
    //打开修改组件弹窗
    handleEdit() {
    handleEdit(row, OperationType, copyType) {
      this.iframeUrl = `/iframe/XsSeOrderBillEdit?HInterID=${row.hmainid}&OperationType=${OperationType}&copyType=${copyType}`;
      this.$nextTick(() => {
        this.openEdit = true;
        this.editShow = true;