chenhaozhe
2026-01-14 6ff74795de0f28f016fcb46ec2f4e240471659aa
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">
@@ -405,6 +414,9 @@
       <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
@@ -587,6 +599,8 @@
      </el-dialog>
      <!-- 条码明细 -->
      <BarCodeDetail :visible.sync="barCodeDetailShow" ref="barcodeDetail"/>
      <!-- 包装容器出入库明细 -->
      <PackStockDetail :visible.sync="packStockDetailShow" ref="packStockDetail"/>
    </div>
  </div>
</template>
@@ -597,10 +611,11 @@
import Edit from '@/views/sell/Kf_ICStockBillMainList/Kf_ICStockBillMainListEdit'
import BarCodeDetail from '@/views/component/BarCodeDetail'               //条码明细组件
import dayjs from "dayjs";                                                //日期处理库
import PackStockDetail from '@/views/component/PackStockDetail'               //包装明细组件
export default {
  name: "GySource",
  components: { RowSettings,Edit,BarCodeDetail},
  components: { RowSettings,Edit,BarCodeDetail,PackStockDetail},
  props: {
    openPage: { type: String },
  },
@@ -617,6 +632,7 @@
      printListShow: false,
      HClassTag: "ForFilteringSchemes",                     //过滤条件的class类
      barCodeDetailShow: false,                             //条码明细组件容器显示标记
      packStockDetailShow:false,                            //包装容器出入库明细容器显示标记
      HBillType: "1202",
      openBtnHide: false,
      btnHideShow: false,
@@ -696,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,
@@ -854,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) {
@@ -917,11 +929,11 @@
      // 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 {
@@ -1177,7 +1189,7 @@
    },
    //选中行高亮样式
    rowStyle({ row, rowIndex }) {
      if (this.ids.includes(row.HItemID)) {
      if (this.ids.includes(row.hmainid)) {
        return { background: "#ecf5ff" };
      }
    },
@@ -1189,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) {
@@ -1570,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();