sen
2026-04-02 5339e71b9a2ac55b99ea82c6c620576aa808d815
ui/admin-ui3/src/views/tms/generationCost/index.vue
@@ -114,7 +114,8 @@
        </avue-form>
        <avue-crud :option="boxTableOption" :data="boxTableData" @selection-change="boxSelectionChange">
          <template #menu-left>
            <el-button type="danger" plain icon="Delete" :disabled="!(boxSelectionList.length === 1 && boxSelectionList[0]?.status === 0)"
            <el-button type="danger" plain icon="Delete"
              :disabled="!(boxSelectionList.length === 1 && boxSelectionList[0]?.status === 0)"
              @click="handleBatchBoxDel">
              作废
            </el-button>
@@ -132,7 +133,8 @@
            </el-select>
          </template>
          <template #yfPrice="{ row }">
            <el-input   :disabled="row.status == 1" v-model="row.yfPrice" :min="1" type="number" placeholder="请输入金额"></el-input>
            <el-input :disabled="row.status == 1" v-model="row.yfPrice" :min="1" type="number"
              placeholder="请输入金额"></el-input>
          </template>
          <template #yfCurrency="{ row }">
            <el-radio-group v-model="row.yfCurrency"   :disabled="row.status == 1" >
@@ -1221,50 +1223,48 @@
    console.log(pageF.single)
  },
  getBeginListFunc: (params = {}) => {
    // 1. 日期转换
    let newParams = <any>{ ...params };
    if (newParams) {
      // 1. 定义日期字段映射 (数组名 : 接口需要的前缀)
      // 这样写的好处是:如果你有多个日期,直接在这里添加一行即可
    // 1. 使用浅拷贝,不影响原始查询对象
    // 关键点:从原始 queryParams.value 取值,确保分页时依然能拿到数组
    let newParams = { ...queryParams.value, ...params };
    // 2. 定义日期字段映射 (数组名 : 接口需要的前缀)
      const dateMap = {
        createTimeRange: 'createTime',
        updateTimeRange: 'updateTime',
        confirmTimeRange: 'confirmTime',
        okTimeRange: 'okTime',
      };
      // 2. 遍历处理日期
    // 3. 遍历处理日期
      Object.keys(dateMap).forEach(arrayKey => {
        const prefix = dateMap[arrayKey];
        const range = newParams[arrayKey];
        if (Array.isArray(range) && range.length > 0) {
          // 赋值 Begin 和 End
      if (Array.isArray(range) && range.length === 2) {
        // 赋值接口需要的 Begin 和 End
          newParams[`${prefix}Begin`] = range[0];
          newParams[`${prefix}End`] = range[1];
        }
        // 【核心改动】:无论是否有值,处理完后都把原始的 Array 字段删掉
        // 这样请求里就不会出现 confirmTimeRangeArray: [...]
      // 只在给接口的参数中删除数组,不影响页面显示的 queryParams
        delete newParams[arrayKey];
      });
      // 3. 通用清洗:删除所有空字符串、null 或 undefined 的其他字段
    // 4. 清洗参数:过滤空值
    const finalParams = {};
      Object.keys(newParams).forEach(key => {
        const val = newParams[key];
        if (val === '' || val === null || val === undefined) {
          delete newParams[key];
      if (val !== '' && val !== null && val !== undefined) {
        finalParams[key] = val;
        }
      });
    } else {
      newParams = {};
    }
    console.log('发送给接口的最终参数:', finalParams);
    return newParams;
    // 【核心修改】:直接返回,不要赋值给 queryParams.value
    return finalParams;
  },
})