| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128 |
- <template>
- <div>
- <el-select
- v-model="value"
- placeholder="请选择"
- filterable
- autoComplete = "off"
- :filter-method="filterMethod"
- @change='chooseChange'
- size="mini"
- >
- <el-option
- v-for="item in searchDataList"
- :key="item.id"
- :value="item.id"
- :label="item.pnm"
- >
-
- <span style="float: left">{{ item.pnm }}</span>
- <span style="float: right; color: #8492a6; font-size: 13px" v-if="item.id.length==6">督查机构</span>
- <span style="float: right; color: #8492a6; font-size: 13px" v-if="item.id.length==9">督查批次</span>
- <span style="float: right; color: #8492a6; font-size: 13px" v-if="item.id.length==12">督查组</span>
- </el-option>
- </el-select>
-
-
- </div>
- </template>
- <script>
- import request from '../utils/gw_ajax_request.js';
- import { getVillageList_ny ,submitInsertCun} from "../api/duChaTianBao.js";
- import inuptWithXiang from './inuptWithXiang.vue'
- export default {
- props: ['rootCode','initalValue','orgType'],
- components:{
- 'inuptWithXiang':inuptWithXiang
- },
- data() {
- return {
- dataList: [],
- value: '',
- dialogVisible:false,
- searchDataList:[],
- timeout: null,
- xianlistData:[],
- newCunForm:{
- "adAbbrName": "",
-
- "adFcode": "",
- "adFullName": "",
-
- "adName": "",
-
- },
- }
- },
- computed:{
- userId:function(){
- return localStorage.getItem("userid")? localStorage.getItem("userid"): '1098101939614724096'
- },
- },
- mounted(){
- this.value = this.initalValue;
- console.log(this.value);
- this.getLeftTreeData();
- },
- watch: {
- rootCode:function(){
- this.querySearchAsync();
- },
- initalValue:function(){
- this.value = this.initalValue;
- console.log(this.value);
- this.querySearchAsync();
- }
- },
- methods:{
- getLeftTreeData(){
- var _self = this;
- request.get('/dc/organization/base/getAllNode',{params:{'userId':this.userId,'orgType':this.orgType}}).then((res)=>{
- let data = res.data
- console.log(data);
- this.searchDataList = data;
- // _self.duChaType = _self.treeData[0].id.substring(2,3);
- })
- },
- provTreeSelectChangeHandler:function(params){
- console.log(params)
- this.newCunForm.adFcode = params.code;
- },
-
- chooseChange:function(p){
- console.log(p);
- this.searchDataList.forEach((element) => {
- if(element.id == p){
- console.log(element);
- this.$emit("selectDuChaTreeNode", { 'code':element.id, 'name': element.pnm});
- }
- });
- },
- filterMethod:function(text){
- console.log(text);
- this.value = text;
-
- var _self = this;
- request.get('/dc/organization/base/getAllNode',{params:{'userId':this.userId,'orgType':'001'}}).then((res)=>{
- let data = res.data
- console.log(data);
- let filterResult = [];
- data.forEach((element) =>{
- if(element.pnm.indexOf(text)>=0){
- filterResult.push(element);
- }
- });
- this.searchDataList = filterResult;
- // _self.duChaType = _self.treeData[0].id.substring(2,3);
- })
-
-
- },
-
- },
-
- }
- </script>
- <style>
- </style>
|