| | |
| | | <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 |
| | |
| | | :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" |
| | |
| | | > |
| | | {{ item.areaName }} |
| | | </a-select-option> |
| | | </a-select> |
| | | </a-select> --> |
| | | </a-form-item> |
| | | <a-form-item> |
| | | <a-button type="primary" html-type="submit" @click="handleSearch"> |
| | |
| | | |
| | | 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, |
| | | }) |
| | |
| | | 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; |
| | |
| | | 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 = ""; |
| | |
| | | private mounted() { |
| | | this.handleSearch(); |
| | | this.cityData(); |
| | | this.queryUnit(); |
| | | } |
| | | |
| | | private updatedAtRender(text: string) { |