1
lkk
3 天以前 60cb43453ec2c4b07743fd297fc4c69928ff5853
src/views/system/comp/index.vue
@@ -234,7 +234,12 @@
                    :value="dict.value" />
                </el-select>
              </el-form-item>
                <el-form-item label="是否替检" prop="tj">
                <el-select v-model="forms.tj" placeholder="请选择是否替检" style="width: 120px" clearable>
                  <el-option v-for="dict in dict.type.sys_yes_no" :key="dict.value" :label="dict.label"
                    :value="dict.value" />
                </el-select>
              </el-form-item>
              <el-form-item label="年龄段">
                <el-col :span="7">
                  <el-input v-model="forms.ltAge" style="width: 53px" />
@@ -360,7 +365,7 @@
              
              <el-form-item label="项目名称" prop="proName">
                <el-input ref="inputName" v-model="queryParams1.proName" placeholder="请输入项目名称" clearable
                  @keyup.enter.native="handleSearchFor" style="width: 140px" />
                  @keyup.enter.native="handleSearchFor" @clear="handleClearSearch" style="width: 140px" />
              </el-form-item>
              <el-form-item>
                <el-button type="primary" icon="el-icon-search" size="mini" @click="handleSearchFor">搜索</el-button>
@@ -453,7 +458,7 @@
              <el-form-item label="项目名称" prop="proName">
                <el-input ref="inputName" v-model="queryParams1.proName" placeholder="请输入项目名称" clearable
                  @keyup.enter.native="handleSearchFor" style="width: 140px" />
                  @keyup.enter.native="handleSearchFor" @clear="handleClearSearch" style="width: 140px" />
              </el-form-item>
              <el-form-item>
                <el-button type="primary" icon="el-icon-search" size="mini" @click="handleSearchFor">搜索</el-button>
@@ -545,7 +550,7 @@
             
              <el-form-item label="项目名称" prop="proName">
                <el-input ref="inputName" v-model="queryParams1.proName" placeholder="请输入项目名称" clearable
                  @keyup.enter.native="handleSearchFor" style="width: 140px" />
                  @keyup.enter.native="handleSearchFor" @clear="handleClearSearch" style="width: 140px" />
              </el-form-item>
              <el-form-item>
                <el-button type="primary" icon="el-icon-search" size="mini" @click="handleSearchFor">搜索</el-button>
@@ -812,7 +817,7 @@
    "dict_comp_type",
    "dict_data_status",
    "sys_user_sex",
    "reservation_pay_type",
    "reservation_pay_type","sys_yes_no"
  ],
  data() {
    let checkPhoneNum = (rule, value, callback) => {
@@ -1440,7 +1445,7 @@
        });
      }
    },
    handleSearchFor() {
    /* handleSearchFor() {
      // 判断是否为汉字
      const isChineseChar = (char) => /[\u4E00-\u9FA5]/.test(char)
      if (isChineseChar(this.queryParams1.proName)) {
@@ -1455,7 +1460,29 @@
          this.Treedata = response.data;
        });
      }
    }, */
    handleSearchFor() {
      // 判断是否为汉字
      const keyword = this.queryParams1.proName?.trim() || '';
      const isChineseChar = /[\u4E00-\u9FA5]/.test(keyword);
      const query = {
      ...this.queryParams1,
      proName: isChineseChar ? keyword : null,
      pym: isChineseChar ? null : keyword
     };
      getProjectList(query).then((response) => {
          this.Treedata = response.data;
      });
    },
    handleClearSearch() {
      this.queryParams1.proName = '';
      this.queryParams1.pym = null;
      // 重新加载表格数据
      getProjectList({}).then((response) => {
          this.Treedata = response.data;
        });
    },
    // 单项数据获取
    handleChangesingle(selection) {
      console.log(selection,22222222)
@@ -1678,6 +1705,9 @@
      this.title = "分组项目维护";
      this.OnenewpacName = [];
      this.queryParams.price = 0;
      // 清空项目名称搜索框
      this.queryParams1.proName = '';
      this.queryParams1.pym = null;
      this.loading = true;
      if (this.groupList[0]) {
        let id = this.groupList[0].id || '';