quanyawei
2024-09-06 75c45150bcc5b1a3b45efe98ce6ec92b7b10aba3
fix: 责任单位修改
1 files modified
50 ■■■■ changed files
src/views/list/Unit.vue 50 ●●●● patch | view | raw | blame | history
src/views/list/Unit.vue
@@ -5,7 +5,7 @@
        <a-form-item label="名称:">
          <a-input v-model="serch.name" style="width: 200px" />
        </a-form-item>
        <a-form-item label="上级区域:">
        <!-- <a-form-item label="上级区域:">
          <a-cascader
            placeholder="请选择"
            labelInValue
@@ -14,9 +14,19 @@
            :options="parentListOptions"
            @change="positionLevel"
          />
        </a-form-item>
        </a-form-item> -->
        <a-form-item label="所属区域:">
          <a-select
          <a-cascader
            placeholder="请选择"
            v-model="serch.areaCode"
            labelInValue
            multiple
            style="width: 200px"
            :options="parentListOptions"
            @change="belongToRegion"
          />
          <!-- <a-select
            ref="select"
            v-model="serch.areaCode"
            style="width: 200px"
@@ -29,7 +39,7 @@
            >
              {{ item.areaName }}
            </a-select-option>
          </a-select>
          </a-select> -->
        </a-form-item>
        <a-form-item>
          <a-button type="primary" html-type="submit" @click="handleSearch">
@@ -300,14 +310,12 @@
  private handleSearch(): void {
    console.log(this.serch);
    const data = this.serch.parentCode;
    let code = data[data.length - 1];
    const data = this.serch.areaCode;
    let code = data[data.length - 2];
    get("unit/selectUint", {
      name: this.serch.name,
      parentCode: code,
      parentCodeList: this.serch.parentCode,
      areaCode: this.serch.areaCode,
      unitId: data[data.length - 1],
      page: this.pagination.current,
      size: this.pagination.pageSize,
    })
@@ -319,7 +327,10 @@
        console.log(err);
      });
  }
  belongToRegion(val: any) {
    console.log("123", val);
    console.log("123", this.serch.parentCode);
  }
  private handlerTableChange(pagination: any, filter: any, sorter: any): void {
    console.log("pagination", pagination);
    this.pagination.current = pagination.current;
@@ -404,14 +415,30 @@
        lists = lists.replace(/"areaName"/g, '"label"');
        const treeLists = JSON.parse(lists);
        this.parentListOptions = JSON.parse(JSON.stringify(treeLists));
        this.newParentListOptions = JSON.parse(JSON.stringify(treeLists));
      })
      .catch((err) => {
        console.log(err);
      });
  }
  queryUnit() {
    get("/unit/query", {})
      .then((res) => {
        console.log("00000000000000", res);
        let org = res.data.data;
        let lists = JSON.stringify(org);
        lists = lists.replace(/"unitId"/g, '"value"');
        lists = lists.replace(/"unitName"/g, '"label"');
        const treeLists = JSON.parse(lists);
        this.parentListOptions = JSON.parse(JSON.stringify(treeLists));
      })
      .catch((err) => {
        console.log(err);
      });
  }
  private positionLevel(val: any) {
    this.serch.areaCode = "";
    this.editForm.areaCode = "";
@@ -432,6 +459,7 @@
  private mounted() {
    this.handleSearch();
    this.cityData();
    this.queryUnit();
  }
  private updatedAtRender(text: string) {