111
lkk
2025-01-11 4cd570c40951d27e5cd745f8678913f221cdb22e
src/views/system/package/index.vue
@@ -550,16 +550,20 @@
        </el-table-column>
      </el-table> -->
      <el-row style="display: flex; width: 1300px;">
      <el-row style="display: flex; width: 1300px">
        <el-col>
          <div
            style="text-align: center; margin-bottom: 10px; margin-top: 10px"
          >
            项目列表
          </div>
          <el-input placeholder="输入关键字进行过滤" v-model="filterText">
          </el-input>
          <div class="tab3" style="height: 365px;">
          <el-input
            placeholder="输入关键字进行过滤"
            @input="handleFilterInput"
            v-model="queryParams.nr"
            clearable
          />
          <div class="tab3" style="height: 365px">
            <el-tree
              class="filter-tree"
              v-loading="loading"
@@ -580,7 +584,7 @@
              :total="total"
              :page.sync="queryParams.page"
              :limit.sync="queryParams.pageSize"
              @pagination="getDataList"
              @pagination="handlePageChange"
            />
          </div>
        </el-col>
@@ -728,7 +732,11 @@
import { listCategory } from "@/api/mall/category";
import { listKeyword } from "@/api/mall/keyword";
// import { getProParentIdDxList, getProSonDxList } from "@/api/system/tijian";
import { getProParentIdDxList, getProSonDxList } from "@/api/system/package";
import {
  getProParentIdDxList,
  search,
  getProSonDxList,
} from "@/api/system/package";
import {
  getPacList,
  getPacInFo,
@@ -825,6 +833,7 @@
        pageSize: 10,
        pacName: null,
        pacRemark: null,
        nr: "",
      },
      // 表单参数
      form: {
@@ -864,11 +873,11 @@
      },
    };
  },
  watch: {
    filterText(val) {
      this.$refs.tree.filter(val);
    },
  },
  // watch: {
  //   filterText(val) {
  //     this.$refs.tree.filter(val);
  //   },
  // },
  created() {
    this.getList();
@@ -912,6 +921,7 @@
        this.loading = false;
      });
    },
    /** 查询关键字列表 */
    getKeyword() {
      this.loading = true;
@@ -1257,64 +1267,88 @@
    },
    getDataList() {
      this.loading = true;
      getProParentIdDxList(this.queryParams).then((response) => {
        this.Treedata = response.data.list;
        /*  if (this.form.tjProjectList) {
          this.form.tjProjectList.forEach((item) => {
            this.Treedata.forEach((item1) => {
              if (item.proId == item1.proId) {
                this.checkedkey.push(item1.proId);
                this.DataList.push(item1);
                this.DataList.forEach((item1) => {
                  item1.limits = 10;
                  if (item1.limits > 10) {
                    item1.limits = 10; // 强制将值设置为最大值
                  } else if (item1.limits < 0) {
                    item1.limits = 0; // 强制将值设置为最小值
                  }
                  this.updateProPrice(item1); // 更新价格或其他逻辑
                });
              }
            });
          });
        }  */ /* else {
          this.checkedkey.push(this.Treedata[0].proId);
          let proId = this.Treedata[0].proId;
          this.TreedataList = this.Treedata.filter(
            (item) => item.proId == proId
          ); */
        // 将第一个项目添加到 DataList
        // this.TreedataList.forEach((item) => {
        //   this.checkedListkey.push(item.proId);
        //   this.DataList.push(item);
        // });
        /*  getProSonDxList(proId).then((res) => {
            this.TreedataList = res.data.list;
            this.TreedataList.forEach((item) => {
              item.disabled = true;
              this.checkedListkey.push(item.proId);
              this.DataList.push(item);
              this.DataList.forEach((item) => {
                item.propinName = this.Treedata[0].proName;
                item.propinPrice = this.Treedata[0].proPrice;
              });
              this.pics = 0;
              this.DataList.forEach((item) => {
                this.pics += item.proPrice;
              });
            });
          }); */
        // }
      search(this.queryParams).then((response) => {
        this.Treedata = response.data.list; // 更新树形数据
        this.total = response.data.total; // 更新总条数
        this.pics = this.DataList.reduce(
          (total, item) => total + item.priceOrd,
          0
        );
        this.loading = false;
      });
      this.loading = false;
    },
    // getDataList() {
    //   this.loading = true;
    //   getProParentIdDxList(this.queryParams).then((response) => {
    //     this.Treedata = response.data.list;
    //     /*  if (this.form.tjProjectList) {
    //       this.form.tjProjectList.forEach((item) => {
    //         this.Treedata.forEach((item1) => {
    //           if (item.proId == item1.proId) {
    //             this.checkedkey.push(item1.proId);
    //             this.DataList.push(item1);
    //             this.DataList.forEach((item1) => {
    //               item1.limits = 10;
    //               if (item1.limits > 10) {
    //                 item1.limits = 10; // 强制将值设置为最大值
    //               } else if (item1.limits < 0) {
    //                 item1.limits = 0; // 强制将值设置为最小值
    //               }
    //               this.updateProPrice(item1); // 更新价格或其他逻辑
    //             });
    //           }
    //         });
    //       });
    //     }  */ /* else {
    //       this.checkedkey.push(this.Treedata[0].proId);
    //       let proId = this.Treedata[0].proId;
    //       this.TreedataList = this.Treedata.filter(
    //         (item) => item.proId == proId
    //       ); */
    //     // 将第一个项目添加到 DataList
    //     // this.TreedataList.forEach((item) => {
    //     //   this.checkedListkey.push(item.proId);
    //     //   this.DataList.push(item);
    //     // });
    //     /*  getProSonDxList(proId).then((res) => {
    //         this.TreedataList = res.data.list;
    //         this.TreedataList.forEach((item) => {
    //           item.disabled = true;
    //           this.checkedListkey.push(item.proId);
    //           this.DataList.push(item);
    //           this.DataList.forEach((item) => {
    //             item.propinName = this.Treedata[0].proName;
    //             item.propinPrice = this.Treedata[0].proPrice;
    //           });
    //           this.pics = 0;
    //           this.DataList.forEach((item) => {
    //             this.pics += item.proPrice;
    //           });
    //         });
    //       }); */
    //     // }
    //     this.pics = this.DataList.reduce(
    //       (total, item) => total + item.priceOrd,
    //       0
    //     );
    //     this.loading = false;
    //   });
    // },
    handleFilterInput() {
      this.queryParams.page = 1; // 搜索时重置为第一页
      this.getDataList(); // 调用接口获取数据
    },
    // 分页事件
    handlePageChange({ page, pageSize }) {
      this.queryParams.page = page; // 更新当前页
      this.queryParams.pageSize = pageSize; // 更新每页条数
      this.getDataList(); // 调用接口获取数据
    },
    handleCurrentChecked(data, checked, checkedNodes) {
@@ -1330,7 +1364,6 @@
          limits: 10,
          priceNow: data.proPrice,
        });
      } else {
        let index = this.DataList.findIndex(
          (item) => item.proId === data.proId