chenhaozhe
2025-12-05 bb40eba5dd2ec75a6fa2cd2c8eb41d769c092fca
src/views/sell/Kf_ICStockBillMainList/Kf_ICStockBillMainList.vue
@@ -9,29 +9,38 @@
      class="searchBox"
    >
      <el-row>
        <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>
        </el-form-item>
        <el-form-item label="日期间隔">
          <el-select
            v-model="queryParams.HInitTimeCycle"
            placeholder="请选择"
            @change="riqiChange"
              <el-form-item label="开始日期" style="margin-left: 100px">
        <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
          v-model="queryParams.HInitTimeCycle"
          placeholder="请选择"
          @change="riqiChange"
          style="width: 150px"
        >
          <el-option
            v-for="(item, index) in rqsgList"
            :key="index"
            :label="item.label"
            :value="item.value"
          >
            <el-option
              v-for="(item, index) in rqsgList"
              :key="index"
              :label="item.label"
              :value="item.value"
            >
            </el-option>
          </el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="单据号" prop="HBillNo">
@@ -402,6 +411,12 @@
        >
      </el-col>
      <!-- <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> -->
       <el-col :span="1.5">
        <el-button type="primary" icon="el-icon-printer" size="mini" :disabled="single" @click="get_BarCodeDetail">条码明细</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button type="primary" icon="el-icon-printer" size="mini" :disabled="single" @click="get_PackStockDetail">包装容器出入库明细</el-button>
      </el-col>
    </el-row>
    <div class="tableBox" v-loading="loading">
      <el-table
@@ -445,7 +460,7 @@
                }}</span>
                <el-button
                  type="text"
                  @click="handleEdit(row, (OperationType = 3))"
                  @click="handleDblclick1"
                  v-else-if="column.property == '单据号'"
                  >{{ row.单据号 }}</el-button
                >
@@ -487,7 +502,7 @@
      >
        <edit
          :OperationType="OperationType"
          :linterid="this.rowForm.HItemID"
          :linterid="this.rowForm.HItemID || this.rowForm.HInterID || this.rowForm.hmainid"
          :HSouceBillType="this.rowForm.HSourceBillType"
          :HOrgID="this.queryParams.HOrgID"
          :copyType="copyType"
@@ -582,6 +597,10 @@
          @pagination="currentPage"
        />
      </el-dialog>
      <!-- 条码明细 -->
      <BarCodeDetail :visible.sync="barCodeDetailShow" ref="barcodeDetail"/>
      <!-- 包装容器出入库明细 -->
      <PackStockDetail :visible.sync="packStockDetailShow" ref="packStockDetail"/>
    </div>
  </div>
</template>
@@ -590,11 +609,13 @@
import axios from "axios";
import RowSettings from "@/views/component/rowSettings";
import Edit from '@/views/sell/Kf_ICStockBillMainList/Kf_ICStockBillMainListEdit'
import dayjs from "dayjs";
import BarCodeDetail from '@/views/component/BarCodeDetail'               //条码明细组件
import dayjs from "dayjs";                                                //日期处理库
import PackStockDetail from '@/views/component/PackStockDetail'               //包装明细组件
export default {
  name: "GySource",
  components: { RowSettings,Edit},
  components: { RowSettings,Edit,BarCodeDetail,PackStockDetail},
  props: {
    openPage: { type: String },
  },
@@ -609,7 +630,9 @@
      tableShow: true,
      openPrintList: false,
      printListShow: false,
      HClassTag: "ForFilteringSchemes", //过滤条件的class类
      HClassTag: "ForFilteringSchemes",                     //过滤条件的class类
      barCodeDetailShow: false,                             //条码明细组件容器显示标记
      packStockDetailShow:false,                            //包装容器出入库明细容器显示标记
      HBillType: "1202",
      openBtnHide: false,
      btnHideShow: false,
@@ -660,7 +683,7 @@
      OperationType: null, //保存类型(新增1修改3)
      HInterID: null,
      baseURL: process.env.VUE_APP_BASE_API || "http://47.96.97.237/API/",
      user: "admin",
      user: sessionStorage["HUserName"],
      currentRow: [],
      lastSelectedRowIndex: null, // 用于记录上次点击的行索引
      lastSelectedRow: null, // 上一次选中的行
@@ -689,8 +712,8 @@
        ColContent2: "",
        ColContent: "",
        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"),
        HBeginDate: dayjs(new Date()).subtract(29, "d").format("YYYY-MM-DD"),
        HEndDate: dayjs(new Date()).format("YYYY-MM-DD"),
      },
      // 显示搜索条件
      showSearch: true,
@@ -752,6 +775,17 @@
    this.getList();
  },
  methods: {
    handleDblclick1(){     //延时传递导入数据
      // 延迟执行第一个函数
      setTimeout(() => {
        this.handleRowClick();
      });
      // 延迟执行第二个函数(可以设置相同或不同的延迟时间)
      setTimeout(() => {
        this.handleDblclick();
      }, 300);
    },
    BillSync() {
      axios.get(`${this.baseURL}/Kf_ICStockBillMain/GetCStockBillList`, {
        params: { BillNo: this.form.HBillno2, BillType: 1403 },
@@ -836,15 +870,11 @@
      const start = dayjs(new Date())
        .subtract(this.queryParams.HInitTimeCycle, "d")
        .format("YYYY-MM-DD");
      // start.setTime(start.getTime() - 3600 * 1000 * 24 * this.queryParams.HInitTimeCycle);
      // const yyyyS = start.getFullYear();
      // const mmS = String(start.getMonth() + 1).padStart(2, "0"); // 月份是从0开始的
      // const ddS = String(start.getDate()).padStart(2, "0");
      // const yyyyE = end.getFullYear();
      // const mmE = String(end.getMonth() + 1).padStart(2, "0"); // 月份是从0开始的
      // const ddE = String(end.getDate()).padStart(2, "0");
      this.sTime = start;
      this.eTime = end;
      this.queryParams.HBeginDate = start;
      this.queryParams.HEndDate = end;
      this.dateRange = [this.sTime, this.eTime];
    },
    organizationChange(val) {
@@ -899,15 +929,15 @@
      // this.sWhere += ` and CONVERT(varchar(100),日期, 23) >= '2020-01-01' and CONVERT(varchar(100),日期, 23) <= '2030-01-01'`;
      // 收料通知单列表
      if (this.dateRange.length > 0) {
      if (this.queryParams.HBeginDate && this.queryParams.HEndDate) {
        this.sWhere +=
          " and CONVERT(varchar(100),日期, 23) >= '" + this.dateRange[0] + "'";
          " and CONVERT(varchar(100),日期, 23) >= '" + this.queryParams.HBeginDate + "'";
        this.sWhere +=
          " and CONVERT(varchar(100),日期, 23) <= '" + this.dateRange[1] + "'";
          " and CONVERT(varchar(100),日期, 23) <= '" + this.queryParams.HEndDate + "'";
      }
      try {
        let res = await axios.get(this.baseURL + "/Kf_ICStockBillMain/GetCStockBillList", {
        let res = await axios.get(this.baseURL + "/Kf_ICStockBackBill/GetKf_ICStockBackBillList", {
          params: {
            sWhere: this.sWhere,
            user: this.user,
@@ -1159,7 +1189,7 @@
    },
    //选中行高亮样式
    rowStyle({ row, rowIndex }) {
      if (this.ids.includes(row.HItemID)) {
      if (this.ids.includes(row.hmainid)) {
        return { background: "#ecf5ff" };
      }
    },
@@ -1171,7 +1201,7 @@
    // 多选框选中数据
    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) {
@@ -1340,22 +1370,47 @@
    //退出
    close() {
      this.tableShow = true;
      this.openEdit = false;
      this.editShow = false;
      this.openEdit = false;    //当通过超链接进入编辑页面并退出后,选中记录数为空,但编辑按钮可操作。点击编辑按钮,再未选中记录的情况下仍能进入最后一次选中的记录的编辑页面。
      this.rowForm = {};        // 关闭时重置这个数据就能解决上面的问题清空行数据
      this.ids = [];            // 清空选中ID数组
      this.single = true;       // 重置单选状态
      this.multiple = true;     // 重置多选状态
      this.getList();
    },
    //打开新增组件弹窗
    handleAddEdit() {
     this.rowForm.hmainid = 0
      this.editShow = true
      this.openEdit = true
      this.editShow = true
    },
    //打开修改组件弹窗
    handleEdit() {
      this.$nextTick(() => {
        this.openEdit = true;
        if(this.rowForm.hmainid == 0)
        {
          this.$modal.msgError("请选择要编辑的数据!");
          return;
      }
        this.editShow = true;
        this.openEdit = true;
      });
    },
    // 打开修改组件弹窗
    //#region 条码明细
    get_BarCodeDetail() {
      // if (this.selectedRow.length !== 1) {
      //   this.$message.warning('请选择一行数据查看条码明细!')
      //   return
      // }
      this.barCodeDetailShow = true
      this.$nextTick(() => {
        this.$refs.barcodeDetail.open(this.rowForm)
      })
      },
    //#endregion
    //关闭编辑页面
    editGyClose(val) {
      this.editShow = false;
@@ -1527,6 +1582,18 @@
        );
      }
    },
      //#region 包装容器出入库明细
    get_PackStockDetail() {
      // if (this.selectedRow.length !== 1) {
      //   this.$message.warning('请选择一行数据查看条码明细!')
      //   return
      // }
      this.packStockDetailShow = true
      this.$nextTick(() => {
        this.$refs.packStockDetail.open(this.rowForm)
      })
      },
    //#endregion
    // 提交上传文件
    submitFileForm() {
      this.$refs.upload.submit();