1
llj
2025-12-15 0fe3d2ce5fde2f99ea1b0f57ab442e8a15bf6ee0
src/views/sell/XsSeOutStockBackBillList.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
@@ -49,7 +61,7 @@
          >
            <el-option
              v-for="(item, index) in organizationList"
              :key="item.ID"
              :key="index"
              :label="item.Name"
              :value="item.ID"
            >
@@ -267,7 +279,7 @@
          icon="el-icon-edit"
          size="mini"
          :disabled="single"
          @click="handleEdit((row = rowForm), (OperationType = 3))"
          @click="handleEdit((row = rowForm), (OperationType = 3), (copyType = -1))"
          >编辑</el-button
        >
      </el-col>
@@ -277,7 +289,7 @@
          icon="el-icon-edit"
          size="mini"
          :disabled="single"
          @click="handleEdit((row = rowForm), (OperationType = 2))"
          @click="handleEdit((row = rowForm), (OperationType = 2), (copyType = 1))"
          >复制</el-button
        >
      </el-col>
@@ -287,7 +299,7 @@
          icon="el-icon-delete"
          size="mini"
          :disabled="single"
          @click="handleDelete((form = rowForm))"
          @click="handleDelete"
          >删除
        </el-button>
      </el-col>
@@ -466,7 +478,7 @@
                }}</span>
                <el-button
                  type="text"
                  @click="handleEdit(row, (OperationType = 3))"
                  @click.stop="handleEdit(row, (OperationType = 3), (copyType = 1))"
                  v-else-if="column.property == '单据号'"
                  >{{ row.单据号 }}</el-button
                >
@@ -499,14 +511,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"
@@ -514,7 +526,10 @@
          :copyType="copyType"
          @editCloseGy="editGyClose"
          v-if="editShow"
        />
        /> -->
        <div style="height: 70vh">
          <iframe :src="iframeUrl" frameborder="0" width="100%" height="100%"></iframe>
        </div>
      </el-dialog>
      <el-dialog
        :title="upload.title"
@@ -613,7 +628,7 @@
import dayjs from "dayjs";
export default {
  name: "GySource",
  name: "XsSeOutStockBackBillList",
  components: { RowSettings },
  props: {
    openPage: { type: String },
@@ -621,7 +636,7 @@
  data() {
    return {
      activeSeach: "",
      HModName: "Cg_POOrderBillList",
      HModName: "XsSeOutStockBackBillList",
      editShow: false,
      openEdit: false,
      totalNameList: [],
@@ -630,7 +645,7 @@
      openPrintList: false,
      printListShow: false,
      HClassTag: "ForFilteringSchemes", //过滤条件的class类
      HBillType: "1202",
      HBillType: "1105",
      openBtnHide: false,
      btnHideShow: false,
      rowHideShow: false,
@@ -662,6 +677,7 @@
        { label: "近30天", value: 29 },
        { label: "近半年", value: 180 },
        { label: "近一年", value: 365 },
        { label: "任意时间", value: -1 },
      ],
      hPriceTypeList: ["成本价", "结算价"],
      addBtnShow: false,
@@ -680,7 +696,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, // 上一次选中的行
@@ -699,7 +714,7 @@
      dateRange: [],
      // 查询参数
      queryParams: {
        HOrgID: sessionStorage["OrganizationID"],
        HOrgID: null,
        HName: null,
        HNumber: null,
        Comparator1: "",
@@ -729,7 +744,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,
@@ -766,10 +788,18 @@
      uploadTotal: 0,
    };
  },
  mounted() {},
  mounted() {
    window.editGyClose = () => {
      this.editGyClose(); // 组件内的方法绑定到windows
    };
  },
  created() {
    this.riqiChange();
    this.getList();
  },
  beforeDestroy() {
    // 组件销毁时清理全局方法,避免内存泄漏
    delete window.editGyClose;
  },
  methods: {
    BillSync() {
@@ -852,6 +882,10 @@
      this.getList();
    },
    riqiChange() {
      if (this.queryParams.HInitTimeCycle == -1) {
        // 任意时间
        return;
      }
      const end = dayjs(new Date()).format("YYYY-MM-DD");
      const start = dayjs(new Date())
        .subtract(this.queryParams.HInitTimeCycle, "d")
@@ -865,7 +899,6 @@
      // const ddE = String(end.getDate()).padStart(2, "0");
      this.sTime = start;
      this.eTime = end;
      this.dateRange = [this.sTime, this.eTime];
    },
    organizationChange(val) {
      // let options=undefined
@@ -919,18 +952,16 @@
      // 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.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 + "/Xs_SeOutStockBill/list_byPage", {
        let res = await axios.get(this.baseURL + "/Xs_SeOutStockBackBill/list_byPage", {
          params: {
            sWhere: this.sWhere,
            user: this.user,
            user: sessionStorage["HUserName"],
            Organization: HOrgName,
            page: this.page,
            size: this.pageSize,
@@ -1019,7 +1050,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}`);
@@ -1179,19 +1215,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, 3, 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) {
@@ -1275,6 +1311,7 @@
        }
        this.sWhere += " and " + this.queryParams.ColName2 + " " + com2;
      }
      if (this.queryParams.HBillNo) {
        this.sWhere += " and 单据号 like '%" + this.queryParams.HBillNo + "%'";
      }
@@ -1311,7 +1348,7 @@
        .get(this.baseURL + "/Xt_User/getOrgIDListByUser", {
          params: {
            HModName: this.HModName,
            user: this.user,
            user: sessionStorage["HUserName"],
            HOrgID: this.zuzhiId,
          },
        })
@@ -1366,13 +1403,15 @@
    //打开新增组件弹窗
    handleAddEdit() {
      this.rowForm.HItemID = 0;
      this.iframeUrl = `/iframe/XsSeOutStockBackBillEdit?HInterID=0&OperationType=1&CopyType=2`;
      this.$nextTick(() => {
        this.openEdit = true;
        this.editShow = true;
      });
    },
    //打开修改组件弹窗
    handleEdit() {
    handleEdit(row, OperationType, copyType) {
      this.iframeUrl = `/iframe/XsSeOutStockBackBillEdit?HInterID=${row.hmainid}&OperationType=${OperationType}&CopyType=${copyType}`;
      this.$nextTick(() => {
        this.openEdit = true;
        this.editShow = true;
@@ -1385,8 +1424,7 @@
      (this.multiple = true), this.getList();
    },
    /** 删除按钮操作 */
    handleDelete(form) {
      console.log(form);
    handleDelete() {
      this.$modal
        .confirm("确认要删除吗,删除后不能恢复")
        .then(() => {
@@ -1394,12 +1432,12 @@
            axios
              .get(this.baseURL + "/Xs_SeOutStockBill/DeltetSeOutStockBill", {
                params: {
                  HInterID: form.hmainid.toString(),
                  HsupId: form.hsubid,
                  HQty: form["数量"],
                  HSourceInterID: form["源单主内码"],
                  HSourceEntryID: form["源单子内码"],
                  user: this.user,
                  HInter: this.rowForm.hmainid.toString(),
                  HsupId: this.rowForm.HsupId,
                  HQty: this.rowForm.HQty,
                  HSourceInterID: this.rowForm.HSourceInterID,
                  HSourceEntryID: this.rowForm.HSourceEntryID,
                  user: sessionStorage["HUserName"],
                },
              })
              .then((res) => {
@@ -1425,7 +1463,11 @@
      //逻辑审核方法
      axios
        .get(this.baseURL + "/Xs_SeOutStockBill/CheckXs_SeOutStockBill", {
          params: { HInterID: InterID, TypeError: num, CurUserName: this.user },
          params: {
            HInterID: InterID,
            TypeError: num,
            CurUserName: sessionStorage["HUserName"],
          },
        })
        .then((res) => {
          let result = res.data;
@@ -1450,7 +1492,7 @@
            params: {
              HInterID: HInterID,
              Type: num,
              user: this.user,
              user: sessionStorage["HUserName"],
            },
          }
        );
@@ -1478,7 +1520,7 @@
              HInterID: HInterID,
              HEntryID: HEntryID,
              ISAudit: num,
              CurUserName: this.user,
              CurUserName: sessionStorage["HUserName"],
            },
          }
        );
@@ -1504,7 +1546,7 @@
            params: {
              HInterID: HInterID,
              Type: num,
              user: this.user,
              user: sessionStorage["HUserName"],
            },
          }
        );
@@ -1526,7 +1568,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;
@@ -1592,7 +1638,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",